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

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

@jeremylynch

Description

@jeremylynch

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions