diff --git a/implementation-contributed/v8/mjsunit/es6/symbols.js b/implementation-contributed/v8/mjsunit/es6/symbols.js index a6c12909b4..da8f1a4f18 100644 --- a/implementation-contributed/v8/mjsunit/es6/symbols.js +++ b/implementation-contributed/v8/mjsunit/es6/symbols.js @@ -297,7 +297,7 @@ function TestKeyGet(obj) { function TestKeyHas(obj) { for (var i in symbols) { assertTrue(symbols[i] in obj) - assertTrue(Object.hasOwnProperty.call(obj, symbols[i])) + assertTrue(Object.prototype.hasOwnProperty.call(obj, symbols[i])) } } diff --git a/implementation-contributed/v8/mjsunit/es6/typedarray-reverse.js b/implementation-contributed/v8/mjsunit/es6/typedarray-reverse.js index d7133718c3..6dbd33d30b 100644 --- a/implementation-contributed/v8/mjsunit/es6/typedarray-reverse.js +++ b/implementation-contributed/v8/mjsunit/es6/typedarray-reverse.js @@ -48,7 +48,7 @@ for (var constructor of arrayConstructors) { var x = { length: 2, 1: 5 }; a.reverse.call(x); assertEquals(2, x.length); - assertFalse(Object.hasOwnProperty(x, '1')); + assertFalse(Object.prototype.hasOwnProperty.call(x, '1')); assertEquals(5, x[0]); } diff --git a/implementation-contributed/v8/mjsunit/harmony/private.js b/implementation-contributed/v8/mjsunit/harmony/private.js index c4306c516c..64aa39f2ce 100644 --- a/implementation-contributed/v8/mjsunit/harmony/private.js +++ b/implementation-contributed/v8/mjsunit/harmony/private.js @@ -248,7 +248,7 @@ function TestKeyGet(obj) { function TestKeyHas() { for (var i in symbols) { assertTrue(symbols[i] in obj) - assertTrue(Object.hasOwnProperty.call(obj, symbols[i])) + assertTrue(Object.prototype.hasOwnProperty.call(obj, symbols[i])) } } diff --git a/implementation-contributed/v8/mjsunit/harmony/public-instance-class-fields.js b/implementation-contributed/v8/mjsunit/harmony/public-instance-class-fields.js index 56c7e201aa..198d6aa821 100644 --- a/implementation-contributed/v8/mjsunit/harmony/public-instance-class-fields.js +++ b/implementation-contributed/v8/mjsunit/harmony/public-instance-class-fields.js @@ -611,7 +611,7 @@ x()(); assertEquals(1, c.c()()); assertEquals(1, c.d()); assertEquals(1, c.e()); - assertFalse(Object.hasOwnProperty(c, 'a')); + assertFalse(Object.prototype.hasOwnProperty.call(c, 'a')); assertEquals(c.a, c.e); assertEquals(undefined, c.f); } diff --git a/src/async-generators/default/async-class-decl-private-method.template b/src/async-generators/default/async-class-decl-private-method.template index 9ca63b4612..cc5c12a299 100644 --- a/src/async-generators/default/async-class-decl-private-method.template +++ b/src/async-generators/default/async-class-decl-private-method.template @@ -32,9 +32,18 @@ class C { const c = new C(); // Test the private fields do not appear as properties before set to value -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#gen"), false, 'Object.hasOwnProperty.call(C.prototype, "#gen")'); -assert.sameValue(Object.hasOwnProperty.call(C, "#gen"), false, 'Object.hasOwnProperty.call(C, "#gen")'); -assert.sameValue(Object.hasOwnProperty.call(c, "#gen"), false, 'Object.hasOwnProperty.call(c, "#gen")'); +assert( + !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"), + "#gen does not appear as an own property on C prototype" +); +assert( + !Object.prototype.hasOwnProperty.call(C, "#gen"), + "#gen does not appear as an own property on C constructor" +); +assert( + !Object.prototype.hasOwnProperty.call(c, "#gen"), + "#gen does not appear as an own property on C instance" +); var iter = c.gen(); @@ -43,6 +52,15 @@ var iter = c.gen(); assert.sameValue(callCount, 1); // Test the private fields do not appear as properties after set to value -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#gen"), false, 'Object.hasOwnProperty.call(C.prototype, "#gen")'); -assert.sameValue(Object.hasOwnProperty.call(C, "#gen"), false, 'Object.hasOwnProperty.call(C, "#gen")'); -assert.sameValue(Object.hasOwnProperty.call(c, "#gen"), false, 'Object.hasOwnProperty.call(c, "#gen")'); +assert( + !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"), + "#gen does not appear as an own property on C prototype" +); +assert( + !Object.prototype.hasOwnProperty.call(C, "#gen"), + "#gen does not appear as an own property on C constructor" +); +assert( + !Object.prototype.hasOwnProperty.call(c, "#gen"), + "#gen does not appear as an own property on C instance" +); diff --git a/src/async-generators/default/async-class-decl-static-private-method.template b/src/async-generators/default/async-class-decl-static-private-method.template index 9b504e2695..e2efb411de 100644 --- a/src/async-generators/default/async-class-decl-static-private-method.template +++ b/src/async-generators/default/async-class-decl-static-private-method.template @@ -30,8 +30,14 @@ class C { } // Test the private fields do not appear as properties before set to value -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#gen"), false, 'Object.hasOwnProperty.call(C.prototype, "#gen")'); -assert.sameValue(Object.hasOwnProperty.call(C, "#gen"), false, 'Object.hasOwnProperty.call(C, "#gen")'); +assert( + !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"), + "#gen does not appear as an own property on C prototype" +); +assert( + !Object.prototype.hasOwnProperty.call(C, "#gen"), + "#gen does not appear as an own property on C constructor" +); var iter = C.gen(); @@ -40,5 +46,11 @@ var iter = C.gen(); assert.sameValue(callCount, 1); // Test the private fields do not appear as properties after set to value -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#gen"), false, 'Object.hasOwnProperty.call(C.prototype, "#gen")'); -assert.sameValue(Object.hasOwnProperty.call(C, "#gen"), false, 'Object.hasOwnProperty.call(C, "#gen")'); +assert( + !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"), + "#gen does not appear as an own property on C prototype" +); +assert( + !Object.prototype.hasOwnProperty.call(C, "#gen"), + "#gen does not appear as an own property on C constructor" +); diff --git a/src/async-generators/default/async-class-expr-private-method.template b/src/async-generators/default/async-class-expr-private-method.template index d42a79d864..51e3158eb3 100644 --- a/src/async-generators/default/async-class-expr-private-method.template +++ b/src/async-generators/default/async-class-expr-private-method.template @@ -32,9 +32,18 @@ var C = class { const c = new C(); // Test the private fields do not appear as properties before set to value -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#gen"), false, 'Object.hasOwnProperty.call(C.prototype, "#gen")'); -assert.sameValue(Object.hasOwnProperty.call(C, "#gen"), false, 'Object.hasOwnProperty.call(C, "#gen")'); -assert.sameValue(Object.hasOwnProperty.call(c, "#gen"), false, 'Object.hasOwnProperty.call(c, "#gen")'); +assert( + !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"), + "#gen does not appear as an own property on C prototype" +); +assert( + !Object.prototype.hasOwnProperty.call(C, "#gen"), + "#gen does not appear as an own property on C constructor" +); +assert( + !Object.prototype.hasOwnProperty.call(c, "#gen"), + "#gen does not appear as an own property on C instance" +); var iter = c.gen(); @@ -43,6 +52,15 @@ var iter = c.gen(); assert.sameValue(callCount, 1); // Test the private fields do not appear as properties after set to value -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#gen"), false, 'Object.hasOwnProperty.call(C.prototype, "#gen")'); -assert.sameValue(Object.hasOwnProperty.call(C, "#gen"), false, 'Object.hasOwnProperty.call(C, "#gen")'); -assert.sameValue(Object.hasOwnProperty.call(c, "#gen"), false, 'Object.hasOwnProperty.call(c, "#gen")'); +assert( + !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"), + "#gen does not appear as an own property on C prototype" +); +assert( + !Object.prototype.hasOwnProperty.call(C, "#gen"), + "#gen does not appear as an own property on C constructor" +); +assert( + !Object.prototype.hasOwnProperty.call(c, "#gen"), + "#gen does not appear as an own property on C instance" +); diff --git a/src/async-generators/default/async-class-expr-static-private-method.template b/src/async-generators/default/async-class-expr-static-private-method.template index 8d5fd8613e..688e8e2248 100644 --- a/src/async-generators/default/async-class-expr-static-private-method.template +++ b/src/async-generators/default/async-class-expr-static-private-method.template @@ -30,8 +30,14 @@ var C = class { } // Test the private fields do not appear as properties before set to value -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#gen"), false, 'Object.hasOwnProperty.call(C.prototype, "#gen")'); -assert.sameValue(Object.hasOwnProperty.call(C, "#gen"), false, 'Object.hasOwnProperty.call(C, "#gen")'); +assert( + !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"), + "#gen does not appear as an own property on C prototype" +); +assert( + !Object.prototype.hasOwnProperty.call(C, "#gen"), + "#gen does not appear as an own property on C constructor" +); var iter = C.gen(); @@ -40,5 +46,11 @@ var iter = C.gen(); assert.sameValue(callCount, 1); // Test the private fields do not appear as properties after set to value -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#gen"), false, 'Object.hasOwnProperty.call(C.prototype, "#gen")'); -assert.sameValue(Object.hasOwnProperty.call(C, "#gen"), false, 'Object.hasOwnProperty.call(C, "#gen")'); +assert( + !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"), + "#gen does not appear as an own property on C prototype" +); +assert( + !Object.prototype.hasOwnProperty.call(C, "#gen"), + "#gen does not appear as an own property on C constructor" +); diff --git a/src/async-generators/yield-identifier-spread-non-strict.case b/src/async-generators/yield-identifier-spread-non-strict.case index 73ba0d813b..4ce025478b 100644 --- a/src/async-generators/yield-identifier-spread-non-strict.case +++ b/src/async-generators/yield-identifier-spread-non-strict.case @@ -45,5 +45,5 @@ item.then(({ done, value }) => { assert.sameValue(value.b, 2); assert.sameValue(value[s], 42); assert.sameValue(Object.keys(value).length, 5); - assert(Object.hasOwnProperty.call(value, s)); + assert(Object.prototype.hasOwnProperty.call(value, s), "s is an own property"); }).then($DONE, $DONE); diff --git a/src/class-elements/computed-name-toprimitive-symbol.case b/src/class-elements/computed-name-toprimitive-symbol.case index 0b96fa10c5..8cd27f8494 100644 --- a/src/class-elements/computed-name-toprimitive-symbol.case +++ b/src/class-elements/computed-name-toprimitive-symbol.case @@ -69,8 +69,14 @@ var obj3 = { //- assertions var c = new C(); -assert.sameValue(Object.hasOwnProperty.call(C.prototype, s1), false); -assert.sameValue(Object.hasOwnProperty.call(C, s1), false); +assert( + !Object.prototype.hasOwnProperty.call(C.prototype, s1), + "s1 doesn't appear as an own property on C prototype" +); +assert( + !Object.prototype.hasOwnProperty.call(C, s1), + "s1 doesn't appear as an own property on C constructor" +); verifyProperty(c, s1, { value: 42, @@ -79,8 +85,14 @@ verifyProperty(c, s1, { configurable: true }); -assert.sameValue(Object.hasOwnProperty.call(C.prototype, s2), false); -assert.sameValue(Object.hasOwnProperty.call(C, s2), false); +assert( + !Object.prototype.hasOwnProperty.call(C.prototype, s2), + "s2 doesn't appear as an own property on C prototype" +); +assert( + !Object.prototype.hasOwnProperty.call(C, s2), + "s2 doesn't appear as an own property on C constructor" +); verifyProperty(c, s2, { value: 43, @@ -89,8 +101,14 @@ verifyProperty(c, s2, { configurable: true }); -assert.sameValue(Object.hasOwnProperty.call(C.prototype, s3), false); -assert.sameValue(Object.hasOwnProperty.call(C, s3), false); +assert( + !Object.prototype.hasOwnProperty.call(C.prototype, s3), + "s3 doesn't appear as an own property on C prototype" +); +assert( + !Object.prototype.hasOwnProperty.call(C, s3), + "s3 doesn't appear as an own property on C constructor" +); verifyProperty(c, s3, { value: 44, diff --git a/src/class-elements/computed-name-toprimitive.case b/src/class-elements/computed-name-toprimitive.case index 2cdd5958da..54793f2f1b 100644 --- a/src/class-elements/computed-name-toprimitive.case +++ b/src/class-elements/computed-name-toprimitive.case @@ -66,8 +66,14 @@ var obj3 = { //- assertions var c = new C(); -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "d"), false); -assert.sameValue(Object.hasOwnProperty.call(C, "d"), false); +assert( + !Object.prototype.hasOwnProperty.call(C.prototype, "d"), + "d doesn't appear as an own property on C prototype" +); +assert( + !Object.prototype.hasOwnProperty.call(C, "d"), + "d doesn't appear as an own property on C constructor" +); verifyProperty(c, "d", { value: 42, @@ -76,8 +82,14 @@ verifyProperty(c, "d", { configurable: true }); -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "e"), false); -assert.sameValue(Object.hasOwnProperty.call(C, "e"), false); +assert( + !Object.prototype.hasOwnProperty.call(C.prototype, "e"), + "e doesn't appear as an own property on C prototype" +); +assert( + !Object.prototype.hasOwnProperty.call(C, "e"), + "e doesn't appear as an own property on C constructor" +); verifyProperty(c, "e", { value: 43, @@ -86,8 +98,14 @@ verifyProperty(c, "e", { configurable: true }); -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "f"), false); -assert.sameValue(Object.hasOwnProperty.call(C, "f"), false); +assert( + !Object.prototype.hasOwnProperty.call(C.prototype, "f"), + "f doesn't appear as an own property on C prototype" +); +assert(! + Object.prototype.hasOwnProperty.call(C, "f"), + "f doesn't appear as an own property on C constructor" +); verifyProperty(c, "f", { value: 44, diff --git a/src/class-elements/computed-names.case b/src/class-elements/computed-names.case index cc846c83ef..9d18addbd8 100644 --- a/src/class-elements/computed-names.case +++ b/src/class-elements/computed-names.case @@ -25,8 +25,14 @@ var x = "b"; [x] = 42; [10] = "meep"; ["not initialized"] //- assertions -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "b"), false); -assert.sameValue(Object.hasOwnProperty.call(C, "b"), false); +assert( + !Object.prototype.hasOwnProperty.call(C.prototype, "b"), + "b doesn't appear as an own property on C prototype" +); +assert( + !Object.prototype.hasOwnProperty.call(C, "b"), + "b doesn't appear as an own property on C constructor" +); verifyProperty(c, "b", { value: 42, @@ -35,12 +41,27 @@ verifyProperty(c, "b", { configurable: true }); -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "x"), false); -assert.sameValue(Object.hasOwnProperty.call(C, "x"), false); -assert.sameValue(Object.hasOwnProperty.call(c, "x"), false); +assert( + !Object.prototype.hasOwnProperty.call(C.prototype, "x"), + "x doesn't appear as an own property on C prototype" +); +assert( + !Object.prototype.hasOwnProperty.call(C, "x"), + "x doesn't appear as an own property on C constructor" +); +assert( + !Object.prototype.hasOwnProperty.call(c, "x"), + "x doesn't appear as an own property on C instance" +); -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "10"), false); -assert.sameValue(Object.hasOwnProperty.call(C, "10"), false); +assert( + !Object.prototype.hasOwnProperty.call(C.prototype, "10"), + "10 doesn't appear as an own property on C prototype" +); +assert( + !Object.prototype.hasOwnProperty.call(C, "10"), + "10 doesn't appear as an own property on C constructor" +); verifyProperty(c, "10", { value: "meep", @@ -49,8 +70,14 @@ verifyProperty(c, "10", { configurable: true }); -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "not initialized"), false); -assert.sameValue(Object.hasOwnProperty.call(C, "not initialized"), false); +assert( + !Object.prototype.hasOwnProperty.call(C.prototype, "not initialized"), + "'not initialized' doesn't appear as an own property on C prototype" +); +assert( + !Object.prototype.hasOwnProperty.call(C, "not initialized"), + "'not initialized' doesn't appear as an own property on C constructor" +); verifyProperty(c, "not initialized", { value: undefined, diff --git a/src/class-elements/computed-symbol-names.case b/src/class-elements/computed-symbol-names.case index b2b25dd6f4..b03b034638 100644 --- a/src/class-elements/computed-symbol-names.case +++ b/src/class-elements/computed-symbol-names.case @@ -25,8 +25,14 @@ var y = Symbol(); //- elements [x]; [y] = 42 //- assertions -assert.sameValue(Object.hasOwnProperty.call(C.prototype, x), false); -assert.sameValue(Object.hasOwnProperty.call(C, x), false); +assert( + !Object.prototype.hasOwnProperty.call(C.prototype, x), + "Symbol x doesn't appear as an own property on C prototype" +); +assert( + !Object.prototype.hasOwnProperty.call(C, x), + "Symbol x doesn't appear as an own property on C constructor" +); verifyProperty(c, x, { value: undefined, @@ -35,8 +41,14 @@ verifyProperty(c, x, { configurable: true }); -assert.sameValue(Object.hasOwnProperty.call(C.prototype, y), false); -assert.sameValue(Object.hasOwnProperty.call(C, y), false); +assert( + !Object.prototype.hasOwnProperty.call(C.prototype, y), + "Symbol y doesn't appear as an own property on C prototype" +); +assert( + !Object.prototype.hasOwnProperty.call(C, y), + "Symbol y doesn't appear as an own property on C constructor" +); verifyProperty(c, y, { value: 42, @@ -45,10 +57,28 @@ verifyProperty(c, y, { configurable: true }); -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "x"), false); -assert.sameValue(Object.hasOwnProperty.call(C, "x"), false); -assert.sameValue(Object.hasOwnProperty.call(c, "x"), false); +assert( + !Object.prototype.hasOwnProperty.call(C.prototype, "x"), + "x doesn't appear as an own property on C prototype" +); +assert( + !Object.prototype.hasOwnProperty.call(C, "x"), + "x doesn't appear as an own property on C constructor" +); +assert( + !Object.prototype.hasOwnProperty.call(c, "x"), + "x doesn't appear as an own property on C instance" +); -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "y"), false); -assert.sameValue(Object.hasOwnProperty.call(C, "y"), false); -assert.sameValue(Object.hasOwnProperty.call(c, "y"), false); +assert( + !Object.prototype.hasOwnProperty.call(C.prototype, "y"), + "y doesn't appear as an own property on C prototype" +); +assert( + !Object.prototype.hasOwnProperty.call(C, "y"), + "y doesn't appear as an own property on C constructor" +); +assert( + !Object.prototype.hasOwnProperty.call(c, "y"), + "y doesn't appear as an own property on C instance" +); diff --git a/src/class-elements/field-declaration.case b/src/class-elements/field-declaration.case index 2d6345d69b..75a3c80e5d 100644 --- a/src/class-elements/field-declaration.case +++ b/src/class-elements/field-declaration.case @@ -61,10 +61,22 @@ assert.sameValue(C.g, undefined); assert.sameValue(C.h, undefined); assert.sameValue(C[0], undefined); -assert.sameValue(Object.hasOwnProperty.call(C, 'f'), false); -assert.sameValue(Object.hasOwnProperty.call(C, 'g'), false); -assert.sameValue(Object.hasOwnProperty.call(C, 'h'), false); -assert.sameValue(Object.hasOwnProperty.call(C, 0), false); +assert( + !Object.prototype.hasOwnProperty.call(C, 'f'), + "f does not appear as an own property on C constructor" +); +assert( + !Object.prototype.hasOwnProperty.call(C, 'g'), + "g does not appear as an own property on C constructor" +); +assert( + !Object.prototype.hasOwnProperty.call(C, 'h'), + "h does not appear as an own property on C constructor" +); +assert( + !Object.prototype.hasOwnProperty.call(C, 0), + "0 does not appear as an own property on C constructor" +); verifyProperty(c, 'f', { value: 'test262', diff --git a/src/class-elements/field-definition-accessor-no-line-terminator.case b/src/class-elements/field-definition-accessor-no-line-terminator.case index 260458950e..2779ff721c 100644 --- a/src/class-elements/field-definition-accessor-no-line-terminator.case +++ b/src/class-elements/field-definition-accessor-no-line-terminator.case @@ -20,9 +20,27 @@ $; //- assertions let c = new C(); -assert.sameValue(Object.hasOwnProperty.call(C.prototype, 'accessor'), false); -assert.sameValue(Object.hasOwnProperty.call(C.prototype, '$'), false); -assert.sameValue(Object.hasOwnProperty.call(C, 'accessor'), true); -assert.sameValue(Object.hasOwnProperty.call(C, '$'), false); -assert.sameValue(Object.hasOwnProperty.call(c, 'accessor'), true); -assert.sameValue(Object.hasOwnProperty.call(c, '$'), true); +assert( + !Object.prototype.hasOwnProperty.call(C.prototype, 'accessor'), + "accessor doesn't appear as an own property on C prototype" +); +assert( + !Object.prototype.hasOwnProperty.call(C.prototype, '$'), + "$ doesn't appear as an own property on C prototype" +); +assert( + Object.prototype.hasOwnProperty.call(C, 'accessor'), + "C constructor has an own property accessor" +); +assert( + !Object.prototype.hasOwnProperty.call(C, '$'), + "$ doesn't appear as an own property on C constructor" +); +assert( + Object.prototype.hasOwnProperty.call(c, 'accessor'), + "C instance has an own property accessor" +); +assert( + Object.prototype.hasOwnProperty.call(c, '$'), + "C instance has an own property $" +); diff --git a/src/class-elements/literal-names-asi.case b/src/class-elements/literal-names-asi.case index 644d7fe8de..e7604c6a0a 100644 --- a/src/class-elements/literal-names-asi.case +++ b/src/class-elements/literal-names-asi.case @@ -22,8 +22,14 @@ features: [class-fields-public] a b = 42; //- assertions -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "a"), false); -assert.sameValue(Object.hasOwnProperty.call(C, "a"), false); +assert( + !Object.prototype.hasOwnProperty.call(C.prototype, "a"), + "a doesn't appear as an own property on C prototype" +); +assert( + !Object.prototype.hasOwnProperty.call(C, "a"), + "a doesn't appear as an own property on C constructor" +); verifyProperty(c, "a", { value: undefined, @@ -32,8 +38,14 @@ verifyProperty(c, "a", { configurable: true }); -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "b"), false); -assert.sameValue(Object.hasOwnProperty.call(C, "b"), false); +assert( + !Object.prototype.hasOwnProperty.call(C.prototype, "b"), + "b doesn't appear as an own property on C prototype" +); +assert( + !Object.prototype.hasOwnProperty.call(C, "b"), + "b doesn't appear as an own property on C constructor" +); verifyProperty(c, "b", { value: 42, diff --git a/src/class-elements/literal-names.case b/src/class-elements/literal-names.case index b9cecd597b..01c8d06b1c 100644 --- a/src/class-elements/literal-names.case +++ b/src/class-elements/literal-names.case @@ -25,8 +25,14 @@ const fn = function() {} a; b = 42; c = fn //- assertions -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "a"), false); -assert.sameValue(Object.hasOwnProperty.call(C, "a"), false); +assert( + !Object.prototype.hasOwnProperty.call(C.prototype, "a"), + "a doesn't appear as an own property on C prototype" +); +assert( + !Object.prototype.hasOwnProperty.call(C, "a"), + "a doesn't appear as an own property on C constructor" +); verifyProperty(c, "a", { value: undefined, @@ -35,8 +41,14 @@ verifyProperty(c, "a", { configurable: true }); -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "b"), false); -assert.sameValue(Object.hasOwnProperty.call(C, "b"), false); +assert( + !Object.prototype.hasOwnProperty.call(C.prototype, "b"), + "b doesn't appear as an own property on C prototype" +); +assert( + !Object.prototype.hasOwnProperty.call(C, "b"), + "b doesn't appear as an own property on C constructor" +); verifyProperty(c, "b", { value: 42, @@ -45,8 +57,14 @@ verifyProperty(c, "b", { configurable: true }); -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "c"), false); -assert.sameValue(Object.hasOwnProperty.call(C, "c"), false); +assert( + !Object.prototype.hasOwnProperty.call(C.prototype, "c"), + "c doesn't appear as an own property on C prototype" +); +assert( + !Object.prototype.hasOwnProperty.call(C, "c"), + "c doesn't appear as an own property on C constructor" +); verifyProperty(c, "c", { value: fn, diff --git a/src/class-elements/private-names.case b/src/class-elements/private-names.case index 55518131bf..482fb9d530 100644 --- a/src/class-elements/private-names.case +++ b/src/class-elements/private-names.case @@ -35,18 +35,18 @@ y() { //- assertions // Test the private fields do not appear as properties before set to value -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#x"), false, "test 1"); -assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 2"); -assert.sameValue(Object.hasOwnProperty.call(c, "#x"), false, "test 3"); +assert(!Object.prototype.hasOwnProperty.call(C.prototype, "#x"), "test 1"); +assert(!Object.prototype.hasOwnProperty.call(C, "#x"), "test 2"); +assert(!Object.prototype.hasOwnProperty.call(c, "#x"), "test 3"); -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#y"), false, "test 4"); -assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 5"); -assert.sameValue(Object.hasOwnProperty.call(c, "#y"), false, "test 6"); +assert(!Object.prototype.hasOwnProperty.call(C.prototype, "#y"), "test 4"); +assert(!Object.prototype.hasOwnProperty.call(C, "#y"), "test 5"); +assert(!Object.prototype.hasOwnProperty.call(c, "#y"), "test 6"); // Test if private fields can be sucessfully accessed and set to value assert.sameValue(c.x(), 42, "test 7"); assert.sameValue(c.y(), 43, "test 8"); // Test the private fields do not appear as properties before after set to value -assert.sameValue(Object.hasOwnProperty.call(c, "#x"), false, "test 9"); -assert.sameValue(Object.hasOwnProperty.call(c, "#y"), false, "test 10"); +assert(!Object.prototype.hasOwnProperty.call(c, "#x"), "test 9"); +assert(!Object.prototype.hasOwnProperty.call(c, "#y"), "test 10"); diff --git a/src/class-elements/productions/cls-decl-after-same-line-async-gen.template b/src/class-elements/productions/cls-decl-after-same-line-async-gen.template index 5ea328e852..324cac0e06 100644 --- a/src/class-elements/productions/cls-decl-after-same-line-async-gen.template +++ b/src/class-elements/productions/cls-decl-after-same-line-async-gen.template @@ -17,7 +17,10 @@ class C { var c = new C(); -assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert( + !Object.prototype.hasOwnProperty.call(c, "m"), + "m doesn't appear as an own property on the C instance" +); assert.sameValue(c.m, C.prototype.m); verifyProperty(C.prototype, "m", { diff --git a/src/class-elements/productions/cls-decl-after-same-line-async-method.template b/src/class-elements/productions/cls-decl-after-same-line-async-method.template index 70bfd7b99c..73c5b3e495 100644 --- a/src/class-elements/productions/cls-decl-after-same-line-async-method.template +++ b/src/class-elements/productions/cls-decl-after-same-line-async-method.template @@ -17,7 +17,10 @@ class C { var c = new C(); -assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert( + !Object.prototype.hasOwnProperty.call(c, "m"), + "m doesn't appear as an own property on the C instance" +); assert.sameValue(c.m, C.prototype.m); verifyProperty(C.prototype, "m", { diff --git a/src/class-elements/productions/cls-decl-after-same-line-gen.template b/src/class-elements/productions/cls-decl-after-same-line-gen.template index 6ac71e1f96..86796bfdfc 100644 --- a/src/class-elements/productions/cls-decl-after-same-line-gen.template +++ b/src/class-elements/productions/cls-decl-after-same-line-gen.template @@ -17,7 +17,10 @@ class C { var c = new C(); assert.sameValue(c.m().next().value, 42); -assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert( + !Object.prototype.hasOwnProperty.call(c, "m"), + "m doesn't appear as an own property on the C instance" +); assert.sameValue(c.m, C.prototype.m); verifyProperty(C.prototype, "m", { diff --git a/src/class-elements/productions/cls-decl-after-same-line-method.template b/src/class-elements/productions/cls-decl-after-same-line-method.template index 664ab1c0de..63d8ac5272 100644 --- a/src/class-elements/productions/cls-decl-after-same-line-method.template +++ b/src/class-elements/productions/cls-decl-after-same-line-method.template @@ -17,7 +17,10 @@ class C { var c = new C(); assert.sameValue(c.m(), 42); -assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert( + !Object.prototype.hasOwnProperty.call(c, "m"), + "m doesn't appear as an own property on the C instance" +); assert.sameValue(c.m, C.prototype.m); verifyProperty(C.prototype, "m", { diff --git a/src/class-elements/productions/cls-decl-after-same-line-static-async-gen.template b/src/class-elements/productions/cls-decl-after-same-line-static-async-gen.template index b64dcea552..804ff47c68 100644 --- a/src/class-elements/productions/cls-decl-after-same-line-static-async-gen.template +++ b/src/class-elements/productions/cls-decl-after-same-line-static-async-gen.template @@ -17,8 +17,14 @@ class C { var c = new C(); -assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); +assert( + !Object.prototype.hasOwnProperty.call(c, "m"), + "m doesn't appear as an own property on the C instance" +); +assert( + !Object.prototype.hasOwnProperty.call(C.prototype, "m"), + "m doesn't appear as an own property on the C prototype" +); verifyProperty(C, "m", { enumerable: false, diff --git a/src/class-elements/productions/cls-decl-after-same-line-static-async-method.template b/src/class-elements/productions/cls-decl-after-same-line-static-async-method.template index f46ce78493..a1c3adfc55 100644 --- a/src/class-elements/productions/cls-decl-after-same-line-static-async-method.template +++ b/src/class-elements/productions/cls-decl-after-same-line-static-async-method.template @@ -17,8 +17,14 @@ class C { var c = new C(); -assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); +assert( + !Object.prototype.hasOwnProperty.call(c, "m"), + "m doesn't appear as an own property on the C instance" +); +assert( + !Object.prototype.hasOwnProperty.call(C.prototype, "m"), + "m doesn't appear as an own property on the C prototype" +); verifyProperty(C, "m", { enumerable: false, diff --git a/src/class-elements/productions/cls-decl-after-same-line-static-gen.template b/src/class-elements/productions/cls-decl-after-same-line-static-gen.template index 265b2e64ff..c16d24f7f3 100644 --- a/src/class-elements/productions/cls-decl-after-same-line-static-gen.template +++ b/src/class-elements/productions/cls-decl-after-same-line-static-gen.template @@ -17,8 +17,14 @@ class C { var c = new C(); assert.sameValue(C.m().next().value, 42); -assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); +assert( + !Object.prototype.hasOwnProperty.call(c, "m"), + "m doesn't appear as an own property on the C instance" +); +assert( + !Object.prototype.hasOwnProperty.call(C.prototype, "m"), + "m doesn't appear as an own property on the C prototype" +); verifyProperty(C, "m", { enumerable: false, diff --git a/src/class-elements/productions/cls-decl-after-same-line-static-method.template b/src/class-elements/productions/cls-decl-after-same-line-static-method.template index 0ba05f6836..9914a53fa7 100644 --- a/src/class-elements/productions/cls-decl-after-same-line-static-method.template +++ b/src/class-elements/productions/cls-decl-after-same-line-static-method.template @@ -17,8 +17,14 @@ class C { var c = new C(); assert.sameValue(C.m(), 42); -assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); +assert( + !Object.prototype.hasOwnProperty.call(c, "m"), + "m doesn't appear as an own property on the C instance" +); +assert( + !Object.prototype.hasOwnProperty.call(C.prototype, "m"), + "m doesn't appear as an own property on the C prototype" +); verifyProperty(C, "m", { enumerable: false, diff --git a/src/class-elements/productions/cls-decl-multiple-definitions.template b/src/class-elements/productions/cls-decl-multiple-definitions.template index 27285d01c6..13bcbe4bc5 100644 --- a/src/class-elements/productions/cls-decl-multiple-definitions.template +++ b/src/class-elements/productions/cls-decl-multiple-definitions.template @@ -21,7 +21,10 @@ class C { var c = new C(); assert.sameValue(c.m(), 42); -assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert( + !Object.prototype.hasOwnProperty.call(c, "m"), + "m doesn't appear as an own property on the C instance" +); assert.sameValue(c.m, C.prototype.m); verifyProperty(C.prototype, "m", { @@ -31,7 +34,10 @@ verifyProperty(C.prototype, "m", { }); assert.sameValue(c.m2(), 39); -assert.sameValue(Object.hasOwnProperty.call(c, "m2"), false); +assert(! + Object.prototype.hasOwnProperty.call(c, "m2"), + "m2 doesn't appear as an own property on the C instance" +); assert.sameValue(c.m2, C.prototype.m2); verifyProperty(C.prototype, "m2", { @@ -41,8 +47,14 @@ verifyProperty(C.prototype, "m2", { }); assert.sameValue(c.foo, "foobar"); -assert.sameValue(Object.hasOwnProperty.call(C, "foo"), false); -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "foo"), false); +assert( + !Object.prototype.hasOwnProperty.call(C, "foo"), + "foo doesn't appear as an own property on the C constructor" +); +assert( + !Object.prototype.hasOwnProperty.call(C.prototype, "foo"), + "foo doesn't appear as an own property on the C prototype" +); verifyProperty(c, "foo", { value: "foobar", @@ -52,8 +64,14 @@ verifyProperty(c, "foo", { }); assert.sameValue(c.bar, "barbaz"); -assert.sameValue(Object.hasOwnProperty.call(C, "bar"), false); -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "bar"), false); +assert( + !Object.prototype.hasOwnProperty.call(C, "bar"), + "bar doesn't appear as an own property on the C constructor" +); +assert( + !Object.prototype.hasOwnProperty.call(C.prototype, "bar"), + "bar doesn't appear as an own property on the C prototype" +); verifyProperty(c, "bar", { value: "barbaz", diff --git a/src/class-elements/productions/cls-decl-multiple-stacked-definitions.template b/src/class-elements/productions/cls-decl-multiple-stacked-definitions.template index aaea634320..16aef87aa2 100644 --- a/src/class-elements/productions/cls-decl-multiple-stacked-definitions.template +++ b/src/class-elements/productions/cls-decl-multiple-stacked-definitions.template @@ -19,8 +19,14 @@ class C { var c = new C(); assert.sameValue(c.foo, "foobar"); -assert.sameValue(Object.hasOwnProperty.call(C, "foo"), false); -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "foo"), false); +assert( + !Object.prototype.hasOwnProperty.call(C, "foo"), + "foo doesn't appear as an own property on the C constructor" +); +assert( + !Object.prototype.hasOwnProperty.call(C.prototype, "foo"), + "foo doesn't appear as an own property on the C prototype" +); verifyProperty(c, "foo", { value: "foobar", @@ -30,8 +36,14 @@ verifyProperty(c, "foo", { }); assert.sameValue(c.bar, "barbaz"); -assert.sameValue(Object.hasOwnProperty.call(C, "bar"), false); -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "bar"), false); +assert( + !Object.prototype.hasOwnProperty.call(C, "bar"), + "bar doesn't appear as an own property on the C constructor" +); +assert( + !Object.prototype.hasOwnProperty.call(C.prototype, "bar"), + "bar doesn't appear as an own property on the C prototype" +); verifyProperty(c, "bar", { value: "barbaz", diff --git a/src/class-elements/productions/cls-decl-new-no-sc-line-method.template b/src/class-elements/productions/cls-decl-new-no-sc-line-method.template index b8021e9189..a3be697506 100644 --- a/src/class-elements/productions/cls-decl-new-no-sc-line-method.template +++ b/src/class-elements/productions/cls-decl-new-no-sc-line-method.template @@ -19,7 +19,10 @@ var c = new C(); assert.sameValue(c.m(), 42); assert.sameValue(c.m, C.prototype.m); -assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert( + !Object.prototype.hasOwnProperty.call(c, "m"), + "m doesn't appear as an own property on the C instance" +); verifyProperty(C.prototype, "m", { enumerable: false, diff --git a/src/class-elements/productions/cls-decl-new-sc-line-generator.template b/src/class-elements/productions/cls-decl-new-sc-line-generator.template index e915233e77..67191bba62 100644 --- a/src/class-elements/productions/cls-decl-new-sc-line-generator.template +++ b/src/class-elements/productions/cls-decl-new-sc-line-generator.template @@ -19,7 +19,10 @@ var c = new C(); assert.sameValue(c.m().next().value, 42); assert.sameValue(c.m, C.prototype.m); -assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert( + !Object.prototype.hasOwnProperty.call(c, "m"), + "m doesn't appear as an own property on the C instance" +); verifyProperty(C.prototype, "m", { enumerable: false, diff --git a/src/class-elements/productions/cls-decl-new-sc-line-method.template b/src/class-elements/productions/cls-decl-new-sc-line-method.template index c58f9d0f25..cc3115ea9a 100644 --- a/src/class-elements/productions/cls-decl-new-sc-line-method.template +++ b/src/class-elements/productions/cls-decl-new-sc-line-method.template @@ -19,7 +19,10 @@ var c = new C(); assert.sameValue(c.m(), 42); assert.sameValue(c.m, C.prototype.m); -assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert( + !Object.prototype.hasOwnProperty.call(c, "m"), + "m doesn't appear as an own property on the C instance" +); verifyProperty(C.prototype, "m", { enumerable: false, diff --git a/src/class-elements/productions/cls-decl-same-line-generator.template b/src/class-elements/productions/cls-decl-same-line-generator.template index 185abc6e64..29c2fb58d9 100644 --- a/src/class-elements/productions/cls-decl-same-line-generator.template +++ b/src/class-elements/productions/cls-decl-same-line-generator.template @@ -18,7 +18,10 @@ var c = new C(); assert.sameValue(c.m().next().value, 42); assert.sameValue(c.m, C.prototype.m); -assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert( + !Object.prototype.hasOwnProperty.call(c, "m"), + "m doesn't appear as an own property on the C instance" +); verifyProperty(C.prototype, "m", { enumerable: false, diff --git a/src/class-elements/productions/cls-decl-same-line-method.template b/src/class-elements/productions/cls-decl-same-line-method.template index c69f4ebf47..72631a5391 100644 --- a/src/class-elements/productions/cls-decl-same-line-method.template +++ b/src/class-elements/productions/cls-decl-same-line-method.template @@ -18,7 +18,10 @@ var c = new C(); assert.sameValue(c.m(), 42); assert.sameValue(c.m, C.prototype.m); -assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert( + !Object.prototype.hasOwnProperty.call(c, "m"), + "m doesn't appear as an own property on the C instance" +); verifyProperty(C.prototype, "m", { enumerable: false, diff --git a/src/class-elements/productions/cls-expr-after-same-line-async-gen.template b/src/class-elements/productions/cls-expr-after-same-line-async-gen.template index efd9bfea6b..a0af38679a 100644 --- a/src/class-elements/productions/cls-expr-after-same-line-async-gen.template +++ b/src/class-elements/productions/cls-expr-after-same-line-async-gen.template @@ -17,7 +17,10 @@ var C = class { var c = new C(); -assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert( + !Object.prototype.hasOwnProperty.call(c, "m"), + "m doesn't appear as an own property on the C instance" +); assert.sameValue(c.m, C.prototype.m); verifyProperty(C.prototype, "m", { diff --git a/src/class-elements/productions/cls-expr-after-same-line-async-method.template b/src/class-elements/productions/cls-expr-after-same-line-async-method.template index eac4a800d3..356571e04f 100644 --- a/src/class-elements/productions/cls-expr-after-same-line-async-method.template +++ b/src/class-elements/productions/cls-expr-after-same-line-async-method.template @@ -17,7 +17,10 @@ var C = class { var c = new C(); -assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert( + !Object.prototype.hasOwnProperty.call(c, "m"), + "m doesn't appear as an own property on the C instance" +); assert.sameValue(c.m, C.prototype.m); verifyProperty(C.prototype, "m", { diff --git a/src/class-elements/productions/cls-expr-after-same-line-gen.template b/src/class-elements/productions/cls-expr-after-same-line-gen.template index 797659ac7e..eb36b10c88 100644 --- a/src/class-elements/productions/cls-expr-after-same-line-gen.template +++ b/src/class-elements/productions/cls-expr-after-same-line-gen.template @@ -17,7 +17,10 @@ var C = class { var c = new C(); assert.sameValue(c.m().next().value, 42); -assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert( + !Object.prototype.hasOwnProperty.call(c, "m"), + "m doesn't appear as an own property on the C instance" +); assert.sameValue(c.m, C.prototype.m); verifyProperty(C.prototype, "m", { diff --git a/src/class-elements/productions/cls-expr-after-same-line-method.template b/src/class-elements/productions/cls-expr-after-same-line-method.template index 4802e7e468..dd3251ebed 100644 --- a/src/class-elements/productions/cls-expr-after-same-line-method.template +++ b/src/class-elements/productions/cls-expr-after-same-line-method.template @@ -17,7 +17,10 @@ var C = class { var c = new C(); assert.sameValue(c.m(), 42); -assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert( + !Object.prototype.hasOwnProperty.call(c, "m"), + "m doesn't appear as an own property on the C instance" +); assert.sameValue(c.m, C.prototype.m); verifyProperty(C.prototype, "m", { diff --git a/src/class-elements/productions/cls-expr-after-same-line-static-async-gen.template b/src/class-elements/productions/cls-expr-after-same-line-static-async-gen.template index 8551243738..6f3258cfe8 100644 --- a/src/class-elements/productions/cls-expr-after-same-line-static-async-gen.template +++ b/src/class-elements/productions/cls-expr-after-same-line-static-async-gen.template @@ -17,8 +17,14 @@ var C = class { var c = new C(); -assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); +assert( + !Object.prototype.hasOwnProperty.call(c, "m"), + "m doesn't appear as an own property on the C instance" +); +assert( + !Object.prototype.hasOwnProperty.call(C.prototype, "m"), + "m doesn't appear as an own property on the C prototype" +); verifyProperty(C, "m", { enumerable: false, diff --git a/src/class-elements/productions/cls-expr-after-same-line-static-async-method.template b/src/class-elements/productions/cls-expr-after-same-line-static-async-method.template index af10d4babc..de374da1f7 100644 --- a/src/class-elements/productions/cls-expr-after-same-line-static-async-method.template +++ b/src/class-elements/productions/cls-expr-after-same-line-static-async-method.template @@ -17,8 +17,14 @@ var C = class { var c = new C(); -assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); +assert( + !Object.prototype.hasOwnProperty.call(c, "m"), + "m doesn't appear as an own property on the C instance" +); +assert( + !Object.prototype.hasOwnProperty.call(C.prototype, "m"), + "m doesn't appear as an own property on the C prototype" +); verifyProperty(C, "m", { enumerable: false, diff --git a/src/class-elements/productions/cls-expr-after-same-line-static-gen.template b/src/class-elements/productions/cls-expr-after-same-line-static-gen.template index e6febf4019..4e25e2587f 100644 --- a/src/class-elements/productions/cls-expr-after-same-line-static-gen.template +++ b/src/class-elements/productions/cls-expr-after-same-line-static-gen.template @@ -17,8 +17,14 @@ var C = class { var c = new C(); assert.sameValue(C.m().next().value, 42); -assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); +assert( + !Object.prototype.hasOwnProperty.call(c, "m"), + "m doesn't appear as an own property on the C instance" +); +assert( + !Object.prototype.hasOwnProperty.call(C.prototype, "m"), + "m doesn't appear as an own property on the C prototype" +); verifyProperty(C, "m", { enumerable: false, diff --git a/src/class-elements/productions/cls-expr-after-same-line-static-method.template b/src/class-elements/productions/cls-expr-after-same-line-static-method.template index 46439fb682..60516a4f8a 100644 --- a/src/class-elements/productions/cls-expr-after-same-line-static-method.template +++ b/src/class-elements/productions/cls-expr-after-same-line-static-method.template @@ -17,8 +17,14 @@ var C = class { var c = new C(); assert.sameValue(C.m(), 42); -assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); +assert( + !Object.prototype.hasOwnProperty.call(c, "m"), + "m doesn't appear as an own property on the C instance" +); +assert( + !Object.prototype.hasOwnProperty.call(C.prototype, "m"), + "m doesn't appear as an own property on the C prototype" +); verifyProperty(C, "m", { enumerable: false, diff --git a/src/class-elements/productions/cls-expr-multiple-definitions.template b/src/class-elements/productions/cls-expr-multiple-definitions.template index a790fa63c5..727a462b77 100644 --- a/src/class-elements/productions/cls-expr-multiple-definitions.template +++ b/src/class-elements/productions/cls-expr-multiple-definitions.template @@ -21,7 +21,10 @@ var C = class { var c = new C(); assert.sameValue(c.m(), 42); -assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert( + !Object.prototype.hasOwnProperty.call(c, "m"), + "m doesn't appear as an own property on the C instance" +); assert.sameValue(c.m, C.prototype.m); verifyProperty(C.prototype, "m", { @@ -31,7 +34,10 @@ verifyProperty(C.prototype, "m", { }); assert.sameValue(c.m2(), 39); -assert.sameValue(Object.hasOwnProperty.call(c, "m2"), false); +assert( + !Object.prototype.hasOwnProperty.call(c, "m2"), + "m2 doesn't appear as an own property on the C instance" +); assert.sameValue(c.m2, C.prototype.m2); verifyProperty(C.prototype, "m2", { @@ -41,8 +47,14 @@ verifyProperty(C.prototype, "m2", { }); assert.sameValue(c.foo, "foobar"); -assert.sameValue(Object.hasOwnProperty.call(C, "foo"), false); -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "foo"), false); +assert( + !Object.prototype.hasOwnProperty.call(C, "foo"), + "foo doesn't appear as an own property on the C constructor" +); +assert( + !Object.prototype.hasOwnProperty.call(C.prototype, "foo"), + "foo doesn't appear as an own property on the C prototype" +); verifyProperty(c, "foo", { value: "foobar", @@ -52,8 +64,14 @@ verifyProperty(c, "foo", { }); assert.sameValue(c.bar, "barbaz"); -assert.sameValue(Object.hasOwnProperty.call(C, "bar"), false); -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "bar"), false); +assert( + !Object.prototype.hasOwnProperty.call(C, "bar"), + "bar doesn't appear as an own property on the C constructor" +); +assert( + !Object.prototype.hasOwnProperty.call(C.prototype, "bar"), + "bar doesn't appear as an own property on the C prototype" +); verifyProperty(c, "bar", { value: "barbaz", diff --git a/src/class-elements/productions/cls-expr-multiple-stacked-definitions.template b/src/class-elements/productions/cls-expr-multiple-stacked-definitions.template index 4adcbf341f..e33db899fb 100644 --- a/src/class-elements/productions/cls-expr-multiple-stacked-definitions.template +++ b/src/class-elements/productions/cls-expr-multiple-stacked-definitions.template @@ -19,8 +19,14 @@ var C = class { var c = new C(); assert.sameValue(c.foo, "foobar"); -assert.sameValue(Object.hasOwnProperty.call(C, "foo"), false); -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "foo"), false); +assert( + !Object.prototype.hasOwnProperty.call(C, "foo"), + "foo doesn't appear as an own property on the C constructor" +); +assert( + !Object.prototype.hasOwnProperty.call(C.prototype, "foo"), + "foo doesn't appear as an own property on the C prototype" +); verifyProperty(c, "foo", { value: "foobar", @@ -30,8 +36,14 @@ verifyProperty(c, "foo", { }); assert.sameValue(c.bar, "barbaz"); -assert.sameValue(Object.hasOwnProperty.call(C, "bar"), false); -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "bar"), false); +assert( + !Object.prototype.hasOwnProperty.call(C, "bar"), + "bar doesn't appear as an own property on the C constructor" +); +assert( + !Object.prototype.hasOwnProperty.call(C.prototype, "bar"), + "bar doesn't appear as an own property on the C prototype" +); verifyProperty(c, "bar", { value: "barbaz", diff --git a/src/class-elements/productions/cls-expr-new-no-sc-line-method.template b/src/class-elements/productions/cls-expr-new-no-sc-line-method.template index ba99b599d5..3e35138bcc 100644 --- a/src/class-elements/productions/cls-expr-new-no-sc-line-method.template +++ b/src/class-elements/productions/cls-expr-new-no-sc-line-method.template @@ -19,7 +19,10 @@ var c = new C(); assert.sameValue(c.m(), 42); assert.sameValue(c.m, C.prototype.m); -assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert( + !Object.prototype.hasOwnProperty.call(c, "m"), + "m doesn't appear as an own property on the C instance" +); verifyProperty(C.prototype, "m", { enumerable: false, diff --git a/src/class-elements/productions/cls-expr-new-sc-line-generator.template b/src/class-elements/productions/cls-expr-new-sc-line-generator.template index ee5a2cee28..fbcfc173fa 100644 --- a/src/class-elements/productions/cls-expr-new-sc-line-generator.template +++ b/src/class-elements/productions/cls-expr-new-sc-line-generator.template @@ -19,7 +19,10 @@ var c = new C(); assert.sameValue(c.m().next().value, 42); assert.sameValue(c.m, C.prototype.m); -assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert( + !Object.prototype.hasOwnProperty.call(c, "m"), + "m doesn't appear as an own property on the C instance" +); verifyProperty(C.prototype, "m", { enumerable: false, diff --git a/src/class-elements/productions/cls-expr-new-sc-line-method.template b/src/class-elements/productions/cls-expr-new-sc-line-method.template index 1d864f8994..bca5ed46c4 100644 --- a/src/class-elements/productions/cls-expr-new-sc-line-method.template +++ b/src/class-elements/productions/cls-expr-new-sc-line-method.template @@ -19,7 +19,10 @@ var c = new C(); assert.sameValue(c.m(), 42); assert.sameValue(c.m, C.prototype.m); -assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert( + !Object.prototype.hasOwnProperty.call(c, "m"), + "m doesn't appear as an own property on the C instance" +); verifyProperty(C.prototype, "m", { enumerable: false, diff --git a/src/class-elements/productions/cls-expr-same-line-generator.template b/src/class-elements/productions/cls-expr-same-line-generator.template index 7e7e2280a1..c64f43c4bd 100644 --- a/src/class-elements/productions/cls-expr-same-line-generator.template +++ b/src/class-elements/productions/cls-expr-same-line-generator.template @@ -18,7 +18,10 @@ var c = new C(); assert.sameValue(c.m().next().value, 42); assert.sameValue(c.m, C.prototype.m); -assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert( + !Object.prototype.hasOwnProperty.call(c, "m"), + "m doesn't appear as an own property on the C instance" +); verifyProperty(C.prototype, "m", { enumerable: false, diff --git a/src/class-elements/productions/cls-expr-same-line-method.template b/src/class-elements/productions/cls-expr-same-line-method.template index 93ab10f298..ab6eb4222a 100644 --- a/src/class-elements/productions/cls-expr-same-line-method.template +++ b/src/class-elements/productions/cls-expr-same-line-method.template @@ -18,7 +18,10 @@ var c = new C(); assert.sameValue(c.m(), 42); assert.sameValue(c.m, C.prototype.m); -assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert( + !Object.prototype.hasOwnProperty.call(c, "m"), + "m doesn't appear as an own property on the C instance" +); verifyProperty(C.prototype, "m", { enumerable: false, diff --git a/src/class-elements/redeclaration-symbol.case b/src/class-elements/redeclaration-symbol.case index fc7eaa468f..95e9ae920d 100644 --- a/src/class-elements/redeclaration-symbol.case +++ b/src/class-elements/redeclaration-symbol.case @@ -40,8 +40,14 @@ var y = Symbol(); //- assertions var c = new C(); -assert.sameValue(Object.hasOwnProperty.call(C.prototype, y), false); -assert.sameValue(Object.hasOwnProperty.call(C, y), false); +assert( + !Object.prototype.hasOwnProperty.call(C.prototype, y), + "y does not appear as an own property on C prototype" +); +assert( + !Object.prototype.hasOwnProperty.call(C, y), + "y does not appear as an own property on C constructor" +); verifyProperty(c, y, { value: "same_value", diff --git a/src/class-elements/redeclaration.case b/src/class-elements/redeclaration.case index 880cbc9900..92fe746624 100644 --- a/src/class-elements/redeclaration.case +++ b/src/class-elements/redeclaration.case @@ -40,8 +40,14 @@ y = (x.push("d"), "same_value"); //- assertions var c = new C(); -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "y"), false); -assert.sameValue(Object.hasOwnProperty.call(C, "y"), false); +assert( + !Object.prototype.hasOwnProperty.call(C.prototype, "y"), + "y does not appear as an own property on C prototype" +); +assert( + !Object.prototype.hasOwnProperty.call(C, "y"), + "y does not appear as an own property on C constructor" +); verifyProperty(c, "y", { value: "same_value", diff --git a/src/class-elements/static-field-declaration.case b/src/class-elements/static-field-declaration.case index 663ab13adf..dcb0ababf4 100644 --- a/src/class-elements/static-field-declaration.case +++ b/src/class-elements/static-field-declaration.case @@ -81,10 +81,22 @@ assert.sameValue(c.g, undefined); assert.sameValue(c.h, undefined); assert.sameValue(c[0], undefined); -assert.sameValue(Object.hasOwnProperty.call(c, 'f'), false); -assert.sameValue(Object.hasOwnProperty.call(c, 'g'), false); -assert.sameValue(Object.hasOwnProperty.call(c, 'h'), false); -assert.sameValue(Object.hasOwnProperty.call(c, 0), false); +assert( + !Object.prototype.hasOwnProperty.call(c, 'f'), + "f does not appear as an own property on the C instance" +); +assert( + !Object.prototype.hasOwnProperty.call(c, 'g'), + "g does not appear as an own property on the C instance" +); +assert( + !Object.prototype.hasOwnProperty.call(c, 'h'), + "h does not appear as an own property on the C instance" +); +assert( + !Object.prototype.hasOwnProperty.call(c, 0), + "0 does not appear as an own property on the C instance" +); verifyProperty(C, 'f', { value: 'test262', diff --git a/src/class-elements/static-private-fields.case b/src/class-elements/static-private-fields.case index dad5916911..cc2f0bc325 100644 --- a/src/class-elements/static-private-fields.case +++ b/src/class-elements/static-private-fields.case @@ -35,18 +35,18 @@ static y() { //- assertions // Test the private fields do not appear as properties before set to value -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#x"), false, "test 1"); -assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 2"); -assert.sameValue(Object.hasOwnProperty.call(c, "#x"), false, "test 3"); +assert(!Object.prototype.hasOwnProperty.call(C.prototype, "#x"), "test 1"); +assert(!Object.prototype.hasOwnProperty.call(C, "#x"), "test 2"); +assert(!Object.prototype.hasOwnProperty.call(c, "#x"), "test 3"); -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#y"), false, "test 4"); -assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 5"); -assert.sameValue(Object.hasOwnProperty.call(c, "#y"), false, "test 6"); +assert(!Object.prototype.hasOwnProperty.call(C.prototype, "#y"), "test 4"); +assert(!Object.prototype.hasOwnProperty.call(C, "#y"), "test 5"); +assert(!Object.prototype.hasOwnProperty.call(c, "#y"), "test 6"); // Test if private fields can be sucessfully accessed and set to value assert.sameValue(C.x(), 42, "test 7"); assert.sameValue(C.y(), 43, "test 8"); // Test the private fields do not appear as properties before after set to value -assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 9"); -assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 10"); +assert(!Object.prototype.hasOwnProperty.call(C, "#x"), "test 9"); +assert(!Object.prototype.hasOwnProperty.call(C, "#y"), "test 10"); diff --git a/src/class-elements/static-private-methods-with-fields.case b/src/class-elements/static-private-methods-with-fields.case index 2aebdd2737..f5d360445d 100644 --- a/src/class-elements/static-private-methods-with-fields.case +++ b/src/class-elements/static-private-methods-with-fields.case @@ -41,29 +41,29 @@ static y() { //- assertions // Test the private methods do not appear as properties before set to value -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#x"), false, "test 1"); -assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 2"); -assert.sameValue(Object.hasOwnProperty.call(c, "#x"), false, "test 3"); +assert(!Object.prototype.hasOwnProperty.call(C.prototype, "#x"), "test 1"); +assert(!Object.prototype.hasOwnProperty.call(C, "#x"), "test 2"); +assert(!Object.prototype.hasOwnProperty.call(c, "#x"), "test 3"); -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#y"), false, "test 4"); -assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 5"); -assert.sameValue(Object.hasOwnProperty.call(c, "#y"), false, "test 6"); +assert(!Object.prototype.hasOwnProperty.call(C.prototype, "#y"), "test 4"); +assert(!Object.prototype.hasOwnProperty.call(C, "#y"), "test 5"); +assert(!Object.prototype.hasOwnProperty.call(c, "#y"), "test 6"); -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#xVal"), false, "test 7"); -assert.sameValue(Object.hasOwnProperty.call(C, "#xVal"), false, "test 8"); -assert.sameValue(Object.hasOwnProperty.call(c, "#xVal"), false, "test 9"); +assert(!Object.prototype.hasOwnProperty.call(C.prototype, "#xVal"), "test 7"); +assert(!Object.prototype.hasOwnProperty.call(C, "#xVal"), "test 8"); +assert(!Object.prototype.hasOwnProperty.call(c, "#xVal"), "test 9"); -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#yVal"), false, "test 10"); -assert.sameValue(Object.hasOwnProperty.call(C, "#yVal"), false, "test 11"); -assert.sameValue(Object.hasOwnProperty.call(c, "#yVal"), false, "test 12"); +assert(!Object.prototype.hasOwnProperty.call(C.prototype, "#yVal"), "test 10"); +assert(!Object.prototype.hasOwnProperty.call(C, "#yVal"), "test 11"); +assert(!Object.prototype.hasOwnProperty.call(c, "#yVal"), "test 12"); // Test if private fields can be sucessfully accessed and set to value assert.sameValue(C.x(), 42, "test 13"); assert.sameValue(C.y(), 43, "test 14"); // Test the private fields do not appear as properties before after set to value -assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 15"); -assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 16"); +assert(!Object.prototype.hasOwnProperty.call(C, "#x"), "test 15"); +assert(!Object.prototype.hasOwnProperty.call(C, "#y"), "test 16"); -assert.sameValue(Object.hasOwnProperty.call(C, "#xVal"), false, "test 17"); -assert.sameValue(Object.hasOwnProperty.call(C, "#yVal"), false, "test 18"); +assert(!Object.prototype.hasOwnProperty.call(C, "#xVal"), "test 17"); +assert(!Object.prototype.hasOwnProperty.call(C, "#yVal"), "test 18"); diff --git a/src/class-elements/static-private-methods.case b/src/class-elements/static-private-methods.case index 9d86d6ac69..dd98b81de8 100644 --- a/src/class-elements/static-private-methods.case +++ b/src/class-elements/static-private-methods.case @@ -37,18 +37,18 @@ static y() { //- assertions // Test the private methods do not appear as properties before set to value -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#x"), false, "test 1"); -assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 2"); -assert.sameValue(Object.hasOwnProperty.call(c, "#x"), false, "test 3"); +assert(!Object.prototype.hasOwnProperty.call(C.prototype, "#x"), "test 1"); +assert(!Object.prototype.hasOwnProperty.call(C, "#x"), "test 2"); +assert(!Object.prototype.hasOwnProperty.call(c, "#x"), "test 3"); -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#y"), false, "test 4"); -assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 5"); -assert.sameValue(Object.hasOwnProperty.call(c, "#y"), false, "test 6"); +assert(!Object.prototype.hasOwnProperty.call(C.prototype, "#y"), "test 4"); +assert(!Object.prototype.hasOwnProperty.call(C, "#y"), "test 5"); +assert(!Object.prototype.hasOwnProperty.call(c, "#y"), "test 6"); // Test if private fields can be sucessfully accessed and set to value assert.sameValue(C.x(), 42, "test 7"); assert.sameValue(C.y(), 86, "test 8"); // Test the private fields do not appear as properties before after set to value -assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 9"); -assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 10"); +assert(!Object.prototype.hasOwnProperty.call(C, "#x"), "test 9"); +assert(!Object.prototype.hasOwnProperty.call(C, "#y"), "test 10"); diff --git a/src/class-elements/string-literal-names.case b/src/class-elements/string-literal-names.case index 8ee06788e8..e8fac590b1 100644 --- a/src/class-elements/string-literal-names.case +++ b/src/class-elements/string-literal-names.case @@ -22,8 +22,14 @@ features: [class-fields-public] 'a'; "b"; 'c' = 39; "d" = 42 //- assertions -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "a"), false); -assert.sameValue(Object.hasOwnProperty.call(C, "a"), false); +assert( + !Object.prototype.hasOwnProperty.call(C.prototype, "a"), + "a does not appear as an own property on C prototype" +); +assert( + !Object.prototype.hasOwnProperty.call(C, "a"), + "a does not appear as an own property on C constructor" +); verifyProperty(c, "a", { value: undefined, @@ -32,8 +38,14 @@ verifyProperty(c, "a", { configurable: true }); -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "b"), false); -assert.sameValue(Object.hasOwnProperty.call(C, "b"), false); +assert( + !Object.prototype.hasOwnProperty.call(C.prototype, "b"), + "b does not appear as an own property on C prototype" +); +assert( + !Object.prototype.hasOwnProperty.call(C, "b"), + "b does not appear as an own property on C constructor" +); verifyProperty(c, "b", { value: undefined, @@ -42,8 +54,14 @@ verifyProperty(c, "b", { configurable: true }); -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "c"), false); -assert.sameValue(Object.hasOwnProperty.call(C, "c"), false); +assert( + !Object.prototype.hasOwnProperty.call(C.prototype, "c"), + "c does not appear as an own property on C prototype" +); +assert( + !Object.prototype.hasOwnProperty.call(C, "c"), + "c does not appear as an own property on C constructor" +); verifyProperty(c, "c", { value: 39, @@ -52,8 +70,14 @@ verifyProperty(c, "c", { configurable: true }); -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "d"), false); -assert.sameValue(Object.hasOwnProperty.call(C, "d"), false); +assert( + !Object.prototype.hasOwnProperty.call(C.prototype, "d"), + "d does not appear as an own property on C prototype" +); +assert( + !Object.prototype.hasOwnProperty.call(C, "d"), + "d does not appear as an own property on C constructor" +); verifyProperty(c, "d", { value: 42, diff --git a/src/generators/default/class-decl-private-method.template b/src/generators/default/class-decl-private-method.template index 4085202f55..d2ed8d7621 100644 --- a/src/generators/default/class-decl-private-method.template +++ b/src/generators/default/class-decl-private-method.template @@ -31,9 +31,18 @@ class C { const c = new C(); // Test the private fields do not appear as properties before set to value -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#gen"), false, 'Object.hasOwnProperty.call(C.prototype, "#gen")'); -assert.sameValue(Object.hasOwnProperty.call(C, "#gen"), false, 'Object.hasOwnProperty.call(C, "#gen")'); -assert.sameValue(Object.hasOwnProperty.call(c, "#gen"), false, 'Object.hasOwnProperty.call(c, "#gen")'); +assert( + !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"), + "Private field '#gen' does not appear as an own property on C prototype" +); +assert( + !Object.prototype.hasOwnProperty.call(C, "#gen"), + "Private field '#gen' does not appear as an own property on C constructor" +); +assert( + !Object.prototype.hasOwnProperty.call(c, "#gen"), + "Private field '#gen' does not appear as an own property on C instance" +); var iter = c.gen(); @@ -42,6 +51,15 @@ var iter = c.gen(); assert.sameValue(callCount, 1); // Test the private fields do not appear as properties after set to value -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#gen"), false, 'Object.hasOwnProperty.call(C.prototype, "#gen")'); -assert.sameValue(Object.hasOwnProperty.call(C, "#gen"), false, 'Object.hasOwnProperty.call(C, "#gen")'); -assert.sameValue(Object.hasOwnProperty.call(c, "#gen"), false, 'Object.hasOwnProperty.call(c, "#gen")'); +assert( + !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"), + "Private field '#gen' does not appear as an own property on C prototype" +); +assert( + !Object.prototype.hasOwnProperty.call(C, "#gen"), + "Private field '#gen' does not appear as an own property on C constructor" +); +assert( + !Object.prototype.hasOwnProperty.call(c, "#gen"), + "Private field '#gen' does not appear as an own property on C instance" +); diff --git a/src/generators/default/class-decl-static-private-method.template b/src/generators/default/class-decl-static-private-method.template index 83e865f3cd..1f6cc210bb 100644 --- a/src/generators/default/class-decl-static-private-method.template +++ b/src/generators/default/class-decl-static-private-method.template @@ -29,8 +29,14 @@ class C { } // Test the private fields do not appear as properties before set to value -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#gen"), false, 'Object.hasOwnProperty.call(C.prototype, "#gen")'); -assert.sameValue(Object.hasOwnProperty.call(C, "#gen"), false, 'Object.hasOwnProperty.call(C, "#gen")'); +assert( + !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"), + "Private field '#gen' does not appear as an own property on C prototype" +); +assert( + !Object.prototype.hasOwnProperty.call(C, "#gen"), + "Private field '#gen' does not appear as an own property on C constructor" +); var iter = C.gen(); @@ -39,5 +45,11 @@ var iter = C.gen(); assert.sameValue(callCount, 1); // Test the private fields do not appear as properties before set to value -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#gen"), false, 'Object.hasOwnProperty.call(C.prototype, "#gen")'); -assert.sameValue(Object.hasOwnProperty.call(C, "#gen"), false, 'Object.hasOwnProperty.call(C, "#gen")'); +assert( + !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"), + "Private field '#gen' does not appear as an own property on C prototype" +); +assert( + !Object.prototype.hasOwnProperty.call(C, "#gen"), + "Private field '#gen' does not appear as an own property on C constructor" +); diff --git a/src/generators/default/class-expr-private-method.template b/src/generators/default/class-expr-private-method.template index f4813630d7..b399aefede 100644 --- a/src/generators/default/class-expr-private-method.template +++ b/src/generators/default/class-expr-private-method.template @@ -31,9 +31,18 @@ var C = class { const c = new C(); // Test the private fields do not appear as properties before set to value -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#gen"), false, 'Object.hasOwnProperty.call(C.prototype, "#gen")'); -assert.sameValue(Object.hasOwnProperty.call(C, "#gen"), false, 'Object.hasOwnProperty.call(C, "#gen")'); -assert.sameValue(Object.hasOwnProperty.call(c, "#gen"), false, 'Object.hasOwnProperty.call(c, "#gen")'); +assert( + !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"), + "Private field '#gen' does not appear as an own property on C prototype" +); +assert( + !Object.prototype.hasOwnProperty.call(C, "#gen"), + "Private field '#gen' does not appear as an own property on C constructor" +); +assert( + !Object.prototype.hasOwnProperty.call(c, "#gen"), + "Private field '#gen' does not appear as an own property on C instance" +); var iter = c.gen(); @@ -42,6 +51,15 @@ var iter = c.gen(); assert.sameValue(callCount, 1); // Test the private fields do not appear as properties after set to value -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#gen"), false, 'Object.hasOwnProperty.call(C.prototype, "#gen")'); -assert.sameValue(Object.hasOwnProperty.call(C, "#gen"), false, 'Object.hasOwnProperty.call(C, "#gen")'); -assert.sameValue(Object.hasOwnProperty.call(c, "#gen"), false, 'Object.hasOwnProperty.call(c, "#gen")'); +assert( + !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"), + "Private field '#gen' does not appear as an own property on C prototype" +); +assert( + !Object.prototype.hasOwnProperty.call(C, "#gen"), + "Private field '#gen' does not appear as an own property on C constructor" +); +assert( + !Object.prototype.hasOwnProperty.call(c, "#gen"), + "Private field '#gen' does not appear as an own property on C instance" +); diff --git a/src/generators/default/class-expr-static-private-method.template b/src/generators/default/class-expr-static-private-method.template index b42a00a2b2..8e2cad27d8 100644 --- a/src/generators/default/class-expr-static-private-method.template +++ b/src/generators/default/class-expr-static-private-method.template @@ -29,8 +29,14 @@ var C = class { } // Test the private fields do not appear as properties before set to value -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#gen"), false, 'Object.hasOwnProperty.call(C.prototype, "#gen")'); -assert.sameValue(Object.hasOwnProperty.call(C, "#gen"), false, 'Object.hasOwnProperty.call(C, "#gen")'); +assert( + !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"), + "Private field '#gen' does not appear as an own property on C prototype" +); +assert( + !Object.prototype.hasOwnProperty.call(C, "#gen"), + "Private field '#gen' does not appear as an own property on C constructor" +); var iter = C.gen(); @@ -39,5 +45,11 @@ var iter = C.gen(); assert.sameValue(callCount, 1); // Test the private fields do not appear as properties before set to value -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#gen"), false, 'Object.hasOwnProperty.call(C.prototype, "#gen")'); -assert.sameValue(Object.hasOwnProperty.call(C, "#gen"), false, 'Object.hasOwnProperty.call(C, "#gen")'); +assert( + !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"), + "Private field '#gen' does not appear as an own property on C prototype" +); +assert( + !Object.prototype.hasOwnProperty.call(C, "#gen"), + "Private field '#gen' does not appear as an own property on C constructor" +); diff --git a/src/generators/yield-identifier-spread-non-strict.case b/src/generators/yield-identifier-spread-non-strict.case index 6659a5d4d7..333960c15f 100644 --- a/src/generators/yield-identifier-spread-non-strict.case +++ b/src/generators/yield-identifier-spread-non-strict.case @@ -45,5 +45,5 @@ assert.sameValue(value.z, 30); assert.sameValue(value.a, 1); assert.sameValue(value.b, 2); assert.sameValue(value[s], 42); -assert(Object.hasOwnProperty.call(value, s)); +assert(Object.prototype.hasOwnProperty.call(value, s), "s is an own property"); assert.sameValue(Object.keys(value).length, 5); diff --git a/src/spread/obj-symbol-property.case b/src/spread/obj-symbol-property.case index 2f7bc5dd9f..46b394fb83 100644 --- a/src/spread/obj-symbol-property.case +++ b/src/spread/obj-symbol-property.case @@ -29,7 +29,7 @@ obj //- body assert.sameValue(obj[symbol], 1); -assert(Object.hasOwnProperty.call(obj, symbol)); +assert(Object.prototype.hasOwnProperty.call(obj, symbol), "symbol is an own property"); assert.sameValue(obj.c, 4); assert.sameValue(obj.d, 5); assert.sameValue(Object.keys(obj).length, 2); diff --git a/test/built-ins/Array/prototype/Symbol.unscopables/change-array-by-copy.js b/test/built-ins/Array/prototype/Symbol.unscopables/change-array-by-copy.js index 4e734f8ee6..2703c3565c 100644 --- a/test/built-ins/Array/prototype/Symbol.unscopables/change-array-by-copy.js +++ b/test/built-ins/Array/prototype/Symbol.unscopables/change-array-by-copy.js @@ -26,4 +26,4 @@ for (const unscopable of ["toReversed", "toSorted", "toSpliced"]) { }) }; -assert.sameValue(Object.hasOwnProperty.call(unscopables, "with"), false, "does not have `with`"); +assert(!Object.prototype.hasOwnProperty.call(unscopables, "with"), "does not have `with`"); diff --git a/test/built-ins/AsyncFromSyncIteratorPrototype/next/iterator-result-prototype.js b/test/built-ins/AsyncFromSyncIteratorPrototype/next/iterator-result-prototype.js index 06ebc60d80..155ad920b3 100644 --- a/test/built-ins/AsyncFromSyncIteratorPrototype/next/iterator-result-prototype.js +++ b/test/built-ins/AsyncFromSyncIteratorPrototype/next/iterator-result-prototype.js @@ -33,10 +33,10 @@ async function* asyncg() { asyncg().next().then(function (result) { assert( - Object.hasOwnProperty.call(result, 'value'), 'Has "own" property `value`' + Object.prototype.hasOwnProperty.call(result, 'value'), 'Has "own" property `value`' ); assert( - Object.hasOwnProperty.call(result, 'done'), 'Has "own" property `done`' + Object.prototype.hasOwnProperty.call(result, 'done'), 'Has "own" property `done`' ); assert.sameValue(Object.getPrototypeOf(result), Object.prototype); }).then($DONE, $DONE); diff --git a/test/built-ins/AsyncGeneratorPrototype/next/iterator-result-prototype.js b/test/built-ins/AsyncGeneratorPrototype/next/iterator-result-prototype.js index 47b3ddd44a..68bed06d6e 100644 --- a/test/built-ins/AsyncGeneratorPrototype/next/iterator-result-prototype.js +++ b/test/built-ins/AsyncGeneratorPrototype/next/iterator-result-prototype.js @@ -37,10 +37,10 @@ async function* g() {} g().next().then(function (result) { assert( - Object.hasOwnProperty.call(result, 'value'), 'Has "own" property `value`' + Object.prototype.hasOwnProperty.call(result, 'value'), 'Has "own" property `value`' ); assert( - Object.hasOwnProperty.call(result, 'done'), 'Has "own" property `done`' + Object.prototype.hasOwnProperty.call(result, 'done'), 'Has "own" property `done`' ); assert.sameValue(Object.getPrototypeOf(result), Object.prototype); }).then($DONE, $DONE) diff --git a/test/built-ins/AsyncGeneratorPrototype/return/iterator-result-prototype.js b/test/built-ins/AsyncGeneratorPrototype/return/iterator-result-prototype.js index efb01f7beb..2b3154d072 100644 --- a/test/built-ins/AsyncGeneratorPrototype/return/iterator-result-prototype.js +++ b/test/built-ins/AsyncGeneratorPrototype/return/iterator-result-prototype.js @@ -38,10 +38,10 @@ async function* g() {} g().return().then(function (result) { assert( - Object.hasOwnProperty.call(result, 'value'), 'Has "own" property `value`' + Object.prototype.hasOwnProperty.call(result, 'value'), 'Has "own" property `value`' ); assert( - Object.hasOwnProperty.call(result, 'done'), 'Has "own" property `done`' + Object.prototype.hasOwnProperty.call(result, 'done'), 'Has "own" property `done`' ); assert.sameValue(Object.getPrototypeOf(result), Object.prototype); }).then($DONE, $DONE) diff --git a/test/built-ins/GeneratorPrototype/next/result-prototype.js b/test/built-ins/GeneratorPrototype/next/result-prototype.js index a65010b87b..d62be02a71 100644 --- a/test/built-ins/GeneratorPrototype/next/result-prototype.js +++ b/test/built-ins/GeneratorPrototype/next/result-prototype.js @@ -12,9 +12,9 @@ function* g() {} var result = g().next(); assert( - Object.hasOwnProperty.call(result, 'value'), 'Has "own" property `value`' + Object.prototype.hasOwnProperty.call(result, 'value'), 'Has "own" property `value`' ); assert( - Object.hasOwnProperty.call(result, 'done'), 'Has "own" property `done`' + Object.prototype.hasOwnProperty.call(result, 'done'), 'Has "own" property `done`' ); assert.sameValue(Object.getPrototypeOf(result), Object.prototype); diff --git a/test/built-ins/Object/S15.2.3_A3.js b/test/built-ins/Object/S15.2.3_A3.js index 7089a87156..99f67435c6 100644 --- a/test/built-ins/Object/S15.2.3_A3.js +++ b/test/built-ins/Object/S15.2.3_A3.js @@ -7,8 +7,8 @@ es5id: 15.2.3_A3 description: Checking Object.length ---*/ assert( - !!Object.hasOwnProperty("length"), - 'The value of !!Object.hasOwnProperty("length") is expected to be true' + Object.prototype.hasOwnProperty.call(Object, "length"), + "The Object constructor has a 'length' own property" ); assert.sameValue(Object.length, 1, 'The value of Object.length is expected to be 1'); diff --git a/test/built-ins/Object/assign/source-non-enum.js b/test/built-ins/Object/assign/source-non-enum.js index 206435af4b..c62bc1f71f 100644 --- a/test/built-ins/Object/assign/source-non-enum.js +++ b/test/built-ins/Object/assign/source-non-enum.js @@ -21,5 +21,8 @@ var result; result = Object.assign(target, source); -assert.sameValue(Object.hasOwnProperty.call(target, 'attr'), false); +assert( + !Object.prototype.hasOwnProperty.call(target, 'attr'), + "Non-enumerable property 'attr' does not get copied to target" +); assert.sameValue(result, target); diff --git a/test/built-ins/Object/assign/source-own-prop-desc-missing.js b/test/built-ins/Object/assign/source-own-prop-desc-missing.js index 03392b33dc..ac09d7aeb2 100644 --- a/test/built-ins/Object/assign/source-own-prop-desc-missing.js +++ b/test/built-ins/Object/assign/source-own-prop-desc-missing.js @@ -27,9 +27,8 @@ var source = new Proxy({}, { result = Object.assign(target, source); assert.sameValue(callCount, 1, 'Proxy trap was invoked exactly once'); -assert.sameValue( - Object.hasOwnProperty.call(target, 'missing'), - false, +assert( + !Object.prototype.hasOwnProperty.call(target, 'missing'), 'An own property was not created for a property without a property descriptor' ); assert.sameValue(result, target); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-4-116.js b/test/built-ins/Object/defineProperty/15.2.3.6-4-116.js index 2e0c7b7fa6..317c238c50 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-4-116.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-4-116.js @@ -6,6 +6,7 @@ es5id: 15.2.3.6-4-116 description: > Object.defineProperty - 'O' is an Array, test the length property of 'O' is own data property (15.4.5.1 step 1) +includes: [propertyHelper.js] ---*/ var arrObj = [0, 1]; @@ -20,10 +21,9 @@ assert.throws(TypeError, function() { }); }); -var desc = Object.getOwnPropertyDescriptor(arrObj, "length"); - -assert(Object.hasOwnProperty.call(arrObj, "length"), 'Object.hasOwnProperty.call(arrObj, "length")'); -assert.sameValue(desc.value, 2, 'desc.value'); -assert.sameValue(desc.writable, true, 'desc.writable'); -assert.sameValue(desc.configurable, false, 'desc.configurable'); -assert.sameValue(desc.enumerable, false, 'desc.enumerable'); +verifyProperty(arrObj, "length", { + value: 2, + writable: true, + configurable: false, + enumerable: false, +}); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-4-598.js b/test/built-ins/Object/defineProperty/15.2.3.6-4-598.js index b1a5e8a5c7..54e3cfe6b7 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-4-598.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-4-598.js @@ -6,31 +6,11 @@ es5id: 15.2.3.6-4-598 description: > ES5 Attributes - all attributes in Object.getPrototypeOf are correct +includes: [propertyHelper.js] ---*/ -var desc = Object.getOwnPropertyDescriptor(Object, "getPrototypeOf"); - -var propertyAreCorrect = (desc.writable === true && desc.enumerable === false && desc.configurable === true); - -var temp = Object.getPrototypeOf; - -Object.getPrototypeOf = "2010"; - -var isWritable = (Object.getPrototypeOf === "2010"); - -var isEnumerable = false; - -for (var prop in Object) { - if (prop === "getPrototypeOf") { - isEnumerable = true; - } -} - -delete Object.getPrototypeOf; - -var isConfigurable = !Object.hasOwnProperty("getPrototypeOf"); - -assert(propertyAreCorrect, 'propertyAreCorrect !== true'); -assert(isWritable, 'isWritable !== true'); -assert.sameValue(isEnumerable, false, 'isEnumerable'); -assert(isConfigurable, 'isConfigurable !== true'); +verifyProperty(Object, "getPrototypeOf", { + writable: true, + enumerable: false, + configurable: true, +}); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-4-599.js b/test/built-ins/Object/defineProperty/15.2.3.6-4-599.js index 129ad54029..0154df06f7 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-4-599.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-4-599.js @@ -6,31 +6,11 @@ es5id: 15.2.3.6-4-599 description: > ES5 Attributes - all attributes in Object.getOwnPropertyDescriptor are correct +includes: [propertyHelper.js] ---*/ -var desc = Object.getOwnPropertyDescriptor(Object, "getOwnPropertyDescriptor"); - -var propertyAreCorrect = (desc.writable === true && desc.enumerable === false && desc.configurable === true); - -var temp = Object.getOwnPropertyDescriptor; - -Object.getOwnPropertyDescriptor = "2010"; - -var isWritable = (Object.getOwnPropertyDescriptor === "2010"); - -var isEnumerable = false; - -for (var prop in Object) { - if (prop === "getOwnPropertyDescriptor") { - isEnumerable = true; - } -} - -delete Object.getOwnPropertyDescriptor; - -var isConfigurable = !Object.hasOwnProperty("getOwnPropertyDescriptor"); - -assert(propertyAreCorrect, 'propertyAreCorrect !== true'); -assert(isWritable, 'isWritable !== true'); -assert.sameValue(isEnumerable, false, 'isEnumerable'); -assert(isConfigurable, 'isConfigurable !== true'); +verifyProperty(Object, "getOwnPropertyDescriptor", { + writable: true, + enumerable: false, + configurable: true, +}); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-4-600.js b/test/built-ins/Object/defineProperty/15.2.3.6-4-600.js index c9775c52fa..dfa4e0da38 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-4-600.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-4-600.js @@ -6,31 +6,11 @@ es5id: 15.2.3.6-4-600 description: > ES5 Attributes - all attributes in Object.getOwnPropertyNames are correct +includes: [propertyHelper.js] ---*/ -var desc = Object.getOwnPropertyDescriptor(Object, "getOwnPropertyNames"); - -var propertyAreCorrect = (desc.writable === true && desc.enumerable === false && desc.configurable === true); - -var temp = Object.getOwnPropertyNames; - -Object.getOwnPropertyNames = "2010"; - -var isWritable = (Object.getOwnPropertyNames === "2010"); - -var isEnumerable = false; - -for (var prop in Object) { - if (prop === "getOwnPropertyNames") { - isEnumerable = true; - } -} - -delete Object.getOwnPropertyNames; - -var isConfigurable = !Object.hasOwnProperty("getOwnPropertyNames"); - -assert(propertyAreCorrect, 'propertyAreCorrect !== true'); -assert(isWritable, 'isWritable !== true'); -assert.sameValue(isEnumerable, false, 'isEnumerable'); -assert(isConfigurable, 'isConfigurable !== true'); +verifyProperty(Object, "getOwnPropertyNames", { + writable: true, + enumerable: false, + configurable: true, +}); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-4-601.js b/test/built-ins/Object/defineProperty/15.2.3.6-4-601.js index 930b2b8419..dc86f5650c 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-4-601.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-4-601.js @@ -4,31 +4,11 @@ /*--- es5id: 15.2.3.6-4-601 description: ES5 Attributes - all attributes in Object.create are correct +includes: [propertyHelper.js] ---*/ -var desc = Object.getOwnPropertyDescriptor(Object, "create"); - -var propertyAreCorrect = (desc.writable === true && desc.enumerable === false && desc.configurable === true); - -var temp = Object.create; - -Object.create = "2010"; - -var isWritable = (Object.create === "2010"); - -var isEnumerable = false; - -for (var prop in Object) { - if (prop === "create") { - isEnumerable = true; - } -} - -delete Object.create; - -var isConfigurable = !Object.hasOwnProperty("create"); - -assert(propertyAreCorrect, 'propertyAreCorrect !== true'); -assert(isWritable, 'isWritable !== true'); -assert.sameValue(isEnumerable, false, 'isEnumerable'); -assert(isConfigurable, 'isConfigurable !== true'); +verifyProperty(Object, "getPrototypeOf", { + writable: true, + enumerable: false, + configurable: true, +}); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-4-602.js b/test/built-ins/Object/defineProperty/15.2.3.6-4-602.js index 61eb16bb60..dff3cb8ba1 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-4-602.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-4-602.js @@ -6,30 +6,11 @@ es5id: 15.2.3.6-4-602 description: > ES5 Attributes - all attributes in Object.defineProperty are correct +includes: [propertyHelper.js] ---*/ -var desc = Object.getOwnPropertyDescriptor(Object, "defineProperty"); - -var propertyAreCorrect = (desc.writable === true && desc.enumerable === false && desc.configurable === true); -var temp = Object.defineProperty; - -Object.defineProperty = "2010"; - -var isWritable = (Object.defineProperty === "2010"); - -var isEnumerable = false; - -for (var prop in Object) { - if (prop === "defineProperty") { - isEnumerable = true; - } -} - -delete Object.defineProperty; - -var isConfigurable = !Object.hasOwnProperty("defineProperty"); - -assert(propertyAreCorrect, 'propertyAreCorrect !== true'); -assert(isWritable, 'isWritable !== true'); -assert.sameValue(isEnumerable, false, 'isEnumerable'); -assert(isConfigurable, 'isConfigurable !== true'); +verifyProperty(Object, "defineProperty", { + writable: true, + enumerable: false, + configurable: true, +}); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-4-603.js b/test/built-ins/Object/defineProperty/15.2.3.6-4-603.js index 0fb05283a4..4ea2b222ba 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-4-603.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-4-603.js @@ -6,31 +6,11 @@ es5id: 15.2.3.6-4-603 description: > ES5 Attributes - all attributes in Object.defineProperties are correct +includes: [propertyHelper.js] ---*/ -var desc = Object.getOwnPropertyDescriptor(Object, "defineProperties"); - -var propertyAreCorrect = (desc.writable === true && desc.enumerable === false && desc.configurable === true); - -var temp = Object.defineProperties; - -Object.defineProperties = "2010"; - -var isWritable = (Object.defineProperties === "2010"); - -var isEnumerable = false; - -for (var prop in Object) { - if (prop === "defineProperties") { - isEnumerable = true; - } -} - -delete Object.defineProperties; - -var isConfigurable = !Object.hasOwnProperty("defineProperties"); - -assert(propertyAreCorrect, 'propertyAreCorrect !== true'); -assert(isWritable, 'isWritable !== true'); -assert.sameValue(isEnumerable, false, 'isEnumerable'); -assert(isConfigurable, 'isConfigurable !== true'); +verifyProperty(Object, "defineProperties", { + writable: true, + enumerable: false, + configurable: true, +}); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-4-604.js b/test/built-ins/Object/defineProperty/15.2.3.6-4-604.js index ec234ccef8..6a1e87b8b4 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-4-604.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-4-604.js @@ -4,31 +4,11 @@ /*--- es5id: 15.2.3.6-4-604 description: ES5 Attributes - all attributes in Object.seal are correct +includes: [propertyHelper.js] ---*/ -var desc = Object.getOwnPropertyDescriptor(Object, "seal"); - -var propertyAreCorrect = (desc.writable === true && desc.enumerable === false && desc.configurable === true); - -var temp = Object.seal; - -Object.seal = "2010"; - -var isWritable = (Object.seal === "2010"); - -var isEnumerable = false; - -for (var prop in Object) { - if (prop === "seal") { - isEnumerable = true; - } -} - -delete Object.seal; - -var isConfigurable = !Object.hasOwnProperty("seal"); - -assert(propertyAreCorrect, 'propertyAreCorrect !== true'); -assert(isWritable, 'isWritable !== true'); -assert.sameValue(isEnumerable, false, 'isEnumerable'); -assert(isConfigurable, 'isConfigurable !== true'); +verifyProperty(Object, "seal", { + writable: true, + enumerable: false, + configurable: true, +}); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-4-605.js b/test/built-ins/Object/defineProperty/15.2.3.6-4-605.js index bf120a7f0a..81f350a663 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-4-605.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-4-605.js @@ -4,31 +4,11 @@ /*--- es5id: 15.2.3.6-4-605 description: ES5 Attributes - all attributes in Object.freeze are correct +includes: [propertyHelper.js] ---*/ -var desc = Object.getOwnPropertyDescriptor(Object, "freeze"); - -var propertyAreCorrect = (desc.writable === true && desc.enumerable === false && desc.configurable === true); - -var temp = Object.freeze; - -Object.freeze = "2010"; - -var isWritable = (Object.freeze === "2010"); - -var isEnumerable = false; - -for (var prop in Object) { - if (prop === "freeze") { - isEnumerable = true; - } -} - -delete Object.freeze; - -var isConfigurable = !Object.hasOwnProperty("freeze"); - -assert(propertyAreCorrect, 'propertyAreCorrect !== true'); -assert(isWritable, 'isWritable !== true'); -assert.sameValue(isEnumerable, false, 'isEnumerable'); -assert(isConfigurable, 'isConfigurable !== true'); +verifyProperty(Object, "freeze", { + writable: true, + enumerable: false, + configurable: true, +}); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-4-606.js b/test/built-ins/Object/defineProperty/15.2.3.6-4-606.js index 7a6a177e2e..643cbce79f 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-4-606.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-4-606.js @@ -6,31 +6,11 @@ es5id: 15.2.3.6-4-606 description: > ES5 Attributes - all attributes in Object.preventExtensions are correct +includes: [propertyHelper.js] ---*/ -var desc = Object.getOwnPropertyDescriptor(Object, "preventExtensions"); - -var propertyAreCorrect = (desc.writable === true && desc.enumerable === false && desc.configurable === true); - -var temp = Object.preventExtensions; - -Object.preventExtensions = "2010"; - -var isWritable = (Object.preventExtensions === "2010"); - -var isEnumerable = false; - -for (var prop in Object) { - if (prop === "preventExtensions") { - isEnumerable = true; - } -} - -delete Object.preventExtensions; - -var isConfigurable = !Object.hasOwnProperty("preventExtensions"); - -assert(propertyAreCorrect, 'propertyAreCorrect !== true'); -assert(isWritable, 'isWritable !== true'); -assert.sameValue(isEnumerable, false, 'isEnumerable'); -assert(isConfigurable, 'isConfigurable !== true'); +verifyProperty(Object, "preventExtensions", { + writable: true, + enumerable: false, + configurable: true, +}); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-4-607.js b/test/built-ins/Object/defineProperty/15.2.3.6-4-607.js index 0713aace05..b9a8dfa73f 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-4-607.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-4-607.js @@ -4,31 +4,11 @@ /*--- es5id: 15.2.3.6-4-607 description: ES5 Attributes - all attributes in Object.isSealed are correct +includes: [propertyHelper.js] ---*/ -var desc = Object.getOwnPropertyDescriptor(Object, "isSealed"); - -var propertyAreCorrect = (desc.writable === true && desc.enumerable === false && desc.configurable === true); - -var temp = Object.isSealed; - -Object.isSealed = "2010"; - -var isWritable = (Object.isSealed === "2010"); - -var isEnumerable = false; - -for (var prop in Object) { - if (prop === "isSealed") { - isEnumerable = true; - } -} - -delete Object.isSealed; - -var isConfigurable = !Object.hasOwnProperty("isSealed"); - -assert(propertyAreCorrect, 'propertyAreCorrect !== true'); -assert(isWritable, 'isWritable !== true'); -assert.sameValue(isEnumerable, false, 'isEnumerable'); -assert(isConfigurable, 'isConfigurable !== true'); +verifyProperty(Object, "isSealed", { + writable: true, + enumerable: false, + configurable: true, +}); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-4-608.js b/test/built-ins/Object/defineProperty/15.2.3.6-4-608.js index c16a7ad9c0..199ad18c43 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-4-608.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-4-608.js @@ -4,31 +4,11 @@ /*--- es5id: 15.2.3.6-4-608 description: ES5 Attributes - all attributes in Object.isFrozen are correct +includes: [propertyHelper.js] ---*/ -var desc = Object.getOwnPropertyDescriptor(Object, "isFrozen"); - -var propertyAreCorrect = (desc.writable === true && desc.enumerable === false && desc.configurable === true); - -var temp = Object.isFrozen; - -Object.isFrozen = "2010"; - -var isWritable = (Object.isFrozen === "2010"); - -var isEnumerable = false; - -for (var prop in Object) { - if (prop === "isFrozen") { - isEnumerable = true; - } -} - -delete Object.isFrozen; - -var isConfigurable = !Object.hasOwnProperty("isFrozen"); - -assert(propertyAreCorrect, 'propertyAreCorrect !== true'); -assert(isWritable, 'isWritable !== true'); -assert.sameValue(isEnumerable, false, 'isEnumerable'); -assert(isConfigurable, 'isConfigurable !== true'); +verifyProperty(Object, "isFrozen", { + writable: true, + enumerable: false, + configurable: true, +}); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-4-609.js b/test/built-ins/Object/defineProperty/15.2.3.6-4-609.js index 7671114615..d2584e39a7 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-4-609.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-4-609.js @@ -4,31 +4,11 @@ /*--- es5id: 15.2.3.6-4-609 description: ES5 Attributes - all attributes in Object.isExtensible are correct +includes: [propertyHelper.js] ---*/ -var desc = Object.getOwnPropertyDescriptor(Object, "isExtensible"); - -var propertyAreCorrect = (desc.writable === true && desc.enumerable === false && desc.configurable === true); - -var temp = Object.isExtensible; - -Object.isExtensible = "2010"; - -var isWritable = (Object.isExtensible === "2010"); - -var isEnumerable = false; - -for (var prop in Object) { - if (prop === "isExtensible") { - isEnumerable = true; - } -} - -delete Object.isExtensible; - -var isConfigurable = !Object.hasOwnProperty("isExtensible"); - -assert(propertyAreCorrect, 'propertyAreCorrect !== true'); -assert(isWritable, 'isWritable !== true'); -assert.sameValue(isEnumerable, false, 'isEnumerable'); -assert(isConfigurable, 'isConfigurable !== true'); +verifyProperty(Object, "isExtensible", { + writable: true, + enumerable: false, + configurable: true, +}); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-4-610.js b/test/built-ins/Object/defineProperty/15.2.3.6-4-610.js index 36a508a238..b2ec763ea5 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-4-610.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-4-610.js @@ -4,31 +4,11 @@ /*--- es5id: 15.2.3.6-4-610 description: ES5 Attributes - all attributes in Object.keys are correct +includes: [propertyHelper.js] ---*/ -var desc = Object.getOwnPropertyDescriptor(Object, "keys"); - -var propertyAreCorrect = (desc.writable === true && desc.enumerable === false && desc.configurable === true); - -var temp = Object.keys; - -Object.keys = "2010"; - -var isWritable = (Object.keys === "2010"); - -var isEnumerable = false; - -for (var prop in Object) { - if (prop === "keys") { - isEnumerable = true; - } -} - -delete Object.keys; - -var isConfigurable = !Object.hasOwnProperty("keys"); - -assert(propertyAreCorrect, 'propertyAreCorrect !== true'); -assert(isWritable, 'isWritable !== true'); -assert.sameValue(isEnumerable, false, 'isEnumerable'); -assert(isConfigurable, 'isConfigurable !== true'); +verifyProperty(Object, "keys", { + writable: true, + enumerable: false, + configurable: true, +}); diff --git a/test/built-ins/Object/defineProperty/symbol-data-property-configurable.js b/test/built-ins/Object/defineProperty/symbol-data-property-configurable.js index 36dc262400..f5cd69be4e 100644 --- a/test/built-ins/Object/defineProperty/symbol-data-property-configurable.js +++ b/test/built-ins/Object/defineProperty/symbol-data-property-configurable.js @@ -5,6 +5,7 @@ es6id: 19.1.2.4 description: > Symbol used as property for configurable data property definition features: [Symbol] +includes: [propertyHelper.js] ---*/ var sym = Symbol(); var obj = {}; @@ -16,18 +17,13 @@ Object.defineProperty(obj, sym, { }); assert.sameValue(sym in obj, true, "The result of `sym in obj` is `true`"); -assert.sameValue( - Object.hasOwnProperty.call(obj, sym), - true, - "`Object.hasOwnProperty.call(obj, sym)` returns `true`" -); +verifyProperty(obj, sym, { + value: 1, + configurable: true, + writable: false, + enumerable: false, +}); -var desc = Object.getOwnPropertyDescriptor(obj, sym); - -assert.sameValue(desc.value, 1, "The value of `desc.value` is `1`"); -assert.sameValue(desc.configurable, true, "The value of `desc.configurable` is `true`"); -assert.sameValue(desc.writable, false, "The value of `desc.writable` is `false`"); -assert.sameValue(desc.enumerable, false, "The value of `desc.enumerable` is `false`"); assert.sameValue( Object.prototype.propertyIsEnumerable.call(obj, sym), false, diff --git a/test/built-ins/Object/defineProperty/symbol-data-property-default-non-strict.js b/test/built-ins/Object/defineProperty/symbol-data-property-default-non-strict.js index a54deb3a95..7dcd9cabd5 100644 --- a/test/built-ins/Object/defineProperty/symbol-data-property-default-non-strict.js +++ b/test/built-ins/Object/defineProperty/symbol-data-property-default-non-strict.js @@ -6,6 +6,7 @@ description: > Symbol used as property for property definition flags: [noStrict] features: [Symbol] +includes: [propertyHelper.js] ---*/ var sym = Symbol(); var obj = {}; @@ -16,18 +17,13 @@ Object.defineProperty(obj, sym, { }); assert.sameValue(sym in obj, true, "The result of `sym in obj` is `true`"); -assert.sameValue( - Object.hasOwnProperty.call(obj, sym), - true, - "`Object.hasOwnProperty.call(obj, sym)` returns `true`" -); +verifyProperty(obj, sym, { + value: 1, + configurable: false, + writable: false, + enumerable: false, +}); -var desc = Object.getOwnPropertyDescriptor(obj, sym); - -assert.sameValue(desc.value, 1, "The value of `desc.value` is `1`"); -assert.sameValue(desc.configurable, false, "The value of `desc.configurable` is `false`"); -assert.sameValue(desc.writable, false, "The value of `desc.writable` is `false`"); -assert.sameValue(desc.enumerable, false, "The value of `desc.enumerable` is `false`"); assert.sameValue( Object.prototype.propertyIsEnumerable.call(obj, sym), false, diff --git a/test/built-ins/Object/defineProperty/symbol-data-property-default-strict.js b/test/built-ins/Object/defineProperty/symbol-data-property-default-strict.js index 93cffc023f..9606fe8c4f 100644 --- a/test/built-ins/Object/defineProperty/symbol-data-property-default-strict.js +++ b/test/built-ins/Object/defineProperty/symbol-data-property-default-strict.js @@ -6,6 +6,7 @@ description: > Symbol used as property for default data property definition flags: [onlyStrict] features: [Symbol] +includes: [propertyHelper.js] ---*/ var sym = Symbol(); var obj = {}; @@ -16,18 +17,13 @@ Object.defineProperty(obj, sym, { }); assert.sameValue(sym in obj, true, "The result of `sym in obj` is `true`"); -assert.sameValue( - Object.hasOwnProperty.call(obj, sym), - true, - "`Object.hasOwnProperty.call(obj, sym)` returns `true`" -); +verifyProperty(obj, sym, { + value: 1, + configurable: false, + writable: false, + enumerable: false, +}); -var desc = Object.getOwnPropertyDescriptor(obj, sym); - -assert.sameValue(desc.value, 1, "The value of `desc.value` is `1`"); -assert.sameValue(desc.configurable, false, "The value of `desc.configurable` is `false`"); -assert.sameValue(desc.writable, false, "The value of `desc.writable` is `false`"); -assert.sameValue(desc.enumerable, false, "The value of `desc.enumerable` is `false`"); assert.sameValue( Object.prototype.propertyIsEnumerable.call(obj, sym), false, diff --git a/test/built-ins/Object/defineProperty/symbol-data-property-writable.js b/test/built-ins/Object/defineProperty/symbol-data-property-writable.js index b2d3a873af..83c3b68b74 100644 --- a/test/built-ins/Object/defineProperty/symbol-data-property-writable.js +++ b/test/built-ins/Object/defineProperty/symbol-data-property-writable.js @@ -5,6 +5,7 @@ es6id: 19.1.2.4 description: > Symbol used as property for writable data property definition features: [Symbol] +includes: [propertyHelper.js] ---*/ var sym = Symbol(); var obj = {}; @@ -16,18 +17,13 @@ Object.defineProperty(obj, sym, { }); assert.sameValue(sym in obj, true, "The result of `sym in obj` is `true`"); -assert.sameValue( - Object.hasOwnProperty.call(obj, sym), - true, - "`Object.hasOwnProperty.call(obj, sym)` returns `true`" -); +verifyProperty(obj, sym, { + value: 1, + configurable: false, + writable: true, + enumerable: false, +}); -var desc = Object.getOwnPropertyDescriptor(obj, sym); - -assert.sameValue(desc.value, 1, "The value of `desc.value` is `1`"); -assert.sameValue(desc.configurable, false, "The value of `desc.configurable` is `false`"); -assert.sameValue(desc.writable, true, "The value of `desc.writable` is `true`"); -assert.sameValue(desc.enumerable, false, "The value of `desc.enumerable` is `false`"); assert.sameValue( Object.prototype.propertyIsEnumerable.call(obj, sym), false, diff --git a/test/built-ins/Object/setPrototypeOf/success.js b/test/built-ins/Object/setPrototypeOf/success.js index ffe0233e4c..cc5d83a11c 100644 --- a/test/built-ins/Object/setPrototypeOf/success.js +++ b/test/built-ins/Object/setPrototypeOf/success.js @@ -24,5 +24,8 @@ var result; result = Object.setPrototypeOf(obj, newProto); assert.sameValue(result, obj, 'Return value'); -assert.sameValue(Object.hasOwnProperty.call(obj, 'test262prop'), false); +assert( + !Object.prototype.hasOwnProperty.call(obj, 'test262prop'), + "'test262prop' isn't copied to an own property" +); assert.sameValue(obj.test262prop, propValue); diff --git a/test/built-ins/Proxy/deleteProperty/trap-is-missing-target-is-proxy.js b/test/built-ins/Proxy/deleteProperty/trap-is-missing-target-is-proxy.js index a7a76f4987..3c5c22adf0 100644 --- a/test/built-ins/Proxy/deleteProperty/trap-is-missing-target-is-proxy.js +++ b/test/built-ins/Proxy/deleteProperty/trap-is-missing-target-is-proxy.js @@ -29,18 +29,26 @@ var plainObjectTarget = new Proxy(plainObject, {}); var plainObjectProxy = new Proxy(plainObjectTarget, {}); assert(delete plainObjectProxy.foo); -assert(!plainObject.hasOwnProperty("foo")); +assert( + !Object.prototype.hasOwnProperty.call(plainObject, "foo"), + "'foo' property was deleted from original object" +); assert(!Reflect.deleteProperty(plainObjectProxy, "bar")); -assert(plainObject.hasOwnProperty("bar")); - +assert( + Object.prototype.hasOwnProperty.call(plainObject, "bar"), + "'bar' property was not deleted from original object" +); var func = function() {}; var funcTarget = new Proxy(func, {}); var funcProxy = new Proxy(funcTarget, {}); assert(delete funcProxy.length); -assert(!func.hasOwnProperty("length")); +assert( + !Object.prototype.hasOwnProperty.call(func, "length"), + "'length' property was deleted from original object" +); assert.throws(TypeError, function() { "use strict"; diff --git a/test/built-ins/Proxy/proxy-no-prototype.js b/test/built-ins/Proxy/proxy-no-prototype.js index a6d3cddbe2..4a8a8795c3 100644 --- a/test/built-ins/Proxy/proxy-no-prototype.js +++ b/test/built-ins/Proxy/proxy-no-prototype.js @@ -9,4 +9,7 @@ description: > features: [Proxy] ---*/ -assert.sameValue(Object.hasOwnProperty.call(Proxy, 'prototype'), false); +assert( + !Object.prototype.hasOwnProperty.call(Proxy, 'prototype'), + "Proxy constructor does not have a prototype property" +); diff --git a/test/built-ins/RegExp/prototype/Symbol.match/g-success-return-val.js b/test/built-ins/RegExp/prototype/Symbol.match/g-success-return-val.js index ca52115e7c..7acbfd2cf6 100644 --- a/test/built-ins/RegExp/prototype/Symbol.match/g-success-return-val.js +++ b/test/built-ins/RegExp/prototype/Symbol.match/g-success-return-val.js @@ -25,17 +25,15 @@ var result = /.(.)./g[Symbol.match]('abcdefghi'); assert(Array.isArray(result)); -assert.sameValue( - Object.hasOwnProperty.call(result, 'index'), - false, +assert( + !Object.prototype.hasOwnProperty.call(result, 'index'), 'Does not define an `index` "own" property' ); assert.sameValue( result.index, undefined, 'Does not define an `index` property' ); -assert.sameValue( - Object.hasOwnProperty.call(result, 'input'), - false, +assert( + !Object.prototype.hasOwnProperty.call(result, 'input'), 'Does not define an `input` "own" property' ); assert.sameValue( diff --git a/test/intl402/Segmenter/constructor/constructor/options-undefined.js b/test/intl402/Segmenter/constructor/constructor/options-undefined.js index c91f211788..906e8d4f64 100644 --- a/test/intl402/Segmenter/constructor/constructor/options-undefined.js +++ b/test/intl402/Segmenter/constructor/constructor/options-undefined.js @@ -43,6 +43,7 @@ for (const args of optionsArguments) { const resolvedOptions = segmenter.resolvedOptions(); assert.sameValue(resolvedOptions.granularity, "grapheme", `Calling with ${args.length} empty arguments should yield the correct value for "granularity"`); - assert.sameValue(Object.hasOwnProperty(resolvedOptions, "lineBreakStyle"), false, + assert( + !Object.prototype.hasOwnProperty.call(resolvedOptions, "lineBreakStyle"), `Calling with ${args.length} empty arguments should yield the correct value for "lineBreakStyle"`); } diff --git a/test/language/expressions/class/elements/fields-asi-5.js b/test/language/expressions/class/elements/fields-asi-5.js index 9a1c0064b5..1ec899ceae 100644 --- a/test/language/expressions/class/elements/fields-asi-5.js +++ b/test/language/expressions/class/elements/fields-asi-5.js @@ -24,5 +24,5 @@ var c = new C(); assert.sameValue(c.a, true, 'a = x in z'); assert.sameValue(c.b, false, 'b = y in z'); -assert.sameValue(Object.hasOwnProperty.call(c, "in"), false, "'in'"); -assert.sameValue(Object.hasOwnProperty.call(c, "z"), false, "'z'"); +assert(!Object.prototype.hasOwnProperty.call(c, "in"), "'in' is not parsed as a field declaration"); +assert(!Object.prototype.hasOwnProperty.call(c, "z"), "'z' is not parsed as a field declaration"); diff --git a/test/language/expressions/object/__proto__-duplicate-computed.js b/test/language/expressions/object/__proto__-duplicate-computed.js index 838511019c..c0bdf69cf6 100644 --- a/test/language/expressions/object/__proto__-duplicate-computed.js +++ b/test/language/expressions/object/__proto__-duplicate-computed.js @@ -43,7 +43,7 @@ assert.sameValue( ); assert( - Object.hasOwnProperty.call(obj, '__proto__'), + Object.prototype.hasOwnProperty.call(obj, '__proto__'), 'has own property __proto__' ); diff --git a/test/language/expressions/object/method-definition/generator-prop-name-yield-expr.js b/test/language/expressions/object/method-definition/generator-prop-name-yield-expr.js index 2ccf6b43f1..a3f7d7fe0f 100644 --- a/test/language/expressions/object/method-definition/generator-prop-name-yield-expr.js +++ b/test/language/expressions/object/method-definition/generator-prop-name-yield-expr.js @@ -25,9 +25,11 @@ assert.sameValue(obj, null); iter.next('propNameViaExpression'); -assert.sameValue( - Object.hasOwnProperty.call(obj, 'propNameViaIdentifier'), false +assert( + !Object.prototype.hasOwnProperty.call(obj, 'propNameViaIdentifier'), + "The property name is not taken from the 'yield' variable" ); -assert.sameValue( - Object.hasOwnProperty.call(obj, 'propNameViaExpression'), true +assert( + Object.prototype.hasOwnProperty.call(obj, 'propNameViaExpression'), + "The property name is taken from the yield expression" ); diff --git a/test/language/expressions/object/method-definition/generator-prop-name-yield-id.js b/test/language/expressions/object/method-definition/generator-prop-name-yield-id.js index a844383dae..8d7f441435 100644 --- a/test/language/expressions/object/method-definition/generator-prop-name-yield-id.js +++ b/test/language/expressions/object/method-definition/generator-prop-name-yield-id.js @@ -16,4 +16,7 @@ var obj = { *[yield]() {} }; -assert.sameValue(Object.hasOwnProperty.call(obj, 'propName'), true); +assert( + Object.prototype.hasOwnProperty.call(obj, 'propName'), + "The property name is taken from the 'yield' variable" +); diff --git a/test/language/expressions/object/method-definition/name-prop-name-yield-expr.js b/test/language/expressions/object/method-definition/name-prop-name-yield-expr.js index 85591f3cdc..36291eea82 100644 --- a/test/language/expressions/object/method-definition/name-prop-name-yield-expr.js +++ b/test/language/expressions/object/method-definition/name-prop-name-yield-expr.js @@ -25,9 +25,11 @@ assert.sameValue(obj, null); iter.next('propNameViaExpression'); -assert.sameValue( - Object.hasOwnProperty.call(obj, 'propNameViaIdentifier'), false +assert( + !Object.prototype.hasOwnProperty.call(obj, 'propNameViaIdentifier'), + "The property name is not taken from the 'yield' variable" ); -assert.sameValue( - Object.hasOwnProperty.call(obj, 'propNameViaExpression'), true +assert( + Object.prototype.hasOwnProperty.call(obj, 'propNameViaExpression'), + "The property name is taken from the yield expression" ); diff --git a/test/language/expressions/object/method-definition/name-prop-name-yield-id.js b/test/language/expressions/object/method-definition/name-prop-name-yield-id.js index d511c3b092..c9c66dedf9 100644 --- a/test/language/expressions/object/method-definition/name-prop-name-yield-id.js +++ b/test/language/expressions/object/method-definition/name-prop-name-yield-id.js @@ -15,4 +15,7 @@ var obj = { [yield]() {} }; -assert.sameValue(Object.hasOwnProperty.call(obj, 'propName'), true); +assert( + Object.prototype.hasOwnProperty.call(obj, 'propName'), + "The property name is taken from the 'yield' variable" +); diff --git a/test/language/expressions/object/method-definition/name-prototype-prop.js b/test/language/expressions/object/method-definition/name-prototype-prop.js index fbb862b6b7..66a9eeab89 100644 --- a/test/language/expressions/object/method-definition/name-prototype-prop.js +++ b/test/language/expressions/object/method-definition/name-prototype-prop.js @@ -9,4 +9,7 @@ es6id: 14.3.9 var method = { method() {} }.method; -assert.sameValue(Object.hasOwnProperty.call(method, 'prototype'), false); +assert( + !Object.prototype.hasOwnProperty.call(method, 'prototype'), + "Functions declared as methods do not define a 'prototype' property" +); diff --git a/test/language/expressions/super/prop-dot-obj-ref-non-strict.js b/test/language/expressions/super/prop-dot-obj-ref-non-strict.js index 215904d655..7b92fcec06 100644 --- a/test/language/expressions/super/prop-dot-obj-ref-non-strict.js +++ b/test/language/expressions/super/prop-dot-obj-ref-non-strict.js @@ -48,5 +48,11 @@ var obj = { obj.method(); -assert.sameValue(Object.hasOwnProperty.call(obj, 'x'), true); -assert.sameValue(Object.hasOwnProperty.call(obj, 'y'), false); +assert( + Object.prototype.hasOwnProperty.call(obj, 'x'), + "x is defined as an own property" +); +assert( + !Object.prototype.hasOwnProperty.call(obj, 'y'), + "y is not defined as an own property after the object is frozen" +); diff --git a/test/language/expressions/super/prop-expr-obj-ref-non-strict.js b/test/language/expressions/super/prop-expr-obj-ref-non-strict.js index ca8f695dcd..72e897bc34 100644 --- a/test/language/expressions/super/prop-expr-obj-ref-non-strict.js +++ b/test/language/expressions/super/prop-expr-obj-ref-non-strict.js @@ -48,5 +48,11 @@ var obj = { obj.method(); -assert.sameValue(Object.hasOwnProperty.call(obj, 'x'), true); -assert.sameValue(Object.hasOwnProperty.call(obj, 'y'), false); +assert( + Object.prototype.hasOwnProperty.call(obj, 'x'), + "x is defined as an own property" +); +assert( + !Object.prototype.hasOwnProperty.call(obj, 'y'), + "y is not defined as an own property after the object is frozen" +); diff --git a/test/language/expressions/tagged-template/template-object.js b/test/language/expressions/tagged-template/template-object.js index 8e595ce878..da4383ec4f 100644 --- a/test/language/expressions/tagged-template/template-object.js +++ b/test/language/expressions/tagged-template/template-object.js @@ -18,25 +18,34 @@ tag`${1}`; assert(Array.isArray(templateObject.raw), 'The template object is an array'); -assert(templateObject.hasOwnProperty('raw')); -verifyNotEnumerable(templateObject, 'raw'); -verifyNotWritable(templateObject, 'raw') -verifyNotConfigurable(templateObject, 'raw'); +verifyProperty(templateObject, 'raw', { + enumerable: false, + writable: false, + configurable: false, +}); assert(Array.isArray(templateObject), 'The "raw" object is an array'); -verifyEnumerable(templateObject, '0'); -verifyNotWritable(templateObject, '0') -verifyNotConfigurable(templateObject, '0'); +verifyProperty(templateObject, '0', { + enumerable: true, + writable: false, + configurable: false, +}); -verifyNotEnumerable(templateObject, 'length'); -verifyNotWritable(templateObject, 'length') -verifyNotConfigurable(templateObject, 'length'); +verifyProperty(templateObject, 'length', { + enumerable: false, + writable: false, + configurable: false, +}); -verifyEnumerable(templateObject.raw, '0'); -verifyNotWritable(templateObject.raw, '0') -verifyNotConfigurable(templateObject.raw, '0'); +verifyProperty(templateObject.raw, '0', { + enumerable: true, + writable: false, + configurable: false, +}); -verifyNotEnumerable(templateObject.raw, 'length'); -verifyNotWritable(templateObject.raw, 'length') -verifyNotConfigurable(templateObject.raw, 'length'); +verifyProperty(templateObject.raw, 'length', { + enumerable: false, + writable: false, + configurable: false, +}); diff --git a/test/language/statements/class/elements/fields-asi-5.js b/test/language/statements/class/elements/fields-asi-5.js index e81ab29ae0..165d892c7b 100644 --- a/test/language/statements/class/elements/fields-asi-5.js +++ b/test/language/statements/class/elements/fields-asi-5.js @@ -24,5 +24,5 @@ var c = new C(); assert.sameValue(c.a, true, 'a = x in z'); assert.sameValue(c.b, false, 'b = y in z'); -assert.sameValue(Object.hasOwnProperty.call(c, "in"), false, "'in'"); -assert.sameValue(Object.hasOwnProperty.call(c, "z"), false, "'z'"); +assert(!Object.prototype.hasOwnProperty.call(c, "in"), "'in' is not parsed as a field declaration"); +assert(!Object.prototype.hasOwnProperty.call(c, "z"), "'z' is not parsed as a field declaration");