From 25278a150d779e41a75d41404f8aadd1e23b7a72 Mon Sep 17 00:00:00 2001 From: Richard Gibson Date: Wed, 14 May 2025 12:08:11 -0400 Subject: [PATCH] harness: Add a verifyCallableProperty helper (#4468) --- harness/propertyHelper.js | 99 +++++++++++++++++---- test/built-ins/isFinite/length.js | 16 ---- test/built-ins/isFinite/name.js | 27 ------ test/built-ins/isFinite/prop-desc.js | 2 +- test/built-ins/isNaN/length.js | 16 ---- test/built-ins/isNaN/name.js | 27 ------ test/built-ins/isNaN/prop-desc.js | 2 +- test/built-ins/parseFloat/S15.1.2.3_A7.1.js | 25 ------ test/built-ins/parseFloat/S15.1.2.3_A7.2.js | 25 ------ test/built-ins/parseFloat/S15.1.2.3_A7.3.js | 16 ---- test/built-ins/parseFloat/S15.1.2.3_A7.4.js | 13 --- test/built-ins/parseFloat/name.js | 27 ------ test/built-ins/parseFloat/prop-desc.js | 2 +- test/built-ins/parseInt/S15.1.2.2_A9.1.js | 24 ----- test/built-ins/parseInt/S15.1.2.2_A9.2.js | 15 ---- test/built-ins/parseInt/S15.1.2.2_A9.3.js | 12 --- test/built-ins/parseInt/S15.1.2.2_A9.4.js | 10 --- test/built-ins/parseInt/name.js | 27 ------ test/built-ins/parseInt/prop-desc.js | 2 +- 19 files changed, 85 insertions(+), 302 deletions(-) delete mode 100644 test/built-ins/isFinite/length.js delete mode 100644 test/built-ins/isFinite/name.js delete mode 100644 test/built-ins/isNaN/length.js delete mode 100644 test/built-ins/isNaN/name.js delete mode 100644 test/built-ins/parseFloat/S15.1.2.3_A7.1.js delete mode 100644 test/built-ins/parseFloat/S15.1.2.3_A7.2.js delete mode 100644 test/built-ins/parseFloat/S15.1.2.3_A7.3.js delete mode 100644 test/built-ins/parseFloat/S15.1.2.3_A7.4.js delete mode 100644 test/built-ins/parseFloat/name.js delete mode 100644 test/built-ins/parseInt/S15.1.2.2_A9.1.js delete mode 100644 test/built-ins/parseInt/S15.1.2.2_A9.2.js delete mode 100644 test/built-ins/parseInt/S15.1.2.2_A9.3.js delete mode 100644 test/built-ins/parseInt/S15.1.2.2_A9.4.js delete mode 100644 test/built-ins/parseInt/name.js diff --git a/harness/propertyHelper.js b/harness/propertyHelper.js index 5637454b5f..0b702b0764 100644 --- a/harness/propertyHelper.js +++ b/harness/propertyHelper.js @@ -6,6 +6,7 @@ description: | property descriptors. defines: - verifyProperty + - verifyCallableProperty - verifyEqualTo # deprecated - verifyWritable # deprecated - verifyNotWritable # deprecated @@ -14,6 +15,7 @@ defines: - verifyConfigurable # deprecated - verifyNotConfigurable # deprecated - verifyPrimordialProperty + - verifyPrimordialCallableProperty ---*/ // @ts-check @@ -22,6 +24,8 @@ defines: // are used in verification but might be destroyed *by* that process itself. var __isArray = Array.isArray; var __defineProperty = Object.defineProperty; +var __getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor; +var __getOwnPropertyNames = Object.getOwnPropertyNames; var __join = Function.prototype.call.bind(Array.prototype.join); var __push = Function.prototype.call.bind(Array.prototype.push); var __hasOwnProperty = Function.prototype.call.bind(Object.prototype.hasOwnProperty); @@ -33,7 +37,7 @@ var nonIndexNumericPropertyName = Math.pow(2, 32) - 1; * @param {string|symbol} name * @param {PropertyDescriptor|undefined} desc * @param {object} [options] - * @param {boolean} [options.restore] + * @param {boolean} [options.restore] revert mutations from verifying writable/configurable */ function verifyProperty(obj, name, desc, options) { assert( @@ -41,7 +45,7 @@ function verifyProperty(obj, name, desc, options) { 'verifyProperty should receive at least 3 arguments: obj, name, and descriptor' ); - var originalDesc = Object.getOwnPropertyDescriptor(obj, name); + var originalDesc = __getOwnPropertyDescriptor(obj, name); var nameStr = String(name); // Allows checking for undefined descriptor if it's explicitly given. @@ -73,7 +77,7 @@ function verifyProperty(obj, name, desc, options) { "The desc argument should be an object or undefined, " + String(desc) ); - var names = Object.getOwnPropertyNames(desc); + var names = __getOwnPropertyNames(desc); for (var i = 0; i < names.length; i++) { assert( names[i] === "value" || @@ -90,37 +94,39 @@ function verifyProperty(obj, name, desc, options) { if (__hasOwnProperty(desc, 'value')) { if (!isSameValue(desc.value, originalDesc.value)) { - __push(failures, "descriptor value should be " + desc.value); + __push(failures, "obj['" + nameStr + "'] descriptor value should be " + desc.value); } if (!isSameValue(desc.value, obj[name])) { - __push(failures, "object value should be " + desc.value); + __push(failures, "obj['" + nameStr + "'] value should be " + desc.value); } } - if (__hasOwnProperty(desc, 'enumerable')) { + if (__hasOwnProperty(desc, 'enumerable') && desc.enumerable !== undefined) { if (desc.enumerable !== originalDesc.enumerable || desc.enumerable !== isEnumerable(obj, name)) { - __push(failures, 'descriptor should ' + (desc.enumerable ? '' : 'not ') + 'be enumerable'); + __push(failures, "obj['" + nameStr + "'] descriptor should " + (desc.enumerable ? '' : 'not ') + "be enumerable"); } } // Operations past this point are potentially destructive! - if (__hasOwnProperty(desc, 'writable')) { + if (__hasOwnProperty(desc, 'writable') && desc.writable !== undefined) { if (desc.writable !== originalDesc.writable || desc.writable !== isWritable(obj, name)) { - __push(failures, 'descriptor should ' + (desc.writable ? '' : 'not ') + 'be writable'); + __push(failures, "obj['" + nameStr + "'] descriptor should " + (desc.writable ? '' : 'not ') + "be writable"); } } - if (__hasOwnProperty(desc, 'configurable')) { + if (__hasOwnProperty(desc, 'configurable') && desc.configurable !== undefined) { if (desc.configurable !== originalDesc.configurable || desc.configurable !== isConfigurable(obj, name)) { - __push(failures, 'descriptor should ' + (desc.configurable ? '' : 'not ') + 'be configurable'); + __push(failures, "obj['" + nameStr + "'] descriptor should " + (desc.configurable ? '' : 'not ') + "be configurable"); } } - assert(!failures.length, __join(failures, '; ')); + if (failures.length) { + assert(false, __join(failures, '; ')); + } if (options && options.restore) { __defineProperty(obj, name, originalDesc); @@ -202,6 +208,56 @@ function isWritable(obj, name, verifyProp, value) { return writeSucceeded; } +/** + * @param {object} obj + * @param {string|symbol} name + * @param {string} [functionName] defaults to name for strings, `[${name.description}]` for symbols + * @param {number} functionLength + * @param {PropertyDescriptor} desc + * @param {object} [options] + * @param {boolean} [options.restore] revert mutations from verifying writable/configurable + */ +function verifyCallableProperty(obj, name, functionName, functionLength, desc, options) { + var value = obj[name]; + + assert.sameValue(typeof value, "function", + "obj['" + String(name) + "'] descriptor should be a function"); + + if (!__hasOwnProperty(desc, "value")) desc.value = value; + verifyProperty(obj, name, desc, options); + + if (functionName === undefined) { + if (typeof name === "symbol") { + functionName = "[" + name.description + "]"; + } else { + functionName = name; + } + } + // Unless otherwise specified, the "name" property of a built-in function + // object has the attributes { [[Writable]]: false, [[Enumerable]]: false, + // [[Configurable]]: true }. + // https://tc39.es/ecma262/multipage/ecmascript-standard-built-in-objects.html#sec-ecmascript-standard-built-in-objects + // https://tc39.es/ecma262/multipage/ordinary-and-exotic-objects-behaviours.html#sec-setfunctionname + verifyProperty(value, "name", { + value: functionName, + writable: false, + enumerable: false, + configurable: desc.configurable + }, options); + + // Unless otherwise specified, the "length" property of a built-in function + // object has the attributes { [[Writable]]: false, [[Enumerable]]: false, + // [[Configurable]]: true }. + // https://tc39.es/ecma262/multipage/ecmascript-standard-built-in-objects.html#sec-ecmascript-standard-built-in-objects + // https://tc39.es/ecma262/multipage/ordinary-and-exotic-objects-behaviours.html#sec-setfunctionlength + verifyProperty(value, "length", { + value: functionLength, + writable: false, + enumerable: false, + configurable: desc.configurable + }, options); +} + /** * Deprecated; please use `verifyProperty` in new tests. */ @@ -217,7 +273,7 @@ function verifyEqualTo(obj, name, value) { */ function verifyWritable(obj, name, verifyProp, value) { if (!verifyProp) { - assert(Object.getOwnPropertyDescriptor(obj, name).writable, + assert(__getOwnPropertyDescriptor(obj, name).writable, "Expected obj[" + String(name) + "] to have writable:true."); } if (!isWritable(obj, name, verifyProp, value)) { @@ -230,7 +286,7 @@ function verifyWritable(obj, name, verifyProp, value) { */ function verifyNotWritable(obj, name, verifyProp, value) { if (!verifyProp) { - assert(!Object.getOwnPropertyDescriptor(obj, name).writable, + assert(!__getOwnPropertyDescriptor(obj, name).writable, "Expected obj[" + String(name) + "] to have writable:false."); } if (isWritable(obj, name, verifyProp)) { @@ -242,7 +298,7 @@ function verifyNotWritable(obj, name, verifyProp, value) { * Deprecated; please use `verifyProperty` in new tests. */ function verifyEnumerable(obj, name) { - assert(Object.getOwnPropertyDescriptor(obj, name).enumerable, + assert(__getOwnPropertyDescriptor(obj, name).enumerable, "Expected obj[" + String(name) + "] to have enumerable:true."); if (!isEnumerable(obj, name)) { throw new Test262Error("Expected obj[" + String(name) + "] to be enumerable, but was not."); @@ -253,7 +309,7 @@ function verifyEnumerable(obj, name) { * Deprecated; please use `verifyProperty` in new tests. */ function verifyNotEnumerable(obj, name) { - assert(!Object.getOwnPropertyDescriptor(obj, name).enumerable, + assert(!__getOwnPropertyDescriptor(obj, name).enumerable, "Expected obj[" + String(name) + "] to have enumerable:false."); if (isEnumerable(obj, name)) { throw new Test262Error("Expected obj[" + String(name) + "] NOT to be enumerable, but was."); @@ -264,7 +320,7 @@ function verifyNotEnumerable(obj, name) { * Deprecated; please use `verifyProperty` in new tests. */ function verifyConfigurable(obj, name) { - assert(Object.getOwnPropertyDescriptor(obj, name).configurable, + assert(__getOwnPropertyDescriptor(obj, name).configurable, "Expected obj[" + String(name) + "] to have configurable:true."); if (!isConfigurable(obj, name)) { throw new Test262Error("Expected obj[" + String(name) + "] to be configurable, but was not."); @@ -275,7 +331,7 @@ function verifyConfigurable(obj, name) { * Deprecated; please use `verifyProperty` in new tests. */ function verifyNotConfigurable(obj, name) { - assert(!Object.getOwnPropertyDescriptor(obj, name).configurable, + assert(!__getOwnPropertyDescriptor(obj, name).configurable, "Expected obj[" + String(name) + "] to have configurable:false."); if (isConfigurable(obj, name)) { throw new Test262Error("Expected obj[" + String(name) + "] NOT to be configurable, but was."); @@ -288,3 +344,10 @@ function verifyNotConfigurable(obj, name) { * See: https://github.com/tc39/how-we-work/blob/main/terminology.md#primordial */ var verifyPrimordialProperty = verifyProperty; + +/** + * Use this function to verify the primordial function-valued properties. + * For non-primordial functions, use verifyCallableProperty. + * See: https://github.com/tc39/how-we-work/blob/main/terminology.md#primordial + */ +var verifyPrimordialCallableProperty = verifyCallableProperty; diff --git a/test/built-ins/isFinite/length.js b/test/built-ins/isFinite/length.js deleted file mode 100644 index 9e43266c05..0000000000 --- a/test/built-ins/isFinite/length.js +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright (C) 2016 The V8 Project authors. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -esid: sec-isfinite-number -description: > - The length property of isFinite is 1 -includes: [propertyHelper.js] ----*/ - -verifyProperty(isFinite, "length", { - value: 1, - writable: false, - enumerable: false, - configurable: true -}); diff --git a/test/built-ins/isFinite/name.js b/test/built-ins/isFinite/name.js deleted file mode 100644 index e9f819a2ea..0000000000 --- a/test/built-ins/isFinite/name.js +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (C) 2015 André Bargull. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -esid: sec-isfinite-number -description: > - isFinite.name is "isFinite". -info: | - isFinite (number) - - 17 ECMAScript Standard Built-in Objects: - Every built-in Function object, including constructors, that is not - identified as an anonymous function has a name property whose value - is a String. - - Unless otherwise specified, the name property of a built-in Function - object, if it exists, has the attributes { [[Writable]]: false, - [[Enumerable]]: false, [[Configurable]]: true }. -includes: [propertyHelper.js] ----*/ - -verifyProperty(isFinite, "name", { - value: "isFinite", - writable: false, - enumerable: false, - configurable: true -}); diff --git a/test/built-ins/isFinite/prop-desc.js b/test/built-ins/isFinite/prop-desc.js index aa1bfbf633..0532a4a7da 100644 --- a/test/built-ins/isFinite/prop-desc.js +++ b/test/built-ins/isFinite/prop-desc.js @@ -8,7 +8,7 @@ description: > includes: [propertyHelper.js] ---*/ -verifyProperty(this, "isFinite", { +verifyPrimordialCallableProperty(this, "isFinite", "isFinite", 1, { writable: true, enumerable: false, configurable: true diff --git a/test/built-ins/isNaN/length.js b/test/built-ins/isNaN/length.js deleted file mode 100644 index 21373d118e..0000000000 --- a/test/built-ins/isNaN/length.js +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright (C) 2016 The V8 Project authors. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -esid: sec-isnan-number -description: > - The length property of isNaN is 1 -includes: [propertyHelper.js] ----*/ - -verifyProperty(isNaN, "length", { - value: 1, - writable: false, - enumerable: false, - configurable: true -}); diff --git a/test/built-ins/isNaN/name.js b/test/built-ins/isNaN/name.js deleted file mode 100644 index 5c506a8f99..0000000000 --- a/test/built-ins/isNaN/name.js +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (C) 2015 André Bargull. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -esid: sec-isnan-number -description: > - isNaN.name is "isNaN". -info: | - isNaN (number) - - 17 ECMAScript Standard Built-in Objects: - Every built-in Function object, including constructors, that is not - identified as an anonymous function has a name property whose value - is a String. - - Unless otherwise specified, the name property of a built-in Function - object, if it exists, has the attributes { [[Writable]]: false, - [[Enumerable]]: false, [[Configurable]]: true }. -includes: [propertyHelper.js] ----*/ - -verifyProperty(isNaN, "name", { - value: "isNaN", - writable: false, - enumerable: false, - configurable: true -}); diff --git a/test/built-ins/isNaN/prop-desc.js b/test/built-ins/isNaN/prop-desc.js index aa535c8249..3c52a36617 100644 --- a/test/built-ins/isNaN/prop-desc.js +++ b/test/built-ins/isNaN/prop-desc.js @@ -8,7 +8,7 @@ description: > includes: [propertyHelper.js] ---*/ -verifyProperty(this, "isNaN", { +verifyPrimordialCallableProperty(this, "isNaN", "isNaN", 1, { writable: true, enumerable: false, configurable: true diff --git a/test/built-ins/parseFloat/S15.1.2.3_A7.1.js b/test/built-ins/parseFloat/S15.1.2.3_A7.1.js deleted file mode 100644 index 7e9d1867e1..0000000000 --- a/test/built-ins/parseFloat/S15.1.2.3_A7.1.js +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright 2009 the Sputnik authors. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -info: The length property of parseFloat has the attribute DontEnum -esid: sec-parsefloat-string -description: Checking use propertyIsEnumerable, for-in ----*/ - -//CHECK#1 -if (parseFloat.propertyIsEnumerable('length') !== false) { - throw new Test262Error('#1: parseFloat.propertyIsEnumerable(\'length\') === false. Actual: ' + (parseFloat.propertyIsEnumerable('length'))); -} - -//CHECK#2 -var result = true; -for (var p in parseFloat) { - if (p === "length") { - result = false; - } -} - -if (result !== true) { - throw new Test262Error('#2: result = true; for (p in parseFloat) { if (p === "length") result = false; } result === true;'); -} diff --git a/test/built-ins/parseFloat/S15.1.2.3_A7.2.js b/test/built-ins/parseFloat/S15.1.2.3_A7.2.js deleted file mode 100644 index 194530c12c..0000000000 --- a/test/built-ins/parseFloat/S15.1.2.3_A7.2.js +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright 2009 the Sputnik authors. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -info: The length property of parseFloat does not have the attribute DontDelete -esid: sec-parsefloat-string -description: Checking use hasOwnProperty, delete ----*/ - -//CHECK#1 -if (parseFloat.hasOwnProperty('length') !== true) { - throw new Test262Error('#1: parseFloat.hasOwnProperty(\'length\') === true. Actual: ' + (parseFloat.hasOwnProperty('length'))); -} - -delete parseFloat.length; - -//CHECK#2 -if (parseFloat.hasOwnProperty('length') !== false) { - throw new Test262Error('#2: delete parseFloat.length; parseFloat.hasOwnProperty(\'length\') === false. Actual: ' + (parseFloat.hasOwnProperty('length'))); -} - -//CHECK#3 -if (parseFloat.length === undefined) { - throw new Test262Error('#3: delete parseFloat.length; parseFloat.length !== undefined'); -} 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 deleted file mode 100644 index f7765d6d9d..0000000000 --- a/test/built-ins/parseFloat/S15.1.2.3_A7.3.js +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright 2009 the Sputnik authors. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -info: The length property of parseFloat has the attribute ReadOnly -esid: sec-parsefloat-string -description: Checking if varying the length property fails -includes: [propertyHelper.js] ----*/ - -//CHECK#1 -var x = parseFloat.length; -verifyNotWritable(parseFloat, "length", null, Infinity); -if (parseFloat.length !== x) { - throw new Test262Error('#1: x = parseFloat.length; parseFloat.length = Infinity; parseFloat.length === x. Actual: ' + (parseFloat.length)); -} diff --git a/test/built-ins/parseFloat/S15.1.2.3_A7.4.js b/test/built-ins/parseFloat/S15.1.2.3_A7.4.js deleted file mode 100644 index c6193115fe..0000000000 --- a/test/built-ins/parseFloat/S15.1.2.3_A7.4.js +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright 2009 the Sputnik authors. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -info: The length property of parseFloat is 1 -esid: sec-parsefloat-string -description: parseFloat.length === 1 ----*/ - -//CHECK#1 -if (parseFloat.length !== 1) { - throw new Test262Error('#1: parseFloat.length === 1. Actual: ' + (parseFloat.length)); -} diff --git a/test/built-ins/parseFloat/name.js b/test/built-ins/parseFloat/name.js deleted file mode 100644 index 1495444887..0000000000 --- a/test/built-ins/parseFloat/name.js +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (C) 2015 André Bargull. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -esid: sec-parsefloat-string -description: > - parseFloat.name is "parseFloat". -info: | - parseFloat (string) - - 17 ECMAScript Standard Built-in Objects: - Every built-in Function object, including constructors, that is not - identified as an anonymous function has a name property whose value - is a String. - - Unless otherwise specified, the name property of a built-in Function - object, if it exists, has the attributes { [[Writable]]: false, - [[Enumerable]]: false, [[Configurable]]: true }. -includes: [propertyHelper.js] ----*/ - -verifyProperty(parseFloat, "name", { - value: "parseFloat", - writable: false, - enumerable: false, - configurable: true -}); diff --git a/test/built-ins/parseFloat/prop-desc.js b/test/built-ins/parseFloat/prop-desc.js index 2dd56b21f0..cc5970b9be 100644 --- a/test/built-ins/parseFloat/prop-desc.js +++ b/test/built-ins/parseFloat/prop-desc.js @@ -12,7 +12,7 @@ info: | includes: [propertyHelper.js] ---*/ -verifyProperty(this, "parseFloat", { +verifyPrimordialCallableProperty(this, "parseFloat", "parseFloat", 1, { writable: true, enumerable: false, configurable: true diff --git a/test/built-ins/parseInt/S15.1.2.2_A9.1.js b/test/built-ins/parseInt/S15.1.2.2_A9.1.js deleted file mode 100644 index 02462249dc..0000000000 --- a/test/built-ins/parseInt/S15.1.2.2_A9.1.js +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright 2009 the Sputnik authors. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -info: The length property of parseInt has the attribute DontEnum -esid: sec-parseint-string-radix -description: Checking use propertyIsEnumerable, for-in ----*/ - -assert.sameValue( - parseInt.propertyIsEnumerable('length'), - false, - 'parseInt.propertyIsEnumerable(\'length\') must return false' -); - -//CHECK#2 -var result = true; -for (var p in parseInt) { - if (p === "length") { - result = false; - } -} - -assert.sameValue(result, true, 'The value of `result` is true'); diff --git a/test/built-ins/parseInt/S15.1.2.2_A9.2.js b/test/built-ins/parseInt/S15.1.2.2_A9.2.js deleted file mode 100644 index 6146844a6c..0000000000 --- a/test/built-ins/parseInt/S15.1.2.2_A9.2.js +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright 2009 the Sputnik authors. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -info: The length property of parseInt does not have the attribute DontDelete -esid: sec-parseint-string-radix -description: Checking use hasOwnProperty, delete ----*/ - -assert.sameValue(parseInt.hasOwnProperty('length'), true, 'parseInt.hasOwnProperty(\'length\') must return true'); - -delete parseInt.length; - -assert.sameValue(parseInt.hasOwnProperty('length'), false, 'parseInt.hasOwnProperty(\'length\') must return false'); -assert.notSameValue(parseInt.length, undefined, 'The value of parseInt.length is expected to not equal ``undefined``'); 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 deleted file mode 100644 index 735e34432c..0000000000 --- a/test/built-ins/parseInt/S15.1.2.2_A9.3.js +++ /dev/null @@ -1,12 +0,0 @@ -// Copyright 2009 the Sputnik authors. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -info: The length property of parseInt has the attribute ReadOnly -esid: sec-parseint-string-radix -description: Checking if varying the length property fails -includes: [propertyHelper.js] ----*/ - -assert.sameValue(parseInt.length, 2, 'The value of parseInt.length is 2'); -verifyNotWritable(parseInt, "length", null, Infinity); diff --git a/test/built-ins/parseInt/S15.1.2.2_A9.4.js b/test/built-ins/parseInt/S15.1.2.2_A9.4.js deleted file mode 100644 index 5334f314ab..0000000000 --- a/test/built-ins/parseInt/S15.1.2.2_A9.4.js +++ /dev/null @@ -1,10 +0,0 @@ -// Copyright 2009 the Sputnik authors. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -info: The length property of parseInt is 2 -esid: sec-parseint-string-radix -description: parseInt.length === 2 ----*/ - -assert.sameValue(parseInt.length, 2, 'The value of parseInt.length is 2'); diff --git a/test/built-ins/parseInt/name.js b/test/built-ins/parseInt/name.js deleted file mode 100644 index 975dc2cea6..0000000000 --- a/test/built-ins/parseInt/name.js +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (C) 2015 André Bargull. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -esid: sec-parseint-string-radix -description: > - parseInt.name is "parseInt". -info: | - parseInt (string , radix) - - 17 ECMAScript Standard Built-in Objects: - Every built-in Function object, including constructors, that is not - identified as an anonymous function has a name property whose value - is a String. - - Unless otherwise specified, the name property of a built-in Function - object, if it exists, has the attributes { [[Writable]]: false, - [[Enumerable]]: false, [[Configurable]]: true }. -includes: [propertyHelper.js] ----*/ - -verifyProperty(parseInt, "name", { - value: "parseInt", - writable: false, - enumerable: false, - configurable: true -}); diff --git a/test/built-ins/parseInt/prop-desc.js b/test/built-ins/parseInt/prop-desc.js index 55f50092b0..dad9021dae 100644 --- a/test/built-ins/parseInt/prop-desc.js +++ b/test/built-ins/parseInt/prop-desc.js @@ -11,7 +11,7 @@ info: | includes: [propertyHelper.js] ---*/ -verifyProperty(this, "parseInt", { +verifyPrimordialCallableProperty(this, "parseInt", "parseInt", 2, { writable: true, enumerable: false, configurable: true