From 72db5f1ec1288ac9f73212a46914be9acc652058 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Bargull?= Date: Thu, 21 Dec 2017 12:08:21 -0800 Subject: Replace mustHaveProperty with verifyProperty --- harness/testIntl.js | 45 --------------------------------------------- 1 file changed, 45 deletions(-) (limited to 'harness') diff --git a/harness/testIntl.js b/harness/testIntl.js index 5646e9c2e..690791d7d 100644 --- a/harness/testIntl.js +++ b/harness/testIntl.js @@ -828,51 +828,6 @@ function testOption(Constructor, property, type, values, fallback, testOptions) } -/** - * Tests whether the named property of the given object has a valid value - * and the default attributes of the properties of an object literal. - * @param {Object} obj the object to be tested. - * @param {string} property the name of the property - * @param {Function|Array} valid either a function that tests value for validity and returns a boolean, - * an array of valid values. - * @exception if the property has an invalid value. - */ -function testProperty(obj, property, valid) { - var desc = Object.getOwnPropertyDescriptor(obj, property); - if (!desc.writable) { - $ERROR("Property " + property + " must be writable."); - } - if (!desc.enumerable) { - $ERROR("Property " + property + " must be enumerable."); - } - if (!desc.configurable) { - $ERROR("Property " + property + " must be configurable."); - } - var value = desc.value; - var isValid = (typeof valid === "function") ? valid(value) : (valid.indexOf(value) !== -1); - if (!isValid) { - $ERROR("Property value " + value + " is not allowed for property " + property + "."); - } -} - - -/** - * Tests whether the given object has the named property with a valid value - * and the default attributes of the properties of an object literal. - * @param {Object} obj the object to be tested. - * @param {string} property the name of the property - * @param {Function|Array} valid either a function that tests value for validity and returns a boolean, - * an array of valid values. - * @exception if the property is missing or has an invalid value. - */ -function mustHaveProperty(obj, property, valid) { - if (!obj.hasOwnProperty(property)) { - $ERROR("Object is missing property " + property + "."); - } - testProperty(obj, property, valid); -} - - /** * Properties of the RegExp constructor that may be affected by use of regular * expressions, and the default values of these properties. Properties are from -- cgit v1.2.1