Laura Harker

Results 24 comments of Laura Harker

Interesting, thanks for reporting. A workaround is to explicitly type `this.a` in the constructor - this should tell Closure Compiler that `this.a` is potentially non-null: ``` js class A {...

While toMaybeFunctionType() can return null, the call sites in this change are places where we reasonably believe it should always return a non-null FunctionType. I don't think it makes sense...

Created Google internal issue http://b/123244691

re 1: No, Closure doesn't currently 'outline' functions. In this case I'm not sure that would be something we want to do: Closure prefers to optimize for post-gzip size, even...

@monztercoder I'll assign you to this issue and we'd be happy to review a PR. Like @concavelenz mentioned earlier, we don't have a compelling use case for this optimization yet,...

Interesting - Closure Compiler has always hardcoded that `toString()` with zero args has no side-effects here: https://github.com/google/closure-compiler/blob/ee55469d388cd1e132fb9f372fc878818e11ac3b/src/com/google/javascript/jscomp/AstAnalyzer.java#L67-L68 and we also assume it is side-effect free in the standard externs: https://github.com/google/closure-compiler/blob/ee55469d388cd1e132fb9f372fc878818e11ac3b/externs/es3.js#L1196...

This was an intentional choice when the CheckMissingRequires pass was written. The problem was that the typechecker doesn't support `@implements`/`@extends` of a weak require very well. See also https://github.com/google/closure-compiler/issues/3583. Here's...

My guess is that this is related to property renaming + whatever system you're using to transpile modules. From the input: ``` exports.Parser=void 0;Object.defineProperty(exports,"Parser",{enumerable:true,get:function(){return Parser_1.Parser;}}); ``` From the output: ```...

Smaller repro: ``` alert(--([2]).length); ``` https://closure-compiler-debugger.appspot.com/#input0%3Dalert(--(%255B2%255D).length)%253B%26input1%26conformanceConfig%26externs%26refasterjs-template%26CHECK_TYPES%3Dtrue%26REWRITE_MODULES_BEFORE_TYPECHECKING%3Dtrue%26FOLD_CONSTANTS%3Dtrue%26CLOSURE_PASS%3Dtrue%26PRESERVE_TYPE_ANNOTATIONS%3Dtrue%26PRETTY_PRINT%3Dtrue

As per https://github.com/google/closure-compiler/issues/3859, this issue isn't specific to increment/decrement but applies to any assignment op. Actual code reassigning array.length in this way seems rare though.