Quote the property-name "class" in an object constant.
authorMike Taylor <mike@indexdata.com>
Tue, 1 Apr 2014 12:53:57 +0000 (13:53 +0100)
committerMike Taylor <mike@indexdata.com>
Tue, 1 Apr 2014 12:53:57 +0000 (13:53 +0100)
commit7944ee84c23db40af2b32505463a2afe4a921652
tree500b3d251579934c57b9c13cfe577e3cd9a10de7
parentac1878922c2abfbbfa564548344ae88c3b744198
Quote the property-name "class" in an object constant.

This is in some sense reasonable to require, since "class" is for some
reason a keyword in JavaScript even though it's not used by the
language which doesn't even have classes. Douglas Crockford's book
"JavaScript: The Good Parts" lists 59 reserved words of which maybe
half are actually used in the language. The others include such
tantalising morsels as "interface" and "implements", "package",
"protected" and even "debugger".

In the absence of this quoting, our JavaScript minifier yui-compressor
responds with
Exception in thread "main" java.lang.reflect.InvocationTargetException
then forty levels of completely uninformative stack-trace before
giving up and rather lamely saying "... 5 more".

Is it really too much to ask that a JavaScript parser should respond
to a syntax error with "syntax error: unquoted keyword 'class'"?

Sheesh.
src/mkws-widgets.js