Skip to content
Merged
Show file tree
Hide file tree
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
7 changes: 4 additions & 3 deletions runtime/src/main/jni/CallbackHandlers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -900,12 +900,13 @@ void CallbackHandlers::NewThreadCallback(const v8::FunctionCallbackInfo<v8::Valu
auto isolate = thiz->GetIsolate();

auto currentExecutingScriptName = StackTrace::CurrentStackTrace(isolate, 1, StackTrace::kScriptName)->GetFrame(0)->GetScriptName();

auto currentExecutingScriptNameStr = ArgConverter::ConvertToString(currentExecutingScriptName);

auto lastForwardSlash = currentExecutingScriptNameStr.find_last_of("/");

auto currentDir = currentExecutingScriptNameStr.substr(0, lastForwardSlash + 1);
string fileSchema("file://");
if (currentDir.compare(0, fileSchema.length(), fileSchema) == 0) {
currentDir = currentDir.substr(fileSchema.length());
}

auto workerPath = ArgConverter::ConvertToString(args[0]->ToString(isolate));

Expand Down
3 changes: 2 additions & 1 deletion runtime/src/main/jni/ModuleInternal.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,8 @@ Local<Script> ModuleInternal::LoadScript(Isolate *isolate, const string& path, c
//
auto cacheData = TryLoadScriptCache(path);

ScriptOrigin origin(fullRequiredModulePath);
auto fullRequiredModulePathWithSchema = ArgConverter::ConvertToV8String(isolate, "file://" + path);
ScriptOrigin origin(fullRequiredModulePathWithSchema);
ScriptCompiler::Source source(scriptText, origin, cacheData);
ScriptCompiler::CompileOptions option = ScriptCompiler::kNoCompileOptions;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,7 @@ describe("Tests exception handling ", function () {
expect(exceptionCaught).toBe(true);
expect(errMsg).toContain("Cannot compile /data/data/com.tns.android_runtime_testapp/files/app/tests/syntaxErrors.js");
expect(errMsg).toContain("SyntaxError: Unexpected token =");
expect(errMsg).toContain("File: \"/data/data/com.tns.android_runtime_testapp/files/app/tests/syntaxErrors.js, line: 3, column: 10");
expect(errMsg).toContain("File: \"file:///data/data/com.tns.android_runtime_testapp/files/app/tests/syntaxErrors.js, line: 3, column: 10");



Expand Down