Batch the batch compiler for tests

This:
- Ensures that a given AST is processed once per context, avoiding AST caching issues and redundant work
- Associates file errors with their library instead of the entry point - we now only generate these once across different entry points

R=jmesserly@google.com

Review URL: https://codereview.chromium.org/1376123004 .
This commit is contained in:
Vijay Menon 2015-10-02 14:11:27 -07:00
parent 03f6510e1d
commit c623db6821
37 changed files with 2024 additions and 252 deletions

View file

@ -331,6 +331,11 @@ class CodeChecker extends RecursiveAstVisitor {
bool _failure = false;
bool get failure => _failure || _overrideChecker._failure;
void reset() {
_failure = false;
_overrideChecker._failure = false;
}
CodeChecker(TypeRules rules, AnalysisErrorListener reporter,
StrongModeOptions options)
: rules = rules,

View file

@ -71,18 +71,23 @@ bool compile(CompilerOptions options) {
return new BatchCompiler(context, options, reporter: reporter).run();
}
// Callback on each individual compiled library
typedef void CompilationNotifier(String path);
class BatchCompiler extends AbstractCompiler {
JSGenerator _jsGen;
LibraryElement _dartCore;
String _runtimeOutputDir;
/// Already compiled sources, so we don't compile them again.
final _compiled = new HashSet<LibraryElement>();
/// Already compiled sources, so we don't check or compile them again.
final _compilationRecord = <LibraryElement, bool>{};
bool _sdkCopied = false;
bool _failure = false;
bool get failure => _failure;
final _pendingLibraries = <LibraryUnit>[];
BatchCompiler(AnalysisContext context, CompilerOptions options,
{AnalysisErrorListener reporter})
: super(
@ -100,11 +105,6 @@ class BatchCompiler extends AbstractCompiler {
ErrorCollector get reporter => checker.reporter;
void reset() {
_compiled.clear();
_sdkCopied = false;
}
/// Compiles every file in [options.inputs].
/// Returns true on successful compile.
bool run() {
@ -112,16 +112,17 @@ class BatchCompiler extends AbstractCompiler {
options.inputs.forEach(compileFromUriString);
clock.stop();
var time = (clock.elapsedMilliseconds / 1000).toStringAsFixed(2);
_log.fine('Compiled ${_compiled.length} libraries in ${time} s\n');
_log.fine('Compiled ${_compilationRecord.length} libraries in ${time} s\n');
return !_failure;
}
void compileFromUriString(String uriString) {
_compileFromUri(stringToUri(uriString));
void compileFromUriString(String uriString, [CompilationNotifier notifier]) {
_compileFromUri(stringToUri(uriString), notifier);
}
void _compileFromUri(Uri uri) {
void _compileFromUri(Uri uri, CompilationNotifier notifier) {
_failure = false;
if (!uri.isAbsolute) {
throw new ArgumentError.value('$uri', 'uri', 'must be absolute');
}
@ -129,32 +130,82 @@ class BatchCompiler extends AbstractCompiler {
if (source == null) {
throw new ArgumentError.value('$uri', 'uri', 'could not find source for');
}
compileSource(source);
_compileSource(source, notifier);
}
void compileSource(Source source) {
void _compileSource(Source source, CompilationNotifier notifier) {
if (AnalysisEngine.isHtmlFileName(source.uri.path)) {
_compileHtml(source);
_compileHtml(source, notifier);
} else {
_compileLibrary(context.computeLibraryElement(source));
_compileLibrary(context.computeLibraryElement(source), notifier);
}
_processPending();
reporter.flush();
}
void _compileLibrary(LibraryElement library) {
if (!_compiled.add(library)) return;
void _processPending() {
// _pendingLibraries was recorded in post-order. Process from the end
// to ensure reverse post-order. This will ensure that we handle back
// edges from the original depth-first search correctly.
if (!options.checkSdk && library.source.uri.scheme == 'dart') {
if (_jsGen != null) _copyDartRuntime();
return;
while (_pendingLibraries.isNotEmpty) {
var unit = _pendingLibraries.removeLast();
var library = unit.library.element.enclosingElement;
assert(_compilationRecord[library] == true);
// Process dependences one more time to propagate failure from cycles
for (var import in library.imports) {
if (!_compilationRecord[import.importedLibrary]) {
_compilationRecord[library] = false;
}
}
for (var export in library.exports) {
if (!_compilationRecord[export.exportedLibrary]) {
_compilationRecord[library] = false;
}
}
// Generate code if still valid
if (_jsGen != null &&
(_compilationRecord[library] ||
options.codegenOptions.forceCompile)) {
_jsGen.generateLibrary(unit);
}
}
}
bool _compileLibrary(LibraryElement library, CompilationNotifier notifier) {
var success = _compilationRecord[library];
if (success != null) {
if (!success) _failure = true;
return success;
}
// Optimistically mark a library valid until proven otherwise
_compilationRecord[library] = true;
if (!options.checkSdk && library.source.uri.scheme == 'dart') {
// We assume the Dart SDK is always valid
if (_jsGen != null) _copyDartRuntime();
return true;
}
// Check dependences to determine if this library type checks
// TODO(jmesserly): in incremental mode, we can skip the transitive
// compile of imports/exports.
_compileLibrary(_dartCore); // implicit dart:core dependency
for (var import in library.imports) _compileLibrary(import.importedLibrary);
for (var export in library.exports) _compileLibrary(export.exportedLibrary);
_compileLibrary(_dartCore, notifier); // implicit dart:core dependency
for (var import in library.imports) {
if (!_compileLibrary(import.importedLibrary, notifier)) {
_compilationRecord[library] = false;
}
}
for (var export in library.exports) {
if (!_compileLibrary(export.exportedLibrary, notifier)) {
_compilationRecord[library] = false;
}
}
// Check this library's own code
var unitElements = [library.definingCompilationUnit]..addAll(library.parts);
var units = <CompilationUnit>[];
@ -163,20 +214,35 @@ class BatchCompiler extends AbstractCompiler {
var unit = context.resolveCompilationUnit(element.source, library);
units.add(unit);
failureInLib = logErrors(element.source) || failureInLib;
checker.reset();
checker.visitCompilationUnit(unit);
if (checker.failure) failureInLib = true;
}
if (failureInLib) _compilationRecord[library] = false;
if (failureInLib) {
_failure = true;
if (!options.codegenOptions.forceCompile) return;
// Notifier framework if requested
if (notifier != null) {
reporter.flush();
notifier(getOutputPath(library.source.uri));
}
if (_jsGen != null) {
// Record valid libraries for further dependence checking (cycles) and
// codegen.
// TODO(vsm): Restructure this to not delay code generation more than
// necessary. We'd like to process the AST before there is any chance
// it's cached out. We should refactor common logic in
// server/dependency_graph and perhaps the analyzer itself.
success = _compilationRecord[library];
if (success || options.codegenOptions.forceCompile) {
var unit = units.first;
var parts = units.skip(1).toList();
_jsGen.generateLibrary(new LibraryUnit(unit, parts));
_pendingLibraries.add(new LibraryUnit(unit, parts));
}
// Return tentative success status.
if (!success) _failure = true;
return success;
}
void _copyDartRuntime() {
@ -194,7 +260,7 @@ class BatchCompiler extends AbstractCompiler {
}
}
void _compileHtml(Source source) {
void _compileHtml(Source source, CompilationNotifier notifier) {
// TODO(jmesserly): reuse DartScriptsTask instead of copy/paste.
var contents = context.getContents(source);
var document = html.parse(contents.data, generateSpans: true);
@ -224,7 +290,7 @@ class BatchCompiler extends AbstractCompiler {
if (scriptSource != null) {
var lib = context.computeLibraryElement(scriptSource);
_compileLibrary(lib);
_compileLibrary(lib, notifier);
script.replaceWith(_linkLibraries(lib, loadedLibs, from: htmlOutDir));
}
}

View file

@ -1,5 +1,4 @@
// Messages from compiling DeltaBlue.dart
info: [DynamicInvoke] f() requires dynamic invoke (test/codegen/BenchmarkBase.dart, line 63, col 7)
info: [DynamicCast] mark (dynamic) will need runtime check to cast to type int (test/codegen/DeltaBlue.dart, line 130, col 18)
info: [DynamicCast] mark (dynamic) will need runtime check to cast to type int (test/codegen/DeltaBlue.dart, line 137, col 16)
info: [DynamicCast] mark (dynamic) will need runtime check to cast to type int (test/codegen/DeltaBlue.dart, line 142, col 37)

View file

@ -0,0 +1,2 @@
// Messages from compiling async_helper.dart
info: [DynamicInvoke] f().then(asyncSuccess) requires dynamic invoke (package:async_helper/async_helper.dart, line 108, col 3)

View file

@ -0,0 +1,7 @@
// Messages from compiling algorithms.dart
warning: [DownCastComposite] sortedList (List<dynamic>) will need runtime check to cast to type List<Comparable<dynamic>> (package:collection/algorithms.dart, line 44, col 36)
info: [DynamicCast] key (dynamic) will need runtime check to cast to type Comparable<dynamic> (package:collection/algorithms.dart, line 44, col 48)
info: [DynamicInvoke] compare(element, key) requires dynamic invoke (package:collection/algorithms.dart, line 51, col 16)
info: [DynamicInvoke] compare(element, list[mid]) requires dynamic invoke (package:collection/algorithms.dart, line 138, col 24)
info: [DynamicInvoke] compare(element, target[mid]) requires dynamic invoke (package:collection/algorithms.dart, line 212, col 11)
info: [DynamicInvoke] compare(firstElement, secondElement) requires dynamic invoke (package:collection/algorithms.dart, line 280, col 9)

View file

@ -0,0 +1 @@
// Messages from compiling collection.dart

View file

@ -0,0 +1,29 @@
// Messages from compiling equality.dart
severe: [StaticTypeError] Type check failed: const DefaultEquality() (DefaultEquality) is not of type Equality<E> (package:collection/equality.dart, line 75, col 31)
severe: [StaticTypeError] Type check failed: const DefaultEquality() (DefaultEquality) is not of type Equality<E> (package:collection/equality.dart, line 120, col 53)
severe: [StaticTypeError] Type check failed: const DefaultEquality() (DefaultEquality) is not of type Equality<E> (package:collection/equality.dart, line 205, col 38)
severe: [StaticTypeError] Type check failed: const DefaultEquality() (DefaultEquality) is not of type Equality<E> (package:collection/equality.dart, line 223, col 38)
severe: [StaticTypeError] Type check failed: const DefaultEquality() (DefaultEquality) is not of type Equality<K> (package:collection/equality.dart, line 263, col 42)
severe: [StaticTypeError] Type check failed: const DefaultEquality() (DefaultEquality) is not of type Equality<V> (package:collection/equality.dart, line 264, col 44)
warning: [DownCastComposite] it1.current (dynamic) will need runtime check to cast to type E (package:collection/equality.dart, line 87, col 36)
warning: [DownCastComposite] it2.current (dynamic) will need runtime check to cast to type E (package:collection/equality.dart, line 87, col 49)
warning: [DownCastComposite] e (dynamic) will need runtime check to cast to type E (package:collection/equality.dart, line 171, col 14)
warning: [DownCastComposite] e (dynamic) will need runtime check to cast to type E (package:collection/equality.dart, line 177, col 14)
info: [NonGroundTypeCheckInfo] Runtime check on non-ground type Iterable<E> may throw StrongModeError (package:collection/equality.dart, line 106, col 32)
info: [NonGroundTypeCheckInfo] Runtime check on non-ground type List<E> may throw StrongModeError (package:collection/equality.dart, line 151, col 32)
info: [InferredTypeAllocation] new HashMap(equals: _elementEquality.equals, hashCode: _elementEquality.hash, isValidKey: _elementEquality.isValidKey) has inferred type HashMap<E, int> (package:collection/equality.dart, line 163, col 30)
info: [NonGroundTypeCheckInfo] Runtime check on non-ground type Iterable<E> may throw StrongModeError (package:collection/equality.dart, line 208, col 32)
info: [NonGroundTypeCheckInfo] Runtime check on non-ground type Set<E> may throw StrongModeError (package:collection/equality.dart, line 226, col 32)
info: [AssignmentCast] other (Object) will need runtime check to cast to type _MapEntry (package:collection/equality.dart, line 247, col 28)
info: [InferredTypeAllocation] new HashMap() has inferred type Map<_MapEntry, int> (package:collection/equality.dart, line 272, col 46)
info: [NonGroundTypeCheckInfo] Runtime check on non-ground type Map<K, V> may throw StrongModeError (package:collection/equality.dart, line 301, col 32)
info: [DynamicCast] e1 (dynamic) will need runtime check to cast to type Set<dynamic> (package:collection/equality.dart, line 383, col 43)
info: [DynamicCast] e2 (dynamic) will need runtime check to cast to type Set<dynamic> (package:collection/equality.dart, line 383, col 47)
info: [DynamicCast] e1 (dynamic) will need runtime check to cast to type Map<dynamic, dynamic> (package:collection/equality.dart, line 387, col 63)
info: [DynamicCast] e2 (dynamic) will need runtime check to cast to type Map<dynamic, dynamic> (package:collection/equality.dart, line 387, col 67)
info: [DynamicCast] e1 (dynamic) will need runtime check to cast to type List<dynamic> (package:collection/equality.dart, line 392, col 46)
info: [DynamicCast] e2 (dynamic) will need runtime check to cast to type List<dynamic> (package:collection/equality.dart, line 392, col 50)
info: [DynamicCast] e1 (dynamic) will need runtime check to cast to type Iterable<dynamic> (package:collection/equality.dart, line 396, col 50)
info: [DynamicCast] e2 (dynamic) will need runtime check to cast to type Iterable<dynamic> (package:collection/equality.dart, line 396, col 54)
info: [DynamicCast] e1 (dynamic) will need runtime check to cast to type Iterable<dynamic> (package:collection/equality.dart, line 401, col 57)
info: [DynamicCast] e2 (dynamic) will need runtime check to cast to type Iterable<dynamic> (package:collection/equality.dart, line 401, col 61)

View file

@ -0,0 +1,57 @@
dart_library.library('collection/iterable_zip', null, /* Imports */[
"dart_runtime/dart",
'dart/collection',
'dart/core'
], /* Lazy imports */[
], function(exports, dart, collection, core) {
'use strict';
let dartx = dart.dartx;
let _iterables = Symbol('_iterables');
class IterableZip extends collection.IterableBase$(core.List) {
IterableZip(iterables) {
this[_iterables] = iterables;
super.IterableBase();
}
get iterator() {
let iterators = this[_iterables][dartx.map](dart.fn(x => dart.dload(x, 'iterator')))[dartx.toList]({growable: false});
return new _IteratorZip(iterators);
}
}
dart.setSignature(IterableZip, {
constructors: () => ({IterableZip: [IterableZip, [core.Iterable$(core.Iterable)]]})
});
dart.defineExtensionMembers(IterableZip, ['iterator']);
let _iterators = Symbol('_iterators');
let _current = Symbol('_current');
class _IteratorZip extends core.Object {
_IteratorZip(iterators) {
this[_iterators] = dart.as(iterators, core.List$(core.Iterator));
this[_current] = null;
}
moveNext() {
if (dart.notNull(this[_iterators][dartx.isEmpty]))
return false;
for (let i = 0; dart.notNull(i) < dart.notNull(this[_iterators][dartx.length]); i = dart.notNull(i) + 1) {
if (!dart.notNull(this[_iterators][dartx.get](i).moveNext())) {
this[_current] = null;
return false;
}
}
this[_current] = core.List.new(this[_iterators][dartx.length]);
for (let i = 0; dart.notNull(i) < dart.notNull(this[_iterators][dartx.length]); i = dart.notNull(i) + 1) {
this[_current][dartx.set](i, this[_iterators][dartx.get](i).current);
}
return true;
}
get current() {
return this[_current];
}
}
_IteratorZip[dart.implements] = () => [core.Iterator$(core.List)];
dart.setSignature(_IteratorZip, {
constructors: () => ({_IteratorZip: [_IteratorZip, [core.List]]}),
methods: () => ({moveNext: [core.bool, []]})
});
// Exports:
exports.IterableZip = IterableZip;
});

View file

@ -0,0 +1,4 @@
// Messages from compiling iterable_zip.dart
warning: [DownCastComposite] iterators (List<dynamic>) will need runtime check to cast to type List<Iterator<dynamic>> (package:collection/iterable_zip.dart, line 42, col 47)
info: [InferredTypeClosure] (x) => x.iterator has inferred type (Iterable<dynamic>) → dynamic (package:collection/iterable_zip.dart, line 33, col 37)
info: [DynamicInvoke] x.iterator requires dynamic invoke (package:collection/iterable_zip.dart, line 33, col 44)

View file

@ -0,0 +1,250 @@
dart_library.library('collection/priority_queue', null, /* Imports */[
"dart_runtime/dart",
'dart/core',
'dart/collection'
], /* Lazy imports */[
], function(exports, dart, core, collection) {
'use strict';
let dartx = dart.dartx;
let PriorityQueue$ = dart.generic(function(E) {
class PriorityQueue extends core.Object {}
return PriorityQueue;
});
let PriorityQueue = PriorityQueue$();
let _queue = Symbol('_queue');
let _length = Symbol('_length');
let _add = Symbol('_add');
let _locate = Symbol('_locate');
let _removeLast = Symbol('_removeLast');
let _bubbleUp = Symbol('_bubbleUp');
let _bubbleDown = Symbol('_bubbleDown');
let _grow = Symbol('_grow');
let HeapPriorityQueue$ = dart.generic(function(E) {
class HeapPriorityQueue extends core.Object {
HeapPriorityQueue(comparison) {
if (comparison === void 0)
comparison = null;
this[_queue] = core.List$(E).new(HeapPriorityQueue$()._INITIAL_CAPACITY);
this.comparison = comparison != null ? comparison : core.Comparable.compare;
this[_length] = 0;
}
add(element) {
dart.as(element, E);
this[_add](element);
}
addAll(elements) {
dart.as(elements, core.Iterable$(E));
for (let element of elements) {
this[_add](element);
}
}
clear() {
this[_queue] = dart.const(dart.list([], E));
this[_length] = 0;
}
contains(object) {
dart.as(object, E);
return dart.notNull(this[_locate](object)) >= 0;
}
get first() {
if (this[_length] == 0)
dart.throw(new core.StateError("No such element"));
return this[_queue][dartx.get](0);
}
get isEmpty() {
return this[_length] == 0;
}
get isNotEmpty() {
return this[_length] != 0;
}
get length() {
return this[_length];
}
remove(element) {
dart.as(element, E);
let index = this[_locate](element);
if (dart.notNull(index) < 0)
return false;
let last = this[_removeLast]();
if (dart.notNull(index) < dart.notNull(this[_length])) {
let comp = dart.dcall(this.comparison, last, element);
if (dart.notNull(comp) <= 0) {
this[_bubbleUp](last, index);
} else {
this[_bubbleDown](last, index);
}
}
return true;
}
removeAll() {
let result = this[_queue];
let length = this[_length];
this[_queue] = dart.const(dart.list([], E));
this[_length] = 0;
return result[dartx.take](length);
}
removeFirst() {
if (this[_length] == 0)
dart.throw(new core.StateError("No such element"));
let result = this[_queue][dartx.get](0);
let last = this[_removeLast]();
if (dart.notNull(this[_length]) > 0) {
this[_bubbleDown](last, 0);
}
return result;
}
toList() {
let list = core.List$(E).new();
list[dartx.length] = this[_length];
list[dartx.setRange](0, this[_length], this[_queue]);
list[dartx.sort](dart.as(this.comparison, __CastType0));
return list;
}
toSet() {
let set = new (collection.SplayTreeSet$(E))(dart.as(this.comparison, dart.functionType(core.int, [E, E])));
for (let i = 0; dart.notNull(i) < dart.notNull(this[_length]); i = dart.notNull(i) + 1) {
set.add(this[_queue][dartx.get](i));
}
return set;
}
toString() {
return dart.toString(this[_queue][dartx.take](this[_length]));
}
[_add](element) {
dart.as(element, E);
if (this[_length] == this[_queue][dartx.length])
this[_grow]();
this[_bubbleUp](element, (() => {
let x = this[_length];
this[_length] = dart.notNull(x) + 1;
return x;
})());
}
[_locate](object) {
dart.as(object, E);
if (this[_length] == 0)
return -1;
let position = 1;
do {
let index = dart.notNull(position) - 1;
let element = this[_queue][dartx.get](index);
let comp = dart.dcall(this.comparison, element, object);
if (comp == 0)
return index;
if (dart.notNull(comp) < 0) {
let leftChildPosition = dart.notNull(position) * 2;
if (dart.notNull(leftChildPosition) <= dart.notNull(this[_length])) {
position = leftChildPosition;
continue;
}
}
do {
while (dart.notNull(position[dartx.isOdd])) {
position = dart.notNull(position) >> 1;
}
position = dart.notNull(position) + 1;
} while (dart.notNull(position) > dart.notNull(this[_length]));
} while (position != 1);
return -1;
}
[_removeLast]() {
let newLength = dart.notNull(this[_length]) - 1;
let last = this[_queue][dartx.get](newLength);
this[_queue][dartx.set](newLength, null);
this[_length] = newLength;
return last;
}
[_bubbleUp](element, index) {
dart.as(element, E);
while (dart.notNull(index) > 0) {
let parentIndex = ((dart.notNull(index) - 1) / 2)[dartx.truncate]();
let parent = this[_queue][dartx.get](parentIndex);
if (dart.notNull(dart.dcall(this.comparison, element, parent)) > 0)
break;
this[_queue][dartx.set](index, parent);
index = parentIndex;
}
this[_queue][dartx.set](index, element);
}
[_bubbleDown](element, index) {
dart.as(element, E);
let rightChildIndex = dart.notNull(index) * 2 + 2;
while (dart.notNull(rightChildIndex) < dart.notNull(this[_length])) {
let leftChildIndex = dart.notNull(rightChildIndex) - 1;
let leftChild = this[_queue][dartx.get](leftChildIndex);
let rightChild = this[_queue][dartx.get](rightChildIndex);
let comp = dart.dcall(this.comparison, leftChild, rightChild);
let minChildIndex = null;
let minChild = null;
if (dart.notNull(comp) < 0) {
minChild = leftChild;
minChildIndex = leftChildIndex;
} else {
minChild = rightChild;
minChildIndex = rightChildIndex;
}
comp = dart.dcall(this.comparison, element, minChild);
if (dart.notNull(comp) <= 0) {
this[_queue][dartx.set](index, element);
return;
}
this[_queue][dartx.set](index, minChild);
index = minChildIndex;
rightChildIndex = dart.notNull(index) * 2 + 2;
}
let leftChildIndex = dart.notNull(rightChildIndex) - 1;
if (dart.notNull(leftChildIndex) < dart.notNull(this[_length])) {
let child = this[_queue][dartx.get](leftChildIndex);
let comp = dart.dcall(this.comparison, element, child);
if (dart.notNull(comp) > 0) {
this[_queue][dartx.set](index, child);
index = leftChildIndex;
}
}
this[_queue][dartx.set](index, element);
}
[_grow]() {
let newCapacity = dart.notNull(this[_queue][dartx.length]) * 2 + 1;
if (dart.notNull(newCapacity) < dart.notNull(HeapPriorityQueue$()._INITIAL_CAPACITY))
newCapacity = HeapPriorityQueue$()._INITIAL_CAPACITY;
let newQueue = core.List$(E).new(newCapacity);
newQueue[dartx.setRange](0, this[_length], this[_queue]);
this[_queue] = newQueue;
}
}
HeapPriorityQueue[dart.implements] = () => [PriorityQueue$(E)];
dart.setSignature(HeapPriorityQueue, {
constructors: () => ({HeapPriorityQueue: [HeapPriorityQueue$(E), [], [dart.functionType(core.int, [E, E])]]}),
methods: () => ({
add: [dart.void, [E]],
addAll: [dart.void, [core.Iterable$(E)]],
clear: [dart.void, []],
contains: [core.bool, [E]],
remove: [core.bool, [E]],
removeAll: [core.Iterable$(E), []],
removeFirst: [E, []],
toList: [core.List$(E), []],
toSet: [core.Set$(E), []],
[_add]: [dart.void, [E]],
[_locate]: [core.int, [E]],
[_removeLast]: [E, []],
[_bubbleUp]: [dart.void, [E, core.int]],
[_bubbleDown]: [dart.void, [E, core.int]],
[_grow]: [dart.void, []]
})
});
return HeapPriorityQueue;
});
let HeapPriorityQueue = HeapPriorityQueue$();
HeapPriorityQueue._INITIAL_CAPACITY = 7;
let __CastType0$ = dart.generic(function(E) {
let __CastType0 = dart.typedef('__CastType0', () => dart.functionType(core.int, [E, E]));
return __CastType0;
});
let __CastType0 = __CastType0$();
// Exports:
exports.PriorityQueue$ = PriorityQueue$;
exports.PriorityQueue = PriorityQueue;
exports.HeapPriorityQueue$ = HeapPriorityQueue$;
exports.HeapPriorityQueue = HeapPriorityQueue;
});

View file

@ -0,0 +1,12 @@
// Messages from compiling priority_queue.dart
warning: [DownCastComposite] comparison ((dynamic, dynamic) → int) will need runtime check to cast to type (E, E) → int (package:collection/priority_queue.dart, line 240, col 15)
warning: [DownCastComposite] comparison ((dynamic, dynamic) → int) will need runtime check to cast to type (E, E) → int (package:collection/priority_queue.dart, line 245, col 38)
info: [InferredType] (comparison != null) ? comparison : Comparable.compare has inferred type (dynamic, dynamic) → int (package:collection/priority_queue.dart, line 172, col 22)
info: [InferredTypeLiteral] const [] has inferred type List<E> (package:collection/priority_queue.dart, line 185, col 14)
info: [DynamicInvoke] comparison(last, element) requires dynamic invoke (package:collection/priority_queue.dart, line 209, col 18)
info: [InferredTypeLiteral] const [] has inferred type List<E> (package:collection/priority_queue.dart, line 222, col 14)
info: [DynamicInvoke] comparison(element, object) requires dynamic invoke (package:collection/priority_queue.dart, line 290, col 18)
info: [DynamicInvoke] comparison(element, parent) requires dynamic invoke (package:collection/priority_queue.dart, line 333, col 11)
info: [DynamicInvoke] comparison(leftChild, rightChild) requires dynamic invoke (package:collection/priority_queue.dart, line 353, col 18)
info: [DynamicInvoke] comparison(element, minChild) requires dynamic invoke (package:collection/priority_queue.dart, line 363, col 14)
info: [DynamicInvoke] comparison(element, child) requires dynamic invoke (package:collection/priority_queue.dart, line 375, col 18)

View file

@ -0,0 +1,119 @@
dart_library.library('collection/src/canonicalized_map', null, /* Imports */[
"dart_runtime/dart",
'dart/core',
'collection/src/utils',
'dart/collection'
], /* Lazy imports */[
], function(exports, dart, core, utils, collection) {
'use strict';
let dartx = dart.dartx;
let _base = Symbol('_base');
let _canonicalize = Symbol('_canonicalize');
let _isValidKeyFn = Symbol('_isValidKeyFn');
let _isValidKey = Symbol('_isValidKey');
let CanonicalizedMap$ = dart.generic(function(C, K, V) {
class CanonicalizedMap extends core.Object {
CanonicalizedMap(canonicalize, opts) {
let isValidKey = opts && 'isValidKey' in opts ? opts.isValidKey : null;
this[_base] = core.Map$(C, utils.Pair$(K, V)).new();
this[_canonicalize] = canonicalize;
this[_isValidKeyFn] = isValidKey;
}
from(other, canonicalize, opts) {
let isValidKey = opts && 'isValidKey' in opts ? opts.isValidKey : null;
this[_base] = core.Map$(C, utils.Pair$(K, V)).new();
this[_canonicalize] = canonicalize;
this[_isValidKeyFn] = isValidKey;
this.addAll(other);
}
get(key) {
if (!dart.notNull(this[_isValidKey](key)))
return null;
let pair = this[_base].get(dart.dcall(this[_canonicalize], key));
return pair == null ? null : pair.last;
}
set(key, value) {
dart.as(key, K);
dart.as(value, V);
this[_base].set(dart.as(dart.dcall(this[_canonicalize], key), C), new (utils.Pair$(K, V))(key, value));
return value;
}
addAll(other) {
dart.as(other, core.Map$(K, V));
other.forEach(dart.fn((key, value) => this.set(dart.as(key, K), dart.as(value, V))));
}
clear() {
this[_base].clear();
}
containsKey(key) {
if (!dart.notNull(this[_isValidKey](key)))
return false;
return this[_base].containsKey(dart.dcall(this[_canonicalize], key));
}
containsValue(value) {
return this[_base].values[dartx.any](dart.fn(pair => dart.equals(dart.dload(pair, 'last'), value), core.bool, [dart.dynamic]));
}
forEach(f) {
dart.as(f, dart.functionType(dart.void, [K, V]));
this[_base].forEach(dart.fn((key, pair) => f(dart.as(dart.dload(pair, 'first'), K), dart.as(dart.dload(pair, 'last'), V)), dart.void, [dart.dynamic, dart.dynamic]));
}
get isEmpty() {
return this[_base].isEmpty;
}
get isNotEmpty() {
return this[_base].isNotEmpty;
}
get keys() {
return dart.as(this[_base].values[dartx.map](dart.fn(pair => dart.dload(pair, 'first'))), core.Iterable$(K));
}
get length() {
return this[_base].length;
}
putIfAbsent(key, ifAbsent) {
dart.as(key, K);
dart.as(ifAbsent, dart.functionType(V, []));
return this[_base].putIfAbsent(dart.as(dart.dcall(this[_canonicalize], key), C), dart.fn(() => new (utils.Pair$(K, V))(key, ifAbsent()), utils.Pair$(K, V), [])).last;
}
remove(key) {
if (!dart.notNull(this[_isValidKey](key)))
return null;
let pair = this[_base].remove(dart.dcall(this[_canonicalize], key));
return pair == null ? null : pair.last;
}
get values() {
return dart.as(this[_base].values[dartx.map](dart.fn(pair => dart.dload(pair, 'last'))), core.Iterable$(V));
}
toString() {
return collection.Maps.mapToString(this);
}
[_isValidKey](key) {
return (key == null || dart.is(key, K)) && (this[_isValidKeyFn] == null || dart.notNull(dart.as(dart.dcall(this[_isValidKeyFn], key), core.bool)));
}
}
CanonicalizedMap[dart.implements] = () => [core.Map$(K, V)];
dart.defineNamedConstructor(CanonicalizedMap, 'from');
dart.setSignature(CanonicalizedMap, {
constructors: () => ({
CanonicalizedMap: [CanonicalizedMap$(C, K, V), [dart.functionType(C, [K])], {isValidKey: dart.functionType(core.bool, [core.Object])}],
from: [CanonicalizedMap$(C, K, V), [core.Map$(K, V), dart.functionType(C, [K])], {isValidKey: dart.functionType(core.bool, [core.Object])}]
}),
methods: () => ({
get: [V, [core.Object]],
set: [dart.void, [K, V]],
addAll: [dart.void, [core.Map$(K, V)]],
clear: [dart.void, []],
containsKey: [core.bool, [core.Object]],
containsValue: [core.bool, [core.Object]],
forEach: [dart.void, [dart.functionType(dart.void, [K, V])]],
putIfAbsent: [V, [K, dart.functionType(V, [])]],
remove: [V, [core.Object]],
[_isValidKey]: [core.bool, [core.Object]]
})
});
return CanonicalizedMap;
});
let CanonicalizedMap = CanonicalizedMap$();
// Exports:
exports.CanonicalizedMap$ = CanonicalizedMap$;
exports.CanonicalizedMap = CanonicalizedMap;
});

View file

@ -0,0 +1,29 @@
// Messages from compiling canonicalized_map.dart
warning: [DownCastComposite] _canonicalize(key) (dynamic) will need runtime check to cast to type C (package:collection/src/canonicalized_map.dart, line 67, col 11)
warning: [DownCastComposite] key (dynamic) will need runtime check to cast to type K (package:collection/src/canonicalized_map.dart, line 71, col 40)
warning: [DownCastComposite] value (dynamic) will need runtime check to cast to type V (package:collection/src/canonicalized_map.dart, line 71, col 47)
warning: [DownCastComposite] pair.first (dynamic) will need runtime check to cast to type K (package:collection/src/canonicalized_map.dart, line 87, col 36)
warning: [DownCastComposite] pair.last (dynamic) will need runtime check to cast to type V (package:collection/src/canonicalized_map.dart, line 87, col 48)
warning: [DownCastComposite] _base.values.map((pair) => pair.first) (Iterable<dynamic>) will need runtime check to cast to type Iterable<K> (package:collection/src/canonicalized_map.dart, line 94, col 27)
warning: [DownCastComposite] _canonicalize(key) (dynamic) will need runtime check to cast to type C (package:collection/src/canonicalized_map.dart, line 99, col 30)
warning: [DownCastComposite] _base.values.map((pair) => pair.last) (Iterable<dynamic>) will need runtime check to cast to type Iterable<V> (package:collection/src/canonicalized_map.dart, line 109, col 29)
info: [DynamicInvoke] _canonicalize(key) requires dynamic invoke (package:collection/src/canonicalized_map.dart, line 62, col 22)
info: [DynamicInvoke] _canonicalize(key) requires dynamic invoke (package:collection/src/canonicalized_map.dart, line 67, col 11)
info: [InferredTypeAllocation] new Pair(key, value) has inferred type Pair<K, V> (package:collection/src/canonicalized_map.dart, line 67, col 33)
info: [InferredTypeClosure] (key, value) => this[key] = value has inferred type (K, V) → void (package:collection/src/canonicalized_map.dart, line 71, col 19)
info: [DynamicInvoke] _canonicalize(key) requires dynamic invoke (package:collection/src/canonicalized_map.dart, line 80, col 30)
info: [InferredTypeClosure] (pair) => pair.last == value has inferred type (Pair<K, V>) → bool (package:collection/src/canonicalized_map.dart, line 84, col 24)
info: [DynamicInvoke] pair.last requires dynamic invoke (package:collection/src/canonicalized_map.dart, line 84, col 34)
info: [InferredTypeClosure] (key, pair) => f(pair.first, pair.last) has inferred type (C, Pair<K, V>) → void (package:collection/src/canonicalized_map.dart, line 87, col 19)
info: [DynamicInvoke] pair.first requires dynamic invoke (package:collection/src/canonicalized_map.dart, line 87, col 36)
info: [DynamicInvoke] pair.last requires dynamic invoke (package:collection/src/canonicalized_map.dart, line 87, col 48)
info: [InferredTypeClosure] (pair) => pair.first has inferred type (Pair<K, V>) → dynamic (package:collection/src/canonicalized_map.dart, line 94, col 44)
info: [DynamicInvoke] pair.first requires dynamic invoke (package:collection/src/canonicalized_map.dart, line 94, col 54)
info: [DynamicInvoke] _canonicalize(key) requires dynamic invoke (package:collection/src/canonicalized_map.dart, line 99, col 30)
info: [InferredTypeClosure] () => new Pair(key, ifAbsent()) has inferred type () → Pair<K, V> (package:collection/src/canonicalized_map.dart, line 100, col 9)
info: [DynamicInvoke] _canonicalize(key) requires dynamic invoke (package:collection/src/canonicalized_map.dart, line 105, col 29)
info: [InferredTypeClosure] (pair) => pair.last has inferred type (Pair<K, V>) → dynamic (package:collection/src/canonicalized_map.dart, line 109, col 46)
info: [DynamicInvoke] pair.last requires dynamic invoke (package:collection/src/canonicalized_map.dart, line 109, col 56)
info: [NonGroundTypeCheckInfo] Runtime check on non-ground type K may throw StrongModeError (package:collection/src/canonicalized_map.dart, line 113, col 51)
info: [DynamicCast] _isValidKeyFn(key) (dynamic) will need runtime check to cast to type bool (package:collection/src/canonicalized_map.dart, line 114, col 33)
info: [DynamicInvoke] _isValidKeyFn(key) requires dynamic invoke (package:collection/src/canonicalized_map.dart, line 114, col 33)

View file

@ -0,0 +1,242 @@
dart_library.library('collection/src/queue_list', null, /* Imports */[
"dart_runtime/dart",
'dart/core',
'dart/collection'
], /* Lazy imports */[
], function(exports, dart, core, collection) {
'use strict';
let dartx = dart.dartx;
let _head = Symbol('_head');
let _tail = Symbol('_tail');
let _table = Symbol('_table');
let _add = Symbol('_add');
let _preGrow = Symbol('_preGrow');
let _grow = Symbol('_grow');
let _writeToList = Symbol('_writeToList');
let QueueList$ = dart.generic(function(E) {
class QueueList extends dart.mixin(core.Object, collection.ListMixin$(E)) {
QueueList(initialCapacity) {
if (initialCapacity === void 0)
initialCapacity = null;
this[_head] = 0;
this[_tail] = 0;
this[_table] = null;
if (initialCapacity == null || dart.notNull(initialCapacity) < dart.notNull(QueueList$()._INITIAL_CAPACITY)) {
initialCapacity = QueueList$()._INITIAL_CAPACITY;
} else if (!dart.notNull(QueueList$()._isPowerOf2(initialCapacity))) {
initialCapacity = QueueList$()._nextPowerOf2(initialCapacity);
}
dart.assert(QueueList$()._isPowerOf2(initialCapacity));
this[_table] = core.List$(E).new(initialCapacity);
}
static from(source) {
if (dart.is(source, core.List)) {
let length = source[dartx.length];
let queue = new (QueueList$(E))(dart.notNull(length) + 1);
dart.assert(dart.notNull(queue[_table][dartx.length]) > dart.notNull(length));
let sourceList = dart.as(source, core.List);
queue[_table][dartx.setRange](0, length, dart.as(sourceList, core.Iterable$(E)), 0);
queue[_tail] = length;
return queue;
} else {
let _ = new (QueueList$(E))();
_.addAll(source);
return _;
}
}
add(element) {
dart.as(element, E);
this[_add](element);
}
addAll(elements) {
dart.as(elements, core.Iterable$(E));
if (dart.is(elements, core.List)) {
let list = dart.as(elements, core.List);
let addCount = list[dartx.length];
let length = this.length;
if (dart.notNull(length) + dart.notNull(addCount) >= dart.notNull(this[_table][dartx.length])) {
this[_preGrow](dart.notNull(length) + dart.notNull(addCount));
this[_table][dartx.setRange](length, dart.notNull(length) + dart.notNull(addCount), dart.as(list, core.Iterable$(E)), 0);
this[_tail] = dart.notNull(this[_tail]) + dart.notNull(addCount);
} else {
let endSpace = dart.notNull(this[_table][dartx.length]) - dart.notNull(this[_tail]);
if (dart.notNull(addCount) < dart.notNull(endSpace)) {
this[_table][dartx.setRange](this[_tail], dart.notNull(this[_tail]) + dart.notNull(addCount), dart.as(list, core.Iterable$(E)), 0);
this[_tail] = dart.notNull(this[_tail]) + dart.notNull(addCount);
} else {
let preSpace = dart.notNull(addCount) - dart.notNull(endSpace);
this[_table][dartx.setRange](this[_tail], dart.notNull(this[_tail]) + dart.notNull(endSpace), dart.as(list, core.Iterable$(E)), 0);
this[_table][dartx.setRange](0, preSpace, dart.as(list, core.Iterable$(E)), endSpace);
this[_tail] = preSpace;
}
}
} else {
for (let element of elements)
this[_add](element);
}
}
toString() {
return collection.IterableBase.iterableToFullString(this, "{", "}");
}
addLast(element) {
dart.as(element, E);
this[_add](element);
}
addFirst(element) {
dart.as(element, E);
this[_head] = dart.notNull(this[_head]) - 1 & dart.notNull(this[_table][dartx.length]) - 1;
this[_table][dartx.set](this[_head], element);
if (this[_head] == this[_tail])
this[_grow]();
}
removeFirst() {
if (this[_head] == this[_tail])
dart.throw(new core.StateError("No element"));
let result = this[_table][dartx.get](this[_head]);
this[_table][dartx.set](this[_head], null);
this[_head] = dart.notNull(this[_head]) + 1 & dart.notNull(this[_table][dartx.length]) - 1;
return result;
}
removeLast() {
if (this[_head] == this[_tail])
dart.throw(new core.StateError("No element"));
this[_tail] = dart.notNull(this[_tail]) - 1 & dart.notNull(this[_table][dartx.length]) - 1;
let result = this[_table][dartx.get](this[_tail]);
this[_table][dartx.set](this[_tail], null);
return result;
}
get length() {
return dart.notNull(this[_tail]) - dart.notNull(this[_head]) & dart.notNull(this[_table][dartx.length]) - 1;
}
set length(value) {
if (dart.notNull(value) < 0)
dart.throw(new core.RangeError(`Length ${value} may not be negative.`));
let delta = dart.notNull(value) - dart.notNull(this.length);
if (dart.notNull(delta) >= 0) {
if (dart.notNull(this[_table][dartx.length]) <= dart.notNull(value)) {
this[_preGrow](value);
}
this[_tail] = dart.notNull(this[_tail]) + dart.notNull(delta) & dart.notNull(this[_table][dartx.length]) - 1;
return;
}
let newTail = dart.notNull(this[_tail]) + dart.notNull(delta);
if (dart.notNull(newTail) >= 0) {
this[_table][dartx.fillRange](newTail, this[_tail], null);
} else {
newTail = dart.notNull(newTail) + dart.notNull(this[_table][dartx.length]);
this[_table][dartx.fillRange](0, this[_tail], null);
this[_table][dartx.fillRange](newTail, this[_table][dartx.length], null);
}
this[_tail] = newTail;
}
get(index) {
if (dart.notNull(index) < 0 || dart.notNull(index) >= dart.notNull(this.length)) {
dart.throw(new core.RangeError(`Index ${index} must be in the range [0..${this.length}).`));
}
return this[_table][dartx.get](dart.notNull(this[_head]) + dart.notNull(index) & dart.notNull(this[_table][dartx.length]) - 1);
}
set(index, value) {
dart.as(value, E);
if (dart.notNull(index) < 0 || dart.notNull(index) >= dart.notNull(this.length)) {
dart.throw(new core.RangeError(`Index ${index} must be in the range [0..${this.length}).`));
}
this[_table][dartx.set](dart.notNull(this[_head]) + dart.notNull(index) & dart.notNull(this[_table][dartx.length]) - 1, value);
return value;
}
static _isPowerOf2(number) {
return (dart.notNull(number) & dart.notNull(number) - 1) == 0;
}
static _nextPowerOf2(number) {
dart.assert(dart.notNull(number) > 0);
number = (dart.notNull(number) << 1) - 1;
for (;;) {
let nextNumber = dart.notNull(number) & dart.notNull(number) - 1;
if (nextNumber == 0)
return number;
number = nextNumber;
}
}
[_add](element) {
dart.as(element, E);
this[_table][dartx.set](this[_tail], element);
this[_tail] = dart.notNull(this[_tail]) + 1 & dart.notNull(this[_table][dartx.length]) - 1;
if (this[_head] == this[_tail])
this[_grow]();
}
[_grow]() {
let newTable = core.List$(E).new(dart.notNull(this[_table][dartx.length]) * 2);
let split = dart.notNull(this[_table][dartx.length]) - dart.notNull(this[_head]);
newTable[dartx.setRange](0, split, this[_table], this[_head]);
newTable[dartx.setRange](split, dart.notNull(split) + dart.notNull(this[_head]), this[_table], 0);
this[_head] = 0;
this[_tail] = this[_table][dartx.length];
this[_table] = newTable;
}
[_writeToList](target) {
dart.as(target, core.List$(E));
dart.assert(dart.notNull(target[dartx.length]) >= dart.notNull(this.length));
if (dart.notNull(this[_head]) <= dart.notNull(this[_tail])) {
let length = dart.notNull(this[_tail]) - dart.notNull(this[_head]);
target[dartx.setRange](0, length, this[_table], this[_head]);
return length;
} else {
let firstPartSize = dart.notNull(this[_table][dartx.length]) - dart.notNull(this[_head]);
target[dartx.setRange](0, firstPartSize, this[_table], this[_head]);
target[dartx.setRange](firstPartSize, dart.notNull(firstPartSize) + dart.notNull(this[_tail]), this[_table], 0);
return dart.notNull(this[_tail]) + dart.notNull(firstPartSize);
}
}
[_preGrow](newElementCount) {
dart.assert(dart.notNull(newElementCount) >= dart.notNull(this.length));
newElementCount = dart.notNull(newElementCount) + (dart.notNull(newElementCount) >> 1);
let newCapacity = QueueList$()._nextPowerOf2(newElementCount);
let newTable = core.List$(E).new(newCapacity);
this[_tail] = this[_writeToList](newTable);
this[_table] = newTable;
this[_head] = 0;
}
}
QueueList[dart.implements] = () => [collection.Queue$(E)];
dart.setSignature(QueueList, {
constructors: () => ({
QueueList: [QueueList$(E), [], [core.int]],
from: [QueueList$(E), [core.Iterable$(E)]]
}),
methods: () => ({
add: [dart.void, [E]],
addAll: [dart.void, [core.Iterable$(E)]],
addLast: [dart.void, [E]],
addFirst: [dart.void, [E]],
removeFirst: [E, []],
removeLast: [E, []],
get: [E, [core.int]],
set: [dart.void, [core.int, E]],
[_add]: [dart.void, [E]],
[_grow]: [dart.void, []],
[_writeToList]: [core.int, [core.List$(E)]],
[_preGrow]: [dart.void, [core.int]]
}),
statics: () => ({
_isPowerOf2: [core.bool, [core.int]],
_nextPowerOf2: [core.int, [core.int]]
}),
names: ['_isPowerOf2', '_nextPowerOf2']
});
dart.defineExtensionMembers(QueueList, [
'add',
'addAll',
'toString',
'removeLast',
'get',
'set',
'length',
'length'
]);
return QueueList;
});
let QueueList = QueueList$();
QueueList._INITIAL_CAPACITY = 8;
// Exports:
exports.QueueList$ = QueueList$;
exports.QueueList = QueueList;
});

View file

@ -0,0 +1,9 @@
// Messages from compiling queue_list.dart
warning: [DownCastComposite] sourceList (List<dynamic>) will need runtime check to cast to type Iterable<E> (package:collection/src/queue_list.dart, line 45, col 40)
warning: [DownCastComposite] list (List<dynamic>) will need runtime check to cast to type Iterable<E> (package:collection/src/queue_list.dart, line 67, col 52)
warning: [DownCastComposite] list (List<dynamic>) will need runtime check to cast to type Iterable<E> (package:collection/src/queue_list.dart, line 73, col 52)
warning: [DownCastComposite] list (List<dynamic>) will need runtime check to cast to type Iterable<E> (package:collection/src/queue_list.dart, line 77, col 52)
warning: [DownCastComposite] list (List<dynamic>) will need runtime check to cast to type Iterable<E> (package:collection/src/queue_list.dart, line 78, col 40)
info: [InferredTypeAllocation] new QueueList(length + 1) has inferred type QueueList<E> (package:collection/src/queue_list.dart, line 42, col 28)
info: [AssignmentCast] source (Iterable<E>) will need runtime check to cast to type List<dynamic> (package:collection/src/queue_list.dart, line 44, col 25)
info: [AssignmentCast] elements (Iterable<E>) will need runtime check to cast to type List<dynamic> (package:collection/src/queue_list.dart, line 61, col 19)

View file

@ -0,0 +1,229 @@
dart_library.library('collection/src/unmodifiable_wrappers', null, /* Imports */[
"dart_runtime/dart",
'dart/collection',
'dart/core'
], /* Lazy imports */[
'collection/wrappers'
], function(exports, dart, collection, core, wrappers) {
'use strict';
let dartx = dart.dartx;
dart.export(exports, collection, ['UnmodifiableListView', 'UnmodifiableMapView'], []);
let NonGrowableListMixin$ = dart.generic(function(E) {
class NonGrowableListMixin extends core.Object {
static _throw() {
dart.throw(new core.UnsupportedError("Cannot change the length of a fixed-length list"));
}
set length(newLength) {
return NonGrowableListMixin$()._throw();
}
add(value) {
dart.as(value, E);
return dart.as(NonGrowableListMixin$()._throw(), core.bool);
}
addAll(iterable) {
dart.as(iterable, core.Iterable$(E));
return NonGrowableListMixin$()._throw();
}
insert(index, element) {
dart.as(element, E);
return NonGrowableListMixin$()._throw();
}
insertAll(index, iterable) {
dart.as(iterable, core.Iterable$(E));
return NonGrowableListMixin$()._throw();
}
remove(value) {
return dart.as(NonGrowableListMixin$()._throw(), core.bool);
}
removeAt(index) {
return dart.as(NonGrowableListMixin$()._throw(), E);
}
removeLast() {
return dart.as(NonGrowableListMixin$()._throw(), E);
}
removeWhere(test) {
dart.as(test, dart.functionType(core.bool, [E]));
return NonGrowableListMixin$()._throw();
}
retainWhere(test) {
dart.as(test, dart.functionType(core.bool, [E]));
return NonGrowableListMixin$()._throw();
}
removeRange(start, end) {
return NonGrowableListMixin$()._throw();
}
replaceRange(start, end, iterable) {
dart.as(iterable, core.Iterable$(E));
return NonGrowableListMixin$()._throw();
}
clear() {
return NonGrowableListMixin$()._throw();
}
}
NonGrowableListMixin[dart.implements] = () => [core.List$(E)];
dart.setSignature(NonGrowableListMixin, {
methods: () => ({
add: [core.bool, [E]],
addAll: [dart.void, [core.Iterable$(E)]],
insert: [dart.void, [core.int, E]],
insertAll: [dart.void, [core.int, core.Iterable$(E)]],
remove: [core.bool, [core.Object]],
removeAt: [E, [core.int]],
removeLast: [E, []],
removeWhere: [dart.void, [dart.functionType(core.bool, [E])]],
retainWhere: [dart.void, [dart.functionType(core.bool, [E])]],
removeRange: [dart.void, [core.int, core.int]],
replaceRange: [dart.void, [core.int, core.int, core.Iterable$(E)]],
clear: [dart.void, []]
}),
statics: () => ({_throw: [dart.dynamic, []]}),
names: ['_throw']
});
dart.defineExtensionMembers(NonGrowableListMixin, [
'add',
'addAll',
'insert',
'insertAll',
'remove',
'removeAt',
'removeLast',
'removeWhere',
'retainWhere',
'removeRange',
'replaceRange',
'clear',
'length'
]);
return NonGrowableListMixin;
});
let NonGrowableListMixin = NonGrowableListMixin$();
let NonGrowableListView$ = dart.generic(function(E) {
class NonGrowableListView extends dart.mixin(wrappers.DelegatingList$(E), NonGrowableListMixin$(E)) {
NonGrowableListView(listBase) {
super.DelegatingList(listBase);
}
}
dart.setSignature(NonGrowableListView, {
constructors: () => ({NonGrowableListView: [exports.NonGrowableListView$(E), [core.List$(E)]]})
});
return NonGrowableListView;
});
dart.defineLazyClassGeneric(exports, 'NonGrowableListView', {get: NonGrowableListView$});
let _throw = Symbol('_throw');
let UnmodifiableSetMixin$ = dart.generic(function(E) {
class UnmodifiableSetMixin extends core.Object {
[_throw]() {
dart.throw(new core.UnsupportedError("Cannot modify an unmodifiable Set"));
}
add(value) {
dart.as(value, E);
return dart.as(this[_throw](), core.bool);
}
addAll(elements) {
dart.as(elements, core.Iterable$(E));
return this[_throw]();
}
remove(value) {
return dart.as(this[_throw](), core.bool);
}
removeAll(elements) {
return this[_throw]();
}
retainAll(elements) {
return this[_throw]();
}
removeWhere(test) {
dart.as(test, dart.functionType(core.bool, [E]));
return this[_throw]();
}
retainWhere(test) {
dart.as(test, dart.functionType(core.bool, [E]));
return this[_throw]();
}
clear() {
return this[_throw]();
}
}
UnmodifiableSetMixin[dart.implements] = () => [core.Set$(E)];
dart.setSignature(UnmodifiableSetMixin, {
methods: () => ({
[_throw]: [dart.dynamic, []],
add: [core.bool, [E]],
addAll: [dart.void, [core.Iterable$(E)]],
remove: [core.bool, [core.Object]],
removeAll: [dart.void, [core.Iterable]],
retainAll: [dart.void, [core.Iterable]],
removeWhere: [dart.void, [dart.functionType(core.bool, [E])]],
retainWhere: [dart.void, [dart.functionType(core.bool, [E])]],
clear: [dart.void, []]
})
});
return UnmodifiableSetMixin;
});
let UnmodifiableSetMixin = UnmodifiableSetMixin$();
let UnmodifiableSetView$ = dart.generic(function(E) {
class UnmodifiableSetView extends dart.mixin(wrappers.DelegatingSet$(E), UnmodifiableSetMixin$(E)) {
UnmodifiableSetView(setBase) {
super.DelegatingSet(setBase);
}
}
dart.setSignature(UnmodifiableSetView, {
constructors: () => ({UnmodifiableSetView: [exports.UnmodifiableSetView$(E), [core.Set$(E)]]})
});
return UnmodifiableSetView;
});
dart.defineLazyClassGeneric(exports, 'UnmodifiableSetView', {get: UnmodifiableSetView$});
let UnmodifiableMapMixin$ = dart.generic(function(K, V) {
class UnmodifiableMapMixin extends core.Object {
static _throw() {
dart.throw(new core.UnsupportedError("Cannot modify an unmodifiable Map"));
}
set(key, value) {
(() => {
dart.as(key, K);
dart.as(value, V);
return UnmodifiableMapMixin$()._throw();
})();
return value;
}
putIfAbsent(key, ifAbsent) {
dart.as(key, K);
dart.as(ifAbsent, dart.functionType(V, []));
return dart.as(UnmodifiableMapMixin$()._throw(), V);
}
addAll(other) {
dart.as(other, core.Map$(K, V));
return UnmodifiableMapMixin$()._throw();
}
remove(key) {
return dart.as(UnmodifiableMapMixin$()._throw(), V);
}
clear() {
return UnmodifiableMapMixin$()._throw();
}
}
UnmodifiableMapMixin[dart.implements] = () => [core.Map$(K, V)];
dart.setSignature(UnmodifiableMapMixin, {
methods: () => ({
set: [dart.void, [K, V]],
putIfAbsent: [V, [K, dart.functionType(V, [])]],
addAll: [dart.void, [core.Map$(K, V)]],
remove: [V, [core.Object]],
clear: [dart.void, []]
}),
statics: () => ({_throw: [dart.dynamic, []]}),
names: ['_throw']
});
return UnmodifiableMapMixin;
});
let UnmodifiableMapMixin = UnmodifiableMapMixin$();
// Exports:
exports.NonGrowableListMixin$ = NonGrowableListMixin$;
exports.NonGrowableListMixin = NonGrowableListMixin;
exports.NonGrowableListView$ = NonGrowableListView$;
exports.UnmodifiableSetMixin$ = UnmodifiableSetMixin$;
exports.UnmodifiableSetMixin = UnmodifiableSetMixin;
exports.UnmodifiableSetView$ = UnmodifiableSetView$;
exports.UnmodifiableMapMixin$ = UnmodifiableMapMixin$;
exports.UnmodifiableMapMixin = UnmodifiableMapMixin;
});

View file

@ -0,0 +1,9 @@
// Messages from compiling unmodifiable_wrappers.dart
warning: [DownCastComposite] _throw() (dynamic) will need runtime check to cast to type E (package:collection/src/unmodifiable_wrappers.dart, line 88, col 28)
warning: [DownCastComposite] _throw() (dynamic) will need runtime check to cast to type E (package:collection/src/unmodifiable_wrappers.dart, line 94, col 21)
warning: [DownCastComposite] _throw() (dynamic) will need runtime check to cast to type V (package:collection/src/unmodifiable_wrappers.dart, line 218, col 41)
warning: [DownCastComposite] _throw() (dynamic) will need runtime check to cast to type V (package:collection/src/unmodifiable_wrappers.dart, line 230, col 27)
info: [DynamicCast] _throw() (dynamic) will need runtime check to cast to type bool (package:collection/src/unmodifiable_wrappers.dart, line 58, col 24)
info: [DynamicCast] _throw() (dynamic) will need runtime check to cast to type bool (package:collection/src/unmodifiable_wrappers.dart, line 82, col 32)
info: [DynamicCast] _throw() (dynamic) will need runtime check to cast to type bool (package:collection/src/unmodifiable_wrappers.dart, line 154, col 24)
info: [DynamicCast] _throw() (dynamic) will need runtime check to cast to type bool (package:collection/src/unmodifiable_wrappers.dart, line 166, col 32)

View file

@ -0,0 +1,24 @@
dart_library.library('collection/src/utils', null, /* Imports */[
"dart_runtime/dart",
'dart/core'
], /* Lazy imports */[
], function(exports, dart, core) {
'use strict';
let dartx = dart.dartx;
let Pair$ = dart.generic(function(E, F) {
class Pair extends core.Object {
Pair(first, last) {
this.first = first;
this.last = last;
}
}
dart.setSignature(Pair, {
constructors: () => ({Pair: [Pair$(E, F), [E, F]]})
});
return Pair;
});
let Pair = Pair$();
// Exports:
exports.Pair$ = Pair$;
exports.Pair = Pair;
});

View file

@ -0,0 +1 @@
// Messages from compiling utils.dart

View file

@ -0,0 +1,825 @@
dart_library.library('collection/wrappers', null, /* Imports */[
"dart_runtime/dart",
'collection/src/canonicalized_map',
'dart/core',
'dart/math',
'dart/collection'
], /* Lazy imports */[
'collection/src/unmodifiable_wrappers'
], function(exports, dart, canonicalized_map, core, math, collection, unmodifiable_wrappers) {
'use strict';
let dartx = dart.dartx;
dart.export(exports, canonicalized_map);
dart.export(exports, unmodifiable_wrappers);
let _base = Symbol('_base');
let _DelegatingIterableBase$ = dart.generic(function(E) {
class _DelegatingIterableBase extends core.Object {
_DelegatingIterableBase() {
}
any(test) {
dart.as(test, dart.functionType(core.bool, [E]));
return this[_base][dartx.any](test);
}
contains(element) {
return this[_base][dartx.contains](element);
}
elementAt(index) {
return this[_base][dartx.elementAt](index);
}
every(test) {
dart.as(test, dart.functionType(core.bool, [E]));
return this[_base][dartx.every](test);
}
expand(f) {
dart.as(f, dart.functionType(core.Iterable, [E]));
return this[_base][dartx.expand](f);
}
get first() {
return this[_base][dartx.first];
}
firstWhere(test, opts) {
dart.as(test, dart.functionType(core.bool, [E]));
let orElse = opts && 'orElse' in opts ? opts.orElse : null;
dart.as(orElse, dart.functionType(E, []));
return this[_base][dartx.firstWhere](test, {orElse: orElse});
}
fold(initialValue, combine) {
dart.as(combine, dart.functionType(dart.dynamic, [dart.dynamic, E]));
return this[_base][dartx.fold](initialValue, combine);
}
forEach(f) {
dart.as(f, dart.functionType(dart.void, [E]));
return this[_base][dartx.forEach](f);
}
get isEmpty() {
return this[_base][dartx.isEmpty];
}
get isNotEmpty() {
return this[_base][dartx.isNotEmpty];
}
get iterator() {
return this[_base][dartx.iterator];
}
[Symbol.iterator]() {
return new dart.JsIterator(this.iterator);
}
join(separator) {
if (separator === void 0)
separator = "";
return this[_base][dartx.join](separator);
}
get last() {
return this[_base][dartx.last];
}
lastWhere(test, opts) {
dart.as(test, dart.functionType(core.bool, [E]));
let orElse = opts && 'orElse' in opts ? opts.orElse : null;
dart.as(orElse, dart.functionType(E, []));
return this[_base][dartx.lastWhere](test, {orElse: orElse});
}
get length() {
return this[_base][dartx.length];
}
map(f) {
dart.as(f, dart.functionType(dart.dynamic, [E]));
return this[_base][dartx.map](f);
}
reduce(combine) {
dart.as(combine, dart.functionType(E, [E, E]));
return this[_base][dartx.reduce](combine);
}
get single() {
return this[_base][dartx.single];
}
singleWhere(test) {
dart.as(test, dart.functionType(core.bool, [E]));
return this[_base][dartx.singleWhere](test);
}
skip(n) {
return this[_base][dartx.skip](n);
}
skipWhile(test) {
dart.as(test, dart.functionType(core.bool, [E]));
return this[_base][dartx.skipWhile](test);
}
take(n) {
return this[_base][dartx.take](n);
}
takeWhile(test) {
dart.as(test, dart.functionType(core.bool, [E]));
return this[_base][dartx.takeWhile](test);
}
toList(opts) {
let growable = opts && 'growable' in opts ? opts.growable : true;
return this[_base][dartx.toList]({growable: growable});
}
toSet() {
return this[_base][dartx.toSet]();
}
where(test) {
dart.as(test, dart.functionType(core.bool, [E]));
return this[_base][dartx.where](test);
}
toString() {
return dart.toString(this[_base]);
}
}
_DelegatingIterableBase[dart.implements] = () => [core.Iterable$(E)];
dart.setSignature(_DelegatingIterableBase, {
constructors: () => ({_DelegatingIterableBase: [_DelegatingIterableBase$(E), []]}),
methods: () => ({
any: [core.bool, [dart.functionType(core.bool, [E])]],
contains: [core.bool, [core.Object]],
elementAt: [E, [core.int]],
every: [core.bool, [dart.functionType(core.bool, [E])]],
expand: [core.Iterable, [dart.functionType(core.Iterable, [E])]],
firstWhere: [E, [dart.functionType(core.bool, [E])], {orElse: dart.functionType(E, [])}],
fold: [dart.dynamic, [dart.dynamic, dart.functionType(dart.dynamic, [dart.dynamic, E])]],
forEach: [dart.void, [dart.functionType(dart.void, [E])]],
join: [core.String, [], [core.String]],
lastWhere: [E, [dart.functionType(core.bool, [E])], {orElse: dart.functionType(E, [])}],
map: [core.Iterable, [dart.functionType(dart.dynamic, [E])]],
reduce: [E, [dart.functionType(E, [E, E])]],
singleWhere: [E, [dart.functionType(core.bool, [E])]],
skip: [core.Iterable$(E), [core.int]],
skipWhile: [core.Iterable$(E), [dart.functionType(core.bool, [E])]],
take: [core.Iterable$(E), [core.int]],
takeWhile: [core.Iterable$(E), [dart.functionType(core.bool, [E])]],
toList: [core.List$(E), [], {growable: core.bool}],
toSet: [core.Set$(E), []],
where: [core.Iterable$(E), [dart.functionType(core.bool, [E])]]
})
});
dart.defineExtensionMembers(_DelegatingIterableBase, [
'any',
'contains',
'elementAt',
'every',
'expand',
'firstWhere',
'fold',
'forEach',
'join',
'lastWhere',
'map',
'reduce',
'singleWhere',
'skip',
'skipWhile',
'take',
'takeWhile',
'toList',
'toSet',
'where',
'toString',
'first',
'isEmpty',
'isNotEmpty',
'iterator',
'last',
'length',
'single'
]);
return _DelegatingIterableBase;
});
let _DelegatingIterableBase = _DelegatingIterableBase$();
let DelegatingIterable$ = dart.generic(function(E) {
class DelegatingIterable extends _DelegatingIterableBase$(E) {
DelegatingIterable(base) {
this[_base] = base;
super._DelegatingIterableBase();
}
}
dart.setSignature(DelegatingIterable, {
constructors: () => ({DelegatingIterable: [DelegatingIterable$(E), [core.Iterable$(E)]]})
});
return DelegatingIterable;
});
let DelegatingIterable = DelegatingIterable$();
let _listBase = Symbol('_listBase');
let DelegatingList$ = dart.generic(function(E) {
class DelegatingList extends DelegatingIterable$(E) {
DelegatingList(base) {
super.DelegatingIterable(base);
}
get [_listBase]() {
return dart.as(this[_base], core.List$(E));
}
get(index) {
return this[_listBase][dartx.get](index);
}
set(index, value) {
dart.as(value, E);
this[_listBase][dartx.set](index, value);
return value;
}
add(value) {
dart.as(value, E);
this[_listBase][dartx.add](value);
}
addAll(iterable) {
dart.as(iterable, core.Iterable$(E));
this[_listBase][dartx.addAll](iterable);
}
asMap() {
return this[_listBase][dartx.asMap]();
}
clear() {
this[_listBase][dartx.clear]();
}
fillRange(start, end, fillValue) {
if (fillValue === void 0)
fillValue = null;
dart.as(fillValue, E);
this[_listBase][dartx.fillRange](start, end, fillValue);
}
getRange(start, end) {
return this[_listBase][dartx.getRange](start, end);
}
indexOf(element, start) {
dart.as(element, E);
if (start === void 0)
start = 0;
return this[_listBase][dartx.indexOf](element, start);
}
insert(index, element) {
dart.as(element, E);
this[_listBase][dartx.insert](index, element);
}
insertAll(index, iterable) {
dart.as(iterable, core.Iterable$(E));
this[_listBase][dartx.insertAll](index, iterable);
}
lastIndexOf(element, start) {
dart.as(element, E);
if (start === void 0)
start = null;
return this[_listBase][dartx.lastIndexOf](element, start);
}
set length(newLength) {
this[_listBase][dartx.length] = newLength;
}
remove(value) {
return this[_listBase][dartx.remove](value);
}
removeAt(index) {
return this[_listBase][dartx.removeAt](index);
}
removeLast() {
return this[_listBase][dartx.removeLast]();
}
removeRange(start, end) {
this[_listBase][dartx.removeRange](start, end);
}
removeWhere(test) {
dart.as(test, dart.functionType(core.bool, [E]));
this[_listBase][dartx.removeWhere](test);
}
replaceRange(start, end, iterable) {
dart.as(iterable, core.Iterable$(E));
this[_listBase][dartx.replaceRange](start, end, iterable);
}
retainWhere(test) {
dart.as(test, dart.functionType(core.bool, [E]));
this[_listBase][dartx.retainWhere](test);
}
get reversed() {
return this[_listBase][dartx.reversed];
}
setAll(index, iterable) {
dart.as(iterable, core.Iterable$(E));
this[_listBase][dartx.setAll](index, iterable);
}
setRange(start, end, iterable, skipCount) {
dart.as(iterable, core.Iterable$(E));
if (skipCount === void 0)
skipCount = 0;
this[_listBase][dartx.setRange](start, end, iterable, skipCount);
}
shuffle(random) {
if (random === void 0)
random = null;
this[_listBase][dartx.shuffle](random);
}
sort(compare) {
if (compare === void 0)
compare = null;
dart.as(compare, dart.functionType(core.int, [E, E]));
this[_listBase][dartx.sort](compare);
}
sublist(start, end) {
if (end === void 0)
end = null;
return this[_listBase][dartx.sublist](start, end);
}
}
DelegatingList[dart.implements] = () => [core.List$(E)];
dart.setSignature(DelegatingList, {
constructors: () => ({DelegatingList: [DelegatingList$(E), [core.List$(E)]]}),
methods: () => ({
get: [E, [core.int]],
set: [dart.void, [core.int, E]],
add: [dart.void, [E]],
addAll: [dart.void, [core.Iterable$(E)]],
asMap: [core.Map$(core.int, E), []],
clear: [dart.void, []],
fillRange: [dart.void, [core.int, core.int], [E]],
getRange: [core.Iterable$(E), [core.int, core.int]],
indexOf: [core.int, [E], [core.int]],
insert: [dart.void, [core.int, E]],
insertAll: [dart.void, [core.int, core.Iterable$(E)]],
lastIndexOf: [core.int, [E], [core.int]],
remove: [core.bool, [core.Object]],
removeAt: [E, [core.int]],
removeLast: [E, []],
removeRange: [dart.void, [core.int, core.int]],
removeWhere: [dart.void, [dart.functionType(core.bool, [E])]],
replaceRange: [dart.void, [core.int, core.int, core.Iterable$(E)]],
retainWhere: [dart.void, [dart.functionType(core.bool, [E])]],
setAll: [dart.void, [core.int, core.Iterable$(E)]],
setRange: [dart.void, [core.int, core.int, core.Iterable$(E)], [core.int]],
shuffle: [dart.void, [], [math.Random]],
sort: [dart.void, [], [dart.functionType(core.int, [E, E])]],
sublist: [core.List$(E), [core.int], [core.int]]
})
});
dart.defineExtensionMembers(DelegatingList, [
'get',
'set',
'add',
'addAll',
'asMap',
'clear',
'fillRange',
'getRange',
'indexOf',
'insert',
'insertAll',
'lastIndexOf',
'remove',
'removeAt',
'removeLast',
'removeRange',
'removeWhere',
'replaceRange',
'retainWhere',
'setAll',
'setRange',
'shuffle',
'sort',
'sublist',
'length',
'reversed'
]);
return DelegatingList;
});
let DelegatingList = DelegatingList$();
let _setBase = Symbol('_setBase');
let DelegatingSet$ = dart.generic(function(E) {
class DelegatingSet extends DelegatingIterable$(E) {
DelegatingSet(base) {
super.DelegatingIterable(base);
}
get [_setBase]() {
return dart.as(this[_base], core.Set$(E));
}
add(value) {
dart.as(value, E);
return this[_setBase].add(value);
}
addAll(elements) {
dart.as(elements, core.Iterable$(E));
this[_setBase].addAll(elements);
}
clear() {
this[_setBase].clear();
}
containsAll(other) {
return this[_setBase].containsAll(other);
}
difference(other) {
dart.as(other, core.Set$(E));
return this[_setBase].difference(other);
}
intersection(other) {
return this[_setBase].intersection(other);
}
lookup(element) {
return this[_setBase].lookup(element);
}
remove(value) {
return this[_setBase].remove(value);
}
removeAll(elements) {
this[_setBase].removeAll(elements);
}
removeWhere(test) {
dart.as(test, dart.functionType(core.bool, [E]));
this[_setBase].removeWhere(test);
}
retainAll(elements) {
this[_setBase].retainAll(elements);
}
retainWhere(test) {
dart.as(test, dart.functionType(core.bool, [E]));
this[_setBase].retainWhere(test);
}
union(other) {
dart.as(other, core.Set$(E));
return this[_setBase].union(other);
}
toSet() {
return new (DelegatingSet$(E))(this[_setBase].toSet());
}
}
DelegatingSet[dart.implements] = () => [core.Set$(E)];
dart.setSignature(DelegatingSet, {
constructors: () => ({DelegatingSet: [DelegatingSet$(E), [core.Set$(E)]]}),
methods: () => ({
add: [core.bool, [E]],
addAll: [dart.void, [core.Iterable$(E)]],
clear: [dart.void, []],
containsAll: [core.bool, [core.Iterable$(core.Object)]],
difference: [core.Set$(E), [core.Set$(E)]],
intersection: [core.Set$(E), [core.Set$(core.Object)]],
lookup: [E, [core.Object]],
remove: [core.bool, [core.Object]],
removeAll: [dart.void, [core.Iterable$(core.Object)]],
removeWhere: [dart.void, [dart.functionType(core.bool, [E])]],
retainAll: [dart.void, [core.Iterable$(core.Object)]],
retainWhere: [dart.void, [dart.functionType(core.bool, [E])]],
union: [core.Set$(E), [core.Set$(E)]],
toSet: [core.Set$(E), []]
})
});
dart.defineExtensionMembers(DelegatingSet, ['toSet']);
return DelegatingSet;
});
let DelegatingSet = DelegatingSet$();
let _baseQueue = Symbol('_baseQueue');
let DelegatingQueue$ = dart.generic(function(E) {
class DelegatingQueue extends DelegatingIterable$(E) {
DelegatingQueue(queue) {
super.DelegatingIterable(queue);
}
get [_baseQueue]() {
return dart.as(this[_base], collection.Queue$(E));
}
add(value) {
dart.as(value, E);
this[_baseQueue].add(value);
}
addAll(iterable) {
dart.as(iterable, core.Iterable$(E));
this[_baseQueue].addAll(iterable);
}
addFirst(value) {
dart.as(value, E);
this[_baseQueue].addFirst(value);
}
addLast(value) {
dart.as(value, E);
this[_baseQueue].addLast(value);
}
clear() {
this[_baseQueue].clear();
}
remove(object) {
return this[_baseQueue].remove(object);
}
removeWhere(test) {
dart.as(test, dart.functionType(core.bool, [E]));
this[_baseQueue].removeWhere(test);
}
retainWhere(test) {
dart.as(test, dart.functionType(core.bool, [E]));
this[_baseQueue].retainWhere(test);
}
removeFirst() {
return this[_baseQueue].removeFirst();
}
removeLast() {
return this[_baseQueue].removeLast();
}
}
DelegatingQueue[dart.implements] = () => [collection.Queue$(E)];
dart.setSignature(DelegatingQueue, {
constructors: () => ({DelegatingQueue: [DelegatingQueue$(E), [collection.Queue$(E)]]}),
methods: () => ({
add: [dart.void, [E]],
addAll: [dart.void, [core.Iterable$(E)]],
addFirst: [dart.void, [E]],
addLast: [dart.void, [E]],
clear: [dart.void, []],
remove: [core.bool, [core.Object]],
removeWhere: [dart.void, [dart.functionType(core.bool, [E])]],
retainWhere: [dart.void, [dart.functionType(core.bool, [E])]],
removeFirst: [E, []],
removeLast: [E, []]
})
});
return DelegatingQueue;
});
let DelegatingQueue = DelegatingQueue$();
let DelegatingMap$ = dart.generic(function(K, V) {
class DelegatingMap extends core.Object {
DelegatingMap(base) {
this[_base] = base;
}
get(key) {
return this[_base].get(key);
}
set(key, value) {
dart.as(key, K);
dart.as(value, V);
this[_base].set(key, value);
return value;
}
addAll(other) {
dart.as(other, core.Map$(K, V));
this[_base].addAll(other);
}
clear() {
this[_base].clear();
}
containsKey(key) {
return this[_base].containsKey(key);
}
containsValue(value) {
return this[_base].containsValue(value);
}
forEach(f) {
dart.as(f, dart.functionType(dart.void, [K, V]));
this[_base].forEach(f);
}
get isEmpty() {
return this[_base].isEmpty;
}
get isNotEmpty() {
return this[_base].isNotEmpty;
}
get keys() {
return this[_base].keys;
}
get length() {
return this[_base].length;
}
putIfAbsent(key, ifAbsent) {
dart.as(key, K);
dart.as(ifAbsent, dart.functionType(V, []));
return this[_base].putIfAbsent(key, ifAbsent);
}
remove(key) {
return this[_base].remove(key);
}
get values() {
return this[_base].values;
}
toString() {
return dart.toString(this[_base]);
}
}
DelegatingMap[dart.implements] = () => [core.Map$(K, V)];
dart.setSignature(DelegatingMap, {
constructors: () => ({DelegatingMap: [DelegatingMap$(K, V), [core.Map$(K, V)]]}),
methods: () => ({
get: [V, [core.Object]],
set: [dart.void, [K, V]],
addAll: [dart.void, [core.Map$(K, V)]],
clear: [dart.void, []],
containsKey: [core.bool, [core.Object]],
containsValue: [core.bool, [core.Object]],
forEach: [dart.void, [dart.functionType(dart.void, [K, V])]],
putIfAbsent: [V, [K, dart.functionType(V, [])]],
remove: [V, [core.Object]]
})
});
return DelegatingMap;
});
let DelegatingMap = DelegatingMap$();
let _baseMap = Symbol('_baseMap');
let MapKeySet$ = dart.generic(function(E) {
class MapKeySet extends dart.mixin(_DelegatingIterableBase$(E), unmodifiable_wrappers.UnmodifiableSetMixin$(E)) {
MapKeySet(base) {
this[_baseMap] = base;
super._DelegatingIterableBase();
}
get [_base]() {
return this[_baseMap].keys;
}
contains(element) {
return this[_baseMap].containsKey(element);
}
get isEmpty() {
return this[_baseMap].isEmpty;
}
get isNotEmpty() {
return this[_baseMap].isNotEmpty;
}
get length() {
return this[_baseMap].length;
}
toString() {
return `{${this[_base][dartx.join](', ')}}`;
}
containsAll(other) {
return other[dartx.every](dart.bind(this, 'contains'));
}
difference(other) {
dart.as(other, core.Set$(E));
return this.where(dart.fn(element => !dart.notNull(other.contains(element)), core.bool, [dart.dynamic]))[dartx.toSet]();
}
intersection(other) {
return this.where(dart.bind(other, 'contains'))[dartx.toSet]();
}
lookup(element) {
dart.as(element, E);
return dart.throw(new core.UnsupportedError("MapKeySet doesn't support lookup()."));
}
union(other) {
dart.as(other, core.Set$(E));
return (() => {
let _ = this.toSet();
_.addAll(other);
return _;
})();
}
}
dart.setSignature(MapKeySet, {
constructors: () => ({MapKeySet: [exports.MapKeySet$(E), [core.Map$(E, dart.dynamic)]]}),
methods: () => ({
containsAll: [core.bool, [core.Iterable$(core.Object)]],
difference: [core.Set$(E), [core.Set$(E)]],
intersection: [core.Set$(E), [core.Set$(core.Object)]],
lookup: [E, [E]],
union: [core.Set$(E), [core.Set$(E)]]
})
});
dart.defineExtensionMembers(MapKeySet, [
'contains',
'toString',
'isEmpty',
'isNotEmpty',
'length'
]);
return MapKeySet;
});
dart.defineLazyClassGeneric(exports, 'MapKeySet', {get: MapKeySet$});
let _keyForValue = Symbol('_keyForValue');
let MapValueSet$ = dart.generic(function(K, V) {
class MapValueSet extends _DelegatingIterableBase$(V) {
MapValueSet(base, keyForValue) {
this[_baseMap] = base;
this[_keyForValue] = keyForValue;
super._DelegatingIterableBase();
}
get [_base]() {
return this[_baseMap].values;
}
contains(element) {
if (element != null && !dart.is(element, V))
return false;
return this[_baseMap].containsKey(dart.dcall(this[_keyForValue], element));
}
get isEmpty() {
return this[_baseMap].isEmpty;
}
get isNotEmpty() {
return this[_baseMap].isNotEmpty;
}
get length() {
return this[_baseMap].length;
}
toString() {
return dart.toString(this.toSet());
}
add(value) {
dart.as(value, V);
let key = dart.as(dart.dcall(this[_keyForValue], value), K);
let result = false;
this[_baseMap].putIfAbsent(key, dart.as(dart.fn(() => {
result = true;
return value;
}), __CastType0));
return result;
}
addAll(elements) {
dart.as(elements, core.Iterable$(V));
return elements[dartx.forEach](dart.bind(this, 'add'));
}
clear() {
return this[_baseMap].clear();
}
containsAll(other) {
return other[dartx.every](dart.bind(this, 'contains'));
}
difference(other) {
dart.as(other, core.Set$(V));
return this.where(dart.fn(element => !dart.notNull(other.contains(element)), core.bool, [dart.dynamic]))[dartx.toSet]();
}
intersection(other) {
return this.where(dart.bind(other, 'contains'))[dartx.toSet]();
}
lookup(element) {
return this[_baseMap].get(dart.dcall(this[_keyForValue], element));
}
remove(value) {
if (value != null && !dart.is(value, V))
return false;
let key = dart.dcall(this[_keyForValue], value);
if (!dart.notNull(this[_baseMap].containsKey(key)))
return false;
this[_baseMap].remove(key);
return true;
}
removeAll(elements) {
return elements[dartx.forEach](dart.bind(this, 'remove'));
}
removeWhere(test) {
dart.as(test, dart.functionType(core.bool, [V]));
let toRemove = [];
this[_baseMap].forEach(dart.fn((key, value) => {
if (dart.notNull(test(dart.as(value, V))))
toRemove[dartx.add](key);
}));
toRemove[dartx.forEach](dart.bind(this[_baseMap], 'remove'));
}
retainAll(elements) {
let valuesToRetain = core.Set$(V).identity();
for (let element of elements) {
if (element != null && !dart.is(element, V))
continue;
let key = dart.dcall(this[_keyForValue], element);
if (!dart.notNull(this[_baseMap].containsKey(key)))
continue;
valuesToRetain.add(this[_baseMap].get(key));
}
let keysToRemove = [];
this[_baseMap].forEach(dart.fn((k, v) => {
if (!dart.notNull(valuesToRetain.contains(v)))
keysToRemove[dartx.add](k);
}));
keysToRemove[dartx.forEach](dart.bind(this[_baseMap], 'remove'));
}
retainWhere(test) {
dart.as(test, dart.functionType(core.bool, [V]));
return this.removeWhere(dart.fn(element => !dart.notNull(test(dart.as(element, V))), core.bool, [dart.dynamic]));
}
union(other) {
dart.as(other, core.Set$(V));
return (() => {
let _ = this.toSet();
_.addAll(other);
return _;
})();
}
}
MapValueSet[dart.implements] = () => [core.Set$(V)];
dart.setSignature(MapValueSet, {
constructors: () => ({MapValueSet: [MapValueSet$(K, V), [core.Map$(K, V), dart.functionType(K, [V])]]}),
methods: () => ({
add: [core.bool, [V]],
addAll: [dart.void, [core.Iterable$(V)]],
clear: [dart.void, []],
containsAll: [core.bool, [core.Iterable$(core.Object)]],
difference: [core.Set$(V), [core.Set$(V)]],
intersection: [core.Set$(V), [core.Set$(core.Object)]],
lookup: [V, [core.Object]],
remove: [core.bool, [core.Object]],
removeAll: [dart.void, [core.Iterable$(core.Object)]],
removeWhere: [dart.void, [dart.functionType(core.bool, [V])]],
retainAll: [dart.void, [core.Iterable$(core.Object)]],
retainWhere: [dart.void, [dart.functionType(core.bool, [V])]],
union: [core.Set$(V), [core.Set$(V)]]
})
});
dart.defineExtensionMembers(MapValueSet, [
'contains',
'toString',
'isEmpty',
'isNotEmpty',
'length'
]);
return MapValueSet;
});
let MapValueSet = MapValueSet$();
let __CastType0$ = dart.generic(function(V) {
let __CastType0 = dart.typedef('__CastType0', () => dart.functionType(V, []));
return __CastType0;
});
let __CastType0 = __CastType0$();
// Exports:
exports.DelegatingIterable$ = DelegatingIterable$;
exports.DelegatingIterable = DelegatingIterable;
exports.DelegatingList$ = DelegatingList$;
exports.DelegatingList = DelegatingList;
exports.DelegatingSet$ = DelegatingSet$;
exports.DelegatingSet = DelegatingSet;
exports.DelegatingQueue$ = DelegatingQueue$;
exports.DelegatingQueue = DelegatingQueue;
exports.DelegatingMap$ = DelegatingMap$;
exports.DelegatingMap = DelegatingMap;
exports.MapKeySet$ = MapKeySet$;
exports.MapValueSet$ = MapValueSet$;
exports.MapValueSet = MapValueSet;
});

View file

@ -0,0 +1,21 @@
// Messages from compiling wrappers.dart
warning: [DownCastComposite] _base (Iterable<E>) will need runtime check to cast to type List<E> (package:collection/wrappers.dart, line 120, col 28)
warning: [DownCastComposite] _base (Iterable<E>) will need runtime check to cast to type Set<E> (package:collection/wrappers.dart, line 219, col 26)
warning: [DownCastComposite] _base (Iterable<E>) will need runtime check to cast to type Queue<E> (package:collection/wrappers.dart, line 272, col 30)
warning: [DownCastComposite] _keyForValue(value) (dynamic) will need runtime check to cast to type K (package:collection/wrappers.dart, line 483, col 13)
warning: [UninferredClosure] () {result = true; return value;} (() → dynamic) will need runtime check to cast to type () → V (package:collection/wrappers.dart, line 485, col 31)
warning: [DownCastComposite] value (dynamic) will need runtime check to cast to type V (package:collection/wrappers.dart, line 536, col 16)
warning: [DownCastComposite] element (dynamic) will need runtime check to cast to type V (package:collection/wrappers.dart, line 558, col 38)
info: [InferredTypeClosure] (element) => !other.contains(element) has inferred type (E) → bool (package:collection/wrappers.dart, line 397, col 13)
info: [NonGroundTypeCheckInfo] Runtime check on non-ground type V may throw StrongModeError (package:collection/wrappers.dart, line 470, col 28)
info: [DynamicInvoke] _keyForValue(element) requires dynamic invoke (package:collection/wrappers.dart, line 471, col 33)
info: [DynamicInvoke] _keyForValue(value) requires dynamic invoke (package:collection/wrappers.dart, line 483, col 13)
info: [InferredTypeClosure] (element) => !other.contains(element) has inferred type (V) → bool (package:collection/wrappers.dart, line 508, col 13)
info: [DynamicInvoke] _keyForValue(element) requires dynamic invoke (package:collection/wrappers.dart, line 521, col 40)
info: [NonGroundTypeCheckInfo] Runtime check on non-ground type V may throw StrongModeError (package:collection/wrappers.dart, line 524, col 26)
info: [DynamicInvoke] _keyForValue(value) requires dynamic invoke (package:collection/wrappers.dart, line 525, col 15)
info: [InferredTypeClosure] (key, value) {if (test(value)) toRemove.add(key);} has inferred type (K, V) → void (package:collection/wrappers.dart, line 535, col 22)
info: [NonGroundTypeCheckInfo] Runtime check on non-ground type V may throw StrongModeError (package:collection/wrappers.dart, line 544, col 30)
info: [DynamicInvoke] _keyForValue(element) requires dynamic invoke (package:collection/wrappers.dart, line 545, col 17)
info: [InferredTypeClosure] (k, v) {if (!valuesToRetain.contains(v)) keysToRemove.add(k);} has inferred type (K, V) → void (package:collection/wrappers.dart, line 551, col 22)
info: [InferredTypeClosure] (element) => !test(element) has inferred type (V) → bool (package:collection/wrappers.dart, line 558, col 19)

View file

@ -0,0 +1 @@
// Messages from compiling html_input_a.dart

View file

@ -0,0 +1 @@
// Messages from compiling html_input_b.dart

View file

@ -0,0 +1 @@
// Messages from compiling html_input_c.dart

View file

@ -0,0 +1 @@
// Messages from compiling html_input_d.dart

View file

@ -0,0 +1 @@
// Messages from compiling html_input_e.dart

View file

@ -0,0 +1 @@
// Messages from compiling dom.dart

View file

@ -0,0 +1,4 @@
// Messages from compiling expect.dart
info: [DynamicCast] expected (dynamic) will need runtime check to cast to type String (package:expect/expect.dart, line 97, col 51)
info: [DynamicCast] actual (dynamic) will need runtime check to cast to type String (package:expect/expect.dart, line 97, col 61)
info: [DynamicInvoke] check(e) requires dynamic invoke (package:expect/expect.dart, line 372, col 14)

View file

@ -1 +0,0 @@
// Messages from compiling html_input.html

View file

@ -0,0 +1 @@
// Messages from compiling circle.dart

View file

@ -0,0 +1 @@
// Messages from compiling dom.dart

View file

@ -0,0 +1 @@
// Messages from compiling painter.dart

View file

@ -1,2 +1,2 @@
// Messages from compiling sunflower.html
// Messages from compiling sunflower.dart
info: [InferredTypeClosure] (e) => draw() has inferred type (Event) → void (test/codegen/sunflower/sunflower.dart, line 29, col 37)

View file

@ -1,7 +1,4 @@
// Messages from compiling syncstar_syntax.dart
info: [DynamicCast] expected (dynamic) will need runtime check to cast to type String (package:expect/expect.dart, line 97, col 51)
info: [DynamicCast] actual (dynamic) will need runtime check to cast to type String (package:expect/expect.dart, line 97, col 61)
info: [DynamicInvoke] check(e) requires dynamic invoke (package:expect/expect.dart, line 372, col 14)
info: [InferredTypeLiteral] [2, 3] has inferred type Iterable<int> (test/codegen/syncstar_syntax.dart, line 9, col 10)
info: [InferredTypeLiteral] [2, 3] has inferred type Iterable<int> (test/codegen/syncstar_syntax.dart, line 15, col 12)
info: [InferredTypeLiteral] [2, 3] has inferred type Iterable<int> (test/codegen/syncstar_syntax.dart, line 20, col 12)

View file

@ -1,194 +1,4 @@
// Messages from compiling unittest.dart
warning: [DownCastComposite] arg0 (dynamic) will need runtime check to cast to type Iterable<Matcher> (package:matcher/src/operator_matchers.dart, line 106, col 16)
warning: [DownCastComposite] [arg0, arg1, arg2, arg3, arg4, arg5, arg6].where((e) => e != null) (Iterable<dynamic>) will need runtime check to cast to type Iterable<Matcher> (package:matcher/src/operator_matchers.dart, line 109, col 9)
warning: [DownCastComposite] x (dynamic) will need runtime check to cast to type (dynamic) → bool (package:matcher/src/util.dart, line 42, col 22)
warning: [UninferredClosure] (match) {var mapped = _escapeMap[match[0]]; if (mapped != null) return mapped; return _getHexLiteral(match[0]);} ((dynamic) → dynamic) will need runtime check to cast to type (Match) → String (package:matcher/src/util.dart, line 54, col 46)
info: [DynamicCast] item.isEmpty (dynamic) will need runtime check to cast to type bool (package:matcher/src/core_matchers.dart, line 17, col 41)
info: [DynamicInvoke] item.isEmpty requires dynamic invoke (package:matcher/src/core_matchers.dart, line 17, col 41)
info: [DynamicCast] item.isNotEmpty (dynamic) will need runtime check to cast to type bool (package:matcher/src/core_matchers.dart, line 28, col 41)
info: [DynamicInvoke] item.isNotEmpty requires dynamic invoke (package:matcher/src/core_matchers.dart, line 28, col 41)
info: [DynamicCast] item (dynamic) will need runtime check to cast to type num (package:matcher/src/core_matchers.dart, line 77, col 62)
info: [DynamicCast] item (dynamic) will need runtime check to cast to type num (package:matcher/src/core_matchers.dart, line 83, col 62)
info: [DynamicCast] expected (dynamic) will need runtime check to cast to type String (package:matcher/src/core_matchers.dart, line 110, col 32)
info: [DynamicInvoke] expected.iterator requires dynamic invoke (package:matcher/src/core_matchers.dart, line 124, col 28)
info: [DynamicInvoke] actual.iterator requires dynamic invoke (package:matcher/src/core_matchers.dart, line 125, col 26)
info: [DynamicInvoke] expectedIterator.moveNext() requires dynamic invoke (package:matcher/src/core_matchers.dart, line 128, col 26)
info: [DynamicInvoke] actualIterator.moveNext() requires dynamic invoke (package:matcher/src/core_matchers.dart, line 129, col 24)
info: [DynamicCast] expectedNext (dynamic) will need runtime check to cast to type bool (package:matcher/src/core_matchers.dart, line 132, col 12)
info: [DynamicCast] actualNext (dynamic) will need runtime check to cast to type bool (package:matcher/src/core_matchers.dart, line 132, col 29)
info: [DynamicCast] expectedNext (dynamic) will need runtime check to cast to type bool (package:matcher/src/core_matchers.dart, line 136, col 12)
info: [DynamicCast] actualNext (dynamic) will need runtime check to cast to type bool (package:matcher/src/core_matchers.dart, line 137, col 12)
info: [DynamicInvoke] matcher(expectedIterator.current, actualIterator.current, newLocation, depth) requires dynamic invoke (package:matcher/src/core_matchers.dart, line 140, col 16)
info: [DynamicInvoke] expectedIterator.current requires dynamic invoke (package:matcher/src/core_matchers.dart, line 141, col 11)
info: [DynamicInvoke] actualIterator.current requires dynamic invoke (package:matcher/src/core_matchers.dart, line 141, col 37)
info: [DynamicCast] rp (dynamic) will need runtime check to cast to type List<dynamic> (package:matcher/src/core_matchers.dart, line 142, col 30)
info: [DynamicInvoke] actual.toSet() requires dynamic invoke (package:matcher/src/core_matchers.dart, line 148, col 14)
info: [DynamicCast] actual.every((actualElement) => matcher(expectedElement, actualElement, location, depth) != null) (dynamic) will need runtime check to cast to type bool (package:matcher/src/core_matchers.dart, line 151, col 11)
info: [DynamicInvoke] actual.every((actualElement) => matcher(expectedElement, actualElement, location, depth) != null) requires dynamic invoke (package:matcher/src/core_matchers.dart, line 151, col 11)
info: [DynamicInvoke] matcher(expectedElement, actualElement, location, depth) requires dynamic invoke (package:matcher/src/core_matchers.dart, line 152, col 11)
info: [DynamicCast] actual.length > expected.length (dynamic) will need runtime check to cast to type bool (package:matcher/src/core_matchers.dart, line 157, col 9)
info: [DynamicInvoke] actual.length > expected.length requires dynamic invoke (package:matcher/src/core_matchers.dart, line 157, col 9)
info: [DynamicInvoke] actual.length requires dynamic invoke (package:matcher/src/core_matchers.dart, line 157, col 9)
info: [DynamicCast] actual.length < expected.length (dynamic) will need runtime check to cast to type bool (package:matcher/src/core_matchers.dart, line 159, col 16)
info: [DynamicInvoke] actual.length < expected.length requires dynamic invoke (package:matcher/src/core_matchers.dart, line 159, col 16)
info: [DynamicInvoke] actual.length requires dynamic invoke (package:matcher/src/core_matchers.dart, line 159, col 16)
info: [DynamicCast] expected.matches(actual, matchState) (dynamic) will need runtime check to cast to type bool (package:matcher/src/core_matchers.dart, line 170, col 11)
info: [DynamicInvoke] expected.matches(actual, matchState) requires dynamic invoke (package:matcher/src/core_matchers.dart, line 170, col 11)
info: [DynamicInvoke] expected.describe(description) requires dynamic invoke (package:matcher/src/core_matchers.dart, line 173, col 7)
info: [DynamicCast] expected (dynamic) will need runtime check to cast to type Set<dynamic> (package:matcher/src/core_matchers.dart, line 191, col 13)
info: [DynamicInvoke] expected.length requires dynamic invoke (package:matcher/src/core_matchers.dart, line 198, col 20)
info: [DynamicInvoke] actual.length requires dynamic invoke (package:matcher/src/core_matchers.dart, line 198, col 39)
info: [DynamicCast] expected.keys (dynamic) will need runtime check to cast to type Iterable<dynamic> (package:matcher/src/core_matchers.dart, line 201, col 25)
info: [DynamicInvoke] expected.keys requires dynamic invoke (package:matcher/src/core_matchers.dart, line 201, col 25)
info: [DynamicCast] actual.containsKey(key) (dynamic) will need runtime check to cast to type bool (package:matcher/src/core_matchers.dart, line 202, col 16)
info: [DynamicInvoke] actual.containsKey(key) requires dynamic invoke (package:matcher/src/core_matchers.dart, line 202, col 16)
info: [DynamicCast] actual.keys (dynamic) will need runtime check to cast to type Iterable<dynamic> (package:matcher/src/core_matchers.dart, line 207, col 25)
info: [DynamicInvoke] actual.keys requires dynamic invoke (package:matcher/src/core_matchers.dart, line 207, col 25)
info: [DynamicCast] expected.containsKey(key) (dynamic) will need runtime check to cast to type bool (package:matcher/src/core_matchers.dart, line 208, col 16)
info: [DynamicInvoke] expected.containsKey(key) requires dynamic invoke (package:matcher/src/core_matchers.dart, line 208, col 16)
info: [DynamicCast] expected.keys (dynamic) will need runtime check to cast to type Iterable<dynamic> (package:matcher/src/core_matchers.dart, line 213, col 25)
info: [DynamicInvoke] expected.keys requires dynamic invoke (package:matcher/src/core_matchers.dart, line 213, col 25)
info: [DynamicInvoke] expected[key] requires dynamic invoke (package:matcher/src/core_matchers.dart, line 215, col 15)
info: [DynamicInvoke] actual[key] requires dynamic invoke (package:matcher/src/core_matchers.dart, line 215, col 30)
info: [DynamicCast] rp[0].length > 0 (dynamic) will need runtime check to cast to type bool (package:matcher/src/core_matchers.dart, line 244, col 9)
info: [DynamicInvoke] rp[0].length > 0 requires dynamic invoke (package:matcher/src/core_matchers.dart, line 244, col 9)
info: [DynamicInvoke] rp[0].length requires dynamic invoke (package:matcher/src/core_matchers.dart, line 244, col 9)
info: [DynamicCast] rp[1].length > 0 (dynamic) will need runtime check to cast to type bool (package:matcher/src/core_matchers.dart, line 245, col 11)
info: [DynamicInvoke] rp[1].length > 0 requires dynamic invoke (package:matcher/src/core_matchers.dart, line 245, col 11)
info: [DynamicInvoke] rp[1].length requires dynamic invoke (package:matcher/src/core_matchers.dart, line 245, col 11)
info: [DynamicCast] reason (dynamic) will need runtime check to cast to type String (package:matcher/src/core_matchers.dart, line 255, col 12)
info: [DynamicInvoke] reason.length requires dynamic invoke (package:matcher/src/core_matchers.dart, line 271, col 9)
info: [DynamicCast] reason (dynamic) will need runtime check to cast to type String (package:matcher/src/core_matchers.dart, line 274, col 31)
info: [DynamicCast] item (dynamic) will need runtime check to cast to type String (package:matcher/src/core_matchers.dart, line 300, col 32)
info: [NonGroundTypeCheckInfo] Runtime check on non-ground type T may throw StrongModeError (package:matcher/src/core_matchers.dart, line 378, col 40)
info: [DynamicInvoke] f() requires dynamic invoke (package:matcher/src/core_matchers.dart, line 397, col 7)
info: [DynamicCast] item.length * item.length >= 0 (dynamic) will need runtime check to cast to type bool (package:matcher/src/core_matchers.dart, line 473, col 11)
info: [DynamicInvoke] item.length * item.length >= 0 requires dynamic invoke (package:matcher/src/core_matchers.dart, line 473, col 11)
info: [DynamicInvoke] item.length * item.length requires dynamic invoke (package:matcher/src/core_matchers.dart, line 473, col 11)
info: [DynamicInvoke] item.length requires dynamic invoke (package:matcher/src/core_matchers.dart, line 473, col 11)
info: [DynamicInvoke] item.length requires dynamic invoke (package:matcher/src/core_matchers.dart, line 473, col 25)
info: [DynamicInvoke] item.length requires dynamic invoke (package:matcher/src/core_matchers.dart, line 474, col 33)
info: [DynamicCast] item.length * item.length >= 0 (dynamic) will need runtime check to cast to type bool (package:matcher/src/core_matchers.dart, line 488, col 11)
info: [DynamicInvoke] item.length * item.length >= 0 requires dynamic invoke (package:matcher/src/core_matchers.dart, line 488, col 11)
info: [DynamicInvoke] item.length * item.length requires dynamic invoke (package:matcher/src/core_matchers.dart, line 488, col 11)
info: [DynamicInvoke] item.length requires dynamic invoke (package:matcher/src/core_matchers.dart, line 488, col 11)
info: [DynamicInvoke] item.length requires dynamic invoke (package:matcher/src/core_matchers.dart, line 488, col 25)
info: [DynamicInvoke] item.length requires dynamic invoke (package:matcher/src/core_matchers.dart, line 491, col 31)
info: [DynamicCast] item.indexOf(_expected) >= 0 (dynamic) will need runtime check to cast to type bool (package:matcher/src/core_matchers.dart, line 514, col 14)
info: [DynamicInvoke] item.indexOf(_expected) >= 0 requires dynamic invoke (package:matcher/src/core_matchers.dart, line 514, col 14)
info: [DynamicInvoke] item.indexOf(_expected) requires dynamic invoke (package:matcher/src/core_matchers.dart, line 514, col 14)
info: [DynamicCast] item.any((e) => _expected.matches(e, matchState)) (dynamic) will need runtime check to cast to type bool (package:matcher/src/core_matchers.dart, line 517, col 16)
info: [DynamicInvoke] item.any((e) => _expected.matches(e, matchState)) requires dynamic invoke (package:matcher/src/core_matchers.dart, line 517, col 16)
info: [DynamicInvoke] _expected.matches(e, matchState) requires dynamic invoke (package:matcher/src/core_matchers.dart, line 517, col 32)
info: [DynamicCast] item.contains(_expected) (dynamic) will need runtime check to cast to type bool (package:matcher/src/core_matchers.dart, line 519, col 16)
info: [DynamicInvoke] item.contains(_expected) requires dynamic invoke (package:matcher/src/core_matchers.dart, line 519, col 16)
info: [DynamicCast] item.containsKey(_expected) (dynamic) will need runtime check to cast to type bool (package:matcher/src/core_matchers.dart, line 522, col 14)
info: [DynamicInvoke] item.containsKey(_expected) requires dynamic invoke (package:matcher/src/core_matchers.dart, line 522, col 14)
info: [DynamicCast] _expected.indexOf(item) >= 0 (dynamic) will need runtime check to cast to type bool (package:matcher/src/core_matchers.dart, line 552, col 14)
info: [DynamicInvoke] _expected.indexOf(item) >= 0 requires dynamic invoke (package:matcher/src/core_matchers.dart, line 552, col 14)
info: [DynamicInvoke] _expected.indexOf(item) requires dynamic invoke (package:matcher/src/core_matchers.dart, line 552, col 14)
info: [DynamicCast] _expected.any((e) => e == item) (dynamic) will need runtime check to cast to type bool (package:matcher/src/core_matchers.dart, line 554, col 14)
info: [DynamicInvoke] _expected.any((e) => e == item) requires dynamic invoke (package:matcher/src/core_matchers.dart, line 554, col 14)
info: [DynamicCast] _expected.containsKey(item) (dynamic) will need runtime check to cast to type bool (package:matcher/src/core_matchers.dart, line 556, col 14)
info: [DynamicInvoke] _expected.containsKey(item) requires dynamic invoke (package:matcher/src/core_matchers.dart, line 556, col 14)
info: [DynamicInvoke] _matcher(item) requires dynamic invoke (package:matcher/src/core_matchers.dart, line 582, col 41)
info: [DynamicCast] matchState['state'] (dynamic) will need runtime check to cast to type Map<dynamic, dynamic> (package:matcher/src/core_matchers.dart, line 637, col 50)
info: [DynamicInvoke] value.describe(this) requires dynamic invoke (package:matcher/src/description.dart, line 44, col 7)
info: [DynamicCast] item (dynamic) will need runtime check to cast to type Iterable<dynamic> (package:matcher/src/iterable_matchers.dart, line 26, col 25)
info: [DynamicCast] matchState['state'] (dynamic) will need runtime check to cast to type Map<dynamic, dynamic> (package:matcher/src/iterable_matchers.dart, line 50, col 36)
info: [DynamicCast] item.any((e) => _matcher.matches(e, matchState)) (dynamic) will need runtime check to cast to type bool (package:matcher/src/iterable_matchers.dart, line 75, col 12)
info: [DynamicInvoke] item.any((e) => _matcher.matches(e, matchState)) requires dynamic invoke (package:matcher/src/iterable_matchers.dart, line 75, col 12)
info: [DynamicInvoke] item.toList() requires dynamic invoke (package:matcher/src/iterable_matchers.dart, line 161, col 12)
info: [DynamicCast] item.length (dynamic) will need runtime check to cast to type num (package:matcher/src/iterable_matchers.dart, line 164, col 28)
info: [DynamicInvoke] item.length requires dynamic invoke (package:matcher/src/iterable_matchers.dart, line 164, col 28)
info: [DynamicInvoke] item.length requires dynamic invoke (package:matcher/src/iterable_matchers.dart, line 165, col 39)
info: [DynamicCast] item.length (dynamic) will need runtime check to cast to type num (package:matcher/src/iterable_matchers.dart, line 166, col 35)
info: [DynamicInvoke] item.length requires dynamic invoke (package:matcher/src/iterable_matchers.dart, line 166, col 35)
info: [DynamicInvoke] item.length requires dynamic invoke (package:matcher/src/iterable_matchers.dart, line 167, col 40)
info: [DynamicCast] item.length (dynamic) will need runtime check to cast to type int (package:matcher/src/iterable_matchers.dart, line 170, col 41)
info: [DynamicInvoke] item.length requires dynamic invoke (package:matcher/src/iterable_matchers.dart, line 170, col 41)
info: [DynamicCast] item (dynamic) will need runtime check to cast to type Iterable<dynamic> (package:matcher/src/iterable_matchers.dart, line 175, col 33)
info: [DynamicInvoke] item.length requires dynamic invoke (package:matcher/src/iterable_matchers.dart, line 230, col 9)
info: [DynamicInvoke] item.iterator requires dynamic invoke (package:matcher/src/iterable_matchers.dart, line 231, col 20)
info: [DynamicInvoke] iterator.moveNext() requires dynamic invoke (package:matcher/src/iterable_matchers.dart, line 234, col 7)
info: [DynamicInvoke] _comparator(e, iterator.current) requires dynamic invoke (package:matcher/src/iterable_matchers.dart, line 235, col 12)
info: [DynamicInvoke] iterator.current requires dynamic invoke (package:matcher/src/iterable_matchers.dart, line 235, col 27)
info: [DynamicInvoke] iterator.current requires dynamic invoke (package:matcher/src/iterable_matchers.dart, line 239, col 21)
info: [DynamicInvoke] item.length requires dynamic invoke (package:matcher/src/iterable_matchers.dart, line 255, col 16)
info: [DynamicInvoke] item.length requires dynamic invoke (package:matcher/src/iterable_matchers.dart, line 257, col 30)
info: [DynamicCast] item.containsValue(_value) (dynamic) will need runtime check to cast to type bool (package:matcher/src/map_matchers.dart, line 18, col 41)
info: [DynamicInvoke] item.containsValue(_value) requires dynamic invoke (package:matcher/src/map_matchers.dart, line 18, col 41)
info: [DynamicCast] item.containsKey(_key) (dynamic) will need runtime check to cast to type bool (package:matcher/src/map_matchers.dart, line 35, col 7)
info: [DynamicInvoke] item.containsKey(_key) requires dynamic invoke (package:matcher/src/map_matchers.dart, line 35, col 7)
info: [DynamicInvoke] item[_key] requires dynamic invoke (package:matcher/src/map_matchers.dart, line 35, col 55)
info: [DynamicCast] item.containsKey(_key) (dynamic) will need runtime check to cast to type bool (package:matcher/src/map_matchers.dart, line 47, col 10)
info: [DynamicInvoke] item.containsKey(_key) requires dynamic invoke (package:matcher/src/map_matchers.dart, line 47, col 10)
info: [DynamicInvoke] item[_key] requires dynamic invoke (package:matcher/src/map_matchers.dart, line 57, col 11)
info: [DynamicCast] item < _value (dynamic) will need runtime check to cast to type bool (package:matcher/src/numeric_matchers.dart, line 81, col 16)
info: [DynamicInvoke] item < _value requires dynamic invoke (package:matcher/src/numeric_matchers.dart, line 81, col 16)
info: [DynamicInvoke] item - _value requires dynamic invoke (package:matcher/src/numeric_matchers.dart, line 122, col 16)
info: [DynamicCast] diff < 0 (dynamic) will need runtime check to cast to type bool (package:matcher/src/numeric_matchers.dart, line 123, col 9)
info: [DynamicInvoke] diff < 0 requires dynamic invoke (package:matcher/src/numeric_matchers.dart, line 123, col 9)
info: [DynamicInvoke] -diff requires dynamic invoke (package:matcher/src/numeric_matchers.dart, line 123, col 26)
info: [DynamicCast] diff <= _delta (dynamic) will need runtime check to cast to type bool (package:matcher/src/numeric_matchers.dart, line 124, col 13)
info: [DynamicInvoke] diff <= _delta requires dynamic invoke (package:matcher/src/numeric_matchers.dart, line 124, col 13)
info: [DynamicInvoke] item - _value requires dynamic invoke (package:matcher/src/numeric_matchers.dart, line 138, col 18)
info: [DynamicCast] diff < 0 (dynamic) will need runtime check to cast to type bool (package:matcher/src/numeric_matchers.dart, line 139, col 11)
info: [DynamicInvoke] diff < 0 requires dynamic invoke (package:matcher/src/numeric_matchers.dart, line 139, col 11)
info: [DynamicInvoke] -diff requires dynamic invoke (package:matcher/src/numeric_matchers.dart, line 139, col 28)
info: [DynamicCast] value < _low (dynamic) will need runtime check to cast to type bool (package:matcher/src/numeric_matchers.dart, line 176, col 9)
info: [DynamicInvoke] value < _low requires dynamic invoke (package:matcher/src/numeric_matchers.dart, line 176, col 9)
info: [DynamicCast] value > _high (dynamic) will need runtime check to cast to type bool (package:matcher/src/numeric_matchers.dart, line 176, col 25)
info: [DynamicInvoke] value > _high requires dynamic invoke (package:matcher/src/numeric_matchers.dart, line 176, col 25)
info: [DynamicInvoke] matcher.describeMismatch(item, mismatchDescription, matchState['state'], verbose) requires dynamic invoke (package:matcher/src/operator_matchers.dart, line 52, col 5)
info: [InferredTypeClosure] (e) => wrapMatcher(e) has inferred type (Matcher) → dynamic (package:matcher/src/operator_matchers.dart, line 112, col 23)
info: [DynamicInvoke] object.describe(description) requires dynamic invoke (package:matcher/src/pretty_print.dart, line 25, col 7)
info: [DynamicInvoke] object.map(pp) requires dynamic invoke (package:matcher/src/pretty_print.dart, line 39, col 21)
info: [DynamicInvoke] object.map(pp).toList() requires dynamic invoke (package:matcher/src/pretty_print.dart, line 39, col 21)
info: [DynamicCast] strings.length > maxItems (dynamic) will need runtime check to cast to type bool (package:matcher/src/pretty_print.dart, line 40, col 31)
info: [DynamicInvoke] strings.length > maxItems requires dynamic invoke (package:matcher/src/pretty_print.dart, line 40, col 31)
info: [DynamicInvoke] strings.length requires dynamic invoke (package:matcher/src/pretty_print.dart, line 40, col 31)
info: [DynamicInvoke] strings.replaceRange(maxItems - 1, strings.length, ['...']) requires dynamic invoke (package:matcher/src/pretty_print.dart, line 41, col 9)
info: [DynamicInvoke] strings.length requires dynamic invoke (package:matcher/src/pretty_print.dart, line 41, col 44)
info: [DynamicInvoke] strings.join(', ') requires dynamic invoke (package:matcher/src/pretty_print.dart, line 46, col 33)
info: [DynamicInvoke] strings.map((string) {return _indent(indent + 2) + string;}) requires dynamic invoke (package:matcher/src/pretty_print.dart, line 54, col 27)
info: [DynamicCast] strings.map((string) {return _indent(indent + 2) + string;}).join(",\n") (dynamic) will need runtime check to cast to type String (package:matcher/src/pretty_print.dart, line 54, col 27)
info: [DynamicInvoke] strings.map((string) {return _indent(indent + 2) + string;}).join(",\n") requires dynamic invoke (package:matcher/src/pretty_print.dart, line 54, col 27)
info: [DynamicCast] string (dynamic) will need runtime check to cast to type String (package:matcher/src/pretty_print.dart, line 55, col 38)
info: [DynamicInvoke] object.keys requires dynamic invoke (package:matcher/src/pretty_print.dart, line 59, col 21)
info: [DynamicInvoke] object.keys.map((key) {return '${pp(key)}: ${pp(object[key])}';}) requires dynamic invoke (package:matcher/src/pretty_print.dart, line 59, col 21)
info: [DynamicInvoke] object.keys.map((key) {return '${pp(key)}: ${pp(object[key])}';}).toList() requires dynamic invoke (package:matcher/src/pretty_print.dart, line 59, col 21)
info: [DynamicInvoke] object[key] requires dynamic invoke (package:matcher/src/pretty_print.dart, line 60, col 34)
info: [DynamicCast] strings.length > maxItems (dynamic) will need runtime check to cast to type bool (package:matcher/src/pretty_print.dart, line 64, col 31)
info: [DynamicInvoke] strings.length > maxItems requires dynamic invoke (package:matcher/src/pretty_print.dart, line 64, col 31)
info: [DynamicInvoke] strings.length requires dynamic invoke (package:matcher/src/pretty_print.dart, line 64, col 31)
info: [DynamicInvoke] strings.replaceRange(maxItems - 1, strings.length, ['...']) requires dynamic invoke (package:matcher/src/pretty_print.dart, line 65, col 9)
info: [DynamicInvoke] strings.length requires dynamic invoke (package:matcher/src/pretty_print.dart, line 65, col 44)
info: [DynamicInvoke] strings.join(", ") requires dynamic invoke (package:matcher/src/pretty_print.dart, line 70, col 28)
info: [DynamicInvoke] strings.map((string) {return _indent(indent + 2) + string;}) requires dynamic invoke (package:matcher/src/pretty_print.dart, line 78, col 22)
info: [DynamicCast] strings.map((string) {return _indent(indent + 2) + string;}).join(",\n") (dynamic) will need runtime check to cast to type String (package:matcher/src/pretty_print.dart, line 78, col 22)
info: [DynamicInvoke] strings.map((string) {return _indent(indent + 2) + string;}).join(",\n") requires dynamic invoke (package:matcher/src/pretty_print.dart, line 78, col 22)
info: [DynamicCast] string (dynamic) will need runtime check to cast to type String (package:matcher/src/pretty_print.dart, line 79, col 38)
info: [DynamicInvoke] object.split("\n") requires dynamic invoke (package:matcher/src/pretty_print.dart, line 83, col 19)
info: [DynamicInvoke] lines.map(_escapeString) requires dynamic invoke (package:matcher/src/pretty_print.dart, line 85, col 11)
info: [DynamicCast] lines.map(_escapeString).join("\\n'\n${_indent(indent + 2)}'") (dynamic) will need runtime check to cast to type String (package:matcher/src/pretty_print.dart, line 85, col 11)
info: [DynamicInvoke] lines.map(_escapeString).join("\\n'\n${_indent(indent + 2)}'") requires dynamic invoke (package:matcher/src/pretty_print.dart, line 85, col 11)
info: [DynamicInvoke] item.toLowerCase() requires dynamic invoke (package:matcher/src/string_matchers.dart, line 22, col 40)
info: [DynamicCast] item (dynamic) will need runtime check to cast to type String (package:matcher/src/string_matchers.dart, line 57, col 59)
info: [DynamicCast] item (dynamic) will need runtime check to cast to type String (package:matcher/src/string_matchers.dart, line 67, col 48)
info: [DynamicCast] item.startsWith(_prefix) (dynamic) will need runtime check to cast to type bool (package:matcher/src/string_matchers.dart, line 86, col 25)
info: [DynamicInvoke] item.startsWith(_prefix) requires dynamic invoke (package:matcher/src/string_matchers.dart, line 86, col 25)
info: [DynamicCast] item.endsWith(_suffix) (dynamic) will need runtime check to cast to type bool (package:matcher/src/string_matchers.dart, line 102, col 25)
info: [DynamicInvoke] item.endsWith(_suffix) requires dynamic invoke (package:matcher/src/string_matchers.dart, line 102, col 25)
info: [DynamicCast] item.indexOf(s, from_index) (dynamic) will need runtime check to cast to type int (package:matcher/src/string_matchers.dart, line 128, col 20)
info: [DynamicInvoke] item.indexOf(s, from_index) requires dynamic invoke (package:matcher/src/string_matchers.dart, line 128, col 20)
info: [DynamicCast] re (dynamic) will need runtime check to cast to type String (package:matcher/src/string_matchers.dart, line 150, col 28)
info: [DynamicCast] re (dynamic) will need runtime check to cast to type RegExp (package:matcher/src/string_matchers.dart, line 152, col 17)
info: [DynamicCast] item (dynamic) will need runtime check to cast to type String (package:matcher/src/string_matchers.dart, line 159, col 41)
info: [DynamicCast] x (dynamic) will need runtime check to cast to type Matcher (package:matcher/src/util.dart, line 40, col 12)
info: [DynamicInvoke] match[0] requires dynamic invoke (package:matcher/src/util.dart, line 55, col 29)
info: [DynamicCast] match[0] (dynamic) will need runtime check to cast to type String (package:matcher/src/util.dart, line 57, col 27)
info: [DynamicInvoke] match[0] requires dynamic invoke (package:matcher/src/util.dart, line 57, col 27)
info: [DynamicInvoke] (window as dynamic).suite(name, body) requires dynamic invoke (test/codegen/unittest.dart, line 14, col 41)
info: [DynamicInvoke] (window as dynamic).test(name, (done) {_finishTest(f) {if (f is Future) {f.then(_finishTest);} else {done();}} _finishTest(body());}) requires dynamic invoke (test/codegen/unittest.dart, line 21, col 3)
info: [DynamicInvoke] f.then(_finishTest) requires dynamic invoke (test/codegen/unittest.dart, line 24, col 9)

View file

@ -0,0 +1,8 @@
// Messages from compiling unittest.dart
info: [DynamicInvoke] (window as dynamic).suite(name, body) requires dynamic invoke (package:unittest/unittest.dart, line 14, col 41)
info: [DynamicInvoke] (window as dynamic).test(name, (done) {_finishTest(f) {if (f is Future) {f.then(_finishTest);} else {done();}} _finishTest(body());}) requires dynamic invoke (package:unittest/unittest.dart, line 21, col 3)
info: [DynamicInvoke] f.then(_finishTest) requires dynamic invoke (package:unittest/unittest.dart, line 24, col 9)
info: [DynamicInvoke] done() requires dynamic invoke (package:unittest/unittest.dart, line 26, col 9)
info: [DynamicCast] matcher.matches(actual, matchState) (dynamic) will need runtime check to cast to type bool (package:unittest/unittest.dart, line 71, col 9)
info: [DynamicInvoke] matcher.matches(actual, matchState) requires dynamic invoke (package:unittest/unittest.dart, line 71, col 9)
info: [DynamicInvoke] formatter(actual, matcher, reason, matchState, verbose) requires dynamic invoke (package:unittest/unittest.dart, line 78, col 8)

View file

@ -65,7 +65,7 @@ main(arguments) {
var expectDir = path.join(inputDir, 'expect');
bool compile(String entryPoint, AnalysisContext context,
BatchCompiler createCompiler(AnalysisContext context,
{bool checkSdk: false, bool sourceMaps: false, bool closure: false}) {
// TODO(jmesserly): add a way to specify flags in the test file, so
// they're more self-contained.
@ -79,10 +79,23 @@ main(arguments) {
useColors: false,
checkSdk: checkSdk,
runtimeDir: runtimeDir,
inputs: [entryPoint],
inputBaseDir: inputDir);
var reporter = createErrorReporter(context, options);
return new BatchCompiler(context, options, reporter: reporter).run();
return new BatchCompiler(context, options, reporter: reporter);
}
bool compile(BatchCompiler compiler, String filePath) {
compiler.compileFromUriString(filePath, (String url) {
// Write compiler messages to disk.
var messagePath = '${path.withoutExtension(url)}.txt';
var file = new File(messagePath);
var message = '''
// Messages from compiling ${path.basenameWithoutExtension(url)}.dart
$compilerMessages''';
file.writeAsStringSync(message);
compilerMessages.clear();
});
return !compiler.failure;
}
var multitests = new Set<String>();
@ -112,6 +125,8 @@ main(arguments) {
}
}
var batchCompiler = createCompiler(realSdkContext);
for (var dir in [null, 'language']) {
if (codeCoverage && dir == 'language') continue;
@ -126,19 +141,20 @@ main(arguments) {
var filename = path.basenameWithoutExtension(filePath);
test('$filename.dart', () {
compilerMessages.writeln('// Messages from compiling $filename.dart');
// TODO(jmesserly): this was added to get some coverage of source maps
// and closure annotations.
// We need a more comprehensive strategy to test them.
var sourceMaps = filename == 'map_keys';
var closure = filename == 'closure';
var success = compile(filePath, realSdkContext,
sourceMaps: sourceMaps, closure: closure);
// Write compiler messages to disk.
new File(path.join(outDir.path, '$filename.txt'))
.writeAsStringSync('$compilerMessages');
var success;
// TODO(vsm): Is it okay to reuse the same context here? If there is
// overlap between test files, we may need separate ones for each
// compiler.
var compiler = (sourceMaps || closure)
? createCompiler(realSdkContext,
sourceMaps: sourceMaps, closure: closure)
: batchCompiler;
success = compile(compiler, filePath);
var outFile = new File(path.join(outDir.path, '$filename.js'));
expect(!success || outFile.existsSync(), true,
@ -173,7 +189,8 @@ main(arguments) {
// Get the test SDK. We use a checked in copy so test expectations can
// be generated against a specific SDK version.
compile('dart:core', testSdkContext, checkSdk: true);
var compiler = createCompiler(testSdkContext, checkSdk: true);
compile(compiler, 'dart:core');
var outFile = new File(path.join(expectDir, 'dart/core.js'));
expect(outFile.existsSync(), true,
reason: '${outFile.path} was created for dart:core');
@ -186,13 +203,7 @@ main(arguments) {
test('devc jscodegen sunflower.html', () {
var filePath = path.join(inputDir, 'sunflower', 'sunflower.html');
compilerMessages.writeln('// Messages from compiling sunflower.html');
var success = compile(filePath, realSdkContext);
// Write compiler messages to disk.
new File(path.join(expectDir, 'sunflower', 'sunflower.txt'))
.writeAsStringSync(compilerMessages.toString());
var success = compile(batchCompiler, filePath);
var expectedFiles = ['sunflower.html', 'sunflower.js',];
@ -205,13 +216,7 @@ main(arguments) {
test('devc jscodegen html_input.html', () {
var filePath = path.join(inputDir, 'html_input.html');
compilerMessages.writeln('// Messages from compiling html_input.html');
var success = compile(filePath, realSdkContext);
// Write compiler messages to disk.
new File(path.join(expectDir, 'html_input.txt'))
.writeAsStringSync(compilerMessages.toString());
var success = compile(batchCompiler, filePath);
var expectedFiles = [
'html_input.html',