From 56036e4064da981fec3b3bfc7f34e22e684b249b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Bargull?= Date: Thu, 14 May 2015 17:22:12 +0200 Subject: [PATCH] Enable strict mode for more built-in tests - Remove no longer needed noStrict flags. - Change tests to use propertyHelper.js for strict mode compatibility. - Add tests for return value of `delete` operator, e.g. `delete Array.prototype === false`. - Add non-writable tests for global NaN property. - Split some tests to run in strict mode. - Change tests with global `var length` declaration to use a different variable name for browser environments. - Merge duplicated tests symbol-data-property-configurable-non-strict and symbol-data-property-configurable-strict. - Merge duplicated tests symbol-data-property-writable-non-strict and symbol-data-property-writable-strict. - (And a small change in propertyHelper to reduce code duplication in function call.) --- harness/propertyHelper.js | 3 +- test/built-ins/Array/S15.4.3_A2.3.js | 4 +- .../built-ins/Array/prototype/S15.4.3.1_A3.js | 23 +++++++--- .../built-ins/Array/prototype/S15.4.3.1_A4.js | 4 +- .../Array/prototype/concat/S15.4.4.4_A4.2.js | 1 - .../Array/prototype/concat/S15.4.4.4_A4.3.js | 4 +- .../Array/prototype/join/S15.4.4.5_A6.2.js | 1 - .../Array/prototype/join/S15.4.4.5_A6.3.js | 4 +- .../Array/prototype/pop/S15.4.4.6_A5.2.js | 1 - .../Array/prototype/pop/S15.4.4.6_A5.3.js | 4 +- .../Array/prototype/push/S15.4.4.7_A6.2.js | 1 - .../Array/prototype/push/S15.4.4.7_A6.3.js | 4 +- .../Array/prototype/reverse/S15.4.4.8_A5.2.js | 1 - .../Array/prototype/reverse/S15.4.4.8_A5.3.js | 4 +- .../Array/prototype/shift/S15.4.4.9_A5.3.js | 4 +- .../Array/prototype/slice/S15.4.4.10_A5.3.js | 4 +- .../Array/prototype/sort/S15.4.4.11_A7.2.js | 1 - .../Array/prototype/sort/S15.4.4.11_A7.3.js | 4 +- .../Array/prototype/splice/S15.4.4.12_A5.2.js | 1 - .../Array/prototype/splice/S15.4.4.12_A5.3.js | 4 +- .../toLocaleString/S15.4.4.3_A4.3.js | 4 +- .../prototype/toString/S15.4.4.2_A4.2.js | 1 - .../prototype/toString/S15.4.4.2_A4.3.js | 4 +- .../prototype/unshift/S15.4.4.13_A5.2.js | 1 - .../prototype/unshift/S15.4.4.13_A5.3.js | 4 +- .../Boolean/prototype/S15.6.3.1_A2.js | 6 +-- .../Boolean/prototype/S15.6.3.1_A3.js | 13 ++++-- test/built-ins/Date/UTC/S15.9.4.3_A3_T1.js | 6 +-- test/built-ins/Date/parse/S15.9.4.2_A3_T1.js | 6 +-- .../Date/prototype/S15.9.4.1_A1_T1.js | 6 +-- .../Date/prototype/S15.9.4.1_A1_T2.js | 14 ++++-- .../prototype/constructor/S15.9.5.1_A3_T1.js | 6 +-- .../prototype/getDate/S15.9.5.14_A3_T1.js | 6 +-- .../Date/prototype/getDay/S15.9.5.16_A3_T1.js | 6 +-- .../prototype/getFullYear/S15.9.5.10_A3_T1.js | 6 +-- .../prototype/getHours/S15.9.5.18_A3_T1.js | 6 +-- .../getMilliseconds/S15.9.5.24_A3_T1.js | 6 +-- .../prototype/getMinutes/S15.9.5.20_A3_T1.js | 6 +-- .../prototype/getMonth/S15.9.5.12_A3_T1.js | 6 +-- .../prototype/getSeconds/S15.9.5.22_A3_T1.js | 6 +-- .../Date/prototype/getTime/S15.9.5.9_A3_T1.js | 6 +-- .../getTimezoneOffset/S15.9.5.26_A3_T1.js | 6 +-- .../prototype/getUTCDate/S15.9.5.15_A3_T1.js | 6 +-- .../prototype/getUTCDay/S15.9.5.17_A3_T1.js | 6 +-- .../getUTCFullYear/S15.9.5.11_A3_T1.js | 6 +-- .../prototype/getUTCHours/S15.9.5.19_A3_T1.js | 6 +-- .../getUTCMilliseconds/S15.9.5.25_A3_T1.js | 6 +-- .../getUTCMinutes/S15.9.5.21_A3_T1.js | 6 +-- .../prototype/getUTCMonth/S15.9.5.13_A3_T1.js | 6 +-- .../getUTCSeconds/S15.9.5.23_A3_T1.js | 6 +-- .../prototype/setDate/S15.9.5.36_A3_T1.js | 6 +-- .../prototype/setFullYear/S15.9.5.40_A3_T1.js | 6 +-- .../prototype/setHours/S15.9.5.34_A3_T1.js | 6 +-- .../setMilliseconds/S15.9.5.28_A3_T1.js | 6 +-- .../prototype/setMinutes/S15.9.5.32_A3_T1.js | 6 +-- .../prototype/setMonth/S15.9.5.38_A3_T1.js | 6 +-- .../prototype/setSeconds/S15.9.5.30_A3_T1.js | 6 +-- .../prototype/setTime/S15.9.5.27_A3_T1.js | 6 +-- .../prototype/setUTCDate/S15.9.5.37_A3_T1.js | 6 +-- .../setUTCFullYear/S15.9.5.41_A3_T1.js | 6 +-- .../prototype/setUTCHours/S15.9.5.35_A3_T1.js | 6 +-- .../setUTCMilliseconds/S15.9.5.29_A3_T1.js | 6 +-- .../setUTCMinutes/S15.9.5.33_A3_T1.js | 6 +-- .../prototype/setUTCMonth/S15.9.5.39_A3_T1.js | 6 +-- .../setUTCSeconds/S15.9.5.31_A3_T1.js | 6 +-- .../prototype/toDateString/S15.9.5.3_A3_T1.js | 6 +-- .../toLocaleDateString/S15.9.5.6_A3_T1.js | 6 +-- .../toLocaleString/S15.9.5.5_A3_T1.js | 6 +-- .../toLocaleTimeString/S15.9.5.7_A3_T1.js | 6 +-- .../prototype/toString/S15.9.5.2_A3_T1.js | 6 +-- .../prototype/toTimeString/S15.9.5.4_A3_T1.js | 6 +-- .../prototype/toUTCString/S15.9.5.42_A3_T1.js | 6 +-- .../Date/prototype/valueOf/S15.9.5.8_A3_T1.js | 6 +-- .../Error/prototype/S15.11.3.1_A1_T1.js | 12 ++++-- .../Error/prototype/S15.11.3.1_A3_T1.js | 8 ++-- .../Function/length/S15.3.5.1_A3_T1.js | 13 +++--- .../Function/length/S15.3.5.1_A3_T2.js | 13 +++--- .../Function/length/S15.3.5.1_A3_T3.js | 13 +++--- .../Function/prototype/S15.3.3.1_A1.js | 5 ++- .../Function/prototype/S15.3.3.1_A3.js | 18 ++++++-- .../Function/prototype/S15.3.5.2_A1_T1.js | 18 +++++--- .../Function/prototype/S15.3.5.2_A1_T2.js | 18 +++++--- .../Function/prototype/apply/S15.3.4.3_A10.js | 5 +-- .../Function/prototype/bind/15.3.4.5-15-3.js | 20 +++------ .../Function/prototype/call/S15.3.4.4_A10.js | 5 +-- .../prototype/toString/S15.3.4.2_A10.js | 5 +-- test/built-ins/Infinity/S15.1.1.2_A2_T1.js | 15 +++++++ test/built-ins/Infinity/S15.1.1.2_A2_T2.js | 9 ++-- test/built-ins/Infinity/S15.1.1.2_A3_T1.js | 21 +++++++++ .../{S15.1.1.2_A3.1.js => S15.1.1.2_A3_T2.js} | 4 +- .../{S15.1.1.2_A3.2.js => S15.1.1.2_A4.js} | 4 +- test/built-ins/Math/E/S15.8.1.1_A3.js | 11 ++++- test/built-ins/Math/E/S15.8.1.1_A4.js | 4 +- test/built-ins/Math/LN10/S15.8.1.2_A3.js | 13 ++++-- test/built-ins/Math/LN10/S15.8.1.2_A4.js | 4 +- test/built-ins/Math/LN2/S15.8.1.3_A3.js | 11 ++++- test/built-ins/Math/LN2/S15.8.1.3_A4.js | 4 +- test/built-ins/Math/LOG10E/S15.8.1.5_A3.js | 11 ++++- test/built-ins/Math/LOG10E/S15.8.1.5_A4.js | 4 +- test/built-ins/Math/LOG2E/S15.8.1.4_A3.js | 11 ++++- test/built-ins/Math/LOG2E/S15.8.1.4_A4.js | 4 +- test/built-ins/Math/PI/S15.8.1.6_A3.js | 11 ++++- test/built-ins/Math/PI/S15.8.1.6_A4.js | 4 +- test/built-ins/Math/SQRT1_2/S15.8.1.7_A3.js | 13 ++++-- test/built-ins/Math/SQRT1_2/S15.8.1.7_A4.js | 4 +- test/built-ins/Math/SQRT2/S15.8.1.8_A3.js | 11 ++++- test/built-ins/Math/SQRT2/S15.8.1.8_A4.js | 4 +- test/built-ins/NaN/S15.1.1.1_A2_T1.js | 15 +++++++ test/built-ins/NaN/S15.1.1.1_A2_T2.js | 15 +++++++ test/built-ins/NaN/S15.1.1.1_A3_T1.js | 21 +++++++++ .../{S15.1.1.1_A3.1.js => S15.1.1.1_A3_T2.js} | 4 +- .../{S15.1.1.1_A3.2.js => S15.1.1.1_A4.js} | 2 +- .../Number/MAX_VALUE/S15.7.3.2_A2.js | 4 +- .../Number/MAX_VALUE/S15.7.3.2_A3.js | 13 ++++-- .../Number/MIN_VALUE/S15.7.3.3_A2.js | 4 +- .../Number/MIN_VALUE/S15.7.3.3_A3.js | 13 ++++-- .../Number/NEGATIVE_INFINITY/S15.7.3.5_A2.js | 4 +- .../Number/NEGATIVE_INFINITY/S15.7.3.5_A3.js | 13 ++++-- test/built-ins/Number/NaN/S15.7.3.4_A2.js | 4 +- test/built-ins/Number/NaN/S15.7.3.4_A3.js | 13 ++++-- .../Number/POSITIVE_INFINITY/S15.7.3.6_A2.js | 4 +- .../Number/POSITIVE_INFINITY/S15.7.3.6_A3.js | 13 ++++-- .../Number/prototype/S15.7.3.1_A1_T1.js | 4 +- .../Number/prototype/S15.7.3.1_A1_T2.js | 14 ++++-- ...ymbol-data-property-configurable-strict.js | 43 ------------------- ...s => symbol-data-property-configurable.js} | 1 - .../symbol-data-property-writable-strict.js | 39 ----------------- ...ct.js => symbol-data-property-writable.js} | 1 - .../Object/prototype/S15.2.3.1_A1.js | 6 +-- .../Object/prototype/S15.2.3.1_A3.js | 14 +++++- .../prototype/hasOwnProperty/S15.2.4.5_A10.js | 5 +-- .../prototype/isPrototypeOf/S15.2.4.6_A10.js | 5 +-- .../propertyIsEnumerable/S15.2.4.7_A10.js | 5 +-- .../prototype/toLocaleString/S15.2.4.3_A10.js | 5 +-- .../prototype/toString/S15.2.4.2_A10.js | 5 +-- .../Object/prototype/valueOf/S15.2.4.4_A10.js | 5 +-- .../RegExp/prototype/S15.10.5.1_A3.js | 14 ++++-- .../RegExp/prototype/S15.10.5.1_A4.js | 7 ++- .../RegExp/prototype/exec/S15.10.6.2_A10.js | 7 ++- .../RegExp/prototype/global/S15.10.7.2_A10.js | 11 +++-- .../prototype/ignoreCase/S15.10.7.3_A10.js | 11 +++-- .../prototype/lastIndex/S15.10.7.5_A9.js | 16 ++++--- .../prototype/multiline/S15.10.7.4_A10.js | 11 +++-- .../RegExp/prototype/source/S15.10.7.1_A10.js | 11 +++-- .../RegExp/prototype/test/S15.10.6.3_A10.js | 7 ++- .../prototype/toString/S15.10.6.4_A10.js | 7 ++- test/built-ins/String/S15.5.5.1_A3.js | 13 ++++-- .../{S15.5.5.1_A4.js => S15.5.5.1_A4_T1.js} | 12 +++--- test/built-ins/String/S15.5.5.1_A4_T2.js | 37 ++++++++++++++++ .../String/prototype/S15.5.3.1_A3.js | 22 +++++++--- .../String/prototype/S15.5.3.1_A4.js | 5 +-- .../String/prototype/charAt/S15.5.4.4_A10.js | 4 +- .../prototype/charCodeAt/S15.5.4.5_A10.js | 4 +- .../String/prototype/concat/S15.5.4.6_A10.js | 4 +- .../String/prototype/indexOf/S15.5.4.7_A10.js | 5 +-- .../prototype/lastIndexOf/S15.5.4.8_A10.js | 5 +-- .../prototype/localeCompare/S15.5.4.9_A10.js | 4 +- .../String/prototype/match/S15.5.4.10_A10.js | 5 +-- .../prototype/replace/S15.5.4.11_A10.js | 5 +-- .../String/prototype/search/S15.5.4.12_A10.js | 5 +-- .../String/prototype/slice/S15.5.4.13_A10.js | 5 +-- .../String/prototype/split/S15.5.4.14_A10.js | 5 +-- .../prototype/substring/S15.5.4.15_A10.js | 5 +-- .../toLocaleLowerCase/S15.5.4.17_A10.js | 7 ++- .../toLocaleUpperCase/S15.5.4.19_A10.js | 5 +-- .../prototype/toLowerCase/S15.5.4.16_A10.js | 5 +-- .../prototype/toUpperCase/S15.5.4.18_A10.js | 5 +-- test/built-ins/decodeURI/S15.1.3.1_A5.3.js | 4 +- .../decodeURIComponent/S15.1.3.2_A5.3.js | 6 +-- test/built-ins/encodeURI/S15.1.3.3_A5.3.js | 6 +-- .../encodeURIComponent/S15.1.3.4_A5.3.js | 6 +-- test/built-ins/eval/S15.1.2.1_A4.3.js | 4 +- test/built-ins/isFinite/S15.1.2.5_A2.3.js | 6 +-- test/built-ins/isNaN/S15.1.2.4_A2.3.js | 6 +-- test/built-ins/parseFloat/S15.1.2.3_A7.3.js | 4 +- test/built-ins/parseInt/S15.1.2.2_A9.3.js | 6 +-- test/built-ins/undefined/15.1.1.3-2.js | 24 +++-------- test/built-ins/undefined/S15.1.1.3_A3_T1.js | 21 +++++++++ .../{S15.1.1.3_A3.1.js => S15.1.1.3_A3_T2.js} | 2 +- .../{S15.1.1.3_A3.2.js => S15.1.1.3_A4.js} | 2 +- 180 files changed, 788 insertions(+), 596 deletions(-) create mode 100755 test/built-ins/Infinity/S15.1.1.2_A2_T1.js create mode 100644 test/built-ins/Infinity/S15.1.1.2_A3_T1.js rename test/built-ins/Infinity/{S15.1.1.2_A3.1.js => S15.1.1.2_A3_T2.js} (91%) mode change 100644 => 100755 rename test/built-ins/Infinity/{S15.1.1.2_A3.2.js => S15.1.1.2_A4.js} (91%) create mode 100755 test/built-ins/NaN/S15.1.1.1_A2_T1.js create mode 100755 test/built-ins/NaN/S15.1.1.1_A2_T2.js create mode 100644 test/built-ins/NaN/S15.1.1.1_A3_T1.js rename test/built-ins/NaN/{S15.1.1.1_A3.1.js => S15.1.1.1_A3_T2.js} (75%) mode change 100644 => 100755 rename test/built-ins/NaN/{S15.1.1.1_A3.2.js => S15.1.1.1_A4.js} (97%) delete mode 100644 test/built-ins/Object/defineProperty/symbol-data-property-configurable-strict.js rename test/built-ins/Object/defineProperty/{symbol-data-property-configurable-non-strict.js => symbol-data-property-configurable.js} (98%) delete mode 100644 test/built-ins/Object/defineProperty/symbol-data-property-writable-strict.js rename test/built-ins/Object/defineProperty/{symbol-data-property-writable-non-strict.js => symbol-data-property-writable.js} (98%) rename test/built-ins/String/{S15.5.5.1_A4.js => S15.5.5.1_A4_T1.js} (94%) create mode 100644 test/built-ins/String/S15.5.5.1_A4_T2.js create mode 100644 test/built-ins/undefined/S15.1.1.3_A3_T1.js rename test/built-ins/undefined/{S15.1.1.3_A3.1.js => S15.1.1.3_A3_T2.js} (96%) rename test/built-ins/undefined/{S15.1.1.3_A3.2.js => S15.1.1.3_A4.js} (98%) diff --git a/harness/propertyHelper.js b/harness/propertyHelper.js index c5b5e0f7c1..e2627877e4 100644 --- a/harness/propertyHelper.js +++ b/harness/propertyHelper.js @@ -41,8 +41,7 @@ function isWritable(obj, name, verifyProp, value) { } } - writeSucceeded = (verifyProp && isEqualTo(obj, verifyProp, newValue)) || - isEqualTo(obj, name, newValue); + writeSucceeded = isEqualTo(obj, verifyProp || name, newValue); // Revert the change only if it was successful (in other cases, reverting // is unnecessary and may trigger exceptions for certain property diff --git a/test/built-ins/Array/S15.4.3_A2.3.js b/test/built-ins/Array/S15.4.3_A2.3.js index fbd42918c0..5e00bf2603 100644 --- a/test/built-ins/Array/S15.4.3_A2.3.js +++ b/test/built-ins/Array/S15.4.3_A2.3.js @@ -5,12 +5,12 @@ info: The length property of Array has the attribute ReadOnly es5id: 15.4.3_A2.3 description: Checking if varying the length property fails -flags: [noStrict] +includes: [propertyHelper.js] ---*/ //CHECK#1 var x = Array.length; -Array.length = Infinity; +verifyNotWritable(Array, "length", null, Infinity); if (Array.length !== x) { $ERROR('#1: x = Array.length; Array.length = Infinity; Array.length === x. Actual: ' + (Array.length)); } diff --git a/test/built-ins/Array/prototype/S15.4.3.1_A3.js b/test/built-ins/Array/prototype/S15.4.3.1_A3.js index 5b432b4abe..420e31492e 100644 --- a/test/built-ins/Array/prototype/S15.4.3.1_A3.js +++ b/test/built-ins/Array/prototype/S15.4.3.1_A3.js @@ -5,8 +5,7 @@ info: The Array.prototype property has the attribute DontDelete es5id: 15.4.3.1_A3 description: Checking if deleting the Array.prototype property fails -flags: [noStrict] -includes: [$FAIL.js] +includes: [$FAIL.js, propertyHelper.js] ---*/ //CHECK#1 @@ -14,14 +13,24 @@ if (Array.hasOwnProperty('prototype') !== true) { $FAIL('#1: Array.hasOwnProperty(\'prototype\') === true. Actual: ' + (Array.hasOwnProperty('prototype'))); } -delete Array.prototype; +verifyNotConfigurable(Array, "prototype"); //CHECK#2 -if (Array.hasOwnProperty('prototype') !== true) { - $ERROR('#2: delete Array.prototype; Array.hasOwnProperty(\'prototype\') === true. Actual: ' + (Array.hasOwnProperty('prototype'))); +try { + if((delete Array.prototype) !== false){ + $ERROR('#2: Array.prototype has the attribute DontDelete'); + } +} catch (e) { + if (e instanceof Test262Error) throw e; + assert(e instanceof TypeError); } //CHECK#3 -if (Array.prototype === undefined) { - $ERROR('#3: delete Array.prototype; Array.prototype !== undefined'); +if (Array.hasOwnProperty('prototype') !== true) { + $ERROR('#3: delete Array.prototype; Array.hasOwnProperty(\'prototype\') === true. Actual: ' + (Array.hasOwnProperty('prototype'))); +} + +//CHECK#4 +if (Array.prototype === undefined) { + $ERROR('#4: delete Array.prototype; Array.prototype !== undefined'); } diff --git a/test/built-ins/Array/prototype/S15.4.3.1_A4.js b/test/built-ins/Array/prototype/S15.4.3.1_A4.js index f077df9d6c..fd62eaff40 100644 --- a/test/built-ins/Array/prototype/S15.4.3.1_A4.js +++ b/test/built-ins/Array/prototype/S15.4.3.1_A4.js @@ -5,12 +5,12 @@ info: The Array.prototype property has the attribute ReadOnly es5id: 15.4.3.1_A4 description: Checking if varying the Array.prototype property fails -flags: [noStrict] +includes: [propertyHelper.js] ---*/ //CHECK#1 var x = Array.prototype; -Array.prototype = 1; +verifyNotWritable(Array, "prototype", null, 1); if (Array.prototype !== x) { $ERROR('#1: x = Array.prototype; Array.prototype = 1; Array.prototype === x. Actual: ' + (Array.prototype)); } diff --git a/test/built-ins/Array/prototype/concat/S15.4.4.4_A4.2.js b/test/built-ins/Array/prototype/concat/S15.4.4.4_A4.2.js index ed25769227..caf9da58f1 100644 --- a/test/built-ins/Array/prototype/concat/S15.4.4.4_A4.2.js +++ b/test/built-ins/Array/prototype/concat/S15.4.4.4_A4.2.js @@ -5,7 +5,6 @@ info: The length property of concat does not have the attribute DontDelete es5id: 15.4.4.4_A4.2 description: Checking use hasOwnProperty, delete -flags: [noStrict] includes: [$FAIL.js] ---*/ diff --git a/test/built-ins/Array/prototype/concat/S15.4.4.4_A4.3.js b/test/built-ins/Array/prototype/concat/S15.4.4.4_A4.3.js index cdf728da1c..206c47194e 100644 --- a/test/built-ins/Array/prototype/concat/S15.4.4.4_A4.3.js +++ b/test/built-ins/Array/prototype/concat/S15.4.4.4_A4.3.js @@ -5,12 +5,12 @@ info: The length property of concat has the attribute ReadOnly es5id: 15.4.4.4_A4.3 description: Checking if varying the length property fails -flags: [noStrict] +includes: [propertyHelper.js] ---*/ //CHECK#1 var x = Array.prototype.concat.length; -Array.prototype.concat.length = Infinity; +verifyNotWritable(Array.prototype.concat, "length", null, Infinity); if (Array.prototype.concat.length !== x) { $ERROR('#1: x = Array.prototype.concat.length; Array.prototype.concat.length = Infinity; Array.prototype.concat.length === x. Actual: ' + (Array.prototype.concat.length)); } diff --git a/test/built-ins/Array/prototype/join/S15.4.4.5_A6.2.js b/test/built-ins/Array/prototype/join/S15.4.4.5_A6.2.js index 3b80f2ce1c..8cc60f7f74 100644 --- a/test/built-ins/Array/prototype/join/S15.4.4.5_A6.2.js +++ b/test/built-ins/Array/prototype/join/S15.4.4.5_A6.2.js @@ -5,7 +5,6 @@ info: The length property of join does not have the attribute DontDelete es5id: 15.4.4.5_A6.2 description: Checking use hasOwnProperty, delete -flags: [noStrict] includes: [$FAIL.js] ---*/ diff --git a/test/built-ins/Array/prototype/join/S15.4.4.5_A6.3.js b/test/built-ins/Array/prototype/join/S15.4.4.5_A6.3.js index 5f520eddab..0a0391e6a4 100644 --- a/test/built-ins/Array/prototype/join/S15.4.4.5_A6.3.js +++ b/test/built-ins/Array/prototype/join/S15.4.4.5_A6.3.js @@ -5,12 +5,12 @@ info: The length property of join has the attribute ReadOnly es5id: 15.4.4.5_A6.3 description: Checking if varying the length property fails -flags: [noStrict] +includes: [propertyHelper.js] ---*/ //CHECK#1 var x = Array.prototype.join.length; -Array.prototype.join.length = Infinity; +verifyNotWritable(Array.prototype.join, "length", null, Infinity); if (Array.prototype.join.length !== x) { $ERROR('#1: x = Array.prototype.join.length; Array.prototype.join.length = Infinity; Array.prototype.join.length === x. Actual: ' + (Array.prototype.join.length)); } diff --git a/test/built-ins/Array/prototype/pop/S15.4.4.6_A5.2.js b/test/built-ins/Array/prototype/pop/S15.4.4.6_A5.2.js index f1167771b8..21c1374617 100644 --- a/test/built-ins/Array/prototype/pop/S15.4.4.6_A5.2.js +++ b/test/built-ins/Array/prototype/pop/S15.4.4.6_A5.2.js @@ -5,7 +5,6 @@ info: The length property of pop does not have the attribute DontDelete es5id: 15.4.4.6_A5.2 description: Checking use hasOwnProperty, delete -flags: [noStrict] includes: [$FAIL.js] ---*/ diff --git a/test/built-ins/Array/prototype/pop/S15.4.4.6_A5.3.js b/test/built-ins/Array/prototype/pop/S15.4.4.6_A5.3.js index 19bce0d7ac..bec89ff414 100644 --- a/test/built-ins/Array/prototype/pop/S15.4.4.6_A5.3.js +++ b/test/built-ins/Array/prototype/pop/S15.4.4.6_A5.3.js @@ -5,12 +5,12 @@ info: The length property of pop has the attribute ReadOnly es5id: 15.4.4.6_A5.3 description: Checking if varying the length property fails -flags: [noStrict] +includes: [propertyHelper.js] ---*/ //CHECK#1 var x = Array.prototype.pop.length; -Array.prototype.pop.length = Infinity; +verifyNotWritable(Array.prototype.pop, "length", null, Infinity); if (Array.prototype.pop.length !== x) { $ERROR('#1: x = Array.prototype.pop.length; Array.prototype.pop.length = Infinity; Array.prototype.pop.length === x. Actual: ' + (Array.prototype.pop.length)); } diff --git a/test/built-ins/Array/prototype/push/S15.4.4.7_A6.2.js b/test/built-ins/Array/prototype/push/S15.4.4.7_A6.2.js index 15ab62b680..4084d34a0e 100644 --- a/test/built-ins/Array/prototype/push/S15.4.4.7_A6.2.js +++ b/test/built-ins/Array/prototype/push/S15.4.4.7_A6.2.js @@ -5,7 +5,6 @@ info: The length property of push does not have the attribute DontDelete es5id: 15.4.4.7_A6.2 description: Checking use hasOwnProperty, delete -flags: [noStrict] includes: [$FAIL.js] ---*/ diff --git a/test/built-ins/Array/prototype/push/S15.4.4.7_A6.3.js b/test/built-ins/Array/prototype/push/S15.4.4.7_A6.3.js index ca2f603978..6b1dcf8e04 100644 --- a/test/built-ins/Array/prototype/push/S15.4.4.7_A6.3.js +++ b/test/built-ins/Array/prototype/push/S15.4.4.7_A6.3.js @@ -5,12 +5,12 @@ info: The length property of push has the attribute ReadOnly es5id: 15.4.4.7_A6.3 description: Checking if varying the length property fails -flags: [noStrict] +includes: [propertyHelper.js] ---*/ //CHECK#1 var x = Array.prototype.push.length; -Array.prototype.push.length = Infinity; +verifyNotWritable(Array.prototype.push, "length", null, Infinity); if (Array.prototype.push.length !== x) { $ERROR('#1: x = Array.prototype.push.length; Array.prototype.push.length = Infinity; Array.prototype.push.length === x. Actual: ' + (Array.prototype.push.length)); } diff --git a/test/built-ins/Array/prototype/reverse/S15.4.4.8_A5.2.js b/test/built-ins/Array/prototype/reverse/S15.4.4.8_A5.2.js index 0c4365d795..a80c86a565 100644 --- a/test/built-ins/Array/prototype/reverse/S15.4.4.8_A5.2.js +++ b/test/built-ins/Array/prototype/reverse/S15.4.4.8_A5.2.js @@ -5,7 +5,6 @@ info: The length property of reverse does not have the attribute DontDelete es5id: 15.4.4.8_A5.2 description: Checking use hasOwnProperty, delete -flags: [noStrict] includes: [$FAIL.js] ---*/ diff --git a/test/built-ins/Array/prototype/reverse/S15.4.4.8_A5.3.js b/test/built-ins/Array/prototype/reverse/S15.4.4.8_A5.3.js index 65b5bf2fe7..d18c4bad86 100644 --- a/test/built-ins/Array/prototype/reverse/S15.4.4.8_A5.3.js +++ b/test/built-ins/Array/prototype/reverse/S15.4.4.8_A5.3.js @@ -5,12 +5,12 @@ info: The length property of reverse has the attribute ReadOnly es5id: 15.4.4.8_A5.3 description: Checking if varying the length property fails -flags: [noStrict] +includes: [propertyHelper.js] ---*/ //CHECK#1 var x = Array.prototype.reverse.length; -Array.prototype.reverse.length = Infinity; +verifyNotWritable(Array.prototype.reverse, "length", null, Infinity); if (Array.prototype.reverse.length !== x) { $ERROR('#1: x = Array.prototype.reverse.length; Array.prototype.reverse.length = Infinity; Array.prototype.reverse.length === x. Actual: ' + (Array.prototype.reverse.length)); } diff --git a/test/built-ins/Array/prototype/shift/S15.4.4.9_A5.3.js b/test/built-ins/Array/prototype/shift/S15.4.4.9_A5.3.js index a126e00969..a3c2ea971d 100644 --- a/test/built-ins/Array/prototype/shift/S15.4.4.9_A5.3.js +++ b/test/built-ins/Array/prototype/shift/S15.4.4.9_A5.3.js @@ -5,12 +5,12 @@ info: The length property of shift has the attribute ReadOnly es5id: 15.4.4.9_A5.3 description: Checking if varying the length property fails -flags: [noStrict] +includes: [propertyHelper.js] ---*/ //CHECK#1 var x = Array.prototype.shift.length; -Array.prototype.shift.length = Infinity; +verifyNotWritable(Array.prototype.shift, "length", null, Infinity); if (Array.prototype.shift.length !== x) { $ERROR('#1: x = Array.prototype.shift.length; Array.prototype.shift.length = Infinity; Array.prototype.shift.length === x. Actual: ' + (Array.prototype.shift.length)); } diff --git a/test/built-ins/Array/prototype/slice/S15.4.4.10_A5.3.js b/test/built-ins/Array/prototype/slice/S15.4.4.10_A5.3.js index b2f7114179..f50e5af1eb 100644 --- a/test/built-ins/Array/prototype/slice/S15.4.4.10_A5.3.js +++ b/test/built-ins/Array/prototype/slice/S15.4.4.10_A5.3.js @@ -5,12 +5,12 @@ info: The length property of slice has the attribute ReadOnly es5id: 15.4.4.10_A5.3 description: Checking if varying the length property fails -flags: [noStrict] +includes: [propertyHelper.js] ---*/ //CHECK#1 var x = Array.prototype.slice.length; -Array.prototype.slice.length = Infinity; +verifyNotWritable(Array.prototype.slice, "length", null, Infinity); if (Array.prototype.slice.length !== x) { $ERROR('#1: x = Array.prototype.slice.length; Array.prototype.slice.length = Infinity; Array.prototypeslice.length === x. Actual: ' + (Array.prototypeslice.length)); } diff --git a/test/built-ins/Array/prototype/sort/S15.4.4.11_A7.2.js b/test/built-ins/Array/prototype/sort/S15.4.4.11_A7.2.js index 101ee5365a..bd006de0cc 100644 --- a/test/built-ins/Array/prototype/sort/S15.4.4.11_A7.2.js +++ b/test/built-ins/Array/prototype/sort/S15.4.4.11_A7.2.js @@ -5,7 +5,6 @@ info: The length property of sort does not have the attribute DontDelete es5id: 15.4.4.11_A7.2 description: Checking use hasOwnProperty, delete -flags: [noStrict] includes: [$FAIL.js] ---*/ diff --git a/test/built-ins/Array/prototype/sort/S15.4.4.11_A7.3.js b/test/built-ins/Array/prototype/sort/S15.4.4.11_A7.3.js index cf12ce9f0f..a8497cb9a9 100644 --- a/test/built-ins/Array/prototype/sort/S15.4.4.11_A7.3.js +++ b/test/built-ins/Array/prototype/sort/S15.4.4.11_A7.3.js @@ -5,12 +5,12 @@ info: The length property of sort has the attribute ReadOnly es5id: 15.4.4.11_A7.3 description: Checking if varying the length fails -flags: [noStrict] +includes: [propertyHelper.js] ---*/ //CHECK#1 var x = Array.prototype.sort.length; -Array.prototype.sort.length = Infinity; +verifyNotWritable(Array.prototype.sort, "length", null, Infinity); if (Array.prototype.sort.length !== x) { $ERROR('#1: x = Array.prototype.sort.length; Array.prototype.sort.length = Infinity; Array.prototype.sort.length === x. Actual: ' + (Array.prototype.sort.length)); } diff --git a/test/built-ins/Array/prototype/splice/S15.4.4.12_A5.2.js b/test/built-ins/Array/prototype/splice/S15.4.4.12_A5.2.js index 20ec46bf89..2fae02e140 100644 --- a/test/built-ins/Array/prototype/splice/S15.4.4.12_A5.2.js +++ b/test/built-ins/Array/prototype/splice/S15.4.4.12_A5.2.js @@ -5,7 +5,6 @@ info: The length property of splice does not have the attribute DontDelete es5id: 15.4.4.12_A5.2 description: Checking use hasOwnProperty, delete -flags: [noStrict] includes: [$FAIL.js] ---*/ diff --git a/test/built-ins/Array/prototype/splice/S15.4.4.12_A5.3.js b/test/built-ins/Array/prototype/splice/S15.4.4.12_A5.3.js index 75f002ea06..8d250f3411 100644 --- a/test/built-ins/Array/prototype/splice/S15.4.4.12_A5.3.js +++ b/test/built-ins/Array/prototype/splice/S15.4.4.12_A5.3.js @@ -5,12 +5,12 @@ info: The length property of splice has the attribute ReadOnly es5id: 15.4.4.12_A5.3 description: Checking if varying the length property fails -flags: [noStrict] +includes: [propertyHelper.js] ---*/ //CHECK#1 var x = Array.prototype.splice.length; -Array.prototype.splice.length = Infinity; +verifyNotWritable(Array.prototype.splice, "length", null, Infinity); if (Array.prototype.splice.length !== x) { $ERROR('#1: x = Array.prototype.splice.length; Array.prototype.splice.length = Infinity; Array.prototype.splice.length === x. Actual: ' + (Array.prototype.splice.length)); } diff --git a/test/built-ins/Array/prototype/toLocaleString/S15.4.4.3_A4.3.js b/test/built-ins/Array/prototype/toLocaleString/S15.4.4.3_A4.3.js index b860c9bba3..e96f635af4 100644 --- a/test/built-ins/Array/prototype/toLocaleString/S15.4.4.3_A4.3.js +++ b/test/built-ins/Array/prototype/toLocaleString/S15.4.4.3_A4.3.js @@ -5,12 +5,12 @@ info: The length property of toLocaleString has the attribute ReadOnly es5id: 15.4.4.3_A4.3 description: Checking if varying the length property fails -flags: [noStrict] +includes: [propertyHelper.js] ---*/ //CHECK#1 var x = Array.prototype.toLocaleString.length; -Array.prototype.toLocaleString.length = Infinity; +verifyNotWritable(Array.prototype.toLocaleString, "length", null, Infinity); if (Array.prototype.toLocaleString.length !== x) { $ERROR('#1: x = Array.prototype.toLocaleString.length; Array.prototype.toLocaleString.length = Infinity; Array.prototype.toLocaleString.length === x. Actual: ' + (Array.prototype.toLocaleString.length)); } diff --git a/test/built-ins/Array/prototype/toString/S15.4.4.2_A4.2.js b/test/built-ins/Array/prototype/toString/S15.4.4.2_A4.2.js index 63e9b9cf17..f86a7757ff 100644 --- a/test/built-ins/Array/prototype/toString/S15.4.4.2_A4.2.js +++ b/test/built-ins/Array/prototype/toString/S15.4.4.2_A4.2.js @@ -5,7 +5,6 @@ info: The length property of toString does not have the attribute DontDelete es5id: 15.4.4.2_A4.2 description: Checking use hasOwnProperty, delete -flags: [noStrict] includes: [$FAIL.js] ---*/ diff --git a/test/built-ins/Array/prototype/toString/S15.4.4.2_A4.3.js b/test/built-ins/Array/prototype/toString/S15.4.4.2_A4.3.js index f6211ddb8f..b6b88a74f1 100644 --- a/test/built-ins/Array/prototype/toString/S15.4.4.2_A4.3.js +++ b/test/built-ins/Array/prototype/toString/S15.4.4.2_A4.3.js @@ -5,12 +5,12 @@ info: The length property of toString has the attribute ReadOnly es5id: 15.4.4.2_A4.3 description: Checking if varying the length property fails -flags: [noStrict] +includes: [propertyHelper.js] ---*/ //CHECK#1 var x = Array.prototype.toString.length; -Array.prototype.toString.length = Infinity; +verifyNotWritable(Array.prototype.toString, "length", null, Infinity); if (Array.prototype.toString.length !== x) { $ERROR('#1: x = Array.prototype.toString.length; Array.prototype.toString.length = Infinity; Array.prototype.toString.length === x. Actual: ' + (Array.prototype.toString.length)); } diff --git a/test/built-ins/Array/prototype/unshift/S15.4.4.13_A5.2.js b/test/built-ins/Array/prototype/unshift/S15.4.4.13_A5.2.js index 5dc23d845e..9d4ed0c948 100644 --- a/test/built-ins/Array/prototype/unshift/S15.4.4.13_A5.2.js +++ b/test/built-ins/Array/prototype/unshift/S15.4.4.13_A5.2.js @@ -5,7 +5,6 @@ info: The length property of unshift does not have the attribute DontDelete es5id: 15.4.4.13_A5.2 description: Checking use hasOwnProperty, delete -flags: [noStrict] includes: [$FAIL.js] ---*/ diff --git a/test/built-ins/Array/prototype/unshift/S15.4.4.13_A5.3.js b/test/built-ins/Array/prototype/unshift/S15.4.4.13_A5.3.js index dcc17cc0ba..cc94d11e9e 100644 --- a/test/built-ins/Array/prototype/unshift/S15.4.4.13_A5.3.js +++ b/test/built-ins/Array/prototype/unshift/S15.4.4.13_A5.3.js @@ -5,12 +5,12 @@ info: The length property of unshift has the attribute ReadOnly es5id: 15.4.4.13_A5.3 description: Checking if varying the length property fails -flags: [noStrict] +includes: [propertyHelper.js] ---*/ //CHECK#1 var x = Array.prototype.unshift.length; -Array.prototype.unshift.length = Infinity; +verifyNotWritable(Array.prototype.unshift, "length", null, Infinity); if (Array.prototype.unshift.length !== x) { $ERROR('#1: x = Array.prototype.unshift.length; Array.prototype.unshift.length = Infinity; Array.prototype.unshift.length === x. Actual: ' + (Array.prototype.unshift.length)); } diff --git a/test/built-ins/Boolean/prototype/S15.6.3.1_A2.js b/test/built-ins/Boolean/prototype/S15.6.3.1_A2.js index c834d39fd2..fa6539868a 100644 --- a/test/built-ins/Boolean/prototype/S15.6.3.1_A2.js +++ b/test/built-ins/Boolean/prototype/S15.6.3.1_A2.js @@ -5,12 +5,12 @@ info: Boolean.prototype has the attribute ReadOnly es5id: 15.6.3.1_A2 description: Checking if varying the Boolean.prototype property fails -flags: [noStrict] +includes: [propertyHelper.js] ---*/ // CHECK#1 -x = Boolean.prototype; -Boolean.prototype = 1; +var x = Boolean.prototype; +verifyNotWritable(Boolean, "prototype", null, 1); if (Boolean.prototype !== x) { $ERROR('#1: Boolean.prototype has the attribute ReadOnly'); } diff --git a/test/built-ins/Boolean/prototype/S15.6.3.1_A3.js b/test/built-ins/Boolean/prototype/S15.6.3.1_A3.js index 3decf9d447..f4b5a8c723 100644 --- a/test/built-ins/Boolean/prototype/S15.6.3.1_A3.js +++ b/test/built-ins/Boolean/prototype/S15.6.3.1_A3.js @@ -5,10 +5,17 @@ info: Boolean.prototype has the attribute DontDelete es5id: 15.6.3.1_A3 description: Checking if deleting the Boolean.prototype property fails -flags: [noStrict] +includes: [propertyHelper.js] ---*/ // CHECK#1 -if (delete Boolean.prototype !== false) { - $ERROR('#1: Boolean.prototype has the attribute DontDelete'); +verifyNotConfigurable(Boolean, "prototype"); + +try { + if (delete Boolean.prototype !== false) { + $ERROR('#1: Boolean.prototype has the attribute DontDelete'); + } +} catch (e) { + if (e instanceof Test262Error) throw e; + assert(e instanceof TypeError); } diff --git a/test/built-ins/Date/UTC/S15.9.4.3_A3_T1.js b/test/built-ins/Date/UTC/S15.9.4.3_A3_T1.js index d21ad9dfc9..c7b2dca717 100644 --- a/test/built-ins/Date/UTC/S15.9.4.3_A3_T1.js +++ b/test/built-ins/Date/UTC/S15.9.4.3_A3_T1.js @@ -7,11 +7,11 @@ info: > attributes es5id: 15.9.4.3_A3_T1 description: Checking ReadOnly attribute -flags: [noStrict] +includes: [propertyHelper.js] ---*/ -x = Date.UTC.length; -Date.UTC.length = 1; +var x = Date.UTC.length; +verifyNotWritable(Date.UTC, "length", null, 1); if (Date.UTC.length !== x) { $ERROR('#1: The Date.UTC.length has the attribute ReadOnly'); } diff --git a/test/built-ins/Date/parse/S15.9.4.2_A3_T1.js b/test/built-ins/Date/parse/S15.9.4.2_A3_T1.js index 920571356c..3ad63c9aed 100644 --- a/test/built-ins/Date/parse/S15.9.4.2_A3_T1.js +++ b/test/built-ins/Date/parse/S15.9.4.2_A3_T1.js @@ -7,11 +7,11 @@ info: > attributes es5id: 15.9.4.2_A3_T1 description: Checking ReadOnly attribute -flags: [noStrict] +includes: [propertyHelper.js] ---*/ -x = Date.parse.length; -Date.parse.length = 1; +var x = Date.parse.length; +verifyNotWritable(Date.parse, "length", null, 1); if (Date.parse.length !== x) { $ERROR('#1: The Date.parse.length has the attribute ReadOnly'); } diff --git a/test/built-ins/Date/prototype/S15.9.4.1_A1_T1.js b/test/built-ins/Date/prototype/S15.9.4.1_A1_T1.js index 1113f1cdb0..3815abe0e1 100644 --- a/test/built-ins/Date/prototype/S15.9.4.1_A1_T1.js +++ b/test/built-ins/Date/prototype/S15.9.4.1_A1_T1.js @@ -7,11 +7,11 @@ info: > attributes es5id: 15.9.4.1_A1_T1 description: Checking ReadOnly attribute -flags: [noStrict] +includes: [propertyHelper.js] ---*/ -x = Date.prototype; -Date.prototype = 1; +var x = Date.prototype; +verifyNotWritable(Date, "prototype", null, 1); if (Date.prototype !== x) { $ERROR('#1: The Date.prototype has the attribute ReadOnly'); } diff --git a/test/built-ins/Date/prototype/S15.9.4.1_A1_T2.js b/test/built-ins/Date/prototype/S15.9.4.1_A1_T2.js index 66cffbf49c..bcca9c2ca7 100644 --- a/test/built-ins/Date/prototype/S15.9.4.1_A1_T2.js +++ b/test/built-ins/Date/prototype/S15.9.4.1_A1_T2.js @@ -7,12 +7,18 @@ info: > attributes es5id: 15.9.4.1_A1_T2 description: Checking DontDelete attribute -flags: [noStrict] -includes: [$FAIL.js] +includes: [propertyHelper.js] ---*/ -if (delete Date.prototype !== false) { - $ERROR('#1: The Date.prototype property has the attributes DontDelete'); +verifyNotConfigurable(Date, "prototype"); + +try { + if (delete Date.prototype !== false) { + $ERROR('#1: The Date.prototype property has the attributes DontDelete'); + } +} catch (e) { + if (e instanceof Test262Error) throw e; + assert(e instanceof TypeError); } if (!Date.hasOwnProperty('prototype')) { diff --git a/test/built-ins/Date/prototype/constructor/S15.9.5.1_A3_T1.js b/test/built-ins/Date/prototype/constructor/S15.9.5.1_A3_T1.js index 88e191f80b..015d2b1ce9 100644 --- a/test/built-ins/Date/prototype/constructor/S15.9.5.1_A3_T1.js +++ b/test/built-ins/Date/prototype/constructor/S15.9.5.1_A3_T1.js @@ -7,11 +7,11 @@ info: > DontDelete, DontEnum } attributes es5id: 15.9.5.1_A3_T1 description: Checking ReadOnly attribute -flags: [noStrict] +includes: [propertyHelper.js] ---*/ -x = Date.prototype.constructor.length; -Date.prototype.constructor.length = 1; +var x = Date.prototype.constructor.length; +verifyNotWritable(Date.prototype.constructor, "length", null, 1); if (Date.prototype.constructor.length !== x) { $ERROR('#1: The Date.prototype.constructor.length has the attribute ReadOnly'); } diff --git a/test/built-ins/Date/prototype/getDate/S15.9.5.14_A3_T1.js b/test/built-ins/Date/prototype/getDate/S15.9.5.14_A3_T1.js index 039948888a..31f0cbb470 100644 --- a/test/built-ins/Date/prototype/getDate/S15.9.5.14_A3_T1.js +++ b/test/built-ins/Date/prototype/getDate/S15.9.5.14_A3_T1.js @@ -7,11 +7,11 @@ info: > DontEnum } attributes es5id: 15.9.5.14_A3_T1 description: Checking ReadOnly attribute -flags: [noStrict] +includes: [propertyHelper.js] ---*/ -x = Date.prototype.getDate.length; -Date.prototype.getDate.length = 1; +var x = Date.prototype.getDate.length; +verifyNotWritable(Date.prototype.getDate, "length", null, 1); if (Date.prototype.getDate.length !== x) { $ERROR('#1: The Date.prototype.getDate.length has the attribute ReadOnly'); } diff --git a/test/built-ins/Date/prototype/getDay/S15.9.5.16_A3_T1.js b/test/built-ins/Date/prototype/getDay/S15.9.5.16_A3_T1.js index 767579e4a3..ce1d0b17b0 100644 --- a/test/built-ins/Date/prototype/getDay/S15.9.5.16_A3_T1.js +++ b/test/built-ins/Date/prototype/getDay/S15.9.5.16_A3_T1.js @@ -7,11 +7,11 @@ info: > DontEnum } attributes es5id: 15.9.5.16_A3_T1 description: Checking ReadOnly attribute -flags: [noStrict] +includes: [propertyHelper.js] ---*/ -x = Date.prototype.getDay.length; -Date.prototype.getDay.length = 1; +var x = Date.prototype.getDay.length; +verifyNotWritable(Date.prototype.getDay, "length", null, 1); if (Date.prototype.getDay.length !== x) { $ERROR('#1: The Date.prototype.getDay.length has the attribute ReadOnly'); } diff --git a/test/built-ins/Date/prototype/getFullYear/S15.9.5.10_A3_T1.js b/test/built-ins/Date/prototype/getFullYear/S15.9.5.10_A3_T1.js index c0ec890478..173f9e83a3 100644 --- a/test/built-ins/Date/prototype/getFullYear/S15.9.5.10_A3_T1.js +++ b/test/built-ins/Date/prototype/getFullYear/S15.9.5.10_A3_T1.js @@ -7,11 +7,11 @@ info: > DontDelete, DontEnum } attributes es5id: 15.9.5.10_A3_T1 description: Checking ReadOnly attribute -flags: [noStrict] +includes: [propertyHelper.js] ---*/ -x = Date.prototype.getFullYear.length; -Date.prototype.getFullYear.length = 1; +var x = Date.prototype.getFullYear.length; +verifyNotWritable(Date.prototype.getFullYear, "length", null, 1); if (Date.prototype.getFullYear.length !== x) { $ERROR('#1: The Date.prototype.getFullYear.length has the attribute ReadOnly'); } diff --git a/test/built-ins/Date/prototype/getHours/S15.9.5.18_A3_T1.js b/test/built-ins/Date/prototype/getHours/S15.9.5.18_A3_T1.js index 556323d1de..fdbaa633f9 100644 --- a/test/built-ins/Date/prototype/getHours/S15.9.5.18_A3_T1.js +++ b/test/built-ins/Date/prototype/getHours/S15.9.5.18_A3_T1.js @@ -7,11 +7,11 @@ info: > DontEnum } attributes es5id: 15.9.5.18_A3_T1 description: Checking ReadOnly attribute -flags: [noStrict] +includes: [propertyHelper.js] ---*/ -x = Date.prototype.getHours.length; -Date.prototype.getHours.length = 1; +var x = Date.prototype.getHours.length; +verifyNotWritable(Date.prototype.getHours, "length", null, 1); if (Date.prototype.getHours.length !== x) { $ERROR('#1: The Date.prototype.getHours.length has the attribute ReadOnly'); } diff --git a/test/built-ins/Date/prototype/getMilliseconds/S15.9.5.24_A3_T1.js b/test/built-ins/Date/prototype/getMilliseconds/S15.9.5.24_A3_T1.js index fe1ecd8ee8..48d763d186 100644 --- a/test/built-ins/Date/prototype/getMilliseconds/S15.9.5.24_A3_T1.js +++ b/test/built-ins/Date/prototype/getMilliseconds/S15.9.5.24_A3_T1.js @@ -7,11 +7,11 @@ info: > DontDelete, DontEnum } attributes es5id: 15.9.5.24_A3_T1 description: Checking ReadOnly attribute -flags: [noStrict] +includes: [propertyHelper.js] ---*/ -x = Date.prototype.getMilliseconds.length; -Date.prototype.getMilliseconds.length = 1; +var x = Date.prototype.getMilliseconds.length; +verifyNotWritable(Date.prototype.getMilliseconds, "length", null, 1); if (Date.prototype.getMilliseconds.length !== x) { $ERROR('#1: The Date.prototype.getMilliseconds.length has the attribute ReadOnly'); } diff --git a/test/built-ins/Date/prototype/getMinutes/S15.9.5.20_A3_T1.js b/test/built-ins/Date/prototype/getMinutes/S15.9.5.20_A3_T1.js index 10cde1ca5f..8c1b3d739c 100644 --- a/test/built-ins/Date/prototype/getMinutes/S15.9.5.20_A3_T1.js +++ b/test/built-ins/Date/prototype/getMinutes/S15.9.5.20_A3_T1.js @@ -7,11 +7,11 @@ info: > DontDelete, DontEnum } attributes es5id: 15.9.5.20_A3_T1 description: Checking ReadOnly attribute -flags: [noStrict] +includes: [propertyHelper.js] ---*/ -x = Date.prototype.getMinutes.length; -Date.prototype.getMinutes.length = 1; +var x = Date.prototype.getMinutes.length; +verifyNotWritable(Date.prototype.getMinutes, "length", null, 1); if (Date.prototype.getMinutes.length !== x) { $ERROR('#1: The Date.prototype.getMinutes.length has the attribute ReadOnly'); } diff --git a/test/built-ins/Date/prototype/getMonth/S15.9.5.12_A3_T1.js b/test/built-ins/Date/prototype/getMonth/S15.9.5.12_A3_T1.js index 2c65e30b6a..0878a8593a 100644 --- a/test/built-ins/Date/prototype/getMonth/S15.9.5.12_A3_T1.js +++ b/test/built-ins/Date/prototype/getMonth/S15.9.5.12_A3_T1.js @@ -7,11 +7,11 @@ info: > DontEnum } attributes es5id: 15.9.5.12_A3_T1 description: Checking ReadOnly attribute -flags: [noStrict] +includes: [propertyHelper.js] ---*/ -x = Date.prototype.getMonth.length; -Date.prototype.getMonth.length = 1; +var x = Date.prototype.getMonth.length; +verifyNotWritable(Date.prototype.getMonth, "length", null, 1); if (Date.prototype.getMonth.length !== x) { $ERROR('#1: The Date.prototype.getMonth.length has the attribute ReadOnly'); } diff --git a/test/built-ins/Date/prototype/getSeconds/S15.9.5.22_A3_T1.js b/test/built-ins/Date/prototype/getSeconds/S15.9.5.22_A3_T1.js index c5b790c046..784c2260e1 100644 --- a/test/built-ins/Date/prototype/getSeconds/S15.9.5.22_A3_T1.js +++ b/test/built-ins/Date/prototype/getSeconds/S15.9.5.22_A3_T1.js @@ -7,11 +7,11 @@ info: > DontDelete, DontEnum } attributes es5id: 15.9.5.22_A3_T1 description: Checking ReadOnly attribute -flags: [noStrict] +includes: [propertyHelper.js] ---*/ -x = Date.prototype.getSeconds.length; -Date.prototype.getSeconds.length = 1; +var x = Date.prototype.getSeconds.length; +verifyNotWritable(Date.prototype.getSeconds, "length", null, 1); if (Date.prototype.getSeconds.length !== x) { $ERROR('#1: The Date.prototype.getSeconds.length has the attribute ReadOnly'); } diff --git a/test/built-ins/Date/prototype/getTime/S15.9.5.9_A3_T1.js b/test/built-ins/Date/prototype/getTime/S15.9.5.9_A3_T1.js index 6034ff9be6..f6429f230f 100644 --- a/test/built-ins/Date/prototype/getTime/S15.9.5.9_A3_T1.js +++ b/test/built-ins/Date/prototype/getTime/S15.9.5.9_A3_T1.js @@ -7,11 +7,11 @@ info: > DontEnum } attributes es5id: 15.9.5.9_A3_T1 description: Checking ReadOnly attribute -flags: [noStrict] +includes: [propertyHelper.js] ---*/ -x = Date.prototype.getTime.length; -Date.prototype.getTime.length = 1; +var x = Date.prototype.getTime.length; +verifyNotWritable(Date.prototype.getTime, "length", null, 1); if (Date.prototype.getTime.length !== x) { $ERROR('#1: The Date.prototype.getTime.length has the attribute ReadOnly'); } diff --git a/test/built-ins/Date/prototype/getTimezoneOffset/S15.9.5.26_A3_T1.js b/test/built-ins/Date/prototype/getTimezoneOffset/S15.9.5.26_A3_T1.js index 09b0df7b8d..6d132420e0 100644 --- a/test/built-ins/Date/prototype/getTimezoneOffset/S15.9.5.26_A3_T1.js +++ b/test/built-ins/Date/prototype/getTimezoneOffset/S15.9.5.26_A3_T1.js @@ -7,11 +7,11 @@ info: > DontDelete, DontEnum } attributes es5id: 15.9.5.26_A3_T1 description: Checking ReadOnly attribute -flags: [noStrict] +includes: [propertyHelper.js] ---*/ -x = Date.prototype.getTimezoneOffset.length; -Date.prototype.getTimezoneOffset.length = 1; +var x = Date.prototype.getTimezoneOffset.length; +verifyNotWritable(Date.prototype.getTimezoneOffset, "length", null, 1); if (Date.prototype.getTimezoneOffset.length !== x) { $ERROR('#1: The Date.prototype.getTimezoneOffset.length has the attribute ReadOnly'); } diff --git a/test/built-ins/Date/prototype/getUTCDate/S15.9.5.15_A3_T1.js b/test/built-ins/Date/prototype/getUTCDate/S15.9.5.15_A3_T1.js index 667d3a0692..d7476cdeee 100644 --- a/test/built-ins/Date/prototype/getUTCDate/S15.9.5.15_A3_T1.js +++ b/test/built-ins/Date/prototype/getUTCDate/S15.9.5.15_A3_T1.js @@ -7,11 +7,11 @@ info: > DontDelete, DontEnum } attributes es5id: 15.9.5.15_A3_T1 description: Checking ReadOnly attribute -flags: [noStrict] +includes: [propertyHelper.js] ---*/ -x = Date.prototype.getUTCDate.length; -Date.prototype.getUTCDate.length = 1; +var x = Date.prototype.getUTCDate.length; +verifyNotWritable(Date.prototype.getUTCDate, "length", null, 1); if (Date.prototype.getUTCDate.length !== x) { $ERROR('#1: The Date.prototype.getUTCDate.length has the attribute ReadOnly'); } diff --git a/test/built-ins/Date/prototype/getUTCDay/S15.9.5.17_A3_T1.js b/test/built-ins/Date/prototype/getUTCDay/S15.9.5.17_A3_T1.js index f1c668e8c1..ff08c81ff3 100644 --- a/test/built-ins/Date/prototype/getUTCDay/S15.9.5.17_A3_T1.js +++ b/test/built-ins/Date/prototype/getUTCDay/S15.9.5.17_A3_T1.js @@ -7,11 +7,11 @@ info: > DontDelete, DontEnum } attributes es5id: 15.9.5.17_A3_T1 description: Checking ReadOnly attribute -flags: [noStrict] +includes: [propertyHelper.js] ---*/ -x = Date.prototype.getUTCDay.length; -Date.prototype.getUTCDay.length = 1; +var x = Date.prototype.getUTCDay.length; +verifyNotWritable(Date.prototype.getUTCDay, "length", null, 1); if (Date.prototype.getUTCDay.length !== x) { $ERROR('#1: The Date.prototype.getUTCDay.length has the attribute ReadOnly'); } diff --git a/test/built-ins/Date/prototype/getUTCFullYear/S15.9.5.11_A3_T1.js b/test/built-ins/Date/prototype/getUTCFullYear/S15.9.5.11_A3_T1.js index 18cd31ff86..26b96be009 100644 --- a/test/built-ins/Date/prototype/getUTCFullYear/S15.9.5.11_A3_T1.js +++ b/test/built-ins/Date/prototype/getUTCFullYear/S15.9.5.11_A3_T1.js @@ -7,11 +7,11 @@ info: > DontDelete, DontEnum } attributes es5id: 15.9.5.11_A3_T1 description: Checking ReadOnly attribute -flags: [noStrict] +includes: [propertyHelper.js] ---*/ -x = Date.prototype.getUTCFullYear.length; -Date.prototype.getUTCFullYear.length = 1; +var x = Date.prototype.getUTCFullYear.length; +verifyNotWritable(Date.prototype.getUTCFullYear, "length", null, 1); if (Date.prototype.getUTCFullYear.length !== x) { $ERROR('#1: The Date.prototype.getUTCFullYear.length has the attribute ReadOnly'); } diff --git a/test/built-ins/Date/prototype/getUTCHours/S15.9.5.19_A3_T1.js b/test/built-ins/Date/prototype/getUTCHours/S15.9.5.19_A3_T1.js index 6cc63fa0fe..492c9b7620 100644 --- a/test/built-ins/Date/prototype/getUTCHours/S15.9.5.19_A3_T1.js +++ b/test/built-ins/Date/prototype/getUTCHours/S15.9.5.19_A3_T1.js @@ -7,11 +7,11 @@ info: > DontDelete, DontEnum } attributes es5id: 15.9.5.19_A3_T1 description: Checking ReadOnly attribute -flags: [noStrict] +includes: [propertyHelper.js] ---*/ -x = Date.prototype.getUTCHours.length; -Date.prototype.getUTCHours.length = 1; +var x = Date.prototype.getUTCHours.length; +verifyNotWritable(Date.prototype.getUTCHours, "length", null, 1); if (Date.prototype.getUTCHours.length !== x) { $ERROR('#1: The Date.prototype.getUTCHours.length has the attribute ReadOnly'); } diff --git a/test/built-ins/Date/prototype/getUTCMilliseconds/S15.9.5.25_A3_T1.js b/test/built-ins/Date/prototype/getUTCMilliseconds/S15.9.5.25_A3_T1.js index 397f11816a..029a9290ef 100644 --- a/test/built-ins/Date/prototype/getUTCMilliseconds/S15.9.5.25_A3_T1.js +++ b/test/built-ins/Date/prototype/getUTCMilliseconds/S15.9.5.25_A3_T1.js @@ -7,11 +7,11 @@ info: > DontDelete, DontEnum } attributes es5id: 15.9.5.25_A3_T1 description: Checking ReadOnly attribute -flags: [noStrict] +includes: [propertyHelper.js] ---*/ -x = Date.prototype.getUTCMilliseconds.length; -Date.prototype.getUTCMilliseconds.length = 1; +var x = Date.prototype.getUTCMilliseconds.length; +verifyNotWritable(Date.prototype.getUTCMilliseconds, "length", null, 1); if (Date.prototype.getUTCMilliseconds.length !== x) { $ERROR('#1: The Date.prototype.getUTCMilliseconds.length has the attribute ReadOnly'); } diff --git a/test/built-ins/Date/prototype/getUTCMinutes/S15.9.5.21_A3_T1.js b/test/built-ins/Date/prototype/getUTCMinutes/S15.9.5.21_A3_T1.js index e642dfdef7..014d0e802d 100644 --- a/test/built-ins/Date/prototype/getUTCMinutes/S15.9.5.21_A3_T1.js +++ b/test/built-ins/Date/prototype/getUTCMinutes/S15.9.5.21_A3_T1.js @@ -7,11 +7,11 @@ info: > DontDelete, DontEnum } attributes es5id: 15.9.5.21_A3_T1 description: Checking ReadOnly attribute -flags: [noStrict] +includes: [propertyHelper.js] ---*/ -x = Date.prototype.getUTCMinutes.length; -Date.prototype.getUTCMinutes.length = 1; +var x = Date.prototype.getUTCMinutes.length; +verifyNotWritable(Date.prototype.getUTCMinutes, "length", null, 1); if (Date.prototype.getUTCMinutes.length !== x) { $ERROR('#1: The Date.prototype.getUTCMinutes.length has the attribute ReadOnly'); } diff --git a/test/built-ins/Date/prototype/getUTCMonth/S15.9.5.13_A3_T1.js b/test/built-ins/Date/prototype/getUTCMonth/S15.9.5.13_A3_T1.js index f2b03bea2f..265d2e683e 100644 --- a/test/built-ins/Date/prototype/getUTCMonth/S15.9.5.13_A3_T1.js +++ b/test/built-ins/Date/prototype/getUTCMonth/S15.9.5.13_A3_T1.js @@ -7,11 +7,11 @@ info: > DontDelete, DontEnum } attributes es5id: 15.9.5.13_A3_T1 description: Checking ReadOnly attribute -flags: [noStrict] +includes: [propertyHelper.js] ---*/ -x = Date.prototype.getUTCMonth.length; -Date.prototype.getUTCMonth.length = 1; +var x = Date.prototype.getUTCMonth.length; +verifyNotWritable(Date.prototype.getUTCMonth, "length", null, 1); if (Date.prototype.getUTCMonth.length !== x) { $ERROR('#1: The Date.prototype.getUTCMonth.length has the attribute ReadOnly'); } diff --git a/test/built-ins/Date/prototype/getUTCSeconds/S15.9.5.23_A3_T1.js b/test/built-ins/Date/prototype/getUTCSeconds/S15.9.5.23_A3_T1.js index 0c5cf3fda5..8c1af370e1 100644 --- a/test/built-ins/Date/prototype/getUTCSeconds/S15.9.5.23_A3_T1.js +++ b/test/built-ins/Date/prototype/getUTCSeconds/S15.9.5.23_A3_T1.js @@ -7,11 +7,11 @@ info: > DontDelete, DontEnum } attributes es5id: 15.9.5.23_A3_T1 description: Checking ReadOnly attribute -flags: [noStrict] +includes: [propertyHelper.js] ---*/ -x = Date.prototype.getUTCSeconds.length; -Date.prototype.getUTCSeconds.length = 1; +var x = Date.prototype.getUTCSeconds.length; +verifyNotWritable(Date.prototype.getUTCSeconds, "length", null, 1); if (Date.prototype.getUTCSeconds.length !== x) { $ERROR('#1: The Date.prototype.getUTCSeconds.length has the attribute ReadOnly'); } diff --git a/test/built-ins/Date/prototype/setDate/S15.9.5.36_A3_T1.js b/test/built-ins/Date/prototype/setDate/S15.9.5.36_A3_T1.js index 951643f302..c04c080489 100644 --- a/test/built-ins/Date/prototype/setDate/S15.9.5.36_A3_T1.js +++ b/test/built-ins/Date/prototype/setDate/S15.9.5.36_A3_T1.js @@ -7,11 +7,11 @@ info: > DontEnum } attributes es5id: 15.9.5.36_A3_T1 description: Checking ReadOnly attribute -flags: [noStrict] +includes: [propertyHelper.js] ---*/ -x = Date.prototype.setDate.length; -Date.prototype.setDate.length = 1; +var x = Date.prototype.setDate.length; +verifyNotWritable(Date.prototype.setDate, "length", null, 1); if (Date.prototype.setDate.length !== x) { $ERROR('#1: The Date.prototype.setDate.length has the attribute ReadOnly'); } diff --git a/test/built-ins/Date/prototype/setFullYear/S15.9.5.40_A3_T1.js b/test/built-ins/Date/prototype/setFullYear/S15.9.5.40_A3_T1.js index cbd1b11a2e..bf8c19aba4 100644 --- a/test/built-ins/Date/prototype/setFullYear/S15.9.5.40_A3_T1.js +++ b/test/built-ins/Date/prototype/setFullYear/S15.9.5.40_A3_T1.js @@ -7,11 +7,11 @@ info: > DontDelete, DontEnum } attributes es5id: 15.9.5.40_A3_T1 description: Checking ReadOnly attribute -flags: [noStrict] +includes: [propertyHelper.js] ---*/ -x = Date.prototype.setFullYear.length; -Date.prototype.setFullYear.length = 1; +var x = Date.prototype.setFullYear.length; +verifyNotWritable(Date.prototype.setFullYear, "length", null, 1); if (Date.prototype.setFullYear.length !== x) { $ERROR('#1: The Date.prototype.setFullYear.length has the attribute ReadOnly'); } diff --git a/test/built-ins/Date/prototype/setHours/S15.9.5.34_A3_T1.js b/test/built-ins/Date/prototype/setHours/S15.9.5.34_A3_T1.js index 7ff13e4893..31a9a32837 100644 --- a/test/built-ins/Date/prototype/setHours/S15.9.5.34_A3_T1.js +++ b/test/built-ins/Date/prototype/setHours/S15.9.5.34_A3_T1.js @@ -7,11 +7,11 @@ info: > DontEnum } attributes es5id: 15.9.5.34_A3_T1 description: Checking ReadOnly attribute -flags: [noStrict] +includes: [propertyHelper.js] ---*/ -x = Date.prototype.setHours.length; -Date.prototype.setHours.length = 1; +var x = Date.prototype.setHours.length; +verifyNotWritable(Date.prototype.setHours, "length", null, 1); if (Date.prototype.setHours.length !== x) { $ERROR('#1: The Date.prototype.setHours.length has the attribute ReadOnly'); } diff --git a/test/built-ins/Date/prototype/setMilliseconds/S15.9.5.28_A3_T1.js b/test/built-ins/Date/prototype/setMilliseconds/S15.9.5.28_A3_T1.js index a9ebc7802a..57960b1ec1 100644 --- a/test/built-ins/Date/prototype/setMilliseconds/S15.9.5.28_A3_T1.js +++ b/test/built-ins/Date/prototype/setMilliseconds/S15.9.5.28_A3_T1.js @@ -7,11 +7,11 @@ info: > DontDelete, DontEnum } attributes es5id: 15.9.5.28_A3_T1 description: Checking ReadOnly attribute -flags: [noStrict] +includes: [propertyHelper.js] ---*/ -x = Date.prototype.setMilliseconds.length; -Date.prototype.setMilliseconds.length = 1; +var x = Date.prototype.setMilliseconds.length; +verifyNotWritable(Date.prototype.setMilliseconds, "length", null, 1); if (Date.prototype.setMilliseconds.length !== x) { $ERROR('#1: The Date.prototype.setMilliseconds.length has the attribute ReadOnly'); } diff --git a/test/built-ins/Date/prototype/setMinutes/S15.9.5.32_A3_T1.js b/test/built-ins/Date/prototype/setMinutes/S15.9.5.32_A3_T1.js index 3caecaee15..ddbd3da4af 100644 --- a/test/built-ins/Date/prototype/setMinutes/S15.9.5.32_A3_T1.js +++ b/test/built-ins/Date/prototype/setMinutes/S15.9.5.32_A3_T1.js @@ -7,11 +7,11 @@ info: > DontDelete, DontEnum } attributes es5id: 15.9.5.32_A3_T1 description: Checking ReadOnly attribute -flags: [noStrict] +includes: [propertyHelper.js] ---*/ -x = Date.prototype.setMinutes.length; -Date.prototype.setMinutes.length = 1; +var x = Date.prototype.setMinutes.length; +verifyNotWritable(Date.prototype.setMinutes, "length", null, 1); if (Date.prototype.setMinutes.length !== x) { $ERROR('#1: The Date.prototype.setMinutes.length has the attribute ReadOnly'); } diff --git a/test/built-ins/Date/prototype/setMonth/S15.9.5.38_A3_T1.js b/test/built-ins/Date/prototype/setMonth/S15.9.5.38_A3_T1.js index 1dc158a92c..9a97ec1ad2 100644 --- a/test/built-ins/Date/prototype/setMonth/S15.9.5.38_A3_T1.js +++ b/test/built-ins/Date/prototype/setMonth/S15.9.5.38_A3_T1.js @@ -7,11 +7,11 @@ info: > DontEnum } attributes es5id: 15.9.5.38_A3_T1 description: Checking ReadOnly attribute -flags: [noStrict] +includes: [propertyHelper.js] ---*/ -x = Date.prototype.setMonth.length; -Date.prototype.setMonth.length = 1; +var x = Date.prototype.setMonth.length; +verifyNotWritable(Date.prototype.setMonth, "length", null, 1); if (Date.prototype.setMonth.length !== x) { $ERROR('#1: The Date.prototype.setMonth.length has the attribute ReadOnly'); } diff --git a/test/built-ins/Date/prototype/setSeconds/S15.9.5.30_A3_T1.js b/test/built-ins/Date/prototype/setSeconds/S15.9.5.30_A3_T1.js index fb655a8a65..61c054f617 100644 --- a/test/built-ins/Date/prototype/setSeconds/S15.9.5.30_A3_T1.js +++ b/test/built-ins/Date/prototype/setSeconds/S15.9.5.30_A3_T1.js @@ -7,11 +7,11 @@ info: > DontDelete, DontEnum } attributes es5id: 15.9.5.30_A3_T1 description: Checking ReadOnly attribute -flags: [noStrict] +includes: [propertyHelper.js] ---*/ -x = Date.prototype.setSeconds.length; -Date.prototype.setSeconds.length = 1; +var x = Date.prototype.setSeconds.length; +verifyNotWritable(Date.prototype.setSeconds, "length", null, 1); if (Date.prototype.setSeconds.length !== x) { $ERROR('#1: The Date.prototype.setSeconds.length has the attribute ReadOnly'); } diff --git a/test/built-ins/Date/prototype/setTime/S15.9.5.27_A3_T1.js b/test/built-ins/Date/prototype/setTime/S15.9.5.27_A3_T1.js index 170b222899..b8a29e63fa 100644 --- a/test/built-ins/Date/prototype/setTime/S15.9.5.27_A3_T1.js +++ b/test/built-ins/Date/prototype/setTime/S15.9.5.27_A3_T1.js @@ -7,11 +7,11 @@ info: > DontEnum } attributes es5id: 15.9.5.27_A3_T1 description: Checking ReadOnly attribute -flags: [noStrict] +includes: [propertyHelper.js] ---*/ -x = Date.prototype.setTime.length; -Date.prototype.setTime.length = 1; +var x = Date.prototype.setTime.length; +verifyNotWritable(Date.prototype.setTime, "length", null, 1); if (Date.prototype.setTime.length !== x) { $ERROR('#1: The Date.prototype.setTime.length has the attribute ReadOnly'); } diff --git a/test/built-ins/Date/prototype/setUTCDate/S15.9.5.37_A3_T1.js b/test/built-ins/Date/prototype/setUTCDate/S15.9.5.37_A3_T1.js index 97362346bb..6e82ad2131 100644 --- a/test/built-ins/Date/prototype/setUTCDate/S15.9.5.37_A3_T1.js +++ b/test/built-ins/Date/prototype/setUTCDate/S15.9.5.37_A3_T1.js @@ -7,11 +7,11 @@ info: > DontDelete, DontEnum } attributes es5id: 15.9.5.37_A3_T1 description: Checking ReadOnly attribute -flags: [noStrict] +includes: [propertyHelper.js] ---*/ -x = Date.prototype.setUTCDate.length; -Date.prototype.setUTCDate.length = 1; +var x = Date.prototype.setUTCDate.length; +verifyNotWritable(Date.prototype.setUTCDate, "length", null, 1); if (Date.prototype.setUTCDate.length !== x) { $ERROR('#1: The Date.prototype.setUTCDate.length has the attribute ReadOnly'); } diff --git a/test/built-ins/Date/prototype/setUTCFullYear/S15.9.5.41_A3_T1.js b/test/built-ins/Date/prototype/setUTCFullYear/S15.9.5.41_A3_T1.js index f2ea0e6878..5a0fea02f5 100644 --- a/test/built-ins/Date/prototype/setUTCFullYear/S15.9.5.41_A3_T1.js +++ b/test/built-ins/Date/prototype/setUTCFullYear/S15.9.5.41_A3_T1.js @@ -7,11 +7,11 @@ info: > DontDelete, DontEnum } attributes es5id: 15.9.5.41_A3_T1 description: Checking ReadOnly attribute -flags: [noStrict] +includes: [propertyHelper.js] ---*/ -x = Date.prototype.setUTCFullYear.length; -Date.prototype.setUTCFullYear.length = 1; +var x = Date.prototype.setUTCFullYear.length; +verifyNotWritable(Date.prototype.setUTCFullYear, "length", null, 1); if (Date.prototype.setUTCFullYear.length !== x) { $ERROR('#1: The Date.prototype.setUTCFullYear.length has the attribute ReadOnly'); } diff --git a/test/built-ins/Date/prototype/setUTCHours/S15.9.5.35_A3_T1.js b/test/built-ins/Date/prototype/setUTCHours/S15.9.5.35_A3_T1.js index fea978f4e8..35f9fab8f7 100644 --- a/test/built-ins/Date/prototype/setUTCHours/S15.9.5.35_A3_T1.js +++ b/test/built-ins/Date/prototype/setUTCHours/S15.9.5.35_A3_T1.js @@ -7,11 +7,11 @@ info: > DontDelete, DontEnum } attributes es5id: 15.9.5.35_A3_T1 description: Checking ReadOnly attribute -flags: [noStrict] +includes: [propertyHelper.js] ---*/ -x = Date.prototype.setUTCHours.length; -Date.prototype.setUTCHours.length = 1; +var x = Date.prototype.setUTCHours.length; +verifyNotWritable(Date.prototype.setUTCHours, "length", null, 1); if (Date.prototype.setUTCHours.length !== x) { $ERROR('#1: The Date.prototype.setUTCHours.length has the attribute ReadOnly'); } diff --git a/test/built-ins/Date/prototype/setUTCMilliseconds/S15.9.5.29_A3_T1.js b/test/built-ins/Date/prototype/setUTCMilliseconds/S15.9.5.29_A3_T1.js index ca89f11c8c..54da31437c 100644 --- a/test/built-ins/Date/prototype/setUTCMilliseconds/S15.9.5.29_A3_T1.js +++ b/test/built-ins/Date/prototype/setUTCMilliseconds/S15.9.5.29_A3_T1.js @@ -7,11 +7,11 @@ info: > DontDelete, DontEnum } attributes es5id: 15.9.5.29_A3_T1 description: Checking ReadOnly attribute -flags: [noStrict] +includes: [propertyHelper.js] ---*/ -x = Date.prototype.setUTCMilliseconds.length; -Date.prototype.setUTCMilliseconds.length = 1; +var x = Date.prototype.setUTCMilliseconds.length; +verifyNotWritable(Date.prototype.setUTCMilliseconds, "length", null, 1); if (Date.prototype.setUTCMilliseconds.length !== x) { $ERROR('#1: The Date.prototype.setUTCMilliseconds.length has the attribute ReadOnly'); } diff --git a/test/built-ins/Date/prototype/setUTCMinutes/S15.9.5.33_A3_T1.js b/test/built-ins/Date/prototype/setUTCMinutes/S15.9.5.33_A3_T1.js index cba299bcb4..67f1beee26 100644 --- a/test/built-ins/Date/prototype/setUTCMinutes/S15.9.5.33_A3_T1.js +++ b/test/built-ins/Date/prototype/setUTCMinutes/S15.9.5.33_A3_T1.js @@ -7,11 +7,11 @@ info: > DontDelete, DontEnum } attributes es5id: 15.9.5.33_A3_T1 description: Checking ReadOnly attribute -flags: [noStrict] +includes: [propertyHelper.js] ---*/ -x = Date.prototype.setUTCMinutes.length; -Date.prototype.setUTCMinutes.length = 1; +var x = Date.prototype.setUTCMinutes.length; +verifyNotWritable(Date.prototype.setUTCMinutes, "length", null, 1); if (Date.prototype.setUTCMinutes.length !== x) { $ERROR('#1: The Date.prototype.setUTCMinutes.length has the attribute ReadOnly'); } diff --git a/test/built-ins/Date/prototype/setUTCMonth/S15.9.5.39_A3_T1.js b/test/built-ins/Date/prototype/setUTCMonth/S15.9.5.39_A3_T1.js index 8979fe138e..12fdc2fb9f 100644 --- a/test/built-ins/Date/prototype/setUTCMonth/S15.9.5.39_A3_T1.js +++ b/test/built-ins/Date/prototype/setUTCMonth/S15.9.5.39_A3_T1.js @@ -7,11 +7,11 @@ info: > DontDelete, DontEnum } attributes es5id: 15.9.5.39_A3_T1 description: Checking ReadOnly attribute -flags: [noStrict] +includes: [propertyHelper.js] ---*/ -x = Date.prototype.setUTCMonth.length; -Date.prototype.setUTCMonth.length = 1; +var x = Date.prototype.setUTCMonth.length; +verifyNotWritable(Date.prototype.setUTCMonth, "length", null, 1); if (Date.prototype.setUTCMonth.length !== x) { $ERROR('#1: The Date.prototype.setUTCMonth.length has the attribute ReadOnly'); } diff --git a/test/built-ins/Date/prototype/setUTCSeconds/S15.9.5.31_A3_T1.js b/test/built-ins/Date/prototype/setUTCSeconds/S15.9.5.31_A3_T1.js index 59a0c073d8..3b0cd3aa63 100644 --- a/test/built-ins/Date/prototype/setUTCSeconds/S15.9.5.31_A3_T1.js +++ b/test/built-ins/Date/prototype/setUTCSeconds/S15.9.5.31_A3_T1.js @@ -7,11 +7,11 @@ info: > DontDelete, DontEnum } attributes es5id: 15.9.5.31_A3_T1 description: Checking ReadOnly attribute -flags: [noStrict] +includes: [propertyHelper.js] ---*/ -x = Date.prototype.setUTCSeconds.length; -Date.prototype.setUTCSeconds.length = 1; +var x = Date.prototype.setUTCSeconds.length; +verifyNotWritable(Date.prototype.setUTCSeconds, "length", null, 1); if (Date.prototype.setUTCSeconds.length !== x) { $ERROR('#1: The Date.prototype.setUTCSeconds.length has the attribute ReadOnly'); } diff --git a/test/built-ins/Date/prototype/toDateString/S15.9.5.3_A3_T1.js b/test/built-ins/Date/prototype/toDateString/S15.9.5.3_A3_T1.js index 4b7b3ac24e..304bb633cf 100644 --- a/test/built-ins/Date/prototype/toDateString/S15.9.5.3_A3_T1.js +++ b/test/built-ins/Date/prototype/toDateString/S15.9.5.3_A3_T1.js @@ -7,11 +7,11 @@ info: > DontDelete, DontEnum } attributes es5id: 15.9.5.3_A3_T1 description: Checking ReadOnly attribute -flags: [noStrict] +includes: [propertyHelper.js] ---*/ -x = Date.prototype.toDateString.length; -Date.prototype.toDateString.length = 1; +var x = Date.prototype.toDateString.length; +verifyNotWritable(Date.prototype.toDateString, "length", null, 1); if (Date.prototype.toDateString.length !== x) { $ERROR('#1: The Date.prototype.toDateString.length has the attribute ReadOnly'); } diff --git a/test/built-ins/Date/prototype/toLocaleDateString/S15.9.5.6_A3_T1.js b/test/built-ins/Date/prototype/toLocaleDateString/S15.9.5.6_A3_T1.js index 127061c169..4333ae2f05 100644 --- a/test/built-ins/Date/prototype/toLocaleDateString/S15.9.5.6_A3_T1.js +++ b/test/built-ins/Date/prototype/toLocaleDateString/S15.9.5.6_A3_T1.js @@ -7,11 +7,11 @@ info: > DontDelete, DontEnum } attributes es5id: 15.9.5.6_A3_T1 description: Checking ReadOnly attribute -flags: [noStrict] +includes: [propertyHelper.js] ---*/ -x = Date.prototype.toLocaleDateString.length; -Date.prototype.toLocaleDateString.length = 1; +var x = Date.prototype.toLocaleDateString.length; +verifyNotWritable(Date.prototype.toLocaleDateString, "length", null, 1); if (Date.prototype.toLocaleDateString.length !== x) { $ERROR('#1: The Date.prototype.toLocaleDateString.length has the attribute ReadOnly'); } diff --git a/test/built-ins/Date/prototype/toLocaleString/S15.9.5.5_A3_T1.js b/test/built-ins/Date/prototype/toLocaleString/S15.9.5.5_A3_T1.js index c7c3b052c0..c2b9d0c373 100644 --- a/test/built-ins/Date/prototype/toLocaleString/S15.9.5.5_A3_T1.js +++ b/test/built-ins/Date/prototype/toLocaleString/S15.9.5.5_A3_T1.js @@ -7,11 +7,11 @@ info: > DontDelete, DontEnum } attributes es5id: 15.9.5.5_A3_T1 description: Checking ReadOnly attribute -flags: [noStrict] +includes: [propertyHelper.js] ---*/ -x = Date.prototype.toLocaleString.length; -Date.prototype.toLocaleString.length = 1; +var x = Date.prototype.toLocaleString.length; +verifyNotWritable(Date.prototype.toLocaleString, "length", null, 1); if (Date.prototype.toLocaleString.length !== x) { $ERROR('#1: The Date.prototype.toLocaleString.length has the attribute ReadOnly'); } diff --git a/test/built-ins/Date/prototype/toLocaleTimeString/S15.9.5.7_A3_T1.js b/test/built-ins/Date/prototype/toLocaleTimeString/S15.9.5.7_A3_T1.js index d216416b4e..4699669804 100644 --- a/test/built-ins/Date/prototype/toLocaleTimeString/S15.9.5.7_A3_T1.js +++ b/test/built-ins/Date/prototype/toLocaleTimeString/S15.9.5.7_A3_T1.js @@ -7,11 +7,11 @@ info: > DontDelete, DontEnum } attributes es5id: 15.9.5.7_A3_T1 description: Checking ReadOnly attribute -flags: [noStrict] +includes: [propertyHelper.js] ---*/ -x = Date.prototype.toLocaleTimeString.length; -Date.prototype.toLocaleTimeString.length = 1; +var x = Date.prototype.toLocaleTimeString.length; +verifyNotWritable(Date.prototype.toLocaleTimeString, "length", null, 1); if (Date.prototype.toLocaleTimeString.length !== x) { $ERROR('#1: The Date.prototype.toLocaleTimeString.length has the attribute ReadOnly'); } diff --git a/test/built-ins/Date/prototype/toString/S15.9.5.2_A3_T1.js b/test/built-ins/Date/prototype/toString/S15.9.5.2_A3_T1.js index 36184f6005..6b8773c320 100644 --- a/test/built-ins/Date/prototype/toString/S15.9.5.2_A3_T1.js +++ b/test/built-ins/Date/prototype/toString/S15.9.5.2_A3_T1.js @@ -7,11 +7,11 @@ info: > DontEnum } attributes es5id: 15.9.5.2_A3_T1 description: Checking ReadOnly attribute -flags: [noStrict] +includes: [propertyHelper.js] ---*/ -x = Date.prototype.toString.length; -Date.prototype.toString.length = 1; +var x = Date.prototype.toString.length; +verifyNotWritable(Date.prototype.toString, "length", null, 1); if (Date.prototype.toString.length !== x) { $ERROR('#1: The Date.prototype.toString.length has the attribute ReadOnly'); } diff --git a/test/built-ins/Date/prototype/toTimeString/S15.9.5.4_A3_T1.js b/test/built-ins/Date/prototype/toTimeString/S15.9.5.4_A3_T1.js index ca723dbc3e..b81f57011d 100644 --- a/test/built-ins/Date/prototype/toTimeString/S15.9.5.4_A3_T1.js +++ b/test/built-ins/Date/prototype/toTimeString/S15.9.5.4_A3_T1.js @@ -7,11 +7,11 @@ info: > DontDelete, DontEnum } attributes es5id: 15.9.5.4_A3_T1 description: Checking ReadOnly attribute -flags: [noStrict] +includes: [propertyHelper.js] ---*/ -x = Date.prototype.toTimeString.length; -Date.prototype.toTimeString.length = 1; +var x = Date.prototype.toTimeString.length; +verifyNotWritable(Date.prototype.toTimeString, "length", null, 1); if (Date.prototype.toTimeString.length !== x) { $ERROR('#1: The Date.prototype.toTimeString.length has the attribute ReadOnly'); } diff --git a/test/built-ins/Date/prototype/toUTCString/S15.9.5.42_A3_T1.js b/test/built-ins/Date/prototype/toUTCString/S15.9.5.42_A3_T1.js index 378ac27b46..e46825e437 100644 --- a/test/built-ins/Date/prototype/toUTCString/S15.9.5.42_A3_T1.js +++ b/test/built-ins/Date/prototype/toUTCString/S15.9.5.42_A3_T1.js @@ -7,11 +7,11 @@ info: > DontDelete, DontEnum } attributes es5id: 15.9.5.42_A3_T1 description: Checking ReadOnly attribute -flags: [noStrict] +includes: [propertyHelper.js] ---*/ -x = Date.prototype.toUTCString.length; -Date.prototype.toUTCString.length = 1; +var x = Date.prototype.toUTCString.length; +verifyNotWritable(Date.prototype.toUTCString, "length", null, 1); if (Date.prototype.toUTCString.length !== x) { $ERROR('#1: The Date.prototype.toUTCString.length has the attribute ReadOnly'); } diff --git a/test/built-ins/Date/prototype/valueOf/S15.9.5.8_A3_T1.js b/test/built-ins/Date/prototype/valueOf/S15.9.5.8_A3_T1.js index fdd237daa7..d7489c5845 100644 --- a/test/built-ins/Date/prototype/valueOf/S15.9.5.8_A3_T1.js +++ b/test/built-ins/Date/prototype/valueOf/S15.9.5.8_A3_T1.js @@ -7,11 +7,11 @@ info: > DontEnum } attributes es5id: 15.9.5.8_A3_T1 description: Checking ReadOnly attribute -flags: [noStrict] +includes: [propertyHelper.js] ---*/ -x = Date.prototype.valueOf.length; -Date.prototype.valueOf.length = 1; +var x = Date.prototype.valueOf.length; +verifyNotWritable(Date.prototype.valueOf, "length", null, 1); if (Date.prototype.valueOf.length !== x) { $ERROR('#1: The Date.prototype.valueOf.length has the attribute ReadOnly'); } diff --git a/test/built-ins/Error/prototype/S15.11.3.1_A1_T1.js b/test/built-ins/Error/prototype/S15.11.3.1_A1_T1.js index 336a11998a..e7bc80e565 100644 --- a/test/built-ins/Error/prototype/S15.11.3.1_A1_T1.js +++ b/test/built-ins/Error/prototype/S15.11.3.1_A1_T1.js @@ -5,14 +5,20 @@ info: Error.prototype property has the attributes {DontDelete} es5id: 15.11.3.1_A1_T1 description: Checking if deleting the Error.prototype property fails -flags: [noStrict] +includes: [propertyHelper.js] ---*/ var proto=Error.prototype; ////////////////////////////////////////////////////////////////////////////// //CHECK#1 -if(delete Error.prototype){ - $ERROR('#1: delete Error.prototype return false'); +verifyNotConfigurable(Error, "prototype"); +try { + if ((delete Error.prototype) !== false) { + $ERROR('#1: Error.prototype has the attribute DontDelete'); + } +} catch (e) { + if (e instanceof Test262Error) throw e; + assert(e instanceof TypeError); } // ////////////////////////////////////////////////////////////////////////////// diff --git a/test/built-ins/Error/prototype/S15.11.3.1_A3_T1.js b/test/built-ins/Error/prototype/S15.11.3.1_A3_T1.js index 7b62671d7a..d76e90fb51 100644 --- a/test/built-ins/Error/prototype/S15.11.3.1_A3_T1.js +++ b/test/built-ins/Error/prototype/S15.11.3.1_A3_T1.js @@ -5,7 +5,7 @@ info: Error.prototype property has the attributes {ReadOnly} es5id: 15.11.3.1_A3_T1 description: Checking if varying the Error.prototype property fails -flags: [noStrict] +includes: [propertyHelper.js] ---*/ ////////////////////////////////////////////////////////////////////////////// @@ -16,9 +16,9 @@ if (!(Error.hasOwnProperty('prototype'))) { // ////////////////////////////////////////////////////////////////////////////// -__obj = Error.prototype; +var __obj = Error.prototype; -Error.prototype = function(){return "shifted";}; +verifyNotWritable(Error, "prototype", null, function(){return "shifted";}); ////////////////////////////////////////////////////////////////////////////// //CHECK#2 @@ -34,7 +34,7 @@ try { Error.prototype(); $ERROR('#3: "Error.prototype()" lead to throwing exception'); } catch (e) { - ; + if (e instanceof Test262Error) throw e; } // ////////////////////////////////////////////////////////////////////////////// diff --git a/test/built-ins/Function/length/S15.3.5.1_A3_T1.js b/test/built-ins/Function/length/S15.3.5.1_A3_T1.js index 78f134f73e..6b810fb8c4 100644 --- a/test/built-ins/Function/length/S15.3.5.1_A3_T1.js +++ b/test/built-ins/Function/length/S15.3.5.1_A3_T1.js @@ -7,23 +7,22 @@ es5id: 15.3.5.1_A3_T1 description: > Checking if varying the length property of Function("arg1,arg2,arg3","arg4,arg5", null) fails -flags: [noStrict] -includes: [$FAIL.js] +includes: [$FAIL.js, propertyHelper.js] ---*/ -f = new Function("arg1,arg2,arg3","arg4,arg5", null); +var f = new Function("arg1,arg2,arg3","arg4,arg5", null); //CHECK#1 if (!(f.hasOwnProperty('length'))) { $FAIL('#1: the function has length property.'); } -length = f.length; +var flength = f.length; -f.length = function(){}; +verifyNotWritable(f, "length", null, function(){}); //CHECK#2 -if (f.length !== length) { +if (f.length !== flength) { $ERROR('#2: the function.length property has the attributes ReadOnly'); } @@ -32,7 +31,7 @@ try { f.length(); $ERROR('#3: the function.length property has the attributes ReadOnly'); } catch (e) { - ; + if (e instanceof Test262Error) throw e; } //CHECK#4 diff --git a/test/built-ins/Function/length/S15.3.5.1_A3_T2.js b/test/built-ins/Function/length/S15.3.5.1_A3_T2.js index d7993cb30c..6ab88a92c0 100644 --- a/test/built-ins/Function/length/S15.3.5.1_A3_T2.js +++ b/test/built-ins/Function/length/S15.3.5.1_A3_T2.js @@ -7,23 +7,22 @@ es5id: 15.3.5.1_A3_T2 description: > Checking if varying the length property of Function("arg1,arg2,arg3", null) fails -flags: [noStrict] -includes: [$FAIL.js] +includes: [$FAIL.js, propertyHelper.js] ---*/ -f = Function("arg1,arg2,arg3", null); +var f = Function("arg1,arg2,arg3", null); //CHECK#1 if (!(f.hasOwnProperty('length'))) { $FAIL('#1: the function has length property.'); } -length = f.length; +var flength = f.length; -f.length = function(){}; +verifyNotWritable(f, "length", null, function(){}); //CHECK#2 -if (f.length !== length) { +if (f.length !== flength) { $ERROR('#2: the function.length property has the attributes ReadOnly'); } @@ -32,7 +31,7 @@ try { f.length(); $ERROR('#3: the function.length property has the attributes ReadOnly'); } catch (e) { - ; + if (e instanceof Test262Error) throw e; } //CHECK#4 diff --git a/test/built-ins/Function/length/S15.3.5.1_A3_T3.js b/test/built-ins/Function/length/S15.3.5.1_A3_T3.js index 1156a5a9dc..26cfedc3ea 100644 --- a/test/built-ins/Function/length/S15.3.5.1_A3_T3.js +++ b/test/built-ins/Function/length/S15.3.5.1_A3_T3.js @@ -7,23 +7,22 @@ es5id: 15.3.5.1_A3_T3 description: > Checking if varying the length property of Function("arg1,arg2,arg3","arg1,arg2","arg3", null) fails -flags: [noStrict] -includes: [$FAIL.js] +includes: [$FAIL.js, propertyHelper.js] ---*/ -f = new Function("arg1,arg2,arg3","arg1,arg2","arg3", null); +var f = new Function("arg1,arg2,arg3","arg1,arg2","arg3", null); //CHECK#1 if (!(f.hasOwnProperty('length'))) { $FAIL('#1: the function has length property.'); } -length = f.length; +var flength = f.length; -f.length = function(){}; +verifyNotWritable(f, "length", null, function(){}); //CHECK#2 -if (f.length !== length) { +if (f.length !== flength) { $ERROR('#2: the function.length property has the attributes ReadOnly'); } @@ -32,7 +31,7 @@ try { f.length(); $ERROR('#3: the function.length property has the attributes ReadOnly'); } catch (e) { - ; + if (e instanceof Test262Error) throw e; } //CHECK#4 diff --git a/test/built-ins/Function/prototype/S15.3.3.1_A1.js b/test/built-ins/Function/prototype/S15.3.3.1_A1.js index 6b7df68ea7..af9795ab90 100644 --- a/test/built-ins/Function/prototype/S15.3.3.1_A1.js +++ b/test/built-ins/Function/prototype/S15.3.3.1_A1.js @@ -5,11 +5,12 @@ info: The Function.prototype property has the attribute ReadOnly es5id: 15.3.3.1_A1 description: Checking if varying the Function.prototype property fails -flags: [noStrict] +includes: [propertyHelper.js] ---*/ var obj = Function.prototype; -Function.prototype = function(){return "shifted";}; + +verifyNotWritable(Function, "prototype", null, function(){return "shifted";}); //CHECK#1 if (Function.prototype !== obj) { diff --git a/test/built-ins/Function/prototype/S15.3.3.1_A3.js b/test/built-ins/Function/prototype/S15.3.3.1_A3.js index c5f7955320..79568c9e71 100644 --- a/test/built-ins/Function/prototype/S15.3.3.1_A3.js +++ b/test/built-ins/Function/prototype/S15.3.3.1_A3.js @@ -5,12 +5,22 @@ info: The Function.prototype property has the attribute DontDelete es5id: 15.3.3.1_A3 description: Checking if deleting the Function.prototype property fails -flags: [noStrict] +includes: [propertyHelper.js] ---*/ -delete Function.prototype; +verifyNotConfigurable(Function, "prototype"); //CHECK#1 -if (!(Function.hasOwnProperty('prototype'))) { - $ERROR('#1: the Function.prototype property has the attributes DontDelete.'); +try { + if ((delete Function.prototype) !== false) { + $ERROR('#1: Function.prototype has the attribute DontDelete'); + } +} catch (e) { + if (e instanceof Test262Error) throw e; + assert(e instanceof TypeError); +} + +//CHECK#2 +if (!(Function.hasOwnProperty('prototype'))) { + $ERROR('#2: the Function.prototype property has the attributes DontDelete.'); } diff --git a/test/built-ins/Function/prototype/S15.3.5.2_A1_T1.js b/test/built-ins/Function/prototype/S15.3.5.2_A1_T1.js index 2844023b4b..386557b43a 100644 --- a/test/built-ins/Function/prototype/S15.3.5.2_A1_T1.js +++ b/test/built-ins/Function/prototype/S15.3.5.2_A1_T1.js @@ -7,22 +7,28 @@ es5id: 15.3.5.2_A1_T1 description: > Checking if deleting the prototype property of Function("", null) fails -flags: [noStrict] -includes: [$FAIL.js] +includes: [$FAIL.js, propertyHelper.js] ---*/ -f = new Function("", null); +var f = new Function("", null); //CHECK#1 if (!(f.hasOwnProperty('prototype'))) { $FAIL('#1: the function has length property.'); } -fproto = f.prototype; +var fproto = f.prototype; + +verifyNotConfigurable(f, "prototype"); //CHECK#2 -if (delete f.prototype) { - $ERROR('#2: the prototype property has the attributes { DontDelete }'); +try { + if ((delete f.prototype) !== false) { + $ERROR('#2: the prototype property has the attributes { DontDelete }'); + } +} catch (e) { + if (e instanceof Test262Error) throw e; + assert(e instanceof TypeError); } //CHECK#3 diff --git a/test/built-ins/Function/prototype/S15.3.5.2_A1_T2.js b/test/built-ins/Function/prototype/S15.3.5.2_A1_T2.js index 3ac833ed1c..ae3d200c08 100644 --- a/test/built-ins/Function/prototype/S15.3.5.2_A1_T2.js +++ b/test/built-ins/Function/prototype/S15.3.5.2_A1_T2.js @@ -7,22 +7,28 @@ es5id: 15.3.5.2_A1_T2 description: > Checking if deleting the prototype property of Function(void 0, "") fails -flags: [noStrict] -includes: [$FAIL.js] +includes: [$FAIL.js, propertyHelper.js] ---*/ -f = Function(void 0, ""); +var f = Function(void 0, ""); //CHECK#1 if (!(f.hasOwnProperty('prototype'))) { $FAIL('#1: the function has length property.'); } -fproto = f.prototype; +var fproto = f.prototype; + +verifyNotConfigurable(f, "prototype"); //CHECK#2 -if (delete f.prototype) { - $ERROR('#2: the prototype property has the attributes { DontDelete }'); +try { + if ((delete f.prototype) !== false) { + $ERROR('#2: the prototype property has the attributes { DontDelete }'); + } +} catch (e) { + if (e instanceof Test262Error) throw e; + assert(e instanceof TypeError); } //CHECK#3 diff --git a/test/built-ins/Function/prototype/apply/S15.3.4.3_A10.js b/test/built-ins/Function/prototype/apply/S15.3.4.3_A10.js index 8219a5e8a6..843d3250ee 100644 --- a/test/built-ins/Function/prototype/apply/S15.3.4.3_A10.js +++ b/test/built-ins/Function/prototype/apply/S15.3.4.3_A10.js @@ -7,8 +7,7 @@ es5id: 15.3.4.3_A10 description: > Checking if varying the Function.prototype.apply.length property fails -flags: [noStrict] -includes: [$FAIL.js] +includes: [$FAIL.js, propertyHelper.js] ---*/ //CHECK#1 @@ -18,7 +17,7 @@ if (!(Function.prototype.apply.hasOwnProperty('length'))) { var obj = Function.prototype.apply.length; -Function.prototype.apply.length = function(){return "shifted";}; +verifyNotWritable(Function.prototype.apply, "length", null, function(){return "shifted";}); //CHECK#2 if (Function.prototype.apply.length !== obj) { diff --git a/test/built-ins/Function/prototype/bind/15.3.4.5-15-3.js b/test/built-ins/Function/prototype/bind/15.3.4.5-15-3.js index a11fb1344e..6181f56a1c 100644 --- a/test/built-ins/Function/prototype/bind/15.3.4.5-15-3.js +++ b/test/built-ins/Function/prototype/bind/15.3.4.5-15-3.js @@ -9,19 +9,13 @@ es5id: 15.3.4.5-15-3 description: > Function.prototype.bind - The [[Writable]] attribute of length property in F set as false -flags: [noStrict] -includes: [runTestCase.js] +includes: [propertyHelper.js] ---*/ -function testcase() { +function foo() { } +var obj = foo.bind({}); +var flength = obj.length; - var canWritable = false; - var hasProperty = false; - function foo() { } - var obj = foo.bind({}); - hasProperty = obj.hasOwnProperty("length"); - obj.length = 100; - canWritable = (obj.length === 100); - return hasProperty && !canWritable; - } -runTestCase(testcase); +assert(obj.hasOwnProperty("length")); +verifyNotWritable(obj, "length", null, 100); +assert.sameValue(obj.length, flength); diff --git a/test/built-ins/Function/prototype/call/S15.3.4.4_A10.js b/test/built-ins/Function/prototype/call/S15.3.4.4_A10.js index f9eae7d6da..a2be8f0580 100644 --- a/test/built-ins/Function/prototype/call/S15.3.4.4_A10.js +++ b/test/built-ins/Function/prototype/call/S15.3.4.4_A10.js @@ -7,8 +7,7 @@ es5id: 15.3.4.4_A10 description: > Checking if varying the Function.prototype.call.length property fails -flags: [noStrict] -includes: [$FAIL.js] +includes: [$FAIL.js, propertyHelper.js] ---*/ //CHECK#1 @@ -18,7 +17,7 @@ if (!(Function.prototype.call.hasOwnProperty('length'))) { var obj = Function.prototype.call.length; -Function.prototype.call.length = function(){return "shifted";}; +verifyNotWritable(Function.prototype.call, "length", null, function(){return "shifted";}); //CHECK#2 if (Function.prototype.call.length !== obj) { diff --git a/test/built-ins/Function/prototype/toString/S15.3.4.2_A10.js b/test/built-ins/Function/prototype/toString/S15.3.4.2_A10.js index 511765b6f5..509f75b2c3 100644 --- a/test/built-ins/Function/prototype/toString/S15.3.4.2_A10.js +++ b/test/built-ins/Function/prototype/toString/S15.3.4.2_A10.js @@ -7,8 +7,7 @@ es5id: 15.3.4.2_A10 description: > Checking if varying the Function.prototype.toString.length property fails -flags: [noStrict] -includes: [$FAIL.js] +includes: [$FAIL.js, propertyHelper.js] ---*/ //CHECK#1 @@ -18,7 +17,7 @@ if (!(Function.prototype.toString.hasOwnProperty('length'))) { var obj = Function.prototype.toString.length; -Function.prototype.toString.length = function(){return "shifted";}; +verifyNotWritable(Function.prototype.toString, "length", null, function(){return "shifted";}); //CHECK#2 if (Function.prototype.toString.length !== obj) { diff --git a/test/built-ins/Infinity/S15.1.1.2_A2_T1.js b/test/built-ins/Infinity/S15.1.1.2_A2_T1.js new file mode 100755 index 0000000000..c0b90e5986 --- /dev/null +++ b/test/built-ins/Infinity/S15.1.1.2_A2_T1.js @@ -0,0 +1,15 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +info: The Infinity is ReadOnly +es5id: 15.1.1.2_A2_T1 +description: Checking typeof Functions +includes: [propertyHelper.js, fnGlobalObject.js] +---*/ + +// CHECK#1 +verifyNotWritable(fnGlobalObject(), "Infinity", null, true); +if (typeof(Infinity) === "boolean") { + $ERROR('#1: Infinity = true; typeof(Infinity) !== "boolean". Actual: ' + (typeof(Infinity))); +} diff --git a/test/built-ins/Infinity/S15.1.1.2_A2_T2.js b/test/built-ins/Infinity/S15.1.1.2_A2_T2.js index 3f35df431e..d6c4093870 100644 --- a/test/built-ins/Infinity/S15.1.1.2_A2_T2.js +++ b/test/built-ins/Infinity/S15.1.1.2_A2_T2.js @@ -2,13 +2,14 @@ // This code is governed by the BSD license found in the LICENSE file. /*--- -info: The Infinity is not ReadOnly +info: The Infinity is ReadOnly es5id: 15.1.1.2_A2_T2 description: Checking typeof Functions +flags: [noStrict] ---*/ // CHECK#1 -var Finite = true; -if (typeof(Finite) !== "boolean") { - $ERROR('#1: Finite = true; typeof(NaN) === "boolean". Actual: ' + (typeof(NaN))); +Infinity = true; +if (typeof(Infinity) === "boolean") { + $ERROR('#1: Infinity = true; typeof(Infinity) !== "boolean". Actual: ' + (typeof(Infinity))); } diff --git a/test/built-ins/Infinity/S15.1.1.2_A3_T1.js b/test/built-ins/Infinity/S15.1.1.2_A3_T1.js new file mode 100644 index 0000000000..6c8d877a87 --- /dev/null +++ b/test/built-ins/Infinity/S15.1.1.2_A3_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 Infinity is DontDelete +es5id: 15.1.1.2_A3_T1 +description: Use delete +includes: [propertyHelper.js, fnGlobalObject.js] +---*/ + +// CHECK#1 +verifyNotConfigurable(fnGlobalObject(), "Infinity"); + +try { + if (delete fnGlobalObject().Infinity !== false) { + $ERROR('#1: delete Infinity === false.'); + } +} catch (e) { + if (e instanceof Test262Error) throw e; + assert(e instanceof TypeError); +} diff --git a/test/built-ins/Infinity/S15.1.1.2_A3.1.js b/test/built-ins/Infinity/S15.1.1.2_A3_T2.js old mode 100644 new mode 100755 similarity index 91% rename from test/built-ins/Infinity/S15.1.1.2_A3.1.js rename to test/built-ins/Infinity/S15.1.1.2_A3_T2.js index f55723df66..8e8433f4dd --- a/test/built-ins/Infinity/S15.1.1.2_A3.1.js +++ b/test/built-ins/Infinity/S15.1.1.2_A3_T2.js @@ -3,12 +3,12 @@ /*--- info: The Infinity is DontDelete -es5id: 15.1.1.2_A3.1 +es5id: 15.1.1.2_A3_T2 description: Use delete flags: [noStrict] ---*/ // CHECK#1 if (delete Infinity !== false) { - $ERROR('#1: delete Infinity === false. Actual: ' + (delete Infinity)); + $ERROR('#1: delete Infinity === false. Actual: ' + (delete Infinity)); } diff --git a/test/built-ins/Infinity/S15.1.1.2_A3.2.js b/test/built-ins/Infinity/S15.1.1.2_A4.js similarity index 91% rename from test/built-ins/Infinity/S15.1.1.2_A3.2.js rename to test/built-ins/Infinity/S15.1.1.2_A4.js index 18f7d83e37..fe9c76f6d1 100644 --- a/test/built-ins/Infinity/S15.1.1.2_A3.2.js +++ b/test/built-ins/Infinity/S15.1.1.2_A4.js @@ -3,7 +3,7 @@ /*--- info: The Infinity is DontEnum -es5id: 15.1.1.2_A3.2 +es5id: 15.1.1.2_A4 description: Use for-in statement ---*/ @@ -11,5 +11,5 @@ description: Use for-in statement for (var prop in this) { if (prop === "Infinity") { $ERROR('#1: The Infinity is DontEnum'); - } + } } diff --git a/test/built-ins/Math/E/S15.8.1.1_A3.js b/test/built-ins/Math/E/S15.8.1.1_A3.js index 1c588bee4e..38126ffc34 100644 --- a/test/built-ins/Math/E/S15.8.1.1_A3.js +++ b/test/built-ins/Math/E/S15.8.1.1_A3.js @@ -5,10 +5,17 @@ info: Value Property E of the Math Object has the attribute DontDelete es5id: 15.8.1.1_A3 description: Checking if Math.E property has the attribute DontDelete -flags: [noStrict] +includes: [propertyHelper.js] ---*/ +verifyNotConfigurable(Math, "E"); + // CHECK#1 -if (delete Math.E === true) { +try { + if (delete Math.E === true) { $ERROR('#1: Value Property E of the Math Object hasn\'t attribute DontDelete: \'Math.E === true\''); + } +} catch (e) { + if (e instanceof Test262Error) throw e; + assert(e instanceof TypeError); } diff --git a/test/built-ins/Math/E/S15.8.1.1_A4.js b/test/built-ins/Math/E/S15.8.1.1_A4.js index aa6c97a337..b8b67c8ab5 100644 --- a/test/built-ins/Math/E/S15.8.1.1_A4.js +++ b/test/built-ins/Math/E/S15.8.1.1_A4.js @@ -5,12 +5,12 @@ info: Value Property E of the Math Object has the attribute ReadOnly es5id: 15.8.1.1_A4 description: Checking if Math.E property has the attribute ReadOnly -flags: [noStrict] +includes: [propertyHelper.js] ---*/ // CHECK#1 var x = Math.E; -Math.E = 1; +verifyNotWritable(Math, "E", null, 1); if (Math.E !== x) { $ERROR('#1: Math.E hasn\'t ReadOnly: \'x = Math.E;Math.E = 1;Math.E === x\''); } diff --git a/test/built-ins/Math/LN10/S15.8.1.2_A3.js b/test/built-ins/Math/LN10/S15.8.1.2_A3.js index 1d39f32052..8ee3eb6fb0 100644 --- a/test/built-ins/Math/LN10/S15.8.1.2_A3.js +++ b/test/built-ins/Math/LN10/S15.8.1.2_A3.js @@ -5,10 +5,17 @@ info: Value Property LN10 of the Math Object has the attribute DontDelete es5id: 15.8.1.2_A3 description: Checking if Math.LN10 property has the attribute DontDelete -flags: [noStrict] +includes: [propertyHelper.js] ---*/ +verifyNotConfigurable(Math, "LN10"); + // CHECK#1 -if (delete Math.LN10 === true) { - $ERROR('#1: Value Property LN10 of the Math Object hasn\'t attribute DontDelete: \'Math.LN10 === true\''); +try { + if (delete Math.LN10 === true) { + $ERROR('#1: Value Property LN10 of the Math Object hasn\'t attribute DontDelete: \'Math.LN10 === true\''); + } +} catch (e) { + if (e instanceof Test262Error) throw e; + assert(e instanceof TypeError); } diff --git a/test/built-ins/Math/LN10/S15.8.1.2_A4.js b/test/built-ins/Math/LN10/S15.8.1.2_A4.js index 1c5c360335..088d821a51 100644 --- a/test/built-ins/Math/LN10/S15.8.1.2_A4.js +++ b/test/built-ins/Math/LN10/S15.8.1.2_A4.js @@ -5,12 +5,12 @@ info: Value Property LN10 of the Math Object has the attribute ReadOnly es5id: 15.8.1.2_A4 description: Checking if Math.LN10 property has the attribute ReadOnly -flags: [noStrict] +includes: [propertyHelper.js] ---*/ // CHECK#1 var x = Math.LN10; -Math.LN10 = 1; +verifyNotWritable(Math, "LN10", null, 1); if (Math.LN10 !== x) { $ERROR('#1: Math.LN10 hasn\'t ReadOnly: \'x = Math.LN10;Math.LN10 = 1;Math.LN10 === x\''); } diff --git a/test/built-ins/Math/LN2/S15.8.1.3_A3.js b/test/built-ins/Math/LN2/S15.8.1.3_A3.js index aafb1cb482..66de45f9ce 100644 --- a/test/built-ins/Math/LN2/S15.8.1.3_A3.js +++ b/test/built-ins/Math/LN2/S15.8.1.3_A3.js @@ -5,10 +5,17 @@ info: Value Property LN2 of the Math Object has the attribute DontDelete es5id: 15.8.1.3_A3 description: Checking if Math.LN2 property has the attribute DontDelete -flags: [noStrict] +includes: [propertyHelper.js] ---*/ +verifyNotConfigurable(Math, "LN2"); + // CHECK#1 -if (delete Math.LN2 === true) { +try { + if (delete Math.LN2 === true) { $ERROR('#1: Value Property LN2 of the Math Object hasn\'t attribute DontDelete: \'Math.LN2 === true\''); + } +} catch (e) { + if (e instanceof Test262Error) throw e; + assert(e instanceof TypeError); } diff --git a/test/built-ins/Math/LN2/S15.8.1.3_A4.js b/test/built-ins/Math/LN2/S15.8.1.3_A4.js index 26509885d0..db335f4e39 100644 --- a/test/built-ins/Math/LN2/S15.8.1.3_A4.js +++ b/test/built-ins/Math/LN2/S15.8.1.3_A4.js @@ -5,12 +5,12 @@ info: Value Property LN2 of the Math Object has the attribute ReadOnly es5id: 15.8.1.3_A4 description: Checking if Math.LN2 property has the attribute DontDelete -flags: [noStrict] +includes: [propertyHelper.js] ---*/ // CHECK#1 var x = Math.LN2; -Math.LN2 = 1; +verifyNotWritable(Math, "LN2", null, 1); if (Math.LN2 !== x) { $ERROR('#1: Math.LN2 hasn\'t ReadOnly: \'x = Math.LN2;Math.LN2 = 1;Math.LN2 === x\''); } diff --git a/test/built-ins/Math/LOG10E/S15.8.1.5_A3.js b/test/built-ins/Math/LOG10E/S15.8.1.5_A3.js index 2903f6d32e..5c02f2b0dd 100644 --- a/test/built-ins/Math/LOG10E/S15.8.1.5_A3.js +++ b/test/built-ins/Math/LOG10E/S15.8.1.5_A3.js @@ -5,10 +5,17 @@ info: Value Property LOG10E of the Math Object has the attribute DontDelete es5id: 15.8.1.5_A3 description: Checking if Math.LOG10E property has the attribute DontDelete -flags: [noStrict] +includes: [propertyHelper.js] ---*/ +verifyNotConfigurable(Math, "LOG10E"); + // CHECK#1 -if (delete Math.LOG10E === true) { +try { + if (delete Math.LOG10E === true) { $ERROR('#1: Value Property LOG10E of the Math Object hasn\'t attribute DontDelete: \'Math.LOG10E === true\''); + } +} catch (e) { + if (e instanceof Test262Error) throw e; + assert(e instanceof TypeError); } diff --git a/test/built-ins/Math/LOG10E/S15.8.1.5_A4.js b/test/built-ins/Math/LOG10E/S15.8.1.5_A4.js index 6fc967cd02..9708e5edae 100644 --- a/test/built-ins/Math/LOG10E/S15.8.1.5_A4.js +++ b/test/built-ins/Math/LOG10E/S15.8.1.5_A4.js @@ -5,12 +5,12 @@ info: Value Property LOG10E of the Math Object has the attribute ReadOnly es5id: 15.8.1.5_A4 description: Checking if Math.LOG10E property has the attribute ReadOnly -flags: [noStrict] +includes: [propertyHelper.js] ---*/ // CHECK#1 var x = Math.LOG10E; -Math.LOG10E = 1; +verifyNotWritable(Math, "LOG10E", null, 1); if (Math.LOG10E !== x) { $ERROR('#1: Math.LOG10E hasn\'t ReadOnly: \'x = Math.LOG10E;Math.LOG10E = 1;Math.LOG10E === x\''); } diff --git a/test/built-ins/Math/LOG2E/S15.8.1.4_A3.js b/test/built-ins/Math/LOG2E/S15.8.1.4_A3.js index e041cb3332..e31dbe98e5 100644 --- a/test/built-ins/Math/LOG2E/S15.8.1.4_A3.js +++ b/test/built-ins/Math/LOG2E/S15.8.1.4_A3.js @@ -5,10 +5,17 @@ info: Value Property LOG2E of the Math Object has the attribute DontDelete es5id: 15.8.1.4_A3 description: Checking if Math.LOG2E property has the attribute DontDelete -flags: [noStrict] +includes: [propertyHelper.js] ---*/ +verifyNotConfigurable(Math, "LOG2E"); + // CHECK#1 -if (delete Math.LOG2E === true) { +try { + if (delete Math.LOG2E === true) { $ERROR('#1: Value Property LOG2E of the Math Object hasn\'t attribute DontDelete: \'Math.LOG2E === true\''); + } +} catch (e) { + if (e instanceof Test262Error) throw e; + assert(e instanceof TypeError); } diff --git a/test/built-ins/Math/LOG2E/S15.8.1.4_A4.js b/test/built-ins/Math/LOG2E/S15.8.1.4_A4.js index 5398e4c907..579d02b125 100644 --- a/test/built-ins/Math/LOG2E/S15.8.1.4_A4.js +++ b/test/built-ins/Math/LOG2E/S15.8.1.4_A4.js @@ -5,12 +5,12 @@ info: Value Property LOG2E of the Math Object has the attribute ReadOnly es5id: 15.8.1.4_A4 description: Checking if Math.LOG2E property has the attribute ReadOnly -flags: [noStrict] +includes: [propertyHelper.js] ---*/ // CHECK#1 var x = Math.LOG2E; -Math.LOG2E = 1; +verifyNotWritable(Math, "LOG2E", null, 1); if (Math.LOG2E !== x) { $ERROR('#1: Math.LOG2E hasn\'t ReadOnly: \'x = Math.LOG2E;Math.LOG2E = 1;Math.LOG2E === x\''); } diff --git a/test/built-ins/Math/PI/S15.8.1.6_A3.js b/test/built-ins/Math/PI/S15.8.1.6_A3.js index da27bb16d6..1563c33a7b 100644 --- a/test/built-ins/Math/PI/S15.8.1.6_A3.js +++ b/test/built-ins/Math/PI/S15.8.1.6_A3.js @@ -5,10 +5,17 @@ info: Value Property PI of the Math Object has the attribute DontDelete es5id: 15.8.1.6_A3 description: Checking if Math.PI property has the attribute DontDelete -flags: [noStrict] +includes: [propertyHelper.js] ---*/ +verifyNotConfigurable(Math, "PI"); + // CHECK#1 -if (delete Math.PI === true) { +try { + if (delete Math.PI === true) { $ERROR('#1: Value Property PI of the Math Object hasn\'t attribute DontDelete: \'Math.PI === true\''); + } +} catch (e) { + if (e instanceof Test262Error) throw e; + assert(e instanceof TypeError); } diff --git a/test/built-ins/Math/PI/S15.8.1.6_A4.js b/test/built-ins/Math/PI/S15.8.1.6_A4.js index b4479726bd..a65b24b2a6 100644 --- a/test/built-ins/Math/PI/S15.8.1.6_A4.js +++ b/test/built-ins/Math/PI/S15.8.1.6_A4.js @@ -5,12 +5,12 @@ info: Value Property PI of the Math Object has the attribute ReadOnly es5id: 15.8.1.6_A4 description: Checking if Math.PI property has the attribute ReadOnly -flags: [noStrict] +includes: [propertyHelper.js] ---*/ // CHECK#1 var x = Math.PI; -Math.PI = 1; +verifyNotWritable(Math, "PI", null, 1); if (Math.PI !== x) { $ERROR('#1: Math.PI hasn\'t ReadOnly: \'x = Math.PI;Math.PI = 1;Math.PI === x\''); } diff --git a/test/built-ins/Math/SQRT1_2/S15.8.1.7_A3.js b/test/built-ins/Math/SQRT1_2/S15.8.1.7_A3.js index e3613f5897..1a95fb060b 100644 --- a/test/built-ins/Math/SQRT1_2/S15.8.1.7_A3.js +++ b/test/built-ins/Math/SQRT1_2/S15.8.1.7_A3.js @@ -5,10 +5,17 @@ info: Value Property SQRT1_2 of the Math Object has the attribute DontDelete es5id: 15.8.1.7_A3 description: Checking if Math.SQRT1_2 property has the attribute DontDelete -flags: [noStrict] +includes: [propertyHelper.js] ---*/ +verifyNotConfigurable(Math, "SQRT1_2"); + // CHECK#1 -if (delete Math.SQRT1_2 === true) { - $ERROR("#1: Value Property SQRT1_2 of the Math Object hasn't attribute DontDelete: 'Math.SQRT1_2 === true'"); +try { + if (delete Math.SQRT1_2 === true) { + $ERROR("#1: Value Property SQRT1_2 of the Math Object hasn't attribute DontDelete: 'Math.SQRT1_2 === true'"); + } +} catch (e) { + if (e instanceof Test262Error) throw e; + assert(e instanceof TypeError); } diff --git a/test/built-ins/Math/SQRT1_2/S15.8.1.7_A4.js b/test/built-ins/Math/SQRT1_2/S15.8.1.7_A4.js index 99c3f2f522..3204f22246 100644 --- a/test/built-ins/Math/SQRT1_2/S15.8.1.7_A4.js +++ b/test/built-ins/Math/SQRT1_2/S15.8.1.7_A4.js @@ -5,12 +5,12 @@ info: Value Property SQRT1_2 of the Math Object has the attribute ReadOnly es5id: 15.8.1.7_A4 description: Checking if Math.SQRT1_2 property has the attribute ReadOnly -flags: [noStrict] +includes: [propertyHelper.js] ---*/ // CHECK#1 var x = Math.SQRT1_2; -Math.SQRT1_2 = 1; +verifyNotWritable(Math, "SQRT1_2", null, 1); if (Math.SQRT1_2 !== x) { $ERROR('#1: Math.SQRT1_2 hasn\'t ReadOnly: \'x = Math.SQRT1_2;Math.SQRT1_2 = 1;Math.SQRT1_2 === x\''); } diff --git a/test/built-ins/Math/SQRT2/S15.8.1.8_A3.js b/test/built-ins/Math/SQRT2/S15.8.1.8_A3.js index 3ae63684e4..0897581a36 100644 --- a/test/built-ins/Math/SQRT2/S15.8.1.8_A3.js +++ b/test/built-ins/Math/SQRT2/S15.8.1.8_A3.js @@ -5,10 +5,17 @@ info: Value Property SQRT2 of the Math Object has the attribute DontDelete es5id: 15.8.1.8_A3 description: Checking if Math.SQRT2 property has the attribute DontDelete -flags: [noStrict] +includes: [propertyHelper.js] ---*/ +verifyNotConfigurable(Math, "SQRT2"); + // CHECK#1 -if (delete Math.SQRT2 === true) { +try { + if (delete Math.SQRT2 === true) { $ERROR('#1: Value Property SQRT2 of the Math Object hasn\'t attribute DontDelete: \'Math.SQRT2 === true\''); + } +} catch (e) { + if (e instanceof Test262Error) throw e; + assert(e instanceof TypeError); } diff --git a/test/built-ins/Math/SQRT2/S15.8.1.8_A4.js b/test/built-ins/Math/SQRT2/S15.8.1.8_A4.js index f96050f0b2..f318bbf1cb 100644 --- a/test/built-ins/Math/SQRT2/S15.8.1.8_A4.js +++ b/test/built-ins/Math/SQRT2/S15.8.1.8_A4.js @@ -5,12 +5,12 @@ info: Value Property SQRT2 of the Math Object has the attribute ReadOnly es5id: 15.8.1.8_A4 description: Checking if Math.SQRT2 property has the attribute ReadOnly -flags: [noStrict] +includes: [propertyHelper.js] ---*/ // CHECK#1 var x = Math.SQRT2; -Math.SQRT2 = 1; +verifyNotWritable(Math, "SQRT2", null, 1); if (Math.SQRT2 !== x) { $ERROR('#1: Math.SQRT2 hasn\'t ReadOnly: \'x = Math.SQRT2;Math.SQRT2 = 1;Math.SQRT2 === x\''); } diff --git a/test/built-ins/NaN/S15.1.1.1_A2_T1.js b/test/built-ins/NaN/S15.1.1.1_A2_T1.js new file mode 100755 index 0000000000..89fd2b8edf --- /dev/null +++ b/test/built-ins/NaN/S15.1.1.1_A2_T1.js @@ -0,0 +1,15 @@ +// Copyright (C) 2015 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +info: The NaN is ReadOnly +es5id: 15.1.1.1_A2_T1 +description: Checking typeof Functions +includes: [propertyHelper.js, fnGlobalObject.js] +---*/ + +// CHECK#1 +verifyNotWritable(fnGlobalObject(), "NaN", null, true); +if (typeof(NaN) === "boolean") { + $ERROR('#1: NaN = true; typeof(NaN) !== "boolean". Actual: ' + (typeof(NaN))); +} diff --git a/test/built-ins/NaN/S15.1.1.1_A2_T2.js b/test/built-ins/NaN/S15.1.1.1_A2_T2.js new file mode 100755 index 0000000000..e357fbe370 --- /dev/null +++ b/test/built-ins/NaN/S15.1.1.1_A2_T2.js @@ -0,0 +1,15 @@ +// Copyright (C) 2015 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +info: The NaN is ReadOnly +es5id: 15.1.1.1_A2_T2 +description: Checking typeof Functions +flags: [noStrict] +---*/ + +// CHECK#1 +NaN = true; +if (typeof(NaN) === "boolean") { + $ERROR('#1: NaN = true; typeof(NaN) !== "boolean". Actual: ' + (typeof(NaN))); +} diff --git a/test/built-ins/NaN/S15.1.1.1_A3_T1.js b/test/built-ins/NaN/S15.1.1.1_A3_T1.js new file mode 100644 index 0000000000..8be2133578 --- /dev/null +++ b/test/built-ins/NaN/S15.1.1.1_A3_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 NaN is DontDelete +es5id: 15.1.1.2_A3_T1 +description: Use delete +includes: [propertyHelper.js, fnGlobalObject.js] +---*/ + +// CHECK#1 +verifyNotConfigurable(fnGlobalObject(), "NaN"); + +try { + if (delete fnGlobalObject().NaN !== false) { + $ERROR('#1: delete NaN === false.'); + } +} catch (e) { + if (e instanceof Test262Error) throw e; + assert(e instanceof TypeError); +} diff --git a/test/built-ins/NaN/S15.1.1.1_A3.1.js b/test/built-ins/NaN/S15.1.1.1_A3_T2.js old mode 100644 new mode 100755 similarity index 75% rename from test/built-ins/NaN/S15.1.1.1_A3.1.js rename to test/built-ins/NaN/S15.1.1.1_A3_T2.js index bc23c3652e..c9e072c4b4 --- a/test/built-ins/NaN/S15.1.1.1_A3.1.js +++ b/test/built-ins/NaN/S15.1.1.1_A3_T2.js @@ -3,12 +3,12 @@ /*--- info: The NaN is DontDelete -es5id: 15.1.1.1_A3.1 +es5id: 15.1.1.1_A3_T2 description: Use delete flags: [noStrict] ---*/ // CHECK#1 if (delete NaN !== false) { - $ERROR('#1: delete NaN === false. Actual: ' + (delete NaN)); + $ERROR('#1: delete NaN === false. Actual: ' + (delete NaN)); } diff --git a/test/built-ins/NaN/S15.1.1.1_A3.2.js b/test/built-ins/NaN/S15.1.1.1_A4.js similarity index 97% rename from test/built-ins/NaN/S15.1.1.1_A3.2.js rename to test/built-ins/NaN/S15.1.1.1_A4.js index 9148a78eec..797f524381 100644 --- a/test/built-ins/NaN/S15.1.1.1_A3.2.js +++ b/test/built-ins/NaN/S15.1.1.1_A4.js @@ -11,5 +11,5 @@ description: Use for-in statement for (var prop in this) { if (prop === "NaN") { $ERROR('#1: The NaN is DontEnum'); - } + } } diff --git a/test/built-ins/Number/MAX_VALUE/S15.7.3.2_A2.js b/test/built-ins/Number/MAX_VALUE/S15.7.3.2_A2.js index a7031a0abc..64047381ad 100644 --- a/test/built-ins/Number/MAX_VALUE/S15.7.3.2_A2.js +++ b/test/built-ins/Number/MAX_VALUE/S15.7.3.2_A2.js @@ -5,12 +5,12 @@ info: Number.MAX_VALUE is ReadOnly es5id: 15.7.3.2_A2 description: Checking if varying Number.MAX_VALUE fails -flags: [noStrict] +includes: [propertyHelper.js] ---*/ // CHECK#1 var x = Number.MAX_VALUE; -Number.MAX_VALUE = 1; +verifyNotWritable(Number, "MAX_VALUE", null, 1); if (Number.MAX_VALUE !== x) { $ERROR('#1: x = Number.MAX_VALUE; Number.MAX_VALUE = 1; Number.MAX_VALUE === x'); } diff --git a/test/built-ins/Number/MAX_VALUE/S15.7.3.2_A3.js b/test/built-ins/Number/MAX_VALUE/S15.7.3.2_A3.js index 60e661fc2c..ff5361257e 100644 --- a/test/built-ins/Number/MAX_VALUE/S15.7.3.2_A3.js +++ b/test/built-ins/Number/MAX_VALUE/S15.7.3.2_A3.js @@ -5,10 +5,17 @@ info: Number.MAX_VALUE is DontDelete es5id: 15.7.3.2_A3 description: Checking if deleting Number.MAX_VALUE fails -flags: [noStrict] +includes: [propertyHelper.js] ---*/ +verifyNotConfigurable(Number, "MAX_VALUE"); + // CHECK#1 -if (delete Number.MAX_VALUE !== false) { - $ERROR('#1: delete Number.MAX_VALUE === false'); +try { + if (delete Number.MAX_VALUE !== false) { + $ERROR('#1: delete Number.MAX_VALUE === false'); + } +} catch (e) { + if (e instanceof Test262Error) throw e; + assert(e instanceof TypeError); } diff --git a/test/built-ins/Number/MIN_VALUE/S15.7.3.3_A2.js b/test/built-ins/Number/MIN_VALUE/S15.7.3.3_A2.js index d3bebcd958..c8ae5b4411 100644 --- a/test/built-ins/Number/MIN_VALUE/S15.7.3.3_A2.js +++ b/test/built-ins/Number/MIN_VALUE/S15.7.3.3_A2.js @@ -5,12 +5,12 @@ info: Number.MIN_VALUE is ReadOnly es5id: 15.7.3.3_A2 description: Checking if varying Number.MIN_VALUE fails -flags: [noStrict] +includes: [propertyHelper.js] ---*/ // CHECK#1 var x = Number.MIN_VALUE; -Number.MIN_VALUE = 1; +verifyNotWritable(Number, "MIN_VALUE", null, 1); if (Number.MIN_VALUE !== x) { $ERROR('#1: x = Number.MIN_VALUE; Number.MIN_VALUE = 1; Number.MIN_VALUE === x'); } diff --git a/test/built-ins/Number/MIN_VALUE/S15.7.3.3_A3.js b/test/built-ins/Number/MIN_VALUE/S15.7.3.3_A3.js index 9faa7b0267..474bfd29e9 100644 --- a/test/built-ins/Number/MIN_VALUE/S15.7.3.3_A3.js +++ b/test/built-ins/Number/MIN_VALUE/S15.7.3.3_A3.js @@ -5,10 +5,17 @@ info: Number.MIN_VALUE is DontDelete es5id: 15.7.3.3_A3 description: Checking if deleting Number.MIN_VALUE fails -flags: [noStrict] +includes: [propertyHelper.js] ---*/ +verifyNotConfigurable(Number, "MIN_VALUE"); + //CHECK#1 -if (delete Number.MIN_VALUE !== false) { - $ERROR('#1: delete Number.MIN_VALUE === false'); +try { + if (delete Number.MIN_VALUE !== false) { + $ERROR('#1: delete Number.MIN_VALUE === false'); + } +} catch (e) { + if (e instanceof Test262Error) throw e; + assert(e instanceof TypeError); } diff --git a/test/built-ins/Number/NEGATIVE_INFINITY/S15.7.3.5_A2.js b/test/built-ins/Number/NEGATIVE_INFINITY/S15.7.3.5_A2.js index 370fdbbdfb..2136e588d4 100644 --- a/test/built-ins/Number/NEGATIVE_INFINITY/S15.7.3.5_A2.js +++ b/test/built-ins/Number/NEGATIVE_INFINITY/S15.7.3.5_A2.js @@ -5,11 +5,11 @@ info: Number.NEGATIVE_INFINITY is ReadOnly es5id: 15.7.3.5_A2 description: Checking if varying Number.NEGATIVE_INFINITY fails -flags: [noStrict] +includes: [propertyHelper.js] ---*/ // CHECK#1 -Number.NEGATIVE_INFINITY = 1; +verifyNotWritable(Number, "NEGATIVE_INFINITY", null, 1); if (isFinite(Number.NEGATIVE_INFINITY)) { $ERROR('#1: Number.NEGATIVE_INFINITY = 1; Number.NEGATIVE_INFINITY === -Infinity'); } else { diff --git a/test/built-ins/Number/NEGATIVE_INFINITY/S15.7.3.5_A3.js b/test/built-ins/Number/NEGATIVE_INFINITY/S15.7.3.5_A3.js index 2b19951747..c0f9c501e4 100644 --- a/test/built-ins/Number/NEGATIVE_INFINITY/S15.7.3.5_A3.js +++ b/test/built-ins/Number/NEGATIVE_INFINITY/S15.7.3.5_A3.js @@ -5,10 +5,17 @@ info: Number.NEGATIVE_INFINITY is DontDelete es5id: 15.7.3.5_A3 description: Checking if deleting Number.NEGATIVE_INFINITY fails -flags: [noStrict] +includes: [propertyHelper.js] ---*/ +verifyNotConfigurable(Number, "NEGATIVE_INFINITY"); + // CHECK#1 -if (delete Number.NEGATIVE_INFINITY !== false) { - $ERROR('#1: delete Number.NEGATIVE_INFINITY === false'); +try { + if (delete Number.NEGATIVE_INFINITY !== false) { + $ERROR('#1: delete Number.NEGATIVE_INFINITY === false'); + } +} catch (e) { + if (e instanceof Test262Error) throw e; + assert(e instanceof TypeError); } diff --git a/test/built-ins/Number/NaN/S15.7.3.4_A2.js b/test/built-ins/Number/NaN/S15.7.3.4_A2.js index 00dd3f80f8..751913d202 100644 --- a/test/built-ins/Number/NaN/S15.7.3.4_A2.js +++ b/test/built-ins/Number/NaN/S15.7.3.4_A2.js @@ -5,11 +5,11 @@ info: Number.NaN is ReadOnly es5id: 15.7.3.4_A2 description: Checking if varying Number.NaN fails -flags: [noStrict] +includes: [propertyHelper.js] ---*/ // CHECK#1 -Number.NaN = 1; +verifyNotWritable(Number, "NaN", null, 1); if (isNaN(Number.NaN) !== true) { $ERROR('#1: Number.NaN = 1; Number.NaN === Not-a-Number'); } diff --git a/test/built-ins/Number/NaN/S15.7.3.4_A3.js b/test/built-ins/Number/NaN/S15.7.3.4_A3.js index cfa2233237..667cd76474 100644 --- a/test/built-ins/Number/NaN/S15.7.3.4_A3.js +++ b/test/built-ins/Number/NaN/S15.7.3.4_A3.js @@ -5,10 +5,17 @@ info: Number.NaN is DontDelete es5id: 15.7.3.4_A3 description: Checking if deleting Number.NaN fails -flags: [noStrict] +includes: [propertyHelper.js] ---*/ +verifyNotConfigurable(Number, "NaN"); + // CHECK#1 -if (delete Number.NaN !== false) { - $ERROR('#1: delete Number.NaN === false'); +try { + if (delete Number.NaN !== false) { + $ERROR('#1: delete Number.NaN === false'); + } +} catch (e) { + if (e instanceof Test262Error) throw e; + assert(e instanceof TypeError); } diff --git a/test/built-ins/Number/POSITIVE_INFINITY/S15.7.3.6_A2.js b/test/built-ins/Number/POSITIVE_INFINITY/S15.7.3.6_A2.js index a2431db0e1..f13ec952da 100644 --- a/test/built-ins/Number/POSITIVE_INFINITY/S15.7.3.6_A2.js +++ b/test/built-ins/Number/POSITIVE_INFINITY/S15.7.3.6_A2.js @@ -5,11 +5,11 @@ info: Number.POSITIVE_INFINITY is ReadOnly es5id: 15.7.3.6_A2 description: Checking if varying Number.POSITIVE_INFINITY fails -flags: [noStrict] +includes: [propertyHelper.js] ---*/ // CHECK#1 -Number.POSITIVE_INFINITY = 1; +verifyNotWritable(Number, "POSITIVE_INFINITY", null, 1); if (isFinite(Number.POSITIVE_INFINITY)) { $ERROR('#1: Number.POSITIVE_INFINITY = 1; Number.POSITIVE_INFINITY === +Infinity'); } else { diff --git a/test/built-ins/Number/POSITIVE_INFINITY/S15.7.3.6_A3.js b/test/built-ins/Number/POSITIVE_INFINITY/S15.7.3.6_A3.js index ddebfce0a5..4e893ea2ac 100644 --- a/test/built-ins/Number/POSITIVE_INFINITY/S15.7.3.6_A3.js +++ b/test/built-ins/Number/POSITIVE_INFINITY/S15.7.3.6_A3.js @@ -5,10 +5,17 @@ info: Number.POSITIVE_INFINITY is DontDelete es5id: 15.7.3.6_A3 description: Checking if deleting Number.POSITIVE_INFINITY fails -flags: [noStrict] +includes: [propertyHelper.js] ---*/ +verifyNotConfigurable(Number, "POSITIVE_INFINITY"); + // CHECK#1 -if (delete Number.POSITIVE_INFINITY !== false) { - $ERROR('#1: delete Number.POSITIVE_INFINITY === false'); +try { + if (delete Number.POSITIVE_INFINITY !== false) { + $ERROR('#1: delete Number.POSITIVE_INFINITY === false'); + } +} catch (e) { + if (e instanceof Test262Error) throw e; + assert(e instanceof TypeError); } diff --git a/test/built-ins/Number/prototype/S15.7.3.1_A1_T1.js b/test/built-ins/Number/prototype/S15.7.3.1_A1_T1.js index 8e59e1fc73..bb585b229c 100644 --- a/test/built-ins/Number/prototype/S15.7.3.1_A1_T1.js +++ b/test/built-ins/Number/prototype/S15.7.3.1_A1_T1.js @@ -7,12 +7,12 @@ info: > attributes es5id: 15.7.3.1_A1_T1 description: Checking if varying the Number.prototype property fails -flags: [noStrict] +includes: [propertyHelper.js] ---*/ //CHECK#1 var x = Number.prototype; -Number.prototype = 1; +verifyNotWritable(Number, "prototype", null, 1); if (Number.prototype !== x) { $ERROR('#1: The Number.prototype property has the attributes ReadOnly'); } diff --git a/test/built-ins/Number/prototype/S15.7.3.1_A1_T2.js b/test/built-ins/Number/prototype/S15.7.3.1_A1_T2.js index 973cc0046d..63705263d8 100644 --- a/test/built-ins/Number/prototype/S15.7.3.1_A1_T2.js +++ b/test/built-ins/Number/prototype/S15.7.3.1_A1_T2.js @@ -7,13 +7,19 @@ info: > attributes es5id: 15.7.3.1_A1_T2 description: Checking if deleting the Number.prototype property fails -flags: [noStrict] -includes: [$FAIL.js] +includes: [$FAIL.js, propertyHelper.js] ---*/ +verifyNotConfigurable(Number, "prototype"); + // CHECK#1 -if (delete Number.prototype !== false) { - $ERROR('#1: The Number.prototype property has the attributes DontDelete'); +try { + if (delete Number.prototype !== false) { + $ERROR('#1: The Number.prototype property has the attributes DontDelete'); + } +} catch (e) { + if (e instanceof Test262Error) throw e; + assert(e instanceof TypeError); } if (!Number.hasOwnProperty('prototype')) { diff --git a/test/built-ins/Object/defineProperty/symbol-data-property-configurable-strict.js b/test/built-ins/Object/defineProperty/symbol-data-property-configurable-strict.js deleted file mode 100644 index 4e8be2295c..0000000000 --- a/test/built-ins/Object/defineProperty/symbol-data-property-configurable-strict.js +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (C) Copyright 2013 the V8 project authors. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. -/*--- -es6id: 19.1.2.4 -description: > - Symbol used as property for configurable data property definition -flags: [onlyStrict] ----*/ -var sym = Symbol(); -var obj = {}; - - -Object.defineProperty(obj, sym, { - value: 1, - configurable: true -}); - -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`" -); - -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, - "`Object.prototype.propertyIsEnumerable.call(obj, sym)` returns `false`" -); - -assert.sameValue(delete obj[sym], true, "The result of `delete obj[sym]` is `true`"); - -assert.sameValue( - Object.getOwnPropertyDescriptor(obj, sym), - undefined, - "`Object.getOwnPropertyDescriptor(obj, sym)` returns `undefined`" -); diff --git a/test/built-ins/Object/defineProperty/symbol-data-property-configurable-non-strict.js b/test/built-ins/Object/defineProperty/symbol-data-property-configurable.js similarity index 98% rename from test/built-ins/Object/defineProperty/symbol-data-property-configurable-non-strict.js rename to test/built-ins/Object/defineProperty/symbol-data-property-configurable.js index 622f6787c6..cac26a7335 100644 --- a/test/built-ins/Object/defineProperty/symbol-data-property-configurable-non-strict.js +++ b/test/built-ins/Object/defineProperty/symbol-data-property-configurable.js @@ -4,7 +4,6 @@ es6id: 19.1.2.4 description: > Symbol used as property for configurable data property definition -flags: [noStrict] ---*/ var sym = Symbol(); var obj = {}; diff --git a/test/built-ins/Object/defineProperty/symbol-data-property-writable-strict.js b/test/built-ins/Object/defineProperty/symbol-data-property-writable-strict.js deleted file mode 100644 index d76388ad62..0000000000 --- a/test/built-ins/Object/defineProperty/symbol-data-property-writable-strict.js +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (C) Copyright 2013 the V8 project authors. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. -/*--- -es6id: 19.1.2.4 -description: > - Symbol used as property for writable data property definition -flags: [onlyStrict] ----*/ -var sym = Symbol(); -var obj = {}; - - -Object.defineProperty(obj, sym, { - value: 1, - writable: true -}); - -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`" -); - -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, - "`Object.prototype.propertyIsEnumerable.call(obj, sym)` returns `false`" -); - -obj[sym] = 2; - -assert.sameValue(obj[sym], 2, "The value of `obj[sym]` is `2`"); diff --git a/test/built-ins/Object/defineProperty/symbol-data-property-writable-non-strict.js b/test/built-ins/Object/defineProperty/symbol-data-property-writable.js similarity index 98% rename from test/built-ins/Object/defineProperty/symbol-data-property-writable-non-strict.js rename to test/built-ins/Object/defineProperty/symbol-data-property-writable.js index 5156206a65..69357f0c55 100644 --- a/test/built-ins/Object/defineProperty/symbol-data-property-writable-non-strict.js +++ b/test/built-ins/Object/defineProperty/symbol-data-property-writable.js @@ -4,7 +4,6 @@ es6id: 19.1.2.4 description: > Symbol used as property for writable data property definition -flags: [noStrict] ---*/ var sym = Symbol(); var obj = {}; diff --git a/test/built-ins/Object/prototype/S15.2.3.1_A1.js b/test/built-ins/Object/prototype/S15.2.3.1_A1.js index 21192d1077..44b0ea6e6b 100644 --- a/test/built-ins/Object/prototype/S15.2.3.1_A1.js +++ b/test/built-ins/Object/prototype/S15.2.3.1_A1.js @@ -5,11 +5,11 @@ info: The Object.prototype property has the attribute ReadOnly es5id: 15.2.3.1_A1 description: Checking if varying "Object.prototype" property fails -flags: [noStrict] +includes: [propertyHelper.js] ---*/ var obj = Object.prototype; -Object.prototype = function(){return "shifted";}; +verifyNotWritable(Object, "prototype", null, function(){return "shifted";}); //CHECK#1 if (Object.prototype !== obj) { @@ -21,5 +21,5 @@ try { Object.prototype(); $ERROR('#2: the Object.prototype property has the attributes ReadOnly'); } catch (e) { - ; + if (e instanceof Test262Error) throw e; } diff --git a/test/built-ins/Object/prototype/S15.2.3.1_A3.js b/test/built-ins/Object/prototype/S15.2.3.1_A3.js index e069f594e3..5b7c6e5eab 100644 --- a/test/built-ins/Object/prototype/S15.2.3.1_A3.js +++ b/test/built-ins/Object/prototype/S15.2.3.1_A3.js @@ -4,10 +4,20 @@ /*--- es5id: 15.2.3.1_A3 description: Checking if deleting "Object.prototype" property fails; -flags: [noStrict] +includes: [propertyHelper.js] ---*/ -delete Object.prototype; +verifyNotConfigurable(Object, "prototype"); + +//CHECK#1 +try { + if((delete Object.prototype) !== false){ + $ERROR('#1: Object.prototype has the attribute DontDelete'); + } +} catch (e) { + if (e instanceof Test262Error) throw e; + assert(e instanceof TypeError); +} //CHECK#2 if (!(Object.hasOwnProperty('prototype'))) { diff --git a/test/built-ins/Object/prototype/hasOwnProperty/S15.2.4.5_A10.js b/test/built-ins/Object/prototype/hasOwnProperty/S15.2.4.5_A10.js index 9076d9ae95..5a190b8cb5 100644 --- a/test/built-ins/Object/prototype/hasOwnProperty/S15.2.4.5_A10.js +++ b/test/built-ins/Object/prototype/hasOwnProperty/S15.2.4.5_A10.js @@ -9,8 +9,7 @@ es5id: 15.2.4.5_A10 description: > Checking if varying the Object.prototype.hasOwnProperty.length property fails -flags: [noStrict] -includes: [$FAIL.js] +includes: [$FAIL.js, propertyHelper.js] ---*/ //CHECK#1 @@ -20,7 +19,7 @@ if (!(Object.prototype.hasOwnProperty.hasOwnProperty('length'))) { var obj = Object.prototype.hasOwnProperty.length; -Object.prototype.hasOwnProperty.length = function(){return "shifted";}; +verifyNotWritable(Object.prototype.hasOwnProperty, "length", null, function(){return "shifted";}); //CHECK#2 if (Object.prototype.hasOwnProperty.length !== obj) { diff --git a/test/built-ins/Object/prototype/isPrototypeOf/S15.2.4.6_A10.js b/test/built-ins/Object/prototype/isPrototypeOf/S15.2.4.6_A10.js index 6ace571c50..466a70a697 100644 --- a/test/built-ins/Object/prototype/isPrototypeOf/S15.2.4.6_A10.js +++ b/test/built-ins/Object/prototype/isPrototypeOf/S15.2.4.6_A10.js @@ -9,8 +9,7 @@ es5id: 15.2.4.6_A10 description: > Checking if varying the Object.prototype.isPrototypeOf.length property fails -flags: [noStrict] -includes: [$FAIL.js] +includes: [$FAIL.js, propertyHelper.js] ---*/ //CHECK#1 @@ -20,7 +19,7 @@ if (!(Object.prototype.isPrototypeOf.hasOwnProperty('length'))) { var obj = Object.prototype.isPrototypeOf.length; -Object.prototype.isPrototypeOf.length = function(){return "shifted";}; +verifyNotWritable(Object.prototype.isPrototypeOf, "length", null, function(){return "shifted";}); //CHECK#2 if (Object.prototype.isPrototypeOf.length !== obj) { diff --git a/test/built-ins/Object/prototype/propertyIsEnumerable/S15.2.4.7_A10.js b/test/built-ins/Object/prototype/propertyIsEnumerable/S15.2.4.7_A10.js index 876a17131f..4aa9a16b65 100644 --- a/test/built-ins/Object/prototype/propertyIsEnumerable/S15.2.4.7_A10.js +++ b/test/built-ins/Object/prototype/propertyIsEnumerable/S15.2.4.7_A10.js @@ -9,8 +9,7 @@ es5id: 15.2.4.7_A10 description: > Checking if varying the Object.prototype.propertyIsEnumerable.length property fails -flags: [noStrict] -includes: [$FAIL.js] +includes: [$FAIL.js, propertyHelper.js] ---*/ //CHECK#1 @@ -20,7 +19,7 @@ if (!(Object.prototype.propertyIsEnumerable.hasOwnProperty('length'))) { var obj = Object.prototype.propertyIsEnumerable.length; -Object.prototype.propertyIsEnumerable.length = function(){return "shifted";}; +verifyNotWritable(Object.prototype.propertyIsEnumerable, "length", null, function(){return "shifted";}); //CHECK#2 if (Object.prototype.propertyIsEnumerable.length !== obj) { diff --git a/test/built-ins/Object/prototype/toLocaleString/S15.2.4.3_A10.js b/test/built-ins/Object/prototype/toLocaleString/S15.2.4.3_A10.js index c71880656a..f77571101e 100644 --- a/test/built-ins/Object/prototype/toLocaleString/S15.2.4.3_A10.js +++ b/test/built-ins/Object/prototype/toLocaleString/S15.2.4.3_A10.js @@ -9,8 +9,7 @@ es5id: 15.2.4.3_A10 description: > Checking if varying the Object.prototype.toLocaleString.length property fails -flags: [noStrict] -includes: [$FAIL.js] +includes: [$FAIL.js, propertyHelper.js] ---*/ //CHECK#1 @@ -20,7 +19,7 @@ if (!(Object.prototype.toLocaleString.hasOwnProperty('length'))) { var obj = Object.prototype.toLocaleString.length; -Object.prototype.toLocaleString.length = function(){return "shifted";}; +verifyNotWritable(Object.prototype.toLocaleString, "length", null, function(){return "shifted";}); //CHECK#2 if (Object.prototype.toLocaleString.length !== obj) { diff --git a/test/built-ins/Object/prototype/toString/S15.2.4.2_A10.js b/test/built-ins/Object/prototype/toString/S15.2.4.2_A10.js index a97f7f79da..887915b20e 100644 --- a/test/built-ins/Object/prototype/toString/S15.2.4.2_A10.js +++ b/test/built-ins/Object/prototype/toString/S15.2.4.2_A10.js @@ -7,8 +7,7 @@ es5id: 15.2.4.2_A10 description: > Checking if varying the Object.prototype.toString.length property fails -flags: [noStrict] -includes: [$FAIL.js] +includes: [$FAIL.js, propertyHelper.js] ---*/ //CHECK#1 @@ -18,7 +17,7 @@ if (!(Object.prototype.toString.hasOwnProperty('length'))) { var obj = Object.prototype.toString.length; -Object.prototype.toString.length = function(){return "shifted";}; +verifyNotWritable(Object.prototype.toString, "length", null, function(){return "shifted";}); //CHECK#2 if (Object.prototype.toString.length !== obj) { diff --git a/test/built-ins/Object/prototype/valueOf/S15.2.4.4_A10.js b/test/built-ins/Object/prototype/valueOf/S15.2.4.4_A10.js index 878ecf265e..734343a08c 100644 --- a/test/built-ins/Object/prototype/valueOf/S15.2.4.4_A10.js +++ b/test/built-ins/Object/prototype/valueOf/S15.2.4.4_A10.js @@ -7,8 +7,7 @@ es5id: 15.2.4.4_A10 description: > Checking if varying the Object.prototype.valueOf.length property fails -flags: [noStrict] -includes: [$FAIL.js] +includes: [$FAIL.js, propertyHelper.js] ---*/ //CHECK#1 @@ -18,7 +17,7 @@ if (!(Object.prototype.valueOf.hasOwnProperty('length'))) { var obj = Object.prototype.valueOf.length; -Object.prototype.valueOf.length = function(){return "shifted";}; +verifyNotWritable(Object.prototype.valueOf, "length", null, function(){return "shifted";}); //CHECK#2 if (Object.prototype.valueOf.length !== obj) { diff --git a/test/built-ins/RegExp/prototype/S15.10.5.1_A3.js b/test/built-ins/RegExp/prototype/S15.10.5.1_A3.js index 8a0d8eee75..55b48d98bb 100644 --- a/test/built-ins/RegExp/prototype/S15.10.5.1_A3.js +++ b/test/built-ins/RegExp/prototype/S15.10.5.1_A3.js @@ -5,8 +5,7 @@ info: The RegExp.prototype property has the attribute DontDelete es5id: 15.10.5.1_A3 description: Checking if deleting the RegExp.prototype property fails -flags: [noStrict] -includes: [$FAIL.js] +includes: [$FAIL.js, propertyHelper.js] ---*/ //CHECK#0 @@ -14,9 +13,16 @@ if (RegExp.hasOwnProperty('prototype') !== true) { $FAIL('#0: RegExp.hasOwnProperty(\'prototype\') === true'); } +verifyNotConfigurable(RegExp, "prototype"); + //CHECK#1 -if (delete RegExp.prototype !== false) { - $ERROR('#1: delete RegExp.prototype === false'); +try { + if (delete RegExp.prototype !== false) { + $ERROR('#1: delete RegExp.prototype === false'); + } +} catch (e) { + if (e instanceof Test262Error) throw e; + assert(e instanceof TypeError); } //CHECK#2 diff --git a/test/built-ins/RegExp/prototype/S15.10.5.1_A4.js b/test/built-ins/RegExp/prototype/S15.10.5.1_A4.js index 3843e0a24b..db97e911b0 100644 --- a/test/built-ins/RegExp/prototype/S15.10.5.1_A4.js +++ b/test/built-ins/RegExp/prototype/S15.10.5.1_A4.js @@ -5,8 +5,7 @@ info: The RegExp.prototype property has the attribute ReadOnly es5id: 15.10.5.1_A4 description: Checking if varying the RegExp.prototype property fails -flags: [noStrict] -includes: [$FAIL.js] +includes: [$FAIL.js, propertyHelper.js] ---*/ //CHECK#1 @@ -14,9 +13,9 @@ if (RegExp.hasOwnProperty('prototype') !== true) { $FAIL('#1: RegExp.hasOwnProperty(\'prototype\') === true'); } -__obj = RegExp.prototype; +var __obj = RegExp.prototype; -RegExp.prototype = function(){return "shifted";}; +verifyNotWritable(RegExp, "prototype", null, function(){return "shifted";}); //CHECK#2 if (RegExp.prototype !== __obj) { diff --git a/test/built-ins/RegExp/prototype/exec/S15.10.6.2_A10.js b/test/built-ins/RegExp/prototype/exec/S15.10.6.2_A10.js index f68ea5899f..d3ecd4035d 100644 --- a/test/built-ins/RegExp/prototype/exec/S15.10.6.2_A10.js +++ b/test/built-ins/RegExp/prototype/exec/S15.10.6.2_A10.js @@ -5,8 +5,7 @@ info: The RegExp.prototype.exec.length property has the attribute ReadOnly es5id: 15.10.6.2_A10 description: Checking if varying the RegExp.prototype.exec.length property fails -flags: [noStrict] -includes: [$FAIL.js] +includes: [$FAIL.js, propertyHelper.js] ---*/ //CHECK#1 @@ -14,9 +13,9 @@ if (RegExp.prototype.exec.hasOwnProperty('length') !== true) { $FAIL('#1: RegExp.prototype.exec.hasOwnProperty(\'length\') === true'); } -__obj = RegExp.prototype.exec.length; +var __obj = RegExp.prototype.exec.length; -RegExp.prototype.exec.length = function(){return "shifted";}; +verifyNotWritable(RegExp.prototype.exec, "length", null, function(){return "shifted";}); //CHECK#2 if (RegExp.prototype.exec.length !== __obj) { diff --git a/test/built-ins/RegExp/prototype/global/S15.10.7.2_A10.js b/test/built-ins/RegExp/prototype/global/S15.10.7.2_A10.js index 73c4ff5263..c7e605d489 100644 --- a/test/built-ins/RegExp/prototype/global/S15.10.7.2_A10.js +++ b/test/built-ins/RegExp/prototype/global/S15.10.7.2_A10.js @@ -5,21 +5,20 @@ info: The RegExp.prototype global property does not have a set accessor es5id: 15.10.7.2_A10 description: Checking if varying the global property fails -flags: [noStrict] -includes: [$FAIL.js] +includes: [$FAIL.js, propertyHelper.js] ---*/ -__re = RegExp.prototype; +var __re = RegExp.prototype; //CHECK#1 if (__re.hasOwnProperty('global') !== true) { $FAIL('#1: __re = RegExp.prototype; __re.hasOwnProperty(\'global\') === true'); } -__sample = /^|^/; -__obj = __sample.global; +var __sample = /^|^/; +var __obj = __sample.global; -__sample.global = "shifted"; +verifyNotWritable(__sample, "global", "global", "shifted"); //CHECK#2 if (__sample.global !== __obj) { diff --git a/test/built-ins/RegExp/prototype/ignoreCase/S15.10.7.3_A10.js b/test/built-ins/RegExp/prototype/ignoreCase/S15.10.7.3_A10.js index 20a02aca15..923032369d 100644 --- a/test/built-ins/RegExp/prototype/ignoreCase/S15.10.7.3_A10.js +++ b/test/built-ins/RegExp/prototype/ignoreCase/S15.10.7.3_A10.js @@ -5,21 +5,20 @@ info: The RegExp.prototype ignoreCase property does not have a set accessor es5id: 15.10.7.3_A10 description: Checking if varying the ignoreCase property fails -flags: [noStrict] -includes: [$FAIL.js] +includes: [$FAIL.js, propertyHelper.js] ---*/ -__re = RegExp.prototype; +var __re = RegExp.prototype; //CHECK#1 if (__re.hasOwnProperty('ignoreCase') !== true) { $FAIL('#1: __re = RegExp.prototype; __re.hasOwnProperty(\'ignoreCase\') === true'); } -__sample = /a|b|c/; -__obj = __sample.ignoreCase; +var __sample = /a|b|c/; +var __obj = __sample.ignoreCase; -__sample.ignoreCase = "shifted"; +verifyNotWritable(__sample, "ignoreCase", "ignoreCase", "shifted"); //CHECK#2 if (__sample.ignoreCase !== __obj) { diff --git a/test/built-ins/RegExp/prototype/lastIndex/S15.10.7.5_A9.js b/test/built-ins/RegExp/prototype/lastIndex/S15.10.7.5_A9.js index abdf5d21c0..fcd56a21de 100644 --- a/test/built-ins/RegExp/prototype/lastIndex/S15.10.7.5_A9.js +++ b/test/built-ins/RegExp/prototype/lastIndex/S15.10.7.5_A9.js @@ -5,20 +5,26 @@ info: The RegExp instance lastIndex property has the attribute DontDelete es5id: 15.10.7.5_A9 description: Checking if deleting the lastIndex property fails -flags: [noStrict] -includes: [$FAIL.js] +includes: [$FAIL.js, propertyHelper.js] ---*/ -__re = new RegExp; +var __re = new RegExp; //CHECK#0 if (__re.hasOwnProperty('lastIndex') !== true) { $FAIL('#0: __re = new RegExp; __re.hasOwnProperty(\'lastIndex\') === true'); } +verifyNotConfigurable(__re, "lastIndex"); + //CHECK#1 -if ((delete __re.lastIndex) !== false) { - $ERROR('#1: __re = new RegExp; (delete __re.lastIndex) === false'); +try { + if ((delete __re.lastIndex) !== false) { + $ERROR('#1: __re = new RegExp; (delete __re.lastIndex) === false'); + } +} catch (e) { + if (e instanceof Test262Error) throw e; + assert(e instanceof TypeError); } //CHECK#2 diff --git a/test/built-ins/RegExp/prototype/multiline/S15.10.7.4_A10.js b/test/built-ins/RegExp/prototype/multiline/S15.10.7.4_A10.js index 179a1303f5..6b6802344a 100644 --- a/test/built-ins/RegExp/prototype/multiline/S15.10.7.4_A10.js +++ b/test/built-ins/RegExp/prototype/multiline/S15.10.7.4_A10.js @@ -5,21 +5,20 @@ info: The RegExp.prototype multiline property does not have a set accessor es5id: 15.10.7.4_A10 description: Checking if varying the multiline property fails -flags: [noStrict] -includes: [$FAIL.js] +includes: [$FAIL.js, propertyHelper.js] ---*/ -__re = RegExp.prototype; +var __re = RegExp.prototype; //CHECK#1 if (__re.hasOwnProperty('multiline') !== true) { $FAIL('#1: __re = RegExp.prototype; __re.hasOwnProperty(\'multiline\') === true'); } -__sample = /\n/; -__obj = __sample.multiline; +var __sample = /\n/; +var __obj = __sample.multiline; -__sample.multiline = "shifted"; +verifyNotWritable(__sample, "multiline", "multiline", "shifted"); //CHECK#2 if (__sample.multiline !== __obj) { diff --git a/test/built-ins/RegExp/prototype/source/S15.10.7.1_A10.js b/test/built-ins/RegExp/prototype/source/S15.10.7.1_A10.js index 08fe7e7961..85e86d5f43 100644 --- a/test/built-ins/RegExp/prototype/source/S15.10.7.1_A10.js +++ b/test/built-ins/RegExp/prototype/source/S15.10.7.1_A10.js @@ -5,21 +5,20 @@ info: The RegExp.prototype source property does not have a set accessor es5id: 15.10.7.1_A10 description: Checking if varying the source property fails -flags: [noStrict] -includes: [$FAIL.js] +includes: [$FAIL.js, propertyHelper.js] ---*/ -__re = RegExp.prototype; +var __re = RegExp.prototype; //CHECK#1 if (__re.hasOwnProperty('source') !== true) { $FAIL('#1: __re = RegExp.prototype; __re.hasOwnProperty(\'source\') === true'); } -__sample = /./; -__obj = __sample.source; +var __sample = /./; +var __obj = __sample.source; -__sample.source = "shifted"; +verifyNotWritable(__sample, "source", "source", "shifted"); //CHECK#2 if (__sample.source !== __obj) { diff --git a/test/built-ins/RegExp/prototype/test/S15.10.6.3_A10.js b/test/built-ins/RegExp/prototype/test/S15.10.6.3_A10.js index 1a0c6bce2a..331a328141 100644 --- a/test/built-ins/RegExp/prototype/test/S15.10.6.3_A10.js +++ b/test/built-ins/RegExp/prototype/test/S15.10.6.3_A10.js @@ -5,8 +5,7 @@ info: The RegExp.prototype.test.length property has the attribute ReadOnly es5id: 15.10.6.3_A10 description: Checking if varying the RegExp.prototype.test.length property fails -flags: [noStrict] -includes: [$FAIL.js] +includes: [$FAIL.js, propertyHelper.js] ---*/ //CHECK#1 @@ -14,9 +13,9 @@ if (RegExp.prototype.test.hasOwnProperty('length') !== true) { $FAIL('#1: RegExp.prototype.test.hasOwnProperty(\'length\') === true'); } -__obj = RegExp.prototype.test.length; +var __obj = RegExp.prototype.test.length; -RegExp.prototype.test.length = function(){return "shifted";}; +verifyNotWritable(RegExp.prototype.test, "length", null, function(){return "shifted";}); //CHECK#2 if (RegExp.prototype.test.length !== __obj) { diff --git a/test/built-ins/RegExp/prototype/toString/S15.10.6.4_A10.js b/test/built-ins/RegExp/prototype/toString/S15.10.6.4_A10.js index b1de97d0d5..ff7e939601 100644 --- a/test/built-ins/RegExp/prototype/toString/S15.10.6.4_A10.js +++ b/test/built-ins/RegExp/prototype/toString/S15.10.6.4_A10.js @@ -7,8 +7,7 @@ es5id: 15.10.6.4_A10 description: > Checking if varying the RegExp.prototype.toString.length property fails -flags: [noStrict] -includes: [$FAIL.js] +includes: [$FAIL.js, propertyHelper.js] ---*/ //CHECK#1 @@ -16,9 +15,9 @@ if (RegExp.prototype.toString.hasOwnProperty('length') !== true) { $FAIL('#1: RegExp.prototype.toString.hasOwnProperty(\'length\') === true'); } -__obj = RegExp.prototype.toString.length; +var __obj = RegExp.prototype.toString.length; -RegExp.prototype.toString.length = function(){return "shifted";}; +verifyNotWritable(RegExp.prototype.toString, "length", null, function(){return "shifted";}); //CHECK#2 if (RegExp.prototype.toString.length !== __obj) { diff --git a/test/built-ins/String/S15.5.5.1_A3.js b/test/built-ins/String/S15.5.5.1_A3.js index 5d550b7d42..8cdd062210 100644 --- a/test/built-ins/String/S15.5.5.1_A3.js +++ b/test/built-ins/String/S15.5.5.1_A3.js @@ -5,7 +5,7 @@ info: length property has the attributes {DontDelete} es5id: 15.5.5.1_A3 description: Checking if deleting the length property of String fails -flags: [noStrict] +includes: [propertyHelper.js] ---*/ var __str__instance = new String("globglob"); @@ -18,10 +18,17 @@ if (!(__str__instance.hasOwnProperty("length"))) { // ////////////////////////////////////////////////////////////////////////////// +verifyNotConfigurable(__str__instance, "length"); + ////////////////////////////////////////////////////////////////////////////// //CHECK#2 -if (delete __str__instance.length === true) { - $ERROR('#2: var __str__instance = new String("globglob"); delete __str__instance.length !== true'); +try { + if (delete __str__instance.length === true) { + $ERROR('#2: var __str__instance = new String("globglob"); delete __str__instance.length !== true'); + } +} catch (e) { + if (e instanceof Test262Error) throw e; + assert(e instanceof TypeError); } // ////////////////////////////////////////////////////////////////////////////// diff --git a/test/built-ins/String/S15.5.5.1_A4.js b/test/built-ins/String/S15.5.5.1_A4_T1.js similarity index 94% rename from test/built-ins/String/S15.5.5.1_A4.js rename to test/built-ins/String/S15.5.5.1_A4_T1.js index 8c17dee481..2df5f77c64 100644 --- a/test/built-ins/String/S15.5.5.1_A4.js +++ b/test/built-ins/String/S15.5.5.1_A4_T1.js @@ -3,7 +3,7 @@ /*--- info: length property has the attributes {ReadOnly} -es5id: 15.5.5.1_A4 +es5id: 15.5.5.1_A4_T1 description: Checking if varying the length property of String fails flags: [noStrict] ---*/ @@ -21,7 +21,7 @@ if (!(__str__instance.hasOwnProperty("length"))) { ////////////////////////////////////////////////////////////////////////////// //CHECK#2 if (__str__instance.length !== 8) { - $ERROR('#2: var __str__instance = new String("globglob"); __str__instance.length === 8. Actual: __str__instance.length ==='+__str__instance.length ); + $ERROR('#2: var __str__instance = new String("globglob"); __str__instance.length === 8. Actual: __str__instance.length ==='+__str__instance.length ); } // ////////////////////////////////////////////////////////////////////////////// @@ -31,18 +31,18 @@ __str__instance.length=-1; ////////////////////////////////////////////////////////////////////////////// //CHECK#3 if (__str__instance.length !== 8) { - $ERROR('#3: var __str__instance = new String("globglob"); __str__instance.length=-1; __str__instance.length === 8(after redefine length property). Actual: __str__instance.length ==='+__str__instance.length ); + $ERROR('#3: var __str__instance = new String("globglob"); __str__instance.length=-1; __str__instance.length === 8(after redefine length property). Actual: __str__instance.length ==='+__str__instance.length ); } // ////////////////////////////////////////////////////////////////////////////// with(__str__instance) length = 0; - + ////////////////////////////////////////////////////////////////////////////// //CHECK#4 if (__str__instance.length !== 8) { - $ERROR('#4: var __str__instance = new String("globglob"); with(__str__instance) length = 0; __str__instance.length === 8(after redefine length property with using "with"). Actual: __str__instance.length ==='+__str__instance.length ); + $ERROR('#4: var __str__instance = new String("globglob"); with(__str__instance) length = 0; __str__instance.length === 8(after redefine length property with using "with"). Actual: __str__instance.length ==='+__str__instance.length ); } // ////////////////////////////////////////////////////////////////////////////// @@ -52,7 +52,7 @@ __str__instance.length++; ////////////////////////////////////////////////////////////////////////////// //CHECK#5 if (__str__instance.length !== 8) { - $ERROR('#5: var __str__instance = new String("globglob"); __str__instance.length++; __str__instance.length === 8(after redefine length property with using "++"). Actual: __str__instance.length ==='+__str__instance.length ); + $ERROR('#5: var __str__instance = new String("globglob"); __str__instance.length++; __str__instance.length === 8(after redefine length property with using "++"). Actual: __str__instance.length ==='+__str__instance.length ); } // ////////////////////////////////////////////////////////////////////////////// diff --git a/test/built-ins/String/S15.5.5.1_A4_T2.js b/test/built-ins/String/S15.5.5.1_A4_T2.js new file mode 100644 index 0000000000..08fb072406 --- /dev/null +++ b/test/built-ins/String/S15.5.5.1_A4_T2.js @@ -0,0 +1,37 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +info: length property has the attributes {ReadOnly} +es5id: 15.5.5.1_A4_T2 +description: Checking if varying the length property of String fails +includes: [propertyHelper.js] +---*/ + +var __str__instance = new String("globglob"); + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (!(__str__instance.hasOwnProperty("length"))) { + $ERROR('#1: var __str__instance = new String("globglob"); __str__instance.hasOwnProperty("length") return true. Actual: '+__str__instance.hasOwnProperty("length")); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#2 +if (__str__instance.length !== 8) { + $ERROR('#2: var __str__instance = new String("globglob"); __str__instance.length === 8. Actual: __str__instance.length ==='+__str__instance.length ); +} +// +////////////////////////////////////////////////////////////////////////////// + +verifyNotWritable(__str__instance, "length", null, -1); + +////////////////////////////////////////////////////////////////////////////// +//CHECK#3 +if (__str__instance.length !== 8) { + $ERROR('#3: var __str__instance = new String("globglob"); __str__instance.length=-1; __str__instance.length === 8(after redefine length property). Actual: __str__instance.length ==='+__str__instance.length ); +} +// +////////////////////////////////////////////////////////////////////////////// diff --git a/test/built-ins/String/prototype/S15.5.3.1_A3.js b/test/built-ins/String/prototype/S15.5.3.1_A3.js index 8ee49875f8..eddfc2e48f 100644 --- a/test/built-ins/String/prototype/S15.5.3.1_A3.js +++ b/test/built-ins/String/prototype/S15.5.3.1_A3.js @@ -5,8 +5,7 @@ info: The String.prototype property has the attribute DontDelete es5id: 15.5.3.1_A3 description: Checking if deleting the String.prototype property fails -flags: [noStrict] -includes: [$FAIL.js] +includes: [$FAIL.js, propertyHelper.js] ---*/ ////////////////////////////////////////////////////////////////////////////// @@ -17,12 +16,25 @@ if (!(String.hasOwnProperty('prototype'))) { // ////////////////////////////////////////////////////////////////////////////// -delete String.prototype; +verifyNotConfigurable(String, "prototype"); ////////////////////////////////////////////////////////////////////////////// //CHECK#2 -if (!(String.hasOwnProperty('prototype'))) { - $ERROR('#2: delete String.prototype; String.hasOwnProperty(\'prototype\') return true. Actual: '+String.hasOwnProperty('prototype')); +try { + if ((delete String.prototype) !== false) { + $ERROR('#2: String.prototype has the attribute DontDelete'); + } +} catch (e) { + if (e instanceof Test262Error) throw e; + assert(e instanceof TypeError); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#3 +if (!(String.hasOwnProperty('prototype'))) { + $ERROR('#3: delete String.prototype; String.hasOwnProperty(\'prototype\') return true. Actual: '+String.hasOwnProperty('prototype')); } // ////////////////////////////////////////////////////////////////////////////// diff --git a/test/built-ins/String/prototype/S15.5.3.1_A4.js b/test/built-ins/String/prototype/S15.5.3.1_A4.js index 71eb71d235..fb570b9415 100644 --- a/test/built-ins/String/prototype/S15.5.3.1_A4.js +++ b/test/built-ins/String/prototype/S15.5.3.1_A4.js @@ -5,8 +5,7 @@ info: The String.prototype property has the attribute ReadOnly es5id: 15.5.3.1_A4 description: Checking if varying the String.prototype property fails -flags: [noStrict] -includes: [$FAIL.js] +includes: [$FAIL.js, propertyHelper.js] ---*/ ////////////////////////////////////////////////////////////////////////////// @@ -19,7 +18,7 @@ if (!(String.hasOwnProperty('prototype'))) { var __obj = String.prototype; -String.prototype = function(){return "shifted";}; +verifyNotWritable(String, "prototype", null, function(){return "shifted";}); ////////////////////////////////////////////////////////////////////////////// //CHECK#2 diff --git a/test/built-ins/String/prototype/charAt/S15.5.4.4_A10.js b/test/built-ins/String/prototype/charAt/S15.5.4.4_A10.js index c07d01b269..ad3379461d 100644 --- a/test/built-ins/String/prototype/charAt/S15.5.4.4_A10.js +++ b/test/built-ins/String/prototype/charAt/S15.5.4.4_A10.js @@ -7,7 +7,7 @@ es5id: 15.5.4.4_A10 description: > Checking if varying the String.prototype.charAt.length property fails -flags: [noStrict] +includes: [propertyHelper.js] ---*/ ////////////////////////////////////////////////////////////////////////////// @@ -20,7 +20,7 @@ if (!(String.prototype.charAt.hasOwnProperty('length'))) { var __obj = String.prototype.charAt.length; -String.prototype.charAt.length = function(){return "shifted";}; +verifyNotWritable(String.prototype.charAt, "length", null, function(){return "shifted";}); ////////////////////////////////////////////////////////////////////////////// //CHECK#2 diff --git a/test/built-ins/String/prototype/charCodeAt/S15.5.4.5_A10.js b/test/built-ins/String/prototype/charCodeAt/S15.5.4.5_A10.js index 5f4e556f68..a22bf9d0e9 100644 --- a/test/built-ins/String/prototype/charCodeAt/S15.5.4.5_A10.js +++ b/test/built-ins/String/prototype/charCodeAt/S15.5.4.5_A10.js @@ -7,7 +7,7 @@ es5id: 15.5.4.5_A10 description: > Checking if varying the String.prototype.charCodeAt.length property fails -flags: [noStrict] +includes: [propertyHelper.js] ---*/ ////////////////////////////////////////////////////////////////////////////// @@ -20,7 +20,7 @@ if (!(String.prototype.charCodeAt.hasOwnProperty('length'))) { var __obj = String.prototype.charCodeAt.length; -String.prototype.charCodeAt.length = function(){return "shifted";}; +verifyNotWritable(String.prototype.charCodeAt, "length", null, function(){return "shifted";}); ////////////////////////////////////////////////////////////////////////////// //CHECK#2 diff --git a/test/built-ins/String/prototype/concat/S15.5.4.6_A10.js b/test/built-ins/String/prototype/concat/S15.5.4.6_A10.js index 1a4e14cc56..00258a5e57 100644 --- a/test/built-ins/String/prototype/concat/S15.5.4.6_A10.js +++ b/test/built-ins/String/prototype/concat/S15.5.4.6_A10.js @@ -7,7 +7,7 @@ es5id: 15.5.4.6_A10 description: > Checking if varying the String.prototype.concat.length property fails -flags: [noStrict] +includes: [propertyHelper.js] ---*/ ////////////////////////////////////////////////////////////////////////////// @@ -20,7 +20,7 @@ if (!(String.prototype.concat.hasOwnProperty('length'))) { var __obj = String.prototype.concat.length; -String.prototype.concat.length = function(){return "shifted";}; +verifyNotWritable(String.prototype.concat, "length", null, function(){return "shifted";}); ////////////////////////////////////////////////////////////////////////////// //CHECK#2 diff --git a/test/built-ins/String/prototype/indexOf/S15.5.4.7_A10.js b/test/built-ins/String/prototype/indexOf/S15.5.4.7_A10.js index 51faa063c5..e9f6ceed19 100644 --- a/test/built-ins/String/prototype/indexOf/S15.5.4.7_A10.js +++ b/test/built-ins/String/prototype/indexOf/S15.5.4.7_A10.js @@ -7,8 +7,7 @@ es5id: 15.5.4.7_A10 description: > Checking if varying the String.prototype.indexOf.length property fails -flags: [noStrict] -includes: [$FAIL.js] +includes: [$FAIL.js, propertyHelper.js] ---*/ ////////////////////////////////////////////////////////////////////////////// @@ -21,7 +20,7 @@ if (!(String.prototype.indexOf.hasOwnProperty('length'))) { var __obj = String.prototype.indexOf.length; -String.prototype.indexOf.length = function(){return "shifted";}; +verifyNotWritable(String.prototype.indexOf, "length", null, function(){return "shifted";}); ////////////////////////////////////////////////////////////////////////////// //CHECK#2 diff --git a/test/built-ins/String/prototype/lastIndexOf/S15.5.4.8_A10.js b/test/built-ins/String/prototype/lastIndexOf/S15.5.4.8_A10.js index 538f8f6b67..3a59f0f6cd 100644 --- a/test/built-ins/String/prototype/lastIndexOf/S15.5.4.8_A10.js +++ b/test/built-ins/String/prototype/lastIndexOf/S15.5.4.8_A10.js @@ -9,8 +9,7 @@ es5id: 15.5.4.8_A10 description: > Checking if varying the String.prototype.lastIndexOf.length property fails -flags: [noStrict] -includes: [$FAIL.js] +includes: [$FAIL.js, propertyHelper.js] ---*/ ////////////////////////////////////////////////////////////////////////////// @@ -23,7 +22,7 @@ if (!(String.prototype.lastIndexOf.hasOwnProperty('length'))) { var __obj = String.prototype.lastIndexOf.length; -String.prototype.lastIndexOf.length = function(){return "shifted";}; +verifyNotWritable(String.prototype.lastIndexOf, "length", null, function(){return "shifted";}); ////////////////////////////////////////////////////////////////////////////// //CHECK#2 diff --git a/test/built-ins/String/prototype/localeCompare/S15.5.4.9_A10.js b/test/built-ins/String/prototype/localeCompare/S15.5.4.9_A10.js index 754377c99c..56579a81b0 100644 --- a/test/built-ins/String/prototype/localeCompare/S15.5.4.9_A10.js +++ b/test/built-ins/String/prototype/localeCompare/S15.5.4.9_A10.js @@ -9,7 +9,7 @@ es5id: 15.5.4.9_A10 description: > Checking if varying the String.prototype.localeCompare.length property fails -flags: [noStrict] +includes: [propertyHelper.js] ---*/ ////////////////////////////////////////////////////////////////////////////// @@ -22,7 +22,7 @@ if (!(String.prototype.localeCompare.hasOwnProperty('length'))) { var __obj = String.prototype.localeCompare.length; -String.prototype.localeCompare.length = function(){return "shifted";}; +verifyNotWritable(String.prototype.localeCompare, "length", null, function(){return "shifted";}); ////////////////////////////////////////////////////////////////////////////// //CHECK#2 diff --git a/test/built-ins/String/prototype/match/S15.5.4.10_A10.js b/test/built-ins/String/prototype/match/S15.5.4.10_A10.js index 973343e62f..1a9f0acbd9 100644 --- a/test/built-ins/String/prototype/match/S15.5.4.10_A10.js +++ b/test/built-ins/String/prototype/match/S15.5.4.10_A10.js @@ -7,8 +7,7 @@ es5id: 15.5.4.10_A10 description: > Checking if varying the String.prototype.match.length property fails -flags: [noStrict] -includes: [$FAIL.js] +includes: [$FAIL.js, propertyHelper.js] ---*/ ////////////////////////////////////////////////////////////////////////////// @@ -21,7 +20,7 @@ if (!(String.prototype.match.hasOwnProperty('length'))) { var __obj = String.prototype.match.length; -String.prototype.match.length = function(){return "shifted";}; +verifyNotWritable(String.prototype.match, "length", null, function(){return "shifted";}); ////////////////////////////////////////////////////////////////////////////// //CHECK#2 diff --git a/test/built-ins/String/prototype/replace/S15.5.4.11_A10.js b/test/built-ins/String/prototype/replace/S15.5.4.11_A10.js index f838683e47..d1cb41ab3e 100644 --- a/test/built-ins/String/prototype/replace/S15.5.4.11_A10.js +++ b/test/built-ins/String/prototype/replace/S15.5.4.11_A10.js @@ -7,8 +7,7 @@ es5id: 15.5.4.11_A10 description: > Checking if varying the String.prototype.replace.length property fails -flags: [noStrict] -includes: [$FAIL.js] +includes: [$FAIL.js, propertyHelper.js] ---*/ ////////////////////////////////////////////////////////////////////////////// @@ -21,7 +20,7 @@ if (!(String.prototype.replace.hasOwnProperty('length'))) { var __obj = String.prototype.replace.length; -String.prototype.replace.length = function(){return "shifted";}; +verifyNotWritable(String.prototype.replace, "length", null, function(){return "shifted";}); ////////////////////////////////////////////////////////////////////////////// //CHECK#2 diff --git a/test/built-ins/String/prototype/search/S15.5.4.12_A10.js b/test/built-ins/String/prototype/search/S15.5.4.12_A10.js index afd98d43ff..de22f528cd 100644 --- a/test/built-ins/String/prototype/search/S15.5.4.12_A10.js +++ b/test/built-ins/String/prototype/search/S15.5.4.12_A10.js @@ -7,8 +7,7 @@ es5id: 15.5.4.12_A10 description: > Checking if varying the String.prototype.search.length property fails -flags: [noStrict] -includes: [$FAIL.js] +includes: [$FAIL.js, propertyHelper.js] ---*/ ////////////////////////////////////////////////////////////////////////////// @@ -21,7 +20,7 @@ if (!(String.prototype.search.hasOwnProperty('length'))) { var __obj = String.prototype.search.length; -String.prototype.search.length = function(){return "shifted";}; +verifyNotWritable(String.prototype.search, "length", null, function(){return "shifted";}); ////////////////////////////////////////////////////////////////////////////// //CHECK#2 diff --git a/test/built-ins/String/prototype/slice/S15.5.4.13_A10.js b/test/built-ins/String/prototype/slice/S15.5.4.13_A10.js index 7aed6ca591..0c1cf4ac32 100644 --- a/test/built-ins/String/prototype/slice/S15.5.4.13_A10.js +++ b/test/built-ins/String/prototype/slice/S15.5.4.13_A10.js @@ -7,8 +7,7 @@ es5id: 15.5.4.13_A10 description: > Checking if varying the String.prototype.slice.length property fails -flags: [noStrict] -includes: [$FAIL.js] +includes: [$FAIL.js, propertyHelper.js] ---*/ ////////////////////////////////////////////////////////////////////////////// @@ -21,7 +20,7 @@ if (!(String.prototype.slice.hasOwnProperty('length'))) { var __obj = String.prototype.slice.length; -String.prototype.slice.length = function(){return "shifted";}; +verifyNotWritable(String.prototype.slice, "length", null, function(){return "shifted";}); ////////////////////////////////////////////////////////////////////////////// //CHECK#2 diff --git a/test/built-ins/String/prototype/split/S15.5.4.14_A10.js b/test/built-ins/String/prototype/split/S15.5.4.14_A10.js index b6139de201..ed6951d6c9 100644 --- a/test/built-ins/String/prototype/split/S15.5.4.14_A10.js +++ b/test/built-ins/String/prototype/split/S15.5.4.14_A10.js @@ -7,8 +7,7 @@ es5id: 15.5.4.14_A10 description: > Checking if varying the String.prototype.split.length property fails -flags: [noStrict] -includes: [$FAIL.js] +includes: [$FAIL.js, propertyHelper.js] ---*/ ////////////////////////////////////////////////////////////////////////////// @@ -21,7 +20,7 @@ if (!(String.prototype.split.hasOwnProperty('length'))) { var __obj = String.prototype.split.length; -String.prototype.split.length = function(){return "shifted";}; +verifyNotWritable(String.prototype.split, "length", null, function(){return "shifted";}); ////////////////////////////////////////////////////////////////////////////// //CHECK#2 diff --git a/test/built-ins/String/prototype/substring/S15.5.4.15_A10.js b/test/built-ins/String/prototype/substring/S15.5.4.15_A10.js index 1d48b27e4d..2cc1836ffe 100644 --- a/test/built-ins/String/prototype/substring/S15.5.4.15_A10.js +++ b/test/built-ins/String/prototype/substring/S15.5.4.15_A10.js @@ -7,8 +7,7 @@ es5id: 15.5.4.15_A10 description: > Checking if varying the String.prototype.substring.length property fails -flags: [noStrict] -includes: [$FAIL.js] +includes: [$FAIL.js, propertyHelper.js] ---*/ ////////////////////////////////////////////////////////////////////////////// @@ -21,7 +20,7 @@ if (!(String.prototype.substring.hasOwnProperty('length'))) { var __obj = String.prototype.substring.length; -String.prototype.substring.length = function(){return "shifted";}; +verifyNotWritable(String.prototype.substring, "length", null, function(){return "shifted";}); ////////////////////////////////////////////////////////////////////////////// //CHECK#2 diff --git a/test/built-ins/String/prototype/toLocaleLowerCase/S15.5.4.17_A10.js b/test/built-ins/String/prototype/toLocaleLowerCase/S15.5.4.17_A10.js index 57c534f137..1da33690bd 100644 --- a/test/built-ins/String/prototype/toLocaleLowerCase/S15.5.4.17_A10.js +++ b/test/built-ins/String/prototype/toLocaleLowerCase/S15.5.4.17_A10.js @@ -9,8 +9,7 @@ es5id: 15.5.4.17_A10 description: > Checking if varying the String.prototype.toLocaleLowerCase.length property fails -flags: [noStrict] -includes: [$FAIL.js] +includes: [$FAIL.js, propertyHelper.js] ---*/ ////////////////////////////////////////////////////////////////////////////// @@ -21,9 +20,9 @@ if (!(String.prototype.toLocaleLowerCase.hasOwnProperty('length'))) { // ////////////////////////////////////////////////////////////////////////////// -__obj = String.prototype.toLocaleLowerCase.length; +var __obj = String.prototype.toLocaleLowerCase.length; -String.prototype.toLocaleLowerCase.length = function(){return "shifted";}; +verifyNotWritable(String.prototype.toLocaleLowerCase, "length", null, function(){return "shifted";}); ////////////////////////////////////////////////////////////////////////////// //CHECK#2 diff --git a/test/built-ins/String/prototype/toLocaleUpperCase/S15.5.4.19_A10.js b/test/built-ins/String/prototype/toLocaleUpperCase/S15.5.4.19_A10.js index c91a71387c..01ed626162 100644 --- a/test/built-ins/String/prototype/toLocaleUpperCase/S15.5.4.19_A10.js +++ b/test/built-ins/String/prototype/toLocaleUpperCase/S15.5.4.19_A10.js @@ -9,8 +9,7 @@ es5id: 15.5.4.19_A10 description: > Checking if varying the String.prototype.toLocaleUpperCase.length property fails -flags: [noStrict] -includes: [$FAIL.js] +includes: [$FAIL.js, propertyHelper.js] ---*/ ////////////////////////////////////////////////////////////////////////////// @@ -23,7 +22,7 @@ if (!(String.prototype.toLocaleUpperCase.hasOwnProperty('length'))) { var __obj = String.prototype.toLocaleUpperCase.length; -String.prototype.toLocaleUpperCase.length = function(){return "shifted";}; +verifyNotWritable(String.prototype.toLocaleUpperCase, "length", null, function(){return "shifted";}); ////////////////////////////////////////////////////////////////////////////// //CHECK#2 diff --git a/test/built-ins/String/prototype/toLowerCase/S15.5.4.16_A10.js b/test/built-ins/String/prototype/toLowerCase/S15.5.4.16_A10.js index 8f7966b7a6..e396b4ab62 100644 --- a/test/built-ins/String/prototype/toLowerCase/S15.5.4.16_A10.js +++ b/test/built-ins/String/prototype/toLowerCase/S15.5.4.16_A10.js @@ -9,8 +9,7 @@ es5id: 15.5.4.16_A10 description: > Checking if varying the String.prototype.toLowerCase.length property fails -flags: [noStrict] -includes: [$FAIL.js] +includes: [$FAIL.js, propertyHelper.js] ---*/ ////////////////////////////////////////////////////////////////////////////// @@ -23,7 +22,7 @@ if (!(String.prototype.toLowerCase.hasOwnProperty('length'))) { var __obj = String.prototype.toLowerCase.length; -String.prototype.toLowerCase.length = function(){return "shifted";}; +verifyNotWritable(String.prototype.toLowerCase, "length", null, function(){return "shifted";}); ////////////////////////////////////////////////////////////////////////////// //CHECK#2 diff --git a/test/built-ins/String/prototype/toUpperCase/S15.5.4.18_A10.js b/test/built-ins/String/prototype/toUpperCase/S15.5.4.18_A10.js index b2cf13f571..c8f354dd39 100644 --- a/test/built-ins/String/prototype/toUpperCase/S15.5.4.18_A10.js +++ b/test/built-ins/String/prototype/toUpperCase/S15.5.4.18_A10.js @@ -9,8 +9,7 @@ es5id: 15.5.4.18_A10 description: > Checking if varying the String.prototype.toUpperCase.length property fails -flags: [noStrict] -includes: [$FAIL.js] +includes: [$FAIL.js, propertyHelper.js] ---*/ ////////////////////////////////////////////////////////////////////////////// @@ -23,7 +22,7 @@ if (!(String.prototype.toUpperCase.hasOwnProperty('length'))) { var __obj = String.prototype.toUpperCase.length; -String.prototype.toUpperCase.length = function(){return "shifted";}; +verifyNotWritable(String.prototype.toUpperCase, "length", null, function(){return "shifted";}); ////////////////////////////////////////////////////////////////////////////// //CHECK#2 diff --git a/test/built-ins/decodeURI/S15.1.3.1_A5.3.js b/test/built-ins/decodeURI/S15.1.3.1_A5.3.js index 6d3c425b58..3aca2c3478 100644 --- a/test/built-ins/decodeURI/S15.1.3.1_A5.3.js +++ b/test/built-ins/decodeURI/S15.1.3.1_A5.3.js @@ -5,12 +5,12 @@ info: The length property of decodeURI has the attribute ReadOnly es5id: 15.1.3.1_A5.3 description: Checking if varying the length property fails -flags: [noStrict] +includes: [propertyHelper.js] ---*/ //CHECK#1 var x = decodeURI.length; -decodeURI.length = Infinity; +verifyNotWritable(decodeURI, "length", null, Infinity); if (decodeURI.length !== x) { $ERROR('#1: x = decodeURI.length; decodeURI.length = Infinity; decodeURI.length === x. Actual: ' + (decodeURI.length)); } diff --git a/test/built-ins/decodeURIComponent/S15.1.3.2_A5.3.js b/test/built-ins/decodeURIComponent/S15.1.3.2_A5.3.js index 5f656ede18..cb11b7ed5d 100644 --- a/test/built-ins/decodeURIComponent/S15.1.3.2_A5.3.js +++ b/test/built-ins/decodeURIComponent/S15.1.3.2_A5.3.js @@ -5,12 +5,12 @@ info: The length property of decodeURIComponent has the attribute ReadOnly es5id: 15.1.3.2_A5.3 description: Checking if varying the length property fails -flags: [noStrict] +includes: [propertyHelper.js] ---*/ //CHECK#1 -x = decodeURIComponent.length; -decodeURIComponent.length = Infinity; +var x = decodeURIComponent.length; +verifyNotWritable(decodeURIComponent, "length", null, Infinity); if (decodeURIComponent.length !== x) { $ERROR('#1: x = decodeURIComponent.length; decodeURIComponent.length = Infinity; decodeURIComponent.length === x. Actual: ' + (decodeURIComponent.length)); } diff --git a/test/built-ins/encodeURI/S15.1.3.3_A5.3.js b/test/built-ins/encodeURI/S15.1.3.3_A5.3.js index 28c592460d..ea8846bd77 100644 --- a/test/built-ins/encodeURI/S15.1.3.3_A5.3.js +++ b/test/built-ins/encodeURI/S15.1.3.3_A5.3.js @@ -5,12 +5,12 @@ info: The length property of encodeURI has the attribute ReadOnly es5id: 15.1.3.3_A5.3 description: Checking if varying the length property fails -flags: [noStrict] +includes: [propertyHelper.js] ---*/ //CHECK#1 -x = encodeURI.length; -encodeURI.length = Infinity; +var x = encodeURI.length; +verifyNotWritable(encodeURI, "length", null, Infinity); if (encodeURI.length !== x) { $ERROR('#1: x = encodeURI.length; encodeURI.length = Infinity; encodeURI.length === x. Actual: ' + (encodeURI.length)); } diff --git a/test/built-ins/encodeURIComponent/S15.1.3.4_A5.3.js b/test/built-ins/encodeURIComponent/S15.1.3.4_A5.3.js index 0445812f57..62912ddb37 100644 --- a/test/built-ins/encodeURIComponent/S15.1.3.4_A5.3.js +++ b/test/built-ins/encodeURIComponent/S15.1.3.4_A5.3.js @@ -5,12 +5,12 @@ info: The length property of encodeURIComponent has the attribute ReadOnly es5id: 15.1.3.4_A5.3 description: Checking if varying the length property fails -flags: [noStrict] +includes: [propertyHelper.js] ---*/ //CHECK#1 -x = encodeURIComponent.length; -encodeURIComponent.length = Infinity; +var x = encodeURIComponent.length; +verifyNotWritable(encodeURIComponent, "length", null, Infinity); if (encodeURIComponent.length !== x) { $ERROR('#1: x = encodeURIComponent.length; encodeURIComponent.length = Infinity; encodeURIComponent.length === x. Actual: ' + (encodeURIComponent.length)); } diff --git a/test/built-ins/eval/S15.1.2.1_A4.3.js b/test/built-ins/eval/S15.1.2.1_A4.3.js index 1df06ecda9..82aad23995 100644 --- a/test/built-ins/eval/S15.1.2.1_A4.3.js +++ b/test/built-ins/eval/S15.1.2.1_A4.3.js @@ -5,12 +5,12 @@ info: The length property of eval has the attribute ReadOnly es5id: 15.1.2.1_A4.3 description: Checking if varying the length property fails -flags: [noStrict] +includes: [propertyHelper.js] ---*/ //CHECK#1 var x = eval.length; -eval.length = Infinity; +verifyNotWritable(eval, "length", null, Infinity); if (eval.length !== x) { $ERROR('#1: x = eval.length; eval.length = Infinity; eval.length === x. Actual: ' + (eval.length)); } diff --git a/test/built-ins/isFinite/S15.1.2.5_A2.3.js b/test/built-ins/isFinite/S15.1.2.5_A2.3.js index fd679488ce..ea89d94a38 100644 --- a/test/built-ins/isFinite/S15.1.2.5_A2.3.js +++ b/test/built-ins/isFinite/S15.1.2.5_A2.3.js @@ -5,12 +5,12 @@ info: The length property of isFinite has the attribute ReadOnly es5id: 15.1.2.5_A2.3 description: Checking if varying the length property fails -flags: [noStrict] +includes: [propertyHelper.js] ---*/ //CHECK#1 -x = isFinite.length; -isFinite.length = Infinity; +var x = isFinite.length; +verifyNotWritable(isFinite, "length", null, Infinity); if (isFinite.length !== x) { $ERROR('#1: x = isFinite.length; isFinite.length = Infinity; isFinite.length === x. Actual: ' + (isFinite.length)); } diff --git a/test/built-ins/isNaN/S15.1.2.4_A2.3.js b/test/built-ins/isNaN/S15.1.2.4_A2.3.js index cd9ac4911e..99efe94e3f 100644 --- a/test/built-ins/isNaN/S15.1.2.4_A2.3.js +++ b/test/built-ins/isNaN/S15.1.2.4_A2.3.js @@ -5,12 +5,12 @@ info: The length property of isNaN has the attribute ReadOnly es5id: 15.1.2.4_A2.3 description: Checking if varying the length property fails -flags: [noStrict] +includes: [propertyHelper.js] ---*/ //CHECK#1 -x = isNaN.length; -isNaN.length = Infinity; +var x = isNaN.length; +verifyNotWritable(isNaN, "length", null, Infinity); if (isNaN.length !== x) { $ERROR('#1: x = isNaN.length; isNaN.length = Infinity; isNaN.length === x. Actual: ' + (isNaN.length)); } diff --git a/test/built-ins/parseFloat/S15.1.2.3_A7.3.js b/test/built-ins/parseFloat/S15.1.2.3_A7.3.js index b6faa93a3b..54baa6a3a8 100644 --- a/test/built-ins/parseFloat/S15.1.2.3_A7.3.js +++ b/test/built-ins/parseFloat/S15.1.2.3_A7.3.js @@ -5,12 +5,12 @@ info: The length property of parseFloat has the attribute ReadOnly es5id: 15.1.2.3_A7.3 description: Checking if varying the length property fails -flags: [noStrict] +includes: [propertyHelper.js] ---*/ //CHECK#1 var x = parseFloat.length; -parseFloat.length = Infinity; +verifyNotWritable(parseFloat, "length", null, Infinity); if (parseFloat.length !== x) { $ERROR('#1: x = parseFloat.length; parseFloat.length = Infinity; parseFloat.length === x. Actual: ' + (parseFloat.length)); } diff --git a/test/built-ins/parseInt/S15.1.2.2_A9.3.js b/test/built-ins/parseInt/S15.1.2.2_A9.3.js index e0bfc8072b..a4db534421 100644 --- a/test/built-ins/parseInt/S15.1.2.2_A9.3.js +++ b/test/built-ins/parseInt/S15.1.2.2_A9.3.js @@ -5,12 +5,12 @@ info: The length property of parseInt has the attribute ReadOnly es5id: 15.1.2.2_A9.3 description: Checking if varying the length property fails -flags: [noStrict] +includes: [propertyHelper.js] ---*/ //CHECK#1 -x = parseInt.length; -parseInt.length = Infinity; +var x = parseInt.length; +verifyNotWritable(parseInt, "length", null, Infinity); if (parseInt.length !== x) { $ERROR('#1: x = parseInt.length; parseInt.length = Infinity; parseInt.length === x. Actual: ' + (parseInt.length)); } diff --git a/test/built-ins/undefined/15.1.1.3-2.js b/test/built-ins/undefined/15.1.1.3-2.js index d1ed84364f..449812b045 100644 --- a/test/built-ins/undefined/15.1.1.3-2.js +++ b/test/built-ins/undefined/15.1.1.3-2.js @@ -8,23 +8,13 @@ es5id: 15.1.1.3-2 description: undefined is not writable, should throw TypeError in strict mode flags: [onlyStrict] -includes: - - runTestCase.js - - fnGlobalObject.js +includes: [fnGlobalObject.js] ---*/ -function testcase(){ - "use strict"; - var global = fnGlobalObject(); - try{ - global["undefined"] = 5; // Should throw a TypeError as per 8.12.5 - } catch (ex) { - if(ex instanceof TypeError){ - return true; - } else { - return false; - } - } -} +var global = fnGlobalObject(); -runTestCase(testcase); +assert.throws(TypeError, function() { + global["undefined"] = 5; // Should throw a TypeError as per 8.12.5 +}); +assert.sameValue(global["undefined"], void 0); +assert.sameValue(undefined, void 0); diff --git a/test/built-ins/undefined/S15.1.1.3_A3_T1.js b/test/built-ins/undefined/S15.1.1.3_A3_T1.js new file mode 100644 index 0000000000..43d8ec4f76 --- /dev/null +++ b/test/built-ins/undefined/S15.1.1.3_A3_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 undefined is DontDelete +es5id: 15.1.1.3_A3.1 +description: Use delete +includes: [propertyHelper.js, fnGlobalObject.js] +---*/ + +// CHECK#1 +verifyNotConfigurable(fnGlobalObject(), "undefined"); + +try { + if (delete fnGlobalObject().undefined !== false) { + $ERROR('#1: delete undefined === false.'); + } +} catch (e) { + if (e instanceof Test262Error) throw e; + assert(e instanceof TypeError); +} diff --git a/test/built-ins/undefined/S15.1.1.3_A3.1.js b/test/built-ins/undefined/S15.1.1.3_A3_T2.js similarity index 96% rename from test/built-ins/undefined/S15.1.1.3_A3.1.js rename to test/built-ins/undefined/S15.1.1.3_A3_T2.js index 57174a55d6..5ef6923755 100644 --- a/test/built-ins/undefined/S15.1.1.3_A3.1.js +++ b/test/built-ins/undefined/S15.1.1.3_A3_T2.js @@ -10,5 +10,5 @@ flags: [noStrict] // CHECK#1 if (delete undefined !== false) { - $ERROR('#1: delete undefined === false. Actual: ' + (delete undefined)); + $ERROR('#1: delete undefined === false. Actual: ' + (delete undefined)); } diff --git a/test/built-ins/undefined/S15.1.1.3_A3.2.js b/test/built-ins/undefined/S15.1.1.3_A4.js similarity index 98% rename from test/built-ins/undefined/S15.1.1.3_A3.2.js rename to test/built-ins/undefined/S15.1.1.3_A4.js index abbb847b02..a040518349 100644 --- a/test/built-ins/undefined/S15.1.1.3_A3.2.js +++ b/test/built-ins/undefined/S15.1.1.3_A4.js @@ -11,5 +11,5 @@ description: Use for-in statement for (var prop in this) { if (prop === "undefined") { $ERROR('#1: The undefined is DontEnum'); - } + } }