Skip to content

Instantly share code, notes, and snippets.

@PeterTillema
Created July 20, 2021 18:28
Show Gist options
  • Save PeterTillema/8617624b979cd52ae85b70a4948f9927 to your computer and use it in GitHub Desktop.
Save PeterTillema/8617624b979cd52ae85b70a4948f9927 to your computer and use it in GitHub Desktop.
Prototype or not?
java -jar compiler.jar \
--externs extern.js \
--compilation_level ADVANCED_OPTIMIZATIONS \
--js=main.js \
--js_output_file=out.js
/**
* @externs
*/
var A;
/**
* @constructor
*/
A.B = function() {}
/**
* @param a
* @returns {A.B}
*/
A.b = function(a) {}
/** @type {number} */
A.B.C;
let test = A.b(3);
console.log(test.C);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment