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

Unified Diff: src/objects.cc

Issue 1529303003: Throw TypeError when reading global references through a JSProxy (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Increased testing Created 5 years 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 | « src/messages.h ('k') | test/mjsunit/harmony/proxies-global-reference.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/objects.cc
diff --git a/src/objects.cc b/src/objects.cc
index 732477cd81ff9852091de87e7a262a58e2bcecfc..431559d4f396104543f9c4760dfe0bd67f106fd7 100644
--- a/src/objects.cc
+++ b/src/objects.cc
@@ -828,6 +828,13 @@ MaybeHandle<Object> JSProxy::GetProperty(Isolate* isolate,
Handle<Name> name,
Handle<Object> receiver,
LanguageMode language_mode) {
+ if (receiver->IsJSGlobalObject()) {
+ THROW_NEW_ERROR(
+ isolate,
+ NewTypeError(MessageTemplate::kReadGlobalReferenceThroughProxy, name),
+ Object);
+ }
+
STACK_CHECK(MaybeHandle<Object>());
Handle<Name> trap_name = isolate->factory()->get_string();
// 1. Assert: IsPropertyKey(P) is true.
« no previous file with comments | « src/messages.h ('k') | test/mjsunit/harmony/proxies-global-reference.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698