Skip to content

Instantly share code, notes, and snippets.

@fkling
Created August 12, 2013 17:49
Closuer compiler enum example.
// ==ClosureCompiler==
// @compilation_level ADVANCED_OPTIMIZATIONS
// @output_file_name default.js
// ==/ClosureCompiler==
/**
* @enum {number}
*/
MyNamespace.MyEnum = {
FOO: 1,
BAR: 2,
BAZ: 3
}
/**
* @type {MyNamespace.MyEnum}
*/
window.foo = MyNamespace.MyEnum.FOO;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment