diff options
Diffstat (limited to 'js/src/tests/test262/built-ins/Date/prototype/constructor')
9 files changed, 158 insertions, 0 deletions
diff --git a/js/src/tests/test262/built-ins/Date/prototype/constructor/S15.9.5.1_A1_T1.js b/js/src/tests/test262/built-ins/Date/prototype/constructor/S15.9.5.1_A1_T1.js new file mode 100644 index 0000000000..3eb5e9e73b --- /dev/null +++ b/js/src/tests/test262/built-ins/Date/prototype/constructor/S15.9.5.1_A1_T1.js @@ -0,0 +1,25 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +info: The Date.prototype property "constructor" has { DontEnum } attributes +esid: sec-date.prototype.constructor +description: Checking absence of ReadOnly attribute +---*/ + +var x = Date.prototype.constructor; +if (x === 1) { + Date.prototype.constructor = 2; +} else { + Date.prototype.constructor = 1; +} + +assert.notSameValue( + Date.prototype.constructor, + x, + 'The value of Date.prototype.constructor is expected to not equal the value of `x`' +); + +// TODO: Convert to verifyProperty() format. + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Date/prototype/constructor/S15.9.5.1_A1_T2.js b/js/src/tests/test262/built-ins/Date/prototype/constructor/S15.9.5.1_A1_T2.js new file mode 100644 index 0000000000..5c5c11a6ca --- /dev/null +++ b/js/src/tests/test262/built-ins/Date/prototype/constructor/S15.9.5.1_A1_T2.js @@ -0,0 +1,22 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +info: The Date.prototype property "constructor" has { DontEnum } attributes +esid: sec-date.prototype.constructor +description: Checking absence of DontDelete attribute +---*/ +assert.notSameValue( + delete Date.prototype.constructor, + false, + 'The value of delete Date.prototype.constructor is not false' +); + +assert( + !Date.prototype.hasOwnProperty('constructor'), + 'The value of !Date.prototype.hasOwnProperty(\'constructor\') is expected to be true' +); + +// TODO: Convert to verifyProperty() format. + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Date/prototype/constructor/S15.9.5.1_A1_T3.js b/js/src/tests/test262/built-ins/Date/prototype/constructor/S15.9.5.1_A1_T3.js new file mode 100644 index 0000000000..4836a6f517 --- /dev/null +++ b/js/src/tests/test262/built-ins/Date/prototype/constructor/S15.9.5.1_A1_T3.js @@ -0,0 +1,20 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +info: The Date.prototype property "constructor" has { DontEnum } attributes +esid: sec-date.prototype.constructor +description: Checking DontEnum attribute +---*/ +assert( + !Date.prototype.propertyIsEnumerable('constructor'), + 'The value of !Date.prototype.propertyIsEnumerable(\'constructor\') is expected to be true' +); + +for (var x in Date.prototype) { + assert.notSameValue(x, "constructor", 'The value of x is not "constructor"'); +} + +// TODO: Convert to verifyProperty() format. + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Date/prototype/constructor/S15.9.5.1_A2_T1.js b/js/src/tests/test262/built-ins/Date/prototype/constructor/S15.9.5.1_A2_T1.js new file mode 100644 index 0000000000..8bc40b00c6 --- /dev/null +++ b/js/src/tests/test262/built-ins/Date/prototype/constructor/S15.9.5.1_A2_T1.js @@ -0,0 +1,21 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +info: The "length" property of the "constructor" is 7 +esid: sec-date.prototype.constructor +description: The "length" property of the "constructor" is 7 +---*/ +assert.sameValue( + Date.prototype.constructor.hasOwnProperty("length"), + true, + 'Date.prototype.constructor.hasOwnProperty("length") must return true' +); + +assert.sameValue( + Date.prototype.constructor.length, + 7, + 'The value of Date.prototype.constructor.length is expected to be 7' +); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Date/prototype/constructor/S15.9.5.1_A3_T1.js b/js/src/tests/test262/built-ins/Date/prototype/constructor/S15.9.5.1_A3_T1.js new file mode 100644 index 0000000000..fd40dfb3de --- /dev/null +++ b/js/src/tests/test262/built-ins/Date/prototype/constructor/S15.9.5.1_A3_T1.js @@ -0,0 +1,24 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +info: | + The Date.prototype.constructor property "length" has { ReadOnly, + DontDelete, DontEnum } attributes +esid: sec-date.prototype.constructor +description: Checking ReadOnly attribute +includes: [propertyHelper.js] +---*/ + +var x = Date.prototype.constructor.length; +verifyNotWritable(Date.prototype.constructor, "length", null, 1); + +assert.sameValue( + Date.prototype.constructor.length, + x, + 'The value of Date.prototype.constructor.length is expected to equal the value of x' +); + +// TODO: Convert to verifyProperty() format. + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Date/prototype/constructor/S15.9.5.1_A3_T2.js b/js/src/tests/test262/built-ins/Date/prototype/constructor/S15.9.5.1_A3_T2.js new file mode 100644 index 0000000000..c47d0ec996 --- /dev/null +++ b/js/src/tests/test262/built-ins/Date/prototype/constructor/S15.9.5.1_A3_T2.js @@ -0,0 +1,24 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +info: | + The Date.prototype.constructor property "length" has { ReadOnly, ! + DontDelete, DontEnum } attributes +esid: sec-date.prototype.constructor +description: Checking DontDelete attribute +---*/ +assert.sameValue( + delete Date.prototype.constructor.length, + true, + 'The value of `delete Date.prototype.constructor.length` is expected to be true' +); + +assert( + !Date.prototype.constructor.hasOwnProperty('length'), + 'The value of !Date.prototype.constructor.hasOwnProperty(\'length\') is expected to be true' +); + +// TODO: Convert to verifyProperty() format. + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Date/prototype/constructor/S15.9.5.1_A3_T3.js b/js/src/tests/test262/built-ins/Date/prototype/constructor/S15.9.5.1_A3_T3.js new file mode 100644 index 0000000000..3821e5da76 --- /dev/null +++ b/js/src/tests/test262/built-ins/Date/prototype/constructor/S15.9.5.1_A3_T3.js @@ -0,0 +1,22 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +info: | + The Date.prototype.constructor property "length" has { ReadOnly, + DontDelete, DontEnum } attributes +esid: sec-date.prototype.constructor +description: Checking DontEnum attribute +---*/ +assert( + !Date.prototype.constructor.propertyIsEnumerable('length'), + 'The value of !Date.prototype.constructor.propertyIsEnumerable(\'length\') is expected to be true' +); + +for (var x in Date.prototype.constructor) { + assert.notSameValue(x, "length", 'The value of x is not "length"'); +} + +// TODO: Convert to verifyProperty() format. + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Date/prototype/constructor/browser.js b/js/src/tests/test262/built-ins/Date/prototype/constructor/browser.js new file mode 100644 index 0000000000..e69de29bb2 --- /dev/null +++ b/js/src/tests/test262/built-ins/Date/prototype/constructor/browser.js diff --git a/js/src/tests/test262/built-ins/Date/prototype/constructor/shell.js b/js/src/tests/test262/built-ins/Date/prototype/constructor/shell.js new file mode 100644 index 0000000000..e69de29bb2 --- /dev/null +++ b/js/src/tests/test262/built-ins/Date/prototype/constructor/shell.js |