Export to GitHub

js2-mode - issue #90

syntax highlighting breaks for object attributes named "class"


Posted on Aug 18, 2008 by Helpful Rabbit

What steps will reproduce the problem?

with dojo JS toolkit you often do thins like this:

var myTree = new dijit.Tree({ id: "myTree", model: myModel, dndController: "dijit._tree.dndSource", class:"container" })

What is the expected output? What do you see instead?

I expect syntax highlighting to work, but js2-el it doesn't like the "class" property.

What version of the product are you using? On what operating system?

  • using trunk of js2-el and trunk of aquamacs

Please provide any additional information below.

Comment #1

Posted on Oct 5, 2008 by Grumpy Kangaroo

Class is a reserved word in javascript, but the mini-buffer error string doesn't appear to be correct.

"missing ; before statement"

Comment #2

Posted on Oct 8, 2008 by Grumpy Kangaroo

Now that I think about it, I think the mode was originally written to support Javascript 2.0 which was going in the direction of supporting more traditional inheritance through the use of classes, but it seems that this plan is no longer going forward (google javascript harmony for more info).

I bet the parser looks for Classes as they were defined in a 2.0 spec.

Status: New

Labels:
Type-Defect Priority-Medium