Showing the changes to libraries/script-engine/src/ScriptManager.cpp (1 of 9 files). Show all
Unified · Split
| @@ -53,6 +53,7 @@ · 52 unmodified lines | ||
| 53 | 53 | #include "ScriptEngines.h" |
| 54 | 54 | #include "StackTestScriptingInterface.h" |
| 55 | 55 | #include "ScriptValue.h" |
| 56 | +#include "ScriptProgram.h" | |
| 56 | 57 | #include "ScriptValueIterator.h" |
| 57 | 58 | #include "ScriptValueUtils.h" |
| 58 | 59 | |
| @@ -1935,18 +1936,21 @@ void ScriptManager::entityScriptContentAvailable(const EntityItemID& entityID, c · 1876 unmodified lines | ||
| 1935 | 1936 | } |
| 1936 | 1937 | |
| 1937 | 1938 | // SYNTAX ERRORS |
| 1938 | − auto syntaxError = _engine->lintScript(contents, fileName); | |
| 1939 | − if (syntaxError.isError()) { | |
| 1940 | − auto message = syntaxError.property("formatted").toString(); | |
| 1941 | − if (message.isEmpty()) { | |
| 1942 | − message = syntaxError.toString(); | |
| 1943 | − } | |
| 1939 | + //auto syntaxError = _engine->lintScript(contents, fileName); | |
| 1940 | + auto program = _engine->newProgram( contents, fileName ); | |
| 1941 | + auto syntaxCheck = program->checkSyntax(); | |
| 1942 | + if (syntaxCheck->state() != ScriptSyntaxCheckResult::Valid) { | |
| 1943 | + auto message = syntaxCheck->errorMessage(); | |
| 1944 | + //syntaxError.property("formatted").toString(); | |
| 1945 | + //if (message.isEmpty()) { | |
| 1946 | + // message = syntaxError.toString(); | |
| 1947 | + //} | |
| 1944 | 1948 | setError(QString("Bad syntax (%1)").arg(message), EntityScriptStatus::ERROR_RUNNING_SCRIPT); |
| 1945 | − syntaxError.setProperty("detail", entityID.toString()); | |
| 1946 | − emit unhandledException(syntaxError); | |
| 1949 | + //syntaxError.setProperty("detail", entityID.toString()); | |
| 1950 | + //V8TODO | |
| 1951 | + //emit unhandledException(syntaxError); | |
| 1947 | 1952 | return; |
| 1948 | 1953 | } |
| 1949 | − auto program = _engine->newProgram( contents, fileName ); | |
| 1950 | 1954 | if (!program) { |
| 1951 | 1955 | setError("Bad program (isNull)", EntityScriptStatus::ERROR_RUNNING_SCRIPT); |
| 1952 | 1956 | emit unhandledException(_engine->makeError(_engine->newValue("program.isNull"))); |