| Index: src/FileSystemJsObject.cpp |
| diff --git a/src/FileSystemJsObject.cpp b/src/FileSystemJsObject.cpp |
| index f62e00429eea3dc98cf5d028592ca733bacc4faf..e7d94db95daa0e5a323d4105215e1d30a33a98c4 100644 |
| --- a/src/FileSystemJsObject.cpp |
| +++ b/src/FileSystemJsObject.cpp |
| @@ -179,16 +179,18 @@ namespace |
| if (!globalContext->IsObject()) |
| throw std::runtime_error("`this` pointer has to be an object"); |
| - const v8::TryCatch tryCatch(jsEngine->GetIsolate()); |
| + auto isolate = jsEngine->GetIsolate(); |
| + const v8::TryCatch tryCatch(isolate); |
| const auto contentEnd = content.cend(); |
| auto stringBegin = SkipEndOfLine(content.begin(), contentEnd); |
| + auto v8Context = isolate->GetCurrentContext(); |
| do |
| { |
| auto stringEnd = AdvanceToEndOfLine(stringBegin, contentEnd); |
| - auto jsLine = Utils::StringBufferToV8String(jsEngine->GetIsolate(), StringBuffer(stringBegin, stringEnd)).As<v8::Value>(); |
| - processFunc->Call(globalContext, 1, &jsLine); |
| + auto jsLine = Utils::StringBufferToV8String(isolate, StringBuffer(stringBegin, stringEnd)).As<v8::Value>(); |
| + processFunc->Call(v8Context, globalContext, 1, &jsLine); |
|
hub
2018/06/18 12:59:02
I get this warning here:
../src/FileSystemJsObjec
sergei
2018/06/18 13:00:19
Yeah, that's because the impl is not complete yet.
|
| if (tryCatch.HasCaught()) |
| - throw JsError(tryCatch.Exception(), tryCatch.Message()); |
| + throw JsError(isolate, tryCatch.Exception(), tryCatch.Message()); |
| stringBegin = SkipEndOfLine(stringEnd, contentEnd); |
| } while (stringBegin != contentEnd); |
| jsEngine->GetJsValues(weakData->weakResolveCallback)[0].Call(); |