test262/test/built-ins/global/global-object.js

27 lines
922 B
JavaScript
Raw Normal View History

// Copyright (C) 2016 Jordan Harband. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
2018-07-26 02:11:53 +02:00
esid: sec-other-properties-of-the-global-object-globalthis
description: "'globalThis' should be the global object"
author: Jordan Harband
2018-07-26 02:11:53 +02:00
features: [globalThis]
---*/
2018-07-26 02:11:53 +02:00
assert.sameValue(this, globalThis);
assert.sameValue(globalThis.globalThis, globalThis);
2018-07-26 02:11:53 +02:00
assert.sameValue(Array, globalThis.Array);
assert.sameValue(Boolean, globalThis.Boolean);
assert.sameValue(Date, globalThis.Date);
assert.sameValue(Error, globalThis.Error);
assert.sameValue(Function, globalThis.Function);
assert.sameValue(JSON, globalThis.JSON);
assert.sameValue(Math, globalThis.Math);
assert.sameValue(Number, globalThis.Number);
assert.sameValue(RegExp, globalThis.RegExp);
assert.sameValue(String, globalThis.String);
Fix various test issues (#840) test/annexB/built-ins/Date/prototype/setYear/time-clip.js test/built-ins/Date/prototype/setFullYear/new-value-time-clip.js test/built-ins/Date/prototype/setMonth/new-value-time-clip.js - Don't try to test time-clip at the end points, because this is near impossible to get right (needs to consider time zone offset, dst, local mean time because of Africa/Monrovia, etc.). test/built-ins/DataView/prototype/setFloat64/detached-buffer-after-toindex-byteoffset.js test/built-ins/DataView/prototype/setInt16/detached-buffer-after-toindex-byteoffset.js - Wasn't update to expect RangeError test/built-ins/Function/internals/Construct/derived-this-uninitialized-realm.js - Change ClassDeclaration -> ClassExpression to get completion value test/built-ins/Function/prototype/toString/AsyncFunction.js - Add missing \n in expected string - Also fixed in gh-847 test/built-ins/global/global-object.js - Add 'var' to make test pass in strict-mode test/language/block-scope/syntax/redeclaration-in-block/attempt-to-redeclare-function-declaration-with-function-declaration.js - This is allowed in sloppy mode when Annex B is implemented test/language/expressions/async-generators/expression-yield-as-statement.js - Fix calls to then() test/language/module-code/namespace/internals/own-property-keys-binding-types.js test/language/module-code/namespace/internals/own-property-keys-sort.js - Tests weren't updated after removal of @@iterator from module namespace objects test/language/module-code/namespace/internals/set-prototype-of-null.js - Fix syntax error test/language/statements/async-function/early-errors-no-async-generator.js - No longer valid now that async iteration proposal is at stage 3
2017-02-07 17:10:56 +01:00
var globalVariable = {};
2018-07-26 02:11:53 +02:00
assert.sameValue(globalVariable, globalThis.globalVariable);