summaryrefslogtreecommitdiffstats
path: root/tests/auto/qscriptengine
Commit message (Collapse)AuthorAgeFilesLines
...
| * | adopt same ownership relationship of scriptengine agents as in old back-endKent Hansen2009-08-181-7/+29
| | | | | | | | | | | | The engine owns its agents, and also knows when they are deleted.
| * | remove expected failures, mark expected failureKent Hansen2009-08-181-3/+1
| | |
| * | Lazily construct the QScriptActivationObjectOlivier Goffart2009-08-131-1/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We can store flags on the ReturnValueRegister entry in the stackframe header (as native function don't use that) Then when requesting an activation object we can lookup the flags to know if we should create it. This reduce a lot the cost of a native call. Reviewed-by: Kent Hansen
| * | Refactor the way the JS stack are created for native functionOlivier Goffart2009-08-121-5/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The original JavaScriptCore doesn't create stack frame or scope for native function. JSC has been patched to support that. This commit revert our patches to JSC, and implement create the stack frame from QScript Reviewed-by: Kent Hansen
| * | 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
| * | | Test the same code as in the documentation for closuresOlivier Goffart2009-08-101-0/+32
| | | |
| * | | mark expected failures for QObject GC-related testsKent Hansen2009-08-101-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | In the JSC-based back-end, script-owned QObjects are not always deleted immediately by the GC. I don't know what precisely determines the deletion time yet. (Inserting a qDebug() before evaluate("gc()") seems to fix it, though...)
| * | | finish implementation of QScriptEngine::importExtension()Kent Hansen2009-08-101-2/+2
| | | | | | | | | | | | | | | | | | | | Added the properties to the activation object: __extension__, __setupPackage__ and __postInit__.
| * | | skip QScriptEngine::newActivationObject() testKent Hansen2009-08-101-0/+1
| | | | | | | | | | | | | | | | | | | | It's an internal function, and currently not implemented in the JSC-based back-end.
| * | | remove two expected failures for backtrace()Kent Hansen2009-08-101-2/+0
| | | | | | | | | | | | | | | | | | | | QScriptContext::backtrace() is implemented now (since commit 34511e1001471ed4041794640aefe508f50ad01c), so the tests work.
| * | | mark function scopes test as expected failureKent Hansen2009-08-101-0/+1
| | | | | | | | | | | | | | | | | | | | QScriptValue::scope() and QScriptValue::setScope() are internal function that we don't implement fully in the JSC-based back-end.
| * | | make native function scopes test passKent Hansen2009-08-101-1/+1
| | | | | | | | | | | | | | | | Missing parentheses in function expression (JSC requires them).
| * | | make the global object properties test passKent Hansen2009-08-101-1/+2
| | | | | | | | | | | | | | | | Accept the presence of a JSON object.
| * | | finish implementation of QVariant.prototype.toString()Kent Hansen2009-08-061-1/+0
| | | | | | | | | | | | | | | | Behave like the old back-end.
| * | | give Error constructors DontEnum attributeKent Hansen2009-08-061-6/+0
| | | | | | | | | | | | | | | | As per ECMA-262, chapter 15.
| * | | RegExp.prototype.toString() when pattern is emptyKent Hansen2009-08-051-2/+0
| | | | | | | | | | | | | | | | | | | | Like ECMA-262 says, // starts a single-line comment; /(?:)/ represents an empty regular expression.
| * | | make QScriptEngine::newQMetaObject() workKent Hansen2009-08-051-3/+0
| | | |
| * | | Merge branch 'master' of git@scm.dev.nokia.troll.no:qt/qt into ↵Kent Hansen2009-08-051-0/+29
| |\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | qtscript-jsc-backend Conflicts: src/script/qscriptextqobject.cpp
| * | | | clear abort flag when we start a new evaluateKent Hansen2009-08-041-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | Otherwise evaluate() would _always_ return the value previously passed to abortEvaluation(), once a script had been aborted.
| * | | | Do not crash if using popContext() while the current context have not been ↵Olivier Goffart2009-08-041-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | pushed Reviewed-by: Kent Hansen
| * | | | Implement QScriptEngine::abortEvaluation()Tor Arne Vestbø2009-08-031-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | We're using a wrapper around TimeoutChecker, where we re-implement didTimeout() to call processEvents().
| * | | | QScriptValueIterator: fix missing non-enumerable valuesTor Arne Vestbø2009-07-311-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
| * | | | update test to match JSC __defineSetter__() behaviorKent Hansen2009-07-301-7/+5
| | | | |
| * | | | implement QScriptContext::activationObject()Kent Hansen2009-07-301-7/+0
| | | | |
| * | | | Add QEXPECT_FAILOlivier Goffart2009-07-301-1/+4
| | | | |
| * | | | Implement QScriptEngine::pushContext end popContextOlivier Goffart2009-07-301-1/+5
| | | | | | | | | | | | | | | | | | | | Reviewed-by: Kent Hansen
| * | | | Merge branch 'master' of git@scm.dev.nokia.troll.no:qt/qt into ↵Kent Hansen2009-07-302-2/+106
| |\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
| * | | | | change tests to match JSC behaviorKent Hansen2009-07-291-16/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Also, tag relevant tests as ECMA compliance-related (i.e., cases where the old back-end was ECMA compliant but JSC currently isn't).
| * | | | | change __defineSetter__() autotest to match JSC behaviorKent Hansen2009-07-291-22/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It's a non-standard extension, so we can live with the fact that JSC semantics are not the same as SpiderMonkey's.
| * | | | | change the reserved ECMAScript words autotest to match behavior of JSCKent Hansen2009-07-291-45/+46
| | | | | |
| * | | | | Enter a scope when enterning a native function.Olivier Goffart2009-07-291-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | so native function that would call engine->evaluate("var b = 'foo'); would not change the global object. The change in qscriptengine.cpp makes sure that the correct scope is used for the execution of QScriptEngine::evaluate. The changes in qscriptfunction.cpp push a new scope for native function calls. We might want to move that into QScriptContext later Reviewed-by: Kent Hansen
| * | | | | Fix tst_QScriptEngine::automaticSemicolonInsertionOlivier Goffart2009-07-281-7/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some Semicollon were added at the end of the input while they shouldn't have. Let handle the automatic semicolon insertion by the Parser (as it does already for the normal new lines) Reviewed-by: Kent Hansen
| * | | | | document testOlivier Goffart2009-07-281-3/+7
| | | | | | | | | | | | | | | | | | | | | | | | JavaScriptCore doesn't assign lineNumber when errors are not thrown
| * | | | | Update the test to match JavaScriptCore behaviourOlivier Goffart2009-07-281-6/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The error reporting behaviour has changed a little bit in JSC regarding the line number of the errors Reviewed-by: Kent Hansen
| * | | | | Fix tst_QScriptEngine::uncaughtExceptionOlivier Goffart2009-07-281-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The test used to test that passing 0 as line number works. There is no reason to impose the lineNumber to be >= 1, this is an arbitrary limitation. It even works when passing negative value, but as -1 is a magic number, an error on line '-1' will not have lineNumber Reviewed-by: Kent Hansen
| * | | | | Make the 'arguments' object working when calling eval from native functionsOlivier Goffart2009-07-281-0/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The 'arguments' is not handled by JavaScriptCore for native function. We have to do that manually Reviewed-by: Kent Hansen
| * | | | | Change JavaScriptCore so it throw error when passing invalid regexp flagOlivier Goffart2009-07-281-6/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As specified in the specification. The QScriptEngine::newRegExp on the other hand used to work with invalid flags. Reviewed-by: Kent Hansen
| * | | | | make QScriptEngine::setGlobalObject() work to some extentKent Hansen2009-07-271-4/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | JSC requires that the global object is actually a JSGlobalObject instance, whereas QScriptEngine::setGlobalObject() allows any object to be set as the global object. The way we solve this is by proxying from an internal global object to the custom (user-set) object. We need to take care that the internal global object is never actually exposed through our API; a brilliantly named helper function, toUsableValue(), makes that happen. Evaluating "var a = 10" with a custom global object doesn't work yet; the variable always ends up in the internal Global Object. For variable assignments, JSC appears to bypass the normal JSObject::put() and instead use JSGlobalObject::copyGlobals{From,To}(), which means I can't intercept and proxy the assignments. This commit enough to get the Context2D example working. There's another bug with iteration of the built-in Global Object's properties (non-enumerable properties are always skipped by the JSC C++ API, whereas with QScriptValueIterator they should not be), but that's a totally separate issue.
| * | | | | The line number is correctly reported for exceptionBenjamin Poulain2009-07-271-6/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Enable the tests checking the line number of exception. Add a lower bound on the lineNumber of QScriptEngin::evaluate()
| * | | | | add QEXPECT_FAIL where it failsOlivier Goffart2009-07-271-0/+25
| | | | | |
| * | | | | Fix tst_QScriptValue::callOlivier Goffart2009-07-271-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We have to set the CallFrame correctly in QScriptEngine::evaluate() in order to ger the 'arguments' object and all the local stuff working. The code Assert if dynamicGlobalObject is not set, so set it to the global object. Reviewed-by: Kent Hansen
| * | | | | Implement QScriptString as a wraper around the JSC::IdentifierOlivier Goffart2009-07-231-1/+0
| | | | | |
| * | | | | Try best to convert a regexp to a ECMAScript expressionOlivier Goffart2009-07-231-4/+60
| | | | | |
| * | | | | make QScriptValue::toString() et al work when there's an exceptionKent Hansen2009-07-171-8/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | JSC refuses to call functions when there's an exception that hasn't been dealt with, so save the exception and restore it afterwards.
| * | | | | set correct property flags in newFunction()Kent Hansen2009-07-171-2/+0
| | | | | |
| * | | | | fix for-in statement autotest to match behavior in JSCKent Hansen2009-07-161-9/+9
| | | | | |
| * | | | | add autotest for Global Object propertiesKent Hansen2009-07-161-0/+145
| | | | | |
| * | | | | initial attempt at implementing QScriptEngine::setGlobalObject()Kent Hansen2009-07-151-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Doesn't actually replace the global object, but rather has the standard global object act as a proxy to the custom one.
| * | | | | clear script exceptions when executing Qt methodsKent Hansen2009-07-151-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The argument conversion logic checks for exceptions after attempting to convert each argument; this requires that there is initially no exception, otherwise it's going to bail out even if the conversion itself succeeded.