#3017 closed defect (invalid)
ShrinkSafe / Rhino does not support object literals named "class"
Reported by: | guest | Owned by: | anonymous |
---|---|---|---|
Priority: | high | Milestone: | |
Component: | General | Version: | 0.4.2 |
Keywords: | Cc: | ||
Blocked By: | Blocking: |
Description
Hello,
"""
cat testjs.js
var v = {class: "foo"};
java -jar custom_rhino.jar testjs.js
js: "testjs.js", line 1: l'identifiant de propriÚtÚ est incorrect js: var v = {class: "foo"}; js: .............. js: "testjs.js", line 1: Compilation produced 1 syntax errors. """
The error being "invalid property identifier".
This is probably a Rhino issue but you will probably handle it better than I could. I have seen nothing about that in Rhino bug tracker. Or maybe, "class" property is actually forbidden in Javascript...
-- pmezard /at/ gmail /dot/ com
Note: See
TracTickets for help on using
tickets.
class is a reserved word in JavaScript?. If you do the following, it will work:
var v = {"class": "foo"};
though that might not be ideal for you, because then you would always have to use vclass? syntax instead of v.class.