Add support for spread syntax
See original GitHub issueThis is supported natively in Node.js v8 and v10.
h3. Steps to reproduce
See GitHub repo with demo
$ git clone https://github.com/leedm777/power-spread.git
$ cd power-spread
$ node --version
v8.11.1
$ npx mocha
spread operator
✓ should work
1 passing (6ms)
$ npx mocha --require intelli-espower-loader
/Users/dlee/prj/tmp/power-spread/node_modules/espower-source/index.js:165
var err = new SyntaxError(detail);
^
SyntaxError:
1: const assert = require('assert');
2:
3: describe('spread operator', () => {
4: it('should work', () => {
5: const obj = { a: 1, b: 2 };
6: const actual = { ...obj, c: 3 };
^
7: assert.deepStrictEqual(actual, { a: 1, b: 2, c: 3 });
8: });
9: });
10:
Parse Error: Unexpected token (6:21) in /Users/dlee/prj/tmp/power-spread/test/spread.js
h3. Expected results
mocha --require intelli-espower-loader
should parse and execute the tests.
h3. Actual results
Fails to parse the spread operator.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:1
- Comments:6 (4 by maintainers)
Top Results From Across the Web
Spread syntax (...) - JavaScript - MDN Web Docs - Mozilla
In an object literal, the spread syntax enumerates the properties of an object and adds the key-value pairs to the object being created....
Read more >An introduction to Spread syntax in JavaScript - freeCodeCamp
Spread syntax allows an iterable such as an array expression or string to be expanded in places where zero or more arguments (for...
Read more >How to Use the Spread Operator (…) in JavaScript - Medium
The spread operator is a useful and quick syntax for adding items to arrays, combining arrays or objects, and spreading an array out...
Read more >Rest parameters and spread syntax
The spread syntax is used to pass an array to functions that normally require a list of many arguments. Together they help to...
Read more >The Practical Usages of JavaScript Spread Operator
The spread operator unpacks elements of iterable objects such as arrays, sets, and maps into a list. The rest paramter is also denoted...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Just released as power-assert 1.6.0, thank you for reporting @leedm777 !
@leedm777 Thank you for reporting! I’ll update parser soon so wait a moment.