Showing the changes to libraries/script-engine/src/ScriptEngine.cpp (1 of 1 file). Show all
Unified · Split
| @@ -72,7 +72,7 @@ · 71 unmodified lines | |||
| 72 | static const QScriptEngine::QObjectWrapOptions DEFAULT_QOBJECT_WRAP_OPTIONS = | 72 | static const QScriptEngine::QObjectWrapOptions DEFAULT_QOBJECT_WRAP_OPTIONS = |
| 73 | QScriptEngine::ExcludeDeleteLater | QScriptEngine::ExcludeChildObjects; | 73 | QScriptEngine::ExcludeDeleteLater | QScriptEngine::ExcludeChildObjects; |
| 74 | static const QScriptValue::PropertyFlags READONLY_PROP_FLAGS { QScriptValue::ReadOnly | QScriptValue::Undeletable }; | 74 | static const QScriptValue::PropertyFlags READONLY_PROP_FLAGS { QScriptValue::ReadOnly | QScriptValue::Undeletable }; |
| 75 | static const QScriptValue::PropertyFlags HIDDEN_PROP_FLAGS { READONLY_PROP_FLAGS | QScriptValue::SkipInEnumeration }; | 75 | static const QScriptValue::PropertyFlags READONLY_HIDDEN_PROP_FLAGS { READONLY_PROP_FLAGS | QScriptValue::SkipInEnumeration }; |
| 76 | 76 | ||
| 77 | 77 | ||
| 78 | 78 | ||
| @@ -165,7 +165,7 @@ ScriptEngine::ScriptEngine(Context context, const QString& scriptContents, const · 86 unmodified lines | |||
| 165 | // ... but may not always be available -- so if needed we fallback to the passed exception | 165 | // ... but may not always be available -- so if needed we fallback to the passed exception |
| 166 | emit unhandledException(exception); | 166 | emit unhandledException(exception); |
| 167 | } | 167 | } |
| 168 | }); | 168 | }, Qt::DirectConnection); |
| 169 | 169 | ||
| 170 | setProcessEventsInterval(MSECS_PER_SECOND); | 170 | setProcessEventsInterval(MSECS_PER_SECOND); |
| 171 | if (isEntityServerScript()) { | 171 | if (isEntityServerScript()) { |
| @@ -1250,7 +1250,7 @@ void ScriptEngine::stopTimer(QTimer *timer) { · 1078 unmodified lines | |||
| 1250 | 1250 | ||
| 1251 | QUrl ScriptEngine::resolvePath(const QString& include) const { | 1251 | QUrl ScriptEngine::resolvePath(const QString& include) const { |
| 1252 | QUrl url(include); | 1252 | QUrl url(include); |
| 1253 | // first lets check to see if it's already a full URL | 1253 | // first lets check to see if it's already a full URL -- or a Windows path like "c:/" |
| 1254 | if (include.startsWith("/") || url.scheme().length() == 1) { | 1254 | if (include.startsWith("/") || url.scheme().length() == 1) { |
| 1255 | url = QUrl::fromLocalFile(include); | 1255 | url = QUrl::fromLocalFile(include); |
| 1256 | } | 1256 | } |
| @@ -1261,12 +1261,12 @@ QUrl ScriptEngine::resolvePath(const QString& include) const { · 4 unmodified lines | |||
| 1261 | // we apparently weren't a fully qualified url, so, let's assume we're relative | 1261 | // we apparently weren't a fully qualified url, so, let's assume we're relative |
| 1262 | // to the first absolute URL in the JS scope chain | 1262 | // to the first absolute URL in the JS scope chain |
| 1263 | QUrl parentURL; | 1263 | QUrl parentURL; |
| 1264 | auto ctx = currentContext(); | 1264 | auto context = currentContext(); |
| 1265 | do { | 1265 | do { |
| 1266 | QScriptContextInfo contextInfo { ctx }; | 1266 | QScriptContextInfo contextInfo { context }; |
| 1267 | parentURL = QUrl(contextInfo.fileName()); | 1267 | parentURL = QUrl(contextInfo.fileName()); |
| 1268 | ctx = ctx->parentContext(); | 1268 | context = context->parentContext(); |
| 1269 | } while (parentURL.isRelative() && ctx); | 1269 | } while (parentURL.isRelative() && context); |
| 1270 | 1270 | ||
| 1271 | if (parentURL.isRelative()) { | 1271 | if (parentURL.isRelative()) { |
| 1272 | // fallback to the "include" parent (if defined, this will already be absolute) | 1272 | // fallback to the "include" parent (if defined, this will already be absolute) |