From 54d12749dc09500054ab24922f99b804af0ba929 Mon Sep 17 00:00:00 2001 From: MiaoWoo Date: Thu, 16 Jan 2020 17:26:31 +0800 Subject: [PATCH] feat: add bungee support Signed-off-by: MiaoWoo --- packages/nashorn/build.sh | 4 ++-- packages/nashorn/src/build.ts | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/nashorn/build.sh b/packages/nashorn/build.sh index a67d827b..5bfc88b8 100755 --- a/packages/nashorn/build.sh +++ b/packages/nashorn/build.sh @@ -1,5 +1,5 @@ -# sponge bukkit jdk -TYPE=jdk +# sponge bukkit jdk bungee +TYPE=bungee TARGET=../types/dist/typings npx tsc src/build.ts --outDir dist cd dist diff --git a/packages/nashorn/src/build.ts b/packages/nashorn/src/build.ts index de8314a9..46ea2ec6 100644 --- a/packages/nashorn/src/build.ts +++ b/packages/nashorn/src/build.ts @@ -33,7 +33,7 @@ function convertJson2TypeDefiend(infile: string, outDir: string) { temp = temp.substr(0, temp.length - 2); } } else { - temp += `${(obj.superclass) ? (' extends ' + obj.superclass.qualifiedName) : ''}`; + temp += `${(obj.superclass) ? (' extends ' + (obj.superclass.qualifiedName == "" ? "object" : obj.superclass.qualifiedName)) : ''}`; if (safeInterface.length > 0) { temp += ' implements ' for (const ifs of safeInterface) { @@ -178,7 +178,7 @@ typeMap['Matrix4d'] = 'any /*Matrix4d*/' function mappingType(type: string): string { let outType = typeMap[type] || type || 'any'; if (outType.indexOf('.') != -1) { - if (outType.startsWith('java.') || outType.startsWith('org.')) { + if (outType.startsWith('java.') || outType.startsWith('org.') || outType.startsWith('net.')) { } else { outType = `any /*${outType}*/`