-
Hello! So, I was doing some testing with Javet, trying to test out using threads with Javet. It almost worked, except I got an error like so, I thought this might be because of garbage collection due to the runtime being stopped or halted or something like that, so I thought I'd make a Should I polyfill these manually, or does V8 support these under some flag/option? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
This exception shows your application shares V8Value among multiple V8Runtime instances which is prohibited. Javet actively validates that, otherwise, V8 and JVM will crash immediately.
Authentic V8 comes with a price that application needs to implement some API by itself, e.g. setTimeout, setInterval, fetch. And that is also one of the reasons that V8 mode is much more secure. Chrome has its own implementation as a web browser. Node.js has its own implementation upon libuv as a lightweight server. Javet leaves that with Javet users for 2 major reasons.
Most of Javet users just turn to Node.js to get the Node.js ecosystem for free, of course, leaving security a little bit behind.
There is no flag for those features in V8. Do it by yourself. But, if your implementation only depends on JDK, please consider open source it along with Javet. Thank you. |
Beta Was this translation helpful? Give feedback.
-
Polyfilling V8 Mode is now at Javenode. Please feel free to contribute or file issues there. |
Beta Was this translation helpful? Give feedback.
Polyfilling V8 Mode is now at Javenode. Please feel free to contribute or file issues there.