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

Unified Diff: src/objects.cc

Issue 1132203005: Fix the behavior of 'super.foo' assignment when receiver is not an object. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: CR feedback Created 5 years, 7 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 | « no previous file | test/mjsunit/es6/regress/regress-4097.js » ('j') | test/mjsunit/es6/regress/regress-4097.js » ('J')
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 92f7b0fbcfa8b49939f2a902d4bdc8f09929b677..1224ab1c6d73c244e089564746ac8abf22d08801 100644
--- a/src/objects.cc
+++ b/src/objects.cc
@@ -3279,6 +3279,11 @@ MaybeHandle<Object> Object::SetSuperProperty(LookupIterator* it,
SetPropertyInternal(it, value, language_mode, store_mode, &found);
if (found) return result;
+ if (!it->GetReceiver()->IsJSReceiver()) {
+ return WriteToReadOnlyProperty(it->isolate(), it->GetReceiver(), it->name(),
+ value, language_mode);
+ }
+
LookupIterator own_lookup(it->GetReceiver(), it->name(), LookupIterator::OWN);
switch (own_lookup.state()) {
« no previous file with comments | « no previous file | test/mjsunit/es6/regress/regress-4097.js » ('j') | test/mjsunit/es6/regress/regress-4097.js » ('J')

Powered by Google App Engine
This is Rietveld 408576698