Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(73)

Unified Diff: test/mjsunit/d8-worker.js

Issue 2643723010: [d8] Use ValueSerializer for postMessage (instead of ad-hoc serializer) (Closed)
Patch Set: forgot hash_combine Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: test/mjsunit/d8-worker.js
diff --git a/test/mjsunit/d8-worker.js b/test/mjsunit/d8-worker.js
index f172fb160338338476473503e54514cb1a994bde..140cf3ccd89e51e5ace073e6bdfb0fec0a9cf67a 100644
--- a/test/mjsunit/d8-worker.js
+++ b/test/mjsunit/d8-worker.js
@@ -61,8 +61,8 @@ var workerScript =
}
break;
case 7:
- if (JSON.stringify(m) !== \"{'a':1,'b':2.5,'c':'three'}\")
- throw new Error('Object');
+ if (JSON.stringify(m) !== '{"a":1,"b":2.5,"c":"three"}')
+ throw new Error('Object' + JSON.stringify(m));
break;
case 8:
var ab = m;
@@ -88,7 +88,6 @@ var workerScript =
}
};`;
-
if (this.Worker) {
function createArrayBuffer(byteLength) {
var ab = new ArrayBuffer(byteLength);
@@ -111,6 +110,17 @@ if (this.Worker) {
w.postMessage([4, true, "bye"]);
w.postMessage({a: 1, b: 2.5, c: "three"});
+ // Test bad get in transfer list.
+ var transferList = [undefined];
+ Object.defineProperty(transferList, '0', {
+ get: function() {
+ throw 'unexpected!';
+ }
+ });
+ assertThrows(function() {
+ w.postMessage([], transferList);
+ });
+
// Clone ArrayBuffer
var ab1 = createArrayBuffer(16);
w.postMessage(ab1);

Powered by Google App Engine
This is Rietveld 408576698