summaryrefslogtreecommitdiffstats
path: root/tests/auto/qscriptvalue
Commit message (Collapse)AuthorAgeFilesLines
* Improve QScript{Engine,Value}::toObject() test coverageKent Hansen2010-04-191-0/+12
| | | | | Test that calling toObject() doesn't change the type of the original value.
* 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.
* 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.
* | | adapt to commit 014c4c63066fd3920594e6a58b02f314b5c88cdfKent Hansen2009-08-041-10/+4
| | |
* | | Merge branch 'master' of git@scm.dev.nokia.troll.no:qt/qt into ↵Kent Hansen2009-07-302-1/+9
|\ \ \ | |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | qtscript-jsc-backend Conflicts: src/3rdparty/webkit/JavaScriptCore/wtf/Platform.h src/3rdparty/webkit/VERSION src/3rdparty/webkit/WebKit/qt/Api/qwebview.cpp src/script/qscriptbuffer_p.h src/script/qscriptclassinfo_p.h src/script/qscriptecmadate.cpp src/script/qscriptgc_p.h src/script/qscriptmemberfwd_p.h src/script/qscriptsyntaxcheckresult_p.h src/script/qscriptvalueimplfwd_p.h tests/auto/qscriptengine/tst_qscriptengine.cpp util/webkit/mkdist-webkit
| * | Port of Qt to VxWorksRobert Griebl2009-07-291-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
| * | add more extensive tests for scopechain functionalityKent Hansen2009-07-291-0/+8
| | |
* | | remove some of the output noise for UserRange property flags testKent Hansen2009-07-281-10/+6
| | | | | | | | | | | | No need to repeatedly do a comparison that will fail.
* | | don't allow defining getter/setter for __proto__ propertyKent Hansen2009-07-281-1/+0
| | |
* | | get rid of test that tests quirk of old back-endKent Hansen2009-07-281-4/+1
| | | | | | | | | | | | | | | There's no requirement that native function objects should have an arguments property, so don't implement it for now.
* | | get rid of warningKent Hansen2009-07-281-0/+3
| | |
* | | make more tests pass for QScriptValue::setProperty()Kent Hansen2009-07-281-12/+8
| | | | | | | | | | | | | | | | | | JSC doesn't provide a way of un-defining a getter/setter. If deleting e.g. only the setter, we remember the getter, delete the property, then re-establish the getter.
* | | Make the 'arguments' object working when calling eval from native functionsOlivier Goffart2009-07-281-6/+0
| | | | | | | | | | | | | | | | | | | | | The 'arguments' is not handled by JavaScriptCore for native function. We have to do that manually Reviewed-by: Kent Hansen
* | | Remove the uncaughtException, use the JSC exception insteadBenjamin Poulain2009-07-271-4/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | Use the exception from JSC::exec instead of QScriptEngin::uncaughtException. A few more tests are passing for qscriptvalue and qscriptqobject. Reviewed-by: Kent Hansen