michael@0: // Eval expressions in arrow functions use the correct |this| value. michael@0: michael@0: function Dog(name) { michael@0: this.name = name; michael@0: this.getName = () => eval("this.name"); michael@0: this.getNameHard = () => eval("(() => this.name)()"); michael@0: } michael@0: michael@0: var d = new Dog("Max"); michael@0: assertEq(d.getName(), d.name); michael@0: assertEq(d.getNameHard(), d.name);