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

Issue 8276014: Update assert to follow the spec. (Closed)

Created:
9 years, 2 months ago by John Lenz
Modified:
9 years, 2 months ago
Reviewers:
regis, ahe, jat
CC:
reviews_dartlang.org
Visibility:
Public.

Description

Update assert to follow the spec. Committed: https://code.google.com/p/dart/source/detail?r=446

Patch Set 1 : '' #

Total comments: 12

Patch Set 2 : '' #

Total comments: 7
Unified diffs Side-by-side diffs Delta from patch set Stats (+53 lines, -76 lines) Patch
M compiler/java/com/google/dart/compiler/ast/DartAssertion.java View 3 chunks +1 line, -17 lines 0 comments Download
M compiler/java/com/google/dart/compiler/backend/js/GenerateJavascriptAST.java View 3 chunks +16 lines, -8 lines 0 comments Download
M compiler/java/com/google/dart/compiler/parser/DartParser.java View 10 chunks +10 lines, -14 lines 0 comments Download
M compiler/java/com/google/dart/compiler/type/TypeAnalyzer.java View 1 chunk +0 lines, -1 line 0 comments Download
M compiler/javatests/com/google/dart/compiler/type/TypeAnalyzerTest.java View 1 chunk +0 lines, -6 lines 0 comments Download
M compiler/lib/implementation/core.dart View 1 chunk +4 lines, -0 lines 0 comments Download
M compiler/lib/implementation/core.js View 1 chunk +4 lines, -7 lines 0 comments Download
A + tests/language/src/AssertionTest.dart View 1 2 chunks +18 lines, -23 lines 7 comments Download

Messages

Total messages: 14 (0 generated)
John Lenz
9 years, 2 months ago (2011-10-13 20:01:44 UTC) #1
John Lenz
http://codereview.chromium.org/8276014/diff/3001/tests/language/src/AssertionTest.dart File tests/language/src/AssertionTest.dart (right): http://codereview.chromium.org/8276014/diff/3001/tests/language/src/AssertionTest.dart#newcode8 tests/language/src/AssertionTest.dart:8: class AssertionTest { This is a fork of AssertTest ...
9 years, 2 months ago (2011-10-13 20:09:40 UTC) #2
John Lenz
ahe for the test file change jat for everything else
9 years, 2 months ago (2011-10-13 20:48:58 UTC) #3
jat
LGTM http://codereview.chromium.org/8276014/diff/3001/compiler/java/com/google/dart/compiler/type/TypeAnalyzer.java File compiler/java/com/google/dart/compiler/type/TypeAnalyzer.java (left): http://codereview.chromium.org/8276014/diff/3001/compiler/java/com/google/dart/compiler/type/TypeAnalyzer.java#oldcode636 compiler/java/com/google/dart/compiler/type/TypeAnalyzer.java:636: checkAssignable(conditionNode, boolType, condition); I know this is pre-existing ...
9 years, 2 months ago (2011-10-13 21:03:00 UTC) #4
ahe
http://codereview.chromium.org/8276014/diff/3001/compiler/java/com/google/dart/compiler/type/TypeAnalyzer.java File compiler/java/com/google/dart/compiler/type/TypeAnalyzer.java (left): http://codereview.chromium.org/8276014/diff/3001/compiler/java/com/google/dart/compiler/type/TypeAnalyzer.java#oldcode636 compiler/java/com/google/dart/compiler/type/TypeAnalyzer.java:636: checkAssignable(conditionNode, boolType, condition); On 2011/10/13 21:03:01, jat wrote: > ...
9 years, 2 months ago (2011-10-13 21:19:41 UTC) #5
jat
http://codereview.chromium.org/8276014/diff/3001/compiler/java/com/google/dart/compiler/type/TypeAnalyzer.java File compiler/java/com/google/dart/compiler/type/TypeAnalyzer.java (left): http://codereview.chromium.org/8276014/diff/3001/compiler/java/com/google/dart/compiler/type/TypeAnalyzer.java#oldcode636 compiler/java/com/google/dart/compiler/type/TypeAnalyzer.java:636: checkAssignable(conditionNode, boolType, condition); Ok, so if the type isn't ...
9 years, 2 months ago (2011-10-13 21:21:52 UTC) #6
John Lenz
http://codereview.chromium.org/8276014/diff/3001/compiler/java/com/google/dart/compiler/type/TypeAnalyzer.java File compiler/java/com/google/dart/compiler/type/TypeAnalyzer.java (left): http://codereview.chromium.org/8276014/diff/3001/compiler/java/com/google/dart/compiler/type/TypeAnalyzer.java#oldcode636 compiler/java/com/google/dart/compiler/type/TypeAnalyzer.java:636: checkAssignable(conditionNode, boolType, condition); On 2011/10/13 21:03:01, jat wrote: > ...
9 years, 2 months ago (2011-10-13 21:35:43 UTC) #7
John Lenz
http://codereview.chromium.org/8276014/diff/3001/tests/language/src/AssertionTest.dart File tests/language/src/AssertionTest.dart (right): http://codereview.chromium.org/8276014/diff/3001/tests/language/src/AssertionTest.dart#newcode8 tests/language/src/AssertionTest.dart:8: class AssertionTest { On 2011/10/13 21:35:43, John Lenz wrote: ...
9 years, 2 months ago (2011-10-13 21:51:08 UTC) #8
ahe
LGTM http://codereview.chromium.org/8276014/diff/3001/tests/language/src/AssertionTest.dart File tests/language/src/AssertionTest.dart (right): http://codereview.chromium.org/8276014/diff/3001/tests/language/src/AssertionTest.dart#newcode8 tests/language/src/AssertionTest.dart:8: class AssertionTest { On 2011/10/13 21:35:43, John Lenz ...
9 years, 2 months ago (2011-10-14 10:45:40 UTC) #9
jat
http://codereview.chromium.org/8276014/diff/3003/tests/language/src/AssertionTest.dart File tests/language/src/AssertionTest.dart (right): http://codereview.chromium.org/8276014/diff/3003/tests/language/src/AssertionTest.dart#newcode4 tests/language/src/AssertionTest.dart:4: // VMOptions=--enable_type_checks On 2011/10/14 10:45:40, ahe wrote: > I ...
9 years, 2 months ago (2011-10-14 14:46:53 UTC) #10
John Lenz
http://codereview.chromium.org/8276014/diff/3001/tests/language/src/AssertionTest.dart File tests/language/src/AssertionTest.dart (right): http://codereview.chromium.org/8276014/diff/3001/tests/language/src/AssertionTest.dart#newcode8 tests/language/src/AssertionTest.dart:8: class AssertionTest { On 2011/10/14 10:45:40, ahe wrote: > ...
9 years, 2 months ago (2011-10-14 19:27:03 UTC) #11
regis
LBTM Please revert this change breaking the vm build and see the comment below. Thanks ...
9 years, 2 months ago (2011-10-14 20:40:28 UTC) #12
jat
http://codereview.chromium.org/8276014/diff/3003/tests/language/src/AssertionTest.dart File tests/language/src/AssertionTest.dart (left): http://codereview.chromium.org/8276014/diff/3003/tests/language/src/AssertionTest.dart#oldcode23 tests/language/src/AssertionTest.dart:23: Expect.equals(14, error.column); On 2011/10/14 20:40:28, regis wrote: > John, ...
9 years, 2 months ago (2011-10-14 20:44:46 UTC) #13
regis
9 years, 2 months ago (2011-10-14 21:04:41 UTC) #14
http://codereview.chromium.org/8276014/diff/3003/tests/language/src/Assertion...
File tests/language/src/AssertionTest.dart (left):

http://codereview.chromium.org/8276014/diff/3003/tests/language/src/Assertion...
tests/language/src/AssertionTest.dart:23: Expect.equals(14, error.column);
On 2011/10/14 20:44:46, jat wrote:
> On 2011/10/14 20:40:28, regis wrote:
> > John, please do not remove valid testing of the vm functionality. It is fine
> to
> > rename the class, but move this test to the vm tree and add your new test
> here.
> 
> The test does not match the spec, so it seems reasonable to make the test
match
> the spec and mark the test as failing on the VM until the VM's behavior
matches
> the spec.
> 
> Also, there are tests like this where the VM is adding additional information
> not in the spec, such as fields on exceptions, and in some cases that means we
> cannot have a single test that works on both DartC and the VM.  In such cases,
I
> suggest that the base test be shared, which would not check
> implementation-specific fields, and then there would be
implementation-specific
> tests which are much smaller and only check those implementation details.
> 
> I do not understand the point of keeping tests which encode non-compliant
> behavior, as you seem to be suggesting.

We are in agreement. I am not against renaming the class AssertError to
AssertionError to match the spec, or to remove the vm specific part from the
test in the language directory. However, the vm specific test should be
preserved by moving it (after renaming the class) to the vm test directory.

But I am against renaming the class in the test only and not renaming the
corresponding class in the core lib implementation of the vm, thereby breaking
the vm build. At least, the renamed test should be disabled for the vm and a bug
should be filed against the vm.

Powered by Google App Engine
This is Rietveld 408576698