From 7944ee84c23db40af2b32505463a2afe4a921652 Mon Sep 17 00:00:00 2001 From: Mike Taylor Date: Tue, 1 Apr 2014 13:53:57 +0100 Subject: [PATCH] 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 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mkws-widgets.js b/src/mkws-widgets.js index 3a24b0e..19789bd 100644 --- a/src/mkws-widgets.js +++ b/src/mkws-widgets.js @@ -2,7 +2,7 @@ function widget($, team, type, node) { // Static register of attributes that do not contribute to config var ignoreAttrs = { - id:1, class:1, style:1, name:1, action:1, type:1, size:1, + id:1, 'class':1, style:1, name:1, action:1, type:1, size:1, value:1, width:1, valign:1 }; -- 1.7.10.4