| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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)
|
|
|
|
|
|
|
|
|
|
| |
The JSC parser doesn't understand function expressions as
statements; you have to surround the expression by parentheses.
That's in accordance with the ECMA spec, but most
implementations (including the old qtscript backend) don't
require the parentheses. However, since it's easier to change
the tests than the JSC parser, let's do that for now to get
rid of some noise in the test output.
|
|
|
|
|
| |
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.
|
|
|
|
| |
They now work.
|
|
|
|
| |
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.
|
|
|
|
| |
QScriptValues added.
|
| |
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
| |
It's been fixed (commit c23be3111ec279b4e19ca9c37a0d9eddb756f402)
|
|
|
|
| |
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
|
|
|
|
|
| |
With the JSC backend, these tests hang (in debug and
non-JIT mode, at least).
|
|
|
|
| |
With JSC backend these tests work (better compatibility, yay).
|
| |
|
|
|
|
| |
Disable the debugger for now, since it's not implemented.
|
| |
|
| |
|
| |
|