HaxeFoundation / HaxeFoundation/haxe

[js] (es6) no error when using this before super in a specific inheritance scenario

Open
#7,836 5 comments 0 reactions 1 assignee Claimed by @nadako View on GitHub
bug platform-javascript
Dominant language
Haxe
Stars
6.9k
Forks
715
Avg merge
2d 2h
Merged PRs (30d)
11

Description

```haxe
extern class A {
function new();
}

extern class B extends A {}

class C extends B {
}

class D extends C {
var i = 5;
}
```

this should complain, but instead it generates some rubbish:

```js
class C extends B {
}
class D extends C {
constructor() {
C._hx_skip_constructor = true;
super();
C._hx_skip_constructor = false;
this._hx_constructor();
}
_hx_constructor() {
this.i = 5;
}
}
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.