summaryrefslogtreecommitdiffstats
path: root/tests/auto/qscriptvalue
Commit message (Collapse)AuthorAgeFilesLines
* 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
* | | tst_QScriptValue::toVariant is not about testing reg expOlivier Goffart2009-07-231-2/+1
| | |
* | | JSC: toString report correct error messageOlivier Goffart2009-07-221-1/+0
| | |
* | | More tests fixed (QScriptValue::toString)Olivier Goffart2009-07-221-4/+0
| | | | | | | | | | | | | | | | | | Handle Exception in a toString function Reviewed-by: Kent Hansen
* | | fix QScriptValue::isErrorOlivier Goffart2009-07-221-1/+0
| | | | | | | | | | | | Reviewed-by: Kent Hansen
* | | Fix the return value of a function call that throws an error.Ariya Hidayat2009-07-171-2/+0
| | |
* | | Fix the return value of a constructor that throws an error.Ariya Hidayat2009-07-171-2/+0
| | |
* | | implement cyclic prototype chain checkKent Hansen2009-07-171-5/+3
| | |
* | | make QScriptValue::toString() et al work when there's an exceptionKent Hansen2009-07-171-2/+1
| | | | | | | | | | | | | | | JSC refuses to call functions when there's an exception that hasn't been dealt with, so save the exception and restore it afterwards.
* | | We cant rely on property attributes from JavaScriptCore for the setter and ↵Olivier Goffart2009-07-161-1/+7
| | | | | | | | | | | | getter
* | | Convert the strings or number value to jscvalue when they are used with an ↵Olivier Goffart2009-07-161-9/+8
| | | | | | | | | | | | | | | | | | | | | engine Also change the stringValue not to be a pointer. This fixes a memory leak.
* | | make the JS function toString() autotest passKent Hansen2009-07-141-162/+161
| | |
* | | implement ability to dynamically change class of script objectsKent Hansen2009-07-101-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | With an object created by QScriptEngine::newObject(), it should be possible to call QScriptValue::setClass() to dynamically change the behavior of that object. Similarly, it should be possible to promote plain script objects to QObject (QVariant) wrappers by calling the overload of QScriptEngine::newQObject() (newVariant()) that takes a script object as the first argument. This commit implements this capability. The premise is the (internal) QScriptObject class, which inherits JSC::JSObject. It reimplements all the methods for getting/setting properties etc. Then there's a level of indirection to facilitate dynamic change of the class: Each QScriptObject can have a delegate associated with it that will handle operations on the object. By default there is no delegate, so the object behaves as a normal JS object, as you expect. However, once a delegate is set (e.g., when QScriptValue::setScriptClass() is called), QScriptObject will give the delegate the chance to handle the object operation. In addition to a delegate implementation for QScriptClass-based objects, there are also delegates for QObject and QVariant wrappers. These replace the QObjectWrapperObject and QVariantWrapperObject classes.
* | | Fix autotest checking QScriptValue::objectId method.Jedrzej Nowacki2009-07-091-2/+0
| | | | | | | | | | | | (QScriptValue::objectId() and QScriptEnigne::objectById)