isaacs / natives

Do stuff with Node.js's native JavaScript modules
31 stars 9 forks source link

Instead of being a noop on buffer, throw an error #6

Closed ChALkeR closed 8 years ago

ChALkeR commented 8 years ago

The user is definitely not getting what they want for that one, and it would most likely be better to just throw an error than to silently try doing some thing that is definitely other than what the user wanted.

isaacs commented 8 years ago

Yeah, except then nothing works. So no. The caveat in the docs is enough.

ChALkeR commented 8 years ago

@isaacs There is no reason to use require('natives').require('buffer') over require('buffer') — both do the same thing, and the user might not expect that. It's not clearly noted in the docs.

require('natives').require('buffer') looks like it works — it returns something sensible, but its actually just what require('buffer') does, not a separate copy which the user wanted.