Remove this piece of code
authorLars Knoll <lars.knoll@theqtcompany.com>
Thu, 13 Aug 2015 16:14:52 +0000 (18:14 +0200)
committerSimon Hausmann <simon.hausmann@theqtcompany.com>
Tue, 25 Aug 2015 03:45:29 +0000 (03:45 +0000)
This was required with the old v8 engine, but removing the
lines doesn't seem to cause any regressions in our tests, so
let's get rid of them, and have proper JS scoping rules
in place.

Change-Id: Ib22b4e820bceff9fe26291dae1bf7b55b12a5cde
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
src/qml/qml/qqmlcontextwrapper.cpp

index 1007029416d3cfcb7e66451d26d19969c4faebb5..99a5fe56ceaa6f697456ce14357b0c00f1916b50 100644 (file)
@@ -100,23 +100,14 @@ ReturnedValue QmlContextWrapper::get(const Managed *m, String *name, bool *hasPr
     QV4::ExecutionEngine *v4 = resource->engine();
     QV4::Scope scope(v4);
 
-    // In V8 the JS global object would come _before_ the QML global object,
-    // so simulate that here.
-    bool hasProp;
-    QV4::ScopedValue result(scope, v4->globalObject->get(name, &hasProp));
-    if (hasProp) {
-        if (hasProperty)
-            *hasProperty = hasProp;
-        return result->asReturnedValue();
-    }
-
     if (resource->d()->isNullWrapper)
         return Object::get(m, name, hasProperty);
 
     if (v4->callingQmlContext() != resource->d()->context)
         return Object::get(m, name, hasProperty);
 
-    result = Object::get(m, name, &hasProp);
+    bool hasProp;
+    QV4::ScopedValue result(scope, Object::get(m, name, &hasProp));
     if (hasProp) {
         if (hasProperty)
             *hasProperty = hasProp;