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

Side by Side Diff: pkg/dev_compiler/tool/input_sdk/private/js_array.dart

Issue 2926613003: Generate better code for '=='. (Closed)
Patch Set: Address comments Created 3 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 part of dart._interceptors; 5 part of dart._interceptors;
6 6
7 /** 7 /**
8 * The interceptor class for [List]. The compiler recognizes this 8 * The interceptor class for [List]. The compiler recognizes this
9 * class as an interceptor, and changes references to [:this:] to 9 * class as an interceptor, and changes references to [:this:] to
10 * actually use the receiver of the method, which is generated as an extra 10 * actually use the receiver of the method, which is generated as an extra
(...skipping 523 matching lines...) Expand 10 before | Expand all | Expand 10 after
534 if (!growable) markFixedList(list); 534 if (!growable) markFixedList(list);
535 return new JSArray<E>.typed(list); 535 return new JSArray<E>.typed(list);
536 } 536 }
537 537
538 Set<E> toSet() => new Set<E>.from(this); 538 Set<E> toSet() => new Set<E>.from(this);
539 539
540 Iterator<E> get iterator => new ArrayIterator<E>(this); 540 Iterator<E> get iterator => new ArrayIterator<E>(this);
541 541
542 int get hashCode => Primitives.objectHashCode(this); 542 int get hashCode => Primitives.objectHashCode(this);
543 543
544 bool operator ==(other) => identical(this, other);
545
544 int get length => JS('int', r'#.length', this); 546 int get length => JS('int', r'#.length', this);
545 547
546 void set length(int newLength) { 548 void set length(int newLength) {
547 checkGrowable('set length'); 549 checkGrowable('set length');
548 if (newLength is! int) { 550 if (newLength is! int) {
549 throw new ArgumentError.value(newLength, 'newLength'); 551 throw new ArgumentError.value(newLength, 'newLength');
550 } 552 }
551 // TODO(sra): Remove this test and let JavaScript throw an error. 553 // TODO(sra): Remove this test and let JavaScript throw an error.
552 if (newLength < 0) { 554 if (newLength < 0) {
553 throw new RangeError.range(newLength, 0, null, 'newLength'); 555 throw new RangeError.range(newLength, 0, null, 'newLength');
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
628 630
629 if (_index >= length) { 631 if (_index >= length) {
630 _current = null; 632 _current = null;
631 return false; 633 return false;
632 } 634 }
633 _current = _iterable[_index]; 635 _current = _iterable[_index];
634 _index++; 636 _index++;
635 return true; 637 return true;
636 } 638 }
637 } 639 }
OLDNEW
« no previous file with comments | « pkg/dev_compiler/tool/input_sdk/private/ddc_runtime/operations.dart ('k') | tests/lib_strong/html/debugger_test_golden.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698