blob: ecee707333262363ed4f58f4e91c0d3f196d8e30 [file] [log] [blame]
description("Bound Function Names");
function assert(b, text) {
if (b)
testPassed(text);
else
testFailed(`Bad result: ${text}`);
}
assert((function() {}).bind().name === "bound ", "Anonymous function bound name.");
assert((function foo() {}).bind().name === "bound foo", "Function bound name should be foo.");
function bar() { }
assert(bar.bind().name === "bound bar", "Function bound name should be bar.");
assert(bar.bind().bind().name === "bound bound bar", "Function double bound name should be bar.");
debug("Test InternalFunction names.");
assert(Error.bind().name === "bound Error", "Function bound name should be Error.");
assert(Function.bind().name === "bound Function", "Function bound name should be Function.");