Allow throwing arbitrary types and add builtin error classes#724
Allow throwing arbitrary types and add builtin error classes#724Perryvw merged 36 commits intoTypeScriptToLua:masterfrom
Conversation
Co-Authored-By: ark120202 <ark120202@gmail.com>
10c9bc9 to
39704ca
Compare
Actually, looks like There is a stage 1 proposal (rendered) which I think we should follow. It defines |
I agree, but for that to work we would need to use accessors, which don't work with subclassing at the moment. We can update the functionality as soon as #725 is fixed. |
Co-Authored-By: ark120202 <ark120202@gmail.com>
Co-Authored-By: ark120202 <ark120202@gmail.com>
Co-Authored-By: ark120202 <ark120202@gmail.com>
|
I've rolled back to supporting |
| }); | ||
|
|
||
| test.each([ | ||
| `"error string"`, |
There was a problem hiding this comment.
Might be a bit cleaner to pass actual values there and convert them with util.valueToString
There was a problem hiding this comment.
True, won't atm due to util.valueToString(undefined) = undefined (#733).
This PR enables throwing custom error objects and adds the builtin error classes as defined by JavaScript. Also fixes a bug in
LuaTransformer.transformClassExpression()where local class definitions had global scope.Example
Arbitrary errors
Builtin errors
Inheritance