Justin Ridgewell ec3722b3f9
Get set helpers (#7687)
* Improve get/set helper

* fixtures

* Edge cases

* Add loose edge cases

* Spec compliant

* Add issue case

* Even more edge cases!

* Final updates

* Fix name

* Use Reflect.{get, set} when available

* Avoid block scoping in loose

* Remove semicolon

* Do not redefine a non-enumerable

* Get strictness from call site, not helpers

* Add called assertions

* Classes are always strict

* Update test fixture
2018-04-11 11:56:59 -04:00

23 lines
314 B
JavaScript

class Point {
getX() {
assert.equal(this.x, 3); // C
}
}
class ColorPoint extends Point {
constructor() {
super();
this.x = 2;
super.x = 3;
assert.equal(this.x, 3) // A
assert.equal(super.x, undefined) // B
}
m() {
this.getX()
}
}
const cp = new ColorPoint();
cp.m();