v8/test/mjsunit/regress/regress-crbug-511880.js
binji a87db3dec8 [d8 Workers] Fix bug creating Worker during main thread termination
When the main thread terminates, it forcibly terminates all Worker threads.
When this happens, the threads objects were only half-created; they had a
JavaScript Worker object, but not a C++ worker object.

This CL fixes that bug, as well as some other fixes:
* Signatures on Worker methods
* Use SetAlignedPointerFromInternalField instead of using an External.
* Remove state_ from Worker. Simplify to atomic bool running_.

BUG=chromium:511880
R=jarin@chromium.org
LOG=n

Review URL: https://codereview.chromium.org/1255563002

Cr-Commit-Position: refs/heads/master@{#29911}
2015-07-30 08:19:39 +00:00

14 lines
394 B
JavaScript

// Copyright 2015 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
if (this.Worker) {
var __v_8 =
`var __v_9 = new Worker('postMessage(42)');
onmessage = function(parentMsg) {
__v_9.postMessage(parentMsg);
};`;
var __v_9 = new Worker(__v_8);
__v_9.postMessage(9);
}