From 563ed10464bc447edfda10fe97d79e701f3deb9c Mon Sep 17 00:00:00 2001 From: leso-kn Date: Wed, 28 May 2025 21:05:08 +0200 Subject: [PATCH 1/2] call function with new keyword when calling classes --- src/type-extensions/function.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/type-extensions/function.ts b/src/type-extensions/function.ts index 753ee90..cfd3432 100644 --- a/src/type-extensions/function.ts +++ b/src/type-extensions/function.ts @@ -103,7 +103,9 @@ class FunctionTypeExtension extends TypeExtension Date: Thu, 12 Jun 2025 10:16:06 +0200 Subject: [PATCH 2/2] fix linter warnings --- src/type-extensions/function.ts | 9 ++++++--- test/engine.test.js | 10 +++++----- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/src/type-extensions/function.ts b/src/type-extensions/function.ts index cfd3432..9c530fb 100644 --- a/src/type-extensions/function.ts +++ b/src/type-extensions/function.ts @@ -103,9 +103,12 @@ class FunctionTypeExtension extends TypeExtension { it('lots of doString calls should succeed', async () => { const engine = await getEngine() - const length = 10000; + const length = 10000 for (let i = 0; i < length; i++) { - const a = Math.floor(Math.random() * 100); - const b = Math.floor(Math.random() * 100); - const result = await engine.doString(`return ${a} + ${b};`); - expect(result).to.equal(a + b); + const a = Math.floor(Math.random() * 100) + const b = Math.floor(Math.random() * 100) + const result = await engine.doString(`return ${a} + ${b};`) + expect(result).to.equal(a + b) } }) })