Created

Embed URL

HTTPS clone URL

SSH clone URL

You can clone with HTTPS or SSH.

Download Gist

ECMAScript.Next Modules

View ecmascript.next_modules.js
1 2 3 4 5 6 7 8 9 10 11 12 13
// Current way of doing modules, you have to expose it via a return statement to make it public.
var Thing = (function(){
function getStuff(){ alert('Stuff retrieved!');
return {
getStuff: getStuff
}
})();
 
// ECMAScript.Next proposal... adding "export" will make functions public.
// I wonder why they didn't just call it "public function".. export sounds like I'm downloading or something. Meh.
module Thing {
export function getStuff(){ alert('Stuff retrieved!'); }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.