Changeset 11566 in webkit for trunk/JavaScriptCore/kjs/nodes.h
- Timestamp:
- Dec 13, 2005, 1:24:53 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/kjs/nodes.h
r11527 r11566 33 33 34 34 class ProgramNode; 35 class PropertyN ode;36 class Property ValueNode;35 class PropertyNameNode; 36 class PropertyListNode; 37 37 class Reference; 38 38 class RegExp; … … 247 247 }; 248 248 249 class PropertyValueNode : public Node { 250 public: 251 // list pointer is tail of a circular list, cracked in the ObjectLiteralNode ctor 252 PropertyValueNode(PropertyNode *n, Node *a) 253 : name(n), assign(a), list(this) { } 254 PropertyValueNode(PropertyNode *n, Node *a, PropertyValueNode *l) 255 : name(n), assign(a), list(l->list) { l->list = this; } 256 JSValue *evaluate(ExecState *exec); 257 virtual void streamTo(SourceStream &s) const; 258 private: 259 friend class ObjectLiteralNode; 260 RefPtr<PropertyNode> name; 261 RefPtr<Node> assign; 262 RefPtr<PropertyValueNode> list; 263 }; 264 265 class ObjectLiteralNode : public Node { 266 public: 267 ObjectLiteralNode() : list(0) { } 268 ObjectLiteralNode(PropertyValueNode *l) : list(l->list) { l->list = 0; } 269 JSValue *evaluate(ExecState *exec); 270 virtual void streamTo(SourceStream &s) const; 271 private: 272 RefPtr<PropertyValueNode> list; 273 }; 274 275 class PropertyNode : public Node { 276 public: 277 PropertyNode(double d) : numeric(d) { } 278 PropertyNode(const Identifier &s) : str(s) { } 249 class PropertyNameNode : public Node { 250 public: 251 PropertyNameNode(double d) : numeric(d) { } 252 PropertyNameNode(const Identifier &s) : str(s) { } 279 253 JSValue *evaluate(ExecState *exec); 280 254 virtual void streamTo(SourceStream &s) const; … … 282 256 double numeric; 283 257 Identifier str; 258 }; 259 260 class PropertyNode : public Node { 261 public: 262 enum Type { Constant, Getter, Setter }; 263 PropertyNode(PropertyNameNode *n, Node *a, Type t) 264 : name(n), assign(a), type(t) { } 265 JSValue *evaluate(ExecState *exec); 266 virtual void streamTo(SourceStream &s) const; 267 friend class PropertyListNode; 268 private: 269 RefPtr<PropertyNameNode> name; 270 RefPtr<Node> assign; 271 Type type; 272 }; 273 274 class PropertyListNode : public Node { 275 public: 276 // list pointer is tail of a circular list, cracked in the ObjectLiteralNode ctor 277 PropertyListNode(PropertyNode *n) 278 279 : node(n), list(this) { } 280 PropertyListNode(PropertyNode *n, PropertyListNode *l) 281 : node(n), list(l->list) { l->list = this; } 282 JSValue *evaluate(ExecState *exec); 283 virtual void streamTo(SourceStream &s) const; 284 private: 285 friend class ObjectLiteralNode; 286 RefPtr<PropertyNode> node; 287 RefPtr<PropertyListNode> list; 288 }; 289 290 class ObjectLiteralNode : public Node { 291 public: 292 ObjectLiteralNode() : list(0) { } 293 ObjectLiteralNode(PropertyListNode *l) : list(l->list) { l->list = 0; } 294 JSValue *evaluate(ExecState *exec); 295 virtual void streamTo(SourceStream &s) const; 296 private: 297 RefPtr<PropertyListNode> list; 284 298 }; 285 299 … … 1031 1045 class FuncExprNode : public Node { 1032 1046 public: 1033 FuncExprNode(const Identifier &i, FunctionBodyNode *b) 1034 : ident(i), param(0), body(b) { } 1035 FuncExprNode(const Identifier &i, ParameterNode *p, FunctionBodyNode *b) 1036 : ident(i), param(p->next), body(b) { p->next = 0; } 1047 FuncExprNode(const Identifier &i, FunctionBodyNode *b, ParameterNode *p = 0) 1048 : ident(i), param(p ? p->next : 0), body(b) { if (p) p->next = 0; } 1037 1049 virtual JSValue *evaluate(ExecState *); 1038 1050 virtual void streamTo(SourceStream &) const; 1039 1051 private: 1052 // Used for streamTo 1053 friend class PropertyNode; 1040 1054 Identifier ident; 1041 1055 RefPtr<ParameterNode> param;
Note:
See TracChangeset
for help on using the changeset viewer.