From 32aa7c263631a192b9bd763f2eec5bc83a20e7df Mon Sep 17 00:00:00 2001 From: Denis Pushkarev Date: Sat, 30 Jan 2016 23:07:47 +0600 Subject: [PATCH] [tests] remove `Object.getOwnPropertySymbols` hard dependency from some native tests --- tests/es.js | 26 ++++++++++---------- tests/tests.js | 26 ++++++++++---------- tests/tests/es6.map.ls | 2 +- tests/tests/es6.object.freeze.ls | 4 +-- tests/tests/es6.object.prevent-extensions.ls | 4 +-- tests/tests/es6.object.seal.ls | 4 +-- tests/tests/es6.set.ls | 2 +- tests/tests/es6.weak-map.ls | 2 +- tests/tests/es6.weak-set.ls | 2 +- 9 files changed, 36 insertions(+), 36 deletions(-) diff --git a/tests/es.js b/tests/es.js index f8a1f6561f39..8a1d94ae4a88 100644 --- a/tests/es.js +++ b/tests/es.js @@ -1350,7 +1350,7 @@ assert.arrayEqual(Object.keys(o), []); } assert.arrayEqual(Object.getOwnPropertyNames(o), []); - assert.arrayEqual(Object.getOwnPropertySymbols(o), []); + ((typeof Object != 'undefined' && Object !== null) && Object.getOwnPropertySymbols) && assert.arrayEqual(Object.getOwnPropertySymbols(o), []); ((typeof Reflect != 'undefined' && Reflect !== null) && Reflect.ownKeys) && assert.arrayEqual(Reflect.ownKeys(o), []); if (nativeSubclass) { C = nativeSubclass(Map); @@ -2942,8 +2942,8 @@ module = QUnit.module, test = QUnit.test; module('ES6'); test('Object.freeze', function(assert){ - var freeze, isFrozen, keys, getOwnPropertyNames, getOwnPropertySymbols, i$, ref$, len$, value, key; - freeze = Object.freeze, isFrozen = Object.isFrozen, keys = Object.keys, getOwnPropertyNames = Object.getOwnPropertyNames, getOwnPropertySymbols = Object.getOwnPropertySymbols; + var freeze, isFrozen, keys, getOwnPropertyNames, i$, ref$, len$, value, key; + freeze = Object.freeze, isFrozen = Object.isFrozen, keys = Object.keys, getOwnPropertyNames = Object.getOwnPropertyNames; assert.isFunction(freeze); assert.arity(freeze, 1); assert.name(freeze, 'freeze'); @@ -2965,7 +2965,7 @@ }()), []); assert.arrayEqual(keys(freeze({})), []); assert.arrayEqual(getOwnPropertyNames(freeze({})), []); - assert.arrayEqual(getOwnPropertySymbols(freeze({})), []); + ((typeof Object != 'undefined' && Object !== null) && Object.getOwnPropertySymbols) && assert.arrayEqual(Object.getOwnPropertySymbols(freeze({})), []); ((typeof Reflect != 'undefined' && Reflect !== null) && Reflect.ownKeys) && assert.arrayEqual(Reflect.ownKeys(freeze({})), []); function fn$(){ try { @@ -3287,8 +3287,8 @@ module = QUnit.module, test = QUnit.test; module('ES6'); test('Object.preventExtensions', function(assert){ - var preventExtensions, isExtensible, keys, getOwnPropertyNames, getOwnPropertySymbols, i$, ref$, len$, value, key; - preventExtensions = Object.preventExtensions, isExtensible = Object.isExtensible, keys = Object.keys, getOwnPropertyNames = Object.getOwnPropertyNames, getOwnPropertySymbols = Object.getOwnPropertySymbols; + var preventExtensions, isExtensible, keys, getOwnPropertyNames, i$, ref$, len$, value, key; + preventExtensions = Object.preventExtensions, isExtensible = Object.isExtensible, keys = Object.keys, getOwnPropertyNames = Object.getOwnPropertyNames; assert.isFunction(preventExtensions); assert.arity(preventExtensions, 1); assert.name(preventExtensions, 'preventExtensions'); @@ -3310,7 +3310,7 @@ }()), []); assert.arrayEqual(keys(preventExtensions({})), []); assert.arrayEqual(getOwnPropertyNames(preventExtensions({})), []); - assert.arrayEqual(getOwnPropertySymbols(preventExtensions({})), []); + ((typeof Object != 'undefined' && Object !== null) && Object.getOwnPropertySymbols) && assert.arrayEqual(Object.getOwnPropertySymbols(preventExtensions({})), []); ((typeof Reflect != 'undefined' && Reflect !== null) && Reflect.ownKeys) && assert.arrayEqual(Reflect.ownKeys(preventExtensions({})), []); function fn$(){ try { @@ -3327,8 +3327,8 @@ module = QUnit.module, test = QUnit.test; module('ES6'); test('Object.seal', function(assert){ - var seal, isSealed, keys, getOwnPropertyNames, getOwnPropertySymbols, i$, ref$, len$, value, key; - seal = Object.seal, isSealed = Object.isSealed, keys = Object.keys, getOwnPropertyNames = Object.getOwnPropertyNames, getOwnPropertySymbols = Object.getOwnPropertySymbols; + var seal, isSealed, keys, getOwnPropertyNames, i$, ref$, len$, value, key; + seal = Object.seal, isSealed = Object.isSealed, keys = Object.keys, getOwnPropertyNames = Object.getOwnPropertyNames; assert.isFunction(seal); assert.arity(seal, 1); assert.name(seal, 'seal'); @@ -3350,7 +3350,7 @@ }()), []); assert.arrayEqual(keys(seal({})), []); assert.arrayEqual(getOwnPropertyNames(seal({})), []); - assert.arrayEqual(getOwnPropertySymbols(seal({})), []); + ((typeof Object != 'undefined' && Object !== null) && Object.getOwnPropertySymbols) && assert.arrayEqual(Object.getOwnPropertySymbols(seal({})), []); ((typeof Reflect != 'undefined' && Reflect !== null) && Reflect.ownKeys) && assert.arrayEqual(Reflect.ownKeys(seal({})), []); function fn$(){ try { @@ -5718,7 +5718,7 @@ assert.arrayEqual(Object.keys(o), []); } assert.arrayEqual(Object.getOwnPropertyNames(o), []); - assert.arrayEqual(Object.getOwnPropertySymbols(o), []); + ((typeof Object != 'undefined' && Object !== null) && Object.getOwnPropertySymbols) && assert.arrayEqual(Object.getOwnPropertySymbols(o), []); ((typeof Reflect != 'undefined' && Reflect !== null) && Reflect.ownKeys) && assert.arrayEqual(Reflect.ownKeys(o), []); if (nativeSubclass) { C = nativeSubclass(Set); @@ -9099,7 +9099,7 @@ assert.arrayEqual(Object.keys(o), []); } assert.arrayEqual(Object.getOwnPropertyNames(o), []); - assert.arrayEqual(Object.getOwnPropertySymbols(o), []); + ((typeof Object != 'undefined' && Object !== null) && Object.getOwnPropertySymbols) && assert.arrayEqual(Object.getOwnPropertySymbols(o), []); ((typeof Reflect != 'undefined' && Reflect !== null) && Reflect.ownKeys) && assert.arrayEqual(Reflect.ownKeys(o), []); if (nativeSubclass) { C = nativeSubclass(WeakMap); @@ -9241,7 +9241,7 @@ assert.arrayEqual(Object.keys(o), []); } assert.arrayEqual(Object.getOwnPropertyNames(o), []); - assert.arrayEqual(Object.getOwnPropertySymbols(o), []); + ((typeof Object != 'undefined' && Object !== null) && Object.getOwnPropertySymbols) && assert.arrayEqual(Object.getOwnPropertySymbols(o), []); ((typeof Reflect != 'undefined' && Reflect !== null) && Reflect.ownKeys) && assert.arrayEqual(Reflect.ownKeys(o), []); if (nativeSubclass) { C = nativeSubclass(WeakSet); diff --git a/tests/tests.js b/tests/tests.js index e3bbc882129c..d8bcceb9ccfa 100644 --- a/tests/tests.js +++ b/tests/tests.js @@ -2161,7 +2161,7 @@ assert.arrayEqual(Object.keys(o), []); } assert.arrayEqual(Object.getOwnPropertyNames(o), []); - assert.arrayEqual(Object.getOwnPropertySymbols(o), []); + ((typeof Object != 'undefined' && Object !== null) && Object.getOwnPropertySymbols) && assert.arrayEqual(Object.getOwnPropertySymbols(o), []); ((typeof Reflect != 'undefined' && Reflect !== null) && Reflect.ownKeys) && assert.arrayEqual(Reflect.ownKeys(o), []); if (nativeSubclass) { C = nativeSubclass(Map); @@ -3753,8 +3753,8 @@ module = QUnit.module, test = QUnit.test; module('ES6'); test('Object.freeze', function(assert){ - var freeze, isFrozen, keys, getOwnPropertyNames, getOwnPropertySymbols, i$, ref$, len$, value, key; - freeze = Object.freeze, isFrozen = Object.isFrozen, keys = Object.keys, getOwnPropertyNames = Object.getOwnPropertyNames, getOwnPropertySymbols = Object.getOwnPropertySymbols; + var freeze, isFrozen, keys, getOwnPropertyNames, i$, ref$, len$, value, key; + freeze = Object.freeze, isFrozen = Object.isFrozen, keys = Object.keys, getOwnPropertyNames = Object.getOwnPropertyNames; assert.isFunction(freeze); assert.arity(freeze, 1); assert.name(freeze, 'freeze'); @@ -3776,7 +3776,7 @@ }()), []); assert.arrayEqual(keys(freeze({})), []); assert.arrayEqual(getOwnPropertyNames(freeze({})), []); - assert.arrayEqual(getOwnPropertySymbols(freeze({})), []); + ((typeof Object != 'undefined' && Object !== null) && Object.getOwnPropertySymbols) && assert.arrayEqual(Object.getOwnPropertySymbols(freeze({})), []); ((typeof Reflect != 'undefined' && Reflect !== null) && Reflect.ownKeys) && assert.arrayEqual(Reflect.ownKeys(freeze({})), []); function fn$(){ try { @@ -4098,8 +4098,8 @@ module = QUnit.module, test = QUnit.test; module('ES6'); test('Object.preventExtensions', function(assert){ - var preventExtensions, isExtensible, keys, getOwnPropertyNames, getOwnPropertySymbols, i$, ref$, len$, value, key; - preventExtensions = Object.preventExtensions, isExtensible = Object.isExtensible, keys = Object.keys, getOwnPropertyNames = Object.getOwnPropertyNames, getOwnPropertySymbols = Object.getOwnPropertySymbols; + var preventExtensions, isExtensible, keys, getOwnPropertyNames, i$, ref$, len$, value, key; + preventExtensions = Object.preventExtensions, isExtensible = Object.isExtensible, keys = Object.keys, getOwnPropertyNames = Object.getOwnPropertyNames; assert.isFunction(preventExtensions); assert.arity(preventExtensions, 1); assert.name(preventExtensions, 'preventExtensions'); @@ -4121,7 +4121,7 @@ }()), []); assert.arrayEqual(keys(preventExtensions({})), []); assert.arrayEqual(getOwnPropertyNames(preventExtensions({})), []); - assert.arrayEqual(getOwnPropertySymbols(preventExtensions({})), []); + ((typeof Object != 'undefined' && Object !== null) && Object.getOwnPropertySymbols) && assert.arrayEqual(Object.getOwnPropertySymbols(preventExtensions({})), []); ((typeof Reflect != 'undefined' && Reflect !== null) && Reflect.ownKeys) && assert.arrayEqual(Reflect.ownKeys(preventExtensions({})), []); function fn$(){ try { @@ -4138,8 +4138,8 @@ module = QUnit.module, test = QUnit.test; module('ES6'); test('Object.seal', function(assert){ - var seal, isSealed, keys, getOwnPropertyNames, getOwnPropertySymbols, i$, ref$, len$, value, key; - seal = Object.seal, isSealed = Object.isSealed, keys = Object.keys, getOwnPropertyNames = Object.getOwnPropertyNames, getOwnPropertySymbols = Object.getOwnPropertySymbols; + var seal, isSealed, keys, getOwnPropertyNames, i$, ref$, len$, value, key; + seal = Object.seal, isSealed = Object.isSealed, keys = Object.keys, getOwnPropertyNames = Object.getOwnPropertyNames; assert.isFunction(seal); assert.arity(seal, 1); assert.name(seal, 'seal'); @@ -4161,7 +4161,7 @@ }()), []); assert.arrayEqual(keys(seal({})), []); assert.arrayEqual(getOwnPropertyNames(seal({})), []); - assert.arrayEqual(getOwnPropertySymbols(seal({})), []); + ((typeof Object != 'undefined' && Object !== null) && Object.getOwnPropertySymbols) && assert.arrayEqual(Object.getOwnPropertySymbols(seal({})), []); ((typeof Reflect != 'undefined' && Reflect !== null) && Reflect.ownKeys) && assert.arrayEqual(Reflect.ownKeys(seal({})), []); function fn$(){ try { @@ -6529,7 +6529,7 @@ assert.arrayEqual(Object.keys(o), []); } assert.arrayEqual(Object.getOwnPropertyNames(o), []); - assert.arrayEqual(Object.getOwnPropertySymbols(o), []); + ((typeof Object != 'undefined' && Object !== null) && Object.getOwnPropertySymbols) && assert.arrayEqual(Object.getOwnPropertySymbols(o), []); ((typeof Reflect != 'undefined' && Reflect !== null) && Reflect.ownKeys) && assert.arrayEqual(Reflect.ownKeys(o), []); if (nativeSubclass) { C = nativeSubclass(Set); @@ -9910,7 +9910,7 @@ assert.arrayEqual(Object.keys(o), []); } assert.arrayEqual(Object.getOwnPropertyNames(o), []); - assert.arrayEqual(Object.getOwnPropertySymbols(o), []); + ((typeof Object != 'undefined' && Object !== null) && Object.getOwnPropertySymbols) && assert.arrayEqual(Object.getOwnPropertySymbols(o), []); ((typeof Reflect != 'undefined' && Reflect !== null) && Reflect.ownKeys) && assert.arrayEqual(Reflect.ownKeys(o), []); if (nativeSubclass) { C = nativeSubclass(WeakMap); @@ -10052,7 +10052,7 @@ assert.arrayEqual(Object.keys(o), []); } assert.arrayEqual(Object.getOwnPropertyNames(o), []); - assert.arrayEqual(Object.getOwnPropertySymbols(o), []); + ((typeof Object != 'undefined' && Object !== null) && Object.getOwnPropertySymbols) && assert.arrayEqual(Object.getOwnPropertySymbols(o), []); ((typeof Reflect != 'undefined' && Reflect !== null) && Reflect.ownKeys) && assert.arrayEqual(Reflect.ownKeys(o), []); if (nativeSubclass) { C = nativeSubclass(WeakSet); diff --git a/tests/tests/es6.map.ls b/tests/tests/es6.map.ls index 9fb3bb9b7f24..19bdb0e9ddff 100644 --- a/tests/tests/es6.map.ls +++ b/tests/tests/es6.map.ls @@ -39,7 +39,7 @@ test 'Map' (assert)-> assert.arrayEqual [key for key of o], [] assert.arrayEqual Object.keys(o), [] assert.arrayEqual Object.getOwnPropertyNames(o), [] - assert.arrayEqual Object.getOwnPropertySymbols(o), [] + Object?getOwnPropertySymbols and assert.arrayEqual Object.getOwnPropertySymbols(o), [] Reflect?ownKeys and assert.arrayEqual Reflect.ownKeys(o), [] if nativeSubclass C = nativeSubclass Map diff --git a/tests/tests/es6.object.freeze.ls b/tests/tests/es6.object.freeze.ls index de00038ad650..b11aaf3694cb 100644 --- a/tests/tests/es6.object.freeze.ls +++ b/tests/tests/es6.object.freeze.ls @@ -2,7 +2,7 @@ module \ES6 test 'Object.freeze' (assert)!-> - {freeze, isFrozen, keys, getOwnPropertyNames, getOwnPropertySymbols} = Object + {freeze, isFrozen, keys, getOwnPropertyNames} = Object assert.isFunction freeze assert.arity freeze, 1 assert.name freeze, \freeze @@ -15,5 +15,5 @@ test 'Object.freeze' (assert)!-> assert.arrayEqual [key for key of freeze {}], [] assert.arrayEqual keys(freeze {}), [] assert.arrayEqual getOwnPropertyNames(freeze {}), [] - assert.arrayEqual getOwnPropertySymbols(freeze {}), [] + Object?getOwnPropertySymbols and assert.arrayEqual Object.getOwnPropertySymbols(freeze {}), [] Reflect?ownKeys and assert.arrayEqual Reflect.ownKeys(freeze {}), [] \ No newline at end of file diff --git a/tests/tests/es6.object.prevent-extensions.ls b/tests/tests/es6.object.prevent-extensions.ls index 10e27b9986ed..0c14199ee5ca 100644 --- a/tests/tests/es6.object.prevent-extensions.ls +++ b/tests/tests/es6.object.prevent-extensions.ls @@ -2,7 +2,7 @@ module \ES6 test 'Object.preventExtensions' (assert)!-> - {preventExtensions, isExtensible, keys, getOwnPropertyNames, getOwnPropertySymbols} = Object + {preventExtensions, isExtensible, keys, getOwnPropertyNames} = Object assert.isFunction preventExtensions assert.arity preventExtensions, 1 assert.name preventExtensions, \preventExtensions @@ -15,5 +15,5 @@ test 'Object.preventExtensions' (assert)!-> assert.arrayEqual [key for key of preventExtensions {}], [] assert.arrayEqual keys(preventExtensions {}), [] assert.arrayEqual getOwnPropertyNames(preventExtensions {}), [] - assert.arrayEqual getOwnPropertySymbols(preventExtensions {}), [] + Object?getOwnPropertySymbols and assert.arrayEqual Object.getOwnPropertySymbols(preventExtensions {}), [] Reflect?ownKeys and assert.arrayEqual Reflect.ownKeys(preventExtensions {}), [] \ No newline at end of file diff --git a/tests/tests/es6.object.seal.ls b/tests/tests/es6.object.seal.ls index 528540a4b8ed..ca58a745a23e 100644 --- a/tests/tests/es6.object.seal.ls +++ b/tests/tests/es6.object.seal.ls @@ -2,7 +2,7 @@ module \ES6 test 'Object.seal' (assert)!-> - {seal, isSealed, keys, getOwnPropertyNames, getOwnPropertySymbols} = Object + {seal, isSealed, keys, getOwnPropertyNames} = Object assert.isFunction seal assert.arity seal, 1 assert.name seal, \seal @@ -15,5 +15,5 @@ test 'Object.seal' (assert)!-> assert.arrayEqual [key for key of seal {}], [] assert.arrayEqual keys(seal {}), [] assert.arrayEqual getOwnPropertyNames(seal {}), [] - assert.arrayEqual getOwnPropertySymbols(seal {}), [] + Object?getOwnPropertySymbols and assert.arrayEqual Object.getOwnPropertySymbols(seal {}), [] Reflect?ownKeys and assert.arrayEqual Reflect.ownKeys(seal {}), [] \ No newline at end of file diff --git a/tests/tests/es6.set.ls b/tests/tests/es6.set.ls index cabdd0644a06..5b8873cad113 100644 --- a/tests/tests/es6.set.ls +++ b/tests/tests/es6.set.ls @@ -60,7 +60,7 @@ test 'Set' (assert)-> assert.arrayEqual [key for key of o], [] assert.arrayEqual Object.keys(o), [] assert.arrayEqual Object.getOwnPropertyNames(o), [] - assert.arrayEqual Object.getOwnPropertySymbols(o), [] + Object?getOwnPropertySymbols and assert.arrayEqual Object.getOwnPropertySymbols(o), [] Reflect?ownKeys and assert.arrayEqual Reflect.ownKeys(o), [] if nativeSubclass C = nativeSubclass Set diff --git a/tests/tests/es6.weak-map.ls b/tests/tests/es6.weak-map.ls index 52ec7c20dcbc..a9b7e9d712f5 100644 --- a/tests/tests/es6.weak-map.ls +++ b/tests/tests/es6.weak-map.ls @@ -44,7 +44,7 @@ test 'WeakMap' (assert)!-> assert.arrayEqual [key for key of o], [] assert.arrayEqual Object.keys(o), [] assert.arrayEqual Object.getOwnPropertyNames(o), [] - assert.arrayEqual Object.getOwnPropertySymbols(o), [] + Object?getOwnPropertySymbols and assert.arrayEqual Object.getOwnPropertySymbols(o), [] Reflect?ownKeys and assert.arrayEqual Reflect.ownKeys(o), [] if nativeSubclass C = nativeSubclass WeakMap diff --git a/tests/tests/es6.weak-set.ls b/tests/tests/es6.weak-set.ls index 63d799e3bf11..e10fe2ba6af6 100644 --- a/tests/tests/es6.weak-set.ls +++ b/tests/tests/es6.weak-set.ls @@ -41,7 +41,7 @@ test 'WeakSet' (assert)!-> assert.arrayEqual [key for key of o], [] assert.arrayEqual Object.keys(o), [] assert.arrayEqual Object.getOwnPropertyNames(o), [] - assert.arrayEqual Object.getOwnPropertySymbols(o), [] + Object?getOwnPropertySymbols and assert.arrayEqual Object.getOwnPropertySymbols(o), [] Reflect?ownKeys and assert.arrayEqual Reflect.ownKeys(o), [] if nativeSubclass C = nativeSubclass WeakSet