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

"arguments.callee" cannot be used in strict mode while passing --jscomp_off=es5Strict #3014

Open
martijnlentink opened this issue Jul 8, 2018 · 2 comments

Comments

@martijnlentink
Copy link

When I am trying to compile a single file that contains a call to arguments.callee.name I get an error "arguments.callee" cannot be used in strict mode while passing. When I pass the argument --jscomp_off=es5Strict I see no difference.

Is don't think this is by design, right?

My command;
java -jar "res\closure-compiler-v20180610.jar" --compilation_level SIMPLE --js "C:\test.js" --js_output_file "C:\test.min.js" --define='IS_DEBUG=false' --jscomp_off=es5Strict --jscomp_off=unknownDefines

@lauraharker
Copy link
Contributor

You need to pass in

--strict_mode_input=false

Otherwise the compiler overrides --jscomp_off=es5Strict here.

AFAIK this is intentional, but missing documentation. Probably need to update https://github.com/google/closure-compiler/wiki/Warnings.

@lauraharker
Copy link
Contributor

I think it might be even clearer to throw an error for --jscomp_off=es5Strict instead of silently setting the error level. I'll update the documentation for now, and try to land a change that

  1. removes es5Strict from the wildcard warnings (so --jscomp_off=* won't affect es5Strict)
  2. throws an error when someone sets --jscomp_off=es5Strict while still having strict mode input.

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

No branches or pull requests

2 participants