feat: update typescript version

Signed-off-by: MiaoWoo <admin@yumc.pw>
This commit is contained in:
2021-12-26 01:21:06 +08:00
parent 72173b4778
commit 5ed61829e1
68 changed files with 234 additions and 161 deletions

View File

@ -16,12 +16,12 @@
"dependencies": {
"@ccms/i18n": "^0.17.0",
"@ccms/nodejs": "^0.17.0",
"core-js": "^3.16.0"
"core-js": "^3.19.3"
},
"devDependencies": {
"@ccms/nashorn": "^0.17.0",
"reflect-metadata": "^0.1.13",
"rimraf": "^3.0.2",
"typescript": "^4.3.5"
"typescript": "^4.5.3"
}
}

View File

@ -39,10 +39,10 @@ class Process extends EventEmitter {
return super.on(event, (...args) => {
try {
listener(...args)
} catch (origin) {
} catch (origin: any) {
try {
super.emit('error', origin)
} catch (error) {
} catch (error: any) {
console.ex(origin)
console.ex(error)
}
@ -53,10 +53,10 @@ class Process extends EventEmitter {
microTaskPool.execute(() => {
try {
func(args)
} catch (origin) {
} catch (origin: any) {
try {
super.emit('error', origin)
} catch (error) {
} catch (error: any) {
console.ex(origin)
console.ex(error)
}
@ -96,16 +96,16 @@ class EventLoop {
task = this.eventLoopTaskQueue.take()
try {
task.getTask()()
} catch (cause) {
} catch (cause: any) {
try {
process.emit('error', cause)
} catch (error) {
} catch (error: any) {
console.error(cause)
console.ex(cause)
}
}
}
} catch (error) {
} catch (error: any) {
console.log(`EventLoop Thread isInterrupted exit! remainTask: ${this.eventLoopTaskQueue.size()}`)
this.eventLoopTaskQueue.clear()
this.eventLoopTaskQueue = undefined
@ -143,18 +143,18 @@ class EventLoop {
call: () => {
try {
callback.apply(undefined, args)
} catch (cause) {
} catch (cause: any) {
cause = cause.getCause && cause.getCause() || cause
try {
process.emit('error', cause)
} catch (error) {
} catch (error: any) {
console.error(cause)
console.ex(cause)
}
}
}
})).get(this.taskExecTimeout, TimeUnit.SECONDS)
} catch (error) {
} catch (error: any) {
if (error instanceof InterruptedException) {
return console.warn(`FixedThreadPool isInterrupted exit! Task ${name} exec exit!`)
}

View File

@ -2,6 +2,6 @@
try {
Java.type('org.openjdk.nashorn.api.scripting.NashornScriptEngine')
Object.setPrototypeOf = ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b })
} catch (error) {
} catch (error: any) {
}
export { }

View File

@ -226,7 +226,7 @@ export class XMLHttpRequest {
}
this.setResponseHeaders(this._connection.getHeaderFields())
this.onloadend && this.onloadend()
} catch (ex) {
} catch (ex: any) {
if (ex instanceof SocketTimeoutException && this.ontimeout) {
return this.ontimeout(ex)
} else if (this.onerror) {