Bug 1332576 - Guard a test primitive that may not be in all shells. r=bbouvier, a=test-only
authorLars T Hansen <lhansen@mozilla.com>
Fri, 20 Jan 2017 11:40:56 +0100
changeset 350382 32fa32a616462f37394053f7eb73d070a69640d0
parent 350381 b9613014ba65c40a78227be03c69e993c70f96ad
child 350383 d1138edcbc38cd3011b93ac8fbcd8a27c1230db6
push id10616
push userryanvm@gmail.com
push dateSat, 21 Jan 2017 03:30:58 +0000
treeherdermozilla-aurora@3209927fdbf9 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbbouvier, test-only
bugs1332576
milestone52.0a2
Bug 1332576 - Guard a test primitive that may not be in all shells. r=bbouvier, a=test-only
js/src/tests/js1_8_5/extensions/sharedtypedarray.js
--- a/js/src/tests/js1_8_5/extensions/sharedtypedarray.js
+++ b/js/src/tests/js1_8_5/extensions/sharedtypedarray.js
@@ -171,27 +171,29 @@ function testSharedTypedArrayMethods() {
     assertEq(v[8], -4);
     assertEq(v[9], -5);
 }
 
 function testClone1() {
     var sab1 = b;
     var blob = serialize(sab1, []);
     var sab2 = deserialize(blob);
-    assertEq(sharedAddress(sab1), sharedAddress(sab2));
+    if (typeof sharedAddress != "undefined")
+	assertEq(sharedAddress(sab1), sharedAddress(sab2));
 }
 
 function testClone2() {
     var sab = b;
     var ia1 = new Int32Array(sab);
     var blob = serialize(ia1, []);
     var ia2 = deserialize(blob);
     assertEq(ia1.length, ia2.length);
     assertEq(ia1.buffer instanceof SharedArrayBuffer, true);
-    assertEq(sharedAddress(ia1.buffer), sharedAddress(ia2.buffer));
+    if (typeof sharedAddress != "undefined")
+	assertEq(sharedAddress(ia1.buffer), sharedAddress(ia2.buffer));
     ia1[10] = 37;
     assertEq(ia2[10], 37);
 }
 
 // Serializing a SharedArrayBuffer should fail if we've set its flag to 'deny' or if
 // the flag is bogus.
 
 function testNoClone() {
@@ -207,17 +209,18 @@ function testNoClone() {
 
 // Eventually, this will be prohibited, but for now, allow the SAB to
 // appear in the transfer list.  See bug 1302036 and bug 1302037.
 
 function testRedundantTransfer() {
     var sab1 = b;
     var blob = serialize(sab1, [sab1]);
     var sab2 = deserialize(blob);
-    assertEq(sharedAddress(sab1), sharedAddress(sab2));
+    if (typeof sharedAddress != "undefined")
+	assertEq(sharedAddress(sab1), sharedAddress(sab2));
 }
 
 function testApplicable() {
     var sab = b;
     var x;
 
     // Just make sure we can create all the view types on shared memory.