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

```js /** * @suppress{checkTypes, duplicate, const} */ var WebAssembly = {}; ``` ``` $ google-closure-compiler --compilation_level ADVANCED_OPTIMIZATIONS --language_in ECMASCRIPT_2020 --language_out NO_TRANSPILE --emit_use_strict=false --js a.js --js_output_file tmp5qadu4_7.cc.js --formatting PRETTY_PRINT externs.zip//webassembly.js:29:18: WARNING...

Consider the code: ```javascript /** @const {!Array} */ const a = [1]; /** @const {!Array} */ const b = Array(10); b[0] = 2; /** @const {!Array} */ const c =...

help wanted
good first issue
P4
feat

I think this looks like a bug in the compiler, see the minimal test case below. The function parameter has a default, so it may never be "undefined" and the...

When compiling apache/arrow with the latest closure compiler on node 16 and Debian, we get this error ``` [03:34:57] Error: gulp-google-closure-compiler: /arrow/js/node_modules/google-closure-compiler-linux/compiler: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.32' not found (required by /arrow/js/node_modules/google-closure-compiler-linux/compiler)...

Version: From at least mid 2022 up to latest. compilation_level ADVANCED language_out ECMASCRIPT_2020 rewrite_polyfills false With ES2020 and up, using `{x:foo, ...bar}` causes this to be added to the head:...

`rewrite_polyfills= false` still inject polyfills when language_out is below ECMASCRIPT_2017 for async function # step to reproduce 1. echo 'export async function test(){console.log('test');}'> my_program.js 2. npx google-closure-compiler --js=my_program.js --js_output_file=out.js --rewrite_polyfills=false...

[Reproduction](https://closure-compiler-debugger.appspot.com/#input0%3D%252F**%250A%2520*%2520%2540template%2520T%250A%2520*%2520%2540param%2520%257BT%257D%2520input%250A%2520*%2520%2540return%2520%257BT%257D%250A%2520*%252F%250Afunction%2520identity(input)%2520%257Breturn%2520input%257D%253B%250A%250A%252F**%2520%2540typedef%2520%257Btypeof%2520identity%257D%2520*%252F%250Avar%2520Identity%253B%250A%250Avar%2520%252F**%2520Identity%253Cnumber%253E%2520*%252F%2520f%253B%250A%250Aconst%2520%252F**%2520null%2520*%252F%2520_%2520%253D%2520f%253B%250A%26input1%26conformanceConfig%26externs%26refasterjs-template%26CHECK_TYPES%3Dtrue%26REWRITE_MODULES_BEFORE_TYPECHECKING%3Dtrue%26CLOSURE_PASS%3Dtrue%26PARSE_TYPE_ANNOTATIONS%3Dtrue%26PRETTY_PRINT%3Dtrue): ```JS /** * @template T * @param {T} input * @return {T} */ function identity(input) {return input}; /** @typedef {typeof identity} */ var Identity; var /** Identity */ f;...

The compiler's definition of this function requires one or more streams, and differs from [MDN](https://developer.mozilla.org/en-US/docs/Web/API/RTCPeerConnection/addTrack) and [W3C](https://www.w3.org/TR/webrtc/#ref-for-dom-rtcpeerconnection-addtrack-8) references which specify zero or more. Code using `addTrack(track)` without a stream behaved...

CJS module support is bugged. Consider [this library](https://www.npmjs.com/package/merge). This library is in CJS format and the first few lines of its code look like this: ```js // "use strict"; Object.defineProperty(exports,...

Some compilation flags are unclear, hard to understand or find out what they do or insufficiently documented. Specifically, I am talking about [the wiki section on compiler flags](https://github.com/google/closure-compiler/wiki/Flags-and-Options). Let's have...