Add `global` tests. (#765)

Closes #605, relates to #567 / https://github.com/tc39/proposal-global/issues/12 / 9c45e2ac68
This commit is contained in:
Jordan Harband 2016-09-28 10:53:50 -07:00 committed by Tom Care
parent 3707a85705
commit be16caa4c8
2 changed files with 39 additions and 0 deletions

View File

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

View File

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