diff --git a/test/staging/sm/TypedArray/find-and-findIndex.js b/test/staging/sm/TypedArray/find-and-findIndex.js index 20d7bd633a..79d92164e2 100644 --- a/test/staging/sm/TypedArray/find-and-findIndex.js +++ b/test/staging/sm/TypedArray/find-and-findIndex.js @@ -10,6 +10,7 @@ flags: description: | Implement %TypedArray%.prototype.{find, findIndex} esid: pending +features: [Symbol] ---*/ const methods = ["find", "findIndex"]; @@ -27,9 +28,7 @@ anyTypedArrayConstructors.forEach(constructor => { assert.sameValue(arr[method](v => v === 3), 3); assert.sameValue(arr[method](v => v === 6), method === "find" ? undefined : -1); - var thisValues = [undefined, null, true, 1, "foo", [], {}]; - if (typeof Symbol == "function") - thisValues.push(Symbol()); + var thisValues = [undefined, null, true, 1, "foo", [], {}, Symbol()]; thisValues.forEach(thisArg => assert.throws(TypeError, () => arr[method].call(thisArg, () => true)) diff --git a/test/staging/sm/TypedArray/findLast-and-findLastIndex.js b/test/staging/sm/TypedArray/findLast-and-findLastIndex.js index 62b33221c5..e66bb5d441 100644 --- a/test/staging/sm/TypedArray/findLast-and-findLastIndex.js +++ b/test/staging/sm/TypedArray/findLast-and-findLastIndex.js @@ -10,6 +10,7 @@ flags: description: | Implement %TypedArray%.prototype.{findLast, findLastIndex} esid: pending +features: [Symbol] ---*/ const methods = ["findLast", "findLastIndex"]; @@ -27,9 +28,7 @@ anyTypedArrayConstructors.forEach(constructor => { assert.sameValue(arr[method](v => v === 3), 3); assert.sameValue(arr[method](v => v === 6), method === "findLast" ? undefined : -1); - var thisValues = [undefined, null, true, 1, "foo", [], {}]; - if (typeof Symbol == "function") - thisValues.push(Symbol()); + var thisValues = [undefined, null, true, 1, "foo", [], {}, Symbol()]; thisValues.forEach(thisArg => assert.throws(TypeError, () => arr[method].call(thisArg, () => true)) diff --git a/test/staging/sm/object/entries.js b/test/staging/sm/object/entries.js index f1210f4d78..915852e7db 100644 --- a/test/staging/sm/object/entries.js +++ b/test/staging/sm/object/entries.js @@ -10,7 +10,9 @@ flags: description: | pending esid: pending +features: [Symbol] ---*/ + if ("entries" in Object) { assert.sameValue(Object.entries.length, 1); @@ -65,8 +67,7 @@ if ("entries" in Object) { assert.deepEqual(Object.entries(1), []); assert.deepEqual(Object.entries(true), []); - if (typeof Symbol === "function") - assert.deepEqual(Object.entries(Symbol("foo")), []); + assert.deepEqual(Object.entries(Symbol("foo")), []); assert.deepEqual(Object.entries("foo"), [["0", "f"], ["1", "o"], ["2", "o"]]); diff --git a/test/staging/sm/object/freeze.js b/test/staging/sm/object/freeze.js index be7a1b8195..2b80ceea81 100644 --- a/test/staging/sm/object/freeze.js +++ b/test/staging/sm/object/freeze.js @@ -9,6 +9,7 @@ flags: description: | Object.freeze() should return its argument with no conversion when the argument is a primitive value esid: pending +features: [Symbol] ---*/ assert.sameValue(Object.freeze(), undefined); @@ -17,7 +18,4 @@ assert.sameValue(Object.freeze(null), null); assert.sameValue(Object.freeze(1), 1); assert.sameValue(Object.freeze("foo"), "foo"); assert.sameValue(Object.freeze(true), true); -if (typeof Symbol === "function") { - assert.sameValue(Object.freeze(Symbol.for("foo")), Symbol.for("foo")); -} - +assert.sameValue(Object.freeze(Symbol.for("foo")), Symbol.for("foo")); diff --git a/test/staging/sm/object/getOwnPropertyDescriptor.js b/test/staging/sm/object/getOwnPropertyDescriptor.js index 8381643338..32af3c121c 100644 --- a/test/staging/sm/object/getOwnPropertyDescriptor.js +++ b/test/staging/sm/object/getOwnPropertyDescriptor.js @@ -10,6 +10,7 @@ flags: description: | Coerce the argument passed to Object.getOwnPropertyDescriptor using ToObject esid: pending +features: [Symbol] ---*/ assert.throws(TypeError, () => Object.getOwnPropertyDescriptor()); @@ -18,9 +19,7 @@ assert.throws(TypeError, () => Object.getOwnPropertyDescriptor(null)); Object.getOwnPropertyDescriptor(1); Object.getOwnPropertyDescriptor(true); -if (typeof Symbol === "function") { - Object.getOwnPropertyDescriptor(Symbol("foo")); -} +Object.getOwnPropertyDescriptor(Symbol("foo")); assert.deepEqual(Object.getOwnPropertyDescriptor("foo", "length"), { value: 3, diff --git a/test/staging/sm/object/getPrototypeOf.js b/test/staging/sm/object/getPrototypeOf.js index d8f013721d..d3bcfe117f 100644 --- a/test/staging/sm/object/getPrototypeOf.js +++ b/test/staging/sm/object/getPrototypeOf.js @@ -9,6 +9,7 @@ flags: description: | Coerce the argument passed to Object.getPrototypeOf using ToObject esid: pending +features: [Symbol] ---*/ assert.throws(TypeError, () => Object.getPrototypeOf()); @@ -18,6 +19,4 @@ assert.throws(TypeError, () => Object.getPrototypeOf(null)); assert.sameValue(Object.getPrototypeOf(1), Number.prototype); assert.sameValue(Object.getPrototypeOf(true), Boolean.prototype); assert.sameValue(Object.getPrototypeOf("foo"), String.prototype); -if (typeof Symbol === "function") { - assert.sameValue(Object.getPrototypeOf(Symbol("foo")), Symbol.prototype); -} +assert.sameValue(Object.getPrototypeOf(Symbol("foo")), Symbol.prototype); diff --git a/test/staging/sm/object/isExtensible.js b/test/staging/sm/object/isExtensible.js index 75a0ab5b40..c10e119315 100644 --- a/test/staging/sm/object/isExtensible.js +++ b/test/staging/sm/object/isExtensible.js @@ -9,6 +9,7 @@ flags: description: | Object.isExtensible() should return false when given primitive values as input esid: pending +features: [Symbol] ---*/ assert.sameValue(Object.isExtensible(), false); @@ -17,6 +18,4 @@ assert.sameValue(Object.isExtensible(null), false); assert.sameValue(Object.isExtensible(1), false); assert.sameValue(Object.isExtensible("foo"), false); assert.sameValue(Object.isExtensible(true), false); -if (typeof Symbol === "function") { - assert.sameValue(Object.isExtensible(Symbol()), false); -} +assert.sameValue(Object.isExtensible(Symbol()), false); diff --git a/test/staging/sm/object/isFrozen.js b/test/staging/sm/object/isFrozen.js index 2310387ced..bff8d83276 100644 --- a/test/staging/sm/object/isFrozen.js +++ b/test/staging/sm/object/isFrozen.js @@ -9,6 +9,7 @@ flags: description: | Object.isFrozen() should return true when given primitive values as input esid: pending +features: [Symbol] ---*/ assert.sameValue(Object.isFrozen(), true); @@ -17,6 +18,4 @@ assert.sameValue(Object.isFrozen(null), true); assert.sameValue(Object.isFrozen(1), true); assert.sameValue(Object.isFrozen("foo"), true); assert.sameValue(Object.isFrozen(true), true); -if (typeof Symbol === "function") { - assert.sameValue(Object.isFrozen(Symbol()), true); -} +assert.sameValue(Object.isFrozen(Symbol()), true); diff --git a/test/staging/sm/object/isSealed.js b/test/staging/sm/object/isSealed.js index 6c198102c0..99e9f5561c 100644 --- a/test/staging/sm/object/isSealed.js +++ b/test/staging/sm/object/isSealed.js @@ -9,6 +9,7 @@ flags: description: | Object.isSealed() should return true when given primitive values as input esid: pending +features: [Symbol] ---*/ assert.sameValue(Object.isSealed(), true); @@ -17,6 +18,4 @@ assert.sameValue(Object.isSealed(null), true); assert.sameValue(Object.isSealed(1), true); assert.sameValue(Object.isSealed("foo"), true); assert.sameValue(Object.isSealed(true), true); -if (typeof Symbol === "function") { - assert.sameValue(Object.isSealed(Symbol()), true); -} +assert.sameValue(Object.isSealed(Symbol()), true); diff --git a/test/staging/sm/object/keys.js b/test/staging/sm/object/keys.js index f6c13f8da8..0616501741 100644 --- a/test/staging/sm/object/keys.js +++ b/test/staging/sm/object/keys.js @@ -10,6 +10,7 @@ flags: description: | Coerce the argument passed to Object.keys using ToObject esid: pending +features: [Symbol] ---*/ assert.throws(TypeError, () => Object.keys()); @@ -18,8 +19,6 @@ assert.throws(TypeError, () => Object.keys(null)); assert.compareArray(Object.keys(1), []); assert.compareArray(Object.keys(true), []); -if (typeof Symbol === "function") { - assert.compareArray(Object.keys(Symbol("foo")), []); -} +assert.compareArray(Object.keys(Symbol("foo")), []); assert.compareArray(Object.keys("foo"), ["0", "1", "2"]); diff --git a/test/staging/sm/object/preventExtensions.js b/test/staging/sm/object/preventExtensions.js index 314d471101..e320714445 100644 --- a/test/staging/sm/object/preventExtensions.js +++ b/test/staging/sm/object/preventExtensions.js @@ -9,6 +9,7 @@ flags: description: | Object.preventExtensions() should return its argument with no conversion when the argument is a primitive value esid: pending +features: [Symbol] ---*/ assert.sameValue(Object.preventExtensions(), undefined); @@ -17,6 +18,4 @@ assert.sameValue(Object.preventExtensions(null), null); assert.sameValue(Object.preventExtensions(1), 1); assert.sameValue(Object.preventExtensions("foo"), "foo"); assert.sameValue(Object.preventExtensions(true), true); -if (typeof Symbol === "function") { - assert.sameValue(Object.preventExtensions(Symbol.for("foo")), Symbol.for("foo")); -} +assert.sameValue(Object.preventExtensions(Symbol.for("foo")), Symbol.for("foo")); diff --git a/test/staging/sm/object/propertyIsEnumerable-proxy.js b/test/staging/sm/object/propertyIsEnumerable-proxy.js index 4d8b27cc52..0506f7a601 100644 --- a/test/staging/sm/object/propertyIsEnumerable-proxy.js +++ b/test/staging/sm/object/propertyIsEnumerable-proxy.js @@ -8,6 +8,7 @@ flags: description: | pending esid: pending +features: [Symbol] ---*/ /* Any copyright is dedicated to the Public Domain. * http://creativecommons.org/publicdomain/zero/1.0/ */ @@ -31,9 +32,7 @@ function logProxy(object) { return {proxy, log}; } -var properties = ["string-property"]; -if (typeof Symbol === 'function') - properties.push(Symbol("symbol-property")); +var properties = ["string-property", Symbol("symbol-property")]; for (var property of properties) { // Test 1: property is not present on object diff --git a/test/staging/sm/object/seal.js b/test/staging/sm/object/seal.js index 7be64917b8..ac61af7c1b 100644 --- a/test/staging/sm/object/seal.js +++ b/test/staging/sm/object/seal.js @@ -9,6 +9,7 @@ flags: description: | Object.seal() should return its argument with no conversion when the argument is a primitive value esid: pending +features: [Symbol] ---*/ assert.sameValue(Object.seal(), undefined); @@ -17,6 +18,4 @@ assert.sameValue(Object.seal(null), null); assert.sameValue(Object.seal(1), 1); assert.sameValue(Object.seal("foo"), "foo"); assert.sameValue(Object.seal(true), true); -if (typeof Symbol === "function") { - assert.sameValue(Object.seal(Symbol.for("foo")), Symbol.for("foo")); -} +assert.sameValue(Object.seal(Symbol.for("foo")), Symbol.for("foo")); diff --git a/test/staging/sm/object/values.js b/test/staging/sm/object/values.js index 8238c313e5..f64ad1298b 100644 --- a/test/staging/sm/object/values.js +++ b/test/staging/sm/object/values.js @@ -10,6 +10,7 @@ flags: description: | pending esid: pending +features: [Symbol] ---*/ if ("values" in Object) { assert.sameValue(Object.values.length, 1); @@ -65,8 +66,7 @@ if ("values" in Object) { assert.compareArray(Object.values(1), []); assert.compareArray(Object.values(true), []); - if (typeof Symbol === "function") - assert.compareArray(Object.values(Symbol("foo")), []); + assert.compareArray(Object.values(Symbol("foo")), []); assert.compareArray(Object.values("foo"), ["f", "o", "o"]);