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

Side by Side Diff: src/parser.cc

Issue 149253010: Tests and fixes for (pre)parse errors related to strict reserved words. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 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 | « src/messages.js ('k') | src/preparser.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 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 4303 matching lines...) Expand 10 before | Expand all | Expand 10 after
4314 *ok = false; 4314 *ok = false;
4315 return NULL; 4315 return NULL;
4316 } 4316 }
4317 if (dupe_loc.IsValid()) { 4317 if (dupe_loc.IsValid()) {
4318 ReportMessageAt(dupe_loc, "strict_param_dupe", 4318 ReportMessageAt(dupe_loc, "strict_param_dupe",
4319 Vector<const char*>::empty()); 4319 Vector<const char*>::empty());
4320 *ok = false; 4320 *ok = false;
4321 return NULL; 4321 return NULL;
4322 } 4322 }
4323 if (name_is_strict_reserved) { 4323 if (name_is_strict_reserved) {
4324 int start_pos = scope->start_position(); 4324 ReportMessageAt(function_name_location, "unexpected_strict_reserved",
4325 int position = function_token_pos != RelocInfo::kNoPosition
4326 ? function_token_pos : (start_pos > 0 ? start_pos - 1 : start_pos);
4327 Scanner::Location location = Scanner::Location(position, start_pos);
4328 ReportMessageAt(location, "strict_reserved_word",
4329 Vector<const char*>::empty()); 4325 Vector<const char*>::empty());
4330 *ok = false; 4326 *ok = false;
4331 return NULL; 4327 return NULL;
4332 } 4328 }
4333 if (reserved_loc.IsValid()) { 4329 if (reserved_loc.IsValid()) {
4334 ReportMessageAt(reserved_loc, "strict_reserved_word", 4330 ReportMessageAt(reserved_loc, "unexpected_strict_reserved",
4335 Vector<const char*>::empty()); 4331 Vector<const char*>::empty());
4336 *ok = false; 4332 *ok = false;
4337 return NULL; 4333 return NULL;
4338 } 4334 }
4339 CheckOctalLiteral(scope->start_position(), 4335 CheckOctalLiteral(scope->start_position(),
4340 scope->end_position(), 4336 scope->end_position(),
4341 CHECK_OK); 4337 CHECK_OK);
4342 } 4338 }
4343 ast_properties = *factory()->visitor()->ast_properties(); 4339 ast_properties = *factory()->visitor()->ast_properties();
4344 dont_optimize_reason = factory()->visitor()->dont_optimize_reason(); 4340 dont_optimize_reason = factory()->visitor()->dont_optimize_reason();
(...skipping 1343 matching lines...) Expand 10 before | Expand all | Expand 10 after
5688 ASSERT(info()->isolate()->has_pending_exception()); 5684 ASSERT(info()->isolate()->has_pending_exception());
5689 } else { 5685 } else {
5690 result = ParseProgram(); 5686 result = ParseProgram();
5691 } 5687 }
5692 } 5688 }
5693 info()->SetFunction(result); 5689 info()->SetFunction(result);
5694 return (result != NULL); 5690 return (result != NULL);
5695 } 5691 }
5696 5692
5697 } } // namespace v8::internal 5693 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/messages.js ('k') | src/preparser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698