Skip to content

Instantly share code, notes, and snippets.

@laszlopandy
Created January 11, 2015 21:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save laszlopandy/602cd66d4b8e402dc1fc to your computer and use it in GitHub Desktop.
Save laszlopandy/602cd66d4b8e402dc1fc to your computer and use it in GitHub Desktop.
Closure compiler dead-code-elimination test.
this['Elm'] = (function() {
var Elm_Debug_make = function() {
function watchSummary() {
return "Banana1";
}
function crash() {
throw new Error("crash");
}
return { watchSummary: watchSummary, crash: crash };
};
var Elm = {};
Elm.Main = {};
Elm.Main.make = function() {
var Debug = Elm_Debug_make();
Debug.crash();
}
return Elm;
})();
/* Output of Closure compiler advanced mode (beautified so it's easier to read):
java -jar compiler.jar --js minimal_test.js --js_output_file minimal_test.min.js -O ADVANCED
*/
this.Elm = function() {
function b() {
return {
d: function() {
return "Banana1"
},
b: function() {
throw Error("crash");
}
}
}
var a = {
a: {}
};
a.a.c = function() {
b().b()
};
return a
}();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment