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

Side by Side Diff: test/generated_sdk/lib/_internal/compiler/js_lib/js_array.dart

Issue 1138533003: fixes #175, fixed arrays (Closed) Base URL: git@github.com:dart-lang/dev_compiler.git@master
Patch Set: warn Created 5 years, 7 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
« no previous file with comments | « test/browser/runtime_tests.js ('k') | tool/input_sdk/private/js_array.dart » ('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 part of _interceptors; 5 part of _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 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
78 return JS('JSFixedArray', '#', list); 78 return JS('JSFixedArray', '#', list);
79 } 79 }
80 80
81 checkMutable(reason) { 81 checkMutable(reason) {
82 if (this is !JSMutableArray) { 82 if (this is !JSMutableArray) {
83 throw new UnsupportedError(reason); 83 throw new UnsupportedError(reason);
84 } 84 }
85 } 85 }
86 86
87 checkGrowable(reason) { 87 checkGrowable(reason) {
88 if (this is !JSExtendableArray) { 88 if (JS('bool', r'#.fixed$length', this)) {
89 throw new UnsupportedError(reason); 89 throw new UnsupportedError(reason);
90 } 90 }
91 } 91 }
92 92
93 void add(E value) { 93 void add(E value) {
94 checkGrowable('add'); 94 checkGrowable('add');
95 JS('void', r'#.push(#)', this, value); 95 JS('void', r'#.push(#)', this, value);
96 } 96 }
97 97
98 E removeAt(int index) { 98 E removeAt(int index) {
(...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after
381 } 381 }
382 382
383 /** 383 /**
384 * Dummy subclasses that allow the backend to track more precise 384 * Dummy subclasses that allow the backend to track more precise
385 * information about arrays through their type. The CPA type inference 385 * information about arrays through their type. The CPA type inference
386 * relies on the fact that these classes do not override [] nor []=. 386 * relies on the fact that these classes do not override [] nor []=.
387 */ 387 */
388 class JSMutableArray<E> extends JSArray<E> implements JSMutableIndexable {} 388 class JSMutableArray<E> extends JSArray<E> implements JSMutableIndexable {}
389 class JSFixedArray<E> extends JSMutableArray<E> {} 389 class JSFixedArray<E> extends JSMutableArray<E> {}
390 class JSExtendableArray<E> extends JSMutableArray<E> {} 390 class JSExtendableArray<E> extends JSMutableArray<E> {}
OLDNEW
« no previous file with comments | « test/browser/runtime_tests.js ('k') | tool/input_sdk/private/js_array.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698