Bug 1332576 - Guard a test primitive that may not be in all shells. r=bbouvier
authorLars T Hansen <lhansen@mozilla.com>
Fri, 20 Jan 2017 11:40:56 +0100
changeset 358364 8b510027eae07a61a61e80177bc327653cfe6b0b
parent 358363 bc99b50404754b0e0d1637defcf2d3bebe0fe912
child 358365 63c9d5f388ee125184fcdb0c1b506ab432a77867
push id10621
push userjlund@mozilla.com
push dateMon, 23 Jan 2017 16:02:43 +0000
treeherdermozilla-aurora@dca7b42e6c67 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbbouvier
bugs1332576
milestone53.0a1
Bug 1332576 - Guard a test primitive that may not be in all shells. r=bbouvier
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.