[runtime] Fix handling of interceptors, pt.2

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 <ishell@chromium.org>
Auto-Submit: Igor Sheludko <ishell@chromium.org>
Reviewed-by: Toon Verwaest <verwaest@chromium.org>
Commit-Queue: Toon Verwaest <verwaest@chromium.org>
Cr-Commit-Position: refs/heads/main@{#79625}
This commit is contained in:
Igor Sheludko 2022-03-25 13:40:03 +01:00 committed by V8 LUCI CQ
parent b086206161
commit a2cae2180a

View File

@ -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);
}