jmmk / javascript-externs-generator

Generate externs for use with Google Closure Compiler
https://jmmk.github.io/javascript-externs-generator/
ISC License
135 stars 9 forks source link

Test Closure Compiler behavior with different extern fomats #22

Open jmmk opened 8 years ago

jmmk commented 8 years ago

Looking at the externs contained in https://github.com/google/closure-compiler/tree/master/contrib/externs, it seems like only the top-level namespace and the prototypes are defined. Is it actually necessary to recurse into everything?

e.g.

var namespace = {
    property: {
        anotherProperty: 1234
    }
};

If we use namespace.property.anotherProperty inside a program, do we need to provide externs for namespace.property.anotherProperty, or does namespace.property suffice?

jmmk commented 8 years ago

https://github.com/google/closure-compiler/blob/master/contrib/externs/maps/google_maps_api_v3.js also includes enum properties. Is this necessary or is it an optimization? If an optimization, what does it do/allow?

jmmk commented 8 years ago

Ideas for how to test this issue (#22) and others related to Closure Compiler behavior (#10, #9, #1):

jmmk commented 7 years ago

Things to test:

jmmk commented 6 years ago

Probably easier to run on the command line: closure-compiler --compilation_level ADVANCED [--externs externs.js,] --js file.js[,] [--js_output_file output.js]