blob: 5f8827aacf3fbb5924c4491f6cf2fd9e272be9bb [file] [log] [blame]
// Copyright (C) 2019 Leo Balter. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-promise.allsettled-reject-element-functions
description: The `name` property of Promise.allSettled Reject Element functions
info: |
A promise resolve function is an anonymous built-in function.
17 ECMAScript Standard Built-in Objects:
Every built-in Function object, including constructors, that is not
identified as an anonymous function has a name property whose value
is a String.
features: [Promise.allSettled]
---*/
var rejectElementFunction;
var thenable = {
then(_, reject) {
rejectElementFunction = reject;
}
};
function NotPromise(executor) {
executor(function() {}, function() {});
}
NotPromise.resolve = function(v) {
return v;
};
Promise.allSettled.call(NotPromise, [thenable]);
assert.sameValue(Object.prototype.hasOwnProperty.call(rejectElementFunction, 'name'), false);
assert.sameValue(rejectElementFunction.name, '');