-
Bug
-
Resolution: Fixed
-
P4
-
None
-
None
-
b82
Step 3 of ES 10.4.3 (Entering Function Code) requires that primitive this-values in non-strict functions must be converted to object. However, Nashorn currently prints "number" and "string" instead of 2x "object" for the code below:
Object.prototype.x = function() {
print(typeof this);
};
(123).x();
"foo".x();
I was wondering how this could go unnoticed by test262, which has 200 tests for ES 10.4.3. It turns out that test262 only tests this within a property descriptor getter (ch10/10.4/10.4.3/10.4.3-1-105.js), which is the one case where Nashorn doesn't exhibit this bug.
Object.prototype.x = function() {
print(typeof this);
};
(123).x();
"foo".x();
I was wondering how this could go unnoticed by test262, which has 200 tests for ES 10.4.3. It turns out that test262 only tests this within a property descriptor getter (ch10/10.4/10.4.3/10.4.3-1-105.js), which is the one case where Nashorn doesn't exhibit this bug.