summaryrefslogtreecommitdiff
path: root/Libraries/LibJS/Tests/Function.js
diff options
context:
space:
mode:
authorLinus Groh <mail@linusgroh.de>2020-05-02 19:18:55 +0100
committerAndreas Kling <kling@serenityos.org>2020-05-02 20:41:31 +0200
commit99be27b4a18162b93fc99de79e0b737f3f401690 (patch)
tree42b1daeb38750be72ffa15b0c672a2e4af699b59 /Libraries/LibJS/Tests/Function.js
parentd007e8d00f802fd57661e250f99ae95976f7bd13 (diff)
downloadserenity-99be27b4a18162b93fc99de79e0b737f3f401690.zip
LibJS: Add "name" property to functions
Diffstat (limited to 'Libraries/LibJS/Tests/Function.js')
-rw-r--r--Libraries/LibJS/Tests/Function.js3
1 files changed, 3 insertions, 0 deletions
diff --git a/Libraries/LibJS/Tests/Function.js b/Libraries/LibJS/Tests/Function.js
index 8ddcb691d6..946ff73270 100644
--- a/Libraries/LibJS/Tests/Function.js
+++ b/Libraries/LibJS/Tests/Function.js
@@ -2,7 +2,9 @@ load("test-common.js");
try {
assert(Function.length === 1);
+ assert(Function.name === "Function");
assert(Function.prototype.length === 0);
+ assert(Function.prototype.name === "");
assert(typeof Function() === "function");
assert(typeof new Function() === "function");
@@ -21,6 +23,7 @@ try {
assert(new Function("return typeof Function()")() === "function");
assert(new Function("x", "return function (y) { return x + y };")(1)(2) === 3);
+ assert(new Function().name === "anonymous");
assert(new Function().toString() === "function anonymous() {\n ???\n}");
console.log("PASS");