summaryrefslogtreecommitdiffstats
path: root/src/script
Commit message (Collapse)AuthorAgeFilesLines
...
| * | | | 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
| * | | | | 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
| | | | | |
| * | | | | port commit 47c9e7b1b3551ff6dbe71590461a45ae398a9501 from qt/masterKent Hansen2009-08-064-17/+26
| | | | | |
| * | | | | finish implementation of QVariant.prototype.toString()Kent Hansen2009-08-061-16/+24
| | | | | | | | | | | | | | | | | | | | | | | | Behave like the old back-end.
| * | | | | make iteration work for the global object againKent Hansen2009-08-062-6/+8
| | | | | | | | | | | | | | | | | | | | | | | | Follow-up to commit 520378cfedd63544a9689687256d2c89352ee561
| * | | | | remove docs that mention QScriptValue::{scope,setScope}()Kent Hansen2009-08-061-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Those functions are internal and we don't want to support them in the JSC back-end, because they expose too much implementation detail of the old back-end.
| * | | | | Updates getPropertyNames() on all javascript object to use the flagBenjamin Poulain2009-08-057-28/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
| * | | | | make QScriptEngine::newQMetaObject() workKent Hansen2009-08-053-65/+107
| | | | | |
| * | | | | add type info and attribute getters for function wrappersKent Hansen2009-08-052-0/+17
| | | | | |
| * | | | | don't store QScriptEngine pointer in native function wrappersKent Hansen2009-08-053-29/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We can infer it from the JSC environment when the function is actually called.
| * | | | | remove unused codeOlivier Goffart2009-08-043-7/+0
| | | | | |
| * | | | | clear abort flag when we start a new evaluateKent Hansen2009-08-041-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Otherwise evaluate() would _always_ return the value previously passed to abortEvaluation(), once a script had been aborted.
| * | | | | move Global Object to its own fileKent Hansen2009-08-044-132/+267
| | | | | |
| * | | | | adapt to commit 014c4c63066fd3920594e6a58b02f314b5c88cdfKent Hansen2009-08-048-28/+39
| | | | | |
| * | | | | Use a more reliable method to dinstinguish between an op_call and an ↵Olivier Goffart2009-08-041-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | op_construct The two opcode operand looks like this. -7 -6 -5 -4 -3 -2 -1 op_construct dst(r) func(r) argCount(n) registerOffset(n) proto(r) thisRegister(r) op_call dst(r) func(r) argCount(n) registerOffset(n) as the registerOffset must always be bigger than any register we can use that knoweldge to differenciate the two calls Note that this is only the fallback used for JavaScript function. native function still uses the QScriptActivationObject Reviewed-by: Kent Hansen
| * | | | | Do not crash if using popContext() while the current context have not been ↵Olivier Goffart2009-08-041-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | pushed Reviewed-by: Kent Hansen
| * | | | | Implement QScriptEngine::abortEvaluation()Tor Arne Vestbø2009-08-032-3/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We store the abort-state in the TimeoutChecker, since that's where we'll mostly access it, but the abort result is stored in the QScriptEngine's d-pointer.
| * | | | | Implement QScriptEngine::setProcessEventsInterval()Tor Arne Vestbø2009-08-031-5/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We're using a wrapper around TimeoutChecker, where we re-implement didTimeout() to call processEvents().
| * | | | | Complete the implementation of QScriptValueIterator with JSCoreBenjamin Poulain2009-08-031-24/+43
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This new implementation of QScriptValueIterator passes all the tests. QScriptValueIterator uses an linked list instead of JSC::PropertyNameArray so the list can be modified by ::remove() and to be able to add internal properties for the strings and arrays. Structure::getPropertyNames() has been modified to not show the property from the prototype. Reviewed-by: Kent Hansen
| * | | | | Unify QScriptValue::toObject() and QScriptEngine::toObject()Benjamin Poulain2009-08-031-19/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QScriptValue::toObject() call QScriptEngine::toObject() so the code is not duplicated. Reviewed-by: Kent Hansen
| * | | | | QScriptContext::calledAsConstructor also works with non-native functionOlivier Goffart2009-08-031-5/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use the opcode to see if it was called with op_construct This could also work with native function, but not when they are called with QScriptValue::call() or QScriptValue::construct()
| * | | | | Remove QScriptContextPrivate, QScriptContext is now a JSC::CallFrameOlivier Goffart2009-07-315-133/+80
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There will not be instances of QScriptContext anymore. Pointer to QScriptContext are just pointer to JSC::CallFrame This simplifies the code as we do not need to manage the memory for the QScriptContext anymore. It is compatible because it is not possible to create QScriptContext. They were all created by QScriptEngine. QScriptContext constructor is private. Aknoweldged-by: Kent
| * | | | | Move the declaration on some function into qscriptengine_p.hOlivier Goffart2009-07-318-41/+19
| | | | | |
| * | | | | Small Refactoring of QScriptOlivier Goffart2009-07-318-57/+78
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Create a scope (activation object) for the native constructor in QScriptClass - put the isCalledasConstructor in the activation object (so i can clean up the QScriptContext - Remove the code duplication in all native functions. Aknoweldged-by: Kent
| * | | | | QScriptValueIterator: fix missing non-enumerable valuesTor Arne Vestbø2009-07-318-24/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
| * | | | | Basic implementation of QScriptValueIterator with JSCBenjamin Poulain2009-07-311-15/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Implement the methods to move forward and backward in the list of property.
| * | | | | implement QScriptContext::activationObject()Kent Hansen2009-07-301-9/+38
| | | | | |
| * | | | | Add missing fileOlivier Goffart2009-07-301-0/+88
| | | | | |
| * | | | | attempt to return something sensible in uncaughtExceptionBacktrace()Kent Hansen2009-07-301-4/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | JSC doesn't provide a way to get the backtrace after the exception has happened (you can only get it at the point it's thrown, by installing a debugger). As a least effort, we try to use the uncaught exception to provide a 1-line backtrace (the filename and linenumber of the innermost call where the exception happened).