summaryrefslogtreecommitdiffstats
path: root/src/script
Commit message (Collapse)AuthorAgeFilesLines
* Fix compilation with MSVC.Simon Hausmann2009-08-141-0/+1
| | | | | A forward declaration of QScriptString is not sufficient for MSVC, include qscriptstring.h.
* Fix compilation with MSVCSimon Hausmann2009-08-141-10/+10
| | | | | Use the JSC_HOST_CALL annotation for the declaration as well as for the definition of the JSC callback functions.
* Fix inclusions of "utils/qscriptdate_p.h" with msvcSimon Hausmann2009-08-141-0/+2
| | | | | | Don't rely on the current working directory being src/script, as that does not appear to be the case when building with .vcproj files. Instead add src/script to the INCLUDEPATH, so that the above inclusion works.
* implement GC marking of qobject sender JS wrapperKent Hansen2009-08-141-5/+5
|
* Skip the fake context created by Interpreter::exucute for the backtraceOlivier Goffart2009-08-141-0/+5
|
* get rid of src/script/webkit.priKent Hansen2009-08-132-43/+44
| | | | Not needed since commit 9727a71ea077658148e963bc8510269b08095023.
* Lazily construct the QScriptActivationObjectOlivier Goffart2009-08-135-39/+93
| | | | | | | | | | | We can store flags on the ReturnValueRegister entry in the stackframe header (as native function don't use that) Then when requesting an activation object we can lookup the flags to know if we should create it. This reduce a lot the cost of a native call. Reviewed-by: Kent Hansen
* Make simple function getters inlineOlivier Goffart2009-08-124-22/+3
|
* Set 'this' on the javascript stack for native functionOlivier Goffart2009-08-121-0/+4
| | | | | | | When called from the interpreter, we do not need to create a stack frame, but we need anyway to put the newly created this on the stack. This fixes crash in the test qscriptjstestsuite
* Push frames when needed for native getter or settersOlivier Goffart2009-08-121-2/+6
| | | | | This is some other places where Qt native function may expect to have their own context
* Make it possible to build QtScript against JavaScriptCore from an external ↵Simon Hausmann2009-08-121-19/+30
| | | | | | directory Reviewed-by: Kent Hansen
* Cantralize the place when we construct the default 'this' object that JSC ↵Olivier Goffart2009-08-123-28/+13
| | | | | | | | doesn't construct. Removes code duplication. This also indirrectly fixes the QMetaObjectWrapperObject where this was missing
* Refactor the way the JS stack are created for native functionOlivier Goffart2009-08-126-86/+133
| | | | | | | | | | The original JavaScriptCore doesn't create stack frame or scope for native function. JSC has been patched to support that. This commit revert our patches to JSC, and implement create the stack frame from QScript Reviewed-by: Kent Hansen
* Move JSC::Debugger's events calls from JSC::evaluate() toJedrzej Nowacki2009-08-121-1/+31
| | | | | | | QSCriptEngine::evaluate() Fix broken behavior after bad integration with 538153994cacc4613aef1eb8ef77e501be7f5a88 commit
* Crash fix.Jedrzej Nowacki2009-08-121-1/+2
| | | | | | Fix GetSetAgent() in tst_qscriptengine. Reviewed-by: TrustMe
* Merge branch 'master' of git@scm.dev.nokia.troll.no:qt/qt into ↵Kent Hansen2009-08-1244-46/+46
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | qtscript-jsc-backend Conflicts: configure src/script/qscriptarray_p.h src/script/qscriptasm.cpp src/script/qscriptasm_p.h src/script/qscriptbuffer_p.h src/script/qscriptclass.cpp src/script/qscriptclassdata.cpp src/script/qscriptclassdata_p.h src/script/qscriptclassinfo_p.h src/script/qscriptclasspropertyiterator_p.h src/script/qscriptcompiler.cpp src/script/qscriptcompiler_p.h src/script/qscriptcontext_p.cpp src/script/qscriptcontext_p.h src/script/qscriptcontextfwd_p.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_p.h src/script/qscriptenginefwd_p.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/qscriptnameid_p.h src/script/qscriptnodepool_p.h src/script/qscriptobject_p.h src/script/qscriptobjectfwd_p.h src/script/qscriptprettypretty.cpp src/script/qscriptprettypretty_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/qscriptvalueiteratorimpl.cpp src/script/qscriptvalueiteratorimpl_p.h
| * Update contact URL in license headers.Jason McDonald2009-08-12114-116/+116
| | | | | | | | Reviewed-by: Trust Me
* | revert part of commit 2449e7fc567f8151736949032a001cf2aa2d5bb9Kent Hansen2009-08-121-2/+1
| | | | | | | | It reverted commit f2f338a922d20ad36c9849f5ea3208a8c4f1674a.
* | Fix compilation on 64-bit machines.Simon Hausmann2009-08-121-1/+1
| | | | | | | | | | | | | | | | | | On 64-bit machines the construction of QVariant from intptr_t is ambigious as it could be void* or ulonglong. The documentation for the debugger extension on the other hand is clear that it should be a qint64. An explicit construction of a qint64 fixes it. Reviewed-by: Jedrzej Nowacki <jedrzej.nowacki@nokia.com>
* | Implement connection between JSC::Debugger and QScriptEngineAgent.Jedrzej Nowacki2009-08-113-26/+113
| | | | | | | | | | | | | | | | | | | | | | Complete reimplementation of QScriptEngineAgentPrivate. New QScriptEngineAgentPrivate implementation makes conversion from different JSC::Debuger types and events to corresponding QScriptEngineAgent. contextPush and contextPop events are created in QScriptEngine each time contextPush or contextPop is ordered from public API
* | QtScript building system changeJedrzej Nowacki2009-08-113-32/+34
| | | | | | | | | | | | | | | | Make new dependency: QScripttools on Webkit. This change is needed to implement QScriptEngineAgent as child of JSC::Debugger. Exclude common part from scripttool.pri and script.pri and move it to webkit.pri
* | make it possible to pop all items in a scope chain and then push to itKent Hansen2009-08-111-8/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | A lot of the JSC::ExecState functions rely on scopeChain() not being 0. This means we shouldn't pop the scope chain if doing so would make it empty; otherwise when you call e.g. pushScope() or evaluate(), you will crash. So instead of popping the chain completely, we now set the sole scope chain item's object pointer to 0 and add appropriate checks elsewhere. A second issue, not solved in this commit, is that JSC expects the Global Object to always be the last item in every scope chain. If it's not, you will crash.
* | compile qtscript with -DNDEBUGKent Hansen2009-08-111-1/+1
| | | | | | | | | | | | We don't need the JSC asserts anymore now, hopefully. More importantly, this changemakes programs that link against both QtScript and QtWebKit not crash.
* | Call to JSC::Debugger's new events that where created inJedrzej Nowacki2009-08-111-0/+11
| | | | | | | | | | | | | | | | | | | | b62ab93d001d2f3238e24faa133720cb877e3023 commit. Workaround for multiple decorators problem. FunctionWrapper and NativeConstrWrapper needs access to original result value (from native function call). Solution was to move part of the NativeConstrWrapper's functionality (functionExit debugger's event) to FunctionWrapper::proxyConstruct.
* | Fix line number and arguments in QScriptContext::toStringOlivier Goffart2009-08-112-7/+20
| | | | | | | | | | | | | | | | | | | | | | | | For arguments, we always need to skip the implicit 'this' argument For line number, we walk thought the stack frames from the top to find the one above the requested one, which contains the returnPC we need. Also fixed a crash because QScriptContext::parentContext would have returned a pointer with flags inside. Reviewed-by: Kent Hansen
* | make QScriptContext::setScope() fail for object created in other engineKent Hansen2009-08-101-0/+6
| | | | | | | | | | Also fix some autotest failures, improve the descriptions of failures, and make the tests run to completion.
* | implement QScriptContext::setActivationObject()Kent Hansen2009-08-101-3/+19
| |
* | get rid of dynamic castsKent Hansen2009-08-102-4/+12
| |
* | cleanup (hide the use of reinterpret_cast)Kent Hansen2009-08-104-24/+36
| | | | | | | | | | Introduce a frameForContext() function so we don't have to cast all over the place.
* | finish implementation of QScriptEngine::importExtension()Kent Hansen2009-08-101-24/+25
| | | | | | | | | | Added the properties to the activation object: __extension__, __setupPackage__ and __postInit__.
* | implement QScriptContextInfo streaming from datastreamKent Hansen2009-08-101-1/+30
| |
* | implement QScriptContextInfo::parameterNames() for Qt methodsKent Hansen2009-08-101-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It doesn't work for overloaded methods yet (unless you just happened to call the overload that's defined last in the source file). In the old back-end we stored the actual overload that was being called in the QScriptContextPrivate. Since QScriptContext is a JSC::ExecState now, we either have to add the information to JSC::ExecState, or add some mapping scheme so we can go determine the meta-index for a particular (ExecState, QtFunction) pair. Also in this commit: Marked expected failures, so the autotests will run to completion.
* | implement QScriptClass property query semantics of old back-endKent Hansen2009-08-101-1/+6
| | | | | | | | | | Look up the property as a normal JS property before falling back to the dynamic query mechanism. This is the documented behavior.
* | implement QScriptContext::backtrace()Kent Hansen2009-08-101-34/+2
| | | | | | | | | | Doesn't pass the test yet, but at least it returns something that might be useful on occasion.
* | extract the function name from the calleeKent Hansen2009-08-101-0/+2
| |
* | make property flags lookup work for properties in prototype chainKent Hansen2009-08-101-3/+7
| | | | | | | | | | JSObject::getPropertyAttributes() does not follow the prototype chain, so we have to do it.
* | make ResolveScope property lookup work (kind of)Kent Hansen2009-08-101-2/+9
| | | | | | | | | | Look in the __qt_scope__ property that is set by QScriptValue::setScope().
* | Merge branch 'master' of git@scm.dev.nokia.troll.no:qt/qt into ↵Kent Hansen2009-08-101-4/+0
|\ \ | |/ | | | | | | | | | | | | | | qtscript-jsc-backend Conflicts: src/script/api/qscriptable.cpp src/script/api/qscriptable_p.h src/script/qscriptclassdata.cpp
| * adjust some ifdefs so they are easy to remove with a scriptKent Hansen2009-08-073-5/+5
| | | | | | | | | | In preparation of making the old QtScript back-end a separate package/solution.
| * QtScript must respect dynamic metaobject's when installedAaron Kennedy2009-07-311-1/+1
| | | | | | | | | | | | (cherry picked from commit f39ccc5ed802ee8461122b8b067c8faa9aae8f8a) Reviewed-by: Roberto Raggi
| * Port of Qt to VxWorksRobert Griebl2009-07-297-3/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This makes Qt work on VxWorks 6.6+ in native (kernel) mode. * compiles with the WindRiver GNU toolchain (Linux only) * works with QWS (tested with the VNC driver only) * tested on PPC hardware and the x86 VxWorks simulator * no q3support, no phonon, no webkit * no QSharedMemory, no QSystemSemaphore, no QProcess * only one QApplication instance (flat address space) * filesystem support depends heavily on the quality of the native driver * QLibrary is just a dummy to make plugins work at all * qmake transparently creates VxWorks munching rules for static ctors * made auto-test cope with missing OS features A special note regarding the Q_FOREACH patch for dcc: when calling foreach(a,c) with c being a function returning a container, the compiler would generate 5 references to some labels (.LXXXX), which are not there (so the linker complains in the end). Seems like dcc doesn't really like the 'true ? 0 : <function call to get type>' statement Reviewed-By: Harald Fernengel
| * Doc: replace links to obsolete APIsVolker Hilsheimer2009-07-272-2/+2
| |
| * Doc: add \since 4.6 for new APIsVolker Hilsheimer2009-07-191-6/+10
| |
| * qtscript meta-object binding: enum properties are not deletableKent Hansen2009-06-261-3/+3
| |
| * make it possible to support queued connections in qtscriptKent Hansen2009-06-256-17/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This change doesn't actually add public API for it, but makes it trivial to add. On the C++ side, qScriptConnect() would get an overload that takes an additional argument, the connection type (d'oh, it should have had a default argument to begin with!). On the script side, it's a bit more tricky to "overload" the existing connect(), since it's already "overloaded" (can have either one or two parameters). Plus, I'd like connect() to be able to support bind-like functionality so you can pass additional arguments to it that will be passed to the signal handler at signal emission time. Oh well, we'll see.
| * have the QtScript print() function use qDebug()Kent Hansen2009-06-251-2/+1
| | | | | | | | | | | | Makes it work with custom message handlers (qInstallMsgHandler()). Task-number: 233005
* | add configure options for (not) building the QtScript moduleKent Hansen2009-08-0758-229/+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
* | kill dead codeKent Hansen2009-08-061-134/+0
| |
* | delete AST-to-string visitorKent Hansen2009-08-062-1675/+0
| | | | | | | | | | We don't need it anymore because we use JSC's toString implementation for function objects.
* | fix regression in enumeration of QPropertiesKent Hansen2009-08-061-1/+1
| |