| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
| |
However, there are some stuff added to qscript that I'm really not sure
about.
Reviewed-by: tom
|
|
|
|
| |
Reviewed-by: Simon Hausmann
|
|
|
|
|
|
|
| |
This add a hook inside JSC to be able to implement our own comparison function
when comparing objects.
Reviewed-by: Kent Hansen
|
|
|
|
|
|
| |
The functions are identical, but in recent WebKit trunk isObject()
doesn't exist anymore. So this renaming is done to prepare for the
import of a more recent JavaScriptCore.
|
|
|
|
| |
Reviewed-by: Trust Me
|
|
|
|
|
|
| |
Call the QScriptValue constructor without class scope.
Reviewed-by: Trust me
|
| |
|
|
|
|
| |
Reviewed-by: Trust Me
|
| |
|
|
|
|
|
|
| |
It's faster.
Reviewed-by: Olivier Goffart
|
|
|
|
| |
Reviewed-by: Trust Me
|
|
|
|
|
|
|
| |
To achieve behavior of the old back-end. There, the recursion guard
was automatic because a mark flag was set on the object as soon as
marking begun, but in JSC it appears to only be set _after_ the
marking is completed.
|
|
|
|
|
|
| |
QtFunction::mark() does not cause infinite recursion any more.
Reviewed-by: Kent Hansen
|
|
|
|
|
| |
Remove useless variable.
Use QBoolBlocker instread of custom QScript::InEval.
|
|
|
|
|
|
| |
Get rid off some compilation warnings about unused variables.
Reviewed-by: Kent Hansen
|
|
|
|
|
|
|
| |
Get rid of conversion functions QScript::qtStringFromJSCUString and
QScript::qtStringToJSCUString. Code was moved to cast operators.
Reviewed-by: Kent Hansen
|
|
|
|
| |
QtScript must respect dynamic metaobjects when installed.
|
|
|
|
|
|
| |
Don't compile moc_qscriptqobject_p.cpp separately but compile it from
qscriptqobject.cpp instead, to ensure that config.h is included. That
ensures that min/max are undeffed as macros.
|
|
|
|
|
|
| |
In WebKit/JSC config.h needs to be included first in .cpp files, to among
other things make sure that min/max are not defined as macros through
windows.h.
|
| |
|
|
|
|
|
| |
This is some other places where Qt native function may expect to have
their own context
|
|
|
|
|
|
|
|
|
|
| |
The original JavaScriptCore doesn't create stack frame or scope for
native function.
JSC has been patched to support that.
This commit revert our patches to JSC, and implement create the stack
frame from QScript
Reviewed-by: Kent Hansen
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
-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
|
| |
|
| |
|
|
|
|
|
|
|
|
| |
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
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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 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(), the exception generated
in the JSC script engine needs to be stored in uncaughtException of
QScriptEngine.
Reviewed-by: Kent Hansen
|
|
|
|
|
| |
No need to expose the fact that we go via the Global Object
to get an engine pointer.
|
|
|
|
|
|
|
|
| |
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
|
| |
|
|
|
|
|
| |
Don't add method names, only signatures.
Respect the SkipMethodsInEnumeration option.
|
| |
|
|
|
|
|
| |
Doesn't actually replace the global object, but rather has the
standard global object act as a proxy to the custom one.
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
| |
The argument conversion logic checks for exceptions after
attempting to convert each argument; this requires that there
is initially no exception, otherwise it's going to bail out
even if the conversion itself succeeded.
|
|
|
|
|
| |
Caller is responsible for calling marked() before mark(),
otherwise you might get infinite recursion.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
| |
Makes sure that new stack frame is set up if the function is
native, and all that.
|