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

Unified Diff: src/parsing/parser.h

Issue 2504613002: [parser,ast] Simplify MarkExpressionAsAssigned. (Closed)
Patch Set: Created 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/ast/ast.h ('k') | src/parsing/parser-base.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/parsing/parser.h
diff --git a/src/parsing/parser.h b/src/parsing/parser.h
index 19384f6fdba3581cc78d0c55a68ed2c1d5a98966..2b9d04ec3a7effd1de1972d25bc0c86453a20928 100644
--- a/src/parsing/parser.h
+++ b/src/parsing/parser.h
@@ -829,12 +829,11 @@ class V8_EXPORT_PRIVATE Parser : public NON_EXPORTED_BASE(ParserBase<Parser>) {
// Determine if the expression is a variable proxy and mark it as being used
// in an assignment or with a increment/decrement operator.
- V8_INLINE static Expression* MarkExpressionAsAssigned(
- Expression* expression) {
- VariableProxy* proxy =
- expression != NULL ? expression->AsVariableProxy() : NULL;
- if (proxy != NULL) proxy->set_is_assigned();
- return expression;
+ V8_INLINE static void MarkExpressionAsAssigned(Expression* expression) {
+ DCHECK_NOT_NULL(expression);
+ if (expression->IsVariableProxy()) {
+ expression->AsVariableProxy()->set_is_assigned();
+ }
}
// Returns true if we have a binary expression between two numeric
« no previous file with comments | « src/ast/ast.h ('k') | src/parsing/parser-base.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698