]> Lady’s Gitweb - Pisces/commitdiff
Test createCallableFunction names and lengths
authorLady <redacted>
Mon, 4 Sep 2023 22:38:25 +0000 (18:38 -0400)
committerLady <redacted>
Tue, 5 Sep 2023 00:39:35 +0000 (20:39 -0400)
function.test.js

index 1165d03da1defd41ff58239b22e257090451762f..dd9b642a48ba85353cadf607787ecb6152314674 100644 (file)
@@ -288,6 +288,34 @@ describe("createCallableFunction", () => {
     );
   });
 
+  it("[[Call]] correctly sets the length", () => {
+    assertStrictEquals(
+      createCallableFunction(
+        function (_a, _b, _c) {},
+      ).length,
+      4,
+    );
+  });
+
+  it("[[Call]] correctly sets the name", () => {
+    assertStrictEquals(
+      createCallableFunction(
+        function etaoin() {},
+      ).name,
+      "etaoin",
+    );
+  });
+
+  it("[[Call]] allows the name to be overridden", () => {
+    assertStrictEquals(
+      createCallableFunction(
+        function etaoin() {},
+        "shrdlu",
+      ).name,
+      "shrdlu",
+    );
+  });
+
   it("[[Construct]] throws an error", () => {
     assertThrows(() => new createCallableFunction(function () {}));
   });
This page took 0.046968 seconds and 4 git commands to generate.