Changeset 28527 in webkit for trunk/JavaScriptCore/kjs/function.h
- Timestamp:
- Dec 7, 2007, 2:05:55 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/kjs/function.h
r28110 r28527 26 26 #define KJS_FUNCTION_H 27 27 28 #include "JSVariableObject.h" 28 29 #include "LocalStorage.h" 29 30 #include "SymbolTable.h" 31 #include "nodes.h" 30 32 #include "object.h" 31 #include <wtf/OwnPtr.h>32 33 33 34 namespace KJS { … … 138 139 }; 139 140 140 class ActivationImp : public JSObject { 141 private: 142 struct ActivationImpPrivate { 143 ActivationImpPrivate(ExecState* e) 144 : exec(e) 145 , function(e->function()) 141 class ActivationImp : public JSVariableObject { 142 private: 143 using JSVariableObject::JSVariableObjectData; 144 145 struct ActivationImpData : public JSVariableObjectData { 146 ActivationImpData(ExecState* e) 147 : JSVariableObjectData(&e->function()->body->symbolTable()) 148 , exec(e) 146 149 , argumentsObject(0) 147 150 { 148 151 } 149 150 LocalStorage localStorage; 152 151 153 ExecState* exec; 152 FunctionImp* function;153 154 Arguments* argumentsObject; 154 155 }; 155 156 156 157 public: 157 ActivationImp(ExecState*); 158 ActivationImp::ActivationImp(ExecState* exec) 159 : JSVariableObject(new ActivationImpData(exec)) 160 { 161 } 162 163 virtual ~ActivationImp() 164 { 165 delete d(); 166 } 158 167 159 168 virtual bool getOwnPropertySlot(ExecState*, const Identifier&, PropertySlot&); 160 169 virtual void put(ExecState*, const Identifier& propertyName, JSValue* value, int attr = None); 161 170 virtual bool deleteProperty(ExecState*, const Identifier& propertyName); 162 virtual void getPropertyNames(ExecState*, PropertyNameArray&);163 171 164 172 virtual const ClassInfo* classInfo() const { return &info; } … … 167 175 virtual void mark(); 168 176 169 bool isActivation() { return true; } 170 171 LocalStorage& localStorage() { return d->localStorage; } 172 SymbolTable& symbolTable() { return *m_symbolTable; } 177 virtual bool isActivationObject() { return true; } 173 178 174 179 private: … … 176 181 static JSValue* argumentsGetter(ExecState*, JSObject*, const Identifier&, const PropertySlot& slot); 177 182 void createArgumentsObject(ExecState*); 178 179 OwnPtr<ActivationImpPrivate> d; 180 SymbolTable* m_symbolTable; 183 ActivationImpData* d() { return static_cast<ActivationImpData*>(JSVariableObject::d); } 181 184 }; 182 185
Note:
See TracChangeset
for help on using the changeset viewer.