Follow-up to bug 1041631 - Make a new test work whether Symbol is defined or not. no_r=me, a=RyanVM on a CLOSED TREE.
authorJason Orendorff <jorendorff@mozilla.com>
Fri, 29 Aug 2014 10:59:19 -0500
changeset 202373 1badbbe5e9a32d70ea1bad8d5b63d1e2199aa30a
parent 202372 5ca1a1ec89d35ab4da84a0931e863084ee67e7d3
child 202374 e5558950266fb8a13a1588b766db7e8c260d6211
push id48408
push userjorendorff@mozilla.com
push dateFri, 29 Aug 2014 16:04:00 +0000
treeherdermozilla-inbound@1badbbe5e9a3 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersRyanVM
bugs1041631
milestone34.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Follow-up to bug 1041631 - Make a new test work whether Symbol is defined or not. no_r=me, a=RyanVM on a CLOSED TREE.
js/src/tests/ecma_6/Class/compPropNames.js
--- a/js/src/tests/ecma_6/Class/compPropNames.js
+++ b/js/src/tests/ecma_6/Class/compPropNames.js
@@ -210,21 +210,23 @@ syntaxError('a = {get@ [f1](){}, set [f1
 syntaxError('a = {get [f1](){}, set@ [f1](a){}}'); // unexpected symbol after set
 
 expr = "hey";
 a = {get [expr]() { return 3; }, set[expr](v) { throw 2; }};
 assertEq(a.hey, 3);
 assertThrowsValue(() => { a.hey = 5; }, 2);
 
 // Symbols with duplicate get and set.
-expr = Symbol("hey");
-a = {get [expr]() { return 3; }, set[expr](v) { throw 2; },
-     set [expr] (w) { throw 4; }, get[expr](){return 5; }};
-assertEq(a[expr], 5);
-assertThrowsValue(() => { a[expr] = 7; }, 4);
+if (typeof Symbol === "function") {
+    expr = Symbol("hey");
+    a = {get [expr]() { return 3; }, set[expr](v) { throw 2; },
+         set [expr] (w) { throw 4; }, get[expr](){return 5; }};
+    assertEq(a[expr], 5);
+    assertThrowsValue(() => { a[expr] = 7; }, 4);
+}
 
 // expressions with side effects are called in the right order
 log = "";
 obj = {
     "a": log += 'a',
     get [log += 'b']() {},
     [log += 'c']: log += 'd',
     set [log += 'e'](a) {}