Improve "name" tests of Promise built-in functions (#2179)

This commit is contained in:
Alexey Shvayka 2019-06-26 22:03:14 +03:00 committed by Leo Balter
parent 7c7d3f756c
commit d7c95efe66
6 changed files with 10 additions and 4 deletions

View File

@ -2,7 +2,7 @@
// This code is governed by the BSD license found in the LICENSE file. // This code is governed by the BSD license found in the LICENSE file.
/*--- /*---
es6id: 25.4.4.1.2 esid: sec-promise.all-resolve-element-functions
description: The `name` property of Promise.all Resolve Element functions description: The `name` property of Promise.all Resolve Element functions
info: | info: |
A promise resolve function is an anonymous built-in function. A promise resolve function is an anonymous built-in function.
@ -29,3 +29,4 @@ NotPromise.resolve = function(v) {
Promise.all.call(NotPromise, [thenable]); Promise.all.call(NotPromise, [thenable]);
assert.sameValue(Object.prototype.hasOwnProperty.call(resolveElementFunction, "name"), false); assert.sameValue(Object.prototype.hasOwnProperty.call(resolveElementFunction, "name"), false);
assert.sameValue(resolveElementFunction.name, "");

View File

@ -30,3 +30,4 @@ NotPromise.resolve = function(v) {
Promise.allSettled.call(NotPromise, [thenable]); Promise.allSettled.call(NotPromise, [thenable]);
assert.sameValue(Object.prototype.hasOwnProperty.call(rejectElementFunction, 'name'), false); assert.sameValue(Object.prototype.hasOwnProperty.call(rejectElementFunction, 'name'), false);
assert.sameValue(rejectElementFunction.name, '');

View File

@ -33,3 +33,4 @@ assert.sameValue(
Object.prototype.hasOwnProperty.call(resolveElementFunction, 'name'), Object.prototype.hasOwnProperty.call(resolveElementFunction, 'name'),
false false
); );
assert.sameValue(resolveElementFunction.name, '');

View File

@ -2,7 +2,7 @@
// This code is governed by the BSD license found in the LICENSE file. // This code is governed by the BSD license found in the LICENSE file.
/*--- /*---
es6id: 25.4.1.5.1 esid: sec-getcapabilitiesexecutor-functions
description: The `name` property of GetCapabilitiesExecutor functions description: The `name` property of GetCapabilitiesExecutor functions
info: | info: |
A GetCapabilitiesExecutor function is an anonymous built-in function. A GetCapabilitiesExecutor function is an anonymous built-in function.
@ -22,3 +22,4 @@ function NotPromise(executor) {
Promise.resolve.call(NotPromise); Promise.resolve.call(NotPromise);
assert.sameValue(Object.prototype.hasOwnProperty.call(executorFunction, "name"), false); assert.sameValue(Object.prototype.hasOwnProperty.call(executorFunction, "name"), false);
assert.sameValue(executorFunction.name, "");

View File

@ -2,7 +2,7 @@
// This code is governed by the BSD license found in the LICENSE file. // This code is governed by the BSD license found in the LICENSE file.
/*--- /*---
es6id: 25.4.1.3.1 esid: sec-promise-reject-functions
description: The `name` property of Promise Reject functions description: The `name` property of Promise Reject functions
info: | info: |
A promise reject function is an anonymous built-in function. A promise reject function is an anonymous built-in function.
@ -19,3 +19,4 @@ new Promise(function(resolve, reject) {
}); });
assert.sameValue(Object.prototype.hasOwnProperty.call(rejectFunction, "name"), false); assert.sameValue(Object.prototype.hasOwnProperty.call(rejectFunction, "name"), false);
assert.sameValue(rejectFunction.name, "");

View File

@ -2,7 +2,7 @@
// This code is governed by the BSD license found in the LICENSE file. // This code is governed by the BSD license found in the LICENSE file.
/*--- /*---
es6id: 25.4.1.3.2 esid: sec-promise-resolve-functions
description: The `name` property of Promise Resolve functions description: The `name` property of Promise Resolve functions
info: | info: |
A promise resolve function is an anonymous built-in function. A promise resolve function is an anonymous built-in function.
@ -19,3 +19,4 @@ new Promise(function(resolve, reject) {
}); });
assert.sameValue(Object.prototype.hasOwnProperty.call(resolveFunction, "name"), false); assert.sameValue(Object.prototype.hasOwnProperty.call(resolveFunction, "name"), false);
assert.sameValue(resolveFunction.name, "");