summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* get rid of warningKent Hansen2009-07-281-0/+3
|
* make more tests pass for QScriptValue::setProperty()Kent Hansen2009-07-282-35/+61
| | | | | | 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.
* 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-283-2/+9
| | | | | | | | | | | | 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
* Fix tst_QScriptEngine::nestedEvaluateOlivier Goffart2009-07-283-8/+18
| | | | | | The 'this' value was not correctly set when evaluating Reviewed-by: Kent Hansen
* Make the 'arguments' object working when calling eval from native functionsOlivier Goffart2009-07-283-8/+24
| | | | | | | 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-283-7/+31
| | | | | | | | | As specified in the specification. The QScriptEngine::newRegExp on the other hand used to work with invalid flags. Reviewed-by: Kent Hansen
* Test tst_QScriptContext::lineNumberOlivier Goffart2009-07-281-3/+1
| | | | The test was wrong. The line number should be from within the eval.
* compileKent Hansen2009-07-271-3/+3
|
* make QScriptEngine::setGlobalObject() work to some extentKent Hansen2009-07-276-38/+165
| | | | | | | | | | | | | | | | | | | | | | | | | 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.
* use engine's globalObject() instead of exec's lexicalGlobalObject()Kent Hansen2009-07-271-7/+7
|
* don't rely on custom global object to get GC callbackKent Hansen2009-07-276-45/+42
| | | | | | | | | | | Install custom ClientData on JSGlobalData instance instead. Also some cleanups to avoid globalObject et al being accessed directly. Killed the proxying scheme employed in setGlobalObject() since it didn't work; if you stored the original Global Object and replaced it with another object, then added properties to the new object, they would show up in the old object, too (because the old object would always proxy to whatever the current Global Object was).
* add garbage collection hook to JSGlobalData::ClientDataKent Hansen2009-07-272-0/+7
| | | | | | Allows us to get a GC callback without having to create a dummy script object that implements JSObject::mark() and calling Heap::protect() on that one.
* The line number is correctly reported for exceptionBenjamin Poulain2009-07-272-6/+1
| | | | | Enable the tests checking the line number of exception. Add a lower bound on the lineNumber of QScriptEngin::evaluate()
* Remove the uncaughtException, use the JSC exception insteadBenjamin Poulain2009-07-275-33/+14
| | | | | | | | | Use the exception from JSC::exec instead of QScriptEngin::uncaughtException. A few more tests are passing for qscriptvalue and qscriptqobject. Reviewed-by: Kent Hansen
* Fix tst_QScriptExtQObject::objectDeleted()Benjamin Poulain2009-07-272-4/+2
| | | | | | | | Fix tst_QScriptExtQObject::objectDeleted(), the exception generated in the JSC script engine needs to be stored in uncaughtException of QScriptEngine. Reviewed-by: Kent Hansen
* add QEXPECT_FAIL where it failsOlivier Goffart2009-07-273-0/+33
|
* Fix tst_QScriptValue::callOlivier Goffart2009-07-272-3/+9
| | | | | | | | | | 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
* Fix tst_QScriptContext::argumentsOlivier Goffart2009-07-272-4/+46
|
* use custom JSGlobalData clientdata to keep pointer to script engineKent Hansen2009-07-271-1/+11
| | | | Better than relying on a custom Global Object.
* move engine-specific GC marking to QScriptEnginePrivateKent Hansen2009-07-272-40/+45
|
* use scriptEngineFromExec() in a few more placesKent Hansen2009-07-271-3/+3
|
* introduce scriptEngineFromExec() helper functionKent Hansen2009-07-274-45/+47
| | | | | No need to expose the fact that we go via the Global Object to get an engine pointer.
* Clear the exceptions before calling a function.Olivier Goffart2009-07-241-4/+24
| | | | | | | | So the exception we get as result are the one thrown by the function. (fix tst_QScriptEngine::newRegExp test) Reviewed-by: Kent Hansen
* Implement QScriptString as a wraper around the JSC::IdentifierOlivier Goffart2009-07-238-94/+114
|
* add QEXPECT_FAIL (QScriptString isn't properly implemented yet)Olivier Goffart2009-07-231-0/+2
|
* Try best to convert a regexp to a ECMAScript expressionOlivier Goffart2009-07-233-17/+120
|
* tst_QScriptValue::toVariant is not about testing reg expOlivier Goffart2009-07-231-2/+1
|
* make QScriptValue::{call,construct}() use JSC::{call,construct}()Kent Hansen2009-07-231-56/+4
| | | | | Support has been added to the JSC functions to support host functions as well, so now we can use them directly.
* JSC: toString report correct error messageOlivier Goffart2009-07-222-1/+4
|
* More tests fixed (QScriptValue::toString)Olivier Goffart2009-07-222-4/+8
| | | | | | Handle Exception in a toString function Reviewed-by: Kent Hansen
* Implement qobjectProtoFuncFindChildren()Benjamin Poulain2009-07-222-3/+80
| | | | | | | | For matching the regular expression, the algorithm of JSCore is used instead of QRegExp, this is done to be consistent with the rest of ecmascript. Reviewed-by: Kent Hansen
* fix QScriptValue::isErrorOlivier Goffart2009-07-223-2/+14
| | | | Reviewed-by: Kent Hansen
* Refactorisation of autotest. FunctionEntryAndExit test divided intoJedrzej Nowacki2009-07-211-4/+122
| | | | smaller pieces.
* Reorder positionChange and QEXPECT_FAIL addedJedrzej Nowacki2009-07-211-52/+45
|
* Fix the return value of a function call that throws an error.Ariya Hidayat2009-07-172-3/+3
|
* Fix the return value of a constructor that throws an error.Ariya Hidayat2009-07-172-3/+3
|
* implement cyclic prototype chain checkKent Hansen2009-07-172-6/+15
|
* make QScriptValue::toString() et al work when there's an exceptionKent Hansen2009-07-175-33/+84
| | | | | 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-172-4/+3
|
* fix for-in statement autotest to match behavior in JSCKent Hansen2009-07-161-9/+9
|
* We cant rely on property attributes from JavaScriptCore for the setter and ↵Olivier Goffart2009-07-164-16/+10
| | | | getter
* skip test that currently crashesKent Hansen2009-07-161-0/+1
|
* do the correct prototype checkKent Hansen2009-07-161-2/+1
| | | | There was a bug in commit 1d56e14605d74aefb955bdd81ee4083131252c9e
* start implementing constructors for QMetaObject wrappersKent Hansen2009-07-164-11/+123
|
* fix bug in built-in print() functionKent Hansen2009-07-161-3/+2
| | | | D'oh, inverse logic.
* Convert the strings or number value to jscvalue when they are used with an ↵Olivier Goffart2009-07-164-31/+34
| | | | | | | engine Also change the stringValue not to be a pointer. This fixes a memory leak.
* add some expected failures in objectDeleted() autotestKent Hansen2009-07-161-2/+10
|
* only set default prototype if resulting object has built-in Object prototype ↵Kent Hansen2009-07-162-2/+4
| | | | | | as its prototype port of commit 4182e9c4b2cbfcd0604c57da210e97d68cbbbb52 in qt/master.
* fix enumeration of QObject wrapper objectsKent Hansen2009-07-161-3/+1
| | | | | Don't add method names, only signatures. Respect the SkipMethodsInEnumeration option.