Changeset 21032 in webkit for trunk/JavaScriptCore/kjs/nodes.h
- Timestamp:
- Apr 23, 2007, 3:28:10 AM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/kjs/nodes.h
r21027 r21032 29 29 #include "internal.h" 30 30 #include <wtf/ListRefPtr.h> 31 #include <wtf/Vector.h> 31 32 32 33 namespace KJS { … … 1004 1005 }; 1005 1006 1007 class Parameter { 1008 public: 1009 Parameter() { } 1010 Parameter(const Identifier& n) : name(n) { } 1011 Identifier name; 1012 }; 1013 1006 1014 // inherited by ProgramNode 1007 1015 class FunctionBodyNode : public BlockNode { … … 1011 1019 int sourceId() { return m_sourceId; } 1012 1020 const UString& sourceURL() { return m_sourceURL; } 1021 1022 void addParam(const Identifier& ident); 1023 size_t numParams() const { return m_parameters.size(); } 1024 Identifier paramName(size_t pos) const { return m_parameters[pos].name; } 1025 UString paramString() const; 1026 Vector<Parameter>& parameters() { return m_parameters; } 1013 1027 private: 1014 1028 UString m_sourceURL; 1015 1029 int m_sourceId; 1030 Vector<Parameter> m_parameters; 1016 1031 }; 1017 1032 … … 1019 1034 public: 1020 1035 FuncExprNode(const Identifier &i, FunctionBodyNode *b, ParameterNode *p = 0) 1021 : ident(i), param(p ? p->next.release() : 0), body(b) { if (p) { Parser::removeNodeCycle(param.get()); } }1036 : ident(i), param(p ? p->next.release() : 0), body(b) { if (p) { Parser::removeNodeCycle(param.get()); } addParams(); } 1022 1037 virtual JSValue *evaluate(ExecState*); 1023 1038 virtual void streamTo(SourceStream&) const; 1024 1039 private: 1040 void addParams(); 1025 1041 // Used for streamTo 1026 1042 friend class PropertyNode; … … 1033 1049 public: 1034 1050 FuncDeclNode(const Identifier &i, FunctionBodyNode *b) 1035 : ident(i), body(b) { }1051 : ident(i), body(b) { addParams(); } 1036 1052 FuncDeclNode(const Identifier &i, ParameterNode *p, FunctionBodyNode *b) 1037 : ident(i), param(p->next.release()), body(b) { Parser::removeNodeCycle(param.get()); }1053 : ident(i), param(p->next.release()), body(b) { Parser::removeNodeCycle(param.get()); addParams(); } 1038 1054 virtual Completion execute(ExecState*); 1039 1055 virtual void processFuncDecl(ExecState*); 1040 1056 virtual void streamTo(SourceStream&) const; 1041 1057 private: 1058 void addParams(); 1042 1059 Identifier ident; 1043 1060 RefPtr<ParameterNode> param;
Note:
See TracChangeset
for help on using the changeset viewer.