| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
allow stuff to run, even though it's likely to crash/not work...
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
QtScript needs the VM to create script objects of type
QScriptObject, not JSC::Object. This is so that the class of
the object can be changed dynamically using e.g.
QScriptValue::setScriptClass(), or the overload of
QScriptEngine::newQObject() that takes an existing object
as first argument (it "promotes" the plain script object to
a QObject wrapper).
This makes the bindings produced by the bindings generator
work.
When JSC becomes a shared library, we need another solution.
|
|
|
|
|
| |
Caller is responsible for calling marked() before mark(),
otherwise you might get infinite recursion.
|
| |
|
|\
| |
| |
| | |
git@scm.dev.nokia.troll.no:qt/qt-webkit into qtscript-jsc-backend
|
| |
| |
| |
| |
| |
| | |
Also, have pushContext() return currentContext() for now, to
avoid crashing, and disable processing of __postInit__ property
in importExtension() for same reason.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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.
|
| | |
|
|/ |
|
| |
|
|
|
|
| |
Follow behavior of old back-end. Makes qscriptable test pass.
|
|
|
|
| |
The old engine did it as well. Makes more tests pass.
|
|
|
|
|
| |
Makes sure that new stack frame is set up if the function is
native, and all that.
|
| |
|
| |
|
|
|
|
| |
See commit 103439f4c8a70740d6475af1b1b58deede12d2c3
|
|
|
|
|
| |
Setters don't work yet. But hey, the defaultprototypes
example finally works.
|
|
|
|
| |
(QScriptValue::objectId() and QScriptEnigne::objectById)
|
|
|
|
|
| |
With commit 6985212c8909c89183b232ca28b96a2c8a2f1385,
context->thisObject() now returns the right thing.
|
|
|
|
|
|
|
|
|
|
|
|
| |
It's up to the implementation of the constructor to decide whether
it wants to initialize the default-constructed object, or create
and return a new one; just like for JS constructors.
We need this functionality in QtScript so that
QScriptContext::thisObject() will return the right thing.
The built-in constructors (RegExp etc.) should be modified to
initialize the default-constructed object instead of always
creating a new object (only when RegExp is called as a function
should it create a new object).
|
|
|
|
| |
There's an off-by-one issue that we just work around for now.
|
|
|
|
| |
Should be DontEnum, as per ECMA-262.
|
|
|
|
|
|
| |
Frames are created when calling JS functions, so they should be
when calling native functions as well. This makes QScriptContext
behave correctly in these cases (see getSetProperty autotest).
|
| |
|
|
|
|
| |
E.g. QScriptClass-based objects.
|
|
|
|
|
| |
It's possible for any JSObject to be a callee; all it needs to
do is implement getCallData().
|
|
|
|
| |
Do it The right way(TM), by lazily wrapping JSC::ExecState objects.
|
| |
|
|
|
|
|
| |
This makes it possible to obtain the callee for native (host)
functions as well.
|
| |
|
|
|
|
|
|
| |
It's possible that JSC evaluate() returns a completion of type
Throw without hadException() being true, so we need to store the
exception value explicitly.
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
Callable seems to work, HasInstance not quite there yet.
|
| |
|
|
|
|
| |
As per ECMA-262.
|
|
|
|
| |
Implement delete operator for Qt properties.
|
|
|
|
|
| |
Enumeration is missing, as is the ability to change the class
of an object after it has been created.
|
| |
|
|
|
|
| |
Not fully working yet, so disabled for now
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
Makes the args, thisObject etc. available if QScriptable is used.
|
| |
|
| |
|