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

Issue 10917290: DartType equals converted to operator == and tested. (Closed)

Created:
8 years, 3 months ago by Johnni Winther
Modified:
8 years, 3 months ago
Reviewers:
karlklose, ahe, Roman
CC:
reviews_dartlang.org, ahe, ngeoffray, Lasse Reichstein Nielsen, floitsch, kasperl
Visibility:
Public.

Description

DartType equals converted to operator == and tested. equals method replaced by operator == in version 0.11. DartType and Link equals updated accordingly test added. TEST=tests/compiler/dart2js/type_equals_test.dart Committed: https://code.google.com/p/dart/source/detail?r=12473

Patch Set 1 #

Total comments: 20

Patch Set 2 : Updated cf. comments. #

Patch Set 3 : Rebased #

Unified diffs Side-by-side diffs Delta from patch set Stats (+132 lines, -12 lines) Patch
M lib/compiler/implementation/typechecker.dart View 1 7 chunks +11 lines, -9 lines 0 comments Download
M lib/compiler/implementation/util/link.dart View 1 chunk +1 line, -1 line 0 comments Download
M lib/compiler/implementation/util/link_implementation.dart View 2 chunks +2 lines, -2 lines 0 comments Download
A tests/compiler/dart2js/type_equals_test.dart View 1 1 chunk +118 lines, -0 lines 0 comments Download

Messages

Total messages: 5 (0 generated)
Johnni Winther
8 years, 3 months ago (2012-09-16 22:15:38 UTC) #1
ahe
LGTM, but I'm a little concerned about the test. https://codereview.chromium.org/10917290/diff/1/lib/compiler/implementation/typechecker.dart File lib/compiler/implementation/typechecker.dart (right): https://codereview.chromium.org/10917290/diff/1/lib/compiler/implementation/typechecker.dart#newcode60 lib/compiler/implementation/typechecker.dart:60: ...
8 years, 3 months ago (2012-09-17 08:19:58 UTC) #2
karlklose
LGTM, thanks Johnni.
8 years, 3 months ago (2012-09-17 10:28:36 UTC) #3
Roman
lgtm I almost started fixing the same thing today as I stepped on consequences of ...
8 years, 3 months ago (2012-09-17 16:53:36 UTC) #4
Johnni Winther
8 years, 3 months ago (2012-09-18 08:14:30 UTC) #5
https://codereview.chromium.org/10917290/diff/1/lib/compiler/implementation/t...
File lib/compiler/implementation/typechecker.dart (right):

https://codereview.chromium.org/10917290/diff/1/lib/compiler/implementation/t...
lib/compiler/implementation/typechecker.dart:60: return other.element ==
element;
On 2012/09/17 08:19:58, ahe wrote:
> ===

Done.

https://codereview.chromium.org/10917290/diff/1/lib/compiler/implementation/t...
lib/compiler/implementation/typechecker.dart:147: if (element != other.element)
return false;
On 2012/09/17 08:19:58, ahe wrote:
> !==

Done.

https://codereview.chromium.org/10917290/diff/1/lib/compiler/implementation/t...
lib/compiler/implementation/typechecker.dart:235: if (element != other.element)
return false;
On 2012/09/17 08:19:58, ahe wrote:
> !==

Done.

https://codereview.chromium.org/10917290/diff/1/tests/compiler/dart2js/type_e...
File tests/compiler/dart2js/type_equals_test.dart (right):

https://codereview.chromium.org/10917290/diff/1/tests/compiler/dart2js/type_e...
tests/compiler/dart2js/type_equals_test.dart:13: Compiler compile(String script)
{
On 2012/09/17 08:19:58, ahe wrote:
> You'd probably be better off using compilerFor in compiler_helper.dart.

Done.

https://codereview.chromium.org/10917290/diff/1/tests/compiler/dart2js/type_e...
tests/compiler/dart2js/type_equals_test.dart:19: bool test(compiler, String
name1, String name2, [bool expect]) {
On 2012/09/17 08:19:58, ahe wrote:
> Should use {}, not [].
> 
> Since the argument is required, I think you should start the method saying
> something like:
> 
> Expect.isTrue(?expect, 'required parameter "expect" not given');

Done.

https://codereview.chromium.org/10917290/diff/1/tests/compiler/dart2js/type_e...
tests/compiler/dart2js/type_equals_test.dart:20: var clazz =
On 2012/09/17 08:19:58, ahe wrote:
> You can use the word "class".

The VM complains.

https://codereview.chromium.org/10917290/diff/1/tests/compiler/dart2js/type_e...
tests/compiler/dart2js/type_equals_test.dart:27: Expect.isTrue(element1 is
FunctionElement);
On 2012/09/17 08:19:58, ahe wrote:
> Test the kind instead, it is more precise.
> 
> Also, the is-check wouldn't be necessary if you declared element1 and element2
> to have type FuncionType.

Done.

https://codereview.chromium.org/10917290/diff/1/tests/compiler/dart2js/type_e...
tests/compiler/dart2js/type_equals_test.dart:29: var signature1 =
element1.computeSignature(compiler);
On 2012/09/17 08:19:58, ahe wrote:
> Use a type here for improved readability.

Done.

https://codereview.chromium.org/10917290/diff/1/tests/compiler/dart2js/type_e...
tests/compiler/dart2js/type_equals_test.dart:32: var value1;
On 2012/09/17 08:19:58, ahe wrote:
> A type here would also improve. Especially since the names "value1" and
"value2"
> convey no information other than these variables hold values, not types.

Done.

https://codereview.chromium.org/10917290/diff/1/tests/compiler/dart2js/type_e...
tests/compiler/dart2js/type_equals_test.dart:48: }
On 2012/09/17 08:19:58, ahe wrote:
> I find this test confusing. It seems like you don't test all arguments.

Comments added as to why function signatures are used.

Powered by Google App Engine
This is Rietveld 408576698