Closed kevinresol closed 3 years ago
class Main { static function main() { trace(new haxe.Exception('foo').message); } }
generated:
export const Exception = Register.global("$hxClasses")["haxe.Exception"] = class Exception extends Register.inherits(Error) { new(message, previous = null, $native = null) { Error.call(this, message); this.message = message; this.__previousException = previous; this.__nativeException = ($native != null) ? $native : this; } get message() { return this.get_message() } get_message() { return this.message; } static get __name__() { return "haxe.Exception" } static get __super__() { return Error } get __class__() { return Exception } }
Note that the line this.message = message will fail because message has no native setter.
this.message = message
message
Also, trying to access .message will cause a stack overflow because get message() and get_message() are mutually recursive.
.message
get message()
get_message()
That's some odd code there, I guess it's only so it passes the @:coreApi constraint
@:coreApi
generated:
Note that the line
this.message = message
will fail becausemessage
has no native setter.Also, trying to access
.message
will cause a stack overflow becauseget message()
andget_message()
are mutually recursive.