| Commit message (Collapse) | Author | Age | Files | Lines |
|\
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Conflicts:
qmake/Makefile.win32
src/corelib/io/qfsfileengine_win.cpp
src/corelib/kernel/qeventdispatcher_win.cpp
src/gui/dialogs/qfiledialog_win.cpp
src/gui/inputmethod/qcoefepinputcontext_s60.cpp
src/gui/text/qfontdatabase_win.cpp
src/gui/util/qsystemtrayicon_win.cpp
src/script/utils/qscriptdate.cpp
tests/auto/qinputcontext/tst_qinputcontext.cpp
tests/auto/qscriptengine/tst_qscriptengine.cpp
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This has already been fixed in 4.7 (QTBUG-9770), but the change is
too big to backport.
The general idea is the same: Only operate on UTC dates internally
(since that's how JS dates are stored), and let QDateTime take care
of converting from/to local dates as necessary.
The fix itself shouldn't be merged to 4.7, but the autotests should.
Task-number: QTBUG-9770
Reviewed-by: Jedrzej Nowacki
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
QScriptEngine::installTranslatorFunctions() now installs
wrapper functions for qsTrId and QT_TRID_NOOP (similar to
the existing ones for tr() and translate()).
Task-number: QTBUG-8454
Reviewed-by: Jedrzej Nowacki
|
| |
| |
| |
| |
| |
| |
| |
| | |
There were still a couple of functions that didn't have them. This
could cause said functions to crash if multiple script engines were
being used.
Reviewed-by: Jedrzej Nowacki
|
|\ \
| | |
| | |
| | |
| | | |
Conflicts:
mkspecs/features/symbian/symbian_building.prf
|
| | | |
|
|/ /
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This commit introduces a new internal JS object type,
QScriptStaticScopeObject, that enables the JS compiler to make
more aggressive optimizations of scoped property access.
QScriptStaticScopeObject registers all its properties in a
symbol table that the JS compiler has access to. If the compiler
finds the property in the symbol table, it will generate the
fast index-based op_{get,put}_scoped_var bytecodes, rather than
the dynamic (slow) op_resolve and friends.
If the compiler _doesn't_ find the property in the symbol table,
it infers that it's safe to skip the scope object when later
resolving the property, which will also improve performance
(see op_resolve_skip bytecode).
QScriptStaticScopeObject is only safe to use when all relevant
properties are known at JS compile time; that is, when a
function that has the static scope object in its scope chain is
compiled.
It's up to the user of the class (e.g. QtDeclarative) to ensure
that this constraint is not violated.
The API for constructing QScriptStaticScopeObject instances is
not public; it lives in QScriptDeclarativeClass for now, an
internal class exported for the purpose of QML. The instance is
returned as a QScriptValue and can be manipulated like any
other JS object (e.g. by QScriptValue::setProperty()).
The other part of this commit utilizes QScriptStaticScopeObject
in QtDeclarative in the two major places where it's currently
possible:
1) QML disallows adding properties to the Global Object.
Furthermore, it's not possible for QML IDs and properties to
"shadow" global variables. Hence, a QScriptStaticScopeObject
can be used to hold all the standard ECMA properties, and this
scope object can come _before_ the QML component in the scope
chain. This enables binding expressions and scripts to have
optimized (direct) access to e.g. Math.sin.
2) Imported scripts can have their properties (resulting from
variable declarations ("var" statements) and function
declarations) added to a static scope object. This enables
functions in the script to have optimized (direct) access to
the script's own properties, as well as to global properties
such as Math.
With this change, it's no longer possible to delete properties
of the Global Object, nor delete properties of an imported
script. It's a compromise we make in order to make the
optimization safe.
Task-number: QTBUG-8576
Reviewed-by: Aaron Kennedy
Reviewed-by: Olivier Goffart
Reviewed-by: Jedrzej Nowacki
|
|\ \
| |/
| |
| |
| |
| |
| | |
Conflicts:
src/openvg/qpaintengine_vg.cpp
src/script/bridge/qscriptqobject_p.h
tests/auto/bic/tst_bic.cpp
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Tell JavaScriptCore that QMetaObject wrappers can be used as the
second operand to instanceof; this is done by setting the
ImplementsHasInstance flag.
We don't actually have to implement hasInstance() because the
default implementation does the right thing.
Task-number: QTBUG-8366
Reviewed-by: Olivier Goffart
|
| |
| |
| |
| |
| |
| |
| | |
The context is determined from the filename passed to evaluate(),
and should be equivalent to QFileInfo(fileName).baseName().
Reviewed-by: Olivier Goffart
|
| |
| |
| |
| |
| | |
Test that calling toObject() doesn't change the type of the
original value.
|
|\ \
| |/
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Conflicts:
src/3rdparty/webkit/VERSION
src/3rdparty/webkit/WebCore/ChangeLog
src/3rdparty/webkit/WebCore/page/FrameView.cpp
src/3rdparty/webkit/WebCore/rendering/RenderWidget.cpp
src/3rdparty/webkit/WebKit/qt/symbian/eabi/QtWebKitu.def
src/s60installs/bwins/QtCoreu.def
src/s60installs/bwins/QtGuiu.def
src/s60installs/bwins/QtNetworku.def
src/s60installs/eabi/QtGuiu.def
tests/auto/qscriptextqobject/tst_qscriptextqobject.cpp
|
| |
| |
| |
| | |
Suggested by Olivier.
|
| | |
|
| |
| |
| |
| | |
And fix two silly typos in the error messages.
|
|\ \
| |/
| |
| |
| | |
Conflicts:
src/script/api/qscriptengine.cpp
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Search up the call stack to find the first non-empty source URL.
Also and add an autotest for the QtScript translator functions
since there was none (their presence was checked, but not their
behavior...).
Task-number: QTBUG-9775
Reviewed-by: Olivier Goffart
|
|\ \
| |/ |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
In 4.5, changing the prototype of the (custom) global object used
to "Just Work"(tm).
In the JSC-based back-end, the built-in global object acts as a
proxy if a custom global object is set, because JSC doesn't (yet,
anyway) provide a way to replace the global object.
To complicate this further, we also have a proxy to the original
global object (that bypasses the custom global object proxying (!)).
This is so that properties of the original global object can
still be accessed with the QtScript C++ API when a custom global
object has been set.
Unfortunately, JSObject::prototype()/setPrototype() are not virtual,
meaning that a change of prototype in the source object is not
reflected in the proxy or vice versa.
Work around this for now by syncing the prototype at the appropriate
places (QScriptEngine::setGlobalObject(), QScriptValue::setPrototype()).
This fixes all except the case when a prototype is set from JS,
since such a write doesn't go through our public C++ API. But this
case can be detected and handled by the global object's
JSObject::put() reimplementation. Created a separate report for that
issue: QTBUG-9737.
Task-number: QTBUG-7066
Reviewed-by: Jedrzej Nowacki
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
QScriptEngines
the currentIdentifierTable table, which is a static thread local variable, could be corrupted.
The main change is to fix the QScriptEngine constructor not to alter the currentIdentifierTable
This showed a lot of cases where APIShim guards where missings.
The problem was seen with creator, related to QTBUG-9426
Reviewed-by: Jedrzej Nowacki
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
QScriptEngine::reportAdditionalMemoryCost(int).
This function provides the ability to give a hint to the engine
that it should perhaps trigger garbage collection sooner rather
than later.
For example, if you've implemented a JS ByteArray class that
wraps a QByteArray, and a user constructs a few hundred
temporary ByteArray objects of large sizes, failure to report
the additional memory cost may cause the application's memory
consumption to grow and grow (because the script engine thinks
they are "cheap" objects, the GC won't kick in).
Reporting the correct size can be difficult (or impossible) in
some cases. For example, it's difficult to predict the total
amount of system memory & resources consumed by a QImage.
But even reporting a heuristic / approximate cost can be better
than reporting no cost.
Task-number: QTBUG-6238
Reviewed-by: Simon Hausmann
|
|\ \
| |/
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Conflicts:
configure.exe
mkspecs/common/symbian/symbian.conf
src/gui/graphicsview/qgraphicswidget.h
src/gui/kernel/qapplication.cpp
src/gui/text/qtextlayout.cpp
src/openvg/qpixmapdata_vg.cpp
src/s60installs/s60installs.pro
tools/runonphone/main.cpp
tools/runonphone/serenum_unix.cpp
qtextlayout.cpp fixed up together with Eskil.
Kept the configure.exe from 4.7 without recompile.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Regression against the old back-end. Don't set the translator
properties on the original global object but rather on the
active one (except for String.prototype.arg, which should
always be added to the original String constructor to match
4.5 behavior).
Task-number: QTBUG-6437
Reviewed-by: Jedrzej Nowacki
|
|/
|
|
|
|
|
|
| |
The thisObject passed to native constructors did not have all
the new structure flags, so if it was promoted to a QObject
(using the overload of newQObject() that takes an existing
script object as first argument), the resulting script object
did not receive dynamic property access callbacks.
|
|
|
|
| |
Reviewed-by: Trust Me
|
|
|
|
|
|
|
|
|
|
| |
This reinstates the pre-4.6 behavior: A script-owned C++ object
that's not referenced anymore should be garbage collected, even
if it has connections. In order to achieve this, the "weak"
reference to the C++ object's wrapper must be invalidated.
Task-number: QTBUG-6366
Reviewed-by: Simon Hausmann
|
|
|
|
|
| |
In 4.6 the Global Object no longer has an arguments property
with undefined value; there should be no such property.
|
| |
|
|
|
|
|
|
| |
These are behavioral differences between QtScript in 4.6 and 4.5,
and so should have tasks to figure out whether anyone actually
depend on the behavior.
|
|
|
|
|
|
|
| |
QRegExp::numCaptures() is marked as obsolete.
Replaced all usage in Qt and test-cases.
Reviewed-by: Andreas Aardal Hanssen
|
|
|
|
|
|
|
|
|
|
|
| |
QScriptProgram encapsulates a Qt Script program (AKA a script).
It retains the compiled representation of the script, so that
repeated evaluation of the same script becomes faster.
An overload of QScriptEngine::evaluate() that takes a QScriptProgram
has been added.
Reviewed-by: Olivier Goffart
|
|
|
|
| |
Reviewed-by: TrustMe
|
|
|
|
|
|
|
| |
Since the GC looks for pointers in the C stack, try to kill those
pointers before calling collectGarbage().
Reviewed-by: Simon Hausmann
|
|
|
|
|
|
|
|
| |
Introduced a helper function in our custom source provider,
columnNumberFromOffset(), that maps an absolute offset in the source
input to a relative column number.
Reviewed-by: Jedrzej Nowacki
|
| |
|
|
|
|
|
|
|
|
| |
Large enough max heap for script tests is now defined by default
for all tests in qttest_p4.prf, so removed the statements from
individual script tests.
Reviewed-by: Janne Anttila
|
|
|
|
|
|
|
|
|
|
| |
The problem is that the interpreter did not check for exception while
running the "while(true){}" loop, as it deduced that none of the generated
opcode would possibly generate an exception.
The solution is to force a check right after we come from a timeout.
Reviewed-by: Kent Hansen
|
|
|
|
| |
Reviewed-by: Trust Me
|
|\
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Conflicts:
demos/boxes/glshaders.cpp
demos/boxes/vector.h
demos/embedded/fluidlauncher/pictureflow.cpp
demos/embedded/fluidlauncher/pictureflow.h
doc/src/desktop-integration.qdoc
doc/src/distributingqt.qdoc
doc/src/examples-overview.qdoc
doc/src/examples.qdoc
doc/src/frameworks-technologies/dbus-adaptors.qdoc
doc/src/geometry.qdoc
doc/src/groups.qdoc
doc/src/objecttrees.qdoc
doc/src/platform-notes.qdoc
doc/src/plugins-howto.qdoc
doc/src/qt3support.qdoc
doc/src/qtdbus.qdoc
doc/src/qtdesigner.qdoc
doc/src/qtgui.qdoc
doc/src/qtmain.qdoc
doc/src/qtopengl.qdoc
doc/src/qtsvg.qdoc
doc/src/qtuiloader.qdoc
doc/src/qundo.qdoc
doc/src/richtext.qdoc
doc/src/topics.qdoc
src/corelib/tools/qdumper.cpp
src/gui/embedded/qkbdpc101_qws.cpp
src/gui/embedded/qkbdsl5000_qws.cpp
src/gui/embedded/qkbdusb_qws.cpp
src/gui/embedded/qkbdvr41xx_qws.cpp
src/gui/embedded/qkbdyopy_qws.cpp
src/gui/embedded/qmousebus_qws.cpp
src/gui/embedded/qmousevr41xx_qws.cpp
src/gui/embedded/qmouseyopy_qws.cpp
src/gui/painting/qpaintengine_d3d.cpp
src/gui/painting/qwindowsurface_d3d.cpp
src/opengl/gl2paintengineex/glgc_shader_source.h
src/opengl/gl2paintengineex/qglpexshadermanager.cpp
src/opengl/gl2paintengineex/qglpexshadermanager_p.h
src/opengl/gl2paintengineex/qglshader.cpp
src/opengl/gl2paintengineex/qglshader_p.h
src/opengl/util/fragmentprograms_p.h
src/plugins/kbddrivers/linuxis/linuxiskbdhandler.cpp
src/plugins/mousedrivers/linuxis/linuxismousehandler.cpp
src/script/parser/qscript.g
src/script/qscriptarray_p.h
src/script/qscriptasm_p.h
src/script/qscriptbuffer_p.h
src/script/qscriptclass.cpp
src/script/qscriptclassdata_p.h
src/script/qscriptcompiler.cpp
src/script/qscriptcompiler_p.h
src/script/qscriptcontext.cpp
src/script/qscriptcontext_p.cpp
src/script/qscriptcontext_p.h
src/script/qscriptcontextfwd_p.h
src/script/qscriptecmaarray.cpp
src/script/qscriptecmaarray_p.h
src/script/qscriptecmaboolean.cpp
src/script/qscriptecmacore.cpp
src/script/qscriptecmadate.cpp
src/script/qscriptecmadate_p.h
src/script/qscriptecmaerror.cpp
src/script/qscriptecmaerror_p.h
src/script/qscriptecmafunction.cpp
src/script/qscriptecmafunction_p.h
src/script/qscriptecmaglobal.cpp
src/script/qscriptecmaglobal_p.h
src/script/qscriptecmamath.cpp
src/script/qscriptecmamath_p.h
src/script/qscriptecmanumber.cpp
src/script/qscriptecmanumber_p.h
src/script/qscriptecmaobject.cpp
src/script/qscriptecmaobject_p.h
src/script/qscriptecmaregexp.cpp
src/script/qscriptecmaregexp_p.h
src/script/qscriptecmastring.cpp
src/script/qscriptecmastring_p.h
src/script/qscriptengine.cpp
src/script/qscriptengine_p.cpp
src/script/qscriptengine_p.h
src/script/qscriptenginefwd_p.h
src/script/qscriptextenumeration.cpp
src/script/qscriptextenumeration_p.h
src/script/qscriptextqobject.cpp
src/script/qscriptextqobject_p.h
src/script/qscriptextvariant.cpp
src/script/qscriptfunction.cpp
src/script/qscriptfunction_p.h
src/script/qscriptgc_p.h
src/script/qscriptmember_p.h
src/script/qscriptobject_p.h
src/script/qscriptprettypretty.cpp
src/script/qscriptprettypretty_p.h
src/script/qscriptvalue.cpp
src/script/qscriptvalueimpl.cpp
src/script/qscriptvalueimpl_p.h
src/script/qscriptvalueimplfwd_p.h
src/script/qscriptvalueiteratorimpl.cpp
src/script/qscriptxmlgenerator.cpp
src/script/qscriptxmlgenerator_p.h
tests/auto/linguist/lupdate/testdata/recursivescan/project.ui
tests/auto/linguist/lupdate/testdata/recursivescan/sub/finddialog.cpp
tests/auto/qkeyevent/tst_qkeyevent.cpp
tools/linguist/shared/cpp.cpp
|
| |
| |
| |
| | |
Reviewed-by: Trust Me
|
| |
| |
| |
| | |
Reviewed-by: Trust Me
|
| |
| |
| |
| |
| |
| | |
Otherwise the property is stored on the wrong object (the proxy).
This fix makes the Qt bindings generated by qtscriptgenerator work
again.
|
| |
| |
| |
| |
| |
| |
| | |
The documentation of the agent constructor specify that the agant is
owned by the engine. Even if the agent is not set to the engine
Reviewed-by: Kent Hansen
|
| |
| |
| |
| | |
It is uneeded and add useless overhead
|
|\ \
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Conflicts:
configure.exe
examples/examples.pro
qmake/Makefile.unix
qmake/Makefile.win32
qmake/Makefile.win32-g++
qmake/Makefile.win32-g++-sh
qmake/qmake.pro
src/script/api/qscriptable.h
src/script/api/qscriptclasspropertyiterator.h
src/script/api/qscriptcontext.h
src/script/api/qscriptengineagent.cpp
src/script/api/qscriptstring.cpp
src/script/api/qscriptstring.h
src/script/api/qscriptvalueiterator.cpp
src/script/api/qscriptvalueiterator.h
src/script/qscriptclass.cpp
src/script/qscriptcontext.cpp
src/script/qscriptengine.cpp
src/script/qscriptengine_p.cpp
src/script/qscriptvalue.cpp
src/script/qscriptvalue_p.h
src/script/qscriptvalueimplfwd_p.h
src/script/script.pro
src/src.pro
tests/auto/auto.pro
tests/auto/qscriptv8testsuite/tst_qscriptv8testsuite.cpp
tools/configure/configureapp.cpp
|
| | | |
|
| | |
| | |
| | |
| | | |
Works as of commit 5bca43cca3ac90429e3f9263d0d7ea8c9eb164d4.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
With the JSC-based back-end, stack frames aren't created when
calling any of the built-in ECMA functions, so we can't base the
test on that. Instead, just look up the "name" property of each
function and check that it has the expected value.
|
| | | |
|
| | |
| | |
| | |
| | | |
The engine owns its agents, and also knows when they are deleted.
|