test262/implementation-contributed/javascriptcore/stress/private-name-as-anonymous-builtin.js
Leo Balter d1261bb49d Update files for the curation process
Remove more stress tests with existing coverage or out of context for test262
2018-09-11 18:20:20 -04:00

25 lines
636 B
JavaScript

// Reviewed
/***
- jsc
- ch
- d8: Error: bad value: ["length","name"]
- jsshell: Error: bad value: ["length","name"]
*/
function shouldBe(actual, expected)
{
if (actual !== expected)
throw new Error('bad value: ' + actual);
}
var executorFunction;
function NotPromise(executor) {
executorFunction = executor;
executor(function(){}, function(){});
}
Promise.resolve.call(NotPromise);
shouldBe(JSON.stringify(Object.getOwnPropertyNames(executorFunction).sort()), `["length"]`);
shouldBe(executorFunction.hasOwnProperty('name'), false);
shouldBe(executorFunction.name, ``);
shouldBe(delete executorFunction.name, true);