codemix / babel-plugin-typecheck

Static and runtime type checking for JavaScript in the form of a Babel plugin.
MIT License
886 stars 44 forks source link

Guard against `node.declaration` being null #48

Closed TannerRogalsky closed 9 years ago

TannerRogalsky commented 9 years ago

Seems I caught an edge case for the ES6 export syntax.

I checked the spec and declaration can, indeed, be null. https://github.com/estree/estree/blob/master/es6.md#exportnameddeclaration

phpnode commented 9 years ago

Thanks!

mathieumg commented 8 years ago

Sorry to hijack this issue, I currently get a crash with the following syntax:

export * as example from "./example";

using the "stage-0" preset. Does this PR fix that? (It's not published yet from what I can understand) If not, is it because this plugin doesn't support the experimental export syntax? If it's a valid bug, I can open a new issue. Thanks!

Edit: Just cloned and built myself to verify, it does indeed fix it. Do you plan on publishing soon? Sorry for the noise!

phpnode commented 8 years ago

@mathieumg just added a test for it in #51, will publish when travis finishes

phpnode commented 8 years ago

@mathieumg I just published 3.0.1 which includes this fix.

mathieumg commented 8 years ago

That was fast, thank you!