Skip to content

using variable called "arguments" makes strict mode fail #4

@simon-lang

Description

@simon-lang

In JS "arguments" is a reserved word (kind of) that refers to the current function's arguments. Like argv.

If you have a 'use strict' at the top of your file, you'll get this error:

Uncaught SyntaxError: Unexpected eval or arguments in strict mode

I noticed this because I was combining this file and the userapp angular module with uglify. Since they have their 'use strict' declaration outside of their closure it gets hoisted to the top and breaks this module.

Anyway, it is easily fixed by renaming every usage of "arguments" in your codebase to "args". Worked fine for me locally.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions