Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(285)

Side by Side Diff: src/parser.cc

Issue 7132001: Merge revision r8194 to 3.1 branch. (Closed) Base URL: http://v8.googlecode.com/svn/branches/3.1/
Patch Set: '' Created 9 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/messages.js ('k') | src/version.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2010 the V8 project authors. All rights reserved. 1 // Copyright 2010 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 3472 matching lines...) Expand 10 before | Expand all | Expand 10 after
3483 ZoneList<Expression*>* Parser::ParseArguments(bool* ok) { 3483 ZoneList<Expression*>* Parser::ParseArguments(bool* ok) {
3484 // Arguments :: 3484 // Arguments ::
3485 // '(' (AssignmentExpression)*[','] ')' 3485 // '(' (AssignmentExpression)*[','] ')'
3486 3486
3487 ZoneList<Expression*>* result = new ZoneList<Expression*>(4); 3487 ZoneList<Expression*>* result = new ZoneList<Expression*>(4);
3488 Expect(Token::LPAREN, CHECK_OK); 3488 Expect(Token::LPAREN, CHECK_OK);
3489 bool done = (peek() == Token::RPAREN); 3489 bool done = (peek() == Token::RPAREN);
3490 while (!done) { 3490 while (!done) {
3491 Expression* argument = ParseAssignmentExpression(true, CHECK_OK); 3491 Expression* argument = ParseAssignmentExpression(true, CHECK_OK);
3492 result->Add(argument); 3492 result->Add(argument);
3493 if (result->length() > kMaxNumFunctionParameters) {
3494 ReportMessageAt(scanner().location(), "too_many_arguments",
3495 Vector<const char*>::empty());
3496 *ok = false;
3497 return NULL;
3498 }
3493 done = (peek() == Token::RPAREN); 3499 done = (peek() == Token::RPAREN);
3494 if (!done) Expect(Token::COMMA, CHECK_OK); 3500 if (!done) Expect(Token::COMMA, CHECK_OK);
3495 } 3501 }
3496 Expect(Token::RPAREN, CHECK_OK); 3502 Expect(Token::RPAREN, CHECK_OK);
3497 return result; 3503 return result;
3498 } 3504 }
3499 3505
3500 3506
3501 FunctionLiteral* Parser::ParseFunctionLiteral(Handle<String> var_name, 3507 FunctionLiteral* Parser::ParseFunctionLiteral(Handle<String> var_name,
3502 bool name_is_reserved, 3508 bool name_is_reserved,
(...skipping 1657 matching lines...) Expand 10 before | Expand all | Expand 10 after
5160 info->is_global(), 5166 info->is_global(),
5161 info->StrictMode()); 5167 info->StrictMode());
5162 } 5168 }
5163 } 5169 }
5164 5170
5165 info->SetFunction(result); 5171 info->SetFunction(result);
5166 return (result != NULL); 5172 return (result != NULL);
5167 } 5173 }
5168 5174
5169 } } // namespace v8::internal 5175 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/messages.js ('k') | src/version.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698