Ignore:
Timestamp:
Jan 23, 2008, 1:39:04 AM (17 years ago)
Author:
Simon Hausmann
Message:

Michael Goddard <[email protected]>

Reworked the JavaScriptCore Qt bindings:

  • Add initial support for string and variant arrays, as well as sub QObjects in the JS bindings.
  • Don't expose fields marked as not scriptable by moc.
  • Add support for dynamic properties and accessing named QObject children of an object (like QtScript and older IE DOM style JS).
  • Add support for custom toString methods.
  • Fine tune some bindings to be closer to QtScript. Make void functions return undefined, and empty/ null QStrings return a zero length string.
  • Create framework for allowing more direct method calls. Since RuntimeMethod doesn't allow us to add additional methods/properties to a function, add these classes. Start prototyping object.signal.connect(...).
  • Add signal support to the Qt bindings. Allow connecting to signals (object.signal.connect(slot)), disconnecting, and emitting signals. Currently chooses the first signal that matches the name, so this will need improvement.
  • Add property names, and resolve signals closer to use. Enumerating properties now returns some of the Qt properties and signals. Slots and methods aren't quite present. Also, resolve signal connections etc. closer to the time of use, so we can do more dynamic resolution based on argument type etc. Still picks the first one with the same name, at the moment.
  • Make signature comparison code consistent. Use the same code for checking meta signatures in the method and fallback getters, and avoid a QByteArray construction when we can.
  • Fix minor memory leak, and handle pointers better. Delete the private object in the dtors, and use RefPtrs for holding Instances etc.
  • Handle method lookup better. Allow invocation time method lookup based on the arguments, which is closer to QtScript behaviour. Also, cache the method lists and delete them in the QtClass dtor (stops a memory leak).
  • Improve JS to Qt data type conversions. Add some support for Date & RegExp JS objects, and provide some metrics on the quality of the conversion.
  • A couple of fixes for autotest failures. Better support for converting lists, read/write only QMetaProperty support, modified slot search order...)
  • Update JS DRT controller for Qt JS binding changes. There were two functions that needed some changes so that the layout tests would work, so this makes a few tests pass again.
  • Bump the timeout for layout tests up to 11s. At least some tests have an internal timeout of 10 seconds, so make the waitUntilDone approach wait at least 11s. fast/dom/open-and-close-by-DOM.html is one of these - now the failure message is more accurate.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/bindings/runtime.cpp

    r29447 r29729  
    8484{
    8585    Instance *newInstance = 0;
    86    
     86
    8787    switch (language) {
    8888#if HAVE(JNI)
     
    130130        return QtInstance::getRuntimeObject(static_cast<QtInstance*>(instance));
    131131#endif
     132    return reallyCreateRuntimeObject(instance);
     133}
     134
     135JSObject* Instance::reallyCreateRuntimeObject(Instance* instance)
     136{
    132137    JSLock lock;
     138
    133139    return new RuntimeObjectImp(instance);
    134140}
     
    148154}
    149155
    150 RootObject* Instance::rootObject() const
    151 {
     156RootObject* Instance::rootObject() const 
     157{ 
    152158    return _rootObject && _rootObject->isValid() ? _rootObject.get() : 0;
    153159}
Note: See TracChangeset for help on using the changeset viewer.