From be16caa4c89f07ca01dfe296f99e8a757add4d15 Mon Sep 17 00:00:00 2001 From: Jordan Harband Date: Wed, 28 Sep 2016 10:53:50 -0700 Subject: [PATCH] Add `global` tests. (#765) Closes #605, relates to #567 / https://github.com/tc39/proposal-global/issues/12 / https://github.com/bocoup/test262/commit/9c45e2ac684bae64614d8eb55789cae97323a7e7 --- test/built-ins/global/global-object.js | 26 ++++++++++++++++++++ test/built-ins/global/property-descriptor.js | 13 ++++++++++ 2 files changed, 39 insertions(+) create mode 100644 test/built-ins/global/global-object.js create mode 100644 test/built-ins/global/property-descriptor.js diff --git a/test/built-ins/global/global-object.js b/test/built-ins/global/global-object.js new file mode 100644 index 0000000000..61d9ac913a --- /dev/null +++ b/test/built-ins/global/global-object.js @@ -0,0 +1,26 @@ +// Copyright (C) 2016 Jordan Harband. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-other-properties-of-the-global-object-global +description: `global` should be the global object +author: Jordan Harband +includes: [propertyHelper.js] +---*/ + +assert.sameValue(this, global); +assert.sameValue(global.global, global); + +assert.sameValue(Array, global.Array); +assert.sameValue(Boolean, global.Boolean); +assert.sameValue(Date, global.Date); +assert.sameValue(Error, global.Error); +assert.sameValue(Function, global.Function); +assert.sameValue(JSON, global.JSON); +assert.sameValue(Math, global.Math); +assert.sameValue(Number, global.Number); +assert.sameValue(RegExp, global.RegExp); +assert.sameValue(String, global.String); + +globalVariable = {}; +assert.sameValue(globalVariable, global.globalVariable); diff --git a/test/built-ins/global/property-descriptor.js b/test/built-ins/global/property-descriptor.js new file mode 100644 index 0000000000..653d8c63bc --- /dev/null +++ b/test/built-ins/global/property-descriptor.js @@ -0,0 +1,13 @@ +// Copyright (C) 2016 Jordan Harband. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-other-properties-of-the-global-object-global +description: `global` should be writable, non-enumerable, and configurable +author: Jordan Harband +includes: [propertyHelper.js] +---*/ + +verifyNotEnumerable(this, 'global'); +verifyWritable(this, 'global'); +verifyConfigurable(this, 'global');