Main.hx 399 B

1234567891011121314151617181920
  1. import haxe.Exception;
  2. extern class BaseExtern {
  3. var field:Int;
  4. function new(i:Int):Void;
  5. }
  6. @:jsRequire('./externs.js', 'ExtendedExtern')
  7. extern class ExtendedExtern extends BaseExtern {}
  8. class HaxeClass extends ExtendedExtern {}
  9. class Main {
  10. static function main() {
  11. var hx = new HaxeClass(999);
  12. if(hx.field != 999) {
  13. throw new Exception('Super constructor was not invoked');
  14. }
  15. }
  16. }