mirror of https://github.com/tc39/test262.git
Formalize tests for built-in Promise methods
Uniformly and exhaustively test the generic aspects of the static- and instance Promise methods, including: - function `length` properties - function `name` properties - method property descriptors
This commit is contained in:
parent
a3081bd108
commit
4e2f350875
|
@ -1,14 +0,0 @@
|
|||
// Copyright 2014 Cubane Canada, Inc. All rights reserved.
|
||||
// See LICENSE for details.
|
||||
|
||||
/*---
|
||||
info: Promise.all expects 1 argument
|
||||
es6id: 25.4.4.1_A1.2_T1
|
||||
author: Sam Mikes
|
||||
description: Promise.all expects 1 argument
|
||||
---*/
|
||||
|
||||
// CHECK#1
|
||||
if (Promise.all.length !== 1) {
|
||||
$ERROR('Expected Promise.all to be a function of one argument.');
|
||||
}
|
|
@ -1,14 +0,0 @@
|
|||
// Copyright 2015 Jordan Harband. All rights reserved.
|
||||
// See LICENSE for details.
|
||||
|
||||
/*---
|
||||
info: Promise.all is not enumerable
|
||||
es6id: 25.4.4.1_A1.3_T1
|
||||
author: Jordan Harband
|
||||
description: Promise.all should be non-enumerable
|
||||
includes:
|
||||
- propertyHelper.js
|
||||
---*/
|
||||
|
||||
// CHECK#1
|
||||
verifyNotEnumerable(Promise, 'all');
|
|
@ -0,0 +1,25 @@
|
|||
// Copyright (C) 2015 the V8 project authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
es6id: 25.4.4.1
|
||||
description: Promise.all `length` property
|
||||
info: >
|
||||
ES6 Section 17:
|
||||
Every built-in Function object, including constructors, has a length
|
||||
property whose value is an integer. Unless otherwise specified, this value
|
||||
is equal to the largest number of named arguments shown in the subclause
|
||||
headings for the function description, including optional parameters.
|
||||
|
||||
[...]
|
||||
|
||||
Unless otherwise specified, the length property of a built-in Function
|
||||
object has the attributes { [[Writable]]: false, [[Enumerable]]: false,
|
||||
[[Configurable]]: true }.
|
||||
includes: [propertyHelper.js]
|
||||
---*/
|
||||
|
||||
assert.sameValue(Promise.all.length, 1);
|
||||
|
||||
verifyNotEnumerable(Promise.all, 'length');
|
||||
verifyNotWritable(Promise.all, 'length');
|
||||
verifyConfigurable(Promise.all, 'length');
|
|
@ -0,0 +1,26 @@
|
|||
// Copyright (C) 2015 the V8 project authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
es6id: 25.4.4.1
|
||||
description: Promise.all `name` property
|
||||
info: >
|
||||
ES6 Section 17:
|
||||
|
||||
Every built-in Function object, including constructors, that is not
|
||||
identified as an anonymous function has a name property whose value is a
|
||||
String. Unless otherwise specified, this value is the name that is given to
|
||||
the function in this specification.
|
||||
|
||||
[...]
|
||||
|
||||
Unless otherwise specified, the name property of a built-in Function
|
||||
object, if it exists, has the attributes { [[Writable]]: false,
|
||||
[[Enumerable]]: false, [[Configurable]]: true }.
|
||||
includes: [propertyHelper.js]
|
||||
---*/
|
||||
|
||||
assert.sameValue(Promise.all.name, 'all');
|
||||
|
||||
verifyNotEnumerable(Promise.all, 'name');
|
||||
verifyNotWritable(Promise.all, 'name');
|
||||
verifyConfigurable(Promise.all, 'name');
|
|
@ -0,0 +1,19 @@
|
|||
// Copyright 2015 Jordan Harband. All rights reserved.
|
||||
// See LICENSE for details.
|
||||
|
||||
/*---
|
||||
es6id: 25.4.4.1_A1.3_T1
|
||||
author: Jordan Harband
|
||||
description: Promise.all property descriptor
|
||||
info: >
|
||||
ES6 Section 17
|
||||
|
||||
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(Promise, 'all');
|
||||
verifyWritable(Promise, 'all');
|
||||
verifyConfigurable(Promise, 'all');
|
|
@ -0,0 +1,25 @@
|
|||
// Copyright (C) 2015 the V8 project authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
es6id: 25.4.3.1
|
||||
description: Promise `length` property
|
||||
info: >
|
||||
ES6 Section 17:
|
||||
Every built-in Function object, including constructors, has a length
|
||||
property whose value is an integer. Unless otherwise specified, this value
|
||||
is equal to the largest number of named arguments shown in the subclause
|
||||
headings for the function description, including optional parameters.
|
||||
|
||||
[...]
|
||||
|
||||
Unless otherwise specified, the length property of a built-in Function
|
||||
object has the attributes { [[Writable]]: false, [[Enumerable]]: false,
|
||||
[[Configurable]]: true }.
|
||||
includes: [propertyHelper.js]
|
||||
---*/
|
||||
|
||||
assert.sameValue(Promise.length, 1);
|
||||
|
||||
verifyNotEnumerable(Promise, 'length');
|
||||
verifyNotWritable(Promise, 'length');
|
||||
verifyConfigurable(Promise, 'length');
|
|
@ -0,0 +1,26 @@
|
|||
// Copyright (C) 2015 the V8 project authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
es6id: 25.4.3.1
|
||||
description: Promise `name` property
|
||||
info: >
|
||||
ES6 Section 17:
|
||||
|
||||
Every built-in Function object, including constructors, that is not
|
||||
identified as an anonymous function has a name property whose value is a
|
||||
String. Unless otherwise specified, this value is the name that is given to
|
||||
the function in this specification.
|
||||
|
||||
[...]
|
||||
|
||||
Unless otherwise specified, the name property of a built-in Function
|
||||
object, if it exists, has the attributes { [[Writable]]: false,
|
||||
[[Enumerable]]: false, [[Configurable]]: true }.
|
||||
includes: [propertyHelper.js]
|
||||
---*/
|
||||
|
||||
assert.sameValue(Promise.name, 'Promise');
|
||||
|
||||
verifyNotEnumerable(Promise, 'name');
|
||||
verifyNotWritable(Promise, 'name');
|
||||
verifyConfigurable(Promise, 'name');
|
|
@ -14,9 +14,3 @@ var p = Promise.resolve(3);
|
|||
if (!(p.catch instanceof Function)) {
|
||||
$ERROR("Expected p.catch to be a function");
|
||||
}
|
||||
|
||||
if (p.catch.length !== 1) {
|
||||
$ERROR("Expected p.catch to take one argument");
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -0,0 +1,25 @@
|
|||
// Copyright (C) 2015 the V8 project authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
es6id: 25.4.5.1
|
||||
description: Promise.prototype.catch `length` property
|
||||
info: >
|
||||
ES6 Section 17:
|
||||
Every built-in Function object, including constructors, has a length
|
||||
property whose value is an integer. Unless otherwise specified, this value
|
||||
is equal to the largest number of named arguments shown in the subclause
|
||||
headings for the function description, including optional parameters.
|
||||
|
||||
[...]
|
||||
|
||||
Unless otherwise specified, the length property of a built-in Function
|
||||
object has the attributes { [[Writable]]: false, [[Enumerable]]: false,
|
||||
[[Configurable]]: true }.
|
||||
includes: [propertyHelper.js]
|
||||
---*/
|
||||
|
||||
assert.sameValue(Promise.prototype.catch.length, 1);
|
||||
|
||||
verifyNotEnumerable(Promise.prototype.catch, 'length');
|
||||
verifyNotWritable(Promise.prototype.catch, 'length');
|
||||
verifyConfigurable(Promise.prototype.catch, 'length');
|
|
@ -0,0 +1,26 @@
|
|||
// Copyright (C) 2015 the V8 project authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
es6id: 25.4.5.1
|
||||
description: Promise.prototype.catch `name` property
|
||||
info: >
|
||||
ES6 Section 17:
|
||||
|
||||
Every built-in Function object, including constructors, that is not
|
||||
identified as an anonymous function has a name property whose value is a
|
||||
String. Unless otherwise specified, this value is the name that is given to
|
||||
the function in this specification.
|
||||
|
||||
[...]
|
||||
|
||||
Unless otherwise specified, the name property of a built-in Function
|
||||
object, if it exists, has the attributes { [[Writable]]: false,
|
||||
[[Enumerable]]: false, [[Configurable]]: true }.
|
||||
includes: [propertyHelper.js]
|
||||
---*/
|
||||
|
||||
assert.sameValue(Promise.prototype.catch.name, 'catch');
|
||||
|
||||
verifyNotEnumerable(Promise.prototype.catch, 'name');
|
||||
verifyNotWritable(Promise.prototype.catch, 'name');
|
||||
verifyConfigurable(Promise.prototype.catch, 'name');
|
|
@ -0,0 +1,17 @@
|
|||
// Copyright (C) 2015 the V8 project authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
es6id: 25.4.5.1
|
||||
description: Promise.prototype.catch property descriptor
|
||||
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]
|
||||
---*/
|
||||
|
||||
assert.sameValue(typeof Promise.prototype.catch, 'function');
|
||||
|
||||
verifyNotEnumerable(Promise.prototype, 'catch');
|
||||
verifyWritable(Promise.prototype, 'catch');
|
||||
verifyConfigurable(Promise.prototype, 'catch');
|
|
@ -12,7 +12,3 @@ description: Promise.prototype.then is a function of two arguments
|
|||
if (!(Promise.prototype.then instanceof Function)) {
|
||||
$ERROR("Expected Promise.prototype.then to be a function");
|
||||
}
|
||||
|
||||
if (Promise.prototype.then.length !== 2) {
|
||||
$ERROR("Expected Promise.prototype.then to be a function of two arguments");
|
||||
}
|
||||
|
|
|
@ -0,0 +1,25 @@
|
|||
// Copyright (C) 2015 the V8 project authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
es6id: 25.4.5.3
|
||||
description: Promise.prototype.then `length` property
|
||||
info: >
|
||||
ES6 Section 17:
|
||||
Every built-in Function object, including constructors, has a length
|
||||
property whose value is an integer. Unless otherwise specified, this value
|
||||
is equal to the largest number of named arguments shown in the subclause
|
||||
headings for the function description, including optional parameters.
|
||||
|
||||
[...]
|
||||
|
||||
Unless otherwise specified, the length property of a built-in Function
|
||||
object has the attributes { [[Writable]]: false, [[Enumerable]]: false,
|
||||
[[Configurable]]: true }.
|
||||
includes: [propertyHelper.js]
|
||||
---*/
|
||||
|
||||
assert.sameValue(Promise.prototype.then.length, 2);
|
||||
|
||||
verifyNotEnumerable(Promise.prototype.then, 'length');
|
||||
verifyNotWritable(Promise.prototype.then, 'length');
|
||||
verifyConfigurable(Promise.prototype.then, 'length');
|
|
@ -0,0 +1,26 @@
|
|||
// Copyright (C) 2015 the V8 project authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
es6id: 25.4.5.3
|
||||
description: Promise.prototype.then `name` property
|
||||
info: >
|
||||
ES6 Section 17:
|
||||
|
||||
Every built-in Function object, including constructors, that is not
|
||||
identified as an anonymous function has a name property whose value is a
|
||||
String. Unless otherwise specified, this value is the name that is given to
|
||||
the function in this specification.
|
||||
|
||||
[...]
|
||||
|
||||
Unless otherwise specified, the name property of a built-in Function
|
||||
object, if it exists, has the attributes { [[Writable]]: false,
|
||||
[[Enumerable]]: false, [[Configurable]]: true }.
|
||||
includes: [propertyHelper.js]
|
||||
---*/
|
||||
|
||||
assert.sameValue(Promise.prototype.then.name, 'then');
|
||||
|
||||
verifyNotEnumerable(Promise.prototype.then, 'name');
|
||||
verifyNotWritable(Promise.prototype.then, 'name');
|
||||
verifyConfigurable(Promise.prototype.then, 'name');
|
|
@ -0,0 +1,17 @@
|
|||
// Copyright (C) 2015 the V8 project authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
es6id: 25.4.5.1
|
||||
description: Promise.prototype.then property descriptor
|
||||
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]
|
||||
---*/
|
||||
|
||||
assert.sameValue(typeof Promise.prototype.then, 'function');
|
||||
|
||||
verifyNotEnumerable(Promise.prototype, 'then');
|
||||
verifyWritable(Promise.prototype, 'then');
|
||||
verifyConfigurable(Promise.prototype, 'then');
|
|
@ -11,7 +11,3 @@ description: Promise.race is callable
|
|||
if (typeof Promise.race !== "function") {
|
||||
$ERROR("Expected Promise.race to be a function, actually " + typeof Promise.race);
|
||||
}
|
||||
|
||||
if (Promise.race.length !== 1) {
|
||||
$ERROR("Expected Promise.race to be a function of 1 argument.");
|
||||
}
|
||||
|
|
|
@ -1,14 +0,0 @@
|
|||
// Copyright 2015 Jordan Harband. All rights reserved.
|
||||
// See LICENSE for details.
|
||||
|
||||
/*---
|
||||
info: Promise.race is not enumerable
|
||||
es6id: 25.4.4.3_A1.2_T1
|
||||
author: Jordan Harband
|
||||
description: Promise.race should be non-enumerable
|
||||
includes:
|
||||
- propertyHelper.js
|
||||
---*/
|
||||
|
||||
// CHECK#1
|
||||
verifyNotEnumerable(Promise, 'race');
|
|
@ -0,0 +1,25 @@
|
|||
// Copyright (C) 2015 the V8 project authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
es6id: 25.4.4.3
|
||||
description: Promise.race `length` property
|
||||
info: >
|
||||
ES6 Section 17:
|
||||
Every built-in Function object, including constructors, has a length
|
||||
property whose value is an integer. Unless otherwise specified, this value
|
||||
is equal to the largest number of named arguments shown in the subclause
|
||||
headings for the function description, including optional parameters.
|
||||
|
||||
[...]
|
||||
|
||||
Unless otherwise specified, the length property of a built-in Function
|
||||
object has the attributes { [[Writable]]: false, [[Enumerable]]: false,
|
||||
[[Configurable]]: true }.
|
||||
includes: [propertyHelper.js]
|
||||
---*/
|
||||
|
||||
assert.sameValue(Promise.race.length, 1);
|
||||
|
||||
verifyNotEnumerable(Promise.race, 'length');
|
||||
verifyNotWritable(Promise.race, 'length');
|
||||
verifyConfigurable(Promise.race, 'length');
|
|
@ -0,0 +1,26 @@
|
|||
// Copyright (C) 2015 the V8 project authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
es6id: 25.4.4.3
|
||||
description: Promise.race `name` property
|
||||
info: >
|
||||
ES6 Section 17:
|
||||
|
||||
Every built-in Function object, including constructors, that is not
|
||||
identified as an anonymous function has a name property whose value is a
|
||||
String. Unless otherwise specified, this value is the name that is given to
|
||||
the function in this specification.
|
||||
|
||||
[...]
|
||||
|
||||
Unless otherwise specified, the name property of a built-in Function
|
||||
object, if it exists, has the attributes { [[Writable]]: false,
|
||||
[[Enumerable]]: false, [[Configurable]]: true }.
|
||||
includes: [propertyHelper.js]
|
||||
---*/
|
||||
|
||||
assert.sameValue(Promise.race.name, 'race');
|
||||
|
||||
verifyNotEnumerable(Promise.race, 'name');
|
||||
verifyNotWritable(Promise.race, 'name');
|
||||
verifyConfigurable(Promise.race, 'name');
|
|
@ -0,0 +1,19 @@
|
|||
// Copyright 2015 Jordan Harband. All rights reserved.
|
||||
// See LICENSE for details.
|
||||
|
||||
/*---
|
||||
es6id: 25.4.4.3_A1.2_T1
|
||||
author: Jordan Harband
|
||||
description: Promise.race property descriptor
|
||||
info: >
|
||||
ES6 Section 17
|
||||
|
||||
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(Promise, 'race');
|
||||
verifyWritable(Promise, 'race');
|
||||
verifyConfigurable(Promise, 'race');
|
|
@ -12,7 +12,3 @@ description: Promise.reject is a function
|
|||
if ((typeof Promise.reject) !== "function") {
|
||||
$ERROR("Expected Promise.reject to be a function");
|
||||
}
|
||||
|
||||
if (Promise.reject.length !== 1) {
|
||||
$ERROR("Expected Promise.reject to be a function of one argument");
|
||||
}
|
||||
|
|
|
@ -1,14 +0,0 @@
|
|||
// Copyright 2015 Jordan Harband. All rights reserved.
|
||||
// See LICENSE for details.
|
||||
|
||||
/*---
|
||||
info: Promise.reject is not enumerable
|
||||
es6id: 25.4.4.4_A1.2_T1
|
||||
author: Jordan Harband
|
||||
description: Promise.reject should be non-enumerable
|
||||
includes:
|
||||
- propertyHelper.js
|
||||
---*/
|
||||
|
||||
// CHECK#1
|
||||
verifyNotEnumerable(Promise, 'reject');
|
|
@ -0,0 +1,25 @@
|
|||
// Copyright (C) 2015 the V8 project authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
es6id: 25.4.4.4
|
||||
description: Promise.reject `length` property
|
||||
info: >
|
||||
ES6 Section 17:
|
||||
Every built-in Function object, including constructors, has a length
|
||||
property whose value is an integer. Unless otherwise specified, this value
|
||||
is equal to the largest number of named arguments shown in the subclause
|
||||
headings for the function description, including optional parameters.
|
||||
|
||||
[...]
|
||||
|
||||
Unless otherwise specified, the length property of a built-in Function
|
||||
object has the attributes { [[Writable]]: false, [[Enumerable]]: false,
|
||||
[[Configurable]]: true }.
|
||||
includes: [propertyHelper.js]
|
||||
---*/
|
||||
|
||||
assert.sameValue(Promise.reject.length, 1);
|
||||
|
||||
verifyNotEnumerable(Promise.reject, 'length');
|
||||
verifyNotWritable(Promise.reject, 'length');
|
||||
verifyConfigurable(Promise.reject, 'length');
|
|
@ -0,0 +1,26 @@
|
|||
// Copyright (C) 2015 the V8 project authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
es6id: 25.4.4.4
|
||||
description: Promise.reject `name` property
|
||||
info: >
|
||||
ES6 Section 17:
|
||||
|
||||
Every built-in Function object, including constructors, that is not
|
||||
identified as an anonymous function has a name property whose value is a
|
||||
String. Unless otherwise specified, this value is the name that is given to
|
||||
the function in this specification.
|
||||
|
||||
[...]
|
||||
|
||||
Unless otherwise specified, the name property of a built-in Function
|
||||
object, if it exists, has the attributes { [[Writable]]: false,
|
||||
[[Enumerable]]: false, [[Configurable]]: true }.
|
||||
includes: [propertyHelper.js]
|
||||
---*/
|
||||
|
||||
assert.sameValue(Promise.reject.name, 'reject');
|
||||
|
||||
verifyNotEnumerable(Promise.reject, 'name');
|
||||
verifyNotWritable(Promise.reject, 'name');
|
||||
verifyConfigurable(Promise.reject, 'name');
|
|
@ -0,0 +1,19 @@
|
|||
// Copyright 2015 Jordan Harband. All rights reserved.
|
||||
// See LICENSE for details.
|
||||
|
||||
/*---
|
||||
es6id: 25.4.4.4_A1.2_T1
|
||||
author: Jordan Harband
|
||||
description: Promise.reject property descriptor
|
||||
info: >
|
||||
ES6 Section 17
|
||||
|
||||
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(Promise, 'reject');
|
||||
verifyWritable(Promise, 'reject');
|
||||
verifyConfigurable(Promise, 'reject');
|
|
@ -12,7 +12,3 @@ description: Promise.resolve is a function
|
|||
if ((typeof Promise.resolve) !== "function") {
|
||||
$ERROR("Expected Promise.resolve to be a function");
|
||||
}
|
||||
|
||||
if (Promise.resolve.length !== 1) {
|
||||
$ERROR("Expected Promise.resolve to be a function of one argument");
|
||||
}
|
||||
|
|
|
@ -1,14 +0,0 @@
|
|||
// Copyright 2015 Jordan Harband. All rights reserved.
|
||||
// See LICENSE for details.
|
||||
|
||||
/*---
|
||||
info: Promise.resolve is not enumerable
|
||||
es6id: 25.4.4.5_A1.2_T1
|
||||
author: Jordan Harband
|
||||
description: Promise.resolve should be non-enumerable
|
||||
includes:
|
||||
- propertyHelper.js
|
||||
---*/
|
||||
|
||||
// CHECK#1
|
||||
verifyNotEnumerable(Promise, 'resolve');
|
|
@ -0,0 +1,25 @@
|
|||
// Copyright (C) 2015 the V8 project authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
es6id: 25.4.4.5
|
||||
description: Promise.resolve `length` property
|
||||
info: >
|
||||
ES6 Section 17:
|
||||
Every built-in Function object, including constructors, has a length
|
||||
property whose value is an integer. Unless otherwise specified, this value
|
||||
is equal to the largest number of named arguments shown in the subclause
|
||||
headings for the function description, including optional parameters.
|
||||
|
||||
[...]
|
||||
|
||||
Unless otherwise specified, the length property of a built-in Function
|
||||
object has the attributes { [[Writable]]: false, [[Enumerable]]: false,
|
||||
[[Configurable]]: true }.
|
||||
includes: [propertyHelper.js]
|
||||
---*/
|
||||
|
||||
assert.sameValue(Promise.resolve.length, 1);
|
||||
|
||||
verifyNotEnumerable(Promise.resolve, 'length');
|
||||
verifyNotWritable(Promise.resolve, 'length');
|
||||
verifyConfigurable(Promise.resolve, 'length');
|
|
@ -0,0 +1,26 @@
|
|||
// Copyright (C) 2015 the V8 project authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
es6id: 25.4.4.5
|
||||
description: Promise.resolve `name` property
|
||||
info: >
|
||||
ES6 Section 17:
|
||||
|
||||
Every built-in Function object, including constructors, that is not
|
||||
identified as an anonymous function has a name property whose value is a
|
||||
String. Unless otherwise specified, this value is the name that is given to
|
||||
the function in this specification.
|
||||
|
||||
[...]
|
||||
|
||||
Unless otherwise specified, the name property of a built-in Function
|
||||
object, if it exists, has the attributes { [[Writable]]: false,
|
||||
[[Enumerable]]: false, [[Configurable]]: true }.
|
||||
includes: [propertyHelper.js]
|
||||
---*/
|
||||
|
||||
assert.sameValue(Promise.resolve.name, 'resolve');
|
||||
|
||||
verifyNotEnumerable(Promise.resolve, 'name');
|
||||
verifyNotWritable(Promise.resolve, 'name');
|
||||
verifyConfigurable(Promise.resolve, 'name');
|
|
@ -0,0 +1,19 @@
|
|||
// Copyright 2015 Jordan Harband. All rights reserved.
|
||||
// See LICENSE for details.
|
||||
|
||||
/*---
|
||||
es6id: 25.4.4.5_A1.2_T1
|
||||
author: Jordan Harband
|
||||
description: Promise.resolve should be non-enumerable
|
||||
info: >
|
||||
ES6 Section 17
|
||||
|
||||
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(Promise, 'resolve');
|
||||
verifyWritable(Promise, 'resolve');
|
||||
verifyConfigurable(Promise, 'resolve');
|
Loading…
Reference in New Issue