diff options
Diffstat (limited to 'js/src/tests/test262/built-ins/Object/prototype/hasOwnProperty')
65 files changed, 1445 insertions, 0 deletions
diff --git a/js/src/tests/test262/built-ins/Object/prototype/hasOwnProperty/8.12.1-1_1.js b/js/src/tests/test262/built-ins/Object/prototype/hasOwnProperty/8.12.1-1_1.js new file mode 100644 index 0000000000..c64913ccec --- /dev/null +++ b/js/src/tests/test262/built-ins/Object/prototype/hasOwnProperty/8.12.1-1_1.js @@ -0,0 +1,13 @@ +// Copyright (c) 2012 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es5id: 8.12.1-1_1 +description: Properties - [[HasOwnProperty]] (property does not exist) +---*/ + +var o = {}; + +assert.sameValue(o.hasOwnProperty("foo"), false, 'o.hasOwnProperty("foo")'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/prototype/hasOwnProperty/8.12.1-1_10.js b/js/src/tests/test262/built-ins/Object/prototype/hasOwnProperty/8.12.1-1_10.js new file mode 100644 index 0000000000..26039ecf64 --- /dev/null +++ b/js/src/tests/test262/built-ins/Object/prototype/hasOwnProperty/8.12.1-1_10.js @@ -0,0 +1,20 @@ +// Copyright (c) 2012 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es5id: 8.12.1-1_10 +description: > + Properties - [[HasOwnProperty]] (writable, configurable, + non-enumerable own value property) +---*/ + +var o = {}; +Object.defineProperty(o, "foo", { + value: 42, + writable: true, + configurable: true +}); + +assert(o.hasOwnProperty("foo"), 'o.hasOwnProperty("foo") !== true'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/prototype/hasOwnProperty/8.12.1-1_11.js b/js/src/tests/test262/built-ins/Object/prototype/hasOwnProperty/8.12.1-1_11.js new file mode 100644 index 0000000000..d9ff6adfd2 --- /dev/null +++ b/js/src/tests/test262/built-ins/Object/prototype/hasOwnProperty/8.12.1-1_11.js @@ -0,0 +1,21 @@ +// Copyright (c) 2012 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es5id: 8.12.1-1_11 +description: > + Properties - [[HasOwnProperty]] (writable, configurable, + enumerable own value property) +---*/ + +var o = {}; +Object.defineProperty(o, "foo", { + value: 42, + writable: true, + enumerable: true, + configurable: true +}); + +assert(o.hasOwnProperty("foo"), 'o.hasOwnProperty("foo") !== true'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/prototype/hasOwnProperty/8.12.1-1_12.js b/js/src/tests/test262/built-ins/Object/prototype/hasOwnProperty/8.12.1-1_12.js new file mode 100644 index 0000000000..edb1e8de7e --- /dev/null +++ b/js/src/tests/test262/built-ins/Object/prototype/hasOwnProperty/8.12.1-1_12.js @@ -0,0 +1,19 @@ +// Copyright (c) 2012 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es5id: 8.12.1-1_12 +description: > + Properties - [[HasOwnProperty]] (non-writable, non-configurable, + non-enumerable inherited value property) +---*/ + +var base = {}; +Object.defineProperty(base, "foo", { + value: 42 +}); +var o = Object.create(base); + +assert.sameValue(o.hasOwnProperty("foo"), false, 'o.hasOwnProperty("foo")'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/prototype/hasOwnProperty/8.12.1-1_13.js b/js/src/tests/test262/built-ins/Object/prototype/hasOwnProperty/8.12.1-1_13.js new file mode 100644 index 0000000000..c59d687403 --- /dev/null +++ b/js/src/tests/test262/built-ins/Object/prototype/hasOwnProperty/8.12.1-1_13.js @@ -0,0 +1,20 @@ +// Copyright (c) 2012 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es5id: 8.12.1-1_13 +description: > + Properties - [[HasOwnProperty]] (non-writable, non-configurable, + enumerable inherited value property) +---*/ + +var base = {}; +Object.defineProperty(base, "foo", { + value: 42, + enumerable: true +}); +var o = Object.create(base); + +assert.sameValue(o.hasOwnProperty("foo"), false, 'o.hasOwnProperty("foo")'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/prototype/hasOwnProperty/8.12.1-1_14.js b/js/src/tests/test262/built-ins/Object/prototype/hasOwnProperty/8.12.1-1_14.js new file mode 100644 index 0000000000..9d385ee88e --- /dev/null +++ b/js/src/tests/test262/built-ins/Object/prototype/hasOwnProperty/8.12.1-1_14.js @@ -0,0 +1,20 @@ +// Copyright (c) 2012 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es5id: 8.12.1-1_14 +description: > + Properties - [[HasOwnProperty]] (non-writable, configurable, + non-enumerable inherited value property) +---*/ + +var base = {}; +Object.defineProperty(base, "foo", { + value: 42, + configurable: true +}); +var o = Object.create(base); + +assert.sameValue(o.hasOwnProperty("foo"), false, 'o.hasOwnProperty("foo")'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/prototype/hasOwnProperty/8.12.1-1_15.js b/js/src/tests/test262/built-ins/Object/prototype/hasOwnProperty/8.12.1-1_15.js new file mode 100644 index 0000000000..6a7520fe47 --- /dev/null +++ b/js/src/tests/test262/built-ins/Object/prototype/hasOwnProperty/8.12.1-1_15.js @@ -0,0 +1,20 @@ +// Copyright (c) 2012 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es5id: 8.12.1-1_15 +description: > + Properties - [[HasOwnProperty]] (writable, non-configurable, + non-enumerable inherited value property) +---*/ + +var base = {}; +Object.defineProperty(base, "foo", { + value: 42, + writable: true +}); +var o = Object.create(base); + +assert.sameValue(o.hasOwnProperty("foo"), false, 'o.hasOwnProperty("foo")'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/prototype/hasOwnProperty/8.12.1-1_16.js b/js/src/tests/test262/built-ins/Object/prototype/hasOwnProperty/8.12.1-1_16.js new file mode 100644 index 0000000000..b491620f68 --- /dev/null +++ b/js/src/tests/test262/built-ins/Object/prototype/hasOwnProperty/8.12.1-1_16.js @@ -0,0 +1,21 @@ +// Copyright (c) 2012 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es5id: 8.12.1-1_16 +description: > + Properties - [[HasOwnProperty]] (non-writable, configurable, + enumerable inherited value property) +---*/ + +var base = {}; +Object.defineProperty(base, "foo", { + value: 42, + configurable: true, + enumerable: true +}); +var o = Object.create(base); + +assert.sameValue(o.hasOwnProperty("foo"), false, 'o.hasOwnProperty("foo")'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/prototype/hasOwnProperty/8.12.1-1_17.js b/js/src/tests/test262/built-ins/Object/prototype/hasOwnProperty/8.12.1-1_17.js new file mode 100644 index 0000000000..a89febbca6 --- /dev/null +++ b/js/src/tests/test262/built-ins/Object/prototype/hasOwnProperty/8.12.1-1_17.js @@ -0,0 +1,21 @@ +// Copyright (c) 2012 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es5id: 8.12.1-1_17 +description: > + Properties - [[HasOwnProperty]] (writable, non-configurable, + enumerable inherited value property) +---*/ + +var base = {}; +Object.defineProperty(base, "foo", { + value: 42, + writable: true, + enumerable: true +}); +var o = Object.create(base); + +assert.sameValue(o.hasOwnProperty("foo"), false, 'o.hasOwnProperty("foo")'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/prototype/hasOwnProperty/8.12.1-1_18.js b/js/src/tests/test262/built-ins/Object/prototype/hasOwnProperty/8.12.1-1_18.js new file mode 100644 index 0000000000..efd916452e --- /dev/null +++ b/js/src/tests/test262/built-ins/Object/prototype/hasOwnProperty/8.12.1-1_18.js @@ -0,0 +1,21 @@ +// Copyright (c) 2012 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es5id: 8.12.1-1_18 +description: > + Properties - [[HasOwnProperty]] (writable, configurable, + non-enumerable inherited value property) +---*/ + +var base = {}; +Object.defineProperty(base, "foo", { + value: 42, + writable: true, + configurable: true +}); +var o = Object.create(base); + +assert.sameValue(o.hasOwnProperty("foo"), false, 'o.hasOwnProperty("foo")'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/prototype/hasOwnProperty/8.12.1-1_19.js b/js/src/tests/test262/built-ins/Object/prototype/hasOwnProperty/8.12.1-1_19.js new file mode 100644 index 0000000000..0b48e5c1bf --- /dev/null +++ b/js/src/tests/test262/built-ins/Object/prototype/hasOwnProperty/8.12.1-1_19.js @@ -0,0 +1,22 @@ +// Copyright (c) 2012 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es5id: 8.12.1-1_19 +description: > + Properties - [[HasOwnProperty]] (writable, configurable, + enumerable inherited value property) +---*/ + +var base = {}; +Object.defineProperty(base, "foo", { + value: 42, + writable: true, + enumerable: true, + configurable: true +}); +var o = Object.create(base); + +assert.sameValue(o.hasOwnProperty("foo"), false, 'o.hasOwnProperty("foo")'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/prototype/hasOwnProperty/8.12.1-1_2.js b/js/src/tests/test262/built-ins/Object/prototype/hasOwnProperty/8.12.1-1_2.js new file mode 100644 index 0000000000..7ffe83d56d --- /dev/null +++ b/js/src/tests/test262/built-ins/Object/prototype/hasOwnProperty/8.12.1-1_2.js @@ -0,0 +1,15 @@ +// Copyright (c) 2012 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es5id: 8.12.1-1_2 +description: Properties - [[HasOwnProperty]] (old style own property) +---*/ + +var o = { + foo: 42 +}; + +assert(o.hasOwnProperty("foo"), 'o.hasOwnProperty("foo") !== true'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/prototype/hasOwnProperty/8.12.1-1_20.js b/js/src/tests/test262/built-ins/Object/prototype/hasOwnProperty/8.12.1-1_20.js new file mode 100644 index 0000000000..f505468b34 --- /dev/null +++ b/js/src/tests/test262/built-ins/Object/prototype/hasOwnProperty/8.12.1-1_20.js @@ -0,0 +1,17 @@ +// Copyright (c) 2012 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es5id: 8.12.1-1_20 +description: Properties - [[HasOwnProperty]] (literal own getter property) +---*/ + +var o = { + get foo() { + return 42; + } +}; + +assert(o.hasOwnProperty("foo"), 'o.hasOwnProperty("foo") !== true'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/prototype/hasOwnProperty/8.12.1-1_21.js b/js/src/tests/test262/built-ins/Object/prototype/hasOwnProperty/8.12.1-1_21.js new file mode 100644 index 0000000000..015c83b944 --- /dev/null +++ b/js/src/tests/test262/built-ins/Object/prototype/hasOwnProperty/8.12.1-1_21.js @@ -0,0 +1,16 @@ +// Copyright (c) 2012 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es5id: 8.12.1-1_21 +description: Properties - [[HasOwnProperty]] (literal own setter property) +---*/ + +var o = { + set foo(x) {; + } +}; + +assert(o.hasOwnProperty("foo"), 'o.hasOwnProperty("foo") !== true'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/prototype/hasOwnProperty/8.12.1-1_22.js b/js/src/tests/test262/built-ins/Object/prototype/hasOwnProperty/8.12.1-1_22.js new file mode 100644 index 0000000000..464f9e7af4 --- /dev/null +++ b/js/src/tests/test262/built-ins/Object/prototype/hasOwnProperty/8.12.1-1_22.js @@ -0,0 +1,21 @@ +// Copyright (c) 2012 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es5id: 8.12.1-1_22 +description: > + Properties - [[HasOwnProperty]] (literal own getter/setter + property) +---*/ + +var o = { + get foo() { + return 42; + }, + set foo(x) {; + } +}; + +assert(o.hasOwnProperty("foo"), 'o.hasOwnProperty("foo") !== true'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/prototype/hasOwnProperty/8.12.1-1_23.js b/js/src/tests/test262/built-ins/Object/prototype/hasOwnProperty/8.12.1-1_23.js new file mode 100644 index 0000000000..38550db4de --- /dev/null +++ b/js/src/tests/test262/built-ins/Object/prototype/hasOwnProperty/8.12.1-1_23.js @@ -0,0 +1,18 @@ +// Copyright (c) 2012 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es5id: 8.12.1-1_23 +description: Properties - [[HasOwnProperty]] (literal inherited getter property) +---*/ + +var base = { + get foo() { + return 42; + } +}; +var o = Object.create(base); + +assert.sameValue(o.hasOwnProperty("foo"), false, 'o.hasOwnProperty("foo")'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/prototype/hasOwnProperty/8.12.1-1_24.js b/js/src/tests/test262/built-ins/Object/prototype/hasOwnProperty/8.12.1-1_24.js new file mode 100644 index 0000000000..35efe9030d --- /dev/null +++ b/js/src/tests/test262/built-ins/Object/prototype/hasOwnProperty/8.12.1-1_24.js @@ -0,0 +1,17 @@ +// Copyright (c) 2012 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es5id: 8.12.1-1_24 +description: Properties - [[HasOwnProperty]] (literal inherited setter property) +---*/ + +var base = { + set foo(x) {; + } +}; +var o = Object.create(base); + +assert.sameValue(o.hasOwnProperty("foo"), false, 'o.hasOwnProperty("foo")'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/prototype/hasOwnProperty/8.12.1-1_25.js b/js/src/tests/test262/built-ins/Object/prototype/hasOwnProperty/8.12.1-1_25.js new file mode 100644 index 0000000000..332424e8a3 --- /dev/null +++ b/js/src/tests/test262/built-ins/Object/prototype/hasOwnProperty/8.12.1-1_25.js @@ -0,0 +1,22 @@ +// Copyright (c) 2012 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es5id: 8.12.1-1_25 +description: > + Properties - [[HasOwnProperty]] (literal inherited getter/setter + property) +---*/ + +var base = { + get foo() { + return 42; + }, + set foo(x) {; + } +}; +var o = Object.create(base); + +assert.sameValue(o.hasOwnProperty("foo"), false, 'o.hasOwnProperty("foo")'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/prototype/hasOwnProperty/8.12.1-1_26.js b/js/src/tests/test262/built-ins/Object/prototype/hasOwnProperty/8.12.1-1_26.js new file mode 100644 index 0000000000..7127ef47df --- /dev/null +++ b/js/src/tests/test262/built-ins/Object/prototype/hasOwnProperty/8.12.1-1_26.js @@ -0,0 +1,20 @@ +// Copyright (c) 2012 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es5id: 8.12.1-1_26 +description: > + Properties - [[HasOwnProperty]] (non-configurable, non-enumerable + own getter property) +---*/ + +var o = {}; +Object.defineProperty(o, "foo", { + get: function() { + return 42; + } +}); + +assert(o.hasOwnProperty("foo"), 'o.hasOwnProperty("foo") !== true'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/prototype/hasOwnProperty/8.12.1-1_27.js b/js/src/tests/test262/built-ins/Object/prototype/hasOwnProperty/8.12.1-1_27.js new file mode 100644 index 0000000000..bb87dc3b8c --- /dev/null +++ b/js/src/tests/test262/built-ins/Object/prototype/hasOwnProperty/8.12.1-1_27.js @@ -0,0 +1,21 @@ +// Copyright (c) 2012 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es5id: 8.12.1-1_27 +description: > + Properties - [[HasOwnProperty]] (non-configurable, enumerable own + getter property) +---*/ + +var o = {}; +Object.defineProperty(o, "foo", { + get: function() { + return 42; + }, + enumerable: true +}); + +assert(o.hasOwnProperty("foo"), 'o.hasOwnProperty("foo") !== true'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/prototype/hasOwnProperty/8.12.1-1_28.js b/js/src/tests/test262/built-ins/Object/prototype/hasOwnProperty/8.12.1-1_28.js new file mode 100644 index 0000000000..7f3cc16af8 --- /dev/null +++ b/js/src/tests/test262/built-ins/Object/prototype/hasOwnProperty/8.12.1-1_28.js @@ -0,0 +1,21 @@ +// Copyright (c) 2012 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es5id: 8.12.1-1_28 +description: > + Properties - [[HasOwnProperty]] (configurable, non-enumerable own + getter property) +---*/ + +var o = {}; +Object.defineProperty(o, "foo", { + get: function() { + return 42; + }, + configurable: true +}); + +assert(o.hasOwnProperty("foo"), 'o.hasOwnProperty("foo") !== true'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/prototype/hasOwnProperty/8.12.1-1_29.js b/js/src/tests/test262/built-ins/Object/prototype/hasOwnProperty/8.12.1-1_29.js new file mode 100644 index 0000000000..025537aa98 --- /dev/null +++ b/js/src/tests/test262/built-ins/Object/prototype/hasOwnProperty/8.12.1-1_29.js @@ -0,0 +1,22 @@ +// Copyright (c) 2012 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es5id: 8.12.1-1_29 +description: > + Properties - [[HasOwnProperty]] (configurable, enumerable own + getter property) +---*/ + +var o = {}; +Object.defineProperty(o, "foo", { + get: function() { + return 42; + }, + enumerable: true, + configurable: true +}); + +assert(o.hasOwnProperty("foo"), 'o.hasOwnProperty("foo") !== true'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/prototype/hasOwnProperty/8.12.1-1_3.js b/js/src/tests/test262/built-ins/Object/prototype/hasOwnProperty/8.12.1-1_3.js new file mode 100644 index 0000000000..8dd61c82df --- /dev/null +++ b/js/src/tests/test262/built-ins/Object/prototype/hasOwnProperty/8.12.1-1_3.js @@ -0,0 +1,16 @@ +// Copyright (c) 2012 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es5id: 8.12.1-1_3 +description: Properties - [[HasOwnProperty]] (old style inherited property) +---*/ + +var base = { + foo: 42 +}; +var o = Object.create(base); + +assert.sameValue(o.hasOwnProperty("foo"), false, 'o.hasOwnProperty("foo")'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/prototype/hasOwnProperty/8.12.1-1_30.js b/js/src/tests/test262/built-ins/Object/prototype/hasOwnProperty/8.12.1-1_30.js new file mode 100644 index 0000000000..74bba37470 --- /dev/null +++ b/js/src/tests/test262/built-ins/Object/prototype/hasOwnProperty/8.12.1-1_30.js @@ -0,0 +1,19 @@ +// Copyright (c) 2012 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es5id: 8.12.1-1_30 +description: > + Properties - [[HasOwnProperty]] (non-configurable, non-enumerable + own setter property) +---*/ + +var o = {}; +Object.defineProperty(o, "foo", { + set: function() {; + } +}); + +assert(o.hasOwnProperty("foo"), 'o.hasOwnProperty("foo") !== true'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/prototype/hasOwnProperty/8.12.1-1_31.js b/js/src/tests/test262/built-ins/Object/prototype/hasOwnProperty/8.12.1-1_31.js new file mode 100644 index 0000000000..94630d7cf2 --- /dev/null +++ b/js/src/tests/test262/built-ins/Object/prototype/hasOwnProperty/8.12.1-1_31.js @@ -0,0 +1,20 @@ +// Copyright (c) 2012 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es5id: 8.12.1-1_31 +description: > + Properties - [[HasOwnProperty]] (non-configurable, enumerable own + setter property) +---*/ + +var o = {}; +Object.defineProperty(o, "foo", { + set: function() {; + }, + enumerable: true +}); + +assert(o.hasOwnProperty("foo"), 'o.hasOwnProperty("foo") !== true'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/prototype/hasOwnProperty/8.12.1-1_32.js b/js/src/tests/test262/built-ins/Object/prototype/hasOwnProperty/8.12.1-1_32.js new file mode 100644 index 0000000000..de90c1bfdc --- /dev/null +++ b/js/src/tests/test262/built-ins/Object/prototype/hasOwnProperty/8.12.1-1_32.js @@ -0,0 +1,20 @@ +// Copyright (c) 2012 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es5id: 8.12.1-1_32 +description: > + Properties - [[HasOwnProperty]] (configurable, non-enumerable own + setter property) +---*/ + +var o = {}; +Object.defineProperty(o, "foo", { + set: function() {; + }, + configurable: true +}); + +assert(o.hasOwnProperty("foo"), 'o.hasOwnProperty("foo") !== true'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/prototype/hasOwnProperty/8.12.1-1_33.js b/js/src/tests/test262/built-ins/Object/prototype/hasOwnProperty/8.12.1-1_33.js new file mode 100644 index 0000000000..3530a36271 --- /dev/null +++ b/js/src/tests/test262/built-ins/Object/prototype/hasOwnProperty/8.12.1-1_33.js @@ -0,0 +1,21 @@ +// Copyright (c) 2012 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es5id: 8.12.1-1_33 +description: > + Properties - [[HasOwnProperty]] (configurable, enumerable own + setter property) +---*/ + +var o = {}; +Object.defineProperty(o, "foo", { + set: function() {; + }, + enumerable: true, + configurable: true +}); + +assert(o.hasOwnProperty("foo"), 'o.hasOwnProperty("foo") !== true'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/prototype/hasOwnProperty/8.12.1-1_34.js b/js/src/tests/test262/built-ins/Object/prototype/hasOwnProperty/8.12.1-1_34.js new file mode 100644 index 0000000000..514ee487ac --- /dev/null +++ b/js/src/tests/test262/built-ins/Object/prototype/hasOwnProperty/8.12.1-1_34.js @@ -0,0 +1,22 @@ +// Copyright (c) 2012 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es5id: 8.12.1-1_34 +description: > + Properties - [[HasOwnProperty]] (non-configurable, non-enumerable + own getter/setter property) +---*/ + +var o = {}; +Object.defineProperty(o, "foo", { + get: function() { + return 42; + }, + set: function() {; + } +}); + +assert(o.hasOwnProperty("foo"), 'o.hasOwnProperty("foo") !== true'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/prototype/hasOwnProperty/8.12.1-1_35.js b/js/src/tests/test262/built-ins/Object/prototype/hasOwnProperty/8.12.1-1_35.js new file mode 100644 index 0000000000..1eab5f8f92 --- /dev/null +++ b/js/src/tests/test262/built-ins/Object/prototype/hasOwnProperty/8.12.1-1_35.js @@ -0,0 +1,23 @@ +// Copyright (c) 2012 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es5id: 8.12.1-1_35 +description: > + Properties - [[HasOwnProperty]] (non-configurable, enumerable own + getter/setter property) +---*/ + +var o = {}; +Object.defineProperty(o, "foo", { + get: function() { + return 42; + }, + set: function() {; + }, + enumerable: true +}); + +assert(o.hasOwnProperty("foo"), 'o.hasOwnProperty("foo") !== true'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/prototype/hasOwnProperty/8.12.1-1_36.js b/js/src/tests/test262/built-ins/Object/prototype/hasOwnProperty/8.12.1-1_36.js new file mode 100644 index 0000000000..b03569e462 --- /dev/null +++ b/js/src/tests/test262/built-ins/Object/prototype/hasOwnProperty/8.12.1-1_36.js @@ -0,0 +1,23 @@ +// Copyright (c) 2012 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es5id: 8.12.1-1_36 +description: > + Properties - [[HasOwnProperty]] (configurable, non-enumerable own + getter/setter property) +---*/ + +var o = {}; +Object.defineProperty(o, "foo", { + get: function() { + return 42; + }, + set: function() {; + }, + configurable: true +}); + +assert(o.hasOwnProperty("foo"), 'o.hasOwnProperty("foo") !== true'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/prototype/hasOwnProperty/8.12.1-1_37.js b/js/src/tests/test262/built-ins/Object/prototype/hasOwnProperty/8.12.1-1_37.js new file mode 100644 index 0000000000..c2a7c7594f --- /dev/null +++ b/js/src/tests/test262/built-ins/Object/prototype/hasOwnProperty/8.12.1-1_37.js @@ -0,0 +1,24 @@ +// Copyright (c) 2012 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es5id: 8.12.1-1_37 +description: > + Properties - [[HasOwnProperty]] (configurable, enumerable own + getter/setter property) +---*/ + +var o = {}; +Object.defineProperty(o, "foo", { + get: function() { + return 42; + }, + set: function() {; + }, + enumerable: true, + configurable: true +}); + +assert(o.hasOwnProperty("foo"), 'o.hasOwnProperty("foo") !== true'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/prototype/hasOwnProperty/8.12.1-1_38.js b/js/src/tests/test262/built-ins/Object/prototype/hasOwnProperty/8.12.1-1_38.js new file mode 100644 index 0000000000..7b8b6b96ee --- /dev/null +++ b/js/src/tests/test262/built-ins/Object/prototype/hasOwnProperty/8.12.1-1_38.js @@ -0,0 +1,21 @@ +// Copyright (c) 2012 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es5id: 8.12.1-1_38 +description: > + Properties - [[HasOwnProperty]] (non-configurable, non-enumerable + inherited getter property) +---*/ + +var base = {}; +Object.defineProperty(base, "foo", { + get: function() { + return 42; + } +}); +var o = Object.create(base); + +assert.sameValue(o.hasOwnProperty("foo"), false, 'o.hasOwnProperty("foo")'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/prototype/hasOwnProperty/8.12.1-1_39.js b/js/src/tests/test262/built-ins/Object/prototype/hasOwnProperty/8.12.1-1_39.js new file mode 100644 index 0000000000..635c0e8ede --- /dev/null +++ b/js/src/tests/test262/built-ins/Object/prototype/hasOwnProperty/8.12.1-1_39.js @@ -0,0 +1,22 @@ +// Copyright (c) 2012 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es5id: 8.12.1-1_39 +description: > + Properties - [[HasOwnProperty]] (non-configurable, enumerable + inherited getter property) +---*/ + +var base = {}; +Object.defineProperty(base, "foo", { + get: function() { + return 42; + }, + enumerable: true +}); +var o = Object.create(base); + +assert.sameValue(o.hasOwnProperty("foo"), false, 'o.hasOwnProperty("foo")'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/prototype/hasOwnProperty/8.12.1-1_4.js b/js/src/tests/test262/built-ins/Object/prototype/hasOwnProperty/8.12.1-1_4.js new file mode 100644 index 0000000000..491227b690 --- /dev/null +++ b/js/src/tests/test262/built-ins/Object/prototype/hasOwnProperty/8.12.1-1_4.js @@ -0,0 +1,18 @@ +// Copyright (c) 2012 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es5id: 8.12.1-1_4 +description: > + Properties - [[HasOwnProperty]] (non-writable, non-configurable, + non-enumerable own value property) +---*/ + +var o = {}; +Object.defineProperty(o, "foo", { + value: 42 +}); + +assert(o.hasOwnProperty("foo"), 'o.hasOwnProperty("foo") !== true'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/prototype/hasOwnProperty/8.12.1-1_40.js b/js/src/tests/test262/built-ins/Object/prototype/hasOwnProperty/8.12.1-1_40.js new file mode 100644 index 0000000000..7c692ecf40 --- /dev/null +++ b/js/src/tests/test262/built-ins/Object/prototype/hasOwnProperty/8.12.1-1_40.js @@ -0,0 +1,22 @@ +// Copyright (c) 2012 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es5id: 8.12.1-1_40 +description: > + Properties - [[HasOwnProperty]] (configurable, non-enumerable + inherited getter property) +---*/ + +var base = {}; +Object.defineProperty(base, "foo", { + get: function() { + return 42; + }, + configurable: true +}); +var o = Object.create(base); + +assert.sameValue(o.hasOwnProperty("foo"), false, 'o.hasOwnProperty("foo")'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/prototype/hasOwnProperty/8.12.1-1_41.js b/js/src/tests/test262/built-ins/Object/prototype/hasOwnProperty/8.12.1-1_41.js new file mode 100644 index 0000000000..f267870cb8 --- /dev/null +++ b/js/src/tests/test262/built-ins/Object/prototype/hasOwnProperty/8.12.1-1_41.js @@ -0,0 +1,23 @@ +// Copyright (c) 2012 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es5id: 8.12.1-1_41 +description: > + Properties - [[HasOwnProperty]] (configurable, enumerable + inherited getter property) +---*/ + +var base = {}; +Object.defineProperty(base, "foo", { + get: function() { + return 42; + }, + enumerable: true, + configurable: true +}); +var o = Object.create(base); + +assert.sameValue(o.hasOwnProperty("foo"), false, 'o.hasOwnProperty("foo")'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/prototype/hasOwnProperty/8.12.1-1_42.js b/js/src/tests/test262/built-ins/Object/prototype/hasOwnProperty/8.12.1-1_42.js new file mode 100644 index 0000000000..441b04c354 --- /dev/null +++ b/js/src/tests/test262/built-ins/Object/prototype/hasOwnProperty/8.12.1-1_42.js @@ -0,0 +1,20 @@ +// Copyright (c) 2012 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es5id: 8.12.1-1_42 +description: > + Properties - [[HasOwnProperty]] (non-configurable, non-enumerable + inherited setter property) +---*/ + +var base = {}; +Object.defineProperty(base, "foo", { + set: function() {; + } +}); +var o = Object.create(base); + +assert.sameValue(o.hasOwnProperty("foo"), false, 'o.hasOwnProperty("foo")'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/prototype/hasOwnProperty/8.12.1-1_43.js b/js/src/tests/test262/built-ins/Object/prototype/hasOwnProperty/8.12.1-1_43.js new file mode 100644 index 0000000000..978196a536 --- /dev/null +++ b/js/src/tests/test262/built-ins/Object/prototype/hasOwnProperty/8.12.1-1_43.js @@ -0,0 +1,21 @@ +// Copyright (c) 2012 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es5id: 8.12.1-1_43 +description: > + Properties - [[HasOwnProperty]] (non-configurable, enumerable + inherited setter property) +---*/ + +var base = {}; +Object.defineProperty(base, "foo", { + set: function() {; + }, + enumerable: true +}); +var o = Object.create(base); + +assert.sameValue(o.hasOwnProperty("foo"), false, 'o.hasOwnProperty("foo")'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/prototype/hasOwnProperty/8.12.1-1_44.js b/js/src/tests/test262/built-ins/Object/prototype/hasOwnProperty/8.12.1-1_44.js new file mode 100644 index 0000000000..8cbee1a166 --- /dev/null +++ b/js/src/tests/test262/built-ins/Object/prototype/hasOwnProperty/8.12.1-1_44.js @@ -0,0 +1,21 @@ +// Copyright (c) 2012 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es5id: 8.12.1-1_44 +description: > + Properties - [[HasOwnProperty]] (configurable, non-enumerable + inherited setter property) +---*/ + +var base = {}; +Object.defineProperty(base, "foo", { + set: function() {; + }, + configurable: true +}); +var o = Object.create(base); + +assert.sameValue(o.hasOwnProperty("foo"), false, 'o.hasOwnProperty("foo")'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/prototype/hasOwnProperty/8.12.1-1_45.js b/js/src/tests/test262/built-ins/Object/prototype/hasOwnProperty/8.12.1-1_45.js new file mode 100644 index 0000000000..acf540ff63 --- /dev/null +++ b/js/src/tests/test262/built-ins/Object/prototype/hasOwnProperty/8.12.1-1_45.js @@ -0,0 +1,22 @@ +// Copyright (c) 2012 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es5id: 8.12.1-1_45 +description: > + Properties - [[HasOwnProperty]] (configurable, enumerable + inherited setter property) +---*/ + +var base = {}; +Object.defineProperty(base, "foo", { + set: function() {; + }, + enumerable: true, + configurable: true +}); +var o = Object.create(base); + +assert.sameValue(o.hasOwnProperty("foo"), false, 'o.hasOwnProperty("foo")'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/prototype/hasOwnProperty/8.12.1-1_46.js b/js/src/tests/test262/built-ins/Object/prototype/hasOwnProperty/8.12.1-1_46.js new file mode 100644 index 0000000000..fbba7cbf4c --- /dev/null +++ b/js/src/tests/test262/built-ins/Object/prototype/hasOwnProperty/8.12.1-1_46.js @@ -0,0 +1,23 @@ +// Copyright (c) 2012 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es5id: 8.12.1-1_46 +description: > + Properties - [[HasOwnProperty]] (non-configurable, non-enumerable + inherited getter/setter property) +---*/ + +var base = {}; +Object.defineProperty(base, "foo", { + get: function() { + return 42; + }, + set: function() {; + } +}); +var o = Object.create(base); + +assert.sameValue(o.hasOwnProperty("foo"), false, 'o.hasOwnProperty("foo")'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/prototype/hasOwnProperty/8.12.1-1_47.js b/js/src/tests/test262/built-ins/Object/prototype/hasOwnProperty/8.12.1-1_47.js new file mode 100644 index 0000000000..85d43eaf0c --- /dev/null +++ b/js/src/tests/test262/built-ins/Object/prototype/hasOwnProperty/8.12.1-1_47.js @@ -0,0 +1,24 @@ +// Copyright (c) 2012 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es5id: 8.12.1-1_47 +description: > + Properties - [[HasOwnProperty]] (non-configurable, enumerable + inherited getter/setter property) +---*/ + +var base = {}; +Object.defineProperty(base, "foo", { + get: function() { + return 42; + }, + set: function() {; + }, + enumerable: true +}); +var o = Object.create(base); + +assert.sameValue(o.hasOwnProperty("foo"), false, 'o.hasOwnProperty("foo")'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/prototype/hasOwnProperty/8.12.1-1_48.js b/js/src/tests/test262/built-ins/Object/prototype/hasOwnProperty/8.12.1-1_48.js new file mode 100644 index 0000000000..2746714b7a --- /dev/null +++ b/js/src/tests/test262/built-ins/Object/prototype/hasOwnProperty/8.12.1-1_48.js @@ -0,0 +1,24 @@ +// Copyright (c) 2012 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es5id: 8.12.1-1_48 +description: > + Properties - [[HasOwnProperty]] (configurable, non-enumerable + inherited getter/setter property) +---*/ + +var base = {}; +Object.defineProperty(base, "foo", { + get: function() { + return 42; + }, + set: function() {; + }, + configurable: true +}); +var o = Object.create(base); + +assert.sameValue(o.hasOwnProperty("foo"), false, 'o.hasOwnProperty("foo")'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/prototype/hasOwnProperty/8.12.1-1_49.js b/js/src/tests/test262/built-ins/Object/prototype/hasOwnProperty/8.12.1-1_49.js new file mode 100644 index 0000000000..4cda6bb3a1 --- /dev/null +++ b/js/src/tests/test262/built-ins/Object/prototype/hasOwnProperty/8.12.1-1_49.js @@ -0,0 +1,25 @@ +// Copyright (c) 2012 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es5id: 8.12.1-1_49 +description: > + Properties - [[HasOwnProperty]] (configurable, enumerable + inherited getter/setter property) +---*/ + +var base = {}; +Object.defineProperty(base, "foo", { + get: function() { + return 42; + }, + set: function() {; + }, + enumerable: true, + configurable: true +}); +var o = Object.create(base); + +assert.sameValue(o.hasOwnProperty("foo"), false, 'o.hasOwnProperty("foo")'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/prototype/hasOwnProperty/8.12.1-1_5.js b/js/src/tests/test262/built-ins/Object/prototype/hasOwnProperty/8.12.1-1_5.js new file mode 100644 index 0000000000..e128936983 --- /dev/null +++ b/js/src/tests/test262/built-ins/Object/prototype/hasOwnProperty/8.12.1-1_5.js @@ -0,0 +1,19 @@ +// Copyright (c) 2012 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es5id: 8.12.1-1_5 +description: > + Properties - [[HasOwnProperty]] (non-writable, non-configurable, + enumerable own value property) +---*/ + +var o = {}; +Object.defineProperty(o, "foo", { + value: 42, + enumerable: true +}); + +assert(o.hasOwnProperty("foo"), 'o.hasOwnProperty("foo") !== true'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/prototype/hasOwnProperty/8.12.1-1_6.js b/js/src/tests/test262/built-ins/Object/prototype/hasOwnProperty/8.12.1-1_6.js new file mode 100644 index 0000000000..95c8994b43 --- /dev/null +++ b/js/src/tests/test262/built-ins/Object/prototype/hasOwnProperty/8.12.1-1_6.js @@ -0,0 +1,19 @@ +// Copyright (c) 2012 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es5id: 8.12.1-1_6 +description: > + Properties - [[HasOwnProperty]] (non-writable, configurable, + non-enumerable own value property) +---*/ + +var o = {}; +Object.defineProperty(o, "foo", { + value: 42, + configurable: true +}); + +assert(o.hasOwnProperty("foo"), 'o.hasOwnProperty("foo") !== true'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/prototype/hasOwnProperty/8.12.1-1_7.js b/js/src/tests/test262/built-ins/Object/prototype/hasOwnProperty/8.12.1-1_7.js new file mode 100644 index 0000000000..d3a3a9104a --- /dev/null +++ b/js/src/tests/test262/built-ins/Object/prototype/hasOwnProperty/8.12.1-1_7.js @@ -0,0 +1,19 @@ +// Copyright (c) 2012 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es5id: 8.12.1-1_7 +description: > + Properties - [[HasOwnProperty]] (writable, non-configurable, + non-enumerable own value property) +---*/ + +var o = {}; +Object.defineProperty(o, "foo", { + value: 42, + writable: true +}); + +assert(o.hasOwnProperty("foo"), 'o.hasOwnProperty("foo") !== true'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/prototype/hasOwnProperty/8.12.1-1_8.js b/js/src/tests/test262/built-ins/Object/prototype/hasOwnProperty/8.12.1-1_8.js new file mode 100644 index 0000000000..4ef56ef4b0 --- /dev/null +++ b/js/src/tests/test262/built-ins/Object/prototype/hasOwnProperty/8.12.1-1_8.js @@ -0,0 +1,20 @@ +// Copyright (c) 2012 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es5id: 8.12.1-1_8 +description: > + Properties - [[HasOwnProperty]] (non-writable, configurable, + enumerable own value property) +---*/ + +var o = {}; +Object.defineProperty(o, "foo", { + value: 42, + configurable: true, + enumerable: true +}); + +assert(o.hasOwnProperty("foo"), 'o.hasOwnProperty("foo") !== true'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/prototype/hasOwnProperty/8.12.1-1_9.js b/js/src/tests/test262/built-ins/Object/prototype/hasOwnProperty/8.12.1-1_9.js new file mode 100644 index 0000000000..ef1d16f1c6 --- /dev/null +++ b/js/src/tests/test262/built-ins/Object/prototype/hasOwnProperty/8.12.1-1_9.js @@ -0,0 +1,20 @@ +// Copyright (c) 2012 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es5id: 8.12.1-1_9 +description: > + Properties - [[HasOwnProperty]] (writable, non-configurable, + enumerable own value property) +---*/ + +var o = {}; +Object.defineProperty(o, "foo", { + value: 42, + writable: true, + enumerable: true +}); + +assert(o.hasOwnProperty("foo"), 'o.hasOwnProperty("foo") !== true'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/prototype/hasOwnProperty/S15.2.4.5_A12.js b/js/src/tests/test262/built-ins/Object/prototype/hasOwnProperty/S15.2.4.5_A12.js new file mode 100644 index 0000000000..d22be23a7d --- /dev/null +++ b/js/src/tests/test262/built-ins/Object/prototype/hasOwnProperty/S15.2.4.5_A12.js @@ -0,0 +1,15 @@ +// Copyright 2011 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es5id: 15.2.4.5_A12 +description: > + Let O be the result of calling ToObject passing the this value as + the argument. +---*/ + +assert.throws(TypeError, function() { + Object.prototype.hasOwnProperty.call(undefined, 'foo'); +}, 'Object.prototype.hasOwnProperty.call(undefined, "foo") throws a TypeError exception'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/prototype/hasOwnProperty/S15.2.4.5_A13.js b/js/src/tests/test262/built-ins/Object/prototype/hasOwnProperty/S15.2.4.5_A13.js new file mode 100644 index 0000000000..b8f3f150ac --- /dev/null +++ b/js/src/tests/test262/built-ins/Object/prototype/hasOwnProperty/S15.2.4.5_A13.js @@ -0,0 +1,15 @@ +// Copyright 2011 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es5id: 15.2.4.5_A13 +description: > + Let O be the result of calling ToObject passing the this value as + the argument. +---*/ + +assert.throws(TypeError, function() { + Object.prototype.hasOwnProperty.call(null, 'foo'); +}, 'Object.prototype.hasOwnProperty.call(null, "foo") throws a TypeError exception'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/prototype/hasOwnProperty/S15.2.4.5_A1_T1.js b/js/src/tests/test262/built-ins/Object/prototype/hasOwnProperty/S15.2.4.5_A1_T1.js new file mode 100644 index 0000000000..72f641c6ea --- /dev/null +++ b/js/src/tests/test262/built-ins/Object/prototype/hasOwnProperty/S15.2.4.5_A1_T1.js @@ -0,0 +1,27 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +info: | + When the hasOwnProperty method is called with argument V, the following steps are taken: + i) Let O be this object + ii) Call ToString(V) + iii) If O doesn't have a property with the name given by Result(ii), return false + iv) Return true +es5id: 15.2.4.5_A1_T1 +description: > + Checking type of the Object.prototype.hasOwnProperty and the + returned result +---*/ +assert.sameValue( + typeof Object.prototype.hasOwnProperty, + "function", + 'The value of `typeof Object.prototype.hasOwnProperty` is expected to be "function"' +); + +assert( + !!Object.prototype.hasOwnProperty("hasOwnProperty"), + 'The value of !!Object.prototype.hasOwnProperty("hasOwnProperty") is expected to be true' +); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/prototype/hasOwnProperty/S15.2.4.5_A1_T2.js b/js/src/tests/test262/built-ins/Object/prototype/hasOwnProperty/S15.2.4.5_A1_T2.js new file mode 100644 index 0000000000..d3b6acdad5 --- /dev/null +++ b/js/src/tests/test262/built-ins/Object/prototype/hasOwnProperty/S15.2.4.5_A1_T2.js @@ -0,0 +1,40 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +info: | + When the hasOwnProperty method is called with argument V, the following steps are taken: + i) Let O be this object + ii) Call ToString(V) + iii) If O doesn't have a property with the name given by Result(ii), return false + iv) Return true +es5id: 15.2.4.5_A1_T2 +description: Argument of the hasOwnProperty method is a custom boolean property +---*/ +assert.sameValue( + typeof Object.prototype.hasOwnProperty, + "function", + 'The value of `typeof Object.prototype.hasOwnProperty` is expected to be "function"' +); + +var obj = { + the_property: true +}; + +assert.sameValue( + typeof obj.hasOwnProperty, + "function", + 'The value of `typeof obj.hasOwnProperty` is expected to be "function"' +); + +assert( + !obj.hasOwnProperty("hasOwnProperty"), + 'The value of !obj.hasOwnProperty("hasOwnProperty") is expected to be true' +); + +assert( + !!obj.hasOwnProperty("the_property"), + 'The value of !!obj.hasOwnProperty("the_property") is expected to be true' +); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/prototype/hasOwnProperty/S15.2.4.5_A1_T3.js b/js/src/tests/test262/built-ins/Object/prototype/hasOwnProperty/S15.2.4.5_A1_T3.js new file mode 100644 index 0000000000..407765b865 --- /dev/null +++ b/js/src/tests/test262/built-ins/Object/prototype/hasOwnProperty/S15.2.4.5_A1_T3.js @@ -0,0 +1,45 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +info: | + When the hasOwnProperty method is called with argument V, the following steps are taken: + i) Let O be this object + ii) Call ToString(V) + iii) If O doesn't have a property with the name given by Result(ii), return false + iv) Return true +es5id: 15.2.4.5_A1_T3 +description: > + Argument of the hasOwnProperty method is a custom property of a + function object +---*/ + +var FACTORY = function() { + this.aproperty = 1; +}; + +var instance = new FACTORY; + +assert.sameValue( + typeof Object.prototype.hasOwnProperty, + "function", + 'The value of `typeof Object.prototype.hasOwnProperty` is expected to be "function"' +); + +assert.sameValue( + typeof instance.hasOwnProperty, + "function", + 'The value of `typeof instance.hasOwnProperty` is expected to be "function"' +); + +assert( + !instance.hasOwnProperty("toString"), + 'The value of !instance.hasOwnProperty("toString") is expected to be true' +); + +assert( + !!instance.hasOwnProperty("aproperty"), + 'The value of !!instance.hasOwnProperty("aproperty") is expected to be true' +); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/prototype/hasOwnProperty/S15.2.4.5_A6.js b/js/src/tests/test262/built-ins/Object/prototype/hasOwnProperty/S15.2.4.5_A6.js new file mode 100644 index 0000000000..7b1ee66e75 --- /dev/null +++ b/js/src/tests/test262/built-ins/Object/prototype/hasOwnProperty/S15.2.4.5_A6.js @@ -0,0 +1,17 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +info: Object.prototype.hasOwnProperty has not prototype property +es5id: 15.2.4.5_A6 +description: > + Checking if obtaining the prototype property of + Object.prototype.hasOwnProperty fails +---*/ +assert.sameValue( + Object.prototype.hasOwnProperty.prototype, + undefined, + 'The value of Object.prototype.hasOwnProperty.prototype is expected to equal undefined' +); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/prototype/hasOwnProperty/browser.js b/js/src/tests/test262/built-ins/Object/prototype/hasOwnProperty/browser.js new file mode 100644 index 0000000000..e69de29bb2 --- /dev/null +++ b/js/src/tests/test262/built-ins/Object/prototype/hasOwnProperty/browser.js diff --git a/js/src/tests/test262/built-ins/Object/prototype/hasOwnProperty/length.js b/js/src/tests/test262/built-ins/Object/prototype/hasOwnProperty/length.js new file mode 100644 index 0000000000..3bebbbd35d --- /dev/null +++ b/js/src/tests/test262/built-ins/Object/prototype/hasOwnProperty/length.js @@ -0,0 +1,30 @@ +// Copyright (C) 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +esid: sec-object.prototype.hasownproperty +description: > + Object.prototype.hasOwnProperty.length is 1. +info: | + Object.prototype.hasOwnProperty ( V ) + + ECMAScript Standard Built-in Objects + + Every built-in function object, including constructors, has a "length" + property whose value is an integer. Unless otherwise specified, this + value is equal to the largest number of named arguments shown in the + subclause headings for the function description. + + Unless otherwise specified, the "length" property of a built-in Function + object has the attributes { [[Writable]]: false, [[Enumerable]]: false, + [[Configurable]]: true }. +includes: [propertyHelper.js] +---*/ + +verifyProperty(Object.prototype.hasOwnProperty, "length", { + value: 1, + writable: false, + enumerable: false, + configurable: true, +}); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/prototype/hasOwnProperty/name.js b/js/src/tests/test262/built-ins/Object/prototype/hasOwnProperty/name.js new file mode 100644 index 0000000000..ae01259e26 --- /dev/null +++ b/js/src/tests/test262/built-ins/Object/prototype/hasOwnProperty/name.js @@ -0,0 +1,28 @@ +// Copyright (C) 2015 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es6id: 19.1.3.2 +description: > + Object.prototype.hasOwnProperty.name is "hasOwnProperty". +info: | + Object.prototype.hasOwnProperty ( V ) + + 17 ECMAScript Standard Built-in Objects: + Every built-in Function object, including constructors, that is not + identified as an anonymous function has a name property whose value + is a String. + + Unless otherwise specified, the name property of a built-in Function + object, if it exists, has the attributes { [[Writable]]: false, + [[Enumerable]]: false, [[Configurable]]: true }. +includes: [propertyHelper.js] +---*/ + +assert.sameValue(Object.prototype.hasOwnProperty.name, "hasOwnProperty"); + +verifyNotEnumerable(Object.prototype.hasOwnProperty, "name"); +verifyNotWritable(Object.prototype.hasOwnProperty, "name"); +verifyConfigurable(Object.prototype.hasOwnProperty, "name"); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/prototype/hasOwnProperty/not-a-constructor.js b/js/src/tests/test262/built-ins/Object/prototype/hasOwnProperty/not-a-constructor.js new file mode 100644 index 0000000000..07d38e779c --- /dev/null +++ b/js/src/tests/test262/built-ins/Object/prototype/hasOwnProperty/not-a-constructor.js @@ -0,0 +1,35 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + Object.prototype.hasOwnProperty does not implement [[Construct]], is not new-able +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. + + sec-evaluatenew + + ... + 7. If IsConstructor(constructor) is false, throw a TypeError exception. + ... +includes: [isConstructor.js] +features: [Reflect.construct, arrow-function] +---*/ + +assert.sameValue( + isConstructor(Object.prototype.hasOwnProperty), + false, + 'isConstructor(Object.prototype.hasOwnProperty) must return false' +); + +assert.throws(TypeError, () => { + new Object.prototype.hasOwnProperty(''); +}, '`new Object.prototype.hasOwnProperty(\'\')` throws TypeError'); + + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/prototype/hasOwnProperty/shell.js b/js/src/tests/test262/built-ins/Object/prototype/hasOwnProperty/shell.js new file mode 100644 index 0000000000..e69de29bb2 --- /dev/null +++ b/js/src/tests/test262/built-ins/Object/prototype/hasOwnProperty/shell.js diff --git a/js/src/tests/test262/built-ins/Object/prototype/hasOwnProperty/symbol_own_property.js b/js/src/tests/test262/built-ins/Object/prototype/hasOwnProperty/symbol_own_property.js new file mode 100644 index 0000000000..d7b0abea3c --- /dev/null +++ b/js/src/tests/test262/built-ins/Object/prototype/hasOwnProperty/symbol_own_property.js @@ -0,0 +1,33 @@ +// Copyright (C) 2015 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +description: Object.prototype.hasOwnProperty called with symbol property key +info: | + 19.1.3.2 Object.prototype.hasOwnProperty ( V ) + + 1. Let P be ToPropertyKey(V). + 2. ReturnIfAbrupt(P). + ... +es6id: 19.1.3.2 +features: [Symbol] +---*/ + +var obj = {}; +var sym = Symbol(); + +assert.sameValue( + obj.hasOwnProperty(sym), + false, + "Returns false if symbol own property not found" +); + +obj[sym] = 0; + +assert.sameValue( + obj.hasOwnProperty(sym), + true, + "Returns true if symbol own property found" +); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/prototype/hasOwnProperty/symbol_property_toPrimitive.js b/js/src/tests/test262/built-ins/Object/prototype/hasOwnProperty/symbol_property_toPrimitive.js new file mode 100644 index 0000000000..03a211d08e --- /dev/null +++ b/js/src/tests/test262/built-ins/Object/prototype/hasOwnProperty/symbol_property_toPrimitive.js @@ -0,0 +1,36 @@ +// Copyright (C) 2015 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +description: Object.prototype.hasOwnProperty with symbol and @@toPrimitive conversion +info: | + 19.1.3.2 Object.prototype.hasOwnProperty ( V ) + + 1. Let P be ToPropertyKey(V). + 2. ReturnIfAbrupt(P). + ... +es6id: 19.1.3.2 +features: [Symbol.toPrimitive] +---*/ + +var obj = {}; +var sym = Symbol(); + +var callCount = 0; +var wrapper = {}; +wrapper[Symbol.toPrimitive] = function() { + callCount += 1; + return sym; +}; + +obj[sym] = 0; + +assert.sameValue( + obj.hasOwnProperty(wrapper), + true, + "Returns true if symbol own property found" +); + +assert.sameValue(callCount, 1, "toPrimitive method called exactly once"); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/prototype/hasOwnProperty/symbol_property_toString.js b/js/src/tests/test262/built-ins/Object/prototype/hasOwnProperty/symbol_property_toString.js new file mode 100644 index 0000000000..5d807383e7 --- /dev/null +++ b/js/src/tests/test262/built-ins/Object/prototype/hasOwnProperty/symbol_property_toString.js @@ -0,0 +1,40 @@ +// Copyright (C) 2015 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +description: Object.prototype.hasOwnProperty with symbol and toString conversion +info: | + 19.1.3.2 Object.prototype.hasOwnProperty ( V ) + + 1. Let P be ToPropertyKey(V). + 2. ReturnIfAbrupt(P). + ... +es6id: 19.1.3.2 +features: [Symbol] +---*/ + +var obj = {}; +var sym = Symbol(); + +var callCount = 0; +var wrapper = { + toString: function() { + callCount += 1; + return sym; + }, + valueOf: function() { + throw new Test262Error("valueOf() called"); + } +}; + +obj[sym] = 0; + +assert.sameValue( + obj.hasOwnProperty(wrapper), + true, + "Returns true if symbol own property found" +); + +assert.sameValue(callCount, 1, "toString method called exactly once"); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/prototype/hasOwnProperty/symbol_property_valueOf.js b/js/src/tests/test262/built-ins/Object/prototype/hasOwnProperty/symbol_property_valueOf.js new file mode 100644 index 0000000000..0a8b0f97d3 --- /dev/null +++ b/js/src/tests/test262/built-ins/Object/prototype/hasOwnProperty/symbol_property_valueOf.js @@ -0,0 +1,38 @@ +// Copyright (C) 2015 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +description: Object.prototype.hasOwnProperty with symbol and valueOf conversion +info: | + 19.1.3.2 Object.prototype.hasOwnProperty ( V ) + + 1. Let P be ToPropertyKey(V). + 2. ReturnIfAbrupt(P). + ... +es6id: 19.1.3.2 +features: [Symbol] +---*/ + +var obj = {}; +var sym = Symbol(); + +var callCount = 0; +var wrapper = { + valueOf: function() { + callCount += 1; + return sym; + }, + toString: null +}; + +obj[sym] = 0; + +assert.sameValue( + obj.hasOwnProperty(wrapper), + true, + "Returns true if symbol own property found" +); + +assert.sameValue(callCount, 1, "valueOf method called exactly once"); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/prototype/hasOwnProperty/topropertykey_before_toobject.js b/js/src/tests/test262/built-ins/Object/prototype/hasOwnProperty/topropertykey_before_toobject.js new file mode 100644 index 0000000000..76ba785ec3 --- /dev/null +++ b/js/src/tests/test262/built-ins/Object/prototype/hasOwnProperty/topropertykey_before_toobject.js @@ -0,0 +1,47 @@ +// Copyright (C) 2020 Alexey Shvayka. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +esid: sec-object.prototype.hasownproperty +description: > + ToPropertyKey is performed before ToObject. +info: | + Object.prototype.hasOwnProperty ( V ) + + 1. Let P be ? ToPropertyKey(V). + 2. Let O be ? ToObject(this value). + + ToPropertyKey ( argument ) + + 1. Let key be ? ToPrimitive(argument, hint String). +features: [Symbol.toPrimitive] +---*/ + +var coercibleKey1 = { + get toString() { + this.hint = "string"; + throw new Test262Error(); + }, + get valueOf() { + this.hint = "defaultOrNumber"; + throw new Test262Error(); + }, +}; + +assert.throws(Test262Error, function() { + Object.prototype.hasOwnProperty.call(null, coercibleKey1); +}); +assert.sameValue(coercibleKey1.hint, "string"); + + +var coercibleKey2 = {}; +coercibleKey2[Symbol.toPrimitive] = function(hint) { + this.hint = hint; + throw new Test262Error(); +}; + +assert.throws(Test262Error, function() { + Object.prototype.hasOwnProperty.call(undefined, coercibleKey2); +}); +assert.sameValue(coercibleKey2.hint, "string"); + +reportCompare(0, 0); |