| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
| |
|
| |
|
|
|
|
|
| |
Introduce a frameForContext() function so we don't have to cast
all over the place.
|
|
|
|
|
| |
Added the properties to the activation object: __extension__,
__setupPackage__ and __postInit__.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
It doesn't work for overloaded methods yet (unless you just
happened to call the overload that's defined last in the source
file).
In the old back-end we stored the actual overload that was being
called in the QScriptContextPrivate. Since QScriptContext is a
JSC::ExecState now, we either have to add the information to
JSC::ExecState, or add some mapping scheme so we can go
determine the meta-index for a particular (ExecState, QtFunction)
pair.
Also in this commit: Marked expected failures, so the autotests
will run to completion.
|
|
|
|
|
| |
Doesn't pass the test yet, but at least it returns something that
might be useful on occasion.
|
| |
|
|
|
|
|
| |
JSObject::getPropertyAttributes() does not follow the prototype
chain, so we have to do it.
|
|
|
|
|
| |
Look in the __qt_scope__ property that is set by
QScriptValue::setScope().
|
|
|
|
|
|
|
|
|
| |
qtscript-jsc-backend
Conflicts:
src/script/api/qscriptable.cpp
src/script/api/qscriptable_p.h
src/script/qscriptclassdata.cpp
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
-script (default) and -no-script.
This means we can get rid of the SCRIPT feature from qfeatures,
since it's now handled by the new configure variable.
It also allows us to get rid of all the QT_NO_SCRIPT ifdefs from
the source files, since qmake isn't going to include those files
for compilation when you configure with -no-script.
The QtScriptTools module will be disabled if the QtScript module
is not built. You'll have to build the old QtScript back-end
(will be made available in a separate package), then build the
QtScriptTools module yourself.
Reviewed-by: Simon Hausmann
|
| |
|
|
|
|
|
|
| |
Those functions are internal and we don't want to support them
in the JSC back-end, because they expose too much implementation
detail of the old back-end.
|
|
|
|
|
|
|
|
| |
getPropertyNames() now uses a flag to specify which property should be
filtered. This flag should be used by all javascript objects.
This patch fixes the changes introduced by
e520df1f8678bd59adb341fb586f008a7de17fe8
|
| |
|
|
|
|
|
| |
We can infer it from the JSC environment when the function is
actually called.
|
| |
|
|
|
|
|
| |
Otherwise evaluate() would _always_ return the value previously
passed to abortEvaluation(), once a script had been aborted.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
op_construct
The two opcode operand looks like this.
-7 -6 -5 -4 -3 -2 -1
op_construct dst(r) func(r) argCount(n) registerOffset(n) proto(r) thisRegister(r)
op_call dst(r) func(r) argCount(n) registerOffset(n)
as the registerOffset must always be bigger than any register we can
use that knoweldge to differenciate the two calls
Note that this is only the fallback used for JavaScript function. native
function still uses the QScriptActivationObject
Reviewed-by: Kent Hansen
|
|
|
|
|
|
| |
pushed
Reviewed-by: Kent Hansen
|
|
|
|
|
|
| |
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.
|
|
|
|
|
| |
We're using a wrapper around TimeoutChecker, where we
re-implement didTimeout() to call processEvents().
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This new implementation of QScriptValueIterator passes all the tests.
QScriptValueIterator uses an linked list instead of
JSC::PropertyNameArray so the list can be modified by ::remove() and
to be able to add internal properties for the strings and arrays.
Structure::getPropertyNames() has been modified to not show the
property from the prototype.
Reviewed-by: Kent Hansen
|
|
|
|
|
|
|
| |
QScriptValue::toObject() call QScriptEngine::toObject() so the code is
not duplicated.
Reviewed-by: Kent Hansen
|
|
|
|
|
|
|
| |
Use the opcode to see if it was called with op_construct
This could also work with native function, but not when they are called
with QScriptValue::call() or QScriptValue::construct()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
There will not be instances of QScriptContext anymore. Pointer to
QScriptContext are just pointer to JSC::CallFrame
This simplifies the code as we do not need to manage the memory for the
QScriptContext anymore.
It is compatible because it is not possible to create
QScriptContext. They were all created by QScriptEngine.
QScriptContext constructor is private.
Aknoweldged-by: Kent
|
| |
|
|
|
|
|
|
|
|
|
| |
- Create a scope (activation object) for the native constructor in QScriptClass
- put the isCalledasConstructor in the activation object (so i can
clean up the QScriptContext
- Remove the code duplication in all native functions.
Aknoweldged-by: Kent
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
| |
Implement the methods to move forward and backward in the list of
property.
|
| |
|
|
|
|
|
|
|
|
| |
JSC doesn't provide a way to get the backtrace after the exception
has happened (you can only get it at the point it's thrown, by
installing a debugger). As a least effort, we try to use the
uncaught exception to provide a 1-line backtrace (the filename and
linenumber of the innermost call where the exception happened).
|
|
|
|
| |
Reviewed-by: Kent Hansen
|
| |
|
| |
|
| |
|
|
|
|
|
|
| |
Some function (such as JSValue::strictEquals) are declared inline in
Operations.h and if that header is not included, that will produce link
errors
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
| |
d_ptr is not stack allocated anymore
|
|
|
|
| |
Reviewed-by: Kent Hansen
|
| |
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
| |
The 'this' value was not correctly set when evaluating
Reviewed-by: Kent Hansen
|
|
|
|
|
|
|
| |
The 'arguments' is not handled by JavaScriptCore for native function. We
have to do that manually
Reviewed-by: Kent Hansen
|
|
|
|
|
|
|
|
|
| |
As specified in the specification.
The QScriptEngine::newRegExp on the other hand used to work with invalid
flags.
Reviewed-by: Kent Hansen
|
| |
|