Wouldn't a global strict mode cause indeterminate behavior in modules not tested for ES5 compliance?
Cheers, Adam Crabtree On Wed, Mar 13, 2013 at 10:18 AM, Ben Noordhuis <[email protected]> wrote: > On Wed, Mar 13, 2013 at 6:03 PM, AJ ONeal <[email protected]> wrote: > > Perhaps the very best part of node v0.10.0 is that all of the core > modules > > are finally fully ES5 compliant!!! > > > > Although, you can't use es5-compliant mode with a shebang > > (because you can't pass the --use_strict argument), > > so I made a shim that will run node in es5 (strict) mode for you. [0] > > > > Install > > > > sudo npm install -g node-es5 > > > > Usage > > > > #!/usr/bin/env node-es5 > > > > (P.S. Dear core devs: please provide a native cli for strict mode node) > > > > Except in the case that you're writing code that also runs in the > browser, > > you can now skip the obligatory > > > > (function () { > > "use strict"; > > > > // code goes here > > }()); > > > > Not that there's any harm in putting it in... but it's just annoying. > > > > You can also take out `strict: true` from your `.jshintrc` for your node > > projects. (An `implicitstrict` option may come soon [1]). > > > > Anyway, this is certainly a GIANT step forward in eliminating the > excuses of > > using bug-prone ES3 code. > > > > Hurrah to the Node Devs! > > > > AJ ONeal > > > > [0]: https://github.com/coolaj86/node-es5 > > [1]: https://github.com/jshint/jshint/issues/924 > > AJ, am I missing something? > > #!/path/to/node --use_strict > console.log('Hello, world.'); > > You're saying that doesn't work for you? > > -- > -- > Job Board: http://jobs.nodejs.org/ > Posting guidelines: > https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines > You received this message because you are subscribed to the Google > Groups "nodejs" group. > To post to this group, send email to [email protected] > To unsubscribe from this group, send email to > [email protected] > For more options, visit this group at > http://groups.google.com/group/nodejs?hl=en?hl=en > > --- > You received this message because you are subscribed to the Google Groups > "nodejs" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > For more options, visit https://groups.google.com/groups/opt_out. > > > -- Better a little with righteousness than much gain with injustice. Proverbs 16:8 -- -- Job Board: http://jobs.nodejs.org/ Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines You received this message because you are subscribed to the Google Groups "nodejs" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/nodejs?hl=en?hl=en --- You received this message because you are subscribed to the Google Groups "nodejs" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/groups/opt_out.
