You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
"use strict";function_classCallCheck(instance,Constructor){if(!(instanceinstanceofConstructor)){thrownewTypeError("Cannot call a class as a function");}}varFoo=functionFoo(){_classCallCheck(this,Foo);};
As the author of the SO post, my use-case is for times when writing a library that may or may not be consumed by TypeScript. Clearly, this should be off by default, but it would be useful to be able to throw a runtime error if the function wasn't called with new (as in Babel).
It would also be useful to have this flag throw runtime errors for as many of the TypeScript compiler errors as is practical (checking that an object fulfils an interface is probably impossible, but checking that the input is an object is achievable).
For the follwing:
Babel emits:
Not really needed for TypeScript. But a request for a similar emit was made for TypeScript : http://stackoverflow.com/q/34945858/390330
Purely for tracking 🌹
The text was updated successfully, but these errors were encountered: