Wither
Wither
> 抱歉我还想问一个愚蠢的问题,比如我在js代码中写一个`while(true)`,我发现java代码就在这块阻塞了,没办法执行下面关闭的代码,如果我想手动停止这段js代码,应该怎么操作, 我写了一个子线程用来跑关闭的代码,结果不太行,并没有达到预期的效果,可以知道一下吗,下面这是我代码  If you write a Java thread in JS, then the thread will indeed run, but you must know that the main thread of the event loop...
> Errors in APIs such as setTimeout and setnterval cannot be caught, and errors will be thrown directly. > > Error > > ```js > setTimeout(() => {throw new Error('')})...
> ```java > uncaughtException > ``` Sorry so much, this is my problem, I'm using unhandledRejection instead of uncaughtException, much appreciated!
> This is a Node.js [feature](https://nodejs.org/api/process.html#event-uncaughtexception) that you missed. Basically, application is supposed to listen the event , otherwise, Node.js crashes.`uncaughtException` > > Please review the following test code. >...
> 您可以使用“Promise”,它很有意义,并且不会阻止 JavaScript I know about Promises and JS microtasks, but I wonder if using Thread in Java can break the problem of JS single threading.
> Please try V8 snapshot. Otherwise, it's technically impossible. If that doesn't work, I'll have to run it in a process, but Node.js if I run into an endless loop...
> 请严格按照[文档](https://www.caoccao.com/Javet/reference/converters/proxy_converter.html#dynamic-anonymous-object-for-class)进行操作,然后重试。JS 代码应如下所示。 > > ```js > { > add: (a, b) => a + b, > } > ``` Please ask me what I did wrong, give a reasonable...
> 请严格按照[文档](https://www.caoccao.com/Javet/reference/converters/proxy_converter.html#dynamic-anonymous-object-for-class)进行操作,然后重试。JS 代码应如下所示。 > > ```js > { > add: (a, b) => a + b, > } > ``` I tried java.io.File at the beginning, he reported an error...
> 它仅适用于具有 default 构造函数的类。新功能未计划。 But I wrote TestJava according to your example, which is the same as your example, why is it also wrong, if it says java.io.File, then it...
> 它仅适用于具有 default 构造函数的类。新功能未计划。 It's the same as the default constructor class, but it doesn't work, and I see from your anonymous implementation, it seems that you need to pass...