Skip to content

Instantly share code, notes, and snippets.

@rolaveric
Created October 31, 2014 09:05
Show Gist options
  • Save rolaveric/29d0d09ef4460c90247f to your computer and use it in GitHub Desktop.
Save rolaveric/29d0d09ef4460c90247f to your computer and use it in GitHub Desktop.
Type Introspection from AtScript
// 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