File tree Expand file tree Collapse file tree 3 files changed +17
-6
lines changed
Expand file tree Collapse file tree 3 files changed +17
-6
lines changed Original file line number Diff line number Diff line change @@ -4,18 +4,24 @@ const isNativeScriptRuntime =
44
55if ( ! isNativeScriptRuntime ) {
66 // deno-lint-ignore no-process-globals
7- if ( typeof process !== "undefined" && typeof process . dlopen === "function" ) {
7+ if (
8+ typeof process !== "undefined" &&
9+ typeof process . dlopen === "function" &&
10+ typeof process . env === "object" &&
11+ typeof URL === "function" &&
12+ typeof __filename === "string"
13+ ) {
814 // ===
915 // If we're in a Node-like environment (e.g. Node.js, Deno, or Bun)
1016 // ===
1117
1218 const module = { exports : { } } ;
1319 process . dlopen (
1420 module ,
15- require ( "node:path" ) . resolve (
16- __dirname ,
21+ new URL (
1722 "./build/RelWithDebInfo/NativeScript.apple.node/macos-arm64/NativeScript.framework/Versions/A/NativeScript" ,
18- ) ,
23+ `file://${ __filename } ` ,
24+ ) . pathname ,
1925 ) ;
2026 module . exports . init ( process . env . METADATA_PATH ) ;
2127 } else if ( typeof require !== "undefined" ) {
Original file line number Diff line number Diff line change @@ -4,7 +4,12 @@ const isNativeScriptRuntime =
44
55if ( ! isNativeScriptRuntime ) {
66 // deno-lint-ignore no-process-globals
7- if ( typeof process !== "undefined" && typeof process . dlopen === "function" ) {
7+ if (
8+ typeof process !== "undefined" &&
9+ typeof process . dlopen === "function" &&
10+ typeof process . env === "object" &&
11+ typeof URL === "function"
12+ ) {
813 // ===
914 // If we're in a Node-like environment (e.g. Node.js, Deno, or Bun)
1015 // ===
Original file line number Diff line number Diff line change 11{
22 "name" : " @nativescript/macos-node-api" ,
3- "version" : " 0.4.3 " ,
3+ "version" : " 0.4.4 " ,
44 "description" : " An embeddable, engine-agnostic NativeScript runtime for macOS based on Node-API" ,
55 "repository" : {
66 "type" : " git" ,
You can’t perform that action at this time.
0 commit comments