File tree Expand file tree Collapse file tree 3 files changed +21
-8
lines changed
Expand file tree Collapse file tree 3 files changed +21
-8
lines changed Original file line number Diff line number Diff line change 11{
2- "rust-analyzer.checkOnSave" : false
2+ "rust-analyzer.checkOnSave" : false ,
3+ "files.associations" : {
4+ "*.jslib" : " javascript" ,
5+ "config" : " toml" ,
6+ "iosfwd" : " cpp"
7+ }
38}
Original file line number Diff line number Diff line change 11const JSBUNDLE_SRC : & str = include_str ! ( "jsbundle.js" ) ;
22
33#[ no_mangle]
4- pub extern "C" fn get_jsbundle ( ) -> * const u8 {
4+ pub extern "C" fn get_jsbundle_ptr ( ) -> * const u8 {
55 JSBUNDLE_SRC . as_ptr ( )
66}
7+
8+ #[ no_mangle]
9+ pub extern "C" fn get_jsbundle_size ( ) -> usize {
10+ JSBUNDLE_SRC . len ( )
11+ }
Original file line number Diff line number Diff line change @@ -234,14 +234,14 @@ class NodeBootstrapper
234234 threadHandle = new std::thread ([this ]()
235235 {
236236 if (RunNodeInstance (platformOnProcess) != 0 )
237- DEBUG (" transmute" , " nodejs script exited with error." );
237+ DEBUG (" transmute" , " nodejs script exited with error." );
238238
239239 started = false ;
240240 if (dispose_v8_onexit)
241241 {
242- V8::Dispose ();
243- V8::DisposePlatform ();
244- node::TearDownOncePerProcess ();
242+ V8::Dispose ();
243+ V8::DisposePlatform ();
244+ node::TearDownOncePerProcess ();
245245 } });
246246
247247 started = true ;
@@ -291,12 +291,15 @@ extern "C"
291291 if (processInitializationResult != nullptr && platformOnProcess != nullptr )
292292 return 1 ;
293293
294- const char *jsbundle_source = reinterpret_cast <const char *>(get_jsbundle ());
294+ const char *jsbundle_source = reinterpret_cast <const char *>(get_jsbundle_ptr ());
295+ size_t jsbundle_size = get_jsbundle_size ();
296+
295297 std::vector<std::string> args = {
296298 " node" ,
297299 " --experimental-vm-modules" ,
300+ " --experimental-global-customevent" ,
298301 " -e" ,
299- jsbundle_source};
302+ std::string ( jsbundle_source, jsbundle_size) };
300303
301304#ifdef __ANDROID__
302305 if (isDebug)
You can’t perform that action at this time.
0 commit comments