summaryrefslogtreecommitdiff
path: root/src/script/bridge/qscriptclassobject.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Change copyrights from Nokia to Digia4.6Sergio Ahumada2012-11-271-4/+4
| | | | | | | | Change copyrights and license headers from Nokia to Digia Change-Id: I8b2ed2e09e9beb46bdda354017c29f00be6ae76f Reviewed-by: Akseli Salovaara <akseli.salovaara@digia.com> Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Update copyright year to 2011.Jason McDonald2011-01-111-1/+1
| | | | Reviewed-by: Trust Me
* QScriptClass-implemented constructors lead to application crashKent Hansen2010-03-191-1/+3
| | | | | | | Add missing popContext() to balance the pushContext(). Task-number: QTBUG-8364 Reviewed-by: Olivier Goffart
* Update copyright year to 2010Jason McDonald2010-01-071-1/+1
| | | | Reviewed-by: Trust Me
* 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>
* Inline internal QtScript object delegate functionsKent Hansen2009-10-231-11/+0
| | | | | | Makes QScriptValue::scriptClass() 20% faster. Reviewed-by: Olivier Goffart
* Update src/3rdparty/javascriptcore and adapt src/script to the changes.Kent Hansen2009-09-241-4/+4
| | | | Reviewed-by: Simon Hausmann
* don't crash in property access after script class has been set to 0Kent Hansen2009-09-221-0/+1
| | | | | | | | 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
* make sure the engine's currentFrame is in sync when calling out to public APIKent Hansen2009-09-221-1/+7
| | | | | | | The currentFrame pointer is used e.g. by QScriptValue::toString(). It needs to be in sync, otherwise we will crash. Reviewed-by: Olivier Goffart
* use JSObject::inherits() instead of JSObject::isObject()Kent Hansen2009-09-211-2/+2
| | | | | | 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.
* Update license headers again.Jason McDonald2009-09-091-4/+4
| | | | Reviewed-by: Trust Me
* improve memory management scheme of QScriptString(Private)Kent Hansen2009-09-021-4/+12
| | | | | | | | Get rid of QPointer. Use linked list of privates (like was recently done for QScriptValue). Allocate the private on the stack when we can. Reviewed-by: Olivier Goffart
* Optimize QScriptClassOlivier Goffart2009-09-021-8/+4
| | | | | | | Do not convert JSC::Identifier to QString to convert it later to JSC::Identivier again Reviewed-by: Kent Hansen
* Update tech preview license header for files that are new in 4.6.Jason McDonald2009-08-311-13/+13
| | | | Reviewed-by: Trust Me
* Fix obsolete license headers.Jason McDonald2009-08-221-1/+1
| | | | Reviewed-by: Trust Me
* Clean up.Jedrzej Nowacki2009-08-181-1/+1
| | | | | | Unused variable were commented. Reviewed-by: Kent Hansen
* Clean up.Jedrzej Nowacki2009-08-181-5/+5
| | | | | | | 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.
* Cantralize the place when we construct the default 'this' object that JSC ↵Olivier Goffart2009-08-121-9/+1
| | | | | | | | doesn't construct. Removes code duplication. This also indirrectly fixes the QMetaObjectWrapperObject where this was missing
* Refactor the way the JS stack are created for native functionOlivier Goffart2009-08-121-7/+17
| | | | | | | | | | 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
* implement QScriptClass property query semantics of old back-endKent Hansen2009-08-101-1/+6
| | | | | Look up the property as a normal JS property before falling back to the dynamic query mechanism. This is the documented behavior.
* add configure options for (not) building the QtScript moduleKent Hansen2009-08-071-4/+0
| | | | | | | | | | | | | | | | | | -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
* Updates getPropertyNames() on all javascript object to use the flagBenjamin Poulain2009-08-051-2/+2
| | | | | | | | 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
* adapt to commit 014c4c63066fd3920594e6a58b02f314b5c88cdfKent Hansen2009-08-041-2/+3
|
* Move the declaration on some function into qscriptengine_p.hOlivier Goffart2009-07-311-4/+0
|
* Small Refactoring of QScriptOlivier Goffart2009-07-311-9/+8
| | | | | | | | | - Create a scope (activation object) for the native constructor in QScriptClass - put the isCalledasConstructor in the activation object (so i can clean up the QScriptContext - Remove the code duplication in all native functions. Aknoweldged-by: Kent
* QScriptValueIterator: fix missing non-enumerable valuesTor Arne Vestbø2009-07-311-2/+3
| | | | | | | | | | 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.
* set calledAsConstructor to true when function is called as constructorKent Hansen2009-07-291-0/+3
|
* Fix license headersOlivier Goffart2009-07-291-4/+34
|
* introduce scriptEngineFromExec() helper functionKent Hansen2009-07-271-8/+9
| | | | | No need to expose the fact that we go via the Global Object to get an engine pointer.
* implement enumeration of custom script classesKent Hansen2009-07-151-1/+14
|
* implement ability to dynamically change class of script objectsKent Hansen2009-07-101-0/+225
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.