Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Option to Output Type Annotations for Google Closure Compiler #137

Open
eeasley opened this issue Aug 14, 2013 · 0 comments
Open

Option to Output Type Annotations for Google Closure Compiler #137

eeasley opened this issue Aug 14, 2013 · 0 comments

Comments

@eeasley
Copy link

eeasley commented Aug 14, 2013

I think it would be lovely if gorillascript (optionally) output its type annotations in comments formatted for the Google Closure Compiler. Users could then use the GCC to perform static type checking on their code.

So

let increment(x as Number) x + 1

would compile to something like

/**
 * @param {number} x
 */
function increment(x) {
    if (typeof x !== "number") {
        throw new TypeError("Expected x to be a Number, got " + __typeof(x));
    }
        return x + 1;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant