summaryrefslogtreecommitdiffstats
path: root/src/script/api/qscriptvalue.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Don't crash when comparing JSCore value without engine to non-JSCore valueKent Hansen2010-01-271-4/+9
| | | | | Task-number: None, discovering while doing test refactoring Reviewed-by: Jedrzej Nowacki
* Merge branch '4.6' of scm.dev.nokia.troll.no:qt/oslo-staging-1 into ↵Qt Continuous Integration System2010-01-111-1/+1
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 4.6-integration * '4.6' of scm.dev.nokia.troll.no:qt/oslo-staging-1: (71 commits) QNAM HTTP Code: Cache socket state inside ensureConnection() tst_qhttpnetworkconnection: Test also HEAD in some tests tst_qhttpnetworkconnection: Relax condition in getMultipleWithPriorities QNAM HTTP Code: When starting new request, prefer connected sockets. typo fix Added the 'framecapture' WebKit example to the default build. Fix code example fix typo in qreadwritelock's documentation QNAM HTTP: Don't call d_func() so often QNAM HTTP: Fix readBuffer maximum size. QNAM HTTP: Optimize eatWhitespace() QNAM HTTP: Check if socket already tries to connect. network internals: fix build on S60 [syncqt] Make -separate-module work with WebKit's directory structure doc: Corrected explanation of when append() does nothing. doc: Added clarification about allocating space for the 0 terminator. Add a way to access the normalised URL in QUrl. [syncqt] Make it possible to synchronize headers for a separate module [syncqt] Make it possible to override the base directory network internals: start HTTP GET requests right away when called ...
| * Update copyright year to 2010Jason McDonald2010-01-061-1/+1
| | | | | | | | Reviewed-by: Trust Me
* | Correctly determine QScriptValue::isQObject() for QObjects using theMichael Brasser2010-01-111-4/+8
|/ | | | | | | | QScriptDeclarativeClass. Task-number: QTBUG-6178 Reviewed-by: Kent Hansen Reviewed-by: Aaron Kennedy
* Fixed the QtScript license information in the source files to referSimon Hausmann2009-11-171-19/+1
| | | | | | | | to the LGPL only. To do this I ran replace-licenses.zsh $QTDIR/src/script release Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
* Replace LGPL license tags with LGPL-ONLYSimon Hausmann2009-11-171-1/+1
| | | | Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
* Add QScriptDeclarativeClassAaron Kennedy2009-11-101-0/+5
| | | | | | | | | QScriptDeclarativeClass is a private, but exported, class used by the declarativeui module. It is very similar to QScriptClass, but slightly faster and provides a couple of "backdoor" extension mechanisms used by declarative. Reviewed-by: Warwick Allison
* Inline QtScript exception helper functionsKent Hansen2009-10-231-16/+0
| | | | | | Makes QScriptValue::toNumber() ~50% faster. Reviewed-by: Olivier Goffart
* Avoid calls to public QScriptValue::engine() functionKent Hansen2009-10-231-14/+22
| | | | | | | | | | Calls to engine() are mostly done for checking that the "source" and "target" engines are the same, but we don't want those checks to slow us down. Use an inline getEngine() function instead. This makes e.g. QScriptValue::call() ~10% faster for a function like "function(a, b) { return a + b; }". Reviewed-by: Olivier Goffart
* Inline internal property lookup functionKent Hansen2009-10-231-26/+21
| | | | | | | | | Also avoid looking up the object's own properties twice (before we called getOwnPropertySlot() and then getPropertySlot() on the same object). Makes QScriptValue::property() ~20% faster when calling it on an "empty" object. Reviewed-by: Olivier Goffart
* Use an inline helper function to check if a QScriptString is validKent Hansen2009-10-231-3/+3
| | | | | | Makes QScriptValue::property() ~10% faster. Reviewed-by: Olivier Goffart
* Use the qsreal type instead of double when working with QtScript numbersKent Hansen2009-10-221-3/+3
| | | | | | | | The idea is that qsreal can be typedef'ed to float on platforms where it's appropriate. Since the QScriptValue ctor takes a qsreal, we should not convert it to a double internally. Reviewed-by: Olivier Goffart
* Use JSC::asObject() when we know that the value is an objectKent Hansen2009-10-071-2/+2
| | | | | It's faster than calling getObject(), since getObject() will do type checking of the value.
* Inline QScriptValuePrivate operator new and deleteKent Hansen2009-10-071-16/+0
| | | | Make allocation faster.
* implement property getters&setters for setProperty(quint32) overloadKent Hansen2009-10-061-2/+4
| | | | | | It's better that this works rather than asserts. Reviewed-by: Olivier Goffart
* Update src/3rdparty/javascriptcore and adapt src/script to the changes.Kent Hansen2009-09-241-18/+16
| | | | Reviewed-by: Simon Hausmann
* don't crash in property access after script class has been set to 0Kent Hansen2009-09-221-5/+9
| | | | | | | | When the script class is set to 0, we need to remove the script object's delegate entirely, because the delegate requires a non-0 script class in order to be useful. Reviewed-by: Olivier Goffart
* Fix QScriptValue::strictlyEqualsSimon Hausmann2009-09-221-1/+8
| | | | | | | | strictlyEquals has to continue to work if one of the values has an engine and the other one doesn't. Use the other value's engine to construct a JSValue if possible and use JSC::JSValue::strictEqual. Reviewed-by: Kent Hansen
* Fix QScriptValue constructors without a QScriptEngineSimon Hausmann2009-09-221-36/+9
| | | | | | | Don't create JSC types as the conversion back to a string now requires an ExecState. Reviewed-by: Kent Hansen
* use JSObject::inherits() instead of JSObject::isObject()Kent Hansen2009-09-211-1/+1
| | | | | | 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.
* Fix compilation with winscwSimon Hausmann2009-09-101-12/+12
| | | | | | | | Winscw gets very confused when the name of an enum value is the same as the name of an entire namespace, JSC in this case. Renaming the enum value to JavaScriptCore fixes this. Rubber-stamped-by: Kent
* Update license headers again.Jason McDonald2009-09-091-4/+4
| | | | Reviewed-by: Trust Me
* Update tech preview license header for files that are new in 4.6.Jason McDonald2009-08-311-13/+13
| | | | Reviewed-by: Trust Me
* fix crash due to double deletionKent Hansen2009-08-311-1/+0
| | | | Needed due to commit 3636e666528b72de79f8c7012690bb9e279f0863
* warn if QScriptValue::setScriptClass() is called on incompatible objectKent Hansen2009-08-261-1/+6
|
* don't crash when attempting to access properties of a JS Object that ↵Kent Hansen2009-08-261-24/+23
| | | | | | | | | | | belonged to a deleted script engine When the engine is deleted, the JSValue is invalidated, but the QScriptValue's type will still be QScriptValuePrivate::JSC. Use a new helper function, isObject(), that checks both that the value is of type JSC _and_ that it is valid, before calling JSValue::isObject() (JSValue::isObject() assumes that the value is valid).
* fix performance issue with QScriptValue::propertyFlags()Kent Hansen2009-08-261-28/+37
| | | | | | | Calling QScriptEngine::toStringHandle() is dead slow, so don't call it; use JSC::Identifier directly. This is the same issue as was fixed for setProperty() in commit a8574172dd5e6bc11cf6f69b6fad5a063549e88d.
* fix performance issue with QScriptValue::setProperty()Kent Hansen2009-08-241-75/+81
| | | | | Calling QScriptEngine::toStringHandle() is dead slow, so don't call it; use JSC::Identifier() directly instead.
* add an internal QScriptValue ctor to initialize from d-pointerKent Hansen2009-08-241-0/+8
| | | | | Avoid having to create a dummy QScriptValue (which will have its d_ptr set to 0).
* make some internal qtscript functions inlineKent Hansen2009-08-241-53/+0
| | | | Make it faster.
* compile fix with namespaced Qthjk2009-08-241-2/+2
|
* pass engine pointer to QScriptValuePrivateKent Hansen2009-08-241-31/+17
| | | | Just a little cleanup.
* handle memory management of QScriptValuePrivate in engine if possibleKent Hansen2009-08-241-15/+31
| | | | | | | | | Avoid calling malloc() and free() so often. The premise is that QScriptValue is usually a short-lived type, and only a few QScriptValues exist at a time, so if we cache privates in the engine, QScriptValues will be much faster to create and destroy. Reviewed-by: Olivier Goffart
* avoid calling QScriptValue::isFunction() inside call() and construct()Kent Hansen2009-08-241-16/+26
| | | | | | | Avoid calling virtual function JSC::JSValue::get{Call,Construct}Data() twice. Reviewed-by: Olivier Goffart
* use QVarLengthArray instead of QVector for holding JS argumentsKent Hansen2009-08-241-4/+3
| | | | | | It's faster. Reviewed-by: Olivier Goffart
* QScriptValue: No need to create the activation object for call or constructOlivier Goffart2009-08-241-4/+0
| | | | It is uneeded and add useless overhead
* Fix obsolete license headers.Jason McDonald2009-08-211-1/+1
| | | | Reviewed-by: Trust Me
* compile again after mergeHarald Fernengel2009-08-211-33/+4
|
* implement registered script values as a doubly linked listKent Hansen2009-08-201-1/+1
| | | | It's faster.
* use a list to keep track of registered script valuesKent Hansen2009-08-201-36/+20
| | | | Get rid of the hash.
* store the engine's d-pointer in QScriptValuePrivateKent Hansen2009-08-201-117/+85
| | | | | It's the d-pointer that we most frequently want to access, so store it to avoid having to use QScriptEnginePrivate::get() all over the place.
* remove redundant variableKent Hansen2009-08-201-5/+2
|
* Fix QScriptValue::objectId().Jedrzej Nowacki2009-08-191-2/+2
| | | | | | | QScriptValue id were made persistent. It depands on JSC:JSValue JSCell pointer not on QScriptValuePrivate attr. Reviewed-by: Kent Hansen
* Clean upJedrzej Nowacki2009-08-191-1/+0
| | | | | | There is no point in setting class member in destructor Reviewed-by: Kent Hansen
* Internal API clean up.Jedrzej Nowacki2009-08-191-11/+0
| | | | | | Static method QScriptValue::initFromJSCValue was removed. Reviewed-by: Kent Hansen
* Clean up.Jedrzej Nowacki2009-08-191-32/+32
| | | | | | | | | Internal API of QScriptValue were cleaned. toPublic() was removed and replaced by standard static Private::get(). All initFromXXX() methods were replaced by overload call of initFrom(). Reviewed-by: Kent Hansen
* Clean up.Jedrzej Nowacki2009-08-181-11/+9
| | | | | | | Get rid of conversion functions QScript::qtStringFromJSCUString and QScript::qtStringToJSCUString. Code was moved to cast operators. Reviewed-by: Kent Hansen
* Fix compilation on WindowsSimon Hausmann2009-08-141-0/+1
| | | | | | 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.
* Lazily construct the QScriptActivationObjectOlivier Goffart2009-08-131-0/+5
| | | | | | | | | | | We can store flags on the ReturnValueRegister entry in the stackframe header (as native function don't use that) Then when requesting an activation object we can lookup the flags to know if we should create it. This reduce a lot the cost of a native call. Reviewed-by: Kent Hansen
* Make simple function getters inlineOlivier Goffart2009-08-121-5/+0
|