eclipsesource / eclipsesource/tabris-js

In TypeScript field initializer override properties set by super constructor

Open
#1,772 1 comment 2 reactions 0 assignees View on GitHub
TypeScript/JSX
Dominant language
JavaScript
Stars
1.4k
Forks
171
PR merge metrics
No merged PRs in 30d

Description

### Problem description

```
class Foo extends Composite {
private _bar = 1;
constructor(properties) {
super(properties);
}
set bar(value) {
this._bar = value;
}
get bar() { return this._bar; }
}

console.log(new Foo({bar: 2}).bar);
```
This prints "1"
### Expected behavior
Should print "2"
### Environment

Any tabris version
any TypeScript version
any Platform

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.