Qt 4.8
Public Functions | Public Variables | List of all members
QScript::GlobalObject Class Reference

#include <qscriptglobalobject_p.h>

Inheritance diagram for QScript::GlobalObject:

Public Functions

virtual JSC::UString className () const
 
virtual void defineGetter (JSC::ExecState *, const JSC::Identifier &propertyName, JSC::JSObject *getterFunction, unsigned attributes=0)
 
virtual void defineSetter (JSC::ExecState *, const JSC::Identifier &propertyName, JSC::JSObject *setterFunction, unsigned attributes=0)
 
virtual bool deleteProperty (JSC::ExecState *, const JSC::Identifier &propertyName)
 
virtual bool getOwnPropertyDescriptor (JSC::ExecState *, const JSC::Identifier &propertyName, JSC::PropertyDescriptor &)
 
virtual void getOwnPropertyNames (JSC::ExecState *, JSC::PropertyNameArray &, JSC::EnumerationMode mode=JSC::ExcludeDontEnumProperties)
 
virtual bool getOwnPropertySlot (JSC::ExecState *, const JSC::Identifier &propertyName, JSC::PropertySlot &)
 
 GlobalObject ()
 
virtual JSC::JSValue lookupGetter (JSC::ExecState *, const JSC::Identifier &propertyName)
 
virtual JSC::JSValue lookupSetter (JSC::ExecState *, const JSC::Identifier &propertyName)
 
virtual void markChildren (JSC::MarkStack &)
 
virtual void put (JSC::ExecState *exec, const JSC::Identifier &propertyName, JSC::JSValue, JSC::PutPropertySlot &)
 
virtual void putWithAttributes (JSC::ExecState *exec, const JSC::Identifier &propertyName, JSC::JSValue value, unsigned attributes)
 
virtual ~GlobalObject ()
 

Public Variables

JSC::JSObject * customGlobalObject
 

Detailed Description

Definition at line 47 of file qscriptglobalobject_p.h.

Constructors and Destructors

◆ GlobalObject()

QScript::GlobalObject::GlobalObject ( )

Definition at line 44 of file qscriptglobalobject.cpp.

45  : JSC::JSGlobalObject(), customGlobalObject(0)
46 {
47 }
JSC::JSObject * customGlobalObject

◆ ~GlobalObject()

QScript::GlobalObject::~GlobalObject ( )
virtual

Definition at line 49 of file qscriptglobalobject.cpp.

50 {
51 }

Functions

◆ className()

virtual JSC::UString QScript::GlobalObject::className ( ) const
inlinevirtual

Definition at line 52 of file qscriptglobalobject_p.h.

52 { return "global"; }

◆ defineGetter()

void QScript::GlobalObject::defineGetter ( JSC::ExecState *  exec,
const JSC::Identifier &  propertyName,
JSC::JSObject *  getterFunction,
unsigned  attributes = 0 
)
virtual

Definition at line 126 of file qscriptglobalobject.cpp.

Referenced by className().

127 {
128  if (customGlobalObject)
129  customGlobalObject->defineGetter(exec, propertyName, getterFunction, attributes);
130  else
131  JSC::JSGlobalObject::defineGetter(exec, propertyName, getterFunction, attributes);
132 }
JSC::JSObject * customGlobalObject

◆ defineSetter()

void QScript::GlobalObject::defineSetter ( JSC::ExecState *  exec,
const JSC::Identifier &  propertyName,
JSC::JSObject *  setterFunction,
unsigned  attributes = 0 
)
virtual

Definition at line 134 of file qscriptglobalobject.cpp.

Referenced by className().

135 {
136  if (customGlobalObject)
137  customGlobalObject->defineSetter(exec, propertyName, setterFunction, attributes);
138  else
139  JSC::JSGlobalObject::defineSetter(exec, propertyName, setterFunction, attributes);
140 }
JSC::JSObject * customGlobalObject

◆ deleteProperty()

bool QScript::GlobalObject::deleteProperty ( JSC::ExecState *  exec,
const JSC::Identifier &  propertyName 
)
virtual

Definition at line 110 of file qscriptglobalobject.cpp.

Referenced by className().

111 {
112  if (customGlobalObject)
113  return customGlobalObject->deleteProperty(exec, propertyName);
114  return JSC::JSGlobalObject::deleteProperty(exec, propertyName);
115 }
JSC::JSObject * customGlobalObject

◆ getOwnPropertyDescriptor()

bool QScript::GlobalObject::getOwnPropertyDescriptor ( JSC::ExecState *  exec,
const JSC::Identifier &  propertyName,
JSC::PropertyDescriptor &  descriptor 
)
virtual

Definition at line 75 of file qscriptglobalobject.cpp.

Referenced by className().

78 {
79  // Must match the logic of getOwnPropertySlot().
81  if (propertyName == exec->propertyNames().arguments && engine->currentFrame->argumentCount() > 0) {
82  // ### Can we get rid of this special handling of the arguments property?
83  JSC::JSValue args = engine->scriptValueToJSCValue(engine->contextForFrame(engine->currentFrame)->argumentsObject());
84  descriptor.setValue(args);
85  return true;
86  }
88  return customGlobalObject->getOwnPropertyDescriptor(exec, propertyName, descriptor);
89  return JSC::JSGlobalObject::getOwnPropertyDescriptor(exec, propertyName, descriptor);
90 }
QScriptEnginePrivate * scriptEngineFromExec(const JSC::ExecState *exec)
QScriptValue argumentsObject() const
Returns the arguments object of this QScriptContext.
JSC::ExecState * currentFrame
JSC::JSValue scriptValueToJSCValue(const QScriptValue &value)
static QScriptContext * contextForFrame(JSC::ExecState *frame)
JSC::JSObject * customGlobalObject

◆ getOwnPropertyNames()

void QScript::GlobalObject::getOwnPropertyNames ( JSC::ExecState *  exec,
JSC::PropertyNameArray &  propertyNames,
JSC::EnumerationMode  mode = JSC::ExcludeDontEnumProperties 
)
virtual

Definition at line 117 of file qscriptglobalobject.cpp.

Referenced by className().

119 {
120  if (customGlobalObject)
121  customGlobalObject->getOwnPropertyNames(exec, propertyNames, mode);
122  else
123  JSC::JSGlobalObject::getOwnPropertyNames(exec, propertyNames, mode);
124 }
JSC::JSObject * customGlobalObject

◆ getOwnPropertySlot()

bool QScript::GlobalObject::getOwnPropertySlot ( JSC::ExecState *  exec,
const JSC::Identifier &  propertyName,
JSC::PropertySlot &  slot 
)
virtual

Definition at line 60 of file qscriptglobalobject.cpp.

Referenced by className().

63 {
65  if (propertyName == exec->propertyNames().arguments && engine->currentFrame->argumentCount() > 0) {
66  JSC::JSValue args = engine->scriptValueToJSCValue(engine->contextForFrame(engine->currentFrame)->argumentsObject());
67  slot.setValue(args);
68  return true;
69  }
71  return customGlobalObject->getOwnPropertySlot(exec, propertyName, slot);
72  return JSC::JSGlobalObject::getOwnPropertySlot(exec, propertyName, slot);
73 }
QScriptEnginePrivate * scriptEngineFromExec(const JSC::ExecState *exec)
QScriptValue argumentsObject() const
Returns the arguments object of this QScriptContext.
JSC::ExecState * currentFrame
JSC::JSValue scriptValueToJSCValue(const QScriptValue &value)
static QScriptContext * contextForFrame(JSC::ExecState *frame)
JSC::JSObject * customGlobalObject

◆ lookupGetter()

JSC::JSValue QScript::GlobalObject::lookupGetter ( JSC::ExecState *  exec,
const JSC::Identifier &  propertyName 
)
virtual

Definition at line 142 of file qscriptglobalobject.cpp.

Referenced by className().

143 {
144  if (customGlobalObject)
145  return customGlobalObject->lookupGetter(exec, propertyName);
146  return JSC::JSGlobalObject::lookupGetter(exec, propertyName);
147 }
JSC::JSObject * customGlobalObject

◆ lookupSetter()

JSC::JSValue QScript::GlobalObject::lookupSetter ( JSC::ExecState *  exec,
const JSC::Identifier &  propertyName 
)
virtual

Definition at line 149 of file qscriptglobalobject.cpp.

Referenced by className().

150 {
151  if (customGlobalObject)
152  return customGlobalObject->lookupSetter(exec, propertyName);
153  return JSC::JSGlobalObject::lookupSetter(exec, propertyName);
154 }
JSC::JSObject * customGlobalObject

◆ markChildren()

void QScript::GlobalObject::markChildren ( JSC::MarkStack &  markStack)
virtual

Definition at line 53 of file qscriptglobalobject.cpp.

Referenced by className().

54 {
55  JSC::JSGlobalObject::markChildren(markStack);
57  markStack.append(customGlobalObject);
58 }
JSC::JSObject * customGlobalObject

◆ put()

void QScript::GlobalObject::put ( JSC::ExecState *  exec,
const JSC::Identifier &  propertyName,
JSC::JSValue  value,
JSC::PutPropertySlot &  slot 
)
virtual

Definition at line 92 of file qscriptglobalobject.cpp.

Referenced by className().

94 {
96  customGlobalObject->put(exec, propertyName, value, slot);
97  else
98  JSC::JSGlobalObject::put(exec, propertyName, value, slot);
99 }
JSC::JSObject * customGlobalObject

◆ putWithAttributes()

void QScript::GlobalObject::putWithAttributes ( JSC::ExecState *  exec,
const JSC::Identifier &  propertyName,
JSC::JSValue  value,
unsigned  attributes 
)
virtual

Definition at line 101 of file qscriptglobalobject.cpp.

Referenced by className().

103 {
104  if (customGlobalObject)
105  customGlobalObject->putWithAttributes(exec, propertyName, value, attributes);
106  else
107  JSC::JSGlobalObject::putWithAttributes(exec, propertyName, value, attributes);
108 }
JSC::JSObject * customGlobalObject

Properties

◆ customGlobalObject

JSC::JSObject* QScript::GlobalObject::customGlobalObject

The documentation for this class was generated from the following files: