closure-compiler
closure-compiler copied to clipboard
A JavaScript checker and optimizer.
Consider A: ```js function foo(timeStamp) { console.log(timeStamp); } function emscripten_request_animation_frame_loop(cb) { function tick(timeStamp) { cb(timeStamp); requestAnimationFrame(tick); } requestAnimationFrame(tick); } emscripten_request_animation_frame_loop(foo); ``` this minifies down to 1: ```js (function(a){function b(c){a(c);requestAnimationFrame(b)}requestAnimationFrame(b)})(function(a){console.log(a)}); ```...
I believe the output from advanced mode could be (mildly) optimised from `var a;a=window.setTimeout;` to `var a=window.setTimeout;` without causing any issues. The full input file was: ``` // ==ClosureCompiler== //...
Filing off of https://groups.google.com/g/closure-compiler-discuss/c/rhAsFdwsnmQ so that this shows up in our bug scrub meeting. (and so that someone more familiar with SourceMapConsumerV3 than me will look at it) Here's Kyle's...
It would be great for Node module resolution to *just work*, without extra arguments. Right now, you need `--module_resolution NODE` which does nothing unless `--process_common_js_modules` is also passed, and even...
When I POST a request to https://closure-compiler.appspot.com/compile with "rewrite_polyfills=false" included, it appears to be ignored. `["output_format=json", "compilation_level=SIMPLE_OPTIMIZATIONS", "language=ECMASCRIPT8", "rewrite_polyfills=false", "output_info=compiled_code", "output_info=statistics", "output_info=errors", "output_info=warnings", "code_url=https://"]` Same behavior when I try using...
In this scenario: ``` class BaseClass { /** @nocollapse */ static getSomething() {} } class SubClass { /** @override */ static getSomething() {} } ``` The `SubClass`'s `getSomething` static method...
With Closure Compiler v20210106 and the following flags: ```lang-none --language_in=ECMASCRIPT_NEXT --compilation_level ADVANCED --js tmp/wrap.js ``` This works fine: ```javascript /** * @param {string} str * @param {string} [prefix=aa] * @param...
Repeating from the comment at https://github.com/google/closure-compiler/pull/3730#pullrequestreview-585356152. At https://github.com/google/closure-compiler/pull/3730 the DOMMatrix externs were added. According to the [specification](https://www.w3.org/TR/geometry-1/#dommatrix) the `init` constructor parameter should be marked as optional. 
It is now possible to output `ES_2017` code, and in future we would really prefer to stay more on top of the output language level. Currently the default output language...
Current [`Set` conformance check](https://github.com/google/closure-compiler/blob/6339e96d57bee2217f0251d593f69b75d71320a0/src/com/google/javascript/jscomp/js/es6/set.js#L36) forces polyfill for `Set`, but will keep [original `Array.from`](https://github.com/google/closure-compiler/blob/6339e96d57bee2217f0251d593f69b75d71320a0/src/com/google/javascript/jscomp/js/es6/array/from.js#L20) in Firefox 32-36. These versions use `set["@@iterator"]` instead of `set[Symbol.iterator]` which leads to `Array.from(new Set("a"))` to be...