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

Side by Side Diff: dart/frog/leg/lib/js_helper.dart

Issue 9835089: Prevent sort on immutable lists. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Temporary interceptor for copyFrom$4 Created 8 years, 9 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | dart/tests/corelib/corelib-leg.status » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #library('js_helper'); 5 #library('js_helper');
6 6
7 #import('coreimpl.dart'); 7 #import('coreimpl.dart');
8 8
9 #source('constant_map.dart'); 9 #source('constant_map.dart');
10 #source('date_helper.dart'); 10 #source('date_helper.dart');
(...skipping 766 matching lines...) Expand 10 before | Expand all | Expand 10 after
777 if (!isJsArray(receiver)) { 777 if (!isJsArray(receiver)) {
778 return UNINTERCEPTED(receiver.every(f)); 778 return UNINTERCEPTED(receiver.every(f));
779 } else { 779 } else {
780 return Collections.every(receiver, f); 780 return Collections.every(receiver, f);
781 } 781 }
782 } 782 }
783 783
784 builtin$sort$1(receiver, compare) { 784 builtin$sort$1(receiver, compare) {
785 if (!isJsArray(receiver)) return UNINTERCEPTED(receiver.sort(compare)); 785 if (!isJsArray(receiver)) return UNINTERCEPTED(receiver.sort(compare));
786 786
787 checkMutable(receiver, 'sort');
787 DualPivotQuicksort.sort(receiver, compare); 788 DualPivotQuicksort.sort(receiver, compare);
788 } 789 }
789 790
790 checkNull(object) { 791 checkNull(object) {
791 if (object === null) throw new NullPointerException(); 792 if (object === null) throw new NullPointerException();
792 return object; 793 return object;
793 } 794 }
794 795
795 checkNum(value) { 796 checkNum(value) {
796 if (value is !num) { 797 if (value is !num) {
(...skipping 559 matching lines...) Expand 10 before | Expand all | Expand 10 after
1356 } 1357 }
1357 1358
1358 /** 1359 /**
1359 * Represents the type of Null. The compiler treats this specially. 1360 * Represents the type of Null. The compiler treats this specially.
1360 */ 1361 */
1361 class Null { 1362 class Null {
1362 factory Null() { 1363 factory Null() {
1363 throw UnsupportedOperationException('new Null()'); 1364 throw UnsupportedOperationException('new Null()');
1364 } 1365 }
1365 } 1366 }
1367
1368 builtin$copyFrom$4(receiver, arg1, arg2, arg3, arg4) {
1369 // TODO(ahe): Remove this method when CL 9839101 has landed.
1370 if (!isJsArray(receiver)) {
1371 return UNINTERCEPTED(receiver.copyFrom(arg1, arg2, arg3, arg4));
1372 }
1373 throw new UnsupportedOperationException('copyFrom');
1374 }
OLDNEW
« no previous file with comments | « no previous file | dart/tests/corelib/corelib-leg.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698