From 047daf7bab45048beddebe81b035d07f5487b30f Mon Sep 17 00:00:00 2001 From: Carl Date: Mon, 11 Jan 2021 03:19:10 +0700 Subject: [PATCH 1/8] Adding wrap definition. --- src/definitions.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/definitions.ts b/src/definitions.ts index 766c53cca0..c26ab00985 100644 --- a/src/definitions.ts +++ b/src/definitions.ts @@ -496,6 +496,9 @@ export class TSDBuilder extends ExportsWalker { sb.push(extendsNode.name.identifier.text); // TODO: fqn? } sb.push(" {\n"); + sb.push(" static wrap(pinter: usize): "); + sb.push(name); + sb.push("\n"); var staticMembers = element.prototype.members; if (staticMembers) { // TODO: for (let member of staticMembers.values()) { From 52f87c39a507a2e5d54661312d34d1f682659c18 Mon Sep 17 00:00:00 2001 From: Carl Date: Mon, 11 Jan 2021 03:33:51 +0700 Subject: [PATCH 2/8] Updating contributors --- NOTICE | 1 + 1 file changed, 1 insertion(+) diff --git a/NOTICE b/NOTICE index e43810f24e..8e47e0290f 100644 --- a/NOTICE +++ b/NOTICE @@ -29,6 +29,7 @@ under the licensing terms detailed in LICENSE: * Valeria Viana Gusmao * Gabor Greif * Martin Fredriksson +* forcepusher Portions of this software are derived from third-party works licensed under the following terms: From d625168660e18667c1526c98143a8d267c0ef2f2 Mon Sep 17 00:00:00 2001 From: Carl Date: Mon, 11 Jan 2021 03:38:23 +0700 Subject: [PATCH 3/8] Fixed a typo. --- src/definitions.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/definitions.ts b/src/definitions.ts index c26ab00985..a763794dde 100644 --- a/src/definitions.ts +++ b/src/definitions.ts @@ -496,7 +496,7 @@ export class TSDBuilder extends ExportsWalker { sb.push(extendsNode.name.identifier.text); // TODO: fqn? } sb.push(" {\n"); - sb.push(" static wrap(pinter: usize): "); + sb.push(" static wrap(pointer: usize): "); sb.push(name); sb.push("\n"); var staticMembers = element.prototype.members; From 0211ed740237adf388096508c92a1a64fe9913aa Mon Sep 17 00:00:00 2001 From: Carl Date: Mon, 11 Jan 2021 04:15:40 +0700 Subject: [PATCH 4/8] Fixed indentation for wrap method. --- src/definitions.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/definitions.ts b/src/definitions.ts index a763794dde..17f3c430a2 100644 --- a/src/definitions.ts +++ b/src/definitions.ts @@ -496,7 +496,8 @@ export class TSDBuilder extends ExportsWalker { sb.push(extendsNode.name.identifier.text); // TODO: fqn? } sb.push(" {\n"); - sb.push(" static wrap(pointer: usize): "); + indent(sb, this.indentLevel); + sb.push("static wrap(pointer: usize): "); sb.push(name); sb.push("\n"); var staticMembers = element.prototype.members; From 7b8f4053151446080c411f8654d85b08c1fcbcce Mon Sep 17 00:00:00 2001 From: Carl Date: Mon, 11 Jan 2021 04:21:39 +0700 Subject: [PATCH 5/8] Changing "pointer" argument to "ptr" for naming consistency. --- src/definitions.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/definitions.ts b/src/definitions.ts index 17f3c430a2..bbbe97fbf5 100644 --- a/src/definitions.ts +++ b/src/definitions.ts @@ -497,7 +497,7 @@ export class TSDBuilder extends ExportsWalker { } sb.push(" {\n"); indent(sb, this.indentLevel); - sb.push("static wrap(pointer: usize): "); + sb.push("static wrap(ptr: usize): "); sb.push(name); sb.push("\n"); var staticMembers = element.prototype.members; From 4c500e5a331a10de4e83abba768a1996f7e0e068 Mon Sep 17 00:00:00 2001 From: Carl Date: Mon, 11 Jan 2021 06:59:20 +0700 Subject: [PATCH 6/8] Update src/definitions.ts Co-authored-by: Daniel Wirtz --- src/definitions.ts | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/definitions.ts b/src/definitions.ts index bbbe97fbf5..1f215a35f6 100644 --- a/src/definitions.ts +++ b/src/definitions.ts @@ -496,10 +496,12 @@ export class TSDBuilder extends ExportsWalker { sb.push(extendsNode.name.identifier.text); // TODO: fqn? } sb.push(" {\n"); - indent(sb, this.indentLevel); - sb.push("static wrap(ptr: usize): "); - sb.push(name); - sb.push("\n"); + if (!isInterface) { + indent(sb, this.indentLevel); + sb.push("static wrap(ptr: usize): "); + sb.push(name); + sb.push("\n"); + } var staticMembers = element.prototype.members; if (staticMembers) { // TODO: for (let member of staticMembers.values()) { From c87fe4c817fc8f06f449b1915bb356e3f4b5b5fc Mon Sep 17 00:00:00 2001 From: forcepusher Date: Mon, 18 Jan 2021 21:44:06 +0700 Subject: [PATCH 7/8] Adding missing semicolon to d.ts generator. --- src/definitions.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/definitions.ts b/src/definitions.ts index 1f215a35f6..ccf02d1ee7 100644 --- a/src/definitions.ts +++ b/src/definitions.ts @@ -500,6 +500,7 @@ export class TSDBuilder extends ExportsWalker { indent(sb, this.indentLevel); sb.push("static wrap(ptr: usize): "); sb.push(name); + sb.push(";"); sb.push("\n"); } var staticMembers = element.prototype.members; From 711a71e4c8bd7cb6270cee3667f503145e61de7e Mon Sep 17 00:00:00 2001 From: Carl Date: Mon, 18 Jan 2021 21:49:01 +0700 Subject: [PATCH 8/8] Merging 2 pushes together. Co-authored-by: Daniel Wirtz --- src/definitions.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/definitions.ts b/src/definitions.ts index ccf02d1ee7..1726936f27 100644 --- a/src/definitions.ts +++ b/src/definitions.ts @@ -500,8 +500,7 @@ export class TSDBuilder extends ExportsWalker { indent(sb, this.indentLevel); sb.push("static wrap(ptr: usize): "); sb.push(name); - sb.push(";"); - sb.push("\n"); + sb.push(";\n"); } var staticMembers = element.prototype.members; if (staticMembers) {