Revert "[d8] Fix a crash when getting the worker's onmessage handler"
This reverts commit a850668ccf
.
Reason for revert: new test flaking on many bots, e.g. https://ci.chromium.org/ui/p/v8/builders/ci/V8%20Win32/31068/overview
Original change's description:
> [d8] Fix a crash when getting the worker's onmessage handler
>
> Bug: chromium:1162473
> Change-Id: Ided2f52882aaf02e1dc9a8d0ba883fedf029464d
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2663004
> Reviewed-by: Camillo Bruni <cbruni@chromium.org>
> Commit-Queue: Marja Hölttä <marja@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#72473}
TBR=marja@chromium.org,cbruni@chromium.org
Change-Id: I5ec056185967974a94fd61baec8a75e855e1a272
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: chromium:1162473, v8:11383
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2666693
Reviewed-by: Clemens Backes <clemensb@chromium.org>
Commit-Queue: Clemens Backes <clemensb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#72481}
This commit is contained in:
parent
5a0b81b493
commit
3ee7b5c6c4
11
src/d8/d8.cc
11
src/d8/d8.cc
@ -3547,11 +3547,12 @@ void Worker::ProcessMessage(std::unique_ptr<SerializationData> data) {
|
||||
Local<Object> global = context->Global();
|
||||
|
||||
// Get the message handler.
|
||||
MaybeLocal<Value> maybe_onmessage = global->Get(
|
||||
context, String::NewFromUtf8Literal(isolate_, "onmessage",
|
||||
NewStringType::kInternalized));
|
||||
Local<Value> onmessage;
|
||||
if (!maybe_onmessage.ToLocal(&onmessage) || !onmessage->IsFunction()) {
|
||||
Local<Value> onmessage = global
|
||||
->Get(context, String::NewFromUtf8Literal(
|
||||
isolate_, "onmessage",
|
||||
NewStringType::kInternalized))
|
||||
.ToLocalChecked();
|
||||
if (!onmessage->IsFunction()) {
|
||||
return;
|
||||
}
|
||||
Local<Function> onmessage_fun = onmessage.As<Function>();
|
||||
|
@ -1,7 +0,0 @@
|
||||
// Copyright 2021 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.
|
||||
|
||||
const script = `__proto__ = Realm.global(Realm.create());`;
|
||||
const w = new Worker(script, {type : 'string'});
|
||||
w.postMessage('hi');
|
Loading…
Reference in New Issue
Block a user