Changeset 179159 in webkit for trunk/Source/JavaScriptCore
- Timestamp:
- Jan 26, 2015, 5:14:14 PM (10 years ago)
- Location:
- trunk/Source/JavaScriptCore
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/ChangeLog
r179124 r179159 1 2015-01-26 Ryosuke Niwa <[email protected]> 2 3 Parse a function expression as a primary expression 4 https://bugs.webkit.org/show_bug.cgi?id=140908 5 6 Reviewed by Mark Lam. 7 8 Moved the code to generate an AST node for a function expression from parseMemberExpression 9 to parsePrimaryExpression to match the ES6 specification terminology: 10 https://people.mozilla.org/~jorendorff/es6-draft.html#sec-primary-expression 11 12 There should be no behavior change from this change since parsePrimaryExpression is only 13 called in parseMemberExpression other than the fact failIfStackOverflow() is called. 14 15 * parser/Parser.cpp: 16 (JSC::Parser<LexerType>::parsePrimaryExpression): 17 (JSC::Parser<LexerType>::parseMemberExpression): 18 1 19 2015-01-26 Myles C. Maxfield <[email protected]> 2 20 -
trunk/Source/JavaScriptCore/parser/Parser.cpp
r178888 r179159 2028 2028 failIfStackOverflow(); 2029 2029 switch (m_token.m_type) { 2030 case FUNCTION: { 2031 JSTokenLocation location(tokenLocation()); 2032 unsigned functionKeywordStart = tokenStart(); 2033 next(); 2034 ParserFunctionInfo<TreeBuilder> info; 2035 info.name = &m_vm->propertyNames->nullIdentifier; 2036 failIfFalse((parseFunctionInfo(context, FunctionNoRequirements, FunctionMode, false, info)), "Cannot parse function expression"); 2037 return context.createFunctionExpr(location, info, functionKeywordStart); 2038 } 2030 2039 case OPENBRACE: 2031 2040 if (strictMode()) … … 2164 2173 } 2165 2174 2166 if (match(FUNCTION)) { 2167 unsigned functionKeywordStart = tokenStart(); 2168 location = tokenLocation(); 2169 next(); 2170 ParserFunctionInfo<TreeBuilder> info; 2171 info.name = &m_vm->propertyNames->nullIdentifier; 2172 failIfFalse((parseFunctionInfo(context, FunctionNoRequirements, FunctionMode, false, info)), "Cannot parse function expression"); 2173 base = context.createFunctionExpr(location, info, functionKeywordStart); 2174 } else 2175 base = parsePrimaryExpression(context); 2175 base = parsePrimaryExpression(context); 2176 2176 2177 2177 failIfFalse(base, "Cannot parse base expression");
Note:
See TracChangeset
for help on using the changeset viewer.