Closure-compiler: "arguments.callee" cannot be used in strict mode while passing --jscomp_off=es5Strict

Created on 8 Jul 2018  路  2Comments  路  Source: google/closure-compiler

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

Most helpful comment

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.

All 2 comments

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.

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.
Was this page helpful?
0 / 5 - 0 ratings