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

Issue 11361190: a === b -> identical(a, b) (Closed)

Created:
8 years, 1 month ago by floitsch
Modified:
8 years, 1 month ago
CC:
reviews_dartlang.org, Lasse Reichstein Nielsen
Visibility:
Public.

Description

a === b -> identical(a, b) Replace === null with == null. BUG=http://dartbug.com/6380 Committed: https://code.google.com/p/dart/source/detail?r=14794

Patch Set 1 #

Patch Set 2 : 80chars. #

Total comments: 66

Patch Set 3 : Rebase #

Patch Set 4 : Address comments. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+927 lines, -953 lines) Patch
M compiler/javatests/com/google/dart/compiler/parser/StringBuffer.dart View 1 chunk +1 line, -1 line 0 comments Download
M editor/tools/plugins/com.google.dart.tools.core_test/src/com/google/dart/tools/core/internal/model/testsource/FunctionTest.dart View 1 2 3 1 chunk +0 lines, -1 line 0 comments Download
M pkg/logging/test/logging_test.dart View 2 chunks +5 lines, -5 lines 0 comments Download
M pkg/unittest/lib/mock.dart View 1 2 2 chunks +11 lines, -11 lines 0 comments Download
M pkg/unittest/lib/src/core_matchers.dart View 1 chunk +1 line, -1 line 0 comments Download
M pkg/unittest/lib/unittest.dart View 1 chunk +1 line, -1 line 0 comments Download
M runtime/bin/builtin.dart View 1 chunk +1 line, -1 line 0 comments Download
M runtime/bin/eventhandler_patch.dart View 2 chunks +2 lines, -2 lines 0 comments Download
M runtime/bin/process_patch.dart View 4 chunks +6 lines, -6 lines 0 comments Download
M runtime/bin/socket_patch.dart View 6 chunks +11 lines, -11 lines 0 comments Download
M runtime/lib/array.dart View 4 chunks +4 lines, -4 lines 0 comments Download
M runtime/lib/array_patch.dart View 1 chunk +1 line, -1 line 0 comments Download
M runtime/lib/byte_array.dart View 17 chunks +17 lines, -17 lines 0 comments Download
M runtime/lib/date_patch.dart View 1 chunk +2 lines, -2 lines 0 comments Download
M runtime/lib/double.dart View 2 chunks +2 lines, -2 lines 0 comments Download
M runtime/lib/expando_patch.dart View 3 chunks +6 lines, -6 lines 0 comments Download
M runtime/lib/growable_array.dart View 2 chunks +2 lines, -2 lines 0 comments Download
M runtime/lib/immutable_map.dart View 1 chunk +1 line, -1 line 0 comments Download
M runtime/lib/isolate_patch.dart View 4 chunks +6 lines, -6 lines 0 comments Download
M runtime/lib/regexp_patch.dart View 2 chunks +3 lines, -3 lines 0 comments Download
M runtime/lib/string_base.dart View 1 2 10 chunks +10 lines, -10 lines 0 comments Download
M runtime/tests/vm/dart/isolate_mirror_local_test.dart View 2 chunks +2 lines, -2 lines 0 comments Download
M runtime/vm/snapshot_test.dart View 7 chunks +15 lines, -15 lines 0 comments Download
M samples/swarm/App.dart View 2 chunks +2 lines, -2 lines 0 comments Download
M samples/swarm/BiIterator.dart View 1 chunk +1 line, -1 line 0 comments Download
M samples/swarm/DataSource.dart View 1 chunk +1 line, -1 line 0 comments Download
M samples/swarm/swarm_ui_lib/base/AnimationScheduler.dart View 2 chunks +4 lines, -4 lines 0 comments Download
M samples/swarm/swarm_ui_lib/base/Size.dart View 1 chunk +1 line, -1 line 0 comments Download
M samples/swarm/swarm_ui_lib/observable/observable.dart View 1 2 3 2 chunks +2 lines, -5 lines 0 comments Download
M samples/swarm/swarm_ui_lib/touch/ClickBuster.dart View 1 chunk +1 line, -1 line 0 comments Download
M samples/swarm/swarm_ui_lib/touch/FxUtil.dart View 1 chunk +4 lines, -4 lines 0 comments Download
M samples/swarm/swarm_ui_lib/touch/Geometry.dart View 2 chunks +2 lines, -2 lines 0 comments Download
M samples/swarm/swarm_ui_lib/touch/Momentum.dart View 8 chunks +12 lines, -12 lines 0 comments Download
M samples/swarm/swarm_ui_lib/touch/Scroller.dart View 7 chunks +11 lines, -11 lines 0 comments Download
M samples/swarm/swarm_ui_lib/touch/TouchHandler.dart View 5 chunks +5 lines, -7 lines 0 comments Download
M samples/swarm/swarm_ui_lib/util/StringUtils.dart View 1 chunk +1 line, -1 line 0 comments Download
M samples/swarm/swarm_ui_lib/util/Uri.dart View 1 chunk +1 line, -1 line 0 comments Download
M samples/swarm/swarm_ui_lib/view/CompositeView.dart View 3 chunks +3 lines, -3 lines 0 comments Download
M samples/swarm/swarm_ui_lib/view/MeasureText.dart View 6 chunks +7 lines, -7 lines 0 comments Download
M samples/swarm/swarm_ui_lib/view/view.dart View 3 chunks +3 lines, -3 lines 0 comments Download
M samples/third_party/dromaeo/Suites.dart View 1 2 3 2 chunks +2 lines, -2 lines 0 comments Download
M samples/third_party/dromaeo/common/JSON.dart View 6 chunks +9 lines, -9 lines 0 comments Download
M samples/third_party/dromaeo/tests/dom-traverse-html.dart View 4 chunks +4 lines, -4 lines 0 comments Download
M samples/third_party/dromaeo/tests/dom-traverse-htmlidiomatic.dart View 4 chunks +4 lines, -4 lines 0 comments Download
M sdk/lib/_internal/compiler/implementation/compile_time_constants.dart View 1 chunk +1 line, -1 line 0 comments Download
M sdk/lib/_internal/compiler/implementation/dart_backend/placeholder_collector.dart View 2 chunks +2 lines, -2 lines 0 comments Download
M sdk/lib/_internal/compiler/implementation/lib/interceptors.dart View 1 chunk +1 line, -1 line 0 comments Download
M sdk/lib/_internal/compiler/implementation/lib/regexp_helper.dart View 1 chunk +1 line, -1 line 0 comments Download
M sdk/lib/_internal/compiler/implementation/resolution/members.dart View 1 chunk +1 line, -1 line 0 comments Download
M sdk/lib/_internal/compiler/implementation/scanner/partial_parser.dart View 1 chunk +1 line, -1 line 0 comments Download
M sdk/lib/_internal/compiler/implementation/ssa/builder.dart View 1 2 3 2 chunks +3 lines, -3 lines 0 comments Download
M sdk/lib/_internal/compiler/implementation/ssa/validate.dart View 1 chunk +1 line, -1 line 0 comments Download
M sdk/lib/_internal/compiler/implementation/types/concrete_types_inferrer.dart View 1 chunk +1 line, -1 line 0 comments Download
M sdk/lib/collection/arrays.dart View 2 chunks +4 lines, -4 lines 0 comments Download
M sdk/lib/collection/splay_tree.dart View 8 chunks +18 lines, -18 lines 0 comments Download
M sdk/lib/core/date.dart View 3 chunks +6 lines, -6 lines 0 comments Download
M sdk/lib/core/errors.dart View 2 chunks +2 lines, -2 lines 0 comments Download
M sdk/lib/core/expect.dart View 9 chunks +11 lines, -9 lines 0 comments Download
M sdk/lib/core/map.dart View 1 2 3 8 chunks +11 lines, -10 lines 0 comments Download
M sdk/lib/core/options.dart View 1 chunk +1 line, -1 line 0 comments Download
M sdk/lib/core/queue.dart View 8 chunks +8 lines, -8 lines 0 comments Download
M sdk/lib/core/set.dart View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M sdk/lib/core/stopwatch.dart View 3 chunks +7 lines, -7 lines 0 comments Download
M sdk/lib/core/string_buffer.dart View 1 2 3 chunks +4 lines, -4 lines 0 comments Download
M sdk/lib/crypto/crypto_utils.dart View 1 chunk +1 line, -1 line 0 comments Download
M sdk/lib/io/chunked_stream.dart View 6 chunks +7 lines, -7 lines 0 comments Download
M sdk/lib/io/file_impl.dart View 1 chunk +2 lines, -2 lines 0 comments Download
M sdk/lib/io/http_impl.dart View 1 chunk +1 line, -1 line 0 comments Download
M sdk/lib/io/http_utils.dart View 3 chunks +8 lines, -8 lines 0 comments Download
M sdk/lib/io/list_stream_impl.dart View 1 chunk +1 line, -1 line 0 comments Download
M sdk/lib/io/socket_stream_impl.dart View 2 chunks +2 lines, -2 lines 0 comments Download
M sdk/lib/io/stream_util.dart View 8 chunks +8 lines, -8 lines 0 comments Download
M sdk/lib/io/string_stream.dart View 5 chunks +9 lines, -9 lines 0 comments Download
M sdk/lib/io/timer_impl.dart View 6 chunks +10 lines, -10 lines 0 comments Download
M sdk/lib/io/websocket_impl.dart View 22 chunks +32 lines, -32 lines 0 comments Download
M sdk/lib/mirrors/mirrors.dart View 1 chunk +1 line, -1 line 0 comments Download
M tests/compiler/dart2js/begin_end_token_test.dart View 1 chunk +1 line, -1 line 0 comments Download
M tests/compiler/dart2js/compiler_helper.dart View 1 chunk +1 line, -1 line 0 comments Download
M tests/compiler/dart2js/compiler_test.dart View 1 chunk +2 lines, -2 lines 0 comments Download
M tests/compiler/dart2js/dart2js.status View 1 2 1 chunk +1 line, -0 lines 0 comments Download
M tests/compiler/dart2js/dart_backend_test.dart View 1 2 2 chunks +2 lines, -2 lines 0 comments Download
M tests/compiler/dart2js/identity_test.dart View 1 2 1 chunk +1 line, -1 line 0 comments Download
M tests/compiler/dart2js/metadata_test.dart View 1 2 3 2 chunks +4 lines, -2 lines 0 comments Download
M tests/compiler/dart2js/mock_compiler.dart View 1 2 3 3 chunks +3 lines, -3 lines 0 comments Download
M tests/compiler/dart2js/resolver_test.dart View 1 2 3 3 chunks +4 lines, -4 lines 0 comments Download
M tests/compiler/dart2js/scanner_test.dart View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M tests/compiler/dart2js/type_checker_test.dart View 3 chunks +3 lines, -3 lines 0 comments Download
M tests/compiler/dart2js/type_equals_test.dart View 1 2 3 1 chunk +2 lines, -2 lines 0 comments Download
M tests/compiler/dart2js/uri_extras_test.dart View 1 chunk +1 line, -1 line 0 comments Download
M tests/compiler/dart2js_extra/bailout_on_break_test.dart View 8 chunks +11 lines, -11 lines 0 comments Download
M tests/compiler/dart2js_extra/bailout_on_continue_test.dart View 6 chunks +7 lines, -7 lines 0 comments Download
M tests/compiler/dart2js_extra/literal_string_juxtaposition_test.dart View 4 chunks +15 lines, -15 lines 0 comments Download
M tests/compiler/dart2js_extra/nan_negate_test.dart View 4 chunks +16 lines, -16 lines 0 comments Download
M tests/compiler/dart2js_extra/no_such_method_test.dart View 1 chunk +6 lines, -6 lines 0 comments Download
M tests/corelib/expando_test.dart View 1 chunk +1 line, -1 line 0 comments Download
M tests/corelib/queue_test.dart View 1 chunk +1 line, -1 line 0 comments Download
M tests/corelib/set_iterator_test.dart View 1 chunk +1 line, -1 line 0 comments Download
M tests/html/hidden_dom_1_test.dart View 1 chunk +1 line, -1 line 0 comments Download
M tests/html/utils.dart View 1 chunk +2 lines, -2 lines 0 comments Download
M tests/isolate/mandel_isolate_test.dart View 1 chunk +1 line, -1 line 0 comments Download
M tests/isolate/serialization_test.dart View 1 2 3 1 chunk +4 lines, -4 lines 0 comments Download
M tests/language/bool_test.dart View 1 2 3 5 chunks +40 lines, -40 lines 0 comments Download
M tests/language/canonical_const2_test.dart View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M tests/language/canonical_const_test.dart View 1 2 3 1 chunk +18 lines, -18 lines 0 comments Download
M tests/language/class_literal_test.dart View 1 chunk +2 lines, -2 lines 0 comments Download
M tests/language/comparison_test.dart View 1 2 3 2 chunks +259 lines, -259 lines 0 comments Download
M tests/language/compile_time_constant9_test.dart View 1 chunk +1 line, -1 line 0 comments Download
M tests/language/compile_time_constant_a_test.dart View 1 2 3 2 chunks +3 lines, -3 lines 0 comments Download
M tests/language/const_locals_test.dart View 1 2 3 1 chunk +3 lines, -3 lines 0 comments Download
M tests/language/const_nested_test.dart View 1 chunk +3 lines, -3 lines 0 comments Download
M tests/language/const_string_test.dart View 1 chunk +21 lines, -21 lines 0 comments Download
M tests/language/constant_fold_equals_test.dart View 1 chunk +2 lines, -2 lines 0 comments Download
M tests/language/ct_const2_test.dart View 1 chunk +2 lines, -2 lines 0 comments Download
M tests/language/ct_const_test.dart View 2 chunks +12 lines, -12 lines 0 comments Download
M tests/language/field_optimization3_test.dart View 1 chunk +1 line, -1 line 0 comments Download
M tests/language/finally_test.dart View 1 chunk +1 line, -1 line 0 comments Download
M tests/language/first_class_types_literals_test.dart View 1 2 3 1 chunk +1 line, -7 lines 0 comments Download
M tests/language/first_class_types_test.dart View 1 2 3 1 chunk +2 lines, -4 lines 0 comments Download
M tests/language/function_syntax_test.dart View 1 chunk +2 lines, -2 lines 0 comments Download
M tests/language/function_type_alias_test.dart View 1 chunk +1 line, -1 line 0 comments Download
M tests/language/if_and_test.dart View 1 chunk +1 line, -1 line 0 comments Download
M tests/language/list_literal3_test.dart View 1 2 3 1 chunk +15 lines, -33 lines 0 comments Download
M tests/language/ordered_maps_test.dart View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M tests/language/reg_exp2_test.dart View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M tests/language/rethrow_test.dart View 3 chunks +4 lines, -4 lines 0 comments Download
M tests/language/scope_variable_test.dart View 2 chunks +3 lines, -3 lines 0 comments Download
M tests/language/static_const_field_test.dart View 1 chunk +6 lines, -6 lines 0 comments Download
M tests/language/strict_equal_test.dart View 5 chunks +20 lines, -20 lines 0 comments Download
M tests/standalone/io/echo_server_stream_test.dart View 1 chunk +1 line, -1 line 0 comments Download
M tests/standalone/io/echo_server_test.dart View 1 chunk +1 line, -1 line 0 comments Download
M tests/standalone/io/http_server_socket_test.dart View 1 chunk +1 line, -1 line 0 comments Download
M tests/standalone/io/process_stderr_test.dart View 1 chunk +1 line, -1 line 0 comments Download
M tests/standalone/io/process_stdout_test.dart View 1 chunk +1 line, -1 line 0 comments Download
M tests/standalone/io/socket_close_test.dart View 2 chunks +2 lines, -2 lines 0 comments Download
M tests/standalone/io/socket_exception_test.dart View 3 chunks +5 lines, -5 lines 0 comments Download
M tests/standalone/io/socket_many_connections_test.dart View 1 chunk +1 line, -1 line 0 comments Download
M tests/standalone/io/socket_stream_close_test.dart View 2 chunks +2 lines, -2 lines 0 comments Download
M tests/standalone/io/stream_pipe_test.dart View 1 chunk +1 line, -1 line 0 comments Download
M tests/standalone/io/testing_server.dart View 1 chunk +1 line, -1 line 0 comments Download
M tests/standalone/io/web_socket_test.dart View 4 chunks +6 lines, -6 lines 0 comments Download
M tests/utils/dummy_compiler_test.dart View 2 chunks +2 lines, -2 lines 0 comments Download
M tests/utils/utf8_test.dart View 1 chunk +1 line, -1 line 0 comments Download
M tools/testing/dart/drt_updater.dart View 2 chunks +3 lines, -3 lines 0 comments Download
M tools/testing/dart/test_options.dart View 1 2 1 chunk +1 line, -1 line 0 comments Download
M tools/testing/dart/test_runner.dart View 1 2 1 chunk +1 line, -1 line 0 comments Download
M tools/testing/legpad/legpad.dart View 4 chunks +4 lines, -4 lines 0 comments Download
M utils/apidoc/apidoc.dart View 1 chunk +3 lines, -3 lines 0 comments Download
M utils/apidoc/html_diff.dart View 1 chunk +1 line, -1 line 0 comments Download
M utils/css/parser.dart View 2 chunks +2 lines, -2 lines 0 comments Download
M utils/css/tokenizer_base.dart View 2 chunks +2 lines, -2 lines 0 comments Download
M utils/peg/pegparser.dart View 1 chunk +1 line, -1 line 0 comments Download
M utils/pub/yaml/deep_equals.dart View 2 chunks +3 lines, -3 lines 0 comments Download
M utils/pub/yaml/yaml_map.dart View 1 chunk +1 line, -1 line 0 comments Download
M utils/template/parser.dart View 2 chunks +2 lines, -2 lines 0 comments Download
M utils/template/tokenizer_base.dart View 2 chunks +2 lines, -2 lines 0 comments Download

Messages

Total messages: 6 (0 generated)
floitsch
8 years, 1 month ago (2012-11-09 19:46:22 UTC) #1
danrubel
the editor and analyzer changes plus a spot check of other files.... lgtm
8 years, 1 month ago (2012-11-09 19:53:20 UTC) #2
Lasse Reichstein Nielsen
LGTM if you update at least the test lines you touch: Expect.equals(true, ...) => Expect.isTrue(...) ...
8 years, 1 month ago (2012-11-12 13:10:41 UTC) #3
Ivan Posva
How does this differ from the CL which we had earlier about this? -Ivan
8 years, 1 month ago (2012-11-12 15:46:54 UTC) #4
floitsch
On 2012/11/12 15:46:54, Ivan Posva wrote: > How does this differ from the CL which ...
8 years, 1 month ago (2012-11-12 15:57:53 UTC) #5
floitsch
8 years, 1 month ago (2012-11-12 22:18:43 UTC) #6
https://codereview.chromium.org/11361190/diff/2001/editor/tools/plugins/com.g...
File
editor/tools/plugins/com.google.dart.tools.core_test/src/com/google/dart/tools/core/internal/model/testsource/FunctionTest.dart
(left):

https://codereview.chromium.org/11361190/diff/2001/editor/tools/plugins/com.g...
editor/tools/plugins/com.google.dart.tools.core_test/src/com/google/dart/tools/core/internal/model/testsource/FunctionTest.dart:310:
// FAILS: (function(a = 10) { assert(a === null); })( f() );
On 2012/11/12 13:10:41, Lasse Reichstein Nielsen wrote:
> Commented code, just remove it.
> What is this syntax? It looks like ECMAScript 6.
> It won't work in checked mode, since 'function' is not a valid return type. It
> has rest arguments in the test above?
> 
> Does it even work? Where is "a" declared?

Done.

https://codereview.chromium.org/11361190/diff/2001/samples/swarm/BiIterator.dart
File samples/swarm/BiIterator.dart (right):

https://codereview.chromium.org/11361190/diff/2001/samples/swarm/BiIterator.d...
samples/swarm/BiIterator.dart:61: if (identical(list[i], val)) {
On 2012/11/12 13:10:41, Lasse Reichstein Nielsen wrote:
> Arguably this should never have been === to begin with.

Maybe, but I don't know if they depend on it. Keeping as is.

https://codereview.chromium.org/11361190/diff/2001/samples/swarm/swarm_ui_lib...
File samples/swarm/swarm_ui_lib/observable/observable.dart (right):

https://codereview.chromium.org/11361190/diff/2001/samples/swarm/swarm_ui_lib...
samples/swarm/swarm_ui_lib/observable/observable.dart:290: //             
equality check should be done?
On 2012/11/12 13:10:41, Lasse Reichstein Nielsen wrote:
> Remove comment. Using identical seems the right thing to do here.

Done.

https://codereview.chromium.org/11361190/diff/2001/samples/swarm/swarm_ui_lib...
File samples/swarm/swarm_ui_lib/touch/TouchHandler.dart (right):

https://codereview.chromium.org/11361190/diff/2001/samples/swarm/swarm_ui_lib...
samples/swarm/swarm_ui_lib/touch/TouchHandler.dart:373: static bool _xor(bool a,
bool b) => a != b;
On 2012/11/12 13:10:41, Lasse Reichstein Nielsen wrote:
> Are we sure this isn't an attempt to do boolify on incoming non-bool values in
> unchecked mode?
> If we are, then consider just inlining this.

Afaics the only use is in line 366. Not inlining, since "xor" may reflect better
the purpose.

https://codereview.chromium.org/11361190/diff/2001/samples/third_party/dromae...
File samples/third_party/dromaeo/Suites.dart (right):

https://codereview.chromium.org/11361190/diff/2001/samples/third_party/dromae...
samples/third_party/dromaeo/Suites.dart:95: if (null != _SUITE_DESCRIPTIONS) {
On 2012/11/12 13:10:41, Lasse Reichstein Nielsen wrote:
> Swap operands, this is unreadable.

Done.

https://codereview.chromium.org/11361190/diff/2001/samples/third_party/dromae...
samples/third_party/dromaeo/Suites.dart:116: final name = null == variant
On 2012/11/12 13:10:41, Lasse Reichstein Nielsen wrote:
> ditto here. And parenthesize the comparison.

Done.

https://codereview.chromium.org/11361190/diff/2001/sdk/lib/_internal/compiler...
File sdk/lib/_internal/compiler/implementation/js_backend/native_emitter.dart
(right):

https://codereview.chromium.org/11361190/diff/2001/sdk/lib/_internal/compiler...
sdk/lib/_internal/compiler/implementation/js_backend/native_emitter.dart:108: if
(method != '') {
On 2012/11/12 13:10:41, Lasse Reichstein Nielsen wrote:
> .isEmpty.
Actually inside a string (thus JavaScript code). Reverting this change.

https://codereview.chromium.org/11361190/diff/2001/sdk/lib/_internal/compiler...
File sdk/lib/_internal/compiler/implementation/ssa/builder.dart (right):

https://codereview.chromium.org/11361190/diff/2001/sdk/lib/_internal/compiler...
sdk/lib/_internal/compiler/implementation/ssa/builder.dart:1463: // foo([a = 42)
{
On 2012/11/12 13:10:41, Lasse Reichstein Nielsen wrote:
> missing ']'.

Done.

https://codereview.chromium.org/11361190/diff/2001/sdk/lib/core/map.dart
File sdk/lib/core/map.dart (right):

https://codereview.chromium.org/11361190/diff/2001/sdk/lib/core/map.dart#newc...
sdk/lib/core/map.dart:212: (identical(_DELETED_KEY, existingKey))) {
On 2012/11/12 13:10:41, Lasse Reichstein Nielsen wrote:
> Swap arguments.

Done.

https://codereview.chromium.org/11361190/diff/2001/sdk/lib/core/set.dart
File sdk/lib/core/set.dart (right):

https://codereview.chromium.org/11361190/diff/2001/sdk/lib/core/set.dart#newc...
sdk/lib/core/set.dart:237: } while ((entry == null) || (entry === deletedKey));
On 2012/11/12 13:10:41, Lasse Reichstein Nielsen wrote:
> Convert other === too, to identical.

Done.

https://codereview.chromium.org/11361190/diff/2001/tests/compiler/dart2js/dar...
File tests/compiler/dart2js/dart2js.status (right):

https://codereview.chromium.org/11361190/diff/2001/tests/compiler/dart2js/dar...
tests/compiler/dart2js/dart2js.status:5: identity_test: Fail # Issue 6638
On 2012/11/12 13:10:41, Lasse Reichstein Nielsen wrote:
> Wut?
> Just remove the test. It's useless anyway.

It tests if we optimize the identity function. As discussed, keeping it.

https://codereview.chromium.org/11361190/diff/2001/tests/compiler/dart2js/met...
File tests/compiler/dart2js/metadata_test.dart (right):

https://codereview.chromium.org/11361190/diff/2001/tests/compiler/dart2js/met...
tests/compiler/dart2js/metadata_test.dart:47:
Expect.isTrue(!identical(annotation1, annotation2), 'expected unique
instances');
On 2012/11/12 13:10:41, Lasse Reichstein Nielsen wrote:
> isFalse and remove the '!'.
> And long line.

Done.

https://codereview.chromium.org/11361190/diff/2001/tests/compiler/dart2js/met...
tests/compiler/dart2js/metadata_test.dart:100:
Expect.isTrue(!identical(annotation1, annotation2), 'expected unique
instances');
On 2012/11/12 13:10:41, Lasse Reichstein Nielsen wrote:
> Ditto.

Done.

https://codereview.chromium.org/11361190/diff/2001/tests/compiler/dart2js/moc...
File tests/compiler/dart2js/mock_compiler.dart (right):

https://codereview.chromium.org/11361190/diff/2001/tests/compiler/dart2js/moc...
tests/compiler/dart2js/mock_compiler.dart:138: if (identical(kind,
api.Diagnostic.ERROR)) {
On 2012/11/12 13:10:41, Lasse Reichstein Nielsen wrote:
> Consider whether == would do, since Diagnostic probably don't override
> operator==.

Done.

https://codereview.chromium.org/11361190/diff/2001/tests/compiler/dart2js/res...
File tests/compiler/dart2js/resolver_test.dart (right):

https://codereview.chromium.org/11361190/diff/2001/tests/compiler/dart2js/res...
tests/compiler/dart2js/resolver_test.dart:160: Expect.isTrue(called != null);
On 2012/11/12 13:10:41, Lasse Reichstein Nielsen wrote:
> Expect.isNotNull(called);
> Ditto in other similar places.

Done.

https://codereview.chromium.org/11361190/diff/2001/tests/compiler/dart2js/sca...
File tests/compiler/dart2js/scanner_test.dart (right):

https://codereview.chromium.org/11361190/diff/2001/tests/compiler/dart2js/sca...
tests/compiler/dart2js/scanner_test.dart:14: bool isRunningOnJavaScript() => 1
== 1.0;
On 2012/11/12 13:10:41, Lasse Reichstein Nielsen wrote:
> This is true on the VM too, you really do need the 'identical' check.
argh.
done.

https://codereview.chromium.org/11361190/diff/2001/tests/compiler/dart2js/typ...
File tests/compiler/dart2js/type_equals_test.dart (right):

https://codereview.chromium.org/11361190/diff/2001/tests/compiler/dart2js/typ...
tests/compiler/dart2js/type_equals_test.dart:22:
Expect.isTrue(identical(element2.kind, ElementKind.FUNCTION));
On 2012/11/12 13:10:41, Lasse Reichstein Nielsen wrote:
> Again, consider using ==.

Done.

https://codereview.chromium.org/11361190/diff/2001/tests/isolate/serializatio...
File tests/isolate/serialization_test.dart (right):

https://codereview.chromium.org/11361190/diff/2001/tests/isolate/serializatio...
tests/isolate/serialization_test.dart:48: Expect.isTrue(identical(copied[0],
copied[2]));
On 2012/11/12 13:10:41, Lasse Reichstein Nielsen wrote:
> Expect.identical

Done.

https://codereview.chromium.org/11361190/diff/2001/tests/language/bool_test.dart
File tests/language/bool_test.dart (right):

https://codereview.chromium.org/11361190/diff/2001/tests/language/bool_test.d...
tests/language/bool_test.dart:12: Expect.equals(true, identical(true, true));
On 2012/11/12 13:10:41, Lasse Reichstein Nielsen wrote:
>  Expect.identical(true, true) 
> and
>  Expect.isFalse(identical(true, false))
> Consider adding Expect.notIdentical
> 
Changed to .isTrue / .isFalse.
Kept the identicals. We don't want to go through the Expect to do the identical
check. (This is one of the most basic tests).

https://codereview.chromium.org/11361190/diff/2001/tests/language/canonical_c...
File tests/language/canonical_const2_test.dart (right):

https://codereview.chromium.org/11361190/diff/2001/tests/language/canonical_c...
tests/language/canonical_const2_test.dart:8: Expect.isTrue(!identical(const
<num>[1,2], const <num>[1.0,2.0]));
On 2012/11/12 13:10:41, Lasse Reichstein Nielsen wrote:
> isFalse(identical

Done.

https://codereview.chromium.org/11361190/diff/2001/tests/language/canonical_c...
File tests/language/canonical_const_test.dart (right):

https://codereview.chromium.org/11361190/diff/2001/tests/language/canonical_c...
tests/language/canonical_const_test.dart:11: Expect.isTrue(identical(null,
null));
On 2012/11/12 13:10:41, Lasse Reichstein Nielsen wrote:
> Use
>  Expect.identical
> and 
>  Expect.isFalse(identical

Done.

https://codereview.chromium.org/11361190/diff/2001/tests/language/class_liter...
File tests/language/class_literal_test.dart (right):

https://codereview.chromium.org/11361190/diff/2001/tests/language/class_liter...
tests/language/class_literal_test.dart:34: Class == null; /// 20: compile-time
error
On 2012/11/12 13:10:41, Lasse Reichstein Nielsen wrote:
> This should not be a compile-time error any more.

Different CL.

https://codereview.chromium.org/11361190/diff/2001/tests/language/comparison_...
File tests/language/comparison_test.dart (right):

https://codereview.chromium.org/11361190/diff/2001/tests/language/comparison_...
tests/language/comparison_test.dart:301: Expect.equals(false, Helper.EQ(1,
"eeny"));
On 2012/11/12 13:10:41, Lasse Reichstein Nielsen wrote:
> Expect.isFalse

Done.

https://codereview.chromium.org/11361190/diff/2001/tests/language/compile_tim...
File tests/language/compile_time_constant_a_test.dart (right):

https://codereview.chromium.org/11361190/diff/2001/tests/language/compile_tim...
tests/language/compile_time_constant_a_test.dart:76:
Expect.isTrue(identical(m3['m1'], m1));
On 2012/11/12 13:10:41, Lasse Reichstein Nielsen wrote:
> Expect.identical

Done.

https://codereview.chromium.org/11361190/diff/2001/tests/language/const_local...
File tests/language/const_locals_test.dart (right):

https://codereview.chromium.org/11361190/diff/2001/tests/language/const_local...
tests/language/const_locals_test.dart:22: Expect.isTrue(identical(s, 'MIN = $MIN
 MAX = $MAX  MASK = $MASK'));
On 2012/11/12 13:10:41, Lasse Reichstein Nielsen wrote:
> Expect.identical

Done.

https://codereview.chromium.org/11361190/diff/2001/tests/language/ct_const2_t...
File tests/language/ct_const2_test.dart (right):

https://codereview.chromium.org/11361190/diff/2001/tests/language/ct_const2_t...
tests/language/ct_const2_test.dart:71: const BOP10 = INT_LIT == INT_LIT_REF;
On 2012/11/12 13:10:41, Lasse Reichstein Nielsen wrote:
> Use identical here too.
> It is a compile-time constant.
identical doesn't yet work on compile-time constants. Not sure if it supposed to
be.

https://codereview.chromium.org/11361190/diff/2001/tests/language/first_class...
File tests/language/first_class_types_literals_test.dart (right):

https://codereview.chromium.org/11361190/diff/2001/tests/language/first_class...
tests/language/first_class_types_literals_test.dart:18:
Expect.isFalse(identical(a.runtimeType, b.runtimeType));
On 2012/11/12 13:10:41, Lasse Reichstein Nielsen wrote:
> is differentType called at all?

No. removed.

https://codereview.chromium.org/11361190/diff/2001/tests/language/first_class...
File tests/language/first_class_types_test.dart (right):

https://codereview.chromium.org/11361190/diff/2001/tests/language/first_class...
tests/language/first_class_types_test.dart:8: Expect.identical(a.runtimeType,
b.runtimeType);
On 2012/11/12 13:10:41, Lasse Reichstein Nielsen wrote:
> That is not guaranteed. The runtimeType getter can give a new object each time
> it's invoked.

Done.

https://codereview.chromium.org/11361190/diff/2001/tests/language/first_class...
tests/language/first_class_types_test.dart:14:
Expect.isFalse(identical(a.runtimeType, b.runtimeType));
On 2012/11/12 13:10:41, Lasse Reichstein Nielsen wrote:
> Remove prints.

Done.

https://codereview.chromium.org/11361190/diff/2001/tests/language/list_litera...
File tests/language/list_literal3_test.dart (right):

https://codereview.chromium.org/11361190/diff/2001/tests/language/list_litera...
tests/language/list_literal3_test.dart:20: try {
On 2012/11/12 13:10:41, Lasse Reichstein Nielsen wrote:
> use: 
>  Expect.throws(()=>joke[0] = "sock", (e) => e is UnspoortedError);

Done.

https://codereview.chromium.org/11361190/diff/2001/tests/language/list_litera...
tests/language/list_literal3_test.dart:39: Expect.equals(true, identical(a[0],
a[1]));
On 2012/11/12 13:10:41, Lasse Reichstein Nielsen wrote:
> Expect.identical

Done.

https://codereview.chromium.org/11361190/diff/2001/tests/language/ordered_map...
File tests/language/ordered_maps_test.dart (right):

https://codereview.chromium.org/11361190/diff/2001/tests/language/ordered_map...
tests/language/ordered_maps_test.dart:14: Expect.equals(true, !identical(map1,
map2));
On 2012/11/12 13:10:41, Lasse Reichstein Nielsen wrote:
> isFalse.

Done.

https://codereview.chromium.org/11361190/diff/2001/tests/language/reg_exp2_te...
File tests/language/reg_exp2_test.dart (right):

https://codereview.chromium.org/11361190/diff/2001/tests/language/reg_exp2_te...
tests/language/reg_exp2_test.dart:26: Expect.equals(true, tag != null);
On 2012/11/12 13:10:41, Lasse Reichstein Nielsen wrote:
> isTrue
isNotNull
done.

Powered by Google App Engine
This is Rietveld 408576698