Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Object initializer for complex object( object inside object) #2597

Closed
ghost opened this issue Aug 28, 2015 · 3 comments
Closed

Object initializer for complex object( object inside object) #2597

ghost opened this issue Aug 28, 2015 · 3 comments
Labels
duplicate Issues and PRs that are duplicates of other issues or PRs. v8 engine Issues and PRs related to the V8 dependency.

Comments

@ghost
Copy link

ghost commented Aug 28, 2015

Hi every one. I found next problem:

let notWork = {
    prop1: {
        [prop2]: 'value'
    }
};

is equal to:

{ prop1: {} }

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 ?

@ghost
Copy link
Author

ghost commented Aug 28, 2015

also I verified this in babel and chrome 44 and this example:

let notWork = {
    prop1: {
        [prop2]: 'value'
    }
};

works as expected:

{ prop1: { prop2: 'value' } };

so this is definitely bug.
io.js version 3.0.0
OS centos 7

@rvagg
Copy link
Member

rvagg commented 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.

@rvagg rvagg closed this as completed Aug 28, 2015
@ghost
Copy link
Author

ghost commented Aug 28, 2015

OK) thank a lot for quick response)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate Issues and PRs that are duplicates of other issues or PRs. v8 engine Issues and PRs related to the V8 dependency.
Projects
None yet
Development

No branches or pull requests

2 participants