Index: test/mjsunit/d8-worker-sharedarraybuffer.js |
diff --git a/test/mjsunit/d8-worker-sharedarraybuffer.js b/test/mjsunit/d8-worker-sharedarraybuffer.js |
index 3fe9fdd143b1eab5eabe85ff57dcf908e524a39f..09586c3a11c7bcebb3d8aca5e41680784c528b3e 100644 |
--- a/test/mjsunit/d8-worker-sharedarraybuffer.js |
+++ b/test/mjsunit/d8-worker-sharedarraybuffer.js |
@@ -28,20 +28,19 @@ |
// Flags: --harmony-sharedarraybuffer |
if (this.Worker) { |
- |
(function TestTransfer() { |
var workerScript = |
`onmessage = function(m) { |
- var sab = m; |
- var ta = new Uint32Array(sab); |
- if (sab.byteLength !== 16) { |
- throw new Error('SharedArrayBuffer transfer byteLength'); |
- } |
- for (var i = 0; i < 4; ++i) { |
- if (ta[i] !== i) { |
- throw new Error('SharedArrayBuffer transfer value ' + i); |
- } |
- } |
+ var sab = m; |
+ var ta = new Uint32Array(sab); |
+ if (sab.byteLength !== 16) { |
+ throw new Error('SharedArrayBuffer transfer byteLength'); |
+ } |
+ for (var i = 0; i < 4; ++i) { |
+ if (ta[i] !== i) { |
+ throw new Error('SharedArrayBuffer transfer value ' + i); |
+ } |
+ } |
// Atomically update ta[0] |
Atomics.store(ta, 0, 100); |
};`; |
@@ -55,7 +54,7 @@ if (this.Worker) { |
} |
// Transfer SharedArrayBuffer |
- w.postMessage(sab, [sab]); |
+ w.postMessage(sab); |
assertEquals(16, sab.byteLength); // ArrayBuffer should not be neutered. |
// Spinwait for the worker to update ta[0] |
@@ -86,7 +85,7 @@ if (this.Worker) { |
var workers = []; |
for (id = 0; id < 4; ++id) { |
workers[id] = new Worker(workerScript); |
- workers[id].postMessage({sab: sab, id: id}, [sab]); |
+ workers[id].postMessage({sab: sab, id: id}); |
} |
// Spinwait for each worker to update ta[id] |