| OLD | NEW |
| 1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 3483 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3494 ZoneList<Expression*>* Parser::ParseArguments(bool* ok) { | 3494 ZoneList<Expression*>* Parser::ParseArguments(bool* ok) { |
| 3495 // Arguments :: | 3495 // Arguments :: |
| 3496 // '(' (AssignmentExpression)*[','] ')' | 3496 // '(' (AssignmentExpression)*[','] ')' |
| 3497 | 3497 |
| 3498 ZoneList<Expression*>* result = new ZoneList<Expression*>(4); | 3498 ZoneList<Expression*>* result = new ZoneList<Expression*>(4); |
| 3499 Expect(Token::LPAREN, CHECK_OK); | 3499 Expect(Token::LPAREN, CHECK_OK); |
| 3500 bool done = (peek() == Token::RPAREN); | 3500 bool done = (peek() == Token::RPAREN); |
| 3501 while (!done) { | 3501 while (!done) { |
| 3502 Expression* argument = ParseAssignmentExpression(true, CHECK_OK); | 3502 Expression* argument = ParseAssignmentExpression(true, CHECK_OK); |
| 3503 result->Add(argument); | 3503 result->Add(argument); |
| 3504 if (result->length() > kMaxNumFunctionParameters) { |
| 3505 ReportMessageAt(scanner().location(), "too_many_arguments", |
| 3506 Vector<const char*>::empty()); |
| 3507 *ok = false; |
| 3508 return NULL; |
| 3509 } |
| 3504 done = (peek() == Token::RPAREN); | 3510 done = (peek() == Token::RPAREN); |
| 3505 if (!done) Expect(Token::COMMA, CHECK_OK); | 3511 if (!done) Expect(Token::COMMA, CHECK_OK); |
| 3506 } | 3512 } |
| 3507 Expect(Token::RPAREN, CHECK_OK); | 3513 Expect(Token::RPAREN, CHECK_OK); |
| 3508 return result; | 3514 return result; |
| 3509 } | 3515 } |
| 3510 | 3516 |
| 3511 | 3517 |
| 3512 FunctionLiteral* Parser::ParseFunctionLiteral(Handle<String> var_name, | 3518 FunctionLiteral* Parser::ParseFunctionLiteral(Handle<String> var_name, |
| 3513 bool name_is_reserved, | 3519 bool name_is_reserved, |
| (...skipping 1645 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5159 info->is_global(), | 5165 info->is_global(), |
| 5160 info->StrictMode()); | 5166 info->StrictMode()); |
| 5161 } | 5167 } |
| 5162 } | 5168 } |
| 5163 | 5169 |
| 5164 info->SetFunction(result); | 5170 info->SetFunction(result); |
| 5165 return (result != NULL); | 5171 return (result != NULL); |
| 5166 } | 5172 } |
| 5167 | 5173 |
| 5168 } } // namespace v8::internal | 5174 } } // namespace v8::internal |
| OLD | NEW |