From: binji Date: Tue, 11 Aug 2015 00:17:01 +0000 (-0700) Subject: [d8 Workers] Make Worker prototype read-only X-Git-Tag: upstream/4.7.83~941 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=cd9293445e69c51846795fe9f526e970585a1423;p=platform%2Fupstream%2Fv8.git [d8 Workers] Make Worker prototype read-only BUG=chromium:518747 R=mstarzinger@chromium.org LOG=n Review URL: https://codereview.chromium.org/1277543006 Cr-Commit-Position: refs/heads/master@{#30099} --- diff --git a/src/d8.cc b/src/d8.cc index d55faabe8..5fa7c2629 100644 --- a/src/d8.cc +++ b/src/d8.cc @@ -1144,6 +1144,7 @@ Local Shell::CreateGlobalTemplate(Isolate* isolate) { worker_fun_template->SetClassName( String::NewFromUtf8(isolate, "Worker", NewStringType::kNormal) .ToLocalChecked()); + worker_fun_template->ReadOnlyPrototype(); worker_fun_template->PrototypeTemplate()->Set( String::NewFromUtf8(isolate, "terminate", NewStringType::kNormal) .ToLocalChecked(), diff --git a/test/mjsunit/regress/regress-crbug-518747.js b/test/mjsunit/regress/regress-crbug-518747.js new file mode 100644 index 000000000..f1787c4c4 --- /dev/null +++ b/test/mjsunit/regress/regress-crbug-518747.js @@ -0,0 +1,9 @@ +// 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) { + Worker.prototype = 12; + var __v_6 = new Worker(''); + __v_6.postMessage([]); +}