News for hackers. Stuff that matters.
Re:Chrome Developer Tools: Back to Basics by threepointone on Thursday February 24, 2011 @05:07PM (#2260040)
Citation needed, please. I keep reading this note that $ and _ are reserved, but I haven't really seen a reference. Besides, _ and $ are not reserved keywords (unlike, say, 'class').
Re:Chrome Developer Tools: Back to Basics by selectnull on Thursday February 24, 2011 @05:24PM (#2260098)
Ecmascript 262, 3rd edition, section 7.6 http://www.ecma-international.org/publications/files/ECMA-ST...

"This standard specifies one departure from the grammar given in the Unicode standard: The dollar sign ($) and the underscore (_) are permitted anywhere in an identifier. The dollar sign is intended for use only in mechanically generated code."

It was removed (or I can't find it) in 5th edition. Also, I can't find a reference for underscore.

Re:Chrome Developer Tools: Back to Basics by threepointone on Thursday February 24, 2011 @07:56PM (#2260547)
[edit: read that you said it was removed in the 5th edition. makes the rest of this comment invalid, I guess]

You delivered! Thank you for the effort.

This what that section says - "The dollar sign ($) and the underscore (_) are permitted anywhere in an identifier. The dollar sign is intended for use only in mechanically generated code."

This seems contradictory. Do they mean to say that $ (only $, not $x) is intended for use in mechanically generated code? Doesn't that make variables $0 [and so on] actually valid? And if not, then doesn't that makes $0 an invalid variable. Finally, why don't javascript interpreters throw an error when you try to name a variable $? Is there a reason they're ALL (v8, nitro, spidermonkey) lax to the ecma standard?

All a little confusing, but trivial enough to ignore, I suppose...

[Also, this somewhat validates my choice of using underscore.js + mixins for my code. sweet.]