| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
| |
- Replace Nokia contact email address with Qt Project website.
- Remove "All rights reserved" line from license headers.
As in the past, to avoid rewriting various autotests that contain
line-number information, an extra blank line has been inserted at the
end of the license text to ensure that this commit does not change the
total number of lines in the license header.
Change-Id: Ie7ba62011752fcb149b99b26317c54f2a0cfa931
Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
|
|
|
|
|
|
|
|
|
| |
Simple search and replace. This commit doesn't touch 3rd-party files,
nor translations (where the change is not so simple and will be handled
in a separate commit).
Change-Id: I4e48513b8078a44a8cd272326685b25338890148
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
|
|
|
|
| |
Reviewed-by: Trust Me
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
when possible
JSC::NativeFunctionWrapper is a typedef to either JSC::PrototypeFunction or
JSC::JSFunction depending if we are running JIT or not.
When using JIT, JSC::JSFunction is faster, as it allow JIT to do the native
call dirrectly. The difference is that in that case, the JS stack is not
fully set up so we have to be carefull.
Unfortunately, it is not possible to make FunctionWrapper inherit from
JSC::NativeFunctionWrapper, because JSFunction is slightly bigger, and we
cannot fit in a Cell
Reviewed-by: Kent Hansen
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- Update qscriptvalueiterator test to expect length property when
iterating arrays and strings.
- Use EvalExecutable::create() instead of EvalExecutable constructor.
The constructor is private.
- Reimplement getOwnPropertyDescriptor() in all custom script objects.
- Remove all reimplementations of getPropertyAttributes().
It doesn't exist in trunk anymore (getOwnPropertyDescriptor() is used
instead).
- Remove checkDontDelete argument from deleteProperty() reimplementations.
The purpose of this argument was to support deleting properties
with attribute Undeletable from C++. But it was quite an invasive
patch to JavaScriptCore, and it doesn't seem worth it. If this feature
is really crucial it should be re-done upstream.
One of the tests needed to be updated so it's not sensitive to the
C++ undeletability.
- Adapt getOwnPropertyNames() reimplementations to signature change.
- Add missing QScriptObject structure flags, otherwise we don't get all virtual calls.
- Remove our patch for reporting column numbers in the debugger callbacks.
It was just too intrusive. As with the checkDontDelete issue, this should
be redone upstream if it's really important. In 4.7, QScriptEngineAgent
will always report a column number of 1.
Other compilation fixes:
- InternalFunction::name() takes an ExecState* argument, not GlobalData*
- ScopeChain::globalObject is no longer a function but a member variable
- ScopeChainNode constructor takes a GlobalObject argument
- Heap::collect() is called collectAllGarbage()
- JSValue::strictEqual() takes an ExecState* argument
- Debugger::exception() takes a bool hasHandler argument
- Debugger no longer reports column number (we decided to drop that patch from JSC)
- UString doesn't have operator+=(char*)
- Update the autotests to reflect the columnNumber=1 change.
- Add helper class to avoid crashing inside JSC.
Ever since r52856 in WebKit trunk, this is needed. There are probably a lot of
other public API functions that need this guard as well, but I'll add them as they
are discovered.
- Update mkdist-javascriptcore tag, exclude a few more files.
- Set ENABLE_JSC_MULTIPLE_THREADS=0 define on Mac due to r52355 in trunk.
Reviewed-by: Simon Hausmann
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
There's no reason to construct QScriptValues when JSC::JSValues
can be operated on directly. A benchmark showed that ~10% of the
time for reading a QObject property from a script was spent just
creating and destroying QScriptValue temporaries. It's time to
finally get rid of this potential bottleneck, not just in the
QObject integration but everywhere.
This change refactors the code so that all internal operations
are performed on JSC::JSValue (most importantly, conversion
from/to Qt types), and the public API functions are just thin
wrappers around these. E.g. instead of doing
enginePrivate->scriptValueFromJSCValue(jsValue).toQObject()
the implementation now does
QScriptEnginePrivate::toQObject(jsValue)
Other operations are delegated to the engine implementation
in similar style.
Task-number: QTBUG-8304
Reviewed-by: Jedrzej Nowacki
|
|
|
|
| |
Reviewed-by: Trust Me
|
|
|
|
|
|
|
|
| |
to the LGPL only.
To do this I ran replace-licenses.zsh $QTDIR/src/script release
Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
|
|
|
|
| |
Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
|
|
|
|
| |
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
|
|
|
|
| |
Reviewed-by: Trust Me
|
|
|
|
| |
Reviewed-by: Trust Me
|
|
|
|
|
|
|
|
| |
For some types, an empty string is the correct and complete
conversion of the type. If the result is an empty string, use
QVariant::canConvert() to determine if that is indeed correct,
before falling back to the "string-conversion-not-available"
path.
|
| |
|
|
|
|
| |
Reviewed-by: Trust Me
|
|
|
|
|
|
|
| |
Get rid of conversion functions QScript::qtStringFromJSCUString and
QScript::qtStringToJSCUString. Code was moved to cast operators.
Reviewed-by: Kent Hansen
|
| |
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
-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
|
|
|
|
| |
Behave like the old back-end.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|