Created
October 31, 2014 09:05
-
-
Save rolaveric/29d0d09ef4460c90247f to your computer and use it in GitHub Desktop.
Type Introspection from AtScript
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
// AtScript types | |
function myFn(name:string, obj:MyClass) { | |
// ... | |
} | |
// Equivalent ES5 | |
/** | |
* @param name {string} | |
* @param obj {MyClass} | |
*/ | |
function myFn(name, obj) { | |
assert(typeof name === 'string'); | |
assert(obj instanceof MyClass); | |
// ... | |
} | |
myFn.parameters = [[String], [MyClass]]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment