RealyUniqueName / JStack

Friendly stack traces for Haxe/JS and Haxe/PHP. Makes haxe.CallStack point to haxe sources.
MIT License
31 stars 2 forks source link

OpenFL compatibility #15

Open Gama11 opened 6 years ago

Gama11 commented 6 years ago

JStack doesn't seem usable with OpenFL projects atm, because it doesn't support constructors / new() as entry points.

> openfl create project JStackTest
> cd JstackTest

Add this to project.xml:

<haxelib name="jstack" />
<haxedef name="JSTACK_MAIN=Main.new" />

Running openfl test html5 results in this error:

Source/Main.hx:12: characters 2-10 : Cannot call super constructor outside class constructor
Source/Main.hx:10: lines 10-16 : Missing super constructor call

Versions used:

RealyUniqueName commented 6 years ago

Till this is fixed you can use ordinary entry point as a workaround. AFAIR OpenFL supports it.

class MyClass extends Sprite {
  static public function main() Lib.addChild(new MyClass());
}
Gama11 commented 6 years ago

Yep, it does, probably should have mentioned that. 👍