summaryrefslogtreecommitdiffstats
path: root/src/script/api
Commit message (Collapse)AuthorAgeFilesLines
* Merge branch 'qtscript-jsc-backend' of ↵Jedrzej Nowacki2009-07-133-268/+93
|\ | | | | | | 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-103-264/+86
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-133-17/+42
| |
* | fix autotest canEvaluate.Jedrzej Nowacki2009-07-132-5/+82
|/
* some small fixes/experimentsKent Hansen2009-07-101-4/+20
|
* register QScriptValue as meta-typeKent Hansen2009-07-091-0/+2
| | | | The old engine did it as well. Makes more tests pass.
* use JSC::call() and JSC::construct()Kent Hansen2009-07-091-54/+2
|
* Fix autotest checking QScriptValue::objectId method.Jedrzej Nowacki2009-07-094-19/+29
| | | | (QScriptValue::objectId() and QScriptEnigne::objectById)
* make arguments object work for native functionsKent Hansen2009-07-091-1/+1
| | | | There's an off-by-one issue that we just work around for now.
* use currentFrame instead of globalExec whenever we canKent Hansen2009-07-092-47/+47
|
* support callees that are not function objectsKent Hansen2009-07-092-5/+5
| | | | E.g. QScriptClass-based objects.
* rewrite most of QScriptContext handlingKent Hansen2009-07-086-82/+294
| | | | Do it The right way(TM), by lazily wrapping JSC::ExecState objects.
* Fix engineDelete autotest.Jedrzej Nowacki2009-07-084-4/+110
|
* work on QScriptEngine::uncaughtException()Kent Hansen2009-07-073-8/+22
| | | | | | 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-062-3/+75
|
* fix QScriptValue::construct() when argument is not array-likeKent Hansen2009-07-062-4/+8
|
* make QScriptClass::HasInstance extension workKent Hansen2009-07-062-2/+2
|
* start implementing QScriptClass extensionsKent Hansen2009-07-032-1/+50
| | | | Callable seems to work, HasInstance not quite there yet.
* make more tests passKent Hansen2009-07-032-4/+2
|
* implement a fair amount of the QScriptClass functionalityKent Hansen2009-07-024-15/+209
| | | | | 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-022-0/+7
| | | | Not fully working yet, so disabled for now
* implement QScriptValue::QObjectMember property flagKent Hansen2009-07-021-0/+2
|
* use the JSC::Getter and JSC::Setter flagsKent Hansen2009-07-021-4/+2
|
* 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-302-14/+51
|
* 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.
* dummy QScriptContextInfo implementationKent Hansen2009-06-291-25/+81
| | | | | It doesn't give useful information but at least apps that try to use it (e.g. the qscriptjstestsuite autotest) won't assert now.
* Merge branch 'qtwebkit-4.6-staging' into qtscript-jsc-backendKent Hansen2009-06-298-32/+272
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/script/api/qscriptable.cpp src/script/api/qscriptclasspropertyiterator.cpp src/script/api/qscriptcontext.cpp src/script/api/qscriptengine.h src/script/api/qscriptengineagent.cpp src/script/api/qscriptextensionplugin.cpp src/script/api/qscriptvalue.h src/script/api/qscriptvalueiterator.cpp src/script/parser/qscript.g src/script/parser/qscriptast.cpp src/script/parser/qscriptast_p.h src/script/parser/qscriptastvisitor_p.h src/script/parser/qscriptgrammar.cpp src/script/parser/qscriptgrammar_p.h src/script/parser/qscriptlexer.cpp src/script/parser/qscriptlexer_p.h src/script/parser/qscriptparser.cpp src/script/parser/qscriptparser_p.h src/script/parser/qscriptsyntaxchecker.cpp src/script/qscriptable.h src/script/qscriptable_p.h src/script/qscriptarray_p.h src/script/qscriptasm.cpp src/script/qscriptasm_p.h src/script/qscriptastfwd_p.h src/script/qscriptastvisitor.cpp src/script/qscriptbuffer_p.h src/script/qscriptclass.cpp src/script/qscriptclass.h src/script/qscriptclass_p.h src/script/qscriptclassdata.cpp src/script/qscriptclassdata_p.h src/script/qscriptclassinfo_p.h src/script/qscriptclasspropertyiterator.h src/script/qscriptclasspropertyiterator_p.h src/script/qscriptcompiler.cpp src/script/qscriptcompiler_p.h src/script/qscriptcontext.h src/script/qscriptcontext_p.cpp src/script/qscriptcontext_p.h src/script/qscriptcontextfwd_p.h src/script/qscriptcontextinfo.cpp src/script/qscriptcontextinfo.h src/script/qscriptcontextinfo_p.h src/script/qscriptecmaarray.cpp src/script/qscriptecmaarray_p.h src/script/qscriptecmaboolean.cpp src/script/qscriptecmaboolean_p.h src/script/qscriptecmacore.cpp src/script/qscriptecmacore_p.h src/script/qscriptecmadate.cpp src/script/qscriptecmadate_p.h src/script/qscriptecmaerror.cpp src/script/qscriptecmaerror_p.h src/script/qscriptecmafunction.cpp src/script/qscriptecmafunction_p.h src/script/qscriptecmaglobal.cpp src/script/qscriptecmaglobal_p.h src/script/qscriptecmamath.cpp src/script/qscriptecmamath_p.h src/script/qscriptecmanumber.cpp src/script/qscriptecmanumber_p.h src/script/qscriptecmaobject.cpp src/script/qscriptecmaobject_p.h src/script/qscriptecmaregexp.cpp src/script/qscriptecmaregexp_p.h src/script/qscriptecmastring.cpp src/script/qscriptecmastring_p.h src/script/qscriptengine.cpp src/script/qscriptengine_p.cpp src/script/qscriptengine_p.h src/script/qscriptengineagent.h src/script/qscriptengineagent_p.h src/script/qscriptenginefwd_p.h src/script/qscriptextensioninterface.h src/script/qscriptextensionplugin.h src/script/qscriptextenumeration.cpp src/script/qscriptextenumeration_p.h src/script/qscriptextqobject.cpp src/script/qscriptextqobject_p.h src/script/qscriptextvariant.cpp src/script/qscriptextvariant_p.h src/script/qscriptfunction.cpp src/script/qscriptfunction_p.h src/script/qscriptgc_p.h src/script/qscriptglobals_p.h src/script/qscriptmember_p.h src/script/qscriptmemberfwd_p.h src/script/qscriptmemorypool_p.h src/script/qscriptnameid_p.h src/script/qscriptnodepool_p.h src/script/qscriptobject_p.h src/script/qscriptobjectdata_p.h src/script/qscriptobjectfwd_p.h src/script/qscriptrepository_p.h src/script/qscriptstring.cpp src/script/qscriptstring.h src/script/qscriptstring_p.h src/script/qscriptsyntaxchecker_p.h src/script/qscriptsyntaxcheckresult_p.h src/script/qscriptvalue.cpp src/script/qscriptvalue_p.h src/script/qscriptvaluefwd_p.h src/script/qscriptvalueimpl.cpp src/script/qscriptvalueimpl_p.h src/script/qscriptvalueimplfwd_p.h src/script/qscriptvalueiterator.h src/script/qscriptvalueiterator_p.h src/script/qscriptvalueiteratorimpl.cpp src/script/qscriptvalueiteratorimpl_p.h src/script/visitors/qscriptprettypretty.cpp src/script/visitors/qscriptprettypretty_p.h src/script/visitors/qscriptxmlgenerator.cpp src/script/visitors/qscriptxmlgenerator_p.h
* implement QScriptEngine::installTranslatorFunctions()Kent Hansen2009-06-261-2/+134
|
* cleanup, make print() function handle exceptionsKent Hansen2009-06-261-81/+41
|
* implement QScriptValue::isQMetaObject() and QScriptValue::toQMetaObject()Kent Hansen2009-06-261-10/+8
|
* implement QMetaObject bindingsKent Hansen2009-06-263-4/+25
|
* work on signal bindings (connect, disconnect, signal emission)Kent Hansen2009-06-243-16/+240
|
* make more qscriptengine tests runKent Hansen2009-06-247-49/+125
| | | | | Not everything passes but at least nothing asserts anymore, so the test runs to completion.
* preliminary implementation of QScriptValueIterator APIKent Hansen2009-06-231-18/+85
| | | | | Properties in the prototype chain are not ignored like they should be, yet.
* make most of the qscriptvalue tests passKent Hansen2009-06-233-74/+146
| | | | call(), construct() etc.
* use JSC::asObject()Kent Hansen2009-06-231-40/+36
|
* 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-1630-0/+9377