diff --git a/test/built-ins/System/System.js b/test/built-ins/System/System.js new file mode 100644 index 0000000000..fd833bb251 --- /dev/null +++ b/test/built-ins/System/System.js @@ -0,0 +1,30 @@ +// Copyright (C) 2016 Jordan Harband. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +esid: sec-system +description: The System object is an ordinary object. +info: > + The System Object + + The System object is the %System% intrinsic object and the initial value of + the System property of the global object. The System object is an ordinary + object. + + The System object is not a function object. It does not have a [[Construct]] + internal method; it is not possible to use the System object as a constructor + with the new operator. The System object also does not have a [[Call]] + internal method; it is not possible to invoke the System object as a + function. +---*/ + +assert.sameValue(typeof System, 'object', '`typeof System` is `"object"`'); + +// System is not callable +assert.throws(TypeError, function() { + System(); +}); + +// System doesn't have a constructor +assert.throws(TypeError, function() { + new System(); +}); diff --git a/test/built-ins/System/global/global-object.js b/test/built-ins/System/global/global-object.js new file mode 100644 index 0000000000..f697cc732d --- /dev/null +++ b/test/built-ins/System/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-system.global +description: System.global should be the global object +author: Jordan Harband +includes: [propertyHelper.js] +---*/ + +assert.sameValue(this, System.global); + +assert.sameValue(Array, System.global.Array); +assert.sameValue(Boolean, System.global.Boolean); +assert.sameValue(Date, System.global.Date); +assert.sameValue(Error, System.global.Error); +assert.sameValue(Function, System.global.Function); +assert.sameValue(JSON, System.global.JSON); +assert.sameValue(Math, System.global.Math); +assert.sameValue(Number, System.global.Number); +assert.sameValue(RegExp, System.global.RegExp); +assert.sameValue(String, System.global.String); +assert.sameValue(System, System.global.System); + +globalVariable = {}; +assert.sameValue(globalVariable, System.global.globalVariable); diff --git a/test/built-ins/System/global/property-descriptor.js b/test/built-ins/System/global/property-descriptor.js new file mode 100644 index 0000000000..d97df9008f --- /dev/null +++ b/test/built-ins/System/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-system.global +description: System.global should be non-writable, non-enumerable, and configurable +author: Jordan Harband +includes: [propertyHelper.js] +---*/ + +verifyNotEnumerable(System, 'global'); +verifyNotWritable(System, 'global'); +verifyConfigurable(System, 'global'); diff --git a/test/built-ins/System/object-prototype.js b/test/built-ins/System/object-prototype.js new file mode 100644 index 0000000000..6426e24fd1 --- /dev/null +++ b/test/built-ins/System/object-prototype.js @@ -0,0 +1,14 @@ +// Copyright (C) 2016 Jordan Harband. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +esid: system +description: > + The value of the [[Prototype]] internal slot of the System object + is the intrinsic object %ObjectPrototype% (19.1.3). +---*/ + +assert.sameValue( + Object.getPrototypeOf(System), + Object.prototype, + '`Object.getPrototypeOf(System)` returns `Object.prototype`' +); diff --git a/test/built-ins/System/properties.js b/test/built-ins/System/properties.js new file mode 100644 index 0000000000..d58513d6f3 --- /dev/null +++ b/test/built-ins/System/properties.js @@ -0,0 +1,14 @@ +// Copyright (C) 2016 Jordan Harband. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +esid: system +description: > + System is configurable, writable, and not enumerable. +info: > + 17 ECMAScript Standard Built-in Objects +includes: [propertyHelper.js] +---*/ + +verifyNotEnumerable(this, 'System'); +verifyWritable(this, 'System'); +verifyConfigurable(this, 'System');