OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 4250 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4261 Expect(Token::LPAREN, CHECK_OK); | 4261 Expect(Token::LPAREN, CHECK_OK); |
4262 scope->set_start_position(scanner().location().beg_pos); | 4262 scope->set_start_position(scanner().location().beg_pos); |
4263 Scanner::Location name_loc = Scanner::Location::invalid(); | 4263 Scanner::Location name_loc = Scanner::Location::invalid(); |
4264 Scanner::Location dupe_loc = Scanner::Location::invalid(); | 4264 Scanner::Location dupe_loc = Scanner::Location::invalid(); |
4265 Scanner::Location reserved_loc = Scanner::Location::invalid(); | 4265 Scanner::Location reserved_loc = Scanner::Location::invalid(); |
4266 | 4266 |
4267 bool done = (peek() == Token::RPAREN); | 4267 bool done = (peek() == Token::RPAREN); |
4268 while (!done) { | 4268 while (!done) { |
4269 bool is_strict_reserved = false; | 4269 bool is_strict_reserved = false; |
4270 Handle<String> param_name = | 4270 Handle<String> param_name = |
4271 ParseIdentifierOrStrictReservedWord(&is_strict_reserved, | 4271 ParseIdentifierOrStrictReservedWord(&is_strict_reserved, CHECK_OK); |
4272 CHECK_OK); | |
4273 | 4272 |
4274 // Store locations for possible future error reports. | 4273 // Store locations for possible future error reports. |
4275 if (!name_loc.IsValid() && IsEvalOrArguments(param_name)) { | 4274 if (!name_loc.IsValid() && IsEvalOrArguments(param_name)) { |
4276 name_loc = scanner().location(); | 4275 name_loc = scanner().location(); |
4277 } | 4276 } |
4278 if (!dupe_loc.IsValid() && top_scope_->IsDeclared(param_name)) { | 4277 if (!dupe_loc.IsValid() && top_scope_->IsDeclared(param_name)) { |
4279 duplicate_parameters = FunctionLiteral::kHasDuplicateParameters; | 4278 duplicate_parameters = FunctionLiteral::kHasDuplicateParameters; |
4280 dupe_loc = scanner().location(); | 4279 dupe_loc = scanner().location(); |
4281 } | 4280 } |
4282 if (!reserved_loc.IsValid() && is_strict_reserved) { | 4281 if (!reserved_loc.IsValid() && is_strict_reserved) { |
(...skipping 1565 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5848 ASSERT(info()->isolate()->has_pending_exception()); | 5847 ASSERT(info()->isolate()->has_pending_exception()); |
5849 } else { | 5848 } else { |
5850 result = ParseProgram(); | 5849 result = ParseProgram(); |
5851 } | 5850 } |
5852 } | 5851 } |
5853 info()->SetFunction(result); | 5852 info()->SetFunction(result); |
5854 return (result != NULL); | 5853 return (result != NULL); |
5855 } | 5854 } |
5856 | 5855 |
5857 } } // namespace v8::internal | 5856 } } // namespace v8::internal |
OLD | NEW |