summaryrefslogtreecommitdiffstats
path: root/src/script/api/qscriptcontextinfo.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Change copyrights from Nokia to DigiaIikka Eklund2012-09-291-2/+2
| | | | | | | | Change copyrights and license headers from Nokia to Digia Change-Id: I280c0a575987d1770e354b4948f1d4d767d711ea Reviewed-by: Simo Fält <simo.falt@digia.com> Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
* Update contact information in license headers.Sergio Ahumada2012-08-011-3/+3
| | | | | | | | | | | | | - Replace Nokia contact email address with Qt Project website. - Remove "All rights reserved" line from license headers. As in the past, to avoid rewriting various autotests that contain line-number information, an extra blank line has been inserted at the end of the license text to ensure that this commit does not change the total number of lines in the license header. Change-Id: Ie7ba62011752fcb149b99b26317c54f2a0cfa931 Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
* Update year in Nokia copyright messages.Jason McDonald2012-01-111-1/+1
| | | | | | | | | Simple search and replace. This commit doesn't touch 3rd-party files, nor translations (where the change is not so simple and will be handled in a separate commit). Change-Id: I4e48513b8078a44a8cd272326685b25338890148 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Avoid asserting when computing line number for backtraceKent Hansen2011-03-011-1/+9
| | | | | | | | | | | | | | | | | | With JSC asserts enabled (QtScript built without NDEBUG defined), JSC::CodeBlock::getBytecodeIndex() would assert because we sometimes called it with an address that was not inside the range of the block's JIT code. We never caught this bug because it just so happens that even though the assert fails, the function returns a result that causes our autotests to pass. Check that the returnPC is in range and report lineNumber -1 if not; this unifies the behavior of the interpreter and JIT, even though it's not the result we want. Task-number: QTBUG-17741 Reviewed-by: Olivier Goffart
* Don't crash when creating backtrace for built-in JS function (2nd try)Kent Hansen2011-02-081-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | Commit 147df10403ba280b3f04c1e3d6c4b1cf386abe5d did not quite fix the issue; other places need the same checks. When the JIT is enabled, frames for built-in JS host calls (such as Array.prototype.forEach) are not fully initialized. In particular, the CodeBlock register of such frames is not set (see comment in JITCall.cpp). We need to check if the codeBlock is actually valid before we start using it. This fixes the crash(es) but not the problem of actually getting the arguments for such frames through the API. There's also a related problem when a QtScript function (newFunction()) is called as a callback of a built-in JS host function (QTBUG-17287). These problems will go away once JavaScriptCore is updated to a more recent version (4.8 at the earliest), since the native-vs-script frame handling has been unified. Task-number: QTBUG-17137 Reviewed-by: Olivier Goffart
* Don't crash when creating backtrace for built-in JS functionKent Hansen2011-02-031-1/+2
| | | | | | | | | | | When the JIT is enabled, NativeFunctionWrapper (used for built-in functions such as Array.prototype.forEach) inherits JSFunction, so we must check whether the function is actually a JS (script) function before we start accessing script-specific properties. Task-number: QTBUG-17137 Reviewed-by: Olivier Goffart
* Update copyright year to 2011.Jason McDonald2011-01-101-1/+1
| | | | Reviewed-by: Trust Me
* Doc: Fixing typoSergio Ahumada2010-11-161-1/+1
|
* QScript: document/obsolete things that does not work since the move to JSCOlivier Goffart2010-07-291-9/+2
| | | | Reviewed-by: Kent Hansen
* Update src/3rdparty/javascriptcore and adapt src/script to the changesKent Hansen2010-03-101-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Update qscriptvalueiterator test to expect length property when iterating arrays and strings. - Use EvalExecutable::create() instead of EvalExecutable constructor. The constructor is private. - Reimplement getOwnPropertyDescriptor() in all custom script objects. - Remove all reimplementations of getPropertyAttributes(). It doesn't exist in trunk anymore (getOwnPropertyDescriptor() is used instead). - Remove checkDontDelete argument from deleteProperty() reimplementations. The purpose of this argument was to support deleting properties with attribute Undeletable from C++. But it was quite an invasive patch to JavaScriptCore, and it doesn't seem worth it. If this feature is really crucial it should be re-done upstream. One of the tests needed to be updated so it's not sensitive to the C++ undeletability. - Adapt getOwnPropertyNames() reimplementations to signature change. - Add missing QScriptObject structure flags, otherwise we don't get all virtual calls. - Remove our patch for reporting column numbers in the debugger callbacks. It was just too intrusive. As with the checkDontDelete issue, this should be redone upstream if it's really important. In 4.7, QScriptEngineAgent will always report a column number of 1. Other compilation fixes: - InternalFunction::name() takes an ExecState* argument, not GlobalData* - ScopeChain::globalObject is no longer a function but a member variable - ScopeChainNode constructor takes a GlobalObject argument - Heap::collect() is called collectAllGarbage() - JSValue::strictEqual() takes an ExecState* argument - Debugger::exception() takes a bool hasHandler argument - Debugger no longer reports column number (we decided to drop that patch from JSC) - UString doesn't have operator+=(char*) - Update the autotests to reflect the columnNumber=1 change. - Add helper class to avoid crashing inside JSC. Ever since r52856 in WebKit trunk, this is needed. There are probably a lot of other public API functions that need this guard as well, but I'll add them as they are discovered. - Update mkdist-javascriptcore tag, exclude a few more files. - Set ENABLE_JSC_MULTIPLE_THREADS=0 define on Mac due to r52355 in trunk. Reviewed-by: Simon Hausmann
* Update copyright year to 2010Jason McDonald2010-01-061-1/+1
| | | | Reviewed-by: Trust Me
* Fixed the QtScript license information in the source files to referSimon Hausmann2009-11-171-19/+1
| | | | | | | | to the LGPL only. To do this I ran replace-licenses.zsh $QTDIR/src/script release Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
* Replace LGPL license tags with LGPL-ONLYSimon Hausmann2009-11-171-1/+1
| | | | Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
* Update src/3rdparty/javascriptcore and adapt src/script to the changes.Kent Hansen2009-09-241-4/+3
| | | | Reviewed-by: Simon Hausmann
* use JSObject::inherits() instead of JSObject::isObject()Kent Hansen2009-09-211-4/+4
| | | | | | The functions are identical, but in recent WebKit trunk isObject() doesn't exist anymore. So this renaming is done to prepare for the import of a more recent JavaScriptCore.
* Fix the bactkrace in the QScript DebuggerOlivier Goffart2009-09-091-10/+10
| | | | | | | | | | | | | | | | | | This patch remove the 'fake' context that appears in the debugger backtrace when there is a break point in the global context. This problem never appeared in the tests because the QScriptContext::backtrace has always at least two items in the backtrace as it needs the native 'bt' function to be called. Changed QScriptEnginePrivate::contextForFrame to skip the fake frame (instead of QScriptContext::parentContext). So we never have a QScriptContext pointing to that frame. The changes in QScriptContextInfo are for retreiving the right filename information for the global context when the global context is on top. Reviewed-by: Kent Hansen
* Update license headers again.Jason McDonald2009-09-091-4/+4
| | | | Reviewed-by: Trust Me
* Merge branch '4.5' into 4.6Thiago Macieira2009-08-311-13/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: demos/boxes/glshaders.cpp demos/boxes/vector.h demos/embedded/fluidlauncher/pictureflow.cpp demos/embedded/fluidlauncher/pictureflow.h doc/src/desktop-integration.qdoc doc/src/distributingqt.qdoc doc/src/examples-overview.qdoc doc/src/examples.qdoc doc/src/frameworks-technologies/dbus-adaptors.qdoc doc/src/geometry.qdoc doc/src/groups.qdoc doc/src/objecttrees.qdoc doc/src/platform-notes.qdoc doc/src/plugins-howto.qdoc doc/src/qt3support.qdoc doc/src/qtdbus.qdoc doc/src/qtdesigner.qdoc doc/src/qtgui.qdoc doc/src/qtmain.qdoc doc/src/qtopengl.qdoc doc/src/qtsvg.qdoc doc/src/qtuiloader.qdoc doc/src/qundo.qdoc doc/src/richtext.qdoc doc/src/topics.qdoc src/corelib/tools/qdumper.cpp src/gui/embedded/qkbdpc101_qws.cpp src/gui/embedded/qkbdsl5000_qws.cpp src/gui/embedded/qkbdusb_qws.cpp src/gui/embedded/qkbdvr41xx_qws.cpp src/gui/embedded/qkbdyopy_qws.cpp src/gui/embedded/qmousebus_qws.cpp src/gui/embedded/qmousevr41xx_qws.cpp src/gui/embedded/qmouseyopy_qws.cpp src/gui/painting/qpaintengine_d3d.cpp src/gui/painting/qwindowsurface_d3d.cpp src/opengl/gl2paintengineex/glgc_shader_source.h src/opengl/gl2paintengineex/qglpexshadermanager.cpp src/opengl/gl2paintengineex/qglpexshadermanager_p.h src/opengl/gl2paintengineex/qglshader.cpp src/opengl/gl2paintengineex/qglshader_p.h src/opengl/util/fragmentprograms_p.h src/plugins/kbddrivers/linuxis/linuxiskbdhandler.cpp src/plugins/mousedrivers/linuxis/linuxismousehandler.cpp src/script/parser/qscript.g src/script/qscriptarray_p.h src/script/qscriptasm_p.h src/script/qscriptbuffer_p.h src/script/qscriptclass.cpp src/script/qscriptclassdata_p.h src/script/qscriptcompiler.cpp src/script/qscriptcompiler_p.h src/script/qscriptcontext.cpp src/script/qscriptcontext_p.cpp src/script/qscriptcontext_p.h src/script/qscriptcontextfwd_p.h src/script/qscriptecmaarray.cpp src/script/qscriptecmaarray_p.h src/script/qscriptecmaboolean.cpp src/script/qscriptecmacore.cpp 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/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/qscriptfunction.cpp src/script/qscriptfunction_p.h src/script/qscriptgc_p.h src/script/qscriptmember_p.h src/script/qscriptobject_p.h src/script/qscriptprettypretty.cpp src/script/qscriptprettypretty_p.h src/script/qscriptvalue.cpp src/script/qscriptvalueimpl.cpp src/script/qscriptvalueimpl_p.h src/script/qscriptvalueimplfwd_p.h src/script/qscriptvalueiteratorimpl.cpp src/script/qscriptxmlgenerator.cpp src/script/qscriptxmlgenerator_p.h tests/auto/linguist/lupdate/testdata/recursivescan/project.ui tests/auto/linguist/lupdate/testdata/recursivescan/sub/finddialog.cpp tests/auto/qkeyevent/tst_qkeyevent.cpp tools/linguist/shared/cpp.cpp
* QScriptContextInfo: fix the line numbers with JITOlivier Goffart2009-08-281-3/+11
| | | | It even works better than with the interpreter
* Merge commit 'qt/master'Jason Barron2009-08-211-18/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: configure.exe examples/examples.pro qmake/Makefile.unix qmake/Makefile.win32 qmake/Makefile.win32-g++ qmake/Makefile.win32-g++-sh qmake/qmake.pro src/script/api/qscriptable.h src/script/api/qscriptclasspropertyiterator.h src/script/api/qscriptcontext.h src/script/api/qscriptengineagent.cpp src/script/api/qscriptstring.cpp src/script/api/qscriptstring.h src/script/api/qscriptvalueiterator.cpp src/script/api/qscriptvalueiterator.h src/script/qscriptclass.cpp src/script/qscriptcontext.cpp src/script/qscriptengine.cpp src/script/qscriptengine_p.cpp src/script/qscriptvalue.cpp src/script/qscriptvalue_p.h src/script/qscriptvalueimplfwd_p.h src/script/script.pro src/src.pro tests/auto/auto.pro tests/auto/qscriptv8testsuite/tst_qscriptv8testsuite.cpp tools/configure/configureapp.cpp
* provide line number information for innermost call frameKent Hansen2009-08-201-0/+3
| | | | | For the innermost frame, we don't have a returnPC, so use the line number that was last passed to the engine agent.
* Fix the line numbers on the backtraceOlivier Goffart2009-08-181-1/+1
| | | | | | | The returnPC points to the opcode after the call, but we want the opcode right before to compute the line number. Reviewed-by: Kent Hansen
* Merge branch 'master' of git@scm.dev.nokia.troll.no:qt/qt into ↵Kent Hansen2009-08-181-1/+1
| | | | | | | | | | qtscript-jsc-backend Conflicts: src/script/qscriptclass.cpp src/script/qscriptcontext.cpp src/script/qscriptengine.cpp src/script/qscriptvalue.cpp
* Clean up.Jedrzej Nowacki2009-08-181-8/+3
| | | | | | | Get rid of conversion functions QScript::qtStringFromJSCUString and QScript::qtStringToJSCUString. Code was moved to cast operators. Reviewed-by: Kent Hansen
* Polish the QScriptContext::backtrace()Olivier Goffart2009-08-141-21/+31
| | | | | | | - in QScriptContextInfo, get the filename of specials context - in QScriptContextInfo, get the right information for the global context (from the skipped fake frame) - addapt the test to the current backtrace layout.
* 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.
* Merge branch 'master' of git@scm.dev.nokia.troll.no:qt/qt into ↵Kent Hansen2009-08-121-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Fix line number and arguments in QScriptContext::toStringOlivier Goffart2009-08-111-2/+18
| | | | | | | | | | | | 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
* cleanup (hide the use of reinterpret_cast)Kent Hansen2009-08-101-1/+3
| | | | | Introduce a frameForContext() function so we don't have to cast all over the place.
* 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.
* extract the function name from the calleeKent Hansen2009-08-101-0/+2
|
* 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
* Remove QScriptContextPrivate, QScriptContext is now a JSC::CallFrameOlivier Goffart2009-07-311-2/+1
| | | | | | | | | | | | | | 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
* Fix license headersOlivier Goffart2009-07-291-4/+34
|
* support callees that are not function objectsKent Hansen2009-07-091-1/+1
| | | | E.g. QScriptClass-based objects.
* rewrite most of QScriptContext handlingKent Hansen2009-07-081-1/+35
| | | | Do it The right way(TM), by lazily wrapping JSC::ExecState objects.
* 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.
* Import JSC-based Qt Script from Kent's tree.Simon Hausmann2009-06-161-0/+400