Showing the changes to libraries/script-engine/src/v8/ScriptEngineV8.cpp (1 of 4 files). Show all
Unified · Split
| @@ -937,13 +937,15 @@ ScriptValue ScriptEngineV8::evaluate(const QString& sourceCode, const QString& f · 936 unmodified lines | ||
| 937 | 937 | v8::Isolate::Scope isolateScope(_v8Isolate); |
| 938 | 938 | v8::HandleScope handleScope(_v8Isolate); |
| 939 | 939 | v8::Context::Scope contextScope(getContext()); |
| 940 | − v8::TryCatch tryCatch(getIsolate()); | |
| 941 | 940 | v8::ScriptOrigin scriptOrigin(getIsolate(), v8::String::NewFromUtf8(getIsolate(), fileName.toStdString().c_str()).ToLocalChecked()); |
| 942 | 941 | v8::Local<v8::Script> script; |
| 943 | − if (!v8::Script::Compile(getContext(), v8::String::NewFromUtf8(getIsolate(), sourceCode.toStdString().c_str()).ToLocalChecked(), &scriptOrigin).ToLocal(&script)) { | |
| 944 | − setUncaughtException(tryCatch, "Error while compiling script"); | |
| 945 | − _evaluatingCounter--; | |
| 946 | − return nullValue(); | |
| 942 | + { | |
| 943 | + v8::TryCatch tryCatch(getIsolate()); | |
| 944 | + if (!v8::Script::Compile(getContext(), v8::String::NewFromUtf8(getIsolate(), sourceCode.toStdString().c_str()).ToLocalChecked(), &scriptOrigin).ToLocal(&script)) { | |
| 945 | + setUncaughtException(tryCatch, "Error while compiling script"); | |
| 946 | + _evaluatingCounter--; | |
| 947 | + return nullValue(); | |
| 948 | + } | |
| 947 | 949 | } |
| 948 | 950 | //qCDebug(scriptengine_v8) << "Script compilation succesful: " << fileName; |
| 949 | 951 | |