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

Side by Side Diff: tests/compiler/dart2js/mock_compiler.dart

Issue 70703002: Add constructors for JSArray (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 1 month 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
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 mock_compiler; 5 library mock_compiler;
6 6
7 import "package:expect/expect.dart"; 7 import "package:expect/expect.dart";
8 import 'dart:async'; 8 import 'dart:async';
9 import 'dart:collection'; 9 import 'dart:collection';
10 10
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
95 toString() {} 95 toString() {}
96 bool operator==(other) => identical(this, other); 96 bool operator==(other) => identical(this, other);
97 get hashCode => throw "Interceptor.hashCode not implemented."; 97 get hashCode => throw "Interceptor.hashCode not implemented.";
98 noSuchMethod(im) { throw im; } 98 noSuchMethod(im) { throw im; }
99 } 99 }
100 abstract class JSIndexable { 100 abstract class JSIndexable {
101 get length; 101 get length;
102 operator[](index); 102 operator[](index);
103 } 103 }
104 abstract class JSMutableIndexable extends JSIndexable {} 104 abstract class JSMutableIndexable extends JSIndexable {}
105 class JSArray extends Interceptor implements List, JSIndexable { 105 class JSArray<E> extends Interceptor implements List<E>, JSIndexable {
106 JSArray();
107 factory JSArray.typed(a) => a;
106 var length; 108 var length;
107 operator[](index) => this[index]; 109 operator[](index) => this[index];
108 operator[]=(index, value) { this[index] = value; } 110 operator[]=(index, value) { this[index] = value; }
109 add(value) { this[length + 1] = value; } 111 add(value) { this[length + 1] = value; }
110 removeAt(index) {} 112 removeAt(index) {}
111 insert(index, value) {} 113 insert(index, value) {}
112 removeLast() {} 114 removeLast() {}
113 } 115 }
114 class JSMutableArray extends JSArray implements JSMutableIndexable {} 116 class JSMutableArray extends JSArray implements JSMutableIndexable {}
115 class JSFixedArray extends JSMutableArray {} 117 class JSFixedArray extends JSMutableArray {}
(...skipping 388 matching lines...) Expand 10 before | Expand all | Expand 10 after
504 } else { 506 } else {
505 sourceFile = compiler.sourceFiles[uri.toString()]; 507 sourceFile = compiler.sourceFiles[uri.toString()];
506 } 508 }
507 if (sourceFile != null && begin != null && end != null) { 509 if (sourceFile != null && begin != null && end != null) {
508 print(sourceFile.getLocationMessage(message, begin, end, true, (x) => x)); 510 print(sourceFile.getLocationMessage(message, begin, end, true, (x) => x));
509 } else { 511 } else {
510 print(message); 512 print(message);
511 } 513 }
512 }; 514 };
513 } 515 }
OLDNEW
« no previous file with comments | « tests/compiler/dart2js/mirrors_used_test.dart ('k') | tests/compiler/dart2js/resolver_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698