Bradford C. Smith

Results 135 comments of Bradford C. Smith

Thanks for asking. I've just taken a look and found that `FilePosition` is also used by Google code that isn't part of closure-compiler, so you cannot see it to fix...

The peephole optimizations remove the cases of an array created with an array literal. Presumably we could update whichever one does that so it also removes arrays created with the...

I would start by adding a test case here: https://github.com/google/closure-compiler/blob/d77e3adfeee582d56c27420039f3ccb6c3e860ad/test/com/google/javascript/jscomp/PeepholeRemoveDeadCodeTest.java#L1476 ``` fold("new Array(10);", ""); ``` Then investigate how to make `PeepholeRemoveDeadCode` pass this test.

It seems we haven't exposed a command-line option for setting this value. Here's the file where one would add that and an example option to copy. https://github.com/google/closure-compiler/blob/master/src/com/google/javascript/jscomp/CommandLineRunner.java#L217 If you'd like...

A lot has happened since that old update from @shicks Sadly, I don't think there's any chance at all that we will ever add tuple types, unless some very motivated...

The reason for this behavior is that the standard externs definitions for these methods don't include `undefined` as a possible return value. e.g. https://github.com/google/closure-compiler/blob/a4329316423d8478452e6330c6b887dd97ddef00/externs/es3.js#L860-L869 The trouble with fixing this is...

closure-compiler does not do structural matching of types to determine their equality unless they are `@record` types. ```js // closure-compiler will construct an ad-hoc type that represents the type of...

Roughly the answer is to compile the 2 parts separately using different externs files (standard for the web page, worker externs only for the worker one). However, I don't have...

Are you trying to polyfill `WebAssembly`? If so, then you should probably do something like this: ```js var WebAssembly = WebAssembly || createMyWebAssemblyPolyfill(); ``` If you type `createmyWebAssemblyPolyfill()` correctly, I...

The compiler is evaluating the switch expression within the scope of the switch statement, causing variables declared inside the statement to shadow outer scope variables. This turns out to be...