Skip to content

Instantly share code, notes, and snippets.

@sebmarkbage
Last active August 29, 2015 14:12
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 sebmarkbage/b407e9604bc862051110 to your computer and use it in GitHub Desktop.
Save sebmarkbage/b407e9604bc862051110 to your computer and use it in GitHub Desktop.
Google DCE Method
// ==ClosureCompiler==
// @compilation_level ADVANCED_OPTIMIZATIONS
// @output_file_name default.js
// ==/ClosureCompiler==
/**
* @constructor
*/
function Foo(name) {
this.name = name;
}
Foo.prototype.foo = function() {
return this.name;
}
window.x = new Foo('test');
window.x=new function(a){this.name=a}("test");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment