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 258901 - False warning about missing semicolon in destructuring assignments
Summary: False warning about missing semicolon in destructuring assignments
Status: RESOLVED FIXED
Alias: None
Product: javascript
Classification: Unclassified
Component: Editor (show other bugs)
Version: 8.2
Hardware: PC Linux
: P3 normal (vote)
Assignee: Petr Hejl
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-04-19 09:22 UTC by Petr Pisl
Modified: 2016-04-27 10:06 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Petr Pisl 2016-04-19 09:22:13 UTC
case 1:

var foo = ["one", "two", "three"];

var [one, two, three] = foo; //<- false warning here
console.log(one); // "one"
console.log(two); // "two"
console.log(three); // "three"  // <- false warning here, if it's the last eof


case 2:

function f() {
  return [1, 2, 3];
}

var [a, , b] = f(); // <- false warning here
console.log(a); // 1
console.log(b); // 3

[,,,] = f(); // <- false warning here


case 3:

var o = {p: 42, q: true};
var {p, q} = o;   // <- false warning here

console.log(p); // 42
console.log(q); // true 


case 4:

var {p: foo, q: bar, w: abc} = {p: 5, q:7};     // <- false warning here
          
console.log(foo); // 5   
console.log(bar); // 7  
console.log(abc); // undefined


case 5:

function drawES6Chart({size = 'big', cords = { x: 0, y: 0 , z: 0}, radius = 25} = {}) {   // <- false warning here
  console.log(size, cords, radius);
  console.log(cords.x, cords.y);       
  
  var blbost = "aoj";  
}
Comment 1 Petr Hejl 2016-04-26 13:56:55 UTC
Case 1 eof fixed in web-main 027b55881011.
Comment 2 Petr Hejl 2016-04-26 14:48:58 UTC
Most of the cases fixed in web-main 522b53b60675. The only remaining is case 2 [,,,].
Comment 3 Petr Hejl 2016-04-27 10:06:38 UTC
The last case fixed in web-main c90af13e6937.