archives

« Bugzilla Issues Index

#284 — Coverage: missing tests for this in the context of getters


As discussed on es-discuss [1], no current browser conforms to section 10.4.3 [2] regarding the `ThisBinding` inside a getter.

This can be shown with a JSFiddle testcase [3], the correct output of which would be

number number
object object

i.e. consistency between functions and getters.

Some tests along the lines of those that already exist for 10.4.3, simply with getters instead of `Function.prototype.call` function calls, would be a good addition to the suite.


[1]: https://mail.mozilla.org/pipermail/es-discuss/2012-February/020781.html
[2]: http://es5.github.com/#x10.4.3
[3]: http://jsfiddle.net/CxdMs/16/


Once the latest set of test contributions from Microsoft make it through, we'll be missing coverage for:
Object.defineProperty(Object.prototype, "getMeStrict", {
get: function() {
"use strict";
document.getElementById("typeof-strict-2").textContent = typeof this;
}
});
(0).getMeStrict;
only. ch10/10.4/10.4.3/10.4.3-1-59-s.js should be permuted for this.