Changeset 47089 in webkit for trunk/JavaScriptCore/parser/Nodes.cpp
- Timestamp:
- Aug 11, 2009, 10:22:33 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/parser/Nodes.cpp
r47062 r47089 1829 1829 FunctionStack::iterator end = m_functionStack.end(); 1830 1830 for (FunctionStack::iterator ptr = m_functionStack.begin(); ptr != end; ++ptr) { 1831 FunctionBodyNode* body = (*ptr)->body();1831 FunctionBodyNode* body = *ptr; 1832 1832 if (!body->isGenerated()) 1833 1833 continue; … … 2019 2019 } 2020 2020 2021 void FunctionBodyNode::finishParsing(const SourceCode& source, ParameterNode* firstParameter )2021 void FunctionBodyNode::finishParsing(const SourceCode& source, ParameterNode* firstParameter, const Identifier& ident) 2022 2022 { 2023 2023 Vector<Identifier> parameters; … … 2027 2027 2028 2028 setSource(source); 2029 finishParsing(parameters.releaseBuffer(), count );2030 } 2031 2032 void FunctionBodyNode::finishParsing(Identifier* parameters, size_t parameterCount )2029 finishParsing(parameters.releaseBuffer(), count, ident); 2030 } 2031 2032 void FunctionBodyNode::finishParsing(Identifier* parameters, size_t parameterCount, const Identifier& ident) 2033 2033 { 2034 2034 ASSERT(!source().isNull()); 2035 2035 m_parameters = parameters; 2036 2036 m_parameterCount = parameterCount; 2037 m_ident = ident; 2037 2038 } 2038 2039 … … 2158 2159 // ------------------------------ FuncDeclNode --------------------------------- 2159 2160 2160 JSFunction* FuncDeclNode::makeFunction(ExecState* exec, ScopeChainNode* scopeChain)2161 {2162 return new (exec) JSFunction(exec, m_ident, m_body.get(), scopeChain);2163 }2164 2165 2161 RegisterID* FuncDeclNode::emitBytecode(BytecodeGenerator& generator, RegisterID* dst) 2166 2162 { … … 2177 2173 } 2178 2174 2179 JSFunction* FuncExprNode::makeFunction(ExecState* exec, ScopeChainNode* scopeChain)2180 {2181 JSFunction* func = new (exec) JSFunction(exec, m_ident, m_body.get(), scopeChain);2182 2183 /*2184 The Identifier in a FunctionExpression can be referenced from inside2185 the FunctionExpression's FunctionBody to allow the function to call2186 itself recursively. However, unlike in a FunctionDeclaration, the2187 Identifier in a FunctionExpression cannot be referenced from and2188 does not affect the scope enclosing the FunctionExpression.2189 */2190 2191 if (!m_ident.isNull()) {2192 JSStaticScopeObject* functionScopeObject = new (exec) JSStaticScopeObject(exec, m_ident, func, ReadOnly | DontDelete);2193 func->scope().push(functionScopeObject);2194 }2195 2196 return func;2197 }2198 2199 2175 } // namespace JSC
Note:
See TracChangeset
for help on using the changeset viewer.