closure-compiler icon indicating copy to clipboard operation
closure-compiler copied to clipboard

A JavaScript checker and optimizer.

Results 180 closure-compiler issues
Sort by recently updated
recently updated
newest added

Consider the snippet ```javascript /** @const {string} */ const Str1 = "a".repeat(10); /** @const {string} */ const Str2 = "a".padEnd(10, "a"); /** @const {string} */ const Str3 = "a".at(0); /**...

I'd like to have an annotation to declare an intent that a function will not have side effects. In the presence of this annotation, I'd like the compiler to warn...

help wanted
feat

When compiling a Function to be called from External code, and declaring the Function in the @externs file so it will be retained without being renamed, this works fine for...

```js function foo() { let c = 3; switch (c) { case 4: let c = 5; break; } } ``` Expected: should be accepted Actual: JSC_REFERENCE_BEFORE_DECLARE_ERROR: Illegal variable reference...

ES6
P3

It can cause some conflicts when you depend on both `closure-compiler-unshaded` and `jakarta.annotation-api` directly or through other dependencies. I would have expected it to be a dependency, along with the...

When using ADVANCED optimizations this happens. ```java.lang.RuntimeException: INTERNAL COMPILER ERROR. Please report this problem. Dataflow analysis appears to diverge around: WHILE 28288:118 [length: 315922] [source_file: classes.js] Node(FUNCTION ESU): classes.js:28288:0 function...

STR: `a.py` ```py import subprocess subprocess.run(['npx', 'google-closure-compiler','--charset=UTF8','--js','a.js','--js_output_file','o.js'], encoding='utf-8', stderr=subprocess.PIPE, shell=True) ``` `a.js` ```js if (4 == NaN) console.log('á'); ``` generates an error ``` C:\emsdk\emscripten\main>python a.py Traceback (most recent call last):...

I have a templated interface, a class which implements the interface, and a little driver app file: `ifoo.js`: ```javascript goog.module('IFoo'); /** * @interface * @template T */ class IFoo {...

## Inline Case (working) This has the typedef inline in a single file: ```javascript /** * @typedef {function(!string, number):string} */ let Foo; /** * @type {Foo} */ const impl =...

test.js: ``` var x = 1; var z = function () { var y = x; var x = 0; return y; }(); console.log(z); ``` Observed behavior: ``` $ node...