| OLD | NEW |
| 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 #library('dart:_interceptors'); | 5 #library('dart:_interceptors'); |
| 6 | 6 |
| 7 #import('dart:coreimpl'); | 7 #import('dart:coreimpl'); |
| 8 | 8 |
| 9 add$1(var receiver, var value) { | 9 add$1(var receiver, var value) { |
| 10 if (isJsArray(receiver)) { | 10 if (isJsArray(receiver)) { |
| (...skipping 346 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 357 return Collections.every(receiver, f); | 357 return Collections.every(receiver, f); |
| 358 } | 358 } |
| 359 } | 359 } |
| 360 | 360 |
| 361 // TODO(ngeoffray): Make it possible to have just one "sort" function ends | 361 // TODO(ngeoffray): Make it possible to have just one "sort" function ends |
| 362 // an optional parameter. | 362 // an optional parameter. |
| 363 | 363 |
| 364 sort$0(receiver) { | 364 sort$0(receiver) { |
| 365 if (!isJsArray(receiver)) return UNINTERCEPTED(receiver.sort()); | 365 if (!isJsArray(receiver)) return UNINTERCEPTED(receiver.sort()); |
| 366 checkMutable(receiver, 'sort'); | 366 checkMutable(receiver, 'sort'); |
| 367 DualPivotQuicksort.sort(receiver, Comparable.compare); | 367 coreSort(receiver, Comparable.compare); |
| 368 } | 368 } |
| 369 | 369 |
| 370 sort$1(receiver, compare) { | 370 sort$1(receiver, compare) { |
| 371 if (!isJsArray(receiver)) return UNINTERCEPTED(receiver.sort(compare)); | 371 if (!isJsArray(receiver)) return UNINTERCEPTED(receiver.sort(compare)); |
| 372 checkMutable(receiver, 'sort'); | 372 checkMutable(receiver, 'sort'); |
| 373 DualPivotQuicksort.sort(receiver, compare); | 373 coreSort(receiver, compare); |
| 374 } | 374 } |
| 375 | 375 |
| 376 isNegative(receiver) { | 376 isNegative(receiver) { |
| 377 if (receiver is num) { | 377 if (receiver is num) { |
| 378 return (receiver == 0) ? (1 / receiver) < 0 : receiver < 0; | 378 return (receiver == 0) ? (1 / receiver) < 0 : receiver < 0; |
| 379 } else { | 379 } else { |
| 380 return UNINTERCEPTED(receiver.isNegative()); | 380 return UNINTERCEPTED(receiver.isNegative()); |
| 381 } | 381 } |
| 382 } | 382 } |
| 383 | 383 |
| (...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 680 } else if (isJsArray(receiver)) { | 680 } else if (isJsArray(receiver)) { |
| 681 return getOrCreateCachedRuntimeType('List'); | 681 return getOrCreateCachedRuntimeType('List'); |
| 682 } else { | 682 } else { |
| 683 return UNINTERCEPTED(receiver.runtimeType); | 683 return UNINTERCEPTED(receiver.runtimeType); |
| 684 } | 684 } |
| 685 } | 685 } |
| 686 | 686 |
| 687 // TODO(lrn): These getters should be generated automatically for all | 687 // TODO(lrn): These getters should be generated automatically for all |
| 688 // intercepted methods. | 688 // intercepted methods. |
| 689 get$toString(receiver) => () => toString(receiver); | 689 get$toString(receiver) => () => toString(receiver); |
| OLD | NEW |