You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Version: v5.9.1 Platform: Linux mymachine 3.16.0-62-generic #83~14.04.1-Ubuntu SMP Fri Feb 26 22:52:39 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
Expected: Default and destructured parameters can be combined without error (as they can be in the latest version of Chrome)
Actual: Using both results in a ReferenceError
Steps to reproduce:
Start Node with some harmony flags: node --harmony --harmony_default_parameters --harmony_destructring
Enter this line of code (({foo}={}) => {console.log(foo);})({foo: 'baz'});
// Human-friendly version
function logFooProperty({foo}={}) {
console.log(foo);
};
logFooProperty({foo: 'baz'} );`
Get an error: ReferenceError: Invalid left-hand side in assignment at Object.exports.createScript (vm.js:24:10) at REPLServer.defaultEval (repl.js:233:25) at bound (domain.js:287:14) at REPLServer.runBound [as eval] (domain.js:300:12) at REPLServer.<anonymous> (repl.js:429:12) at emitOne (events.js:95:20) at REPLServer.emit (events.js:182:7) at REPLServer.Interface._onLine (readline.js:211:10) at REPLServer.Interface._line (readline.js:550:8) at REPLServer.Interface._ttyWrite (readline.js:827:14)
Currently both default and destrctured parameters work on their own:
(({foo}) => {console.log(foo);})({foo: 'baz'}); // works
((options={}) => {console.log(options.foo);})({foo: 'baz'});
and the two can be combined in Chrome without error, so it seems as though Node (when started with the appropriate harmony flags) should also be able to combine the two without error.
The text was updated successfully, but these errors were encountered:
And yeah, while I understood that these were experimental features I still thought you might want bug reports on them. But if all that code is going away soon then there's certainly no need.
It'll work in v6 (just tested it), coming likely end of this month. You can run pretty much all ES2015 features (except modules) without flags with the next coming major version.
If you are interested check out the vee-eight-v5.0 branch.
@dnalborczyk: while I would love to check out that branch, I have to share a codebase with others (who will get annoyed at me if I check in code that doesn't work for them), so I'll hold out for the official release. Thanks for the update though!.
Version: v5.9.1
Platform: Linux mymachine 3.16.0-62-generic #83~14.04.1-Ubuntu SMP Fri Feb 26 22:52:39 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
Expected: Default and destructured parameters can be combined without error (as they can be in the latest version of Chrome)
Actual: Using both results in a
ReferenceError
Steps to reproduce:
Start Node with some harmony flags:
node --harmony --harmony_default_parameters --harmony_destructring
Enter this line of code
(({foo}={}) => {console.log(foo);})({foo: 'baz'});
ReferenceError: Invalid left-hand side in assignment
at Object.exports.createScript (vm.js:24:10)
at REPLServer.defaultEval (repl.js:233:25)
at bound (domain.js:287:14)
at REPLServer.runBound [as eval] (domain.js:300:12)
at REPLServer.<anonymous> (repl.js:429:12)
at emitOne (events.js:95:20)
at REPLServer.emit (events.js:182:7)
at REPLServer.Interface._onLine (readline.js:211:10)
at REPLServer.Interface._line (readline.js:550:8)
at REPLServer.Interface._ttyWrite (readline.js:827:14)
Currently both default and destrctured parameters work on their own:
and the two can be combined in Chrome without error, so it seems as though Node (when started with the appropriate harmony flags) should also be able to combine the two without error.
The text was updated successfully, but these errors were encountered: