summaryrefslogtreecommitdiffstats
path: root/src/script/bridge/qscriptobject.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Inline internal QtScript object data() functionsKent Hansen2009-10-231-14/+0
| | | | | | Makes QScriptValue::data() 15% faster. Reviewed-by: Olivier Goffart
* Inline internal QtScript object delegate functionsKent Hansen2009-10-231-16/+0
| | | | | | Makes QScriptValue::scriptClass() 20% faster. Reviewed-by: Olivier Goffart
* compile fix with namespaced qthjk2009-09-281-2/+2
| | | | Reviewed-by: Simon Hausmann
* Update src/3rdparty/javascriptcore and adapt src/script to the changes.Kent Hansen2009-09-241-17/+16
| | | | Reviewed-by: Simon Hausmann
* QtScript: Fix comparing QVariant and QObject.Olivier Goffart2009-09-211-0/+14
| | | | | | | This add a hook inside JSC to be able to implement our own comparison function when comparing objects. Reviewed-by: Kent Hansen
* Update license headers again.Jason McDonald2009-09-091-4/+4
| | | | Reviewed-by: Trust Me
* Update tech preview license header for files that are new in 4.6.Jason McDonald2009-08-311-13/+13
| | | | Reviewed-by: Trust Me
* Fix memory leak in QScriptEngine::newQObjectOlivier Goffart2009-08-251-0/+2
| | | | | | | Do not reset the delegate and the prototype when reusing existing wrapper. Reviewed-by: Kent Hansen
* compile fix with namespaced Qthjk2009-08-241-2/+3
|
* Fix obsolete license headers.Jason McDonald2009-08-211-1/+1
| | | | Reviewed-by: Trust Me
* add recursion guard for GC markingKent Hansen2009-08-201-0/+6
| | | | | | | To achieve behavior of the old back-end. There, the recursion guard was automatic because a mark flag was set on the object as soon as marking begun, but in JSC it appears to only be set _after_ the marking is completed.
* Fix compilation on WindowsSimon Hausmann2009-08-141-0/+1
| | | | | | In WebKit/JSC config.h needs to be included first in .cpp files, to among other things make sure that min/max are not defined as macros through windows.h.
* add configure options for (not) building the QtScript moduleKent Hansen2009-08-071-4/+0
| | | | | | | | | | | | | | | | | | -script (default) and -no-script. This means we can get rid of the SCRIPT feature from qfeatures, since it's now handled by the new configure variable. It also allows us to get rid of all the QT_NO_SCRIPT ifdefs from the source files, since qmake isn't going to include those files for compilation when you configure with -no-script. The QtScriptTools module will be disabled if the QtScript module is not built. You'll have to build the old QtScript back-end (will be made available in a separate package), then build the QtScriptTools module yourself. Reviewed-by: Simon Hausmann
* Updates getPropertyNames() on all javascript object to use the flagBenjamin Poulain2009-08-051-5/+5
| | | | | | | | getPropertyNames() now uses a flag to specify which property should be filtered. This flag should be used by all javascript objects. This patch fixes the changes introduced by e520df1f8678bd59adb341fb586f008a7de17fe8
* adapt to commit 014c4c63066fd3920594e6a58b02f314b5c88cdfKent Hansen2009-08-041-5/+7
|
* QScriptValueIterator: fix missing non-enumerable valuesTor Arne Vestbø2009-07-311-5/+6
| | | | | | | | | | Added an extra argument to JSObject::getPropertyNames() that specifies if the non-enumerable properties (those with the DontEnum attribute set) should be included or not. Tried looking at using a unsigned as an attribute-inclusion or exclusion filter, but the semantics of either the calling or the callee code would be very strange so I opted out.
* Fix license headersOlivier Goffart2009-07-291-5/+35
|
* We cant rely on property attributes from JavaScriptCore for the setter and ↵Olivier Goffart2009-07-161-10/+0
| | | | getter
* add GC marking guardsKent Hansen2009-07-131-2/+4
| | | | | Caller is responsible for calling marked() before mark(), otherwise you might get infinite recursion.
* mark object data if we have itKent Hansen2009-07-131-0/+2
|
* implement ability to dynamically change class of script objectsKent Hansen2009-07-101-0/+225
With an object created by QScriptEngine::newObject(), it should be possible to call QScriptValue::setClass() to dynamically change the behavior of that object. Similarly, it should be possible to promote plain script objects to QObject (QVariant) wrappers by calling the overload of QScriptEngine::newQObject() (newVariant()) that takes a script object as the first argument. This commit implements this capability. The premise is the (internal) QScriptObject class, which inherits JSC::JSObject. It reimplements all the methods for getting/setting properties etc. Then there's a level of indirection to facilitate dynamic change of the class: Each QScriptObject can have a delegate associated with it that will handle operations on the object. By default there is no delegate, so the object behaves as a normal JS object, as you expect. However, once a delegate is set (e.g., when QScriptValue::setScriptClass() is called), QScriptObject will give the delegate the chance to handle the object operation. In addition to a delegate implementation for QScriptClass-based objects, there are also delegates for QObject and QVariant wrappers. These replace the QObjectWrapperObject and QVariantWrapperObject classes.