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

Side by Side Diff: src/parser.cc

Issue 185563004: Fix a few nits found by PVS Studio (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: rebased Created 6 years, 1 month 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/objects.cc ('k') | test/cctest/test-api.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 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/v8.h" 5 #include "src/v8.h"
6 6
7 #include "src/api.h" 7 #include "src/api.h"
8 #include "src/ast.h" 8 #include "src/ast.h"
9 #include "src/bailout-reason.h" 9 #include "src/bailout-reason.h"
10 #include "src/base/platform/platform.h" 10 #include "src/base/platform/platform.h"
(...skipping 3185 matching lines...) Expand 10 before | Expand all | Expand 10 after
3196 // Parsed for-in loop w/ let declaration. 3196 // Parsed for-in loop w/ let declaration.
3197 return loop; 3197 return loop;
3198 3198
3199 } else { 3199 } else {
3200 init = variable_statement; 3200 init = variable_statement;
3201 } 3201 }
3202 } else { 3202 } else {
3203 Scanner::Location lhs_location = scanner()->peek_location(); 3203 Scanner::Location lhs_location = scanner()->peek_location();
3204 Expression* expression = ParseExpression(false, CHECK_OK); 3204 Expression* expression = ParseExpression(false, CHECK_OK);
3205 ForEachStatement::VisitMode mode; 3205 ForEachStatement::VisitMode mode;
3206 bool accept_OF = expression->AsVariableProxy(); 3206 bool accept_OF = expression->IsVariableProxy();
3207 3207
3208 if (CheckInOrOf(accept_OF, &mode)) { 3208 if (CheckInOrOf(accept_OF, &mode)) {
3209 expression = this->CheckAndRewriteReferenceExpression( 3209 expression = this->CheckAndRewriteReferenceExpression(
3210 expression, lhs_location, "invalid_lhs_in_for", CHECK_OK); 3210 expression, lhs_location, "invalid_lhs_in_for", CHECK_OK);
3211 3211
3212 ForEachStatement* loop = 3212 ForEachStatement* loop =
3213 factory()->NewForEachStatement(mode, labels, pos); 3213 factory()->NewForEachStatement(mode, labels, pos);
3214 Target target(&this->target_stack_, loop); 3214 Target target(&this->target_stack_, loop);
3215 3215
3216 Expression* enumerable = ParseExpression(true, CHECK_OK); 3216 Expression* enumerable = ParseExpression(true, CHECK_OK);
(...skipping 1738 matching lines...) Expand 10 before | Expand all | Expand 10 after
4955 4955
4956 // We cannot internalize on a background thread; a foreground task will take 4956 // We cannot internalize on a background thread; a foreground task will take
4957 // care of calling Parser::Internalize just before compilation. 4957 // care of calling Parser::Internalize just before compilation.
4958 4958
4959 if (compile_options() == ScriptCompiler::kProduceParserCache) { 4959 if (compile_options() == ScriptCompiler::kProduceParserCache) {
4960 if (result != NULL) *info_->cached_data() = recorder.GetScriptData(); 4960 if (result != NULL) *info_->cached_data() = recorder.GetScriptData();
4961 log_ = NULL; 4961 log_ = NULL;
4962 } 4962 }
4963 } 4963 }
4964 } } // namespace v8::internal 4964 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/objects.cc ('k') | test/cctest/test-api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698