summaryrefslogtreecommitdiffstats
path: root/tests/auto/qscriptvalue
Commit message (Collapse)AuthorAgeFilesLines
* Merge branch '4.6-s60' into 4.7-s60axis2010-03-221-0/+8
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: configure.exe mkspecs/common/symbian/symbian.conf src/gui/graphicsview/qgraphicswidget.h src/gui/kernel/qapplication.cpp src/gui/text/qtextlayout.cpp src/openvg/qpixmapdata_vg.cpp src/s60installs/s60installs.pro tools/runonphone/main.cpp tools/runonphone/serenum_unix.cpp qtextlayout.cpp fixed up together with Eskil. Kept the configure.exe from 4.7 without recompile.
| * Don't assert in QScriptValue::call()Kent Hansen2010-03-181-0/+8
| | | | | | | | | | | | | | | | | | Oops, the case of a non-array object argument wasn't implemented nor tested in the new back-end. This commit brings it in line with the behavior of the old back-end. Also test that QScriptValue::construct() doesn't have the same problem. Reviewed-by: TrustMe
| * Speed up compilation of this test with MSVC.Rohan McGovern2010-02-261-0/+7
| | | | | | | | | | | | | | | | This test includes a source file which is almost half a megabyte in size. When compiling with -O2, MSVC2008 can take over 20 minutes to link this test! Turn off optimization, just for this test.
* | Update src/3rdparty/javascriptcore and adapt src/script to the changesKent Hansen2010-03-101-3/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - 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
* | Reduce compiling time of QScriptValue autotest suite on Windows.Jedrzej Nowacki2010-03-048-10223/+11412
| | | | | | | | | | | | | | | | | | | | | | | | | | The QScriptValue autotest suite compiles about 24 min with MSVS2008, which is unacceptable. Tests were splited into a few files for better use of distributed compilation. Repeated calls to insert() and operator<<() where replaced by loops, that should reduce time of code optimizing. Reviewed-by: Kent Hansen
* | Optimize QScriptValue autotest generator.Jedrzej Nowacki2010-03-043-173/+245
| | | | | | | | | | | | | | | | | | | | | | | | | | QScriptValue autotest suite compile 24 minutes on MSVS2008 which is unacceptable. Modification tries to reduce the compilation time. Temples were changed to use static arrays of data; instead of inserting values directly, they are inserted in a loop (less code to optimize). Generated code were separated into several files (better usage of distributed compiling). Reviewed-by: Kent Hansen
* | Merge branch 'master' of scm.dev.nokia.troll.no:qt/mobility-staging into ↵Qt Continuous Integration System2010-02-261-0/+7
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | master-integration * 'master' of scm.dev.nokia.troll.no:qt/mobility-staging: Speed up compilation of this test with MSVC. Fix Symbian build when building for WINSCW with abld. Fix file descriptor leak with generic engine on Linux.
| * | Speed up compilation of this test with MSVC.Rohan McGovern2010-02-261-0/+7
| |/ | | | | | | | | | | | | | | This test includes a source file which is almost half a megabyte in size. When compiling with -O2, MSVC2008 can take over 20 minutes to link this test! Turn off optimization, just for this test.
* | Update of the QScriptValue autotest suite.Jedrzej Nowacki2010-02-252-6/+617
| | | | | | | | | | | | | | The test suite was updated after changes in dataset of autotest generator. New test were added: isVariant, isQMetaObject and isQObject. Reviewed-by: Kent Hansen
* | New data set for QScriptValue autotest generator.Jedrzej Nowacki2010-02-251-0/+6
| | | | | | | | | | | | | | New tests data was added. The tests cover a qscriptvalue created by QScriptEngine newQMetaObject(), newVariant() and newQObject() functions. Reviewed-by: Kent Hansen
* | Update of the QScriptValue autotest suite.Jedrzej Nowacki2010-02-241-0/+3114
| | | | | | | | | | | | | | tst_qscriptvalue_generated.cpp was updated after last few autotest generator modifications. Reviewed-by: Kent Hansen
* | New autotests cases for QScriptValue autotests generator.Jedrzej Nowacki2010-02-241-1/+36
| | | | | | | | | | | | | | | | Few test cases were added. They test values returned from QScriptEngine functions; evaluate(), newDate(), newObject() and newArray(). Reviewed-by: Kent Hansen
* | QScriptValue autotest generator templates change.Jedrzej Nowacki2010-02-241-0/+8
| | | | | | | | | | | | | | | | | | Each generated test case should check if a result is deterministic. The future generation of QScriptValue will be based on a state machine. The state might be changed after each function call, so it is worth of testing if result is always the same. Reviewed-by: Kent Hansen
* | Fix license template.Jedrzej Nowacki2010-02-241-2/+1
|/ | | | | | Fix license template inside the qscriptvalue autotest generator. Reviewed-by: TrustMe
* Apply newly generated test values.Jedrzej Nowacki2010-02-101-0/+127
| | | | | | | Apply test results for values created directly from QScriptEngine (results of nullValue() and undefinedValue()) Reviewed-by: Kent Hansen
* Add new test values to QScriptValue test generator.Jedrzej Nowacki2010-02-101-0/+4
| | | | | | | Two new values were added; results from QScriptEngine::nullValue() and QScriptEngine::undefinedValue(). Reviewed-by: Kent Hansen
* Fix an unhandled exception in QScriptValue's test generator.Jedrzej Nowacki2010-02-101-1/+1
| | | | | | | | | $QT_END_LICENSE was interpreted as a template key by Template() object, causing substitute() call to throw a KeyError exception. The bug was introduced in 9962e2d96a212c518054220167eb6f61e1052bcc. Reviewed-by: TrustMe
* Autotest: to be sure, generate .cpp files with the proper headers tooThiago Macieira2010-02-031-17/+40
|
* Fix license headers on these new files (and the generator).Thiago Macieira2010-02-025-104/+230
|
* Add auto-generated tests for QScriptValueKent Hansen2010-02-024-83/+6836
| | | | | | | | | tst_qscriptvalue_generated.cpp was generated by Jedrzej's generator (see testgen subdirectory). The idea is that the old isXXX and toXXX tests will be replaced entirely by the auto-generated versions, but we keep them for now (with "_old" suffix) until we are sure that the auto-generated versions cover everything.
* Introduce of QScriptValue autotest generator.Jedrzej Nowacki2010-02-026-0/+1076
| | | | | | | | | | | | The patch contain the QScriptValue autotest suite generator. Based on an input it can generate expected tests results and simple tests cases. The results are kept inside generated autotest implementation file (cpp), which could be included by main test file (tst_qscriptvalue.cpp). Generator gives great coverage for isXXX, toXXX, comparison methods. The generator should be used manually and it is not compiled by default. Reviewed-by: Kent Hansen
* Fix autotest memory leakKent Hansen2010-01-291-1/+1
|
* Don't crash when comparing JSCore value without engine to non-JSCore valueKent Hansen2010-01-271-0/+14
| | | | | Task-number: None, discovering while doing test refactoring Reviewed-by: Jedrzej Nowacki
* Update copyright year to 2010Jason McDonald2010-01-061-1/+1
| | | | Reviewed-by: Trust Me
* implement property getters&setters for setProperty(quint32) overloadKent Hansen2009-10-061-0/+27
| | | | | | It's better that this works rather than asserts. Reviewed-by: Olivier Goffart
* remove two expected failuresKent Hansen2009-09-301-4/+0
| | | | The tests now pass after the last update of src/3rdparty/javascriptcore.
* mark test as expected failure only when JIT is enabledKent Hansen2009-09-291-2/+8
| | | | With the interpreter it works.
* Update src/3rdparty/javascriptcore and adapt src/script to the changes.Kent Hansen2009-09-241-0/+2
| | | | Reviewed-by: Simon Hausmann
* Added explicit casts to make QScriptValue autotest compile with NokiaX86Miikka Heikkinen2009-09-221-2/+2
| | | | | | | NokiaX86 compiler has problems with implicit casts and templates, so worked around this problem with explicit casts. Reviewed-by: Janne Koskinen
* Fix autotest compilationOlivier Goffart2009-09-211-1/+0
|
* QtScript: Fix comparing QVariant and QObject.Olivier Goffart2009-09-211-2/+40
| | | | | | | This add a hook inside JSC to be able to implement our own comparison function when comparing objects. 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
| * Update tech preview license header.Jason McDonald2009-08-311-13/+13
| | | | | | | | Reviewed-by: Trust Me
| * Update license headers.Jason McDonald2009-08-111-1/+1
| | | | | | | | Reviewed-by: Trust Me
* | fix crash due to double deletionKent Hansen2009-08-311-0/+22
| | | | | | | | Needed due to commit 3636e666528b72de79f8c7012690bb9e279f0863
* | fix whacky behavior of QScriptValue::toString() for QVariantKent Hansen2009-08-271-0/+2
| | | | | | | | | | | | | | | | For some types, an empty string is the correct and complete conversion of the type. If the result is an empty string, use QVariant::canConvert() to determine if that is indeed correct, before falling back to the "string-conversion-not-available" path.
* | warn if QScriptValue::setScriptClass() is called on incompatible objectKent Hansen2009-08-261-6/+23
| |
* | don't crash when attempting to access properties of a JS Object that ↵Kent Hansen2009-08-261-0/+2
| | | | | | | | | | | | | | | | | | | | | | belonged to a deleted script engine When the engine is deleted, the JSValue is invalidated, but the QScriptValue's type will still be QScriptValuePrivate::JSC. Use a new helper function, isObject(), that checks both that the value is of type JSC _and_ that it is valid, before calling JSValue::isObject() (JSValue::isObject() assumes that the value is valid).
* | fix performance issue with QScriptValue::propertyFlags()Kent Hansen2009-08-261-0/+1
| | | | | | | | | | | | | | Calling QScriptEngine::toStringHandle() is dead slow, so don't call it; use JSC::Identifier directly. This is the same issue as was fixed for setProperty() in commit a8574172dd5e6bc11cf6f69b6fad5a063549e88d.
* | avoid calling QScriptValue::isFunction() inside call() and construct()Kent Hansen2009-08-241-0/+14
| | | | | | | | | | | | | | Avoid calling virtual function JSC::JSValue::get{Call,Construct}Data() twice. Reviewed-by: Olivier Goffart
* | use a list to keep track of registered script valuesKent Hansen2009-08-201-2/+0
| | | | | | | | Get rid of the hash.
* | make QScriptEngine::objectById() workKent Hansen2009-08-201-1/+3
| | | | | | | | | | It needs to work even when there is no public QScriptValue that holds a reference to the object.
* | Fix QScriptValue::objectId().Jedrzej Nowacki2009-08-191-1/+0
| | | | | | | | | | | | | | QScriptValue id were made persistent. It depands on JSC:JSValue JSCell pointer not on QScriptValuePrivate attr. Reviewed-by: Kent Hansen
* | add test to make sure a JavaScript object's ID persistsKent Hansen2009-08-191-0/+10
| | | | | | | | | | | | Even if the QScriptValue is destroyed, the underlying ID should not change; e.g. if a new QScriptValue is created and wraps the same object, the ID should be the same as before.
* | add a test for comparing Q{Object,Variant} wrappers from scriptKent Hansen2009-08-181-0/+15
| | | | | | | | | | | | | | | | | | | | | | In the old back-end, this worked because we extended the ECMA comparison algorithm to treat QObject and QVariant wrappers specially. Instead of comparing the script objects (which would always fail), we compared the wrapped values (which could be the same in both wrappers). In the new JSC-based back-end this currently fails. We would have to add a hack (QtScript-specific ifdef) to JSC in order to support it.
* | adopt variant-to-string conversion of the original qtscript back-endKent Hansen2009-08-171-0/+12
| |
* | 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
| * | Update contact URL in license headers.Jason McDonald2009-08-121-1/+1
| | | | | | | | | | | | Reviewed-by: Trust Me
* | | make property flags lookup work for properties in prototype chainKent Hansen2009-08-101-0/+8
| | | | | | | | | | | | | | | JSObject::getPropertyAttributes() does not follow the prototype chain, so we have to do it.