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

Issue 106843002: Detect illegal assignable expressions (Closed)

Created:
7 years ago by hausner
Modified:
7 years ago
Reviewers:
regis
CC:
reviews_dartlang.org, vm-dev_dartlang.org
Visibility:
Public.

Description

Detect illegal assignable expressions The AST cannot distinguish between (x) and x. Adding a check to the VM compiler that detects syntactically illegal assignments like (x) = 0. The existing checks only analyze the AST so we didn’t detect some illegal cases. Looking at the source to detect syntactically illegal left hand expressions is a bit ugly because we can’t easily look at previous tokens. This change rewinds the token iterator a few positions and then moves forward to check whether the last token of the expression is an identifier or a closing bracket ]. Added new test. We did not have a single test case for this :) R=regis@google.com Committed: https://code.google.com/p/dart/source/detail?r=30904

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+108 lines, -19 lines) Patch
M runtime/vm/parser.h View 3 chunks +4 lines, -2 lines 0 comments Download
M runtime/vm/parser.cc View 18 chunks +54 lines, -17 lines 0 comments Download
A tests/language/assignable_expression_test.dart View 1 chunk +44 lines, -0 lines 0 comments Download
M tests/language/language_analyzer.status View 1 chunk +6 lines, -0 lines 0 comments Download

Messages

Total messages: 3 (0 generated)
hausner
7 years ago (2013-12-05 17:51:19 UTC) #1
regis
LGTM
7 years ago (2013-12-05 17:57:24 UTC) #2
hausner
7 years ago (2013-12-05 18:15:27 UTC) #3
Message was sent while issue was closed.
Committed patchset #1 manually as r30904 (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698