summaryrefslogtreecommitdiffstats
path: root/src/script/api/qscriptengine.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* fix GC-related crashKent Hansen2009-07-151-2/+4
| | | | | | | For some reason our Global Object is not marked by the collector. This fixes the case when you invoke GC explicitly by calling collectGarbage(), but the issue is probably still there when GC is invoked implicitly.
* fix some memory leaksKent Hansen2009-07-151-2/+6
|
* initial attempt at implementing QScriptEngine::setGlobalObject()Kent Hansen2009-07-151-6/+66
| | | | | Doesn't actually replace the global object, but rather has the standard global object act as a proxy to the custom one.
* implement QObject wrapper caching (PreferExistingWrapperObject)Kent Hansen2009-07-151-2/+12
|
* implement QScriptEngine::isEvaluating()Kent Hansen2009-07-151-3/+2
|
* don't assert in QScriptEngine::setGlobalObject()Kent Hansen2009-07-131-2/+2
| | | | allow stuff to run, even though it's likely to crash/not work...
* add GC marking guardsKent Hansen2009-07-131-7/+13
| | | | | Caller is responsible for calling marked() before mark(), otherwise you might get infinite recursion.
* Merge branch 'qtscript-jsc-backend' of ↵Jedrzej Nowacki2009-07-131-183/+39
|\ | | | | | | git@scm.dev.nokia.troll.no:qt/qt-webkit into qtscript-jsc-backend
| * don't crash during GC if no prototype has been set for a metatypeKent Hansen2009-07-101-4/+7
| | | | | | | | | | | | Also, have pushContext() return currentContext() for now, to avoid crashing, and disable processing of __postInit__ property in importExtension() for same reason.
| * implement ability to dynamically change class of script objectsKent Hansen2009-07-101-179/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | fix checkSyntax autotest.Jedrzej Nowacki2009-07-131-17/+38
| |
* | fix autotest canEvaluate.Jedrzej Nowacki2009-07-131-4/+80
|/
* register QScriptValue as meta-typeKent Hansen2009-07-091-0/+2
| | | | The old engine did it as well. Makes more tests pass.
* Fix autotest checking QScriptValue::objectId method.Jedrzej Nowacki2009-07-091-4/+13
| | | | (QScriptValue::objectId() and QScriptEnigne::objectById)
* use currentFrame instead of globalExec whenever we canKent Hansen2009-07-091-20/+20
|
* rewrite most of QScriptContext handlingKent Hansen2009-07-081-31/+40
| | | | Do it The right way(TM), by lazily wrapping JSC::ExecState objects.
* Fix engineDelete autotest.Jedrzej Nowacki2009-07-081-0/+14
|
* work on QScriptEngine::uncaughtException()Kent Hansen2009-07-071-6/+11
| | | | | | It's possible that JSC evaluate() returns a completion of type Throw without hadException() being true, so we need to store the exception value explicitly.
* mark the QScriptClass object prototypeKent Hansen2009-07-071-0/+2
|
* start to implement QScriptEngine::importExtension()Kent Hansen2009-07-061-5/+200
|
* implement QScriptEngine::availableExtensions()Kent Hansen2009-07-061-3/+71
|
* make QScriptClass::HasInstance extension workKent Hansen2009-07-061-1/+1
|
* start implementing QScriptClass extensionsKent Hansen2009-07-031-0/+43
| | | | Callable seems to work, HasInstance not quite there yet.
* make more tests passKent Hansen2009-07-031-0/+2
|
* implement a fair amount of the QScriptClass functionalityKent Hansen2009-07-021-5/+131
| | | | | Enumeration is missing, as is the ability to change the class of an object after it has been created.
* first stab at implementing Qt property getter/settersKent Hansen2009-07-021-0/+6
| | | | Not fully working yet, so disabled for now
* don't crash if isFunction() is called with invalid JS valueKent Hansen2009-06-301-1/+1
|
* implement setting of default prototype in newQObject()Kent Hansen2009-06-301-14/+48
|
* implement name-based connection, make more tests workKent Hansen2009-06-301-7/+13
|
* port recent changes from qt/masterKent Hansen2009-06-301-4/+3
| | | | Makes variant conversion work for signal handlers.
* implement QScriptEngine::installTranslatorFunctions()Kent Hansen2009-06-261-2/+134
|
* cleanup, make print() function handle exceptionsKent Hansen2009-06-261-81/+41
|
* implement QMetaObject bindingsKent Hansen2009-06-261-2/+18
|
* work on signal bindings (connect, disconnect, signal emission)Kent Hansen2009-06-241-13/+221
|
* make more qscriptengine tests runKent Hansen2009-06-241-37/+62
| | | | | Not everything passes but at least nothing asserts anymore, so the test runs to completion.
* make most of the qscriptvalue tests passKent Hansen2009-06-231-5/+6
| | | | call(), construct() etc.
* toObject({undefined,null}) should return invalid scriptvalueKent Hansen2009-06-231-1/+1
| | | | JSC will throw an error.
* Import JSC-based Qt Script from Kent's tree.Simon Hausmann2009-06-161-0/+2634