@@ -21,7 +21,7 @@ const __wasi = new __nodeWASI({
2121 env : process . env ,
2222 preopens : {
2323 [ __rootDir ] : __rootDir ,
24- } ,
24+ }
2525} )
2626
2727const __emnapiContext = __emnapiGetDefaultContext ( )
@@ -33,36 +33,22 @@ const __sharedMemory = new WebAssembly.Memory({
3333} )
3434
3535let __wasmFilePath = __nodePath . join ( __dirname , 'compiler-rs.wasm32-wasi.wasm' )
36- const __wasmDebugFilePath = __nodePath . join (
37- __dirname ,
38- 'compiler-rs.wasm32-wasi.debug.wasm' ,
39- )
36+ const __wasmDebugFilePath = __nodePath . join ( __dirname , 'compiler-rs.wasm32-wasi.debug.wasm' )
4037
4138if ( __nodeFs . existsSync ( __wasmDebugFilePath ) ) {
4239 __wasmFilePath = __wasmDebugFilePath
4340} else if ( ! __nodeFs . existsSync ( __wasmFilePath ) ) {
4441 try {
45- __wasmFilePath = __nodePath . resolve (
46- '@vue-jsx-vapor/compiler-rs-wasm32-wasi' ,
47- )
42+ __wasmFilePath = __nodePath . resolve ( '@vue-jsx-vapor/compiler-rs-wasm32-wasi' )
4843 } catch {
49- throw new Error (
50- 'Cannot find compiler-rs.wasm32-wasi.wasm file, and @vue-jsx-vapor/compiler-rs-wasm32-wasi package is not installed.' ,
51- )
44+ throw new Error ( 'Cannot find compiler-rs.wasm32-wasi.wasm file, and @vue-jsx-vapor/compiler-rs-wasm32-wasi package is not installed.' )
5245 }
5346}
5447
55- const {
56- instance : __napiInstance ,
57- module : __wasiModule ,
58- napiModule : __napiModule ,
59- } = __emnapiInstantiateNapiModuleSync ( __nodeFs . readFileSync ( __wasmFilePath ) , {
48+ const { instance : __napiInstance , module : __wasiModule , napiModule : __napiModule } = __emnapiInstantiateNapiModuleSync ( __nodeFs . readFileSync ( __wasmFilePath ) , {
6049 context : __emnapiContext ,
61- asyncWorkPoolSize : ( function ( ) {
62- const threadsSizeFromEnv = Number (
63- process . env . NAPI_RS_ASYNC_WORK_POOL_SIZE ??
64- process . env . UV_THREADPOOL_SIZE ,
65- )
50+ asyncWorkPoolSize : ( function ( ) {
51+ const threadsSizeFromEnv = Number ( process . env . NAPI_RS_ASYNC_WORK_POOL_SIZE ?? process . env . UV_THREADPOOL_SIZE )
6652 // NaN > 0 is false
6753 if ( threadsSizeFromEnv > 0 ) {
6854 return threadsSizeFromEnv
@@ -86,21 +72,21 @@ const {
8672 // According to https://github.com/nodejs/node/blob/19e0d472728c79d418b74bddff588bea70a403d0/lib/internal/worker.js#L415,
8773 // a worker is consist of two handles: kPublicPort and kHandle.
8874 {
89- const kPublicPort = Object . getOwnPropertySymbols ( worker ) . find ( ( s ) =>
90- s . toString ( ) . includes ( ' kPublicPort' ) ,
91- )
75+ const kPublicPort = Object . getOwnPropertySymbols ( worker ) . find ( s =>
76+ s . toString ( ) . includes ( " kPublicPort" )
77+ ) ;
9278 if ( kPublicPort ) {
93- worker [ kPublicPort ] . ref = ( ) => { }
79+ worker [ kPublicPort ] . ref = ( ) => { } ;
9480 }
9581
96- const kHandle = Object . getOwnPropertySymbols ( worker ) . find ( ( s ) =>
97- s . toString ( ) . includes ( ' kHandle' ) ,
98- )
82+ const kHandle = Object . getOwnPropertySymbols ( worker ) . find ( s =>
83+ s . toString ( ) . includes ( " kHandle" )
84+ ) ;
9985 if ( kHandle ) {
100- worker [ kHandle ] . ref = ( ) => { }
86+ worker [ kHandle ] . ref = ( ) => { } ;
10187 }
10288
103- worker . unref ( )
89+ worker . unref ( ) ;
10490 }
10591 return worker
10692 } ,
0 commit comments