Wither

Results 54 comments of Wither

> 抱歉我还想问一个愚蠢的问题,比如我在js代码中写一个`while(true)`,我发现java代码就在这块阻塞了,没办法执行下面关闭的代码,如果我想手动停止这段js代码,应该怎么操作, 我写了一个子线程用来跑关闭的代码,结果不太行,并没有达到预期的效果,可以知道一下吗,下面这是我代码 ![1719914920021](https://private-user-images.githubusercontent.com/139865188/344978686-649dbe4f-0427-4a3d-9ec6-119a9ef7f3aa.jpg?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjIzNDgxODIsIm5iZiI6MTcyMjM0Nzg4MiwicGF0aCI6Ii8xMzk4NjUxODgvMzQ0OTc4Njg2LTY0OWRiZTRmLTA0MjctNGEzZC05ZWM2LTExOWE5ZWY3ZjNhYS5qcGc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjQwNzMwJTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI0MDczMFQxMzU4MDJaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT04NzVmMzA3NzU0YjQzMzBiMzQ2YTM5ZmUwMGFkY2M0OGFiOWM5MWFiODk3MGE0N2FiOGJhYzJmZmJmMDk4MjI3JlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCZhY3Rvcl9pZD0wJmtleV9pZD0wJnJlcG9faWQ9MCJ9.MFyIdBDpLPjM74I_1oLJH_NyxKOd_yNdcGRWYvCjVOk) 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...