This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 147817 - syntax coloring of JavaScript 1.7 let statements/expressions/definitions
Summary: syntax coloring of JavaScript 1.7 let statements/expressions/definitions
Status: RESOLVED FIXED
Alias: None
Product: javascript
Classification: Unclassified
Component: Editor (show other bugs)
Version: 6.x
Hardware: All All
: P2 blocker with 1 vote (vote)
Assignee: Petr Pisl
URL:
Keywords:
: 147679 (view as bug list)
Depends on:
Blocks:
 
Reported: 2008-09-22 01:42 UTC by brettz9
Modified: 2016-06-21 13:05 UTC (History)
1 user (show)

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description brettz9 2008-09-22 01:42:49 UTC
The let statement (and let expressions and definitions) introduced in Mozilla's JavaScript 1.7 is not recognized for
coloring:

For example: http://developer.mozilla.org/en/New_in_JavaScript_1.7#Block_scope_with_let

 let (x = x+10, y = 12) {  
   print(x+y + "\n");  
 }

There are also a few other JavaScript constructs (which I haven't already reported) which were introduced in the later
JavaScript versions that also don't work with JavaScript syntax coloring in NetBeans:
Generators: http://developer.mozilla.org/en/New_in_JavaScript_1.7
Expression closures and Generator expressions: http://developer.mozilla.org/en/New_in_JavaScript_1.8
Comment 1 Torbjorn Norbye 2008-09-22 19:56:53 UTC
Correct, that's new in JavaScript 1.7 and unfortunately not yet supported by our parser. We're way past feature freeze
for 6.5 (we're entering high resistance in a day or two) so this will have to wait for the next release. There's no
target milestone for that in the issue tracker yet so marking it future.
Comment 2 Torbjorn Norbye 2008-09-22 20:01:28 UTC
Actually, I'm changing this to a task for the next release instead of a bug in the current release, and assigning it a
higher priority. I noticed you filed a couple of other issues on JavaScript 1.7 stuff; I will make those issues
duplicates of this one. (I will update the parser to all the JS 1.7 features at the same time, not piecemeal.)
Comment 3 Torbjorn Norbye 2008-09-22 20:01:54 UTC
*** Issue 147679 has been marked as a duplicate of this issue. ***
Comment 4 Torbjorn Norbye 2008-09-22 20:02:13 UTC
*** Issue 147680 has been marked as a duplicate of this issue. ***
Comment 5 brettz9 2008-09-23 01:43:53 UTC
Ok, thanks, that'd be great. 

There is also JavaScript 1.8, though in the code I've worked with so far, I personally haven't come across its features,
though of course it'd be nice to have.

Regardless of whether you want to group that as a bug with this one, file a second one, or ignore it for now, this page
on JavaScript 1.8 also mentions the fixing of a bug in the handling of one of the features added in JavaScript 1.7,
destructuring of arrays): http://developer.mozilla.org/en/docs/New_in_JavaScript_1.8
Comment 6 Torbjorn Norbye 2008-12-01 01:47:45 UTC
This is fixed now -- JavaScript 1.7 support is in 7.0.

Now we need a new issue tracking JavaScript 1.8 support :)

Comment 7 brettz9 2008-12-26 08:13:09 UTC
Just to verify you were aware of this also... JavaScript 1.7 with destructuring arrays, also allows the "var" keyword:

var [a, b, c] = getArray();

thanks...
Comment 8 Torbjorn Norbye 2008-12-27 00:45:49 UTC
Is there a problem with the var [a, b, c] = getArray(); form? I'm not seeing any errors for that in my build.
Comment 9 brettz9 2008-12-27 01:33:10 UTC
I was just reporting it in case your fix hadn't addressed it. I haven't worked any builds since 6.5.
Comment 10 brettz9 2009-01-11 07:13:10 UTC
Actually I do see a problem (though not an error) when adding the var keyword before a destructured assignment...
Subsequent references to variables assigned in this way are colored by the editor as though they were global variables,
even though "var" should be making them local...
Comment 11 fmorshed 2016-04-14 14:34:21 UTC
I see that this issue has not been touched for a few years!  When will it be addressed?  We are considering to use "let", and lack of support in NB editor is one impediment.
Comment 12 Petr Pisl 2016-04-15 09:04:16 UTC
There are some features of EcmaScript 6 already implemented. See more issue #242387. In the fact, it's already done, but we are waiting for approval to put the grall parser into the build.
Comment 13 Christian Lenz 2016-06-21 11:49:08 UTC
I think this ticket is obsolete, because of the new support von ES6 in Netbeans. :) Just to let you know.
Comment 14 Petr Pisl 2016-06-21 13:05:32 UTC
The ES6 features are in trunk now.