Another ES5 harness bug

Jeff Walden jwalden+es at MIT.EDU
Tue Sep 8 15:40:07 PDT 2009

A number of tests include comments noting that the test function must be executed such that this is the global object.  As the harness is currently implemented, this isn't the case -- this is the test harness object itself.  This breaks a number of tests, of which the example following this email is representative.

Here's a patch to address this problem in the harness and to fix a few tests (only the ones I was immediately examining) to work correctly with it:

What needs to happen for this to be fixed upstream?





Object.getOwnPropertyDescriptor returns data desc for functions on built-ins (Global.decodeURIComponent)


function testcase() {
     var desc = Object.getOwnPropertyDescriptor(this, "decodeURIComponent");
     if (desc.value === this.decodeURIComponent &&
         desc.writable === true &&
         desc.enumerable === false && desc.configurable === true) {
         return true;


function prereq() {
     return fnExists(Object.getOwnPropertyDescriptor);



More information about the es-discuss mailing list