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

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

Issue 1218553004: Change d8 Worker API so it takes a string instead of a function. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: use template strings Created 5 years, 6 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
« no previous file with comments | « test/mjsunit/d8-worker-sharedarraybuffer.js ('k') | test/mjsunit/regress/regress-crbug-503578.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/d8-worker-spawn-worker.js
diff --git a/test/mjsunit/d8-worker-spawn-worker.js b/test/mjsunit/d8-worker-spawn-worker.js
index b9d7f9ade4fd116837c275a73867eeda26076e5a..a114d8587e0ebc7095565cfebb3634e7fdefbbe7 100644
--- a/test/mjsunit/d8-worker-spawn-worker.js
+++ b/test/mjsunit/d8-worker-spawn-worker.js
@@ -26,21 +26,15 @@
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
if (this.Worker) {
- function f() {
- var g = function () {
- postMessage(42);
- };
+ var workerScript =
+ `var w = new Worker('postMessage(42)');
+ onmessage = function(parentMsg) {
+ w.postMessage(parentMsg);
+ var childMsg = w.getMessage();
+ postMessage(childMsg);
+ };`;
- var w = new Worker(g);
-
- onmessage = function(parentMsg) {
- w.postMessage(parentMsg);
- var childMsg = w.getMessage();
- postMessage(childMsg);
- };
- }
-
- var w = new Worker(f);
+ var w = new Worker(workerScript);
w.postMessage(9);
assertEquals(42, w.getMessage());
}
« no previous file with comments | « test/mjsunit/d8-worker-sharedarraybuffer.js ('k') | test/mjsunit/regress/regress-crbug-503578.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698