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

Issue 51533003: Compile time error if name is used before variable is declared (Closed)

Created:
7 years, 1 month ago by hausner
Modified:
7 years, 1 month ago
Reviewers:
ngeoffray, Ivan Posva
CC:
reviews_dartlang.org, vm-dev_dartlang.org, ngeoffray
Visibility:
Public.

Description

Compile time error if name is used before variable is declared Implement proper semantics if a name has been referenced in a block and later a variable with that same name is declared. Fix library code that was wrong. Add new language test, delete a couple of tests that are outdated, file co19 bug 649. Dart2js and dart2dart are not yet implementing these compile-time errors. R=iposva@google.com Committed: https://code.google.com/p/dart/source/detail?r=29770

Patch Set 1 #

Total comments: 6
Unified diffs Side-by-side diffs Delta from patch set Stats (+193 lines, -83 lines) Patch
M runtime/lib/growable_array.dart View 1 chunk +1 line, -1 line 0 comments Download
M runtime/lib/string_patch.dart View 1 chunk +2 lines, -2 lines 0 comments Download
M runtime/lib/typed_data.dart View 1 chunk +1 line, -1 line 0 comments Download
M runtime/vm/parser.cc View 3 chunks +27 lines, -2 lines 2 comments Download
M runtime/vm/scopes.h View 4 chunks +27 lines, -0 lines 0 comments Download
M runtime/vm/scopes.cc View 2 chunks +44 lines, -1 line 2 comments Download
M tests/co19/co19-co19.status View 2 chunks +1 line, -1 line 0 comments Download
M tests/co19/co19-dart2dart.status View 1 chunk +1 line, -0 lines 0 comments Download
M tests/co19/co19-dart2js.status View 1 chunk +1 line, -0 lines 0 comments Download
D tests/language/bailout3_test.dart View 1 chunk +0 lines, -41 lines 2 comments Download
M tests/language/language_analyzer.status View 1 chunk +0 lines, -4 lines 0 comments Download
M tests/language/language_analyzer2.status View 1 chunk +0 lines, -4 lines 0 comments Download
M tests/language/language_dart2js.status View 1 chunk +7 lines, -0 lines 0 comments Download
D tests/language/prefix9_test.dart View 1 chunk +0 lines, -26 lines 0 comments Download
A tests/language/ref_before_declaration_test.dart View 1 chunk +81 lines, -0 lines 0 comments Download

Messages

Total messages: 5 (0 generated)
hausner
7 years, 1 month ago (2013-10-31 22:55:56 UTC) #1
Ivan Posva
LGTM -ip https://codereview.chromium.org/51533003/diff/1/runtime/vm/parser.cc File runtime/vm/parser.cc (right): https://codereview.chromium.org/51533003/diff/1/runtime/vm/parser.cc#newcode5273 runtime/vm/parser.cc:5273: script_.GetTokenLocation(previous_pos, &line_number, NULL); Since we are only ...
7 years, 1 month ago (2013-11-01 16:35:12 UTC) #2
hausner
Thank you. Nicolas, I removed tests/language/bailout3_test.dart because my impression is that it depends on declaring ...
7 years, 1 month ago (2013-11-01 16:42:51 UTC) #3
hausner
Committed patchset #1 manually as r29770 (presubmit successful).
7 years, 1 month ago (2013-11-01 21:28:43 UTC) #4
ngeoffray
7 years, 1 month ago (2013-11-01 21:41:06 UTC) #5
Message was sent while issue was closed.
https://codereview.chromium.org/51533003/diff/1/tests/language/bailout3_test....
File tests/language/bailout3_test.dart (left):

https://codereview.chromium.org/51533003/diff/1/tests/language/bailout3_test....
tests/language/bailout3_test.dart:31: var a = bar();
This should be var b = bar().

https://codereview.chromium.org/51533003/diff/1/tests/language/bailout3_test....
tests/language/bailout3_test.dart:34: Expect.equals(1, a.length);
-> b.length.

Powered by Google App Engine
This is Rietveld 408576698