4 ms·
Strict Mode Is Coming To Town
- sayrer 16y agoCurrent state of support for strict mode: WebKit nightly: yes Firefox 4 nightly: yes Chromium Nightly: no Opera 10.6: no IE9 beta: no
- aphexairlines 16y agoTo be followed by use warnings, use integer, use bytes, use 5.008, etc.
- tzs 16y agoIf only they would add "use Lua"...
- j_baker 16y agoSemi-unrelated: I don't understand the note at the bottom or the linked document about the XSS problem. Is there actually a way to prevent XSS that's under consideration?
- j4mie 16y ago"The arguments pseudo array becomes a little bit more array-like in ES5. In strict mode, it loses its callee and caller properties." Anyone know what replaces this? How would I write this (stupid code that would eventually blow the stack) without arguments.callee? (function () { console.log("hello world"); setTimeout(arguments.callee, 1000); })();
- davnola 16y agoIt looks like you're forced to use a named lambda.
- sharkbrainguy 16y ago(function foo() { console.log("hello world"); setTimeout(foo, 1000); })();
- drdaeman 16y ago> In C, an extremely unfortunate representation of octalness was selected: Leading zero. So in C, 0100 means 64, not 100, and 08 is an error, not 8. Even more unfortunately, this anachronism has been copied into nearly all modern languages, including JavaScript, where it is only used to create errors. I've never tripped on 0100 != 100 (and never heard of anyone who did — every programmer I've talked to knew leading zero has special meaning), but this "anachronism" allowed me to conveniently write `fs.chmod(path, 0640, cb);`. Thank you, ECMA, for pointless runtime calculations with `parseInt("0640", 8)`.
- __david__ 16y agoAgreed, they should at least replace it with 0o777 or something. While they're at it I wouldn't mind 0b10101 notation either. Considering javascript as a browser only language is shortsighted, especially given the existence of things like Node.js.
- cpeterso 16y agoWhen would someone actually want to use octal literals in a C program? I never understood why C has this "feature". In contract, binary literals would have actually been useful. EDIT: After RTFA'ing, I see that octal was useful for hardware with 60 bit words.