1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/js/src/jit-test/tests/arrow-functions/this-6.js Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,11 @@ 1.4 +// Eval expressions in arrow functions use the correct |this| value. 1.5 + 1.6 +function Dog(name) { 1.7 + this.name = name; 1.8 + this.getName = () => eval("this.name"); 1.9 + this.getNameHard = () => eval("(() => this.name)()"); 1.10 +} 1.11 + 1.12 +var d = new Dog("Max"); 1.13 +assertEq(d.getName(), d.name); 1.14 +assertEq(d.getNameHard(), d.name);