Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions src/main/java/com/eclipsesource/v8/NodeJS.java
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ public void invoke(final V8Object receiver, final V8Array parameters) {
try {
File startupScript = createTemporaryScriptFile(STARTUP_SCRIPT, STARTUP_SCRIPT_NAME);
try {
v8.createNodeRuntime(startupScript.getAbsolutePath());
v8.createNodeRuntime(startupScript.getCanonicalPath());
} finally {
startupScript.delete();
}
Expand Down Expand Up @@ -165,9 +165,11 @@ public V8Object require(final File file) {
v8.checkThread();
V8Array requireParams = new V8Array(v8);
try {
requireParams.push(file.getAbsolutePath());
requireParams.push(file.getCanonicalPath());
return (V8Object) require.call(null, requireParams);
} finally {
} catch (IOException e) {
throw new RuntimeException(e);
}finally {
requireParams.close();
}
}
Expand Down Expand Up @@ -202,8 +204,10 @@ private V8Function createScriptExecutionCallback(final File file) {
public Object invoke(final V8Object receiver, final V8Array parameters) {
V8Array requireParams = new V8Array(v8);
try {
requireParams.push(file.getAbsolutePath());
requireParams.push(file.getCanonicalPath());
return require.call(null, requireParams);
} catch (IOException e) {
throw new RuntimeException(e);
} finally {
requireParams.close();
}
Expand Down