eb0dd1da71
It shipped in Chrome 71. Bug: v8:5537 Change-Id: Ia78c58dc0af941ec87c05c933419f7e93d2b26f8 Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1675951 Commit-Queue: Mathias Bynens <mathias@chromium.org> Auto-Submit: Mathias Bynens <mathias@chromium.org> Reviewed-by: Sathya Gunasekaran <gsathya@chromium.org> Cr-Commit-Position: refs/heads/master@{#62374}
27 lines
825 B
JavaScript
27 lines
825 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.
|
|
|
|
assertEquals(globalThis, this);
|
|
assertEquals(this.globalThis, this);
|
|
assertEquals(globalThis.globalThis, this);
|
|
assertEquals(globalThis.globalThis.globalThis, this);
|
|
assertEquals(globalThis.globalThis.globalThis.globalThis, this);
|
|
|
|
{
|
|
const realm = Realm.create();
|
|
assertEquals(Realm.global(realm), Realm.eval(realm, 'globalThis'));
|
|
assertNotEquals(Realm.global(realm), globalThis);
|
|
}
|
|
|
|
{
|
|
const descriptor = Object.getOwnPropertyDescriptor(
|
|
this,
|
|
'globalThis'
|
|
);
|
|
assertEquals(descriptor.value, this);
|
|
assertEquals(descriptor.writable, true);
|
|
assertEquals(descriptor.enumerable, false);
|
|
assertEquals(descriptor.configurable, true);
|
|
}
|