GeezerVison is showing github.com — Object initializer for complex object( object inside object) · Issue #2597 · nodejs/node
Object initializer for complex object( object inside object) #2597
Labels
duplicateIssues and PRs that are duplicates of other issues or PRs.v8 engineIssues and PRs related to the V8 dependency. Description
Hi every one. I found next problem:
let notWork = {
prop1: {
[prop2]: 'value'
}
};
is equal to:
on the other hand this construction:
let workFine = {
['prop1']: {
['prop2']: 'value'
}
};
work fine:
{ prop1: { prop2: 'value' } };
I didn't find any descriptions for complex object in specification.
Can I initialize objects like in first example or this is a bug ?
Activity
rvagg commented on Aug 28, 2015
That nested case is weird, however, this is essentially a dupe of #2507 and is not something we can address while V8 4.4 is still being maintained upstream. It may be fixed by patching V8 later but that's still to be decided. I suggest you just don't use this feature with versions of Node / io.js that are shipping with V8 4.4.
Metadata
Metadata
duplicateIssues and PRs that are duplicates of other issues or PRs.v8 engineIssues and PRs related to the V8 dependency. Development
No branches or pull requestsIssue actions