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

Side by Side Diff: src/parser.cc

Issue 9365054: Don't treat function parameters as let-bound variables in Harmony mode. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 years, 10 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 | « no previous file | test/mjsunit/harmony/block-conflicts.js » ('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 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 4030 matching lines...) Expand 10 before | Expand all | Expand 10 after
4041 name_loc = scanner().location(); 4041 name_loc = scanner().location();
4042 } 4042 }
4043 if (!dupe_loc.IsValid() && top_scope_->IsDeclared(param_name)) { 4043 if (!dupe_loc.IsValid() && top_scope_->IsDeclared(param_name)) {
4044 has_duplicate_parameters = true; 4044 has_duplicate_parameters = true;
4045 dupe_loc = scanner().location(); 4045 dupe_loc = scanner().location();
4046 } 4046 }
4047 if (!reserved_loc.IsValid() && is_strict_reserved) { 4047 if (!reserved_loc.IsValid() && is_strict_reserved) {
4048 reserved_loc = scanner().location(); 4048 reserved_loc = scanner().location();
4049 } 4049 }
4050 4050
4051 top_scope_->DeclareParameter(param_name, is_extended_mode() ? LET : VAR); 4051 top_scope_->DeclareParameter(param_name, VAR);
4052 num_parameters++; 4052 num_parameters++;
4053 if (num_parameters > kMaxNumFunctionParameters) { 4053 if (num_parameters > kMaxNumFunctionParameters) {
4054 ReportMessageAt(scanner().location(), "too_many_parameters", 4054 ReportMessageAt(scanner().location(), "too_many_parameters",
4055 Vector<const char*>::empty()); 4055 Vector<const char*>::empty());
4056 *ok = false; 4056 *ok = false;
4057 return NULL; 4057 return NULL;
4058 } 4058 }
4059 done = (peek() == Token::RPAREN); 4059 done = (peek() == Token::RPAREN);
4060 if (!done) Expect(Token::COMMA, CHECK_OK); 4060 if (!done) Expect(Token::COMMA, CHECK_OK);
4061 } 4061 }
(...skipping 1549 matching lines...) Expand 10 before | Expand all | Expand 10 after
5611 ASSERT(info->isolate()->has_pending_exception()); 5611 ASSERT(info->isolate()->has_pending_exception());
5612 } else { 5612 } else {
5613 result = parser.ParseProgram(info); 5613 result = parser.ParseProgram(info);
5614 } 5614 }
5615 } 5615 }
5616 info->SetFunction(result); 5616 info->SetFunction(result);
5617 return (result != NULL); 5617 return (result != NULL);
5618 } 5618 }
5619 5619
5620 } } // namespace v8::internal 5620 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | test/mjsunit/harmony/block-conflicts.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698