Skip to content

Commit

Permalink
[runtime] Fix handling of interceptors, pt.2
Browse files Browse the repository at this point in the history
Stores to undeclared global in strict mode should throw ReferenceError.

Bug: chromium:1309225
Change-Id: Iac7c55da2ff9c16e488b4fc66408c5300469873e
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3553099
Commit-Queue: Igor Sheludko <[email protected]>
Auto-Submit: Igor Sheludko <[email protected]>
Reviewed-by: Toon Verwaest <[email protected]>
Commit-Queue: Toon Verwaest <[email protected]>
Cr-Commit-Position: refs/heads/main@{#79625}
  • Loading branch information
isheludko authored and V8 LUCI CQ committed Mar 25, 2022
1 parent b086206 commit a2cae21
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/objects/objects.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2702,6 +2702,10 @@ Maybe<bool> Object::SetSuperProperty(LookupIterator* it, Handle<Object> value,
JSReceiver::GetOwnPropertyDescriptor(&own_lookup, &desc);
MAYBE_RETURN(owned, Nothing<bool>());
if (!owned.FromJust()) {
if (!CheckContextualStoreToJSGlobalObject(&own_lookup,
should_throw)) {
return Nothing<bool>();
}
return JSReceiver::CreateDataProperty(&own_lookup, value,
should_throw);
}
Expand Down

0 comments on commit a2cae21

Please sign in to comment.