1. 20 Mar, 2012 1 commit
    • Kent Hansen's avatar
      Make QVariant conversion for JS null type symmetric · d96d89c6
      Kent Hansen authored
      If you pass (void*)0 to QJSEngine::toScriptValue(), or you pass a
      QVariant of type QMetaType::VoidStar containing a 0 value, you get
      back a QJSValue of type null (isNull() returns true); that's fine.
      
      However, if you called QJSValue::toVariant() on a JS null value, you
      would get back an invalid QVariant. The expected result is a
      QVariant of type QMetaType::VoidStar containing a 0 value. This
      makes the conversion of the JS null type symmetric and avoids loss
      of data.
      
      Change-Id: Ifa6e788152118f80adf9c2d7be1283f053b44294
      Reviewed-by: default avatarJędrzej Nowacki <jedrzej.nowacki@nokia.com>
      Reviewed-by: default avatarSimon Hausmann <simon.hausmann@nokia.com>
      d96d89c6
  2. 13 Mar, 2012 1 commit
  3. 24 Feb, 2012 1 commit
  4. 07 Feb, 2012 1 commit
  5. 02 Feb, 2012 8 commits
    • Kent Hansen's avatar
      Remove QJSEngine::undefinedValue() function · 52b77f94
      Kent Hansen authored
      Rationale: It's strange to have an undefined value factory function.
      There should just be one way of constructing undefined values: By
      passing UndefinedValue to the QJSValue constructor.
      
      The undefinedValue() function created a value that was bound to the
      engine; the QJSValue constructor does not. In order to ensure that
      we're testing the same behavior as before, I've replaced
      undefinedValue() calls by toScriptValue(QVariant()) in the autotests.
      
      Task-number: QTBUG-23604
      Change-Id: Ie9295b7af49c853b5a4a3445da48c325fef8d6b1
      Reviewed-by: default avatarJędrzej Nowacki <jedrzej.nowacki@nokia.com>
      Reviewed-by: default avatarSimon Hausmann <simon.hausmann@nokia.com>
      52b77f94
    • Kent Hansen's avatar
      Remove QJSValue::isFunction() function · fe6173c5
      Kent Hansen authored
      Rationale: QJSValue::isCallable() should be used instead. There is no
      compelling reason to be able to distinguish between JS Function
      instances and other callable objects.
      
      Task-number: QTBUG-23604
      Change-Id: Ieef6b32030ef70f54081035fd4ffc3c17c184cd3
      Reviewed-by: default avatarJędrzej Nowacki <jedrzej.nowacki@nokia.com>
      fe6173c5
    • Kent Hansen's avatar
      Remove QJSValue::construct() and deprecated call() overload · 9e7e0c16
      Kent Hansen authored
      callAsConstructor() should be used instead.
      
      Task-number: QTBUG-23604
      Change-Id: If95ab9906712ede7cbae5e9d24624708bccf880f
      Reviewed-by: default avatarJędrzej Nowacki <jedrzej.nowacki@nokia.com>
      9e7e0c16
    • Kent Hansen's avatar
      Remove QJSValue::toInt32() and toUInt32() functions · 88cb0644
      Kent Hansen authored
      toInt() and toUInt() should be used instead.
      
      Task-number: QTBUG-23604
      Change-Id: Ib64aea139e9082066a1e5096ef9fe3a97c35d3eb
      Reviewed-by: default avatarJędrzej Nowacki <jedrzej.nowacki@nokia.com>
      88cb0644
    • Kent Hansen's avatar
      Remove QJSEngine::nullValue() function · fd7fce38
      Kent Hansen authored
      Rationale: It's strange to have a null value factory function.
      There should just be one way of constructing null values: By
      passing NullValue to the QJSValue constructor.
      
      The nullValue() function created a value that was bound to the
      engine; the QJSValue constructor does not. In order to ensure that
      we're testing the same behavior as before, I've replaced nullValue()
      calls by evaluate("null") in the autotests.
      
      Task-number: QTBUG-23604
      Change-Id: Ie40b61fa64e070b90c6245fd21554963073c5f80
      Reviewed-by: default avatarJędrzej Nowacki <jedrzej.nowacki@nokia.com>
      fd7fce38
    • Kent Hansen's avatar
      Remove QJSValue constructors that take QJSEngine argument · f4c98230
      Kent Hansen authored
      Rationale: These were remnants from QtScript.
      The difference from the standard constructors is that the value is
      eagerly bound to the engine, so they can be a bit faster. But they
      are also more low-level and look ugly in use.
      
      Task-number: QTBUG-23604
      Change-Id: I5dae7452389383f60055d5ccc4f28d53c52f6092
      Reviewed-by: default avatarJędrzej Nowacki <jedrzej.nowacki@nokia.com>
      f4c98230
    • Kent Hansen's avatar
      Remove QJSValue::propertyFlags() function · 54c51c89
      Kent Hansen authored
      Rationale: The API is incomplete. There is no way to set/update the
      flags; adding a third (optional) argument to setProperty() is ugly.
      
      If necessary, a QJSPropertyDescriptor API should be added, to enable
      complete setting/querying of properties.
      
      The flags were moved to QJSValuePrivate, and the propertyFlags()
      implementation kept, because there is one place the read-only flag
      is checked internally (in qv8typewrapper).
      
      Task-number: QTBUG-23604
      Change-Id: I089dce28dbda428662aac7c8d1536987fe6d855c
      Reviewed-by: default avatarJędrzej Nowacki <jedrzej.nowacki@nokia.com>
      54c51c89
    • Kent Hansen's avatar
      Remove invalid QJSValue type · ed84a6ee
      Kent Hansen authored
      Rationale: It's confusing to have an invalid type (which doesn't
      exist in JavaScript), and it creates lots of extra cases that have
      to be handled e.g. in value conversion and comparison. The Undefined
      type should be sufficient.
      
      Also, the invalid value type was being (ab)used to 1) make
      setProperty() act as a property deleter, and 2) signify that a
      property queried by property() doesn't exist. The recently introduced
      functions has(Own)Property() and deleteProperty() now provide that
      functionality.
      
      Default-constructed QJSValues now have the Undefined type.
      
      Task-number: QTBUG-23604
      Change-Id: I1847492724d31e03ee1212c09ec87a2010920dc5
      Reviewed-by: default avatarJędrzej Nowacki <jedrzej.nowacki@nokia.com>
      ed84a6ee
  6. 01 Feb, 2012 6 commits
  7. 30 Jan, 2012 1 commit
  8. 23 Jan, 2012 1 commit
  9. 20 Jan, 2012 8 commits
  10. 11 Jan, 2012 1 commit
  11. 05 Jan, 2012 1 commit
  12. 15 Aug, 2011 1 commit
  13. 29 Jul, 2011 1 commit