Skip to content

Creating errors breaks in Safari (strict mode) #1284

@mgh

Description

@mgh

Creating an Error and assigning to the column property breaks on the latest mobile and desktop Safari. Removing "use strict" in esprima is a workaround, but seems like not the ideal solution.

Relevant line:
https://github.com/jquery/esprima/blob/master/esprima.js#L2395

Test case:

(function () { "use strict"; var e = new Error(); e.column = 1; })();

--> TypeError: Attempted to assign to readonly property.

The effect is that esprima.parse on invalid code throws the above TypeError rather than the expected SyntaxError in Safari.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions