Bug 1082202 - Fix propertyIsEnumerable-proxy.js test to run without Symbol available. rs=Waldo a=test-only CLOSED TREE
authorTill Schneidereit <till@tillschneidereit.net>
Mon, 13 Oct 2014 16:25:03 -0700
changeset 210263 551b01d447d19fcfaef8fa0edf74b565c4194905
parent 210262 ec600d4ffe61c0530d0153d5bc7fed26752a4178
child 210264 e4d22e719c37f783a4c7b0a33440131a6852e8c6
push id1
push userroot
push dateMon, 20 Oct 2014 17:29:22 +0000
reviewersWaldo, test-only
bugs1082202
milestone35.0a1
Bug 1082202 - Fix propertyIsEnumerable-proxy.js test to run without Symbol available. rs=Waldo a=test-only CLOSED TREE
js/src/tests/ecma_6/Object/propertyIsEnumerable-proxy.js
--- a/js/src/tests/ecma_6/Object/propertyIsEnumerable-proxy.js
+++ b/js/src/tests/ecma_6/Object/propertyIsEnumerable-proxy.js
@@ -15,17 +15,21 @@ function logProxy(object) {
                 throw new Error(`Unexpected call to trap: "${propertyKey}"`);
             }
             return target[propertyKey];
         }
     }));
     return {proxy, log};
 }
 
-for (var property of ["string-property", Symbol("symbol-property")]) {
+var properties = ["string-property"];
+if (typeof Symbol === 'function')
+    properties.push(Symbol("symbol-property"));
+
+for (var property of properties) {
     // Test 1: property is not present on object
     var {proxy, log} = logProxy({});
     var result = Object.prototype.propertyIsEnumerable.call(proxy, property);
     assertEq(result, false);
     assertDeepEq(log, [property]);
 
     // Test 2: property is present on object and enumerable
     var {proxy, log} = logProxy({[property]: 0});