summaryrefslogtreecommitdiffstats
path: root/src/script/api/qscriptengine_p.h
diff options
context:
space:
mode:
authorKent Hansen <khansen@trolltech.com>2009-07-15 12:10:10 (GMT)
committerKent Hansen <khansen@trolltech.com>2009-07-15 12:10:10 (GMT)
commit8e932d7d53168fda6ed39109659efcaf88a32487 (patch)
treea1a68e31082ee788e66e232f148f3f80268ee5ee /src/script/api/qscriptengine_p.h
parentc32c9c2d2b868cb34fb8917b25273eb52f2c9581 (diff)
downloadQt-8e932d7d53168fda6ed39109659efcaf88a32487.zip
Qt-8e932d7d53168fda6ed39109659efcaf88a32487.tar.gz
Qt-8e932d7d53168fda6ed39109659efcaf88a32487.tar.bz2
initial attempt at implementing QScriptEngine::setGlobalObject()
Doesn't actually replace the global object, but rather has the standard global object act as a proxy to the custom one.
Diffstat (limited to 'src/script/api/qscriptengine_p.h')
-rw-r--r--src/script/api/qscriptengine_p.h15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/script/api/qscriptengine_p.h b/src/script/api/qscriptengine_p.h
index 64f2145..29581e4 100644
--- a/src/script/api/qscriptengine_p.h
+++ b/src/script/api/qscriptengine_p.h
@@ -110,6 +110,8 @@ public:
QScriptContext *contextForFrame(JSC::ExecState *frame);
void releaseContextForFrame(JSC::ExecState *frame);
+ bool isCollecting() const;
+
#ifndef QT_NO_QOBJECT
JSC::JSValue newQObject(QObject *object,
QScriptEngine::ValueOwnership ownership = QScriptEngine::QtOwnership,
@@ -155,6 +157,7 @@ public:
#endif
JSC::JSGlobalObject *globalObject;
+ JSC::JSObject *customGlobalObject;
JSC::ExecState *currentFrame;
QHash<JSC::ExecState*, QScriptContext*> contextForFrameHash;
JSC::JSValue uncaughtException;
@@ -198,9 +201,19 @@ class GlobalObject : public JSC::JSGlobalObject
{
public:
GlobalObject(QScriptEnginePrivate*);
- ~GlobalObject();
+ virtual ~GlobalObject();
virtual JSC::UString className() const { return "global"; }
virtual void mark();
+ virtual bool getOwnPropertySlot(JSC::ExecState*,
+ const JSC::Identifier& propertyName,
+ JSC::PropertySlot&);
+ virtual void put(JSC::ExecState* exec, const JSC::Identifier& propertyName,
+ JSC::JSValue, JSC::PutPropertySlot&);
+ virtual bool deleteProperty(JSC::ExecState*,
+ const JSC::Identifier& propertyName);
+ virtual bool getPropertyAttributes(JSC::ExecState*, const JSC::Identifier&,
+ unsigned&) const;
+ virtual void getPropertyNames(JSC::ExecState*, JSC::PropertyNameArray&);
public:
QScriptEnginePrivate *engine;