summaryrefslogtreecommitdiffstats
path: root/src/script
Commit message (Collapse)AuthorAgeFilesLines
...
| * | | | | Implement QScriptEngine::pushContext end popContextOlivier Goffart2009-07-302-4/+28
| | | | | | | | | | | | | | | | | | | | | | | | Reviewed-by: Kent Hansen
| * | | | | Move QScriptActivationObject to his own fileOlivier Goffart2009-07-303-37/+100
| | | | | |
| * | | | | set calledAsConstructor to true when function is called as constructorKent Hansen2009-07-294-0/+11
| | | | | |
| * | | | | initialize calledAsConstructor memberKent Hansen2009-07-291-0/+1
| | | | | |
| * | | | | Fix license headersOlivier Goffart2009-07-2936-151/+1231
| | | | | |
| * | | | | Compile in release mode.Olivier Goffart2009-07-291-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some function (such as JSValue::strictEquals) are declared inline in Operations.h and if that header is not included, that will produce link errors
| * | | | | Enter a scope when enterning a native function.Olivier Goffart2009-07-292-13/+90
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
| * | | | | Memory leak.Olivier Goffart2009-07-291-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | d_ptr is not stack allocated anymore
| * | | | | Set the this object on the global context sets the global objectOlivier Goffart2009-07-281-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | Reviewed-by: Kent Hansen
| * | | | | don't allow defining getter/setter for __proto__ propertyKent Hansen2009-07-281-4/+9
| | | | | |
| * | | | | make more tests pass for QScriptValue::setProperty()Kent Hansen2009-07-281-23/+53
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
| * | | | | Fix tst_QScriptEngine::uncaughtExceptionOlivier Goffart2009-07-281-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-281-2/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-1/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As specified in the specification. The QScriptEngine::newRegExp on the other hand used to work with invalid flags. Reviewed-by: Kent Hansen
| * | | | | compileKent Hansen2009-07-271-3/+3
| | | | | |
| * | | | | make QScriptEngine::setGlobalObject() work to some extentKent Hansen2009-07-275-34/+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).
| * | | | | The line number is correctly reported for exceptionBenjamin Poulain2009-07-271-0/+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-274-29/+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-271-1/+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
| * | | | | Fix tst_QScriptValue::callOlivier Goffart2009-07-271-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-271-2/+3
| | | | | |
| * | | | | 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-236-91/+114
| | | | | |
| * | | | | Try best to convert a regexp to a ECMAScript expressionOlivier Goffart2009-07-231-1/+40
| | | | | |
| * | | | | 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.
| * | | | | More tests fixed (QScriptValue::toString)Olivier Goffart2009-07-221-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Handle Exception in a toString function Reviewed-by: Kent Hansen
| * | | | | Implement qobjectProtoFuncFindChildren()Benjamin Poulain2009-07-221-1/+50
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 the return value of a function call that throws an error.Ariya Hidayat2009-07-171-1/+3
| | | | | |
| * | | | | Fix the return value of a constructor that throws an error.Ariya Hidayat2009-07-171-1/+3
| | | | | |
| * | | | | implement cyclic prototype chain checkKent Hansen2009-07-171-1/+12
| | | | | |
| * | | | | make QScriptValue::toString() et al work when there's an exceptionKent Hansen2009-07-172-11/+78
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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/+3
| | | | | |
| * | | | | We cant rely on property attributes from JavaScriptCore for the setter and ↵Olivier Goffart2009-07-163-15/+3
| | | | | | | | | | | | | | | | | | | | | | | | getter
| * | | | | 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-163-22/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | engine Also change the stringValue not to be a pointer. This fixes a memory leak.
| * | | | | only set default prototype if resulting object has built-in Object prototype ↵Kent Hansen2009-07-161-1/+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.
| * | | | | compile when JIT is enabledKent Hansen2009-07-151-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | NativeFunctionWrapper is typedef for JSFunction
| * | | | | don't try to be so cleverKent Hansen2009-07-151-7/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If we implement the ability to change the global object, the global object pointer can change, so we need to keep a reference to the object if it's stored in a QScriptValue.
| * | | | | fix GC-related crashKent Hansen2009-07-151-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For some reason our Global Object is not marked by the collector. This fixes the case when you invoke GC explicitly by calling collectGarbage(), but the issue is probably still there when GC is invoked implicitly.
| * | | | | fix some memory leaksKent Hansen2009-07-153-2/+8
| | | | | |