mirror of https://github.com/tc39/test262.git
Improve coverage: ctor props of the global object
Prior to this commit, the descriptors of the constructor properties of the global object were verified inconsistently, many independent assertions occured in the same file, and that file test was poorly located. Restructure the relevant tests to improve coverage, follow convention, and promote discoverability.
This commit is contained in:
parent
1f079a3525
commit
9cd62ffbd7
|
@ -0,0 +1,16 @@
|
|||
// Copyright (C) 2019 Bocoup. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-constructor-properties-of-the-global-object-boolean
|
||||
description: Property descriptor for Boolean
|
||||
info: |
|
||||
Every other data property described in clauses 18 through 26 and in Annex B.2
|
||||
has the attributes { [[Writable]]: true, [[Enumerable]]: false,
|
||||
[[Configurable]]: true } unless otherwise specified.
|
||||
includes: [propertyHelper.js]
|
||||
---*/
|
||||
|
||||
verifyNotEnumerable(this, "Boolean");
|
||||
verifyWritable(this, "Boolean");
|
||||
verifyConfigurable(this, "Boolean");
|
|
@ -0,0 +1,16 @@
|
|||
// Copyright (C) 2019 Bocoup. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-constructor-properties-of-the-global-object-date
|
||||
description: Property descriptor for Date
|
||||
info: |
|
||||
Every other data property described in clauses 18 through 26 and in Annex B.2
|
||||
has the attributes { [[Writable]]: true, [[Enumerable]]: false,
|
||||
[[Configurable]]: true } unless otherwise specified.
|
||||
includes: [propertyHelper.js]
|
||||
---*/
|
||||
|
||||
verifyNotEnumerable(this, "Date");
|
||||
verifyWritable(this, "Date");
|
||||
verifyConfigurable(this, "Date");
|
|
@ -0,0 +1,16 @@
|
|||
// Copyright (C) 2019 Bocoup. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-constructor-properties-of-the-global-object-error
|
||||
description: Property descriptor for Error
|
||||
info: |
|
||||
Every other data property described in clauses 18 through 26 and in Annex B.2
|
||||
has the attributes { [[Writable]]: true, [[Enumerable]]: false,
|
||||
[[Configurable]]: true } unless otherwise specified.
|
||||
includes: [propertyHelper.js]
|
||||
---*/
|
||||
|
||||
verifyNotEnumerable(this, "Error");
|
||||
verifyWritable(this, "Error");
|
||||
verifyConfigurable(this, "Error");
|
|
@ -0,0 +1,16 @@
|
|||
// Copyright (C) 2019 Bocoup. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-constructor-properties-of-the-global-object-function
|
||||
description: Property descriptor for Function
|
||||
info: |
|
||||
Every other data property described in clauses 18 through 26 and in Annex B.2
|
||||
has the attributes { [[Writable]]: true, [[Enumerable]]: false,
|
||||
[[Configurable]]: true } unless otherwise specified.
|
||||
includes: [propertyHelper.js]
|
||||
---*/
|
||||
|
||||
verifyNotEnumerable(this, "Function");
|
||||
verifyWritable(this, "Function");
|
||||
verifyConfigurable(this, "Function");
|
|
@ -0,0 +1,16 @@
|
|||
// Copyright (C) 2019 Bocoup. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-constructor-properties-of-the-global-object-evalerror
|
||||
description: Property descriptor for EvalError
|
||||
info: |
|
||||
Every other data property described in clauses 18 through 26 and in Annex B.2
|
||||
has the attributes { [[Writable]]: true, [[Enumerable]]: false,
|
||||
[[Configurable]]: true } unless otherwise specified.
|
||||
includes: [propertyHelper.js]
|
||||
---*/
|
||||
|
||||
verifyNotEnumerable(this, "EvalError");
|
||||
verifyWritable(this, "EvalError");
|
||||
verifyConfigurable(this, "EvalError");
|
|
@ -0,0 +1,16 @@
|
|||
// Copyright (C) 2019 Bocoup. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-constructor-properties-of-the-global-object-rangeerror
|
||||
description: Property descriptor for RangeError
|
||||
info: |
|
||||
Every other data property described in clauses 18 through 26 and in Annex B.2
|
||||
has the attributes { [[Writable]]: true, [[Enumerable]]: false,
|
||||
[[Configurable]]: true } unless otherwise specified.
|
||||
includes: [propertyHelper.js]
|
||||
---*/
|
||||
|
||||
verifyNotEnumerable(this, "RangeError");
|
||||
verifyWritable(this, "RangeError");
|
||||
verifyConfigurable(this, "RangeError");
|
|
@ -0,0 +1,16 @@
|
|||
// Copyright (C) 2019 Bocoup. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-constructor-properties-of-the-global-object-referenceerror
|
||||
description: Property descriptor for ReferenceError
|
||||
info: |
|
||||
Every other data property described in clauses 18 through 26 and in Annex B.2
|
||||
has the attributes { [[Writable]]: true, [[Enumerable]]: false,
|
||||
[[Configurable]]: true } unless otherwise specified.
|
||||
includes: [propertyHelper.js]
|
||||
---*/
|
||||
|
||||
verifyNotEnumerable(this, "ReferenceError");
|
||||
verifyWritable(this, "ReferenceError");
|
||||
verifyConfigurable(this, "ReferenceError");
|
|
@ -0,0 +1,16 @@
|
|||
// Copyright (C) 2019 Bocoup. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-constructor-properties-of-the-global-object-syntaxerror
|
||||
description: Property descriptor for SyntaxError
|
||||
info: |
|
||||
Every other data property described in clauses 18 through 26 and in Annex B.2
|
||||
has the attributes { [[Writable]]: true, [[Enumerable]]: false,
|
||||
[[Configurable]]: true } unless otherwise specified.
|
||||
includes: [propertyHelper.js]
|
||||
---*/
|
||||
|
||||
verifyNotEnumerable(this, "SyntaxError");
|
||||
verifyWritable(this, "SyntaxError");
|
||||
verifyConfigurable(this, "SyntaxError");
|
|
@ -0,0 +1,16 @@
|
|||
// Copyright (C) 2019 Bocoup. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-constructor-properties-of-the-global-object-typeerror
|
||||
description: Property descriptor for TypeError
|
||||
info: |
|
||||
Every other data property described in clauses 18 through 26 and in Annex B.2
|
||||
has the attributes { [[Writable]]: true, [[Enumerable]]: false,
|
||||
[[Configurable]]: true } unless otherwise specified.
|
||||
includes: [propertyHelper.js]
|
||||
---*/
|
||||
|
||||
verifyNotEnumerable(this, "TypeError");
|
||||
verifyWritable(this, "TypeError");
|
||||
verifyConfigurable(this, "TypeError");
|
|
@ -0,0 +1,16 @@
|
|||
// Copyright (C) 2019 Bocoup. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-constructor-properties-of-the-global-object-urierror
|
||||
description: Property descriptor for URIError
|
||||
info: |
|
||||
Every other data property described in clauses 18 through 26 and in Annex B.2
|
||||
has the attributes { [[Writable]]: true, [[Enumerable]]: false,
|
||||
[[Configurable]]: true } unless otherwise specified.
|
||||
includes: [propertyHelper.js]
|
||||
---*/
|
||||
|
||||
verifyNotEnumerable(this, "URIError");
|
||||
verifyWritable(this, "URIError");
|
||||
verifyConfigurable(this, "URIError");
|
|
@ -0,0 +1,16 @@
|
|||
// Copyright (C) 2019 Bocoup. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-constructor-properties-of-the-global-object-object
|
||||
description: Property descriptor for Object
|
||||
info: |
|
||||
Every other data property described in clauses 18 through 26 and in Annex B.2
|
||||
has the attributes { [[Writable]]: true, [[Enumerable]]: false,
|
||||
[[Configurable]]: true } unless otherwise specified.
|
||||
includes: [propertyHelper.js]
|
||||
---*/
|
||||
|
||||
verifyNotEnumerable(this, "Object");
|
||||
verifyWritable(this, "Object");
|
||||
verifyConfigurable(this, "Object");
|
|
@ -0,0 +1,16 @@
|
|||
// Copyright (C) 2019 Bocoup. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-constructor-properties-of-the-global-object-regexp
|
||||
description: Property descriptor for RegExp
|
||||
info: |
|
||||
Every other data property described in clauses 18 through 26 and in Annex B.2
|
||||
has the attributes { [[Writable]]: true, [[Enumerable]]: false,
|
||||
[[Configurable]]: true } unless otherwise specified.
|
||||
includes: [propertyHelper.js]
|
||||
---*/
|
||||
|
||||
verifyNotEnumerable(this, "RegExp");
|
||||
verifyWritable(this, "RegExp");
|
||||
verifyConfigurable(this, "RegExp");
|
|
@ -0,0 +1,16 @@
|
|||
// Copyright (C) 2019 Bocoup. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-constructor-properties-of-the-global-object-string
|
||||
description: Property descriptor for String
|
||||
info: |
|
||||
Every other data property described in clauses 18 through 26 and in Annex B.2
|
||||
has the attributes { [[Writable]]: true, [[Enumerable]]: false,
|
||||
[[Configurable]]: true } unless otherwise specified.
|
||||
includes: [propertyHelper.js]
|
||||
---*/
|
||||
|
||||
verifyNotEnumerable(this, "String");
|
||||
verifyWritable(this, "String");
|
||||
verifyConfigurable(this, "String");
|
|
@ -1,48 +0,0 @@
|
|||
// Copyright 2009 the Sputnik authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
info: Global object properties have attributes { DontEnum }
|
||||
es5id: 10.2.3_A2.2_T3
|
||||
description: Function execution context - Constructor Properties
|
||||
flags: [noStrict]
|
||||
---*/
|
||||
|
||||
function test() {
|
||||
//CHECK#1
|
||||
for (var x in this) {
|
||||
if (x === 'Object') {
|
||||
$ERROR("#1: 'property 'Object' have attribute DontEnum");
|
||||
} else if (x === 'Function') {
|
||||
$ERROR("#1: 'Function' have attribute DontEnum");
|
||||
} else if (x === 'String') {
|
||||
$ERROR("#1: 'String' have attribute DontEnum");
|
||||
} else if (x === 'Number') {
|
||||
$ERROR("#1: 'Number' have attribute DontEnum");
|
||||
} else if (x === 'Array') {
|
||||
$ERROR("#1: 'Array' have attribute DontEnum");
|
||||
} else if (x === 'Boolean') {
|
||||
$ERROR("#1: 'Boolean' have attribute DontEnum");
|
||||
} else if (x === 'Date') {
|
||||
$ERROR("#1: 'Date' have attribute DontEnum");
|
||||
} else if (x === 'RegExp') {
|
||||
$ERROR("#1: 'RegExp' have attribute DontEnum");
|
||||
} else if (x === 'Error') {
|
||||
$ERROR("#1: 'Error' have attribute DontEnum");
|
||||
} else if (x === 'EvalError') {
|
||||
$ERROR("#1: 'EvalError' have attribute DontEnum");
|
||||
} else if (x === 'RangeError') {
|
||||
$ERROR("#1: 'RangeError' have attribute DontEnum");
|
||||
} else if (x === 'ReferenceError') {
|
||||
$ERROR("#1: 'ReferenceError' have attribute DontEnum");
|
||||
} else if (x === 'SyntaxError') {
|
||||
$ERROR("#1: 'SyntaxError' have attribute DontEnum");
|
||||
} else if (x === 'TypeError') {
|
||||
$ERROR("#1: 'TypeError' have attribute DontEnum");
|
||||
} else if (x === 'URIError') {
|
||||
$ERROR("#1: 'URIError' have attribute DontEnum");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
test();
|
Loading…
Reference in New Issue