14885d5884
When global object has proxies we should first call hasProperty and then call GetProperty according to spec. This cl fixes both LoadGlobal and LoadLookupGlobal to correctly handle these cases. Also fixes tests that didn't expect hasProperty to be called. Change-Id: I3a45df7ae24be74dd46cf04cafbf8c2d7018b3af Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1876059 Commit-Queue: Mythri Alle <mythria@chromium.org> Reviewed-by: Toon Verwaest <verwaest@chromium.org> Cr-Commit-Position: refs/heads/master@{#64580}
15 lines
473 B
JavaScript
15 lines
473 B
JavaScript
// Copyright 2018 the V8 project authors. All rights reserved.
|
|
// Use of this source code is governed by a BSD-style license that can be
|
|
// found in the LICENSE file.
|
|
|
|
const globalThis = this;
|
|
Object.setPrototypeOf(this, new Proxy({}, {
|
|
has() { return true; },
|
|
getOwnPropertyDescriptor() {
|
|
assertUnreachable("getOwnPropertyDescriptor shouldn't be called."); },
|
|
get(target, prop, receiver) {
|
|
assertTrue(receiver === globalThis);
|
|
}
|
|
}));
|
|
undefined_name_access
|