(no title)
Ramone
|
14 years ago
I think the argument that we shouldn't rely on the parser for certain language features is a bit silly (including interpreting end-of-statements). The language is precisely what the parser says it is, and nothing more or less. JSMin is free to not do what the parser does of course, but that won't be Javascript.
EvilTerran|14 years ago
"The parser is the spec" is a nasty design smell, IMO.
jmount|14 years ago
ktizo|14 years ago
If he wants his code to work with this particular minifier, he should include the semicolon, nothing more, nothing less.
Is a bit like trying to speak in official french. It might be correct according to the officials charged with protecting the french language, but you will sound extremely odd to most french people.
wpietri|14 years ago
First, there's no "the parser". There are a lot of parsers, some of which don't yet exist.
Second, that means there's no way to distinguish between bugs and features. If the language is defined by parser behavior, then any parser bug is now part of the language.
Third, you've eliminated the white space needed for future growth. If you look at any standard that has evolved well over a period of years, you can see in the early days there was a lot left undefined. If the implementation is the spec, then nothing can be treated as open for change.
blasdel|14 years ago
the problem was that jsmin didn't just violate the spec — it's not a javascript implementation at all, but rather a pile of naive textual replacements