Commit 3ee7b5c6 authored by Clemens Backes's avatar Clemens Backes Committed by Commit Bot

Revert "[d8] Fix a crash when getting the worker's onmessage handler"

This reverts commit a850668c.

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/+/2666693Reviewed-by: 's avatarClemens Backes <clemensb@chromium.org>
Commit-Queue: Clemens Backes <clemensb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#72481}
parent 5a0b81b4
......@@ -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>();
......
// 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');
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment