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

Unified Diff: src/objects.cc

Issue 895573002: Check global object behind global proxy for extensibility (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix Created 5 years, 11 months 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/accessors.cc ('k') | test/mjsunit/regress/regress-crbug-454091.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 15909984b9f247921f4f06399b78e3f8c573cc1c..8d7244b6a91511a6c511f9bd956de99bd99a8d1f 100644
--- a/src/objects.cc
+++ b/src/objects.cc
@@ -12115,6 +12115,13 @@ MaybeHandle<Object> JSObject::SetPrototype(Handle<JSObject> object,
real_receiver =
Handle<JSObject>::cast(PrototypeIterator::GetCurrent(iter));
iter.Advance();
+ if (!real_receiver->map()->is_extensible()) {
+ Handle<Object> args[] = {object};
+ THROW_NEW_ERROR(isolate,
+ NewTypeError("non_extensible_proto",
+ HandleVector(args, arraysize(args))),
+ Object);
+ }
}
}
« no previous file with comments | « src/accessors.cc ('k') | test/mjsunit/regress/regress-crbug-454091.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698