closure-compiler
closure-compiler copied to clipboard
A JavaScript checker and optimizer.
AMP is seeing an exception being thrown when printing a code warning: https://github.com/ampproject/amp-closure-compiler/issues/22 ``` java.lang.StringIndexOutOfBoundsException: String index out of range: 75 at java.lang.StringLatin1.charAt(StringLatin1.java:47) at java.lang.String.charAt(String.java:693) at com.google.javascript.jscomp.LightweightMessageFormatter.padLine(LightweightMessageFormatter.java:197) at com.google.javascript.jscomp.LightweightMessageFormatter.padMultipleLines(LightweightMessageFormatter.java:251) at...
I'm getting a NPE in Closure Compiler when running it via the rules_closure Bazel rules. I have not succeeded in creating a small reproducer, so I was hoping for some...
A disclaimer: I'm new to Closure Compiler and I know nothing about Closure Library, but I stumbled upon [this StackOverflow question](https://stackoverflow.com/questions/41832887/is-it-possible-to-get-the-compiled-function-name-by-from-google-closure-from-wit). It seemed like using `goog.reflect.objectProperty` would help me solve...
[This](https://closure-compiler.appspot.com/home#code%3D%252F%252F%2520%253D%253DClosureCompiler%253D%253D%250A%252F%252F%2520%2540compilation_level%2520ADVANCED_OPTIMIZATIONS%250A%252F%252F%2520%2540output_file_name%2520default.js%250A%252F%252F%2520%2540use_closure_library%2520true%250A%252F%252F%2520%2540formatting%2520pretty_print%250A%252F%252F%2520%2540language_out%2520ECMASCRIPT3%250A%252F%252F%2520%253D%253D%252FClosureCompiler%253D%253D%250A%250Agoog.require('goog.math.Coordinate')%253B%250Agoog.require('goog.math.Vec2')%253B%250A%250Avar%2520a%2520%253D%2520new%2520goog.math.Coordinate(4%252C%25207)%253B%250Avar%2520b%2520%253D%2520new%2520goog.math.Vec2(0%252C%2520-1)%253B%250Avar%2520c%2520%253D%2520goog.math.Coordinate.sum(a%252C%2520b)%253B%250Aalert(c)%253B%250A%250A) is a simple example. ``` goog.require('goog.math.Coordinate'); goog.require('goog.math.Vec2'); var a = new goog.math.Coordinate(4, 7); var b = new goog.math.Vec2(0, -1); var c = goog.math.Coordinate.sum(a, b); alert(c); ``` Everything works fine...
One of my takeaways from reading the documentation on externs vs exports was that externs are discouraged as a way to prevent mangling of your own api/data model. It made...
Closure Compiler rejects import statements from an absolute URL. This should be easy to support if it just passes them through verbatim. Instead any presence of such a line causes...
Repro case: ``` js // a.js /** @define {string} */ var FOO = 'default foo'; export function test() { console.log(FOO); } ``` ``` js // b.js import * as a...
Affects: ``` Version: v20200927.0.0 Built on: 2020-09-29 11:30 ``` Inputs: ```javascript // main.js import { A } from 'foo'; console.log(A); // foo/index.js export const A = 'B'; ``` Command: ```...
**summary** I'm currently working on a [PR for AMP](https://github.com/ampproject/amphtml/pull/30304#discussion_r492403836) in which we'd like to use a `@const` to assist with inlining a variable. An issue has come up where we...
* for CanvasRenderingContext2D the matrix variant is missing https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/setTransform * for CanvasPattern the method is missing https://developer.mozilla.org/en-US/docs/Web/API/CanvasPattern/setTransform Source: https://github.com/google/closure-compiler/blob/master/externs/browser/html5.js upstream of https://github.com/google/elemental2/issues/145