Skip to content
This repository has been archived by the owner on Jun 10, 2018. It is now read-only.

ExecJS::ProgramError: Unexpected token: name (key) #199

Open
jeremylynch opened this issue Apr 11, 2016 · 0 comments
Open

ExecJS::ProgramError: Unexpected token: name (key) #199

jeremylynch opened this issue Apr 11, 2016 · 0 comments

Comments

@jeremylynch
Copy link

The following code is raising this error: ExecJS::ProgramError: Unexpected token: name (key)

var key = 'dummy',
    plugin = {};

plugin.variables = {
    [key + '1']: "1",
    [key + 'Ctrl-2']: "2",
};

However this code does not:

var key = 'dummy',
    plugin = { variables: {} };

plugin.variables[key + '1'] = "1";
plugin.variables[key + 'Ctrl-2'] = "2",

I understand that the former is ES6 compatible and the latter is ES5 compatible. Is this the reason I am getting the error?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant