Created
January 4, 2012 23:30
-
-
Save ariya/1562832 to your computer and use it in GitHub Desktop.
Module example transpiled by Traceur
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// What you write | |
module universe { | |
export var answer = 42; | |
} | |
// What Traceur produces | |
var universe =(function() { | |
"use strict"; | |
Object.defineProperty(this, "answer", { | |
get: function() { | |
return answer; | |
}, | |
enumerable: true | |
}); | |
Object.freeze(this); | |
var answer = 42; | |
return this; | |
}).call(Object.create(null)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment