Version 1.11.0-dev.0.0
svn merge -r 45051:45518 https://dart.googlecode.com/svn/branches/bleeding_edge trunk
git-svn-id: http://dart.googlecode.com/svn/trunk@45519 260f80e4-7a28-3924-810f-c04153c831b5
diff --git a/CHANGELOG.md b/CHANGELOG.md
index c4321b3..d236bf7 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,4 +1,83 @@
-## 1.9.1 (2015-03-25)
+## 1.11.0
+
+### Core library changes
+
+* `dart:core`
+ * Add `unmodifiable` constructor to `List` -
+ [r45334](https://code.google.com/p/dart/source/detail?r=45334)
+* `dart:isolate` *Experimental*
+ * Make the `priority` parameter of `Isolate.ping` and `Isolate.kill` methods
+ a named parameter.
+ * Remove the `Isolate.AS_EVENT` priority.
+ * Add extra `response` parameter to `Isolate.ping` and
+ `Isolate.addOnExitListener` -
+ [r45092](https://code.google.com/p/dart/source/detail?r=45092)
+
+## 1.10.0 – 2015-04-29
+
+### Core library changes
+
+* `dart:convert`
+ * **POTENTIALLY BREAKING** Fix behavior of `HtmlEscape`. It no longer escapes
+ no-break space (U+00A0) anywhere or forward slash (`/`, `U+002F`) in element
+ context. Slash is still escaped using `HtmlEscapeMode.UNKNOWN`.
+ [r45003](https://code.google.com/p/dart/source/detail?r=45003),
+ [r45153](https://code.google.com/p/dart/source/detail?r=45153),
+ [r45189](https://code.google.com/p/dart/source/detail?r=45189)
+
+* `dart:core`
+ * `Uri.parse` added `start` and `end` positional arguments.
+
+* `dart:html`
+ * **POTENTIALLY BREAKING** `CssClassSet` method arguments must now be 'tokens', i.e. non-empty
+ strings with no white-space characters. The implementation was incorrect for
+ class names containing spaces. The fix is to forbid spaces and provide a
+ faster implementation.
+ [Announcement](https://groups.google.com/a/dartlang.org/d/msg/announce/jmUI2XJHfC8/UZUCvJH3p2oJ)
+
+* `dart:io`
+
+ * `ProcessResult` now exposes a constructor.
+ * `import` and `Isolate.spawnUri` now supports the
+ [Data URI scheme](http://en.wikipedia.org/wiki/Data_URI_scheme) on the VM.
+
+## Tool Changes
+
+### pub
+
+ * Running `pub run foo` within a package now runs the `foo` executable defined
+ by the `foo` package. The previous behavior ran `bin/foo`. This makes it
+ easy to run binaries in dependencies, for instance `pub run test`.
+
+ * On Mac and Linux, signals sent to `pub run` and forwarded to the child
+ command.
+
+## 1.9.3 – 2015-04-14
+
+This is a bug fix release which merges a number of commits from `bleeding_edge`.
+
+* dart2js: Addresses as issue with minified Javascript output with CSP enabled -
+ [r44453](https://code.google.com/p/dart/source/detail?r=44453)
+
+* Editor: Fixes accidental updating of files in the pub cache during rename
+ refactoring - [r44677](https://code.google.com/p/dart/source/detail?r=44677)
+
+* Editor: Fix for
+ [issue 23032](https://code.google.com/p/dart/issues/detail?id=23032)
+ regarding skipped breakpoints on Windows -
+ [r44824](https://code.google.com/p/dart/source/detail?r=44824)
+
+* dart:mirrors: Fix `MethodMirror.source` when the method is on the first line
+ in a script -
+ [r44957](https://code.google.com/p/dart/source/detail?r=44957),
+ [r44976](https://code.google.com/p/dart/source/detail?r=44976)
+
+* pub: Fix for
+ [issue 23084](https://code.google.com/p/dart/issues/detail?id=23084):
+ Pub can fail to load transformers necessary for local development -
+ [r44876](https://code.google.com/p/dart/source/detail?r=44876)
+
+## 1.9.1 – 2015-03-25
### Language changes
@@ -78,7 +157,7 @@
* `HttpServer.bind` and `HttpServer.bindSecure` added the `v6Only` named
argument. If this is true, only IPv6 connections will be accepted.
-
+
* `HttpServer.bind`, `HttpServer.bindSecure`, `ServerSocket.bind`,
`RawServerSocket.bind`, `SecureServerSocket.bind` and
`RawSecureServerSocket.bind` added the `shared` named argument. If this is
@@ -112,7 +191,7 @@
* Isolates spawned via `Isolate.spawn` now allow most objects, including
top-level and static functions, to be sent between them.
-## 1.8.5 (2015-01-21)
+## 1.8.5 – 2015-01-21
* Code generation for SIMD on ARM and ARM64 is fixed.
@@ -122,7 +201,7 @@
[issue 21795]: https://code.google.com/p/dart/issues/detail?id=21795
-## 1.8.3 (2014-12-10)
+## 1.8.3 – 2014-12-10
* Breakpoints can be set in the Editor using file suffixes ([issue 21280][]).
@@ -139,7 +218,7 @@
[issue 21280]: https://code.google.com/p/dart/issues/detail?id=21280
[issue 21698]: https://code.google.com/p/dart/issues/detail?id=21698
-## 1.8.0 (2014-11-28)
+## 1.8.0 – 2014-11-28
* `dart:collection`: `SplayTree` added the `toSet` function.
@@ -180,7 +259,7 @@
[alpn]: https://tools.ietf.org/html/rfc7301
-## 1.7.0 (2014-10-15)
+## 1.7.0 – 2014-10-15
### Tool changes
diff --git a/pkg/analysis_server/AUTHORS b/pkg/analysis_server/AUTHORS
new file mode 100755
index 0000000..e8063a8
--- /dev/null
+++ b/pkg/analysis_server/AUTHORS
@@ -0,0 +1,6 @@
+# Below is a list of people and organizations that have contributed
+# to the project. Names should be added to the list like so:
+#
+# Name/Organization <email address>
+
+Google Inc.
diff --git a/pkg/analysis_server/CHANGELOG.md b/pkg/analysis_server/CHANGELOG.md
new file mode 100755
index 0000000..2a2d63c
--- /dev/null
+++ b/pkg/analysis_server/CHANGELOG.md
@@ -0,0 +1,5 @@
+# Changelog
+
+## 0.0.1
+
+- Initial version
diff --git a/pkg/analysis_server/CONTRIBUTING.md b/pkg/analysis_server/CONTRIBUTING.md
new file mode 100755
index 0000000..6f5e0ea
--- /dev/null
+++ b/pkg/analysis_server/CONTRIBUTING.md
@@ -0,0 +1,33 @@
+Want to contribute? Great! First, read this page (including the small print at
+the end).
+
+### Before you contribute
+Before we can use your code, you must sign the
+[Google Individual Contributor License Agreement](https://cla.developers.google.com/about/google-individual)
+(CLA), which you can do online. The CLA is necessary mainly because you own the
+copyright to your changes, even after your contribution becomes part of our
+codebase, so we need your permission to use and distribute your code. We also
+need to be sure of various other things—for instance that you'll tell us if you
+know that your code infringes on other people's patents. You don't have to sign
+the CLA until after you've submitted your code for review and a member has
+approved it, but you must do it before we can put your code into our codebase.
+
+Before you start working on a larger contribution, you should get in touch with
+us first through the issue tracker with your idea so that we can help out and
+possibly guide you. Coordinating up front makes it much easier to avoid
+frustration later on.
+
+### Code reviews
+All submissions, including submissions by project members, require review.
+
+### File headers
+All files in the project must start with the following header.
+
+ // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
+ // for details. All rights reserved. Use of this source code is governed by a
+ // BSD-style license that can be found in the LICENSE file.
+
+### The small print
+Contributions made by corporations are covered by a different agreement than the
+one above, the
+[Software Grant and Corporate Contributor License Agreement](https://developers.google.com/open-source/cla/corporate).
diff --git a/pkg/analysis_server/README.md b/pkg/analysis_server/README.md
new file mode 100755
index 0000000..e5d6caa
--- /dev/null
+++ b/pkg/analysis_server/README.md
@@ -0,0 +1,21 @@
+# analysis_server
+
+A long-running process that provides analysis results to other tools.
+
+The analysis server is designed to provide on-going analysis of one or more code
+bases as those code bases are changing.
+
+## Using the server
+
+The analysis server is not intended to be used stand-alone, and therefore does
+not have a human-friendly user interface.
+
+Clients (typically tools, such as an editor) are expected to run the analysis
+server in a separate process and communicate with it using a JSON protocol. The
+protocol is specified in the file `analysis_server/doc/api.html`.
+
+## Features and bugs
+
+Please file feature requests and bugs at the [issue tracker][tracker].
+
+[tracker]: https://code.google.com/p/dart/issues
\ No newline at end of file
diff --git a/pkg/analysis_server/doc/api.html b/pkg/analysis_server/doc/api.html
index 59a5359..2b31520 100644
--- a/pkg/analysis_server/doc/api.html
+++ b/pkg/analysis_server/doc/api.html
@@ -43,7 +43,7 @@
</style></head>
<body>
<h1>Analysis Server API Specification</h1>
- <h1 style="color:#999999">Version 1.6.0</h1>
+ <h1 style="color:#999999">Version 1.6.2</h1>
<p>
This document contains a specification of the API provided by the
analysis server. The API in this document is currently under
@@ -1545,11 +1545,12 @@
selection offset and selection length.
</p>
<p>
- If a request is made for a file which does not exist, or
- which is not currently subject to analysis (e.g. because it
- is not associated with any analysis root specified to
- analysis.setAnalysisRoots), an error of type
- <tt>FORMAT_INVALID_FILE</tt> will be generated.
+ If a request is made for a file which does not exist, or which is not
+ currently subject to analysis (e.g. because it is not associated with
+ any analysis root specified to analysis.setAnalysisRoots), an error of
+ type <tt>FORMAT_INVALID_FILE</tt> will be generated. If the source
+ contains syntax errors, an error of type <tt>FORMAT_WITH_ERRORS</tt>
+ will be generated.
</p>
@@ -2445,6 +2446,12 @@
The type of the options parameter being suggested. This
field is omitted if the parameterName field is omitted.
</p>
+ </dd><dt class="field"><b><i>importUri ( <span style="color:#999999">optional</span> String )</i></b></dt><dd>
+
+ <p>
+ The import to be added if the suggestion is out of scope
+ and needs an import to be added to be in scope.
+ </p>
</dd></dl></dd><dt class="typeDefinition"><a name="type_CompletionSuggestionKind">CompletionSuggestionKind: String</a></dt><dd>
<p>
An enumeration of the kinds of elements that can be included
@@ -2481,7 +2488,14 @@
A keyword is being suggested.
For suggestions of this kind, the completion is the keyword.
</p>
- </dd><dt class="value">NAMED_ARGUMENT</dt><dt class="value">OPTIONAL_ARGUMENT</dt><dt class="value">PARAMETER</dt></dl></dd><dt class="typeDefinition"><a name="type_Element">Element: object</a></dt><dd>
+ </dd><dt class="value">NAMED_ARGUMENT</dt><dd>
+
+ <p>
+ A named argument for the current callsite is being suggested.
+ For suggestions of this kind, the completion is
+ the named argument identifier including a trailing ':' and space.
+ </p>
+ </dd><dt class="value">OPTIONAL_ARGUMENT</dt><dt class="value">PARAMETER</dt></dl></dd><dt class="typeDefinition"><a name="type_Element">Element: object</a></dt><dd>
<p>
Information about an element (something that can be declared
in code).
@@ -3128,6 +3142,12 @@
An "edit.format" request specified a FilePath
which does not match a Dart file in an analysis root.
</p>
+ </dd><dt class="value">FORMAT_WITH_ERRORS</dt><dd>
+
+ <p>
+ An "edit.format" request specified a file that contains syntax
+ errors.
+ </p>
</dd><dt class="value">GET_ERRORS_INVALID_FILE</dt><dd>
<p>
diff --git a/pkg/analysis_server/lib/analysis/index/index_core.dart b/pkg/analysis_server/lib/analysis/index/index_core.dart
new file mode 100644
index 0000000..e712495
--- /dev/null
+++ b/pkg/analysis_server/lib/analysis/index/index_core.dart
@@ -0,0 +1,185 @@
+// Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+library analysis_server.analysis.index.index_core;
+
+import 'dart:async';
+
+import 'package:analyzer/src/generated/engine.dart';
+import 'package:analyzer/src/generated/source.dart';
+
+/**
+ * An object that can have a [Relationship] with various [Location]s in a code
+ * base.
+ *
+ * Clients are expected to subtype this class when implementing plugins.
+ */
+abstract class IndexableObject {
+ // TODO(brianwilkerson) Figure out the subset of the Element API that is used
+ // by the index.
+}
+
+/**
+ * An object used to add relationships to the index.
+ *
+ * Clients are expected to subtype this class when implementing plugins.
+ */
+abstract class IndexContributor {
+ /**
+ * Contribute relationships to the given index [store] as a result of
+ * analyzing the given [source] in the given [context].
+ */
+ void contributeTo(IndexStore store, AnalysisContext context, Source source);
+}
+
+// A sketch of what the driver routine might look like:
+//
+//void buildIndexForSource(AnalysisContext context, Source source) {
+// IndexStoreImpl store;
+// store.aboutToIndex(context, source);
+// try {
+// for (IndexContributor contributor in contributors) {
+// contributor.contributeTo(store, context, source);
+// }
+// } finally {
+// store.doneIndexing();
+// }
+//}
+
+/**
+ * An object that stores information about the relationships between locations
+ * in a code base.
+ *
+ * Clients are not expected to subtype this class.
+ */
+abstract class IndexStore {
+ /**
+ * Remove all of the information from the index.
+ */
+ void clear();
+
+ /**
+ * Return a future that completes with the locations that have the given
+ * [relationship] with the given [indexable] object.
+ *
+ * For example, if the [indexable] object represents a function and the
+ * relationship is the `is-invoked-by` relationship, then the returned
+ * locations will be all of the places where the function is invoked.
+ */
+ Future<List<Location>> getRelationships(
+ IndexableObject indexable, Relationship relationship);
+
+ /**
+ * Record that the given [indexable] object and [location] have the given
+ * [relationship].
+ *
+ * For example, if the [relationship] is the `is-invoked-by` relationship,
+ * then the [indexable] object would be the function being invoked and
+ * [location] would be the point at which it is invoked. Each indexable object
+ * can have the same relationship with multiple locations. In other words, if
+ * the following code were executed
+ *
+ * recordRelationship(indexable, isReferencedBy, location1);
+ * recordRelationship(indexable, isReferencedBy, location2);
+ *
+ * (where `location1 != location2`) then both relationships would be
+ * maintained in the index and the result of executing
+ *
+ * getRelationship(indexable, isReferencedBy);
+ *
+ * would be a list containing both `location1` and `location2`.
+ */
+ void recordRelationship(
+ IndexableObject indexable, Relationship relationship, Location location);
+
+ /**
+ * Remove from the index all of the information associated with the given
+ * [context].
+ *
+ * This method should be invoked when the [context] is disposed.
+ */
+ void removeContext(AnalysisContext context);
+
+ /**
+ * Remove from the index all of the information associated with indexable
+ * objects or locations in the given [source]. This includes relationships
+ * between an indexable object in [source] and any other locations, as well as
+ * relationships between any other indexable objects and locations within
+ * the [source].
+ *
+ * This method should be invoked when [source] is no longer part of the given
+ * [context].
+ */
+ void removeSource(AnalysisContext context, Source source);
+
+ /**
+ * Remove from the index all of the information associated with indexable
+ * objects or locations in the given sources. This includes relationships
+ * between an indexable object in the given sources and any other locations,
+ * as well as relationships between any other indexable objects and a location
+ * within the given sources.
+ *
+ * This method should be invoked when the sources described by the given
+ * [container] are no longer part of the given [context].
+ */
+ void removeSources(AnalysisContext context, SourceContainer container);
+}
+
+/**
+ * Instances of the class [Location] represent a location related to an
+ * indexable object.
+ *
+ * The location is expressed as an offset and length, but the offset is relative
+ * to the source containing the indexable object rather than the start of the
+ * indexable object within that source.
+ *
+ * Clients are not expected to subtype this class.
+ */
+abstract class Location {
+ /**
+ * An empty list of locations.
+ */
+ static const List<Location> EMPTY_LIST = const <Location>[];
+
+ /**
+ * Return the indexable object containing this location.
+ */
+ IndexableObject get indexable;
+
+ /**
+ * Return `true` if this location is a qualified reference.
+ */
+ bool get isQualified;
+
+ /**
+ * Return `true` if this location is a resolved reference.
+ */
+ bool get isResolved;
+
+ /**
+ * Return the length of this location.
+ */
+ int get length;
+
+ /**
+ * Return the offset of this location within the source containing the
+ * indexable object.
+ */
+ int get offset;
+}
+
+/**
+ * A relationship between an indexable object and a location. Relationships are
+ * identified by a globally unique identifier.
+ *
+ * Clients are not expected to subtype this class.
+ */
+abstract class Relationship {
+ /**
+ * Return a relationship that has the given [identifier]. If the relationship
+ * has already been created, then it will be returned, otherwise a new
+ * relationship will be created
+ */
+ factory Relationship(String identifier) => null;
+}
diff --git a/pkg/analysis_server/lib/analysis/index/index_dart.dart b/pkg/analysis_server/lib/analysis/index/index_dart.dart
new file mode 100644
index 0000000..ed1869f
--- /dev/null
+++ b/pkg/analysis_server/lib/analysis/index/index_dart.dart
@@ -0,0 +1,41 @@
+// Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+library analysis_server.analysis.index.index_dart;
+
+import 'package:analysis_server/analysis/index/index_core.dart';
+import 'package:analyzer/src/generated/ast.dart';
+import 'package:analyzer/src/generated/engine.dart';
+import 'package:analyzer/src/generated/source.dart';
+
+/**
+ * An [IndexContributor] that can be used to contribute relationships for Dart
+ * files.
+ *
+ * Clients are expected to subtype this class when implementing plugins.
+ */
+abstract class DartIndexContributor extends IndexContributor {
+ @override
+ void contributeTo(IndexStore store, AnalysisContext context, Source source) {
+ if (!AnalysisEngine.isDartFileName(source.fullName)) {
+ return;
+ }
+ List<Source> libraries = context.getLibrariesContaining(source);
+ if (libraries.isEmpty) {
+ return;
+ }
+ libraries.forEach((Source library) {
+ CompilationUnit unit = context.resolveCompilationUnit2(source, library);
+ if (unit != null) {
+ internalContributeTo(store, unit);
+ }
+ });
+ }
+
+ /**
+ * Contribute relationships to the given index [store] based on the given
+ * fully resolved compilation[unit].
+ */
+ void internalContributeTo(IndexStore store, CompilationUnit unit);
+}
diff --git a/pkg/analysis_server/lib/completion/completion_core.dart b/pkg/analysis_server/lib/completion/completion_core.dart
new file mode 100644
index 0000000..691ab89
--- /dev/null
+++ b/pkg/analysis_server/lib/completion/completion_core.dart
@@ -0,0 +1,106 @@
+// Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+library analysis_server.completion.completion_core;
+
+import 'package:analysis_server/src/protocol.dart';
+import 'package:analyzer/file_system/file_system.dart';
+import 'package:analyzer/src/generated/engine.dart';
+import 'package:analyzer/src/generated/source.dart';
+
+/**
+ * An object used to produce completions for a specific error. Completion
+ * contributors are long-lived objects and must not retain any state between
+ * invocations of [computeSuggestions].
+ *
+ * Clients are expected to subtype this class when implementing plugins.
+ */
+abstract class CompletionContributor {
+ /**
+ * Compute a list of completion suggestions based on the given completion
+ * [request] and return a result that includes those suggestions. This method
+ * is called after specific phases of analysis until the contributor indicates
+ * computation is complete by setting [CompletionResult.isLast] to `true`.
+ */
+ CompletionResult computeSuggestions(CompletionRequest request);
+}
+
+/**
+ * The information about a requested list of completions.
+ *
+ * Clients are not expected to subtype this class.
+ */
+abstract class CompletionRequest {
+ /**
+ * Return the results that were returned the last time the contributor was
+ * asked for results, or `null` if this is the first request for results at
+ * this location.
+ */
+ //CompletionResult get previousResults;
+
+ /**
+ * Return the analysis context in which the completion is being requested.
+ */
+ AnalysisContext get context;
+
+ /**
+ * The offset within the source at which the completion is being requested.
+ */
+ int get offset;
+
+ /**
+ * Return the resource provider associated with this request.
+ */
+ ResourceProvider get resourceProvider;
+
+ /**
+ * Return the source in which the completion is being requested.
+ */
+ Source get source;
+}
+
+/**
+ * The result of computing suggestions for code completion.
+ *
+ * Clients are expected to subtype this class when implementing plugins.
+ */
+abstract class CompletionResult {
+ /**
+ * Return `true` if this result contains suggestions that were not in the
+ * previously returned completion results. This should also be `true` if this
+ * is the first result produced for a given location.
+ */
+ bool get hasNewSuggestions;
+
+ /**
+ * Return `true` if the contributor has contributed all possible completion
+ * suggestions, or `false` if the contributor should be consulted again after
+ * more analysis has been completed.
+ */
+ bool get isLast;
+
+ /**
+ * Return the length of the text to be replaced. This will be zero (0) if the
+ * suggestion is to be inserted, otherwise it will be greater than zero. For
+ * example, if the remainder of the identifier containing the cursor is to be
+ * replaced when the suggestion is applied, in which case the length will be
+ * the number of characters in the existing identifier.
+ */
+ int get replacementLength;
+
+ /**
+ * Return the offset of the start of the text to be replaced. This will be
+ * different than the offset used to request the completion suggestions if
+ * there was a portion of text that needs to be replaced. For example, if a
+ * partial identifier is immediately before the original offset, in which case
+ * the replacementOffset will be the offset of the beginning of the
+ * identifier.
+ */
+ int get replacementOffset;
+
+ /**
+ * Return the list of suggestions being contributed by the contributor.
+ */
+ List<CompletionSuggestion> get suggestions;
+}
diff --git a/pkg/analysis_server/lib/completion/completion_dart.dart b/pkg/analysis_server/lib/completion/completion_dart.dart
new file mode 100644
index 0000000..daeba77
--- /dev/null
+++ b/pkg/analysis_server/lib/completion/completion_dart.dart
@@ -0,0 +1,64 @@
+// Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+library analysis_server.completion.completion_dart;
+
+import 'package:analysis_server/completion/completion_core.dart';
+import 'package:analyzer/src/generated/ast.dart';
+
+/**
+ * An object used to produce completions for a specific error within a Dart
+ * file. Completion contributors are long-lived objects and must not retain any
+ * state between invocations of [computeSuggestions].
+ *
+ * Clients are expected to subtype this class when implementing plugins.
+ */
+abstract class DartCompletionContributor extends CompletionContributor {
+ @override
+ CompletionResult computeSuggestions(CompletionRequest request) {
+ // TODO(brianwilkerson) Implement this by getting the information required
+ // to create a DartCompletionRequest and calling:
+ // return internalComputeSuggestions(dartRequest);
+ return null;
+ }
+
+ /**
+ * Compute a list of completion suggestions based on the given completion
+ * [request] and return a result that includes those suggestions. This method
+ * is called after specific phases of analysis until the contributor indicates
+ * computation is complete by setting [CompletionResult.isLast] to `true`.
+ */
+ CompletionResult internalComputeSuggestions(DartCompletionRequest request);
+}
+
+/**
+ * The information about a requested list of completions within a Dart file.
+ */
+abstract class DartCompletionRequest extends CompletionRequest {
+ /**
+ * Return `true` if the compilation [unit] is resolved.
+ */
+ bool get isResolved;
+
+ /**
+ * The compilation unit in which the completion was requested.
+ */
+ CompilationUnit get unit;
+
+ /**
+ * Cached information from a prior code completion operation.
+ */
+ //DartCompletionCache get cache;
+
+ /**
+ * The completion target. This determines what part of the parse tree
+ * will receive the newly inserted text.
+ */
+ //CompletionTarget get target;
+
+ /**
+ * Information about the types of suggestions that should be included.
+ */
+ //OpType get _optype;
+}
diff --git a/pkg/analysis_server/lib/edit/assist/assist_core.dart b/pkg/analysis_server/lib/edit/assist/assist_core.dart
new file mode 100644
index 0000000..537791c
--- /dev/null
+++ b/pkg/analysis_server/lib/edit/assist/assist_core.dart
@@ -0,0 +1,99 @@
+// Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+library analysis_server.edit.assist.assist_core;
+
+import 'package:analysis_server/src/protocol.dart' show SourceChange;
+import 'package:analyzer/src/generated/engine.dart';
+import 'package:analyzer/src/generated/source.dart';
+
+/**
+ * A description of a single proposed assist.
+ *
+ * Clients are not expected to subtype this class.
+ */
+class Assist {
+ /**
+ * An empty list of assists.
+ */
+ static const List<Assist> EMPTY_LIST = const <Assist>[];
+
+ /**
+ * A comparator that can be used to sort assists by their relevance. The most
+ * relevant assists will be sorted before assists with a lower relevance.
+ */
+ static final Comparator<Assist> SORT_BY_RELEVANCE = (Assist firstAssist,
+ Assist secondAssist) =>
+ firstAssist.kind.relevance - secondAssist.kind.relevance;
+
+ /**
+ * A description of the assist being proposed.
+ */
+ final AssistKind kind;
+
+ /**
+ * The change to be made in order to apply the assist.
+ */
+ final SourceChange change;
+
+ /**
+ * Initialize a newly created assist to have the given [kind] and [change].
+ */
+ Assist(this.kind, this.change);
+
+ @override
+ String toString() {
+ return 'Assist(kind=$kind, change=$change)';
+ }
+}
+
+/**
+ * An object used to produce assists for a specific location.
+ *
+ * Clients are expected to subtype this class when implementing plugins.
+ */
+abstract class AssistContributor {
+ /**
+ * Return a list of assists for a location in the given [source]. The location
+ * is specified by the [offset] and [length] of the selected region. The
+ * [context] can be used to get additional information that is useful for
+ * computing assists.
+ */
+ List<Assist> computeAssists(
+ AnalysisContext context, Source source, int offset, int length);
+}
+
+/**
+ * A description of a class of assists. Instances are intended to hold the
+ * information that is common across a number of assists and to be shared by
+ * those assists.
+ *
+ * Clients are not expected to subtype this class.
+ */
+class AssistKind {
+ /**
+ * The name of this kind of assist, used for debugging.
+ */
+ final String name;
+
+ /**
+ * The relevance of this kind of assist for the kind of error being addressed.
+ */
+ final int relevance;
+
+ /**
+ * A human-readable description of the changes that will be applied by this
+ * kind of assist.
+ */
+ final String message;
+
+ /**
+ * Initialize a newly created kind of assist to have the given [name],
+ * [relevance] and [message].
+ */
+ const AssistKind(this.name, this.relevance, this.message);
+
+ @override
+ String toString() => name;
+}
diff --git a/pkg/analysis_server/lib/edit/assist/assist_dart.dart b/pkg/analysis_server/lib/edit/assist/assist_dart.dart
new file mode 100644
index 0000000..ec6718c
--- /dev/null
+++ b/pkg/analysis_server/lib/edit/assist/assist_dart.dart
@@ -0,0 +1,45 @@
+// Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+library analysis_server.edit.assist.assist_dart;
+
+import 'package:analysis_server/edit/assist/assist_core.dart';
+import 'package:analyzer/src/generated/ast.dart';
+import 'package:analyzer/src/generated/engine.dart';
+import 'package:analyzer/src/generated/source.dart';
+
+/**
+ * An [AssistContributor] that can be used to contribute assists for Dart
+ * files.
+ *
+ * Clients are expected to subtype this class when implementing plugins.
+ */
+abstract class DartAssistContributor extends AssistContributor {
+ @override
+ List<Assist> computeAssists(
+ AnalysisContext context, Source source, int offset, int length) {
+ if (!AnalysisEngine.isDartFileName(source.fullName)) {
+ return Assist.EMPTY_LIST;
+ }
+ List<Source> libraries = context.getLibrariesContaining(source);
+ if (libraries.isEmpty) {
+ return Assist.EMPTY_LIST;
+ }
+ CompilationUnit unit =
+ context.resolveCompilationUnit2(source, libraries[0]);
+ if (unit == null) {
+ return Assist.EMPTY_LIST;
+ }
+ return internalComputeAssists(unit, offset, length);
+ }
+
+ /**
+ * Return a list of assists for a location in the given [source]. The location
+ * is specified by the [offset] and [length] of the selected region. The
+ * [context] can be used to get additional information that is useful for
+ * computing assists.
+ */
+ List<Assist> internalComputeAssists(
+ CompilationUnit unit, int offset, int length);
+}
diff --git a/pkg/analysis_server/lib/edit/fix/fix_core.dart b/pkg/analysis_server/lib/edit/fix/fix_core.dart
new file mode 100644
index 0000000..f546198
--- /dev/null
+++ b/pkg/analysis_server/lib/edit/fix/fix_core.dart
@@ -0,0 +1,100 @@
+// Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+library analysis_server.edit.fix.fix_core;
+
+import 'package:analysis_server/src/protocol.dart' show SourceChange;
+import 'package:analyzer/src/generated/engine.dart';
+import 'package:analyzer/src/generated/error.dart';
+
+/**
+ * A description of a single proposed fix for some problem.
+ *
+ * Clients are not expected to subtype this class.
+ */
+class Fix {
+ /**
+ * An empty list of fixes.
+ */
+ static const List<Fix> EMPTY_LIST = const <Fix>[];
+
+ /**
+ * A comparator that can be used to sort fixes by their relevance. The most
+ * relevant fixes will be sorted before fixes with a lower relevance.
+ */
+ static final Comparator<Fix> SORT_BY_RELEVANCE = (Fix firstFix,
+ Fix secondFix) => firstFix.kind.relevance - secondFix.kind.relevance;
+
+ /**
+ * A description of the fix being proposed.
+ */
+ final FixKind kind;
+
+ /**
+ * The change to be made in order to apply the fix.
+ */
+ final SourceChange change;
+
+ /**
+ * Initialize a newly created fix to have the given [kind] and [change].
+ */
+ Fix(this.kind, this.change);
+
+ @override
+ String toString() {
+ return 'Fix(kind=$kind, change=$change)';
+ }
+}
+
+/**
+ * An object used to produce fixes for a specific error. Fix contributors are
+ * long-lived objects and must not retain any state between invocations of
+ * [computeFixes].
+ *
+ * Clients are expected to subtype this class when implementing plugins.
+ */
+abstract class FixContributor {
+ /**
+ * Return a list of fixes for the given [error]. The error was reported
+ * after it's source was analyzed in the given [context].
+ */
+ List<Fix> computeFixes(AnalysisContext context, AnalysisError error);
+}
+
+/**
+ * A description of a class of fixes. Instances are intended to hold the
+ * information that is common across a number of fixes and to be shared by those
+ * fixes. For example, if an unnecessary cast is found then one of the suggested
+ * fixes will be to remove the cast. If there are multiple unnecessary casts in
+ * a single file, then there will be multiple fixes, one per occurance, but they
+ * will all share the same kind.
+ *
+ * Clients are not expected to subtype this class.
+ */
+class FixKind {
+ /**
+ * The name of this kind of fix, used for debugging.
+ */
+ final String name;
+
+ /**
+ * The relevance of this kind of fix for the kind of error being addressed.
+ */
+ final int relevance;
+
+ /**
+ * A human-readable description of the changes that will be applied by this
+ * kind of fix.
+ */
+ final String message;
+
+ /**
+ * Initialize a newly created kind of fix to have the given [name],
+ * [relevance] and [message].
+ */
+ const FixKind(this.name, this.relevance, this.message);
+
+ @override
+ String toString() => name;
+}
diff --git a/pkg/analysis_server/lib/edit/fix/fix_dart.dart b/pkg/analysis_server/lib/edit/fix/fix_dart.dart
new file mode 100644
index 0000000..0e559e4
--- /dev/null
+++ b/pkg/analysis_server/lib/edit/fix/fix_dart.dart
@@ -0,0 +1,43 @@
+// Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+library analysis_server.edit.fix.fix_dart;
+
+import 'package:analysis_server/edit/fix/fix_core.dart';
+import 'package:analyzer/src/generated/ast.dart';
+import 'package:analyzer/src/generated/engine.dart';
+import 'package:analyzer/src/generated/error.dart';
+import 'package:analyzer/src/generated/source.dart';
+
+/**
+ * A [FixContributor] that can be used to contribute fixes for errors in Dart
+ * files.
+ *
+ * Clients are expected to subtype this class when implementing plugins.
+ */
+abstract class DartFixContributor extends FixContributor {
+ @override
+ List<Fix> computeFixes(AnalysisContext context, AnalysisError error) {
+ Source source = error.source;
+ if (!AnalysisEngine.isDartFileName(source.fullName)) {
+ return Fix.EMPTY_LIST;
+ }
+ List<Source> libraries = context.getLibrariesContaining(source);
+ if (libraries.isEmpty) {
+ return Fix.EMPTY_LIST;
+ }
+ CompilationUnit unit =
+ context.resolveCompilationUnit2(source, libraries[0]);
+ if (unit == null) {
+ return Fix.EMPTY_LIST;
+ }
+ return internalComputeFixes(unit, error);
+ }
+
+ /**
+ * Return a list of fixes for the given [error]. The error was reported
+ * against the given compilation [unit].
+ */
+ List<Fix> internalComputeFixes(CompilationUnit unit, AnalysisError error);
+}
diff --git a/pkg/analysis_server/lib/plugin/assist.dart b/pkg/analysis_server/lib/plugin/assist.dart
new file mode 100644
index 0000000..f578c0d
--- /dev/null
+++ b/pkg/analysis_server/lib/plugin/assist.dart
@@ -0,0 +1,22 @@
+// Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+/**
+ * Support for client code that extends the analysis server by adding new assist
+ * contributors.
+ */
+library analysis_server.plugin.assist;
+
+import 'package:analysis_server/edit/assist/assist_core.dart';
+import 'package:analysis_server/src/plugin/server_plugin.dart';
+import 'package:plugin/plugin.dart';
+
+/**
+ * The identifier of the extension point that allows plugins to register new
+ * assist contributors with the server. The object used as an extension must be
+ * an [AssistContributor].
+ */
+final String ASSIST_CONTRIBUTOR_EXTENSION_POINT_ID = Plugin.join(
+ ServerPlugin.UNIQUE_IDENTIFIER,
+ ServerPlugin.ASSIST_CONTRIBUTOR_EXTENSION_POINT);
diff --git a/pkg/analysis_server/lib/plugin/completion.dart b/pkg/analysis_server/lib/plugin/completion.dart
new file mode 100644
index 0000000..a1947e5
--- /dev/null
+++ b/pkg/analysis_server/lib/plugin/completion.dart
@@ -0,0 +1,22 @@
+// Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+/**
+ * Support for client code that extends the analysis server by adding new code
+ * completion contributors.
+ */
+library analysis_server.plugin.completion;
+
+import 'package:analysis_server/completion/completion_core.dart';
+import 'package:analysis_server/src/plugin/server_plugin.dart';
+import 'package:plugin/plugin.dart';
+
+/**
+ * The identifier of the extension point that allows plugins to register new
+ * code completion contributors with the server. The object used as an extension
+ * must be a [CompletionContributor].
+ */
+final String COMPLETION_CONTRIBUTOR_EXTENSION_POINT_ID = Plugin.join(
+ ServerPlugin.UNIQUE_IDENTIFIER,
+ ServerPlugin.COMPLETION_CONTRIBUTOR_EXTENSION_POINT);
diff --git a/pkg/analysis_server/lib/plugin/fix.dart b/pkg/analysis_server/lib/plugin/fix.dart
new file mode 100644
index 0000000..8045624
--- /dev/null
+++ b/pkg/analysis_server/lib/plugin/fix.dart
@@ -0,0 +1,22 @@
+// Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+/**
+ * Support for client code that extends the analysis server by adding new fix
+ * contributors.
+ */
+library analysis_server.plugin.fix;
+
+import 'package:analysis_server/edit/fix/fix_core.dart';
+import 'package:analysis_server/src/plugin/server_plugin.dart';
+import 'package:plugin/plugin.dart';
+
+/**
+ * The identifier of the extension point that allows plugins to register new
+ * fix contributors with the server. The object used as an extension must be a
+ * [FixContributor].
+ */
+final String FIX_CONTRIBUTOR_EXTENSION_POINT_ID = Plugin.join(
+ ServerPlugin.UNIQUE_IDENTIFIER,
+ ServerPlugin.FIX_CONTRIBUTOR_EXTENSION_POINT);
diff --git a/pkg/analysis_server/lib/plugin/index.dart b/pkg/analysis_server/lib/plugin/index.dart
new file mode 100644
index 0000000..e8bcf89
--- /dev/null
+++ b/pkg/analysis_server/lib/plugin/index.dart
@@ -0,0 +1,22 @@
+// Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+/**
+ * Support for client code that extends the analysis server by adding new index
+ * contributors.
+ */
+library analysis_server.plugin.index;
+
+import 'package:analysis_server/analysis/index/index_core.dart';
+import 'package:analysis_server/src/plugin/server_plugin.dart';
+import 'package:plugin/plugin.dart';
+
+/**
+ * The identifier of the extension point that allows plugins to register new
+ * index contributors with the server. The object used as an extension must be
+ * an [IndexContributor].
+ */
+final String INDEX_CONTRIBUTOR_EXTENSION_POINT_ID = Plugin.join(
+ ServerPlugin.UNIQUE_IDENTIFIER,
+ ServerPlugin.INDEX_CONTRIBUTOR_EXTENSION_POINT);
diff --git a/pkg/analysis_server/lib/src/analysis_server.dart b/pkg/analysis_server/lib/src/analysis_server.dart
index 4989c15..121227a 100644
--- a/pkg/analysis_server/lib/src/analysis_server.dart
+++ b/pkg/analysis_server/lib/src/analysis_server.dart
@@ -21,7 +21,6 @@
import 'package:analysis_server/src/source/optimizing_pub_package_map_provider.dart';
import 'package:analyzer/file_system/file_system.dart';
import 'package:analyzer/instrumentation/instrumentation.dart';
-import 'package:analyzer/plugin/plugin.dart';
import 'package:analyzer/src/generated/ast.dart';
import 'package:analyzer/src/generated/element.dart';
import 'package:analyzer/src/generated/engine.dart';
@@ -30,6 +29,7 @@
import 'package:analyzer/src/generated/source.dart';
import 'package:analyzer/src/generated/source_io.dart';
import 'package:analyzer/src/generated/utilities_general.dart';
+import 'package:plugin/plugin.dart';
typedef void OptionUpdater(AnalysisOptionsImpl options);
@@ -66,7 +66,7 @@
* The version of the analysis server. The value should be replaced
* automatically during the build.
*/
- static final String VERSION = '1.6.0';
+ static final String VERSION = '1.6.2';
/**
* The number of milliseconds to perform operations before inserting
@@ -425,9 +425,10 @@
* first context that implicitly analyzes it.
*
* If the [path] is not analyzed by any context, a [ContextSourcePair] with
- * `null` context and `file` [Source] is returned.
+ * a `null` context and `file` [Source] is returned.
*
- * If the [path] dosn't represent a file, `null` is returned as a [Source].
+ * If the [path] dosn't represent a file, a [ContextSourcePair] with a `null`
+ * context and `null` [Source] is returned.
*
* Does not return `null`.
*/
@@ -443,21 +444,21 @@
}
// try to find the deep-most containing context
Resource resource = resourceProvider.getResource(path);
- File file = resource is File ? resource : null;
+ if (resource is! File) {
+ return new ContextSourcePair(null, null);
+ }
+ File file = resource;
{
AnalysisContext containingContext = getContainingContext(path);
if (containingContext != null) {
- Source source = file != null
- ? ContextManager.createSourceInContext(containingContext, file)
- : null;
+ Source source =
+ ContextManager.createSourceInContext(containingContext, file);
return new ContextSourcePair(containingContext, source);
}
}
// try to find a context that analysed the file
for (AnalysisContext context in folderMap.values) {
- Source source = file != null
- ? ContextManager.createSourceInContext(context, file)
- : null;
+ Source source = ContextManager.createSourceInContext(context, file);
SourceKind kind = context.getKindOf(source);
if (kind != SourceKind.UNKNOWN) {
return new ContextSourcePair(context, source);
@@ -472,7 +473,7 @@
}
}
// file-based source
- Source fileSource = file != null ? file.createSource() : null;
+ Source fileSource = file.createSource();
return new ContextSourcePair(null, fileSource);
}
diff --git a/pkg/analysis_server/lib/src/context_manager.dart b/pkg/analysis_server/lib/src/context_manager.dart
index bd3dc86..e010a3e 100644
--- a/pkg/analysis_server/lib/src/context_manager.dart
+++ b/pkg/analysis_server/lib/src/context_manager.dart
@@ -389,7 +389,29 @@
UriResolver _computePackageUriResolver(Folder folder, _ContextInfo info) {
if (info.packageRoot != null) {
info.packageMapInfo = null;
- return new PackageUriResolver([new JavaFile(info.packageRoot)]);
+ JavaFile packagesDir = new JavaFile(info.packageRoot);
+ Map<String, List<Folder>> packageMap = new Map<String, List<Folder>>();
+ if (packagesDir.isDirectory()) {
+ for (JavaFile file in packagesDir.listFiles()) {
+ // Ensure symlinks in packages directory are canonicalized
+ // to prevent 'type X cannot be assigned to type X' warnings
+ String path;
+ try {
+ path = file.getCanonicalPath();
+ } catch (e, s) {
+ // Ignore packages that do not exist
+ _instrumentationService.logException(e, s);
+ continue;
+ }
+ Resource res = resourceProvider.getResource(path);
+ if (res is Folder) {
+ packageMap[file.getName()] = <Folder>[res];
+ }
+ }
+ return new PackageMapUriResolver(resourceProvider, packageMap);
+ }
+ //TODO(danrubel) remove this if it will never be called
+ return new PackageUriResolver([packagesDir]);
} else {
beginComputePackageMap();
OptimizingPubPackageMapInfo packageMapInfo;
diff --git a/pkg/analysis_server/lib/src/domain_completion.dart b/pkg/analysis_server/lib/src/domain_completion.dart
index 70808d5..cd9b426 100644
--- a/pkg/analysis_server/lib/src/domain_completion.dart
+++ b/pkg/analysis_server/lib/src/domain_completion.dart
@@ -6,6 +6,8 @@
import 'dart:async';
+import 'package:analysis_server/completion/completion_core.dart'
+ show CompletionRequest;
import 'package:analysis_server/src/analysis_server.dart';
import 'package:analysis_server/src/constants.dart';
import 'package:analysis_server/src/protocol.dart';
@@ -23,6 +25,11 @@
*/
class CompletionDomainHandler implements RequestHandler {
/**
+ * The maximum number of performance measurements to keep.
+ */
+ static const int performanceListMaxLength = 50;
+
+ /**
* The analysis server that is using this handler to process requests.
*/
final AnalysisServer server;
@@ -61,11 +68,6 @@
new List<CompletionPerformance>();
/**
- * The maximum number of performance measurements to keep.
- */
- static const int performanceListMaxLength = 50;
-
- /**
* Performance for the last priority change event.
*/
CompletionPerformance computeCachePerformance;
@@ -157,7 +159,7 @@
String computeTag = 'computeCache';
performance.logStartTime(computeTag);
CompletionManager manager = completionManagerFor(context, source);
- manager.computeCache().then((bool success) {
+ manager.computeCache().catchError((_) => false).then((bool success) {
performance.logElapseTime(computeTag);
performance.complete('priorityChanged caching: $success');
});
@@ -185,7 +187,7 @@
manager = completionManagerFor(context, source);
}
CompletionRequest completionRequest =
- new CompletionRequest(params.offset, performance);
+ new CompletionRequestImpl(server, context, source, params.offset);
int notificationCount = 0;
manager.results(completionRequest).listen((CompletionResult result) {
++notificationCount;
diff --git a/pkg/analysis_server/lib/src/domain_execution.dart b/pkg/analysis_server/lib/src/domain_execution.dart
index 59d70af..145f1ba 100644
--- a/pkg/analysis_server/lib/src/domain_execution.dart
+++ b/pkg/analysis_server/lib/src/domain_execution.dart
@@ -96,7 +96,7 @@
return new Response.invalidParameter(request, 'id',
'There is no execution context with an id of $contextId');
}
- AnalysisContext context = server.getAnalysisContext(path);
+ AnalysisContext context = server.getContainingContext(path);
if (context == null) {
return new Response.invalidExecutionContext(request, contextId);
}
diff --git a/pkg/analysis_server/lib/src/edit/edit_domain.dart b/pkg/analysis_server/lib/src/edit/edit_domain.dart
index 9d4c7df..8e11600 100644
--- a/pkg/analysis_server/lib/src/edit/edit_domain.dart
+++ b/pkg/analysis_server/lib/src/edit/edit_domain.dart
@@ -6,9 +6,12 @@
import 'dart:async';
+import 'package:analysis_server/edit/assist/assist_core.dart';
+import 'package:analysis_server/edit/fix/fix_core.dart';
import 'package:analysis_server/src/analysis_server.dart';
import 'package:analysis_server/src/collections.dart';
import 'package:analysis_server/src/constants.dart';
+import 'package:analysis_server/src/plugin/server_plugin.dart';
import 'package:analysis_server/src/protocol_server.dart' hide Element;
import 'package:analysis_server/src/services/correction/assist.dart';
import 'package:analysis_server/src/services/correction/fix.dart';
@@ -40,6 +43,11 @@
final AnalysisServer server;
/**
+ * The server plugin that defines the extension points used by this handler.
+ */
+ final ServerPlugin plugin;
+
+ /**
* The [SearchEngine] for this server.
*/
SearchEngine searchEngine;
@@ -49,7 +57,7 @@
/**
* Initialize a newly created handler to handle requests for the given [server].
*/
- EditDomainHandler(this.server) {
+ EditDomainHandler(this.server, this.plugin) {
searchEngine = server.searchEngine;
_newRefactoringManager();
}
@@ -90,7 +98,12 @@
selectionStart: start,
selectionLength: length);
DartFormatter formatter = new DartFormatter();
- SourceCode formattedResult = formatter.formatSource(code);
+ SourceCode formattedResult;
+ try {
+ formattedResult = formatter.formatSource(code);
+ } on FormatterException {
+ return new Response.formatWithErrors(request);
+ }
String formattedSource = formattedResult.text;
List<SourceEdit> edits = <SourceEdit>[];
@@ -102,23 +115,35 @@
edits.add(edit);
}
- return new EditFormatResult(edits, formattedResult.selectionStart,
- formattedResult.selectionLength).toResponse(request.id);
+ int newStart = formattedResult.selectionStart;
+ int newLength = formattedResult.selectionLength;
+
+ // Sending null start/length values would violate protocol, so convert back
+ // to 0.
+ if (newStart == null) {
+ newStart = 0;
+ }
+ if (newLength == null) {
+ newLength = 0;
+ }
+
+ return new EditFormatResult(edits, newStart, newLength)
+ .toResponse(request.id);
}
Response getAssists(Request request) {
- var params = new EditGetAssistsParams.fromRequest(request);
+ EditGetAssistsParams params = new EditGetAssistsParams.fromRequest(request);
+ ContextSourcePair pair = server.getContextSourcePair(params.file);
+ engine.AnalysisContext context = pair.context;
+ Source source = pair.source;
List<SourceChange> changes = <SourceChange>[];
- List<CompilationUnit> units =
- server.getResolvedCompilationUnits(params.file);
- if (units.isNotEmpty) {
- CompilationUnit unit = units[0];
- List<Assist> assists = computeAssists(unit, params.offset, params.length);
+ if (context != null && source != null) {
+ List<Assist> assists =
+ computeAssists(plugin, context, source, params.offset, params.length);
assists.forEach((Assist assist) {
changes.add(assist.change);
});
}
- // respond
return new EditGetAssistsResult(changes).toResponse(request.id);
}
@@ -137,7 +162,7 @@
for (engine.AnalysisError error in errorInfo.errors) {
int errorLine = lineInfo.getLocation(error.offset).lineNumber;
if (errorLine == requestLine) {
- List<Fix> fixes = computeFixes(unit, error);
+ List<Fix> fixes = computeFixes(plugin, unit.element.context, error);
if (fixes.isNotEmpty) {
AnalysisError serverError =
newAnalysisError_fromEngine(lineInfo, error);
@@ -469,7 +494,7 @@
refactoring = new ExtractMethodRefactoring(
searchEngine, units[0], offset, length);
feedback = new ExtractMethodFeedback(
- offset, length, null, [], false, [], [], []);
+ offset, length, '', [], false, [], [], []);
}
}
if (kind == RefactoringKind.INLINE_LOCAL_VARIABLE) {
diff --git a/pkg/analysis_server/lib/src/generated_protocol.dart b/pkg/analysis_server/lib/src/generated_protocol.dart
index 27ad110..57fcf60 100644
--- a/pkg/analysis_server/lib/src/generated_protocol.dart
+++ b/pkg/analysis_server/lib/src/generated_protocol.dart
@@ -37,12 +37,24 @@
* }
*/
class ServerGetVersionResult implements HasToJson {
+ String _version;
+
/**
* The version number of the analysis server.
*/
- String version;
+ String get version => _version;
- ServerGetVersionResult(this.version);
+ /**
+ * The version number of the analysis server.
+ */
+ void set version(String value) {
+ assert(value != null);
+ this._version = value;
+ }
+
+ ServerGetVersionResult(String version) {
+ this.version = version;
+ }
factory ServerGetVersionResult.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
if (json == null) {
@@ -145,12 +157,24 @@
* }
*/
class ServerSetSubscriptionsParams implements HasToJson {
+ List<ServerService> _subscriptions;
+
/**
* A list of the services being subscribed to.
*/
- List<ServerService> subscriptions;
+ List<ServerService> get subscriptions => _subscriptions;
- ServerSetSubscriptionsParams(this.subscriptions);
+ /**
+ * A list of the services being subscribed to.
+ */
+ void set subscriptions(List<ServerService> value) {
+ assert(value != null);
+ this._subscriptions = value;
+ }
+
+ ServerSetSubscriptionsParams(List<ServerService> subscriptions) {
+ this.subscriptions = subscriptions;
+ }
factory ServerSetSubscriptionsParams.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
if (json == null) {
@@ -232,12 +256,24 @@
* }
*/
class ServerConnectedParams implements HasToJson {
+ String _version;
+
/**
* The version number of the analysis server.
*/
- String version;
+ String get version => _version;
- ServerConnectedParams(this.version);
+ /**
+ * The version number of the analysis server.
+ */
+ void set version(String value) {
+ assert(value != null);
+ this._version = value;
+ }
+
+ ServerConnectedParams(String version) {
+ this.version = version;
+ }
factory ServerConnectedParams.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
if (json == null) {
@@ -300,24 +336,60 @@
* }
*/
class ServerErrorParams implements HasToJson {
+ bool _isFatal;
+
+ String _message;
+
+ String _stackTrace;
+
/**
* True if the error is a fatal error, meaning that the server will shutdown
* automatically after sending this notification.
*/
- bool isFatal;
+ bool get isFatal => _isFatal;
+
+ /**
+ * True if the error is a fatal error, meaning that the server will shutdown
+ * automatically after sending this notification.
+ */
+ void set isFatal(bool value) {
+ assert(value != null);
+ this._isFatal = value;
+ }
/**
* The error message indicating what kind of error was encountered.
*/
- String message;
+ String get message => _message;
+
+ /**
+ * The error message indicating what kind of error was encountered.
+ */
+ void set message(String value) {
+ assert(value != null);
+ this._message = value;
+ }
/**
* The stack trace associated with the generation of the error, used for
* debugging the server.
*/
- String stackTrace;
+ String get stackTrace => _stackTrace;
- ServerErrorParams(this.isFatal, this.message, this.stackTrace);
+ /**
+ * The stack trace associated with the generation of the error, used for
+ * debugging the server.
+ */
+ void set stackTrace(String value) {
+ assert(value != null);
+ this._stackTrace = value;
+ }
+
+ ServerErrorParams(bool isFatal, String message, String stackTrace) {
+ this.isFatal = isFatal;
+ this.message = message;
+ this.stackTrace = stackTrace;
+ }
factory ServerErrorParams.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
if (json == null) {
@@ -397,19 +469,42 @@
* }
*/
class ServerStatusParams implements HasToJson {
+ AnalysisStatus _analysis;
+
+ PubStatus _pub;
+
/**
* The current status of analysis, including whether analysis is being
* performed and if so what is being analyzed.
*/
- AnalysisStatus analysis;
+ AnalysisStatus get analysis => _analysis;
+
+ /**
+ * The current status of analysis, including whether analysis is being
+ * performed and if so what is being analyzed.
+ */
+ void set analysis(AnalysisStatus value) {
+ this._analysis = value;
+ }
/**
* The current status of pub execution, indicating whether we are currently
* running pub.
*/
- PubStatus pub;
+ PubStatus get pub => _pub;
- ServerStatusParams({this.analysis, this.pub});
+ /**
+ * The current status of pub execution, indicating whether we are currently
+ * running pub.
+ */
+ void set pub(PubStatus value) {
+ this._pub = value;
+ }
+
+ ServerStatusParams({AnalysisStatus analysis, PubStatus pub}) {
+ this.analysis = analysis;
+ this.pub = pub;
+ }
factory ServerStatusParams.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
if (json == null) {
@@ -479,12 +574,24 @@
* }
*/
class AnalysisGetErrorsParams implements HasToJson {
+ String _file;
+
/**
* The file for which errors are being requested.
*/
- String file;
+ String get file => _file;
- AnalysisGetErrorsParams(this.file);
+ /**
+ * The file for which errors are being requested.
+ */
+ void set file(String value) {
+ assert(value != null);
+ this._file = value;
+ }
+
+ AnalysisGetErrorsParams(String file) {
+ this.file = file;
+ }
factory AnalysisGetErrorsParams.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
if (json == null) {
@@ -545,12 +652,24 @@
* }
*/
class AnalysisGetErrorsResult implements HasToJson {
+ List<AnalysisError> _errors;
+
/**
* The errors associated with the file.
*/
- List<AnalysisError> errors;
+ List<AnalysisError> get errors => _errors;
- AnalysisGetErrorsResult(this.errors);
+ /**
+ * The errors associated with the file.
+ */
+ void set errors(List<AnalysisError> value) {
+ assert(value != null);
+ this._errors = value;
+ }
+
+ AnalysisGetErrorsResult(List<AnalysisError> errors) {
+ this.errors = errors;
+ }
factory AnalysisGetErrorsResult.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
if (json == null) {
@@ -612,17 +731,40 @@
* }
*/
class AnalysisGetHoverParams implements HasToJson {
+ String _file;
+
+ int _offset;
+
/**
* The file in which hover information is being requested.
*/
- String file;
+ String get file => _file;
+
+ /**
+ * The file in which hover information is being requested.
+ */
+ void set file(String value) {
+ assert(value != null);
+ this._file = value;
+ }
/**
* The offset for which hover information is being requested.
*/
- int offset;
+ int get offset => _offset;
- AnalysisGetHoverParams(this.file, this.offset);
+ /**
+ * The offset for which hover information is being requested.
+ */
+ void set offset(int value) {
+ assert(value != null);
+ this._offset = value;
+ }
+
+ AnalysisGetHoverParams(String file, int offset) {
+ this.file = file;
+ this.offset = offset;
+ }
factory AnalysisGetHoverParams.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
if (json == null) {
@@ -692,6 +834,8 @@
* }
*/
class AnalysisGetHoverResult implements HasToJson {
+ List<HoverInformation> _hovers;
+
/**
* The hover information associated with the location. The list will be empty
* if no information could be determined for the location. The list can
@@ -699,9 +843,23 @@
* in conflicting ways (such as a part that is included in multiple
* libraries).
*/
- List<HoverInformation> hovers;
+ List<HoverInformation> get hovers => _hovers;
- AnalysisGetHoverResult(this.hovers);
+ /**
+ * The hover information associated with the location. The list will be empty
+ * if no information could be determined for the location. The list can
+ * contain multiple items if the file is being analyzed in multiple contexts
+ * in conflicting ways (such as a part that is included in multiple
+ * libraries).
+ */
+ void set hovers(List<HoverInformation> value) {
+ assert(value != null);
+ this._hovers = value;
+ }
+
+ AnalysisGetHoverResult(List<HoverInformation> hovers) {
+ this.hovers = hovers;
+ }
factory AnalysisGetHoverResult.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
if (json == null) {
@@ -784,19 +942,44 @@
* }
*/
class AnalysisGetLibraryDependenciesResult implements HasToJson {
+ List<String> _libraries;
+
+ Map<String, Map<String, List<String>>> _packageMap;
+
/**
* A list of the paths of library elements referenced by files in existing
* analysis roots.
*/
- List<String> libraries;
+ List<String> get libraries => _libraries;
+
+ /**
+ * A list of the paths of library elements referenced by files in existing
+ * analysis roots.
+ */
+ void set libraries(List<String> value) {
+ assert(value != null);
+ this._libraries = value;
+ }
/**
* A mapping from context source roots to package maps which map package
* names to source directories for use in client-side package URI resolution.
*/
- Map<String, Map<String, List<String>>> packageMap;
+ Map<String, Map<String, List<String>>> get packageMap => _packageMap;
- AnalysisGetLibraryDependenciesResult(this.libraries, this.packageMap);
+ /**
+ * A mapping from context source roots to package maps which map package
+ * names to source directories for use in client-side package URI resolution.
+ */
+ void set packageMap(Map<String, Map<String, List<String>>> value) {
+ assert(value != null);
+ this._packageMap = value;
+ }
+
+ AnalysisGetLibraryDependenciesResult(List<String> libraries, Map<String, Map<String, List<String>>> packageMap) {
+ this.libraries = libraries;
+ this.packageMap = packageMap;
+ }
factory AnalysisGetLibraryDependenciesResult.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
if (json == null) {
@@ -868,24 +1051,60 @@
* }
*/
class AnalysisGetNavigationParams implements HasToJson {
+ String _file;
+
+ int _offset;
+
+ int _length;
+
/**
* The file in which navigation information is being requested.
*/
- String file;
+ String get file => _file;
+
+ /**
+ * The file in which navigation information is being requested.
+ */
+ void set file(String value) {
+ assert(value != null);
+ this._file = value;
+ }
/**
* The offset of the region for which navigation information is being
* requested.
*/
- int offset;
+ int get offset => _offset;
+
+ /**
+ * The offset of the region for which navigation information is being
+ * requested.
+ */
+ void set offset(int value) {
+ assert(value != null);
+ this._offset = value;
+ }
/**
* The length of the region for which navigation information is being
* requested.
*/
- int length;
+ int get length => _length;
- AnalysisGetNavigationParams(this.file, this.offset, this.length);
+ /**
+ * The length of the region for which navigation information is being
+ * requested.
+ */
+ void set length(int value) {
+ assert(value != null);
+ this._length = value;
+ }
+
+ AnalysisGetNavigationParams(String file, int offset, int length) {
+ this.file = file;
+ this.offset = offset;
+ this.length = length;
+ }
factory AnalysisGetNavigationParams.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
if (json == null) {
@@ -966,24 +1185,60 @@
* }
*/
class AnalysisGetNavigationResult implements HasToJson {
+ List<String> _files;
+
+ List<NavigationTarget> _targets;
+
+ List<NavigationRegion> _regions;
+
/**
* A list of the paths of files that are referenced by the navigation
* targets.
*/
- List<String> files;
+ List<String> get files => _files;
+
+ /**
+ * A list of the paths of files that are referenced by the navigation
+ * targets.
+ */
+ void set files(List<String> value) {
+ assert(value != null);
+ this._files = value;
+ }
/**
* A list of the navigation targets that are referenced by the navigation
* regions.
*/
- List<NavigationTarget> targets;
+ List<NavigationTarget> get targets => _targets;
+
+ /**
+ * A list of the navigation targets that are referenced by the navigation
+ * regions.
+ */
+ void set targets(List<NavigationTarget> value) {
+ assert(value != null);
+ this._targets = value;
+ }
/**
* A list of the navigation regions within the requested region of the file.
*/
- List<NavigationRegion> regions;
+ List<NavigationRegion> get regions => _regions;
- AnalysisGetNavigationResult(this.files, this.targets, this.regions);
+ /**
+ * A list of the navigation regions within the requested region of the file.
+ */
+ void set regions(List<NavigationRegion> value) {
+ assert(value != null);
+ this._regions = value;
+ }
+
+ AnalysisGetNavigationResult(List<String> files, List<NavigationTarget> targets, List<NavigationRegion> regions) {
+ this.files = files;
+ this.targets = targets;
+ this.regions = regions;
+ }
factory AnalysisGetNavigationResult.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
if (json == null) {
@@ -1062,12 +1317,23 @@
* }
*/
class AnalysisReanalyzeParams implements HasToJson {
+ List<String> _roots;
+
/**
* A list of the analysis roots that are to be re-analyzed.
*/
- List<String> roots;
+ List<String> get roots => _roots;
- AnalysisReanalyzeParams({this.roots});
+ /**
+ * A list of the analysis roots that are to be re-analyzed.
+ */
+ void set roots(List<String> value) {
+ this._roots = value;
+ }
+
+ AnalysisReanalyzeParams({List<String> roots}) {
+ this.roots = roots;
+ }
factory AnalysisReanalyzeParams.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
if (json == null) {
@@ -1151,16 +1417,39 @@
* }
*/
class AnalysisSetAnalysisRootsParams implements HasToJson {
+ List<String> _included;
+
+ List<String> _excluded;
+
+ Map<String, String> _packageRoots;
+
/**
* A list of the files and directories that should be analyzed.
*/
- List<String> included;
+ List<String> get included => _included;
+
+ /**
+ * A list of the files and directories that should be analyzed.
+ */
+ void set included(List<String> value) {
+ assert(value != null);
+ this._included = value;
+ }
/**
* A list of the files and directories within the included directories that
* should not be analyzed.
*/
- List<String> excluded;
+ List<String> get excluded => _excluded;
+
+ /**
+ * A list of the files and directories within the included directories that
+ * should not be analyzed.
+ */
+ void set excluded(List<String> value) {
+ assert(value != null);
+ this._excluded = value;
+ }
/**
* A mapping from source directories to target directories that should
@@ -1176,9 +1465,31 @@
* this field is absent, or the empty map is specified, that indicates that
* the normal pubspec.yaml mechanism should always be used.
*/
- Map<String, String> packageRoots;
+ Map<String, String> get packageRoots => _packageRoots;
- AnalysisSetAnalysisRootsParams(this.included, this.excluded, {this.packageRoots});
+ /**
+ * A mapping from source directories to target directories that should
+ * override the normal package: URI resolution mechanism. The analyzer will
+ * behave as though each source directory in the map contains a special
+ * pubspec.yaml file which resolves any package: URI to the corresponding
+ * path within the target directory. The effect is the same as specifying the
+ * target directory as a "--package_root" parameter to the Dart VM when
+ * executing any Dart file inside the source directory.
+ *
+ * Files in any directories that are not overridden by this mapping have
+ * their package: URI's resolved using the normal pubspec.yaml mechanism. If
+ * this field is absent, or the empty map is specified, that indicates that
+ * the normal pubspec.yaml mechanism should always be used.
+ */
+ void set packageRoots(Map<String, String> value) {
+ this._packageRoots = value;
+ }
+
+ AnalysisSetAnalysisRootsParams(List<String> included, List<String> excluded, {Map<String, String> packageRoots}) {
+ this.included = included;
+ this.excluded = excluded;
+ this.packageRoots = packageRoots;
+ }
factory AnalysisSetAnalysisRootsParams.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
if (json == null) {
@@ -1278,12 +1589,24 @@
* }
*/
class AnalysisSetPriorityFilesParams implements HasToJson {
+ List<String> _files;
+
/**
* The files that are to be a priority for analysis.
*/
- List<String> files;
+ List<String> get files => _files;
- AnalysisSetPriorityFilesParams(this.files);
+ /**
+ * The files that are to be a priority for analysis.
+ */
+ void set files(List<String> value) {
+ assert(value != null);
+ this._files = value;
+ }
+
+ AnalysisSetPriorityFilesParams(List<String> files) {
+ this.files = files;
+ }
factory AnalysisSetPriorityFilesParams.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
if (json == null) {
@@ -1365,13 +1688,26 @@
* }
*/
class AnalysisSetSubscriptionsParams implements HasToJson {
+ Map<AnalysisService, List<String>> _subscriptions;
+
/**
* A table mapping services to a list of the files being subscribed to the
* service.
*/
- Map<AnalysisService, List<String>> subscriptions;
+ Map<AnalysisService, List<String>> get subscriptions => _subscriptions;
- AnalysisSetSubscriptionsParams(this.subscriptions);
+ /**
+ * A table mapping services to a list of the files being subscribed to the
+ * service.
+ */
+ void set subscriptions(Map<AnalysisService, List<String>> value) {
+ assert(value != null);
+ this._subscriptions = value;
+ }
+
+ AnalysisSetSubscriptionsParams(Map<AnalysisService, List<String>> subscriptions) {
+ this.subscriptions = subscriptions;
+ }
factory AnalysisSetSubscriptionsParams.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
if (json == null) {
@@ -1453,13 +1789,26 @@
* }
*/
class AnalysisUpdateContentParams implements HasToJson {
+ Map<String, dynamic> _files;
+
/**
* A table mapping the files whose content has changed to a description of
* the content change.
*/
- Map<String, dynamic> files;
+ Map<String, dynamic> get files => _files;
- AnalysisUpdateContentParams(this.files);
+ /**
+ * A table mapping the files whose content has changed to a description of
+ * the content change.
+ */
+ void set files(Map<String, dynamic> value) {
+ assert(value != null);
+ this._files = value;
+ }
+
+ AnalysisUpdateContentParams(Map<String, dynamic> files) {
+ this.files = files;
+ }
factory AnalysisUpdateContentParams.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
if (json == null) {
@@ -1572,12 +1921,24 @@
* }
*/
class AnalysisUpdateOptionsParams implements HasToJson {
+ AnalysisOptions _options;
+
/**
* The options that are to be used to control analysis.
*/
- AnalysisOptions options;
+ AnalysisOptions get options => _options;
- AnalysisUpdateOptionsParams(this.options);
+ /**
+ * The options that are to be used to control analysis.
+ */
+ void set options(AnalysisOptions value) {
+ assert(value != null);
+ this._options = value;
+ }
+
+ AnalysisUpdateOptionsParams(AnalysisOptions options) {
+ this.options = options;
+ }
factory AnalysisUpdateOptionsParams.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
if (json == null) {
@@ -1660,17 +2021,40 @@
* }
*/
class AnalysisErrorsParams implements HasToJson {
+ String _file;
+
+ List<AnalysisError> _errors;
+
/**
* The file containing the errors.
*/
- String file;
+ String get file => _file;
+
+ /**
+ * The file containing the errors.
+ */
+ void set file(String value) {
+ assert(value != null);
+ this._file = value;
+ }
/**
* The errors contained in the file.
*/
- List<AnalysisError> errors;
+ List<AnalysisError> get errors => _errors;
- AnalysisErrorsParams(this.file, this.errors);
+ /**
+ * The errors contained in the file.
+ */
+ void set errors(List<AnalysisError> value) {
+ assert(value != null);
+ this._errors = value;
+ }
+
+ AnalysisErrorsParams(String file, List<AnalysisError> errors) {
+ this.file = file;
+ this.errors = errors;
+ }
factory AnalysisErrorsParams.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
if (json == null) {
@@ -1740,12 +2124,24 @@
* }
*/
class AnalysisFlushResultsParams implements HasToJson {
+ List<String> _files;
+
/**
* The files that are no longer being analyzed.
*/
- List<String> files;
+ List<String> get files => _files;
- AnalysisFlushResultsParams(this.files);
+ /**
+ * The files that are no longer being analyzed.
+ */
+ void set files(List<String> value) {
+ assert(value != null);
+ this._files = value;
+ }
+
+ AnalysisFlushResultsParams(List<String> files) {
+ this.files = files;
+ }
factory AnalysisFlushResultsParams.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
if (json == null) {
@@ -1807,17 +2203,40 @@
* }
*/
class AnalysisFoldingParams implements HasToJson {
+ String _file;
+
+ List<FoldingRegion> _regions;
+
/**
* The file containing the folding regions.
*/
- String file;
+ String get file => _file;
+
+ /**
+ * The file containing the folding regions.
+ */
+ void set file(String value) {
+ assert(value != null);
+ this._file = value;
+ }
/**
* The folding regions contained in the file.
*/
- List<FoldingRegion> regions;
+ List<FoldingRegion> get regions => _regions;
- AnalysisFoldingParams(this.file, this.regions);
+ /**
+ * The folding regions contained in the file.
+ */
+ void set regions(List<FoldingRegion> value) {
+ assert(value != null);
+ this._regions = value;
+ }
+
+ AnalysisFoldingParams(String file, List<FoldingRegion> regions) {
+ this.file = file;
+ this.regions = regions;
+ }
factory AnalysisFoldingParams.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
if (json == null) {
@@ -1888,10 +2307,22 @@
* }
*/
class AnalysisHighlightsParams implements HasToJson {
+ String _file;
+
+ List<HighlightRegion> _regions;
+
/**
* The file containing the highlight regions.
*/
- String file;
+ String get file => _file;
+
+ /**
+ * The file containing the highlight regions.
+ */
+ void set file(String value) {
+ assert(value != null);
+ this._file = value;
+ }
/**
* The highlight regions contained in the file. Each highlight region
@@ -1900,9 +2331,24 @@
* highlight regions if there is more than one meaning associated with a
* particular region.
*/
- List<HighlightRegion> regions;
+ List<HighlightRegion> get regions => _regions;
- AnalysisHighlightsParams(this.file, this.regions);
+ /**
+ * The highlight regions contained in the file. Each highlight region
+ * represents a particular syntactic or semantic meaning associated with some
+ * range. Note that the highlight regions that are returned can overlap other
+ * highlight regions if there is more than one meaning associated with a
+ * particular region.
+ */
+ void set regions(List<HighlightRegion> value) {
+ assert(value != null);
+ this._regions = value;
+ }
+
+ AnalysisHighlightsParams(String file, List<HighlightRegion> regions) {
+ this.file = file;
+ this.regions = regions;
+ }
factory AnalysisHighlightsParams.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
if (json == null) {
@@ -1975,29 +2421,76 @@
* }
*/
class AnalysisInvalidateParams implements HasToJson {
+ String _file;
+
+ int _offset;
+
+ int _length;
+
+ int _delta;
+
/**
* The file whose information has been invalidated.
*/
- String file;
+ String get file => _file;
+
+ /**
+ * The file whose information has been invalidated.
+ */
+ void set file(String value) {
+ assert(value != null);
+ this._file = value;
+ }
/**
* The offset of the invalidated region.
*/
- int offset;
+ int get offset => _offset;
+
+ /**
+ * The offset of the invalidated region.
+ */
+ void set offset(int value) {
+ assert(value != null);
+ this._offset = value;
+ }
/**
* The length of the invalidated region.
*/
- int length;
+ int get length => _length;
+
+ /**
+ * The length of the invalidated region.
+ */
+ void set length(int value) {
+ assert(value != null);
+ this._length = value;
+ }
/**
* The delta to be applied to the offsets in information that follows the
* invalidated region in order to update it so that it doesn't need to be
* re-requested.
*/
- int delta;
+ int get delta => _delta;
- AnalysisInvalidateParams(this.file, this.offset, this.length, this.delta);
+ /**
+ * The delta to be applied to the offsets in information that follows the
+ * invalidated region in order to update it so that it doesn't need to be
+ * re-requested.
+ */
+ void set delta(int value) {
+ assert(value != null);
+ this._delta = value;
+ }
+
+ AnalysisInvalidateParams(String file, int offset, int length, int delta) {
+ this.file = file;
+ this.offset = offset;
+ this.length = length;
+ this.delta = delta;
+ }
factory AnalysisInvalidateParams.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
if (json == null) {
@@ -2088,10 +2581,26 @@
* }
*/
class AnalysisNavigationParams implements HasToJson {
+ String _file;
+
+ List<NavigationRegion> _regions;
+
+ List<NavigationTarget> _targets;
+
+ List<String> _files;
+
/**
* The file containing the navigation regions.
*/
- String file;
+ String get file => _file;
+
+ /**
+ * The file containing the navigation regions.
+ */
+ void set file(String value) {
+ assert(value != null);
+ this._file = value;
+ }
/**
* The navigation regions contained in the file. The regions are sorted by
@@ -2102,21 +2611,58 @@
* versions of a package. Note that the navigation regions that are returned
* do not overlap other navigation regions.
*/
- List<NavigationRegion> regions;
+ List<NavigationRegion> get regions => _regions;
+
+ /**
+ * The navigation regions contained in the file. The regions are sorted by
+ * their offsets. Each navigation region represents a list of targets
+ * associated with some range. The lists will usually contain a single
+ * target, but can contain more in the case of a part that is included in
+ * multiple libraries or in Dart code that is compiled against multiple
+ * versions of a package. Note that the navigation regions that are returned
+ * do not overlap other navigation regions.
+ */
+ void set regions(List<NavigationRegion> value) {
+ assert(value != null);
+ this._regions = value;
+ }
/**
* The navigation targets referenced in the file. They are referenced by
* NavigationRegions by their index in this array.
*/
- List<NavigationTarget> targets;
+ List<NavigationTarget> get targets => _targets;
+
+ /**
+ * The navigation targets referenced in the file. They are referenced by
+ * NavigationRegions by their index in this array.
+ */
+ void set targets(List<NavigationTarget> value) {
+ assert(value != null);
+ this._targets = value;
+ }
/**
* The files containing navigation targets referenced in the file. They are
* referenced by NavigationTargets by their index in this array.
*/
- List<String> files;
+ List<String> get files => _files;
- AnalysisNavigationParams(this.file, this.regions, this.targets, this.files);
+ /**
+ * The files containing navigation targets referenced in the file. They are
+ * referenced by NavigationTargets by their index in this array.
+ */
+ void set files(List<String> value) {
+ assert(value != null);
+ this._files = value;
+ }
+
+ AnalysisNavigationParams(String file, List<NavigationRegion> regions, List<NavigationTarget> targets, List<String> files) {
+ this.file = file;
+ this.regions = regions;
+ this.targets = targets;
+ this.files = files;
+ }
factory AnalysisNavigationParams.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
if (json == null) {
@@ -2205,17 +2751,40 @@
* }
*/
class AnalysisOccurrencesParams implements HasToJson {
+ String _file;
+
+ List<Occurrences> _occurrences;
+
/**
* The file in which the references occur.
*/
- String file;
+ String get file => _file;
+
+ /**
+ * The file in which the references occur.
+ */
+ void set file(String value) {
+ assert(value != null);
+ this._file = value;
+ }
/**
* The occurrences of references to elements within the file.
*/
- List<Occurrences> occurrences;
+ List<Occurrences> get occurrences => _occurrences;
- AnalysisOccurrencesParams(this.file, this.occurrences);
+ /**
+ * The occurrences of references to elements within the file.
+ */
+ void set occurrences(List<Occurrences> value) {
+ assert(value != null);
+ this._occurrences = value;
+ }
+
+ AnalysisOccurrencesParams(String file, List<Occurrences> occurrences) {
+ this.file = file;
+ this.occurrences = occurrences;
+ }
factory AnalysisOccurrencesParams.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
if (json == null) {
@@ -2286,17 +2855,40 @@
* }
*/
class AnalysisOutlineParams implements HasToJson {
+ String _file;
+
+ Outline _outline;
+
/**
* The file with which the outline is associated.
*/
- String file;
+ String get file => _file;
+
+ /**
+ * The file with which the outline is associated.
+ */
+ void set file(String value) {
+ assert(value != null);
+ this._file = value;
+ }
/**
* The outline associated with the file.
*/
- Outline outline;
+ Outline get outline => _outline;
- AnalysisOutlineParams(this.file, this.outline);
+ /**
+ * The outline associated with the file.
+ */
+ void set outline(Outline value) {
+ assert(value != null);
+ this._outline = value;
+ }
+
+ AnalysisOutlineParams(String file, Outline outline) {
+ this.file = file;
+ this.outline = outline;
+ }
factory AnalysisOutlineParams.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
if (json == null) {
@@ -2367,17 +2959,40 @@
* }
*/
class AnalysisOverridesParams implements HasToJson {
+ String _file;
+
+ List<Override> _overrides;
+
/**
* The file with which the overrides are associated.
*/
- String file;
+ String get file => _file;
+
+ /**
+ * The file with which the overrides are associated.
+ */
+ void set file(String value) {
+ assert(value != null);
+ this._file = value;
+ }
/**
* The overrides associated with the file.
*/
- List<Override> overrides;
+ List<Override> get overrides => _overrides;
- AnalysisOverridesParams(this.file, this.overrides);
+ /**
+ * The overrides associated with the file.
+ */
+ void set overrides(List<Override> value) {
+ assert(value != null);
+ this._overrides = value;
+ }
+
+ AnalysisOverridesParams(String file, List<Override> overrides) {
+ this.file = file;
+ this.overrides = overrides;
+ }
factory AnalysisOverridesParams.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
if (json == null) {
@@ -2448,17 +3063,40 @@
* }
*/
class CompletionGetSuggestionsParams implements HasToJson {
+ String _file;
+
+ int _offset;
+
/**
* The file containing the point at which suggestions are to be made.
*/
- String file;
+ String get file => _file;
+
+ /**
+ * The file containing the point at which suggestions are to be made.
+ */
+ void set file(String value) {
+ assert(value != null);
+ this._file = value;
+ }
/**
* The offset within the file at which suggestions are to be made.
*/
- int offset;
+ int get offset => _offset;
- CompletionGetSuggestionsParams(this.file, this.offset);
+ /**
+ * The offset within the file at which suggestions are to be made.
+ */
+ void set offset(int value) {
+ assert(value != null);
+ this._offset = value;
+ }
+
+ CompletionGetSuggestionsParams(String file, int offset) {
+ this.file = file;
+ this.offset = offset;
+ }
factory CompletionGetSuggestionsParams.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
if (json == null) {
@@ -2528,12 +3166,24 @@
* }
*/
class CompletionGetSuggestionsResult implements HasToJson {
+ String _id;
+
/**
* The identifier used to associate results with this completion request.
*/
- String id;
+ String get id => _id;
- CompletionGetSuggestionsResult(this.id);
+ /**
+ * The identifier used to associate results with this completion request.
+ */
+ void set id(String value) {
+ assert(value != null);
+ this._id = value;
+ }
+
+ CompletionGetSuggestionsResult(String id) {
+ this.id = id;
+ }
factory CompletionGetSuggestionsResult.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
if (json == null) {
@@ -2598,10 +3248,28 @@
* }
*/
class CompletionResultsParams implements HasToJson {
+ String _id;
+
+ int _replacementOffset;
+
+ int _replacementLength;
+
+ List<CompletionSuggestion> _results;
+
+ bool _isLast;
+
/**
* The id associated with the completion.
*/
- String id;
+ String get id => _id;
+
+ /**
+ * The id associated with the completion.
+ */
+ void set id(String value) {
+ assert(value != null);
+ this._id = value;
+ }
/**
* The offset of the start of the text to be replaced. This will be different
@@ -2609,14 +3277,35 @@
* portion of an identifier before the original offset. In particular, the
* replacementOffset will be the offset of the beginning of said identifier.
*/
- int replacementOffset;
+ int get replacementOffset => _replacementOffset;
+
+ /**
+ * The offset of the start of the text to be replaced. This will be different
+ * than the offset used to request the completion suggestions if there was a
+ * portion of an identifier before the original offset. In particular, the
+ * replacementOffset will be the offset of the beginning of said identifier.
+ */
+ void set replacementOffset(int value) {
+ assert(value != null);
+ this._replacementOffset = value;
+ }
/**
* The length of the text to be replaced if the remainder of the identifier
* containing the cursor is to be replaced when the suggestion is applied
* (that is, the number of characters in the existing identifier).
*/
- int replacementLength;
+ int get replacementLength => _replacementLength;
+
+ /**
+ * The length of the text to be replaced if the remainder of the identifier
+ * containing the cursor is to be replaced when the suggestion is applied
+ * (that is, the number of characters in the existing identifier).
+ */
+ void set replacementLength(int value) {
+ assert(value != null);
+ this._replacementLength = value;
+ }
/**
* The completion suggestions being reported. The notification contains all
@@ -2625,15 +3314,42 @@
* client to respond to further keystrokes from the user without having to
* make additional requests.
*/
- List<CompletionSuggestion> results;
+ List<CompletionSuggestion> get results => _results;
+
+ /**
+ * The completion suggestions being reported. The notification contains all
+ * possible completions at the requested cursor position, even those that do
+ * not match the characters the user has already typed. This allows the
+ * client to respond to further keystrokes from the user without having to
+ * make additional requests.
+ */
+ void set results(List<CompletionSuggestion> value) {
+ assert(value != null);
+ this._results = value;
+ }
/**
* True if this is that last set of results that will be returned for the
* indicated completion.
*/
- bool isLast;
+ bool get isLast => _isLast;
- CompletionResultsParams(this.id, this.replacementOffset, this.replacementLength, this.results, this.isLast);
+ /**
+ * True if this is that last set of results that will be returned for the
+ * indicated completion.
+ */
+ void set isLast(bool value) {
+ assert(value != null);
+ this._isLast = value;
+ }
+
+ CompletionResultsParams(String id, int replacementOffset, int replacementLength, List<CompletionSuggestion> results, bool isLast) {
+ this.id = id;
+ this.replacementOffset = replacementOffset;
+ this.replacementLength = replacementLength;
+ this.results = results;
+ this.isLast = isLast;
+ }
factory CompletionResultsParams.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
if (json == null) {
@@ -2732,24 +3448,60 @@
* }
*/
class SearchFindElementReferencesParams implements HasToJson {
+ String _file;
+
+ int _offset;
+
+ bool _includePotential;
+
/**
* The file containing the declaration of or reference to the element used to
* define the search.
*/
- String file;
+ String get file => _file;
+
+ /**
+ * The file containing the declaration of or reference to the element used to
+ * define the search.
+ */
+ void set file(String value) {
+ assert(value != null);
+ this._file = value;
+ }
/**
* The offset within the file of the declaration of or reference to the
* element.
*/
- int offset;
+ int get offset => _offset;
+
+ /**
+ * The offset within the file of the declaration of or reference to the
+ * element.
+ */
+ void set offset(int value) {
+ assert(value != null);
+ this._offset = value;
+ }
/**
* True if potential matches are to be included in the results.
*/
- bool includePotential;
+ bool get includePotential => _includePotential;
- SearchFindElementReferencesParams(this.file, this.offset, this.includePotential);
+ /**
+ * True if potential matches are to be included in the results.
+ */
+ void set includePotential(bool value) {
+ assert(value != null);
+ this._includePotential = value;
+ }
+
+ SearchFindElementReferencesParams(String file, int offset, bool includePotential) {
+ this.file = file;
+ this.offset = offset;
+ this.includePotential = includePotential;
+ }
factory SearchFindElementReferencesParams.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
if (json == null) {
@@ -2829,13 +3581,27 @@
* }
*/
class SearchFindElementReferencesResult implements HasToJson {
+ String _id;
+
+ Element _element;
+
/**
* The identifier used to associate results with this search request.
*
* If no element was found at the given location, this field will be absent,
* and no results will be reported via the search.results notification.
*/
- String id;
+ String get id => _id;
+
+ /**
+ * The identifier used to associate results with this search request.
+ *
+ * If no element was found at the given location, this field will be absent,
+ * and no results will be reported via the search.results notification.
+ */
+ void set id(String value) {
+ this._id = value;
+ }
/**
* The element referenced or defined at the given offset and whose references
@@ -2843,9 +3609,22 @@
*
* If no element was found at the given location, this field will be absent.
*/
- Element element;
+ Element get element => _element;
- SearchFindElementReferencesResult({this.id, this.element});
+ /**
+ * The element referenced or defined at the given offset and whose references
+ * will be returned in the search results.
+ *
+ * If no element was found at the given location, this field will be absent.
+ */
+ void set element(Element value) {
+ this._element = value;
+ }
+
+ SearchFindElementReferencesResult({String id, Element element}) {
+ this.id = id;
+ this.element = element;
+ }
factory SearchFindElementReferencesResult.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
if (json == null) {
@@ -2915,12 +3694,24 @@
* }
*/
class SearchFindMemberDeclarationsParams implements HasToJson {
+ String _name;
+
/**
* The name of the declarations to be found.
*/
- String name;
+ String get name => _name;
- SearchFindMemberDeclarationsParams(this.name);
+ /**
+ * The name of the declarations to be found.
+ */
+ void set name(String value) {
+ assert(value != null);
+ this._name = value;
+ }
+
+ SearchFindMemberDeclarationsParams(String name) {
+ this.name = name;
+ }
factory SearchFindMemberDeclarationsParams.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
if (json == null) {
@@ -2981,12 +3772,24 @@
* }
*/
class SearchFindMemberDeclarationsResult implements HasToJson {
+ String _id;
+
/**
* The identifier used to associate results with this search request.
*/
- String id;
+ String get id => _id;
- SearchFindMemberDeclarationsResult(this.id);
+ /**
+ * The identifier used to associate results with this search request.
+ */
+ void set id(String value) {
+ assert(value != null);
+ this._id = value;
+ }
+
+ SearchFindMemberDeclarationsResult(String id) {
+ this.id = id;
+ }
factory SearchFindMemberDeclarationsResult.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
if (json == null) {
@@ -3047,12 +3850,24 @@
* }
*/
class SearchFindMemberReferencesParams implements HasToJson {
+ String _name;
+
/**
* The name of the references to be found.
*/
- String name;
+ String get name => _name;
- SearchFindMemberReferencesParams(this.name);
+ /**
+ * The name of the references to be found.
+ */
+ void set name(String value) {
+ assert(value != null);
+ this._name = value;
+ }
+
+ SearchFindMemberReferencesParams(String name) {
+ this.name = name;
+ }
factory SearchFindMemberReferencesParams.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
if (json == null) {
@@ -3113,12 +3928,24 @@
* }
*/
class SearchFindMemberReferencesResult implements HasToJson {
+ String _id;
+
/**
* The identifier used to associate results with this search request.
*/
- String id;
+ String get id => _id;
- SearchFindMemberReferencesResult(this.id);
+ /**
+ * The identifier used to associate results with this search request.
+ */
+ void set id(String value) {
+ assert(value != null);
+ this._id = value;
+ }
+
+ SearchFindMemberReferencesResult(String id) {
+ this.id = id;
+ }
factory SearchFindMemberReferencesResult.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
if (json == null) {
@@ -3179,13 +4006,26 @@
* }
*/
class SearchFindTopLevelDeclarationsParams implements HasToJson {
+ String _pattern;
+
/**
* The regular expression used to match the names of the declarations to be
* found.
*/
- String pattern;
+ String get pattern => _pattern;
- SearchFindTopLevelDeclarationsParams(this.pattern);
+ /**
+ * The regular expression used to match the names of the declarations to be
+ * found.
+ */
+ void set pattern(String value) {
+ assert(value != null);
+ this._pattern = value;
+ }
+
+ SearchFindTopLevelDeclarationsParams(String pattern) {
+ this.pattern = pattern;
+ }
factory SearchFindTopLevelDeclarationsParams.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
if (json == null) {
@@ -3246,12 +4086,24 @@
* }
*/
class SearchFindTopLevelDeclarationsResult implements HasToJson {
+ String _id;
+
/**
* The identifier used to associate results with this search request.
*/
- String id;
+ String get id => _id;
- SearchFindTopLevelDeclarationsResult(this.id);
+ /**
+ * The identifier used to associate results with this search request.
+ */
+ void set id(String value) {
+ assert(value != null);
+ this._id = value;
+ }
+
+ SearchFindTopLevelDeclarationsResult(String id) {
+ this.id = id;
+ }
factory SearchFindTopLevelDeclarationsResult.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
if (json == null) {
@@ -3313,18 +4165,42 @@
* }
*/
class SearchGetTypeHierarchyParams implements HasToJson {
+ String _file;
+
+ int _offset;
+
/**
* The file containing the declaration or reference to the type for which a
* hierarchy is being requested.
*/
- String file;
+ String get file => _file;
+
+ /**
+ * The file containing the declaration or reference to the type for which a
+ * hierarchy is being requested.
+ */
+ void set file(String value) {
+ assert(value != null);
+ this._file = value;
+ }
/**
* The offset of the name of the type within the file.
*/
- int offset;
+ int get offset => _offset;
- SearchGetTypeHierarchyParams(this.file, this.offset);
+ /**
+ * The offset of the name of the type within the file.
+ */
+ void set offset(int value) {
+ assert(value != null);
+ this._offset = value;
+ }
+
+ SearchGetTypeHierarchyParams(String file, int offset) {
+ this.file = file;
+ this.offset = offset;
+ }
factory SearchGetTypeHierarchyParams.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
if (json == null) {
@@ -3394,6 +4270,8 @@
* }
*/
class SearchGetTypeHierarchyResult implements HasToJson {
+ List<TypeHierarchyItem> _hierarchyItems;
+
/**
* A list of the types in the requested hierarchy. The first element of the
* list is the item representing the type for which the hierarchy was
@@ -3405,9 +4283,26 @@
* not represent a type, or if the file has not been sufficiently analyzed to
* allow a type hierarchy to be produced.
*/
- List<TypeHierarchyItem> hierarchyItems;
+ List<TypeHierarchyItem> get hierarchyItems => _hierarchyItems;
- SearchGetTypeHierarchyResult({this.hierarchyItems});
+ /**
+ * A list of the types in the requested hierarchy. The first element of the
+ * list is the item representing the type for which the hierarchy was
+ * requested. The index of other elements of the list is unspecified, but
+ * correspond to the integers used to reference supertype and subtype items
+ * within the items.
+ *
+ * This field will be absent if the code at the given file and offset does
+ * not represent a type, or if the file has not been sufficiently analyzed to
+ * allow a type hierarchy to be produced.
+ */
+ void set hierarchyItems(List<TypeHierarchyItem> value) {
+ this._hierarchyItems = value;
+ }
+
+ SearchGetTypeHierarchyResult({List<TypeHierarchyItem> hierarchyItems}) {
+ this.hierarchyItems = hierarchyItems;
+ }
factory SearchGetTypeHierarchyResult.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
if (json == null) {
@@ -3470,23 +4365,58 @@
* }
*/
class SearchResultsParams implements HasToJson {
+ String _id;
+
+ List<SearchResult> _results;
+
+ bool _isLast;
+
/**
* The id associated with the search.
*/
- String id;
+ String get id => _id;
+
+ /**
+ * The id associated with the search.
+ */
+ void set id(String value) {
+ assert(value != null);
+ this._id = value;
+ }
/**
* The search results being reported.
*/
- List<SearchResult> results;
+ List<SearchResult> get results => _results;
+
+ /**
+ * The search results being reported.
+ */
+ void set results(List<SearchResult> value) {
+ assert(value != null);
+ this._results = value;
+ }
/**
* True if this is that last set of results that will be returned for the
* indicated search.
*/
- bool isLast;
+ bool get isLast => _isLast;
- SearchResultsParams(this.id, this.results, this.isLast);
+ /**
+ * True if this is that last set of results that will be returned for the
+ * indicated search.
+ */
+ void set isLast(bool value) {
+ assert(value != null);
+ this._isLast = value;
+ }
+
+ SearchResultsParams(String id, List<SearchResult> results, bool isLast) {
+ this.id = id;
+ this.results = results;
+ this.isLast = isLast;
+ }
factory SearchResultsParams.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
if (json == null) {
@@ -3567,22 +4497,56 @@
* }
*/
class EditFormatParams implements HasToJson {
+ String _file;
+
+ int _selectionOffset;
+
+ int _selectionLength;
+
/**
* The file containing the code to be formatted.
*/
- String file;
+ String get file => _file;
+
+ /**
+ * The file containing the code to be formatted.
+ */
+ void set file(String value) {
+ assert(value != null);
+ this._file = value;
+ }
/**
* The offset of the current selection in the file.
*/
- int selectionOffset;
+ int get selectionOffset => _selectionOffset;
+
+ /**
+ * The offset of the current selection in the file.
+ */
+ void set selectionOffset(int value) {
+ assert(value != null);
+ this._selectionOffset = value;
+ }
/**
* The length of the current selection in the file.
*/
- int selectionLength;
+ int get selectionLength => _selectionLength;
- EditFormatParams(this.file, this.selectionOffset, this.selectionLength);
+ /**
+ * The length of the current selection in the file.
+ */
+ void set selectionLength(int value) {
+ assert(value != null);
+ this._selectionLength = value;
+ }
+
+ EditFormatParams(String file, int selectionOffset, int selectionLength) {
+ this.file = file;
+ this.selectionOffset = selectionOffset;
+ this.selectionLength = selectionLength;
+ }
factory EditFormatParams.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
if (json == null) {
@@ -3663,23 +4627,58 @@
* }
*/
class EditFormatResult implements HasToJson {
+ List<SourceEdit> _edits;
+
+ int _selectionOffset;
+
+ int _selectionLength;
+
/**
* The edit(s) to be applied in order to format the code. The list will be
* empty if the code was already formatted (there are no changes).
*/
- List<SourceEdit> edits;
+ List<SourceEdit> get edits => _edits;
+
+ /**
+ * The edit(s) to be applied in order to format the code. The list will be
+ * empty if the code was already formatted (there are no changes).
+ */
+ void set edits(List<SourceEdit> value) {
+ assert(value != null);
+ this._edits = value;
+ }
/**
* The offset of the selection after formatting the code.
*/
- int selectionOffset;
+ int get selectionOffset => _selectionOffset;
+
+ /**
+ * The offset of the selection after formatting the code.
+ */
+ void set selectionOffset(int value) {
+ assert(value != null);
+ this._selectionOffset = value;
+ }
/**
* The length of the selection after formatting the code.
*/
- int selectionLength;
+ int get selectionLength => _selectionLength;
- EditFormatResult(this.edits, this.selectionOffset, this.selectionLength);
+ /**
+ * The length of the selection after formatting the code.
+ */
+ void set selectionLength(int value) {
+ assert(value != null);
+ this._selectionLength = value;
+ }
+
+ EditFormatResult(List<SourceEdit> edits, int selectionOffset, int selectionLength) {
+ this.edits = edits;
+ this.selectionOffset = selectionOffset;
+ this.selectionLength = selectionLength;
+ }
factory EditFormatResult.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
if (json == null) {
@@ -3760,22 +4759,56 @@
* }
*/
class EditGetAssistsParams implements HasToJson {
+ String _file;
+
+ int _offset;
+
+ int _length;
+
/**
* The file containing the code for which assists are being requested.
*/
- String file;
+ String get file => _file;
+
+ /**
+ * The file containing the code for which assists are being requested.
+ */
+ void set file(String value) {
+ assert(value != null);
+ this._file = value;
+ }
/**
* The offset of the code for which assists are being requested.
*/
- int offset;
+ int get offset => _offset;
+
+ /**
+ * The offset of the code for which assists are being requested.
+ */
+ void set offset(int value) {
+ assert(value != null);
+ this._offset = value;
+ }
/**
* The length of the code for which assists are being requested.
*/
- int length;
+ int get length => _length;
- EditGetAssistsParams(this.file, this.offset, this.length);
+ /**
+ * The length of the code for which assists are being requested.
+ */
+ void set length(int value) {
+ assert(value != null);
+ this._length = value;
+ }
+
+ EditGetAssistsParams(String file, int offset, int length) {
+ this.file = file;
+ this.offset = offset;
+ this.length = length;
+ }
factory EditGetAssistsParams.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
if (json == null) {
@@ -3854,12 +4887,24 @@
* }
*/
class EditGetAssistsResult implements HasToJson {
+ List<SourceChange> _assists;
+
/**
* The assists that are available at the given location.
*/
- List<SourceChange> assists;
+ List<SourceChange> get assists => _assists;
- EditGetAssistsResult(this.assists);
+ /**
+ * The assists that are available at the given location.
+ */
+ void set assists(List<SourceChange> value) {
+ assert(value != null);
+ this._assists = value;
+ }
+
+ EditGetAssistsResult(List<SourceChange> assists) {
+ this.assists = assists;
+ }
factory EditGetAssistsResult.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
if (json == null) {
@@ -3922,22 +4967,56 @@
* }
*/
class EditGetAvailableRefactoringsParams implements HasToJson {
+ String _file;
+
+ int _offset;
+
+ int _length;
+
/**
* The file containing the code on which the refactoring would be based.
*/
- String file;
+ String get file => _file;
+
+ /**
+ * The file containing the code on which the refactoring would be based.
+ */
+ void set file(String value) {
+ assert(value != null);
+ this._file = value;
+ }
/**
* The offset of the code on which the refactoring would be based.
*/
- int offset;
+ int get offset => _offset;
+
+ /**
+ * The offset of the code on which the refactoring would be based.
+ */
+ void set offset(int value) {
+ assert(value != null);
+ this._offset = value;
+ }
/**
* The length of the code on which the refactoring would be based.
*/
- int length;
+ int get length => _length;
- EditGetAvailableRefactoringsParams(this.file, this.offset, this.length);
+ /**
+ * The length of the code on which the refactoring would be based.
+ */
+ void set length(int value) {
+ assert(value != null);
+ this._length = value;
+ }
+
+ EditGetAvailableRefactoringsParams(String file, int offset, int length) {
+ this.file = file;
+ this.offset = offset;
+ this.length = length;
+ }
factory EditGetAvailableRefactoringsParams.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
if (json == null) {
@@ -4016,12 +5095,24 @@
* }
*/
class EditGetAvailableRefactoringsResult implements HasToJson {
+ List<RefactoringKind> _kinds;
+
/**
* The kinds of refactorings that are valid for the given selection.
*/
- List<RefactoringKind> kinds;
+ List<RefactoringKind> get kinds => _kinds;
- EditGetAvailableRefactoringsResult(this.kinds);
+ /**
+ * The kinds of refactorings that are valid for the given selection.
+ */
+ void set kinds(List<RefactoringKind> value) {
+ assert(value != null);
+ this._kinds = value;
+ }
+
+ EditGetAvailableRefactoringsResult(List<RefactoringKind> kinds) {
+ this.kinds = kinds;
+ }
factory EditGetAvailableRefactoringsResult.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
if (json == null) {
@@ -4083,17 +5174,40 @@
* }
*/
class EditGetFixesParams implements HasToJson {
+ String _file;
+
+ int _offset;
+
/**
* The file containing the errors for which fixes are being requested.
*/
- String file;
+ String get file => _file;
+
+ /**
+ * The file containing the errors for which fixes are being requested.
+ */
+ void set file(String value) {
+ assert(value != null);
+ this._file = value;
+ }
/**
* The offset used to select the errors for which fixes will be returned.
*/
- int offset;
+ int get offset => _offset;
- EditGetFixesParams(this.file, this.offset);
+ /**
+ * The offset used to select the errors for which fixes will be returned.
+ */
+ void set offset(int value) {
+ assert(value != null);
+ this._offset = value;
+ }
+
+ EditGetFixesParams(String file, int offset) {
+ this.file = file;
+ this.offset = offset;
+ }
factory EditGetFixesParams.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
if (json == null) {
@@ -4163,12 +5277,24 @@
* }
*/
class EditGetFixesResult implements HasToJson {
+ List<AnalysisErrorFixes> _fixes;
+
/**
* The fixes that are available for the errors at the given offset.
*/
- List<AnalysisErrorFixes> fixes;
+ List<AnalysisErrorFixes> get fixes => _fixes;
- EditGetFixesResult(this.fixes);
+ /**
+ * The fixes that are available for the errors at the given offset.
+ */
+ void set fixes(List<AnalysisErrorFixes> value) {
+ assert(value != null);
+ this._fixes = value;
+ }
+
+ EditGetFixesResult(List<AnalysisErrorFixes> fixes) {
+ this.fixes = fixes;
+ }
factory EditGetFixesResult.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
if (json == null) {
@@ -4234,31 +5360,84 @@
* }
*/
class EditGetRefactoringParams implements HasToJson {
+ RefactoringKind _kind;
+
+ String _file;
+
+ int _offset;
+
+ int _length;
+
+ bool _validateOnly;
+
+ RefactoringOptions _options;
+
/**
* The kind of refactoring to be performed.
*/
- RefactoringKind kind;
+ RefactoringKind get kind => _kind;
+
+ /**
+ * The kind of refactoring to be performed.
+ */
+ void set kind(RefactoringKind value) {
+ assert(value != null);
+ this._kind = value;
+ }
/**
* The file containing the code involved in the refactoring.
*/
- String file;
+ String get file => _file;
+
+ /**
+ * The file containing the code involved in the refactoring.
+ */
+ void set file(String value) {
+ assert(value != null);
+ this._file = value;
+ }
/**
* The offset of the region involved in the refactoring.
*/
- int offset;
+ int get offset => _offset;
+
+ /**
+ * The offset of the region involved in the refactoring.
+ */
+ void set offset(int value) {
+ assert(value != null);
+ this._offset = value;
+ }
/**
* The length of the region involved in the refactoring.
*/
- int length;
+ int get length => _length;
+
+ /**
+ * The length of the region involved in the refactoring.
+ */
+ void set length(int value) {
+ assert(value != null);
+ this._length = value;
+ }
/**
* True if the client is only requesting that the values of the options be
* validated and no change be generated.
*/
- bool validateOnly;
+ bool get validateOnly => _validateOnly;
+
+ /**
+ * True if the client is only requesting that the values of the options be
+ * validated and no change be generated.
+ */
+ void set validateOnly(bool value) {
+ assert(value != null);
+ this._validateOnly = value;
+ }
/**
* Data used to provide values provided by the user. The structure of the
@@ -4267,9 +5446,27 @@
* as “Options”. This field can be omitted if the refactoring does not
* require any options or if the values of those options are not known.
*/
- RefactoringOptions options;
+ RefactoringOptions get options => _options;
- EditGetRefactoringParams(this.kind, this.file, this.offset, this.length, this.validateOnly, {this.options});
+ /**
+ * Data used to provide values provided by the user. The structure of the
+ * data is dependent on the kind of refactoring being performed. The data
+ * that is expected is documented in the section titled Refactorings, labeled
+ * as “Options”. This field can be omitted if the refactoring does not
+ * require any options or if the values of those options are not known.
+ */
+ void set options(RefactoringOptions value) {
+ this._options = value;
+ }
+
+ EditGetRefactoringParams(RefactoringKind kind, String file, int offset, int length, bool validateOnly, {RefactoringOptions options}) {
+ this.kind = kind;
+ this.file = file;
+ this.offset = offset;
+ this.length = length;
+ this.validateOnly = validateOnly;
+ this.options = options;
+ }
factory EditGetRefactoringParams.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
if (json == null) {
@@ -4382,26 +5579,68 @@
* }
*/
class EditGetRefactoringResult implements HasToJson {
+ List<RefactoringProblem> _initialProblems;
+
+ List<RefactoringProblem> _optionsProblems;
+
+ List<RefactoringProblem> _finalProblems;
+
+ RefactoringFeedback _feedback;
+
+ SourceChange _change;
+
+ List<String> _potentialEdits;
+
/**
* The initial status of the refactoring, i.e. problems related to the
* context in which the refactoring is requested. The array will be empty if
* there are no known problems.
*/
- List<RefactoringProblem> initialProblems;
+ List<RefactoringProblem> get initialProblems => _initialProblems;
+
+ /**
+ * The initial status of the refactoring, i.e. problems related to the
+ * context in which the refactoring is requested. The array will be empty if
+ * there are no known problems.
+ */
+ void set initialProblems(List<RefactoringProblem> value) {
+ assert(value != null);
+ this._initialProblems = value;
+ }
/**
* The options validation status, i.e. problems in the given options, such as
* light-weight validation of a new name, flags compatibility, etc. The array
* will be empty if there are no known problems.
*/
- List<RefactoringProblem> optionsProblems;
+ List<RefactoringProblem> get optionsProblems => _optionsProblems;
+
+ /**
+ * The options validation status, i.e. problems in the given options, such as
+ * light-weight validation of a new name, flags compatibility, etc. The array
+ * will be empty if there are no known problems.
+ */
+ void set optionsProblems(List<RefactoringProblem> value) {
+ assert(value != null);
+ this._optionsProblems = value;
+ }
/**
* The final status of the refactoring, i.e. problems identified in the
* result of a full, potentially expensive validation and / or change
* creation. The array will be empty if there are no known problems.
*/
- List<RefactoringProblem> finalProblems;
+ List<RefactoringProblem> get finalProblems => _finalProblems;
+
+ /**
+ * The final status of the refactoring, i.e. problems identified in the
+ * result of a full, potentially expensive validation and / or change
+ * creation. The array will be empty if there are no known problems.
+ */
+ void set finalProblems(List<RefactoringProblem> value) {
+ assert(value != null);
+ this._finalProblems = value;
+ }
/**
* Data used to provide feedback to the user. The structure of the data is
@@ -4409,7 +5648,17 @@
* returned is documented in the section titled Refactorings, labeled as
* “Feedback”.
*/
- RefactoringFeedback feedback;
+ RefactoringFeedback get feedback => _feedback;
+
+ /**
+ * Data used to provide feedback to the user. The structure of the data is
+ * dependent on the kind of refactoring being created. The data that is
+ * returned is documented in the section titled Refactorings, labeled as
+ * “Feedback”.
+ */
+ void set feedback(RefactoringFeedback value) {
+ this._feedback = value;
+ }
/**
* The changes that are to be applied to affect the refactoring. This field
@@ -4417,7 +5666,17 @@
* being computed, such as having no options specified for a refactoring that
* requires them, or if only validation was requested.
*/
- SourceChange change;
+ SourceChange get change => _change;
+
+ /**
+ * The changes that are to be applied to affect the refactoring. This field
+ * will be omitted if there are problems that prevent a set of changes from
+ * being computed, such as having no options specified for a refactoring that
+ * requires them, or if only validation was requested.
+ */
+ void set change(SourceChange value) {
+ this._change = value;
+ }
/**
* The ids of source edits that are not known to be valid. An edit is not
@@ -4427,9 +5686,28 @@
* to a member from an unknown type. This field will be omitted if the change
* field is omitted or if there are no potential edits for the refactoring.
*/
- List<String> potentialEdits;
+ List<String> get potentialEdits => _potentialEdits;
- EditGetRefactoringResult(this.initialProblems, this.optionsProblems, this.finalProblems, {this.feedback, this.change, this.potentialEdits});
+ /**
+ * The ids of source edits that are not known to be valid. An edit is not
+ * known to be valid if there was insufficient type information for the
+ * server to be able to determine whether or not the code needs to be
+ * modified, such as when a member is being renamed and there is a reference
+ * to a member from an unknown type. This field will be omitted if the change
+ * field is omitted or if there are no potential edits for the refactoring.
+ */
+ void set potentialEdits(List<String> value) {
+ this._potentialEdits = value;
+ }
+
+ EditGetRefactoringResult(List<RefactoringProblem> initialProblems, List<RefactoringProblem> optionsProblems, List<RefactoringProblem> finalProblems, {RefactoringFeedback feedback, SourceChange change, List<String> potentialEdits}) {
+ this.initialProblems = initialProblems;
+ this.optionsProblems = optionsProblems;
+ this.finalProblems = finalProblems;
+ this.feedback = feedback;
+ this.change = change;
+ this.potentialEdits = potentialEdits;
+ }
factory EditGetRefactoringResult.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
if (json == null) {
@@ -4535,12 +5813,24 @@
* }
*/
class EditSortMembersParams implements HasToJson {
+ String _file;
+
/**
* The Dart file to sort.
*/
- String file;
+ String get file => _file;
- EditSortMembersParams(this.file);
+ /**
+ * The Dart file to sort.
+ */
+ void set file(String value) {
+ assert(value != null);
+ this._file = value;
+ }
+
+ EditSortMembersParams(String file) {
+ this.file = file;
+ }
factory EditSortMembersParams.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
if (json == null) {
@@ -4601,13 +5891,26 @@
* }
*/
class EditSortMembersResult implements HasToJson {
+ SourceFileEdit _edit;
+
/**
* The file edit that is to be applied to the given file to effect the
* sorting.
*/
- SourceFileEdit edit;
+ SourceFileEdit get edit => _edit;
- EditSortMembersResult(this.edit);
+ /**
+ * The file edit that is to be applied to the given file to effect the
+ * sorting.
+ */
+ void set edit(SourceFileEdit value) {
+ assert(value != null);
+ this._edit = value;
+ }
+
+ EditSortMembersResult(SourceFileEdit edit) {
+ this.edit = edit;
+ }
factory EditSortMembersResult.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
if (json == null) {
@@ -4668,13 +5971,26 @@
* }
*/
class ExecutionCreateContextParams implements HasToJson {
+ String _contextRoot;
+
/**
* The path of the Dart or HTML file that will be launched, or the path of
* the directory containing the file.
*/
- String contextRoot;
+ String get contextRoot => _contextRoot;
- ExecutionCreateContextParams(this.contextRoot);
+ /**
+ * The path of the Dart or HTML file that will be launched, or the path of
+ * the directory containing the file.
+ */
+ void set contextRoot(String value) {
+ assert(value != null);
+ this._contextRoot = value;
+ }
+
+ ExecutionCreateContextParams(String contextRoot) {
+ this.contextRoot = contextRoot;
+ }
factory ExecutionCreateContextParams.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
if (json == null) {
@@ -4735,12 +6051,24 @@
* }
*/
class ExecutionCreateContextResult implements HasToJson {
+ String _id;
+
/**
* The identifier used to refer to the execution context that was created.
*/
- String id;
+ String get id => _id;
- ExecutionCreateContextResult(this.id);
+ /**
+ * The identifier used to refer to the execution context that was created.
+ */
+ void set id(String value) {
+ assert(value != null);
+ this._id = value;
+ }
+
+ ExecutionCreateContextResult(String id) {
+ this.id = id;
+ }
factory ExecutionCreateContextResult.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
if (json == null) {
@@ -4801,12 +6129,24 @@
* }
*/
class ExecutionDeleteContextParams implements HasToJson {
+ String _id;
+
/**
* The identifier of the execution context that is to be deleted.
*/
- String id;
+ String get id => _id;
- ExecutionDeleteContextParams(this.id);
+ /**
+ * The identifier of the execution context that is to be deleted.
+ */
+ void set id(String value) {
+ assert(value != null);
+ this._id = value;
+ }
+
+ ExecutionDeleteContextParams(String id) {
+ this.id = id;
+ }
factory ExecutionDeleteContextParams.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
if (json == null) {
@@ -4890,22 +6230,54 @@
* }
*/
class ExecutionMapUriParams implements HasToJson {
+ String _id;
+
+ String _file;
+
+ String _uri;
+
/**
* The identifier of the execution context in which the URI is to be mapped.
*/
- String id;
+ String get id => _id;
+
+ /**
+ * The identifier of the execution context in which the URI is to be mapped.
+ */
+ void set id(String value) {
+ assert(value != null);
+ this._id = value;
+ }
/**
* The path of the file to be mapped into a URI.
*/
- String file;
+ String get file => _file;
+
+ /**
+ * The path of the file to be mapped into a URI.
+ */
+ void set file(String value) {
+ this._file = value;
+ }
/**
* The URI to be mapped into a file path.
*/
- String uri;
+ String get uri => _uri;
- ExecutionMapUriParams(this.id, {this.file, this.uri});
+ /**
+ * The URI to be mapped into a file path.
+ */
+ void set uri(String value) {
+ this._uri = value;
+ }
+
+ ExecutionMapUriParams(String id, {String file, String uri}) {
+ this.id = id;
+ this.file = file;
+ this.uri = uri;
+ }
factory ExecutionMapUriParams.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
if (json == null) {
@@ -4985,19 +6357,42 @@
* }
*/
class ExecutionMapUriResult implements HasToJson {
+ String _file;
+
+ String _uri;
+
/**
* The file to which the URI was mapped. This field is omitted if the uri
* field was not given in the request.
*/
- String file;
+ String get file => _file;
+
+ /**
+ * The file to which the URI was mapped. This field is omitted if the uri
+ * field was not given in the request.
+ */
+ void set file(String value) {
+ this._file = value;
+ }
/**
* The URI to which the file path was mapped. This field is omitted if the
* file field was not given in the request.
*/
- String uri;
+ String get uri => _uri;
- ExecutionMapUriResult({this.file, this.uri});
+ /**
+ * The URI to which the file path was mapped. This field is omitted if the
+ * file field was not given in the request.
+ */
+ void set uri(String value) {
+ this._uri = value;
+ }
+
+ ExecutionMapUriResult({String file, String uri}) {
+ this.file = file;
+ this.uri = uri;
+ }
factory ExecutionMapUriResult.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
if (json == null) {
@@ -5067,12 +6462,24 @@
* }
*/
class ExecutionSetSubscriptionsParams implements HasToJson {
+ List<ExecutionService> _subscriptions;
+
/**
* A list of the services being subscribed to.
*/
- List<ExecutionService> subscriptions;
+ List<ExecutionService> get subscriptions => _subscriptions;
- ExecutionSetSubscriptionsParams(this.subscriptions);
+ /**
+ * A list of the services being subscribed to.
+ */
+ void set subscriptions(List<ExecutionService> value) {
+ assert(value != null);
+ this._subscriptions = value;
+ }
+
+ ExecutionSetSubscriptionsParams(List<ExecutionService> subscriptions) {
+ this.subscriptions = subscriptions;
+ }
factory ExecutionSetSubscriptionsParams.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
if (json == null) {
@@ -5156,25 +6563,60 @@
* }
*/
class ExecutionLaunchDataParams implements HasToJson {
+ String _file;
+
+ ExecutableKind _kind;
+
+ List<String> _referencedFiles;
+
/**
* The file for which launch data is being provided. This will either be a
* Dart library or an HTML file.
*/
- String file;
+ String get file => _file;
+
+ /**
+ * The file for which launch data is being provided. This will either be a
+ * Dart library or an HTML file.
+ */
+ void set file(String value) {
+ assert(value != null);
+ this._file = value;
+ }
/**
* The kind of the executable file. This field is omitted if the file is not
* a Dart file.
*/
- ExecutableKind kind;
+ ExecutableKind get kind => _kind;
+
+ /**
+ * The kind of the executable file. This field is omitted if the file is not
+ * a Dart file.
+ */
+ void set kind(ExecutableKind value) {
+ this._kind = value;
+ }
/**
* A list of the Dart files that are referenced by the file. This field is
* omitted if the file is not an HTML file.
*/
- List<String> referencedFiles;
+ List<String> get referencedFiles => _referencedFiles;
- ExecutionLaunchDataParams(this.file, {this.kind, this.referencedFiles});
+ /**
+ * A list of the Dart files that are referenced by the file. This field is
+ * omitted if the file is not an HTML file.
+ */
+ void set referencedFiles(List<String> value) {
+ this._referencedFiles = value;
+ }
+
+ ExecutionLaunchDataParams(String file, {ExecutableKind kind, List<String> referencedFiles}) {
+ this.file = file;
+ this.kind = kind;
+ this.referencedFiles = referencedFiles;
+ }
factory ExecutionLaunchDataParams.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
if (json == null) {
@@ -5254,12 +6696,24 @@
* }
*/
class AddContentOverlay implements HasToJson {
+ String _content;
+
/**
* The new content of the file.
*/
- String content;
+ String get content => _content;
- AddContentOverlay(this.content);
+ /**
+ * The new content of the file.
+ */
+ void set content(String value) {
+ assert(value != null);
+ this._content = value;
+ }
+
+ AddContentOverlay(String content) {
+ this.content = content;
+ }
factory AddContentOverlay.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
if (json == null) {
@@ -5320,35 +6774,93 @@
* }
*/
class AnalysisError implements HasToJson {
+ AnalysisErrorSeverity _severity;
+
+ AnalysisErrorType _type;
+
+ Location _location;
+
+ String _message;
+
+ String _correction;
+
/**
* The severity of the error.
*/
- AnalysisErrorSeverity severity;
+ AnalysisErrorSeverity get severity => _severity;
+
+ /**
+ * The severity of the error.
+ */
+ void set severity(AnalysisErrorSeverity value) {
+ assert(value != null);
+ this._severity = value;
+ }
/**
* The type of the error.
*/
- AnalysisErrorType type;
+ AnalysisErrorType get type => _type;
+
+ /**
+ * The type of the error.
+ */
+ void set type(AnalysisErrorType value) {
+ assert(value != null);
+ this._type = value;
+ }
/**
* The location associated with the error.
*/
- Location location;
+ Location get location => _location;
+
+ /**
+ * The location associated with the error.
+ */
+ void set location(Location value) {
+ assert(value != null);
+ this._location = value;
+ }
/**
* The message to be displayed for this error. The message should indicate
* what is wrong with the code and why it is wrong.
*/
- String message;
+ String get message => _message;
+
+ /**
+ * The message to be displayed for this error. The message should indicate
+ * what is wrong with the code and why it is wrong.
+ */
+ void set message(String value) {
+ assert(value != null);
+ this._message = value;
+ }
/**
* The correction message to be displayed for this error. The correction
* message should indicate how the user can fix the error. The field is
* omitted if there is no correction message associated with the error code.
*/
- String correction;
+ String get correction => _correction;
- AnalysisError(this.severity, this.type, this.location, this.message, {this.correction});
+ /**
+ * The correction message to be displayed for this error. The correction
+ * message should indicate how the user can fix the error. The field is
+ * omitted if there is no correction message associated with the error code.
+ */
+ void set correction(String value) {
+ this._correction = value;
+ }
+
+ AnalysisError(AnalysisErrorSeverity severity, AnalysisErrorType type, Location location, String message, {String correction}) {
+ this.severity = severity;
+ this.type = type;
+ this.location = location;
+ this.message = message;
+ this.correction = correction;
+ }
factory AnalysisError.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
if (json == null) {
@@ -5437,19 +6949,42 @@
* }
*/
class AnalysisErrorFixes implements HasToJson {
+ AnalysisError _error;
+
+ List<SourceChange> _fixes;
+
/**
* The error with which the fixes are associated.
*/
- AnalysisError error;
+ AnalysisError get error => _error;
+
+ /**
+ * The error with which the fixes are associated.
+ */
+ void set error(AnalysisError value) {
+ assert(value != null);
+ this._error = value;
+ }
/**
* The fixes associated with the error.
*/
- List<SourceChange> fixes;
+ List<SourceChange> get fixes => _fixes;
- AnalysisErrorFixes(this.error, {this.fixes}) {
+ /**
+ * The fixes associated with the error.
+ */
+ void set fixes(List<SourceChange> value) {
+ assert(value != null);
+ this._fixes = value;
+ }
+
+ AnalysisErrorFixes(AnalysisError error, {List<SourceChange> fixes}) {
+ this.error = error;
if (fixes == null) {
- fixes = <SourceChange>[];
+ this.fixes = <SourceChange>[];
+ } else {
+ this.fixes = fixes;
}
}
@@ -5651,12 +7186,35 @@
* }
*/
class AnalysisOptions implements HasToJson {
+ bool _enableAsync;
+
+ bool _enableDeferredLoading;
+
+ bool _enableEnums;
+
+ bool _enableNullAwareOperators;
+
+ bool _generateDart2jsHints;
+
+ bool _generateHints;
+
+ bool _generateLints;
+
/**
* Deprecated
*
* True if the client wants to enable support for the proposed async feature.
*/
- bool enableAsync;
+ bool get enableAsync => _enableAsync;
+
+ /**
+ * Deprecated
+ *
+ * True if the client wants to enable support for the proposed async feature.
+ */
+ void set enableAsync(bool value) {
+ this._enableAsync = value;
+ }
/**
* Deprecated
@@ -5664,40 +7222,99 @@
* True if the client wants to enable support for the proposed deferred
* loading feature.
*/
- bool enableDeferredLoading;
+ bool get enableDeferredLoading => _enableDeferredLoading;
+
+ /**
+ * Deprecated
+ *
+ * True if the client wants to enable support for the proposed deferred
+ * loading feature.
+ */
+ void set enableDeferredLoading(bool value) {
+ this._enableDeferredLoading = value;
+ }
/**
* Deprecated
*
* True if the client wants to enable support for the proposed enum feature.
*/
- bool enableEnums;
+ bool get enableEnums => _enableEnums;
+
+ /**
+ * Deprecated
+ *
+ * True if the client wants to enable support for the proposed enum feature.
+ */
+ void set enableEnums(bool value) {
+ this._enableEnums = value;
+ }
/**
* True if the client wants to enable support for the proposed "null aware
* operators" feature.
*/
- bool enableNullAwareOperators;
+ bool get enableNullAwareOperators => _enableNullAwareOperators;
+
+ /**
+ * True if the client wants to enable support for the proposed "null aware
+ * operators" feature.
+ */
+ void set enableNullAwareOperators(bool value) {
+ this._enableNullAwareOperators = value;
+ }
/**
* True if hints that are specific to dart2js should be generated. This
* option is ignored if generateHints is false.
*/
- bool generateDart2jsHints;
+ bool get generateDart2jsHints => _generateDart2jsHints;
+
+ /**
+ * True if hints that are specific to dart2js should be generated. This
+ * option is ignored if generateHints is false.
+ */
+ void set generateDart2jsHints(bool value) {
+ this._generateDart2jsHints = value;
+ }
/**
* True if hints should be generated as part of generating errors and
* warnings.
*/
- bool generateHints;
+ bool get generateHints => _generateHints;
+
+ /**
+ * True if hints should be generated as part of generating errors and
+ * warnings.
+ */
+ void set generateHints(bool value) {
+ this._generateHints = value;
+ }
/**
* True if lints should be generated as part of generating errors and
* warnings.
*/
- bool generateLints;
+ bool get generateLints => _generateLints;
- AnalysisOptions({this.enableAsync, this.enableDeferredLoading, this.enableEnums, this.enableNullAwareOperators, this.generateDart2jsHints, this.generateHints, this.generateLints});
+ /**
+ * True if lints should be generated as part of generating errors and
+ * warnings.
+ */
+ void set generateLints(bool value) {
+ this._generateLints = value;
+ }
+
+ AnalysisOptions({bool enableAsync, bool enableDeferredLoading, bool enableEnums, bool enableNullAwareOperators, bool generateDart2jsHints, bool generateHints, bool generateLints}) {
+ this.enableAsync = enableAsync;
+ this.enableDeferredLoading = enableDeferredLoading;
+ this.enableEnums = enableEnums;
+ this.enableNullAwareOperators = enableNullAwareOperators;
+ this.generateDart2jsHints = generateDart2jsHints;
+ this.generateHints = generateHints;
+ this.generateLints = generateLints;
+ }
factory AnalysisOptions.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
if (json == null) {
@@ -5878,18 +7495,41 @@
* }
*/
class AnalysisStatus implements HasToJson {
+ bool _isAnalyzing;
+
+ String _analysisTarget;
+
/**
* True if analysis is currently being performed.
*/
- bool isAnalyzing;
+ bool get isAnalyzing => _isAnalyzing;
+
+ /**
+ * True if analysis is currently being performed.
+ */
+ void set isAnalyzing(bool value) {
+ assert(value != null);
+ this._isAnalyzing = value;
+ }
/**
* The name of the current target of analysis. This field is omitted if
* analyzing is false.
*/
- String analysisTarget;
+ String get analysisTarget => _analysisTarget;
- AnalysisStatus(this.isAnalyzing, {this.analysisTarget});
+ /**
+ * The name of the current target of analysis. This field is omitted if
+ * analyzing is false.
+ */
+ void set analysisTarget(String value) {
+ this._analysisTarget = value;
+ }
+
+ AnalysisStatus(bool isAnalyzing, {String analysisTarget}) {
+ this.isAnalyzing = isAnalyzing;
+ this.analysisTarget = analysisTarget;
+ }
factory AnalysisStatus.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
if (json == null) {
@@ -5951,12 +7591,24 @@
* }
*/
class ChangeContentOverlay implements HasToJson {
+ List<SourceEdit> _edits;
+
/**
* The edits to be applied to the file.
*/
- List<SourceEdit> edits;
+ List<SourceEdit> get edits => _edits;
- ChangeContentOverlay(this.edits);
+ /**
+ * The edits to be applied to the file.
+ */
+ void set edits(List<SourceEdit> value) {
+ assert(value != null);
+ this._edits = value;
+ }
+
+ ChangeContentOverlay(List<SourceEdit> edits) {
+ this.edits = edits;
+ }
factory ChangeContentOverlay.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
if (json == null) {
@@ -6027,19 +7679,75 @@
* "hasNamedParameters": optional bool
* "parameterName": optional String
* "parameterType": optional String
+ * "importUri": optional String
* }
*/
class CompletionSuggestion implements HasToJson {
+ CompletionSuggestionKind _kind;
+
+ int _relevance;
+
+ String _completion;
+
+ int _selectionOffset;
+
+ int _selectionLength;
+
+ bool _isDeprecated;
+
+ bool _isPotential;
+
+ String _docSummary;
+
+ String _docComplete;
+
+ String _declaringType;
+
+ Element _element;
+
+ String _returnType;
+
+ List<String> _parameterNames;
+
+ List<String> _parameterTypes;
+
+ int _requiredParameterCount;
+
+ bool _hasNamedParameters;
+
+ String _parameterName;
+
+ String _parameterType;
+
+ String _importUri;
+
/**
* The kind of element being suggested.
*/
- CompletionSuggestionKind kind;
+ CompletionSuggestionKind get kind => _kind;
+
+ /**
+ * The kind of element being suggested.
+ */
+ void set kind(CompletionSuggestionKind value) {
+ assert(value != null);
+ this._kind = value;
+ }
/**
* The relevance of this completion suggestion where a higher number
* indicates a higher relevance.
*/
- int relevance;
+ int get relevance => _relevance;
+
+ /**
+ * The relevance of this completion suggestion where a higher number
+ * indicates a higher relevance.
+ */
+ void set relevance(int value) {
+ assert(value != null);
+ this._relevance = value;
+ }
/**
* The identifier to be inserted if the suggestion is selected. If the
@@ -6047,100 +7755,270 @@
* additionally insert a template for the parameters. The information
* required in order to do so is contained in other fields.
*/
- String completion;
+ String get completion => _completion;
+
+ /**
+ * The identifier to be inserted if the suggestion is selected. If the
+ * suggestion is for a method or function, the client might want to
+ * additionally insert a template for the parameters. The information
+ * required in order to do so is contained in other fields.
+ */
+ void set completion(String value) {
+ assert(value != null);
+ this._completion = value;
+ }
/**
* The offset, relative to the beginning of the completion, of where the
* selection should be placed after insertion.
*/
- int selectionOffset;
+ int get selectionOffset => _selectionOffset;
+
+ /**
+ * The offset, relative to the beginning of the completion, of where the
+ * selection should be placed after insertion.
+ */
+ void set selectionOffset(int value) {
+ assert(value != null);
+ this._selectionOffset = value;
+ }
/**
* The number of characters that should be selected after insertion.
*/
- int selectionLength;
+ int get selectionLength => _selectionLength;
+
+ /**
+ * The number of characters that should be selected after insertion.
+ */
+ void set selectionLength(int value) {
+ assert(value != null);
+ this._selectionLength = value;
+ }
/**
* True if the suggested element is deprecated.
*/
- bool isDeprecated;
+ bool get isDeprecated => _isDeprecated;
+
+ /**
+ * True if the suggested element is deprecated.
+ */
+ void set isDeprecated(bool value) {
+ assert(value != null);
+ this._isDeprecated = value;
+ }
/**
* True if the element is not known to be valid for the target. This happens
* if the type of the target is dynamic.
*/
- bool isPotential;
+ bool get isPotential => _isPotential;
+
+ /**
+ * True if the element is not known to be valid for the target. This happens
+ * if the type of the target is dynamic.
+ */
+ void set isPotential(bool value) {
+ assert(value != null);
+ this._isPotential = value;
+ }
/**
* An abbreviated version of the Dartdoc associated with the element being
* suggested, This field is omitted if there is no Dartdoc associated with
* the element.
*/
- String docSummary;
+ String get docSummary => _docSummary;
+
+ /**
+ * An abbreviated version of the Dartdoc associated with the element being
+ * suggested, This field is omitted if there is no Dartdoc associated with
+ * the element.
+ */
+ void set docSummary(String value) {
+ this._docSummary = value;
+ }
/**
* The Dartdoc associated with the element being suggested, This field is
* omitted if there is no Dartdoc associated with the element.
*/
- String docComplete;
+ String get docComplete => _docComplete;
+
+ /**
+ * The Dartdoc associated with the element being suggested, This field is
+ * omitted if there is no Dartdoc associated with the element.
+ */
+ void set docComplete(String value) {
+ this._docComplete = value;
+ }
/**
* The class that declares the element being suggested. This field is omitted
* if the suggested element is not a member of a class.
*/
- String declaringType;
+ String get declaringType => _declaringType;
+
+ /**
+ * The class that declares the element being suggested. This field is omitted
+ * if the suggested element is not a member of a class.
+ */
+ void set declaringType(String value) {
+ this._declaringType = value;
+ }
/**
* Information about the element reference being suggested.
*/
- Element element;
+ Element get element => _element;
+
+ /**
+ * Information about the element reference being suggested.
+ */
+ void set element(Element value) {
+ this._element = value;
+ }
/**
* The return type of the getter, function or method or the type of the field
* being suggested. This field is omitted if the suggested element is not a
* getter, function or method.
*/
- String returnType;
+ String get returnType => _returnType;
+
+ /**
+ * The return type of the getter, function or method or the type of the field
+ * being suggested. This field is omitted if the suggested element is not a
+ * getter, function or method.
+ */
+ void set returnType(String value) {
+ this._returnType = value;
+ }
/**
* The names of the parameters of the function or method being suggested.
* This field is omitted if the suggested element is not a setter, function
* or method.
*/
- List<String> parameterNames;
+ List<String> get parameterNames => _parameterNames;
+
+ /**
+ * The names of the parameters of the function or method being suggested.
+ * This field is omitted if the suggested element is not a setter, function
+ * or method.
+ */
+ void set parameterNames(List<String> value) {
+ this._parameterNames = value;
+ }
/**
* The types of the parameters of the function or method being suggested.
* This field is omitted if the parameterNames field is omitted.
*/
- List<String> parameterTypes;
+ List<String> get parameterTypes => _parameterTypes;
+
+ /**
+ * The types of the parameters of the function or method being suggested.
+ * This field is omitted if the parameterNames field is omitted.
+ */
+ void set parameterTypes(List<String> value) {
+ this._parameterTypes = value;
+ }
/**
* The number of required parameters for the function or method being
* suggested. This field is omitted if the parameterNames field is omitted.
*/
- int requiredParameterCount;
+ int get requiredParameterCount => _requiredParameterCount;
+
+ /**
+ * The number of required parameters for the function or method being
+ * suggested. This field is omitted if the parameterNames field is omitted.
+ */
+ void set requiredParameterCount(int value) {
+ this._requiredParameterCount = value;
+ }
/**
* True if the function or method being suggested has at least one named
* parameter. This field is omitted if the parameterNames field is omitted.
*/
- bool hasNamedParameters;
+ bool get hasNamedParameters => _hasNamedParameters;
+
+ /**
+ * True if the function or method being suggested has at least one named
+ * parameter. This field is omitted if the parameterNames field is omitted.
+ */
+ void set hasNamedParameters(bool value) {
+ this._hasNamedParameters = value;
+ }
/**
* The name of the optional parameter being suggested. This field is omitted
* if the suggestion is not the addition of an optional argument within an
* argument list.
*/
- String parameterName;
+ String get parameterName => _parameterName;
+
+ /**
+ * The name of the optional parameter being suggested. This field is omitted
+ * if the suggestion is not the addition of an optional argument within an
+ * argument list.
+ */
+ void set parameterName(String value) {
+ this._parameterName = value;
+ }
/**
* The type of the options parameter being suggested. This field is omitted
* if the parameterName field is omitted.
*/
- String parameterType;
+ String get parameterType => _parameterType;
- CompletionSuggestion(this.kind, this.relevance, this.completion, this.selectionOffset, this.selectionLength, this.isDeprecated, this.isPotential, {this.docSummary, this.docComplete, this.declaringType, this.element, this.returnType, this.parameterNames, this.parameterTypes, this.requiredParameterCount, this.hasNamedParameters, this.parameterName, this.parameterType});
+ /**
+ * The type of the options parameter being suggested. This field is omitted
+ * if the parameterName field is omitted.
+ */
+ void set parameterType(String value) {
+ this._parameterType = value;
+ }
+
+ /**
+ * The import to be added if the suggestion is out of scope and needs an
+ * import to be added to be in scope.
+ */
+ String get importUri => _importUri;
+
+ /**
+ * The import to be added if the suggestion is out of scope and needs an
+ * import to be added to be in scope.
+ */
+ void set importUri(String value) {
+ this._importUri = value;
+ }
+
+ CompletionSuggestion(CompletionSuggestionKind kind, int relevance, String completion, int selectionOffset, int selectionLength, bool isDeprecated, bool isPotential, {String docSummary, String docComplete, String declaringType, Element element, String returnType, List<String> parameterNames, List<String> parameterTypes, int requiredParameterCount, bool hasNamedParameters, String parameterName, String parameterType, String importUri}) {
+ this.kind = kind;
+ this.relevance = relevance;
+ this.completion = completion;
+ this.selectionOffset = selectionOffset;
+ this.selectionLength = selectionLength;
+ this.isDeprecated = isDeprecated;
+ this.isPotential = isPotential;
+ this.docSummary = docSummary;
+ this.docComplete = docComplete;
+ this.declaringType = declaringType;
+ this.element = element;
+ this.returnType = returnType;
+ this.parameterNames = parameterNames;
+ this.parameterTypes = parameterTypes;
+ this.requiredParameterCount = requiredParameterCount;
+ this.hasNamedParameters = hasNamedParameters;
+ this.parameterName = parameterName;
+ this.parameterType = parameterType;
+ this.importUri = importUri;
+ }
factory CompletionSuggestion.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
if (json == null) {
@@ -6233,7 +8111,11 @@
if (json.containsKey("parameterType")) {
parameterType = jsonDecoder._decodeString(jsonPath + ".parameterType", json["parameterType"]);
}
- return new CompletionSuggestion(kind, relevance, completion, selectionOffset, selectionLength, isDeprecated, isPotential, docSummary: docSummary, docComplete: docComplete, declaringType: declaringType, element: element, returnType: returnType, parameterNames: parameterNames, parameterTypes: parameterTypes, requiredParameterCount: requiredParameterCount, hasNamedParameters: hasNamedParameters, parameterName: parameterName, parameterType: parameterType);
+ String importUri;
+ if (json.containsKey("importUri")) {
+ importUri = jsonDecoder._decodeString(jsonPath + ".importUri", json["importUri"]);
+ }
+ return new CompletionSuggestion(kind, relevance, completion, selectionOffset, selectionLength, isDeprecated, isPotential, docSummary: docSummary, docComplete: docComplete, declaringType: declaringType, element: element, returnType: returnType, parameterNames: parameterNames, parameterTypes: parameterTypes, requiredParameterCount: requiredParameterCount, hasNamedParameters: hasNamedParameters, parameterName: parameterName, parameterType: parameterType, importUri: importUri);
} else {
throw jsonDecoder.mismatch(jsonPath, "CompletionSuggestion");
}
@@ -6281,6 +8163,9 @@
if (parameterType != null) {
result["parameterType"] = parameterType;
}
+ if (importUri != null) {
+ result["importUri"] = importUri;
+ }
return result;
}
@@ -6307,7 +8192,8 @@
requiredParameterCount == other.requiredParameterCount &&
hasNamedParameters == other.hasNamedParameters &&
parameterName == other.parameterName &&
- parameterType == other.parameterType;
+ parameterType == other.parameterType &&
+ importUri == other.importUri;
}
return false;
}
@@ -6333,6 +8219,7 @@
hash = _JenkinsSmiHash.combine(hash, hasNamedParameters.hashCode);
hash = _JenkinsSmiHash.combine(hash, parameterName.hashCode);
hash = _JenkinsSmiHash.combine(hash, parameterType.hashCode);
+ hash = _JenkinsSmiHash.combine(hash, importUri.hashCode);
return _JenkinsSmiHash.finish(hash);
}
}
@@ -6384,6 +8271,11 @@
*/
static const KEYWORD = const CompletionSuggestionKind._("KEYWORD");
+ /**
+ * A named argument for the current callsite is being suggested. For
+ * suggestions of this kind, the completion is the named argument identifier
+ * including a trailing ':' and space.
+ */
static const NAMED_ARGUMENT = const CompletionSuggestionKind._("NAMED_ARGUMENT");
static const OPTIONAL_ARGUMENT = const CompletionSuggestionKind._("OPTIONAL_ARGUMENT");
@@ -6470,21 +8362,59 @@
return flags;
}
+ ElementKind _kind;
+
+ String _name;
+
+ Location _location;
+
+ int _flags;
+
+ String _parameters;
+
+ String _returnType;
+
+ String _typeParameters;
+
/**
* The kind of the element.
*/
- ElementKind kind;
+ ElementKind get kind => _kind;
+
+ /**
+ * The kind of the element.
+ */
+ void set kind(ElementKind value) {
+ assert(value != null);
+ this._kind = value;
+ }
/**
* The name of the element. This is typically used as the label in the
* outline.
*/
- String name;
+ String get name => _name;
+
+ /**
+ * The name of the element. This is typically used as the label in the
+ * outline.
+ */
+ void set name(String value) {
+ assert(value != null);
+ this._name = value;
+ }
/**
* The location of the name in the declaration of the element.
*/
- Location location;
+ Location get location => _location;
+
+ /**
+ * The location of the name in the declaration of the element.
+ */
+ void set location(Location value) {
+ this._location = value;
+ }
/**
* A bit-map containing the following flags:
@@ -6497,7 +8427,23 @@
* - 0x10 - set if the element is private
* - 0x20 - set if the element is deprecated
*/
- int flags;
+ int get flags => _flags;
+
+ /**
+ * A bit-map containing the following flags:
+ *
+ * - 0x01 - set if the element is explicitly or implicitly abstract
+ * - 0x02 - set if the element was declared to be ‘const’
+ * - 0x04 - set if the element was declared to be ‘final’
+ * - 0x08 - set if the element is a static member of a class or is a
+ * top-level function or field
+ * - 0x10 - set if the element is private
+ * - 0x20 - set if the element is deprecated
+ */
+ void set flags(int value) {
+ assert(value != null);
+ this._flags = value;
+ }
/**
* The parameter list for the element. If the element is not a method or
@@ -6505,22 +8451,57 @@
* parameters (e.g. getter), this field will not be defined. If the element
* has zero parameters, this field will have a value of "()".
*/
- String parameters;
+ String get parameters => _parameters;
+
+ /**
+ * The parameter list for the element. If the element is not a method or
+ * function this field will not be defined. If the element doesn't have
+ * parameters (e.g. getter), this field will not be defined. If the element
+ * has zero parameters, this field will have a value of "()".
+ */
+ void set parameters(String value) {
+ this._parameters = value;
+ }
/**
* The return type of the element. If the element is not a method or function
* this field will not be defined. If the element does not have a declared
* return type, this field will contain an empty string.
*/
- String returnType;
+ String get returnType => _returnType;
+
+ /**
+ * The return type of the element. If the element is not a method or function
+ * this field will not be defined. If the element does not have a declared
+ * return type, this field will contain an empty string.
+ */
+ void set returnType(String value) {
+ this._returnType = value;
+ }
/**
* The type parameter list for the element. If the element doesn't have type
* parameters, this field will not be defined.
*/
- String typeParameters;
+ String get typeParameters => _typeParameters;
- Element(this.kind, this.name, this.flags, {this.location, this.parameters, this.returnType, this.typeParameters});
+ /**
+ * The type parameter list for the element. If the element doesn't have type
+ * parameters, this field will not be defined.
+ */
+ void set typeParameters(String value) {
+ this._typeParameters = value;
+ }
+
+ Element(ElementKind kind, String name, int flags, {Location location, String parameters, String returnType, String typeParameters}) {
+ this.kind = kind;
+ this.name = name;
+ this.location = location;
+ this.flags = flags;
+ this.parameters = parameters;
+ this.returnType = returnType;
+ this.typeParameters = typeParameters;
+ }
factory Element.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
if (json == null) {
@@ -6783,17 +8764,40 @@
* }
*/
class ExecutableFile implements HasToJson {
+ String _file;
+
+ ExecutableKind _kind;
+
/**
* The path of the executable file.
*/
- String file;
+ String get file => _file;
+
+ /**
+ * The path of the executable file.
+ */
+ void set file(String value) {
+ assert(value != null);
+ this._file = value;
+ }
/**
* The kind of the executable file.
*/
- ExecutableKind kind;
+ ExecutableKind get kind => _kind;
- ExecutableFile(this.file, this.kind);
+ /**
+ * The kind of the executable file.
+ */
+ void set kind(ExecutableKind value) {
+ assert(value != null);
+ this._kind = value;
+ }
+
+ ExecutableFile(String file, ExecutableKind kind) {
+ this.file = file;
+ this.kind = kind;
+ }
factory ExecutableFile.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
if (json == null) {
@@ -7023,22 +9027,56 @@
* }
*/
class FoldingRegion implements HasToJson {
+ FoldingKind _kind;
+
+ int _offset;
+
+ int _length;
+
/**
* The kind of the region.
*/
- FoldingKind kind;
+ FoldingKind get kind => _kind;
+
+ /**
+ * The kind of the region.
+ */
+ void set kind(FoldingKind value) {
+ assert(value != null);
+ this._kind = value;
+ }
/**
* The offset of the region to be folded.
*/
- int offset;
+ int get offset => _offset;
+
+ /**
+ * The offset of the region to be folded.
+ */
+ void set offset(int value) {
+ assert(value != null);
+ this._offset = value;
+ }
/**
* The length of the region to be folded.
*/
- int length;
+ int get length => _length;
- FoldingRegion(this.kind, this.offset, this.length);
+ /**
+ * The length of the region to be folded.
+ */
+ void set length(int value) {
+ assert(value != null);
+ this._length = value;
+ }
+
+ FoldingRegion(FoldingKind kind, int offset, int length) {
+ this.kind = kind;
+ this.offset = offset;
+ this.length = length;
+ }
factory FoldingRegion.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
if (json == null) {
@@ -7110,22 +9148,56 @@
* }
*/
class HighlightRegion implements HasToJson {
+ HighlightRegionType _type;
+
+ int _offset;
+
+ int _length;
+
/**
* The type of highlight associated with the region.
*/
- HighlightRegionType type;
+ HighlightRegionType get type => _type;
+
+ /**
+ * The type of highlight associated with the region.
+ */
+ void set type(HighlightRegionType value) {
+ assert(value != null);
+ this._type = value;
+ }
/**
* The offset of the region to be highlighted.
*/
- int offset;
+ int get offset => _offset;
+
+ /**
+ * The offset of the region to be highlighted.
+ */
+ void set offset(int value) {
+ assert(value != null);
+ this._offset = value;
+ }
/**
* The length of the region to be highlighted.
*/
- int length;
+ int get length => _length;
- HighlightRegion(this.type, this.offset, this.length);
+ /**
+ * The length of the region to be highlighted.
+ */
+ void set length(int value) {
+ assert(value != null);
+ this._length = value;
+ }
+
+ HighlightRegion(HighlightRegionType type, int offset, int length) {
+ this.type = type;
+ this.offset = offset;
+ this.length = length;
+ }
factory HighlightRegion.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
if (json == null) {
@@ -7434,38 +9506,105 @@
* }
*/
class HoverInformation implements HasToJson {
+ int _offset;
+
+ int _length;
+
+ String _containingLibraryPath;
+
+ String _containingLibraryName;
+
+ String _containingClassDescription;
+
+ String _dartdoc;
+
+ String _elementDescription;
+
+ String _elementKind;
+
+ String _parameter;
+
+ String _propagatedType;
+
+ String _staticType;
+
/**
* The offset of the range of characters that encompases the cursor position
* and has the same hover information as the cursor position.
*/
- int offset;
+ int get offset => _offset;
+
+ /**
+ * The offset of the range of characters that encompases the cursor position
+ * and has the same hover information as the cursor position.
+ */
+ void set offset(int value) {
+ assert(value != null);
+ this._offset = value;
+ }
/**
* The length of the range of characters that encompases the cursor position
* and has the same hover information as the cursor position.
*/
- int length;
+ int get length => _length;
+
+ /**
+ * The length of the range of characters that encompases the cursor position
+ * and has the same hover information as the cursor position.
+ */
+ void set length(int value) {
+ assert(value != null);
+ this._length = value;
+ }
/**
* The path to the defining compilation unit of the library in which the
* referenced element is declared. This data is omitted if there is no
* referenced element, or if the element is declared inside an HTML file.
*/
- String containingLibraryPath;
+ String get containingLibraryPath => _containingLibraryPath;
+
+ /**
+ * The path to the defining compilation unit of the library in which the
+ * referenced element is declared. This data is omitted if there is no
+ * referenced element, or if the element is declared inside an HTML file.
+ */
+ void set containingLibraryPath(String value) {
+ this._containingLibraryPath = value;
+ }
/**
* The name of the library in which the referenced element is declared. This
* data is omitted if there is no referenced element, or if the element is
* declared inside an HTML file.
*/
- String containingLibraryName;
+ String get containingLibraryName => _containingLibraryName;
+
+ /**
+ * The name of the library in which the referenced element is declared. This
+ * data is omitted if there is no referenced element, or if the element is
+ * declared inside an HTML file.
+ */
+ void set containingLibraryName(String value) {
+ this._containingLibraryName = value;
+ }
/**
* A human-readable description of the class declaring the element being
* referenced. This data is omitted if there is no referenced element, or if
* the element is not a class member.
*/
- String containingClassDescription;
+ String get containingClassDescription => _containingClassDescription;
+
+ /**
+ * A human-readable description of the class declaring the element being
+ * referenced. This data is omitted if there is no referenced element, or if
+ * the element is not a class member.
+ */
+ void set containingClassDescription(String value) {
+ this._containingClassDescription = value;
+ }
/**
* The dartdoc associated with the referenced element. Other than the removal
@@ -7473,42 +9612,107 @@
* block comment, the dartdoc is unprocessed markdown. This data is omitted
* if there is no referenced element, or if the element has no dartdoc.
*/
- String dartdoc;
+ String get dartdoc => _dartdoc;
+
+ /**
+ * The dartdoc associated with the referenced element. Other than the removal
+ * of the comment delimiters, including leading asterisks in the case of a
+ * block comment, the dartdoc is unprocessed markdown. This data is omitted
+ * if there is no referenced element, or if the element has no dartdoc.
+ */
+ void set dartdoc(String value) {
+ this._dartdoc = value;
+ }
/**
* A human-readable description of the element being referenced. This data is
* omitted if there is no referenced element.
*/
- String elementDescription;
+ String get elementDescription => _elementDescription;
+
+ /**
+ * A human-readable description of the element being referenced. This data is
+ * omitted if there is no referenced element.
+ */
+ void set elementDescription(String value) {
+ this._elementDescription = value;
+ }
/**
* A human-readable description of the kind of element being referenced (such
* as “class” or “function type alias”). This data is omitted if there is no
* referenced element.
*/
- String elementKind;
+ String get elementKind => _elementKind;
+
+ /**
+ * A human-readable description of the kind of element being referenced (such
+ * as “class” or “function type alias”). This data is omitted if there is no
+ * referenced element.
+ */
+ void set elementKind(String value) {
+ this._elementKind = value;
+ }
/**
* A human-readable description of the parameter corresponding to the
* expression being hovered over. This data is omitted if the location is not
* in an argument to a function.
*/
- String parameter;
+ String get parameter => _parameter;
+
+ /**
+ * A human-readable description of the parameter corresponding to the
+ * expression being hovered over. This data is omitted if the location is not
+ * in an argument to a function.
+ */
+ void set parameter(String value) {
+ this._parameter = value;
+ }
/**
* The name of the propagated type of the expression. This data is omitted if
* the location does not correspond to an expression or if there is no
* propagated type information.
*/
- String propagatedType;
+ String get propagatedType => _propagatedType;
+
+ /**
+ * The name of the propagated type of the expression. This data is omitted if
+ * the location does not correspond to an expression or if there is no
+ * propagated type information.
+ */
+ void set propagatedType(String value) {
+ this._propagatedType = value;
+ }
/**
* The name of the static type of the expression. This data is omitted if the
* location does not correspond to an expression.
*/
- String staticType;
+ String get staticType => _staticType;
- HoverInformation(this.offset, this.length, {this.containingLibraryPath, this.containingLibraryName, this.containingClassDescription, this.dartdoc, this.elementDescription, this.elementKind, this.parameter, this.propagatedType, this.staticType});
+ /**
+ * The name of the static type of the expression. This data is omitted if the
+ * location does not correspond to an expression.
+ */
+ void set staticType(String value) {
+ this._staticType = value;
+ }
+
+ HoverInformation(int offset, int length, {String containingLibraryPath, String containingLibraryName, String containingClassDescription, String dartdoc, String elementDescription, String elementKind, String parameter, String propagatedType, String staticType}) {
+ this.offset = offset;
+ this.length = length;
+ this.containingLibraryPath = containingLibraryPath;
+ this.containingLibraryName = containingLibraryName;
+ this.containingClassDescription = containingClassDescription;
+ this.dartdoc = dartdoc;
+ this.elementDescription = elementDescription;
+ this.elementKind = elementKind;
+ this.parameter = parameter;
+ this.propagatedType = propagatedType;
+ this.staticType = staticType;
+ }
factory HoverInformation.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
if (json == null) {
@@ -7652,23 +9856,58 @@
* }
*/
class LinkedEditGroup implements HasToJson {
+ List<Position> _positions;
+
+ int _length;
+
+ List<LinkedEditSuggestion> _suggestions;
+
/**
* The positions of the regions that should be edited simultaneously.
*/
- List<Position> positions;
+ List<Position> get positions => _positions;
+
+ /**
+ * The positions of the regions that should be edited simultaneously.
+ */
+ void set positions(List<Position> value) {
+ assert(value != null);
+ this._positions = value;
+ }
/**
* The length of the regions that should be edited simultaneously.
*/
- int length;
+ int get length => _length;
+
+ /**
+ * The length of the regions that should be edited simultaneously.
+ */
+ void set length(int value) {
+ assert(value != null);
+ this._length = value;
+ }
/**
* Pre-computed suggestions for what every region might want to be changed
* to.
*/
- List<LinkedEditSuggestion> suggestions;
+ List<LinkedEditSuggestion> get suggestions => _suggestions;
- LinkedEditGroup(this.positions, this.length, this.suggestions);
+ /**
+ * Pre-computed suggestions for what every region might want to be changed
+ * to.
+ */
+ void set suggestions(List<LinkedEditSuggestion> value) {
+ assert(value != null);
+ this._suggestions = value;
+ }
+
+ LinkedEditGroup(List<Position> positions, int length, List<LinkedEditSuggestion> suggestions) {
+ this.positions = positions;
+ this.length = length;
+ this.suggestions = suggestions;
+ }
factory LinkedEditGroup.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
if (json == null) {
@@ -7759,17 +9998,40 @@
* }
*/
class LinkedEditSuggestion implements HasToJson {
+ String _value;
+
+ LinkedEditSuggestionKind _kind;
+
/**
* The value that could be used to replace all of the linked edit regions.
*/
- String value;
+ String get value => _value;
+
+ /**
+ * The value that could be used to replace all of the linked edit regions.
+ */
+ void set value(String value) {
+ assert(value != null);
+ this._value = value;
+ }
/**
* The kind of value being proposed.
*/
- LinkedEditSuggestionKind kind;
+ LinkedEditSuggestionKind get kind => _kind;
- LinkedEditSuggestion(this.value, this.kind);
+ /**
+ * The kind of value being proposed.
+ */
+ void set kind(LinkedEditSuggestionKind value) {
+ assert(value != null);
+ this._kind = value;
+ }
+
+ LinkedEditSuggestion(String value, LinkedEditSuggestionKind kind) {
+ this.value = value;
+ this.kind = kind;
+ }
factory LinkedEditSuggestion.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
if (json == null) {
@@ -7893,34 +10155,92 @@
* }
*/
class Location implements HasToJson {
+ String _file;
+
+ int _offset;
+
+ int _length;
+
+ int _startLine;
+
+ int _startColumn;
+
/**
* The file containing the range.
*/
- String file;
+ String get file => _file;
+
+ /**
+ * The file containing the range.
+ */
+ void set file(String value) {
+ assert(value != null);
+ this._file = value;
+ }
/**
* The offset of the range.
*/
- int offset;
+ int get offset => _offset;
+
+ /**
+ * The offset of the range.
+ */
+ void set offset(int value) {
+ assert(value != null);
+ this._offset = value;
+ }
/**
* The length of the range.
*/
- int length;
+ int get length => _length;
+
+ /**
+ * The length of the range.
+ */
+ void set length(int value) {
+ assert(value != null);
+ this._length = value;
+ }
/**
* The one-based index of the line containing the first character of the
* range.
*/
- int startLine;
+ int get startLine => _startLine;
+
+ /**
+ * The one-based index of the line containing the first character of the
+ * range.
+ */
+ void set startLine(int value) {
+ assert(value != null);
+ this._startLine = value;
+ }
/**
* The one-based index of the column containing the first character of the
* range.
*/
- int startColumn;
+ int get startColumn => _startColumn;
- Location(this.file, this.offset, this.length, this.startLine, this.startColumn);
+ /**
+ * The one-based index of the column containing the first character of the
+ * range.
+ */
+ void set startColumn(int value) {
+ assert(value != null);
+ this._startColumn = value;
+ }
+
+ Location(String file, int offset, int length, int startLine, int startColumn) {
+ this.file = file;
+ this.offset = offset;
+ this.length = length;
+ this.startLine = startLine;
+ this.startColumn = startColumn;
+ }
factory Location.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
if (json == null) {
@@ -8010,24 +10330,60 @@
* }
*/
class NavigationRegion implements HasToJson {
+ int _offset;
+
+ int _length;
+
+ List<int> _targets;
+
/**
* The offset of the region from which the user can navigate.
*/
- int offset;
+ int get offset => _offset;
+
+ /**
+ * The offset of the region from which the user can navigate.
+ */
+ void set offset(int value) {
+ assert(value != null);
+ this._offset = value;
+ }
/**
* The length of the region from which the user can navigate.
*/
- int length;
+ int get length => _length;
+
+ /**
+ * The length of the region from which the user can navigate.
+ */
+ void set length(int value) {
+ assert(value != null);
+ this._length = value;
+ }
/**
* The indexes of the targets (in the enclosing navigation response) to which
* the given region is bound. By opening the target, clients can implement
* one form of navigation.
*/
- List<int> targets;
+ List<int> get targets => _targets;
- NavigationRegion(this.offset, this.length, this.targets);
+ /**
+ * The indexes of the targets (in the enclosing navigation response) to which
+ * the given region is bound. By opening the target, clients can implement
+ * one form of navigation.
+ */
+ void set targets(List<int> value) {
+ assert(value != null);
+ this._targets = value;
+ }
+
+ NavigationRegion(int offset, int length, List<int> targets) {
+ this.offset = offset;
+ this.length = length;
+ this.targets = targets;
+ }
factory NavigationRegion.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
if (json == null) {
@@ -8102,40 +10458,110 @@
* }
*/
class NavigationTarget implements HasToJson {
+ ElementKind _kind;
+
+ int _fileIndex;
+
+ int _offset;
+
+ int _length;
+
+ int _startLine;
+
+ int _startColumn;
+
/**
* The kind of the element.
*/
- ElementKind kind;
+ ElementKind get kind => _kind;
+
+ /**
+ * The kind of the element.
+ */
+ void set kind(ElementKind value) {
+ assert(value != null);
+ this._kind = value;
+ }
/**
* The index of the file (in the enclosing navigation response) to navigate
* to.
*/
- int fileIndex;
+ int get fileIndex => _fileIndex;
+
+ /**
+ * The index of the file (in the enclosing navigation response) to navigate
+ * to.
+ */
+ void set fileIndex(int value) {
+ assert(value != null);
+ this._fileIndex = value;
+ }
/**
* The offset of the region from which the user can navigate.
*/
- int offset;
+ int get offset => _offset;
+
+ /**
+ * The offset of the region from which the user can navigate.
+ */
+ void set offset(int value) {
+ assert(value != null);
+ this._offset = value;
+ }
/**
* The length of the region from which the user can navigate.
*/
- int length;
+ int get length => _length;
+
+ /**
+ * The length of the region from which the user can navigate.
+ */
+ void set length(int value) {
+ assert(value != null);
+ this._length = value;
+ }
/**
* The one-based index of the line containing the first character of the
* region.
*/
- int startLine;
+ int get startLine => _startLine;
+
+ /**
+ * The one-based index of the line containing the first character of the
+ * region.
+ */
+ void set startLine(int value) {
+ assert(value != null);
+ this._startLine = value;
+ }
/**
* The one-based index of the column containing the first character of the
* region.
*/
- int startColumn;
+ int get startColumn => _startColumn;
- NavigationTarget(this.kind, this.fileIndex, this.offset, this.length, this.startLine, this.startColumn);
+ /**
+ * The one-based index of the column containing the first character of the
+ * region.
+ */
+ void set startColumn(int value) {
+ assert(value != null);
+ this._startColumn = value;
+ }
+
+ NavigationTarget(ElementKind kind, int fileIndex, int offset, int length, int startLine, int startColumn) {
+ this.kind = kind;
+ this.fileIndex = fileIndex;
+ this.offset = offset;
+ this.length = length;
+ this.startLine = startLine;
+ this.startColumn = startColumn;
+ }
factory NavigationTarget.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
if (json == null) {
@@ -8234,22 +10660,56 @@
* }
*/
class Occurrences implements HasToJson {
+ Element _element;
+
+ List<int> _offsets;
+
+ int _length;
+
/**
* The element that was referenced.
*/
- Element element;
+ Element get element => _element;
+
+ /**
+ * The element that was referenced.
+ */
+ void set element(Element value) {
+ assert(value != null);
+ this._element = value;
+ }
/**
* The offsets of the name of the referenced element within the file.
*/
- List<int> offsets;
+ List<int> get offsets => _offsets;
+
+ /**
+ * The offsets of the name of the referenced element within the file.
+ */
+ void set offsets(List<int> value) {
+ assert(value != null);
+ this._offsets = value;
+ }
/**
* The length of the name of the referenced element.
*/
- int length;
+ int get length => _length;
- Occurrences(this.element, this.offsets, this.length);
+ /**
+ * The length of the name of the referenced element.
+ */
+ void set length(int value) {
+ assert(value != null);
+ this._length = value;
+ }
+
+ Occurrences(Element element, List<int> offsets, int length) {
+ this.element = element;
+ this.offsets = offsets;
+ this.length = length;
+ }
factory Occurrences.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
if (json == null) {
@@ -8322,10 +10782,26 @@
* }
*/
class Outline implements HasToJson {
+ Element _element;
+
+ int _offset;
+
+ int _length;
+
+ List<Outline> _children;
+
/**
* A description of the element represented by this node.
*/
- Element element;
+ Element get element => _element;
+
+ /**
+ * A description of the element represented by this node.
+ */
+ void set element(Element value) {
+ assert(value != null);
+ this._element = value;
+ }
/**
* The offset of the first character of the element. This is different than
@@ -8333,20 +10809,52 @@
* It can be used, for example, to map locations in the file back to an
* outline.
*/
- int offset;
+ int get offset => _offset;
+
+ /**
+ * The offset of the first character of the element. This is different than
+ * the offset in the Element, which if the offset of the name of the element.
+ * It can be used, for example, to map locations in the file back to an
+ * outline.
+ */
+ void set offset(int value) {
+ assert(value != null);
+ this._offset = value;
+ }
/**
* The length of the element.
*/
- int length;
+ int get length => _length;
+
+ /**
+ * The length of the element.
+ */
+ void set length(int value) {
+ assert(value != null);
+ this._length = value;
+ }
/**
* The children of the node. The field will be omitted if the node has no
* children.
*/
- List<Outline> children;
+ List<Outline> get children => _children;
- Outline(this.element, this.offset, this.length, {this.children});
+ /**
+ * The children of the node. The field will be omitted if the node has no
+ * children.
+ */
+ void set children(List<Outline> value) {
+ this._children = value;
+ }
+
+ Outline(Element element, int offset, int length, {List<Outline> children}) {
+ this.element = element;
+ this.offset = offset;
+ this.length = length;
+ this.children = children;
+ }
factory Outline.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
if (json == null) {
@@ -8428,31 +10936,78 @@
* }
*/
class Override implements HasToJson {
+ int _offset;
+
+ int _length;
+
+ OverriddenMember _superclassMember;
+
+ List<OverriddenMember> _interfaceMembers;
+
/**
* The offset of the name of the overriding member.
*/
- int offset;
+ int get offset => _offset;
+
+ /**
+ * The offset of the name of the overriding member.
+ */
+ void set offset(int value) {
+ assert(value != null);
+ this._offset = value;
+ }
/**
* The length of the name of the overriding member.
*/
- int length;
+ int get length => _length;
+
+ /**
+ * The length of the name of the overriding member.
+ */
+ void set length(int value) {
+ assert(value != null);
+ this._length = value;
+ }
/**
* The member inherited from a superclass that is overridden by the
* overriding member. The field is omitted if there is no superclass member,
* in which case there must be at least one interface member.
*/
- OverriddenMember superclassMember;
+ OverriddenMember get superclassMember => _superclassMember;
+
+ /**
+ * The member inherited from a superclass that is overridden by the
+ * overriding member. The field is omitted if there is no superclass member,
+ * in which case there must be at least one interface member.
+ */
+ void set superclassMember(OverriddenMember value) {
+ this._superclassMember = value;
+ }
/**
* The members inherited from interfaces that are overridden by the
* overriding member. The field is omitted if there are no interface members,
* in which case there must be a superclass member.
*/
- List<OverriddenMember> interfaceMembers;
+ List<OverriddenMember> get interfaceMembers => _interfaceMembers;
- Override(this.offset, this.length, {this.superclassMember, this.interfaceMembers});
+ /**
+ * The members inherited from interfaces that are overridden by the
+ * overriding member. The field is omitted if there are no interface members,
+ * in which case there must be a superclass member.
+ */
+ void set interfaceMembers(List<OverriddenMember> value) {
+ this._interfaceMembers = value;
+ }
+
+ Override(int offset, int length, {OverriddenMember superclassMember, List<OverriddenMember> interfaceMembers}) {
+ this.offset = offset;
+ this.length = length;
+ this.superclassMember = superclassMember;
+ this.interfaceMembers = interfaceMembers;
+ }
factory Override.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
if (json == null) {
@@ -8532,17 +11087,40 @@
* }
*/
class OverriddenMember implements HasToJson {
+ Element _element;
+
+ String _className;
+
/**
* The element that is being overridden.
*/
- Element element;
+ Element get element => _element;
+
+ /**
+ * The element that is being overridden.
+ */
+ void set element(Element value) {
+ assert(value != null);
+ this._element = value;
+ }
/**
* The name of the class in which the member is defined.
*/
- String className;
+ String get className => _className;
- OverriddenMember(this.element, this.className);
+ /**
+ * The name of the class in which the member is defined.
+ */
+ void set className(String value) {
+ assert(value != null);
+ this._className = value;
+ }
+
+ OverriddenMember(Element element, String className) {
+ this.element = element;
+ this.className = className;
+ }
factory OverriddenMember.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
if (json == null) {
@@ -8604,17 +11182,40 @@
* }
*/
class Position implements HasToJson {
+ String _file;
+
+ int _offset;
+
/**
* The file containing the position.
*/
- String file;
+ String get file => _file;
+
+ /**
+ * The file containing the position.
+ */
+ void set file(String value) {
+ assert(value != null);
+ this._file = value;
+ }
/**
* The offset of the position.
*/
- int offset;
+ int get offset => _offset;
- Position(this.file, this.offset);
+ /**
+ * The offset of the position.
+ */
+ void set offset(int value) {
+ assert(value != null);
+ this._offset = value;
+ }
+
+ Position(String file, int offset) {
+ this.file = file;
+ this.offset = offset;
+ }
factory Position.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
if (json == null) {
@@ -8675,13 +11276,26 @@
* }
*/
class PubStatus implements HasToJson {
+ bool _isListingPackageDirs;
+
/**
* True if the server is currently running pub to produce a list of package
* directories.
*/
- bool isListingPackageDirs;
+ bool get isListingPackageDirs => _isListingPackageDirs;
- PubStatus(this.isListingPackageDirs);
+ /**
+ * True if the server is currently running pub to produce a list of package
+ * directories.
+ */
+ void set isListingPackageDirs(bool value) {
+ assert(value != null);
+ this._isListingPackageDirs = value;
+ }
+
+ PubStatus(bool isListingPackageDirs) {
+ this.isListingPackageDirs = isListingPackageDirs;
+ }
factory PubStatus.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
if (json == null) {
@@ -8821,36 +11435,94 @@
* }
*/
class RefactoringMethodParameter implements HasToJson {
+ String _id;
+
+ RefactoringMethodParameterKind _kind;
+
+ String _type;
+
+ String _name;
+
+ String _parameters;
+
/**
* The unique identifier of the parameter. Clients may omit this field for
* the parameters they want to add.
*/
- String id;
+ String get id => _id;
+
+ /**
+ * The unique identifier of the parameter. Clients may omit this field for
+ * the parameters they want to add.
+ */
+ void set id(String value) {
+ this._id = value;
+ }
/**
* The kind of the parameter.
*/
- RefactoringMethodParameterKind kind;
+ RefactoringMethodParameterKind get kind => _kind;
+
+ /**
+ * The kind of the parameter.
+ */
+ void set kind(RefactoringMethodParameterKind value) {
+ assert(value != null);
+ this._kind = value;
+ }
/**
* The type that should be given to the parameter, or the return type of the
* parameter's function type.
*/
- String type;
+ String get type => _type;
+
+ /**
+ * The type that should be given to the parameter, or the return type of the
+ * parameter's function type.
+ */
+ void set type(String value) {
+ assert(value != null);
+ this._type = value;
+ }
/**
* The name that should be given to the parameter.
*/
- String name;
+ String get name => _name;
+
+ /**
+ * The name that should be given to the parameter.
+ */
+ void set name(String value) {
+ assert(value != null);
+ this._name = value;
+ }
/**
* The parameter list of the parameter's function type. If the parameter is
* not of a function type, this field will not be defined. If the function
* type has zero parameters, this field will have a value of "()".
*/
- String parameters;
+ String get parameters => _parameters;
- RefactoringMethodParameter(this.kind, this.type, this.name, {this.id, this.parameters});
+ /**
+ * The parameter list of the parameter's function type. If the parameter is
+ * not of a function type, this field will not be defined. If the function
+ * type has zero parameters, this field will have a value of "()".
+ */
+ void set parameters(String value) {
+ this._parameters = value;
+ }
+
+ RefactoringMethodParameter(RefactoringMethodParameterKind kind, String type, String name, {String id, String parameters}) {
+ this.id = id;
+ this.kind = kind;
+ this.type = type;
+ this.name = name;
+ this.parameters = parameters;
+ }
factory RefactoringMethodParameter.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
if (json == null) {
@@ -9066,24 +11738,59 @@
* }
*/
class RefactoringProblem implements HasToJson {
+ RefactoringProblemSeverity _severity;
+
+ String _message;
+
+ Location _location;
+
/**
* The severity of the problem being represented.
*/
- RefactoringProblemSeverity severity;
+ RefactoringProblemSeverity get severity => _severity;
+
+ /**
+ * The severity of the problem being represented.
+ */
+ void set severity(RefactoringProblemSeverity value) {
+ assert(value != null);
+ this._severity = value;
+ }
/**
* A human-readable description of the problem being represented.
*/
- String message;
+ String get message => _message;
+
+ /**
+ * A human-readable description of the problem being represented.
+ */
+ void set message(String value) {
+ assert(value != null);
+ this._message = value;
+ }
/**
* The location of the problem being represented. This field is omitted
* unless there is a specific location associated with the problem (such as a
* location where an element being renamed will be shadowed).
*/
- Location location;
+ Location get location => _location;
- RefactoringProblem(this.severity, this.message, {this.location});
+ /**
+ * The location of the problem being represented. This field is omitted
+ * unless there is a specific location associated with the problem (such as a
+ * location where an element being renamed will be shadowed).
+ */
+ void set location(Location value) {
+ this._location = value;
+ }
+
+ RefactoringProblem(RefactoringProblemSeverity severity, String message, {Location location}) {
+ this.severity = severity;
+ this.message = message;
+ this.location = location;
+ }
factory RefactoringProblem.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
if (json == null) {
@@ -9269,23 +11976,57 @@
* }
*/
class RequestError implements HasToJson {
+ RequestErrorCode _code;
+
+ String _message;
+
+ String _stackTrace;
+
/**
* A code that uniquely identifies the error that occurred.
*/
- RequestErrorCode code;
+ RequestErrorCode get code => _code;
+
+ /**
+ * A code that uniquely identifies the error that occurred.
+ */
+ void set code(RequestErrorCode value) {
+ assert(value != null);
+ this._code = value;
+ }
/**
* A short description of the error.
*/
- String message;
+ String get message => _message;
+
+ /**
+ * A short description of the error.
+ */
+ void set message(String value) {
+ assert(value != null);
+ this._message = value;
+ }
/**
* The stack trace associated with processing the request, used for debugging
* the server.
*/
- String stackTrace;
+ String get stackTrace => _stackTrace;
- RequestError(this.code, this.message, {this.stackTrace});
+ /**
+ * The stack trace associated with processing the request, used for debugging
+ * the server.
+ */
+ void set stackTrace(String value) {
+ this._stackTrace = value;
+ }
+
+ RequestError(RequestErrorCode code, String message, {String stackTrace}) {
+ this.code = code;
+ this.message = message;
+ this.stackTrace = stackTrace;
+ }
factory RequestError.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
if (json == null) {
@@ -9353,6 +12094,7 @@
* enum {
* CONTENT_MODIFIED
* FORMAT_INVALID_FILE
+ * FORMAT_WITH_ERRORS
* GET_ERRORS_INVALID_FILE
* INVALID_ANALYSIS_ROOT
* INVALID_EXECUTION_CONTEXT
@@ -9386,6 +12128,11 @@
static const FORMAT_INVALID_FILE = const RequestErrorCode._("FORMAT_INVALID_FILE");
/**
+ * An "edit.format" request specified a file that contains syntax errors.
+ */
+ static const FORMAT_WITH_ERRORS = const RequestErrorCode._("FORMAT_WITH_ERRORS");
+
+ /**
* An "analysis.getErrors" request specified a FilePath which does not match
* a file currently subject to analysis.
*/
@@ -9491,7 +12238,7 @@
/**
* A list containing all of the enum values that are defined.
*/
- static const List<RequestErrorCode> VALUES = const <RequestErrorCode>[CONTENT_MODIFIED, FORMAT_INVALID_FILE, GET_ERRORS_INVALID_FILE, INVALID_ANALYSIS_ROOT, INVALID_EXECUTION_CONTEXT, INVALID_OVERLAY_CHANGE, INVALID_PARAMETER, INVALID_REQUEST, NO_INDEX_GENERATED, REFACTORING_REQUEST_CANCELLED, SERVER_ALREADY_STARTED, SERVER_ERROR, SORT_MEMBERS_INVALID_FILE, SORT_MEMBERS_PARSE_ERRORS, UNANALYZED_PRIORITY_FILES, UNKNOWN_REQUEST, UNKNOWN_SOURCE, UNSUPPORTED_FEATURE];
+ static const List<RequestErrorCode> VALUES = const <RequestErrorCode>[CONTENT_MODIFIED, FORMAT_INVALID_FILE, FORMAT_WITH_ERRORS, GET_ERRORS_INVALID_FILE, INVALID_ANALYSIS_ROOT, INVALID_EXECUTION_CONTEXT, INVALID_OVERLAY_CHANGE, INVALID_PARAMETER, INVALID_REQUEST, NO_INDEX_GENERATED, REFACTORING_REQUEST_CANCELLED, SERVER_ALREADY_STARTED, SERVER_ERROR, SORT_MEMBERS_INVALID_FILE, SORT_MEMBERS_PARSE_ERRORS, UNANALYZED_PRIORITY_FILES, UNKNOWN_REQUEST, UNKNOWN_SOURCE, UNSUPPORTED_FEATURE];
final String name;
@@ -9503,6 +12250,8 @@
return CONTENT_MODIFIED;
case "FORMAT_INVALID_FILE":
return FORMAT_INVALID_FILE;
+ case "FORMAT_WITH_ERRORS":
+ return FORMAT_WITH_ERRORS;
case "GET_ERRORS_INVALID_FILE":
return GET_ERRORS_INVALID_FILE;
case "INVALID_ANALYSIS_ROOT":
@@ -9567,16 +12316,41 @@
* }
*/
class SearchResult implements HasToJson {
+ Location _location;
+
+ SearchResultKind _kind;
+
+ bool _isPotential;
+
+ List<Element> _path;
+
/**
* The location of the code that matched the search criteria.
*/
- Location location;
+ Location get location => _location;
+
+ /**
+ * The location of the code that matched the search criteria.
+ */
+ void set location(Location value) {
+ assert(value != null);
+ this._location = value;
+ }
/**
* The kind of element that was found or the kind of reference that was
* found.
*/
- SearchResultKind kind;
+ SearchResultKind get kind => _kind;
+
+ /**
+ * The kind of element that was found or the kind of reference that was
+ * found.
+ */
+ void set kind(SearchResultKind value) {
+ assert(value != null);
+ this._kind = value;
+ }
/**
* True if the result is a potential match but cannot be confirmed to be a
@@ -9584,15 +12358,40 @@
* were requested, and a reference to a method m from an unknown class were
* found, it would be marked as being a potential match.
*/
- bool isPotential;
+ bool get isPotential => _isPotential;
+
+ /**
+ * True if the result is a potential match but cannot be confirmed to be a
+ * match. For example, if all references to a method m defined in some class
+ * were requested, and a reference to a method m from an unknown class were
+ * found, it would be marked as being a potential match.
+ */
+ void set isPotential(bool value) {
+ assert(value != null);
+ this._isPotential = value;
+ }
/**
* The elements that contain the result, starting with the most immediately
* enclosing ancestor and ending with the library.
*/
- List<Element> path;
+ List<Element> get path => _path;
- SearchResult(this.location, this.kind, this.isPotential, this.path);
+ /**
+ * The elements that contain the result, starting with the most immediately
+ * enclosing ancestor and ending with the library.
+ */
+ void set path(List<Element> value) {
+ assert(value != null);
+ this._path = value;
+ }
+
+ SearchResult(Location location, SearchResultKind kind, bool isPotential, List<Element> path) {
+ this.location = location;
+ this.kind = kind;
+ this.isPotential = isPotential;
+ this.path = path;
+ }
factory SearchResult.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
if (json == null) {
@@ -9814,34 +12613,80 @@
* }
*/
class SourceChange implements HasToJson {
+ String _message;
+
+ List<SourceFileEdit> _edits;
+
+ List<LinkedEditGroup> _linkedEditGroups;
+
+ Position _selection;
+
/**
* A human-readable description of the change to be applied.
*/
- String message;
+ String get message => _message;
+
+ /**
+ * A human-readable description of the change to be applied.
+ */
+ void set message(String value) {
+ assert(value != null);
+ this._message = value;
+ }
/**
* A list of the edits used to effect the change, grouped by file.
*/
- List<SourceFileEdit> edits;
+ List<SourceFileEdit> get edits => _edits;
+
+ /**
+ * A list of the edits used to effect the change, grouped by file.
+ */
+ void set edits(List<SourceFileEdit> value) {
+ assert(value != null);
+ this._edits = value;
+ }
/**
* A list of the linked editing groups used to customize the changes that
* were made.
*/
- List<LinkedEditGroup> linkedEditGroups;
+ List<LinkedEditGroup> get linkedEditGroups => _linkedEditGroups;
+
+ /**
+ * A list of the linked editing groups used to customize the changes that
+ * were made.
+ */
+ void set linkedEditGroups(List<LinkedEditGroup> value) {
+ assert(value != null);
+ this._linkedEditGroups = value;
+ }
/**
* The position that should be selected after the edits have been applied.
*/
- Position selection;
+ Position get selection => _selection;
- SourceChange(this.message, {this.edits, this.linkedEditGroups, this.selection}) {
+ /**
+ * The position that should be selected after the edits have been applied.
+ */
+ void set selection(Position value) {
+ this._selection = value;
+ }
+
+ SourceChange(String message, {List<SourceFileEdit> edits, List<LinkedEditGroup> linkedEditGroups, Position selection}) {
+ this.message = message;
if (edits == null) {
- edits = <SourceFileEdit>[];
+ this.edits = <SourceFileEdit>[];
+ } else {
+ this.edits = edits;
}
if (linkedEditGroups == null) {
- linkedEditGroups = <LinkedEditGroup>[];
+ this.linkedEditGroups = <LinkedEditGroup>[];
+ } else {
+ this.linkedEditGroups = linkedEditGroups;
}
+ this.selection = selection;
}
factory SourceChange.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
@@ -9957,20 +12802,52 @@
static String applySequence(String code, Iterable<SourceEdit> edits) =>
_applySequence(code, edits);
+ int _offset;
+
+ int _length;
+
+ String _replacement;
+
+ String _id;
+
/**
* The offset of the region to be modified.
*/
- int offset;
+ int get offset => _offset;
+
+ /**
+ * The offset of the region to be modified.
+ */
+ void set offset(int value) {
+ assert(value != null);
+ this._offset = value;
+ }
/**
* The length of the region to be modified.
*/
- int length;
+ int get length => _length;
+
+ /**
+ * The length of the region to be modified.
+ */
+ void set length(int value) {
+ assert(value != null);
+ this._length = value;
+ }
/**
* The code that is to replace the specified region in the original code.
*/
- String replacement;
+ String get replacement => _replacement;
+
+ /**
+ * The code that is to replace the specified region in the original code.
+ */
+ void set replacement(String value) {
+ assert(value != null);
+ this._replacement = value;
+ }
/**
* An identifier that uniquely identifies this source edit from other edits
@@ -9982,9 +12859,28 @@
* id so that they can be referenced. Edits in the same response that do not
* need to be referenced will not have an id.
*/
- String id;
+ String get id => _id;
- SourceEdit(this.offset, this.length, this.replacement, {this.id});
+ /**
+ * An identifier that uniquely identifies this source edit from other edits
+ * in the same response. This field is omitted unless a containing structure
+ * needs to be able to identify the edit for some reason.
+ *
+ * For example, some refactoring operations can produce edits that might not
+ * be appropriate (referred to as potential edits). Such edits will have an
+ * id so that they can be referenced. Edits in the same response that do not
+ * need to be referenced will not have an id.
+ */
+ void set id(String value) {
+ this._id = value;
+ }
+
+ SourceEdit(int offset, int length, String replacement, {String id}) {
+ this.offset = offset;
+ this.length = length;
+ this.replacement = replacement;
+ this.id = id;
+ }
factory SourceEdit.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
if (json == null) {
@@ -10075,10 +12971,24 @@
* }
*/
class SourceFileEdit implements HasToJson {
+ String _file;
+
+ int _fileStamp;
+
+ List<SourceEdit> _edits;
+
/**
* The file containing the code to be modified.
*/
- String file;
+ String get file => _file;
+
+ /**
+ * The file containing the code to be modified.
+ */
+ void set file(String value) {
+ assert(value != null);
+ this._file = value;
+ }
/**
* The modification stamp of the file at the moment when the change was
@@ -10087,16 +12997,40 @@
* sure that the file was not changed since then, so it is safe to apply the
* change.
*/
- int fileStamp;
+ int get fileStamp => _fileStamp;
+
+ /**
+ * The modification stamp of the file at the moment when the change was
+ * created, in milliseconds since the "Unix epoch". Will be -1 if the file
+ * did not exist and should be created. The client may use this field to make
+ * sure that the file was not changed since then, so it is safe to apply the
+ * change.
+ */
+ void set fileStamp(int value) {
+ assert(value != null);
+ this._fileStamp = value;
+ }
/**
* A list of the edits used to effect the change.
*/
- List<SourceEdit> edits;
+ List<SourceEdit> get edits => _edits;
- SourceFileEdit(this.file, this.fileStamp, {this.edits}) {
+ /**
+ * A list of the edits used to effect the change.
+ */
+ void set edits(List<SourceEdit> value) {
+ assert(value != null);
+ this._edits = value;
+ }
+
+ SourceFileEdit(String file, int fileStamp, {List<SourceEdit> edits}) {
+ this.file = file;
+ this.fileStamp = fileStamp;
if (edits == null) {
- edits = <SourceEdit>[];
+ this.edits = <SourceEdit>[];
+ } else {
+ this.edits = edits;
}
}
@@ -10185,10 +13119,32 @@
* }
*/
class TypeHierarchyItem implements HasToJson {
+ Element _classElement;
+
+ String _displayName;
+
+ Element _memberElement;
+
+ int _superclass;
+
+ List<int> _interfaces;
+
+ List<int> _mixins;
+
+ List<int> _subclasses;
+
/**
* The class element represented by this item.
*/
- Element classElement;
+ Element get classElement => _classElement;
+
+ /**
+ * The class element represented by this item.
+ */
+ void set classElement(Element value) {
+ assert(value != null);
+ this._classElement = value;
+ }
/**
* The name to be displayed for the class. This field will be omitted if the
@@ -10196,7 +13152,17 @@
* different if there is additional type information to be displayed, such as
* type arguments.
*/
- String displayName;
+ String get displayName => _displayName;
+
+ /**
+ * The name to be displayed for the class. This field will be omitted if the
+ * display name is the same as the name of the element. The display name is
+ * different if there is additional type information to be displayed, such as
+ * type arguments.
+ */
+ void set displayName(String value) {
+ this._displayName = value;
+ }
/**
* The member in the class corresponding to the member on which the hierarchy
@@ -10204,42 +13170,98 @@
* requested for a member or if the class does not have a corresponding
* member.
*/
- Element memberElement;
+ Element get memberElement => _memberElement;
+
+ /**
+ * The member in the class corresponding to the member on which the hierarchy
+ * was requested. This field will be omitted if the hierarchy was not
+ * requested for a member or if the class does not have a corresponding
+ * member.
+ */
+ void set memberElement(Element value) {
+ this._memberElement = value;
+ }
/**
* The index of the item representing the superclass of this class. This
* field will be omitted if this item represents the class Object.
*/
- int superclass;
+ int get superclass => _superclass;
+
+ /**
+ * The index of the item representing the superclass of this class. This
+ * field will be omitted if this item represents the class Object.
+ */
+ void set superclass(int value) {
+ this._superclass = value;
+ }
/**
* The indexes of the items representing the interfaces implemented by this
* class. The list will be empty if there are no implemented interfaces.
*/
- List<int> interfaces;
+ List<int> get interfaces => _interfaces;
+
+ /**
+ * The indexes of the items representing the interfaces implemented by this
+ * class. The list will be empty if there are no implemented interfaces.
+ */
+ void set interfaces(List<int> value) {
+ assert(value != null);
+ this._interfaces = value;
+ }
/**
* The indexes of the items representing the mixins referenced by this class.
* The list will be empty if there are no classes mixed in to this class.
*/
- List<int> mixins;
+ List<int> get mixins => _mixins;
+
+ /**
+ * The indexes of the items representing the mixins referenced by this class.
+ * The list will be empty if there are no classes mixed in to this class.
+ */
+ void set mixins(List<int> value) {
+ assert(value != null);
+ this._mixins = value;
+ }
/**
* The indexes of the items representing the subtypes of this class. The list
* will be empty if there are no subtypes or if this item represents a
* supertype of the pivot type.
*/
- List<int> subclasses;
+ List<int> get subclasses => _subclasses;
- TypeHierarchyItem(this.classElement, {this.displayName, this.memberElement, this.superclass, this.interfaces, this.mixins, this.subclasses}) {
+ /**
+ * The indexes of the items representing the subtypes of this class. The list
+ * will be empty if there are no subtypes or if this item represents a
+ * supertype of the pivot type.
+ */
+ void set subclasses(List<int> value) {
+ assert(value != null);
+ this._subclasses = value;
+ }
+
+ TypeHierarchyItem(Element classElement, {String displayName, Element memberElement, int superclass, List<int> interfaces, List<int> mixins, List<int> subclasses}) {
+ this.classElement = classElement;
+ this.displayName = displayName;
+ this.memberElement = memberElement;
+ this.superclass = superclass;
if (interfaces == null) {
- interfaces = <int>[];
+ this.interfaces = <int>[];
+ } else {
+ this.interfaces = interfaces;
}
if (mixins == null) {
- mixins = <int>[];
+ this.mixins = <int>[];
+ } else {
+ this.mixins = mixins;
}
if (subclasses == null) {
- subclasses = <int>[];
+ this.subclasses = <int>[];
+ } else {
+ this.subclasses = subclasses;
}
}
@@ -10417,16 +13439,39 @@
* }
*/
class ExtractLocalVariableFeedback extends RefactoringFeedback implements HasToJson {
+ List<String> _names;
+
+ List<int> _offsets;
+
+ List<int> _lengths;
+
/**
* The proposed names for the local variable.
*/
- List<String> names;
+ List<String> get names => _names;
+
+ /**
+ * The proposed names for the local variable.
+ */
+ void set names(List<String> value) {
+ assert(value != null);
+ this._names = value;
+ }
/**
* The offsets of the expressions that would be replaced by a reference to
* the variable.
*/
- List<int> offsets;
+ List<int> get offsets => _offsets;
+
+ /**
+ * The offsets of the expressions that would be replaced by a reference to
+ * the variable.
+ */
+ void set offsets(List<int> value) {
+ assert(value != null);
+ this._offsets = value;
+ }
/**
* The lengths of the expressions that would be replaced by a reference to
@@ -10434,9 +13479,24 @@
* given expression, if the offset of that expression is offsets[i], then the
* length of that expression is lengths[i].
*/
- List<int> lengths;
+ List<int> get lengths => _lengths;
- ExtractLocalVariableFeedback(this.names, this.offsets, this.lengths);
+ /**
+ * The lengths of the expressions that would be replaced by a reference to
+ * the variable. The lengths correspond to the offsets. In other words, for a
+ * given expression, if the offset of that expression is offsets[i], then the
+ * length of that expression is lengths[i].
+ */
+ void set lengths(List<int> value) {
+ assert(value != null);
+ this._lengths = value;
+ }
+
+ ExtractLocalVariableFeedback(List<String> names, List<int> offsets, List<int> lengths) {
+ this.names = names;
+ this.offsets = offsets;
+ this.lengths = lengths;
+ }
factory ExtractLocalVariableFeedback.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
if (json == null) {
@@ -10507,10 +13567,22 @@
* }
*/
class ExtractLocalVariableOptions extends RefactoringOptions implements HasToJson {
+ String _name;
+
+ bool _extractAll;
+
/**
* The name that the local variable should be given.
*/
- String name;
+ String get name => _name;
+
+ /**
+ * The name that the local variable should be given.
+ */
+ void set name(String value) {
+ assert(value != null);
+ this._name = value;
+ }
/**
* True if all occurrences of the expression within the scope in which the
@@ -10518,9 +13590,23 @@
* variable. The expression used to initiate the refactoring will always be
* replaced.
*/
- bool extractAll;
+ bool get extractAll => _extractAll;
- ExtractLocalVariableOptions(this.name, this.extractAll);
+ /**
+ * True if all occurrences of the expression within the scope in which the
+ * variable will be defined should be replaced by a reference to the local
+ * variable. The expression used to initiate the refactoring will always be
+ * replaced.
+ */
+ void set extractAll(bool value) {
+ assert(value != null);
+ this._extractAll = value;
+ }
+
+ ExtractLocalVariableOptions(String name, bool extractAll) {
+ this.name = name;
+ this.extractAll = extractAll;
+ }
factory ExtractLocalVariableOptions.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
if (json == null) {
@@ -10593,43 +13679,118 @@
* }
*/
class ExtractMethodFeedback extends RefactoringFeedback implements HasToJson {
+ int _offset;
+
+ int _length;
+
+ String _returnType;
+
+ List<String> _names;
+
+ bool _canCreateGetter;
+
+ List<RefactoringMethodParameter> _parameters;
+
+ List<int> _offsets;
+
+ List<int> _lengths;
+
/**
* The offset to the beginning of the expression or statements that will be
* extracted.
*/
- int offset;
+ int get offset => _offset;
+
+ /**
+ * The offset to the beginning of the expression or statements that will be
+ * extracted.
+ */
+ void set offset(int value) {
+ assert(value != null);
+ this._offset = value;
+ }
/**
* The length of the expression or statements that will be extracted.
*/
- int length;
+ int get length => _length;
+
+ /**
+ * The length of the expression or statements that will be extracted.
+ */
+ void set length(int value) {
+ assert(value != null);
+ this._length = value;
+ }
/**
* The proposed return type for the method. If the returned element does not
* have a declared return type, this field will contain an empty string.
*/
- String returnType;
+ String get returnType => _returnType;
+
+ /**
+ * The proposed return type for the method. If the returned element does not
+ * have a declared return type, this field will contain an empty string.
+ */
+ void set returnType(String value) {
+ assert(value != null);
+ this._returnType = value;
+ }
/**
* The proposed names for the method.
*/
- List<String> names;
+ List<String> get names => _names;
+
+ /**
+ * The proposed names for the method.
+ */
+ void set names(List<String> value) {
+ assert(value != null);
+ this._names = value;
+ }
/**
* True if a getter could be created rather than a method.
*/
- bool canCreateGetter;
+ bool get canCreateGetter => _canCreateGetter;
+
+ /**
+ * True if a getter could be created rather than a method.
+ */
+ void set canCreateGetter(bool value) {
+ assert(value != null);
+ this._canCreateGetter = value;
+ }
/**
* The proposed parameters for the method.
*/
- List<RefactoringMethodParameter> parameters;
+ List<RefactoringMethodParameter> get parameters => _parameters;
+
+ /**
+ * The proposed parameters for the method.
+ */
+ void set parameters(List<RefactoringMethodParameter> value) {
+ assert(value != null);
+ this._parameters = value;
+ }
/**
* The offsets of the expressions or statements that would be replaced by an
* invocation of the method.
*/
- List<int> offsets;
+ List<int> get offsets => _offsets;
+
+ /**
+ * The offsets of the expressions or statements that would be replaced by an
+ * invocation of the method.
+ */
+ void set offsets(List<int> value) {
+ assert(value != null);
+ this._offsets = value;
+ }
/**
* The lengths of the expressions or statements that would be replaced by an
@@ -10638,9 +13799,30 @@
* that expression is offsets[i], then the length of that expression is
* lengths[i].
*/
- List<int> lengths;
+ List<int> get lengths => _lengths;
- ExtractMethodFeedback(this.offset, this.length, this.returnType, this.names, this.canCreateGetter, this.parameters, this.offsets, this.lengths);
+ /**
+ * The lengths of the expressions or statements that would be replaced by an
+ * invocation of the method. The lengths correspond to the offsets. In other
+ * words, for a given expression (or block of statements), if the offset of
+ * that expression is offsets[i], then the length of that expression is
+ * lengths[i].
+ */
+ void set lengths(List<int> value) {
+ assert(value != null);
+ this._lengths = value;
+ }
+
+ ExtractMethodFeedback(int offset, int length, String returnType, List<String> names, bool canCreateGetter, List<RefactoringMethodParameter> parameters, List<int> offsets, List<int> lengths) {
+ this.offset = offset;
+ this.length = length;
+ this.returnType = returnType;
+ this.names = names;
+ this.canCreateGetter = canCreateGetter;
+ this.parameters = parameters;
+ this.offsets = offsets;
+ this.lengths = lengths;
+ }
factory ExtractMethodFeedback.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
if (json == null) {
@@ -10759,21 +13941,56 @@
* }
*/
class ExtractMethodOptions extends RefactoringOptions implements HasToJson {
+ String _returnType;
+
+ bool _createGetter;
+
+ String _name;
+
+ List<RefactoringMethodParameter> _parameters;
+
+ bool _extractAll;
+
/**
* The return type that should be defined for the method.
*/
- String returnType;
+ String get returnType => _returnType;
+
+ /**
+ * The return type that should be defined for the method.
+ */
+ void set returnType(String value) {
+ assert(value != null);
+ this._returnType = value;
+ }
/**
* True if a getter should be created rather than a method. It is an error if
* this field is true and the list of parameters is non-empty.
*/
- bool createGetter;
+ bool get createGetter => _createGetter;
+
+ /**
+ * True if a getter should be created rather than a method. It is an error if
+ * this field is true and the list of parameters is non-empty.
+ */
+ void set createGetter(bool value) {
+ assert(value != null);
+ this._createGetter = value;
+ }
/**
* The name that the method should be given.
*/
- String name;
+ String get name => _name;
+
+ /**
+ * The name that the method should be given.
+ */
+ void set name(String value) {
+ assert(value != null);
+ this._name = value;
+ }
/**
* The parameters that should be defined for the method.
@@ -10787,16 +14004,49 @@
* - To add new parameters, omit their identifier.
* - To remove some parameters, omit them in this list.
*/
- List<RefactoringMethodParameter> parameters;
+ List<RefactoringMethodParameter> get parameters => _parameters;
+
+ /**
+ * The parameters that should be defined for the method.
+ *
+ * It is an error if a REQUIRED or NAMED parameter follows a POSITIONAL
+ * parameter. It is an error if a REQUIRED or POSITIONAL parameter follows a
+ * NAMED parameter.
+ *
+ * - To change the order and/or update proposed parameters, add parameters
+ * with the same identifiers as proposed.
+ * - To add new parameters, omit their identifier.
+ * - To remove some parameters, omit them in this list.
+ */
+ void set parameters(List<RefactoringMethodParameter> value) {
+ assert(value != null);
+ this._parameters = value;
+ }
/**
* True if all occurrences of the expression or statements should be replaced
* by an invocation of the method. The expression or statements used to
* initiate the refactoring will always be replaced.
*/
- bool extractAll;
+ bool get extractAll => _extractAll;
- ExtractMethodOptions(this.returnType, this.createGetter, this.name, this.parameters, this.extractAll);
+ /**
+ * True if all occurrences of the expression or statements should be replaced
+ * by an invocation of the method. The expression or statements used to
+ * initiate the refactoring will always be replaced.
+ */
+ void set extractAll(bool value) {
+ assert(value != null);
+ this._extractAll = value;
+ }
+
+ ExtractMethodOptions(String returnType, bool createGetter, String name, List<RefactoringMethodParameter> parameters, bool extractAll) {
+ this.returnType = returnType;
+ this.createGetter = createGetter;
+ this.name = name;
+ this.parameters = parameters;
+ this.extractAll = extractAll;
+ }
factory ExtractMethodOptions.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
if (json == null) {
@@ -10890,17 +14140,40 @@
* }
*/
class InlineLocalVariableFeedback extends RefactoringFeedback implements HasToJson {
+ String _name;
+
+ int _occurrences;
+
/**
* The name of the variable being inlined.
*/
- String name;
+ String get name => _name;
+
+ /**
+ * The name of the variable being inlined.
+ */
+ void set name(String value) {
+ assert(value != null);
+ this._name = value;
+ }
/**
* The number of times the variable occurs.
*/
- int occurrences;
+ int get occurrences => _occurrences;
- InlineLocalVariableFeedback(this.name, this.occurrences);
+ /**
+ * The number of times the variable occurs.
+ */
+ void set occurrences(int value) {
+ assert(value != null);
+ this._occurrences = value;
+ }
+
+ InlineLocalVariableFeedback(String name, int occurrences) {
+ this.name = name;
+ this.occurrences = occurrences;
+ }
factory InlineLocalVariableFeedback.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
if (json == null) {
@@ -10980,24 +14253,59 @@
* }
*/
class InlineMethodFeedback extends RefactoringFeedback implements HasToJson {
+ String _className;
+
+ String _methodName;
+
+ bool _isDeclaration;
+
/**
* The name of the class enclosing the method being inlined. If not a class
* member is being inlined, this field will be absent.
*/
- String className;
+ String get className => _className;
+
+ /**
+ * The name of the class enclosing the method being inlined. If not a class
+ * member is being inlined, this field will be absent.
+ */
+ void set className(String value) {
+ this._className = value;
+ }
/**
* The name of the method (or function) being inlined.
*/
- String methodName;
+ String get methodName => _methodName;
+
+ /**
+ * The name of the method (or function) being inlined.
+ */
+ void set methodName(String value) {
+ assert(value != null);
+ this._methodName = value;
+ }
/**
* True if the declaration of the method is selected. So all references
* should be inlined.
*/
- bool isDeclaration;
+ bool get isDeclaration => _isDeclaration;
- InlineMethodFeedback(this.methodName, this.isDeclaration, {this.className});
+ /**
+ * True if the declaration of the method is selected. So all references
+ * should be inlined.
+ */
+ void set isDeclaration(bool value) {
+ assert(value != null);
+ this._isDeclaration = value;
+ }
+
+ InlineMethodFeedback(String methodName, bool isDeclaration, {String className}) {
+ this.className = className;
+ this.methodName = methodName;
+ this.isDeclaration = isDeclaration;
+ }
factory InlineMethodFeedback.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
if (json == null) {
@@ -11068,19 +14376,44 @@
* }
*/
class InlineMethodOptions extends RefactoringOptions implements HasToJson {
+ bool _deleteSource;
+
+ bool _inlineAll;
+
/**
* True if the method being inlined should be removed. It is an error if this
* field is true and inlineAll is false.
*/
- bool deleteSource;
+ bool get deleteSource => _deleteSource;
+
+ /**
+ * True if the method being inlined should be removed. It is an error if this
+ * field is true and inlineAll is false.
+ */
+ void set deleteSource(bool value) {
+ assert(value != null);
+ this._deleteSource = value;
+ }
/**
* True if all invocations of the method should be inlined, or false if only
* the invocation site used to create this refactoring should be inlined.
*/
- bool inlineAll;
+ bool get inlineAll => _inlineAll;
- InlineMethodOptions(this.deleteSource, this.inlineAll);
+ /**
+ * True if all invocations of the method should be inlined, or false if only
+ * the invocation site used to create this refactoring should be inlined.
+ */
+ void set inlineAll(bool value) {
+ assert(value != null);
+ this._inlineAll = value;
+ }
+
+ InlineMethodOptions(bool deleteSource, bool inlineAll) {
+ this.deleteSource = deleteSource;
+ this.inlineAll = inlineAll;
+ }
factory InlineMethodOptions.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
if (json == null) {
@@ -11163,12 +14496,24 @@
* }
*/
class MoveFileOptions extends RefactoringOptions implements HasToJson {
+ String _newFile;
+
/**
* The new file path to which the given file is being moved.
*/
- String newFile;
+ String get newFile => _newFile;
- MoveFileOptions(this.newFile);
+ /**
+ * The new file path to which the given file is being moved.
+ */
+ void set newFile(String value) {
+ assert(value != null);
+ this._newFile = value;
+ }
+
+ MoveFileOptions(String newFile) {
+ this.newFile = newFile;
+ }
factory MoveFileOptions.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
if (json == null) {
@@ -11228,28 +14573,74 @@
* }
*/
class RenameFeedback extends RefactoringFeedback implements HasToJson {
+ int _offset;
+
+ int _length;
+
+ String _elementKindName;
+
+ String _oldName;
+
/**
* The offset to the beginning of the name selected to be renamed.
*/
- int offset;
+ int get offset => _offset;
+
+ /**
+ * The offset to the beginning of the name selected to be renamed.
+ */
+ void set offset(int value) {
+ assert(value != null);
+ this._offset = value;
+ }
/**
* The length of the name selected to be renamed.
*/
- int length;
+ int get length => _length;
+
+ /**
+ * The length of the name selected to be renamed.
+ */
+ void set length(int value) {
+ assert(value != null);
+ this._length = value;
+ }
/**
* The human-readable description of the kind of element being renamed (such
* as “class” or “function type alias”).
*/
- String elementKindName;
+ String get elementKindName => _elementKindName;
+
+ /**
+ * The human-readable description of the kind of element being renamed (such
+ * as “class” or “function type alias”).
+ */
+ void set elementKindName(String value) {
+ assert(value != null);
+ this._elementKindName = value;
+ }
/**
* The old name of the element before the refactoring.
*/
- String oldName;
+ String get oldName => _oldName;
- RenameFeedback(this.offset, this.length, this.elementKindName, this.oldName);
+ /**
+ * The old name of the element before the refactoring.
+ */
+ void set oldName(String value) {
+ assert(value != null);
+ this._oldName = value;
+ }
+
+ RenameFeedback(int offset, int length, String elementKindName, String oldName) {
+ this.offset = offset;
+ this.length = length;
+ this.elementKindName = elementKindName;
+ this.oldName = oldName;
+ }
factory RenameFeedback.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
if (json == null) {
@@ -11328,12 +14719,24 @@
* }
*/
class RenameOptions extends RefactoringOptions implements HasToJson {
+ String _newName;
+
/**
* The name that the element should have after the refactoring.
*/
- String newName;
+ String get newName => _newName;
- RenameOptions(this.newName);
+ /**
+ * The name that the element should have after the refactoring.
+ */
+ void set newName(String value) {
+ assert(value != null);
+ this._newName = value;
+ }
+
+ RenameOptions(String newName) {
+ this.newName = newName;
+ }
factory RenameOptions.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
if (json == null) {
diff --git a/pkg/analysis_server/lib/src/get_handler.dart b/pkg/analysis_server/lib/src/get_handler.dart
index 14d18cd..776f38a 100644
--- a/pkg/analysis_server/lib/src/get_handler.dart
+++ b/pkg/analysis_server/lib/src/get_handler.dart
@@ -10,7 +10,6 @@
import 'dart:io';
import 'dart:math';
-import 'package:analyzer/plugin/plugin.dart';
import 'package:analysis_server/src/analysis_server.dart';
import 'package:analysis_server/src/domain_completion.dart';
import 'package:analysis_server/src/domain_execution.dart';
@@ -31,8 +30,7 @@
import 'package:analyzer/src/generated/java_engine.dart';
import 'package:analyzer/src/generated/source.dart';
import 'package:analyzer/src/generated/utilities_general.dart';
-
-import 'analysis_server.dart';
+import 'package:plugin/plugin.dart';
/**
* A function that can be used to generate HTML output into the given [buffer].
diff --git a/pkg/analysis_server/lib/src/plugin/server_plugin.dart b/pkg/analysis_server/lib/src/plugin/server_plugin.dart
index b74fb7f..6aed910 100644
--- a/pkg/analysis_server/lib/src/plugin/server_plugin.dart
+++ b/pkg/analysis_server/lib/src/plugin/server_plugin.dart
@@ -4,6 +4,13 @@
library analysis_server.src.plugin.server_plugin;
+import 'package:analysis_server/analysis/index/index_core.dart';
+import 'package:analysis_server/completion/completion_core.dart';
+import 'package:analysis_server/edit/assist/assist_core.dart';
+import 'package:analysis_server/edit/fix/fix_core.dart';
+import 'package:analysis_server/plugin/assist.dart';
+//import 'package:analysis_server/plugin/completion.dart';
+import 'package:analysis_server/plugin/fix.dart';
import 'package:analysis_server/src/analysis_server.dart';
import 'package:analysis_server/src/domain_analysis.dart';
import 'package:analysis_server/src/domain_completion.dart';
@@ -12,7 +19,9 @@
import 'package:analysis_server/src/edit/edit_domain.dart';
import 'package:analysis_server/src/protocol.dart';
import 'package:analysis_server/src/search/search_domain.dart';
-import 'package:analyzer/plugin/plugin.dart';
+import 'package:analysis_server/src/services/correction/assist_internal.dart';
+import 'package:analysis_server/src/services/correction/fix_internal.dart';
+import 'package:plugin/plugin.dart';
/**
* A function that will create a request handler that can be used by the given
@@ -27,26 +36,102 @@
class ServerPlugin implements Plugin {
/**
* The simple identifier of the extension point that allows plugins to
+ * register new assist contributors with the server.
+ */
+ static const String ASSIST_CONTRIBUTOR_EXTENSION_POINT = 'assistContributor';
+
+ /**
+ * The simple identifier of the extension point that allows plugins to
+ * register new completion contributors with the server.
+ */
+ static const String COMPLETION_CONTRIBUTOR_EXTENSION_POINT =
+ 'completionContributor';
+
+ /**
+ * The simple identifier of the extension point that allows plugins to
* register new domains with the server.
*/
static const String DOMAIN_EXTENSION_POINT = 'domain';
/**
+ * The simple identifier of the extension point that allows plugins to
+ * register new fix contributors with the server.
+ */
+ static const String FIX_CONTRIBUTOR_EXTENSION_POINT = 'fixContributor';
+
+ /**
+ * The simple identifier of the extension point that allows plugins to
+ * register new index contributors with the server.
+ */
+ static const String INDEX_CONTRIBUTOR_EXTENSION_POINT = 'indexContributor';
+
+ /**
* The unique identifier of this plugin.
*/
static const String UNIQUE_IDENTIFIER = 'analysis_server.core';
/**
+ * The extension point that allows plugins to register new assist contributors
+ * with the server.
+ */
+ ExtensionPoint assistContributorExtensionPoint;
+
+ /**
+ * The extension point that allows plugins to register new completion
+ * contributors with the server.
+ */
+ ExtensionPoint completionContributorExtensionPoint;
+
+ /**
* The extension point that allows plugins to register new domains with the
* server.
*/
ExtensionPoint domainExtensionPoint;
/**
+ * The extension point that allows plugins to register new fix contributors
+ * with the server.
+ */
+ ExtensionPoint fixContributorExtensionPoint;
+
+ /**
+ * The extension point that allows plugins to register new index contributors
+ * with the server.
+ */
+ ExtensionPoint indexContributorExtensionPoint;
+
+ /**
* Initialize a newly created plugin.
*/
ServerPlugin();
+ /**
+ * Return a list containing all of the assist contributors that were
+ * contributed.
+ */
+ List<AssistContributor> get assistContributors =>
+ assistContributorExtensionPoint.extensions;
+
+ /**
+ * Return a list containing all of the completion contributors that were
+ * contributed.
+ */
+ List<CompletionContributor> get completionContributors =>
+ completionContributorExtensionPoint.extensions;
+
+ /**
+ * Return a list containing all of the fix contributors that were contributed.
+ */
+ List<FixContributor> get fixContributors =>
+ fixContributorExtensionPoint.extensions;
+
+ /**
+ * Return a list containing all of the index contributors that were
+ * contributed.
+ */
+ List<IndexContributor> get indexContributor =>
+ indexContributorExtensionPoint.extensions;
+
@override
String get uniqueIdentifier => UNIQUE_IDENTIFIER;
@@ -65,25 +150,82 @@
@override
void registerExtensionPoints(RegisterExtensionPoint registerExtensionPoint) {
+ assistContributorExtensionPoint = registerExtensionPoint(
+ ASSIST_CONTRIBUTOR_EXTENSION_POINT,
+ _validateAssistContributorExtension);
+ completionContributorExtensionPoint = registerExtensionPoint(
+ COMPLETION_CONTRIBUTOR_EXTENSION_POINT,
+ _validateCompletionContributorExtension);
domainExtensionPoint = registerExtensionPoint(
DOMAIN_EXTENSION_POINT, _validateDomainExtension);
+ fixContributorExtensionPoint = registerExtensionPoint(
+ FIX_CONTRIBUTOR_EXTENSION_POINT, _validateFixContributorExtension);
+ indexContributorExtensionPoint = registerExtensionPoint(
+ INDEX_CONTRIBUTOR_EXTENSION_POINT, _validateIndexContributorExtension);
}
@override
void registerExtensions(RegisterExtension registerExtension) {
+ //
+ // Register assist contributors.
+ //
+ registerExtension(
+ ASSIST_CONTRIBUTOR_EXTENSION_POINT_ID, new DefaultAssistContributor());
+ //
+ // Register completion contributors.
+ //
+ // TODO(brianwilkerson) Register the completion contributors.
+// registerExtension(COMPLETION_CONTRIBUTOR_EXTENSION_POINT_ID, ???);
+ //
+ // Register domains.
+ //
String domainId = Plugin.join(UNIQUE_IDENTIFIER, DOMAIN_EXTENSION_POINT);
registerExtension(
domainId, (AnalysisServer server) => new ServerDomainHandler(server));
registerExtension(
domainId, (AnalysisServer server) => new AnalysisDomainHandler(server));
- registerExtension(
- domainId, (AnalysisServer server) => new EditDomainHandler(server));
+ registerExtension(domainId,
+ (AnalysisServer server) => new EditDomainHandler(server, this));
registerExtension(
domainId, (AnalysisServer server) => new SearchDomainHandler(server));
registerExtension(domainId,
(AnalysisServer server) => new CompletionDomainHandler(server));
registerExtension(domainId,
(AnalysisServer server) => new ExecutionDomainHandler(server));
+ //
+ // Register fix contributors.
+ //
+ registerExtension(
+ FIX_CONTRIBUTOR_EXTENSION_POINT_ID, new DefaultFixContributor());
+ //
+ // Register index contributors.
+ //
+ // TODO(brianwilkerson) Register the index contributors.
+// registerExtension(INDEX_CONTRIBUTOR_EXTENSION_POINT, ???);
+ }
+
+ /**
+ * Validate the given extension by throwing an [ExtensionError] if it is not a
+ * valid assist contributor.
+ */
+ void _validateAssistContributorExtension(Object extension) {
+ if (extension is! AssistContributor) {
+ String id = assistContributorExtensionPoint.uniqueIdentifier;
+ throw new ExtensionError(
+ 'Extensions to $id must be an AssistContributor');
+ }
+ }
+
+ /**
+ * Validate the given extension by throwing an [ExtensionError] if it is not a
+ * valid completion contributor.
+ */
+ void _validateCompletionContributorExtension(Object extension) {
+ if (extension is! CompletionContributor) {
+ String id = completionContributorExtensionPoint.uniqueIdentifier;
+ throw new ExtensionError(
+ 'Extensions to $id must be an CompletionContributor');
+ }
}
/**
@@ -97,4 +239,26 @@
'Extensions to $id must be a RequestHandlerFactory');
}
}
+
+ /**
+ * Validate the given extension by throwing an [ExtensionError] if it is not a
+ * valid fix contributor.
+ */
+ void _validateFixContributorExtension(Object extension) {
+ if (extension is! FixContributor) {
+ String id = fixContributorExtensionPoint.uniqueIdentifier;
+ throw new ExtensionError('Extensions to $id must be a FixContributor');
+ }
+ }
+
+ /**
+ * Validate the given extension by throwing an [ExtensionError] if it is not a
+ * valid index contributor.
+ */
+ void _validateIndexContributorExtension(Object extension) {
+ if (extension is! IndexContributor) {
+ String id = indexContributorExtensionPoint.uniqueIdentifier;
+ throw new ExtensionError('Extensions to $id must be an IndexContributor');
+ }
+ }
}
diff --git a/pkg/analysis_server/lib/src/protocol.dart b/pkg/analysis_server/lib/src/protocol.dart
index bdc8608..a0854aa 100644
--- a/pkg/analysis_server/lib/src/protocol.dart
+++ b/pkg/analysis_server/lib/src/protocol.dart
@@ -690,14 +690,22 @@
: _result = result;
/**
- * Initialize a newly created instance to represent the
- * FORMAT_INVALID_FILE error condition.
+ * Initialize a newly created instance to represent the FORMAT_INVALID_FILE
+ * error condition.
*/
Response.formatInvalidFile(Request request) : this(request.id,
error: new RequestError(RequestErrorCode.FORMAT_INVALID_FILE,
'Error during `edit.format`: invalid file.'));
/**
+ * Initialize a newly created instance to represent the FORMAT_WITH_ERROR
+ * error condition.
+ */
+ Response.formatWithErrors(Request request) : this(request.id,
+ error: new RequestError(RequestErrorCode.FORMAT_WITH_ERRORS,
+ 'Error during `edit.format`: source contains syntax errors.'));
+
+ /**
* Initialize a newly created instance based upon the given JSON data
*/
factory Response.fromJson(Map<String, Object> json) {
diff --git a/pkg/analysis_server/lib/src/server/driver.dart b/pkg/analysis_server/lib/src/server/driver.dart
index bc7c17b..0c1f9db9b 100644
--- a/pkg/analysis_server/lib/src/server/driver.dart
+++ b/pkg/analysis_server/lib/src/server/driver.dart
@@ -17,15 +17,14 @@
import 'package:analyzer/file_system/physical_file_system.dart';
import 'package:analyzer/instrumentation/file_instrumentation.dart';
import 'package:analyzer/instrumentation/instrumentation.dart';
-import 'package:analyzer/options.dart';
-import 'package:analyzer/plugin/plugin.dart';
import 'package:analyzer/src/generated/engine.dart';
import 'package:analyzer/src/generated/incremental_logger.dart';
import 'package:analyzer/src/generated/java_io.dart';
import 'package:analyzer/src/generated/sdk.dart';
import 'package:analyzer/src/generated/sdk_io.dart';
-import 'package:analyzer/src/plugin/plugin_impl.dart';
import 'package:args/args.dart';
+import 'package:plugin/manager.dart';
+import 'package:plugin/plugin.dart';
/**
* Initializes incremental logger.
@@ -52,6 +51,130 @@
}
}
+/// Commandline argument parser. (Copied from analyzer/lib/options.dart)
+/// TODO(pquitslund): replaces with a simple [ArgParser] instance
+/// when the args package supports ignoring unrecognized
+/// options/flags (https://github.com/dart-lang/args/issues/9).
+class CommandLineParser {
+ final List<String> _knownFlags;
+ final bool _alwaysIgnoreUnrecognized;
+ final ArgParser _parser;
+
+ /// Creates a new command line parser
+ CommandLineParser({bool alwaysIgnoreUnrecognized: false})
+ : _knownFlags = <String>[],
+ _alwaysIgnoreUnrecognized = alwaysIgnoreUnrecognized,
+ _parser = new ArgParser(allowTrailingOptions: true);
+
+ ArgParser get parser => _parser;
+
+ /// Defines a flag.
+ /// See [ArgParser.addFlag()].
+ void addFlag(String name, {String abbr, String help, bool defaultsTo: false,
+ bool negatable: true, void callback(bool value), bool hide: false}) {
+ _knownFlags.add(name);
+ _parser.addFlag(name,
+ abbr: abbr,
+ help: help,
+ defaultsTo: defaultsTo,
+ negatable: negatable,
+ callback: callback,
+ hide: hide);
+ }
+
+ /// Defines a value-taking option.
+ /// See [ArgParser.addOption()].
+ void addOption(String name, {String abbr, String help, List<String> allowed,
+ Map<String, String> allowedHelp, String defaultsTo, void callback(value),
+ bool allowMultiple: false}) {
+ _knownFlags.add(name);
+ _parser.addOption(name,
+ abbr: abbr,
+ help: help,
+ allowed: allowed,
+ allowedHelp: allowedHelp,
+ defaultsTo: defaultsTo,
+ callback: callback,
+ allowMultiple: allowMultiple);
+ }
+
+ /// Generates a string displaying usage information for the defined options.
+ /// See [ArgParser.usage].
+ String getUsage() => _parser.usage;
+
+ /// Parses [args], a list of command-line arguments, matches them against the
+ /// flags and options defined by this parser, and returns the result. The
+ /// values of any defined variables are captured in the given map.
+ /// See [ArgParser].
+ ArgResults parse(
+ List<String> args, Map<String, String> definedVariables) => _parser
+ .parse(_filterUnknowns(parseDefinedVariables(args, definedVariables)));
+
+ List<String> parseDefinedVariables(
+ List<String> args, Map<String, String> definedVariables) {
+ int count = args.length;
+ List<String> remainingArgs = <String>[];
+ for (int i = 0; i < count; i++) {
+ String arg = args[i];
+ if (arg == '--') {
+ while (i < count) {
+ remainingArgs.add(args[i++]);
+ }
+ } else if (arg.startsWith("-D")) {
+ definedVariables[arg.substring(2)] = args[++i];
+ } else {
+ remainingArgs.add(arg);
+ }
+ }
+ return remainingArgs;
+ }
+
+ List<String> _filterUnknowns(List<String> args) {
+
+ // Only filter args if the ignore flag is specified, or if
+ // _alwaysIgnoreUnrecognized was set to true
+ if (_alwaysIgnoreUnrecognized ||
+ args.contains('--ignore-unrecognized-flags')) {
+
+ // Filter all unrecognized flags and options.
+ List<String> filtered = <String>[];
+ for (int i = 0; i < args.length; ++i) {
+ String arg = args[i];
+ if (arg.startsWith('--') && arg.length > 2) {
+ String option = arg.substring(2);
+ // strip the last '=value'
+ int equalsOffset = option.lastIndexOf('=');
+ if (equalsOffset != -1) {
+ option = option.substring(0, equalsOffset);
+ }
+ // check the option
+ if (!_knownFlags.contains(option)) {
+ //"eat" params by advancing to the next flag/option
+ i = _getNextFlagIndex(args, i);
+ } else {
+ filtered.add(arg);
+ }
+ } else {
+ filtered.add(arg);
+ }
+ }
+
+ return filtered;
+ } else {
+ return args;
+ }
+ }
+
+ _getNextFlagIndex(args, i) {
+ for (; i < args.length; ++i) {
+ if (args[i].startsWith('--')) {
+ return i;
+ }
+ }
+ return i;
+ }
+}
+
/**
* The [Driver] class represents a single running instance of the analysis
* server application. It is responsible for parsing command line options
@@ -81,6 +204,26 @@
"enable-incremental-resolution-api";
/**
+ * The name of the option used to enable instrumentation.
+ */
+ static const String ENABLE_INSTRUMENTATION_OPTION = "enable-instrumentation";
+
+ /**
+ * The name of the option used to enable the use of the new task model.
+ */
+ static const String ENABLE_NEW_TASK_MODEL = "enable-new-task-model";
+
+ /**
+ * The name of the option used to set the file read mode.
+ */
+ static const String FILE_READ_MODE = "file-read-mode";
+
+ /**
+ * The name of the option used to print usage information.
+ */
+ static const String HELP_OPTION = "help";
+
+ /**
* The name of the option used to describe the incremental resolution logger.
*/
static const String INCREMENTAL_RESOLUTION_LOG = "incremental-resolution-log";
@@ -99,14 +242,10 @@
static const String INSTRUMENTATION_LOG_FILE = "instrumentation-log-file";
/**
- * The name of the option used to enable instrumentation.
+ * The name of the option used to specify if [print] should print to the
+ * console instead of being intercepted.
*/
- static const String ENABLE_INSTRUMENTATION_OPTION = "enable-instrumentation";
-
- /**
- * The name of the option used to print usage information.
- */
- static const String HELP_OPTION = "help";
+ static const String INTERNAL_DELAY_FREQUENCY = 'internal-delay-frequency';
/**
* The name of the option used to specify if [print] should print to the
@@ -115,10 +254,14 @@
static const String INTERNAL_PRINT_TO_CONSOLE = "internal-print-to-console";
/**
- * The name of the option used to specify if [print] should print to the
- * console instead of being intercepted.
+ * The name of the flag used to disable error notifications.
*/
- static const String INTERNAL_DELAY_FREQUENCY = 'internal-delay-frequency';
+ static const String NO_ERROR_NOTIFICATION = "no-error-notification";
+
+ /**
+ * The name of the flag used to disable the index.
+ */
+ static const String NO_INDEX = "no-index";
/**
* The option for specifying the http diagnostic port.
@@ -135,21 +278,6 @@
static const String SDK_OPTION = "sdk";
/**
- * The name of the flag used to disable error notifications.
- */
- static const String NO_ERROR_NOTIFICATION = "no-error-notification";
-
- /**
- * The name of the flag used to disable the index.
- */
- static const String NO_INDEX = "no-index";
-
- /**
- * The name of the option used to set the file read mode.
- */
- static const String FILE_READ_MODE = "file-read-mode";
-
- /**
* The instrumentation server that is to be used by the analysis server.
*/
InstrumentationServer instrumentationServer;
@@ -185,24 +313,6 @@
return;
}
- // TODO(brianwilkerson) Enable this after it is possible for an
- // instrumentation server to be provided.
-// if (results[ENABLE_INSTRUMENTATION_OPTION]) {
-// if (instrumentationServer == null) {
-// print('Exiting server: enabled instrumentation without providing an instrumentation server');
-// print('');
-// _printUsage(parser);
-// return;
-// }
-// } else {
-// if (instrumentationServer != null) {
-// print('Exiting server: providing an instrumentation server without enabling instrumentation');
-// print('');
-// _printUsage(parser);
-// return;
-// }
-// }
-
// TODO (danrubel) Remove this workaround
// once the underlying VM and dart:io issue has been fixed.
if (results[INTERNAL_DELAY_FREQUENCY] != null) {
@@ -244,7 +354,9 @@
// which will make a guess.
defaultSdk = DirectoryBasedDartSdk.defaultSdk;
}
-
+ //
+ // Initialize the instrumentation service.
+ //
if (instrumentationServer != null) {
String filePath = results[INSTRUMENTATION_LOG_FILE];
if (filePath != null) {
@@ -258,6 +370,12 @@
results[CLIENT_VERSION], AnalysisServer.VERSION, defaultSdk.sdkVersion);
AnalysisEngine.instance.instrumentationService = service;
//
+ // Enable the new task model, if appropriate.
+ //
+ if (results[ENABLE_NEW_TASK_MODEL]) {
+ AnalysisEngine.instance.useTaskModel = true;
+ }
+ //
// Process all of the plugins so that extensions are registered.
//
ServerPlugin serverPlugin = new ServerPlugin();
@@ -267,7 +385,9 @@
plugins.addAll(_userDefinedPlugins);
ExtensionManager manager = new ExtensionManager();
manager.processPlugins(plugins);
-
+ //
+ // Create the sockets and start listening for requests.
+ //
socketServer = new SocketServer(
analysisServerOptions, defaultSdk, service, serverPlugin);
httpServer = new HttpAnalysisServer(socketServer);
@@ -336,6 +456,11 @@
help: "enable sending instrumentation information to a server",
defaultsTo: false,
negatable: false);
+ parser.addFlag(ENABLE_NEW_TASK_MODEL,
+ help: "enable the use of the new task model",
+ defaultsTo: false,
+ hide: true,
+ negatable: false);
parser.addFlag(HELP_OPTION,
help: "print this help message without starting a server",
defaultsTo: false,
diff --git a/pkg/analysis_server/lib/src/services/completion/arglist_contributor.dart b/pkg/analysis_server/lib/src/services/completion/arglist_contributor.dart
index 0dac520..56a6d73 100644
--- a/pkg/analysis_server/lib/src/services/completion/arglist_contributor.dart
+++ b/pkg/analysis_server/lib/src/services/completion/arglist_contributor.dart
@@ -19,7 +19,7 @@
DartCompletionRequest request, List<String> namedArgs, String name) {
if (name != null && name.length > 0 && !namedArgs.contains(name)) {
request.addSuggestion(new CompletionSuggestion(
- CompletionSuggestionKind.NAMED_ARGUMENT, DART_RELEVANCE_PARAMETER,
+ CompletionSuggestionKind.NAMED_ARGUMENT, DART_RELEVANCE_NAMED_PARAMETER,
'$name: ', name.length + 2, 0, false, false));
}
}
diff --git a/pkg/analysis_server/lib/src/services/completion/completion_manager.dart b/pkg/analysis_server/lib/src/services/completion/completion_manager.dart
index 5ed7b1a..5708274 100644
--- a/pkg/analysis_server/lib/src/services/completion/completion_manager.dart
+++ b/pkg/analysis_server/lib/src/services/completion/completion_manager.dart
@@ -6,9 +6,13 @@
import 'dart:async';
+import 'package:analysis_server/completion/completion_core.dart'
+ show CompletionRequest;
+import 'package:analysis_server/src/analysis_server.dart';
import 'package:analysis_server/src/protocol.dart';
import 'package:analysis_server/src/services/completion/dart_completion_manager.dart';
import 'package:analysis_server/src/services/search/search_engine.dart';
+import 'package:analyzer/file_system/file_system.dart';
import 'package:analyzer/src/generated/engine.dart';
import 'package:analyzer/src/generated/source.dart';
@@ -130,10 +134,6 @@
_stopwatch.start();
}
- void setContentsAndOffset(String contents, int offset) {
- snippet = _computeSnippet(contents, offset);
- }
-
int get elapsedInMilliseconds =>
operations.length > 0 ? operations.last.elapsed.inMilliseconds : 0;
@@ -181,6 +181,10 @@
_startTimes[tag] = _stopwatch.elapsed;
}
+ void setContentsAndOffset(String contents, int offset) {
+ snippet = _computeSnippet(contents, offset);
+ }
+
void _logDuration(String tag, Duration elapsed) {
operations.add(new OperationPerformance(tag, elapsed));
}
@@ -217,18 +221,26 @@
/**
* Encapsulates information specific to a particular completion request.
*/
-class CompletionRequest {
+class CompletionRequestImpl implements CompletionRequest {
+
/**
- * The offset within the source at which the completion is requested.
+ * The underlying analysis server for this completion request.
*/
+ final AnalysisServer server;
+
+ @override
+ final AnalysisContext context;
+
+ @override
+ final Source source;
+
+ @override
final int offset;
- /**
- * Performance measurements for this particular request.
- */
- final CompletionPerformance performance;
+ CompletionRequestImpl(this.server, this.context, this.source, this.offset);
- CompletionRequest(this.offset, this.performance);
+ @override
+ ResourceProvider get resourceProvider => server.resourceProvider;
}
/**
diff --git a/pkg/analysis_server/lib/src/services/completion/dart_completion_cache.dart b/pkg/analysis_server/lib/src/services/completion/dart_completion_cache.dart
index d8afca4..67a7245 100644
--- a/pkg/analysis_server/lib/src/services/completion/dart_completion_cache.dart
+++ b/pkg/analysis_server/lib/src/services/completion/dart_completion_cache.dart
@@ -177,17 +177,20 @@
/**
* Add constructor suggestions for the given class.
*/
- void _addConstructorSuggestions(ClassElement classElem, int relevance) {
+ void _addConstructorSuggestions(
+ ClassElement classElem, int relevance, Source importForSource) {
String className = classElem.name;
for (ConstructorElement constructor in classElem.constructors) {
if (!constructor.isPrivate) {
- CompletionSuggestion suggestion =
- createSuggestion(constructor, relevance: relevance);
- String name = suggestion.completion;
- name = name.length > 0 ? '$className.$name' : className;
- suggestion.completion = name;
- suggestion.selectionOffset = suggestion.completion.length;
- importedConstructorSuggestions.add(suggestion);
+ CompletionSuggestion suggestion = createSuggestion(constructor,
+ relevance: relevance, importForSource: importForSource);
+ if (suggestion != null) {
+ String name = suggestion.completion;
+ name = name.length > 0 ? '$className.$name' : className;
+ suggestion.completion = name;
+ suggestion.selectionOffset = suggestion.completion.length;
+ importedConstructorSuggestions.add(suggestion);
+ }
}
}
}
@@ -299,7 +302,7 @@
element.isPublic &&
!excludedLibs.contains(element.library) &&
!_importedCompletions.contains(element.displayName)) {
- _addSuggestion(element, DART_RELEVANCE_LOW);
+ _addSuggestion(element, DART_RELEVANCE_LOW, importForSource: source);
}
}
});
@@ -308,7 +311,8 @@
/**
* Add a suggestion for the given element.
*/
- void _addSuggestion(Element element, int relevance) {
+ void _addSuggestion(Element element, int relevance,
+ {Source importForSource}) {
if (element is ExecutableElement) {
// Do not suggest operators or local functions
if (element.isOperator) {
@@ -321,25 +325,27 @@
}
}
- CompletionSuggestion suggestion =
- createSuggestion(element, relevance: relevance);
+ CompletionSuggestion suggestion = createSuggestion(element,
+ relevance: relevance, importForSource: importForSource);
- if (element is ExecutableElement) {
- DartType returnType = element.returnType;
- if (returnType != null && returnType.isVoid) {
- importedVoidReturnSuggestions.add(suggestion);
+ if (suggestion != null) {
+ if (element is ExecutableElement) {
+ DartType returnType = element.returnType;
+ if (returnType != null && returnType.isVoid) {
+ importedVoidReturnSuggestions.add(suggestion);
+ } else {
+ otherImportedSuggestions.add(suggestion);
+ }
+ } else if (element is FunctionTypeAliasElement) {
+ importedTypeSuggestions.add(suggestion);
+ } else if (element is ClassElement) {
+ importedTypeSuggestions.add(suggestion);
+ _addConstructorSuggestions(element, relevance, importForSource);
} else {
otherImportedSuggestions.add(suggestion);
}
- } else if (element is FunctionTypeAliasElement) {
- importedTypeSuggestions.add(suggestion);
- } else if (element is ClassElement) {
- importedTypeSuggestions.add(suggestion);
- _addConstructorSuggestions(element, relevance);
- } else {
- otherImportedSuggestions.add(suggestion);
+ _importedCompletions.add(suggestion.completion);
}
- _importedCompletions.add(suggestion.completion);
}
/**
diff --git a/pkg/analysis_server/lib/src/services/completion/dart_completion_manager.dart b/pkg/analysis_server/lib/src/services/completion/dart_completion_manager.dart
index c1b0339..88b78a4 100644
--- a/pkg/analysis_server/lib/src/services/completion/dart_completion_manager.dart
+++ b/pkg/analysis_server/lib/src/services/completion/dart_completion_manager.dart
@@ -6,6 +6,9 @@
import 'dart:async';
+import 'package:analysis_server/completion/completion_core.dart'
+ show CompletionRequest;
+import 'package:analysis_server/src/analysis_server.dart';
import 'package:analysis_server/src/protocol.dart';
import 'package:analysis_server/src/services/completion/arglist_contributor.dart';
import 'package:analysis_server/src/services/completion/combinator_contributor.dart';
@@ -13,11 +16,12 @@
import 'package:analysis_server/src/services/completion/completion_manager.dart';
import 'package:analysis_server/src/services/completion/completion_target.dart';
import 'package:analysis_server/src/services/completion/dart_completion_cache.dart';
+import 'package:analysis_server/src/services/completion/import_uri_contributor.dart';
import 'package:analysis_server/src/services/completion/imported_reference_contributor.dart';
-import 'package:analysis_server/src/services/completion/prefixed_element_contributor.dart';
import 'package:analysis_server/src/services/completion/keyword_contributor.dart';
import 'package:analysis_server/src/services/completion/local_reference_contributor.dart';
import 'package:analysis_server/src/services/completion/optype.dart';
+import 'package:analysis_server/src/services/completion/prefixed_element_contributor.dart';
import 'package:analysis_server/src/services/search/search_engine.dart';
import 'package:analyzer/src/generated/ast.dart';
import 'package:analyzer/src/generated/engine.dart';
@@ -39,6 +43,7 @@
const int DART_RELEVANCE_LOCAL_VARIABLE = 1059;
const int DART_RELEVANCE_LOW = 500;
const int DART_RELEVANCE_PARAMETER = 1059;
+const int DART_RELEVANCE_NAMED_PARAMETER = 1060;
/**
* The base class for contributing code completion suggestions.
@@ -86,7 +91,8 @@
new KeywordContributor(),
new ArgListContributor(),
new CombinatorContributor(),
- new PrefixedElementContributor()
+ new PrefixedElementContributor(),
+ new ImportUriContributor(),
];
}
if (commonUsageComputer == null) {
@@ -119,8 +125,9 @@
* then send an initial response to the client.
* Return a list of contributors for which [computeFull] should be called
*/
- List<DartCompletionContributor> computeFast(DartCompletionRequest request) {
- return request.performance.logElapseTime('computeFast', () {
+ List<DartCompletionContributor> computeFast(
+ DartCompletionRequest request, CompletionPerformance performance) {
+ return performance.logElapseTime('computeFast', () {
CompilationUnit unit = context.parseCompilationUnit(source);
request.unit = unit;
request.target = new CompletionTarget.forOffset(unit, request.offset);
@@ -143,8 +150,7 @@
List<DartCompletionContributor> todo = new List.from(contributors);
todo.removeWhere((DartCompletionContributor c) {
- return request.performance.logElapseTime('computeFast ${c.runtimeType}',
- () {
+ return performance.logElapseTime('computeFast ${c.runtimeType}', () {
return c.computeFast(request);
});
});
@@ -159,19 +165,19 @@
* resolved and request that each remaining contributor finish their work.
* Return a [Future] that completes when the last notification has been sent.
*/
- Future computeFull(
- DartCompletionRequest request, List<DartCompletionContributor> todo) {
- request.performance.logStartTime('waitForAnalysis');
+ Future computeFull(DartCompletionRequest request,
+ CompletionPerformance performance, List<DartCompletionContributor> todo) {
+ performance.logStartTime('waitForAnalysis');
return waitForAnalysis().then((CompilationUnit unit) {
if (controller.isClosed) {
return;
}
- request.performance.logElapseTime('waitForAnalysis');
+ performance.logElapseTime('waitForAnalysis');
if (unit == null) {
sendResults(request, true);
return;
}
- request.performance.logElapseTime('computeFull', () {
+ performance.logElapseTime('computeFull', () {
request.unit = unit;
// TODO(paulberry): Do we need to invoke _ReplacementOffsetBuilder
// again?
@@ -180,10 +186,10 @@
todo.forEach((DartCompletionContributor c) {
String name = c.runtimeType.toString();
String completeTag = 'computeFull $name complete';
- request.performance.logStartTime(completeTag);
- request.performance.logElapseTime('computeFull $name', () {
+ performance.logStartTime(completeTag);
+ performance.logElapseTime('computeFull $name', () {
c.computeFull(request).then((bool changed) {
- request.performance.logElapseTime(completeTag);
+ performance.logElapseTime(completeTag);
bool last = --count == 0;
if (changed || last) {
commonUsageComputer.computeFull(request);
@@ -198,13 +204,13 @@
@override
void computeSuggestions(CompletionRequest completionRequest) {
- DartCompletionRequest request = new DartCompletionRequest(context,
- searchEngine, source, completionRequest.offset, cache,
- completionRequest.performance);
- request.performance.logElapseTime('compute', () {
- List<DartCompletionContributor> todo = computeFast(request);
+ DartCompletionRequest request =
+ new DartCompletionRequest.from(completionRequest, cache);
+ CompletionPerformance performance = new CompletionPerformance();
+ performance.logElapseTime('compute', () {
+ List<DartCompletionContributor> todo = computeFast(request, performance);
if (!todo.isEmpty) {
- computeFull(request, todo);
+ computeFull(request, performance, todo);
}
});
}
@@ -249,22 +255,7 @@
/**
* The context in which the completion is requested.
*/
-class DartCompletionRequest extends CompletionRequest {
- /**
- * The analysis context in which the completion is requested.
- */
- final AnalysisContext context;
-
- /**
- * The search engine for use when building suggestions.
- */
- final SearchEngine searchEngine;
-
- /**
- * The source in which the completion is requested.
- */
- final Source source;
-
+class DartCompletionRequest extends CompletionRequestImpl {
/**
* Cached information from a prior code completion operation.
*/
@@ -314,9 +305,13 @@
*/
final Set<String> _completions = new Set<String>();
- DartCompletionRequest(this.context, this.searchEngine, this.source,
- int offset, this.cache, CompletionPerformance performance)
- : super(offset, performance);
+ DartCompletionRequest(AnalysisServer server, AnalysisContext context,
+ Source source, int offset, this.cache)
+ : super(server, context, source, offset);
+
+ factory DartCompletionRequest.from(CompletionRequestImpl request,
+ DartCompletionCache cache) => new DartCompletionRequest(
+ request.server, request.context, request.source, request.offset, cache);
/**
* Return the original text from the [replacementOffset] to the [offset]
@@ -339,6 +334,11 @@
}
/**
+ * The search engine for use when building suggestions.
+ */
+ SearchEngine get searchEngine => server.searchEngine;
+
+ /**
* The list of suggestions to be sent to the client.
*/
Iterable<CompletionSuggestion> get suggestions => _suggestions;
diff --git a/pkg/analysis_server/lib/src/services/completion/import_uri_contributor.dart b/pkg/analysis_server/lib/src/services/completion/import_uri_contributor.dart
new file mode 100644
index 0000000..8551852
--- /dev/null
+++ b/pkg/analysis_server/lib/src/services/completion/import_uri_contributor.dart
@@ -0,0 +1,166 @@
+// Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+library services.completion.contributor.dart.importuri;
+
+import 'dart:async';
+import 'dart:collection';
+
+import 'package:analysis_server/src/services/completion/dart_completion_manager.dart';
+import 'package:analyzer/file_system/file_system.dart';
+import 'package:analyzer/src/generated/ast.dart';
+import 'package:analyzer/src/generated/sdk.dart';
+import 'package:analyzer/src/generated/source.dart';
+import 'package:path/path.dart';
+
+import '../../protocol_server.dart'
+ show CompletionSuggestion, CompletionSuggestionKind;
+
+/**
+ * A contributor for calculating uri suggestions
+ * for import and part directives.
+ */
+class ImportUriContributor extends DartCompletionContributor {
+ _ImportUriSuggestionBuilder builder;
+
+ @override
+ bool computeFast(DartCompletionRequest request) {
+ builder = new _ImportUriSuggestionBuilder(request);
+ return builder.computeFast(request.target.containingNode);
+ }
+
+ @override
+ Future<bool> computeFull(DartCompletionRequest request) {
+ return new Future.value(false);
+ }
+}
+
+class _ImportUriSuggestionBuilder extends SimpleAstVisitor {
+ final DartCompletionRequest request;
+ HashSet<String> _importedUris;
+
+ _ImportUriSuggestionBuilder(this.request);
+
+ bool computeFast(AstNode node) {
+ node.accept(this);
+ return true;
+ }
+
+ @override
+ visitSimpleStringLiteral(SimpleStringLiteral node) {
+ AstNode parent = node.parent;
+ if (parent is ImportDirective && parent.uri == node) {
+ String partial = node.literal.lexeme.substring(
+ node.contentsOffset - node.offset, request.offset - node.offset);
+ _computeImportedUris();
+ request.replacementOffset = node.contentsOffset;
+ request.replacementLength = node.contentsEnd - node.contentsOffset;
+ _addDartSuggestions();
+ _addPackageSuggestions(partial);
+ _addFileSuggestions(partial);
+ } else if (parent is PartDirective && parent.uri == node) {
+ String partial = node.literal.lexeme.substring(
+ node.contentsOffset - node.offset, request.offset - node.offset);
+ _computeImportedUris();
+ request.replacementOffset = node.contentsOffset;
+ request.replacementLength = node.contentsEnd - node.contentsOffset;
+ _addFileSuggestions(partial);
+ }
+ }
+
+ void _addDartSuggestions() {
+ _addSuggestion('dart:');
+ SourceFactory factory = request.context.sourceFactory;
+ for (SdkLibrary lib in factory.dartSdk.sdkLibraries) {
+ if (!lib.isInternal && !lib.isImplementation) {
+ if (!lib.shortName.startsWith('dart:_')) {
+ _addSuggestion(lib.shortName);
+ }
+ }
+ }
+ }
+
+ void _addFileSuggestions(String partial) {
+ Source source = request.source;
+ String sourceFullName = source.fullName;
+ String sourceShortName = source.shortName;
+ String dirPath = (partial.endsWith('/') || partial.endsWith(separator))
+ ? partial
+ : dirname(partial);
+ String prefix = dirPath == '.' ? '' : dirPath;
+ if (isRelative(dirPath)) {
+ String sourceDir = dirname(sourceFullName);
+ if (isAbsolute(sourceDir)) {
+ dirPath = join(sourceDir, dirPath);
+ } else {
+ return;
+ }
+ }
+ Resource dir = request.resourceProvider.getResource(dirPath);
+ if (dir is Folder) {
+ for (Resource child in dir.getChildren()) {
+ String completion;
+ if (child is Folder) {
+ completion = '$prefix${child.shortName}$separator';
+ } else {
+ completion = '$prefix${child.shortName}';
+ }
+ if (completion != sourceShortName && completion != sourceFullName) {
+ _addSuggestion(completion);
+ }
+ }
+ }
+ }
+
+ void _addPackageFolderSuggestions(
+ String partial, String prefix, Folder folder) {
+ for (Resource child in folder.getChildren()) {
+ if (child is Folder) {
+ String childPrefix = '$prefix${child.shortName}/';
+ _addSuggestion(childPrefix);
+ if (partial.startsWith(childPrefix)) {
+ _addPackageFolderSuggestions(partial, childPrefix, child);
+ }
+ } else {
+ _addSuggestion('$prefix${child.shortName}');
+ }
+ }
+ }
+
+ void _addPackageSuggestions(String partial) {
+ SourceFactory factory = request.context.sourceFactory;
+ Map<String, List<Folder>> packageMap = factory.packageMap;
+ if (packageMap != null) {
+ _addSuggestion('package:');
+ packageMap.forEach((String pkgName, List<Folder> folders) {
+ String prefix = 'package:$pkgName/';
+ _addSuggestion(prefix);
+ for (Folder folder in folders) {
+ _addPackageFolderSuggestions(partial, prefix, folder);
+ }
+ });
+ }
+ }
+
+ void _addSuggestion(String completion) {
+ if (!_importedUris.contains(completion)) {
+ request.addSuggestion(new CompletionSuggestion(
+ CompletionSuggestionKind.IMPORT, DART_RELEVANCE_DEFAULT, completion,
+ completion.length, 0, false, false));
+ }
+ }
+
+ void _computeImportedUris() {
+ _importedUris = new HashSet<String>();
+ _importedUris.add('dart:core');
+ for (Directive directive in request.unit.directives) {
+ if (directive is ImportDirective) {
+ String uri = directive.uriContent;
+ if (uri != null && uri.length > 0) {
+ _importedUris.add(uri);
+ }
+ }
+ }
+ }
+}
diff --git a/pkg/analysis_server/lib/src/services/completion/imported_reference_contributor.dart b/pkg/analysis_server/lib/src/services/completion/imported_reference_contributor.dart
index 5608f8f..0fced1d 100644
--- a/pkg/analysis_server/lib/src/services/completion/imported_reference_contributor.dart
+++ b/pkg/analysis_server/lib/src/services/completion/imported_reference_contributor.dart
@@ -191,9 +191,8 @@
// Build a list of inherited types that are imported
// and include any inherited imported members
List<String> inheritedTypes = new List<String>();
- visitInheritedTypes(classDecl, (_) {
- // local declarations are handled by the local reference contributor
- }, (String typeName) {
+ // local declarations are handled by the local reference contributor
+ visitInheritedTypes(classDecl, importedTypeName: (String typeName) {
inheritedTypes.add(typeName);
});
HashSet<String> visited = new HashSet<String>();
diff --git a/pkg/analysis_server/lib/src/services/completion/keyword_contributor.dart b/pkg/analysis_server/lib/src/services/completion/keyword_contributor.dart
index b979b8b..5414bcc 100644
--- a/pkg/analysis_server/lib/src/services/completion/keyword_contributor.dart
+++ b/pkg/analysis_server/lib/src/services/completion/keyword_contributor.dart
@@ -11,6 +11,9 @@
import 'package:analyzer/src/generated/ast.dart';
import 'package:analyzer/src/generated/scanner.dart';
+const ASYNC = 'async';
+const AWAIT = 'await';
+
/**
* A contributor for calculating `completion.getSuggestions` request results
* for the local library in which the completion is requested.
@@ -40,28 +43,16 @@
this.entity = request.target.entity;
@override
- visitBlock(Block node) {
- if (_isInClassMemberBody(node)) {
- _addSuggestions([Keyword.SUPER, Keyword.THIS,]);
+ visitArgumentList(ArgumentList node) {
+ if (entity == node.rightParenthesis ||
+ (entity is SimpleIdentifier && node.arguments.contains(entity))) {
+ _addExpressionKeywords(node);
}
- _addSuggestions([
- Keyword.ASSERT,
- Keyword.CASE,
- Keyword.CONTINUE,
- Keyword.DO,
- Keyword.FINAL,
- Keyword.FOR,
- Keyword.IF,
- Keyword.NEW,
- Keyword.RETHROW,
- Keyword.RETURN,
- Keyword.SWITCH,
- Keyword.THROW,
- Keyword.TRY,
- Keyword.VAR,
- Keyword.VOID,
- Keyword.WHILE
- ]);
+ }
+
+ @override
+ visitBlock(Block node) {
+ _addStatementKeywords(node);
}
@override
@@ -70,22 +61,18 @@
if (entity == node.name) {
return;
}
- if (entity == node.rightBracket || entity is ClassMember) {
- _addSuggestions([
- Keyword.CONST,
- Keyword.DYNAMIC,
- Keyword.FACTORY,
- Keyword.FINAL,
- Keyword.GET,
- Keyword.OPERATOR,
- Keyword.SET,
- Keyword.STATIC,
- Keyword.VAR,
- Keyword.VOID
- ]);
- return;
+ if (entity == node.rightBracket) {
+ _addClassBodyKeywords();
+ } else if (entity is ClassMember) {
+ _addClassBodyKeywords();
+ int index = node.members.indexOf(entity);
+ ClassMember previous = index > 0 ? node.members[index - 1] : null;
+ if (previous is MethodDeclaration && previous.body is EmptyFunctionBody) {
+ _addSuggestion2(ASYNC);
+ }
+ } else {
+ _addClassDeclarationKeywords(node);
}
- _addClassDeclarationKeywords(node);
}
@override
@@ -120,20 +107,58 @@
!node.directives.any((d) => d is LibraryDirective)) {
_addSuggestions([Keyword.LIBRARY], DART_RELEVANCE_HIGH);
}
- _addSuggestions(
- [Keyword.EXPORT, Keyword.IMPORT, Keyword.PART], DART_RELEVANCE_HIGH);
+ _addSuggestions([Keyword.EXPORT, Keyword.PART], DART_RELEVANCE_HIGH);
+ _addSuggestion2("import '';",
+ offset: 8, relevance: DART_RELEVANCE_HIGH + 1);
+ _addSuggestion2("import '' as ;",
+ offset: 8, relevance: DART_RELEVANCE_HIGH);
+ _addSuggestion2("import '' hide ;",
+ offset: 8, relevance: DART_RELEVANCE_HIGH);
+ _addSuggestion2("import '' show ;",
+ offset: 8, relevance: DART_RELEVANCE_HIGH);
}
if (entity == null || entity is Declaration) {
- _addSuggestions([
- Keyword.ABSTRACT,
- Keyword.CLASS,
- Keyword.CONST,
- Keyword.DYNAMIC,
- Keyword.FINAL,
- Keyword.TYPEDEF,
- Keyword.VAR,
- Keyword.VOID
- ], DART_RELEVANCE_HIGH);
+ if (previousMember is FunctionDeclaration &&
+ previousMember.functionExpression is FunctionExpression &&
+ previousMember.functionExpression.body is EmptyFunctionBody) {
+ _addSuggestion2(ASYNC, relevance: DART_RELEVANCE_HIGH);
+ }
+ _addCompilationUnitKeywords();
+ }
+ }
+
+ @override
+ visitExpressionFunctionBody(ExpressionFunctionBody node) {
+ if (entity == node.expression) {
+ _addExpressionKeywords(node);
+ }
+ }
+
+ @override
+ visitFormalParameterList(FormalParameterList node) {
+ AstNode constructorDecl =
+ node.getAncestor((p) => p is ConstructorDeclaration);
+ if (constructorDecl != null) {
+ _addSuggestions([Keyword.THIS]);
+ }
+ }
+
+ @override
+ visitFunctionExpression(FunctionExpression node) {
+ if (entity == node.body) {
+ _addSuggestion2(ASYNC, relevance: DART_RELEVANCE_HIGH);
+ if (node.body is EmptyFunctionBody &&
+ node.parent is FunctionDeclaration &&
+ node.parent.parent is CompilationUnit) {
+ _addCompilationUnitKeywords();
+ }
+ }
+ }
+
+ @override
+ visitIfStatement(IfStatement node) {
+ if (entity == node.thenStatement) {
+ _addStatementKeywords(node);
}
}
@@ -149,15 +174,74 @@
}
}
- void _addImportDirectiveKeywords(ImportDirective node) {
- if (node.asKeyword == null) {
- _addSuggestion(Keyword.AS, DART_RELEVANCE_HIGH);
- if (node.deferredKeyword == null) {
- _addSuggestion(Keyword.DEFERRED, DART_RELEVANCE_HIGH);
+ @override
+ visitMethodDeclaration(MethodDeclaration node) {
+ if (entity == node.body) {
+ if (node.body is EmptyFunctionBody) {
+ _addClassBodyKeywords();
+ _addSuggestion2(ASYNC);
+ } else {
+ _addSuggestion2(ASYNC, relevance: DART_RELEVANCE_HIGH);
}
}
}
+ @override
+ visitNamedExpression(NamedExpression node) {
+ if (entity is SimpleIdentifier && entity == node.expression) {
+ _addExpressionKeywords(node);
+ }
+ }
+
+ @override
+ visitNode(AstNode node) {
+ // ignored
+ }
+
+ @override
+ visitSwitchStatement(SwitchStatement node) {
+ if (entity == node.expression) {
+ _addExpressionKeywords(node);
+ } else if (entity == node.rightBracket) {
+ if (node.members.isEmpty) {
+ _addSuggestions([Keyword.CASE, Keyword.DEFAULT], DART_RELEVANCE_HIGH);
+ } else {
+ _addSuggestions([Keyword.CASE, Keyword.DEFAULT]);
+ _addStatementKeywords(node);
+ }
+ }
+ if (node.members.contains(entity)) {
+ if (entity == node.members.first) {
+ _addSuggestions([Keyword.CASE, Keyword.DEFAULT], DART_RELEVANCE_HIGH);
+ } else {
+ _addSuggestions([Keyword.CASE, Keyword.DEFAULT]);
+ _addStatementKeywords(node);
+ }
+ }
+ }
+
+ @override
+ visitVariableDeclaration(VariableDeclaration node) {
+ if (entity == node.initializer) {
+ _addExpressionKeywords(node);
+ }
+ }
+
+ void _addClassBodyKeywords() {
+ _addSuggestions([
+ Keyword.CONST,
+ Keyword.DYNAMIC,
+ Keyword.FACTORY,
+ Keyword.FINAL,
+ Keyword.GET,
+ Keyword.OPERATOR,
+ Keyword.SET,
+ Keyword.STATIC,
+ Keyword.VAR,
+ Keyword.VOID
+ ]);
+ }
+
void _addClassDeclarationKeywords(ClassDeclaration node) {
// Very simplistic suggestion because analyzer will warn if
// the extends / with / implements keywords are out of order
@@ -171,12 +255,77 @@
}
}
+ void _addCompilationUnitKeywords() {
+ _addSuggestions([
+ Keyword.ABSTRACT,
+ Keyword.CLASS,
+ Keyword.CONST,
+ Keyword.DYNAMIC,
+ Keyword.FINAL,
+ Keyword.TYPEDEF,
+ Keyword.VAR,
+ Keyword.VOID
+ ], DART_RELEVANCE_HIGH);
+ }
+
+ void _addExpressionKeywords(AstNode node) {
+ _addSuggestions([Keyword.FALSE, Keyword.NEW, Keyword.NULL, Keyword.TRUE,]);
+ if (_inClassMemberBody(node)) {
+ _addSuggestions([Keyword.SUPER, Keyword.THIS,]);
+ }
+ if (_inAsyncMethodOrFunction(node)) {
+ _addSuggestion2(AWAIT);
+ }
+ }
+
+ void _addImportDirectiveKeywords(ImportDirective node) {
+ if (node.asKeyword == null) {
+ _addSuggestion(Keyword.AS, DART_RELEVANCE_HIGH);
+ if (node.deferredKeyword == null) {
+ _addSuggestion(Keyword.DEFERRED, DART_RELEVANCE_HIGH);
+ }
+ }
+ }
+
+ void _addStatementKeywords(AstNode node) {
+ if (_inClassMemberBody(node)) {
+ _addSuggestions([Keyword.SUPER, Keyword.THIS,]);
+ }
+ if (_inAsyncMethodOrFunction(node)) {
+ _addSuggestion2(AWAIT);
+ }
+ _addSuggestions([
+ Keyword.ASSERT,
+ Keyword.CONTINUE,
+ Keyword.DO,
+ Keyword.FINAL,
+ Keyword.FOR,
+ Keyword.IF,
+ Keyword.NEW,
+ Keyword.RETHROW,
+ Keyword.RETURN,
+ Keyword.SWITCH,
+ Keyword.THROW,
+ Keyword.TRY,
+ Keyword.VAR,
+ Keyword.VOID,
+ Keyword.WHILE
+ ]);
+ }
+
void _addSuggestion(Keyword keyword,
- [int relevance = DART_RELEVANCE_DEFAULT]) {
- String completion = keyword.syntax;
+ [int relevance = DART_RELEVANCE_KEYWORD]) {
+ _addSuggestion2(keyword.syntax, relevance: relevance);
+ }
+
+ void _addSuggestion2(String completion,
+ {int offset, int relevance: DART_RELEVANCE_KEYWORD}) {
+ if (offset == null) {
+ offset = completion.length;
+ }
request.addSuggestion(new CompletionSuggestion(
- CompletionSuggestionKind.KEYWORD, relevance, completion,
- completion.length, 0, false, false));
+ CompletionSuggestionKind.KEYWORD, relevance, completion, offset, 0,
+ false, false));
}
void _addSuggestions(List<Keyword> keywords,
@@ -186,7 +335,12 @@
});
}
- bool _isInClassMemberBody(AstNode node) {
+ bool _inAsyncMethodOrFunction(AstNode node) {
+ FunctionBody body = node.getAncestor((n) => n is FunctionBody);
+ return body != null && body.isAsynchronous;
+ }
+
+ bool _inClassMemberBody(AstNode node) {
while (true) {
AstNode body = node.getAncestor((n) => n is FunctionBody);
if (body == null) {
diff --git a/pkg/analysis_server/lib/src/services/completion/local_declaration_visitor.dart b/pkg/analysis_server/lib/src/services/completion/local_declaration_visitor.dart
index d00921a..6ba0afa 100644
--- a/pkg/analysis_server/lib/src/services/completion/local_declaration_visitor.dart
+++ b/pkg/analysis_server/lib/src/services/completion/local_declaration_visitor.dart
@@ -110,10 +110,9 @@
@override
void visitClassDeclaration(ClassDeclaration node) {
_visitClassDeclarationMembers(node);
- visitInheritedTypes(node, (ClassDeclaration classNode) {
+ // imported types are handled by the imported reference contributor
+ visitInheritedTypes(node, localDeclaration: (ClassDeclaration classNode) {
_visitClassDeclarationMembers(classNode);
- }, (String typeName) {
- // ignored
});
visitNode(node);
}
diff --git a/pkg/analysis_server/lib/src/services/completion/local_reference_contributor.dart b/pkg/analysis_server/lib/src/services/completion/local_reference_contributor.dart
index 12cdd5e..7701bb8 100644
--- a/pkg/analysis_server/lib/src/services/completion/local_reference_contributor.dart
+++ b/pkg/analysis_server/lib/src/services/completion/local_reference_contributor.dart
@@ -11,71 +11,11 @@
import 'package:analysis_server/src/protocol.dart' hide Element, ElementKind;
import 'package:analysis_server/src/services/completion/dart_completion_manager.dart';
import 'package:analysis_server/src/services/completion/local_declaration_visitor.dart';
+import 'package:analysis_server/src/services/completion/local_suggestion_builder.dart';
import 'package:analysis_server/src/services/completion/optype.dart';
import 'package:analyzer/src/generated/ast.dart';
-import 'package:analyzer/src/generated/scanner.dart';
import 'package:analyzer/src/generated/utilities_dart.dart';
-const _DYNAMIC = 'dynamic';
-
-final TypeName _NO_RETURN_TYPE = new TypeName(
- new SimpleIdentifier(new StringToken(TokenType.IDENTIFIER, '', 0)), null);
-
-/**
- * Create a new protocol Element for inclusion in a completion suggestion.
- */
-protocol.Element _createElement(protocol.ElementKind kind, SimpleIdentifier id,
- {String parameters, TypeName returnType, bool isAbstract: false,
- bool isDeprecated: false}) {
- String name = id != null ? id.name : '';
- int flags = protocol.Element.makeFlags(
- isAbstract: isAbstract,
- isDeprecated: isDeprecated,
- isPrivate: Identifier.isPrivateName(name));
- return new protocol.Element(kind, name, flags,
- parameters: parameters, returnType: _nameForType(returnType));
-}
-
-/**
- * Return `true` if the @deprecated annotation is present
- */
-bool _isDeprecated(AnnotatedNode node) {
- if (node != null) {
- NodeList<Annotation> metadata = node.metadata;
- if (metadata != null) {
- return metadata.any((Annotation a) {
- return a.name is SimpleIdentifier && a.name.name == 'deprecated';
- });
- }
- }
- return false;
-}
-
-/**
- * Return the name for the given type.
- */
-String _nameForType(TypeName type) {
- if (type == _NO_RETURN_TYPE) {
- return null;
- }
- if (type == null) {
- return _DYNAMIC;
- }
- Identifier id = type.name;
- if (id == null) {
- return _DYNAMIC;
- }
- String name = id.name;
- if (name == null || name.length <= 0) {
- return _DYNAMIC;
- }
- TypeArgumentList typeArgs = type.typeArguments;
- if (typeArgs != null) {
- //TODO (danrubel) include type arguments
- }
- return name;
-}
-
/**
* A contributor for calculating `completion.getSuggestions` request results
* for the local library in which the completion is requested.
@@ -217,8 +157,7 @@
}
}
}
- bool isDeprecated =
- constructorDecl != null && _isDeprecated(constructorDecl);
+ bool deprecated = constructorDecl != null && isDeprecated(constructorDecl);
List<String> parameterNames = new List<String>();
List<String> parameterTypes = new List<String>();
int requiredParameterCount = 0;
@@ -260,14 +199,14 @@
paramBuf.write(hasNamedParameters ? '}' : ']');
}
paramBuf.write(')');
- protocol.Element element = _createElement(
+ protocol.Element element = createElement(
protocol.ElementKind.CONSTRUCTOR, elemId,
parameters: paramBuf.toString());
element.returnType = classDecl.name.name;
CompletionSuggestion suggestion = new CompletionSuggestion(
CompletionSuggestionKind.INVOCATION,
- isDeprecated ? DART_RELEVANCE_LOW : DART_RELEVANCE_DEFAULT, completion,
- completion.length, 0, isDeprecated, false,
+ deprecated ? DART_RELEVANCE_LOW : DART_RELEVANCE_DEFAULT, completion,
+ completion.length, 0, deprecated, false,
declaringType: classDecl.name.name,
element: element,
parameterNames: parameterNames,
@@ -283,7 +222,7 @@
*/
String _nameForParamType(NormalFormalParameter param) {
if (param is SimpleFormalParameter) {
- return _nameForType(param.type);
+ return nameForType(param.type);
}
SimpleIdentifier id = param.identifier;
if (param is FieldFormalParameter && id != null) {
@@ -294,14 +233,14 @@
if (member is FieldDeclaration) {
for (VariableDeclaration field in member.fields.variables) {
if (field.name.name == fieldName) {
- return _nameForType(member.fields.type);
+ return nameForType(member.fields.type);
}
}
}
}
}
}
- return _DYNAMIC;
+ return DYNAMIC;
}
}
@@ -436,15 +375,15 @@
@override
void declaredClass(ClassDeclaration declaration) {
if (optype.includeTypeNameSuggestions) {
- bool isDeprecated = _isDeprecated(declaration);
- CompletionSuggestion suggestion = _addSuggestion(declaration.name,
- _NO_RETURN_TYPE, isDeprecated, DART_RELEVANCE_DEFAULT);
+ bool deprecated = isDeprecated(declaration);
+ CompletionSuggestion suggestion = _addSuggestion(
+ declaration.name, NO_RETURN_TYPE, deprecated, DART_RELEVANCE_DEFAULT);
if (suggestion != null) {
- suggestion.element = _createElement(
+ suggestion.element = createElement(
protocol.ElementKind.CLASS, declaration.name,
- returnType: _NO_RETURN_TYPE,
+ returnType: NO_RETURN_TYPE,
isAbstract: declaration.isAbstract,
- isDeprecated: isDeprecated);
+ isDeprecated: deprecated);
}
}
}
@@ -452,15 +391,15 @@
@override
void declaredClassTypeAlias(ClassTypeAlias declaration) {
if (optype.includeTypeNameSuggestions) {
- bool isDeprecated = _isDeprecated(declaration);
- CompletionSuggestion suggestion = _addSuggestion(declaration.name,
- _NO_RETURN_TYPE, isDeprecated, DART_RELEVANCE_DEFAULT);
+ bool deprecated = isDeprecated(declaration);
+ CompletionSuggestion suggestion = _addSuggestion(
+ declaration.name, NO_RETURN_TYPE, deprecated, DART_RELEVANCE_DEFAULT);
if (suggestion != null) {
- suggestion.element = _createElement(
+ suggestion.element = createElement(
protocol.ElementKind.CLASS_TYPE_ALIAS, declaration.name,
- returnType: _NO_RETURN_TYPE,
+ returnType: NO_RETURN_TYPE,
isAbstract: true,
- isDeprecated: isDeprecated);
+ isDeprecated: deprecated);
}
}
}
@@ -468,15 +407,10 @@
@override
void declaredField(FieldDeclaration fieldDecl, VariableDeclaration varDecl) {
if (optype.includeReturnValueSuggestions) {
- bool isDeprecated = _isDeprecated(fieldDecl) || _isDeprecated(varDecl);
- TypeName type = fieldDecl.fields.type;
- CompletionSuggestion suggestion = _addSuggestion(
- varDecl.name, type, isDeprecated, DART_RELEVANCE_LOCAL_FIELD,
- classDecl: fieldDecl.parent);
+ CompletionSuggestion suggestion =
+ createFieldSuggestion(fieldDecl, varDecl);
if (suggestion != null) {
- suggestion.element = _createElement(
- protocol.ElementKind.FIELD, varDecl.name,
- returnType: type, isDeprecated: isDeprecated);
+ request.addSuggestion(suggestion);
}
}
}
@@ -486,7 +420,7 @@
if (optype.includeReturnValueSuggestions ||
optype.includeVoidReturnSuggestions) {
TypeName returnType = declaration.returnType;
- bool isDeprecated = _isDeprecated(declaration);
+ bool deprecated = isDeprecated(declaration);
protocol.ElementKind kind;
int defaultRelevance = DART_RELEVANCE_DEFAULT;
if (declaration.isGetter) {
@@ -497,7 +431,7 @@
return;
}
kind = protocol.ElementKind.SETTER;
- returnType = _NO_RETURN_TYPE;
+ returnType = NO_RETURN_TYPE;
defaultRelevance = DART_RELEVANCE_LOCAL_ACCESSOR;
} else {
if (!optype.includeVoidReturnSuggestions && _isVoid(returnType)) {
@@ -507,13 +441,13 @@
defaultRelevance = DART_RELEVANCE_LOCAL_FUNCTION;
}
CompletionSuggestion suggestion = _addSuggestion(
- declaration.name, returnType, isDeprecated, defaultRelevance);
+ declaration.name, returnType, deprecated, defaultRelevance);
if (suggestion != null) {
FormalParameterList param = declaration.functionExpression.parameters;
- suggestion.element = _createElement(kind, declaration.name,
+ suggestion.element = createElement(kind, declaration.name,
parameters: param != null ? param.toSource() : null,
returnType: returnType,
- isDeprecated: isDeprecated);
+ isDeprecated: deprecated);
if (kind == protocol.ElementKind.FUNCTION) {
_addParameterInfo(
suggestion, declaration.functionExpression.parameters);
@@ -525,17 +459,15 @@
@override
void declaredFunctionTypeAlias(FunctionTypeAlias declaration) {
if (optype.includeTypeNameSuggestions) {
- bool isDeprecated = _isDeprecated(declaration);
+ bool deprecated = isDeprecated(declaration);
TypeName returnType = declaration.returnType;
CompletionSuggestion suggestion = _addSuggestion(
- declaration.name, returnType, isDeprecated, DART_RELEVANCE_DEFAULT);
+ declaration.name, returnType, deprecated, DART_RELEVANCE_DEFAULT);
if (suggestion != null) {
// TODO (danrubel) determine parameters and return type
- suggestion.element = _createElement(
+ suggestion.element = createElement(
protocol.ElementKind.FUNCTION_TYPE_ALIAS, declaration.name,
- returnType: returnType,
- isAbstract: true,
- isDeprecated: isDeprecated);
+ returnType: returnType, isAbstract: true, isDeprecated: deprecated);
}
}
}
@@ -551,7 +483,7 @@
CompletionSuggestion suggestion =
_addSuggestion(name, type, false, DART_RELEVANCE_LOCAL_VARIABLE);
if (suggestion != null) {
- suggestion.element = _createElement(
+ suggestion.element = createElement(
protocol.ElementKind.LOCAL_VARIABLE, name, returnType: type);
}
}
@@ -574,7 +506,7 @@
return;
}
kind = protocol.ElementKind.SETTER;
- returnType = _NO_RETURN_TYPE;
+ returnType = NO_RETURN_TYPE;
defaultRelevance = DART_RELEVANCE_LOCAL_ACCESSOR;
} else {
if (!optype.includeVoidReturnSuggestions && _isVoid(returnType)) {
@@ -584,16 +516,16 @@
parameters = declaration.parameters.toSource();
defaultRelevance = DART_RELEVANCE_LOCAL_METHOD;
}
- bool isDeprecated = _isDeprecated(declaration);
+ bool deprecated = isDeprecated(declaration);
CompletionSuggestion suggestion = _addSuggestion(
- declaration.name, returnType, isDeprecated, defaultRelevance,
+ declaration.name, returnType, deprecated, defaultRelevance,
classDecl: declaration.parent);
if (suggestion != null) {
- suggestion.element = _createElement(kind, declaration.name,
+ suggestion.element = createElement(kind, declaration.name,
parameters: parameters,
returnType: returnType,
isAbstract: declaration.isAbstract,
- isDeprecated: isDeprecated);
+ isDeprecated: deprecated);
if (kind == protocol.ElementKind.METHOD) {
_addParameterInfo(suggestion, declaration.parameters);
}
@@ -607,8 +539,8 @@
CompletionSuggestion suggestion =
_addSuggestion(name, type, false, DART_RELEVANCE_PARAMETER);
if (suggestion != null) {
- suggestion.element = _createElement(
- protocol.ElementKind.PARAMETER, name, returnType: type);
+ suggestion.element = createElement(protocol.ElementKind.PARAMETER, name,
+ returnType: type);
}
}
}
@@ -617,13 +549,13 @@
void declaredTopLevelVar(
VariableDeclarationList varList, VariableDeclaration varDecl) {
if (optype.includeReturnValueSuggestions) {
- bool isDeprecated = _isDeprecated(varList) || _isDeprecated(varDecl);
+ bool deprecated = isDeprecated(varList) || isDeprecated(varDecl);
CompletionSuggestion suggestion = _addSuggestion(varDecl.name,
- varList.type, isDeprecated, DART_RELEVANCE_LOCAL_TOP_LEVEL_VARIABLE);
+ varList.type, deprecated, DART_RELEVANCE_LOCAL_TOP_LEVEL_VARIABLE);
if (suggestion != null) {
- suggestion.element = _createElement(
+ suggestion.element = createElement(
protocol.ElementKind.TOP_LEVEL_VARIABLE, varDecl.name,
- returnType: varList.type, isDeprecated: isDeprecated);
+ returnType: varList.type, isDeprecated: deprecated);
}
}
}
@@ -666,28 +598,12 @@
CompletionSuggestion _addSuggestion(SimpleIdentifier id, TypeName returnType,
bool isDeprecated, int defaultRelevance, {ClassDeclaration classDecl}) {
- if (id != null) {
- String completion = id.name;
- if (completion != null && completion.length > 0 && completion != '_') {
- CompletionSuggestion suggestion = new CompletionSuggestion(
- CompletionSuggestionKind.INVOCATION,
- isDeprecated ? DART_RELEVANCE_LOW : defaultRelevance, completion,
- completion.length, 0, isDeprecated, false,
- returnType: _nameForType(returnType));
- if (classDecl != null) {
- SimpleIdentifier identifier = classDecl.name;
- if (identifier != null) {
- String name = identifier.name;
- if (name != null && name.length > 0) {
- suggestion.declaringType = name;
- }
- }
- }
- request.addSuggestion(suggestion);
- return suggestion;
- }
+ CompletionSuggestion suggestion = createSuggestion(
+ id, isDeprecated, defaultRelevance, returnType, classDecl: classDecl);
+ if (suggestion != null) {
+ request.addSuggestion(suggestion);
}
- return null;
+ return suggestion;
}
bool _isVoid(TypeName returnType) {
diff --git a/pkg/analysis_server/lib/src/services/completion/local_suggestion_builder.dart b/pkg/analysis_server/lib/src/services/completion/local_suggestion_builder.dart
new file mode 100644
index 0000000..8014dd4
--- /dev/null
+++ b/pkg/analysis_server/lib/src/services/completion/local_suggestion_builder.dart
@@ -0,0 +1,118 @@
+// Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+library services.completion.suggestion.builder.local;
+
+import 'package:analysis_server/src/protocol.dart' as protocol
+ show Element, ElementKind;
+import 'package:analysis_server/src/protocol.dart' hide Element, ElementKind;
+import 'package:analysis_server/src/services/completion/dart_completion_manager.dart';
+import 'package:analyzer/src/generated/ast.dart';
+import 'package:analyzer/src/generated/scanner.dart';
+
+const DYNAMIC = 'dynamic';
+
+final TypeName NO_RETURN_TYPE = new TypeName(
+ new SimpleIdentifier(new StringToken(TokenType.IDENTIFIER, '', 0)), null);
+
+/**
+ * Create a new protocol Element for inclusion in a completion suggestion.
+ */
+protocol.Element createElement(protocol.ElementKind kind, SimpleIdentifier id,
+ {String parameters, TypeName returnType, bool isAbstract: false,
+ bool isDeprecated: false}) {
+ String name = id != null ? id.name : '';
+ int flags = protocol.Element.makeFlags(
+ isAbstract: isAbstract,
+ isDeprecated: isDeprecated,
+ isPrivate: Identifier.isPrivateName(name));
+ return new protocol.Element(kind, name, flags,
+ parameters: parameters, returnType: nameForType(returnType));
+}
+
+/**
+ * Create a new suggestion for the given field.
+ * Return the new suggestion or `null` if it could not be created.
+ */
+CompletionSuggestion createFieldSuggestion(
+ FieldDeclaration fieldDecl, VariableDeclaration varDecl) {
+ bool deprecated = isDeprecated(fieldDecl) || isDeprecated(varDecl);
+ TypeName type = fieldDecl.fields.type;
+ return createSuggestion(
+ varDecl.name, deprecated, DART_RELEVANCE_LOCAL_FIELD, type,
+ classDecl: fieldDecl.parent,
+ element: createElement(protocol.ElementKind.FIELD, varDecl.name,
+ returnType: type, isDeprecated: deprecated));
+}
+
+/**
+ * Create a new suggestion based upon the given information.
+ * Return the new suggestion or `null` if it could not be created.
+ */
+CompletionSuggestion createSuggestion(SimpleIdentifier id, bool isDeprecated,
+ int defaultRelevance, TypeName returnType,
+ {ClassDeclaration classDecl, protocol.Element element}) {
+ if (id == null) {
+ return null;
+ }
+ String completion = id.name;
+ if (completion == null || completion.length <= 0 || completion == '_') {
+ return null;
+ }
+ CompletionSuggestion suggestion = new CompletionSuggestion(
+ CompletionSuggestionKind.INVOCATION,
+ isDeprecated ? DART_RELEVANCE_LOW : defaultRelevance, completion,
+ completion.length, 0, isDeprecated, false,
+ returnType: nameForType(returnType), element: element);
+ if (classDecl != null) {
+ SimpleIdentifier classId = classDecl.name;
+ if (classId != null) {
+ String className = classId.name;
+ if (className != null && className.length > 0) {
+ suggestion.declaringType = className;
+ }
+ }
+ }
+ return suggestion;
+}
+
+/**
+ * Return `true` if the @deprecated annotation is present
+ */
+bool isDeprecated(AnnotatedNode node) {
+ if (node != null) {
+ NodeList<Annotation> metadata = node.metadata;
+ if (metadata != null) {
+ return metadata.any((Annotation a) {
+ return a.name is SimpleIdentifier && a.name.name == 'deprecated';
+ });
+ }
+ }
+ return false;
+}
+
+/**
+ * Return the name for the given type.
+ */
+String nameForType(TypeName type) {
+ if (type == NO_RETURN_TYPE) {
+ return null;
+ }
+ if (type == null) {
+ return DYNAMIC;
+ }
+ Identifier id = type.name;
+ if (id == null) {
+ return DYNAMIC;
+ }
+ String name = id.name;
+ if (name == null || name.length <= 0) {
+ return DYNAMIC;
+ }
+ TypeArgumentList typeArgs = type.typeArguments;
+ if (typeArgs != null) {
+ //TODO (danrubel) include type arguments
+ }
+ return name;
+}
diff --git a/pkg/analysis_server/lib/src/services/completion/optype.dart b/pkg/analysis_server/lib/src/services/completion/optype.dart
index 84bced9..c9d88bcd 100644
--- a/pkg/analysis_server/lib/src/services/completion/optype.dart
+++ b/pkg/analysis_server/lib/src/services/completion/optype.dart
@@ -442,6 +442,16 @@
}
@override
+ void visitFieldFormalParameter(FieldFormalParameter node) {
+ if (entity == node.identifier) {
+ optype.isPrefixed = true;
+ } else {
+ optype.includeReturnValueSuggestions = true;
+ optype.includeTypeNameSuggestions = true;
+ }
+ }
+
+ @override
void visitNormalFormalParameter(NormalFormalParameter node) {
optype.includeReturnValueSuggestions = true;
optype.includeTypeNameSuggestions = true;
@@ -595,7 +605,7 @@
@override
void visitVariableDeclarationList(VariableDeclarationList node) {
if ((node.keyword == null || node.keyword.lexeme != 'var') &&
- (node.type == null)) {
+ (node.type == null || identical(entity, node.type))) {
optype.includeTypeNameSuggestions = true;
}
}
diff --git a/pkg/analysis_server/lib/src/services/completion/prefixed_element_contributor.dart b/pkg/analysis_server/lib/src/services/completion/prefixed_element_contributor.dart
index cb6ccf4..296ca24 100644
--- a/pkg/analysis_server/lib/src/services/completion/prefixed_element_contributor.dart
+++ b/pkg/analysis_server/lib/src/services/completion/prefixed_element_contributor.dart
@@ -8,14 +8,15 @@
import 'package:analysis_server/src/services/completion/dart_completion_manager.dart';
import 'package:analysis_server/src/services/completion/local_declaration_visitor.dart';
+import 'package:analysis_server/src/services/completion/local_suggestion_builder.dart';
import 'package:analysis_server/src/services/completion/optype.dart';
import 'package:analysis_server/src/services/completion/suggestion_builder.dart';
import 'package:analyzer/src/generated/ast.dart';
import 'package:analyzer/src/generated/element.dart';
-import '../../protocol_server.dart' as protocol;
import '../../protocol_server.dart'
show CompletionSuggestion, CompletionSuggestionKind;
+import '../../protocol_server.dart' as protocol;
/**
* A contributor for calculating invocation / access suggestions
@@ -80,6 +81,74 @@
}
/**
+ * A suggestion builder for 'this.' constructor arguments.
+ */
+class _FieldFormalSuggestionBuilder implements SuggestionBuilder {
+ final DartCompletionRequest request;
+
+ _FieldFormalSuggestionBuilder(this.request);
+
+ @override
+ bool computeFast(AstNode node) {
+ if (node is FieldFormalParameter) {
+ ConstructorDeclaration constructorDecl =
+ node.getAncestor((p) => p is ConstructorDeclaration);
+ if (constructorDecl != null) {
+
+ // Compute fields already referenced
+ List<String> referencedFields = new List<String>();
+ for (FormalParameter param in constructorDecl.parameters.parameters) {
+ if (param is FieldFormalParameter) {
+ SimpleIdentifier fieldId = param.identifier;
+ if (fieldId != null && fieldId != request.target.entity) {
+ String fieldName = fieldId.name;
+ if (fieldName != null && fieldName.length > 0) {
+ referencedFields.add(fieldName);
+ }
+ }
+ }
+ }
+
+ // Add suggestions for fields that are not already referenced
+ ClassDeclaration classDecl =
+ constructorDecl.getAncestor((p) => p is ClassDeclaration);
+ for (ClassMember member in classDecl.members) {
+ if (member is FieldDeclaration) {
+ for (VariableDeclaration varDecl in member.fields.variables) {
+ SimpleIdentifier fieldId = varDecl.name;
+ if (fieldId != null) {
+ String fieldName = fieldId.name;
+ if (fieldName != null && fieldName.length > 0) {
+ if (!referencedFields.contains(fieldName)) {
+ CompletionSuggestion suggestion =
+ createFieldSuggestion(member, varDecl);
+ if (suggestion != null) {
+ request.addSuggestion(suggestion);
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ } else {
+ // This should never be called with a case not handled above.
+ assert(false);
+ }
+ return true;
+ }
+
+ @override
+ Future<bool> computeFull(AstNode node) {
+ // This should never be called; we should always be able to compute
+ // suggestions and return true in computeFast method.
+ assert(false);
+ return null;
+ }
+}
+
+/**
* An [AstNode] vistor for determining which suggestion builder
* should be used to build invocation/access suggestions.
*/
@@ -96,6 +165,11 @@
}
@override
+ SuggestionBuilder visitFieldFormalParameter(FieldFormalParameter node) {
+ return new _FieldFormalSuggestionBuilder(request);
+ }
+
+ @override
SuggestionBuilder visitMethodInvocation(MethodInvocation node) {
return new _ExpressionSuggestionBuilder(request);
}
diff --git a/pkg/analysis_server/lib/src/services/completion/suggestion_builder.dart b/pkg/analysis_server/lib/src/services/completion/suggestion_builder.dart
index ac87e30..80ddd85 100644
--- a/pkg/analysis_server/lib/src/services/completion/suggestion_builder.dart
+++ b/pkg/analysis_server/lib/src/services/completion/suggestion_builder.dart
@@ -14,16 +14,20 @@
import 'package:analyzer/src/generated/ast.dart';
import 'package:analyzer/src/generated/element.dart';
import 'package:analyzer/src/generated/utilities_dart.dart';
+import 'package:analyzer/src/generated/source.dart';
+import 'package:path/path.dart' as path;
const String DYNAMIC = 'dynamic';
/**
* Return a suggestion based upon the given element
* or `null` if a suggestion is not appropriate for the given element.
+ * If the suggestion is not currently in scope, then specify
+ * importForSource as the source to which an import should be added.
*/
CompletionSuggestion createSuggestion(Element element,
{CompletionSuggestionKind kind: CompletionSuggestionKind.INVOCATION,
- int relevance: DART_RELEVANCE_DEFAULT}) {
+ int relevance: DART_RELEVANCE_DEFAULT, Source importForSource}) {
String nameForType(DartType type) {
if (type == null) {
return DYNAMIC;
@@ -78,6 +82,34 @@
(ParameterElement parameter) =>
parameter.parameterKind == ParameterKind.NAMED);
}
+ if (importForSource != null) {
+ String srcPath = path.dirname(importForSource.fullName);
+ LibraryElement libElem = element.library;
+ if (libElem != null) {
+ Source libSource = libElem.source;
+ if (libSource != null) {
+ UriKind uriKind = libSource.uriKind;
+ if (uriKind == UriKind.DART_URI) {
+ suggestion.importUri = libSource.uri.toString();
+ } else if (uriKind == UriKind.PACKAGE_URI) {
+ suggestion.importUri = libSource.uri.toString();
+ } else if (uriKind == UriKind.FILE_URI &&
+ element.source.uriKind == UriKind.FILE_URI) {
+ try {
+ suggestion.importUri =
+ path.relative(libSource.fullName, from: srcPath);
+ } catch (_) {
+ // ignored
+ }
+ }
+ }
+ }
+ if (suggestion.importUri == null) {
+ // Do not include out of scope suggestions
+ // for which we cannot determine an import
+ return null;
+ }
+ }
return suggestion;
}
@@ -125,12 +157,13 @@
/**
* Starting with the given class node, traverse the inheritence hierarchy
* calling the given functions with each non-null non-empty inherited class
- * declaration. For each locally defined class declaration, call [local].
+ * declaration. For each locally defined declaration, call [localDeclaration].
* For each class identifier in the hierarchy that is not defined locally,
- * call the [imported] function.
+ * call the [importedTypeName] function.
*/
void visitInheritedTypes(ClassDeclaration node,
- void local(ClassDeclaration classNode), void imported(String typeName)) {
+ {void localDeclaration(ClassDeclaration classNode),
+ void importedTypeName(String typeName)}) {
CompilationUnit unit = node.getAncestor((p) => p is CompilationUnit);
List<ClassDeclaration> todo = new List<ClassDeclaration>();
todo.add(node);
@@ -149,10 +182,14 @@
return false;
}, orElse: () => null);
if (classNode is ClassDeclaration) {
- local(classNode);
+ if (localDeclaration != null) {
+ localDeclaration(classNode);
+ }
todo.add(classNode);
} else {
- imported(name);
+ if (importedTypeName != null) {
+ importedTypeName(name);
+ }
}
}
});
diff --git a/pkg/analysis_server/lib/src/services/correction/assist.dart b/pkg/analysis_server/lib/src/services/correction/assist.dart
index f84e1f7a..8234ed8 100644
--- a/pkg/analysis_server/lib/src/services/correction/assist.dart
+++ b/pkg/analysis_server/lib/src/services/correction/assist.dart
@@ -4,43 +4,43 @@
library services.correction.assist;
-import 'package:analysis_server/src/protocol.dart';
-import 'package:analysis_server/src/services/correction/assist_internal.dart';
-import 'package:analyzer/src/generated/ast.dart';
+import 'package:analysis_server/edit/assist/assist_core.dart';
+import 'package:analysis_server/src/plugin/server_plugin.dart';
+import 'package:analyzer/src/generated/engine.dart';
+import 'package:analyzer/src/generated/java_engine.dart';
import 'package:analyzer/src/generated/source.dart';
/**
- * Computes [Assist]s at the given location.
- *
- * Returns the computed [Assist]s, not `null`.
+ * Compute and return the assists available at the given selection (described by
+ * the [offset] and [length]) in the given [source]. The source was analyzed in
+ * the given [context]. The [plugin] is used to get the list of assist
+ * contributors.
*/
-List<Assist> computeAssists(CompilationUnit unit, int offset, int length) {
- Source source = unit.element.source;
- String file = source.fullName;
- AssistProcessor processor =
- new AssistProcessor(source, file, unit, offset, length);
- return processor.compute();
-}
-
-/**
- * A description of a single proposed assist.
- */
-class Assist {
- final AssistKind kind;
- final SourceChange change;
-
- Assist(this.kind, this.change);
-
- @override
- String toString() {
- return 'Assist(kind=$kind, change=$change)';
+List<Assist> computeAssists(ServerPlugin plugin, AnalysisContext context,
+ Source source, int offset, int length) {
+ List<Assist> assists = <Assist>[];
+ List<AssistContributor> contributors = plugin.assistContributors;
+ for (AssistContributor contributor in contributors) {
+ try {
+ List<Assist> contributedAssists =
+ contributor.computeAssists(context, source, offset, length);
+ if (contributedAssists != null) {
+ assists.addAll(contributedAssists);
+ }
+ } catch (exception, stackTrace) {
+ AnalysisEngine.instance.logger.logError(
+ 'Exception from assist contributor: ${contributor.runtimeType}',
+ new CaughtException(exception, stackTrace));
+ }
}
+ assists.sort(Assist.SORT_BY_RELEVANCE);
+ return assists;
}
/**
- * An enumeration of possible quick assist kinds.
+ * An enumeration of possible assist kinds.
*/
-class AssistKind {
+class DartAssistKind {
static const ADD_PART_DIRECTIVE =
const AssistKind('ADD_PART_DIRECTIVE', 30, "Add 'part' directive");
static const ADD_TYPE_ANNOTATION =
@@ -103,13 +103,4 @@
'SURROUND_WITH_TRY_FINALLY', 30, "Surround with 'try-finally'");
static const SURROUND_WITH_WHILE =
const AssistKind('SURROUND_WITH_WHILE', 30, "Surround with 'while'");
-
- final name;
- final int relevance;
- final String message;
-
- const AssistKind(this.name, this.relevance, this.message);
-
- @override
- String toString() => name;
}
diff --git a/pkg/analysis_server/lib/src/services/correction/assist_internal.dart b/pkg/analysis_server/lib/src/services/correction/assist_internal.dart
index 324ab85..dbb8255 100644
--- a/pkg/analysis_server/lib/src/services/correction/assist_internal.dart
+++ b/pkg/analysis_server/lib/src/services/correction/assist_internal.dart
@@ -6,6 +6,8 @@
import 'dart:collection';
+import 'package:analysis_server/edit/assist/assist_core.dart';
+import 'package:analysis_server/edit/assist/assist_dart.dart';
import 'package:analysis_server/src/protocol_server.dart' hide Element;
import 'package:analysis_server/src/services/correction/assist.dart';
import 'package:analysis_server/src/services/correction/name_suggestion.dart';
@@ -28,8 +30,8 @@
* The computer for Dart assists.
*/
class AssistProcessor {
- final Source source;
- final String file;
+ Source source;
+ String file;
int fileStamp;
final CompilationUnit unit;
final int selectionOffset;
@@ -51,8 +53,9 @@
SourceChange change = new SourceChange('<message>');
- AssistProcessor(this.source, this.file, this.unit, this.selectionOffset,
- this.selectionLength) {
+ AssistProcessor(this.unit, this.selectionOffset, this.selectionLength) {
+ source = unit.element.source;
+ file = source.fullName;
unitElement = unit.element;
context = unitElement.context;
unitLibraryElement = unitElement.library;
@@ -219,7 +222,7 @@
_addInsertEdit(declaredIdentifier.identifier.offset, '$typeSource ');
}
// add proposal
- _addAssist(AssistKind.ADD_TYPE_ANNOTATION, []);
+ _addAssist(DartAssistKind.ADD_TYPE_ANNOTATION, []);
}
void _addProposal_addTypeAnnotation_SimpleFormalParameter() {
@@ -262,7 +265,7 @@
// add edit
_addInsertEdit(name.offset, '$typeSource ');
// add proposal
- _addAssist(AssistKind.ADD_TYPE_ANNOTATION, []);
+ _addAssist(DartAssistKind.ADD_TYPE_ANNOTATION, []);
}
void _addProposal_addTypeAnnotation_VariableDeclaration() {
@@ -322,7 +325,7 @@
_addInsertEdit(variable.offset, '$typeSource ');
}
// add proposal
- _addAssist(AssistKind.ADD_TYPE_ANNOTATION, []);
+ _addAssist(DartAssistKind.ADD_TYPE_ANNOTATION, []);
}
void _addProposal_assignToLocalVariable() {
@@ -384,7 +387,7 @@
builder.append(' = ');
// add proposal
_insertBuilder(builder);
- _addAssist(AssistKind.ASSIGN_TO_LOCAL_VARIABLE, []);
+ _addAssist(DartAssistKind.ASSIGN_TO_LOCAL_VARIABLE, []);
}
void _addProposal_convertToBlockFunctionBody() {
@@ -403,7 +406,7 @@
String newBodySource = '{$eol$prefix$indent$returnSource;$eol$prefix}';
_addReplaceEdit(rangeNode(body), newBodySource);
// add proposal
- _addAssist(AssistKind.CONVERT_INTO_BLOCK_BODY, []);
+ _addAssist(DartAssistKind.CONVERT_INTO_BLOCK_BODY, []);
}
void _addProposal_convertToExpressionFunctionBody() {
@@ -438,7 +441,7 @@
}
_addReplaceEdit(rangeNode(body), newBodySource);
// add proposal
- _addAssist(AssistKind.CONVERT_INTO_EXPRESSION_BODY, []);
+ _addAssist(DartAssistKind.CONVERT_INTO_EXPRESSION_BODY, []);
}
void _addProposal_convertToForIndexLoop() {
@@ -513,7 +516,7 @@
_addInsertEdit(firstBlockLine,
'$prefix$indent$loopVariable = $listName[$indexName];$eol');
// add proposal
- _addAssist(AssistKind.CONVERT_INTO_FOR_INDEX, []);
+ _addAssist(DartAssistKind.CONVERT_INTO_FOR_INDEX, []);
}
void _addProposal_convertToIsNot_onIs() {
@@ -562,7 +565,7 @@
}
_addInsertEdit(isExpression.isOperator.end, '!');
// add proposal
- _addAssist(AssistKind.CONVERT_INTO_IS_NOT, []);
+ _addAssist(DartAssistKind.CONVERT_INTO_IS_NOT, []);
}
void _addProposal_convertToIsNot_onNot() {
@@ -611,7 +614,7 @@
}
_addInsertEdit(isExpression.isOperator.end, '!');
// add proposal
- _addAssist(AssistKind.CONVERT_INTO_IS_NOT, []);
+ _addAssist(DartAssistKind.CONVERT_INTO_IS_NOT, []);
}
/**
@@ -668,7 +671,7 @@
_addRemoveEdit(rangeStartStart(prefixExpression, prefixExpression.operand));
_addReplaceEdit(rangeNode(isEmptyIdentifier), 'isNotEmpty');
// add proposal
- _addAssist(AssistKind.CONVERT_INTO_IS_NOT_EMPTY, []);
+ _addAssist(DartAssistKind.CONVERT_INTO_IS_NOT_EMPTY, []);
}
void _addProposal_encapsulateField() {
@@ -741,7 +744,7 @@
' }';
_addInsertEdit(fieldDeclaraton.end, getterCode + setterCode);
// add proposal
- _addAssist(AssistKind.ENCAPSULATE_FIELD, []);
+ _addAssist(DartAssistKind.ENCAPSULATE_FIELD, []);
}
void _addProposal_exchangeOperands() {
@@ -799,7 +802,7 @@
}
}
// add proposal
- _addAssist(AssistKind.EXCHANGE_OPERANDS, []);
+ _addAssist(DartAssistKind.EXCHANGE_OPERANDS, []);
}
void _addProposal_importAddShow() {
@@ -841,7 +844,7 @@
String showCombinator = ' show ${StringUtils.join(referencedNames, ', ')}';
_addInsertEdit(importDirective.end - 1, showCombinator);
// add proposal
- _addAssist(AssistKind.IMPORT_ADD_SHOW, []);
+ _addAssist(DartAssistKind.IMPORT_ADD_SHOW, []);
}
void _addProposal_introduceLocalTestedType() {
@@ -919,7 +922,7 @@
builder.setExitOffset();
// add proposal
_insertBuilder(builder);
- _addAssist(AssistKind.INTRODUCE_LOCAL_CAST_TYPE, []);
+ _addAssist(DartAssistKind.INTRODUCE_LOCAL_CAST_TYPE, []);
}
void _addProposal_invertIf() {
@@ -943,7 +946,7 @@
_addReplaceEdit(rangeNode(thenStatement), elseSource);
_addReplaceEdit(rangeNode(elseStatement), thenSource);
// add proposal
- _addAssist(AssistKind.INVERT_IF_STATEMENT, []);
+ _addAssist(DartAssistKind.INVERT_IF_STATEMENT, []);
}
void _addProposal_joinIfStatementInner() {
@@ -1003,7 +1006,7 @@
'if ($condition) {$eol$newSource$prefix}');
}
// done
- _addAssist(AssistKind.JOIN_IF_WITH_INNER, []);
+ _addAssist(DartAssistKind.JOIN_IF_WITH_INNER, []);
}
void _addProposal_joinIfStatementOuter() {
@@ -1065,7 +1068,7 @@
'if ($condition) {$eol$newSource$prefix}');
}
// done
- _addAssist(AssistKind.JOIN_IF_WITH_OUTER, []);
+ _addAssist(DartAssistKind.JOIN_IF_WITH_OUTER, []);
}
void _addProposal_joinVariableDeclaration_onAssignment() {
@@ -1135,7 +1138,7 @@
_addReplaceEdit(rangeEndStart(declNode, assignOffset), ' ');
}
// add proposal
- _addAssist(AssistKind.JOIN_VARIABLE_DECLARATION, []);
+ _addAssist(DartAssistKind.JOIN_VARIABLE_DECLARATION, []);
}
void _addProposal_joinVariableDeclaration_onDeclaration() {
@@ -1197,7 +1200,7 @@
_addReplaceEdit(rangeEndStart(decl.name, assignOffset), ' ');
}
// add proposal
- _addAssist(AssistKind.JOIN_VARIABLE_DECLARATION, []);
+ _addAssist(DartAssistKind.JOIN_VARIABLE_DECLARATION, []);
}
void _addProposal_removeTypeAnnotation() {
@@ -1246,7 +1249,7 @@
_addReplaceEdit(typeRange, 'var ');
}
// add proposal
- _addAssist(AssistKind.REMOVE_TYPE_ANNOTATION, []);
+ _addAssist(DartAssistKind.REMOVE_TYPE_ANNOTATION, []);
}
void _addProposal_replaceConditionalWithIfElse() {
@@ -1343,7 +1346,7 @@
_addReplaceEdit(rangeNode(statement), src);
}
// add proposal
- _addAssist(AssistKind.REPLACE_CONDITIONAL_WITH_IF_ELSE, []);
+ _addAssist(DartAssistKind.REPLACE_CONDITIONAL_WITH_IF_ELSE, []);
}
void _addProposal_replaceIfElseWithConditional() {
@@ -1391,7 +1394,7 @@
}
}
// add proposal
- _addAssist(AssistKind.REPLACE_IF_ELSE_WITH_CONDITIONAL, []);
+ _addAssist(DartAssistKind.REPLACE_IF_ELSE_WITH_CONDITIONAL, []);
}
void _addProposal_splitAndCondition() {
@@ -1480,7 +1483,7 @@
_addIndentEdit(linesRange, thenIndentOld, thenIndentNew);
}
// add proposal
- _addAssist(AssistKind.SPLIT_AND_CONDITION, []);
+ _addAssist(DartAssistKind.SPLIT_AND_CONDITION, []);
}
void _addProposal_splitVariableDeclaration() {
@@ -1513,7 +1516,7 @@
SourceRange assignRange = rangeEndLength(statement, 0);
_addReplaceEdit(assignRange, eol + indent + name + ' = ' + initSrc + ';');
// add proposal
- _addAssist(AssistKind.SPLIT_VARIABLE_DECLARATION, []);
+ _addAssist(DartAssistKind.SPLIT_VARIABLE_DECLARATION, []);
}
void _addProposal_surroundWith() {
@@ -1556,7 +1559,7 @@
_addInsertEdit(statementsRange.end, '$indentOld}$eol');
exitPosition = _newPosition(lastStatement.end);
// add proposal
- _addAssist(AssistKind.SURROUND_WITH_BLOCK, []);
+ _addAssist(DartAssistKind.SURROUND_WITH_BLOCK, []);
}
// "if"
{
@@ -1578,7 +1581,7 @@
sb.append(eol);
_insertBuilder(sb, statementsRange.length);
// add proposal
- _addAssist(AssistKind.SURROUND_WITH_IF, []);
+ _addAssist(DartAssistKind.SURROUND_WITH_IF, []);
}
// "while"
{
@@ -1600,7 +1603,7 @@
sb.append(eol);
_insertBuilder(sb, statementsRange.length);
// add proposal
- _addAssist(AssistKind.SURROUND_WITH_WHILE, []);
+ _addAssist(DartAssistKind.SURROUND_WITH_WHILE, []);
}
// "for-in"
{
@@ -1628,7 +1631,7 @@
sb.append(eol);
_insertBuilder(sb, statementsRange.length);
// add proposal
- _addAssist(AssistKind.SURROUND_WITH_FOR_IN, []);
+ _addAssist(DartAssistKind.SURROUND_WITH_FOR_IN, []);
}
// "for"
{
@@ -1668,7 +1671,7 @@
sb.append(eol);
_insertBuilder(sb, statementsRange.length);
// add proposal
- _addAssist(AssistKind.SURROUND_WITH_FOR, []);
+ _addAssist(DartAssistKind.SURROUND_WITH_FOR, []);
}
// "do-while"
{
@@ -1690,7 +1693,7 @@
sb.append(eol);
_insertBuilder(sb, statementsRange.length);
// add proposal
- _addAssist(AssistKind.SURROUND_WITH_DO_WHILE, []);
+ _addAssist(DartAssistKind.SURROUND_WITH_DO_WHILE, []);
}
// "try-catch"
{
@@ -1730,7 +1733,7 @@
sb.append(eol);
_insertBuilder(sb, statementsRange.length);
// add proposal
- _addAssist(AssistKind.SURROUND_WITH_TRY_CATCH, []);
+ _addAssist(DartAssistKind.SURROUND_WITH_TRY_CATCH, []);
}
// "try-finally"
{
@@ -1763,7 +1766,7 @@
//
_insertBuilder(sb, statementsRange.length);
// add proposal
- _addAssist(AssistKind.SURROUND_WITH_TRY_FINALLY, []);
+ _addAssist(DartAssistKind.SURROUND_WITH_TRY_FINALLY, []);
}
}
@@ -1904,6 +1907,18 @@
}
}
+/**
+ * An [AssistContributor] that provides the default set of assists.
+ */
+class DefaultAssistContributor extends DartAssistContributor {
+ @override
+ List<Assist> internalComputeAssists(
+ CompilationUnit unit, int offset, int length) {
+ AssistProcessor processor = new AssistProcessor(unit, offset, length);
+ return processor.compute();
+ }
+}
+
class _SimpleIdentifierRecursiveAstVisitor extends RecursiveAstVisitor {
final _SimpleIdentifierVisitor visitor;
diff --git a/pkg/analysis_server/lib/src/services/correction/fix.dart b/pkg/analysis_server/lib/src/services/correction/fix.dart
index beb3367..3de01d3 100644
--- a/pkg/analysis_server/lib/src/services/correction/fix.dart
+++ b/pkg/analysis_server/lib/src/services/correction/fix.dart
@@ -2,46 +2,43 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-library services.correction.fix;
+library analysis_server.src.services.correction.fix;
-import 'package:analysis_server/src/protocol.dart' show SourceChange;
-import 'package:analysis_server/src/services/correction/fix_internal.dart';
-import 'package:analyzer/src/generated/ast.dart';
+import 'package:analysis_server/edit/fix/fix_core.dart';
+import 'package:analysis_server/src/plugin/server_plugin.dart';
+import 'package:analyzer/src/generated/engine.dart';
import 'package:analyzer/src/generated/error.dart';
+import 'package:analyzer/src/generated/java_engine.dart';
/**
- * Computes [Fix]s for the given [AnalysisError].
- *
- * Returns the computed [Fix]s, not `null`.
+ * Compute and return the fixes available for the given [error]. The error was
+ * reported after it's source was analyzed in the given [context]. The [plugin]
+ * is used to get the list of fix contributors.
*/
-List<Fix> computeFixes(CompilationUnit unit, AnalysisError error) {
- var processor = new FixProcessor(unit, error);
- List<Fix> fixes = processor.compute();
- fixes.sort((Fix a, Fix b) {
- return a.kind.relevance - b.kind.relevance;
- });
- return fixes;
-}
-
-/**
- * A description of a single proposed fix for some problem.
- */
-class Fix {
- final FixKind kind;
- final SourceChange change;
-
- Fix(this.kind, this.change);
-
- @override
- String toString() {
- return '[kind=$kind, change=$change]';
+List<Fix> computeFixes(
+ ServerPlugin plugin, AnalysisContext context, AnalysisError error) {
+ List<Fix> fixes = <Fix>[];
+ List<FixContributor> contributors = plugin.fixContributors;
+ for (FixContributor contributor in contributors) {
+ try {
+ List<Fix> contributedFixes = contributor.computeFixes(context, error);
+ if (contributedFixes != null) {
+ fixes.addAll(contributedFixes);
+ }
+ } catch (exception, stackTrace) {
+ AnalysisEngine.instance.logger.logError(
+ 'Exception from fix contributor: ${contributor.runtimeType}',
+ new CaughtException(exception, stackTrace));
+ }
}
+ fixes.sort(Fix.SORT_BY_RELEVANCE);
+ return fixes;
}
/**
* An enumeration of possible quick fix kinds.
*/
-class FixKind {
+class DartFixKind {
static const ADD_ASYNC =
const FixKind('ADD_ASYNC', 50, "Add 'async' modifier");
static const ADD_FIELD_FORMAL_PARAMETERS = const FixKind(
@@ -91,6 +88,8 @@
const FixKind('INSERT_SEMICOLON', 50, "Insert ';'");
static const MAKE_CLASS_ABSTRACT =
const FixKind('MAKE_CLASS_ABSTRACT', 50, "Make class '{0}' abstract");
+ static const REMOVE_DEAD_CODE =
+ const FixKind('REMOVE_DEAD_CODE', 50, "Remove dead code");
static const REMOVE_PARAMETERS_IN_GETTER_DECLARATION = const FixKind(
'REMOVE_PARAMETERS_IN_GETTER_DECLARATION', 50,
"Remove parameters in getter declaration");
@@ -99,8 +98,8 @@
"Remove parentheses in getter invocation");
static const REMOVE_UNNECASSARY_CAST =
const FixKind('REMOVE_UNNECASSARY_CAST', 50, "Remove unnecessary cast");
- static const REMOVE_UNUSED_CATCH_CLAUSE = const FixKind(
- 'REMOVE_UNUSED_CATCH', 50, "Remove unused 'catch' clause");
+ static const REMOVE_UNUSED_CATCH_CLAUSE =
+ const FixKind('REMOVE_UNUSED_CATCH', 50, "Remove unused 'catch' clause");
static const REMOVE_UNUSED_CATCH_STACK = const FixKind(
'REMOVE_UNUSED_CATCH_STACK', 50, "Remove unused stack trace variable");
static const REMOVE_UNUSED_IMPORT =
@@ -122,13 +121,4 @@
const FixKind('USE_EQ_EQ_NULL', 50, "Use == null instead of 'is Null'");
static const USE_NOT_EQ_NULL =
const FixKind('USE_NOT_EQ_NULL', 50, "Use != null instead of 'is! Null'");
-
- final name;
- final int relevance;
- final String message;
-
- const FixKind(this.name, this.relevance, this.message);
-
- @override
- String toString() => name;
}
diff --git a/pkg/analysis_server/lib/src/services/correction/fix_internal.dart b/pkg/analysis_server/lib/src/services/correction/fix_internal.dart
index f38c00c9..9ae3c0e 100644
--- a/pkg/analysis_server/lib/src/services/correction/fix_internal.dart
+++ b/pkg/analysis_server/lib/src/services/correction/fix_internal.dart
@@ -2,10 +2,12 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-library services.src.correction.fix;
+library analysis_server.src.services.correction.fix_internal;
import 'dart:collection';
+import 'package:analysis_server/edit/fix/fix_core.dart';
+import 'package:analysis_server/edit/fix/fix_dart.dart';
import 'package:analysis_server/src/protocol.dart'
hide AnalysisError, Element, ElementKind;
import 'package:analysis_server/src/protocol_server.dart'
@@ -38,6 +40,17 @@
typedef bool ElementPredicate(Element argument);
/**
+ * A [FixContributor] that provides the default set of fixes.
+ */
+class DefaultFixContributor extends DartFixContributor {
+ @override
+ List<Fix> internalComputeFixes(CompilationUnit unit, AnalysisError error) {
+ FixProcessor processor = new FixProcessor(unit, error);
+ return processor.compute();
+ }
+}
+
+/**
* The computer for Dart fixes.
*/
class FixProcessor {
@@ -66,6 +79,7 @@
int errorOffset;
int errorLength;
int errorEnd;
+ SourceRange errorRange;
AstNode node;
AstNode coveredNode;
@@ -92,6 +106,7 @@
errorOffset = error.offset;
errorLength = error.length;
errorEnd = errorOffset + errorLength;
+ errorRange = new SourceRange(errorOffset, errorLength);
node = new NodeLocator.con1(errorOffset).searchWithin(unit);
coveredNode = new NodeLocator.con2(errorOffset, errorOffset + errorLength)
.searchWithin(unit);
@@ -137,6 +152,9 @@
_addFix_createPartUri();
_addFix_replaceImportUri();
}
+ if (errorCode == HintCode.DEAD_CODE) {
+ _addFix_removeDeadCode();
+ }
if (errorCode == HintCode.DIVISION_OPTIMIZATION) {
_addFix_useEffectiveIntegerDivision();
}
@@ -317,9 +335,9 @@
AstNode node = this.node;
if (_isAwaitNode()) {
FunctionBody body = node.getAncestor((n) => n is FunctionBody);
- if (body.keyword == null) {
+ if (body != null && body.keyword == null) {
_addReplaceEdit(rf.rangeStartLength(body, 0), 'async ');
- _addFix(FixKind.ADD_ASYNC, []);
+ _addFix(DartFixKind.ADD_ASYNC, []);
return true;
}
}
@@ -329,7 +347,7 @@
void _addFix_boolInsteadOfBoolean() {
SourceRange range = rf.rangeError(error);
_addReplaceEdit(range, 'bool');
- _addFix(FixKind.REPLACE_BOOLEAN_WITH_BOOL, []);
+ _addFix(DartFixKind.REPLACE_BOOLEAN_WITH_BOOL, []);
}
void _addFix_createClass() {
@@ -362,7 +380,7 @@
_insertBuilder(sb, unitElement);
_addLinkedPosition('NAME', sb, rf.rangeNode(node));
// add proposal
- _addFix(FixKind.CREATE_CLASS, [name]);
+ _addFix(DartFixKind.CREATE_CLASS, [name]);
}
}
@@ -409,7 +427,7 @@
// insert source
_insertBuilder(sb, unitElement);
// add proposal
- _addFix(FixKind.CREATE_CONSTRUCTOR_FOR_FINAL_FIELDS, []);
+ _addFix(DartFixKind.CREATE_CONSTRUCTOR_FOR_FINAL_FIELDS, []);
}
void _addFix_createConstructor_insteadOfSyntheticDefault() {
@@ -471,7 +489,7 @@
// insert source
_insertBuilder(sb, targetElement);
// add proposal
- _addFix(FixKind.CREATE_CONSTRUCTOR, [constructorName]);
+ _addFix(DartFixKind.CREATE_CONSTRUCTOR, [constructorName]);
}
void _addFix_createConstructor_named() {
@@ -535,7 +553,7 @@
_addLinkedPosition('NAME', sb, rf.rangeNode(name));
}
// add proposal
- _addFix(FixKind.CREATE_CONSTRUCTOR, [constructorName]);
+ _addFix(DartFixKind.CREATE_CONSTRUCTOR, [constructorName]);
}
void _addFix_createConstructorSuperExplicit() {
@@ -601,7 +619,7 @@
_insertBuilder(sb, unitElement);
// add proposal
String proposalName = _getConstructorProposalName(superConstructor);
- _addFix(FixKind.ADD_SUPER_CONSTRUCTOR_INVOCATION, [proposalName]);
+ _addFix(DartFixKind.ADD_SUPER_CONSTRUCTOR_INVOCATION, [proposalName]);
}
}
@@ -673,7 +691,7 @@
_insertBuilder(sb, unitElement);
// add proposal
String proposalName = _getConstructorProposalName(superConstructor);
- _addFix(FixKind.CREATE_CONSTRUCTOR_SUPER, [proposalName]);
+ _addFix(DartFixKind.CREATE_CONSTRUCTOR_SUPER, [proposalName]);
}
}
@@ -708,6 +726,9 @@
if (target is Identifier) {
Identifier targetIdentifier = target;
Element targetElement = targetIdentifier.staticElement;
+ if (targetElement == null) {
+ return;
+ }
staticModifier = targetElement.kind == ElementKind.CLASS;
}
} else {
@@ -755,7 +776,7 @@
_addLinkedPosition('NAME', sb, rf.rangeNode(node));
}
// add proposal
- _addFix(FixKind.CREATE_FIELD, [name]);
+ _addFix(DartFixKind.CREATE_FIELD, [name]);
}
void _addFix_createFunction_forFunctionType() {
@@ -889,7 +910,7 @@
_addLinkedPosition('NAME', sb, rf.rangeNode(node));
}
// add proposal
- _addFix(FixKind.CREATE_GETTER, [name]);
+ _addFix(DartFixKind.CREATE_GETTER, [name]);
}
void _addFix_createImportUri() {
@@ -905,7 +926,7 @@
change.addEdit(file, -1, edit);
doSourceChange_addSourceEdit(change, context, source, edit);
}
- _addFix(FixKind.CREATE_FILE, [file]);
+ _addFix(DartFixKind.CREATE_FILE, [file]);
}
}
}
@@ -923,7 +944,7 @@
assignment.operator.type == TokenType.EQ &&
assignment.parent is ExpressionStatement) {
_addInsertEdit(node.offset, 'var ');
- _addFix(FixKind.CREATE_LOCAL_VARIABLE, [name]);
+ _addFix(DartFixKind.CREATE_LOCAL_VARIABLE, [name]);
return;
}
}
@@ -961,7 +982,7 @@
// add linked positions
_addLinkedPosition('NAME', sb, rf.rangeNode(node));
// add proposal
- _addFix(FixKind.CREATE_LOCAL_VARIABLE, [name]);
+ _addFix(DartFixKind.CREATE_LOCAL_VARIABLE, [name]);
}
void _addFix_createMissingOverrides(List<ExecutableElement> elements) {
@@ -1018,7 +1039,7 @@
// add proposal
exitPosition = new Position(file, insertOffset);
_insertBuilder(sb, unitElement);
- _addFix(FixKind.CREATE_MISSING_OVERRIDES, [numElements]);
+ _addFix(DartFixKind.CREATE_MISSING_OVERRIDES, [numElements]);
}
void _addFix_createMissingOverrides_single(SourceBuilder sb,
@@ -1096,7 +1117,7 @@
_insertBuilder(sb, unitElement);
exitPosition = new Position(file, insertOffset);
// add proposal
- _addFix(FixKind.CREATE_NO_SUCH_METHOD, []);
+ _addFix(DartFixKind.CREATE_NO_SUCH_METHOD, []);
}
void _addFix_createPartUri() {
@@ -1109,7 +1130,7 @@
SourceEdit edit = new SourceEdit(0, 0, 'part of $libName;$eol$eol');
change.addEdit(file, -1, edit);
doSourceChange_addSourceEdit(change, context, source, edit);
- _addFix(FixKind.CREATE_FILE, [file]);
+ _addFix(DartFixKind.CREATE_FILE, [file]);
}
}
}
@@ -1129,7 +1150,7 @@
}
_addReplaceEdit(rf.rangeNode(typeName), returnTypeCode);
// add proposal
- _addFix(FixKind.REPLACE_RETURN_TYPE_FUTURE, []);
+ _addFix(DartFixKind.REPLACE_RETURN_TYPE_FUTURE, []);
}
void _addFix_importLibrary(FixKind kind, String importPath) {
@@ -1173,7 +1194,6 @@
if (name.startsWith('_')) {
return;
}
-
// may be there is an existing import,
// but it is with prefix and we don't use this prefix
for (ImportElement imp in unitLibraryElement.imports) {
@@ -1194,7 +1214,7 @@
if (prefix != null) {
SourceRange range = rf.rangeStartLength(node, 0);
_addReplaceEdit(range, '${prefix.displayName}.');
- _addFix(FixKind.IMPORT_LIBRARY_PREFIX, [
+ _addFix(DartFixKind.IMPORT_LIBRARY_PREFIX, [
libraryElement.displayName,
prefix.displayName
]);
@@ -1218,7 +1238,7 @@
String newShowCode = 'show ${StringUtils.join(showNames, ", ")}';
_addReplaceEdit(
rf.rangeOffsetEnd(showCombinator), newShowCode, unitLibraryElement);
- _addFix(FixKind.IMPORT_LIBRARY_SHOW, [libraryName]);
+ _addFix(DartFixKind.IMPORT_LIBRARY_SHOW, [libraryName]);
// we support only one import without prefix
return;
}
@@ -1250,7 +1270,7 @@
continue;
}
// add import
- _addFix_importLibrary(FixKind.IMPORT_LIBRARY_SDK, libraryUri);
+ _addFix_importLibrary(DartFixKind.IMPORT_LIBRARY_SDK, libraryUri);
}
}
// check project libraries
@@ -1285,14 +1305,14 @@
String libraryPackageUri = findAbsoluteUri(context, libraryFile);
if (libraryPackageUri != null) {
_addFix_importLibrary(
- FixKind.IMPORT_LIBRARY_PROJECT, libraryPackageUri);
+ DartFixKind.IMPORT_LIBRARY_PROJECT, libraryPackageUri);
continue;
}
}
// relative URI
String relativeFile = relative(libraryFile, from: unitLibraryFolder);
relativeFile = split(relativeFile).join('/');
- _addFix_importLibrary(FixKind.IMPORT_LIBRARY_PROJECT, relativeFile);
+ _addFix_importLibrary(DartFixKind.IMPORT_LIBRARY_PROJECT, relativeFile);
}
}
}
@@ -1330,7 +1350,7 @@
}
int insertOffset = error.offset + error.length;
_addInsertEdit(insertOffset, ';');
- _addFix(FixKind.INSERT_SEMICOLON, []);
+ _addFix(DartFixKind.INSERT_SEMICOLON, []);
}
}
@@ -1339,7 +1359,7 @@
IsExpression isExpression = coveredNode as IsExpression;
_addReplaceEdit(
rf.rangeEndEnd(isExpression.expression, isExpression), ' != null');
- _addFix(FixKind.USE_NOT_EQ_NULL, []);
+ _addFix(DartFixKind.USE_NOT_EQ_NULL, []);
}
}
@@ -1348,7 +1368,7 @@
IsExpression isExpression = coveredNode as IsExpression;
_addReplaceEdit(
rf.rangeEndEnd(isExpression.expression, isExpression), ' == null');
- _addFix(FixKind.USE_EQ_EQ_NULL, []);
+ _addFix(DartFixKind.USE_EQ_EQ_NULL, []);
}
}
@@ -1357,7 +1377,39 @@
node.getAncestor((node) => node is ClassDeclaration);
String className = enclosingClass.name.name;
_addInsertEdit(enclosingClass.classKeyword.offset, 'abstract ');
- _addFix(FixKind.MAKE_CLASS_ABSTRACT, [className]);
+ _addFix(DartFixKind.MAKE_CLASS_ABSTRACT, [className]);
+ }
+
+ void _addFix_removeDeadCode() {
+ AstNode coveringNode = this.coveredNode;
+ if (coveringNode is Expression) {
+ AstNode parent = coveredNode.parent;
+ if (parent is BinaryExpression) {
+ if (parent.rightOperand == coveredNode) {
+ _addRemoveEdit(rf.rangeEndEnd(parent.leftOperand, coveredNode));
+ _addFix(DartFixKind.REMOVE_DEAD_CODE, []);
+ }
+ }
+ } else if (coveringNode is Block) {
+ Block block = coveringNode;
+ List<Statement> statementsToRemove = <Statement>[];
+ for (Statement statement in block.statements) {
+ if (rf.rangeNode(statement).intersects(errorRange)) {
+ statementsToRemove.add(statement);
+ }
+ }
+ if (statementsToRemove.isNotEmpty) {
+ SourceRange rangeToRemove =
+ utils.getLinesRangeStatements(statementsToRemove);
+ _addRemoveEdit(rangeToRemove);
+ _addFix(DartFixKind.REMOVE_DEAD_CODE, []);
+ }
+ } else if (coveringNode is Statement) {
+ SourceRange rangeToRemove =
+ utils.getLinesRangeStatements(<Statement>[coveringNode]);
+ _addRemoveEdit(rangeToRemove);
+ _addFix(DartFixKind.REMOVE_DEAD_CODE, []);
+ }
}
void _addFix_removeParameters_inGetterDeclaration() {
@@ -1366,7 +1418,7 @@
FunctionBody body = method.body;
if (method.name == node && body != null) {
_addReplaceEdit(rf.rangeEndStart(node, body), ' ');
- _addFix(FixKind.REMOVE_PARAMETERS_IN_GETTER_DECLARATION, []);
+ _addFix(DartFixKind.REMOVE_PARAMETERS_IN_GETTER_DECLARATION, []);
}
}
}
@@ -1376,7 +1428,7 @@
MethodInvocation invocation = node.parent as MethodInvocation;
if (invocation.methodName == node && invocation.target != null) {
_addRemoveEdit(rf.rangeEndEnd(node, invocation));
- _addFix(FixKind.REMOVE_PARENTHESIS_IN_GETTER_INVOCATION, []);
+ _addFix(DartFixKind.REMOVE_PARENTHESIS_IN_GETTER_INVOCATION, []);
}
}
}
@@ -1392,7 +1444,7 @@
_addRemoveEdit(rf.rangeEndEnd(expression, asExpression));
_removeEnclosingParentheses(asExpression, expressionPrecedence);
// done
- _addFix(FixKind.REMOVE_UNNECASSARY_CAST, []);
+ _addFix(DartFixKind.REMOVE_UNNECASSARY_CAST, []);
}
void _addFix_removeUnusedCatchClause() {
@@ -1402,7 +1454,7 @@
catchClause.exceptionParameter == node) {
_addRemoveEdit(
rf.rangeStartStart(catchClause.catchKeyword, catchClause.body));
- _addFix(FixKind.REMOVE_UNUSED_CATCH_CLAUSE, []);
+ _addFix(DartFixKind.REMOVE_UNUSED_CATCH_CLAUSE, []);
}
}
}
@@ -1414,7 +1466,7 @@
catchClause.stackTraceParameter == node &&
catchClause.exceptionParameter != null) {
_addRemoveEdit(rf.rangeEndEnd(catchClause.exceptionParameter, node));
- _addFix(FixKind.REMOVE_UNUSED_CATCH_STACK, []);
+ _addFix(DartFixKind.REMOVE_UNUSED_CATCH_STACK, []);
}
}
}
@@ -1429,7 +1481,7 @@
// remove the whole line with import
_addRemoveEdit(utils.getLinesRange(rf.rangeNode(importDirective)));
// done
- _addFix(FixKind.REMOVE_UNUSED_IMPORT, []);
+ _addFix(DartFixKind.REMOVE_UNUSED_IMPORT, []);
}
void _addFix_replaceImportUri() {
@@ -1452,7 +1504,7 @@
// add fix
SourceRange range = rf.rangeNode(node);
_addReplaceEdit(range, "'$fixedUri'");
- _addFix(FixKind.REPLACE_IMPORT_URI, [fixedUri]);
+ _addFix(DartFixKind.REPLACE_IMPORT_URI, [fixedUri]);
}
}
}
@@ -1461,14 +1513,14 @@
void _addFix_replaceVarWithDynamic() {
SourceRange range = rf.rangeError(error);
_addReplaceEdit(range, 'dynamic');
- _addFix(FixKind.REPLACE_VAR_WITH_DYNAMIC, []);
+ _addFix(DartFixKind.REPLACE_VAR_WITH_DYNAMIC, []);
}
void _addFix_replaceWithConstInstanceCreation() {
if (coveredNode is InstanceCreationExpression) {
var instanceCreation = coveredNode as InstanceCreationExpression;
_addReplaceEdit(rf.rangeToken(instanceCreation.keyword), 'const');
- _addFix(FixKind.USE_CONST, []);
+ _addFix(DartFixKind.USE_CONST, []);
}
}
@@ -1498,7 +1550,7 @@
_addReplaceEdit(rf.rangeNode(node), closestName);
// add proposal
if (closestName != null) {
- _addFix(FixKind.CHANGE_TO, [closestName]);
+ _addFix(DartFixKind.CHANGE_TO, [closestName]);
}
}
}
@@ -1555,7 +1607,7 @@
if (finder._element != null) {
String closestName = finder._element.name;
_addReplaceEdit(rf.rangeNode(node), closestName);
- _addFix(FixKind.CHANGE_TO, [closestName]);
+ _addFix(DartFixKind.CHANGE_TO, [closestName]);
}
}
}
@@ -1602,7 +1654,7 @@
_insertBuilder(sb, unitElement);
_addLinkedPosition('NAME', sb, rf.rangeNode(node));
// add proposal
- _addFix(FixKind.CREATE_FUNCTION, [name]);
+ _addFix(DartFixKind.CREATE_FUNCTION, [name]);
}
void _addFix_undefinedFunction_useSimilar() {
@@ -1626,7 +1678,7 @@
if (finder._element != null) {
String closestName = finder._element.name;
_addReplaceEdit(rf.rangeNode(node), closestName);
- _addFix(FixKind.CHANGE_TO, [closestName]);
+ _addFix(DartFixKind.CHANGE_TO, [closestName]);
}
}
}
@@ -1710,7 +1762,7 @@
_addLinkedPosition('NAME', sb, rf.rangeNode(node));
}
// add proposal
- _addFix(FixKind.CREATE_METHOD, [name]);
+ _addFix(DartFixKind.CREATE_METHOD, [name]);
}
}
@@ -1794,7 +1846,7 @@
_addInsertEdit(offset, fieldParametersCode);
}
// add proposal
- _addFix(FixKind.ADD_FIELD_FORMAL_PARAMETERS, []);
+ _addFix(DartFixKind.ADD_FIELD_FORMAL_PARAMETERS, []);
}
}
@@ -1814,7 +1866,7 @@
_addRemoveEdit(rf.rangeStartStart(n, binary.leftOperand));
_addRemoveEdit(rf.rangeEndEnd(binary.rightOperand, n));
// add proposal
- _addFix(FixKind.USE_EFFECTIVE_INTEGER_DIVISION, []);
+ _addFix(DartFixKind.USE_EFFECTIVE_INTEGER_DIVISION, []);
// done
break;
}
@@ -1835,7 +1887,7 @@
SourceRange range = rf.rangeNode(target);
_addReplaceEdit(range, declaringTypeCode);
// add proposal
- _addFix(FixKind.CHANGE_TO_STATIC_ACCESS, [declaringType]);
+ _addFix(DartFixKind.CHANGE_TO_STATIC_ACCESS, [declaringType]);
}
}
@@ -1875,7 +1927,7 @@
void _addLinkedPosition(String groupId, SourceBuilder sb, SourceRange range) {
// prepare offset
int offset = range.offset;
- if (sb.offset < offset) {
+ if (sb.offset <= offset) {
int delta = sb.length;
offset += delta;
}
@@ -1967,7 +2019,7 @@
_addProposal_createFunction(functionType, name, unitSource, insertOffset,
false, prefix, sourcePrefix, sourceSuffix, unitElement);
// add proposal
- _addFix(FixKind.CREATE_FUNCTION, [name]);
+ _addFix(DartFixKind.CREATE_FUNCTION, [name]);
}
/**
@@ -1996,7 +2048,7 @@
_inStaticContext(), prefix, sourcePrefix, sourceSuffix,
targetClassElement);
// add proposal
- _addFix(FixKind.CREATE_METHOD, [name]);
+ _addFix(DartFixKind.CREATE_METHOD, [name]);
}
/**
diff --git a/pkg/analysis_server/lib/src/services/index/index.dart b/pkg/analysis_server/lib/src/services/index/index.dart
index c033fd6..4582ac8 100644
--- a/pkg/analysis_server/lib/src/services/index/index.dart
+++ b/pkg/analysis_server/lib/src/services/index/index.dart
@@ -50,8 +50,8 @@
* [relationship] - the relationship between the given element and the
* locations to be returned.
*/
- Future<List<Location>> getRelationships(
- Element element, Relationship relationship);
+ Future<List<LocationImpl>> getRelationships(
+ Element element, RelationshipImpl relationship);
/**
* Returns top-level [Element]s whose names satisfy to [nameFilter].
@@ -131,98 +131,100 @@
* Defines an Element.
* Right: an Element declaration.
*/
- static final Relationship DEFINES = Relationship.getRelationship("defines");
+ static final RelationshipImpl DEFINES =
+ RelationshipImpl.getRelationship("defines");
/**
* Left: class.
* Is extended by.
* Right: other class declaration.
*/
- static final Relationship IS_EXTENDED_BY =
- Relationship.getRelationship("is-extended-by");
+ static final RelationshipImpl IS_EXTENDED_BY =
+ RelationshipImpl.getRelationship("is-extended-by");
/**
* Left: class.
* Is implemented by.
* Right: other class declaration.
*/
- static final Relationship IS_IMPLEMENTED_BY =
- Relationship.getRelationship("is-implemented-by");
+ static final RelationshipImpl IS_IMPLEMENTED_BY =
+ RelationshipImpl.getRelationship("is-implemented-by");
/**
* Left: class.
* Is mixed into.
* Right: other class declaration.
*/
- static final Relationship IS_MIXED_IN_BY =
- Relationship.getRelationship("is-mixed-in-by");
+ static final RelationshipImpl IS_MIXED_IN_BY =
+ RelationshipImpl.getRelationship("is-mixed-in-by");
/**
* Left: local variable, parameter.
* Is read at.
* Right: location.
*/
- static final Relationship IS_READ_BY =
- Relationship.getRelationship("is-read-by");
+ static final RelationshipImpl IS_READ_BY =
+ RelationshipImpl.getRelationship("is-read-by");
/**
* Left: local variable, parameter.
* Is both read and written at.
* Right: location.
*/
- static final Relationship IS_READ_WRITTEN_BY =
- Relationship.getRelationship("is-read-written-by");
+ static final RelationshipImpl IS_READ_WRITTEN_BY =
+ RelationshipImpl.getRelationship("is-read-written-by");
/**
* Left: local variable, parameter.
* Is written at.
* Right: location.
*/
- static final Relationship IS_WRITTEN_BY =
- Relationship.getRelationship("is-written-by");
+ static final RelationshipImpl IS_WRITTEN_BY =
+ RelationshipImpl.getRelationship("is-written-by");
/**
* Left: function, method, variable, getter.
* Is invoked at.
* Right: location.
*/
- static final Relationship IS_INVOKED_BY =
- Relationship.getRelationship("is-invoked-by");
+ static final RelationshipImpl IS_INVOKED_BY =
+ RelationshipImpl.getRelationship("is-invoked-by");
/**
* Left: function, function type, class, field, method.
* Is referenced (and not invoked, read/written) at.
* Right: location.
*/
- static final Relationship IS_REFERENCED_BY =
- Relationship.getRelationship("is-referenced-by");
+ static final RelationshipImpl IS_REFERENCED_BY =
+ RelationshipImpl.getRelationship("is-referenced-by");
/**
* Left: name element.
* Is defined by.
* Right: concrete element declaration.
*/
- static final Relationship NAME_IS_DEFINED_BY =
- Relationship.getRelationship("name-is-defined-by");
+ static final RelationshipImpl NAME_IS_DEFINED_BY =
+ RelationshipImpl.getRelationship("name-is-defined-by");
IndexConstants._();
}
/**
- * Instances of the class [Location] represent a location related to an element.
+ * Instances of the class [LocationImpl] represent a location related to an
+ * element.
*
* The location is expressed as an offset and length, but the offset is relative
* to the resource containing the element rather than the start of the element
* within that resource.
*/
-class Location {
+class LocationImpl {
static const int _FLAG_QUALIFIED = 1 << 0;
static const int _FLAG_RESOLVED = 1 << 1;
/**
* An empty array of locations.
*/
- static const List<Location> EMPTY_ARRAY = const <Location>[];
+ static const List<LocationImpl> EMPTY_ARRAY = const <LocationImpl>[];
/**
* The element containing this location.
@@ -252,7 +254,7 @@
* [offset] - the offset within the resource containing [element].
* [length] - the length of this location
*/
- Location(this.element, this.offset, this.length,
+ LocationImpl(this.element, this.offset, this.length,
{bool isQualified: false, bool isResolved: true}) {
if (element == null) {
throw new ArgumentError("element location cannot be null");
@@ -290,12 +292,12 @@
}
/**
- * A [Location] with attached data.
+ * A [LocationImpl] with attached data.
*/
-class LocationWithData<D> extends Location {
+class LocationWithData<D> extends LocationImpl {
final D data;
- LocationWithData(Location location, this.data)
+ LocationWithData(LocationImpl location, this.data)
: super(location.element, location.offset, location.length);
}
@@ -317,11 +319,11 @@
* Relationship between an element and a location. Relationships are identified
* by a globally unique identifier.
*/
-class Relationship {
+class RelationshipImpl {
/**
* A table mapping relationship identifiers to relationships.
*/
- static Map<String, Relationship> _RELATIONSHIP_MAP = {};
+ static Map<String, RelationshipImpl> _RELATIONSHIP_MAP = {};
/**
* The next artificial hash code.
@@ -341,7 +343,7 @@
/**
* Initialize a newly created relationship with the given unique identifier.
*/
- Relationship(this.identifier);
+ RelationshipImpl(this.identifier);
@override
int get hashCode => _hashCode;
@@ -352,10 +354,10 @@
/**
* Returns the relationship with the given unique [identifier].
*/
- static Relationship getRelationship(String identifier) {
- Relationship relationship = _RELATIONSHIP_MAP[identifier];
+ static RelationshipImpl getRelationship(String identifier) {
+ RelationshipImpl relationship = _RELATIONSHIP_MAP[identifier];
if (relationship == null) {
- relationship = new Relationship(identifier);
+ relationship = new RelationshipImpl(identifier);
_RELATIONSHIP_MAP[identifier] = relationship;
}
return relationship;
diff --git a/pkg/analysis_server/lib/src/services/index/index_contributor.dart b/pkg/analysis_server/lib/src/services/index/index_contributor.dart
index d2ac8a7..b5bef6b 100644
--- a/pkg/analysis_server/lib/src/services/index/index_contributor.dart
+++ b/pkg/analysis_server/lib/src/services/index/index_contributor.dart
@@ -21,7 +21,7 @@
* Adds data to [store] based on the resolved Dart [unit].
*/
void indexDartUnit(
- IndexStore store, AnalysisContext context, CompilationUnit unit) {
+ InternalIndexStore store, AnalysisContext context, CompilationUnit unit) {
// check unit
if (unit == null) {
return;
@@ -45,7 +45,7 @@
* Adds data to [store] based on the resolved HTML [unit].
*/
void indexHtmlUnit(
- IndexStore store, AnalysisContext context, ht.HtmlUnit unit) {
+ InternalIndexStore store, AnalysisContext context, ht.HtmlUnit unit) {
// check unit
if (unit == null) {
return;
@@ -65,10 +65,10 @@
}
/**
- * Visits a resolved AST and adds relationships into [IndexStore].
+ * Visits a resolved AST and adds relationships into [InternalIndexStore].
*/
class _IndexContributor extends GeneralizingAstVisitor {
- final IndexStore _store;
+ final InternalIndexStore _store;
LibraryElement _libraryElement;
@@ -102,10 +102,11 @@
}
/**
- * Record the given relationship between the given [Element] and [Location].
+ * Record the given relationship between the given [Element] and
+ * [LocationImpl].
*/
void recordRelationship(
- Element element, Relationship relationship, Location location) {
+ Element element, RelationshipImpl relationship, LocationImpl location) {
if (element != null && location != null) {
_store.recordRelationship(element, relationship, location);
}
@@ -229,7 +230,7 @@
// field reference is write here
if (fieldName != null) {
Element element = fieldName.staticElement;
- Location location = _createLocationForNode(fieldName);
+ LocationImpl location = _createLocationForNode(fieldName);
_store.recordRelationship(
element, IndexConstants.IS_WRITTEN_BY, location);
}
@@ -249,7 +250,7 @@
element = element.redirectedConstructor;
}
// prepare location
- Location location;
+ LocationImpl location;
if (node.name != null) {
int start = node.period.offset;
int end = node.name.end;
@@ -341,7 +342,8 @@
MethodElement element = node.bestElement;
if (element is MethodElement) {
Token operator = node.leftBracket;
- Location location = _createLocationForToken(operator, element != null);
+ LocationImpl location =
+ _createLocationForToken(operator, element != null);
recordRelationship(element, IndexConstants.IS_INVOKED_BY, location);
}
super.visitIndexExpression(node);
@@ -361,7 +363,7 @@
@override
visitMethodInvocation(MethodInvocation node) {
SimpleIdentifier name = node.methodName;
- Location location = _createLocationForNode(name);
+ LocationImpl location = _createLocationForNode(name);
// element invocation
Element element = name.bestElement;
if (element is MethodElement ||
@@ -383,14 +385,14 @@
@override
visitPartDirective(PartDirective node) {
Element element = node.element;
- Location location = _createLocationForNode(node.uri);
+ LocationImpl location = _createLocationForNode(node.uri);
recordRelationship(element, IndexConstants.IS_REFERENCED_BY, location);
super.visitPartDirective(node);
}
@override
visitPartOfDirective(PartOfDirective node) {
- Location location = _createLocationForNode(node.libraryName);
+ LocationImpl location = _createLocationForNode(node.libraryName);
recordRelationship(node.element, IndexConstants.IS_REFERENCED_BY, location);
}
@@ -409,7 +411,7 @@
@override
visitRedirectingConstructorInvocation(RedirectingConstructorInvocation node) {
ConstructorElement element = node.staticElement;
- Location location;
+ LocationImpl location;
if (node.constructorName != null) {
int start = node.period.offset;
int end = node.constructorName.end;
@@ -425,7 +427,7 @@
@override
visitSimpleIdentifier(SimpleIdentifier node) {
Element nameElement = new NameElement(node.name);
- Location location = _createLocationForNode(node);
+ LocationImpl location = _createLocationForNode(node);
// name in declaration
if (node.inDeclarationContext()) {
recordRelationship(
@@ -456,7 +458,7 @@
}
// this.field parameter
if (element is FieldFormalParameterElement) {
- Relationship relationship = peekElement() == element
+ RelationshipImpl relationship = peekElement() == element
? IndexConstants.IS_WRITTEN_BY
: IndexConstants.IS_REFERENCED_BY;
_store.recordRelationship(element.field, relationship, location);
@@ -496,7 +498,7 @@
@override
visitSuperConstructorInvocation(SuperConstructorInvocation node) {
ConstructorElement element = node.staticElement;
- Location location;
+ LocationImpl location;
if (node.constructorName != null) {
int start = node.period.offset;
int end = node.constructorName.end;
@@ -536,7 +538,7 @@
// record declaration
{
SimpleIdentifier name = node.name;
- Location location = _createLocationForNode(name);
+ LocationImpl location = _createLocationForNode(name);
location = _getLocationWithExpressionType(location, node.initializer);
recordRelationship(element, IndexConstants.NAME_IS_DEFINED_BY, location);
}
@@ -575,16 +577,16 @@
}
/**
- * @return the [Location] representing location of the [AstNode].
+ * @return the [LocationImpl] representing location of the [AstNode].
*/
- Location _createLocationForNode(AstNode node) {
+ LocationImpl _createLocationForNode(AstNode node) {
bool isQualified = _isQualifiedClassMemberAccess(node);
bool isResolved = true;
if (node is SimpleIdentifier) {
isResolved = node.bestElement != null;
}
Element element = peekElement();
- return new Location(element, node.offset, node.length,
+ return new LocationImpl(element, node.offset, node.length,
isQualified: isQualified, isResolved: isResolved);
}
@@ -592,20 +594,20 @@
* [offset] - the offset of the location within [Source].
* [length] - the length of the location.
*
- * Returns the [Location] representing the given offset and length within the
+ * Returns the [LocationImpl] representing the given offset and length within the
* inner-most [Element].
*/
- Location _createLocationForOffset(int offset, int length) {
+ LocationImpl _createLocationForOffset(int offset, int length) {
Element element = peekElement();
- return new Location(element, offset, length);
+ return new LocationImpl(element, offset, length);
}
/**
- * @return the [Location] representing location of the [Token].
+ * @return the [LocationImpl] representing location of the [Token].
*/
- Location _createLocationForToken(Token token, bool isResolved) {
+ LocationImpl _createLocationForToken(Token token, bool isResolved) {
Element element = peekElement();
- return new Location(element, token.offset, token.length,
+ return new LocationImpl(element, token.offset, token.length,
isQualified: true, isResolved: isResolved);
}
@@ -664,7 +666,7 @@
ImportElement importElement = internal_getImportElement(
_libraryElement, null, element, _importElementsMap);
if (importElement != null) {
- Location location = _createLocationForOffset(node.offset, 0);
+ LocationImpl location = _createLocationForOffset(node.offset, 0);
recordRelationship(
importElement, IndexConstants.IS_REFERENCED_BY, location);
}
@@ -679,7 +681,7 @@
if (info != null) {
int offset = prefixNode.offset;
int length = info.periodEnd - offset;
- Location location = _createLocationForOffset(offset, length);
+ LocationImpl location = _createLocationForOffset(offset, length);
recordRelationship(
info.element, IndexConstants.IS_REFERENCED_BY, location);
}
@@ -691,7 +693,7 @@
*/
void _recordLibraryReference(UriBasedDirective node, LibraryElement library) {
if (library != null) {
- Location location = _createLocationForNode(node.uri);
+ LocationImpl location = _createLocationForNode(node.uri);
recordRelationship(library.definingCompilationUnit,
IndexConstants.IS_REFERENCED_BY, location);
}
@@ -702,7 +704,7 @@
*/
void _recordOperatorReference(Token operator, Element element) {
// prepare location
- Location location = _createLocationForToken(operator, element != null);
+ LocationImpl location = _createLocationForToken(operator, element != null);
// record name reference
{
String name = operator.lexeme;
@@ -727,7 +729,7 @@
/**
* Records a relation between [superNode] and its [Element].
*/
- void _recordSuperType(TypeName superNode, Relationship relationship) {
+ void _recordSuperType(TypeName superNode, RelationshipImpl relationship) {
if (superNode != null) {
Identifier superName = superNode.name;
if (superName != null) {
@@ -742,19 +744,19 @@
* Records the [Element] definition in the library and universe.
*/
void _recordTopLevelElementDefinition(Element element) {
- Location location = createLocation(element);
+ LocationImpl location = createLocation(element);
recordRelationship(_libraryElement, IndexConstants.DEFINES, location);
_store.recordTopLevelDeclaration(element);
}
/**
- * Creates a [Location] representing declaration of the [Element].
+ * Creates a [LocationImpl] representing declaration of the [Element].
*/
- static Location createLocation(Element element) {
+ static LocationImpl createLocation(Element element) {
if (element != null) {
int offset = element.nameOffset;
int length = element.displayName.length;
- return new Location(element, offset, length);
+ return new LocationImpl(element, offset, length);
}
return null;
}
@@ -765,8 +767,8 @@
* [location] - the base location
* [expression] - the expression assigned at the given location
*/
- static Location _getLocationWithExpressionType(
- Location location, Expression expression) {
+ static LocationImpl _getLocationWithExpressionType(
+ LocationImpl location, Expression expression) {
if (expression != null) {
return new LocationWithData<DartType>(location, expression.bestType);
}
diff --git a/pkg/analysis_server/lib/src/services/index/index_store.dart b/pkg/analysis_server/lib/src/services/index/index_store.dart
index 7163d16..8dd931a 100644
--- a/pkg/analysis_server/lib/src/services/index/index_store.dart
+++ b/pkg/analysis_server/lib/src/services/index/index_store.dart
@@ -15,7 +15,7 @@
* A container with information computed by an index - relations between
* elements.
*/
-abstract class IndexStore {
+abstract class InternalIndexStore {
/**
* Answers index statistics.
*/
@@ -76,11 +76,11 @@
*
* [element] - the the [Element] that has the relationship with the locations
* to be returned.
- * [relationship] - the [Relationship] between the given element and the
+ * [relationship] - the [RelationshipImpl] between the given element and the
* locations to be returned
*/
- Future<List<Location>> getRelationships(
- Element element, Relationship relationship);
+ Future<List<LocationImpl>> getRelationships(
+ Element element, RelationshipImpl relationship);
/**
* Returns top-level [Element]s whose names satisfy to [nameFilter].
@@ -107,11 +107,11 @@
* would be a list containing both `location1` and `location2`.
*
* [element] - the [Element] that is related to the location.
- * [relationship] - the [Relationship] between the element and the location.
- * [location] the [Location] where relationship happens.
+ * [relationship] - the [RelationshipImpl] between the element and the location.
+ * [location] the [LocationImpl] where relationship happens.
*/
void recordRelationship(
- Element element, Relationship relationship, Location location);
+ Element element, RelationshipImpl relationship, LocationImpl location);
/**
* Records the declaration of the given top-level [element].
diff --git a/pkg/analysis_server/lib/src/services/index/local_index.dart b/pkg/analysis_server/lib/src/services/index/local_index.dart
index e9deeda..a11db6d 100644
--- a/pkg/analysis_server/lib/src/services/index/local_index.dart
+++ b/pkg/analysis_server/lib/src/services/index/local_index.dart
@@ -44,15 +44,15 @@
/**
* Returns a `Future<List<Location>>` that completes with the list of
- * [Location]s of the given [relationship] with the given [element].
+ * [LocationImpl]s of the given [relationship] with the given [element].
*
* For example, if the [element] represents a function and the [relationship]
* is the `is-invoked-by` relationship, then the locations will be all of the
* places where the function is invoked.
*/
@override
- Future<List<Location>> getRelationships(
- Element element, Relationship relationship) {
+ Future<List<LocationImpl>> getRelationships(
+ Element element, RelationshipImpl relationship) {
return _store.getRelationships(element, relationship);
}
diff --git a/pkg/analysis_server/lib/src/services/index/store/codec.dart b/pkg/analysis_server/lib/src/services/index/store/codec.dart
index f9190f0..0c2f816 100644
--- a/pkg/analysis_server/lib/src/services/index/store/codec.dart
+++ b/pkg/analysis_server/lib/src/services/index/store/codec.dart
@@ -181,12 +181,12 @@
RelationshipCodec(this._stringCodec);
- Relationship decode(int idIndex) {
+ RelationshipImpl decode(int idIndex) {
String id = _stringCodec.decode(idIndex);
- return Relationship.getRelationship(id);
+ return RelationshipImpl.getRelationship(id);
}
- int encode(Relationship relationship) {
+ int encode(RelationshipImpl relationship) {
String id = relationship.identifier;
return _stringCodec.encode(id);
}
diff --git a/pkg/analysis_server/lib/src/services/index/store/split_store.dart b/pkg/analysis_server/lib/src/services/index/store/split_store.dart
index 6610d8a..bde1d08 100644
--- a/pkg/analysis_server/lib/src/services/index/store/split_store.dart
+++ b/pkg/analysis_server/lib/src/services/index/store/split_store.dart
@@ -19,25 +19,6 @@
import 'package:analyzer/src/generated/source.dart';
import 'package:analyzer/src/generated/utilities_general.dart';
-class _TopElementData {
- final String name;
- final int elementId1;
- final int elementId2;
- final int elementId3;
-
- factory _TopElementData(ElementCodec elementCodec, Element element) {
- return new _TopElementData._(element.name, elementCodec.encode1(element),
- elementCodec.encode2(element), elementCodec.encode3(element));
- }
-
- _TopElementData._(
- this.name, this.elementId1, this.elementId2, this.elementId3);
-
- Element getElement(AnalysisContext context, ElementCodec elementCodec) {
- return elementCodec.decode(context, elementId1, elementId2, elementId3);
- }
-}
-
/**
* A manager for files content.
*/
@@ -291,22 +272,23 @@
*
* [element] - the the element that has the relationship with the locations to
* be returned.
- * [relationship] - the [Relationship] between the given [element] and the
+ * [relationship] - the [RelationshipImpl] between the given [element] and the
* locations to be returned
*/
- List<Location> getRelationships(Element element, Relationship relationship) {
+ List<LocationImpl> getRelationships(
+ Element element, RelationshipImpl relationship) {
// prepare key
RelationKeyData key = new RelationKeyData.forObject(
_elementCodec, _relationshipCodec, element, relationship);
// find LocationData(s)
List<LocationData> locationDatas = _relations[key];
if (locationDatas == null) {
- return Location.EMPTY_ARRAY;
+ return LocationImpl.EMPTY_ARRAY;
}
// convert to Location(s)
- List<Location> locations = <Location>[];
+ List<LocationImpl> locations = <LocationImpl>[];
for (LocationData locationData in locationDatas) {
- Location location = locationData.getLocation(context, _elementCodec);
+ LocationImpl location = locationData.getLocation(context, _elementCodec);
if (location != null) {
locations.add(location);
}
@@ -339,11 +321,11 @@
* Records that the given [element] and [location] have the given [relationship].
*
* [element] - the [Element] that is related to the location.
- * [relationship] - the [Relationship] between [element] and [location].
- * [location] - the [Location] where relationship happens.
+ * [relationship] - the [RelationshipImpl] between [element] and [location].
+ * [location] - the [LocationImpl] where relationship happens.
*/
void recordRelationship(
- Element element, Relationship relationship, Location location) {
+ Element element, RelationshipImpl relationship, LocationImpl location) {
RelationKeyData key = new RelationKeyData.forObject(
_elementCodec, _relationshipCodec, element, relationship);
// prepare LocationData(s)
@@ -359,7 +341,7 @@
class InspectLocation {
final String nodeName;
- final Relationship relationship;
+ final RelationshipImpl relationship;
final List<String> path;
final int offset;
final int length;
@@ -370,7 +352,7 @@
}
/**
- * A container with information about a [Location].
+ * A container with information about a [LocationImpl].
*/
class LocationData {
static const int _FLAG_QUALIFIED = 1 << 0;
@@ -386,7 +368,7 @@
LocationData.forData(this.elementId1, this.elementId2, this.elementId3,
this.offset, this.length, this.flags);
- LocationData.forObject(ElementCodec elementCodec, Location location)
+ LocationData.forObject(ElementCodec elementCodec, LocationImpl location)
: elementId1 = elementCodec.encode1(location.element),
elementId2 = elementCodec.encode2(location.element),
elementId3 = elementCodec.encode3(location.element),
@@ -423,7 +405,7 @@
/**
* Returns a {@link Location} that is represented by this {@link LocationData}.
*/
- Location getLocation(AnalysisContext context, ElementCodec elementCodec) {
+ LocationImpl getLocation(AnalysisContext context, ElementCodec elementCodec) {
Element element =
elementCodec.decode(context, elementId1, elementId2, elementId3);
if (element == null) {
@@ -431,7 +413,7 @@
}
bool isQualified = (flags & _FLAG_QUALIFIED) != 0;
bool isResovled = (flags & _FLAG_RESOLVED) != 0;
- return new Location(element, offset, length,
+ return new LocationImpl(element, offset, length,
isQualified: isQualified, isResolved: isResovled);
}
}
@@ -487,7 +469,7 @@
}
/**
- * An [Element] to [Location] relation key.
+ * An [Element] to [LocationImpl] relation key.
*/
class RelationKeyData {
final int elementId1;
@@ -500,7 +482,7 @@
RelationKeyData.forObject(ElementCodec elementCodec,
RelationshipCodec relationshipCodec, Element element,
- Relationship relationship)
+ RelationshipImpl relationship)
: elementId1 = elementCodec.encode1(element),
elementId2 = elementCodec.encode2(element),
elementId3 = elementCodec.encode3(element),
@@ -517,11 +499,6 @@
}
@override
- String toString() {
- return 'Key($elementId2, $elementId2, $elementId3, $relationshipId)';
- }
-
- @override
bool operator ==(Object obj) {
if (obj is! RelationKeyData) {
return false;
@@ -532,12 +509,18 @@
other.elementId3 == elementId3 &&
other.relationshipId == relationshipId;
}
+
+ @override
+ String toString() {
+ return 'Key($elementId2, $elementId2, $elementId3, $relationshipId)';
+ }
}
/**
- * An [IndexStore] which keeps index information in separate nodes for each unit.
+ * An [InternalIndexStore] which keeps index information in separate nodes for
+ * each unit.
*/
-class SplitIndexStore implements IndexStore {
+class SplitIndexStore implements InternalIndexStore {
/**
* The [ContextCodec] to encode/decode [AnalysisContext]s.
*/
@@ -581,8 +564,8 @@
* A table mapping element names to the node names that may have relations with elements with
* these names.
*/
- Map<Relationship, IntToIntSetMap> _relToNameMap =
- new HashMap<Relationship, IntToIntSetMap>();
+ Map<RelationshipImpl, IntToIntSetMap> _relToNameMap =
+ new HashMap<RelationshipImpl, IntToIntSetMap>();
/**
* The [NodeManager] to get/put [IndexNode]s.
@@ -728,8 +711,8 @@
}
}
- Future<List<Location>> getRelationships(
- Element element, Relationship relationship) {
+ Future<List<LocationImpl>> getRelationships(
+ Element element, RelationshipImpl relationship) {
// prepare node names
List<int> nodeNameIds;
{
@@ -742,23 +725,26 @@
}
}
// prepare Future(s) for reading each IndexNode
- List<Future<List<Location>>> nodeFutures = <Future<List<Location>>>[];
+ List<Future<List<LocationImpl>>> nodeFutures =
+ <Future<List<LocationImpl>>>[];
for (int nodeNameId in nodeNameIds) {
String nodeName = _stringCodec.decode(nodeNameId);
Future<IndexNode> nodeFuture = _nodeManager.getNode(nodeName);
- Future<List<Location>> locationsFuture = nodeFuture.then((node) {
+ Future<List<LocationImpl>> locationsFuture = nodeFuture.then((node) {
if (node == null) {
// TODO(scheglov) remove node
- return Location.EMPTY_ARRAY;
+ return LocationImpl.EMPTY_ARRAY;
}
return node.getRelationships(element, relationship);
});
nodeFutures.add(locationsFuture);
}
// return Future that merges separate IndexNode Location(s)
- return Future.wait(nodeFutures).then((List<List<Location>> locationsList) {
- List<Location> allLocations = <Location>[];
- for (List<Location> locations in locationsList) {
+ return Future
+ .wait(nodeFutures)
+ .then((List<List<LocationImpl>> locationsList) {
+ List<LocationImpl> allLocations = <LocationImpl>[];
+ for (List<LocationImpl> locations in locationsList) {
allLocations.addAll(locations);
}
return allLocations;
@@ -828,7 +814,7 @@
@override
void recordRelationship(
- Element element, Relationship relationship, Location location) {
+ Element element, RelationshipImpl relationship, LocationImpl location) {
if (element == null || element is MultiplyDefinedElement) {
return;
}
@@ -944,7 +930,8 @@
units.add(unit);
}
- void _recordNodeNameForElement(Element element, Relationship relationship) {
+ void _recordNodeNameForElement(
+ Element element, RelationshipImpl relationship) {
IntToIntSetMap nameToNodeNames = _relToNameMap[relationship];
if (nameToNodeNames == null) {
nameToNodeNames = new IntToIntSetMap();
@@ -1033,3 +1020,22 @@
_buf[_pos++] = value;
}
}
+
+class _TopElementData {
+ final String name;
+ final int elementId1;
+ final int elementId2;
+ final int elementId3;
+
+ factory _TopElementData(ElementCodec elementCodec, Element element) {
+ return new _TopElementData._(element.name, elementCodec.encode1(element),
+ elementCodec.encode2(element), elementCodec.encode3(element));
+ }
+
+ _TopElementData._(
+ this.name, this.elementId1, this.elementId2, this.elementId3);
+
+ Element getElement(AnalysisContext context, ElementCodec elementCodec) {
+ return elementCodec.decode(context, elementId1, elementId2, elementId3);
+ }
+}
diff --git a/pkg/analysis_server/lib/src/services/refactoring/extract_method.dart b/pkg/analysis_server/lib/src/services/refactoring/extract_method.dart
index 0603b43..2f85e83 100644
--- a/pkg/analysis_server/lib/src/services/refactoring/extract_method.dart
+++ b/pkg/analysis_server/lib/src/services/refactoring/extract_method.dart
@@ -70,7 +70,7 @@
CorrectionUtils utils;
Set<LibraryElement> librariesToImport = new Set<LibraryElement>();
- String returnType;
+ String returnType = '';
String variableType;
String name;
bool extractAll = true;
diff --git a/pkg/analysis_server/lib/src/services/search/search_engine_internal.dart b/pkg/analysis_server/lib/src/services/search/search_engine_internal.dart
index e5c80dd..d97cf42 100644
--- a/pkg/analysis_server/lib/src/services/search/search_engine_internal.dart
+++ b/pkg/analysis_server/lib/src/services/search/search_engine_internal.dart
@@ -6,11 +6,11 @@
import 'dart:async';
+import 'package:analysis_server/src/services/correction/source_range.dart';
import 'package:analysis_server/src/services/index/index.dart';
import 'package:analysis_server/src/services/search/search_engine.dart';
import 'package:analyzer/src/generated/element.dart';
import 'package:analyzer/src/generated/source.dart';
-import 'package:analysis_server/src/services/correction/source_range.dart';
/**
* A [SearchEngine] implementation.
@@ -197,11 +197,11 @@
_Requestor(this.index);
- void add(Element element, Relationship relationship, MatchKind kind) {
+ void add(Element element, RelationshipImpl relationship, MatchKind kind) {
Future relationsFuture = index.getRelationships(element, relationship);
- Future matchesFuture = relationsFuture.then((List<Location> locations) {
+ Future matchesFuture = relationsFuture.then((List<LocationImpl> locations) {
List<SearchMatch> matches = <SearchMatch>[];
- for (Location location in locations) {
+ for (LocationImpl location in locations) {
matches.add(new SearchMatch(kind, location.element,
new SourceRange(location.offset, location.length),
location.isResolved, location.isQualified));
diff --git a/pkg/analysis_server/lib/src/socket_server.dart b/pkg/analysis_server/lib/src/socket_server.dart
index 16814af..8fb9b8d 100644
--- a/pkg/analysis_server/lib/src/socket_server.dart
+++ b/pkg/analysis_server/lib/src/socket_server.dart
@@ -13,8 +13,8 @@
import 'package:analysis_server/src/source/optimizing_pub_package_map_provider.dart';
import 'package:analyzer/file_system/physical_file_system.dart';
import 'package:analyzer/instrumentation/instrumentation.dart';
-import 'package:analyzer/plugin/plugin.dart';
import 'package:analyzer/src/generated/sdk_io.dart';
+import 'package:plugin/plugin.dart';
/**
* Instances of the class [SocketServer] implement the common parts of
diff --git a/pkg/analysis_server/lib/src/utilities/change_builder_core.dart b/pkg/analysis_server/lib/src/utilities/change_builder_core.dart
new file mode 100644
index 0000000..9f0225b
--- /dev/null
+++ b/pkg/analysis_server/lib/src/utilities/change_builder_core.dart
@@ -0,0 +1,251 @@
+// Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+library analysis_server.src.utilities.change_builder_core;
+
+import 'package:analysis_server/src/protocol.dart';
+import 'package:analysis_server/utilities/change_builder_core.dart';
+import 'package:analyzer/src/generated/source.dart';
+
+/**
+ * A builder used to build a [SourceChange].
+ */
+class ChangeBuilderImpl implements ChangeBuilder {
+ /**
+ * The end-of-line marker used in the file being edited, or `null` if the
+ * default marker should be used.
+ */
+ String eol = null;
+
+ /**
+ * The change that is being built.
+ */
+ final SourceChange _change = new SourceChange('');
+
+ /**
+ * A table mapping group ids to the associated linked edit groups.
+ */
+ final Map<String, LinkedEditGroup> _linkedEditGroups =
+ <String, LinkedEditGroup>{};
+
+ /**
+ * Initialize a newly created change builder.
+ */
+ ChangeBuilderImpl();
+
+ @override
+ SourceChange get sourceChange {
+ _linkedEditGroups.forEach((String name, LinkedEditGroup group) {
+ _change.addLinkedEditGroup(group);
+ });
+ _linkedEditGroups.clear();
+ return _change;
+ }
+
+ @override
+ void addFileEdit(Source source, int fileStamp,
+ void buildFileEdit(FileEditBuilder builder)) {
+ FileEditBuilderImpl builder = createFileEditBuilder(source, fileStamp);
+ try {
+ buildFileEdit(builder);
+ } finally {
+ _change.addFileEdit(builder.fileEdit);
+ }
+ }
+
+ /**
+ * Create and return a [FileEditBuilder] that can be used to build edits to
+ * the given [source].
+ */
+ FileEditBuilderImpl createFileEditBuilder(Source source, int fileStamp) {
+ return new FileEditBuilderImpl(this, source, fileStamp);
+ }
+
+ /**
+ * Return the linked edit group with the given [groupName], creating it if it
+ * did not already exist.
+ */
+ LinkedEditGroup getLinkedEditGroup(String groupName) {
+ LinkedEditGroup group = _linkedEditGroups[groupName];
+ if (group == null) {
+ group = new LinkedEditGroup.empty();
+ _linkedEditGroups[groupName] = group;
+ }
+ return group;
+ }
+}
+
+/**
+ * A builder used to build a [SourceEdit] as part of a [SourceFileEdit].
+ */
+class EditBuilderImpl implements EditBuilder {
+ /**
+ * The builder being used to create the source file edit of which the source
+ * edit will be a part.
+ */
+ final FileEditBuilderImpl fileEditBuilder;
+
+ /**
+ * The offset of the region being replaced.
+ */
+ final int offset;
+
+ /**
+ * The length of the region being replaced.
+ */
+ final int length;
+
+ /**
+ * The end-of-line marker used in the file being edited, or `null` if the
+ * default marker should be used.
+ */
+ String _eol = null;
+
+ /**
+ * The buffer in which the content of the edit is being composed.
+ */
+ final StringBuffer _buffer = new StringBuffer();
+
+ /**
+ * Initialize a newly created builder to build a source edit.
+ */
+ EditBuilderImpl(this.fileEditBuilder, this.offset, this.length) {
+ _eol = fileEditBuilder.changeBuilder.eol;
+ }
+
+ /**
+ * Create and return an edit representing the replacement of a region of the
+ * file with the accumulated text.
+ */
+ SourceEdit get sourceEdit =>
+ new SourceEdit(offset, length, _buffer.toString());
+
+ @override
+ void addLinkedEdit(
+ String groupName, void buildLinkedEdit(LinkedEditBuilder builder)) {
+ LinkedEditBuilderImpl builder = createLinkedEditBuilder();
+ int start = offset + _buffer.length;
+ try {
+ buildLinkedEdit(builder);
+ } finally {
+ int end = offset + _buffer.length;
+ int length = end - start;
+ Position position = new Position(fileEditBuilder.fileEdit.file, start);
+ LinkedEditGroup group =
+ fileEditBuilder.changeBuilder.getLinkedEditGroup(groupName);
+ group.addPosition(position, length);
+ for (LinkedEditSuggestion suggestion in builder.suggestions) {
+ group.addSuggestion(suggestion);
+ }
+ }
+ }
+
+ LinkedEditBuilderImpl createLinkedEditBuilder() {
+ return new LinkedEditBuilderImpl(this);
+ }
+
+ @override
+ void write(String string) {
+ _buffer.write(string);
+ }
+
+ @override
+ void writeln([String string]) {
+ if (string != null) {
+ _buffer.write(string);
+ }
+ if (_eol == null) {
+ _buffer.writeln();
+ } else {
+ _buffer.write(_eol);
+ }
+ }
+}
+
+/**
+ * A builder used to build a [SourceFileEdit] within a [SourceChange].
+ */
+class FileEditBuilderImpl implements FileEditBuilder {
+ /**
+ * The builder being used to create the source change of which the source file
+ * edit will be a part.
+ */
+ final ChangeBuilderImpl changeBuilder;
+
+ /**
+ * The source file edit that is being built.
+ */
+ final SourceFileEdit fileEdit;
+
+ /**
+ * Initialize a newly created builder to build a source file edit within the
+ * change being built by the given [changeBuilder]. The file being edited has
+ * the given [timeStamp] and [timeStamp].
+ */
+ FileEditBuilderImpl(this.changeBuilder, Source source, int timeStamp)
+ : fileEdit = new SourceFileEdit(source.fullName, timeStamp);
+
+ @override
+ void addInsertion(int offset, void buildEdit(EditBuilder builder)) {
+ EditBuilderImpl builder = createEditBuilder(offset, 0);
+ try {
+ buildEdit(builder);
+ } finally {
+ fileEdit.add(builder.sourceEdit);
+ }
+ }
+
+ @override
+ void addLinkedPosition(int offset, int length, String groupName) {
+ LinkedEditGroup group = changeBuilder.getLinkedEditGroup(groupName);
+ Position position = new Position(fileEdit.file, offset);
+ group.addPosition(position, length);
+ }
+
+ @override
+ void addReplacement(
+ int offset, int length, void buildEdit(EditBuilder builder)) {
+ EditBuilderImpl builder = createEditBuilder(offset, length);
+ try {
+ buildEdit(builder);
+ } finally {
+ fileEdit.add(builder.sourceEdit);
+ }
+ }
+
+ EditBuilderImpl createEditBuilder(int offset, int length) {
+ return new EditBuilderImpl(this, offset, length);
+ }
+}
+
+/**
+ * A builder used to build a [LinkedEdit] region within an edit.
+ */
+class LinkedEditBuilderImpl implements LinkedEditBuilder {
+ final EditBuilderImpl editBuilder;
+
+ final List<LinkedEditSuggestion> suggestions = <LinkedEditSuggestion>[];
+
+ LinkedEditBuilderImpl(this.editBuilder);
+
+ @override
+ void addSuggestion(LinkedEditSuggestionKind kind, String value) {
+ suggestions.add(new LinkedEditSuggestion(value, kind));
+ }
+
+ @override
+ void addSuggestions(LinkedEditSuggestionKind kind, List<String> values) {
+ values.forEach((value) => addSuggestion(kind, value));
+ }
+
+ @override
+ void write(String string) {
+ editBuilder.write(string);
+ }
+
+ @override
+ void writeln([String string]) {
+ editBuilder.writeln(string);
+ }
+}
diff --git a/pkg/analysis_server/lib/src/utilities/change_builder_dart.dart b/pkg/analysis_server/lib/src/utilities/change_builder_dart.dart
new file mode 100644
index 0000000..e6b1de9
--- /dev/null
+++ b/pkg/analysis_server/lib/src/utilities/change_builder_dart.dart
@@ -0,0 +1,471 @@
+// Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+library analysis_server.src.utilities.change_builder_dart;
+
+import 'package:analysis_server/src/protocol.dart' hide ElementKind;
+import 'package:analysis_server/src/services/correction/name_suggestion.dart';
+import 'package:analysis_server/src/services/correction/util.dart';
+import 'package:analysis_server/src/utilities/change_builder_core.dart';
+import 'package:analysis_server/utilities/change_builder_core.dart';
+import 'package:analysis_server/utilities/change_builder_dart.dart';
+import 'package:analyzer/src/generated/ast.dart';
+import 'package:analyzer/src/generated/element.dart';
+import 'package:analyzer/src/generated/engine.dart';
+import 'package:analyzer/src/generated/scanner.dart';
+import 'package:analyzer/src/generated/source.dart';
+import 'package:analyzer/src/generated/utilities_dart.dart';
+
+/**
+ * A [ChangeBuilder] used to build changes in Dart files.
+ */
+class DartChangeBuilderImpl extends ChangeBuilderImpl
+ implements DartChangeBuilder {
+ /**
+ * The analysis context in which the files being edited were analyzed.
+ */
+ final AnalysisContext context;
+
+ /**
+ * Initialize a newly created change builder.
+ */
+ DartChangeBuilderImpl(this.context);
+
+ @override
+ DartFileEditBuilderImpl createFileEditBuilder(Source source, int fileStamp) {
+ return new DartFileEditBuilderImpl(this, source, fileStamp);
+ }
+}
+
+/**
+ * An [EditBuilder] used to build edits in Dart files.
+ */
+class DartEditBuilderImpl extends EditBuilderImpl implements DartEditBuilder {
+ /**
+ * A utility class used to help build the source code.
+ */
+ final CorrectionUtils utils;
+
+ /**
+ * Initialize a newly created builder to build a source edit.
+ */
+ DartEditBuilderImpl(
+ DartFileEditBuilderImpl sourceFileEditBuilder, int offset, int length)
+ : utils = sourceFileEditBuilder.utils,
+ super(sourceFileEditBuilder, offset, length);
+
+ DartFileEditBuilderImpl get dartFileEditBuilder => fileEditBuilder;
+
+ @override
+ void writeClassDeclaration(String name, {Iterable<DartType> interfaces,
+ bool isAbstract: false, void memberWriter(), Iterable<DartType> mixins,
+ String nameGroupName, DartType superclass}) {
+ // TODO(brianwilkerson) Add support for type parameters, probably as a
+ // parameterWriter parameter.
+ // TODO(brianwilkerson) Add a superclassGroupName parameter.
+ if (isAbstract) {
+ write(Keyword.ABSTRACT.syntax);
+ write(' ');
+ }
+ write('class ');
+ if (nameGroupName == null) {
+ write(name);
+ } else {
+ addLinkedEdit(DartEditBuilder.NAME_GROUP_ID, (LinkedEditBuilder builder) {
+ write(name);
+ });
+ }
+ if (superclass != null) {
+ write(' extends ');
+ writeType(superclass, groupName: DartEditBuilder.SUPERCLASS_GROUP_ID);
+ } else if (mixins != null && mixins.isNotEmpty) {
+ write(' extends Object ');
+ }
+ writeTypes(mixins, prefix: ' with ');
+ writeTypes(interfaces, prefix: ' implements ');
+ writeln(' {');
+ if (memberWriter != null) {
+ writeln();
+ memberWriter();
+ writeln();
+ }
+ write('}');
+ }
+
+ //@override
+ void writeConstructorDeclaration(ClassElement classElement,
+ {ArgumentList argumentList, SimpleIdentifier constructorName,
+ bool isConst: false}) {
+ // TODO(brianwilkerson) Clean up the API and add it to the public API.
+ //
+ // TODO(brianwilkerson) Support passing a list of final fields rather than
+ // an argument list.
+ if (isConst) {
+ write(Keyword.CONST.syntax);
+ write(' ');
+ }
+ write(classElement.name);
+ write('.');
+ if (constructorName != null) {
+ addLinkedEdit(DartEditBuilder.NAME_GROUP_ID, (LinkedEditBuilder builder) {
+ write(constructorName.name);
+ });
+ CompilationUnit unit = constructorName
+ .getAncestor((AstNode node) => node is CompilationUnit);
+ if (unit != null) {
+ CompilationUnitElement element = unit.element;
+ if (element != null) {
+ String referenceFile = element.source.fullName;
+ if (referenceFile == dartFileEditBuilder.fileEdit.file) {
+ dartFileEditBuilder.addLinkedPosition(constructorName.offset,
+ constructorName.length, DartEditBuilder.NAME_GROUP_ID);
+ }
+ }
+ }
+ }
+ if (argumentList != null) {
+ writeParametersMatchingArguments(argumentList);
+ } else {
+ write('()');
+ }
+ writeln(' {');
+ write(' }');
+ }
+
+ @override
+ void writeFieldDeclaration(String name, {void initializerWriter(),
+ bool isConst: false, bool isFinal: false, bool isStatic: false,
+ String nameGroupName, DartType type, String typeGroupName}) {
+ if (isStatic) {
+ write(Keyword.STATIC.syntax);
+ write(' ');
+ }
+ bool typeRequired = true;
+ if (isConst) {
+ write(Keyword.CONST.syntax);
+ typeRequired = false;
+ } else if (isFinal) {
+ write(Keyword.FINAL.syntax);
+ typeRequired = false;
+ }
+ if (type != null) {
+ writeType(type, groupName: typeGroupName);
+ } else if (typeRequired) {
+ write(Keyword.VAR.syntax);
+ }
+ write(' ');
+ if (nameGroupName != null) {
+ addLinkedEdit(nameGroupName, (LinkedEditBuilder builder) {
+ write(name);
+ });
+ } else {
+ write(name);
+ }
+ if (initializerWriter != null) {
+ write(' = ');
+ initializerWriter();
+ }
+ write(';');
+ }
+
+ @override
+ void writeGetterDeclaration(String name, {void bodyWriter(),
+ bool isStatic: false, String nameGroupName, DartType returnType,
+ String returnTypeGroupName}) {
+ if (isStatic) {
+ write(Keyword.STATIC.syntax);
+ write(' ');
+ }
+ if (returnType != null) {
+ writeType(returnType, groupName: returnTypeGroupName);
+ write(' ');
+ }
+ write(Keyword.GET.syntax);
+ write(' ');
+ if (nameGroupName != null) {
+ addLinkedEdit(nameGroupName, (LinkedEditBuilder builder) {
+ write(name);
+ });
+ } else {
+ write(name);
+ }
+ if (bodyWriter == null) {
+ write(' => null;');
+ } else {
+ write(' ');
+ bodyWriter();
+ }
+ }
+
+ @override
+ void writeOverrideOfInheritedMember(ExecutableElement member) {
+ // prepare environment
+ String prefix = utils.getIndent(1);
+ // may be property
+ String prefix2 = utils.getIndent(2);
+ ElementKind elementKind = member.kind;
+ bool isGetter = elementKind == ElementKind.GETTER;
+ bool isSetter = elementKind == ElementKind.SETTER;
+ bool isMethod = elementKind == ElementKind.METHOD;
+ bool isOperator = isMethod && (member as MethodElement).isOperator;
+ write(prefix);
+ if (isGetter) {
+ writeln('// TODO: implement ${member.displayName}');
+ write(prefix);
+ }
+ // @override
+ writeln('@override');
+ write(prefix);
+ // return type
+ // REVIEW: Added groupId
+ bool shouldReturn = writeType(member.type.returnType,
+ groupName: DartEditBuilder.RETURN_TYPE_GROUP_ID);
+ write(' ');
+ if (isGetter) {
+ write(Keyword.GET.syntax);
+ write(' ');
+ } else if (isSetter) {
+ write(Keyword.SET.syntax);
+ write(' ');
+ } else if (isOperator) {
+ write(Keyword.OPERATOR.syntax);
+ write(' ');
+ }
+ // name
+ write(member.displayName);
+ // parameters + body
+ if (isGetter) {
+ writeln(' => null;');
+ } else {
+ List<ParameterElement> parameters = member.parameters;
+ writeParameters(parameters);
+ writeln(' {');
+ // TO-DO
+ write(prefix2);
+ writeln('// TODO: implement ${member.displayName}');
+ // REVIEW: Added return statement.
+ if (shouldReturn) {
+ write(prefix2);
+ writeln('return null;');
+ }
+ // close method
+ write(prefix);
+ writeln('}');
+ }
+ }
+
+ @override
+ void writeParameters(Iterable<ParameterElement> parameters) {
+ write('(');
+ bool sawNamed = false;
+ bool sawPositional = false;
+ for (int i = 0; i < parameters.length; i++) {
+ ParameterElement parameter = parameters.elementAt(i);
+ if (i > 0) {
+ write(', ');
+ }
+ // may be optional
+ ParameterKind parameterKind = parameter.parameterKind;
+ if (parameterKind == ParameterKind.NAMED) {
+ if (!sawNamed) {
+ write('{');
+ sawNamed = true;
+ }
+ }
+ if (parameterKind == ParameterKind.POSITIONAL) {
+ if (!sawPositional) {
+ write('[');
+ sawPositional = true;
+ }
+ }
+ // parameter
+ writeParameterSource(parameter.type, parameter.name);
+ // default value
+ String defaultCode = parameter.defaultValueCode;
+ if (defaultCode != null) {
+ if (sawPositional) {
+ write(' = ');
+ } else {
+ write(': ');
+ }
+ write(defaultCode);
+ }
+ }
+ // close parameters
+ if (sawNamed) {
+ write('}');
+ }
+ if (sawPositional) {
+ write(']');
+ }
+ write(')');
+ }
+
+ @override
+ void writeParametersMatchingArguments(ArgumentList arguments) {
+ Set<String> excluded = new Set();
+ bool namedFound = false;
+ write('(');
+ List<Expression> argumentList = arguments.arguments;
+ for (int i = 0; i < argumentList.length; i++) {
+ Expression argument = argumentList[i];
+ DartType type = argument.bestType;
+ List<String> suggestions =
+ _getParameterNameSuggestions(excluded, type, argument, i);
+ String favorite = suggestions[0];
+ // append separator
+ if (i > 0) {
+ write(', ');
+ }
+ if (argument is NamedExpression) {
+ if (!namedFound) {
+ namedFound = true;
+ write('[');
+ }
+ favorite = argument.name.label.name;
+ }
+ // append type name
+ writeType(type, addSupertypeProposals: true, groupName: 'TYPE$i');
+ write(' ');
+ // append parameter name
+ excluded.add(favorite);
+ addLinkedEdit('ARG$i', (LinkedEditBuilder builder) {
+ builder.write(favorite);
+ builder.addSuggestions(LinkedEditSuggestionKind.PARAMETER, suggestions);
+ });
+ }
+ if (namedFound) {
+ write(']');
+ }
+ write(')');
+ }
+
+ @override
+ void writeParameterSource(DartType type, String name) {
+ String parameterSource = utils.getParameterSource(
+ type, name, dartFileEditBuilder.librariesToImport);
+ write(parameterSource);
+ }
+
+ @override
+ bool writeType(DartType type, {bool addSupertypeProposals: false,
+ String groupName, bool required: false}) {
+ if (type != null && !type.isDynamic) {
+ String typeSource =
+ utils.getTypeSource(type, dartFileEditBuilder.librariesToImport);
+ if (groupName != null) {
+ addLinkedEdit(groupName, (LinkedEditBuilder builder) {
+ write(typeSource);
+ if (addSupertypeProposals) {
+ _addSuperTypeProposals(builder, type, new Set<DartType>());
+ }
+ });
+ } else {
+ write(typeSource);
+ }
+ return true;
+ } else if (required) {
+ write(Keyword.VAR.syntax);
+ }
+ return false;
+ }
+
+ /**
+ * Write the code for a comma-separated list of [types], optionally prefixed
+ * by a [prefix]. If the list of [types] is `null` or does not return any
+ * types, then nothing will be written.
+ */
+ void writeTypes(Iterable<DartType> types, {String prefix}) {
+ if (types == null || types.isEmpty) {
+ return;
+ }
+ bool first = true;
+ for (DartType type in types) {
+ if (first) {
+ if (prefix != null) {
+ write(prefix);
+ }
+ first = false;
+ } else {
+ write(', ');
+ }
+ writeType(type);
+ }
+ }
+
+ void _addSuperTypeProposals(
+ LinkedEditBuilder builder, DartType type, Set<DartType> alreadyAdded) {
+ if (type != null &&
+ type.element is ClassElement &&
+ alreadyAdded.add(type)) {
+ ClassElement element = type.element as ClassElement;
+ builder.addSuggestion(LinkedEditSuggestionKind.TYPE, element.name);
+ _addSuperTypeProposals(builder, element.supertype, alreadyAdded);
+ for (InterfaceType interfaceType in element.interfaces) {
+ _addSuperTypeProposals(builder, interfaceType, alreadyAdded);
+ }
+ }
+ }
+
+ /**
+ * Return a list containing the suggested names for a parmeter with the given
+ * [type] whose value in one location is computed by the given [expression].
+ * The list will not contain any names in the set of [excluded] names. The
+ * [index] is the index of the argument, used to create a name if no better
+ * name could be created. The first name in the list will be the best name.
+ */
+ List<String> _getParameterNameSuggestions(
+ Set<String> excluded, DartType type, Expression expression, int index) {
+ List<String> suggestions =
+ getVariableNameSuggestionsForExpression(type, expression, excluded);
+ if (suggestions.length != 0) {
+ return suggestions;
+ }
+ return <String>['arg$index'];
+ }
+}
+
+/**
+ * A [FileEditBuilder] used to build edits for Dart files.
+ */
+class DartFileEditBuilderImpl extends FileEditBuilderImpl
+ implements DartFileEditBuilder {
+ /**
+ * The compilation unit to which the code will be added.
+ */
+ CompilationUnit unit;
+
+ /**
+ * A utility class used to help build the source code.
+ */
+ CorrectionUtils utils;
+
+ /**
+ * A set containing the elements of the libraries that need to be imported in
+ * order to make visible the names used in generated code.
+ */
+ Set<LibraryElement> librariesToImport = new Set<LibraryElement>();
+
+ /**
+ * Initialize a newly created builder to build a source file edit within the
+ * change being built by the given [changeBuilder]. The file being edited has
+ * the given [source] and [timeStamp].
+ */
+ DartFileEditBuilderImpl(
+ DartChangeBuilderImpl changeBuilder, Source source, int timeStamp)
+ : super(changeBuilder, source, timeStamp) {
+ AnalysisContext context = changeBuilder.context;
+ List<Source> librariesContaining = context.getLibrariesContaining(source);
+ if (librariesContaining.length < 1) {
+ throw new StateError('Cannot build edits for ${source.fullName}');
+ }
+ unit = context.resolveCompilationUnit2(source, librariesContaining[0]);
+ utils = new CorrectionUtils(unit);
+ }
+
+ @override
+ DartEditBuilderImpl createEditBuilder(int offset, int length) {
+ return new DartEditBuilderImpl(this, offset, length);
+ }
+}
diff --git a/pkg/analysis_server/lib/starter.dart b/pkg/analysis_server/lib/starter.dart
index 8d5658a..dae6a05 100644
--- a/pkg/analysis_server/lib/starter.dart
+++ b/pkg/analysis_server/lib/starter.dart
@@ -6,7 +6,7 @@
import 'package:analysis_server/src/server/driver.dart';
import 'package:analyzer/instrumentation/instrumentation.dart';
-import 'package:analyzer/plugin/plugin.dart';
+import 'package:plugin/plugin.dart';
/**
* An object that can be used to start an analysis server.
diff --git a/pkg/analysis_server/lib/utilities/change_builder_core.dart b/pkg/analysis_server/lib/utilities/change_builder_core.dart
new file mode 100644
index 0000000..7c69c46
--- /dev/null
+++ b/pkg/analysis_server/lib/utilities/change_builder_core.dart
@@ -0,0 +1,123 @@
+// Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+library analysis_server.utilities.change_builder_core;
+
+import 'package:analysis_server/src/utilities/change_builder_core.dart';
+import 'package:analysis_server/src/protocol.dart';
+import 'package:analyzer/src/generated/source.dart';
+
+/**
+ * A builder used to build a [SourceChange].
+ *
+ * Clients are not expected to subtype this class.
+ */
+abstract class ChangeBuilder {
+ /**
+ * Initialize a newly created change builder.
+ */
+ factory ChangeBuilder() = ChangeBuilderImpl;
+
+ /**
+ * Return the source change that was built.
+ */
+ SourceChange get sourceChange;
+
+ /**
+ * Use the [buildFileEdit] function to create a collection of edits to the
+ * given [source]. The edits will be added to the source change that is being
+ * built. The [timeStamp] is the time at which the [source] was last modified
+ * and is used by clients to ensure that it is safe to apply the edits.
+ */
+ void addFileEdit(Source source, int timeStamp,
+ void buildFileEdit(FileEditBuilder builder));
+}
+
+/**
+ * A builder used to build a [SourceEdit] as part of a [SourceFileEdit].
+ *
+ * Clients are not expected to subtype this class.
+ */
+abstract class EditBuilder {
+ /**
+ * Add a region of text that is part of the linked edit group with the given
+ * [groupName]. The [buildLinkedEdit] function is used to write the content of
+ * the region of text and to add suggestions for other possible values for
+ * that region.
+ */
+ void addLinkedEdit(
+ String groupName, void buildLinkedEdit(LinkedEditBuilder builder));
+
+ /**
+ * Add the given [string] to the content of the current edit.
+ */
+ void write(String string);
+
+ /**
+ * Add the given [string] to the content of the current edit and then add an
+ * end-of-line marker.
+ */
+ void writeln([String string]);
+}
+
+/**
+ * A builder used to build a [SourceFileEdit] within a [SourceChange].
+ *
+ * Clients are not expected to subtype this class.
+ */
+abstract class FileEditBuilder {
+ /**
+ * Add an insertion of text at the given [offset]. The [offset] is relative to
+ * the original source. The [buildEdit] function is used to write the text to
+ * be inserted. This is fully equivalent to
+ *
+ * addReplacement(offset, 0, buildEdit);
+ */
+ void addInsertion(int offset, void buildEdit(EditBuilder builder));
+
+ /**
+ * Add the region of text starting at the given [offset] and continuing for
+ * the given [length] to the linked edit group with the given [groupName].
+ * The [offset] is relative to the original source. This is typically used to
+ * include pre-existing regions of text in a group.
+ */
+ void addLinkedPosition(int offset, int length, String groupName);
+
+ /**
+ * Add a replacement of text starting at the given [offset] and continuing for
+ * the given [length]. The [offset] is relative to the original source. The
+ * [buildEdit] function is used to write the text that will replace the
+ * specified region.
+ */
+ void addReplacement(
+ int offset, int length, void buildEdit(EditBuilder builder));
+}
+
+/**
+ * A builder used to build a [LinkedEdit] region within an edit.
+ *
+ * Clients are not expected to subtype this class.
+ */
+abstract class LinkedEditBuilder {
+ /**
+ * Add the given [value] as a suggestion with the given [kind].
+ */
+ void addSuggestion(LinkedEditSuggestionKind kind, String value);
+
+ /**
+ * Add each of the given [values] as a suggestion with the given [kind].
+ */
+ void addSuggestions(LinkedEditSuggestionKind kind, Iterable<String> values);
+
+ /**
+ * Add the given [string] to the content of the current edit.
+ */
+ void write(String string);
+
+ /**
+ * Add the given [string] to the content of the current edit and then add an
+ * end-of-line marker.
+ */
+ void writeln([String string]);
+}
diff --git a/pkg/analysis_server/lib/utilities/change_builder_dart.dart b/pkg/analysis_server/lib/utilities/change_builder_dart.dart
new file mode 100644
index 0000000..b81b22a
--- /dev/null
+++ b/pkg/analysis_server/lib/utilities/change_builder_dart.dart
@@ -0,0 +1,142 @@
+// Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+library analysis_server.utilities.change_builder_dart;
+
+import 'package:analysis_server/src/utilities/change_builder_dart.dart';
+import 'package:analysis_server/utilities/change_builder_core.dart';
+import 'package:analyzer/src/generated/ast.dart';
+import 'package:analyzer/src/generated/element.dart';
+import 'package:analyzer/src/generated/engine.dart';
+
+/**
+ * A [ChangeBuilder] used to build changes in Dart files.
+ *
+ * Clients are not expected to subtype this class.
+ */
+abstract class DartChangeBuilder extends ChangeBuilder {
+ /**
+ * Initialize a newly created change builder.
+ */
+ factory DartChangeBuilder(AnalysisContext context) = DartChangeBuilderImpl;
+}
+
+/**
+ * An [EditBuilder] used to build edits in Dart files.
+ *
+ * Clients are not expected to subtype this class.
+ */
+abstract class DartEditBuilder extends EditBuilder {
+ /**
+ * The group-id used for the name of a declaration.
+ */
+ static const String NAME_GROUP_ID = 'NAME';
+
+ /**
+ * The group-id used for the return type of a function, getter or method.
+ */
+ static const String RETURN_TYPE_GROUP_ID = 'RETURN_TYPE';
+
+ /**
+ * The group-id used for the name of the superclass in a class declaration.
+ */
+ static const String SUPERCLASS_GROUP_ID = 'SUPERCLASS';
+
+ /**
+ * Write the code for a declaration of a class with the given [name]. If a
+ * list of [interfaces] is provided, then the class will implement those
+ * interfaces. If [isAbstract] is `true`, then the class will be abstract. If
+ * a [memberWriter] is provided, then it will be invoked to allow members to
+ * be generated. (The members will automatically be preceeded and followed by
+ * end-of-line markers.) If a list of [mixins] is provided, then the class
+ * will mix in those classes. If a [nameGroupName] is provided, then the name
+ * of the class will be included in the linked edit group with that name. If a
+ * [superclass] is given then it will be the superclass of the class. (If a
+ * list of [mixins] is provided but no [superclass] is given then the class
+ * will extend `Object`.)
+ */
+ void writeClassDeclaration(String name, {Iterable<DartType> interfaces,
+ bool isAbstract: false, void memberWriter(), Iterable<DartType> mixins,
+ String nameGroupName, DartType superclass});
+
+ /**
+ * Write the code for a declaration of a field with the given [name]. If an
+ * [initializerWriter] is provided, it will be invoked to write the content of
+ * the initializer. (The equal sign separating the field name from the
+ * initializer expression will automatically be written.) If [isConst] is
+ * `true`, then the declaration will be preceeded by the `const` keyword. If
+ * [isFinal] is `true`, then the declaration will be preceeded by the `final`
+ * keyword. (If both [isConst] and [isFinal] are `true`, then only the `const`
+ * keyword will be written.) If [isStatic] is `true`, then the declaration
+ * will be preceeded by the `static` keyword. If a [nameGroupName] is
+ * provided, the name of the field will be included in the linked edit group
+ * with that name. If a [type] is provided, then it will be used as the type
+ * of the field. (The keyword `var` will be provided automatically when
+ * required.) If a [typeGroupName] is provided, then if a type was written
+ * it will be in the linked edit group with that name.
+ */
+ void writeFieldDeclaration(String name, {void initializerWriter(),
+ bool isConst: false, bool isFinal: false, bool isStatic: false,
+ String nameGroupName, DartType type, String typeGroupName});
+
+ /**
+ * Write the code for a declaration of a getter with the given [name]. If a
+ * [bodyWriter] is provided, it will be invoked to write the body of the
+ * getter. (The space between the name and the body will automatically be
+ * written.) If [isStatic] is `true`, then the declaration will be preceeded
+ * by the `static` keyword. If a [nameGroupName] is provided, the name of the
+ * getter will be included in the linked edit group with that name. If a
+ * [returnType] is provided, then it will be used as the return type of the
+ * getter. If a [returnTypeGroupName] is provided, then if a return type was
+ * written it will be in the linked edit group with that name.
+ */
+ void writeGetterDeclaration(String name, {void bodyWriter(),
+ bool isStatic: false, String nameGroupName, DartType returnType,
+ String returnTypeGroupName});
+
+ /**
+ * Append a placeholder for an override of the specified inherited [member].
+ */
+ void writeOverrideOfInheritedMember(ExecutableElement member);
+
+ /**
+ * Write the code for a list of [parameters], including the surrounding
+ * parentheses.
+ */
+ void writeParameters(Iterable<ParameterElement> parameters);
+
+ /**
+ * Write the code for a list of parameters that would match the given list of
+ * [arguments], including the surrounding parentheses.
+ */
+ void writeParametersMatchingArguments(ArgumentList arguments);
+
+ /**
+ * Write the code for a single parameter with the given [type] and [name].
+ * The [type] can be `null` if no type is to be specified for the parameter.
+ */
+ void writeParameterSource(DartType type, String name);
+
+ /**
+ * Write the code for a type annotation for the given [type]. If the [type] is
+ * either `null` or represents the type 'dynamic', then the behavior depends
+ * on whether a type is [required]. If [required] is `true`, then 'var' will
+ * be written; otherwise, nothing is written.
+ *
+ * If the [groupName] is not `null`, then the name of the type (including type
+ * parameters) will be included as a region in the linked edit group with that
+ * name. If the [groupName] is not `null` and [addSupertypeProposals] is
+ * `true`, then all of the supertypes of the [type] will be added as
+ * suggestions for alternatives to the type name.
+ */
+ bool writeType(DartType type, {bool addSupertypeProposals: false,
+ String groupName, bool required: false});
+}
+
+/**
+ * A [FileEditBuilder] used to build edits for Dart files.
+ *
+ * Clients are not expected to subtype this class.
+ */
+abstract class DartFileEditBuilder extends FileEditBuilder {}
diff --git a/pkg/analysis_server/pubspec.yaml b/pkg/analysis_server/pubspec.yaml
index 927bdee..52f3479 100644
--- a/pkg/analysis_server/pubspec.yaml
+++ b/pkg/analysis_server/pubspec.yaml
@@ -4,17 +4,19 @@
description: A server that performs analysis of Dart code over character streams using JSON-RPC encoded information.
homepage: http://www.dartlang.org
environment:
- sdk: '>=1.0.0 <2.0.0'
+ sdk: '>=1.9.0 <2.0.0'
dependencies:
- analyzer: '>=0.24.1-alpha.0 <0.25.0'
- args: '>=0.12.1 <0.13.0'
+ analyzer: '>=0.25.0 <0.26.0'
+ args: '>=0.13.0 <0.14.0'
dart_style: '>=0.1.7 <0.2.0'
logging: any
path: any
+ plugin: '<0.2.0'
watcher: any
yaml: any
dev_dependencies:
- html5lib: any
+ html: any
mock: '>=0.11.0 <0.12.0'
+ test_reflective_loader: '>=0.0.3 <0.1.0'
typed_mock: '>=0.0.4 <1.0.0'
unittest: '>=0.11.4 <0.12.0'
diff --git a/pkg/analysis_server/test/abstract_context.dart b/pkg/analysis_server/test/abstract_context.dart
index bb9a85a..696a2ae 100644
--- a/pkg/analysis_server/test/abstract_context.dart
+++ b/pkg/analysis_server/test/abstract_context.dart
@@ -6,6 +6,7 @@
import 'package:analyzer/file_system/file_system.dart';
import 'package:analyzer/file_system/memory_file_system.dart';
+import 'package:analyzer/source/package_map_resolver.dart';
import 'package:analyzer/src/generated/ast.dart';
import 'package:analyzer/src/generated/element.dart';
import 'package:analyzer/src/generated/engine.dart';
@@ -41,9 +42,16 @@
static final UriResolver SDK_RESOLVER = new DartUriResolver(SDK);
MemoryResourceProvider provider = new MemoryResourceProvider();
+ Map<String, List<Folder>> packageMap;
UriResolver resourceResolver;
AnalysisContext context;
+ Source addPackageSource(String packageName, String filePath, String content) {
+ packageMap[packageName] = [(provider.newFolder('/pubcache/$packageName'))];
+ File file = provider.newFile('/pubcache/$packageName/$filePath', content);
+ return file.createSource();
+ }
+
Source addSource(String path, String content, [Uri uri]) {
File file = provider.newFile(path, content);
Source source = file.createSource(uri);
@@ -76,8 +84,12 @@
void setUp() {
resourceResolver = new ResourceUriResolver(provider);
+ packageMap = new Map<String, List<Folder>>();
+ PackageMapUriResolver packageResolver =
+ new PackageMapUriResolver(provider, packageMap);
context = AnalysisEngine.instance.createAnalysisContext();
- context.sourceFactory = new SourceFactory([SDK_RESOLVER, resourceResolver]);
+ context.sourceFactory =
+ new SourceFactory([SDK_RESOLVER, packageResolver, resourceResolver]);
}
void tearDown() {
diff --git a/pkg/analysis_server/test/analysis/get_errors_test.dart b/pkg/analysis_server/test/analysis/get_errors_test.dart
index 44e1fc5..846990d 100644
--- a/pkg/analysis_server/test/analysis/get_errors_test.dart
+++ b/pkg/analysis_server/test/analysis/get_errors_test.dart
@@ -9,14 +9,14 @@
import 'package:analysis_server/src/domain_analysis.dart';
import 'package:analysis_server/src/protocol.dart';
import 'package:analyzer/file_system/file_system.dart';
+import 'package:test_reflective_loader/test_reflective_loader.dart';
import 'package:unittest/unittest.dart';
import '../analysis_abstract.dart';
-import '../reflective_tests.dart';
main() {
groupSep = ' | ';
- runReflectiveTests(GetErrorsTest);
+ defineReflectiveTests(GetErrorsTest);
}
@reflectiveTest
diff --git a/pkg/analysis_server/test/analysis/get_hover_test.dart b/pkg/analysis_server/test/analysis/get_hover_test.dart
index 6428832..7261b3c 100644
--- a/pkg/analysis_server/test/analysis/get_hover_test.dart
+++ b/pkg/analysis_server/test/analysis/get_hover_test.dart
@@ -7,14 +7,14 @@
import 'dart:async';
import 'package:analysis_server/src/protocol.dart';
+import 'package:test_reflective_loader/test_reflective_loader.dart';
import 'package:unittest/unittest.dart';
import '../analysis_abstract.dart';
-import '../reflective_tests.dart';
main() {
groupSep = ' | ';
- runReflectiveTests(AnalysisHoverTest);
+ defineReflectiveTests(AnalysisHoverTest);
}
@reflectiveTest
diff --git a/pkg/analysis_server/test/analysis/notification_errors_test.dart b/pkg/analysis_server/test/analysis/notification_errors_test.dart
index d0195fd..3375ba4 100644
--- a/pkg/analysis_server/test/analysis/notification_errors_test.dart
+++ b/pkg/analysis_server/test/analysis/notification_errors_test.dart
@@ -7,14 +7,14 @@
import 'package:analysis_server/src/constants.dart';
import 'package:analysis_server/src/domain_analysis.dart';
import 'package:analysis_server/src/protocol.dart';
+import 'package:test_reflective_loader/test_reflective_loader.dart';
import 'package:unittest/unittest.dart';
import '../analysis_abstract.dart';
-import '../reflective_tests.dart';
main() {
groupSep = ' | ';
- runReflectiveTests(NotificationErrorsTest);
+ defineReflectiveTests(NotificationErrorsTest);
}
@reflectiveTest
diff --git a/pkg/analysis_server/test/analysis/notification_highlights_test.dart b/pkg/analysis_server/test/analysis/notification_highlights_test.dart
index e1bc205..5e08e7b 100644
--- a/pkg/analysis_server/test/analysis/notification_highlights_test.dart
+++ b/pkg/analysis_server/test/analysis/notification_highlights_test.dart
@@ -8,14 +8,14 @@
import 'package:analysis_server/src/constants.dart';
import 'package:analysis_server/src/protocol.dart';
+import 'package:test_reflective_loader/test_reflective_loader.dart';
import 'package:unittest/unittest.dart';
import '../analysis_abstract.dart';
-import '../reflective_tests.dart';
main() {
- runReflectiveTests(AnalysisNotificationHighlightsTest);
- runReflectiveTests(HighlightTypeTest);
+ defineReflectiveTests(AnalysisNotificationHighlightsTest);
+ defineReflectiveTests(HighlightTypeTest);
}
@reflectiveTest
diff --git a/pkg/analysis_server/test/analysis/notification_navigation_test.dart b/pkg/analysis_server/test/analysis/notification_navigation_test.dart
index 8c6dab0..cc24ca3 100644
--- a/pkg/analysis_server/test/analysis/notification_navigation_test.dart
+++ b/pkg/analysis_server/test/analysis/notification_navigation_test.dart
@@ -8,14 +8,14 @@
import 'package:analysis_server/src/constants.dart';
import 'package:analysis_server/src/protocol.dart';
+import 'package:test_reflective_loader/test_reflective_loader.dart';
import 'package:unittest/unittest.dart';
import '../analysis_abstract.dart';
-import '../reflective_tests.dart';
main() {
groupSep = ' | ';
- runReflectiveTests(AnalysisNotificationNavigationTest);
+ defineReflectiveTests(AnalysisNotificationNavigationTest);
}
@reflectiveTest
diff --git a/pkg/analysis_server/test/analysis/notification_occurrences_test.dart b/pkg/analysis_server/test/analysis/notification_occurrences_test.dart
index 2b78fbf..d7f8779 100644
--- a/pkg/analysis_server/test/analysis/notification_occurrences_test.dart
+++ b/pkg/analysis_server/test/analysis/notification_occurrences_test.dart
@@ -8,14 +8,14 @@
import 'package:analysis_server/src/constants.dart';
import 'package:analysis_server/src/protocol.dart';
+import 'package:test_reflective_loader/test_reflective_loader.dart';
import 'package:unittest/unittest.dart';
import '../analysis_abstract.dart';
-import '../reflective_tests.dart';
main() {
groupSep = ' | ';
- runReflectiveTests(AnalysisNotificationOccurrencesTest);
+ defineReflectiveTests(AnalysisNotificationOccurrencesTest);
}
@reflectiveTest
diff --git a/pkg/analysis_server/test/analysis/notification_outline_test.dart b/pkg/analysis_server/test/analysis/notification_outline_test.dart
index cae3f7b..6311762 100644
--- a/pkg/analysis_server/test/analysis/notification_outline_test.dart
+++ b/pkg/analysis_server/test/analysis/notification_outline_test.dart
@@ -8,13 +8,13 @@
import 'package:analysis_server/src/constants.dart';
import 'package:analysis_server/src/protocol.dart';
+import 'package:test_reflective_loader/test_reflective_loader.dart';
import 'package:unittest/unittest.dart';
import '../analysis_abstract.dart';
-import '../reflective_tests.dart';
main() {
- runReflectiveTests(_AnalysisNotificationOutlineTest);
+ defineReflectiveTests(_AnalysisNotificationOutlineTest);
}
@reflectiveTest
diff --git a/pkg/analysis_server/test/analysis/notification_overrides_test.dart b/pkg/analysis_server/test/analysis/notification_overrides_test.dart
index 17a1e49..cf272a0 100644
--- a/pkg/analysis_server/test/analysis/notification_overrides_test.dart
+++ b/pkg/analysis_server/test/analysis/notification_overrides_test.dart
@@ -8,14 +8,14 @@
import 'package:analysis_server/src/constants.dart';
import 'package:analysis_server/src/protocol.dart';
+import 'package:test_reflective_loader/test_reflective_loader.dart';
import 'package:unittest/unittest.dart';
import '../analysis_abstract.dart';
-import '../reflective_tests.dart';
main() {
groupSep = ' | ';
- runReflectiveTests(AnalysisNotificationOverridesTest);
+ defineReflectiveTests(AnalysisNotificationOverridesTest);
}
@reflectiveTest
diff --git a/pkg/analysis_server/test/analysis/reanalyze_test.dart b/pkg/analysis_server/test/analysis/reanalyze_test.dart
index 2e85d6d..0884fdb 100644
--- a/pkg/analysis_server/test/analysis/reanalyze_test.dart
+++ b/pkg/analysis_server/test/analysis/reanalyze_test.dart
@@ -7,14 +7,14 @@
import 'package:analysis_server/src/constants.dart';
import 'package:analysis_server/src/protocol.dart';
import 'package:analyzer/src/generated/engine.dart';
+import 'package:test_reflective_loader/test_reflective_loader.dart';
import 'package:unittest/unittest.dart';
import '../analysis_abstract.dart';
-import '../reflective_tests.dart';
main() {
groupSep = ' | ';
- runReflectiveTests(ReanalyzeTest);
+ defineReflectiveTests(ReanalyzeTest);
}
@reflectiveTest
diff --git a/pkg/analysis_server/test/analysis/update_content_test.dart b/pkg/analysis_server/test/analysis/update_content_test.dart
index 226b6c1..e137ab9 100644
--- a/pkg/analysis_server/test/analysis/update_content_test.dart
+++ b/pkg/analysis_server/test/analysis/update_content_test.dart
@@ -11,15 +11,15 @@
import 'package:analyzer/src/generated/ast.dart';
import 'package:analyzer/src/generated/engine.dart';
import 'package:analyzer/src/generated/source.dart';
+import 'package:test_reflective_loader/test_reflective_loader.dart';
import 'package:typed_mock/typed_mock.dart';
import 'package:unittest/unittest.dart';
import '../analysis_abstract.dart';
-import '../reflective_tests.dart';
main() {
groupSep = ' | ';
- runReflectiveTests(UpdateContentTest);
+ defineReflectiveTests(UpdateContentTest);
}
compilationUnitMatcher(String file) {
diff --git a/pkg/analysis_server/test/analysis_server_test.dart b/pkg/analysis_server/test/analysis_server_test.dart
index 374f47b..eb6387d 100644
--- a/pkg/analysis_server/test/analysis_server_test.dart
+++ b/pkg/analysis_server/test/analysis_server_test.dart
@@ -18,16 +18,16 @@
import 'package:analyzer/src/generated/engine.dart';
import 'package:analyzer/src/generated/java_engine.dart';
import 'package:analyzer/src/generated/source.dart';
+import 'package:test_reflective_loader/test_reflective_loader.dart';
import 'package:typed_mock/typed_mock.dart';
import 'package:unittest/unittest.dart';
import 'mock_sdk.dart';
import 'mocks.dart';
-import 'reflective_tests.dart';
main() {
groupSep = ' | ';
- runReflectiveTests(AnalysisServerTest);
+ defineReflectiveTests(AnalysisServerTest);
}
@reflectiveTest
@@ -243,6 +243,20 @@
expect(source.fullName, filePath);
}
+ test_getContextSourcePair_nonFile() {
+ String dirPath = '/dir';
+ Folder dir = resourceProvider.newFolder(dirPath);
+
+ AnalysisContext context = AnalysisEngine.instance.createAnalysisContext();
+ _configureSourceFactory(context);
+ server.folderMap[dir] = context;
+
+ ContextSourcePair pair = server.getContextSourcePair(dirPath);
+ expect(pair, isNotNull);
+ expect(pair.context, isNull);
+ expect(pair.source, isNull);
+ }
+
test_getContextSourcePair_package_inRoot() {
String rootPath = '/my_package';
String filePath = rootPath + '/lib/file.dart';
diff --git a/pkg/analysis_server/test/completion_test.dart b/pkg/analysis_server/test/completion_test.dart
index de752be..1101d88 100644
--- a/pkg/analysis_server/test/completion_test.dart
+++ b/pkg/analysis_server/test/completion_test.dart
@@ -115,7 +115,7 @@
class F {m() { m(); !1}}''', <String>["1+m"]);
buildTests('testCommentSnippets017', '''
-class F {var x = !1false;}''', <String>["1+true"], failingTests: '1');
+class F {var x = !1false;}''', <String>["1+true"]);
buildTests('testCommentSnippets018', '''
class Map{}class Arrays{}class C{ m(!1){} n(!2 x, q)''',
@@ -1093,7 +1093,7 @@
}''', <String>["1+a", "1-x", "1-y"], failingTests: '1');
buildTests('testCompletion_import', '''
-import '!1';''', <String>["1+dart:!", "1+package:!"], failingTests: '1');
+import '!1';''', <String>["1+dart:!", "1+package:!"]);
buildTests('testCompletion_import_dart', '''
import 'dart:math
@@ -1109,7 +1109,7 @@
buildTests('testCompletion_import_hasStringLiteral_noSemicolon', '''
import '!1'
-class A {}''', <String>["1+dart:!", "1+package:!"], failingTests: '1');
+class A {}''', <String>["1+dart:!", "1+package:!"]);
buildTests('testCompletion_import_noSpace', '''
import!1''', <String>["1+ 'dart:!';", "1+ 'package:!';"], failingTests: '1');
@@ -1408,8 +1408,7 @@
buildTests('testCompletion_staticField1', '''
class num{}class Sunflower {static final n!2um MAX_D = 300;nu!3m xc, yc;Sun!4flower() {x!Xc = y!Yc = MA!1 }}''',
- <String>["1+MAX_D", "X+xc", "Y+yc", "2+num", "3+num", "4+Sunflower"],
- failingTests: '2');
+ <String>["1+MAX_D", "X+xc", "Y+yc", "2+num", "3+num", "4+Sunflower"]);
buildTests('testCompletion_super_superType', '''
class A {
@@ -1969,7 +1968,7 @@
"J+if",
"K+else",
"L+return"
- ], failingTests: '59BCHK');
+ ], failingTests: '35BCHK');
// operators in function
buildTests('test015', '''f(a,b,c) => a + b * c !1;''', <String>["1+=="],
@@ -1983,19 +1982,18 @@
// keywords
buildTests('test017', '''
-!1library foo;
-!2import 'x' !5as r;
+!1!2import 'x' !5as r;
!3export '!8uri' !6hide Q !7show X;
!4part 'x';''', <String>[
"1+library",
- "2+import",
+ "2+import '!';",
"3+export",
"4+part",
"5+as",
"6+hide",
"7+show",
"8-null"
- ], failingTests: '1567');
+ ], failingTests: '567');
// keywords
buildTests('test018', '''!1part !2of foo;''', <String>["1+part", "2+of"],
@@ -2006,7 +2004,7 @@
var falsetrue = 1;
main() {
var foo = true!1
-}''', <String>["1+true", "1+truefalse", "1-falsetrue"], failingTests: '1');
+}''', <String>["1+true", "1+truefalse", "1-falsetrue"]);
buildTests('test020', '''var x = null.!1''', <String>["1+toString"],
failingTests: '1');
diff --git a/pkg/analysis_server/test/context_manager_test.dart b/pkg/analysis_server/test/context_manager_test.dart
index 2be5cb8..59df06f 100644
--- a/pkg/analysis_server/test/context_manager_test.dart
+++ b/pkg/analysis_server/test/context_manager_test.dart
@@ -16,14 +16,14 @@
import 'package:analyzer/src/generated/source.dart';
import 'package:analyzer/src/generated/source_io.dart';
import 'package:path/path.dart';
+import 'package:test_reflective_loader/test_reflective_loader.dart';
import 'package:unittest/unittest.dart';
import 'mocks.dart';
-import 'reflective_tests.dart';
main() {
groupSep = ' | ';
- runReflectiveTests(ContextManagerTest);
+ defineReflectiveTests(ContextManagerTest);
}
@reflectiveTest
diff --git a/pkg/analysis_server/test/domain_analysis_test.dart b/pkg/analysis_server/test/domain_analysis_test.dart
index 7037f60..881315a 100644
--- a/pkg/analysis_server/test/domain_analysis_test.dart
+++ b/pkg/analysis_server/test/domain_analysis_test.dart
@@ -13,18 +13,18 @@
import 'package:analyzer/file_system/memory_file_system.dart';
import 'package:analyzer/instrumentation/instrumentation.dart';
import 'package:path/path.dart';
+import 'package:test_reflective_loader/test_reflective_loader.dart';
import 'package:unittest/unittest.dart';
import 'analysis_abstract.dart';
import 'mock_sdk.dart';
import 'mocks.dart';
-import 'reflective_tests.dart';
main() {
groupSep = ' | ';
- runReflectiveTests(AnalysisDomainTest);
- runReflectiveTests(SetSubscriptionsTest);
+ defineReflectiveTests(AnalysisDomainTest);
+ defineReflectiveTests(SetSubscriptionsTest);
MockServerChannel serverChannel;
MemoryResourceProvider resourceProvider;
diff --git a/pkg/analysis_server/test/domain_completion_test.dart b/pkg/analysis_server/test/domain_completion_test.dart
index 6ffc8ef..49b56a4 100644
--- a/pkg/analysis_server/test/domain_completion_test.dart
+++ b/pkg/analysis_server/test/domain_completion_test.dart
@@ -6,6 +6,8 @@
import 'dart:async';
+import 'package:analysis_server/completion/completion_core.dart'
+ show CompletionRequest;
import 'package:analysis_server/src/analysis_server.dart';
import 'package:analysis_server/src/channel/channel.dart';
import 'package:analysis_server/src/constants.dart';
@@ -23,18 +25,18 @@
import 'package:analyzer/src/generated/engine.dart';
import 'package:analyzer/src/generated/sdk.dart';
import 'package:analyzer/src/generated/source.dart';
+import 'package:test_reflective_loader/test_reflective_loader.dart';
import 'package:unittest/unittest.dart';
import 'analysis_abstract.dart';
import 'mock_sdk.dart';
import 'mocks.dart';
-import 'reflective_tests.dart';
main() {
groupSep = ' | ';
- runReflectiveTests(CompletionManagerTest);
- runReflectiveTests(CompletionTest);
- runReflectiveTests(_NoSearchEngine);
+ defineReflectiveTests(CompletionManagerTest);
+ defineReflectiveTests(CompletionTest);
+ defineReflectiveTests(_NoSearchEngine);
}
@reflectiveTest
@@ -409,7 +411,7 @@
expect(replacementOffset, equals(completionOffset - 2));
expect(replacementLength, equals(2));
assertHasResult(
- CompletionSuggestionKind.KEYWORD, 'import', DART_RELEVANCE_HIGH);
+ CompletionSuggestionKind.KEYWORD, 'export', DART_RELEVANCE_HIGH);
assertHasResult(
CompletionSuggestionKind.KEYWORD, 'class', DART_RELEVANCE_HIGH);
});
@@ -647,9 +649,10 @@
final MockContext mockContext = new MockContext();
Test_AnalysisServer(ServerCommunicationChannel channel,
- ResourceProvider resourceProvider, OptimizingPubPackageMapProvider packageMapProvider,
- Index index, AnalysisServerOptions analysisServerOptions,
- DartSdk defaultSdk, InstrumentationService instrumentationService)
+ ResourceProvider resourceProvider,
+ OptimizingPubPackageMapProvider packageMapProvider, Index index,
+ AnalysisServerOptions analysisServerOptions, DartSdk defaultSdk,
+ InstrumentationService instrumentationService)
: super(channel, resourceProvider, packageMapProvider, index,
analysisServerOptions, defaultSdk, instrumentationService);
diff --git a/pkg/analysis_server/test/edit/assists_test.dart b/pkg/analysis_server/test/edit/assists_test.dart
index 0fcdb80..a24a048 100644
--- a/pkg/analysis_server/test/edit/assists_test.dart
+++ b/pkg/analysis_server/test/edit/assists_test.dart
@@ -7,15 +7,17 @@
import 'dart:async';
import 'package:analysis_server/src/edit/edit_domain.dart';
+import 'package:analysis_server/src/plugin/server_plugin.dart';
import 'package:analysis_server/src/protocol.dart';
+import 'package:plugin/manager.dart';
+import 'package:test_reflective_loader/test_reflective_loader.dart';
import 'package:unittest/unittest.dart' hide ERROR;
import '../analysis_abstract.dart';
-import '../reflective_tests.dart';
main() {
groupSep = ' | ';
- runReflectiveTests(AssistsTest);
+ defineReflectiveTests(AssistsTest);
}
@reflectiveTest
@@ -39,7 +41,10 @@
void setUp() {
super.setUp();
createProject();
- handler = new EditDomainHandler(server);
+ ExtensionManager manager = new ExtensionManager();
+ ServerPlugin plugin = new ServerPlugin();
+ manager.processPlugins([plugin]);
+ handler = new EditDomainHandler(server, plugin);
}
Future test_removeTypeAnnotation() {
diff --git a/pkg/analysis_server/test/edit/fixes_test.dart b/pkg/analysis_server/test/edit/fixes_test.dart
index ff4bacd..7da3e75 100644
--- a/pkg/analysis_server/test/edit/fixes_test.dart
+++ b/pkg/analysis_server/test/edit/fixes_test.dart
@@ -7,15 +7,17 @@
import 'dart:async';
import 'package:analysis_server/src/edit/edit_domain.dart';
+import 'package:analysis_server/src/plugin/server_plugin.dart';
import 'package:analysis_server/src/protocol.dart';
+import 'package:plugin/manager.dart';
+import 'package:test_reflective_loader/test_reflective_loader.dart';
import 'package:unittest/unittest.dart' hide ERROR;
import '../analysis_abstract.dart';
-import '../reflective_tests.dart';
main() {
groupSep = ' | ';
- runReflectiveTests(FixesTest);
+ defineReflectiveTests(FixesTest);
}
@reflectiveTest
@@ -24,7 +26,10 @@
void setUp() {
super.setUp();
createProject();
- handler = new EditDomainHandler(server);
+ ExtensionManager manager = new ExtensionManager();
+ ServerPlugin plugin = new ServerPlugin();
+ manager.processPlugins([plugin]);
+ handler = new EditDomainHandler(server, plugin);
}
Future test_fixUndefinedClass() {
diff --git a/pkg/analysis_server/test/edit/format_test.dart b/pkg/analysis_server/test/edit/format_test.dart
index f459900..c116db8 100644
--- a/pkg/analysis_server/test/edit/format_test.dart
+++ b/pkg/analysis_server/test/edit/format_test.dart
@@ -7,15 +7,18 @@
import 'dart:async';
import 'package:analysis_server/src/edit/edit_domain.dart';
+import 'package:analysis_server/src/plugin/server_plugin.dart';
import 'package:analysis_server/src/protocol.dart';
+import 'package:plugin/manager.dart';
+import 'package:test_reflective_loader/test_reflective_loader.dart';
import 'package:unittest/unittest.dart' hide ERROR;
import '../analysis_abstract.dart';
-import '../reflective_tests.dart';
+import '../mocks.dart';
main() {
groupSep = ' | ';
- runReflectiveTests(FormatTest);
+ defineReflectiveTests(FormatTest);
}
@reflectiveTest
@@ -24,7 +27,44 @@
void setUp() {
super.setUp();
createProject();
- handler = new EditDomainHandler(server);
+ ExtensionManager manager = new ExtensionManager();
+ ServerPlugin plugin = new ServerPlugin();
+ manager.processPlugins([plugin]);
+ handler = new EditDomainHandler(server, plugin);
+ }
+
+ Future test_formatNoOp() {
+ // Already formatted source
+ addTestFile('''
+main() {
+ int x = 3;
+}
+''');
+ return waitForTasksFinished().then((_) {
+ EditFormatResult formatResult = _formatAt(0, 3);
+ expect(formatResult.edits, isNotNull);
+ expect(formatResult.edits, hasLength(0));
+ });
+ }
+
+ Future test_formatNoSelection() async {
+ addTestFile('''
+main() { int x = 3; }
+''');
+ await waitForTasksFinished();
+ EditFormatResult formatResult = _formatAt(0, 0);
+
+ expect(formatResult.edits, isNotNull);
+ expect(formatResult.edits, hasLength(1));
+
+ SourceEdit edit = formatResult.edits[0];
+ expect(edit.replacement, equals('''
+main() {
+ int x = 3;
+}
+'''));
+ expect(formatResult.selectionOffset, equals(0));
+ expect(formatResult.selectionLength, equals(0));
}
Future test_formatSimple() {
@@ -48,17 +88,14 @@
});
}
- Future test_formatNoOp() {
- // Already formatted source
+ Future test_withErrors() {
addTestFile('''
-main() {
- int x = 3;
-}
+main() { int x =
''');
return waitForTasksFinished().then((_) {
- EditFormatResult formatResult = _formatAt(0, 3);
- expect(formatResult.edits, isNotNull);
- expect(formatResult.edits, hasLength(0));
+ Request request = new EditFormatParams(testFile, 0, 3).toRequest('0');
+ Response response = handler.handleRequest(request);
+ expect(response, isResponseFailure('0'));
});
}
diff --git a/pkg/analysis_server/test/edit/refactoring_test.dart b/pkg/analysis_server/test/edit/refactoring_test.dart
index 696c4e0..dac98eb 100644
--- a/pkg/analysis_server/test/edit/refactoring_test.dart
+++ b/pkg/analysis_server/test/edit/refactoring_test.dart
@@ -7,27 +7,29 @@
import 'dart:async';
import 'package:analysis_server/src/edit/edit_domain.dart';
+import 'package:analysis_server/src/plugin/server_plugin.dart';
import 'package:analysis_server/src/protocol.dart';
import 'package:analysis_server/src/services/index/index.dart';
import 'package:analysis_server/src/services/index/local_memory_index.dart';
+import 'package:plugin/manager.dart';
+import 'package:test_reflective_loader/test_reflective_loader.dart';
import 'package:unittest/unittest.dart' hide ERROR;
import '../analysis_abstract.dart';
import '../mocks.dart';
-import '../reflective_tests.dart';
main() {
groupSep = ' | ';
- runReflectiveTests(ConvertGetterMethodToMethodTest);
- runReflectiveTests(ConvertMethodToGetterTest);
- runReflectiveTests(ExtractLocalVariableTest);
- runReflectiveTests(ExtractMethodTest);
- runReflectiveTests(GetAvailableRefactoringsTest);
- runReflectiveTests(InlineLocalTest);
- runReflectiveTests(InlineMethodTest);
- runReflectiveTests(MoveFileTest);
- runReflectiveTests(RenameTest);
- runReflectiveTests(_NoSearchEngine);
+ defineReflectiveTests(ConvertGetterMethodToMethodTest);
+ defineReflectiveTests(ConvertMethodToGetterTest);
+ defineReflectiveTests(ExtractLocalVariableTest);
+ defineReflectiveTests(ExtractMethodTest);
+ defineReflectiveTests(GetAvailableRefactoringsTest);
+ defineReflectiveTests(InlineLocalTest);
+ defineReflectiveTests(InlineMethodTest);
+ defineReflectiveTests(MoveFileTest);
+ defineReflectiveTests(RenameTest);
+ defineReflectiveTests(_NoSearchEngine);
}
@reflectiveTest
@@ -609,13 +611,6 @@
List<RefactoringKind> kinds;
/**
- * Tests that there is a RENAME refactoring available at the [search] offset.
- */
- Future assertHasRenameRefactoring(String code, String search) async {
- return assertHasKind(code, search, RefactoringKind.RENAME, true);
- }
-
- /**
* Tests that there is refactoring of the given [kind] is available at the
* [search] offset.
*/
@@ -632,6 +627,13 @@
expect(kinds, matcher);
}
+ /**
+ * Tests that there is a RENAME refactoring available at the [search] offset.
+ */
+ Future assertHasRenameRefactoring(String code, String search) async {
+ return assertHasKind(code, search, RefactoringKind.RENAME, true);
+ }
+
@override
Index createIndex() {
return createLocalMemoryIndex();
@@ -667,10 +669,19 @@
void setUp() {
super.setUp();
createProject();
- handler = new EditDomainHandler(server);
+ ExtensionManager manager = new ExtensionManager();
+ ServerPlugin plugin = new ServerPlugin();
+ manager.processPlugins([plugin]);
+ handler = new EditDomainHandler(server, plugin);
server.handlers = [handler];
}
+ Future test_convertMethodToGetter_hasElement() {
+ return assertHasKind('''
+int getValue() => 42;
+''', 'getValue', RefactoringKind.CONVERT_METHOD_TO_GETTER, true);
+ }
+
Future test_extractLocal() async {
addTestFile('''
main() {
@@ -683,12 +694,6 @@
expect(kinds, contains(RefactoringKind.EXTRACT_METHOD));
}
- Future test_convertMethodToGetter_hasElement() {
- return assertHasKind('''
-int getValue() => 42;
-''', 'getValue', RefactoringKind.CONVERT_METHOD_TO_GETTER, true);
- }
-
Future test_rename_hasElement_class() {
return assertHasRenameRefactoring('''
class Test {}
@@ -986,7 +991,7 @@
@reflectiveTest
class MoveFileTest extends _AbstractGetRefactoring_Test {
- MoveFileOptions options = new MoveFileOptions(null);
+ MoveFileOptions options;
test_OK() {
resourceProvider.newFile('/project/bin/lib.dart', '');
@@ -994,7 +999,7 @@
import 'dart:math';
import 'lib.dart';
''');
- options.newFile = '/project/test.dart';
+ _setOptions('/project/test.dart');
return assertSuccessfulRefactoring(() {
return _sendMoveRequest();
}, '''
@@ -1009,6 +1014,10 @@
.toRequest('0');
return serverChannel.sendRequest(request);
}
+
+ void _setOptions(String newFile) {
+ options = new MoveFileOptions(newFile);
+ }
}
@reflectiveTest
@@ -1702,9 +1711,12 @@
@override
void setUp() {
super.setUp();
- server.handlers = [new EditDomainHandler(server),];
createProject();
- handler = new EditDomainHandler(server);
+ ExtensionManager manager = new ExtensionManager();
+ ServerPlugin plugin = new ServerPlugin();
+ manager.processPlugins([plugin]);
+ handler = new EditDomainHandler(server, plugin);
+ server.handlers = [handler];
}
}
diff --git a/pkg/analysis_server/test/edit/sort_members_test.dart b/pkg/analysis_server/test/edit/sort_members_test.dart
index 967ef71..18d3052 100644
--- a/pkg/analysis_server/test/edit/sort_members_test.dart
+++ b/pkg/analysis_server/test/edit/sort_members_test.dart
@@ -7,16 +7,18 @@
import 'dart:async';
import 'package:analysis_server/src/edit/edit_domain.dart';
+import 'package:analysis_server/src/plugin/server_plugin.dart';
import 'package:analysis_server/src/protocol.dart';
+import 'package:plugin/manager.dart';
+import 'package:test_reflective_loader/test_reflective_loader.dart';
import 'package:unittest/unittest.dart' hide ERROR;
import '../analysis_abstract.dart';
import '../mocks.dart';
-import '../reflective_tests.dart';
main() {
groupSep = ' | ';
- runReflectiveTests(SortMembersTest);
+ defineReflectiveTests(SortMembersTest);
}
@reflectiveTest
@@ -27,7 +29,10 @@
void setUp() {
super.setUp();
createProject();
- handler = new EditDomainHandler(server);
+ ExtensionManager manager = new ExtensionManager();
+ ServerPlugin plugin = new ServerPlugin();
+ manager.processPlugins([plugin]);
+ handler = new EditDomainHandler(server, plugin);
}
Future test_BAD_doesNotExist() {
diff --git a/pkg/analysis_server/test/integration/analysis/error_test.dart b/pkg/analysis_server/test/integration/analysis/error_test.dart
index 2a76f3d..7337545 100644
--- a/pkg/analysis_server/test/integration/analysis/error_test.dart
+++ b/pkg/analysis_server/test/integration/analysis/error_test.dart
@@ -5,13 +5,13 @@
library test.integration.analysis.error;
import 'package:analysis_server/src/protocol.dart';
+import 'package:test_reflective_loader/test_reflective_loader.dart';
import 'package:unittest/unittest.dart';
-import '../../reflective_tests.dart';
import '../integration_tests.dart';
main() {
- runReflectiveTests(AnalysisErrorIntegrationTest);
+ defineReflectiveTests(AnalysisErrorIntegrationTest);
}
@reflectiveTest
diff --git a/pkg/analysis_server/test/integration/analysis/get_errors_after_analysis_test.dart b/pkg/analysis_server/test/integration/analysis/get_errors_after_analysis_test.dart
index 6a1a582..091eea6 100644
--- a/pkg/analysis_server/test/integration/analysis/get_errors_after_analysis_test.dart
+++ b/pkg/analysis_server/test/integration/analysis/get_errors_after_analysis_test.dart
@@ -4,11 +4,12 @@
library test.integration.analysis.get.errors.after.analysis;
-import '../../reflective_tests.dart';
+import 'package:test_reflective_loader/test_reflective_loader.dart';
+
import 'get_errors.dart';
main() {
- runReflectiveTests(Test);
+ defineReflectiveTests(Test);
}
@reflectiveTest
diff --git a/pkg/analysis_server/test/integration/analysis/get_errors_before_analysis_test.dart b/pkg/analysis_server/test/integration/analysis/get_errors_before_analysis_test.dart
index a0920ca..34fa7e7 100644
--- a/pkg/analysis_server/test/integration/analysis/get_errors_before_analysis_test.dart
+++ b/pkg/analysis_server/test/integration/analysis/get_errors_before_analysis_test.dart
@@ -4,11 +4,12 @@
library test.integration.analysis.get.errors.before.analysis;
-import '../../reflective_tests.dart';
+import 'package:test_reflective_loader/test_reflective_loader.dart';
+
import 'get_errors.dart';
main() {
- runReflectiveTests(Test);
+ defineReflectiveTests(Test);
}
@reflectiveTest
diff --git a/pkg/analysis_server/test/integration/analysis/get_hover_test.dart b/pkg/analysis_server/test/integration/analysis/get_hover_test.dart
index 7b5be4d..3928d99 100644
--- a/pkg/analysis_server/test/integration/analysis/get_hover_test.dart
+++ b/pkg/analysis_server/test/integration/analysis/get_hover_test.dart
@@ -8,13 +8,13 @@
import 'package:analysis_server/src/protocol.dart';
import 'package:path/path.dart';
+import 'package:test_reflective_loader/test_reflective_loader.dart';
import 'package:unittest/unittest.dart';
-import '../../reflective_tests.dart';
import '../integration_tests.dart';
main() {
- runReflectiveTests(AnalysisGetHoverIntegrationTest);
+ defineReflectiveTests(AnalysisGetHoverIntegrationTest);
}
@reflectiveTest
diff --git a/pkg/analysis_server/test/integration/analysis/highlights_test.dart b/pkg/analysis_server/test/integration/analysis/highlights_test.dart
index bb17256..b466ff6 100644
--- a/pkg/analysis_server/test/integration/analysis/highlights_test.dart
+++ b/pkg/analysis_server/test/integration/analysis/highlights_test.dart
@@ -5,13 +5,13 @@
library test.integration.analysis.highlights;
import 'package:analysis_server/src/protocol.dart';
+import 'package:test_reflective_loader/test_reflective_loader.dart';
import 'package:unittest/unittest.dart';
-import '../../reflective_tests.dart';
import '../integration_tests.dart';
main() {
- runReflectiveTests(AnalysisHighlightsTest);
+ defineReflectiveTests(AnalysisHighlightsTest);
}
@reflectiveTest
@@ -96,8 +96,14 @@
highlights.remove(type);
}
check(HighlightRegionType.ANNOTATION, ['@override']);
- check(HighlightRegionType.BUILT_IN,
- ['as', 'get', 'import', 'set', 'static', 'typedef']);
+ check(HighlightRegionType.BUILT_IN, [
+ 'as',
+ 'get',
+ 'import',
+ 'set',
+ 'static',
+ 'typedef'
+ ]);
check(HighlightRegionType.CLASS, [
'Class',
'Class2',
@@ -106,9 +112,8 @@
'int'
]);
check(HighlightRegionType.COMMENT_BLOCK, ['/* Block comment */']);
- check(HighlightRegionType.COMMENT_DOCUMENTATION, [
- '/**\n * Doc comment\n */'
- ]);
+ check(HighlightRegionType.COMMENT_DOCUMENTATION,
+ ['/**\n * Doc comment\n */']);
check(
HighlightRegionType.COMMENT_END_OF_LINE, ['// End of line comment']);
check(HighlightRegionType.CONSTRUCTOR, ['constructor']);
@@ -127,8 +132,10 @@
check(HighlightRegionType.LITERAL_DOUBLE, ['1.0']);
check(HighlightRegionType.LITERAL_INTEGER, ['2', '42']);
check(HighlightRegionType.LITERAL_LIST, ['[]']);
- check(HighlightRegionType.LITERAL_MAP,
- ['{1.0: [].toList()}', '{2: local}']);
+ check(HighlightRegionType.LITERAL_MAP, [
+ '{1.0: [].toList()}',
+ '{2: local}'
+ ]);
check(HighlightRegionType.LITERAL_STRING, ["'dart:async'", "'string'"]);
check(HighlightRegionType.LOCAL_VARIABLE, ['local']);
check(HighlightRegionType.LOCAL_VARIABLE_DECLARATION, ['local']);
@@ -138,8 +145,10 @@
check(HighlightRegionType.METHOD_STATIC, ['wait']);
check(HighlightRegionType.PARAMETER, ['parameter']);
check(HighlightRegionType.SETTER_DECLARATION, ['setter']);
- check(HighlightRegionType.TOP_LEVEL_VARIABLE,
- ['override', 'topLevelVariable']);
+ check(HighlightRegionType.TOP_LEVEL_VARIABLE, [
+ 'override',
+ 'topLevelVariable'
+ ]);
check(HighlightRegionType.TYPE_NAME_DYNAMIC, ['dynamic']);
check(HighlightRegionType.TYPE_PARAMETER, ['TypeParameter']);
expect(highlights, isEmpty);
diff --git a/pkg/analysis_server/test/integration/analysis/navigation_test.dart b/pkg/analysis_server/test/integration/analysis/navigation_test.dart
index 66de913..87b2e31 100644
--- a/pkg/analysis_server/test/integration/analysis/navigation_test.dart
+++ b/pkg/analysis_server/test/integration/analysis/navigation_test.dart
@@ -5,13 +5,13 @@
library test.integration.analysis.navigation;
import 'package:analysis_server/src/protocol.dart';
+import 'package:test_reflective_loader/test_reflective_loader.dart';
import 'package:unittest/unittest.dart';
-import '../../reflective_tests.dart';
import '../integration_tests.dart';
main() {
- runReflectiveTests(AnalysisNavigationTest);
+ defineReflectiveTests(AnalysisNavigationTest);
}
@reflectiveTest
diff --git a/pkg/analysis_server/test/integration/analysis/occurrences_test.dart b/pkg/analysis_server/test/integration/analysis/occurrences_test.dart
index 57405cf..5b084ec 100644
--- a/pkg/analysis_server/test/integration/analysis/occurrences_test.dart
+++ b/pkg/analysis_server/test/integration/analysis/occurrences_test.dart
@@ -5,13 +5,13 @@
library test.integration.analysis.occurrences;
import 'package:analysis_server/src/protocol.dart';
+import 'package:test_reflective_loader/test_reflective_loader.dart';
import 'package:unittest/unittest.dart';
-import '../../reflective_tests.dart';
import '../integration_tests.dart';
main() {
- runReflectiveTests(Test);
+ defineReflectiveTests(Test);
}
@reflectiveTest
diff --git a/pkg/analysis_server/test/integration/analysis/outline_test.dart b/pkg/analysis_server/test/integration/analysis/outline_test.dart
index dcd6e3a..1369c3d 100644
--- a/pkg/analysis_server/test/integration/analysis/outline_test.dart
+++ b/pkg/analysis_server/test/integration/analysis/outline_test.dart
@@ -5,13 +5,13 @@
library test.integration.analysis.outline;
import 'package:analysis_server/src/protocol.dart';
+import 'package:test_reflective_loader/test_reflective_loader.dart';
import 'package:unittest/unittest.dart';
-import '../../reflective_tests.dart';
import '../integration_tests.dart';
main() {
- runReflectiveTests(Test);
+ defineReflectiveTests(Test);
}
@reflectiveTest
diff --git a/pkg/analysis_server/test/integration/analysis/overrides_test.dart b/pkg/analysis_server/test/integration/analysis/overrides_test.dart
index b5dfb6f..12872c2 100644
--- a/pkg/analysis_server/test/integration/analysis/overrides_test.dart
+++ b/pkg/analysis_server/test/integration/analysis/overrides_test.dart
@@ -5,13 +5,13 @@
library test.integration.analysis.overrides;
import 'package:analysis_server/src/protocol.dart';
+import 'package:test_reflective_loader/test_reflective_loader.dart';
import 'package:unittest/unittest.dart';
-import '../../reflective_tests.dart';
import '../integration_tests.dart';
main() {
- runReflectiveTests(Test);
+ defineReflectiveTests(Test);
}
@reflectiveTest
diff --git a/pkg/analysis_server/test/integration/analysis/package_root_test.dart b/pkg/analysis_server/test/integration/analysis/package_root_test.dart
index 61974b0..bafba77 100644
--- a/pkg/analysis_server/test/integration/analysis/package_root_test.dart
+++ b/pkg/analysis_server/test/integration/analysis/package_root_test.dart
@@ -6,13 +6,13 @@
import 'package:analysis_server/src/protocol.dart';
import 'package:path/path.dart';
+import 'package:test_reflective_loader/test_reflective_loader.dart';
import 'package:unittest/unittest.dart';
-import '../../reflective_tests.dart';
import '../integration_tests.dart';
main() {
- runReflectiveTests(Test);
+ defineReflectiveTests(Test);
}
@reflectiveTest
diff --git a/pkg/analysis_server/test/integration/analysis/reanalyze_concurrent_test.dart b/pkg/analysis_server/test/integration/analysis/reanalyze_concurrent_test.dart
index 242ed66..806b82c 100644
--- a/pkg/analysis_server/test/integration/analysis/reanalyze_concurrent_test.dart
+++ b/pkg/analysis_server/test/integration/analysis/reanalyze_concurrent_test.dart
@@ -12,11 +12,12 @@
import 'dart:async';
-import '../../reflective_tests.dart';
+import 'package:test_reflective_loader/test_reflective_loader.dart';
+
import '../integration_tests.dart';
main() {
- runReflectiveTests(Test);
+ defineReflectiveTests(Test);
}
@reflectiveTest
diff --git a/pkg/analysis_server/test/integration/analysis/reanalyze_test.dart b/pkg/analysis_server/test/integration/analysis/reanalyze_test.dart
index 59df3ed..79aee38 100644
--- a/pkg/analysis_server/test/integration/analysis/reanalyze_test.dart
+++ b/pkg/analysis_server/test/integration/analysis/reanalyze_test.dart
@@ -5,13 +5,13 @@
library test.integration.analysis.reanalyze;
import 'package:analysis_server/src/protocol.dart';
+import 'package:test_reflective_loader/test_reflective_loader.dart';
import 'package:unittest/unittest.dart';
-import '../../reflective_tests.dart';
import '../integration_tests.dart';
main() {
- runReflectiveTests(Test);
+ defineReflectiveTests(Test);
}
@reflectiveTest
diff --git a/pkg/analysis_server/test/integration/analysis/update_content_list_test.dart b/pkg/analysis_server/test/integration/analysis/update_content_list_test.dart
index 2450fd8..6bf7cd3 100644
--- a/pkg/analysis_server/test/integration/analysis/update_content_list_test.dart
+++ b/pkg/analysis_server/test/integration/analysis/update_content_list_test.dart
@@ -5,13 +5,13 @@
library test.integration.analysis.update.content.list;
import 'package:analysis_server/src/protocol.dart';
+import 'package:test_reflective_loader/test_reflective_loader.dart';
import 'package:unittest/unittest.dart';
-import '../../reflective_tests.dart';
import '../integration_tests.dart';
main() {
- runReflectiveTests(Test);
+ defineReflectiveTests(Test);
}
@reflectiveTest
diff --git a/pkg/analysis_server/test/integration/analysis/update_content_test.dart b/pkg/analysis_server/test/integration/analysis/update_content_test.dart
index b5a9b57..18da8a6 100644
--- a/pkg/analysis_server/test/integration/analysis/update_content_test.dart
+++ b/pkg/analysis_server/test/integration/analysis/update_content_test.dart
@@ -5,13 +5,13 @@
library test.integration.analysis.update.content;
import 'package:analysis_server/src/protocol.dart';
+import 'package:test_reflective_loader/test_reflective_loader.dart';
import 'package:unittest/unittest.dart';
-import '../../reflective_tests.dart';
import '../integration_tests.dart';
main() {
- runReflectiveTests(Test);
+ defineReflectiveTests(Test);
}
@reflectiveTest
diff --git a/pkg/analysis_server/test/integration/asynchrony_test.dart b/pkg/analysis_server/test/integration/asynchrony_test.dart
index 238b586..79852cb 100644
--- a/pkg/analysis_server/test/integration/asynchrony_test.dart
+++ b/pkg/analysis_server/test/integration/asynchrony_test.dart
@@ -6,13 +6,13 @@
import 'dart:async';
+import 'package:test_reflective_loader/test_reflective_loader.dart';
import 'package:unittest/unittest.dart';
-import '../reflective_tests.dart';
import 'integration_tests.dart';
main() {
-// runReflectiveTests(AsynchronyIntegrationTest);
+// defineReflectiveTests(AsynchronyIntegrationTest);
}
/**
diff --git a/pkg/analysis_server/test/integration/completion/get_suggestions_test.dart b/pkg/analysis_server/test/integration/completion/get_suggestions_test.dart
index d9c85c1..12687e4 100644
--- a/pkg/analysis_server/test/integration/completion/get_suggestions_test.dart
+++ b/pkg/analysis_server/test/integration/completion/get_suggestions_test.dart
@@ -5,13 +5,13 @@
library test.integration.completion.get.suggestions;
import 'package:analysis_server/src/protocol.dart';
+import 'package:test_reflective_loader/test_reflective_loader.dart';
import 'package:unittest/unittest.dart';
-import '../../reflective_tests.dart';
import '../integration_tests.dart';
main() {
- runReflectiveTests(Test);
+ defineReflectiveTests(Test);
}
@reflectiveTest
diff --git a/pkg/analysis_server/test/integration/integration_test_methods.dart b/pkg/analysis_server/test/integration/integration_test_methods.dart
index 86879e6..eba2bda 100644
--- a/pkg/analysis_server/test/integration/integration_test_methods.dart
+++ b/pkg/analysis_server/test/integration/integration_test_methods.dart
@@ -1073,7 +1073,8 @@
* If a request is made for a file which does not exist, or which is not
* currently subject to analysis (e.g. because it is not associated with any
* analysis root specified to analysis.setAnalysisRoots), an error of type
- * FORMAT_INVALID_FILE will be generated.
+ * FORMAT_INVALID_FILE will be generated. If the source contains syntax
+ * errors, an error of type FORMAT_WITH_ERRORS will be generated.
*
* Parameters
*
diff --git a/pkg/analysis_server/test/integration/protocol_matchers.dart b/pkg/analysis_server/test/integration/protocol_matchers.dart
index 83314f9..42d9ee9 100644
--- a/pkg/analysis_server/test/integration/protocol_matchers.dart
+++ b/pkg/analysis_server/test/integration/protocol_matchers.dart
@@ -1120,6 +1120,7 @@
* "hasNamedParameters": optional bool
* "parameterName": optional String
* "parameterType": optional String
+ * "importUri": optional String
* }
*/
final Matcher isCompletionSuggestion = new LazyMatcher(() => new MatchesJsonObject(
@@ -1142,7 +1143,8 @@
"requiredParameterCount": isInt,
"hasNamedParameters": isBool,
"parameterName": isString,
- "parameterType": isString
+ "parameterType": isString,
+ "importUri": isString
}));
/**
@@ -1822,6 +1824,7 @@
* enum {
* CONTENT_MODIFIED
* FORMAT_INVALID_FILE
+ * FORMAT_WITH_ERRORS
* GET_ERRORS_INVALID_FILE
* INVALID_ANALYSIS_ROOT
* INVALID_EXECUTION_CONTEXT
@@ -1843,6 +1846,7 @@
final Matcher isRequestErrorCode = new MatchesEnum("RequestErrorCode", [
"CONTENT_MODIFIED",
"FORMAT_INVALID_FILE",
+ "FORMAT_WITH_ERRORS",
"GET_ERRORS_INVALID_FILE",
"INVALID_ANALYSIS_ROOT",
"INVALID_EXECUTION_CONTEXT",
diff --git a/pkg/analysis_server/test/integration/search/get_type_hierarchy_test.dart b/pkg/analysis_server/test/integration/search/get_type_hierarchy_test.dart
index d1f8726..fdab854 100644
--- a/pkg/analysis_server/test/integration/search/get_type_hierarchy_test.dart
+++ b/pkg/analysis_server/test/integration/search/get_type_hierarchy_test.dart
@@ -7,13 +7,13 @@
import 'dart:async';
import 'package:analysis_server/src/protocol.dart';
+import 'package:test_reflective_loader/test_reflective_loader.dart';
import 'package:unittest/unittest.dart';
-import '../../reflective_tests.dart';
import '../integration_tests.dart';
main() {
- runReflectiveTests(Test);
+ defineReflectiveTests(Test);
}
/**
diff --git a/pkg/analysis_server/test/integration/server/get_version_test.dart b/pkg/analysis_server/test/integration/server/get_version_test.dart
index 779aff1..7f7b529 100644
--- a/pkg/analysis_server/test/integration/server/get_version_test.dart
+++ b/pkg/analysis_server/test/integration/server/get_version_test.dart
@@ -4,11 +4,12 @@
library test.integration.server.get.version;
-import '../../reflective_tests.dart';
+import 'package:test_reflective_loader/test_reflective_loader.dart';
+
import '../integration_tests.dart';
main() {
- runReflectiveTests(Test);
+ defineReflectiveTests(Test);
}
@reflectiveTest
diff --git a/pkg/analysis_server/test/integration/server/set_subscriptions_invalid_service_test.dart b/pkg/analysis_server/test/integration/server/set_subscriptions_invalid_service_test.dart
index 721a607..bcf15db 100644
--- a/pkg/analysis_server/test/integration/server/set_subscriptions_invalid_service_test.dart
+++ b/pkg/analysis_server/test/integration/server/set_subscriptions_invalid_service_test.dart
@@ -4,13 +4,13 @@
library test.integration.server.set.subscriptions.invalid.service;
+import 'package:test_reflective_loader/test_reflective_loader.dart';
import 'package:unittest/unittest.dart';
-import '../../reflective_tests.dart';
import '../integration_tests.dart';
main() {
- runReflectiveTests(Test);
+ defineReflectiveTests(Test);
}
@reflectiveTest
diff --git a/pkg/analysis_server/test/integration/server/set_subscriptions_test.dart b/pkg/analysis_server/test/integration/server/set_subscriptions_test.dart
index 55c740a..517445b 100644
--- a/pkg/analysis_server/test/integration/server/set_subscriptions_test.dart
+++ b/pkg/analysis_server/test/integration/server/set_subscriptions_test.dart
@@ -7,13 +7,13 @@
import 'dart:async';
import 'package:analysis_server/src/protocol.dart';
+import 'package:test_reflective_loader/test_reflective_loader.dart';
import 'package:unittest/unittest.dart';
-import '../../reflective_tests.dart';
import '../integration_tests.dart';
main() {
- runReflectiveTests(Test);
+ defineReflectiveTests(Test);
}
@reflectiveTest
diff --git a/pkg/analysis_server/test/integration/server/shutdown_test.dart b/pkg/analysis_server/test/integration/server/shutdown_test.dart
index 09c4fe4..7a5de26 100644
--- a/pkg/analysis_server/test/integration/server/shutdown_test.dart
+++ b/pkg/analysis_server/test/integration/server/shutdown_test.dart
@@ -6,13 +6,13 @@
import 'dart:async';
+import 'package:test_reflective_loader/test_reflective_loader.dart';
import 'package:unittest/unittest.dart';
-import '../../reflective_tests.dart';
import '../integration_tests.dart';
main() {
- runReflectiveTests(Test);
+ defineReflectiveTests(Test);
}
@reflectiveTest
diff --git a/pkg/analysis_server/test/integration/server/status_test.dart b/pkg/analysis_server/test/integration/server/status_test.dart
index 4b1b86e..c386b88 100644
--- a/pkg/analysis_server/test/integration/server/status_test.dart
+++ b/pkg/analysis_server/test/integration/server/status_test.dart
@@ -7,13 +7,13 @@
import 'dart:async';
import 'package:analysis_server/src/protocol.dart';
+import 'package:test_reflective_loader/test_reflective_loader.dart';
import 'package:unittest/unittest.dart';
-import '../../reflective_tests.dart';
import '../integration_tests.dart';
main() {
- runReflectiveTests(Test);
+ defineReflectiveTests(Test);
}
@reflectiveTest
diff --git a/pkg/analysis_server/test/mock_sdk.dart b/pkg/analysis_server/test/mock_sdk.dart
index 2cdebda..d23f7a5 100644
--- a/pkg/analysis_server/test/mock_sdk.dart
+++ b/pkg/analysis_server/test/mock_sdk.dart
@@ -316,7 +316,7 @@
bool get isDocumented => throw unimplemented;
@override
- bool get isImplementation => throw unimplemented;
+ bool get isImplementation => false;
@override
bool get isInternal => shortName.startsWith('dart:_');
diff --git a/pkg/analysis_server/test/operation/operation_queue_test.dart b/pkg/analysis_server/test/operation/operation_queue_test.dart
index de5e795..71569e8 100644
--- a/pkg/analysis_server/test/operation/operation_queue_test.dart
+++ b/pkg/analysis_server/test/operation/operation_queue_test.dart
@@ -8,17 +8,19 @@
import 'package:analysis_server/src/operation/operation.dart';
import 'package:analysis_server/src/operation/operation_analysis.dart';
import 'package:analysis_server/src/operation/operation_queue.dart';
+import 'package:analysis_server/src/services/search/search_engine.dart';
+import 'package:analyzer/file_system/file_system.dart';
import 'package:analyzer/src/generated/engine.dart';
import 'package:analyzer/src/generated/source.dart';
+import 'package:test_reflective_loader/test_reflective_loader.dart';
import 'package:typed_mock/typed_mock.dart';
import 'package:unittest/unittest.dart';
import '../mocks.dart';
-import '../reflective_tests.dart';
main() {
groupSep = ' | ';
- runReflectiveTests(ServerOperationQueueTest);
+ defineReflectiveTests(ServerOperationQueueTest);
}
/**
@@ -37,6 +39,15 @@
}
class AnalysisServerMock extends TypedMock implements AnalysisServer {
+
+ @override
+ final ResourceProvider resourceProvider;
+
+ @override
+ final SearchEngine searchEngine;
+
+ AnalysisServerMock({this.resourceProvider, this.searchEngine});
+
noSuchMethod(Invocation invocation) => super.noSuchMethod(invocation);
}
diff --git a/pkg/analysis_server/test/protocol_server_test.dart b/pkg/analysis_server/test/protocol_server_test.dart
index 26aae55..129c8cc 100644
--- a/pkg/analysis_server/test/protocol_server_test.dart
+++ b/pkg/analysis_server/test/protocol_server_test.dart
@@ -13,19 +13,19 @@
import 'package:analyzer/src/generated/element.dart' as engine;
import 'package:analyzer/src/generated/error.dart' as engine;
import 'package:analyzer/src/generated/source.dart' as engine;
+import 'package:test_reflective_loader/test_reflective_loader.dart';
import 'package:typed_mock/typed_mock.dart';
import 'package:unittest/unittest.dart';
import 'abstract_context.dart';
import 'mocks.dart';
-import 'reflective_tests.dart';
main() {
groupSep = ' | ';
- runReflectiveTests(AnalysisErrorTest);
- runReflectiveTests(ElementTest);
- runReflectiveTests(ElementKindTest);
- runReflectiveTests(EnumTest);
+ defineReflectiveTests(AnalysisErrorTest);
+ defineReflectiveTests(ElementTest);
+ defineReflectiveTests(ElementKindTest);
+ defineReflectiveTests(EnumTest);
}
class AnalysisErrorMock extends TypedMock implements engine.AnalysisError {
diff --git a/pkg/analysis_server/test/protocol_test.dart b/pkg/analysis_server/test/protocol_test.dart
index 3148cdf..ddd1b35 100644
--- a/pkg/analysis_server/test/protocol_test.dart
+++ b/pkg/analysis_server/test/protocol_test.dart
@@ -8,20 +8,19 @@
import 'package:analysis_server/src/constants.dart';
import 'package:analysis_server/src/protocol.dart';
+import 'package:test_reflective_loader/test_reflective_loader.dart';
import 'package:unittest/unittest.dart';
-import 'reflective_tests.dart';
-
-Matcher _throwsRequestFailure = throwsA(new isInstanceOf<RequestFailure>());
-
main() {
groupSep = ' | ';
- runReflectiveTests(NotificationTest);
- runReflectiveTests(RequestTest);
- runReflectiveTests(RequestErrorTest);
- runReflectiveTests(ResponseTest);
+ defineReflectiveTests(NotificationTest);
+ defineReflectiveTests(RequestTest);
+ defineReflectiveTests(RequestErrorTest);
+ defineReflectiveTests(ResponseTest);
}
+Matcher _throwsRequestFailure = throwsA(new isInstanceOf<RequestFailure>());
+
@reflectiveTest
class InvalidParameterResponseMatcher extends Matcher {
static const String ERROR_CODE = 'INVALID_PARAMETER';
@@ -110,8 +109,11 @@
var trace = 'a stack trace\r\nbar';
RequestError error = new RequestError(
RequestErrorCode.UNKNOWN_REQUEST, 'msg', stackTrace: trace);
- expect(error.toJson(),
- {CODE: 'UNKNOWN_REQUEST', MESSAGE: 'msg', STACK_TRACE: trace});
+ expect(error.toJson(), {
+ CODE: 'UNKNOWN_REQUEST',
+ MESSAGE: 'msg',
+ STACK_TRACE: trace
+ });
}
}
diff --git a/pkg/analysis_server/test/reflective_tests.dart b/pkg/analysis_server/test/reflective_tests.dart
deleted file mode 100644
index 8180cf7..0000000
--- a/pkg/analysis_server/test/reflective_tests.dart
+++ /dev/null
@@ -1,121 +0,0 @@
-// Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-library reflective_tests;
-
-@MirrorsUsed(metaTargets: 'ReflectiveTest')
-import 'dart:mirrors';
-import 'dart:async';
-
-import 'package:unittest/unittest.dart';
-
-/**
- * Runs test methods existing in the given [type].
- *
- * Methods with names starting with `test` are run using [test] function.
- * Methods with names starting with `solo_test` are run using [solo_test] function.
- *
- * Each method is run with a new instance of [type].
- * So, [type] should have a default constructor.
- *
- * If [type] declares method `setUp`, it methods will be invoked before any test
- * method invocation.
- *
- * If [type] declares method `tearDown`, it will be invoked after any test
- * method invocation. If method returns [Future] to test some asyncronous
- * behavior, then `tearDown` will be invoked in `Future.complete`.
- */
-void runReflectiveTests(Type type) {
- ClassMirror classMirror = reflectClass(type);
- if (!classMirror.metadata.any((InstanceMirror annotation) =>
- annotation.type.reflectedType == ReflectiveTest)) {
- String name = MirrorSystem.getName(classMirror.qualifiedName);
- throw new Exception('Class $name must have annotation "@reflectiveTest" '
- 'in order to be run by runReflectiveTests.');
- }
- String className = MirrorSystem.getName(classMirror.simpleName);
- group(className, () {
- classMirror.instanceMembers.forEach((symbol, memberMirror) {
- // we need only methods
- if (memberMirror is! MethodMirror || !memberMirror.isRegularMethod) {
- return;
- }
- String memberName = MirrorSystem.getName(symbol);
- // test_
- if (memberName.startsWith('test_')) {
- test(memberName, () {
- return _runTest(classMirror, symbol);
- });
- return;
- }
- // solo_test_
- if (memberName.startsWith('solo_test_')) {
- solo_test(memberName, () {
- return _runTest(classMirror, symbol);
- });
- }
- // fail_test_
- if (memberName.startsWith('fail_')) {
- test(memberName, () {
- return _runFailingTest(classMirror, symbol);
- });
- }
- // solo_fail_test_
- if (memberName.startsWith('solo_fail_')) {
- solo_test(memberName, () {
- return _runFailingTest(classMirror, symbol);
- });
- }
- });
- });
-}
-
-Future _invokeSymbolIfExists(InstanceMirror instanceMirror, Symbol symbol) {
- var invocationResult = null;
- try {
- invocationResult = instanceMirror.invoke(symbol, []).reflectee;
- } on NoSuchMethodError {}
- if (invocationResult is Future) {
- return invocationResult;
- } else {
- return new Future.value(invocationResult);
- }
-}
-
-/**
- * Run a test that is expected to fail, and confirm that it fails.
- *
- * This properly handles the following cases:
- * - The test fails by throwing an exception
- * - The test returns a future which completes with an error.
- *
- * However, it does not handle the case where the test creates an asynchronous
- * callback using expectAsync(), and that callback generates a failure.
- */
-Future _runFailingTest(ClassMirror classMirror, Symbol symbol) {
- return new Future(() => _runTest(classMirror, symbol)).then((_) {
- fail('Test passed - expected to fail.');
- }, onError: (_) {});
-}
-
-_runTest(ClassMirror classMirror, Symbol symbol) {
- InstanceMirror instanceMirror = classMirror.newInstance(new Symbol(''), []);
- return _invokeSymbolIfExists(instanceMirror, #setUp)
- .then((_) => instanceMirror.invoke(symbol, []).reflectee)
- .whenComplete(() => _invokeSymbolIfExists(instanceMirror, #tearDown));
-}
-
-/**
- * A marker annotation used to instruct dart2js to keep reflection information
- * for the annotated classes.
- */
-class ReflectiveTest {
- const ReflectiveTest();
-}
-
-/**
- * A marker annotation used to instruct dart2js to keep reflection information
- * for the annotated classes.
- */
-const ReflectiveTest reflectiveTest = const ReflectiveTest();
diff --git a/pkg/analysis_server/test/search/element_references_test.dart b/pkg/analysis_server/test/search/element_references_test.dart
index bf27ea8..dce6b8c 100644
--- a/pkg/analysis_server/test/search/element_references_test.dart
+++ b/pkg/analysis_server/test/search/element_references_test.dart
@@ -8,15 +8,15 @@
import 'package:analysis_server/src/protocol.dart';
import 'package:analysis_server/src/services/index/index.dart';
+import 'package:test_reflective_loader/test_reflective_loader.dart';
import 'package:unittest/unittest.dart';
-import '../reflective_tests.dart';
import 'abstract_search_domain.dart';
main() {
groupSep = ' | ';
- runReflectiveTests(ElementReferencesTest);
- runReflectiveTests(_NoSearchEngine);
+ defineReflectiveTests(ElementReferencesTest);
+ defineReflectiveTests(_NoSearchEngine);
}
@reflectiveTest
diff --git a/pkg/analysis_server/test/search/member_declarations_test.dart b/pkg/analysis_server/test/search/member_declarations_test.dart
index f1b9391..849bb20 100644
--- a/pkg/analysis_server/test/search/member_declarations_test.dart
+++ b/pkg/analysis_server/test/search/member_declarations_test.dart
@@ -7,14 +7,14 @@
import 'dart:async';
import 'package:analysis_server/src/protocol.dart';
+import 'package:test_reflective_loader/test_reflective_loader.dart';
import 'package:unittest/unittest.dart';
-import '../reflective_tests.dart';
import 'abstract_search_domain.dart';
main() {
groupSep = ' | ';
- runReflectiveTests(MemberDeclarationsTest);
+ defineReflectiveTests(MemberDeclarationsTest);
}
@reflectiveTest
diff --git a/pkg/analysis_server/test/search/member_references_test.dart b/pkg/analysis_server/test/search/member_references_test.dart
index 9c5c79a..79f159d 100644
--- a/pkg/analysis_server/test/search/member_references_test.dart
+++ b/pkg/analysis_server/test/search/member_references_test.dart
@@ -7,14 +7,14 @@
import 'dart:async';
import 'package:analysis_server/src/protocol.dart';
+import 'package:test_reflective_loader/test_reflective_loader.dart';
import 'package:unittest/unittest.dart';
-import '../reflective_tests.dart';
import 'abstract_search_domain.dart';
main() {
groupSep = ' | ';
- runReflectiveTests(MemberReferencesTest);
+ defineReflectiveTests(MemberReferencesTest);
}
@reflectiveTest
diff --git a/pkg/analysis_server/test/search/search_result_test.dart b/pkg/analysis_server/test/search/search_result_test.dart
index a4cd492..1b6f918 100644
--- a/pkg/analysis_server/test/search/search_result_test.dart
+++ b/pkg/analysis_server/test/search/search_result_test.dart
@@ -6,13 +6,12 @@
import 'package:analysis_server/src/protocol_server.dart';
import 'package:analysis_server/src/services/search/search_engine.dart';
+import 'package:test_reflective_loader/test_reflective_loader.dart';
import 'package:unittest/unittest.dart';
-import '../reflective_tests.dart';
-
main() {
groupSep = ' | ';
- runReflectiveTests(SearchResultKindTest);
+ defineReflectiveTests(SearchResultKindTest);
}
@reflectiveTest
diff --git a/pkg/analysis_server/test/search/top_level_declarations_test.dart b/pkg/analysis_server/test/search/top_level_declarations_test.dart
index a09a819..96ef6c6 100644
--- a/pkg/analysis_server/test/search/top_level_declarations_test.dart
+++ b/pkg/analysis_server/test/search/top_level_declarations_test.dart
@@ -7,14 +7,14 @@
import 'dart:async';
import 'package:analysis_server/src/protocol.dart';
+import 'package:test_reflective_loader/test_reflective_loader.dart';
import 'package:unittest/unittest.dart';
-import '../reflective_tests.dart';
import 'abstract_search_domain.dart';
main() {
groupSep = ' | ';
- runReflectiveTests(TopLevelDeclarationsTest);
+ defineReflectiveTests(TopLevelDeclarationsTest);
}
@reflectiveTest
diff --git a/pkg/analysis_server/test/search/type_hierarchy_test.dart b/pkg/analysis_server/test/search/type_hierarchy_test.dart
index 5aba67c..ac45e26 100644
--- a/pkg/analysis_server/test/search/type_hierarchy_test.dart
+++ b/pkg/analysis_server/test/search/type_hierarchy_test.dart
@@ -10,14 +10,14 @@
import 'package:analysis_server/src/search/search_domain.dart';
import 'package:analysis_server/src/services/index/index.dart';
import 'package:analysis_server/src/services/index/local_memory_index.dart';
+import 'package:test_reflective_loader/test_reflective_loader.dart';
import 'package:unittest/unittest.dart';
import '../analysis_abstract.dart';
-import '../reflective_tests.dart';
main() {
groupSep = ' | ';
- runReflectiveTests(GetTypeHierarchyTest);
+ defineReflectiveTests(GetTypeHierarchyTest);
}
@reflectiveTest
@@ -114,9 +114,8 @@
class A {}
class B extends A {}
''');
- packageMapProvider.packageMap['pkgA'] = [
- resourceProvider.getResource('/packages/pkgA')
- ];
+ packageMapProvider.packageMap['pkgA'] =
+ [resourceProvider.getResource('/packages/pkgA')];
// reference the package from a project
addTestFile('''
import 'package:pkgA/libA.dart';
diff --git a/pkg/analysis_server/test/services/completion/arglist_contributor_test.dart b/pkg/analysis_server/test/services/completion/arglist_contributor_test.dart
index 64979d6..5218204 100644
--- a/pkg/analysis_server/test/services/completion/arglist_contributor_test.dart
+++ b/pkg/analysis_server/test/services/completion/arglist_contributor_test.dart
@@ -7,14 +7,14 @@
import 'package:analysis_server/src/protocol.dart';
import 'package:analysis_server/src/services/completion/arglist_contributor.dart';
import 'package:analysis_server/src/services/completion/dart_completion_manager.dart';
+import 'package:test_reflective_loader/test_reflective_loader.dart';
import 'package:unittest/unittest.dart';
-import '../../reflective_tests.dart';
import 'completion_test_util.dart';
main() {
groupSep = ' | ';
- runReflectiveTests(ArgListContributorTest);
+ defineReflectiveTests(ArgListContributorTest);
}
@reflectiveTest
@@ -77,7 +77,7 @@
for (String name in namedArguments) {
expected.add(assertSuggest('$name: ',
csKind: CompletionSuggestionKind.NAMED_ARGUMENT,
- relevance: DART_RELEVANCE_PARAMETER));
+ relevance: DART_RELEVANCE_NAMED_PARAMETER));
}
assertNoOtherSuggestions(expected);
}
diff --git a/pkg/analysis_server/test/services/completion/combinator_contributor_test.dart b/pkg/analysis_server/test/services/completion/combinator_contributor_test.dart
index 01df6a0..60e402c 100644
--- a/pkg/analysis_server/test/services/completion/combinator_contributor_test.dart
+++ b/pkg/analysis_server/test/services/completion/combinator_contributor_test.dart
@@ -7,14 +7,14 @@
import 'package:analysis_server/src/protocol.dart';
import 'package:analysis_server/src/services/completion/combinator_contributor.dart';
import 'package:analysis_server/src/services/completion/dart_completion_manager.dart';
+import 'package:test_reflective_loader/test_reflective_loader.dart';
import 'package:unittest/unittest.dart';
-import '../../reflective_tests.dart';
import 'completion_test_util.dart';
main() {
groupSep = ' | ';
- runReflectiveTests(CombinatorContributorTest);
+ defineReflectiveTests(CombinatorContributorTest);
}
@reflectiveTest
@@ -68,8 +68,8 @@
assertSuggestClass('PB',
relevance: DART_RELEVANCE_DEFAULT,
kind: CompletionSuggestionKind.IDENTIFIER);
- assertSuggestTopLevelVar('T1', null,
- DART_RELEVANCE_DEFAULT, CompletionSuggestionKind.IDENTIFIER);
+ assertSuggestTopLevelVar('T1', null, DART_RELEVANCE_DEFAULT,
+ CompletionSuggestionKind.IDENTIFIER);
assertSuggestFunction('F1', 'PB',
kind: CompletionSuggestionKind.IDENTIFIER);
assertNotSuggested('C');
@@ -111,15 +111,15 @@
assertSuggestClass('PB',
relevance: DART_RELEVANCE_DEFAULT,
kind: CompletionSuggestionKind.IDENTIFIER);
- assertSuggestTopLevelVar('T1', null,
- DART_RELEVANCE_DEFAULT, CompletionSuggestionKind.IDENTIFIER);
+ assertSuggestTopLevelVar('T1', null, DART_RELEVANCE_DEFAULT,
+ CompletionSuggestionKind.IDENTIFIER);
assertSuggestFunction('F1', 'PB',
kind: CompletionSuggestionKind.IDENTIFIER);
assertSuggestClass('Clz',
relevance: DART_RELEVANCE_DEFAULT,
kind: CompletionSuggestionKind.IDENTIFIER);
- assertSuggestFunctionTypeAlias('F2', null,
- false, DART_RELEVANCE_DEFAULT, CompletionSuggestionKind.IDENTIFIER);
+ assertSuggestFunctionTypeAlias('F2', null, false, DART_RELEVANCE_DEFAULT,
+ CompletionSuggestionKind.IDENTIFIER);
assertNotSuggested('C');
assertNotSuggested('D');
assertNotSuggested('X');
diff --git a/pkg/analysis_server/test/services/completion/common_usage_computer_test.dart b/pkg/analysis_server/test/services/completion/common_usage_computer_test.dart
index a1d86e0..9a46aac 100644
--- a/pkg/analysis_server/test/services/completion/common_usage_computer_test.dart
+++ b/pkg/analysis_server/test/services/completion/common_usage_computer_test.dart
@@ -6,6 +6,8 @@
import 'dart:async';
+import 'package:analysis_server/src/analysis_server.dart'
+ show ContextSourcePair;
import 'package:analysis_server/src/constants.dart';
import 'package:analysis_server/src/domain_completion.dart';
import 'package:analysis_server/src/protocol.dart';
@@ -16,16 +18,15 @@
import 'package:analysis_server/src/services/index/local_memory_index.dart';
import 'package:analyzer/src/generated/engine.dart';
import 'package:analyzer/src/generated/source.dart';
+import 'package:test_reflective_loader/test_reflective_loader.dart';
import 'package:unittest/unittest.dart';
import '../../analysis_abstract.dart';
import '../../mocks.dart';
-import '../../reflective_tests.dart';
-import 'package:analysis_server/src/analysis_server.dart' show ContextSourcePair;
main() {
groupSep = ' | ';
- runReflectiveTests(CommonUsageComputerTest);
+ defineReflectiveTests(CommonUsageComputerTest);
}
@reflectiveTest
@@ -140,8 +141,8 @@
expect(replacementOffset, equals(completionOffset));
expect(replacementLength, equals(0));
assertHasResult(CompletionSuggestionKind.INVOCATION, 'delayed');
- assertHasResult(CompletionSuggestionKind.INVOCATION,
- 'value', DART_RELEVANCE_COMMON_USAGE);
+ assertHasResult(CompletionSuggestionKind.INVOCATION, 'value',
+ DART_RELEVANCE_COMMON_USAGE);
assertNoResult('Future');
assertNoResult('Object');
assertNoResult('A');
@@ -209,8 +210,8 @@
expect(replacementOffset, equals(completionOffset));
expect(replacementLength, equals(0));
assertHasResult(CompletionSuggestionKind.INVOCATION, 'nextBool');
- assertHasResult(CompletionSuggestionKind.INVOCATION,
- 'nextDouble', DART_RELEVANCE_COMMON_USAGE - 1);
+ assertHasResult(CompletionSuggestionKind.INVOCATION, 'nextDouble',
+ DART_RELEVANCE_COMMON_USAGE - 1);
assertHasResult(CompletionSuggestionKind.INVOCATION, 'nextInt',
DART_RELEVANCE_COMMON_USAGE);
assertNoResult('Random');
diff --git a/pkg/analysis_server/test/services/completion/completion_computer_test.dart b/pkg/analysis_server/test/services/completion/completion_computer_test.dart
index 50fee60..5b23689 100644
--- a/pkg/analysis_server/test/services/completion/completion_computer_test.dart
+++ b/pkg/analysis_server/test/services/completion/completion_computer_test.dart
@@ -6,6 +6,9 @@
import 'dart:async';
+import 'package:analysis_server/completion/completion_core.dart'
+ show CompletionRequest;
+import 'package:analysis_server/src/analysis_server.dart';
import 'package:analysis_server/src/protocol.dart';
import 'package:analysis_server/src/services/completion/completion_manager.dart';
import 'package:analysis_server/src/services/completion/dart_completion_manager.dart';
@@ -15,14 +18,15 @@
import 'package:analysis_server/src/services/search/search_engine_internal.dart';
import 'package:analyzer/src/generated/engine.dart';
import 'package:analyzer/src/generated/source.dart';
+import 'package:test_reflective_loader/test_reflective_loader.dart';
import 'package:unittest/unittest.dart';
import '../../abstract_single_unit.dart';
-import '../../reflective_tests.dart';
+import '../../operation/operation_queue_test.dart';
main() {
groupSep = ' | ';
- runReflectiveTests(DartCompletionManagerTest);
+ defineReflectiveTests(DartCompletionManagerTest);
}
/**
@@ -44,7 +48,6 @@
Index index;
SearchEngineImpl searchEngine;
Source source;
- CompletionPerformance perf;
DartCompletionManager manager;
MockCompletionContributor contributor1;
MockCompletionContributor contributor2;
@@ -63,7 +66,6 @@
index = createLocalMemoryIndex();
searchEngine = new SearchEngineImpl(index);
source = addSource('/does/not/exist.dart', '');
- perf = new CompletionPerformance();
manager = new DartCompletionManager.create(context, searchEngine, source);
suggestion1 = new CompletionSuggestion(CompletionSuggestionKind.INVOCATION,
DART_RELEVANCE_DEFAULT, "suggestion1", 1, 1, false, false);
@@ -83,7 +85,9 @@
manager.contributors = [contributor1, contributor2];
int count = 0;
bool done = false;
- CompletionRequest completionRequest = new CompletionRequest(0, perf);
+ AnalysisServer server = new AnalysisServerMock(searchEngine: searchEngine);
+ CompletionRequest completionRequest =
+ new CompletionRequestImpl(server, context, source, 0);
manager.results(completionRequest).listen((CompletionResult r) {
switch (++count) {
case 1:
@@ -120,7 +124,9 @@
manager.contributors = [contributor1, contributor2];
int count = 0;
bool done = false;
- CompletionRequest completionRequest = new CompletionRequest(0, perf);
+ AnalysisServer server = new AnalysisServerMock(searchEngine: searchEngine);
+ CompletionRequest completionRequest =
+ new CompletionRequestImpl(server, context, source, 0);
manager.results(completionRequest).listen((CompletionResult r) {
switch (++count) {
case 1:
diff --git a/pkg/analysis_server/test/services/completion/completion_manager_test.dart b/pkg/analysis_server/test/services/completion/completion_manager_test.dart
index 7981038..9efd78c 100644
--- a/pkg/analysis_server/test/services/completion/completion_manager_test.dart
+++ b/pkg/analysis_server/test/services/completion/completion_manager_test.dart
@@ -7,14 +7,14 @@
import 'package:analysis_server/src/services/completion/completion_manager.dart';
import 'package:analysis_server/src/services/completion/dart_completion_manager.dart';
import 'package:analyzer/src/generated/source.dart';
+import 'package:test_reflective_loader/test_reflective_loader.dart';
import 'package:unittest/unittest.dart';
import '../../abstract_context.dart';
-import '../../reflective_tests.dart';
main() {
groupSep = ' | ';
- runReflectiveTests(CompletionManagerTest);
+ defineReflectiveTests(CompletionManagerTest);
}
@reflectiveTest
diff --git a/pkg/analysis_server/test/services/completion/completion_target_test.dart b/pkg/analysis_server/test/services/completion/completion_target_test.dart
index e673466..57fb4e9 100644
--- a/pkg/analysis_server/test/services/completion/completion_target_test.dart
+++ b/pkg/analysis_server/test/services/completion/completion_target_test.dart
@@ -7,14 +7,14 @@
import 'package:analysis_server/src/services/completion/completion_target.dart';
import 'package:analyzer/src/generated/ast.dart';
import 'package:analyzer/src/generated/source.dart';
+import 'package:test_reflective_loader/test_reflective_loader.dart';
import 'package:unittest/unittest.dart';
import '../../abstract_context.dart';
-import '../../reflective_tests.dart';
main() {
groupSep = ' | ';
- runReflectiveTests(CompletionTargetTest);
+ defineReflectiveTests(CompletionTargetTest);
}
@reflectiveTest
diff --git a/pkg/analysis_server/test/services/completion/completion_test_util.dart b/pkg/analysis_server/test/services/completion/completion_test_util.dart
index e2af4d8..3e44f63 100644
--- a/pkg/analysis_server/test/services/completion/completion_test_util.dart
+++ b/pkg/analysis_server/test/services/completion/completion_test_util.dart
@@ -6,6 +6,7 @@
import 'dart:async';
+import 'package:analysis_server/src/analysis_server.dart';
import 'package:analysis_server/src/protocol.dart' as protocol
show Element, ElementKind;
import 'package:analysis_server/src/protocol.dart' hide Element, ElementKind;
@@ -26,6 +27,7 @@
import 'package:unittest/unittest.dart';
import '../../abstract_context.dart';
+import '../../operation/operation_queue_test.dart';
int suggestionComparator(CompletionSuggestion s1, CompletionSuggestion s2) {
String c1 = s1.completion.toLowerCase();
@@ -42,7 +44,7 @@
CompilationUnit testUnit;
int completionOffset;
AstNode completionNode;
- bool _computeFastCalled = false;
+ bool computeFastResult;
DartCompletionRequest request;
DartCompletionCache cache;
DartCompletionManager _completionManager;
@@ -63,8 +65,9 @@
content.substring(completionOffset + 1);
testSource = addSource(testFile, content);
cache = new DartCompletionCache(context, testSource);
- request = new DartCompletionRequest(context, searchEngine, testSource,
- completionOffset, cache, new CompletionPerformance());
+ AnalysisServer server = new AnalysisServerMock(searchEngine: searchEngine, resourceProvider: provider);
+ request = new DartCompletionRequest(
+ server, context, testSource, completionOffset, cache);
}
void assertHasNoParameterInfo(CompletionSuggestion suggestion) {
@@ -109,7 +112,7 @@
CompletionSuggestion assertSuggest(String completion,
{CompletionSuggestionKind csKind: CompletionSuggestionKind.INVOCATION,
- int relevance: DART_RELEVANCE_DEFAULT,
+ int relevance: DART_RELEVANCE_DEFAULT, String importUri,
protocol.ElementKind elemKind: null, bool isDeprecated: false,
bool isPotential: false}) {
CompletionSuggestion cs =
@@ -124,6 +127,7 @@
} else {
expect(cs.relevance, equals(relevance));
}
+ expect(cs.importUri, importUri);
expect(cs.selectionOffset, equals(completion.length));
expect(cs.selectionLength, equals(0));
expect(cs.isDeprecated, equals(isDeprecated));
@@ -132,11 +136,14 @@
}
CompletionSuggestion assertSuggestClass(String name,
- {int relevance: DART_RELEVANCE_DEFAULT,
+ {int relevance: DART_RELEVANCE_DEFAULT, String importUri,
CompletionSuggestionKind kind: CompletionSuggestionKind.INVOCATION,
bool isDeprecated: false}) {
CompletionSuggestion cs = assertSuggest(name,
- csKind: kind, relevance: relevance, isDeprecated: isDeprecated);
+ csKind: kind,
+ relevance: relevance,
+ importUri: importUri,
+ isDeprecated: isDeprecated);
protocol.Element element = cs.element;
expect(element, isNotNull);
expect(element.kind, equals(protocol.ElementKind.CLASS));
@@ -163,8 +170,9 @@
}
CompletionSuggestion assertSuggestConstructor(String name,
- {int relevance: DART_RELEVANCE_DEFAULT}) {
- CompletionSuggestion cs = assertSuggest(name, relevance: relevance);
+ {int relevance: DART_RELEVANCE_DEFAULT, String importUri}) {
+ CompletionSuggestion cs =
+ assertSuggest(name, relevance: relevance, importUri: importUri);
protocol.Element element = cs.element;
expect(element, isNotNull);
expect(element.kind, equals(protocol.ElementKind.CONSTRUCTOR));
@@ -174,12 +182,13 @@
}
CompletionSuggestion assertSuggestField(String name, String type,
- {int relevance: DART_RELEVANCE_DEFAULT,
+ {int relevance: DART_RELEVANCE_DEFAULT, String importUri,
CompletionSuggestionKind kind: CompletionSuggestionKind.INVOCATION,
bool isDeprecated: false}) {
CompletionSuggestion cs = assertSuggest(name,
csKind: kind,
relevance: relevance,
+ importUri: importUri,
elemKind: protocol.ElementKind.FIELD,
isDeprecated: isDeprecated);
// The returnType represents the type of a field
@@ -197,9 +206,13 @@
CompletionSuggestion assertSuggestFunction(String name, String returnType,
{CompletionSuggestionKind kind: CompletionSuggestionKind.INVOCATION,
- bool deprecated: false, int relevance: DART_RELEVANCE_DEFAULT}) {
+ bool deprecated: false, int relevance: DART_RELEVANCE_DEFAULT,
+ String importUri}) {
CompletionSuggestion cs = assertSuggest(name,
- csKind: kind, relevance: relevance, isDeprecated: deprecated);
+ csKind: kind,
+ relevance: relevance,
+ importUri: importUri,
+ isDeprecated: deprecated);
expect(cs.returnType, returnType != null ? returnType : 'dynamic');
protocol.Element element = cs.element;
expect(element, isNotNull);
@@ -219,9 +232,13 @@
CompletionSuggestion assertSuggestFunctionTypeAlias(
String name, String returnType, bool isDeprecated,
[int relevance = DART_RELEVANCE_DEFAULT,
- CompletionSuggestionKind kind = CompletionSuggestionKind.INVOCATION]) {
+ CompletionSuggestionKind kind = CompletionSuggestionKind.INVOCATION,
+ String importUri]) {
CompletionSuggestion cs = assertSuggest(name,
- csKind: kind, relevance: relevance, isDeprecated: isDeprecated);
+ csKind: kind,
+ relevance: relevance,
+ importUri: importUri,
+ isDeprecated: isDeprecated);
expect(cs.returnType, returnType != null ? returnType : 'dynamic');
protocol.Element element = cs.element;
expect(element, isNotNull);
@@ -241,12 +258,13 @@
}
CompletionSuggestion assertSuggestGetter(String name, String returnType,
- {int relevance: DART_RELEVANCE_DEFAULT,
+ {int relevance: DART_RELEVANCE_DEFAULT, String importUri,
CompletionSuggestionKind kind: CompletionSuggestionKind.INVOCATION,
bool isDeprecated: false}) {
CompletionSuggestion cs = assertSuggest(name,
csKind: kind,
relevance: relevance,
+ importUri: importUri,
elemKind: protocol.ElementKind.GETTER,
isDeprecated: isDeprecated);
expect(cs.returnType, returnType != null ? returnType : 'dynamic');
@@ -287,11 +305,14 @@
CompletionSuggestion assertSuggestMethod(
String name, String declaringType, String returnType,
- {int relevance: DART_RELEVANCE_DEFAULT,
+ {int relevance: DART_RELEVANCE_DEFAULT, String importUri,
CompletionSuggestionKind kind: CompletionSuggestionKind.INVOCATION,
bool isDeprecated: false}) {
CompletionSuggestion cs = assertSuggest(name,
- csKind: kind, relevance: relevance, isDeprecated: isDeprecated);
+ csKind: kind,
+ relevance: relevance,
+ importUri: importUri,
+ isDeprecated: isDeprecated);
expect(cs.declaringType, equals(declaringType));
expect(cs.returnType, returnType != null ? returnType : 'dynamic');
protocol.Element element = cs.element;
@@ -335,11 +356,12 @@
}
CompletionSuggestion assertSuggestSetter(String name,
- [int relevance = DART_RELEVANCE_DEFAULT,
+ [int relevance = DART_RELEVANCE_DEFAULT, String importUri,
CompletionSuggestionKind kind = CompletionSuggestionKind.INVOCATION]) {
CompletionSuggestion cs = assertSuggest(name,
csKind: kind,
relevance: relevance,
+ importUri: importUri,
elemKind: protocol.ElementKind.SETTER);
protocol.Element element = cs.element;
expect(element, isNotNull);
@@ -357,9 +379,10 @@
CompletionSuggestion assertSuggestTopLevelVar(String name, String returnType,
[int relevance = DART_RELEVANCE_DEFAULT,
- CompletionSuggestionKind kind = CompletionSuggestionKind.INVOCATION]) {
- CompletionSuggestion cs =
- assertSuggest(name, csKind: kind, relevance: relevance);
+ CompletionSuggestionKind kind = CompletionSuggestionKind.INVOCATION,
+ String importUri]) {
+ CompletionSuggestion cs = assertSuggest(name,
+ csKind: kind, relevance: relevance, importUri: importUri);
expect(cs.returnType, returnType != null ? returnType : 'dynamic');
protocol.Element element = cs.element;
expect(element, isNotNull);
@@ -382,21 +405,28 @@
}
bool computeFast() {
- _computeFastCalled = true;
+ expect(computeFastResult, isNull);
_completionManager = new DartCompletionManager(context, searchEngine,
testSource, cache, [contributor], new CommonUsageComputer({}));
- var result = _completionManager.computeFast(request);
+ var result =
+ _completionManager.computeFast(request, new CompletionPerformance());
expect(request.replacementOffset, isNotNull);
expect(request.replacementLength, isNotNull);
- return result.isEmpty;
+ computeFastResult = result.isEmpty;
+ return computeFastResult;
}
Future computeFull(assertFunction(bool result), {bool fullAnalysis: true}) {
- if (!_computeFastCalled) {
- expect(computeFast(), isFalse);
+ if (computeFastResult == null) {
+ computeFast();
}
- resolve(fullAnalysis);
- return contributor.computeFull(request).then(assertFunction);
+ if (computeFastResult) {
+ assertFunction(true);
+ return new Future.value(true);
+ } else {
+ resolve(fullAnalysis);
+ return contributor.computeFull(request).then(assertFunction);
+ }
}
void failedCompletion(String message,
@@ -524,16 +554,12 @@
CompletionSuggestion assertSuggestImportedClass(String name,
{CompletionSuggestionKind kind: CompletionSuggestionKind.INVOCATION,
- int relevance: DART_RELEVANCE_DEFAULT}) {
- if (contributor is ImportedReferenceContributor) {
- return assertSuggestClass(name, relevance: relevance, kind: kind);
- } else {
- return assertNotSuggested(name);
- }
+ int relevance: DART_RELEVANCE_DEFAULT, String importUri}) {
+ return assertNotSuggested(name);
}
CompletionSuggestion assertSuggestImportedConstructor(String name,
- {int relevance: DART_RELEVANCE_DEFAULT}) {
+ {int relevance: DART_RELEVANCE_DEFAULT, String importUri}) {
return assertNotSuggested(name);
}
@@ -545,7 +571,8 @@
CompletionSuggestion assertSuggestImportedFunction(
String name, String returnType,
{CompletionSuggestionKind kind: CompletionSuggestionKind.INVOCATION,
- bool deprecated: false, int relevance: DART_RELEVANCE_DEFAULT}) {
+ bool deprecated: false, int relevance: DART_RELEVANCE_DEFAULT,
+ String importUri}) {
return assertNotSuggested(name);
}
@@ -553,12 +580,7 @@
String name, String returnType, [bool isDeprecated = false,
int relevance = DART_RELEVANCE_DEFAULT,
CompletionSuggestionKind kind = CompletionSuggestionKind.INVOCATION]) {
- if (contributor is ImportedReferenceContributor) {
- return assertSuggestFunctionTypeAlias(
- name, returnType, isDeprecated, relevance, kind);
- } else {
- return assertNotSuggested(name);
- }
+ return assertNotSuggested(name);
}
CompletionSuggestion assertSuggestImportedGetter(
@@ -580,12 +602,9 @@
CompletionSuggestion assertSuggestImportedTopLevelVar(
String name, String returnType, [int relevance = DART_RELEVANCE_DEFAULT,
- CompletionSuggestionKind kind = CompletionSuggestionKind.INVOCATION]) {
- if (contributor is ImportedReferenceContributor) {
- return assertSuggestTopLevelVar(name, returnType, relevance, kind);
- } else {
- return assertNotSuggested(name);
- }
+ CompletionSuggestionKind kind = CompletionSuggestionKind.INVOCATION,
+ String importUri]) {
+ return assertNotSuggested(name);
}
CompletionSuggestion assertSuggestInvocationClass(String name,
@@ -1267,6 +1286,319 @@
});
}
+ test_Block_final() {
+ // Block BlockFunctionBody MethodDeclaration
+ addSource('/testAB.dart', '''
+ export "dart:math" hide max;
+ class A {int x;}
+ @deprecated D1() {int x;}
+ class _B {boo() { partBoo() {}} }''');
+ addSource('/testCD.dart', '''
+ String T1;
+ var _T2;
+ class C { }
+ class D { }''');
+ addSource('/testEEF.dart', '''
+ class EE { }
+ class F { }''');
+ addSource('/testG.dart', 'class G { }');
+ addSource('/testH.dart', '''
+ class H { }
+ int T3;
+ var _T4;'''); // not imported
+ addTestSource('''
+ import "/testAB.dart";
+ import "/testCD.dart" hide D;
+ import "/testEEF.dart" show EE;
+ import "/testG.dart" as g;
+ int T5;
+ var _T6;
+ String get T7 => 'hello';
+ set T8(int value) { partT8() {} }
+ Z D2() {int x;}
+ class X {
+ int get clog => 8;
+ set blog(value) { }
+ a() {
+ var f;
+ localF(int arg1) { }
+ {var x;}
+ final ^
+ }
+ void b() { }}
+ class Z { }''');
+ computeFast();
+ return computeFull((bool result) {
+ expect(request.replacementOffset, completionOffset);
+ expect(request.replacementLength, 0);
+
+ assertSuggestLocalClass('X');
+ assertSuggestLocalClass('Z');
+ assertNotSuggested('a');
+ assertNotSuggested('b');
+ assertNotSuggested('localF');
+ assertNotSuggested('f');
+ // Don't suggest locals out of scope
+ assertNotSuggested('r');
+ assertNotSuggested('x');
+ assertNotSuggested('partT8');
+
+ assertSuggestImportedClass('A');
+ assertNotSuggested('_B');
+ assertSuggestImportedClass('C');
+ assertNotSuggested('partBoo');
+ // hidden element suggested as low relevance
+ // but imported results are partially filtered
+ //assertSuggestImportedClass('D', COMPLETION_RELEVANCE_LOW);
+ //assertSuggestImportedFunction(
+ // 'D1', null, true, COMPLETION_RELEVANCE_LOW);
+ assertNotSuggested('D2');
+ assertSuggestImportedClass('EE');
+ // hidden element suggested as low relevance
+ //assertSuggestImportedClass('F', COMPLETION_RELEVANCE_LOW);
+ assertSuggestLibraryPrefix('g');
+ assertNotSuggested('G');
+ //assertSuggestImportedClass('H', COMPLETION_RELEVANCE_LOW);
+ assertSuggestImportedClass('Object');
+ assertNotSuggested('min');
+ //assertSuggestImportedFunction(
+ // 'max',
+ // 'num',
+ // false,
+ // COMPLETION_RELEVANCE_LOW);
+ assertNotSuggested('T1');
+ assertNotSuggested('_T2');
+ //assertSuggestImportedTopLevelVar('T3', 'int', COMPLETION_RELEVANCE_LOW);
+ assertNotSuggested('_T4');
+ assertNotSuggested('T5');
+ assertNotSuggested('_T6');
+ assertNotSuggested('==');
+ assertNotSuggested('T7');
+ assertNotSuggested('T8');
+ assertNotSuggested('clog');
+ assertNotSuggested('blog');
+ // TODO (danrubel) suggest HtmlElement as low relevance
+ assertNotSuggested('HtmlElement');
+ assertSuggestImportedClass('Uri');
+ assertNotSuggested('parseIPv6Address');
+ assertNotSuggested('parseHex');
+ });
+ }
+
+ test_Block_final2() {
+ addTestSource('main() {final S^ v;}');
+ computeFast();
+ return computeFull((bool result) {
+ assertSuggestImportedClass('String');
+ });
+ }
+
+ test_Block_final3() {
+ addTestSource('main() {final ^ v;}');
+ computeFast();
+ return computeFull((bool result) {
+ assertSuggestImportedClass('String');
+ });
+ }
+
+ test_Block_final_final() {
+ // Block BlockFunctionBody MethodDeclaration
+ addSource('/testAB.dart', '''
+ export "dart:math" hide max;
+ class A {int x;}
+ @deprecated D1() {int x;}
+ class _B {boo() { partBoo() {}} }''');
+ addSource('/testCD.dart', '''
+ String T1;
+ var _T2;
+ class C { }
+ class D { }''');
+ addSource('/testEEF.dart', '''
+ class EE { }
+ class F { }''');
+ addSource('/testG.dart', 'class G { }');
+ addSource('/testH.dart', '''
+ class H { }
+ int T3;
+ var _T4;'''); // not imported
+ addTestSource('''
+ import "/testAB.dart";
+ import "/testCD.dart" hide D;
+ import "/testEEF.dart" show EE;
+ import "/testG.dart" as g;
+ int T5;
+ var _T6;
+ String get T7 => 'hello';
+ set T8(int value) { partT8() {} }
+ Z D2() {int x;}
+ class X {
+ int get clog => 8;
+ set blog(value) { }
+ a() {
+ final ^
+ final var f;
+ localF(int arg1) { }
+ {var x;}
+ }
+ void b() { }}
+ class Z { }''');
+ computeFast();
+ return computeFull((bool result) {
+ expect(request.replacementOffset, completionOffset);
+ expect(request.replacementLength, 0);
+
+ assertSuggestLocalClass('X');
+ assertSuggestLocalClass('Z');
+ assertNotSuggested('a');
+ assertNotSuggested('b');
+ assertNotSuggested('localF');
+ assertNotSuggested('f');
+ // Don't suggest locals out of scope
+ assertNotSuggested('r');
+ assertNotSuggested('x');
+ assertNotSuggested('partT8');
+
+ assertSuggestImportedClass('A');
+ assertNotSuggested('_B');
+ assertSuggestImportedClass('C');
+ assertNotSuggested('partBoo');
+ // hidden element suggested as low relevance
+ // but imported results are partially filtered
+ //assertSuggestImportedClass('D', COMPLETION_RELEVANCE_LOW);
+ //assertSuggestImportedFunction(
+ // 'D1', null, true, COMPLETION_RELEVANCE_LOW);
+ assertNotSuggested('D2');
+ assertSuggestImportedClass('EE');
+ // hidden element suggested as low relevance
+ //assertSuggestImportedClass('F', COMPLETION_RELEVANCE_LOW);
+ assertSuggestLibraryPrefix('g');
+ assertNotSuggested('G');
+ //assertSuggestImportedClass('H', COMPLETION_RELEVANCE_LOW);
+ assertSuggestImportedClass('Object');
+ assertNotSuggested('min');
+ //assertSuggestImportedFunction(
+ // 'max',
+ // 'num',
+ // false,
+ // COMPLETION_RELEVANCE_LOW);
+ assertNotSuggested('T1');
+ assertNotSuggested('_T2');
+ //assertSuggestImportedTopLevelVar('T3', 'int', COMPLETION_RELEVANCE_LOW);
+ assertNotSuggested('_T4');
+ assertNotSuggested('T5');
+ assertNotSuggested('_T6');
+ assertNotSuggested('==');
+ assertNotSuggested('T7');
+ assertNotSuggested('T8');
+ assertNotSuggested('clog');
+ assertNotSuggested('blog');
+ // TODO (danrubel) suggest HtmlElement as low relevance
+ assertNotSuggested('HtmlElement');
+ assertSuggestImportedClass('Uri');
+ assertNotSuggested('parseIPv6Address');
+ assertNotSuggested('parseHex');
+ });
+ }
+
+ test_Block_final_var() {
+ // Block BlockFunctionBody MethodDeclaration
+ addSource('/testAB.dart', '''
+ export "dart:math" hide max;
+ class A {int x;}
+ @deprecated D1() {int x;}
+ class _B {boo() { partBoo() {}} }''');
+ addSource('/testCD.dart', '''
+ String T1;
+ var _T2;
+ class C { }
+ class D { }''');
+ addSource('/testEEF.dart', '''
+ class EE { }
+ class F { }''');
+ addSource('/testG.dart', 'class G { }');
+ addSource('/testH.dart', '''
+ class H { }
+ int T3;
+ var _T4;'''); // not imported
+ addTestSource('''
+ import "/testAB.dart";
+ import "/testCD.dart" hide D;
+ import "/testEEF.dart" show EE;
+ import "/testG.dart" as g;
+ int T5;
+ var _T6;
+ String get T7 => 'hello';
+ set T8(int value) { partT8() {} }
+ Z D2() {int x;}
+ class X {
+ int get clog => 8;
+ set blog(value) { }
+ a() {
+ final ^
+ var f;
+ localF(int arg1) { }
+ {var x;}
+ }
+ void b() { }}
+ class Z { }''');
+ computeFast();
+ return computeFull((bool result) {
+ expect(request.replacementOffset, completionOffset);
+ expect(request.replacementLength, 0);
+
+ assertSuggestLocalClass('X');
+ assertSuggestLocalClass('Z');
+ assertNotSuggested('a');
+ assertNotSuggested('b');
+ assertNotSuggested('localF');
+ assertNotSuggested('f');
+ // Don't suggest locals out of scope
+ assertNotSuggested('r');
+ assertNotSuggested('x');
+ assertNotSuggested('partT8');
+
+ assertSuggestImportedClass('A');
+ assertNotSuggested('_B');
+ assertSuggestImportedClass('C');
+ assertNotSuggested('partBoo');
+ // hidden element suggested as low relevance
+ // but imported results are partially filtered
+ //assertSuggestImportedClass('D', COMPLETION_RELEVANCE_LOW);
+ //assertSuggestImportedFunction(
+ // 'D1', null, true, COMPLETION_RELEVANCE_LOW);
+ assertNotSuggested('D2');
+ assertSuggestImportedClass('EE');
+ // hidden element suggested as low relevance
+ //assertSuggestImportedClass('F', COMPLETION_RELEVANCE_LOW);
+ assertSuggestLibraryPrefix('g');
+ assertNotSuggested('G');
+ //assertSuggestImportedClass('H', COMPLETION_RELEVANCE_LOW);
+ assertSuggestImportedClass('Object');
+ assertNotSuggested('min');
+ //assertSuggestImportedFunction(
+ // 'max',
+ // 'num',
+ // false,
+ // COMPLETION_RELEVANCE_LOW);
+ assertNotSuggested('T1');
+ assertNotSuggested('_T2');
+ //assertSuggestImportedTopLevelVar('T3', 'int', COMPLETION_RELEVANCE_LOW);
+ assertNotSuggested('_T4');
+ assertNotSuggested('T5');
+ assertNotSuggested('_T6');
+ assertNotSuggested('==');
+ assertNotSuggested('T7');
+ assertNotSuggested('T8');
+ assertNotSuggested('clog');
+ assertNotSuggested('blog');
+ // TODO (danrubel) suggest HtmlElement as low relevance
+ assertNotSuggested('HtmlElement');
+ assertSuggestImportedClass('Uri');
+ assertNotSuggested('parseIPv6Address');
+ assertNotSuggested('parseHex');
+ });
+ }
+
test_Block_identifier_partial() {
addSource('/testAB.dart', '''
export "dart:math" hide max;
@@ -1316,12 +1648,14 @@
assertNotSuggested('_B');
//assertSuggestImportedClass('C');
// hidden element suggested as low relevance
- assertSuggestImportedClass('D', relevance: DART_RELEVANCE_LOW);
+ assertSuggestImportedClass('D',
+ relevance: DART_RELEVANCE_LOW, importUri: 'testCD.dart');
assertSuggestImportedFunction('D1', null,
deprecated: true, relevance: DART_RELEVANCE_LOW);
assertSuggestLocalFunction('D2', 'Z');
// unimported elements suggested with low relevance
- assertSuggestImportedClass('D3', relevance: DART_RELEVANCE_LOW);
+ assertSuggestImportedClass('D3',
+ relevance: DART_RELEVANCE_LOW, importUri: 'testH.dart');
//assertSuggestImportedClass('EE');
// hidden element suggested as low relevance
//assertSuggestImportedClass('F', COMPLETION_RELEVANCE_LOW);
@@ -1457,14 +1791,22 @@
}
test_Block_unimported() {
- addSource('/testAB.dart', 'class Foo { }');
+ addPackageSource('myBar', 'bar.dart', 'class Foo2 { Foo2() { } }');
+ addSource(
+ '/proj/testAB.dart', 'import "package:myBar/bar.dart"; class Foo { }');
+ testFile = '/proj/completionTest.dart';
addTestSource('class C {foo(){F^}}');
computeFast();
return computeFull((bool result) {
expect(request.replacementOffset, completionOffset - 1);
expect(request.replacementLength, 1);
- assertSuggestImportedClass('Foo', relevance: DART_RELEVANCE_LOW);
- assertSuggestImportedClass('Future', relevance: DART_RELEVANCE_LOW);
+ assertSuggestImportedClass('Foo',
+ relevance: DART_RELEVANCE_LOW, importUri: 'testAB.dart');
+ // TODO(danrubel) implement
+ assertSuggestImportedClass('Foo2',
+ relevance: DART_RELEVANCE_LOW, importUri: 'package:myBar/bar.dart');
+ assertSuggestImportedClass('Future',
+ relevance: DART_RELEVANCE_LOW, importUri: 'dart:async');
});
}
@@ -1653,6 +1995,69 @@
});
}
+ test_ClassDeclaration_body_final() {
+ // ClassDeclaration CompilationUnit
+ addSource('/testB.dart', '''
+ class B { }''');
+ addTestSource('''
+ import "testB.dart" as x;
+ class A {final ^}
+ class _B {}
+ A T;''');
+ computeFast();
+ return computeFull((bool result) {
+ expect(request.replacementOffset, completionOffset);
+ expect(request.replacementLength, 0);
+ assertSuggestLocalClass('A');
+ assertSuggestLocalClass('_B');
+ assertSuggestImportedClass('Object');
+ assertNotSuggested('T');
+ assertSuggestLibraryPrefix('x');
+ });
+ }
+
+ test_ClassDeclaration_body_final_final() {
+ // ClassDeclaration CompilationUnit
+ addSource('/testB.dart', '''
+ class B { }''');
+ addTestSource('''
+ import "testB.dart" as x;
+ class A {final ^ final foo;}
+ class _B {}
+ A T;''');
+ computeFast();
+ return computeFull((bool result) {
+ expect(request.replacementOffset, completionOffset);
+ expect(request.replacementLength, 0);
+ assertSuggestLocalClass('A');
+ assertSuggestLocalClass('_B');
+ assertSuggestImportedClass('Object');
+ assertNotSuggested('T');
+ assertSuggestLibraryPrefix('x');
+ });
+ }
+
+ test_ClassDeclaration_body_final_var() {
+ // ClassDeclaration CompilationUnit
+ addSource('/testB.dart', '''
+ class B { }''');
+ addTestSource('''
+ import "testB.dart" as x;
+ class A {final ^ var foo;}
+ class _B {}
+ A T;''');
+ computeFast();
+ return computeFull((bool result) {
+ expect(request.replacementOffset, completionOffset);
+ expect(request.replacementLength, 0);
+ assertSuggestLocalClass('A');
+ assertSuggestLocalClass('_B');
+ assertSuggestImportedClass('Object');
+ assertNotSuggested('T');
+ assertSuggestLibraryPrefix('x');
+ });
+ }
+
test_Combinator_hide() {
// SimpleIdentifier HideCombinator ImportDirective
addSource('/testAB.dart', '''
@@ -2019,6 +2424,16 @@
});
}
+ test_FieldFormalParameter_in_non_constructor() {
+ // SimpleIdentifer FieldFormalParameter FormalParameterList
+ addTestSource('class A {B(this.^foo) {}}');
+ return computeFull((bool result) {
+ expect(request.replacementOffset, completionOffset);
+ expect(request.replacementLength, 3);
+ assertNoSuggestions();
+ });
+ }
+
test_ForEachStatement_body_typed() {
// Block ForEachStatement
addTestSource('main(args) {for (int foo in bar) {^}}');
@@ -2452,8 +2867,10 @@
return computeFull((bool result) {
expect(request.replacementOffset, completionOffset - 1);
expect(request.replacementLength, 1);
- assertSuggestImportedConstructor('Foo', relevance: DART_RELEVANCE_LOW);
- assertSuggestImportedConstructor('Future', relevance: DART_RELEVANCE_LOW);
+ assertSuggestImportedConstructor('Future',
+ relevance: DART_RELEVANCE_LOW, importUri: 'dart:async');
+ assertSuggestImportedConstructor('Foo',
+ relevance: DART_RELEVANCE_LOW, importUri: 'testAB.dart');
});
}
@@ -3624,6 +4041,161 @@
});
}
+ test_ThisExpression_constructor_param() {
+ // SimpleIdentifier FieldFormalParameter FormalParameterList
+ addTestSource('''
+ main() { }
+ class I {X get f => new A();get _g => new A();}
+ class A implements I {
+ A(this.^) {}
+ A.z() {}
+ var b; X _c;
+ X get d => new A();get _e => new A();
+ // no semicolon between completion point and next statement
+ set s1(I x) {} set _s2(I x) {m(null);}
+ m(X x) {} I _n(X x) {}}
+ class X{}''');
+ computeFast();
+ return computeFull((bool result) {
+ expect(request.replacementOffset, completionOffset);
+ expect(request.replacementLength, 0);
+ assertSuggestInvocationField('b', null,
+ relevance: DART_RELEVANCE_LOCAL_FIELD);
+ assertSuggestInvocationField('_c', 'X',
+ relevance: DART_RELEVANCE_LOCAL_FIELD);
+ assertNotSuggested('d');
+ assertNotSuggested('_e');
+ assertNotSuggested('f');
+ assertNotSuggested('_g');
+ assertNotSuggested('m');
+ assertNotSuggested('_n');
+ assertNotSuggested('s1');
+ assertNotSuggested('_s2');
+ assertNotSuggested('z');
+ assertNotSuggested('I');
+ assertNotSuggested('A');
+ assertNotSuggested('X');
+ assertNotSuggested('Object');
+ assertNotSuggested('==');
+ });
+ }
+
+ test_ThisExpression_constructor_param2() {
+ // SimpleIdentifier FieldFormalParameter FormalParameterList
+ addTestSource('''
+ main() { }
+ class I {X get f => new A();get _g => new A();}
+ class A implements I {
+ A(this.b^) {}
+ A.z() {}
+ var b; X _c;
+ X get d => new A();get _e => new A();
+ // no semicolon between completion point and next statement
+ set s1(I x) {} set _s2(I x) {m(null);}
+ m(X x) {} I _n(X x) {}}
+ class X{}''');
+ computeFast();
+ return computeFull((bool result) {
+ expect(request.replacementOffset, completionOffset - 1);
+ expect(request.replacementLength, 1);
+ assertSuggestInvocationField('b', null,
+ relevance: DART_RELEVANCE_LOCAL_FIELD);
+ assertSuggestInvocationField('_c', 'X',
+ relevance: DART_RELEVANCE_LOCAL_FIELD);
+ assertNotSuggested('d');
+ assertNotSuggested('_e');
+ assertNotSuggested('f');
+ assertNotSuggested('_g');
+ assertNotSuggested('m');
+ assertNotSuggested('_n');
+ assertNotSuggested('s1');
+ assertNotSuggested('_s2');
+ assertNotSuggested('z');
+ assertNotSuggested('I');
+ assertNotSuggested('A');
+ assertNotSuggested('X');
+ assertNotSuggested('Object');
+ assertNotSuggested('==');
+ });
+ }
+
+ test_ThisExpression_constructor_param3() {
+ // SimpleIdentifier FieldFormalParameter FormalParameterList
+ addTestSource('''
+ main() { }
+ class I {X get f => new A();get _g => new A();}
+ class A implements I {
+ A(this.^b) {}
+ A.z() {}
+ var b; X _c;
+ X get d => new A();get _e => new A();
+ // no semicolon between completion point and next statement
+ set s1(I x) {} set _s2(I x) {m(null);}
+ m(X x) {} I _n(X x) {}}
+ class X{}''');
+ computeFast();
+ return computeFull((bool result) {
+ expect(request.replacementOffset, completionOffset);
+ expect(request.replacementLength, 1);
+ assertSuggestInvocationField('b', null,
+ relevance: DART_RELEVANCE_LOCAL_FIELD);
+ assertSuggestInvocationField('_c', 'X',
+ relevance: DART_RELEVANCE_LOCAL_FIELD);
+ assertNotSuggested('d');
+ assertNotSuggested('_e');
+ assertNotSuggested('f');
+ assertNotSuggested('_g');
+ assertNotSuggested('m');
+ assertNotSuggested('_n');
+ assertNotSuggested('s1');
+ assertNotSuggested('_s2');
+ assertNotSuggested('z');
+ assertNotSuggested('I');
+ assertNotSuggested('A');
+ assertNotSuggested('X');
+ assertNotSuggested('Object');
+ assertNotSuggested('==');
+ });
+ }
+
+ test_ThisExpression_constructor_param4() {
+ // SimpleIdentifier FieldFormalParameter FormalParameterList
+ addTestSource('''
+ main() { }
+ class I {X get f => new A();get _g => new A();}
+ class A implements I {
+ A(this.b, this.^) {}
+ A.z() {}
+ var b; X _c;
+ X get d => new A();get _e => new A();
+ // no semicolon between completion point and next statement
+ set s1(I x) {} set _s2(I x) {m(null);}
+ m(X x) {} I _n(X x) {}}
+ class X{}''');
+ computeFast();
+ return computeFull((bool result) {
+ expect(request.replacementOffset, completionOffset);
+ expect(request.replacementLength, 0);
+ assertNotSuggested('b');
+ assertSuggestInvocationField('_c', 'X',
+ relevance: DART_RELEVANCE_LOCAL_FIELD);
+ assertNotSuggested('d');
+ assertNotSuggested('_e');
+ assertNotSuggested('f');
+ assertNotSuggested('_g');
+ assertNotSuggested('m');
+ assertNotSuggested('_n');
+ assertNotSuggested('s1');
+ assertNotSuggested('_s2');
+ assertNotSuggested('z');
+ assertNotSuggested('I');
+ assertNotSuggested('A');
+ assertNotSuggested('X');
+ assertNotSuggested('Object');
+ assertNotSuggested('==');
+ });
+ }
+
test_TopLevelVariableDeclaration_typed_name() {
// SimpleIdentifier VariableDeclaration VariableDeclarationList
// TopLevelVariableDeclaration
diff --git a/pkg/analysis_server/test/services/completion/import_uri_contributor_test.dart b/pkg/analysis_server/test/services/completion/import_uri_contributor_test.dart
new file mode 100644
index 0000000..bfea35a
--- /dev/null
+++ b/pkg/analysis_server/test/services/completion/import_uri_contributor_test.dart
@@ -0,0 +1,258 @@
+// Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+library test.services.completion.contributor.dart.importuri;
+
+import 'dart:io';
+
+import 'package:analysis_server/src/protocol.dart';
+import 'package:analysis_server/src/services/completion/import_uri_contributor.dart';
+import 'package:path/path.dart';
+import 'package:test_reflective_loader/test_reflective_loader.dart';
+import 'package:unittest/unittest.dart';
+
+import 'completion_test_util.dart';
+
+main() {
+ groupSep = ' | ';
+ defineReflectiveTests(ImportUriContributorTest);
+}
+
+@reflectiveTest
+class ImportUriContributorTest extends AbstractCompletionTest {
+ @override
+ void setUpContributor() {
+ contributor = new ImportUriContributor();
+ }
+
+ test_import() {
+ addTestSource('import "^" import');
+ computeFast();
+ expect(request.replacementOffset, completionOffset);
+ expect(request.replacementLength, 0);
+ assertSuggest('dart:', csKind: CompletionSuggestionKind.IMPORT);
+ assertSuggest('package:', csKind: CompletionSuggestionKind.IMPORT);
+ }
+
+ test_import_dart() {
+ addTestSource('import "d^" import');
+ computeFast();
+ expect(request.replacementOffset, completionOffset - 1);
+ expect(request.replacementLength, 1);
+ assertSuggest('dart:', csKind: CompletionSuggestionKind.IMPORT);
+ assertNotSuggested('dart:core');
+ assertNotSuggested('dart:_internal');
+ assertSuggest('dart:async', csKind: CompletionSuggestionKind.IMPORT);
+ assertSuggest('dart:math', csKind: CompletionSuggestionKind.IMPORT);
+ }
+
+ test_import_dart2() {
+ addTestSource('import "dart:async"; import "d^"');
+ computeFast();
+ expect(request.replacementOffset, completionOffset - 1);
+ expect(request.replacementLength, 1);
+ assertSuggest('dart:', csKind: CompletionSuggestionKind.IMPORT);
+ assertNotSuggested('dart:core');
+ assertNotSuggested('dart:_internal');
+ assertNotSuggested('dart:async');
+ assertSuggest('dart:math', csKind: CompletionSuggestionKind.IMPORT);
+ }
+
+ test_import_file() {
+ // TODO(danrubel) fix file uri suggestions on Windows
+ if (Platform.isWindows) return;
+ testFile = '/proj/completion.dart';
+ addSource('/proj/other.dart', 'library other;');
+ addSource('/proj/foo/bar.dart', 'library bar;');
+ addSource('/blat.dart', 'library blat;');
+ addTestSource('import "^" import');
+ computeFast();
+ expect(request.replacementOffset, completionOffset);
+ expect(request.replacementLength, 0);
+ assertNotSuggested('completion.dart');
+ assertSuggest('other.dart', csKind: CompletionSuggestionKind.IMPORT);
+ assertNotSuggested('foo');
+ assertSuggest('foo${separator}', csKind: CompletionSuggestionKind.IMPORT);
+ assertNotSuggested('foo${separator}bar.dart');
+ assertNotSuggested('..${separator}blat.dart');
+ }
+
+ test_import_file2() {
+ // TODO(danrubel) fix file uri suggestions on Windows
+ if (Platform.isWindows) return;
+ testFile = '/proj/completion.dart';
+ addSource('/proj/other.dart', 'library other;');
+ addSource('/proj/foo/bar.dart', 'library bar;');
+ addSource('/blat.dart', 'library blat;');
+ addTestSource('import "..^" import');
+ computeFast();
+ expect(request.replacementOffset, completionOffset - 2);
+ expect(request.replacementLength, 2);
+ assertNotSuggested('completion.dart');
+ assertSuggest('other.dart', csKind: CompletionSuggestionKind.IMPORT);
+ assertNotSuggested('foo');
+ assertSuggest('foo${separator}', csKind: CompletionSuggestionKind.IMPORT);
+ assertNotSuggested('foo${separator}bar.dart');
+ assertNotSuggested('..${separator}blat.dart');
+ }
+
+ test_import_file_child() {
+ // TODO(danrubel) fix file uri suggestions on Windows
+ if (Platform.isWindows) return;
+ testFile = '/proj/completion.dart';
+ addSource('/proj/other.dart', 'library other;');
+ addSource('/proj/foo/bar.dart', 'library bar;');
+ addSource('/blat.dart', 'library blat;');
+ addTestSource('import "foo/^" import');
+ computeFast();
+ expect(request.replacementOffset, completionOffset - 4);
+ expect(request.replacementLength, 4);
+ assertNotSuggested('completion.dart');
+ assertNotSuggested('other.dart');
+ assertNotSuggested('foo');
+ assertNotSuggested('foo${separator}');
+ assertSuggest('foo${separator}bar.dart', csKind: CompletionSuggestionKind.IMPORT);
+ assertNotSuggested('..${separator}blat.dart');
+ }
+
+ test_import_file_parent() {
+ // TODO(danrubel) fix file uri suggestions on Windows
+ if (Platform.isWindows) return;
+ testFile = '/proj/completion.dart';
+ addSource('/proj/other.dart', 'library other;');
+ addSource('/proj/foo/bar.dart', 'library bar;');
+ addSource('/blat.dart', 'library blat;');
+ addTestSource('import "../^" import');
+ computeFast();
+ expect(request.replacementOffset, completionOffset - 3);
+ expect(request.replacementLength, 3);
+ assertNotSuggested('completion.dart');
+ assertNotSuggested('other.dart');
+ assertNotSuggested('foo');
+ assertNotSuggested('foo${separator}');
+ assertNotSuggested('foo${separator}bar.dart');
+ assertSuggest('..${separator}blat.dart', csKind: CompletionSuggestionKind.IMPORT);
+ }
+
+ test_import_package() {
+ addPackageSource('foo', 'foo.dart', 'library foo;');
+ addPackageSource('foo', 'baz/too.dart', 'library too;');
+ addPackageSource('bar', 'bar.dart', 'library bar;');
+ addTestSource('import "p^" import');
+ computeFast();
+ expect(request.replacementOffset, completionOffset - 1);
+ expect(request.replacementLength, 1);
+ assertSuggest('package:', csKind: CompletionSuggestionKind.IMPORT);
+ assertSuggest('package:foo/', csKind: CompletionSuggestionKind.IMPORT);
+ assertSuggest('package:foo/foo.dart',
+ csKind: CompletionSuggestionKind.IMPORT);
+ assertSuggest('package:foo/baz/', csKind: CompletionSuggestionKind.IMPORT);
+ assertNotSuggested('package:foo/baz/too.dart');
+ assertSuggest('package:bar/', csKind: CompletionSuggestionKind.IMPORT);
+ assertSuggest('package:bar/bar.dart',
+ csKind: CompletionSuggestionKind.IMPORT);
+ }
+
+ test_import_package2() {
+ addPackageSource('foo', 'foo.dart', 'library foo;');
+ addPackageSource('foo', 'baz/too.dart', 'library too;');
+ addPackageSource('bar', 'bar.dart', 'library bar;');
+ addTestSource('import "package:foo/baz/^" import');
+ computeFast();
+ assertSuggest('package:foo/baz/too.dart',
+ csKind: CompletionSuggestionKind.IMPORT);
+ }
+
+ test_outside_import() {
+ addTestSource('import ^"d" import');
+ computeFast();
+ computeFull((_) {
+ assertNoSuggestions();
+ });
+ }
+
+ test_outside_import2() {
+ addTestSource('import "d"^ import');
+ computeFast();
+ computeFull((_) {
+ assertNoSuggestions();
+ });
+ }
+
+ test_part_file() {
+ // TODO(danrubel) fix file uri suggestions on Windows
+ if (Platform.isWindows) return;
+ testFile = '/proj/completion.dart';
+ addSource('/proj/other.dart', 'library other;');
+ addSource('/proj/foo/bar.dart', 'library bar;');
+ addSource('/blat.dart', 'library blat;');
+ addTestSource('library x; part "^" import');
+ computeFast();
+ expect(request.replacementOffset, completionOffset);
+ expect(request.replacementLength, 0);
+ assertNotSuggested('completion.dart');
+ assertSuggest('other.dart', csKind: CompletionSuggestionKind.IMPORT);
+ assertNotSuggested('foo');
+ assertSuggest('foo${separator}', csKind: CompletionSuggestionKind.IMPORT);
+ assertNotSuggested('foo${separator}bar.dart');
+ assertNotSuggested('..${separator}blat.dart');
+ }
+
+ test_part_file2() {
+ // TODO(danrubel) fix file uri suggestions on Windows
+ if (Platform.isWindows) return;
+ testFile = '/proj/completion.dart';
+ addSource('/proj/other.dart', 'library other;');
+ addSource('/proj/foo/bar.dart', 'library bar;');
+ addSource('/blat.dart', 'library blat;');
+ addTestSource('library x; part "..^" import');
+ computeFast();
+ expect(request.replacementOffset, completionOffset - 2);
+ expect(request.replacementLength, 2);
+ assertNotSuggested('completion.dart');
+ assertSuggest('other.dart', csKind: CompletionSuggestionKind.IMPORT);
+ assertNotSuggested('foo');
+ assertSuggest('foo${separator}', csKind: CompletionSuggestionKind.IMPORT);
+ assertNotSuggested('foo${separator}bar.dart');
+ assertNotSuggested('..${separator}blat.dart');
+ }
+
+ test_part_file_child() {
+ // TODO(danrubel) fix file uri suggestions on Windows
+ if (Platform.isWindows) return;
+ testFile = '/proj/completion.dart';
+ addSource('/proj/other.dart', 'library other;');
+ addSource('/proj/foo/bar.dart', 'library bar;');
+ addSource('/blat.dart', 'library blat;');
+ addTestSource('library x; part "foo/^" import');
+ computeFast();
+ expect(request.replacementOffset, completionOffset - 4);
+ expect(request.replacementLength, 4);
+ assertNotSuggested('completion.dart');
+ assertNotSuggested('other.dart');
+ assertNotSuggested('foo');
+ assertNotSuggested('foo${separator}');
+ assertSuggest('foo${separator}bar.dart', csKind: CompletionSuggestionKind.IMPORT);
+ assertNotSuggested('..${separator}blat.dart');
+ }
+
+ test_part_file_parent() {
+ // TODO(danrubel) fix file uri suggestions on Windows
+ if (Platform.isWindows) return;
+ testFile = '/proj/completion.dart';
+ addSource('/proj/other.dart', 'library other;');
+ addSource('/proj/foo/bar.dart', 'library bar;');
+ addSource('/blat.dart', 'library blat;');
+ addTestSource('library x; part "../^" import');
+ computeFast();
+ expect(request.replacementOffset, completionOffset - 3);
+ expect(request.replacementLength, 3);
+ assertNotSuggested('completion.dart');
+ assertNotSuggested('other.dart');
+ assertNotSuggested('foo');
+ assertNotSuggested('foo${separator}');
+ assertNotSuggested('foo${separator}bar.dart');
+ assertSuggest('..${separator}blat.dart', csKind: CompletionSuggestionKind.IMPORT);
+ }
+}
diff --git a/pkg/analysis_server/test/services/completion/imported_reference_contributor_test.dart b/pkg/analysis_server/test/services/completion/imported_reference_contributor_test.dart
index 7551979..561d877 100644
--- a/pkg/analysis_server/test/services/completion/imported_reference_contributor_test.dart
+++ b/pkg/analysis_server/test/services/completion/imported_reference_contributor_test.dart
@@ -7,7 +7,6 @@
import 'package:analysis_server/src/protocol.dart' as protocol
show Element, ElementKind;
import 'package:analysis_server/src/protocol.dart' hide Element, ElementKind;
-import 'package:analysis_server/src/services/completion/completion_manager.dart';
import 'package:analysis_server/src/services/completion/dart_completion_cache.dart';
import 'package:analysis_server/src/services/completion/dart_completion_manager.dart';
import 'package:analysis_server/src/services/completion/imported_reference_contributor.dart';
@@ -15,15 +14,17 @@
import 'package:analyzer/src/generated/element.dart';
import 'package:analyzer/src/generated/engine.dart';
import 'package:analyzer/src/generated/source.dart';
+import 'package:test_reflective_loader/test_reflective_loader.dart';
import 'package:unittest/unittest.dart';
import '../../abstract_context.dart';
-import '../../reflective_tests.dart';
import 'completion_test_util.dart';
+import 'package:analysis_server/src/analysis_server.dart';
+import '../../operation/operation_queue_test.dart';
main() {
groupSep = ' | ';
- runReflectiveTests(ImportedReferenceContributorTest);
+ defineReflectiveTests(ImportedReferenceContributorTest);
}
@reflectiveTest
@@ -47,7 +48,6 @@
if (!(contributor as ImportedReferenceContributor).shouldWaitForLowPrioritySuggestions) {
return null;
}
- expect(request.unit.element, isNotNull);
List<CompletionSuggestion> oldSuggestions = request.suggestions;
/*
* Simulate a source change to flush the cached compilation unit
@@ -61,8 +61,13 @@
setUpContributor();
int replacementOffset = request.replacementOffset;
int replacementLength = request.replacementLength;
- request = new DartCompletionRequest(context, searchEngine, testSource,
- completionOffset, cache, new CompletionPerformance());
+ AnalysisServer server = new AnalysisServerMock();
+ /*
+ * Pass null for searchEngine to ensure that it is not used
+ * when the cache has been populated.
+ */
+ request = new DartCompletionRequest(
+ server, context, testSource, completionOffset, cache);
request.replacementOffset = replacementOffset;
request.replacementLength = replacementLength;
@@ -91,6 +96,7 @@
fail(sb.toString());
}
+ computeFastResult = null;
if (computeFast()) {
expect(request.unit.element, isNull);
assertResultsFromCache(oldSuggestions);
@@ -117,42 +123,76 @@
}
@override
+ CompletionSuggestion assertSuggestImportedClass(String name,
+ {CompletionSuggestionKind kind: CompletionSuggestionKind.INVOCATION,
+ int relevance: DART_RELEVANCE_DEFAULT, String importUri}) {
+ return assertSuggestClass(name,
+ relevance: relevance, kind: kind, importUri: importUri);
+ }
+
+ @override
CompletionSuggestion assertSuggestImportedConstructor(String name,
- {int relevance: DART_RELEVANCE_DEFAULT}) {
- return assertSuggestConstructor(name, relevance: relevance);
+ {int relevance: DART_RELEVANCE_DEFAULT, String importUri}) {
+ return assertSuggestConstructor(name,
+ relevance: relevance, importUri: importUri);
}
@override
CompletionSuggestion assertSuggestImportedField(String name, String type,
- {int relevance: DART_RELEVANCE_INHERITED_FIELD}) {
- return assertSuggestField(name, type, relevance: relevance);
+ {int relevance: DART_RELEVANCE_INHERITED_FIELD, String importUri}) {
+ return assertSuggestField(name, type,
+ relevance: relevance, importUri: importUri);
}
@override
CompletionSuggestion assertSuggestImportedFunction(
String name, String returnType,
{CompletionSuggestionKind kind: CompletionSuggestionKind.INVOCATION,
- bool deprecated: false, int relevance: DART_RELEVANCE_DEFAULT}) {
+ bool deprecated: false, int relevance: DART_RELEVANCE_DEFAULT,
+ String importUri}) {
return assertSuggestFunction(name, returnType,
- kind: kind, deprecated: deprecated, relevance: relevance);
+ kind: kind,
+ deprecated: deprecated,
+ relevance: relevance,
+ importUri: importUri);
+ }
+
+ @override
+ CompletionSuggestion assertSuggestImportedFunctionTypeAlias(
+ String name, String returnType, [bool isDeprecated = false,
+ int relevance = DART_RELEVANCE_DEFAULT,
+ CompletionSuggestionKind kind = CompletionSuggestionKind.INVOCATION,
+ String importUri]) {
+ return assertSuggestFunctionTypeAlias(
+ name, returnType, isDeprecated, relevance, kind, importUri);
}
CompletionSuggestion assertSuggestImportedGetter(
String name, String returnType,
- {int relevance: DART_RELEVANCE_INHERITED_ACCESSOR}) {
- return assertSuggestGetter(name, returnType, relevance: relevance);
+ {int relevance: DART_RELEVANCE_INHERITED_ACCESSOR, String importUri}) {
+ return assertSuggestGetter(name, returnType,
+ relevance: relevance, importUri: importUri);
}
CompletionSuggestion assertSuggestImportedMethod(
String name, String declaringType, String returnType,
- {int relevance: DART_RELEVANCE_INHERITED_METHOD}) {
+ {int relevance: DART_RELEVANCE_INHERITED_METHOD, String importUri}) {
return assertSuggestMethod(name, declaringType, returnType,
- relevance: relevance);
+ relevance: relevance, importUri: importUri);
}
CompletionSuggestion assertSuggestImportedSetter(String name,
- {int relevance: DART_RELEVANCE_INHERITED_ACCESSOR}) {
- return assertSuggestSetter(name, relevance);
+ {int relevance: DART_RELEVANCE_INHERITED_ACCESSOR, String importUri}) {
+ return assertSuggestSetter(name, relevance, importUri);
+ }
+
+ @override
+ CompletionSuggestion assertSuggestImportedTopLevelVar(
+ String name, String returnType, [int relevance = DART_RELEVANCE_DEFAULT,
+ CompletionSuggestionKind kind = CompletionSuggestionKind.INVOCATION,
+ String importUri]) {
+ return assertSuggestTopLevelVar(
+ name, returnType, relevance, kind, importUri);
}
@override
@@ -226,17 +266,6 @@
});
}
- test_internal_sdk_libs() {
- addTestSource('main() {p^}');
- computeFast();
- return computeFull((bool result) {
- assertSuggest('print');
- assertSuggest('pow', relevance: DART_RELEVANCE_LOW);
- // Do not suggest completions from internal SDK library
- assertNotSuggested('printToConsole');
- });
- }
-
test_Block_partial_results() {
// Block BlockFunctionBody MethodDeclaration
addSource('/testAB.dart', '''
@@ -458,6 +487,18 @@
});
}
+ test_internal_sdk_libs() {
+ addTestSource('main() {p^}');
+ computeFast();
+ return computeFull((bool result) {
+ assertSuggest('print');
+ assertSuggest('pow',
+ relevance: DART_RELEVANCE_LOW, importUri: 'dart:math');
+ // Do not suggest completions from internal SDK library
+ assertNotSuggested('printToConsole');
+ });
+ }
+
test_method_parameters_mixed_required_and_named() {
addSource('/libA.dart', '''
class A {
diff --git a/pkg/analysis_server/test/services/completion/keyword_contributor_test.dart b/pkg/analysis_server/test/services/completion/keyword_contributor_test.dart
index a7d881a..46940bf 100644
--- a/pkg/analysis_server/test/services/completion/keyword_contributor_test.dart
+++ b/pkg/analysis_server/test/services/completion/keyword_contributor_test.dart
@@ -8,14 +8,14 @@
import 'package:analysis_server/src/services/completion/dart_completion_manager.dart';
import 'package:analysis_server/src/services/completion/keyword_contributor.dart';
import 'package:analyzer/src/generated/scanner.dart';
+import 'package:test_reflective_loader/test_reflective_loader.dart';
import 'package:unittest/unittest.dart';
-import '../../reflective_tests.dart';
import 'completion_test_util.dart';
main() {
groupSep = ' | ';
- runReflectiveTests(KeywordContributorTest);
+ defineReflectiveTests(KeywordContributorTest);
}
@reflectiveTest
@@ -74,9 +74,10 @@
Keyword.VOID
];
- static const List<Keyword> IN_BLOCK_IN_CLASS = const [
+ static const List<String> NO_PSEUDO_KEYWORDS = const [];
+
+ static const List<Keyword> STMT_START_IN_CLASS = const [
Keyword.ASSERT,
- Keyword.CASE,
Keyword.CONTINUE,
Keyword.DO,
Keyword.FINAL,
@@ -95,10 +96,51 @@
Keyword.WHILE
];
- static const List<Keyword> IN_BLOCK_NOT_IN_CLASS = const [
+ static const List<Keyword> STMT_START_IN_SWITCH_IN_CLASS = const [
Keyword.ASSERT,
Keyword.CASE,
Keyword.CONTINUE,
+ Keyword.DEFAULT,
+ Keyword.DO,
+ Keyword.FINAL,
+ Keyword.FOR,
+ Keyword.IF,
+ Keyword.NEW,
+ Keyword.RETHROW,
+ Keyword.RETURN,
+ Keyword.SUPER,
+ Keyword.SWITCH,
+ Keyword.THIS,
+ Keyword.THROW,
+ Keyword.TRY,
+ Keyword.VAR,
+ Keyword.VOID,
+ Keyword.WHILE
+ ];
+
+ static const List<Keyword> STMT_START_IN_SWITCH_OUTSIDE_CLASS = const [
+ Keyword.ASSERT,
+ Keyword.CASE,
+ Keyword.CONTINUE,
+ Keyword.DEFAULT,
+ Keyword.DO,
+ Keyword.FINAL,
+ Keyword.FOR,
+ Keyword.IF,
+ Keyword.NEW,
+ Keyword.RETHROW,
+ Keyword.RETURN,
+ Keyword.SWITCH,
+ Keyword.THROW,
+ Keyword.TRY,
+ Keyword.VAR,
+ Keyword.VOID,
+ Keyword.WHILE
+ ];
+
+ static const List<Keyword> STMT_START_OUTSIDE_CLASS = const [
+ Keyword.ASSERT,
+ Keyword.CONTINUE,
Keyword.DO,
Keyword.FINAL,
Keyword.FOR,
@@ -114,43 +156,70 @@
Keyword.WHILE
];
+ static const List<Keyword> EXPRESSION_START_INSTANCE = const [
+ Keyword.FALSE,
+ Keyword.NEW,
+ Keyword.NULL,
+ Keyword.SUPER,
+ Keyword.THIS,
+ Keyword.TRUE,
+ ];
+
+ static const List<Keyword> EXPRESSION_START_NO_INSTANCE = const [
+ Keyword.FALSE,
+ Keyword.NEW,
+ Keyword.NULL,
+ Keyword.TRUE,
+ ];
+
void assertSuggestKeywords(Iterable<Keyword> expectedKeywords,
- [int relevance = DART_RELEVANCE_KEYWORD]) {
- Set<Keyword> actualKeywords = new Set<Keyword>();
+ {List<String> pseudoKeywords: NO_PSEUDO_KEYWORDS,
+ int relevance: DART_RELEVANCE_KEYWORD}) {
+ Set<String> expectedCompletions = new Set<String>();
+ Set<String> actualCompletions = new Set<String>();
+ expectedCompletions.addAll(expectedKeywords.map((k) => k.syntax));
+ expectedCompletions.addAll(pseudoKeywords);
+ if (expectedCompletions.contains(Keyword.IMPORT.syntax)) {
+ expectedCompletions.remove(Keyword.IMPORT.syntax);
+ expectedCompletions.add("import '';");
+ expectedCompletions.add("import '' as ;");
+ expectedCompletions.add("import '' hide ;");
+ expectedCompletions.add("import '' show ;");
+ }
for (CompletionSuggestion s in request.suggestions) {
if (s.kind == CompletionSuggestionKind.KEYWORD) {
Keyword k = Keyword.keywords[s.completion];
- if (k == null) {
+ if (k == null && !expectedCompletions.contains(s.completion)) {
fail('Invalid keyword suggested: ${s.completion}');
} else {
- if (!actualKeywords.add(k)) {
+ if (!actualCompletions.add(s.completion)) {
fail('Duplicate keyword suggested: ${s.completion}');
}
}
}
}
- if (expectedKeywords.any((k) => k is String)) {
- StringBuffer msg = new StringBuffer();
- msg.writeln('Expected set should be:');
- expectedKeywords.forEach((n) {
- Keyword k = Keyword.keywords[n];
- msg.writeln(' Keyword.${k.name},');
- });
- fail(msg.toString());
- }
- if (!_equalSets(expectedKeywords, actualKeywords)) {
+ if (!_equalSets(expectedCompletions, actualCompletions)) {
StringBuffer msg = new StringBuffer();
msg.writeln('Expected:');
- _appendKeywords(msg, expectedKeywords);
+ _appendCompletions(msg, expectedCompletions, actualCompletions);
msg.writeln('but found:');
- _appendKeywords(msg, actualKeywords);
+ _appendCompletions(msg, actualCompletions, expectedCompletions);
fail(msg.toString());
}
for (CompletionSuggestion s in request.suggestions) {
if (s.kind == CompletionSuggestionKind.KEYWORD) {
- Keyword k = Keyword.keywords[s.completion];
- expect(s.relevance, equals(relevance), reason: k.toString());
- expect(s.selectionOffset, equals(s.completion.length));
+ if (s.completion.startsWith(Keyword.IMPORT.syntax)) {
+ int importRelevance = relevance;
+ if (importRelevance == DART_RELEVANCE_HIGH &&
+ s.completion == "import '';") {
+ ++importRelevance;
+ }
+ expect(s.relevance, equals(importRelevance), reason: s.completion);
+ expect(s.selectionOffset, equals(Keyword.IMPORT.syntax.length + 2));
+ } else {
+ expect(s.relevance, equals(relevance), reason: s.completion);
+ expect(s.selectionOffset, equals(s.completion.length));
+ }
expect(s.selectionLength, equals(0));
expect(s.isDeprecated, equals(false));
expect(s.isPotential, equals(false));
@@ -166,45 +235,116 @@
test_after_class() {
addTestSource('class A {} ^');
expect(computeFast(), isTrue);
- assertSuggestKeywords(DECLARATION_KEYWORDS, DART_RELEVANCE_HIGH);
+ assertSuggestKeywords(DECLARATION_KEYWORDS, relevance: DART_RELEVANCE_HIGH);
}
test_after_class2() {
addTestSource('class A {} c^');
expect(computeFast(), isTrue);
- assertSuggestKeywords(DECLARATION_KEYWORDS, DART_RELEVANCE_HIGH);
+ assertSuggestKeywords(DECLARATION_KEYWORDS, relevance: DART_RELEVANCE_HIGH);
}
test_after_import() {
addTestSource('import "foo"; ^');
expect(computeFast(), isTrue);
- assertSuggestKeywords(
- DIRECTIVE_AND_DECLARATION_KEYWORDS, DART_RELEVANCE_HIGH);
+ assertSuggestKeywords(DIRECTIVE_AND_DECLARATION_KEYWORDS,
+ relevance: DART_RELEVANCE_HIGH);
}
test_after_import2() {
addTestSource('import "foo"; c^');
expect(computeFast(), isTrue);
- assertSuggestKeywords(
- DIRECTIVE_AND_DECLARATION_KEYWORDS, DART_RELEVANCE_HIGH);
+ assertSuggestKeywords(DIRECTIVE_AND_DECLARATION_KEYWORDS,
+ relevance: DART_RELEVANCE_HIGH);
+ }
+
+ test_argument() {
+ addTestSource('main() {foo(^);}');
+ expect(computeFast(), isTrue);
+ assertSuggestKeywords(EXPRESSION_START_NO_INSTANCE);
+ }
+
+ test_argument2() {
+ addTestSource('main() {foo(n^);}');
+ expect(computeFast(), isTrue);
+ assertSuggestKeywords(EXPRESSION_START_NO_INSTANCE);
+ }
+
+ test_argument_literal() {
+ addTestSource('main() {foo("^");}');
+ expect(computeFast(), isTrue);
+ assertSuggestKeywords([]);
+ }
+
+ test_argument_named() {
+ addTestSource('main() {foo(bar: ^);}');
+ expect(computeFast(), isTrue);
+ assertSuggestKeywords(EXPRESSION_START_NO_INSTANCE);
+ }
+
+ test_argument_named2() {
+ addTestSource('main() {foo(bar: n^);}');
+ expect(computeFast(), isTrue);
+ assertSuggestKeywords(EXPRESSION_START_NO_INSTANCE);
+ }
+
+ test_argument_named_literal() {
+ addTestSource('main() {foo(bar: "^");}');
+ expect(computeFast(), isTrue);
+ assertSuggestKeywords([]);
+ }
+
+ test_assignment_field() {
+ addTestSource('class A {var foo = ^}');
+ expect(computeFast(), isTrue);
+ assertSuggestKeywords(EXPRESSION_START_NO_INSTANCE);
+ }
+
+ test_assignment_field2() {
+ addTestSource('class A {var foo = n^}');
+ expect(computeFast(), isTrue);
+ assertSuggestKeywords(EXPRESSION_START_NO_INSTANCE);
+ }
+
+ test_assignment_local() {
+ addTestSource('main() {var foo = ^}');
+ expect(computeFast(), isTrue);
+ assertSuggestKeywords(EXPRESSION_START_NO_INSTANCE);
+ }
+
+ test_assignment_local2() {
+ addTestSource('main() {var foo = n^}');
+ expect(computeFast(), isTrue);
+ assertSuggestKeywords(EXPRESSION_START_NO_INSTANCE);
+ }
+
+ test_assignment_local2_async() {
+ addTestSource('main() async {var foo = n^}');
+ expect(computeFast(), isTrue);
+ assertSuggestKeywords(EXPRESSION_START_NO_INSTANCE,
+ pseudoKeywords: ['await']);
+ }
+
+ test_assignment_local_async() {
+ addTestSource('main() async {var foo = ^}');
+ expect(computeFast(), isTrue);
+ assertSuggestKeywords(EXPRESSION_START_NO_INSTANCE,
+ pseudoKeywords: ['await']);
}
test_before_import() {
addTestSource('^ import foo;');
expect(computeFast(), isTrue);
- assertSuggestKeywords([
- Keyword.EXPORT,
- Keyword.IMPORT,
- Keyword.LIBRARY,
- Keyword.PART
- ], DART_RELEVANCE_HIGH);
+ assertSuggestKeywords(
+ [Keyword.EXPORT, Keyword.IMPORT, Keyword.LIBRARY, Keyword.PART],
+ relevance: DART_RELEVANCE_HIGH);
}
test_class() {
addTestSource('class A e^ { }');
expect(computeFast(), isTrue);
- assertSuggestKeywords(
- [Keyword.EXTENDS, Keyword.IMPLEMENTS], DART_RELEVANCE_HIGH);
+ assertSuggestKeywords([Keyword.EXTENDS, Keyword.IMPLEMENTS],
+ relevance: DART_RELEVANCE_HIGH);
}
test_class_body() {
@@ -234,22 +374,22 @@
test_class_extends() {
addTestSource('class A extends foo ^');
expect(computeFast(), isTrue);
- assertSuggestKeywords(
- [Keyword.IMPLEMENTS, Keyword.WITH], DART_RELEVANCE_HIGH);
+ assertSuggestKeywords([Keyword.IMPLEMENTS, Keyword.WITH],
+ relevance: DART_RELEVANCE_HIGH);
}
test_class_extends2() {
addTestSource('class A extends foo i^');
expect(computeFast(), isTrue);
- assertSuggestKeywords(
- [Keyword.IMPLEMENTS, Keyword.WITH], DART_RELEVANCE_HIGH);
+ assertSuggestKeywords([Keyword.IMPLEMENTS, Keyword.WITH],
+ relevance: DART_RELEVANCE_HIGH);
}
test_class_extends3() {
addTestSource('class A extends foo i^ { }');
expect(computeFast(), isTrue);
- assertSuggestKeywords(
- [Keyword.IMPLEMENTS, Keyword.WITH], DART_RELEVANCE_HIGH);
+ assertSuggestKeywords([Keyword.IMPLEMENTS, Keyword.WITH],
+ relevance: DART_RELEVANCE_HIGH);
}
test_class_extends_name() {
@@ -261,23 +401,23 @@
test_class_implements() {
addTestSource('class A ^ implements foo');
expect(computeFast(), isTrue);
- assertSuggestKeywords([Keyword.EXTENDS], DART_RELEVANCE_HIGH);
+ assertSuggestKeywords([Keyword.EXTENDS], relevance: DART_RELEVANCE_HIGH);
}
test_class_implements2() {
addTestSource('class A e^ implements foo');
expect(computeFast(), isTrue);
// TODO (danrubel) refinement: don't suggest implements
- assertSuggestKeywords(
- [Keyword.EXTENDS, Keyword.IMPLEMENTS], DART_RELEVANCE_HIGH);
+ assertSuggestKeywords([Keyword.EXTENDS, Keyword.IMPLEMENTS],
+ relevance: DART_RELEVANCE_HIGH);
}
test_class_implements3() {
addTestSource('class A e^ implements foo { }');
expect(computeFast(), isTrue);
// TODO (danrubel) refinement: don't suggest implements
- assertSuggestKeywords(
- [Keyword.EXTENDS, Keyword.IMPLEMENTS], DART_RELEVANCE_HIGH);
+ assertSuggestKeywords([Keyword.EXTENDS, Keyword.IMPLEMENTS],
+ relevance: DART_RELEVANCE_HIGH);
}
test_class_implements_name() {
@@ -295,40 +435,40 @@
test_class_noBody() {
addTestSource('class A ^');
expect(computeFast(), isTrue);
- assertSuggestKeywords(
- [Keyword.EXTENDS, Keyword.IMPLEMENTS], DART_RELEVANCE_HIGH);
+ assertSuggestKeywords([Keyword.EXTENDS, Keyword.IMPLEMENTS],
+ relevance: DART_RELEVANCE_HIGH);
}
test_class_noBody2() {
addTestSource('class A e^');
expect(computeFast(), isTrue);
- assertSuggestKeywords(
- [Keyword.EXTENDS, Keyword.IMPLEMENTS], DART_RELEVANCE_HIGH);
+ assertSuggestKeywords([Keyword.EXTENDS, Keyword.IMPLEMENTS],
+ relevance: DART_RELEVANCE_HIGH);
}
test_class_noBody3() {
addTestSource('class A e^ String foo;');
expect(computeFast(), isTrue);
- assertSuggestKeywords(
- [Keyword.EXTENDS, Keyword.IMPLEMENTS], DART_RELEVANCE_HIGH);
+ assertSuggestKeywords([Keyword.EXTENDS, Keyword.IMPLEMENTS],
+ relevance: DART_RELEVANCE_HIGH);
}
test_class_with() {
addTestSource('class A extends foo with bar ^');
expect(computeFast(), isTrue);
- assertSuggestKeywords([Keyword.IMPLEMENTS], DART_RELEVANCE_HIGH);
+ assertSuggestKeywords([Keyword.IMPLEMENTS], relevance: DART_RELEVANCE_HIGH);
}
test_class_with2() {
addTestSource('class A extends foo with bar i^');
expect(computeFast(), isTrue);
- assertSuggestKeywords([Keyword.IMPLEMENTS], DART_RELEVANCE_HIGH);
+ assertSuggestKeywords([Keyword.IMPLEMENTS], relevance: DART_RELEVANCE_HIGH);
}
test_class_with3() {
addTestSource('class A extends foo with bar i^ { }');
expect(computeFast(), isTrue);
- assertSuggestKeywords([Keyword.IMPLEMENTS], DART_RELEVANCE_HIGH);
+ assertSuggestKeywords([Keyword.IMPLEMENTS], relevance: DART_RELEVANCE_HIGH);
}
test_class_with_name() {
@@ -337,11 +477,58 @@
assertSuggestKeywords([]);
}
+ test_constructor_param() {
+ addTestSource('class A { A(^) {});}');
+ expect(computeFast(), isTrue);
+ assertSuggestKeywords([Keyword.THIS]);
+ }
+
+ test_constructor_param2() {
+ addTestSource('class A { A(t^) {});}');
+ expect(computeFast(), isTrue);
+ assertSuggestKeywords([Keyword.THIS]);
+ }
+
test_empty() {
addTestSource('^');
expect(computeFast(), isTrue);
- assertSuggestKeywords(
- DIRECTIVE_DECLARATION_AND_LIBRARY_KEYWORDS, DART_RELEVANCE_HIGH);
+ assertSuggestKeywords(DIRECTIVE_DECLARATION_AND_LIBRARY_KEYWORDS,
+ relevance: DART_RELEVANCE_HIGH);
+ }
+
+ test_function_async() {
+ addTestSource('main()^');
+ expect(computeFast(), isTrue);
+ assertSuggestKeywords(DECLARATION_KEYWORDS,
+ pseudoKeywords: ['async'], relevance: DART_RELEVANCE_HIGH);
+ }
+
+ test_function_async2() {
+ addTestSource('main()^{}');
+ expect(computeFast(), isTrue);
+ assertSuggestKeywords([],
+ pseudoKeywords: ['async'], relevance: DART_RELEVANCE_HIGH);
+ }
+
+ test_function_async3() {
+ addTestSource('main()a^');
+ expect(computeFast(), isTrue);
+ assertSuggestKeywords(DECLARATION_KEYWORDS,
+ pseudoKeywords: ['async'], relevance: DART_RELEVANCE_HIGH);
+ }
+
+ test_function_async4() {
+ addTestSource('main()a^{}');
+ expect(computeFast(), isTrue);
+ assertSuggestKeywords(DECLARATION_KEYWORDS,
+ pseudoKeywords: ['async'], relevance: DART_RELEVANCE_HIGH);
+ }
+
+ test_function_async5() {
+ addTestSource('main()a^ Foo foo;');
+ expect(computeFast(), isTrue);
+ assertSuggestKeywords(DECLARATION_KEYWORDS,
+ pseudoKeywords: ['async'], relevance: DART_RELEVANCE_HIGH);
}
test_function_body_inClass_constructorInitializer() {
@@ -353,7 +540,19 @@
}
''');
expect(computeFast(), isTrue);
- assertSuggestKeywords(IN_BLOCK_NOT_IN_CLASS);
+ assertSuggestKeywords(STMT_START_OUTSIDE_CLASS);
+ }
+
+ test_function_body_inClass_constructorInitializer_async() {
+ addTestSource(r'''
+foo(p) {}
+class A {
+ final f;
+ A() : f = foo(() async {^});
+}
+''');
+ expect(computeFast(), isTrue);
+ assertSuggestKeywords(STMT_START_OUTSIDE_CLASS, pseudoKeywords: ['await']);
}
test_function_body_inClass_field() {
@@ -363,7 +562,7 @@
}
''');
expect(computeFast(), isTrue);
- assertSuggestKeywords(IN_BLOCK_NOT_IN_CLASS);
+ assertSuggestKeywords(STMT_START_OUTSIDE_CLASS);
}
test_function_body_inClass_methodBody() {
@@ -375,7 +574,7 @@
}
''');
expect(computeFast(), isTrue);
- assertSuggestKeywords(IN_BLOCK_IN_CLASS);
+ assertSuggestKeywords(STMT_START_IN_CLASS);
}
test_function_body_inClass_methodBody_inFunction() {
@@ -389,116 +588,192 @@
}
''');
expect(computeFast(), isTrue);
- assertSuggestKeywords(IN_BLOCK_IN_CLASS);
+ assertSuggestKeywords(STMT_START_IN_CLASS);
+ }
+
+ test_function_body_inClass_methodBody_inFunction_async() {
+ addTestSource(r'''
+class A {
+ m() {
+ f() {
+ f2() async {^};
+ };
+ }
+}
+''');
+ expect(computeFast(), isTrue);
+ assertSuggestKeywords(STMT_START_IN_CLASS, pseudoKeywords: ['await']);
}
test_function_body_inUnit() {
addTestSource('main() {^}');
expect(computeFast(), isTrue);
- assertSuggestKeywords(IN_BLOCK_NOT_IN_CLASS);
+ assertSuggestKeywords(STMT_START_OUTSIDE_CLASS);
}
test_function_body_inUnit_afterBlock() {
addTestSource('main() {{}^}');
expect(computeFast(), isTrue);
- assertSuggestKeywords(IN_BLOCK_NOT_IN_CLASS);
+ assertSuggestKeywords(STMT_START_OUTSIDE_CLASS);
+ }
+
+ test_function_body_inUnit_async() {
+ addTestSource('main() async {^}');
+ expect(computeFast(), isTrue);
+ assertSuggestKeywords(STMT_START_OUTSIDE_CLASS, pseudoKeywords: ['await']);
+ }
+
+ test_if_in_class() {
+ addTestSource('class A {foo() {if (true) ^}}');
+ expect(computeFast(), isTrue);
+ assertSuggestKeywords(STMT_START_IN_CLASS);
+ }
+
+ test_if_in_class2() {
+ addTestSource('class A {foo() {if (true) ^;}}');
+ expect(computeFast(), isTrue);
+ assertSuggestKeywords(STMT_START_IN_CLASS);
+ }
+
+ test_if_in_class3() {
+ addTestSource('class A {foo() {if (true) r^;}}');
+ expect(computeFast(), isTrue);
+ assertSuggestKeywords(STMT_START_IN_CLASS);
+ }
+
+ test_if_in_class4() {
+ addTestSource('class A {foo() {if (true) ^ go();}}');
+ expect(computeFast(), isTrue);
+ assertSuggestKeywords(STMT_START_IN_CLASS);
+ }
+
+ test_if_outside_class() {
+ addTestSource('foo() {if (true) ^}');
+ expect(computeFast(), isTrue);
+ assertSuggestKeywords(STMT_START_OUTSIDE_CLASS);
+ }
+
+ test_if_outside_class2() {
+ addTestSource('foo() {if (true) ^;}');
+ expect(computeFast(), isTrue);
+ assertSuggestKeywords(STMT_START_OUTSIDE_CLASS);
+ }
+
+ test_if_outside_class3() {
+ addTestSource('foo() {if (true) r^;}');
+ expect(computeFast(), isTrue);
+ assertSuggestKeywords(STMT_START_OUTSIDE_CLASS);
+ }
+
+ test_if_outside_class4() {
+ addTestSource('foo() {if (true) ^ go();}');
+ expect(computeFast(), isTrue);
+ assertSuggestKeywords(STMT_START_OUTSIDE_CLASS);
}
test_import() {
addTestSource('import "foo" deferred as foo ^;');
expect(computeFast(), isTrue);
- assertSuggestKeywords([], DART_RELEVANCE_HIGH);
+ assertSuggestKeywords([], relevance: DART_RELEVANCE_HIGH);
}
test_import_as() {
addTestSource('import "foo" deferred ^;');
expect(computeFast(), isTrue);
- assertSuggestKeywords([Keyword.AS], DART_RELEVANCE_HIGH);
+ assertSuggestKeywords([Keyword.AS], relevance: DART_RELEVANCE_HIGH);
}
test_import_as2() {
addTestSource('import "foo" deferred a^;');
expect(computeFast(), isTrue);
- assertSuggestKeywords([Keyword.AS], DART_RELEVANCE_HIGH);
+ assertSuggestKeywords([Keyword.AS], relevance: DART_RELEVANCE_HIGH);
}
test_import_as3() {
addTestSource('import "foo" deferred a^');
expect(computeFast(), isTrue);
- assertSuggestKeywords([Keyword.AS], DART_RELEVANCE_HIGH);
+ assertSuggestKeywords([Keyword.AS], relevance: DART_RELEVANCE_HIGH);
}
test_import_deferred() {
addTestSource('import "foo" ^ as foo;');
expect(computeFast(), isTrue);
- assertSuggestKeywords([Keyword.DEFERRED], DART_RELEVANCE_HIGH);
+ assertSuggestKeywords([Keyword.DEFERRED], relevance: DART_RELEVANCE_HIGH);
}
test_import_deferred2() {
addTestSource('import "foo" d^ as foo;');
expect(computeFast(), isTrue);
- assertSuggestKeywords([Keyword.DEFERRED], DART_RELEVANCE_HIGH);
+ assertSuggestKeywords([Keyword.DEFERRED], relevance: DART_RELEVANCE_HIGH);
}
test_import_deferred3() {
addTestSource('import "foo" d^ show foo;');
expect(computeFast(), isTrue);
- assertSuggestKeywords([Keyword.AS, Keyword.DEFERRED], DART_RELEVANCE_HIGH);
+ assertSuggestKeywords([Keyword.AS, Keyword.DEFERRED],
+ relevance: DART_RELEVANCE_HIGH);
}
test_import_deferred4() {
addTestSource('import "foo" d^ hide foo;');
expect(computeFast(), isTrue);
- assertSuggestKeywords([Keyword.AS, Keyword.DEFERRED], DART_RELEVANCE_HIGH);
+ assertSuggestKeywords([Keyword.AS, Keyword.DEFERRED],
+ relevance: DART_RELEVANCE_HIGH);
}
test_import_deferred5() {
addTestSource('import "foo" d^');
expect(computeFast(), isTrue);
- assertSuggestKeywords([Keyword.AS, Keyword.DEFERRED], DART_RELEVANCE_HIGH);
+ assertSuggestKeywords([Keyword.AS, Keyword.DEFERRED],
+ relevance: DART_RELEVANCE_HIGH);
}
test_import_deferred6() {
addTestSource('import "foo" d^ import');
expect(computeFast(), isTrue);
- assertSuggestKeywords([Keyword.AS, Keyword.DEFERRED], DART_RELEVANCE_HIGH);
- }
-
- test_import_deferred_not() {
- addTestSource('import "foo" as foo ^;');
- expect(computeFast(), isTrue);
- assertSuggestKeywords([], DART_RELEVANCE_HIGH);
+ assertSuggestKeywords([Keyword.AS, Keyword.DEFERRED],
+ relevance: DART_RELEVANCE_HIGH);
}
test_import_deferred_as() {
addTestSource('import "foo" ^;');
expect(computeFast(), isTrue);
- assertSuggestKeywords([Keyword.AS, Keyword.DEFERRED], DART_RELEVANCE_HIGH);
+ assertSuggestKeywords([Keyword.AS, Keyword.DEFERRED],
+ relevance: DART_RELEVANCE_HIGH);
}
test_import_deferred_as2() {
addTestSource('import "foo" d^;');
expect(computeFast(), isTrue);
- assertSuggestKeywords([Keyword.AS, Keyword.DEFERRED], DART_RELEVANCE_HIGH);
+ assertSuggestKeywords([Keyword.AS, Keyword.DEFERRED],
+ relevance: DART_RELEVANCE_HIGH);
}
test_import_deferred_as3() {
addTestSource('import "foo" ^');
expect(computeFast(), isTrue);
- assertSuggestKeywords([Keyword.AS, Keyword.DEFERRED], DART_RELEVANCE_HIGH);
+ assertSuggestKeywords([Keyword.AS, Keyword.DEFERRED],
+ relevance: DART_RELEVANCE_HIGH);
}
test_import_deferred_as4() {
addTestSource('import "foo" d^');
expect(computeFast(), isTrue);
- assertSuggestKeywords([Keyword.AS, Keyword.DEFERRED], DART_RELEVANCE_HIGH);
+ assertSuggestKeywords([Keyword.AS, Keyword.DEFERRED],
+ relevance: DART_RELEVANCE_HIGH);
+ }
+
+ test_import_deferred_not() {
+ addTestSource('import "foo" as foo ^;');
+ expect(computeFast(), isTrue);
+ assertSuggestKeywords([], relevance: DART_RELEVANCE_HIGH);
}
test_library() {
addTestSource('library foo;^');
expect(computeFast(), isTrue);
- assertSuggestKeywords(
- DIRECTIVE_AND_DECLARATION_KEYWORDS, DART_RELEVANCE_HIGH);
+ assertSuggestKeywords(DIRECTIVE_AND_DECLARATION_KEYWORDS,
+ relevance: DART_RELEVANCE_HIGH);
}
test_library_name() {
@@ -507,10 +782,114 @@
assertSuggestKeywords([]);
}
+ test_method_async() {
+ addTestSource('class A { foo() ^}');
+ expect(computeFast(), isTrue);
+ assertSuggestKeywords(CLASS_BODY_KEYWORDS, pseudoKeywords: ['async']);
+ }
+
+ test_method_async2() {
+ addTestSource('class A { foo() ^{}}');
+ expect(computeFast(), isTrue);
+ assertSuggestKeywords([],
+ pseudoKeywords: ['async'], relevance: DART_RELEVANCE_HIGH);
+ }
+
+ test_method_async3() {
+ addTestSource('class A { foo() a^}');
+ expect(computeFast(), isTrue);
+ assertSuggestKeywords(CLASS_BODY_KEYWORDS, pseudoKeywords: ['async']);
+ }
+
+ test_method_async4() {
+ addTestSource('class A { foo() a^{}}');
+ expect(computeFast(), isTrue);
+ assertSuggestKeywords(CLASS_BODY_KEYWORDS, pseudoKeywords: ['async']);
+ }
+
+ test_method_async5() {
+ addTestSource('class A { foo() ^ Foo foo;}');
+ expect(computeFast(), isTrue);
+ assertSuggestKeywords(CLASS_BODY_KEYWORDS, pseudoKeywords: ['async']);
+ }
+
+ test_method_async6() {
+ addTestSource('class A { foo() a^ Foo foo;}');
+ expect(computeFast(), isTrue);
+ assertSuggestKeywords(CLASS_BODY_KEYWORDS, pseudoKeywords: ['async']);
+ }
+
+ test_method_async7() {
+ addTestSource('class A { foo() ^ => Foo foo;}');
+ expect(computeFast(), isTrue);
+ assertSuggestKeywords([],
+ pseudoKeywords: ['async'], relevance: DART_RELEVANCE_HIGH);
+ }
+
+ test_method_async8() {
+ addTestSource('class A { foo() a^ Foo foo;}');
+ expect(computeFast(), isTrue);
+ assertSuggestKeywords(CLASS_BODY_KEYWORDS, pseudoKeywords: ['async']);
+ }
+
test_method_body() {
addTestSource('class A { foo() {^}}');
expect(computeFast(), isTrue);
- assertSuggestKeywords(IN_BLOCK_IN_CLASS);
+ assertSuggestKeywords(STMT_START_IN_CLASS);
+ }
+
+ test_method_body2() {
+ addTestSource('class A { foo() => ^}');
+ expect(computeFast(), isTrue);
+ assertSuggestKeywords(EXPRESSION_START_INSTANCE);
+ }
+
+ test_method_body3() {
+ addTestSource('class A { foo() => ^ Foo foo;}');
+ expect(computeFast(), isTrue);
+ assertSuggestKeywords(EXPRESSION_START_INSTANCE);
+ }
+
+ test_method_body4() {
+ addTestSource('class A { foo() => ^;}');
+ expect(computeFast(), isTrue);
+ assertSuggestKeywords(EXPRESSION_START_INSTANCE);
+ }
+
+ test_method_body_async() {
+ addTestSource('class A { foo() async {^}}');
+ expect(computeFast(), isTrue);
+ assertSuggestKeywords(STMT_START_IN_CLASS, pseudoKeywords: ['await']);
+ }
+
+ test_method_body_async2() {
+ addTestSource('class A { foo() async => ^}');
+ expect(computeFast(), isTrue);
+ assertSuggestKeywords(EXPRESSION_START_INSTANCE, pseudoKeywords: ['await']);
+ }
+
+ test_method_body_async3() {
+ addTestSource('class A { foo() async => ^ Foo foo;}');
+ expect(computeFast(), isTrue);
+ assertSuggestKeywords(EXPRESSION_START_INSTANCE, pseudoKeywords: ['await']);
+ }
+
+ test_method_body_async4() {
+ addTestSource('class A { foo() async => ^;}');
+ expect(computeFast(), isTrue);
+ assertSuggestKeywords(EXPRESSION_START_INSTANCE, pseudoKeywords: ['await']);
+ }
+
+ test_method_param() {
+ addTestSource('class A { foo(^) {});}');
+ expect(computeFast(), isTrue);
+ assertNoSuggestions();
+ }
+
+ test_method_param2() {
+ addTestSource('class A { foo(t^) {});}');
+ expect(computeFast(), isTrue);
+ assertNoSuggestions();
}
test_named_constructor_invocation() {
@@ -522,34 +901,94 @@
test_part_of() {
addTestSource('part of foo;^');
expect(computeFast(), isTrue);
- assertSuggestKeywords(
- DIRECTIVE_AND_DECLARATION_KEYWORDS, DART_RELEVANCE_HIGH);
+ assertSuggestKeywords(DIRECTIVE_AND_DECLARATION_KEYWORDS,
+ relevance: DART_RELEVANCE_HIGH);
}
test_partial_class() {
addTestSource('cl^');
expect(computeFast(), isTrue);
- assertSuggestKeywords(
- DIRECTIVE_DECLARATION_AND_LIBRARY_KEYWORDS, DART_RELEVANCE_HIGH);
+ assertSuggestKeywords(DIRECTIVE_DECLARATION_AND_LIBRARY_KEYWORDS,
+ relevance: DART_RELEVANCE_HIGH);
}
test_partial_class2() {
addTestSource('library a; cl^');
expect(computeFast(), isTrue);
- assertSuggestKeywords(
- DIRECTIVE_AND_DECLARATION_KEYWORDS, DART_RELEVANCE_HIGH);
+ assertSuggestKeywords(DIRECTIVE_AND_DECLARATION_KEYWORDS,
+ relevance: DART_RELEVANCE_HIGH);
}
- void _appendKeywords(StringBuffer msg, Iterable<Keyword> keywords) {
- List<Keyword> sorted = keywords.toList();
- sorted.sort((k1, k2) => k1.name.compareTo(k2.name));
- sorted.forEach((k) => msg.writeln(' Keyword.${k.name},'));
+ test_switch_expression() {
+ addTestSource('main() {switch(^) {}}');
+ expect(computeFast(), isTrue);
+ assertSuggestKeywords(EXPRESSION_START_NO_INSTANCE);
}
- bool _equalSets(Iterable<Keyword> iter1, Iterable<Keyword> iter2) {
+ test_switch_expression2() {
+ addTestSource('main() {switch(n^) {}}');
+ expect(computeFast(), isTrue);
+ assertSuggestKeywords(EXPRESSION_START_NO_INSTANCE);
+ }
+
+ test_switch_expression3() {
+ addTestSource('main() {switch(n^)}');
+ expect(computeFast(), isTrue);
+ assertSuggestKeywords(EXPRESSION_START_NO_INSTANCE);
+ }
+
+ test_switch_start() {
+ addTestSource('main() {switch(1) {^}}');
+ expect(computeFast(), isTrue);
+ assertSuggestKeywords([Keyword.CASE, Keyword.DEFAULT],
+ relevance: DART_RELEVANCE_HIGH);
+ }
+
+ test_switch_start2() {
+ addTestSource('main() {switch(1) {^ case 1:}}');
+ expect(computeFast(), isTrue);
+ assertSuggestKeywords([Keyword.CASE, Keyword.DEFAULT],
+ relevance: DART_RELEVANCE_HIGH);
+ }
+
+ test_switch_start3() {
+ addTestSource('main() {switch(1) {^default:}}');
+ expect(computeFast(), isTrue);
+ assertSuggestKeywords([Keyword.CASE, Keyword.DEFAULT],
+ relevance: DART_RELEVANCE_HIGH);
+ }
+
+ test_switch_start4() {
+ addTestSource('main() {switch(1) {^ default:}}');
+ expect(computeFast(), isTrue);
+ assertSuggestKeywords([Keyword.CASE, Keyword.DEFAULT],
+ relevance: DART_RELEVANCE_HIGH);
+ }
+
+ test_switch_statement() {
+ addTestSource('main() {switch(1) {case 1:^}}');
+ expect(computeFast(), isTrue);
+ assertSuggestKeywords(STMT_START_IN_SWITCH_OUTSIDE_CLASS);
+ }
+
+ test_switch_statement2() {
+ addTestSource('class A{foo() {switch(1) {case 1:^}}}');
+ expect(computeFast(), isTrue);
+ assertSuggestKeywords(STMT_START_IN_SWITCH_IN_CLASS);
+ }
+
+ void _appendCompletions(
+ StringBuffer msg, Iterable<String> completions, Iterable<String> other) {
+ List<String> sorted = completions.toList();
+ sorted.sort((c1, c2) => c1.compareTo(c2));
+ sorted.forEach(
+ (c) => msg.writeln(' $c, ${other.contains(c) ? '' : '<<<<<<<<<<<'}'));
+ }
+
+ bool _equalSets(Iterable<String> iter1, Iterable<String> iter2) {
if (iter1.length != iter2.length) return false;
- if (iter1.any((k) => !iter2.contains(k))) return false;
- if (iter2.any((k) => !iter1.contains(k))) return false;
+ if (iter1.any((c) => !iter2.contains(c))) return false;
+ if (iter2.any((c) => !iter1.contains(c))) return false;
return true;
}
}
diff --git a/pkg/analysis_server/test/services/completion/local_reference_contributor_test.dart b/pkg/analysis_server/test/services/completion/local_reference_contributor_test.dart
index 0fe8047..77c43f0 100644
--- a/pkg/analysis_server/test/services/completion/local_reference_contributor_test.dart
+++ b/pkg/analysis_server/test/services/completion/local_reference_contributor_test.dart
@@ -7,14 +7,14 @@
import 'package:analysis_server/src/protocol_server.dart';
import 'package:analysis_server/src/services/completion/dart_completion_manager.dart';
import 'package:analysis_server/src/services/completion/local_reference_contributor.dart';
+import 'package:test_reflective_loader/test_reflective_loader.dart';
import 'package:unittest/unittest.dart';
-import '../../reflective_tests.dart';
import 'completion_test_util.dart';
main() {
groupSep = ' | ';
- runReflectiveTests(LocalReferenceContributorTest);
+ defineReflectiveTests(LocalReferenceContributorTest);
}
@reflectiveTest
@@ -149,21 +149,6 @@
contributor = new LocalReferenceContributor();
}
- test_missing_params_function() {
- addTestSource('int f1{} main(){f^}');
- expect(computeFast(), isTrue);
- }
-
- test_missing_params_method() {
- addTestSource('class C1{int f1{} main(){f^}}');
- expect(computeFast(), isTrue);
- }
-
- test_missing_params_constructor() {
- addTestSource('class C1{C1{} main(){C^}}');
- expect(computeFast(), isTrue);
- }
-
test_break_ignores_outer_functions_using_closure() {
addTestSource('''
void main() {
@@ -756,6 +741,21 @@
expect(suggestion.hasNamedParameters, false);
}
+ test_missing_params_constructor() {
+ addTestSource('class C1{C1{} main(){C^}}');
+ expect(computeFast(), isTrue);
+ }
+
+ test_missing_params_function() {
+ addTestSource('int f1{} main(){f^}');
+ expect(computeFast(), isTrue);
+ }
+
+ test_missing_params_method() {
+ addTestSource('class C1{int f1{} main(){f^}}');
+ expect(computeFast(), isTrue);
+ }
+
test_overrides() {
addTestSource('''
class A {m() {}}
diff --git a/pkg/analysis_server/test/services/completion/optype_test.dart b/pkg/analysis_server/test/services/completion/optype_test.dart
index ff74539..69107b7 100644
--- a/pkg/analysis_server/test/services/completion/optype_test.dart
+++ b/pkg/analysis_server/test/services/completion/optype_test.dart
@@ -9,14 +9,14 @@
import 'package:analyzer/src/generated/ast.dart';
import 'package:analyzer/src/generated/engine.dart';
import 'package:analyzer/src/generated/source.dart';
+import 'package:test_reflective_loader/test_reflective_loader.dart';
import 'package:unittest/unittest.dart';
import '../../abstract_context.dart';
-import '../../reflective_tests.dart';
main() {
groupSep = ' | ';
- runReflectiveTests(OpTypeTest);
+ defineReflectiveTests(OpTypeTest);
}
@reflectiveTest
@@ -207,6 +207,31 @@
assertOpType(returnValue: true, typeNames: true, voidReturn: true);
}
+ test_Block_final() {
+ addTestSource('main() {final ^}');
+ assertOpType(typeNames: true);
+ }
+
+ test_Block_final2() {
+ addTestSource('main() {final S^ v;}');
+ assertOpType(typeNames: true);
+ }
+
+ test_Block_final3() {
+ addTestSource('main() {final ^ v;}');
+ assertOpType(typeNames: true);
+ }
+
+ test_Block_final_final() {
+ addTestSource('main() {final ^ final S x;}');
+ assertOpType(typeNames: true);
+ }
+
+ test_Block_final_final2() {
+ addTestSource('main() {final S^ final S x;}');
+ assertOpType(typeNames: true);
+ }
+
test_Block_identifier_partial() {
addTestSource('class X {a() {var f; {var x;} D^ var r;} void b() { }}');
assertOpType(returnValue: true, typeNames: true, voidReturn: true);
@@ -1131,6 +1156,42 @@
assertOpType(returnValue: true, voidReturn: true, prefixed: true);
}
+ test_ThisExpression_constructor_param() {
+ // SimpleIdentifier FieldFormalParameter FormalParameterList
+ addTestSource('''
+ class A implements I {
+ A(this.^) {}
+ }''');
+ assertOpType(prefixed: true);
+ }
+
+ test_ThisExpression_constructor_param2() {
+ // SimpleIdentifier FieldFormalParameter FormalParameterList
+ addTestSource('''
+ class A implements I {
+ A(this.f^) {}
+ }''');
+ assertOpType(prefixed: true);
+ }
+
+ test_ThisExpression_constructor_param3() {
+ // SimpleIdentifier FieldFormalParameter FormalParameterList
+ addTestSource('''
+ class A implements I {
+ A(this.^f) {}
+ }''');
+ assertOpType(prefixed: true);
+ }
+
+ test_ThisExpression_constructor_param4() {
+ // FieldFormalParameter FormalParameterList ConstructorDeclaration
+ addTestSource('''
+ class A implements I {
+ A(Str^ this.foo) {}
+ }''');
+ assertOpType(typeNames: true);
+ }
+
test_ThrowExpression() {
// SimpleIdentifier ThrowExpression ExpressionStatement
addTestSource('main() {throw ^;}');
diff --git a/pkg/analysis_server/test/services/completion/prefixed_element_contributor_test.dart b/pkg/analysis_server/test/services/completion/prefixed_element_contributor_test.dart
index 790d1ca..5c4bfc8 100644
--- a/pkg/analysis_server/test/services/completion/prefixed_element_contributor_test.dart
+++ b/pkg/analysis_server/test/services/completion/prefixed_element_contributor_test.dart
@@ -9,14 +9,14 @@
import 'package:analysis_server/src/protocol.dart';
import 'package:analysis_server/src/services/completion/dart_completion_manager.dart';
import 'package:analysis_server/src/services/completion/prefixed_element_contributor.dart';
+import 'package:test_reflective_loader/test_reflective_loader.dart';
import 'package:unittest/unittest.dart';
-import '../../reflective_tests.dart';
import 'completion_test_util.dart';
main() {
groupSep = ' | ';
- runReflectiveTests(PrefixedElementContributorTest);
+ defineReflectiveTests(PrefixedElementContributorTest);
}
@reflectiveTest
diff --git a/pkg/analysis_server/test/services/completion/test_all.dart b/pkg/analysis_server/test/services/completion/test_all.dart
index f7c58bc..2c5ff9c 100644
--- a/pkg/analysis_server/test/services/completion/test_all.dart
+++ b/pkg/analysis_server/test/services/completion/test_all.dart
@@ -12,11 +12,12 @@
import 'completion_computer_test.dart' as completion_computer_test;
import 'completion_manager_test.dart' as completion_manager_test;
import 'completion_target_test.dart' as completion_target_test;
+import 'import_uri_contributor_test.dart' as import_uri_test;
import 'imported_reference_contributor_test.dart' as imported_test;
-import 'prefixed_element_contributor_test.dart' as invocation_test;
import 'keyword_contributor_test.dart' as keyword_test;
import 'local_reference_contributor_test.dart' as local_test;
import 'optype_test.dart' as optype_test;
+import 'prefixed_element_contributor_test.dart' as invocation_test;
/// Utility for manually running all tests.
main() {
@@ -28,6 +29,7 @@
completion_computer_test.main();
completion_manager_test.main();
completion_target_test.main();
+ import_uri_test.main();
imported_test.main();
keyword_test.main();
invocation_test.main();
diff --git a/pkg/analysis_server/test/services/correction/assist_test.dart b/pkg/analysis_server/test/services/correction/assist_test.dart
index a7d8534..57f49d0 100644
--- a/pkg/analysis_server/test/services/correction/assist_test.dart
+++ b/pkg/analysis_server/test/services/correction/assist_test.dart
@@ -4,17 +4,20 @@
library test.services.correction.assist;
+import 'package:analysis_server/edit/assist/assist_core.dart';
+import 'package:analysis_server/src/plugin/server_plugin.dart';
import 'package:analysis_server/src/protocol.dart';
import 'package:analysis_server/src/services/correction/assist.dart';
import 'package:analyzer/src/generated/source.dart';
+import 'package:plugin/manager.dart';
+import 'package:test_reflective_loader/test_reflective_loader.dart';
import 'package:unittest/unittest.dart';
import '../../abstract_single_unit.dart';
-import '../../reflective_tests.dart';
main() {
groupSep = ' | ';
- runReflectiveTests(AssistProcessorTest);
+ defineReflectiveTests(AssistProcessorTest);
}
@reflectiveTest
@@ -22,6 +25,7 @@
int offset;
int length;
+ ServerPlugin plugin;
Assist assist;
SourceChange change;
String resultCode;
@@ -55,7 +59,8 @@
* Asserts that there is no [Assist] of the given [kind] at [offset].
*/
void assertNoAssist(AssistKind kind) {
- List<Assist> assists = computeAssists(testUnit, offset, length);
+ List<Assist> assists = computeAssists(
+ plugin, context, testUnit.element.source, offset, length);
for (Assist assist in assists) {
if (assist.kind == kind) {
throw fail('Unexpected assist $kind in\n${assists.join('\n')}');
@@ -95,6 +100,9 @@
super.setUp();
offset = 0;
length = 0;
+ ExtensionManager manager = new ExtensionManager();
+ plugin = new ServerPlugin();
+ manager.processPlugins([plugin]);
}
void test_addTypeAnnotation_BAD_privateType_closureParameter() {
@@ -110,7 +118,7 @@
foo((test) {});
}
''');
- assertNoAssistAt('test)', AssistKind.ADD_TYPE_ANNOTATION);
+ assertNoAssistAt('test)', DartAssistKind.ADD_TYPE_ANNOTATION);
}
void test_addTypeAnnotation_BAD_privateType_declaredIdentifier() {
@@ -129,7 +137,7 @@
}
}
''');
- assertNoAssistAt('var item', AssistKind.ADD_TYPE_ANNOTATION);
+ assertNoAssistAt('var item', DartAssistKind.ADD_TYPE_ANNOTATION);
}
void test_addTypeAnnotation_BAD_privateType_list() {
@@ -145,7 +153,7 @@
var v = getValues();
}
''');
- assertNoAssistAt('var ', AssistKind.ADD_TYPE_ANNOTATION);
+ assertNoAssistAt('var ', DartAssistKind.ADD_TYPE_ANNOTATION);
}
void test_addTypeAnnotation_BAD_privateType_variable() {
@@ -161,7 +169,7 @@
var v = getValue();
}
''');
- assertNoAssistAt('var ', AssistKind.ADD_TYPE_ANNOTATION);
+ assertNoAssistAt('var ', DartAssistKind.ADD_TYPE_ANNOTATION);
}
void test_addTypeAnnotation_classField_OK_final() {
@@ -170,7 +178,7 @@
final f = 0;
}
''');
- assertHasAssistAt('final ', AssistKind.ADD_TYPE_ANNOTATION, '''
+ assertHasAssistAt('final ', DartAssistKind.ADD_TYPE_ANNOTATION, '''
class A {
final int f = 0;
}
@@ -183,7 +191,7 @@
var f = 0;
}
''');
- assertHasAssistAt('var ', AssistKind.ADD_TYPE_ANNOTATION, '''
+ assertHasAssistAt('var ', DartAssistKind.ADD_TYPE_ANNOTATION, '''
class A {
int f = 0;
}
@@ -197,7 +205,7 @@
}
}
''');
- assertNoAssistAt('item in', AssistKind.ADD_TYPE_ANNOTATION);
+ assertNoAssistAt('item in', DartAssistKind.ADD_TYPE_ANNOTATION);
}
void test_addTypeAnnotation_declaredIdentifier_BAD_inForEachBody() {
@@ -208,7 +216,7 @@
}
}
''');
- assertNoAssistAt('42;', AssistKind.ADD_TYPE_ANNOTATION);
+ assertNoAssistAt('42;', DartAssistKind.ADD_TYPE_ANNOTATION);
}
void test_addTypeAnnotation_declaredIdentifier_BAD_unknownType() {
@@ -219,7 +227,7 @@
}
}
''');
- assertNoAssistAt('item in', AssistKind.ADD_TYPE_ANNOTATION);
+ assertNoAssistAt('item in', DartAssistKind.ADD_TYPE_ANNOTATION);
}
void test_addTypeAnnotation_declaredIdentifier_generic_OK() {
@@ -231,7 +239,7 @@
}
}
''');
- assertHasAssistAt('item in', AssistKind.ADD_TYPE_ANNOTATION, '''
+ assertHasAssistAt('item in', DartAssistKind.ADD_TYPE_ANNOTATION, '''
class A<T> {
main(List<List<T>> items) {
for (List<T> item in items) {
@@ -249,14 +257,14 @@
}
''');
// on identifier
- assertHasAssistAt('item in', AssistKind.ADD_TYPE_ANNOTATION, '''
+ assertHasAssistAt('item in', DartAssistKind.ADD_TYPE_ANNOTATION, '''
main(List<String> items) {
for (String item in items) {
}
}
''');
// on "for"
- assertHasAssistAt('for (', AssistKind.ADD_TYPE_ANNOTATION, '''
+ assertHasAssistAt('for (', DartAssistKind.ADD_TYPE_ANNOTATION, '''
main(List<String> items) {
for (String item in items) {
}
@@ -276,7 +284,7 @@
}
}
''');
- assertHasAssistAt('future in', AssistKind.ADD_TYPE_ANNOTATION, '''
+ assertHasAssistAt('future in', DartAssistKind.ADD_TYPE_ANNOTATION, '''
import 'my_lib.dart';
import 'dart:async';
main() {
@@ -293,7 +301,7 @@
}
}
''');
- assertHasAssistAt('item in', AssistKind.ADD_TYPE_ANNOTATION, '''
+ assertHasAssistAt('item in', DartAssistKind.ADD_TYPE_ANNOTATION, '''
main(List<String> items) {
for (final String item in items) {
}
@@ -309,7 +317,7 @@
}
}
''');
- assertHasAssistAt('v =', AssistKind.ADD_TYPE_ANNOTATION, '''
+ assertHasAssistAt('v =', DartAssistKind.ADD_TYPE_ANNOTATION, '''
class A {
main(List<int> items) {
List<int> v = items;
@@ -326,7 +334,7 @@
}
}
''');
- assertHasAssistAt('v =', AssistKind.ADD_TYPE_ANNOTATION, '''
+ assertHasAssistAt('v =', DartAssistKind.ADD_TYPE_ANNOTATION, '''
class A<T> {
main(List<T> items) {
List<T> v = items;
@@ -346,7 +354,7 @@
var v = getFutureInt();
}
''');
- assertHasAssistAt('v =', AssistKind.ADD_TYPE_ANNOTATION, '''
+ assertHasAssistAt('v =', DartAssistKind.ADD_TYPE_ANNOTATION, '''
import 'my_lib.dart';
import 'dart:async';
main() {
@@ -384,7 +392,7 @@
testLibraryElement = testUnitElement.library;
// prepare the assist
offset = findOffset('v = ');
- assist = _assertHasAssist(AssistKind.ADD_TYPE_ANNOTATION);
+ assist = _assertHasAssist(DartAssistKind.ADD_TYPE_ANNOTATION);
change = assist.change;
// verify
{
@@ -423,7 +431,7 @@
var v = newMyClass();
}
''');
- assertHasAssistAt('v =', AssistKind.ADD_TYPE_ANNOTATION, '''
+ assertHasAssistAt('v =', DartAssistKind.ADD_TYPE_ANNOTATION, '''
import 'ccc/lib_b.dart';
import 'aa/bbb/lib_a.dart';
main() {
@@ -438,7 +446,7 @@
var v = () => 1;
}
''');
- assertHasAssistAt('v =', AssistKind.ADD_TYPE_ANNOTATION, '''
+ assertHasAssistAt('v =', DartAssistKind.ADD_TYPE_ANNOTATION, '''
main() {
Function v = () => 1;
}
@@ -451,7 +459,7 @@
var v = 0;
}
''');
- assertHasAssistAt('v =', AssistKind.ADD_TYPE_ANNOTATION, '''
+ assertHasAssistAt('v =', DartAssistKind.ADD_TYPE_ANNOTATION, '''
main() {
int v = 0;
}
@@ -464,7 +472,7 @@
var v = <String>[];
}
''');
- assertHasAssistAt('v =', AssistKind.ADD_TYPE_ANNOTATION, '''
+ assertHasAssistAt('v =', DartAssistKind.ADD_TYPE_ANNOTATION, '''
main() {
List<String> v = <String>[];
}
@@ -479,7 +487,7 @@
var x = f();
}
''');
- assertHasAssistAt('x =', AssistKind.ADD_TYPE_ANNOTATION, '''
+ assertHasAssistAt('x =', DartAssistKind.ADD_TYPE_ANNOTATION, '''
class C {}
C f() => null;
main() {
@@ -494,7 +502,7 @@
var v = 123;
}
''');
- assertHasAssistAt('23', AssistKind.ADD_TYPE_ANNOTATION, '''
+ assertHasAssistAt('23', DartAssistKind.ADD_TYPE_ANNOTATION, '''
main() {
int v = 123;
}
@@ -507,7 +515,7 @@
var abc = 0;
}
''');
- assertHasAssistAt('bc', AssistKind.ADD_TYPE_ANNOTATION, '''
+ assertHasAssistAt('bc', DartAssistKind.ADD_TYPE_ANNOTATION, '''
main() {
int abc = 0;
}
@@ -520,7 +528,7 @@
var v = 0;
}
''');
- assertHasAssistAt('var ', AssistKind.ADD_TYPE_ANNOTATION, '''
+ assertHasAssistAt('var ', DartAssistKind.ADD_TYPE_ANNOTATION, '''
main() {
int v = 0;
}
@@ -533,7 +541,7 @@
var v = 123; // marker
}
''');
- assertHasAssistAt(' // marker', AssistKind.ADD_TYPE_ANNOTATION, '''
+ assertHasAssistAt(' // marker', DartAssistKind.ADD_TYPE_ANNOTATION, '''
main() {
int v = 123; // marker
}
@@ -546,7 +554,7 @@
int v = 42;
}
''');
- assertNoAssistAt(' = 42', AssistKind.ADD_TYPE_ANNOTATION);
+ assertNoAssistAt(' = 42', DartAssistKind.ADD_TYPE_ANNOTATION);
}
void test_addTypeAnnotation_local_wrong_multiple() {
@@ -555,7 +563,7 @@
var a = 1, b = '';
}
''');
- assertNoAssistAt('var ', AssistKind.ADD_TYPE_ANNOTATION);
+ assertNoAssistAt('var ', DartAssistKind.ADD_TYPE_ANNOTATION);
}
void test_addTypeAnnotation_local_wrong_noValue() {
@@ -565,7 +573,7 @@
var v;
}
''');
- assertNoAssistAt('var ', AssistKind.ADD_TYPE_ANNOTATION);
+ assertNoAssistAt('var ', DartAssistKind.ADD_TYPE_ANNOTATION);
}
void test_addTypeAnnotation_local_wrong_null() {
@@ -574,7 +582,7 @@
var v = null;
}
''');
- assertNoAssistAt('var ', AssistKind.ADD_TYPE_ANNOTATION);
+ assertNoAssistAt('var ', DartAssistKind.ADD_TYPE_ANNOTATION);
}
void test_addTypeAnnotation_local_wrong_unknown() {
@@ -584,7 +592,7 @@
var v = unknownVar;
}
''');
- assertNoAssistAt('var ', AssistKind.ADD_TYPE_ANNOTATION);
+ assertNoAssistAt('var ', DartAssistKind.ADD_TYPE_ANNOTATION);
}
void test_addTypeAnnotation_OK_privateType_sameLibrary() {
@@ -595,7 +603,7 @@
var v = getValue();
}
''');
- assertHasAssistAt('var ', AssistKind.ADD_TYPE_ANNOTATION, '''
+ assertHasAssistAt('var ', DartAssistKind.ADD_TYPE_ANNOTATION, '''
class _A {}
_A getValue() => new _A();
main() {
@@ -611,7 +619,7 @@
foo((num test) {});
}
''');
- assertNoAssistAt('test', AssistKind.ADD_TYPE_ANNOTATION);
+ assertNoAssistAt('test', DartAssistKind.ADD_TYPE_ANNOTATION);
}
void test_addTypeAnnotation_parameter_BAD_noPropagatedType() {
@@ -621,7 +629,7 @@
foo((test) {});
}
''');
- assertNoAssistAt('test', AssistKind.ADD_TYPE_ANNOTATION);
+ assertNoAssistAt('test', DartAssistKind.ADD_TYPE_ANNOTATION);
}
void test_addTypeAnnotation_parameter_OK() {
@@ -631,7 +639,7 @@
foo((test) {});
}
''');
- assertHasAssistAt('test', AssistKind.ADD_TYPE_ANNOTATION, '''
+ assertHasAssistAt('test', DartAssistKind.ADD_TYPE_ANNOTATION, '''
foo(f(int p)) {}
main() {
foo((int test) {});
@@ -643,7 +651,7 @@
resolveTestUnit('''
var V = 0;
''');
- assertHasAssistAt('var ', AssistKind.ADD_TYPE_ANNOTATION, '''
+ assertHasAssistAt('var ', DartAssistKind.ADD_TYPE_ANNOTATION, '''
int V = 0;
''');
}
@@ -652,14 +660,14 @@
resolveTestUnit('''
var A = 1, V = '';
''');
- assertNoAssistAt('var ', AssistKind.ADD_TYPE_ANNOTATION);
+ assertNoAssistAt('var ', DartAssistKind.ADD_TYPE_ANNOTATION);
}
void test_addTypeAnnotation_topLevelField_wrong_noValue() {
resolveTestUnit('''
var V;
''');
- assertNoAssistAt('var ', AssistKind.ADD_TYPE_ANNOTATION);
+ assertNoAssistAt('var ', DartAssistKind.ADD_TYPE_ANNOTATION);
}
void test_assignToLocalVariable() {
@@ -670,7 +678,8 @@
}
List<int> readBytes() => <int>[];
''');
- assertHasAssistAt('readBytes();', AssistKind.ASSIGN_TO_LOCAL_VARIABLE, '''
+ assertHasAssistAt('readBytes();', DartAssistKind.ASSIGN_TO_LOCAL_VARIABLE,
+ '''
main() {
List<int> bytes;
var readBytes = readBytes();
@@ -690,7 +699,7 @@
vvv = 42;
}
''');
- assertNoAssistAt('vvv =', AssistKind.ASSIGN_TO_LOCAL_VARIABLE);
+ assertNoAssistAt('vvv =', DartAssistKind.ASSIGN_TO_LOCAL_VARIABLE);
}
void test_assignToLocalVariable_invocationArgument() {
@@ -700,7 +709,7 @@
}
int f(p) {}
''');
- assertNoAssistAt('345', AssistKind.ASSIGN_TO_LOCAL_VARIABLE);
+ assertNoAssistAt('345', DartAssistKind.ASSIGN_TO_LOCAL_VARIABLE);
}
void test_assignToLocalVariable_throw() {
@@ -709,7 +718,7 @@
throw 42;
}
''');
- assertNoAssistAt('throw ', AssistKind.ASSIGN_TO_LOCAL_VARIABLE);
+ assertNoAssistAt('throw ', DartAssistKind.ASSIGN_TO_LOCAL_VARIABLE);
}
void test_assignToLocalVariable_void() {
@@ -719,7 +728,7 @@
}
void f() {}
''');
- assertNoAssistAt('f();', AssistKind.ASSIGN_TO_LOCAL_VARIABLE);
+ assertNoAssistAt('f();', DartAssistKind.ASSIGN_TO_LOCAL_VARIABLE);
}
void test_convertToBlockBody_OK_closure() {
@@ -729,7 +738,7 @@
setup(() => print('done'));
}
''');
- assertHasAssistAt('() => print', AssistKind.CONVERT_INTO_BLOCK_BODY, '''
+ assertHasAssistAt('() => print', DartAssistKind.CONVERT_INTO_BLOCK_BODY, '''
setup(x) {}
main() {
setup(() {
@@ -745,7 +754,7 @@
factory A() => null;
}
''');
- assertHasAssistAt('A()', AssistKind.CONVERT_INTO_BLOCK_BODY, '''
+ assertHasAssistAt('A()', DartAssistKind.CONVERT_INTO_BLOCK_BODY, '''
class A {
factory A() {
return null;
@@ -760,7 +769,7 @@
mmm() => 123;
}
''');
- assertHasAssistAt('mmm()', AssistKind.CONVERT_INTO_BLOCK_BODY, '''
+ assertHasAssistAt('mmm()', DartAssistKind.CONVERT_INTO_BLOCK_BODY, '''
class A {
mmm() {
return 123;
@@ -773,7 +782,7 @@
resolveTestUnit('''
fff() => 123;
''');
- assertHasAssistAt('fff()', AssistKind.CONVERT_INTO_BLOCK_BODY, '''
+ assertHasAssistAt('fff()', DartAssistKind.CONVERT_INTO_BLOCK_BODY, '''
fff() {
return 123;
}
@@ -784,7 +793,7 @@
resolveTestUnit('''
fff() => 123;
''');
- assertHasAssistAt('23;', AssistKind.CONVERT_INTO_BLOCK_BODY, '''
+ assertHasAssistAt('23;', DartAssistKind.CONVERT_INTO_BLOCK_BODY, '''
fff() {
return 123;
}
@@ -795,7 +804,7 @@
resolveTestUnit('''
var v = 123;
''');
- assertNoAssistAt('v =', AssistKind.CONVERT_INTO_BLOCK_BODY);
+ assertNoAssistAt('v =', DartAssistKind.CONVERT_INTO_BLOCK_BODY);
}
void test_convertToBlockBody_wrong_notExpressionBlock() {
@@ -804,7 +813,7 @@
return 123;
}
''');
- assertNoAssistAt('fff() {', AssistKind.CONVERT_INTO_BLOCK_BODY);
+ assertNoAssistAt('fff() {', DartAssistKind.CONVERT_INTO_BLOCK_BODY);
}
void test_convertToExpressionBody_OK_closure() {
@@ -816,7 +825,7 @@
});
}
''');
- assertHasAssistAt('42;', AssistKind.CONVERT_INTO_EXPRESSION_BODY, '''
+ assertHasAssistAt('42;', DartAssistKind.CONVERT_INTO_EXPRESSION_BODY, '''
setup(x) {}
main() {
setup(() => 42);
@@ -832,7 +841,7 @@
}
}
''');
- assertHasAssistAt('A()', AssistKind.CONVERT_INTO_EXPRESSION_BODY, '''
+ assertHasAssistAt('A()', DartAssistKind.CONVERT_INTO_EXPRESSION_BODY, '''
class A {
factory A() => null;
}
@@ -845,7 +854,7 @@
return 42;
}
''');
- assertHasAssistAt('{', AssistKind.CONVERT_INTO_EXPRESSION_BODY, '''
+ assertHasAssistAt('{', DartAssistKind.CONVERT_INTO_EXPRESSION_BODY, '''
fff() => 42;
''');
}
@@ -856,7 +865,7 @@
return 42;
}
''');
- assertHasAssistAt('ff()', AssistKind.CONVERT_INTO_EXPRESSION_BODY, '''
+ assertHasAssistAt('ff()', DartAssistKind.CONVERT_INTO_EXPRESSION_BODY, '''
fff() => 42;
''');
}
@@ -869,8 +878,8 @@
}
}
''');
- assertHasAssistAt('{ // marker', AssistKind.CONVERT_INTO_EXPRESSION_BODY,
- '''
+ assertHasAssistAt('{ // marker',
+ DartAssistKind.CONVERT_INTO_EXPRESSION_BODY, '''
class A {
m() => 42;
}
@@ -883,7 +892,7 @@
return 42;
}
''');
- assertHasAssistAt('return', AssistKind.CONVERT_INTO_EXPRESSION_BODY, '''
+ assertHasAssistAt('return', DartAssistKind.CONVERT_INTO_EXPRESSION_BODY, '''
fff() => 42;
''');
}
@@ -892,7 +901,7 @@
resolveTestUnit('''
fff() => 42;
''');
- assertNoAssistAt('fff()', AssistKind.CONVERT_INTO_EXPRESSION_BODY);
+ assertNoAssistAt('fff()', DartAssistKind.CONVERT_INTO_EXPRESSION_BODY);
}
void test_convertToExpressionBody_wrong_moreThanOneStatement() {
@@ -902,14 +911,14 @@
return v;
}
''');
- assertNoAssistAt('fff()', AssistKind.CONVERT_INTO_EXPRESSION_BODY);
+ assertNoAssistAt('fff()', DartAssistKind.CONVERT_INTO_EXPRESSION_BODY);
}
void test_convertToExpressionBody_wrong_noEnclosingFunction() {
resolveTestUnit('''
var V = 42;
''');
- assertNoAssistAt('V = ', AssistKind.CONVERT_INTO_EXPRESSION_BODY);
+ assertNoAssistAt('V = ', DartAssistKind.CONVERT_INTO_EXPRESSION_BODY);
}
void test_convertToExpressionBody_wrong_noReturn() {
@@ -918,7 +927,7 @@
var v = 42;
}
''');
- assertNoAssistAt('fff()', AssistKind.CONVERT_INTO_EXPRESSION_BODY);
+ assertNoAssistAt('fff()', DartAssistKind.CONVERT_INTO_EXPRESSION_BODY);
}
void test_convertToExpressionBody_wrong_noReturnValue() {
@@ -927,7 +936,7 @@
return;
}
''');
- assertNoAssistAt('fff()', AssistKind.CONVERT_INTO_EXPRESSION_BODY);
+ assertNoAssistAt('fff()', DartAssistKind.CONVERT_INTO_EXPRESSION_BODY);
}
void test_convertToForIndex_BAD_bodyNotBlock() {
@@ -936,7 +945,7 @@
for (String item in items) print(item);
}
''');
- assertNoAssistAt('for (String', AssistKind.CONVERT_INTO_FOR_INDEX);
+ assertNoAssistAt('for (String', DartAssistKind.CONVERT_INTO_FOR_INDEX);
}
void test_convertToForIndex_BAD_doesNotDeclareVariable() {
@@ -948,7 +957,7 @@
}
}
''');
- assertNoAssistAt('for (item', AssistKind.CONVERT_INTO_FOR_INDEX);
+ assertNoAssistAt('for (item', DartAssistKind.CONVERT_INTO_FOR_INDEX);
}
void test_convertToForIndex_BAD_iterableIsNotVariable() {
@@ -959,7 +968,7 @@
}
}
''');
- assertNoAssistAt('for (String', AssistKind.CONVERT_INTO_FOR_INDEX);
+ assertNoAssistAt('for (String', DartAssistKind.CONVERT_INTO_FOR_INDEX);
}
void test_convertToForIndex_BAD_iterableNotList() {
@@ -970,7 +979,7 @@
}
}
''');
- assertNoAssistAt('for (String', AssistKind.CONVERT_INTO_FOR_INDEX);
+ assertNoAssistAt('for (String', DartAssistKind.CONVERT_INTO_FOR_INDEX);
}
void test_convertToForIndex_BAD_usesIJK() {
@@ -982,7 +991,7 @@
}
}
''');
- assertNoAssistAt('for (String', AssistKind.CONVERT_INTO_FOR_INDEX);
+ assertNoAssistAt('for (String', DartAssistKind.CONVERT_INTO_FOR_INDEX);
}
void test_convertToForIndex_OK_onDeclaredIdentifier_name() {
@@ -993,7 +1002,7 @@
}
}
''');
- assertHasAssistAt('item in', AssistKind.CONVERT_INTO_FOR_INDEX, '''
+ assertHasAssistAt('item in', DartAssistKind.CONVERT_INTO_FOR_INDEX, '''
main(List<String> items) {
for (int i = 0; i < items.length; i++) {
String item = items[i];
@@ -1011,7 +1020,7 @@
}
}
''');
- assertHasAssistAt('tring item', AssistKind.CONVERT_INTO_FOR_INDEX, '''
+ assertHasAssistAt('tring item', DartAssistKind.CONVERT_INTO_FOR_INDEX, '''
main(List<String> items) {
for (int i = 0; i < items.length; i++) {
String item = items[i];
@@ -1029,7 +1038,7 @@
}
}
''');
- assertHasAssistAt('for (String', AssistKind.CONVERT_INTO_FOR_INDEX, '''
+ assertHasAssistAt('for (String', DartAssistKind.CONVERT_INTO_FOR_INDEX, '''
main(List<String> items) {
for (int i = 0; i < items.length; i++) {
String item = items[i];
@@ -1047,7 +1056,7 @@
}
}
''');
- assertHasAssistAt('for (String', AssistKind.CONVERT_INTO_FOR_INDEX, '''
+ assertHasAssistAt('for (String', DartAssistKind.CONVERT_INTO_FOR_INDEX, '''
main(List<String> items) {
for (int j = 0; j < items.length; j++) {
String item = items[j];
@@ -1066,7 +1075,7 @@
}
}
''');
- assertHasAssistAt('for (String', AssistKind.CONVERT_INTO_FOR_INDEX, '''
+ assertHasAssistAt('for (String', DartAssistKind.CONVERT_INTO_FOR_INDEX, '''
main(List<String> items) {
for (int k = 0; k < items.length; k++) {
String item = items[k];
@@ -1083,7 +1092,7 @@
!(p is String);
}
''');
- assertHasAssistAt('p is', AssistKind.CONVERT_INTO_IS_NOT, '''
+ assertHasAssistAt('p is', DartAssistKind.CONVERT_INTO_IS_NOT, '''
main(p) {
p is! String;
}
@@ -1096,7 +1105,7 @@
!(p is String);
}
''');
- assertHasAssistAt('String)', AssistKind.CONVERT_INTO_IS_NOT, '''
+ assertHasAssistAt('String)', DartAssistKind.CONVERT_INTO_IS_NOT, '''
main(p) {
p is! String;
}
@@ -1109,7 +1118,7 @@
!(p is String);
}
''');
- assertHasAssistAt('is String', AssistKind.CONVERT_INTO_IS_NOT, '''
+ assertHasAssistAt('is String', DartAssistKind.CONVERT_INTO_IS_NOT, '''
main(p) {
p is! String;
}
@@ -1122,7 +1131,7 @@
!!(p is String);
}
''');
- assertHasAssistAt('is String', AssistKind.CONVERT_INTO_IS_NOT, '''
+ assertHasAssistAt('is String', DartAssistKind.CONVERT_INTO_IS_NOT, '''
main(p) {
!(p is! String);
}
@@ -1135,7 +1144,7 @@
!!(p is String);
}
''');
- assertHasAssistAt('!(p', AssistKind.CONVERT_INTO_IS_NOT, '''
+ assertHasAssistAt('!(p', DartAssistKind.CONVERT_INTO_IS_NOT, '''
main(p) {
!(p is! String);
}
@@ -1148,7 +1157,7 @@
!(p is String);
}
''');
- assertHasAssistAt('!(p', AssistKind.CONVERT_INTO_IS_NOT, '''
+ assertHasAssistAt('!(p', DartAssistKind.CONVERT_INTO_IS_NOT, '''
main(p) {
p is! String;
}
@@ -1161,7 +1170,7 @@
!(p is String);
}
''');
- assertHasAssistAt('(p is', AssistKind.CONVERT_INTO_IS_NOT, '''
+ assertHasAssistAt('(p is', DartAssistKind.CONVERT_INTO_IS_NOT, '''
main(p) {
p is! String;
}
@@ -1174,7 +1183,7 @@
p is! String;
}
''');
- assertNoAssistAt('is!', AssistKind.CONVERT_INTO_IS_NOT);
+ assertNoAssistAt('is!', DartAssistKind.CONVERT_INTO_IS_NOT);
}
void test_convertToIsNot_wrong_is_noEnclosingParenthesis() {
@@ -1183,7 +1192,7 @@
p is String;
}
''');
- assertNoAssistAt('is String', AssistKind.CONVERT_INTO_IS_NOT);
+ assertNoAssistAt('is String', DartAssistKind.CONVERT_INTO_IS_NOT);
}
void test_convertToIsNot_wrong_is_noPrefix() {
@@ -1192,7 +1201,7 @@
(p is String);
}
''');
- assertNoAssistAt('is String', AssistKind.CONVERT_INTO_IS_NOT);
+ assertNoAssistAt('is String', DartAssistKind.CONVERT_INTO_IS_NOT);
}
void test_convertToIsNot_wrong_is_notIsExpression() {
@@ -1201,7 +1210,7 @@
123 + 456;
}
''');
- assertNoAssistAt('123 +', AssistKind.CONVERT_INTO_IS_NOT);
+ assertNoAssistAt('123 +', DartAssistKind.CONVERT_INTO_IS_NOT);
}
void test_convertToIsNot_wrong_is_notTheNotOperator() {
@@ -1211,7 +1220,7 @@
++(p is String);
}
''');
- assertNoAssistAt('is String', AssistKind.CONVERT_INTO_IS_NOT);
+ assertNoAssistAt('is String', DartAssistKind.CONVERT_INTO_IS_NOT);
}
void test_convertToIsNot_wrong_not_alreadyIsNot() {
@@ -1220,7 +1229,7 @@
!(p is! String);
}
''');
- assertNoAssistAt('!(p', AssistKind.CONVERT_INTO_IS_NOT);
+ assertNoAssistAt('!(p', DartAssistKind.CONVERT_INTO_IS_NOT);
}
void test_convertToIsNot_wrong_not_noEnclosingParenthesis() {
@@ -1229,7 +1238,7 @@
!p;
}
''');
- assertNoAssistAt('!p', AssistKind.CONVERT_INTO_IS_NOT);
+ assertNoAssistAt('!p', DartAssistKind.CONVERT_INTO_IS_NOT);
}
void test_convertToIsNot_wrong_not_notIsExpression() {
@@ -1238,7 +1247,7 @@
!(p == null);
}
''');
- assertNoAssistAt('!(p', AssistKind.CONVERT_INTO_IS_NOT);
+ assertNoAssistAt('!(p', DartAssistKind.CONVERT_INTO_IS_NOT);
}
void test_convertToIsNot_wrong_not_notTheNotOperator() {
@@ -1248,7 +1257,7 @@
++(p is String);
}
''');
- assertNoAssistAt('++(', AssistKind.CONVERT_INTO_IS_NOT);
+ assertNoAssistAt('++(', DartAssistKind.CONVERT_INTO_IS_NOT);
}
void test_convertToIsNotEmpty_OK_on_isEmpty() {
@@ -1257,7 +1266,7 @@
!str.isEmpty;
}
''');
- assertHasAssistAt('isEmpty', AssistKind.CONVERT_INTO_IS_NOT_EMPTY, '''
+ assertHasAssistAt('isEmpty', DartAssistKind.CONVERT_INTO_IS_NOT_EMPTY, '''
main(String str) {
str.isNotEmpty;
}
@@ -1270,7 +1279,7 @@
!str.isEmpty;
}
''');
- assertHasAssistAt('str.', AssistKind.CONVERT_INTO_IS_NOT_EMPTY, '''
+ assertHasAssistAt('str.', DartAssistKind.CONVERT_INTO_IS_NOT_EMPTY, '''
main(String str) {
str.isNotEmpty;
}
@@ -1283,7 +1292,7 @@
!'text'.isEmpty;
}
''');
- assertHasAssistAt('isEmpty', AssistKind.CONVERT_INTO_IS_NOT_EMPTY, '''
+ assertHasAssistAt('isEmpty', DartAssistKind.CONVERT_INTO_IS_NOT_EMPTY, '''
main(String str) {
'text'.isNotEmpty;
}
@@ -1297,7 +1306,7 @@
~str.isEmpty;
}
''');
- assertNoAssistAt('isEmpty;', AssistKind.CONVERT_INTO_IS_NOT_EMPTY);
+ assertNoAssistAt('isEmpty;', DartAssistKind.CONVERT_INTO_IS_NOT_EMPTY);
}
void test_convertToIsNotEmpty_wrong_noIsNotEmpty() {
@@ -1309,7 +1318,7 @@
!a.isEmpty;
}
''');
- assertNoAssistAt('isEmpty;', AssistKind.CONVERT_INTO_IS_NOT_EMPTY);
+ assertNoAssistAt('isEmpty;', DartAssistKind.CONVERT_INTO_IS_NOT_EMPTY);
}
void test_convertToIsNotEmpty_wrong_notInPrefixExpression() {
@@ -1318,7 +1327,7 @@
str.isEmpty;
}
''');
- assertNoAssistAt('isEmpty;', AssistKind.CONVERT_INTO_IS_NOT_EMPTY);
+ assertNoAssistAt('isEmpty;', DartAssistKind.CONVERT_INTO_IS_NOT_EMPTY);
}
void test_convertToIsNotEmpty_wrong_notIsEmpty() {
@@ -1327,7 +1336,7 @@
!p.isEven;
}
''');
- assertNoAssistAt('isEven;', AssistKind.CONVERT_INTO_IS_NOT_EMPTY);
+ assertNoAssistAt('isEven;', DartAssistKind.CONVERT_INTO_IS_NOT_EMPTY);
}
void test_encapsulateField_BAD_alreadyPrivate() {
@@ -1339,7 +1348,7 @@
print(a._test);
}
''');
- assertNoAssistAt('_test =', AssistKind.ENCAPSULATE_FIELD);
+ assertNoAssistAt('_test =', DartAssistKind.ENCAPSULATE_FIELD);
}
void test_encapsulateField_BAD_final() {
@@ -1348,7 +1357,7 @@
final int test = 42;
}
''');
- assertNoAssistAt('test =', AssistKind.ENCAPSULATE_FIELD);
+ assertNoAssistAt('test =', DartAssistKind.ENCAPSULATE_FIELD);
}
void test_encapsulateField_BAD_multipleFields() {
@@ -1360,7 +1369,7 @@
print(a.bbb);
}
''');
- assertNoAssistAt('bbb, ', AssistKind.ENCAPSULATE_FIELD);
+ assertNoAssistAt('bbb, ', DartAssistKind.ENCAPSULATE_FIELD);
}
void test_encapsulateField_BAD_notOnName() {
@@ -1369,7 +1378,7 @@
int test = 1 + 2 + 3;
}
''');
- assertNoAssistAt('+ 2', AssistKind.ENCAPSULATE_FIELD);
+ assertNoAssistAt('+ 2', DartAssistKind.ENCAPSULATE_FIELD);
}
void test_encapsulateField_BAD_parseError() {
@@ -1382,7 +1391,7 @@
print(a.test);
}
''');
- assertNoAssistAt('; // marker', AssistKind.ENCAPSULATE_FIELD);
+ assertNoAssistAt('; // marker', DartAssistKind.ENCAPSULATE_FIELD);
}
void test_encapsulateField_BAD_static() {
@@ -1391,7 +1400,7 @@
static int test = 42;
}
''');
- assertNoAssistAt('test =', AssistKind.ENCAPSULATE_FIELD);
+ assertNoAssistAt('test =', DartAssistKind.ENCAPSULATE_FIELD);
}
void test_encapsulateField_OK_hasType() {
@@ -1404,7 +1413,7 @@
print(a.test);
}
''');
- assertHasAssistAt('test = 42', AssistKind.ENCAPSULATE_FIELD, '''
+ assertHasAssistAt('test = 42', DartAssistKind.ENCAPSULATE_FIELD, '''
class A {
int _test = 42;
@@ -1430,7 +1439,7 @@
print(a.test);
}
''');
- assertHasAssistAt('test = 42', AssistKind.ENCAPSULATE_FIELD, '''
+ assertHasAssistAt('test = 42', DartAssistKind.ENCAPSULATE_FIELD, '''
class A {
var _test = 42;
@@ -1459,7 +1468,7 @@
return a $initialOperator b;
}
''');
- assertHasAssistAt(initialOperator, AssistKind.EXCHANGE_OPERANDS, '''
+ assertHasAssistAt(initialOperator, DartAssistKind.EXCHANGE_OPERANDS, '''
bool main(int a, int b) {
return b $resultOperator a;
}
@@ -1473,7 +1482,7 @@
1 * 2 * 3 + 4;
}
''');
- assertHasAssistAt('* 2', AssistKind.EXCHANGE_OPERANDS, '''
+ assertHasAssistAt('* 2', DartAssistKind.EXCHANGE_OPERANDS, '''
main() {
2 * 3 * 1 + 4;
}
@@ -1486,7 +1495,7 @@
1 + 2 - 3 + 4;
}
''');
- assertHasAssistAt('+ 2', AssistKind.EXCHANGE_OPERANDS, '''
+ assertHasAssistAt('+ 2', DartAssistKind.EXCHANGE_OPERANDS, '''
main() {
2 + 1 - 3 + 4;
}
@@ -1499,7 +1508,7 @@
1 + 2 + 3;
}
''');
- assertHasAssistAt('+ 2', AssistKind.EXCHANGE_OPERANDS, '''
+ assertHasAssistAt('+ 2', DartAssistKind.EXCHANGE_OPERANDS, '''
main() {
2 + 3 + 1;
}
@@ -1512,7 +1521,7 @@
1 + 2 + 3;
}
''');
- assertHasAssistAt('+ 3', AssistKind.EXCHANGE_OPERANDS, '''
+ assertHasAssistAt('+ 3', DartAssistKind.EXCHANGE_OPERANDS, '''
main() {
3 + 1 + 2;
}
@@ -1525,7 +1534,7 @@
1 + 2;
}
''');
- assertHasAssistAt(' 2', AssistKind.EXCHANGE_OPERANDS, '''
+ assertHasAssistAt(' 2', DartAssistKind.EXCHANGE_OPERANDS, '''
main() {
2 + 1;
}
@@ -1538,7 +1547,7 @@
1 + 2;
}
''');
- assertHasAssistAt('+ 2', AssistKind.EXCHANGE_OPERANDS, '''
+ assertHasAssistAt('+ 2', DartAssistKind.EXCHANGE_OPERANDS, '''
main() {
2 + 1;
}
@@ -1552,7 +1561,7 @@
}
''');
length = '1 + 2'.length;
- assertHasAssistAt('1 + 2', AssistKind.EXCHANGE_OPERANDS, '''
+ assertHasAssistAt('1 + 2', DartAssistKind.EXCHANGE_OPERANDS, '''
main() {
2 + 1;
}
@@ -1566,7 +1575,7 @@
}
''');
length = 2;
- assertHasAssistAt('+ 2', AssistKind.EXCHANGE_OPERANDS, '''
+ assertHasAssistAt('+ 2', DartAssistKind.EXCHANGE_OPERANDS, '''
main() {
2 + 1;
}
@@ -1580,7 +1589,7 @@
}
''');
length = 3;
- assertNoAssistAt('+ 222', AssistKind.EXCHANGE_OPERANDS);
+ assertNoAssistAt('+ 222', DartAssistKind.EXCHANGE_OPERANDS);
}
void test_exchangeBinaryExpressionArguments_wrong_onOperand() {
@@ -1590,7 +1599,7 @@
}
''');
length = 3;
- assertNoAssistAt('11 +', AssistKind.EXCHANGE_OPERANDS);
+ assertNoAssistAt('11 +', DartAssistKind.EXCHANGE_OPERANDS);
}
void test_exchangeBinaryExpressionArguments_wrong_selectionWithBinary() {
@@ -1600,7 +1609,7 @@
}
''');
length = '1 + 2 + 3'.length;
- assertNoAssistAt('1 + 2 + 3', AssistKind.EXCHANGE_OPERANDS);
+ assertNoAssistAt('1 + 2 + 3', DartAssistKind.EXCHANGE_OPERANDS);
}
void test_importAddShow_BAD_hasShow() {
@@ -1610,21 +1619,21 @@
PI;
}
''');
- assertNoAssistAt('import ', AssistKind.IMPORT_ADD_SHOW);
+ assertNoAssistAt('import ', DartAssistKind.IMPORT_ADD_SHOW);
}
void test_importAddShow_BAD_unresolvedUri() {
resolveTestUnit('''
import '/no/such/lib.dart';
''');
- assertNoAssistAt('import ', AssistKind.IMPORT_ADD_SHOW);
+ assertNoAssistAt('import ', DartAssistKind.IMPORT_ADD_SHOW);
}
void test_importAddShow_BAD_unused() {
resolveTestUnit('''
import 'dart:math';
''');
- assertNoAssistAt('import ', AssistKind.IMPORT_ADD_SHOW);
+ assertNoAssistAt('import ', DartAssistKind.IMPORT_ADD_SHOW);
}
void test_importAddShow_OK_hasUnresolvedIdentifier() {
@@ -1635,7 +1644,7 @@
return x.foo();
}
''');
- assertHasAssistAt('import ', AssistKind.IMPORT_ADD_SHOW, '''
+ assertHasAssistAt('import ', DartAssistKind.IMPORT_ADD_SHOW, '''
import 'dart:math' show PI;
main(x) {
PI;
@@ -1653,7 +1662,7 @@
max(1, 2);
}
''');
- assertHasAssistAt('import ', AssistKind.IMPORT_ADD_SHOW, '''
+ assertHasAssistAt('import ', DartAssistKind.IMPORT_ADD_SHOW, '''
import 'dart:math' show E, PI, max;
main() {
PI;
@@ -1672,7 +1681,7 @@
max(1, 2);
}
''');
- assertHasAssistAt('art:math', AssistKind.IMPORT_ADD_SHOW, '''
+ assertHasAssistAt('art:math', DartAssistKind.IMPORT_ADD_SHOW, '''
import 'dart:math' show E, PI, max;
main() {
PI;
@@ -1689,7 +1698,7 @@
print('not a block');
}
''');
- assertNoAssistAt('if (p', AssistKind.INTRODUCE_LOCAL_CAST_TYPE);
+ assertNoAssistAt('if (p', DartAssistKind.INTRODUCE_LOCAL_CAST_TYPE);
}
void test_introduceLocalTestedType_BAD_notIsExpression() {
@@ -1699,7 +1708,7 @@
}
}
''');
- assertNoAssistAt('if (p', AssistKind.INTRODUCE_LOCAL_CAST_TYPE);
+ assertNoAssistAt('if (p', DartAssistKind.INTRODUCE_LOCAL_CAST_TYPE);
}
void test_introduceLocalTestedType_OK_if_is() {
@@ -1721,13 +1730,14 @@
}
''';
assertHasAssistAt(
- 'is MyType', AssistKind.INTRODUCE_LOCAL_CAST_TYPE, expected);
+ 'is MyType', DartAssistKind.INTRODUCE_LOCAL_CAST_TYPE, expected);
_assertLinkedGroup(change.linkedEditGroups[0], [
'myTypeName = '
], expectedSuggestions(
LinkedEditSuggestionKind.VARIABLE, ['myTypeName', 'typeName', 'name']));
// another good location
- assertHasAssistAt('if (p', AssistKind.INTRODUCE_LOCAL_CAST_TYPE, expected);
+ assertHasAssistAt(
+ 'if (p', DartAssistKind.INTRODUCE_LOCAL_CAST_TYPE, expected);
}
void test_introduceLocalTestedType_OK_if_isNot() {
@@ -1749,13 +1759,14 @@
}
''';
assertHasAssistAt(
- 'is! MyType', AssistKind.INTRODUCE_LOCAL_CAST_TYPE, expected);
+ 'is! MyType', DartAssistKind.INTRODUCE_LOCAL_CAST_TYPE, expected);
_assertLinkedGroup(change.linkedEditGroups[0], [
'myTypeName = '
], expectedSuggestions(
LinkedEditSuggestionKind.VARIABLE, ['myTypeName', 'typeName', 'name']));
// another good location
- assertHasAssistAt('if (p', AssistKind.INTRODUCE_LOCAL_CAST_TYPE, expected);
+ assertHasAssistAt(
+ 'if (p', DartAssistKind.INTRODUCE_LOCAL_CAST_TYPE, expected);
}
void test_introduceLocalTestedType_OK_while() {
@@ -1775,14 +1786,15 @@
}
''';
assertHasAssistAt(
- 'is String', AssistKind.INTRODUCE_LOCAL_CAST_TYPE, expected);
+ 'is String', DartAssistKind.INTRODUCE_LOCAL_CAST_TYPE, expected);
assertHasAssistAt(
- 'while (p', AssistKind.INTRODUCE_LOCAL_CAST_TYPE, expected);
+ 'while (p', DartAssistKind.INTRODUCE_LOCAL_CAST_TYPE, expected);
}
void test_invalidSelection() {
resolveTestUnit('');
- List<Assist> assists = computeAssists(testUnit, -1, 0);
+ List<Assist> assists =
+ computeAssists(plugin, context, testUnit.element.source, -1, 0);
expect(assists, isEmpty);
}
@@ -1796,7 +1808,7 @@
}
}
''');
- assertHasAssistAt('if (', AssistKind.INVERT_IF_STATEMENT, '''
+ assertHasAssistAt('if (', DartAssistKind.INVERT_IF_STATEMENT, '''
main() {
if (false) {
1;
@@ -1816,7 +1828,7 @@
1;
}
''');
- assertHasAssistAt('if (', AssistKind.INVERT_IF_STATEMENT, '''
+ assertHasAssistAt('if (', DartAssistKind.INVERT_IF_STATEMENT, '''
main() {
if (false)
1;
@@ -1836,7 +1848,7 @@
}
}
''');
- assertHasAssistAt('if (1 ==', AssistKind.JOIN_IF_WITH_INNER, '''
+ assertHasAssistAt('if (1 ==', DartAssistKind.JOIN_IF_WITH_INNER, '''
main() {
if (1 == 1 && (2 == 2 || 3 == 3)) {
print(0);
@@ -1856,7 +1868,7 @@
}
bool isCheck() => false;
''');
- assertHasAssistAt('if (isCheck', AssistKind.JOIN_IF_WITH_INNER, '''
+ assertHasAssistAt('if (isCheck', DartAssistKind.JOIN_IF_WITH_INNER, '''
main() {
if (isCheck() && 2 == 2) {
print(0);
@@ -1876,7 +1888,7 @@
}
}
''');
- assertHasAssistAt('if (1 ==', AssistKind.JOIN_IF_WITH_INNER, '''
+ assertHasAssistAt('if (1 ==', DartAssistKind.JOIN_IF_WITH_INNER, '''
main() {
if ((1 == 1 || 2 == 2) && 3 == 3) {
print(0);
@@ -1895,7 +1907,7 @@
}
}
''');
- assertHasAssistAt('1 ==', AssistKind.JOIN_IF_WITH_INNER, '''
+ assertHasAssistAt('1 ==', DartAssistKind.JOIN_IF_WITH_INNER, '''
main() {
if (1 == 1 && 2 == 2) {
print(0);
@@ -1914,7 +1926,7 @@
}
}
''');
- assertHasAssistAt('if (1 ==', AssistKind.JOIN_IF_WITH_INNER, '''
+ assertHasAssistAt('if (1 ==', DartAssistKind.JOIN_IF_WITH_INNER, '''
main() {
if (1 == 1 && 2 == 2) {
print(0);
@@ -1932,7 +1944,7 @@
}
}
''');
- assertHasAssistAt('if (1 ==', AssistKind.JOIN_IF_WITH_INNER, '''
+ assertHasAssistAt('if (1 ==', DartAssistKind.JOIN_IF_WITH_INNER, '''
main() {
if (1 == 1 && 2 == 2) {
print(0);
@@ -1953,7 +1965,7 @@
}
}
''');
- assertHasAssistAt('if (1 ==', AssistKind.JOIN_IF_WITH_INNER, '''
+ assertHasAssistAt('if (1 ==', DartAssistKind.JOIN_IF_WITH_INNER, '''
main() {
if (1 == 1 && 2 == 2) {
print(1);
@@ -1973,7 +1985,7 @@
}
}
''');
- assertHasAssistAt('if (1 ==', AssistKind.JOIN_IF_WITH_INNER, '''
+ assertHasAssistAt('if (1 ==', DartAssistKind.JOIN_IF_WITH_INNER, '''
main() {
if (1 == 1 && 2 == 2) {
print(0);
@@ -1990,7 +2002,7 @@
}
}
''');
- assertNoAssistAt('if (1 ==', AssistKind.JOIN_IF_WITH_INNER);
+ assertNoAssistAt('if (1 ==', DartAssistKind.JOIN_IF_WITH_INNER);
}
void test_joinIfStatementInner_wrong_innerWithElse() {
@@ -2005,7 +2017,7 @@
}
}
''');
- assertNoAssistAt('if (1 ==', AssistKind.JOIN_IF_WITH_INNER);
+ assertNoAssistAt('if (1 ==', DartAssistKind.JOIN_IF_WITH_INNER);
}
void test_joinIfStatementInner_wrong_targetNotIf() {
@@ -2014,7 +2026,7 @@
print(0);
}
''');
- assertNoAssistAt('print', AssistKind.JOIN_IF_WITH_INNER);
+ assertNoAssistAt('print', DartAssistKind.JOIN_IF_WITH_INNER);
}
void test_joinIfStatementInner_wrong_targetWithElse() {
@@ -2029,7 +2041,7 @@
}
}
''');
- assertNoAssistAt('if (1 ==', AssistKind.JOIN_IF_WITH_INNER);
+ assertNoAssistAt('if (1 ==', DartAssistKind.JOIN_IF_WITH_INNER);
}
void test_joinIfStatementOuter_OK_conditionAndOr() {
@@ -2042,7 +2054,7 @@
}
}
''');
- assertHasAssistAt('if (2 ==', AssistKind.JOIN_IF_WITH_OUTER, '''
+ assertHasAssistAt('if (2 ==', DartAssistKind.JOIN_IF_WITH_OUTER, '''
main() {
if (1 == 1 && (2 == 2 || 3 == 3)) {
print(0);
@@ -2062,7 +2074,7 @@
}
bool isCheck() => false;
''');
- assertHasAssistAt('if (isCheck', AssistKind.JOIN_IF_WITH_OUTER, '''
+ assertHasAssistAt('if (isCheck', DartAssistKind.JOIN_IF_WITH_OUTER, '''
main() {
if (1 == 1 && isCheck()) {
print(0);
@@ -2082,7 +2094,7 @@
}
}
''');
- assertHasAssistAt('if (3 == 3', AssistKind.JOIN_IF_WITH_OUTER, '''
+ assertHasAssistAt('if (3 == 3', DartAssistKind.JOIN_IF_WITH_OUTER, '''
main() {
if ((1 == 1 || 2 == 2) && 3 == 3) {
print(0);
@@ -2101,7 +2113,7 @@
}
}
''');
- assertHasAssistAt('if (2 == 2', AssistKind.JOIN_IF_WITH_OUTER, '''
+ assertHasAssistAt('if (2 == 2', DartAssistKind.JOIN_IF_WITH_OUTER, '''
main() {
if (1 == 1 && 2 == 2) {
print(0);
@@ -2120,7 +2132,7 @@
}
}
''');
- assertHasAssistAt('if (2 == 2', AssistKind.JOIN_IF_WITH_OUTER, '''
+ assertHasAssistAt('if (2 == 2', DartAssistKind.JOIN_IF_WITH_OUTER, '''
main() {
if (1 == 1 && 2 == 2) {
print(0);
@@ -2138,7 +2150,7 @@
}
}
''');
- assertHasAssistAt('if (2 == 2', AssistKind.JOIN_IF_WITH_OUTER, '''
+ assertHasAssistAt('if (2 == 2', DartAssistKind.JOIN_IF_WITH_OUTER, '''
main() {
if (1 == 1 && 2 == 2) {
print(0);
@@ -2159,7 +2171,7 @@
}
}
''');
- assertHasAssistAt('if (2 == 2', AssistKind.JOIN_IF_WITH_OUTER, '''
+ assertHasAssistAt('if (2 == 2', DartAssistKind.JOIN_IF_WITH_OUTER, '''
main() {
if (1 == 1 && 2 == 2) {
print(1);
@@ -2179,7 +2191,7 @@
}
}
''');
- assertHasAssistAt('if (2 == 2', AssistKind.JOIN_IF_WITH_OUTER, '''
+ assertHasAssistAt('if (2 == 2', DartAssistKind.JOIN_IF_WITH_OUTER, '''
main() {
if (1 == 1 && 2 == 2) {
print(0);
@@ -2196,7 +2208,7 @@
}
}
''');
- assertNoAssistAt('if (1 == 1', AssistKind.JOIN_IF_WITH_OUTER);
+ assertNoAssistAt('if (1 == 1', DartAssistKind.JOIN_IF_WITH_OUTER);
}
void test_joinIfStatementOuter_wrong_outerWithElse() {
@@ -2211,7 +2223,7 @@
}
}
''');
- assertNoAssistAt('if (2 == 2', AssistKind.JOIN_IF_WITH_OUTER);
+ assertNoAssistAt('if (2 == 2', DartAssistKind.JOIN_IF_WITH_OUTER);
}
void test_joinIfStatementOuter_wrong_targetNotIf() {
@@ -2220,7 +2232,7 @@
print(0);
}
''');
- assertNoAssistAt('print', AssistKind.JOIN_IF_WITH_OUTER);
+ assertNoAssistAt('print', DartAssistKind.JOIN_IF_WITH_OUTER);
}
void test_joinIfStatementOuter_wrong_targetWithElse() {
@@ -2235,7 +2247,7 @@
}
}
''');
- assertNoAssistAt('if (2 == 2', AssistKind.JOIN_IF_WITH_OUTER);
+ assertNoAssistAt('if (2 == 2', DartAssistKind.JOIN_IF_WITH_OUTER);
}
void test_joinVariableDeclaration_onAssignment_OK() {
@@ -2245,7 +2257,7 @@
v = 1;
}
''');
- assertHasAssistAt('v =', AssistKind.JOIN_VARIABLE_DECLARATION, '''
+ assertHasAssistAt('v =', DartAssistKind.JOIN_VARIABLE_DECLARATION, '''
main() {
var v = 1;
}
@@ -2259,7 +2271,7 @@
v = 2;
}
''');
- assertNoAssistAt('v = 2', AssistKind.JOIN_VARIABLE_DECLARATION);
+ assertNoAssistAt('v = 2', DartAssistKind.JOIN_VARIABLE_DECLARATION);
}
void test_joinVariableDeclaration_onAssignment_wrong_notAdjacent() {
@@ -2270,7 +2282,7 @@
v = 1;
}
''');
- assertNoAssistAt('v = 1', AssistKind.JOIN_VARIABLE_DECLARATION);
+ assertNoAssistAt('v = 1', DartAssistKind.JOIN_VARIABLE_DECLARATION);
}
void test_joinVariableDeclaration_onAssignment_wrong_notAssignment() {
@@ -2280,7 +2292,7 @@
v += 1;
}
''');
- assertNoAssistAt('v += 1', AssistKind.JOIN_VARIABLE_DECLARATION);
+ assertNoAssistAt('v += 1', DartAssistKind.JOIN_VARIABLE_DECLARATION);
}
void test_joinVariableDeclaration_onAssignment_wrong_notDeclaration() {
@@ -2289,7 +2301,7 @@
v = 1;
}
''');
- assertNoAssistAt('v = 1', AssistKind.JOIN_VARIABLE_DECLARATION);
+ assertNoAssistAt('v = 1', DartAssistKind.JOIN_VARIABLE_DECLARATION);
}
void test_joinVariableDeclaration_onAssignment_wrong_notLeftArgument() {
@@ -2299,7 +2311,7 @@
1 + v; // marker
}
''');
- assertNoAssistAt('v; // marker', AssistKind.JOIN_VARIABLE_DECLARATION);
+ assertNoAssistAt('v; // marker', DartAssistKind.JOIN_VARIABLE_DECLARATION);
}
void test_joinVariableDeclaration_onAssignment_wrong_notOneVariable() {
@@ -2309,7 +2321,7 @@
v = 1;
}
''');
- assertNoAssistAt('v = 1', AssistKind.JOIN_VARIABLE_DECLARATION);
+ assertNoAssistAt('v = 1', DartAssistKind.JOIN_VARIABLE_DECLARATION);
}
void test_joinVariableDeclaration_onAssignment_wrong_notResolved() {
@@ -2320,7 +2332,7 @@
x = 1;
}
''');
- assertNoAssistAt('x = 1', AssistKind.JOIN_VARIABLE_DECLARATION);
+ assertNoAssistAt('x = 1', DartAssistKind.JOIN_VARIABLE_DECLARATION);
}
void test_joinVariableDeclaration_onAssignment_wrong_notSameBlock() {
@@ -2332,7 +2344,7 @@
}
}
''');
- assertNoAssistAt('v = 1', AssistKind.JOIN_VARIABLE_DECLARATION);
+ assertNoAssistAt('v = 1', DartAssistKind.JOIN_VARIABLE_DECLARATION);
}
void test_joinVariableDeclaration_onDeclaration_OK_onName() {
@@ -2342,7 +2354,7 @@
v = 1;
}
''');
- assertHasAssistAt('v;', AssistKind.JOIN_VARIABLE_DECLARATION, '''
+ assertHasAssistAt('v;', DartAssistKind.JOIN_VARIABLE_DECLARATION, '''
main() {
var v = 1;
}
@@ -2356,7 +2368,7 @@
v = 1;
}
''');
- assertHasAssistAt('int v', AssistKind.JOIN_VARIABLE_DECLARATION, '''
+ assertHasAssistAt('int v', DartAssistKind.JOIN_VARIABLE_DECLARATION, '''
main() {
int v = 1;
}
@@ -2370,7 +2382,7 @@
v = 1;
}
''');
- assertHasAssistAt('var v', AssistKind.JOIN_VARIABLE_DECLARATION, '''
+ assertHasAssistAt('var v', DartAssistKind.JOIN_VARIABLE_DECLARATION, '''
main() {
var v = 1;
}
@@ -2384,7 +2396,7 @@
v = 2;
}
''');
- assertNoAssistAt('v = 1', AssistKind.JOIN_VARIABLE_DECLARATION);
+ assertNoAssistAt('v = 1', DartAssistKind.JOIN_VARIABLE_DECLARATION);
}
void test_joinVariableDeclaration_onDeclaration_wrong_lastStatement() {
@@ -2394,7 +2406,7 @@
var v;
}
''');
- assertNoAssistAt('v;', AssistKind.JOIN_VARIABLE_DECLARATION);
+ assertNoAssistAt('v;', DartAssistKind.JOIN_VARIABLE_DECLARATION);
}
void test_joinVariableDeclaration_onDeclaration_wrong_nextNotAssignmentExpression() {
@@ -2404,7 +2416,7 @@
42;
}
''');
- assertNoAssistAt('v;', AssistKind.JOIN_VARIABLE_DECLARATION);
+ assertNoAssistAt('v;', DartAssistKind.JOIN_VARIABLE_DECLARATION);
}
void test_joinVariableDeclaration_onDeclaration_wrong_nextNotExpressionStatement() {
@@ -2414,7 +2426,7 @@
if (true) return;
}
''');
- assertNoAssistAt('v;', AssistKind.JOIN_VARIABLE_DECLARATION);
+ assertNoAssistAt('v;', DartAssistKind.JOIN_VARIABLE_DECLARATION);
}
void test_joinVariableDeclaration_onDeclaration_wrong_nextNotPureAssignment() {
@@ -2424,7 +2436,7 @@
v += 1;
}
''');
- assertNoAssistAt('v;', AssistKind.JOIN_VARIABLE_DECLARATION);
+ assertNoAssistAt('v;', DartAssistKind.JOIN_VARIABLE_DECLARATION);
}
void test_joinVariableDeclaration_onDeclaration_wrong_notOneVariable() {
@@ -2434,7 +2446,7 @@
v = 1;
}
''');
- assertNoAssistAt('v, ', AssistKind.JOIN_VARIABLE_DECLARATION);
+ assertNoAssistAt('v, ', DartAssistKind.JOIN_VARIABLE_DECLARATION);
}
void test_removeTypeAnnotation_classField_OK() {
@@ -2443,7 +2455,7 @@
int v = 1;
}
''');
- assertHasAssistAt('v = ', AssistKind.REMOVE_TYPE_ANNOTATION, '''
+ assertHasAssistAt('v = ', DartAssistKind.REMOVE_TYPE_ANNOTATION, '''
class A {
var v = 1;
}
@@ -2456,7 +2468,7 @@
final int v = 1;
}
''');
- assertHasAssistAt('v = ', AssistKind.REMOVE_TYPE_ANNOTATION, '''
+ assertHasAssistAt('v = ', DartAssistKind.REMOVE_TYPE_ANNOTATION, '''
class A {
final v = 1;
}
@@ -2469,7 +2481,7 @@
int a = 1, b = 2;
}
''');
- assertHasAssistAt('int ', AssistKind.REMOVE_TYPE_ANNOTATION, '''
+ assertHasAssistAt('int ', DartAssistKind.REMOVE_TYPE_ANNOTATION, '''
main() {
var a = 1, b = 2;
}
@@ -2482,7 +2494,7 @@
const int v = 1;
}
''');
- assertHasAssistAt('int ', AssistKind.REMOVE_TYPE_ANNOTATION, '''
+ assertHasAssistAt('int ', DartAssistKind.REMOVE_TYPE_ANNOTATION, '''
main() {
const v = 1;
}
@@ -2495,7 +2507,7 @@
final int v = 1;
}
''');
- assertHasAssistAt('int ', AssistKind.REMOVE_TYPE_ANNOTATION, '''
+ assertHasAssistAt('int ', DartAssistKind.REMOVE_TYPE_ANNOTATION, '''
main() {
final v = 1;
}
@@ -2506,7 +2518,7 @@
resolveTestUnit('''
int V = 1;
''');
- assertHasAssistAt('int ', AssistKind.REMOVE_TYPE_ANNOTATION, '''
+ assertHasAssistAt('int ', DartAssistKind.REMOVE_TYPE_ANNOTATION, '''
var V = 1;
''');
}
@@ -2515,7 +2527,7 @@
resolveTestUnit('''
final int V = 1;
''');
- assertHasAssistAt('int ', AssistKind.REMOVE_TYPE_ANNOTATION, '''
+ assertHasAssistAt('int ', DartAssistKind.REMOVE_TYPE_ANNOTATION, '''
final V = 1;
''');
}
@@ -2528,7 +2540,8 @@
}
''');
// on conditional
- assertHasAssistAt('11 :', AssistKind.REPLACE_CONDITIONAL_WITH_IF_ELSE, '''
+ assertHasAssistAt('11 :', DartAssistKind.REPLACE_CONDITIONAL_WITH_IF_ELSE,
+ '''
main() {
var v;
if (true) {
@@ -2539,7 +2552,8 @@
}
''');
// on variable
- assertHasAssistAt('v =', AssistKind.REPLACE_CONDITIONAL_WITH_IF_ELSE, '''
+ assertHasAssistAt('v =', DartAssistKind.REPLACE_CONDITIONAL_WITH_IF_ELSE,
+ '''
main() {
var v;
if (true) {
@@ -2557,8 +2571,8 @@
return true ? 111 : 222;
}
''');
- assertHasAssistAt('return ', AssistKind.REPLACE_CONDITIONAL_WITH_IF_ELSE,
- '''
+ assertHasAssistAt('return ',
+ DartAssistKind.REPLACE_CONDITIONAL_WITH_IF_ELSE, '''
main() {
if (true) {
return 111;
@@ -2575,7 +2589,8 @@
int a = 1, vvv = true ? 111 : 222, b = 2;
}
''');
- assertHasAssistAt('11 :', AssistKind.REPLACE_CONDITIONAL_WITH_IF_ELSE, '''
+ assertHasAssistAt('11 :', DartAssistKind.REPLACE_CONDITIONAL_WITH_IF_ELSE,
+ '''
main() {
int a = 1, vvv, b = 2;
if (true) {
@@ -2591,7 +2606,7 @@
resolveTestUnit('''
var v = true ? 111 : 222;
''');
- assertNoAssistAt('? 111', AssistKind.REPLACE_CONDITIONAL_WITH_IF_ELSE);
+ assertNoAssistAt('? 111', DartAssistKind.REPLACE_CONDITIONAL_WITH_IF_ELSE);
}
void test_replaceConditionalWithIfElse_wrong_notConditional() {
@@ -2600,7 +2615,7 @@
var v = 42;
}
''');
- assertNoAssistAt('v = 42', AssistKind.REPLACE_CONDITIONAL_WITH_IF_ELSE);
+ assertNoAssistAt('v = 42', DartAssistKind.REPLACE_CONDITIONAL_WITH_IF_ELSE);
}
void test_replaceIfElseWithConditional_OK_assignment() {
@@ -2614,8 +2629,8 @@
}
}
''');
- assertHasAssistAt('if (true)', AssistKind.REPLACE_IF_ELSE_WITH_CONDITIONAL,
- '''
+ assertHasAssistAt('if (true)',
+ DartAssistKind.REPLACE_IF_ELSE_WITH_CONDITIONAL, '''
main() {
int vvv;
vvv = true ? 111 : 222;
@@ -2633,8 +2648,8 @@
}
}
''');
- assertHasAssistAt('if (true)', AssistKind.REPLACE_IF_ELSE_WITH_CONDITIONAL,
- '''
+ assertHasAssistAt('if (true)',
+ DartAssistKind.REPLACE_IF_ELSE_WITH_CONDITIONAL, '''
main() {
return true ? 111 : 222;
}
@@ -2651,7 +2666,7 @@
}
}
''');
- assertNoAssistAt('else', AssistKind.REPLACE_IF_ELSE_WITH_CONDITIONAL);
+ assertNoAssistAt('else', DartAssistKind.REPLACE_IF_ELSE_WITH_CONDITIONAL);
}
void test_replaceIfElseWithConditional_wrong_notIfStatement() {
@@ -2660,7 +2675,7 @@
print(0);
}
''');
- assertNoAssistAt('print', AssistKind.REPLACE_IF_ELSE_WITH_CONDITIONAL);
+ assertNoAssistAt('print', DartAssistKind.REPLACE_IF_ELSE_WITH_CONDITIONAL);
}
void test_replaceIfElseWithConditional_wrong_notSingleStatememt() {
@@ -2676,7 +2691,8 @@
}
}
''');
- assertNoAssistAt('if (true)', AssistKind.REPLACE_IF_ELSE_WITH_CONDITIONAL);
+ assertNoAssistAt(
+ 'if (true)', DartAssistKind.REPLACE_IF_ELSE_WITH_CONDITIONAL);
}
void test_splitAndCondition_OK_innerAndExpression() {
@@ -2687,7 +2703,7 @@
}
}
''');
- assertHasAssistAt('&& 2 == 2', AssistKind.SPLIT_AND_CONDITION, '''
+ assertHasAssistAt('&& 2 == 2', DartAssistKind.SPLIT_AND_CONDITION, '''
main() {
if (1 == 1) {
if (2 == 2 && 3 == 3) {
@@ -2709,7 +2725,7 @@
}
}
''');
- assertHasAssistAt('&& false', AssistKind.SPLIT_AND_CONDITION, '''
+ assertHasAssistAt('&& false', DartAssistKind.SPLIT_AND_CONDITION, '''
main() {
if (true) {
if (false) {
@@ -2730,7 +2746,7 @@
print(0);
}
''');
- assertHasAssistAt('&& false', AssistKind.SPLIT_AND_CONDITION, '''
+ assertHasAssistAt('&& false', DartAssistKind.SPLIT_AND_CONDITION, '''
main() {
if (true)
if (false)
@@ -2749,11 +2765,11 @@
}
''');
// not binary expression
- assertNoAssistAt('main() {', AssistKind.SPLIT_AND_CONDITION);
+ assertNoAssistAt('main() {', DartAssistKind.SPLIT_AND_CONDITION);
// selection is not empty and includes more than just operator
{
length = 5;
- assertNoAssistAt('&& 2 == 2', AssistKind.SPLIT_AND_CONDITION);
+ assertNoAssistAt('&& 2 == 2', DartAssistKind.SPLIT_AND_CONDITION);
}
}
@@ -2767,7 +2783,7 @@
}
}
''');
- assertNoAssistAt('&& 2', AssistKind.SPLIT_AND_CONDITION);
+ assertNoAssistAt('&& 2', DartAssistKind.SPLIT_AND_CONDITION);
}
void test_splitAndCondition_wrong_notAnd() {
@@ -2778,7 +2794,7 @@
}
}
''');
- assertNoAssistAt('|| 2', AssistKind.SPLIT_AND_CONDITION);
+ assertNoAssistAt('|| 2', DartAssistKind.SPLIT_AND_CONDITION);
}
void test_splitAndCondition_wrong_notPartOfIf() {
@@ -2787,7 +2803,7 @@
print(1 == 1 && 2 == 2);
}
''');
- assertNoAssistAt('&& 2', AssistKind.SPLIT_AND_CONDITION);
+ assertNoAssistAt('&& 2', DartAssistKind.SPLIT_AND_CONDITION);
}
void test_splitAndCondition_wrong_notTopLevelAnd() {
@@ -2801,8 +2817,8 @@
}
}
''');
- assertNoAssistAt('&& 2', AssistKind.SPLIT_AND_CONDITION);
- assertNoAssistAt('&& 4', AssistKind.SPLIT_AND_CONDITION);
+ assertNoAssistAt('&& 2', DartAssistKind.SPLIT_AND_CONDITION);
+ assertNoAssistAt('&& 4', DartAssistKind.SPLIT_AND_CONDITION);
}
void test_splitVariableDeclaration_OK_onName() {
@@ -2811,7 +2827,7 @@
var v = 1;
}
''');
- assertHasAssistAt('v =', AssistKind.SPLIT_VARIABLE_DECLARATION, '''
+ assertHasAssistAt('v =', DartAssistKind.SPLIT_VARIABLE_DECLARATION, '''
main() {
var v;
v = 1;
@@ -2825,7 +2841,7 @@
int v = 1;
}
''');
- assertHasAssistAt('int ', AssistKind.SPLIT_VARIABLE_DECLARATION, '''
+ assertHasAssistAt('int ', DartAssistKind.SPLIT_VARIABLE_DECLARATION, '''
main() {
int v;
v = 1;
@@ -2839,7 +2855,7 @@
var v = 1;
}
''');
- assertHasAssistAt('var ', AssistKind.SPLIT_VARIABLE_DECLARATION, '''
+ assertHasAssistAt('var ', DartAssistKind.SPLIT_VARIABLE_DECLARATION, '''
main() {
var v;
v = 1;
@@ -2853,7 +2869,7 @@
var v = 1, v2;
}
''');
- assertNoAssistAt('v = 1', AssistKind.SPLIT_VARIABLE_DECLARATION);
+ assertNoAssistAt('v = 1', DartAssistKind.SPLIT_VARIABLE_DECLARATION);
}
void test_surroundWith_block() {
@@ -2866,7 +2882,7 @@
}
''');
_setStartEndSelection();
- assertHasAssist(AssistKind.SURROUND_WITH_BLOCK, '''
+ assertHasAssist(DartAssistKind.SURROUND_WITH_BLOCK, '''
main() {
// start
{
@@ -2888,7 +2904,7 @@
}
''');
_setStartEndSelection();
- assertHasAssist(AssistKind.SURROUND_WITH_DO_WHILE, '''
+ assertHasAssist(DartAssistKind.SURROUND_WITH_DO_WHILE, '''
main() {
// start
do {
@@ -2910,7 +2926,7 @@
}
''');
_setStartEndSelection();
- assertHasAssist(AssistKind.SURROUND_WITH_FOR, '''
+ assertHasAssist(DartAssistKind.SURROUND_WITH_FOR, '''
main() {
// start
for (var v = init; condition; increment) {
@@ -2932,7 +2948,7 @@
}
''');
_setStartEndSelection();
- assertHasAssist(AssistKind.SURROUND_WITH_FOR_IN, '''
+ assertHasAssist(DartAssistKind.SURROUND_WITH_FOR_IN, '''
main() {
// start
for (var item in iterable) {
@@ -2954,7 +2970,7 @@
}
''');
_setStartEndSelection();
- assertHasAssist(AssistKind.SURROUND_WITH_IF, '''
+ assertHasAssist(DartAssistKind.SURROUND_WITH_IF, '''
main() {
// start
if (condition) {
@@ -2976,7 +2992,7 @@
}
''');
_setStartEndSelection();
- assertHasAssist(AssistKind.SURROUND_WITH_TRY_CATCH, '''
+ assertHasAssist(DartAssistKind.SURROUND_WITH_TRY_CATCH, '''
main() {
// start
try {
@@ -3000,7 +3016,7 @@
}
''');
_setStartEndSelection();
- assertHasAssist(AssistKind.SURROUND_WITH_TRY_FINALLY, '''
+ assertHasAssist(DartAssistKind.SURROUND_WITH_TRY_FINALLY, '''
main() {
// start
try {
@@ -3024,7 +3040,7 @@
}
''');
_setStartEndSelection();
- assertHasAssist(AssistKind.SURROUND_WITH_WHILE, '''
+ assertHasAssist(DartAssistKind.SURROUND_WITH_WHILE, '''
main() {
// start
while (condition) {
@@ -3040,7 +3056,8 @@
* Computes assists and verifies that there is an assist of the given kind.
*/
Assist _assertHasAssist(AssistKind kind) {
- List<Assist> assists = computeAssists(testUnit, offset, length);
+ List<Assist> assists = computeAssists(
+ plugin, context, testUnit.element.source, offset, length);
for (Assist assist in assists) {
if (assist.kind == kind) {
return assist;
diff --git a/pkg/analysis_server/test/services/correction/change_test.dart b/pkg/analysis_server/test/services/correction/change_test.dart
index 8155af2..3a551ca 100644
--- a/pkg/analysis_server/test/services/correction/change_test.dart
+++ b/pkg/analysis_server/test/services/correction/change_test.dart
@@ -7,18 +7,17 @@
import 'package:analysis_server/src/constants.dart';
import 'package:analysis_server/src/protocol_server.dart';
import 'package:analyzer/src/generated/source.dart';
+import 'package:test_reflective_loader/test_reflective_loader.dart';
import 'package:unittest/unittest.dart';
-import '../../reflective_tests.dart';
-
main() {
groupSep = ' | ';
- runReflectiveTests(ChangeTest);
- runReflectiveTests(EditTest);
- runReflectiveTests(FileEditTest);
- runReflectiveTests(LinkedEditGroupTest);
- runReflectiveTests(LinkedEditSuggestionTest);
- runReflectiveTests(PositionTest);
+ defineReflectiveTests(ChangeTest);
+ defineReflectiveTests(EditTest);
+ defineReflectiveTests(FileEditTest);
+ defineReflectiveTests(LinkedEditGroupTest);
+ defineReflectiveTests(LinkedEditSuggestionTest);
+ defineReflectiveTests(PositionTest);
}
@reflectiveTest
diff --git a/pkg/analysis_server/test/services/correction/fix_test.dart b/pkg/analysis_server/test/services/correction/fix_test.dart
index 6589220..e9e14e1 100644
--- a/pkg/analysis_server/test/services/correction/fix_test.dart
+++ b/pkg/analysis_server/test/services/correction/fix_test.dart
@@ -4,22 +4,24 @@
library test.services.correction.fix;
+import 'package:analysis_server/edit/fix/fix_core.dart';
import 'package:analysis_server/src/protocol.dart' hide AnalysisError;
import 'package:analysis_server/src/services/correction/fix.dart';
+import 'package:analysis_server/src/services/correction/fix_internal.dart';
import 'package:analyzer/file_system/file_system.dart';
import 'package:analyzer/source/package_map_resolver.dart';
import 'package:analyzer/src/generated/error.dart';
import 'package:analyzer/src/generated/parser.dart';
import 'package:analyzer/src/generated/source.dart';
+import 'package:test_reflective_loader/test_reflective_loader.dart';
import 'package:unittest/unittest.dart';
import '../../abstract_context.dart';
import '../../abstract_single_unit.dart';
-import '../../reflective_tests.dart';
main() {
groupSep = ' | ';
- runReflectiveTests(FixProcessorTest);
+ defineReflectiveTests(FixProcessorTest);
}
typedef bool AnalysisErrorFilter(AnalysisError error);
@@ -45,7 +47,7 @@
$lineWithTest
}
''');
- assertHasFix(FixKind.CREATE_FUNCTION, '''
+ assertHasFix(DartFixKind.CREATE_FUNCTION, '''
main() {
bool b = true;
$lineWithTest
@@ -70,7 +72,7 @@
void assertNoFix(FixKind kind) {
AnalysisError error = _findErrorToFix();
- List<Fix> fixes = computeFixes(testUnit, error);
+ List<Fix> fixes = _computeFixes(error);
for (Fix fix in fixes) {
if (fix.kind == kind) {
throw fail('Unexpected fix $kind in\n${fixes.join('\n')}');
@@ -112,7 +114,7 @@
Test(this.a);
}
''');
- assertHasFix(FixKind.ADD_FIELD_FORMAL_PARAMETERS, '''
+ assertHasFix(DartFixKind.ADD_FIELD_FORMAL_PARAMETERS, '''
class Test {
final int a;
final int b;
@@ -131,7 +133,7 @@
Test();
}
''');
- assertHasFix(FixKind.ADD_FIELD_FORMAL_PARAMETERS, '''
+ assertHasFix(DartFixKind.ADD_FIELD_FORMAL_PARAMETERS, '''
class Test {
final int a;
final int b;
@@ -150,7 +152,7 @@
Test([this.c]);
}
''');
- assertHasFix(FixKind.ADD_FIELD_FORMAL_PARAMETERS, '''
+ assertHasFix(DartFixKind.ADD_FIELD_FORMAL_PARAMETERS, '''
class Test {
final int a;
final int b;
@@ -160,6 +162,13 @@
''');
}
+ void test_addSync_BAD_nullFunctionBody() {
+ resolveTestUnit('''
+var F = await;
+''');
+ assertNoFix(DartFixKind.ADD_ASYNC);
+ }
+
void test_addSync_blockFunctionBody() {
resolveTestUnit('''
foo() {}
@@ -173,18 +182,18 @@
{
AnalysisError error = errors[0];
expect(error.message, "Expected to find ';'");
- List<Fix> fixes = computeFixes(testUnit, error);
+ List<Fix> fixes = _computeFixes(error);
expect(fixes, isEmpty);
}
// Undefined name 'await'
{
AnalysisError error = errors[1];
expect(error.message, "Undefined name 'await'");
- List<Fix> fixes = computeFixes(testUnit, error);
+ List<Fix> fixes = _computeFixes(error);
// has exactly one fix
expect(fixes, hasLength(1));
Fix fix = fixes[0];
- expect(fix.kind, FixKind.ADD_ASYNC);
+ expect(fix.kind, DartFixKind.ADD_ASYNC);
// apply to "file"
List<SourceFileEdit> fileEdits = fix.change.edits;
expect(fileEdits, hasLength(1));
@@ -207,7 +216,7 @@
foo() {}
main() => await foo();
''');
- assertHasFix(FixKind.ADD_ASYNC, '''
+ assertHasFix(DartFixKind.ADD_ASYNC, '''
foo() {}
main() async => await foo();
''');
@@ -219,7 +228,7 @@
boolean v;
}
''');
- assertHasFix(FixKind.REPLACE_BOOLEAN_WITH_BOOL, '''
+ assertHasFix(DartFixKind.REPLACE_BOOLEAN_WITH_BOOL, '''
main() {
bool v;
}
@@ -235,7 +244,7 @@
a.foo();
}
''');
- assertHasFix(FixKind.CHANGE_TO_STATIC_ACCESS, '''
+ assertHasFix(DartFixKind.CHANGE_TO_STATIC_ACCESS, '''
class A {
static foo() {}
}
@@ -263,7 +272,7 @@
b.foo();
}
''');
- assertHasFix(FixKind.CHANGE_TO_STATIC_ACCESS, '''
+ assertHasFix(DartFixKind.CHANGE_TO_STATIC_ACCESS, '''
import 'libB.dart';
import 'libA.dart';
main(B b) {
@@ -279,7 +288,7 @@
f.wait([]);
}
''');
- assertHasFix(FixKind.CHANGE_TO_STATIC_ACCESS, '''
+ assertHasFix(DartFixKind.CHANGE_TO_STATIC_ACCESS, '''
import 'dart:async' as pref;
main(pref.Future f) {
pref.Future.wait([]);
@@ -296,7 +305,7 @@
a.foo;
}
''');
- assertHasFix(FixKind.CHANGE_TO_STATIC_ACCESS, '''
+ assertHasFix(DartFixKind.CHANGE_TO_STATIC_ACCESS, '''
class A {
static get foo => 42;
}
@@ -324,7 +333,7 @@
b.foo;
}
''');
- assertHasFix(FixKind.CHANGE_TO_STATIC_ACCESS, '''
+ assertHasFix(DartFixKind.CHANGE_TO_STATIC_ACCESS, '''
import 'libB.dart';
import 'libA.dart';
main(B b) {
@@ -339,7 +348,7 @@
Test v = null;
}
''');
- assertHasFix(FixKind.CREATE_CLASS, '''
+ assertHasFix(DartFixKind.CREATE_CLASS, '''
main() {
Test v = null;
}
@@ -361,7 +370,7 @@
final int c;
}
''');
- assertHasFix(FixKind.CREATE_CONSTRUCTOR_FOR_FINAL_FIELDS, '''
+ assertHasFix(DartFixKind.CREATE_CONSTRUCTOR_FOR_FINAL_FIELDS, '''
class Test {
final int a;
final int b = 2;
@@ -383,7 +392,7 @@
new A(1, 2.0);
}
''');
- assertHasFix(FixKind.CREATE_CONSTRUCTOR, '''
+ assertHasFix(DartFixKind.CREATE_CONSTRUCTOR, '''
class A {
int field;
@@ -407,7 +416,7 @@
new A.named(1, 2.0);
}
''');
- assertHasFix(FixKind.CREATE_CONSTRUCTOR, '''
+ assertHasFix(DartFixKind.CREATE_CONSTRUCTOR, '''
class A {
A.named(int i, double d) {
}
@@ -427,14 +436,14 @@
final int v;
}
''');
- assertNoFix(FixKind.CREATE_CONSTRUCTOR_FOR_FINAL_FIELDS);
+ assertNoFix(DartFixKind.CREATE_CONSTRUCTOR_FOR_FINAL_FIELDS);
}
void test_createConstructorForFinalFields_topLevelField() {
resolveTestUnit('''
final int v;
''');
- assertNoFix(FixKind.CREATE_CONSTRUCTOR_FOR_FINAL_FIELDS);
+ assertNoFix(DartFixKind.CREATE_CONSTRUCTOR_FOR_FINAL_FIELDS);
}
void test_createConstructorSuperExplicit() {
@@ -446,7 +455,7 @@
B() {}
}
''');
- assertHasFix(FixKind.ADD_SUPER_CONSTRUCTOR_INVOCATION, '''
+ assertHasFix(DartFixKind.ADD_SUPER_CONSTRUCTOR_INVOCATION, '''
class A {
A(bool p1, int p2, double p3, String p4, {p5});
}
@@ -466,7 +475,7 @@
B() : field = 42 {}
}
''');
- assertHasFix(FixKind.ADD_SUPER_CONSTRUCTOR_INVOCATION, '''
+ assertHasFix(DartFixKind.ADD_SUPER_CONSTRUCTOR_INVOCATION, '''
class A {
A(int p);
}
@@ -486,7 +495,7 @@
B() {}
}
''');
- assertHasFix(FixKind.ADD_SUPER_CONSTRUCTOR_INVOCATION, '''
+ assertHasFix(DartFixKind.ADD_SUPER_CONSTRUCTOR_INVOCATION, '''
class A {
A.named(int p);
}
@@ -505,7 +514,7 @@
B() {}
}
''');
- assertNoFix(FixKind.ADD_SUPER_CONSTRUCTOR_INVOCATION);
+ assertNoFix(DartFixKind.ADD_SUPER_CONSTRUCTOR_INVOCATION);
}
void test_createConstructorSuperImplicit() {
@@ -519,7 +528,7 @@
void existingMethod() {}
}
''');
- assertHasFix(FixKind.CREATE_CONSTRUCTOR_SUPER, '''
+ assertHasFix(DartFixKind.CREATE_CONSTRUCTOR_SUPER, '''
class A {
A(p1, int p2, List<String> p3, [int p4]);
}
@@ -545,7 +554,7 @@
void existingMethod() {}
}
''');
- assertHasFix(FixKind.CREATE_CONSTRUCTOR_SUPER, '''
+ assertHasFix(DartFixKind.CREATE_CONSTRUCTOR_SUPER, '''
class A {
int _field;
A(this._field);
@@ -577,7 +586,7 @@
class C extends B {
}
''');
- assertHasFix(FixKind.CREATE_CONSTRUCTOR_SUPER, '''
+ assertHasFix(DartFixKind.CREATE_CONSTRUCTOR_SUPER, '''
import 'libB.dart';
import 'libA.dart';
class C extends B {
@@ -597,7 +606,7 @@
void existingMethod() {}
}
''');
- assertHasFix(FixKind.CREATE_CONSTRUCTOR_SUPER, '''
+ assertHasFix(DartFixKind.CREATE_CONSTRUCTOR_SUPER, '''
class A {
A.named(p1, int p2);
}
@@ -619,7 +628,7 @@
class B extends A {
}
''');
- assertNoFix(FixKind.CREATE_CONSTRUCTOR_SUPER);
+ assertNoFix(DartFixKind.CREATE_CONSTRUCTOR_SUPER);
}
void test_createField_BAD_inEnum() {
@@ -631,7 +640,7 @@
MyEnum.foo;
}
''');
- assertNoFix(FixKind.CREATE_FIELD);
+ assertNoFix(DartFixKind.CREATE_FIELD);
}
void test_createField_BAD_inSDK() {
@@ -640,7 +649,7 @@
p.foo = 1;
}
''');
- assertNoFix(FixKind.CREATE_FIELD);
+ assertNoFix(DartFixKind.CREATE_FIELD);
}
void test_createField_getter_multiLevel() {
@@ -657,7 +666,7 @@
int v = c.b.a.test;
}
''');
- assertHasFix(FixKind.CREATE_FIELD, '''
+ assertHasFix(DartFixKind.CREATE_FIELD, '''
class A {
int test;
}
@@ -681,7 +690,7 @@
int v = a.test;
}
''');
- assertHasFix(FixKind.CREATE_FIELD, '''
+ assertHasFix(DartFixKind.CREATE_FIELD, '''
class A {
int test;
}
@@ -702,7 +711,7 @@
class B {
}
''');
- assertHasFix(FixKind.CREATE_FIELD, '''
+ assertHasFix(DartFixKind.CREATE_FIELD, '''
class A {
B b;
void f(Object p) {
@@ -724,7 +733,7 @@
}
f(String s) {}
''');
- assertHasFix(FixKind.CREATE_FIELD, '''
+ assertHasFix(DartFixKind.CREATE_FIELD, '''
class A {
String test;
@@ -744,7 +753,7 @@
}
}
''');
- assertHasFix(FixKind.CREATE_FIELD, '''
+ assertHasFix(DartFixKind.CREATE_FIELD, '''
class A {
int test;
@@ -763,7 +772,7 @@
}
}
''');
- assertHasFix(FixKind.CREATE_FIELD, '''
+ assertHasFix(DartFixKind.CREATE_FIELD, '''
class A {
var test;
@@ -783,7 +792,7 @@
int v = x.test;
}
''');
- assertHasFix(FixKind.CREATE_FIELD, '''
+ assertHasFix(DartFixKind.CREATE_FIELD, '''
class A {
int test;
}
@@ -803,7 +812,7 @@
x.test = 0;
}
''');
- assertHasFix(FixKind.CREATE_FIELD, '''
+ assertHasFix(DartFixKind.CREATE_FIELD, '''
class A {
int test;
}
@@ -832,7 +841,7 @@
c.test = getA();
}
''');
- assertHasFix(FixKind.CREATE_FIELD, '''
+ assertHasFix(DartFixKind.CREATE_FIELD, '''
import 'libB.dart';
import 'libA.dart';
class C {
@@ -855,7 +864,7 @@
}
}
''');
- assertHasFix(FixKind.CREATE_FIELD, '''
+ assertHasFix(DartFixKind.CREATE_FIELD, '''
class A {
List test;
}
@@ -878,7 +887,7 @@
}
}
''');
- assertHasFix(FixKind.CREATE_FIELD, '''
+ assertHasFix(DartFixKind.CREATE_FIELD, '''
class A<T> {
List<T> items;
@@ -903,7 +912,7 @@
a.test = 5;
}
''');
- assertHasFix(FixKind.CREATE_FIELD, '''
+ assertHasFix(DartFixKind.CREATE_FIELD, '''
class A {
int aaa;
int zzz;
@@ -927,7 +936,7 @@
a.test = 5;
}
''');
- assertHasFix(FixKind.CREATE_FIELD, '''
+ assertHasFix(DartFixKind.CREATE_FIELD, '''
class A {
int test;
@@ -947,7 +956,7 @@
A.test = 5;
}
''');
- assertHasFix(FixKind.CREATE_FIELD, '''
+ assertHasFix(DartFixKind.CREATE_FIELD, '''
class A {
static int test;
}
@@ -965,7 +974,7 @@
}
}
''');
- assertHasFix(FixKind.CREATE_FIELD, '''
+ assertHasFix(DartFixKind.CREATE_FIELD, '''
class A {
int test;
@@ -984,7 +993,7 @@
}
}
''');
- assertHasFix(FixKind.CREATE_FIELD, '''
+ assertHasFix(DartFixKind.CREATE_FIELD, '''
class A {
static int test;
@@ -1001,7 +1010,7 @@
import 'my_file.dart';
''');
AnalysisError error = _findErrorToFix();
- fix = _assertHasFix(FixKind.CREATE_FILE, error);
+ fix = _assertHasFix(DartFixKind.CREATE_FILE, error);
change = fix.change;
// validate change
List<SourceFileEdit> fileEdits = change.edits;
@@ -1019,7 +1028,7 @@
part 'my_part.dart';
''');
AnalysisError error = _findErrorToFix();
- fix = _assertHasFix(FixKind.CREATE_FILE, error);
+ fix = _assertHasFix(DartFixKind.CREATE_FILE, error);
change = fix.change;
// validate change
List<SourceFileEdit> fileEdits = change.edits;
@@ -1036,7 +1045,7 @@
int v = p.foo;
}
''');
- assertNoFix(FixKind.CREATE_GETTER);
+ assertNoFix(DartFixKind.CREATE_GETTER);
}
void test_createGetter_hint_getter() {
@@ -1048,7 +1057,7 @@
int v = x.test;
}
''');
- assertHasFix(FixKind.CREATE_GETTER, '''
+ assertHasFix(DartFixKind.CREATE_GETTER, '''
class A {
int get test => null;
}
@@ -1073,7 +1082,7 @@
int v = c.b.a.test;
}
''');
- assertHasFix(FixKind.CREATE_GETTER, '''
+ assertHasFix(DartFixKind.CREATE_GETTER, '''
class A {
int get test => null;
}
@@ -1097,7 +1106,7 @@
int v = a.test;
}
''');
- assertHasFix(FixKind.CREATE_GETTER, '''
+ assertHasFix(DartFixKind.CREATE_GETTER, '''
class A {
int get test => null;
}
@@ -1118,7 +1127,7 @@
class B {
}
''');
- assertHasFix(FixKind.CREATE_GETTER, '''
+ assertHasFix(DartFixKind.CREATE_GETTER, '''
class A {
B b;
void f(Object p) {
@@ -1139,7 +1148,7 @@
a.test = 42;
}
''');
- assertNoFix(FixKind.CREATE_GETTER);
+ assertNoFix(DartFixKind.CREATE_GETTER);
}
void test_createGetter_unqualified_instance_asInvocationArgument() {
@@ -1151,7 +1160,7 @@
}
f(String s) {}
''');
- assertHasFix(FixKind.CREATE_GETTER, '''
+ assertHasFix(DartFixKind.CREATE_GETTER, '''
class A {
String get test => null;
@@ -1171,7 +1180,7 @@
}
}
''');
- assertNoFix(FixKind.CREATE_GETTER);
+ assertNoFix(DartFixKind.CREATE_GETTER);
}
void test_createGetter_unqualified_instance_assignmentRhs() {
@@ -1182,7 +1191,7 @@
}
}
''');
- assertHasFix(FixKind.CREATE_GETTER, '''
+ assertHasFix(DartFixKind.CREATE_GETTER, '''
class A {
int get test => null;
@@ -1201,7 +1210,7 @@
}
}
''');
- assertHasFix(FixKind.CREATE_GETTER, '''
+ assertHasFix(DartFixKind.CREATE_GETTER, '''
class A {
get test => null;
@@ -1220,7 +1229,7 @@
foo(bar);
}
''');
- assertHasFix(FixKind.CREATE_LOCAL_VARIABLE, '''
+ assertHasFix(DartFixKind.CREATE_LOCAL_VARIABLE, '''
typedef MY_FUNCTION(int p);
foo(MY_FUNCTION f) {}
main() {
@@ -1237,7 +1246,7 @@
foo(bar);
}
''');
- assertNoFix(FixKind.CREATE_LOCAL_VARIABLE);
+ assertNoFix(DartFixKind.CREATE_LOCAL_VARIABLE);
}
void test_createLocalVariable_read_typeAssignment() {
@@ -1246,7 +1255,7 @@
int a = test;
}
''');
- assertHasFix(FixKind.CREATE_LOCAL_VARIABLE, '''
+ assertHasFix(DartFixKind.CREATE_LOCAL_VARIABLE, '''
main() {
int test;
int a = test;
@@ -1262,7 +1271,7 @@
}
}
''');
- assertHasFix(FixKind.CREATE_LOCAL_VARIABLE, '''
+ assertHasFix(DartFixKind.CREATE_LOCAL_VARIABLE, '''
main() {
bool test;
if (!test) {
@@ -1279,13 +1288,30 @@
}
f(String p) {}
''');
- assertHasFix(FixKind.CREATE_LOCAL_VARIABLE, '''
+ assertHasFix(DartFixKind.CREATE_LOCAL_VARIABLE, '''
main() {
String test;
f(test);
}
f(String p) {}
''');
+ _assertLinkedGroup(change.linkedEditGroups[0], ['String test;']);
+ _assertLinkedGroup(change.linkedEditGroups[1], ['test;', 'test);']);
+ }
+
+ void test_createLocalVariable_read_typeInvocationTarget() {
+ resolveTestUnit('''
+main() {
+ test.add('hello');
+}
+''');
+ assertHasFix(DartFixKind.CREATE_LOCAL_VARIABLE, '''
+main() {
+ var test;
+ test.add('hello');
+}
+''');
+ _assertLinkedGroup(change.linkedEditGroups[0], ['test;', 'test.add(']);
}
void test_createLocalVariable_write_assignment() {
@@ -1294,7 +1320,7 @@
test = 42;
}
''');
- assertHasFix(FixKind.CREATE_LOCAL_VARIABLE, '''
+ assertHasFix(DartFixKind.CREATE_LOCAL_VARIABLE, '''
main() {
var test = 42;
}
@@ -1307,7 +1333,7 @@
test += 42;
}
''');
- assertHasFix(FixKind.CREATE_LOCAL_VARIABLE, '''
+ assertHasFix(DartFixKind.CREATE_LOCAL_VARIABLE, '''
main() {
int test;
test += 42;
@@ -1326,7 +1352,7 @@
class MyEmulator extends Emulator {
}
''');
- assertHasFix(FixKind.CREATE_MISSING_OVERRIDES, '''
+ assertHasFix(DartFixKind.CREATE_MISSING_OVERRIDES, '''
typedef int Binary(int left, int right);
abstract class Emulator {
@@ -1351,7 +1377,7 @@
class B extends A {
}
''');
- assertHasFix(FixKind.CREATE_MISSING_OVERRIDES, '''
+ assertHasFix(DartFixKind.CREATE_MISSING_OVERRIDES, '''
abstract class A {
forEach(int f(double p1, String p2));
}
@@ -1377,7 +1403,7 @@
class Test extends IterableMixin<int> {
}
''');
- assertHasFix(FixKind.CREATE_MISSING_OVERRIDES, '''
+ assertHasFix(DartFixKind.CREATE_MISSING_OVERRIDES, '''
class Iterator<T> {
}
@@ -1403,7 +1429,7 @@
class B extends A {
}
''');
- assertHasFix(FixKind.CREATE_MISSING_OVERRIDES, '''
+ assertHasFix(DartFixKind.CREATE_MISSING_OVERRIDES, '''
abstract class A {
get g1;
int get g2;
@@ -1431,7 +1457,7 @@
class B extends A {
}
''');
- assertHasFix(FixKind.CREATE_MISSING_OVERRIDES, '''
+ assertHasFix(DartFixKind.CREATE_MISSING_OVERRIDES, '''
import 'dart:async' as aaa;
abstract class A {
Map<aaa.Future, List<aaa.Future>> g(aaa.Future p);
@@ -1457,7 +1483,7 @@
class B implements A {
}
''');
- assertHasFix(FixKind.CREATE_MISSING_OVERRIDES, '''
+ assertHasFix(DartFixKind.CREATE_MISSING_OVERRIDES, '''
class A {
int ma;
void mb() {}
@@ -1533,7 +1559,7 @@
}
}
''';
- assertHasFix(FixKind.CREATE_MISSING_OVERRIDES, expectedCode);
+ assertHasFix(DartFixKind.CREATE_MISSING_OVERRIDES, expectedCode);
// end position should be on "m1", not on "m2", "m3", etc
{
Position endPosition = change.selection;
@@ -1560,7 +1586,7 @@
class B extends A {
}
''');
- assertHasFix(FixKind.CREATE_MISSING_OVERRIDES, '''
+ assertHasFix(DartFixKind.CREATE_MISSING_OVERRIDES, '''
abstract class A {
int operator [](int index);
void operator []=(int index, String value);
@@ -1591,7 +1617,7 @@
class B extends A {
}
''');
- assertHasFix(FixKind.CREATE_MISSING_OVERRIDES, '''
+ assertHasFix(DartFixKind.CREATE_MISSING_OVERRIDES, '''
abstract class A {
set s1(x);
set s2(int x);
@@ -1628,7 +1654,7 @@
existing() {}
}
''');
- assertHasFix(FixKind.CREATE_NO_SUCH_METHOD, '''
+ assertHasFix(DartFixKind.CREATE_NO_SUCH_METHOD, '''
abstract class A {
m1();
int m2();
@@ -1655,7 +1681,7 @@
int v = a.test;
}
''');
- assertHasFix(FixKind.CREATE_GETTER, '''
+ assertHasFix(DartFixKind.CREATE_GETTER, '''
class A {
int existingField;
@@ -1685,7 +1711,7 @@
a..ma().useFunction(test);
}
''');
- assertHasFix(FixKind.CREATE_FUNCTION, '''
+ assertHasFix(DartFixKind.CREATE_FUNCTION, '''
class A {
B ma() => null;
}
@@ -1710,7 +1736,7 @@
}
useFunction({Function g}) {}
''');
- assertHasFix(FixKind.CREATE_FUNCTION, '''
+ assertHasFix(DartFixKind.CREATE_FUNCTION, '''
main() {
useFunction(g: test);
}
@@ -1728,7 +1754,7 @@
}
useFunction(int g(a, b)) {}
''');
- assertHasFix(FixKind.CREATE_FUNCTION, '''
+ assertHasFix(DartFixKind.CREATE_FUNCTION, '''
main() {
useFunction(test);
}
@@ -1746,7 +1772,7 @@
}
useFunction(int g(double a, String b)) {}
''');
- assertHasFix(FixKind.CREATE_FUNCTION, '''
+ assertHasFix(DartFixKind.CREATE_FUNCTION, '''
main() {
useFunction(test);
}
@@ -1764,7 +1790,7 @@
}
useFunction({int g(double a, String b)}) {}
''');
- assertHasFix(FixKind.CREATE_FUNCTION, '''
+ assertHasFix(DartFixKind.CREATE_FUNCTION, '''
main() {
useFunction(g: test);
}
@@ -1791,7 +1817,7 @@
useFunction(test);
}
''');
- assertHasFix(FixKind.CREATE_FUNCTION, '''
+ assertHasFix(DartFixKind.CREATE_FUNCTION, '''
import 'libB.dart';
import 'libA.dart';
main() {
@@ -1812,7 +1838,7 @@
}
useFunction(int g(double a, String b)) {}
''');
- assertHasFix(FixKind.CREATE_METHOD, '''
+ assertHasFix(DartFixKind.CREATE_METHOD, '''
class A {
static foo() {
useFunction(test);
@@ -1833,7 +1859,7 @@
}
useFunction(int g(double a, String b)) {}
''');
- assertHasFix(FixKind.CREATE_METHOD, '''
+ assertHasFix(DartFixKind.CREATE_METHOD, '''
class A {
var f;
A() : f = useFunction(test);
@@ -1854,7 +1880,7 @@
}
useFunction(int g(double a, String b)) {}
''');
- assertHasFix(FixKind.CREATE_METHOD, '''
+ assertHasFix(DartFixKind.CREATE_METHOD, '''
main(A a) {
useFunction(a.test);
}
@@ -1876,7 +1902,7 @@
}
useFunction(int g(double a, String b)) {}
''');
- assertHasFix(FixKind.CREATE_METHOD, '''
+ assertHasFix(DartFixKind.CREATE_METHOD, '''
main(A a) {
useFunction(a.test);
}
@@ -1898,8 +1924,8 @@
typedef A();
useFunction(g) {}
''');
- assertNoFix(FixKind.CREATE_METHOD);
- assertNoFix(FixKind.CREATE_FUNCTION);
+ assertNoFix(DartFixKind.CREATE_METHOD);
+ assertNoFix(DartFixKind.CREATE_FUNCTION);
}
void test_creationFunction_forFunctionType_unknownTarget() {
@@ -1911,7 +1937,7 @@
}
useFunction(g) {}
''');
- assertNoFix(FixKind.CREATE_METHOD);
+ assertNoFix(DartFixKind.CREATE_METHOD);
}
void test_expectedToken_semicolon() {
@@ -1920,7 +1946,7 @@
print(0)
}
''');
- assertHasFix(FixKind.INSERT_SEMICOLON, '''
+ assertHasFix(DartFixKind.INSERT_SEMICOLON, '''
main() {
print(0);
}
@@ -1936,7 +1962,7 @@
int main() async {
}
''');
- assertHasFix(FixKind.REPLACE_RETURN_TYPE_FUTURE, '''
+ assertHasFix(DartFixKind.REPLACE_RETURN_TYPE_FUTURE, '''
library main;
import 'dart:async';
Future<int> main() async {
@@ -1953,7 +1979,7 @@
int main() async {
}
''');
- assertHasFix(FixKind.REPLACE_RETURN_TYPE_FUTURE, '''
+ assertHasFix(DartFixKind.REPLACE_RETURN_TYPE_FUTURE, '''
import 'dart:async' as al;
al.Future<int> main() async {
}
@@ -1969,7 +1995,7 @@
List<int> main() async {
}
''');
- assertHasFix(FixKind.REPLACE_RETURN_TYPE_FUTURE, '''
+ assertHasFix(DartFixKind.REPLACE_RETURN_TYPE_FUTURE, '''
import 'dart:async';
Future<List<int>> main() async {
}
@@ -1985,7 +2011,7 @@
void main() async {
}
''');
- assertHasFix(FixKind.REPLACE_RETURN_TYPE_FUTURE, '''
+ assertHasFix(DartFixKind.REPLACE_RETURN_TYPE_FUTURE, '''
import 'dart:async';
Future main() async {
}
@@ -2004,7 +2030,7 @@
}
''');
performAllAnalysisTasks();
- assertHasFix(FixKind.IMPORT_LIBRARY_PROJECT, '''
+ assertHasFix(DartFixKind.IMPORT_LIBRARY_PROJECT, '''
import 'package:my_pkg/my_lib.dart';
main() {
@@ -2021,7 +2047,7 @@
Future f = null;
}
''');
- assertHasFix(FixKind.IMPORT_LIBRARY_PREFIX, '''
+ assertHasFix(DartFixKind.IMPORT_LIBRARY_PREFIX, '''
import 'dart:async' as pref;
main() {
pref.Stream s = null;
@@ -2038,7 +2064,7 @@
print(PI);
}
''');
- assertHasFix(FixKind.IMPORT_LIBRARY_PREFIX, '''
+ assertHasFix(DartFixKind.IMPORT_LIBRARY_PREFIX, '''
import 'dart:math' as pref;
main() {
print(pref.E);
@@ -2060,7 +2086,7 @@
}
''');
performAllAnalysisTasks();
- assertHasFix(FixKind.IMPORT_LIBRARY_PROJECT, '''
+ assertHasFix(DartFixKind.IMPORT_LIBRARY_PROJECT, '''
import 'lib.dart';
@Test(0)
@@ -2081,7 +2107,7 @@
}
''');
performAllAnalysisTasks();
- assertHasFix(FixKind.IMPORT_LIBRARY_PROJECT, '''
+ assertHasFix(DartFixKind.IMPORT_LIBRARY_PROJECT, '''
import '../lib.dart';
main() {
@@ -2102,7 +2128,7 @@
}
''');
performAllAnalysisTasks();
- assertHasFix(FixKind.IMPORT_LIBRARY_PROJECT, '''
+ assertHasFix(DartFixKind.IMPORT_LIBRARY_PROJECT, '''
import '../lib/sub/folder/lib.dart';
main() {
@@ -2123,7 +2149,7 @@
}
''');
performAllAnalysisTasks();
- assertHasFix(FixKind.IMPORT_LIBRARY_PROJECT, '''
+ assertHasFix(DartFixKind.IMPORT_LIBRARY_PROJECT, '''
import 'lib.dart';
main() {
@@ -2143,7 +2169,7 @@
}
''');
performAllAnalysisTasks();
- assertHasFix(FixKind.IMPORT_LIBRARY_PROJECT, '''
+ assertHasFix(DartFixKind.IMPORT_LIBRARY_PROJECT, '''
import 'lib.dart';
main() {
@@ -2165,7 +2191,7 @@
}
''');
performAllAnalysisTasks();
- assertHasFix(FixKind.IMPORT_LIBRARY_PROJECT, '''
+ assertHasFix(DartFixKind.IMPORT_LIBRARY_PROJECT, '''
import 'lib.dart';
class A {
@@ -2188,7 +2214,7 @@
}
''');
performAllAnalysisTasks();
- assertHasFix(FixKind.IMPORT_LIBRARY_PROJECT, '''
+ assertHasFix(DartFixKind.IMPORT_LIBRARY_PROJECT, '''
import 'lib.dart';
main() {
@@ -2208,7 +2234,7 @@
}
''');
performAllAnalysisTasks();
- assertHasFix(FixKind.IMPORT_LIBRARY_PROJECT, '''
+ assertHasFix(DartFixKind.IMPORT_LIBRARY_PROJECT, '''
import 'lib.dart';
main() {
@@ -2223,7 +2249,7 @@
p as Future;
}
''');
- assertHasFix(FixKind.IMPORT_LIBRARY_SDK, '''
+ assertHasFix(DartFixKind.IMPORT_LIBRARY_SDK, '''
import 'dart:async';
main(p) {
@@ -2238,7 +2264,7 @@
Future.wait(null);
}
''');
- assertHasFix(FixKind.IMPORT_LIBRARY_SDK, '''
+ assertHasFix(DartFixKind.IMPORT_LIBRARY_SDK, '''
import 'dart:async';
main() {
@@ -2253,7 +2279,7 @@
p is Future;
}
''');
- assertHasFix(FixKind.IMPORT_LIBRARY_SDK, '''
+ assertHasFix(DartFixKind.IMPORT_LIBRARY_SDK, '''
import 'dart:async';
main(p) {
@@ -2268,7 +2294,7 @@
Future f = null;
}
''');
- assertHasFix(FixKind.IMPORT_LIBRARY_SDK, '''
+ assertHasFix(DartFixKind.IMPORT_LIBRARY_SDK, '''
import 'dart:async';
main() {
@@ -2283,7 +2309,7 @@
Future.wait;
}
''');
- assertHasFix(FixKind.IMPORT_LIBRARY_SDK, '''
+ assertHasFix(DartFixKind.IMPORT_LIBRARY_SDK, '''
import 'dart:async';
main() {
@@ -2298,7 +2324,7 @@
List<Future> futures = [];
}
''');
- assertHasFix(FixKind.IMPORT_LIBRARY_SDK, '''
+ assertHasFix(DartFixKind.IMPORT_LIBRARY_SDK, '''
import 'dart:async';
main() {
@@ -2314,7 +2340,7 @@
}
''');
performAllAnalysisTasks();
- assertHasFix(FixKind.IMPORT_LIBRARY_SDK, '''
+ assertHasFix(DartFixKind.IMPORT_LIBRARY_SDK, '''
import 'dart:math';
main() {
@@ -2330,7 +2356,7 @@
}
''');
performAllAnalysisTasks();
- assertHasFix(FixKind.IMPORT_LIBRARY_SDK, '''
+ assertHasFix(DartFixKind.IMPORT_LIBRARY_SDK, '''
import 'dart:math';
@PI
@@ -2347,7 +2373,7 @@
Future f = null;
}
''');
- assertHasFix(FixKind.IMPORT_LIBRARY_SHOW, '''
+ assertHasFix(DartFixKind.IMPORT_LIBRARY_SHOW, '''
import 'dart:async' show Future, Stream;
main() {
Stream s = null;
@@ -2362,7 +2388,7 @@
p is! Null;
}
''');
- assertHasFix(FixKind.USE_NOT_EQ_NULL, '''
+ assertHasFix(DartFixKind.USE_NOT_EQ_NULL, '''
main(p) {
p != null;
}
@@ -2375,7 +2401,7 @@
p is Null;
}
''');
- assertHasFix(FixKind.USE_EQ_EQ_NULL, '''
+ assertHasFix(DartFixKind.USE_EQ_EQ_NULL, '''
main(p) {
p == null;
}
@@ -2388,7 +2414,7 @@
m();
}
''');
- assertHasFix(FixKind.MAKE_CLASS_ABSTRACT, '''
+ assertHasFix(DartFixKind.MAKE_CLASS_ABSTRACT, '''
abstract class A {
m();
}
@@ -2403,7 +2429,7 @@
class B extends A {
}
''');
- assertHasFix(FixKind.MAKE_CLASS_ABSTRACT, '''
+ assertHasFix(DartFixKind.MAKE_CLASS_ABSTRACT, '''
abstract class A {
m();
}
@@ -2419,17 +2445,67 @@
}''');
List<AnalysisError> errors = context.computeErrors(testSource);
for (var error in errors) {
- computeFixes(testUnit, error);
+ _computeFixes(error);
}
}
+ void test_removeDeadCode_condition() {
+ resolveTestUnit('''
+main(int p) {
+ if (true || p > 5) {
+ print(1);
+ }
+}
+''');
+ assertHasFix(DartFixKind.REMOVE_DEAD_CODE, '''
+main(int p) {
+ if (true) {
+ print(1);
+ }
+}
+''');
+ }
+
+ void test_removeDeadCode_statements_one() {
+ resolveTestUnit('''
+int main() {
+ print(0);
+ return 42;
+ print(1);
+}
+''');
+ assertHasFix(DartFixKind.REMOVE_DEAD_CODE, '''
+int main() {
+ print(0);
+ return 42;
+}
+''');
+ }
+
+ void test_removeDeadCode_statements_two() {
+ resolveTestUnit('''
+int main() {
+ print(0);
+ return 42;
+ print(1);
+ print(2);
+}
+''');
+ assertHasFix(DartFixKind.REMOVE_DEAD_CODE, '''
+int main() {
+ print(0);
+ return 42;
+}
+''');
+ }
+
void test_removeParentheses_inGetterDeclaration() {
resolveTestUnit('''
class A {
int get foo() => 0;
}
''');
- assertHasFix(FixKind.REMOVE_PARAMETERS_IN_GETTER_DECLARATION, '''
+ assertHasFix(DartFixKind.REMOVE_PARAMETERS_IN_GETTER_DECLARATION, '''
class A {
int get foo => 0;
}
@@ -2445,7 +2521,7 @@
a.foo();
}
''');
- assertHasFix(FixKind.REMOVE_PARENTHESIS_IN_GETTER_INVOCATION, '''
+ assertHasFix(DartFixKind.REMOVE_PARENTHESIS_IN_GETTER_INVOCATION, '''
class A {
int get foo => 0;
}
@@ -2463,7 +2539,7 @@
}
}
''');
- assertHasFix(FixKind.REMOVE_UNNECASSARY_CAST, '''
+ assertHasFix(DartFixKind.REMOVE_UNNECASSARY_CAST, '''
main(Object p) {
if (p is String) {
String v = p;
@@ -2482,7 +2558,7 @@
}
}
''');
- assertHasFix(FixKind.REMOVE_UNUSED_CATCH_CLAUSE, '''
+ assertHasFix(DartFixKind.REMOVE_UNUSED_CATCH_CLAUSE, '''
main() {
try {
throw 42;
@@ -2502,7 +2578,7 @@
}
}
''');
- assertHasFix(FixKind.REMOVE_UNUSED_CATCH_STACK, '''
+ assertHasFix(DartFixKind.REMOVE_UNUSED_CATCH_STACK, '''
main() {
try {
throw 42;
@@ -2518,7 +2594,7 @@
main() {
}
''');
- assertHasFix(FixKind.REMOVE_UNUSED_IMPORT, '''
+ assertHasFix(DartFixKind.REMOVE_UNUSED_IMPORT, '''
main() {
}
''');
@@ -2532,7 +2608,7 @@
Future f;
}
''');
- assertHasFix(FixKind.REMOVE_UNUSED_IMPORT, '''
+ assertHasFix(DartFixKind.REMOVE_UNUSED_IMPORT, '''
import 'dart:async';
main() {
@@ -2548,7 +2624,7 @@
main() {
}
''');
- assertHasFix(FixKind.REMOVE_UNUSED_IMPORT, '''
+ assertHasFix(DartFixKind.REMOVE_UNUSED_IMPORT, '''
main() {
}
''');
@@ -2561,7 +2637,7 @@
import 'no/matter/lib.dart';
''');
performAllAnalysisTasks();
- assertHasFix(FixKind.REPLACE_IMPORT_URI, '''
+ assertHasFix(DartFixKind.REPLACE_IMPORT_URI, '''
import '../foo/bar/lib.dart';
''');
}
@@ -2572,7 +2648,7 @@
import 'no/matter/my_lib.dart';
''');
performAllAnalysisTasks();
- assertHasFix(FixKind.REPLACE_IMPORT_URI, '''
+ assertHasFix(DartFixKind.REPLACE_IMPORT_URI, '''
import 'package:my_pkg/my_lib.dart';
''');
}
@@ -2586,7 +2662,7 @@
Map<String, var> m;
}
''');
- assertHasFix(FixKind.REPLACE_VAR_WITH_DYNAMIC, '''
+ assertHasFix(DartFixKind.REPLACE_VAR_WITH_DYNAMIC, '''
class A {
Map<String, dynamic> m;
}
@@ -2600,7 +2676,7 @@
}
const a = new A();
''');
- assertHasFix(FixKind.USE_CONST, '''
+ assertHasFix(DartFixKind.USE_CONST, '''
class A {
const A();
}
@@ -2614,7 +2690,7 @@
Stirng s = 'abc';
}
''');
- assertHasFix(FixKind.CHANGE_TO, '''
+ assertHasFix(DartFixKind.CHANGE_TO, '''
main() {
String s = 'abc';
}
@@ -2628,7 +2704,7 @@
MyCalss v = null;
}
''');
- assertHasFix(FixKind.CHANGE_TO, '''
+ assertHasFix(DartFixKind.CHANGE_TO, '''
class MyClass {}
main() {
MyClass v = null;
@@ -2643,7 +2719,7 @@
test(v);
}
''');
- assertHasFix(FixKind.CREATE_FUNCTION, '''
+ assertHasFix(DartFixKind.CREATE_FUNCTION, '''
main() {
dynamic v;
test(v);
@@ -2660,7 +2736,7 @@
dynamic v = test();
}
''');
- assertHasFix(FixKind.CREATE_FUNCTION, '''
+ assertHasFix(DartFixKind.CREATE_FUNCTION, '''
main() {
dynamic v = test();
}
@@ -2676,7 +2752,7 @@
int v = myUndefinedFunction(1, 2.0, '3');
}
''');
- assertHasFix(FixKind.CREATE_FUNCTION, '''
+ assertHasFix(DartFixKind.CREATE_FUNCTION, '''
main() {
int v = myUndefinedFunction(1, 2.0, '3');
}
@@ -2694,7 +2770,7 @@
}
}
''');
- assertHasFix(FixKind.CREATE_FUNCTION, '''
+ assertHasFix(DartFixKind.CREATE_FUNCTION, '''
class A {
main() {
int v = myUndefinedFunction(1, 2.0, '3');
@@ -2715,7 +2791,7 @@
}
}
''');
- assertHasFix(FixKind.CREATE_FUNCTION, '''
+ assertHasFix(DartFixKind.CREATE_FUNCTION, '''
class A<T> {
Map<int, T> items;
main() {
@@ -2737,7 +2813,7 @@
}
}
''');
- assertHasFix(FixKind.CREATE_FUNCTION, '''
+ assertHasFix(DartFixKind.CREATE_FUNCTION, '''
class A {
List<int> items;
main() {
@@ -2762,7 +2838,7 @@
test(getFuture());
}
''');
- assertHasFix(FixKind.CREATE_FUNCTION, '''
+ assertHasFix(DartFixKind.CREATE_FUNCTION, '''
import 'lib.dart';
import 'dart:async';
main() {
@@ -2780,7 +2856,7 @@
test(null);
}
''');
- assertHasFix(FixKind.CREATE_FUNCTION, '''
+ assertHasFix(DartFixKind.CREATE_FUNCTION, '''
main() {
test(null);
}
@@ -2812,7 +2888,7 @@
v = myUndefinedFunction();
}
''');
- assertHasFix(FixKind.CREATE_FUNCTION, '''
+ assertHasFix(DartFixKind.CREATE_FUNCTION, '''
main() {
int v;
v = myUndefinedFunction();
@@ -2830,7 +2906,7 @@
v += myUndefinedFunction();
}
''');
- assertHasFix(FixKind.CREATE_FUNCTION, '''
+ assertHasFix(DartFixKind.CREATE_FUNCTION, '''
main() {
int v;
v += myUndefinedFunction();
@@ -2847,7 +2923,7 @@
0 + myUndefinedFunction();
}
''');
- assertHasFix(FixKind.CREATE_FUNCTION, '''
+ assertHasFix(DartFixKind.CREATE_FUNCTION, '''
main() {
0 + myUndefinedFunction();
}
@@ -2863,7 +2939,7 @@
int v = myUndefinedFunction();
}
''');
- assertHasFix(FixKind.CREATE_FUNCTION, '''
+ assertHasFix(DartFixKind.CREATE_FUNCTION, '''
main() {
int v = myUndefinedFunction();
}
@@ -2880,7 +2956,7 @@
foo( myUndefinedFunction() );
}
''');
- assertHasFix(FixKind.CREATE_FUNCTION, '''
+ assertHasFix(DartFixKind.CREATE_FUNCTION, '''
foo(int p) {}
main() {
foo( myUndefinedFunction() );
@@ -2897,7 +2973,7 @@
return myUndefinedFunction();
}
''');
- assertHasFix(FixKind.CREATE_FUNCTION, '''
+ assertHasFix(DartFixKind.CREATE_FUNCTION, '''
int main() {
return myUndefinedFunction();
}
@@ -2913,7 +2989,7 @@
myUndefinedFunction();
}
''');
- assertHasFix(FixKind.CREATE_FUNCTION, '''
+ assertHasFix(DartFixKind.CREATE_FUNCTION, '''
main() {
myUndefinedFunction();
}
@@ -2929,7 +3005,7 @@
pritn(0);
}
''');
- assertHasFix(FixKind.CHANGE_TO, '''
+ assertHasFix(DartFixKind.CHANGE_TO, '''
main() {
print(0);
}
@@ -2943,7 +3019,7 @@
myFuntcion();
}
''');
- assertHasFix(FixKind.CHANGE_TO, '''
+ assertHasFix(DartFixKind.CHANGE_TO, '''
myFunction() {}
main() {
myFunction();
@@ -2961,7 +3037,7 @@
print(x.myFild);
}
''');
- assertHasFix(FixKind.CHANGE_TO, '''
+ assertHasFix(DartFixKind.CHANGE_TO, '''
class A {
int myField;
}
@@ -2981,7 +3057,7 @@
print(a.myFild);
}
''');
- assertHasFix(FixKind.CHANGE_TO, '''
+ assertHasFix(DartFixKind.CHANGE_TO, '''
class A {
int myField;
}
@@ -3000,7 +3076,7 @@
A.MY_NAM;
}
''');
- assertHasFix(FixKind.CHANGE_TO, '''
+ assertHasFix(DartFixKind.CHANGE_TO, '''
class A {
static int MY_NAME = 1;
}
@@ -3019,7 +3095,7 @@
}
}
''');
- assertHasFix(FixKind.CHANGE_TO, '''
+ assertHasFix(DartFixKind.CHANGE_TO, '''
class A {
int myField;
main() {
@@ -3035,7 +3111,7 @@
List.foo();
}
''');
- assertNoFix(FixKind.CREATE_METHOD);
+ assertNoFix(DartFixKind.CREATE_METHOD);
}
void test_undefinedMethod_create_generic_BAD() {
@@ -3051,7 +3127,7 @@
class B {
}
''');
- assertHasFix(FixKind.CREATE_METHOD, '''
+ assertHasFix(DartFixKind.CREATE_METHOD, '''
class A<T> {
B b;
Map<int, T> items;
@@ -3080,7 +3156,7 @@
class B {
}
''');
- assertHasFix(FixKind.CREATE_METHOD, '''
+ assertHasFix(DartFixKind.CREATE_METHOD, '''
class A {
B b;
List<int> items;
@@ -3105,7 +3181,7 @@
}
}
''');
- assertHasFix(FixKind.CREATE_METHOD, '''
+ assertHasFix(DartFixKind.CREATE_METHOD, '''
class A<T> {
List<T> items;
main() {
@@ -3126,7 +3202,7 @@
A.myUndefinedMethod();
}
''');
- assertHasFix(FixKind.CREATE_METHOD, '''
+ assertHasFix(DartFixKind.CREATE_METHOD, '''
class A {
static void myUndefinedMethod() {
}
@@ -3146,7 +3222,7 @@
A.myUndefinedMethod();
}
''');
- assertHasFix(FixKind.CREATE_METHOD, '''
+ assertHasFix(DartFixKind.CREATE_METHOD, '''
class A {
foo() {}
@@ -3167,7 +3243,7 @@
a.myUndefinedMethod();
}
''');
- assertHasFix(FixKind.CREATE_METHOD, '''
+ assertHasFix(DartFixKind.CREATE_METHOD, '''
class A {
void myUndefinedMethod() {
}
@@ -3185,7 +3261,7 @@
A.myUndefinedMethod();
}
''');
- assertNoFix(FixKind.CREATE_METHOD);
+ assertNoFix(DartFixKind.CREATE_METHOD);
}
void test_undefinedMethod_createQualified_targetIsUnresolved() {
@@ -3194,7 +3270,7 @@
NoSuchClass.myUndefinedMethod();
}
''');
- assertNoFix(FixKind.CREATE_METHOD);
+ assertNoFix(DartFixKind.CREATE_METHOD);
}
void test_undefinedMethod_createUnqualified_parameters() {
@@ -3205,7 +3281,7 @@
}
}
''');
- assertHasFix(FixKind.CREATE_METHOD, '''
+ assertHasFix(DartFixKind.CREATE_METHOD, '''
class A {
main() {
myUndefinedMethod(0, 1.0, '3');
@@ -3250,7 +3326,7 @@
}
}
''');
- assertHasFix(FixKind.CREATE_METHOD, '''
+ assertHasFix(DartFixKind.CREATE_METHOD, '''
class A {
main() {
int v = myUndefinedMethod();
@@ -3274,7 +3350,7 @@
static var f = myUndefinedMethod();
}
''');
- assertHasFix(FixKind.CREATE_METHOD, '''
+ assertHasFix(DartFixKind.CREATE_METHOD, '''
class A {
static var f = myUndefinedMethod();
@@ -3292,7 +3368,7 @@
}
}
''');
- assertHasFix(FixKind.CREATE_METHOD, '''
+ assertHasFix(DartFixKind.CREATE_METHOD, '''
class A {
static main() {
myUndefinedMethod();
@@ -3313,7 +3389,7 @@
a.myUndefinedMethod();
}
''');
- assertHasFix(FixKind.CREATE_METHOD, '''
+ assertHasFix(DartFixKind.CREATE_METHOD, '''
class A {
void myUndefinedMethod() {
}
@@ -3331,7 +3407,7 @@
object.then();
}
''');
- assertNoFix(FixKind.CHANGE_TO);
+ assertNoFix(DartFixKind.CHANGE_TO);
}
void test_undefinedMethod_useSimilar_qualified() {
@@ -3344,7 +3420,7 @@
a.myMehtod();
}
''');
- assertHasFix(FixKind.CHANGE_TO, '''
+ assertHasFix(DartFixKind.CHANGE_TO, '''
class A {
myMethod() {}
}
@@ -3366,7 +3442,7 @@
}
}
''');
- assertHasFix(FixKind.CHANGE_TO, '''
+ assertHasFix(DartFixKind.CHANGE_TO, '''
class A {
myMethod() {}
}
@@ -3387,7 +3463,7 @@
}
}
''');
- assertHasFix(FixKind.CHANGE_TO, '''
+ assertHasFix(DartFixKind.CHANGE_TO, '''
class A {
myMethod() {}
main() {
@@ -3407,7 +3483,7 @@
x.myFild = 42;
}
''');
- assertHasFix(FixKind.CHANGE_TO, '''
+ assertHasFix(DartFixKind.CHANGE_TO, '''
class A {
int myField;
}
@@ -3427,7 +3503,7 @@
a.myFild = 42;
}
''');
- assertHasFix(FixKind.CHANGE_TO, '''
+ assertHasFix(DartFixKind.CHANGE_TO, '''
class A {
int myField;
}
@@ -3446,7 +3522,7 @@
}
}
''');
- assertHasFix(FixKind.CHANGE_TO, '''
+ assertHasFix(DartFixKind.CHANGE_TO, '''
class A {
int myField;
main() {
@@ -3464,7 +3540,7 @@
print((a / b).toInt());
}
''');
- assertHasFix(FixKind.USE_EFFECTIVE_INTEGER_DIVISION, '''
+ assertHasFix(DartFixKind.USE_EFFECTIVE_INTEGER_DIVISION, '''
main() {
var a = 5;
var b = 2;
@@ -3477,7 +3553,7 @@
* Computes fixes and verifies that there is a fix of the given kind.
*/
Fix _assertHasFix(FixKind kind, AnalysisError error) {
- List<Fix> fixes = computeFixes(testUnit, error);
+ List<Fix> fixes = _computeFixes(error);
for (Fix fix in fixes) {
if (fix.kind == kind) {
return fix;
@@ -3496,6 +3572,14 @@
}
/**
+ * Computes fixes for the given [error] in [testUnit].
+ */
+ List<Fix> _computeFixes(AnalysisError error) {
+ FixProcessor processor = new FixProcessor(testUnit, error);
+ return processor.compute();
+ }
+
+ /**
* Configures the [SourceFactory] to have the `my_pkg` package in
* `/packages/my_pkg/lib` folder.
*/
diff --git a/pkg/analysis_server/test/services/correction/levenshtein_test.dart b/pkg/analysis_server/test/services/correction/levenshtein_test.dart
index ecda77c..bf5d6e5 100644
--- a/pkg/analysis_server/test/services/correction/levenshtein_test.dart
+++ b/pkg/analysis_server/test/services/correction/levenshtein_test.dart
@@ -5,13 +5,12 @@
library test.services.correction.levenshtein;
import 'package:analysis_server/src/services/correction/levenshtein.dart';
+import 'package:test_reflective_loader/test_reflective_loader.dart';
import 'package:unittest/unittest.dart';
-import '../../reflective_tests.dart';
-
main() {
groupSep = ' | ';
- runReflectiveTests(LevenshteinTest);
+ defineReflectiveTests(LevenshteinTest);
}
@reflectiveTest
diff --git a/pkg/analysis_server/test/services/correction/name_suggestion_test.dart b/pkg/analysis_server/test/services/correction/name_suggestion_test.dart
index a383efb..e7aa554 100644
--- a/pkg/analysis_server/test/services/correction/name_suggestion_test.dart
+++ b/pkg/analysis_server/test/services/correction/name_suggestion_test.dart
@@ -7,14 +7,14 @@
import 'package:analysis_server/src/services/correction/name_suggestion.dart';
import 'package:analyzer/src/generated/ast.dart';
import 'package:analyzer/src/generated/element.dart';
+import 'package:test_reflective_loader/test_reflective_loader.dart';
import 'package:unittest/unittest.dart';
import '../../abstract_single_unit.dart';
-import '../../reflective_tests.dart';
main() {
groupSep = ' | ';
- runReflectiveTests(VariableNameSuggestionTest);
+ defineReflectiveTests(VariableNameSuggestionTest);
}
@reflectiveTest
diff --git a/pkg/analysis_server/test/services/correction/sort_members_test.dart b/pkg/analysis_server/test/services/correction/sort_members_test.dart
index 46ff0d7..02db5b7 100644
--- a/pkg/analysis_server/test/services/correction/sort_members_test.dart
+++ b/pkg/analysis_server/test/services/correction/sort_members_test.dart
@@ -6,14 +6,14 @@
import 'package:analysis_server/src/protocol.dart';
import 'package:analysis_server/src/services/correction/sort_members.dart';
+import 'package:test_reflective_loader/test_reflective_loader.dart';
import 'package:unittest/unittest.dart';
import '../../abstract_single_unit.dart';
-import '../../reflective_tests.dart';
main() {
groupSep = ' | ';
- runReflectiveTests(SortMembersTest);
+ defineReflectiveTests(SortMembersTest);
}
@reflectiveTest
diff --git a/pkg/analysis_server/test/services/correction/source_range_test.dart b/pkg/analysis_server/test/services/correction/source_range_test.dart
index 8b501bf..41bb641 100644
--- a/pkg/analysis_server/test/services/correction/source_range_test.dart
+++ b/pkg/analysis_server/test/services/correction/source_range_test.dart
@@ -10,14 +10,14 @@
import 'package:analyzer/src/generated/error.dart';
import 'package:analyzer/src/generated/parser.dart';
import 'package:analyzer/src/generated/source.dart';
+import 'package:test_reflective_loader/test_reflective_loader.dart';
import 'package:unittest/unittest.dart';
import '../../abstract_single_unit.dart';
-import '../../reflective_tests.dart';
main() {
groupSep = ' | ';
- runReflectiveTests(SourceRangesTest);
+ defineReflectiveTests(SourceRangesTest);
}
@reflectiveTest
diff --git a/pkg/analysis_server/test/services/correction/status_test.dart b/pkg/analysis_server/test/services/correction/status_test.dart
index 66bcd6d..9620aee 100644
--- a/pkg/analysis_server/test/services/correction/status_test.dart
+++ b/pkg/analysis_server/test/services/correction/status_test.dart
@@ -11,15 +11,15 @@
import 'package:analyzer/src/generated/ast.dart';
import 'package:analyzer/src/generated/element.dart';
import 'package:analyzer/src/generated/source.dart';
+import 'package:test_reflective_loader/test_reflective_loader.dart';
import 'package:unittest/unittest.dart';
import '../../abstract_single_unit.dart';
-import '../../reflective_tests.dart';
main() {
groupSep = ' | ';
- runReflectiveTests(RefactoringLocationTest);
- runReflectiveTests(RefactoringStatusTest);
+ defineReflectiveTests(RefactoringLocationTest);
+ defineReflectiveTests(RefactoringStatusTest);
}
@reflectiveTest
diff --git a/pkg/analysis_server/test/services/correction/strings_test.dart b/pkg/analysis_server/test/services/correction/strings_test.dart
index a2b263e..5f78332 100644
--- a/pkg/analysis_server/test/services/correction/strings_test.dart
+++ b/pkg/analysis_server/test/services/correction/strings_test.dart
@@ -5,13 +5,12 @@
library test.services.correction.strings;
import 'package:analysis_server/src/services/correction/strings.dart';
+import 'package:test_reflective_loader/test_reflective_loader.dart';
import 'package:unittest/unittest.dart' hide isEmpty;
-import '../../reflective_tests.dart';
-
main() {
groupSep = ' | ';
- runReflectiveTests(StringsTest);
+ defineReflectiveTests(StringsTest);
}
@reflectiveTest
diff --git a/pkg/analysis_server/test/services/dependencies/library_dependencies_test.dart b/pkg/analysis_server/test/services/dependencies/library_dependencies_test.dart
index 3f2408e..75003c3 100644
--- a/pkg/analysis_server/test/services/dependencies/library_dependencies_test.dart
+++ b/pkg/analysis_server/test/services/dependencies/library_dependencies_test.dart
@@ -5,14 +5,14 @@
library test.services.dependencies.library;
import 'package:analysis_server/src/services/dependencies/library_dependencies.dart';
+import 'package:test_reflective_loader/test_reflective_loader.dart';
import 'package:unittest/unittest.dart';
import '../../abstract_context.dart';
-import '../../reflective_tests.dart';
main() {
groupSep = ' | ';
- runReflectiveTests(LibraryDependenciesTest);
+ defineReflectiveTests(LibraryDependenciesTest);
}
@reflectiveTest
diff --git a/pkg/analysis_server/test/services/index/dart_index_contributor_test.dart b/pkg/analysis_server/test/services/index/dart_index_contributor_test.dart
index 6cda753..38ecc46 100644
--- a/pkg/analysis_server/test/services/index/dart_index_contributor_test.dart
+++ b/pkg/analysis_server/test/services/index/dart_index_contributor_test.dart
@@ -10,21 +10,21 @@
import 'package:analyzer/src/generated/ast.dart';
import 'package:analyzer/src/generated/element.dart';
import 'package:analyzer/src/generated/source.dart';
+import 'package:test_reflective_loader/test_reflective_loader.dart';
import 'package:typed_mock/typed_mock.dart';
import 'package:unittest/unittest.dart';
import '../../abstract_single_unit.dart';
-import '../../reflective_tests.dart';
main() {
groupSep = ' | ';
- runReflectiveTests(DartUnitContributorTest);
+ defineReflectiveTests(DartUnitContributorTest);
}
/**
* Returns `true` if the [actual] location the same properties as [expected].
*/
-bool _equalsLocation(Location actual, ExpectedLocation expected) {
+bool _equalsLocation(LocationImpl actual, ExpectedLocation expected) {
return _equalsLocationProperties(actual, expected.element, expected.offset,
expected.length, expected.isQualified, expected.isResolved);
}
@@ -32,7 +32,7 @@
/**
* Returns `true` if the [actual] location the expected properties.
*/
-bool _equalsLocationProperties(Location actual, Element expectedElement,
+bool _equalsLocationProperties(LocationImpl actual, Element expectedElement,
int expectedOffset, int expectedLength, bool isQualified, bool isResolved) {
return (expectedElement == null || expectedElement == actual.element) &&
expectedOffset == actual.offset &&
@@ -42,7 +42,7 @@
}
bool _equalsRecordedRelation(RecordedRelation recordedRelation,
- Element expectedElement, Relationship expectedRelationship,
+ Element expectedElement, RelationshipImpl expectedRelationship,
ExpectedLocation expectedLocation) {
return expectedElement == recordedRelation.element &&
(expectedRelationship == null ||
@@ -53,7 +53,7 @@
@reflectiveTest
class DartUnitContributorTest extends AbstractSingleUnitTest {
- IndexStore store = new MockIndexStore();
+ InternalIndexStore store = new MockIndexStore();
List<RecordedRelation> recordedRelations = <RecordedRelation>[];
List<Element> recordedTopElements = <Element>[];
@@ -65,12 +65,14 @@
void setUp() {
super.setUp();
when(store.aboutToIndexDart(context, anyObject)).thenReturn(true);
- when(store.recordRelationship(anyObject, anyObject, anyObject)).thenInvoke(
- (Element element, Relationship relationship, Location location) {
+ when(store.recordRelationship(anyObject, anyObject, anyObject))
+ .thenInvoke((Element element, RelationshipImpl relationship,
+ LocationImpl location) {
recordedRelations
.add(new RecordedRelation(element, relationship, location));
});
- when(store.recordTopLevelDeclaration(anyObject)).thenInvoke((Element element) {
+ when(store.recordTopLevelDeclaration(anyObject))
+ .thenInvoke((Element element) {
recordedTopElements.add(element);
});
}
@@ -135,8 +137,8 @@
Element mainElement = findElement("main");
VariableElement variableElement = findElement("v");
// verify
- _assertNoRecordedRelation(variableElement,
- IndexConstants.IS_READ_BY, _expectedLocation(mainElement, 'v in []'));
+ _assertNoRecordedRelation(variableElement, IndexConstants.IS_READ_BY,
+ _expectedLocation(mainElement, 'v in []'));
}
void test_isDefinedBy_NameElement_method() {
@@ -283,8 +285,8 @@
Element mainElement = findElement("main");
Element element = findElement("v");
// verify
- _assertRecordedRelation(element,
- IndexConstants.IS_INVOKED_BY, _expectedLocation(mainElement, 'v();'));
+ _assertRecordedRelation(element, IndexConstants.IS_INVOKED_BY,
+ _expectedLocation(mainElement, 'v();'));
}
void test_isInvokedBy_MethodElement() {
@@ -398,8 +400,8 @@
Element mainElement = findElement("main");
Element element = findElement("p");
// verify
- _assertRecordedRelation(element,
- IndexConstants.IS_INVOKED_BY, _expectedLocation(mainElement, 'p();'));
+ _assertRecordedRelation(element, IndexConstants.IS_INVOKED_BY,
+ _expectedLocation(mainElement, 'p();'));
}
void test_isMixedInBy_ClassDeclaration() {
@@ -438,8 +440,8 @@
Element mainElement = findElement("main");
Element parameterElement = findElement("p");
// verify
- _assertRecordedRelation(parameterElement,
- IndexConstants.IS_READ_BY, _expectedLocation(mainElement, 'p);'));
+ _assertRecordedRelation(parameterElement, IndexConstants.IS_READ_BY,
+ _expectedLocation(mainElement, 'p);'));
}
void test_isReadBy_VariableElement() {
@@ -453,8 +455,8 @@
Element mainElement = findElement("main");
Element variableElement = findElement("v");
// verify
- _assertRecordedRelation(variableElement,
- IndexConstants.IS_READ_BY, _expectedLocation(mainElement, 'v);'));
+ _assertRecordedRelation(variableElement, IndexConstants.IS_READ_BY,
+ _expectedLocation(mainElement, 'v);'));
}
void test_isReadWrittenBy_ParameterElement() {
@@ -504,8 +506,8 @@
ParameterElement pElement = findElement("p");
VariableElement vElement = findElement("v");
// verify
- _assertRecordedRelation(aElement,
- IndexConstants.IS_REFERENCED_BY, _expectedLocation(pElement, 'A p) {'));
+ _assertRecordedRelation(aElement, IndexConstants.IS_REFERENCED_BY,
+ _expectedLocation(pElement, 'A p) {'));
_assertRecordedRelation(aElement, IndexConstants.IS_REFERENCED_BY,
_expectedLocation(vElement, 'A v;'));
_assertRecordedRelation(aElement, IndexConstants.IS_REFERENCED_BY,
@@ -529,8 +531,8 @@
ParameterElement pElement = findElement("p");
VariableElement vElement = findElement("v");
// verify
- _assertRecordedRelation(bElement,
- IndexConstants.IS_REFERENCED_BY, _expectedLocation(pElement, 'B p) {'));
+ _assertRecordedRelation(bElement, IndexConstants.IS_REFERENCED_BY,
+ _expectedLocation(pElement, 'B p) {'));
_assertRecordedRelation(bElement, IndexConstants.IS_REFERENCED_BY,
_expectedLocation(vElement, 'B v;'));
}
@@ -739,8 +741,8 @@
Element aElement = findElement('A');
Element pElement = findElement('p');
// verify
- _assertRecordedRelation(aElement,
- IndexConstants.IS_REFERENCED_BY, _expectedLocation(pElement, 'A p) {'));
+ _assertRecordedRelation(aElement, IndexConstants.IS_REFERENCED_BY,
+ _expectedLocation(pElement, 'A p) {'));
}
/**
@@ -938,8 +940,8 @@
Element mainElement = findElement('main');
Element element = findElement('L');
// verify
- _assertRecordedRelation(element,
- IndexConstants.IS_REFERENCED_BY, _expectedLocation(mainElement, 'L;'));
+ _assertRecordedRelation(element, IndexConstants.IS_REFERENCED_BY,
+ _expectedLocation(mainElement, 'L;'));
}
void test_isReferencedBy_libraryName() {
@@ -1121,8 +1123,8 @@
Element mainElement = findElement("main");
ParameterElement pElement = findElement("p");
// verify
- _assertRecordedRelation(pElement,
- IndexConstants.IS_WRITTEN_BY, _expectedLocation(mainElement, 'p = 1'));
+ _assertRecordedRelation(pElement, IndexConstants.IS_WRITTEN_BY,
+ _expectedLocation(mainElement, 'p = 1'));
}
void test_isWrittenBy_VariableElement() {
@@ -1135,8 +1137,8 @@
Element mainElement = findElement("main");
LocalVariableElement vElement = findElement("v");
// verify
- _assertRecordedRelation(vElement,
- IndexConstants.IS_WRITTEN_BY, _expectedLocation(mainElement, 'v = 1'));
+ _assertRecordedRelation(vElement, IndexConstants.IS_WRITTEN_BY,
+ _expectedLocation(mainElement, 'v = 1'));
}
void test_NameElement_field() {
@@ -1390,8 +1392,8 @@
/**
* Asserts that [recordedRelations] has no item with the specified properties.
*/
- void _assertNoRecordedRelation(
- Element element, Relationship relationship, ExpectedLocation location) {
+ void _assertNoRecordedRelation(Element element, RelationshipImpl relationship,
+ ExpectedLocation location) {
for (RecordedRelation recordedRelation in recordedRelations) {
if (_equalsRecordedRelation(
recordedRelation, element, relationship, location)) {
@@ -1404,8 +1406,9 @@
/**
* Asserts that [recordedRelations] has an item with the expected properties.
*/
- Location _assertRecordedRelation(Element expectedElement,
- Relationship expectedRelationship, ExpectedLocation expectedLocation) {
+ LocationImpl _assertRecordedRelation(Element expectedElement,
+ RelationshipImpl expectedRelationship,
+ ExpectedLocation expectedLocation) {
for (RecordedRelation recordedRelation in recordedRelations) {
if (_equalsRecordedRelation(recordedRelation, expectedElement,
expectedRelationship, expectedLocation)) {
@@ -1463,7 +1466,7 @@
}
}
-class MockIndexStore extends TypedMock implements IndexStore {
+class MockIndexStore extends TypedMock implements InternalIndexStore {
noSuchMethod(Invocation invocation) => super.noSuchMethod(invocation);
}
@@ -1472,8 +1475,8 @@
*/
class RecordedRelation {
final Element element;
- final Relationship relationship;
- final Location location;
+ final RelationshipImpl relationship;
+ final LocationImpl location;
RecordedRelation(this.element, this.relationship, this.location);
diff --git a/pkg/analysis_server/test/services/index/local_index_test.dart b/pkg/analysis_server/test/services/index/local_index_test.dart
index 52c7b2b..3faa925 100644
--- a/pkg/analysis_server/test/services/index/local_index_test.dart
+++ b/pkg/analysis_server/test/services/index/local_index_test.dart
@@ -10,15 +10,15 @@
import 'package:analyzer/src/generated/element.dart';
import 'package:analyzer/src/generated/html.dart';
import 'package:analyzer/src/generated/source_io.dart';
+import 'package:test_reflective_loader/test_reflective_loader.dart';
import 'package:unittest/unittest.dart';
import '../../abstract_context.dart';
-import '../../reflective_tests.dart';
import 'store/single_source_container.dart';
main() {
groupSep = ' | ';
- runReflectiveTests(LocalIndexTest);
+ defineReflectiveTests(LocalIndexTest);
}
void _assertElementNames(List<Element> elements, List expected) {
diff --git a/pkg/analysis_server/test/services/index/store/codec_test.dart b/pkg/analysis_server/test/services/index/store/codec_test.dart
index b02f669..7c134ed 100644
--- a/pkg/analysis_server/test/services/index/store/codec_test.dart
+++ b/pkg/analysis_server/test/services/index/store/codec_test.dart
@@ -8,18 +8,18 @@
import 'package:analysis_server/src/services/index/store/codec.dart';
import 'package:analyzer/src/generated/element.dart';
import 'package:analyzer/src/generated/engine.dart';
+import 'package:test_reflective_loader/test_reflective_loader.dart';
import 'package:unittest/unittest.dart';
import '../../../abstract_single_unit.dart';
import '../../../mocks.dart';
-import '../../../reflective_tests.dart';
main() {
groupSep = ' | ';
- runReflectiveTests(_ContextCodecTest);
- runReflectiveTests(_ElementCodecTest);
- runReflectiveTests(_RelationshipCodecTest);
- runReflectiveTests(_StringCodecTest);
+ defineReflectiveTests(_ContextCodecTest);
+ defineReflectiveTests(_ElementCodecTest);
+ defineReflectiveTests(_RelationshipCodecTest);
+ defineReflectiveTests(_StringCodecTest);
}
@reflectiveTest
@@ -389,7 +389,8 @@
}
void test_all() {
- Relationship relationship = Relationship.getRelationship('my-relationship');
+ RelationshipImpl relationship =
+ RelationshipImpl.getRelationship('my-relationship');
int id = codec.encode(relationship);
expect(codec.decode(id), relationship);
}
diff --git a/pkg/analysis_server/test/services/index/store/collection_test.dart b/pkg/analysis_server/test/services/index/store/collection_test.dart
index 8d57e17..917afad 100644
--- a/pkg/analysis_server/test/services/index/store/collection_test.dart
+++ b/pkg/analysis_server/test/services/index/store/collection_test.dart
@@ -5,14 +5,13 @@
library test.services.src.index.store.collection;
import 'package:analysis_server/src/services/index/store/collection.dart';
+import 'package:test_reflective_loader/test_reflective_loader.dart';
import 'package:unittest/unittest.dart';
-import '../../../reflective_tests.dart';
-
main() {
groupSep = ' | ';
- runReflectiveTests(_IntArrayToIntMapTest);
- runReflectiveTests(_IntToIntSetMapTest);
+ defineReflectiveTests(_IntArrayToIntMapTest);
+ defineReflectiveTests(_IntToIntSetMapTest);
}
@reflectiveTest
diff --git a/pkg/analysis_server/test/services/index/store/mocks.dart b/pkg/analysis_server/test/services/index/store/mocks.dart
index 9d0bab4..9ed78af 100644
--- a/pkg/analysis_server/test/services/index/store/mocks.dart
+++ b/pkg/analysis_server/test/services/index/store/mocks.dart
@@ -16,7 +16,7 @@
noSuchMethod(Invocation invocation) => super.noSuchMethod(invocation);
}
-class MockLocation extends TypedMock implements Location {
+class MockLocation extends TypedMock implements LocationImpl {
noSuchMethod(Invocation invocation) => super.noSuchMethod(invocation);
}
diff --git a/pkg/analysis_server/test/services/index/store/split_store_test.dart b/pkg/analysis_server/test/services/index/store/split_store_test.dart
index 28352ae..a5e1943 100644
--- a/pkg/analysis_server/test/services/index/store/split_store_test.dart
+++ b/pkg/analysis_server/test/services/index/store/split_store_test.dart
@@ -13,27 +13,27 @@
import 'package:analyzer/src/generated/element.dart';
import 'package:analyzer/src/generated/engine.dart';
import 'package:analyzer/src/generated/source.dart';
+import 'package:test_reflective_loader/test_reflective_loader.dart';
import 'package:typed_mock/typed_mock.dart';
import 'package:unittest/unittest.dart';
import '../../../mocks.dart';
-import '../../../reflective_tests.dart';
import 'mocks.dart';
import 'single_source_container.dart';
main() {
groupSep = ' | ';
- runReflectiveTests(_FileNodeManagerTest);
- runReflectiveTests(_IndexNodeTest);
- runReflectiveTests(_LocationDataTest);
- runReflectiveTests(_RelationKeyDataTest);
- runReflectiveTests(_SplitIndexStoreTest);
+ defineReflectiveTests(_FileNodeManagerTest);
+ defineReflectiveTests(_IndexNodeTest);
+ defineReflectiveTests(_LocationDataTest);
+ defineReflectiveTests(_RelationKeyDataTest);
+ defineReflectiveTests(_SplitIndexStoreTest);
}
void _assertHasLocation(
- List<Location> locations, Element element, int offset, int length,
+ List<LocationImpl> locations, Element element, int offset, int length,
{bool isQualified: false, bool isResolved: true}) {
- for (Location location in locations) {
+ for (LocationImpl location in locations) {
if ((element == null || location.element == element) &&
location.offset == offset &&
location.length == length &&
@@ -47,7 +47,7 @@
}
void _assertHasLocationQ(
- List<Location> locations, Element element, int offset, int length) {
+ List<LocationImpl> locations, Element element, int offset, int length) {
_assertHasLocation(locations, element, offset, length, isQualified: true);
}
@@ -167,7 +167,8 @@
Element elementA = _mockElement();
Element elementB = _mockElement();
Element elementC = _mockElement();
- Relationship relationship = Relationship.getRelationship('my-relationship');
+ RelationshipImpl relationship =
+ RelationshipImpl.getRelationship('my-relationship');
// put Node
Future putFuture;
{
@@ -198,7 +199,7 @@
return nodeManager.getNode(name).then((IndexNode node) {
expect(2, node.locationCount);
{
- List<Location> locations =
+ List<LocationImpl> locations =
node.getRelationships(elementA, relationship);
expect(locations, hasLength(2));
_assertHasLocation(locations, elementB, 1, 10);
@@ -267,9 +268,10 @@
Element elementA = _mockElement();
Element elementB = _mockElement();
Element elementC = _mockElement();
- Relationship relationship = Relationship.getRelationship('my-relationship');
- Location locationA = new Location(elementB, 1, 2);
- Location locationB = new Location(elementC, 10, 20);
+ RelationshipImpl relationship =
+ RelationshipImpl.getRelationship('my-relationship');
+ LocationImpl locationA = new LocationImpl(elementB, 1, 2);
+ LocationImpl locationB = new LocationImpl(elementC, 10, 20);
// empty initially
expect(node.locationCount, 0);
// record
@@ -280,7 +282,8 @@
// get relations
expect(node.getRelationships(elementB, relationship), isEmpty);
{
- List<Location> locations = node.getRelationships(elementA, relationship);
+ List<LocationImpl> locations =
+ node.getRelationships(elementA, relationship);
expect(locations, hasLength(2));
_assertHasLocation(locations, null, 1, 2);
_assertHasLocation(locations, null, 10, 20);
@@ -298,7 +301,8 @@
Element elementA = _mockElement();
Element elementB = _mockElement();
Element elementC = _mockElement();
- Relationship relationship = Relationship.getRelationship('my-relationship');
+ RelationshipImpl relationship =
+ RelationshipImpl.getRelationship('my-relationship');
// record
{
int relationshipId = relationshipCodec.encode(relationship);
@@ -311,7 +315,8 @@
node.relations = {key: locations};
}
// request
- List<Location> locations = node.getRelationships(elementA, relationship);
+ List<LocationImpl> locations =
+ node.getRelationships(elementA, relationship);
expect(locations, hasLength(2));
_assertHasLocation(locations, elementB, 1, 10);
_assertHasLocationQ(locations, elementC, 2, 20);
@@ -340,7 +345,7 @@
Element element = new MockElement();
when(elementCodec.decode(context, 11, 12, 13)).thenReturn(element);
LocationData locationData = new LocationData.forData(11, 12, 13, 1, 2, 0);
- Location location = locationData.getLocation(context, elementCodec);
+ LocationImpl location = locationData.getLocation(context, elementCodec);
expect(location.element, element);
expect(location.offset, 1);
expect(location.length, 2);
@@ -356,7 +361,7 @@
when(elementCodec.encode3(element)).thenReturn(13);
when(elementCodec.decode(context, 11, 12, 13)).thenReturn(element);
// create
- Location location = new Location(element, 1, 2);
+ LocationImpl location = new LocationImpl(element, 1, 2);
LocationData locationData =
new LocationData.forObject(elementCodec, location);
// touch 'hashCode'
@@ -366,7 +371,8 @@
locationData == new LocationData.forData(11, 12, 13, 1, 2, 2), isTrue);
// getLocation()
{
- Location newLocation = locationData.getLocation(context, elementCodec);
+ LocationImpl newLocation =
+ locationData.getLocation(context, elementCodec);
expect(newLocation.element, element);
expect(newLocation.offset, 1);
expect(newLocation.length, 2);
@@ -374,18 +380,19 @@
// no Element - no Location
{
when(elementCodec.decode(context, 11, 12, 13)).thenReturn(null);
- Location newLocation = locationData.getLocation(context, elementCodec);
+ LocationImpl newLocation =
+ locationData.getLocation(context, elementCodec);
expect(newLocation, isNull);
}
}
}
/**
- * [Location] has no [==] and [hashCode], so to compare locations by value we
+ * [LocationImpl] has no [==] and [hashCode], so to compare locations by value we
* need to wrap them into such object.
*/
class _LocationEqualsWrapper {
- final Location location;
+ final LocationImpl location;
_LocationEqualsWrapper(this.location);
@@ -443,7 +450,8 @@
when(elementCodec.encode3(element)).thenReturn(13);
}
// prepare relationship
- Relationship relationship = Relationship.getRelationship('my-relationship');
+ RelationshipImpl relationship =
+ RelationshipImpl.getRelationship('my-relationship');
int relationshipId = 1;
when(relationshipCodec.encode(relationship)).thenReturn(relationshipId);
// create RelationKeyData
@@ -478,7 +486,8 @@
CompilationUnitElement libraryUnitElement = new MockCompilationUnitElement();
ElementCodec elementCodec = new MockElementCodec();
MemoryNodeManager nodeManager = new MemoryNodeManager();
- Relationship relationship = Relationship.getRelationship('test-relationship');
+ RelationshipImpl relationship =
+ RelationshipImpl.getRelationship('test-relationship');
Source sourceA = new MockSource('sourceA');
Source sourceB = new MockSource('sourceB');
Source sourceC = new MockSource('sourceC');
@@ -563,14 +572,14 @@
}
return store
.getRelationships(elementA, relationship)
- .then((List<Location> locations) {
+ .then((List<LocationImpl> locations) {
assertLocations(locations, []);
});
}
test_aboutToIndexDart_library_secondWithoutOneUnit() {
- Location locationA = mockLocation(elementA);
- Location locationB = mockLocation(elementB);
+ LocationImpl locationA = mockLocation(elementA);
+ LocationImpl locationB = mockLocation(elementB);
{
store.aboutToIndexDart(contextA, unitElementA);
store.recordRelationship(elementA, relationship, locationA);
@@ -584,7 +593,7 @@
// "A" and "B" locations
return store
.getRelationships(elementA, relationship)
- .then((List<Location> locations) {
+ .then((List<LocationImpl> locations) {
assertLocations(locations, [locationA, locationB]);
// apply "libraryUnitElement", only with "B"
when(libraryElement.parts).thenReturn([unitElementB]);
@@ -595,7 +604,7 @@
}).then((_) {
return store
.getRelationships(elementA, relationship)
- .then((List<Location> locations) {
+ .then((List<LocationImpl> locations) {
assertLocations(locations, [locationB]);
});
});
@@ -616,8 +625,8 @@
}
test_aboutToIndexHtml_() {
- Location locationA = mockLocation(elementA);
- Location locationB = mockLocation(elementB);
+ LocationImpl locationA = mockLocation(elementA);
+ LocationImpl locationB = mockLocation(elementB);
{
store.aboutToIndexHtml(contextA, htmlElementA);
store.recordRelationship(elementA, relationship, locationA);
@@ -631,7 +640,7 @@
// "A" and "B" locations
return store
.getRelationships(elementA, relationship)
- .then((List<Location> locations) {
+ .then((List<LocationImpl> locations) {
assertLocations(locations, [locationA, locationB]);
});
}
@@ -642,7 +651,7 @@
}
void test_clear() {
- Location locationA = mockLocation(elementA);
+ LocationImpl locationA = mockLocation(elementA);
store.aboutToIndexDart(contextA, unitElementA);
store.recordRelationship(elementA, relationship, locationA);
store.doneIndex();
@@ -655,7 +664,7 @@
test_getRelationships_empty() {
return store
.getRelationships(elementA, relationship)
- .then((List<Location> locations) {
+ .then((List<LocationImpl> locations) {
expect(locations, isEmpty);
});
}
@@ -668,8 +677,8 @@
expect(statistics, contains('0 sources'));
}
// add 2 locations
- Location locationA = mockLocation(elementA);
- Location locationB = mockLocation(elementB);
+ LocationImpl locationA = mockLocation(elementA);
+ LocationImpl locationB = mockLocation(elementB);
{
store.aboutToIndexDart(contextA, unitElementA);
store.recordRelationship(elementA, relationship, locationA);
@@ -690,14 +699,14 @@
void test_recordRelationship_multiplyDefinedElement() {
Element multiplyElement =
new MultiplyDefinedElementImpl(contextA, <Element>[elementA, elementB]);
- Location location = mockLocation(elementA);
+ LocationImpl location = mockLocation(elementA);
store.recordRelationship(multiplyElement, relationship, location);
store.doneIndex();
expect(nodeManager.isEmpty(), isTrue);
}
void test_recordRelationship_nullElement() {
- Location locationA = mockLocation(elementA);
+ LocationImpl locationA = mockLocation(elementA);
store.recordRelationship(null, relationship, locationA);
store.doneIndex();
expect(nodeManager.isEmpty(), isTrue);
@@ -710,8 +719,8 @@
}
test_recordRelationship_oneElement_twoNodes() {
- Location locationA = mockLocation(elementA);
- Location locationB = mockLocation(elementB);
+ LocationImpl locationA = mockLocation(elementA);
+ LocationImpl locationB = mockLocation(elementB);
{
store.aboutToIndexDart(contextA, unitElementA);
store.recordRelationship(elementA, relationship, locationA);
@@ -724,40 +733,40 @@
}
return store
.getRelationships(elementA, relationship)
- .then((List<Location> locations) {
+ .then((List<LocationImpl> locations) {
assertLocations(locations, [locationA, locationB]);
});
}
test_recordRelationship_oneLocation() {
- Location locationA = mockLocation(elementA);
+ LocationImpl locationA = mockLocation(elementA);
store.aboutToIndexDart(contextA, unitElementA);
store.recordRelationship(elementA, relationship, locationA);
store.doneIndex();
return store
.getRelationships(elementA, relationship)
- .then((List<Location> locations) {
+ .then((List<LocationImpl> locations) {
assertLocations(locations, [locationA]);
});
}
test_recordRelationship_twoLocations() {
- Location locationA = mockLocation(elementA);
- Location locationB = mockLocation(elementA);
+ LocationImpl locationA = mockLocation(elementA);
+ LocationImpl locationB = mockLocation(elementA);
store.aboutToIndexDart(contextA, unitElementA);
store.recordRelationship(elementA, relationship, locationA);
store.recordRelationship(elementA, relationship, locationB);
store.doneIndex();
return store
.getRelationships(elementA, relationship)
- .then((List<Location> locations) {
+ .then((List<LocationImpl> locations) {
assertLocations(locations, [locationA, locationB]);
});
}
test_removeContext() {
- Location locationA = mockLocation(elementA);
- Location locationB = mockLocation(elementB);
+ LocationImpl locationA = mockLocation(elementA);
+ LocationImpl locationB = mockLocation(elementB);
{
store.aboutToIndexDart(contextA, unitElementA);
store.recordRelationship(elementA, relationship, locationA);
@@ -771,14 +780,14 @@
// "A" and "B" locations
return store
.getRelationships(elementA, relationship)
- .then((List<Location> locations) {
+ .then((List<LocationImpl> locations) {
assertLocations(locations, [locationA, locationB]);
// remove "A" context
store.removeContext(contextA);
}).then((_) {
return store
.getRelationships(elementA, relationship)
- .then((List<Location> locations) {
+ .then((List<LocationImpl> locations) {
assertLocations(locations, []);
});
});
@@ -789,9 +798,9 @@
}
test_removeSource_library() {
- Location locationA = mockLocation(elementA);
- Location locationB = mockLocation(elementB);
- Location locationC = mockLocation(elementC);
+ LocationImpl locationA = mockLocation(elementA);
+ LocationImpl locationB = mockLocation(elementB);
+ LocationImpl locationC = mockLocation(elementC);
{
store.aboutToIndexDart(contextA, unitElementA);
store.recordRelationship(elementA, relationship, locationA);
@@ -810,14 +819,14 @@
// "A", "B" and "C" locations
return store
.getRelationships(elementA, relationship)
- .then((List<Location> locations) {
+ .then((List<LocationImpl> locations) {
assertLocations(locations, [locationA, locationB, locationC]);
}).then((_) {
// remove "librarySource"
store.removeSource(contextA, librarySource);
return store
.getRelationships(elementA, relationship)
- .then((List<Location> locations) {
+ .then((List<LocationImpl> locations) {
assertLocations(locations, []);
});
});
@@ -828,9 +837,9 @@
}
test_removeSource_unit() {
- Location locationA = mockLocation(elementA);
- Location locationB = mockLocation(elementB);
- Location locationC = mockLocation(elementC);
+ LocationImpl locationA = mockLocation(elementA);
+ LocationImpl locationB = mockLocation(elementB);
+ LocationImpl locationC = mockLocation(elementC);
{
store.aboutToIndexDart(contextA, unitElementA);
store.recordRelationship(elementA, relationship, locationA);
@@ -849,22 +858,22 @@
// "A", "B" and "C" locations
return store
.getRelationships(elementA, relationship)
- .then((List<Location> locations) {
+ .then((List<LocationImpl> locations) {
assertLocations(locations, [locationA, locationB, locationC]);
}).then((_) {
// remove "A" source
store.removeSource(contextA, sourceA);
return store
.getRelationships(elementA, relationship)
- .then((List<Location> locations) {
+ .then((List<LocationImpl> locations) {
assertLocations(locations, [locationB, locationC]);
});
});
}
test_removeSources_library() {
- Location locationA = mockLocation(elementA);
- Location locationB = mockLocation(elementB);
+ LocationImpl locationA = mockLocation(elementA);
+ LocationImpl locationB = mockLocation(elementB);
{
store.aboutToIndexDart(contextA, unitElementA);
store.recordRelationship(elementA, relationship, locationA);
@@ -878,14 +887,14 @@
// "A" and "B" locations
return store
.getRelationships(elementA, relationship)
- .then((List<Location> locations) {
+ .then((List<LocationImpl> locations) {
assertLocations(locations, [locationA, locationB]);
}).then((_) {
// remove "librarySource"
store.removeSources(contextA, new SingleSourceContainer(librarySource));
return store
.getRelationships(elementA, relationship)
- .then((List<Location> locations) {
+ .then((List<LocationImpl> locations) {
assertLocations(locations, []);
});
});
@@ -1038,17 +1047,18 @@
* Asserts that the [actual] locations have all the [expected] locations and
* only them.
*/
- static void assertLocations(List<Location> actual, List<Location> expected) {
+ static void assertLocations(
+ List<LocationImpl> actual, List<LocationImpl> expected) {
List<_LocationEqualsWrapper> actualWrappers = wrapLocations(actual);
List<_LocationEqualsWrapper> expectedWrappers = wrapLocations(expected);
expect(actualWrappers, unorderedEquals(expectedWrappers));
}
/**
- * @return the new [Location] mock.
+ * @return the new [LocationImpl] mock.
*/
- static Location mockLocation(Element element) {
- Location location = new MockLocation();
+ static LocationImpl mockLocation(Element element) {
+ LocationImpl location = new MockLocation();
when(location.element).thenReturn(element);
when(location.offset).thenReturn(0);
when(location.length).thenReturn(0);
@@ -1060,9 +1070,10 @@
/**
* Wraps the given locations into [LocationEqualsWrapper].
*/
- static List<_LocationEqualsWrapper> wrapLocations(List<Location> locations) {
+ static List<_LocationEqualsWrapper> wrapLocations(
+ List<LocationImpl> locations) {
List<_LocationEqualsWrapper> wrappers = <_LocationEqualsWrapper>[];
- for (Location location in locations) {
+ for (LocationImpl location in locations) {
wrappers.add(new _LocationEqualsWrapper(location));
}
return wrappers;
diff --git a/pkg/analysis_server/test/services/index/store/temporary_folder_file_manager_test.dart b/pkg/analysis_server/test/services/index/store/temporary_folder_file_manager_test.dart
index e306270..3eaf5bc 100644
--- a/pkg/analysis_server/test/services/index/store/temporary_folder_file_manager_test.dart
+++ b/pkg/analysis_server/test/services/index/store/temporary_folder_file_manager_test.dart
@@ -8,13 +8,12 @@
import 'package:analysis_server/src/services/index/store/temporary_folder_file_manager.dart';
import 'package:path/path.dart';
+import 'package:test_reflective_loader/test_reflective_loader.dart';
import 'package:unittest/unittest.dart';
-import '../../../reflective_tests.dart';
-
main() {
groupSep = ' | ';
- runReflectiveTests(_SeparateFileManagerTest);
+ defineReflectiveTests(_SeparateFileManagerTest);
}
@reflectiveTest
diff --git a/pkg/analysis_server/test/services/refactoring/convert_getter_to_method_test.dart b/pkg/analysis_server/test/services/refactoring/convert_getter_to_method_test.dart
index 1ab8463..1c90d2a 100644
--- a/pkg/analysis_server/test/services/refactoring/convert_getter_to_method_test.dart
+++ b/pkg/analysis_server/test/services/refactoring/convert_getter_to_method_test.dart
@@ -10,14 +10,14 @@
import 'package:analysis_server/src/services/correction/status.dart';
import 'package:analysis_server/src/services/refactoring/refactoring.dart';
import 'package:analyzer/src/generated/element.dart';
+import 'package:test_reflective_loader/test_reflective_loader.dart';
import 'package:unittest/unittest.dart';
-import '../../reflective_tests.dart';
import 'abstract_refactoring.dart';
main() {
groupSep = ' | ';
- runReflectiveTests(ConvertGetterToMethodTest);
+ defineReflectiveTests(ConvertGetterToMethodTest);
}
@reflectiveTest
diff --git a/pkg/analysis_server/test/services/refactoring/convert_method_to_getter_test.dart b/pkg/analysis_server/test/services/refactoring/convert_method_to_getter_test.dart
index 805a3f3..11f3f8a 100644
--- a/pkg/analysis_server/test/services/refactoring/convert_method_to_getter_test.dart
+++ b/pkg/analysis_server/test/services/refactoring/convert_method_to_getter_test.dart
@@ -10,14 +10,14 @@
import 'package:analysis_server/src/services/correction/status.dart';
import 'package:analysis_server/src/services/refactoring/refactoring.dart';
import 'package:analyzer/src/generated/element.dart';
+import 'package:test_reflective_loader/test_reflective_loader.dart';
import 'package:unittest/unittest.dart';
-import '../../reflective_tests.dart';
import 'abstract_refactoring.dart';
main() {
groupSep = ' | ';
- runReflectiveTests(ConvertMethodToGetterTest);
+ defineReflectiveTests(ConvertMethodToGetterTest);
}
@reflectiveTest
@@ -146,15 +146,6 @@
'Only methods without parameters can be converted to getters.');
}
- test_checkInitialConditions_returnTypeVoid() {
- indexTestUnit('''
-void test() {}
-''');
- _createRefactoring('test');
- // check conditions
- _assertInitialConditions_fatal('Cannot convert function returning void.');
- }
-
test_checkInitialConditions_localFunction() {
indexTestUnit('''
main() {
@@ -180,6 +171,15 @@
'Only class methods or top-level functions can be converted to getters.');
}
+ test_checkInitialConditions_returnTypeVoid() {
+ indexTestUnit('''
+void test() {}
+''');
+ _createRefactoring('test');
+ // check conditions
+ _assertInitialConditions_fatal('Cannot convert function returning void.');
+ }
+
Future _assertInitialConditions_fatal(String message) async {
RefactoringStatus status = await refactoring.checkInitialConditions();
assertRefactoringStatus(status, RefactoringProblemSeverity.FATAL,
diff --git a/pkg/analysis_server/test/services/refactoring/extract_local_test.dart b/pkg/analysis_server/test/services/refactoring/extract_local_test.dart
index 32b2a57..a5c29c2 100644
--- a/pkg/analysis_server/test/services/refactoring/extract_local_test.dart
+++ b/pkg/analysis_server/test/services/refactoring/extract_local_test.dart
@@ -10,14 +10,14 @@
import 'package:analysis_server/src/services/correction/status.dart';
import 'package:analysis_server/src/services/refactoring/extract_local.dart';
import 'package:analysis_server/src/services/refactoring/refactoring.dart';
+import 'package:test_reflective_loader/test_reflective_loader.dart';
import 'package:unittest/unittest.dart';
-import '../../reflective_tests.dart';
import 'abstract_refactoring.dart';
main() {
groupSep = ' | ';
- runReflectiveTests(ExtractLocalTest);
+ defineReflectiveTests(ExtractLocalTest);
}
@reflectiveTest
@@ -706,6 +706,25 @@
''');
}
+ test_singleExpression_hasParseError_expectedSemicolon() {
+ verifyNoTestUnitErrors = false;
+ indexTestUnit('''
+main(p) {
+ foo
+ p.bar.baz;
+}
+''');
+ _createRefactoringForString('p.bar');
+ // apply refactoring
+ return _assertSuccessfulRefactoring('''
+main(p) {
+ foo
+ var res = p.bar;
+ res.baz;
+}
+''');
+ }
+
test_singleExpression_inExpressionBody() {
indexTestUnit('''
main() {
diff --git a/pkg/analysis_server/test/services/refactoring/extract_method_test.dart b/pkg/analysis_server/test/services/refactoring/extract_method_test.dart
index 68ec6ec..f32a9ba 100644
--- a/pkg/analysis_server/test/services/refactoring/extract_method_test.dart
+++ b/pkg/analysis_server/test/services/refactoring/extract_method_test.dart
@@ -10,14 +10,14 @@
import 'package:analysis_server/src/services/correction/status.dart';
import 'package:analysis_server/src/services/refactoring/extract_method.dart';
import 'package:analysis_server/src/services/refactoring/refactoring.dart';
+import 'package:test_reflective_loader/test_reflective_loader.dart';
import 'package:unittest/unittest.dart';
-import '../../reflective_tests.dart';
import 'abstract_refactoring.dart';
main() {
groupSep = ' | ';
- runReflectiveTests(ExtractMethodTest);
+ defineReflectiveTests(ExtractMethodTest);
}
@reflectiveTest
diff --git a/pkg/analysis_server/test/services/refactoring/inline_local_test.dart b/pkg/analysis_server/test/services/refactoring/inline_local_test.dart
index 2a3c104..01c7467 100644
--- a/pkg/analysis_server/test/services/refactoring/inline_local_test.dart
+++ b/pkg/analysis_server/test/services/refactoring/inline_local_test.dart
@@ -8,14 +8,14 @@
import 'package:analysis_server/src/services/correction/status.dart';
import 'package:analysis_server/src/services/refactoring/inline_local.dart';
import 'package:analysis_server/src/services/refactoring/refactoring.dart';
+import 'package:test_reflective_loader/test_reflective_loader.dart';
import 'package:unittest/unittest.dart';
-import '../../reflective_tests.dart';
import 'abstract_refactoring.dart';
main() {
groupSep = ' | ';
- runReflectiveTests(InlineLocalTest);
+ defineReflectiveTests(InlineLocalTest);
}
@reflectiveTest
diff --git a/pkg/analysis_server/test/services/refactoring/inline_method_test.dart b/pkg/analysis_server/test/services/refactoring/inline_method_test.dart
index 48f5c2a..92cbc76 100644
--- a/pkg/analysis_server/test/services/refactoring/inline_method_test.dart
+++ b/pkg/analysis_server/test/services/refactoring/inline_method_test.dart
@@ -7,18 +7,18 @@
import 'dart:async';
import 'package:analysis_server/src/protocol.dart' hide Element;
+import 'package:analysis_server/src/services/correction/status.dart';
import 'package:analysis_server/src/services/refactoring/inline_method.dart';
import 'package:analysis_server/src/services/refactoring/refactoring.dart';
import 'package:analyzer/src/generated/source.dart';
+import 'package:test_reflective_loader/test_reflective_loader.dart';
import 'package:unittest/unittest.dart';
-import '../../reflective_tests.dart';
import 'abstract_refactoring.dart';
-import 'package:analysis_server/src/services/correction/status.dart';
main() {
groupSep = ' | ';
- runReflectiveTests(InlineMethodTest);
+ defineReflectiveTests(InlineMethodTest);
}
@reflectiveTest
diff --git a/pkg/analysis_server/test/services/refactoring/move_file_test.dart b/pkg/analysis_server/test/services/refactoring/move_file_test.dart
index ed220e5..a06a0da 100644
--- a/pkg/analysis_server/test/services/refactoring/move_file_test.dart
+++ b/pkg/analysis_server/test/services/refactoring/move_file_test.dart
@@ -11,15 +11,15 @@
import 'package:analyzer/source/package_map_resolver.dart';
import 'package:analyzer/src/generated/engine.dart';
import 'package:analyzer/src/generated/source.dart';
+import 'package:test_reflective_loader/test_reflective_loader.dart';
import 'package:unittest/unittest.dart';
import '../../abstract_context.dart';
-import '../../reflective_tests.dart';
import 'abstract_refactoring.dart';
main() {
groupSep = ' | ';
- runReflectiveTests(MoveFileTest);
+ defineReflectiveTests(MoveFileTest);
}
@reflectiveTest
diff --git a/pkg/analysis_server/test/services/refactoring/naming_conventions_test.dart b/pkg/analysis_server/test/services/refactoring/naming_conventions_test.dart
index 4652eca..b43fac4 100644
--- a/pkg/analysis_server/test/services/refactoring/naming_conventions_test.dart
+++ b/pkg/analysis_server/test/services/refactoring/naming_conventions_test.dart
@@ -8,14 +8,14 @@
show RefactoringProblemSeverity;
import 'package:analysis_server/src/services/refactoring/naming_conventions.dart';
import 'package:analysis_server/src/services/refactoring/refactoring.dart';
+import 'package:test_reflective_loader/test_reflective_loader.dart';
import 'package:unittest/unittest.dart';
-import '../../reflective_tests.dart';
import 'abstract_refactoring.dart';
main() {
groupSep = ' | ';
- runReflectiveTests(NamingConventionsTest);
+ defineReflectiveTests(NamingConventionsTest);
}
@reflectiveTest
diff --git a/pkg/analysis_server/test/services/refactoring/rename_class_member_test.dart b/pkg/analysis_server/test/services/refactoring/rename_class_member_test.dart
index a91c99b..d8e2a68 100644
--- a/pkg/analysis_server/test/services/refactoring/rename_class_member_test.dart
+++ b/pkg/analysis_server/test/services/refactoring/rename_class_member_test.dart
@@ -6,14 +6,14 @@
import 'package:analysis_server/src/protocol.dart';
import 'package:analysis_server/src/services/correction/status.dart';
+import 'package:test_reflective_loader/test_reflective_loader.dart';
import 'package:unittest/unittest.dart';
-import '../../reflective_tests.dart';
import 'abstract_rename.dart';
main() {
groupSep = ' | ';
- runReflectiveTests(RenameClassMemberTest);
+ defineReflectiveTests(RenameClassMemberTest);
}
@reflectiveTest
diff --git a/pkg/analysis_server/test/services/refactoring/rename_constructor_test.dart b/pkg/analysis_server/test/services/refactoring/rename_constructor_test.dart
index 5591f35..04ec5dc 100644
--- a/pkg/analysis_server/test/services/refactoring/rename_constructor_test.dart
+++ b/pkg/analysis_server/test/services/refactoring/rename_constructor_test.dart
@@ -8,14 +8,14 @@
import 'package:analysis_server/src/services/correction/status.dart';
import 'package:analyzer/src/generated/ast.dart';
import 'package:analyzer/src/generated/element.dart';
+import 'package:test_reflective_loader/test_reflective_loader.dart';
import 'package:unittest/unittest.dart';
-import '../../reflective_tests.dart';
import 'abstract_rename.dart';
main() {
groupSep = ' | ';
- runReflectiveTests(RenameConstructorTest);
+ defineReflectiveTests(RenameConstructorTest);
}
@reflectiveTest
diff --git a/pkg/analysis_server/test/services/refactoring/rename_import_test.dart b/pkg/analysis_server/test/services/refactoring/rename_import_test.dart
index fdf4be9..806eda4 100644
--- a/pkg/analysis_server/test/services/refactoring/rename_import_test.dart
+++ b/pkg/analysis_server/test/services/refactoring/rename_import_test.dart
@@ -6,14 +6,14 @@
import 'package:analysis_server/src/protocol.dart';
import 'package:analyzer/src/generated/ast.dart';
+import 'package:test_reflective_loader/test_reflective_loader.dart';
import 'package:unittest/unittest.dart';
-import '../../reflective_tests.dart';
import 'abstract_rename.dart';
main() {
groupSep = ' | ';
- runReflectiveTests(RenameImportTest);
+ defineReflectiveTests(RenameImportTest);
}
@reflectiveTest
diff --git a/pkg/analysis_server/test/services/refactoring/rename_label_test.dart b/pkg/analysis_server/test/services/refactoring/rename_label_test.dart
index a6812051..dadf102 100644
--- a/pkg/analysis_server/test/services/refactoring/rename_label_test.dart
+++ b/pkg/analysis_server/test/services/refactoring/rename_label_test.dart
@@ -5,14 +5,14 @@
library test.services.refactoring.rename_label;
import 'package:analysis_server/src/protocol.dart';
+import 'package:test_reflective_loader/test_reflective_loader.dart';
import 'package:unittest/unittest.dart';
-import '../../reflective_tests.dart';
import 'abstract_rename.dart';
main() {
groupSep = ' | ';
- runReflectiveTests(RenameLabelTest);
+ defineReflectiveTests(RenameLabelTest);
}
@reflectiveTest
diff --git a/pkg/analysis_server/test/services/refactoring/rename_library_test.dart b/pkg/analysis_server/test/services/refactoring/rename_library_test.dart
index 53a4f24..098ff7d 100644
--- a/pkg/analysis_server/test/services/refactoring/rename_library_test.dart
+++ b/pkg/analysis_server/test/services/refactoring/rename_library_test.dart
@@ -6,14 +6,14 @@
import 'package:analysis_server/src/protocol.dart';
import 'package:analyzer/src/generated/source.dart';
+import 'package:test_reflective_loader/test_reflective_loader.dart';
import 'package:unittest/unittest.dart';
-import '../../reflective_tests.dart';
import 'abstract_rename.dart';
main() {
groupSep = ' | ';
- runReflectiveTests(RenameLibraryTest);
+ defineReflectiveTests(RenameLibraryTest);
}
@reflectiveTest
diff --git a/pkg/analysis_server/test/services/refactoring/rename_local_test.dart b/pkg/analysis_server/test/services/refactoring/rename_local_test.dart
index e5d647b..81bc8b8 100644
--- a/pkg/analysis_server/test/services/refactoring/rename_local_test.dart
+++ b/pkg/analysis_server/test/services/refactoring/rename_local_test.dart
@@ -6,14 +6,14 @@
import 'package:analysis_server/src/protocol.dart';
import 'package:analysis_server/src/services/correction/status.dart';
+import 'package:test_reflective_loader/test_reflective_loader.dart';
import 'package:unittest/unittest.dart';
-import '../../reflective_tests.dart';
import 'abstract_rename.dart';
main() {
groupSep = ' | ';
- runReflectiveTests(RenameLocalTest);
+ defineReflectiveTests(RenameLocalTest);
}
@reflectiveTest
diff --git a/pkg/analysis_server/test/services/refactoring/rename_unit_member_test.dart b/pkg/analysis_server/test/services/refactoring/rename_unit_member_test.dart
index 2f265a3..6e0427f 100644
--- a/pkg/analysis_server/test/services/refactoring/rename_unit_member_test.dart
+++ b/pkg/analysis_server/test/services/refactoring/rename_unit_member_test.dart
@@ -6,14 +6,14 @@
import 'package:analysis_server/src/protocol.dart';
import 'package:analysis_server/src/services/correction/status.dart';
+import 'package:test_reflective_loader/test_reflective_loader.dart';
import 'package:unittest/unittest.dart';
-import '../../reflective_tests.dart';
import 'abstract_rename.dart';
main() {
groupSep = ' | ';
- runReflectiveTests(RenameUnitMemberTest);
+ defineReflectiveTests(RenameUnitMemberTest);
}
@reflectiveTest
diff --git a/pkg/analysis_server/test/services/search/hierarchy_test.dart b/pkg/analysis_server/test/services/search/hierarchy_test.dart
index 3829063..8bb1c61 100644
--- a/pkg/analysis_server/test/services/search/hierarchy_test.dart
+++ b/pkg/analysis_server/test/services/search/hierarchy_test.dart
@@ -11,14 +11,14 @@
import 'package:analysis_server/src/services/search/hierarchy.dart';
import 'package:analysis_server/src/services/search/search_engine_internal.dart';
import 'package:analyzer/src/generated/element.dart';
+import 'package:test_reflective_loader/test_reflective_loader.dart';
import 'package:unittest/unittest.dart';
import '../../abstract_single_unit.dart';
-import '../../reflective_tests.dart';
main() {
groupSep = ' | ';
- runReflectiveTests(HierarchyTest);
+ defineReflectiveTests(HierarchyTest);
}
@reflectiveTest
diff --git a/pkg/analysis_server/test/services/search/search_engine_test.dart b/pkg/analysis_server/test/services/search/search_engine_test.dart
index 1f21c70..ed71610 100644
--- a/pkg/analysis_server/test/services/search/search_engine_test.dart
+++ b/pkg/analysis_server/test/services/search/search_engine_test.dart
@@ -12,15 +12,15 @@
import 'package:analysis_server/src/services/search/search_engine_internal.dart';
import 'package:analyzer/src/generated/element.dart';
import 'package:analyzer/src/generated/source.dart';
+import 'package:test_reflective_loader/test_reflective_loader.dart';
import 'package:typed_mock/typed_mock.dart';
import 'package:unittest/unittest.dart';
import '../../abstract_single_unit.dart';
-import '../../reflective_tests.dart';
main() {
groupSep = ' | ';
- runReflectiveTests(SearchEngineImplTest);
+ defineReflectiveTests(SearchEngineImplTest);
}
class ExpectedMatch {
@@ -211,9 +211,8 @@
''');
ConstructorElement element = findElement('named');
Element mainElement = findElement('main');
- var expected = [
- _expectId(mainElement, MatchKind.REFERENCE, '.named();', length: 6)
- ];
+ var expected =
+ [_expectId(mainElement, MatchKind.REFERENCE, '.named();', length: 6)];
return _verifyReferences(element, expected);
}
@@ -314,9 +313,8 @@
ImportElement element = testLibraryElement.imports[0];
Element mainElement = findElement('main');
var kind = MatchKind.REFERENCE;
- var expected = [
- _expectId(mainElement, kind, 'math.PI);', length: 'math.'.length)
- ];
+ var expected =
+ [_expectId(mainElement, kind, 'math.PI);', length: 'math.'.length)];
return _verifyReferences(element, expected);
}
@@ -420,9 +418,8 @@
''');
MethodMember method = findNodeElementAtString('m(); // ref');
Element mainElement = findElement('main');
- var expected = [
- _expectIdQ(mainElement, MatchKind.INVOCATION, 'm(); // ref')
- ];
+ var expected =
+ [_expectIdQ(mainElement, MatchKind.INVOCATION, 'm(); // ref')];
return _verifyReferences(method, expected);
}
diff --git a/pkg/analysis_server/test/socket_server_test.dart b/pkg/analysis_server/test/socket_server_test.dart
index 5b4f5f0..e98aa2a 100644
--- a/pkg/analysis_server/test/socket_server_test.dart
+++ b/pkg/analysis_server/test/socket_server_test.dart
@@ -13,7 +13,7 @@
import 'package:analysis_server/src/socket_server.dart';
import 'package:analyzer/instrumentation/instrumentation.dart';
import 'package:analyzer/src/generated/sdk_io.dart';
-import 'package:analyzer/src/plugin/plugin_impl.dart';
+import 'package:plugin/manager.dart';
import 'package:unittest/unittest.dart';
import 'mocks.dart';
diff --git a/pkg/analysis_server/test/source/optimizing_pub_package_map_provider_test.dart b/pkg/analysis_server/test/source/optimizing_pub_package_map_provider_test.dart
index 769b683..4f68485 100644
--- a/pkg/analysis_server/test/source/optimizing_pub_package_map_provider_test.dart
+++ b/pkg/analysis_server/test/source/optimizing_pub_package_map_provider_test.dart
@@ -11,14 +11,13 @@
import 'package:analyzer/file_system/file_system.dart';
import 'package:analyzer/file_system/memory_file_system.dart';
import 'package:path/path.dart';
+import 'package:test_reflective_loader/test_reflective_loader.dart';
import 'package:unittest/unittest.dart';
-import '../reflective_tests.dart';
-
main() {
groupSep = ' | ';
- runReflectiveTests(OptimizingPubPackageMapProviderTest);
- runReflectiveTests(OptimizingPubPackageMapInfoTest);
+ defineReflectiveTests(OptimizingPubPackageMapProviderTest);
+ defineReflectiveTests(OptimizingPubPackageMapInfoTest);
}
@reflectiveTest
diff --git a/pkg/analysis_server/test/src/test_all.dart b/pkg/analysis_server/test/src/test_all.dart
new file mode 100644
index 0000000..d5f5729
--- /dev/null
+++ b/pkg/analysis_server/test/src/test_all.dart
@@ -0,0 +1,19 @@
+// Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+library test.src;
+
+import 'package:unittest/unittest.dart';
+
+import 'utilities/test_all.dart' as utilities_all;
+
+/**
+ * Utility for manually running all tests.
+ */
+main() {
+ groupSep = ' | ';
+ group('analysis_server', () {
+ utilities_all.main();
+ });
+}
diff --git a/pkg/analysis_server/test/src/utilities/change_builder_core_test.dart b/pkg/analysis_server/test/src/utilities/change_builder_core_test.dart
new file mode 100644
index 0000000..a378fad
--- /dev/null
+++ b/pkg/analysis_server/test/src/utilities/change_builder_core_test.dart
@@ -0,0 +1,283 @@
+// Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+library analysis_server.test.src.utilities.change_builder_core_test;
+
+import 'package:analysis_server/src/utilities/change_builder_core.dart';
+import 'package:analysis_server/src/protocol.dart';
+import 'package:analysis_server/utilities/change_builder_core.dart';
+import 'package:test_reflective_loader/test_reflective_loader.dart';
+import 'package:unittest/unittest.dart';
+import '../../domain_execution_test.dart';
+
+main() {
+ groupSep = ' | ';
+ defineReflectiveTests(ChangeBuilderImplTest);
+ defineReflectiveTests(EditBuilderImplTest);
+ defineReflectiveTests(FileEditBuilderImplTest);
+ defineReflectiveTests(LinkedEditBuilderImplTest);
+}
+
+@reflectiveTest
+class ChangeBuilderImplTest {
+ void test_createFileEditBuilder() {
+ ChangeBuilderImpl builder = new ChangeBuilderImpl();
+ TestSource source = new TestSource('/test.dart');
+ int timeStamp = 54;
+ FileEditBuilderImpl fileEditBuilder = builder.createFileEditBuilder(source, timeStamp);
+ expect(fileEditBuilder, new isInstanceOf<FileEditBuilder>());
+ SourceFileEdit fileEdit = fileEditBuilder.fileEdit;
+ expect(fileEdit.file, source.fullName);
+ expect(fileEdit.fileStamp, timeStamp);
+ }
+
+ void test_getLinkedEditGroup() {
+ ChangeBuilderImpl builder = new ChangeBuilderImpl();
+ LinkedEditGroup group = builder.getLinkedEditGroup('a');
+ expect(identical(builder.getLinkedEditGroup('b'), group), isFalse);
+ expect(identical(builder.getLinkedEditGroup('a'), group), isTrue);
+ }
+
+ void test_sourceChange_noChanges() {
+ ChangeBuilderImpl builder = new ChangeBuilderImpl();
+ SourceChange sourceChange = builder.sourceChange;
+ expect(sourceChange, isNotNull);
+ expect(sourceChange.edits, isEmpty);
+ expect(sourceChange.linkedEditGroups, isEmpty);
+ expect(sourceChange.message, isEmpty);
+ expect(sourceChange.selection, isNull);
+ }
+
+ void test_sourceChange_oneChange() {
+ ChangeBuilderImpl builder = new ChangeBuilderImpl();
+ TestSource source = new TestSource('/test.dart');
+ builder.addFileEdit(source, 0, (FileEditBuilder builder) {});
+ builder.getLinkedEditGroup('a');
+ SourceChange sourceChange = builder.sourceChange;
+ expect(sourceChange, isNotNull);
+ expect(sourceChange.edits, hasLength(1));
+ expect(sourceChange.linkedEditGroups, hasLength(1));
+ expect(sourceChange.message, isEmpty);
+ expect(sourceChange.selection, isNull);
+ }
+}
+
+@reflectiveTest
+class EditBuilderImplTest {
+ TestSource source = new TestSource('/test.dart');
+
+ void test_addLinkedEdit() {
+ ChangeBuilderImpl builder = new ChangeBuilderImpl();
+ int offset = 10;
+ String text = 'content';
+ builder.addFileEdit(source, 0, (FileEditBuilderImpl builder) {
+ builder.addInsertion(10, (EditBuilderImpl builder) {
+ builder.addLinkedEdit('a', (LinkedEditBuilder builder) {
+ builder.write(text);
+ });
+ SourceEdit sourceEdit = builder.sourceEdit;
+ expect(sourceEdit.replacement, text);
+ });
+ });
+ SourceChange sourceChange = builder.sourceChange;
+ expect(sourceChange, isNotNull);
+ List<LinkedEditGroup> groups = sourceChange.linkedEditGroups;
+ expect(groups, hasLength(1));
+ LinkedEditGroup group = groups[0];
+ expect(group, isNotNull);
+ expect(group.length, text.length);
+ List<Position> positions = group.positions;
+ expect(positions, hasLength(1));
+ expect(positions[0].offset, offset);
+ }
+
+ void test_createLinkedEditBuilder() {
+ ChangeBuilderImpl builder = new ChangeBuilderImpl();
+ builder.addFileEdit(source, 0, (FileEditBuilderImpl builder) {
+ builder.addInsertion(10, (EditBuilderImpl builder) {
+ LinkedEditBuilderImpl linkBuilder = builder.createLinkedEditBuilder();
+ expect(linkBuilder, new isInstanceOf<LinkedEditBuilder>());
+ });
+ });
+ }
+
+ void test_write() {
+ ChangeBuilderImpl builder = new ChangeBuilderImpl();
+ int timeStamp = 93;
+ int offset = 10;
+ String text = 'write';
+ builder.addFileEdit(source, timeStamp, (FileEditBuilderImpl builder) {
+ builder.addInsertion(offset, (EditBuilderImpl builder) {
+ builder.write(text);
+ });
+ });
+
+ SourceChange sourceChange = builder.sourceChange;
+ expect(sourceChange, isNotNull);
+
+ List<SourceFileEdit> fileEdits = sourceChange.edits;
+ expect(fileEdits, hasLength(1));
+ SourceFileEdit fileEdit = fileEdits[0];
+ expect(fileEdit, isNotNull);
+ expect(fileEdit.file, source.fullName);
+ expect(fileEdit.fileStamp, timeStamp);
+
+ List<SourceEdit> edits = fileEdit.edits;
+ expect(edits, hasLength(1));
+ SourceEdit edit = edits[0];
+ expect(edit, isNotNull);
+ expect(edit.offset, offset);
+ expect(edit.length, 0);
+ expect(edit.replacement, text);
+ }
+
+ void test_writeln_withoutText() {
+ ChangeBuilderImpl builder = new ChangeBuilderImpl();
+ int timeStamp = 39;
+ int offset = 52;
+ int length = 12;
+ builder.addFileEdit(source, timeStamp, (FileEditBuilderImpl builder) {
+ builder.addReplacement(offset, length, (EditBuilderImpl builder) {
+ builder.writeln();
+ });
+ });
+
+ SourceChange sourceChange = builder.sourceChange;
+ expect(sourceChange, isNotNull);
+
+ List<SourceFileEdit> fileEdits = sourceChange.edits;
+ expect(fileEdits, hasLength(1));
+ SourceFileEdit fileEdit = fileEdits[0];
+ expect(fileEdit, isNotNull);
+ expect(fileEdit.file, source.fullName);
+ expect(fileEdit.fileStamp, timeStamp);
+
+ List<SourceEdit> edits = fileEdit.edits;
+ expect(edits, hasLength(1));
+ SourceEdit edit = edits[0];
+ expect(edit, isNotNull);
+ expect(edit.offset, offset);
+ expect(edit.length, length);
+ expect(edit.replacement == '\n' || edit.replacement == '\r\n', isTrue);
+ }
+
+ void test_writeln_withText() {
+ ChangeBuilderImpl builder = new ChangeBuilderImpl();
+ int timeStamp = 39;
+ int offset = 52;
+ int length = 12;
+ String text = 'writeln';
+ builder.addFileEdit(source, timeStamp, (FileEditBuilderImpl builder) {
+ builder.addReplacement(offset, length, (EditBuilderImpl builder) {
+ builder.writeln(text);
+ });
+ });
+
+ SourceChange sourceChange = builder.sourceChange;
+ expect(sourceChange, isNotNull);
+
+ List<SourceFileEdit> fileEdits = sourceChange.edits;
+ expect(fileEdits, hasLength(1));
+ SourceFileEdit fileEdit = fileEdits[0];
+ expect(fileEdit, isNotNull);
+ expect(fileEdit.file, source.fullName);
+ expect(fileEdit.fileStamp, timeStamp);
+
+ List<SourceEdit> edits = fileEdit.edits;
+ expect(edits, hasLength(1));
+ SourceEdit edit = edits[0];
+ expect(edit, isNotNull);
+ expect(edit.offset, offset);
+ expect(edit.length, length);
+ expect(edit.replacement == '$text\n' || edit.replacement == '$text\r\n', isTrue);
+ }
+}
+
+@reflectiveTest
+class FileEditBuilderImplTest {
+ TestSource source = new TestSource('/test.dart');
+
+ void test_addInsertion() {
+ ChangeBuilderImpl builder = new ChangeBuilderImpl();
+ builder.addFileEdit(source, 0, (FileEditBuilderImpl builder) {
+ builder.addInsertion(10, (EditBuilderImpl builder) {
+ expect(builder, isNotNull);
+ });
+ });
+ }
+
+ void test_addLinkedPosition() {
+ ChangeBuilderImpl changeBuilder = new ChangeBuilderImpl();
+ String groupName = 'a';
+ changeBuilder.addFileEdit(source, 0, (FileEditBuilderImpl builder) {
+ builder.addLinkedPosition(3, 6, groupName);
+ });
+
+ LinkedEditGroup group = changeBuilder.getLinkedEditGroup(groupName);
+ List<Position> positions = group.positions;
+ expect(positions, hasLength(1));
+ Position position = positions[0];
+ expect(position.file, source.fullName);
+ expect(position.offset, 3);
+ expect(group.length, 6);
+ }
+
+ void test_addReplacement() {
+ ChangeBuilderImpl builder = new ChangeBuilderImpl();
+ builder.addFileEdit(source, 0, (FileEditBuilderImpl builder) {
+ builder.addReplacement(4, 5, (EditBuilderImpl builder) {
+ expect(builder, isNotNull);
+ });
+ });
+ }
+
+ void test_createEditBuilder() {
+ ChangeBuilderImpl builder = new ChangeBuilderImpl();
+ builder.addFileEdit(source, 0, (FileEditBuilderImpl builder) {
+ int offset = 4;
+ int length = 5;
+ EditBuilderImpl editBuilder = builder.createEditBuilder(offset, length);
+ expect(editBuilder, new isInstanceOf<EditBuilder>());
+ SourceEdit sourceEdit = editBuilder.sourceEdit;
+ expect(sourceEdit.length, length);
+ expect(sourceEdit.offset, offset);
+ expect(sourceEdit.replacement, isEmpty);
+ });
+ }
+}
+
+@reflectiveTest
+class LinkedEditBuilderImplTest {
+ TestSource source = new TestSource('/test.dart');
+
+ void test_addSuggestion() {
+ String groupName = 'a';
+ ChangeBuilderImpl builder = new ChangeBuilderImpl();
+ builder.addFileEdit(source, 0, (FileEditBuilderImpl builder) {
+ builder.addInsertion(10, (EditBuilderImpl builder) {
+ builder.addLinkedEdit(groupName, (LinkedEditBuilderImpl builder) {
+ builder.addSuggestion(LinkedEditSuggestionKind.TYPE, 'A');
+ });
+ });
+ });
+
+ LinkedEditGroup group = builder.getLinkedEditGroup(groupName);
+ expect(group.suggestions, hasLength(1));
+ }
+
+ void test_addSuggestions() {
+ String groupName = 'a';
+ ChangeBuilderImpl builder = new ChangeBuilderImpl();
+ builder.addFileEdit(source, 0, (FileEditBuilderImpl builder) {
+ builder.addInsertion(10, (EditBuilderImpl builder) {
+ builder.addLinkedEdit(groupName, (LinkedEditBuilderImpl builder) {
+ builder.addSuggestions(LinkedEditSuggestionKind.TYPE, ['A', 'B']);
+ });
+ });
+ });
+
+ LinkedEditGroup group = builder.getLinkedEditGroup(groupName);
+ expect(group.suggestions, hasLength(2));
+ }
+}
diff --git a/pkg/analysis_server/test/src/utilities/change_builder_dart_test.dart b/pkg/analysis_server/test/src/utilities/change_builder_dart_test.dart
new file mode 100644
index 0000000..3e73a39
--- /dev/null
+++ b/pkg/analysis_server/test/src/utilities/change_builder_dart_test.dart
@@ -0,0 +1,779 @@
+// Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+library analysis_server.test.src.utilities.change_builder_dart_test;
+
+import 'package:analysis_server/src/protocol.dart';
+import 'package:analysis_server/src/utilities/change_builder_core.dart';
+import 'package:analysis_server/src/utilities/change_builder_dart.dart';
+import 'package:analysis_server/utilities/change_builder_core.dart';
+import 'package:analysis_server/utilities/change_builder_dart.dart';
+import 'package:analyzer/src/generated/ast.dart';
+import 'package:analyzer/src/generated/source.dart';
+import 'package:test_reflective_loader/test_reflective_loader.dart';
+import 'package:unittest/unittest.dart';
+
+import '../../abstract_context.dart';
+import '../../domain_execution_test.dart';
+
+main() {
+ groupSep = ' | ';
+ defineReflectiveTests(DartChangeBuilderImplTest);
+ defineReflectiveTests(DartEditBuilderImplTest);
+ defineReflectiveTests(DartFileEditBuilderImplTest);
+}
+
+@reflectiveTest
+class DartChangeBuilderImplTest extends AbstractContextTest {
+ void test_createFileEditBuilder() {
+ Source source = addSource('/test.dart', 'library test;');
+ resolveLibraryUnit(source);
+ int timeStamp = 54;
+ DartChangeBuilderImpl builder = new DartChangeBuilderImpl(context);
+ DartFileEditBuilderImpl fileEditBuilder =
+ builder.createFileEditBuilder(source, timeStamp);
+ expect(fileEditBuilder, new isInstanceOf<DartFileEditBuilder>());
+ SourceFileEdit fileEdit = fileEditBuilder.fileEdit;
+ expect(fileEdit.file, source.fullName);
+ expect(fileEdit.fileStamp, timeStamp);
+ }
+}
+
+@reflectiveTest
+class DartEditBuilderImplTest extends AbstractContextTest {
+ SourceEdit getEdit(DartChangeBuilderImpl builder) {
+ SourceChange sourceChange = builder.sourceChange;
+ expect(sourceChange, isNotNull);
+ List<SourceFileEdit> fileEdits = sourceChange.edits;
+ expect(fileEdits, hasLength(1));
+ SourceFileEdit fileEdit = fileEdits[0];
+ expect(fileEdit, isNotNull);
+ List<SourceEdit> edits = fileEdit.edits;
+ expect(edits, hasLength(1));
+ return edits[0];
+ }
+
+ void test_writeClassDeclaration_interfaces() {
+ Source source = addSource('/test.dart', 'class A {}');
+ CompilationUnit unit = resolveLibraryUnit(source);
+ ClassDeclaration declaration = unit.declarations[0];
+
+ DartChangeBuilderImpl builder = new DartChangeBuilderImpl(context);
+ builder.addFileEdit(source, 1, (DartFileEditBuilderImpl builder) {
+ builder.addInsertion(0, (DartEditBuilder builder) {
+ builder.writeClassDeclaration('C',
+ interfaces: [declaration.element.type]);
+ });
+ });
+ SourceEdit edit = getEdit(builder);
+ expect(
+ edit.replacement, equalsIgnoringWhitespace('class C implements A { }'));
+ }
+
+ void test_writeClassDeclaration_isAbstract() {
+ Source source = addSource('/test.dart', '');
+ resolveLibraryUnit(source);
+
+ DartChangeBuilderImpl builder = new DartChangeBuilderImpl(context);
+ builder.addFileEdit(source, 1, (DartFileEditBuilderImpl builder) {
+ builder.addInsertion(0, (DartEditBuilder builder) {
+ builder.writeClassDeclaration('C', isAbstract: true);
+ });
+ });
+ SourceEdit edit = getEdit(builder);
+ expect(edit.replacement, equalsIgnoringWhitespace('abstract class C { }'));
+ }
+
+ void test_writeClassDeclaration_memberWriter() {
+ Source source = addSource('/test.dart', '');
+ resolveLibraryUnit(source);
+
+ DartChangeBuilderImpl builder = new DartChangeBuilderImpl(context);
+ builder.addFileEdit(source, 1, (DartFileEditBuilderImpl builder) {
+ builder.addInsertion(0, (DartEditBuilder builder) {
+ builder.writeClassDeclaration('C', memberWriter: () {
+ builder.write('/**/');
+ });
+ });
+ });
+ SourceEdit edit = getEdit(builder);
+ expect(edit.replacement, equalsIgnoringWhitespace('class C { /**/ }'));
+ }
+
+ void test_writeClassDeclaration_mixins_noSuperclass() {
+ Source source = addSource('/test.dart', 'class A {}');
+ CompilationUnit unit = resolveLibraryUnit(source);
+ ClassDeclaration classA = unit.declarations[0];
+
+ DartChangeBuilderImpl builder = new DartChangeBuilderImpl(context);
+ builder.addFileEdit(source, 1, (DartFileEditBuilderImpl builder) {
+ builder.addInsertion(0, (DartEditBuilder builder) {
+ builder.writeClassDeclaration('C', mixins: [classA.element.type]);
+ });
+ });
+ SourceEdit edit = getEdit(builder);
+ expect(edit.replacement,
+ equalsIgnoringWhitespace('class C extends Object with A { }'));
+ }
+
+ void test_writeClassDeclaration_mixins_superclass() {
+ Source source = addSource('/test.dart', 'class A {} class B {}');
+ CompilationUnit unit = resolveLibraryUnit(source);
+ ClassDeclaration classA = unit.declarations[0];
+ ClassDeclaration classB = unit.declarations[1];
+
+ DartChangeBuilderImpl builder = new DartChangeBuilderImpl(context);
+ builder.addFileEdit(source, 1, (DartFileEditBuilderImpl builder) {
+ builder.addInsertion(0, (DartEditBuilder builder) {
+ builder.writeClassDeclaration('C',
+ mixins: [classB.element.type], superclass: classA.element.type);
+ });
+ });
+ SourceEdit edit = getEdit(builder);
+ expect(edit.replacement,
+ equalsIgnoringWhitespace('class C extends A with B { }'));
+ }
+
+ void test_writeClassDeclaration_nameGroupName() {
+ Source source = addSource('/test.dart', '');
+ resolveLibraryUnit(source);
+
+ DartChangeBuilderImpl builder = new DartChangeBuilderImpl(context);
+ builder.addFileEdit(source, 1, (DartFileEditBuilderImpl builder) {
+ builder.addInsertion(0, (DartEditBuilder builder) {
+ builder.writeClassDeclaration('C', nameGroupName: 'name');
+ });
+ });
+ SourceEdit edit = getEdit(builder);
+ expect(edit.replacement, equalsIgnoringWhitespace('class C { }'));
+
+ List<LinkedEditGroup> linkedEditGroups =
+ builder.sourceChange.linkedEditGroups;
+ expect(linkedEditGroups, hasLength(1));
+ LinkedEditGroup group = linkedEditGroups[0];
+ expect(group.length, 1);
+ expect(group.positions, hasLength(1));
+ }
+
+ void test_writeClassDeclaration_superclass() {
+ Source source = addSource('/test.dart', 'class B {}');
+ CompilationUnit unit = resolveLibraryUnit(source);
+ ClassDeclaration declaration = unit.declarations[0];
+
+ DartChangeBuilderImpl builder = new DartChangeBuilderImpl(context);
+ builder.addFileEdit(source, 1, (DartFileEditBuilderImpl builder) {
+ builder.addInsertion(0, (DartEditBuilder builder) {
+ builder.writeClassDeclaration('C',
+ superclass: declaration.element.type);
+ });
+ });
+ SourceEdit edit = getEdit(builder);
+ expect(edit.replacement, equalsIgnoringWhitespace('class C extends B { }'));
+ }
+
+ void test_writeFieldDeclaration_initializerWriter() {
+ String content = 'class A {}';
+ Source source = addSource('/test.dart', content);
+ resolveLibraryUnit(source);
+
+ DartChangeBuilderImpl builder = new DartChangeBuilderImpl(context);
+ builder.addFileEdit(source, 1, (DartFileEditBuilderImpl builder) {
+ builder.addInsertion(content.length - 1, (DartEditBuilder builder) {
+ builder.writeFieldDeclaration('f', initializerWriter: () {
+ builder.write('e');
+ });
+ });
+ });
+ SourceEdit edit = getEdit(builder);
+ expect(edit.replacement, equalsIgnoringWhitespace('var f = e;'));
+ }
+
+ void test_writeFieldDeclaration_isConst() {
+ String content = 'class A {}';
+ Source source = addSource('/test.dart', content);
+ resolveLibraryUnit(source);
+
+ DartChangeBuilderImpl builder = new DartChangeBuilderImpl(context);
+ builder.addFileEdit(source, 1, (DartFileEditBuilderImpl builder) {
+ builder.addInsertion(content.length - 1, (DartEditBuilder builder) {
+ builder.writeFieldDeclaration('f', isConst: true);
+ });
+ });
+ SourceEdit edit = getEdit(builder);
+ expect(edit.replacement, equalsIgnoringWhitespace('const f;'));
+ }
+
+ void test_writeFieldDeclaration_isConst_isFinal() {
+ String content = 'class A {}';
+ Source source = addSource('/test.dart', content);
+ resolveLibraryUnit(source);
+
+ DartChangeBuilderImpl builder = new DartChangeBuilderImpl(context);
+ builder.addFileEdit(source, 1, (DartFileEditBuilderImpl builder) {
+ builder.addInsertion(content.length - 1, (DartEditBuilder builder) {
+ builder.writeFieldDeclaration('f', isConst: true, isFinal: true);
+ });
+ });
+ SourceEdit edit = getEdit(builder);
+ expect(edit.replacement, equalsIgnoringWhitespace('const f;'));
+ }
+
+ void test_writeFieldDeclaration_isFinal() {
+ String content = 'class A {}';
+ Source source = addSource('/test.dart', content);
+ resolveLibraryUnit(source);
+
+ DartChangeBuilderImpl builder = new DartChangeBuilderImpl(context);
+ builder.addFileEdit(source, 1, (DartFileEditBuilderImpl builder) {
+ builder.addInsertion(content.length - 1, (DartEditBuilder builder) {
+ builder.writeFieldDeclaration('f', isFinal: true);
+ });
+ });
+ SourceEdit edit = getEdit(builder);
+ expect(edit.replacement, equalsIgnoringWhitespace('final f;'));
+ }
+
+ void test_writeFieldDeclaration_isStatic() {
+ String content = 'class A {}';
+ Source source = addSource('/test.dart', content);
+ resolveLibraryUnit(source);
+
+ DartChangeBuilderImpl builder = new DartChangeBuilderImpl(context);
+ builder.addFileEdit(source, 1, (DartFileEditBuilderImpl builder) {
+ builder.addInsertion(content.length - 1, (DartEditBuilder builder) {
+ builder.writeFieldDeclaration('f', isStatic: true);
+ });
+ });
+ SourceEdit edit = getEdit(builder);
+ expect(edit.replacement, equalsIgnoringWhitespace('static var f;'));
+ }
+
+ void test_writeFieldDeclaration_nameGroupName() {
+ String content = 'class A {}';
+ Source source = addSource('/test.dart', content);
+ resolveLibraryUnit(source);
+
+ DartChangeBuilderImpl builder = new DartChangeBuilderImpl(context);
+ builder.addFileEdit(source, 1, (DartFileEditBuilderImpl builder) {
+ builder.addInsertion(content.length - 1, (DartEditBuilder builder) {
+ builder.writeFieldDeclaration('f', nameGroupName: 'name');
+ });
+ });
+ SourceEdit edit = getEdit(builder);
+ expect(edit.replacement, equalsIgnoringWhitespace('var f;'));
+
+ List<LinkedEditGroup> linkedEditGroups =
+ builder.sourceChange.linkedEditGroups;
+ expect(linkedEditGroups, hasLength(1));
+ LinkedEditGroup group = linkedEditGroups[0];
+ expect(group.length, 1);
+ expect(group.positions, hasLength(1));
+ Position position = group.positions[0];
+ expect(position.offset, equals(13));
+ }
+
+ void test_writeFieldDeclaration_type_typeGroupName() {
+ String content = 'class A {} class B {}';
+ Source source = addSource('/test.dart', content);
+ CompilationUnit unit = resolveLibraryUnit(source);
+ ClassDeclaration declaration = unit.declarations[0];
+
+ DartChangeBuilderImpl builder = new DartChangeBuilderImpl(context);
+ builder.addFileEdit(source, 1, (DartFileEditBuilderImpl builder) {
+ builder.addInsertion(content.length - 1, (DartEditBuilder builder) {
+ builder.writeFieldDeclaration('f',
+ type: declaration.element.type, typeGroupName: 'type');
+ });
+ });
+ SourceEdit edit = getEdit(builder);
+ expect(edit.replacement, equalsIgnoringWhitespace('A f;'));
+
+ List<LinkedEditGroup> linkedEditGroups =
+ builder.sourceChange.linkedEditGroups;
+ expect(linkedEditGroups, hasLength(1));
+ LinkedEditGroup group = linkedEditGroups[0];
+ expect(group.length, 1);
+ expect(group.positions, hasLength(1));
+ Position position = group.positions[0];
+ expect(position.offset, equals(20));
+ }
+
+ void test_writeGetterDeclaration_bodyWriter() {
+ String content = 'class A {}';
+ Source source = addSource('/test.dart', content);
+ resolveLibraryUnit(source);
+
+ DartChangeBuilderImpl builder = new DartChangeBuilderImpl(context);
+ builder.addFileEdit(source, 1, (DartFileEditBuilderImpl builder) {
+ builder.addInsertion(content.length - 1, (DartEditBuilderImpl builder) {
+ builder.writeGetterDeclaration('g', bodyWriter: () {
+ builder.write('{}');
+ });
+ });
+ });
+ SourceEdit edit = getEdit(builder);
+ expect(edit.replacement, equalsIgnoringWhitespace('get g {}'));
+ }
+
+ void test_writeGetterDeclaration_isStatic() {
+ String content = 'class A {}';
+ Source source = addSource('/test.dart', content);
+ resolveLibraryUnit(source);
+
+ DartChangeBuilderImpl builder = new DartChangeBuilderImpl(context);
+ builder.addFileEdit(source, 1, (DartFileEditBuilderImpl builder) {
+ builder.addInsertion(content.length - 1, (DartEditBuilderImpl builder) {
+ builder.writeGetterDeclaration('g', isStatic: true);
+ });
+ });
+ SourceEdit edit = getEdit(builder);
+ expect(edit.replacement, equalsIgnoringWhitespace('static get g => null;'));
+ }
+
+ void test_writeGetterDeclaration_nameGroupName() {
+ String content = 'class A {}';
+ Source source = addSource('/test.dart', content);
+ resolveLibraryUnit(source);
+
+ DartChangeBuilderImpl builder = new DartChangeBuilderImpl(context);
+ builder.addFileEdit(source, 1, (DartFileEditBuilderImpl builder) {
+ builder.addInsertion(content.length - 1, (DartEditBuilderImpl builder) {
+ builder.writeGetterDeclaration('g', nameGroupName: 'name');
+ });
+ });
+ SourceEdit edit = getEdit(builder);
+ expect(edit.replacement, equalsIgnoringWhitespace('get g => null;'));
+
+ List<LinkedEditGroup> linkedEditGroups =
+ builder.sourceChange.linkedEditGroups;
+ expect(linkedEditGroups, hasLength(1));
+ LinkedEditGroup group = linkedEditGroups[0];
+ expect(group.length, 1);
+ expect(group.positions, hasLength(1));
+ Position position = group.positions[0];
+ expect(position.offset, equals(13));
+ }
+
+ void test_writeGetterDeclaration_returnType() {
+ String content = 'class A {} class B {}';
+ Source source = addSource('/test.dart', content);
+ CompilationUnit unit = resolveLibraryUnit(source);
+ ClassDeclaration classA = unit.declarations[0];
+
+ DartChangeBuilderImpl builder = new DartChangeBuilderImpl(context);
+ builder.addFileEdit(source, 1, (DartFileEditBuilderImpl builder) {
+ builder.addInsertion(content.length - 1, (DartEditBuilderImpl builder) {
+ builder.writeGetterDeclaration('g', returnType: classA.element.type, returnTypeGroupName: 'returnType');
+ });
+ });
+ SourceEdit edit = getEdit(builder);
+ expect(edit.replacement, equalsIgnoringWhitespace('A get g => null;'));
+
+ List<LinkedEditGroup> linkedEditGroups =
+ builder.sourceChange.linkedEditGroups;
+ expect(linkedEditGroups, hasLength(1));
+ LinkedEditGroup group = linkedEditGroups[0];
+ expect(group.length, 1);
+ expect(group.positions, hasLength(1));
+ Position position = group.positions[0];
+ expect(position.offset, equals(20));
+ }
+
+ void test_writeOverrideOfInheritedMember() {
+ String content = '''
+class A {
+ A add(A a) => null;
+}
+class B extends A {
+}''';
+ Source source = addSource('/test.dart', content);
+ CompilationUnit unit = resolveLibraryUnit(source);
+ ClassDeclaration declaration = unit.declarations[0];
+
+ DartChangeBuilderImpl builder = new DartChangeBuilderImpl(context);
+ builder.addFileEdit(source, 1, (DartFileEditBuilderImpl builder) {
+ builder.addInsertion(content.length - 1, (DartEditBuilder builder) {
+ builder.writeOverrideOfInheritedMember(declaration.element.methods[0]);
+ });
+ });
+ SourceEdit edit = getEdit(builder);
+ expect(edit.replacement, equalsIgnoringWhitespace('''
+@override
+A add(A a) {
+ // TODO: implement add
+ return null;
+}'''));
+ }
+
+ void test_writeParameters_named() {
+ String content = 'f(int i, {String s}) {}';
+ Source source = addSource('/test.dart', content);
+ CompilationUnit unit = resolveLibraryUnit(source);
+ FunctionDeclaration f = unit.declarations[0];
+ FormalParameterList parameters = f.functionExpression.parameters;
+ Iterable elements = parameters.parameters
+ .map((FormalParameter parameter) => parameter.element);
+
+ DartChangeBuilderImpl builder = new DartChangeBuilderImpl(context);
+ builder.addFileEdit(source, 1, (DartFileEditBuilderImpl builder) {
+ builder.addInsertion(content.length - 1, (DartEditBuilder builder) {
+ builder.writeParameters(elements);
+ });
+ });
+ SourceEdit edit = getEdit(builder);
+ expect(edit.replacement, equalsIgnoringWhitespace('(int i, {String s})'));
+ }
+
+ void test_writeParameters_positional() {
+ String content = 'f(int i, [String s]) {}';
+ Source source = addSource('/test.dart', content);
+ CompilationUnit unit = resolveLibraryUnit(source);
+ FunctionDeclaration f = unit.declarations[0];
+ FormalParameterList parameters = f.functionExpression.parameters;
+ Iterable elements = parameters.parameters
+ .map((FormalParameter parameter) => parameter.element);
+
+ DartChangeBuilderImpl builder = new DartChangeBuilderImpl(context);
+ builder.addFileEdit(source, 1, (DartFileEditBuilderImpl builder) {
+ builder.addInsertion(content.length - 1, (DartEditBuilder builder) {
+ builder.writeParameters(elements);
+ });
+ });
+ SourceEdit edit = getEdit(builder);
+ expect(edit.replacement, equalsIgnoringWhitespace('(int i, [String s])'));
+ }
+
+ void test_writeParameters_required() {
+ String content = 'f(int i, String s) {}';
+ Source source = addSource('/test.dart', content);
+ CompilationUnit unit = resolveLibraryUnit(source);
+ FunctionDeclaration f = unit.declarations[0];
+ FormalParameterList parameters = f.functionExpression.parameters;
+ Iterable elements = parameters.parameters
+ .map((FormalParameter parameter) => parameter.element);
+
+ DartChangeBuilderImpl builder = new DartChangeBuilderImpl(context);
+ builder.addFileEdit(source, 1, (DartFileEditBuilderImpl builder) {
+ builder.addInsertion(content.length - 1, (DartEditBuilder builder) {
+ builder.writeParameters(elements);
+ });
+ });
+ SourceEdit edit = getEdit(builder);
+ expect(edit.replacement, equalsIgnoringWhitespace('(int i, String s)'));
+ }
+
+ void test_writeParametersMatchingArguments_named() {
+ String content = '''
+f(int i, String s) {
+ g(s, index: i);
+}''';
+ Source source = addSource('/test.dart', content);
+ CompilationUnit unit = resolveLibraryUnit(source);
+ FunctionDeclaration f = unit.declarations[0];
+ BlockFunctionBody body = f.functionExpression.body;
+ ExpressionStatement statement = body.block.statements[0];
+ MethodInvocation invocation = statement.expression;
+
+ DartChangeBuilderImpl builder = new DartChangeBuilderImpl(context);
+ builder.addFileEdit(source, 1, (DartFileEditBuilderImpl builder) {
+ builder.addInsertion(content.length - 1, (DartEditBuilder builder) {
+ builder.writeParametersMatchingArguments(invocation.argumentList);
+ });
+ });
+ SourceEdit edit = getEdit(builder);
+ expect(
+ edit.replacement, equalsIgnoringWhitespace('(String s, [int index])'));
+ }
+
+ void test_writeParametersMatchingArguments_required() {
+ String content = '''
+f(int i, String s) {
+ g(s, i);
+}''';
+ Source source = addSource('/test.dart', content);
+ CompilationUnit unit = resolveLibraryUnit(source);
+ FunctionDeclaration f = unit.declarations[0];
+ BlockFunctionBody body = f.functionExpression.body;
+ ExpressionStatement statement = body.block.statements[0];
+ MethodInvocation invocation = statement.expression;
+
+ DartChangeBuilderImpl builder = new DartChangeBuilderImpl(context);
+ builder.addFileEdit(source, 1, (DartFileEditBuilderImpl builder) {
+ builder.addInsertion(content.length - 1, (DartEditBuilder builder) {
+ builder.writeParametersMatchingArguments(invocation.argumentList);
+ });
+ });
+ SourceEdit edit = getEdit(builder);
+ expect(edit.replacement, equalsIgnoringWhitespace('(String s, int i)'));
+ }
+
+ void test_writeParameterSource() {
+ String content = 'class A {}';
+ Source source = addSource('/test.dart', content);
+ CompilationUnit unit = resolveLibraryUnit(source);
+ ClassDeclaration classA = unit.declarations[0];
+
+ DartChangeBuilderImpl builder = new DartChangeBuilderImpl(context);
+ builder.addFileEdit(source, 1, (DartFileEditBuilderImpl builder) {
+ builder.addInsertion(content.length - 1, (DartEditBuilder builder) {
+ builder.writeParameterSource(classA.element.type, 'a');
+ });
+ });
+ SourceEdit edit = getEdit(builder);
+ expect(edit.replacement, equalsIgnoringWhitespace('A a'));
+ }
+
+ void test_writeType_dymanic() {
+ String content = 'class A {}';
+ Source source = addSource('/test.dart', content);
+ CompilationUnit unit = resolveLibraryUnit(source);
+
+ DartChangeBuilderImpl builder = new DartChangeBuilderImpl(context);
+ builder.addFileEdit(source, 1, (DartFileEditBuilderImpl builder) {
+ builder.addInsertion(content.length - 1, (DartEditBuilder builder) {
+ builder.writeType(unit.element.context.typeProvider.dynamicType);
+ });
+ });
+ SourceEdit edit = getEdit(builder);
+ expect(edit.replacement, equalsIgnoringWhitespace(''));
+ }
+
+ void test_writeType_genericType() {
+ String content = 'class A {} class B<E> {}';
+ Source source = addSource('/test.dart', content);
+ CompilationUnit unit = resolveLibraryUnit(source);
+ ClassDeclaration classA = unit.declarations[0];
+ ClassDeclaration classB = unit.declarations[1];
+
+ DartChangeBuilderImpl builder = new DartChangeBuilderImpl(context);
+ builder.addFileEdit(source, 1, (DartFileEditBuilderImpl builder) {
+ builder.addInsertion(content.length - 1, (DartEditBuilder builder) {
+ builder
+ .writeType(classB.element.type.substitute4([classA.element.type]));
+ });
+ });
+ SourceEdit edit = getEdit(builder);
+ expect(edit.replacement, equalsIgnoringWhitespace('B<A>'));
+ }
+
+ void test_writeType_groupName() {
+ String content = 'class A {} class B extends A {} class C extends B {}';
+ Source source = addSource('/test.dart', content);
+ CompilationUnit unit = resolveLibraryUnit(source);
+ ClassDeclaration classC = unit.declarations[2];
+
+ DartChangeBuilderImpl builder = new DartChangeBuilderImpl(context);
+ builder.addFileEdit(source, 1, (DartFileEditBuilderImpl builder) {
+ builder.addInsertion(content.length - 1, (DartEditBuilder builder) {
+ builder.writeType(classC.element.type, groupName: 'type');
+ });
+ });
+ SourceEdit edit = getEdit(builder);
+ expect(edit.replacement, equalsIgnoringWhitespace('C'));
+
+ List<LinkedEditGroup> linkedEditGroups =
+ builder.sourceChange.linkedEditGroups;
+ expect(linkedEditGroups, hasLength(1));
+ LinkedEditGroup group = linkedEditGroups[0];
+ expect(group, isNotNull);
+ }
+
+ void test_writeType_groupName_addSupertypeProposals() {
+ String content = 'class A {} class B extends A {} class C extends B {}';
+ Source source = addSource('/test.dart', content);
+ CompilationUnit unit = resolveLibraryUnit(source);
+ ClassDeclaration classC = unit.declarations[2];
+
+ DartChangeBuilderImpl builder = new DartChangeBuilderImpl(context);
+ builder.addFileEdit(source, 1, (DartFileEditBuilderImpl builder) {
+ builder.addInsertion(content.length - 1, (DartEditBuilder builder) {
+ builder.writeType(classC.element.type,
+ addSupertypeProposals: true, groupName: 'type');
+ });
+ });
+ SourceEdit edit = getEdit(builder);
+ expect(edit.replacement, equalsIgnoringWhitespace('C'));
+
+ List<LinkedEditGroup> linkedEditGroups =
+ builder.sourceChange.linkedEditGroups;
+ expect(linkedEditGroups, hasLength(1));
+ LinkedEditGroup group = linkedEditGroups[0];
+ List<LinkedEditSuggestion> suggestions = group.suggestions;
+ expect(suggestions, hasLength(4));
+ Iterable<String> values = suggestions
+ .map((LinkedEditSuggestion suggestion) {
+ expect(suggestion.kind, LinkedEditSuggestionKind.TYPE);
+ return suggestion.value;
+ });
+ expect(values, contains('Object'));
+ expect(values, contains('A'));
+ expect(values, contains('B'));
+ expect(values, contains('C'));
+ }
+
+ void test_writeType_null() {
+ String content = 'class A {}';
+ Source source = addSource('/test.dart', content);
+ resolveLibraryUnit(source);
+
+ DartChangeBuilderImpl builder = new DartChangeBuilderImpl(context);
+ builder.addFileEdit(source, 1, (DartFileEditBuilderImpl builder) {
+ builder.addInsertion(content.length - 1, (DartEditBuilder builder) {
+ builder.writeType(null);
+ });
+ });
+ SourceEdit edit = getEdit(builder);
+ expect(edit.replacement, equalsIgnoringWhitespace(''));
+ }
+
+ void test_writeType_required_dymanic() {
+ String content = 'class A {}';
+ Source source = addSource('/test.dart', content);
+ CompilationUnit unit = resolveLibraryUnit(source);
+
+ DartChangeBuilderImpl builder = new DartChangeBuilderImpl(context);
+ builder.addFileEdit(source, 1, (DartFileEditBuilderImpl builder) {
+ builder.addInsertion(content.length - 1, (DartEditBuilder builder) {
+ builder.writeType(unit.element.context.typeProvider.dynamicType,
+ required: true);
+ });
+ });
+ SourceEdit edit = getEdit(builder);
+ expect(edit.replacement, equalsIgnoringWhitespace('var'));
+ }
+
+ void test_writeType_required_notNull() {
+ String content = 'class A {}';
+ Source source = addSource('/test.dart', content);
+ CompilationUnit unit = resolveLibraryUnit(source);
+ ClassDeclaration classA = unit.declarations[0];
+
+ DartChangeBuilderImpl builder = new DartChangeBuilderImpl(context);
+ builder.addFileEdit(source, 1, (DartFileEditBuilderImpl builder) {
+ builder.addInsertion(content.length - 1, (DartEditBuilder builder) {
+ builder.writeType(classA.element.type, required: true);
+ });
+ });
+ SourceEdit edit = getEdit(builder);
+ expect(edit.replacement, equalsIgnoringWhitespace('A'));
+ }
+
+ void test_writeType_required_null() {
+ String content = 'class A {}';
+ Source source = addSource('/test.dart', content);
+ resolveLibraryUnit(source);
+
+ DartChangeBuilderImpl builder = new DartChangeBuilderImpl(context);
+ builder.addFileEdit(source, 1, (DartFileEditBuilderImpl builder) {
+ builder.addInsertion(content.length - 1, (DartEditBuilder builder) {
+ builder.writeType(null, required: true);
+ });
+ });
+ SourceEdit edit = getEdit(builder);
+ expect(edit.replacement, equalsIgnoringWhitespace('var'));
+ }
+
+ void test_writeType_simpleType() {
+ String content = 'class A {}';
+ Source source = addSource('/test.dart', content);
+ CompilationUnit unit = resolveLibraryUnit(source);
+ ClassDeclaration classA = unit.declarations[0];
+
+ DartChangeBuilderImpl builder = new DartChangeBuilderImpl(context);
+ builder.addFileEdit(source, 1, (DartFileEditBuilderImpl builder) {
+ builder.addInsertion(content.length - 1, (DartEditBuilder builder) {
+ builder.writeType(classA.element.type);
+ });
+ });
+ SourceEdit edit = getEdit(builder);
+ expect(edit.replacement, equalsIgnoringWhitespace('A'));
+ }
+
+ void test_writeTypes_empty() {
+ String content = 'class A {}';
+ Source source = addSource('/test.dart', content);
+ resolveLibraryUnit(source);
+
+ DartChangeBuilderImpl builder = new DartChangeBuilderImpl(context);
+ builder.addFileEdit(source, 1, (DartFileEditBuilderImpl builder) {
+ builder.addInsertion(content.length - 1, (DartEditBuilder builder) {
+ (builder as DartEditBuilderImpl).writeTypes([]);
+ });
+ });
+ SourceEdit edit = getEdit(builder);
+ expect(edit.replacement, isEmpty);
+ }
+
+ void test_writeTypes_noPrefix() {
+ String content = 'class A {} class B {}';
+ Source source = addSource('/test.dart', content);
+ CompilationUnit unit = resolveLibraryUnit(source);
+ ClassDeclaration classA = unit.declarations[0];
+ ClassDeclaration classB = unit.declarations[1];
+
+ DartChangeBuilderImpl builder = new DartChangeBuilderImpl(context);
+ builder.addFileEdit(source, 1, (DartFileEditBuilderImpl builder) {
+ builder.addInsertion(content.length - 1, (DartEditBuilder builder) {
+ (builder as DartEditBuilderImpl)
+ .writeTypes([classA.element.type, classB.element.type]);
+ });
+ });
+ SourceEdit edit = getEdit(builder);
+ expect(edit.replacement, equalsIgnoringWhitespace('A, B'));
+ }
+
+ void test_writeTypes_null() {
+ String content = 'class A {}';
+ Source source = addSource('/test.dart', content);
+ resolveLibraryUnit(source);
+
+ DartChangeBuilderImpl builder = new DartChangeBuilderImpl(context);
+ builder.addFileEdit(source, 1, (DartFileEditBuilderImpl builder) {
+ builder.addInsertion(content.length - 1, (DartEditBuilder builder) {
+ (builder as DartEditBuilderImpl).writeTypes(null);
+ });
+ });
+ SourceEdit edit = getEdit(builder);
+ expect(edit.replacement, isEmpty);
+ }
+
+ void test_writeTypes_prefix() {
+ String content = 'class A {} class B {}';
+ Source source = addSource('/test.dart', content);
+ CompilationUnit unit = resolveLibraryUnit(source);
+ ClassDeclaration classA = unit.declarations[0];
+ ClassDeclaration classB = unit.declarations[1];
+
+ DartChangeBuilderImpl builder = new DartChangeBuilderImpl(context);
+ builder.addFileEdit(source, 1, (DartFileEditBuilderImpl builder) {
+ builder.addInsertion(content.length - 1, (DartEditBuilder builder) {
+ (builder as DartEditBuilderImpl).writeTypes(
+ [classA.element.type, classB.element.type], prefix: 'implements ');
+ });
+ });
+ SourceEdit edit = getEdit(builder);
+ expect(edit.replacement, equalsIgnoringWhitespace('implements A, B'));
+ }
+}
+
+@reflectiveTest
+class DartFileEditBuilderImplTest extends AbstractContextTest {
+ void test_createEditBuilder() {
+ Source source = addSource('/test.dart', 'library test;');
+ resolveLibraryUnit(source);
+ int timeStamp = 65;
+ DartChangeBuilderImpl builder = new DartChangeBuilderImpl(context);
+ builder.addFileEdit(source, timeStamp, (DartFileEditBuilderImpl builder) {
+ int offset = 4;
+ int length = 5;
+ DartEditBuilderImpl editBuilder =
+ builder.createEditBuilder(offset, length);
+ expect(editBuilder, new isInstanceOf<DartEditBuilder>());
+ SourceEdit sourceEdit = editBuilder.sourceEdit;
+ expect(sourceEdit.length, length);
+ expect(sourceEdit.offset, offset);
+ expect(sourceEdit.replacement, isEmpty);
+ });
+ }
+}
diff --git a/pkg/analysis_server/test/src/utilities/test_all.dart b/pkg/analysis_server/test/src/utilities/test_all.dart
new file mode 100644
index 0000000..e2ce06e
--- /dev/null
+++ b/pkg/analysis_server/test/src/utilities/test_all.dart
@@ -0,0 +1,17 @@
+// Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+library test.services;
+
+import 'package:unittest/unittest.dart';
+
+import 'change_builder_core_test.dart' as change_builder_core_test;
+import 'change_builder_dart_test.dart' as change_builder_dart_test;
+
+/// Utility for manually running all tests.
+main() {
+ groupSep = ' | ';
+ change_builder_core_test.main();
+ change_builder_dart_test.main();
+}
diff --git a/pkg/analysis_server/test/test_all.dart b/pkg/analysis_server/test/test_all.dart
index 862b77f..9307059 100644
--- a/pkg/analysis_server/test/test_all.dart
+++ b/pkg/analysis_server/test/test_all.dart
@@ -20,6 +20,7 @@
import 'services/test_all.dart' as services_all;
import 'socket_server_test.dart' as socket_server_test;
import 'source/test_all.dart' as source_all;
+import 'src/test_all.dart' as src_all;
/**
* Utility for manually running all tests.
@@ -43,5 +44,6 @@
services_all.main();
socket_server_test.main();
source_all.main();
+ src_all.main();
});
}
diff --git a/pkg/analysis_server/tool/spec/api.dart b/pkg/analysis_server/tool/spec/api.dart
index a968bb1..6f47644 100644
--- a/pkg/analysis_server/tool/spec/api.dart
+++ b/pkg/analysis_server/tool/spec/api.dart
@@ -10,7 +10,7 @@
import 'dart:collection';
-import 'package:html5lib/dom.dart' as dom;
+import 'package:html/dom.dart' as dom;
/**
* Toplevel container for the API.
diff --git a/pkg/analysis_server/tool/spec/codegen_dart_protocol.dart b/pkg/analysis_server/tool/spec/codegen_dart_protocol.dart
index 9087e57..88df36b 100644
--- a/pkg/analysis_server/tool/spec/codegen_dart_protocol.dart
+++ b/pkg/analysis_server/tool/spec/codegen_dart_protocol.dart
@@ -6,7 +6,7 @@
import 'dart:convert';
-import 'package:html5lib/dom.dart' as dom;
+import 'package:html/dom.dart' as dom;
import 'api.dart';
import 'codegen_dart.dart';
@@ -16,6 +16,13 @@
import 'to_html.dart';
/**
+ * Translate spec_input.html into protocol_matchers.dart.
+ */
+main() {
+ target.generate();
+}
+
+/**
* Special flags that need to be inserted into the declaration of the Element
* class.
*/
@@ -35,13 +42,6 @@
});
/**
- * Translate spec_input.html into protocol_matchers.dart.
- */
-main() {
- target.generate();
-}
-
-/**
* Callback type used to represent arbitrary code generation.
*/
typedef void CodegenCallback();
@@ -383,10 +383,29 @@
if (field.value != null) {
continue;
}
+ writeln('${dartType(field.type)} _${field.name};');
+ writeln();
+ }
+ for (TypeObjectField field in type.fields) {
+ if (field.value != null) {
+ continue;
+ }
docComment(toHtmlVisitor.collectHtml(() {
toHtmlVisitor.translateHtml(field.html);
}));
- writeln('${dartType(field.type)} ${field.name};');
+ writeln('${dartType(field.type)} get ${field.name} => _${field.name};');
+ writeln();
+ docComment(toHtmlVisitor.collectHtml(() {
+ toHtmlVisitor.translateHtml(field.html);
+ }));
+ writeln('void set ${field.name}(${dartType(field.type)} value) {');
+ indent(() {
+ if (!field.optional) {
+ writeln('assert(value != null);');
+ }
+ writeln('this._${field.name} = value;');
+ });
+ writeln('}');
writeln();
}
emitObjectConstructor(type, className);
@@ -437,7 +456,8 @@
if (field.value != null) {
continue;
}
- String arg = 'this.${field.name}';
+ String arg = '${dartType(field.type)} ${field.name}';
+ String setValueFromArg = 'this.${field.name} = ${field.name};';
if (isOptionalConstructorArg(className, field)) {
optionalArgs.add(arg);
if (!field.optional) {
@@ -448,7 +468,12 @@
extraInitCode.add(() {
writeln('if (${field.name} == null) {');
indent(() {
- writeln('${field.name} = <${dartType(fieldType.itemType)}>[];');
+ writeln(
+ 'this.${field.name} = <${dartType(fieldType.itemType)}>[];');
+ });
+ writeln('} else {');
+ indent(() {
+ writeln(setValueFromArg);
});
writeln('}');
});
@@ -456,9 +481,16 @@
throw new Exception(
"Don't know how to create default field value.");
}
+ } else {
+ extraInitCode.add(() {
+ writeln(setValueFromArg);
+ });
}
} else {
args.add(arg);
+ extraInitCode.add(() {
+ writeln(setValueFromArg);
+ });
}
}
if (optionalArgs.isNotEmpty) {
diff --git a/pkg/analysis_server/tool/spec/codegen_java.dart b/pkg/analysis_server/tool/spec/codegen_java.dart
index 3f64815..a06af6b 100644
--- a/pkg/analysis_server/tool/spec/codegen_java.dart
+++ b/pkg/analysis_server/tool/spec/codegen_java.dart
@@ -7,7 +7,7 @@
*/
library CodegenJava;
-import 'package:html5lib/dom.dart' as dom;
+import 'package:html/dom.dart' as dom;
import 'api.dart';
import 'codegen_tools.dart';
diff --git a/pkg/analysis_server/tool/spec/codegen_java_types.dart b/pkg/analysis_server/tool/spec/codegen_java_types.dart
index e7d289e..16bfade 100644
--- a/pkg/analysis_server/tool/spec/codegen_java_types.dart
+++ b/pkg/analysis_server/tool/spec/codegen_java_types.dart
@@ -7,7 +7,7 @@
*/
library java.generator.types;
-import 'package:html5lib/dom.dart' as dom;
+import 'package:html/dom.dart' as dom;
import 'api.dart';
import 'codegen_java.dart';
diff --git a/pkg/analysis_server/tool/spec/codegen_tools.dart b/pkg/analysis_server/tool/spec/codegen_tools.dart
index 0997b33..84a95ab 100644
--- a/pkg/analysis_server/tool/spec/codegen_tools.dart
+++ b/pkg/analysis_server/tool/spec/codegen_tools.dart
@@ -9,7 +9,7 @@
import 'dart:io';
-import 'package:html5lib/dom.dart' as dom;
+import 'package:html/dom.dart' as dom;
import 'package:path/path.dart';
import 'html_tools.dart';
diff --git a/pkg/analysis_server/tool/spec/from_html.dart b/pkg/analysis_server/tool/spec/from_html.dart
index 6578a8a..938aacc 100644
--- a/pkg/analysis_server/tool/spec/from_html.dart
+++ b/pkg/analysis_server/tool/spec/from_html.dart
@@ -9,8 +9,8 @@
import 'dart:io';
-import 'package:html5lib/dom.dart' as dom;
-import 'package:html5lib/parser.dart' as parser;
+import 'package:html/dom.dart' as dom;
+import 'package:html/parser.dart' as parser;
import 'api.dart';
import 'html_tools.dart';
diff --git a/pkg/analysis_server/tool/spec/html_tools.dart b/pkg/analysis_server/tool/spec/html_tools.dart
index 3df949c..419fe63 100644
--- a/pkg/analysis_server/tool/spec/html_tools.dart
+++ b/pkg/analysis_server/tool/spec/html_tools.dart
@@ -7,7 +7,7 @@
*/
library html.tools;
-import 'package:html5lib/dom.dart' as dom;
+import 'package:html/dom.dart' as dom;
/**
* Make a deep copy of the given HTML nodes.
diff --git a/pkg/analysis_server/tool/spec/spec_input.html b/pkg/analysis_server/tool/spec/spec_input.html
index 87c9949..87c3340 100644
--- a/pkg/analysis_server/tool/spec/spec_input.html
+++ b/pkg/analysis_server/tool/spec/spec_input.html
@@ -5,7 +5,7 @@
</head>
<body>
<h1>Analysis Server API Specification</h1>
- <h1 style="color:#999999">Version <version>1.6.0</version></h1>
+ <h1 style="color:#999999">Version <version>1.6.2</version></h1>
<p>
This document contains a specification of the API provided by the
analysis server. The API in this document is currently under
@@ -1326,11 +1326,12 @@
selection offset and selection length.
</p>
<p>
- If a request is made for a file which does not exist, or
- which is not currently subject to analysis (e.g. because it
- is not associated with any analysis root specified to
- analysis.setAnalysisRoots), an error of type
- <tt>FORMAT_INVALID_FILE</tt> will be generated.
+ If a request is made for a file which does not exist, or which is not
+ currently subject to analysis (e.g. because it is not associated with
+ any analysis root specified to analysis.setAnalysisRoots), an error of
+ type <tt>FORMAT_INVALID_FILE</tt> will be generated. If the source
+ contains syntax errors, an error of type <tt>FORMAT_WITH_ERRORS</tt>
+ will be generated.
</p>
<params>
<field name="file">
@@ -2200,6 +2201,13 @@
field is omitted if the parameterName field is omitted.
</p>
</field>
+ <field name="importUri" optional="true">
+ <ref>String</ref>
+ <p>
+ The import to be added if the suggestion is out of scope
+ and needs an import to be added to be in scope.
+ </p>
+ </field>
</object>
</type>
<type name="CompletionSuggestionKind">
@@ -2243,7 +2251,14 @@
For suggestions of this kind, the completion is the keyword.
</p>
</value>
- <value><code>NAMED_ARGUMENT</code></value>
+ <value>
+ <code>NAMED_ARGUMENT</code>
+ <p>
+ A named argument for the current callsite is being suggested.
+ For suggestions of this kind, the completion is
+ the named argument identifier including a trailing ':' and space.
+ </p>
+ </value>
<value><code>OPTIONAL_ARGUMENT</code></value>
<value><code>PARAMETER</code></value>
</enum>
@@ -3125,6 +3140,13 @@
</p>
</value>
<value>
+ <code>FORMAT_WITH_ERRORS</code>
+ <p>
+ An "edit.format" request specified a file that contains syntax
+ errors.
+ </p>
+ </value>
+ <value>
<code>GET_ERRORS_INVALID_FILE</code>
<p>
An "analysis.getErrors" request specified a FilePath
diff --git a/pkg/analysis_server/tool/spec/text_formatter.dart b/pkg/analysis_server/tool/spec/text_formatter.dart
index a811d68..17a7996 100644
--- a/pkg/analysis_server/tool/spec/text_formatter.dart
+++ b/pkg/analysis_server/tool/spec/text_formatter.dart
@@ -7,7 +7,7 @@
*/
library text.formatter;
-import 'package:html5lib/dom.dart' as dom;
+import 'package:html/dom.dart' as dom;
import 'codegen_tools.dart';
diff --git a/pkg/analysis_server/tool/spec/to_html.dart b/pkg/analysis_server/tool/spec/to_html.dart
index f773e94..804db2d 100644
--- a/pkg/analysis_server/tool/spec/to_html.dart
+++ b/pkg/analysis_server/tool/spec/to_html.dart
@@ -11,7 +11,7 @@
import 'dart:convert';
-import 'package:html5lib/dom.dart' as dom;
+import 'package:html/dom.dart' as dom;
import 'api.dart';
import 'codegen_tools.dart';
diff --git a/pkg/analyzer/CHANGELOG.md b/pkg/analyzer/CHANGELOG.md
index 1c1ec87..7cbf18f 100644
--- a/pkg/analyzer/CHANGELOG.md
+++ b/pkg/analyzer/CHANGELOG.md
@@ -1,3 +1,12 @@
+## 0.25.0
+
+* Commandline interface moved to dedicated `analyzer_cli` package. Files moved:
+ * `bin/analyzer.dart`
+ * `lib/options.dart`
+ * `lib/src/analyzer_impl.dart`
+ * `lib/src/error_formatter.dart`
+* Removed dependency on the `args` package.
+
## 0.22.1
* Changes in the async/await support.
@@ -7,9 +16,9 @@
New API:
-* Source.uri added.
+* `Source.uri` added.
Breaking changes:
-* DartSdk.fromEncoding replaced with "fromFileUri".
-* Source.resolveRelative replaced with "resolveRelativeUri".
+* `DartSdk.fromEncoding` replaced with `fromFileUri`.
+* `Source.resolveRelative` replaced with `resolveRelativeUri`.
diff --git a/pkg/analyzer/README.md b/pkg/analyzer/README.md
index c8db3be..2423774 100644
--- a/pkg/analyzer/README.md
+++ b/pkg/analyzer/README.md
@@ -1,20 +1,27 @@
-This code is part of an experimental port of the Editor's analysis engine from
-Java to Dart. While we will continue to support the Java version of the analysis
-engine and the services built on it, we also intend to provide the same services
-to Dart-based applications. This is very early code and we expect it to change,
-possibly in significant ways. While we are eager to see other people make use
-of the analysis engine, we also want to be clear, in case you are interested in
-doing so, that the current API's should in no way be considered to be stable.
+The analysis package defines support for performing static analysis of Dart
+code. It was designed to support tooling efforts, but has also been used for
+such things as statistics gathering and code transformers.
-In particular, this code was automatically translated from the Java
-implementation. The Java implementation that was translated is still under
-development and will continue to change over time. The translator that was used
-is still under development and the output produced by the translator will change
-over time. Therefore, the API presented by this code will change. In addition,
-any edits made to this code will be overwritten the next time we re-generate
-this code.
+If you are interested in providing Dart support in a long-running tool, such as
+an editor or IDE, you should use the analysis server instead of this package.
+The analysis server is currently shipped as an executable in the SDK and will
+be released as a package in the near future. In the meantime, if you'd like to
+learn more about it, please look at the
+[Analysis Server API Specification](http://htmlpreview.github.io/?https://github.com/dart-lang/bleeding_edge/blob/master/dart/pkg/analysis_server/doc/api.html)
+or contact the mailing list (see below).
-If you are interested in using this code, despite the disclaimer above,
-fantastic! Please let the editor team know so that we can get a sense of the
-interest in it. Also, feel free to ask questions and make requests for
-additional functionality.
\ No newline at end of file
+The API's in this package are, quite frankly, a mess at the moment. They were
+originally machine generated by a translator and were based on an earlier Java
+implementation. Several of the API's still look like their Java predecessors
+(or worse) rather than clean Dart API's.
+
+In addition, there is currently no clean distinction between public and internal
+API's. We plan to address this issue soon, but doing so will, unfortunately,
+require a large number of breaking changes. We will try to minimize the pain
+this causes for our clients, but some pain is inevitable.
+
+Questions and requests for additional functionality are welcome, and can be made
+by either opening an issue at
+[https://code.google.com/p/dart/issues](https://code.google.com/p/dart/issues)
+or by emailing
+[analyzer-discuss@dartlang.org](https://groups.google.com/a/dartlang.org/forum/#!forum/analyzer-discuss).
\ No newline at end of file
diff --git a/pkg/analyzer/bin/analyzer.dart b/pkg/analyzer/bin/analyzer.dart
deleted file mode 100644
index ccdc619..0000000
--- a/pkg/analyzer/bin/analyzer.dart
+++ /dev/null
@@ -1,151 +0,0 @@
-#!/usr/bin/env dart
-// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-/** The entry point for the analyzer. */
-library analyzer;
-
-import 'dart:async';
-import 'dart:convert';
-import 'dart:io';
-
-import 'package:analyzer/options.dart';
-import 'package:analyzer/src/analyzer_impl.dart';
-import 'package:analyzer/src/generated/engine.dart';
-import 'package:analyzer/src/generated/error.dart';
-import 'package:analyzer/src/generated/interner.dart';
-import 'package:analyzer/src/generated/java_core.dart' show JavaSystem;
-import 'package:analyzer/src/generated/java_engine.dart';
-import 'package:analyzer/src/generated/utilities_general.dart';
-
-void main(List<String> args) {
- StringUtilities.INTERNER = new MappedInterner();
- CommandLineOptions options = CommandLineOptions.parse(args);
- if (options.shouldBatch) {
- BatchRunner.runAsBatch(args, (List<String> args) {
- CommandLineOptions options = CommandLineOptions.parse(args);
- return _analyzeAll(options, true);
- });
- } else {
- _analyzeAll(options, false);
- }
-}
-
-_analyzeAll(CommandLineOptions options, bool isBatch) {
- if (!options.machineFormat) {
- stdout.writeln("Analyzing ${options.sourceFiles}...");
- }
- ErrorSeverity allResult = ErrorSeverity.NONE;
- for (String sourcePath in options.sourceFiles) {
- sourcePath = sourcePath.trim();
- // check that file exists
- if (!new File(sourcePath).existsSync()) {
- print('File not found: $sourcePath');
- exitCode = ErrorSeverity.ERROR.ordinal;
- // fail fast; don't analyze more files
- return ErrorSeverity.ERROR;
- }
- // check that file is Dart file
- if (!AnalysisEngine.isDartFileName(sourcePath)) {
- print('$sourcePath is not a Dart file');
- exitCode = ErrorSeverity.ERROR.ordinal;
- // fail fast; don't analyze more files
- return ErrorSeverity.ERROR;
- }
- ErrorSeverity status = _runAnalyzer(options, sourcePath, isBatch);
- allResult = allResult.max(status);
- }
- return allResult;
-}
-
-_runAnalyzer(CommandLineOptions options, String sourcePath, bool isBatch) {
- if (options.warmPerf) {
- int startTime = JavaSystem.currentTimeMillis();
- AnalyzerImpl analyzer =
- new AnalyzerImpl(sourcePath, options, startTime, isBatch);
- analyzer.analyzeSync(printMode: 2);
-
- for (int i = 0; i < 8; i++) {
- startTime = JavaSystem.currentTimeMillis();
- analyzer = new AnalyzerImpl(sourcePath, options, startTime, isBatch);
- analyzer.analyzeSync(printMode: 0);
- }
-
- PerformanceTag.reset();
- startTime = JavaSystem.currentTimeMillis();
- analyzer = new AnalyzerImpl(sourcePath, options, startTime, isBatch);
- return analyzer.analyzeSync();
- }
- int startTime = JavaSystem.currentTimeMillis();
- AnalyzerImpl analyzer =
- new AnalyzerImpl(sourcePath, options, startTime, isBatch);
- var errorSeverity = analyzer.analyzeSync();
- if (errorSeverity == ErrorSeverity.ERROR) {
- exitCode = errorSeverity.ordinal;
- }
- if (options.warningsAreFatal && errorSeverity == ErrorSeverity.WARNING) {
- exitCode = errorSeverity.ordinal;
- }
- return errorSeverity;
-}
-
-typedef ErrorSeverity BatchRunnerHandler(List<String> args);
-
-/// Provides a framework to read command line options from stdin and feed them to a callback.
-class BatchRunner {
- /**
- * Run the tool in 'batch' mode, receiving command lines through stdin and returning pass/fail
- * status through stdout. This feature is intended for use in unit testing.
- */
- static void runAsBatch(List<String> sharedArgs, BatchRunnerHandler handler) {
- stdout.writeln('>>> BATCH START');
- Stopwatch stopwatch = new Stopwatch();
- stopwatch.start();
- int testsFailed = 0;
- int totalTests = 0;
- ErrorSeverity batchResult = ErrorSeverity.NONE;
- // read line from stdin
- Stream cmdLine =
- stdin.transform(UTF8.decoder).transform(new LineSplitter());
- cmdLine.listen((String line) {
- // may be finish
- if (line.isEmpty) {
- var time = stopwatch.elapsedMilliseconds;
- stdout.writeln(
- '>>> BATCH END (${totalTests - testsFailed}/$totalTests) ${time}ms');
- exitCode = batchResult.ordinal;
- }
- // prepare aruments
- var args;
- {
- var lineArgs = line.split(new RegExp('\\s+'));
- args = new List<String>();
- args.addAll(sharedArgs);
- args.addAll(lineArgs);
- args.remove('-b');
- args.remove('--batch');
- }
- // analyze single set of arguments
- try {
- totalTests++;
- ErrorSeverity result = handler(args);
- bool resultPass = result != ErrorSeverity.ERROR;
- if (!resultPass) {
- testsFailed++;
- }
- batchResult = batchResult.max(result);
- // Write stderr end token and flush.
- stderr.writeln('>>> EOF STDERR');
- String resultPassString = resultPass ? 'PASS' : 'FAIL';
- stdout.writeln(
- '>>> TEST $resultPassString ${stopwatch.elapsedMilliseconds}ms');
- } catch (e, stackTrace) {
- stderr.writeln(e);
- stderr.writeln(stackTrace);
- stderr.writeln('>>> EOF STDERR');
- stdout.writeln('>>> TEST CRASH');
- }
- });
- }
-}
diff --git a/pkg/analyzer/lib/analyzer.dart b/pkg/analyzer/lib/analyzer.dart
index a4116c3..83a72a1 100644
--- a/pkg/analyzer/lib/analyzer.dart
+++ b/pkg/analyzer/lib/analyzer.dart
@@ -28,27 +28,27 @@
///
/// Throws an [AnalyzerErrorGroup] if any errors occurred, unless
/// [suppressErrors] is `true`, in which case any errors are discarded.
+///
+/// If [parseFunctionBodies] is [false] then only function signatures will be
+/// parsed.
CompilationUnit parseCompilationUnit(String contents,
- {String name, bool suppressErrors: false}) {
+ {String name, bool suppressErrors: false, bool parseFunctionBodies: true}) {
if (name == null) name = '<unknown source>';
var source = new StringSource(contents, name);
- var errorCollector = new _ErrorCollector();
- var reader = new CharSequenceReader(contents);
- var scanner = new Scanner(source, reader, errorCollector);
- var token = scanner.tokenize();
- var parser = new Parser(source, errorCollector);
- var unit = parser.parseCompilationUnit(token);
- unit.lineInfo = new LineInfo(scanner.lineStarts);
-
- if (errorCollector.hasErrors && !suppressErrors) throw errorCollector.group;
-
- return unit;
+ return _parseSource(contents, source,
+ suppressErrors: suppressErrors, parseFunctionBodies: parseFunctionBodies);
}
/// Parses a Dart file into an AST.
-CompilationUnit parseDartFile(String path) {
+///
+/// Throws an [AnalyzerErrorGroup] if any errors occurred, unless
+/// [suppressErrors] is `true`, in which case any errors are discarded.
+///
+/// If [parseFunctionBodies] is [false] then only function signatures will be
+/// parsed.
+CompilationUnit parseDartFile(String path,
+ {bool suppressErrors: false, bool parseFunctionBodies: true}) {
String contents = new File(path).readAsStringSync();
- var errorCollector = new _ErrorCollector();
var sourceFactory = new SourceFactory([new FileUriResolver()]);
var absolutePath = pathos.absolute(path);
@@ -60,14 +60,22 @@
throw new ArgumentError("Source $source doesn't exist");
}
+ return _parseSource(contents, source,
+ suppressErrors: suppressErrors, parseFunctionBodies: parseFunctionBodies);
+}
+
+CompilationUnit _parseSource(String contents, Source source,
+ {bool suppressErrors: false, bool parseFunctionBodies: true}) {
var reader = new CharSequenceReader(contents);
+ var errorCollector = new _ErrorCollector();
var scanner = new Scanner(source, reader, errorCollector);
var token = scanner.tokenize();
- var parser = new Parser(source, errorCollector);
- var unit = parser.parseCompilationUnit(token);
- unit.lineInfo = new LineInfo(scanner.lineStarts);
+ var parser = new Parser(source, errorCollector)
+ ..parseFunctionBodies = parseFunctionBodies;
+ var unit = parser.parseCompilationUnit(token)
+ ..lineInfo = new LineInfo(scanner.lineStarts);
- if (errorCollector.hasErrors) throw errorCollector.group;
+ if (errorCollector.hasErrors && !suppressErrors) throw errorCollector.group;
return unit;
}
diff --git a/pkg/analyzer/lib/options.dart b/pkg/analyzer/lib/options.dart
deleted file mode 100644
index 06aaa84..0000000
--- a/pkg/analyzer/lib/options.dart
+++ /dev/null
@@ -1,443 +0,0 @@
-// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-library options;
-
-import 'dart:io';
-
-import 'package:args/args.dart';
-
-const _BINARY_NAME = 'dartanalyzer';
-
-/**
- * Analyzer commandline configuration options.
- */
-class CommandLineOptions {
- /** The path to the dart SDK */
- final String dartSdkPath;
-
- /** A table mapping the names of defined variables to their values. */
- final Map<String, String> definedVariables;
-
- /** Whether to report hints */
- final bool disableHints;
-
- /** Whether to display version information */
- final bool displayVersion;
-
- /**
- * Whether to enable null-aware operators (DEP 9).
- */
- final bool enableNullAwareOperators;
-
- /**
- * Whether to strictly follow the specification when generating warnings on
- * "call" methods (fixes dartbug.com/21938).
- */
- final bool enableStrictCallChecks;
-
- /**
- * Whether to treat type mismatches found during constant evaluation as
- * errors.
- */
- final bool enableTypeChecks;
-
- /** Whether to ignore unrecognized flags */
- final bool ignoreUnrecognizedFlags;
-
- /** Whether to log additional analysis messages and exceptions */
- final bool log;
-
- /** Whether to use machine format for error display */
- final bool machineFormat;
-
- /** The path to the package root */
- final String packageRootPath;
-
- /** Whether to show performance statistics */
- final bool perf;
-
- /** Batch mode (for unit testing) */
- final bool shouldBatch;
-
- /** Whether to show package: warnings */
- final bool showPackageWarnings;
-
- /** Whether to show SDK warnings */
- final bool showSdkWarnings;
-
- /** The source files to analyze */
- final List<String> sourceFiles;
-
- /** Whether to show both cold and hot performance statistics */
- final bool warmPerf;
-
- /** Whether to treat warnings as fatal */
- final bool warningsAreFatal;
-
- /** A table mapping library URIs to the file system path where the library
- * source is located.
- */
- final Map<String, String> customUrlMappings;
-
- /**
- * Initialize options from the given parsed [args].
- */
- CommandLineOptions._fromArgs(ArgResults args,
- Map<String, String> definedVariables,
- Map<String, String> customUrlMappings)
- : dartSdkPath = args['dart-sdk'],
- this.definedVariables = definedVariables,
- disableHints = args['no-hints'],
- displayVersion = args['version'],
- enableNullAwareOperators = args['enable-null-aware-operators'],
- enableStrictCallChecks = args['enable-strict-call-checks'],
- enableTypeChecks = args['enable_type_checks'],
- ignoreUnrecognizedFlags = args['ignore-unrecognized-flags'],
- log = args['log'],
- machineFormat = args['machine'] || args['format'] == 'machine',
- packageRootPath = args['package-root'],
- perf = args['perf'],
- shouldBatch = args['batch'],
- showPackageWarnings = args['show-package-warnings'] ||
- args['package-warnings'],
- showSdkWarnings = args['show-sdk-warnings'] || args['warnings'],
- sourceFiles = args.rest,
- warmPerf = args['warm-perf'],
- warningsAreFatal = args['fatal-warnings'],
- this.customUrlMappings = customUrlMappings;
-
- /**
- * Parse [args] into [CommandLineOptions] describing the specified
- * analyzer options. In case of a format error, prints error and exists.
- */
- static CommandLineOptions parse(List<String> args) {
- CommandLineOptions options = _parse(args);
- // check SDK
- {
- var sdkPath = options.dartSdkPath;
- // check that SDK is specified
- if (sdkPath == null) {
- print('Usage: $_BINARY_NAME: no Dart SDK found.');
- exit(15);
- }
- // check that SDK is existing directory
- if (!(new Directory(sdkPath)).existsSync()) {
- print('Usage: $_BINARY_NAME: invalid Dart SDK path: $sdkPath');
- exit(15);
- }
- }
- // OK
- return options;
- }
-
- static String _getVersion() {
- try {
- // This is relative to bin/snapshot, so ../..
- String versionPath =
- Platform.script.resolve('../../version').toFilePath();
- File versionFile = new File(versionPath);
- return versionFile.readAsStringSync().trim();
- } catch (_) {
- // This happens when the script is not running in the context of an SDK.
- return "<unknown>";
- }
- }
-
- static CommandLineOptions _parse(List<String> args) {
- args = args.expand((String arg) => arg.split('=')).toList();
- var parser = new CommandLineParser()
- ..addFlag('batch',
- abbr: 'b',
- help: 'Run in batch mode',
- defaultsTo: false,
- negatable: false)
- ..addOption('dart-sdk', help: 'The path to the Dart SDK')
- ..addOption('package-root',
- abbr: 'p',
- help: 'The path to the package root. The flag package-root is deprecated. Remove to use package information computed by pub.')
- ..addOption('format',
- help: 'Specifies the format in which errors are displayed')
- ..addFlag('machine',
- help: 'Print errors in a format suitable for parsing (deprecated)',
- defaultsTo: false,
- negatable: false)
- ..addFlag('version',
- help: 'Print the analyzer version',
- defaultsTo: false,
- negatable: false)
- ..addFlag('no-hints',
- help: 'Do not show hint results', defaultsTo: false, negatable: false)
- ..addFlag('ignore-unrecognized-flags',
- help: 'Ignore unrecognized command line flags',
- defaultsTo: false,
- negatable: false)
- ..addFlag('fatal-warnings',
- help: 'Treat non-type warnings as fatal',
- defaultsTo: false,
- negatable: false)
- ..addFlag('package-warnings',
- help: 'Show warnings from package: imports',
- defaultsTo: false,
- negatable: false)
- ..addFlag('show-package-warnings',
- help: 'Show warnings from package: imports (deprecated)',
- defaultsTo: false,
- negatable: false)
- ..addFlag('perf',
- help: 'Show performance statistics',
- defaultsTo: false,
- negatable: false)
- ..addFlag('warnings',
- help: 'Show warnings from SDK imports',
- defaultsTo: false,
- negatable: false)
- ..addFlag('show-sdk-warnings',
- help: 'Show warnings from SDK imports (deprecated)',
- defaultsTo: false,
- negatable: false)
- ..addFlag('help',
- abbr: 'h',
- help: 'Display this help message',
- defaultsTo: false,
- negatable: false)
- ..addOption('url-mapping',
- help: '--url-mapping=libraryUri,/path/to/library.dart directs the '
- 'analyzer to use "library.dart" as the source for an import ' 'of "libraryUri"',
- allowMultiple: true)
- //
- // Hidden flags.
- //
- ..addFlag('enable-async',
- help: 'Enable support for the proposed async feature',
- defaultsTo: false,
- negatable: false,
- hide: true)
- ..addFlag('enable-enum',
- help: 'Enable support for the proposed enum feature',
- defaultsTo: false,
- negatable: false,
- hide: true)
- ..addFlag('enable-null-aware-operators',
- help: 'Enable support for null-aware operators (DEP 9)',
- defaultsTo: false,
- negatable: false,
- hide: true)
- ..addFlag('enable-strict-call-checks',
- help: 'Fix issue 21938',
- defaultsTo: false,
- negatable: false,
- hide: true)
- ..addFlag('log',
- help: 'Log additional messages and exceptions',
- defaultsTo: false,
- negatable: false,
- hide: true)
- ..addFlag('warm-perf',
- help: 'Show both cold and warm performance statistics',
- defaultsTo: false,
- negatable: false,
- hide: true)
- ..addFlag('enable_type_checks',
- help: 'Check types in constant evaluation',
- defaultsTo: false,
- negatable: false,
- hide: true);
-
- try {
- // TODO(scheglov) https://code.google.com/p/dart/issues/detail?id=11061
- args =
- args.map((String arg) => arg == '-batch' ? '--batch' : arg).toList();
- Map<String, String> definedVariables = <String, String>{};
- var results = parser.parse(args, definedVariables);
- // help requests
- if (results['help']) {
- _showUsage(parser);
- exit(0);
- }
- // batch mode and input files
- if (results['batch']) {
- if (results.rest.isNotEmpty) {
- print('No source files expected in the batch mode.');
- _showUsage(parser);
- exit(15);
- }
- } else if (results['version']) {
- print('$_BINARY_NAME version ${_getVersion()}');
- exit(0);
- } else {
- if (results.rest.isEmpty) {
- _showUsage(parser);
- exit(15);
- }
- }
- Map<String, String> customUrlMappings = <String, String>{};
- for (String mapping in results['url-mapping']) {
- List<String> splitMapping = mapping.split(',');
- if (splitMapping.length != 2) {
- _showUsage(parser);
- exit(15);
- }
- customUrlMappings[splitMapping[0]] = splitMapping[1];
- }
- return new CommandLineOptions._fromArgs(
- results, definedVariables, customUrlMappings);
- } on FormatException catch (e) {
- print(e.message);
- _showUsage(parser);
- exit(15);
- }
- }
-
- static _showUsage(parser) {
- print('Usage: $_BINARY_NAME [options...] <libraries to analyze...>');
- print(parser.getUsage());
- print('');
- print('For more information, see http://www.dartlang.org/tools/analyzer.');
- }
-}
-
-/**
- * Commandline argument parser.
- *
- * TODO(pquitslund): when the args package supports ignoring unrecognized
- * options/flags, this class can be replaced with a simple [ArgParser] instance.
- */
-class CommandLineParser {
- final List<String> _knownFlags;
- final bool _alwaysIgnoreUnrecognized;
- final ArgParser _parser;
-
- /** Creates a new command line parser */
- CommandLineParser({bool alwaysIgnoreUnrecognized: false})
- : _knownFlags = <String>[],
- _alwaysIgnoreUnrecognized = alwaysIgnoreUnrecognized,
- _parser = new ArgParser(allowTrailingOptions: true);
-
- ArgParser get parser => _parser;
-
- /**
- * Defines a flag.
- *
- * See [ArgParser.addFlag()].
- */
- void addFlag(String name, {String abbr, String help, bool defaultsTo: false,
- bool negatable: true, void callback(bool value), bool hide: false}) {
- _knownFlags.add(name);
- _parser.addFlag(name,
- abbr: abbr,
- help: help,
- defaultsTo: defaultsTo,
- negatable: negatable,
- callback: callback,
- hide: hide);
- }
-
- /**
- * Defines a value-taking option.
- *
- * See [ArgParser.addOption()].
- */
- void addOption(String name, {String abbr, String help, List<String> allowed,
- Map<String, String> allowedHelp, String defaultsTo, void callback(value),
- bool allowMultiple: false}) {
- _knownFlags.add(name);
- _parser.addOption(name,
- abbr: abbr,
- help: help,
- allowed: allowed,
- allowedHelp: allowedHelp,
- defaultsTo: defaultsTo,
- callback: callback,
- allowMultiple: allowMultiple);
- }
-
- /**
- * Generates a string displaying usage information for the defined options.
- *
- * See [ArgParser.usage].
- */
- String getUsage() => _parser.usage;
-
- /**
- * Parses [args], a list of command-line arguments, matches them against the
- * flags and options defined by this parser, and returns the result. The
- * values of any defined variables are captured in the given map.
- *
- * See [ArgParser].
- */
- ArgResults parse(
- List<String> args, Map<String, String> definedVariables) => _parser
- .parse(_filterUnknowns(parseDefinedVariables(args, definedVariables)));
-
- List<String> parseDefinedVariables(
- List<String> args, Map<String, String> definedVariables) {
- int count = args.length;
- List<String> remainingArgs = <String>[];
- for (int i = 0; i < count; i++) {
- String arg = args[i];
- if (arg == '--') {
- while (i < count) {
- remainingArgs.add(args[i++]);
- }
- } else if (arg.startsWith("-D")) {
- definedVariables[arg.substring(2)] = args[++i];
- } else {
- remainingArgs.add(arg);
- }
- }
- return remainingArgs;
- }
-
- List<String> _filterUnknowns(List<String> args) {
-
- // Only filter args if the ignore flag is specified, or if
- // _alwaysIgnoreUnrecognized was set to true
- if (_alwaysIgnoreUnrecognized ||
- args.contains('--ignore-unrecognized-flags')) {
-
- //TODO(pquitslund): replace w/ the following once library skew issues are
- // sorted out
- //return args.where((arg) => !arg.startsWith('--') ||
- // _knownFlags.contains(arg.substring(2)));
-
- // Filter all unrecognized flags and options.
- List<String> filtered = <String>[];
- for (int i = 0; i < args.length; ++i) {
- String arg = args[i];
- if (arg.startsWith('--') && arg.length > 2) {
- String option = arg.substring(2);
- // strip the last '=value'
- int equalsOffset = option.lastIndexOf('=');
- if (equalsOffset != -1) {
- option = option.substring(0, equalsOffset);
- }
- // check the option
- if (!_knownFlags.contains(option)) {
- //print('remove: $arg');
- //"eat" params by advancing to the next flag/option
- i = _getNextFlagIndex(args, i);
- } else {
- filtered.add(arg);
- }
- } else {
- filtered.add(arg);
- }
- }
-
- return filtered;
- } else {
- return args;
- }
- }
-
- _getNextFlagIndex(args, i) {
- for (; i < args.length; ++i) {
- if (args[i].startsWith('--')) {
- return i;
- }
- }
- return i;
- }
-}
diff --git a/pkg/analyzer/lib/plugin/plugin.dart b/pkg/analyzer/lib/plugin/plugin.dart
deleted file mode 100644
index c81c83c..0000000
--- a/pkg/analyzer/lib/plugin/plugin.dart
+++ /dev/null
@@ -1,130 +0,0 @@
-// Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-library analyzer.plugin.plugin;
-
-/**
- * A function used to register the given [extension] to the extension point with
- * the given unique [identifier].
- *
- * An [ExtensionError] will be thrown if the [extension] is not appropriate
- * for the extension point, such as an [extension] that does not implement the
- * required interface.
- */
-typedef void RegisterExtension(String identifier, Object extension);
-
-/**
- * A function used to register an extension point with the given simple
- * [identifier]. If given, the [validator] will be used to validate extensions
- * to the extension point.
- *
- * An [ExtensionError] will be thrown if the extension point cannot be
- * registered, such as when a plugin attempts to define two extension points
- * with the same simple identifier.
- */
-typedef ExtensionPoint RegisterExtensionPoint(String identifier,
- [ValidateExtension validateExtension]);
-
-/**
- * A function used by a plugin to validate an [extension] to a extension point.
- *
- * An [ExtensionError] should be thrown if the [extension] is not valid for the
- * extension point, such as an [extension] that does not implement the required
- * interface.
- */
-typedef void ValidateExtension(Object extension);
-
-/**
- * An exception indicating that an error occurred while attempting to register
- * either an extension or an extension point.
- *
- * Clients are not expected to subtype this class.
- */
-class ExtensionError implements Exception {
- /**
- * The message describing the error that occurred.
- */
- final String message;
-
- /**
- * Initialize a newly created error to have the given message.
- */
- ExtensionError(this.message);
-}
-
-/**
- * A representation of an extension point.
- *
- * Clients are not expected to subtype this class.
- */
-abstract class ExtensionPoint {
- /**
- * Return an immutable list containing all of the extensions that were
- * registered for this extension point.
- */
- List<Object> get extensions;
-
- /**
- * Return the plugin that defined this extension point.
- */
- Plugin get plugin;
-
- /**
- * Return the identifier used to uniquely identify this extension point within
- * the defining plugin.
- */
- String get simpleIdentifier;
-
- /**
- * Return the identifier used to uniquely identify this extension point. The
- * unique identifier is the identifier for the plugin, followed by a period
- * (`.`), followed by the [simpleIdentifier] for the extension point.
- */
- String get uniqueIdentifier;
-}
-
-/**
- * A contribution to the analysis server that can extend the behavior of the
- * server while also allowing other plugins to extend it's behavior.
- *
- * Clients are expected to subtype this class when implementing plugins.
- */
-abstract class Plugin {
- /**
- * Return the identifier used to uniquely identify this plugin.
- */
- String get uniqueIdentifier;
-
- /**
- * Use the [register] function to register all of the extension points
- * contributed by this plugin.
- *
- * Clients should not invoke the [register] function after this method has
- * returned.
- */
- void registerExtensionPoints(RegisterExtensionPoint register);
-
- /**
- * Use the [register] function to register all of the extensions contributed
- * by this plugin.
- *
- * Clients should not invoke the [register] function after this method has
- * returned.
- */
- void registerExtensions(RegisterExtension register);
-
- /**
- * Return a unique identifier created from the unique identifier from the
- * [plugin] and the [simpleIdentifier].
- */
- static String buildUniqueIdentifier(Plugin plugin, String simpleIdentifier) =>
- join(plugin.uniqueIdentifier, simpleIdentifier);
-
- /**
- * Return an identifier created by joining the [pluginIdentifier] and the
- * [simpleIdentifier].
- */
- static String join(String pluginIdentifier, String simpleIdentifier) =>
- '$pluginIdentifier.$simpleIdentifier';
-}
diff --git a/pkg/analyzer/lib/plugin/task.dart b/pkg/analyzer/lib/plugin/task.dart
index 42c9214..8ea132f 100644
--- a/pkg/analyzer/lib/plugin/task.dart
+++ b/pkg/analyzer/lib/plugin/task.dart
@@ -8,9 +8,9 @@
*/
library analyzer.plugin.task;
-import 'package:analyzer/plugin/plugin.dart';
import 'package:analyzer/src/plugin/engine_plugin.dart';
import 'package:analyzer/task/model.dart';
+import 'package:plugin/plugin.dart';
/**
* The identifier of the extension point that allows plugins to register new
diff --git a/pkg/analyzer/lib/src/analyzer_impl.dart b/pkg/analyzer/lib/src/analyzer_impl.dart
deleted file mode 100644
index 1ecfd83..0000000
--- a/pkg/analyzer/lib/src/analyzer_impl.dart
+++ /dev/null
@@ -1,498 +0,0 @@
-// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-library analyzer_impl;
-
-import 'dart:async';
-import 'dart:collection';
-import 'dart:io';
-
-import 'package:analyzer/file_system/file_system.dart' show Folder;
-import 'package:analyzer/file_system/physical_file_system.dart';
-import 'package:analyzer/source/package_map_provider.dart';
-import 'package:analyzer/source/package_map_resolver.dart';
-import 'package:analyzer/source/pub_package_map_provider.dart';
-import 'package:analyzer/src/error_formatter.dart';
-import 'package:analyzer/src/generated/java_core.dart' show JavaSystem;
-import 'package:analyzer/src/generated/java_engine.dart';
-import 'package:analyzer/src/generated/utilities_general.dart';
-
-import '../options.dart';
-import 'generated/constant.dart';
-import 'generated/element.dart';
-import 'generated/engine.dart';
-import 'generated/error.dart';
-import 'generated/java_io.dart';
-import 'generated/sdk_io.dart';
-import 'generated/source_io.dart';
-
-DirectoryBasedDartSdk sdk;
-
-/**
- * The maximum number of sources for which AST structures should be kept in the cache.
- */
-const int _MAX_CACHE_SIZE = 512;
-
-/// Analyzes single library [File].
-class AnalyzerImpl {
- final String sourcePath;
-
- final CommandLineOptions options;
- final int startTime;
-
- /**
- * True if the analyzer is running in batch mode.
- */
- final bool isBatch;
-
- ContentCache contentCache = new ContentCache();
-
- SourceFactory sourceFactory;
- AnalysisContext context;
- Source librarySource;
- /// All [Source]s references by the analyzed library.
- final Set<Source> sources = new Set<Source>();
-
- /// All [AnalysisErrorInfo]s in the analyzed library.
- final List<AnalysisErrorInfo> errorInfos = new List<AnalysisErrorInfo>();
-
- /// [HashMap] between sources and analysis error infos.
- final HashMap<Source, AnalysisErrorInfo> sourceErrorsMap =
- new HashMap<Source, AnalysisErrorInfo>();
-
- /**
- * If the file specified on the command line is part of a package, the name
- * of that package. Otherwise `null`. This allows us to analyze the file
- * specified on the command line as though it is reached via a "package:"
- * URI, but avoid suppressing its output in the event that the user has not
- * specified the "--package-warnings" option.
- */
- String _selfPackageName;
-
- AnalyzerImpl(String sourcePath, this.options, this.startTime, this.isBatch)
- : sourcePath = _normalizeSourcePath(sourcePath) {
- if (sdk == null) {
- sdk = new DirectoryBasedDartSdk(new JavaFile(options.dartSdkPath));
- }
- }
-
- /// Returns the maximal [ErrorSeverity] of the recorded errors.
- ErrorSeverity get maxErrorSeverity {
- var status = ErrorSeverity.NONE;
- for (AnalysisErrorInfo errorInfo in errorInfos) {
- for (AnalysisError error in errorInfo.errors) {
- if (!_isDesiredError(error)) {
- continue;
- }
- var severity = computeSeverity(error, options.enableTypeChecks);
- status = status.max(severity);
- }
- }
- return status;
- }
-
- void addCompilationUnitSource(CompilationUnitElement unit,
- Set<LibraryElement> libraries, Set<CompilationUnitElement> units) {
- if (unit == null || units.contains(unit)) {
- return;
- }
- units.add(unit);
- sources.add(unit.source);
- }
-
- void addLibrarySources(LibraryElement library, Set<LibraryElement> libraries,
- Set<CompilationUnitElement> units) {
- if (library == null || !libraries.add(library)) {
- return;
- }
- // may be skip library
- {
- UriKind uriKind = library.source.uriKind;
- // Optionally skip package: libraries.
- if (!options.showPackageWarnings && _isOtherPackage(library.source.uri)) {
- return;
- }
- // Optionally skip SDK libraries.
- if (!options.showSdkWarnings && uriKind == UriKind.DART_URI) {
- return;
- }
- }
- // add compilation units
- addCompilationUnitSource(library.definingCompilationUnit, libraries, units);
- for (CompilationUnitElement child in library.parts) {
- addCompilationUnitSource(child, libraries, units);
- }
- // add referenced libraries
- for (LibraryElement child in library.importedLibraries) {
- addLibrarySources(child, libraries, units);
- }
- for (LibraryElement child in library.exportedLibraries) {
- addLibrarySources(child, libraries, units);
- }
- }
-
- /**
- * Treats the [sourcePath] as the top level library and analyzes it using a
- * asynchronous algorithm over the analysis engine.
- */
- void analyzeAsync() {
- setupForAnalysis();
- _analyzeAsync();
- }
-
- /**
- * Treats the [sourcePath] as the top level library and analyzes it using a
- * synchronous algorithm over the analysis engine. If [printMode] is `0`,
- * then no error or performance information is printed. If [printMode] is `1`,
- * then both will be printed. If [printMode] is `2`, then only performance
- * information will be printed, and it will be marked as being for a cold VM.
- */
- ErrorSeverity analyzeSync({int printMode: 1}) {
- setupForAnalysis();
- return _analyzeSync(printMode);
- }
-
- Source computeLibrarySource() {
- JavaFile sourceFile = new JavaFile(sourcePath);
- Source source = sdk.fromFileUri(sourceFile.toURI());
- if (source != null) {
- return source;
- }
- source = new FileBasedSource.con2(sourceFile.toURI(), sourceFile);
- Uri uri = context.sourceFactory.restoreUri(source);
- if (uri == null) {
- return source;
- }
- return new FileBasedSource.con2(uri, sourceFile);
- }
-
- /**
- * Create and return the source factory to be used by the analysis context.
- */
- SourceFactory createSourceFactory() {
- List<UriResolver> resolvers = [
- new CustomUriResolver(options.customUrlMappings),
- new DartUriResolver(sdk)
- ];
- if (options.packageRootPath != null) {
- JavaFile packageDirectory = new JavaFile(options.packageRootPath);
- resolvers.add(new PackageUriResolver([packageDirectory]));
- } else {
- PubPackageMapProvider pubPackageMapProvider =
- new PubPackageMapProvider(PhysicalResourceProvider.INSTANCE, sdk);
- PackageMapInfo packageMapInfo = pubPackageMapProvider.computePackageMap(
- PhysicalResourceProvider.INSTANCE.getResource('.'));
- Map<String, List<Folder>> packageMap = packageMapInfo.packageMap;
- if (packageMap != null) {
- resolvers.add(new PackageMapUriResolver(
- PhysicalResourceProvider.INSTANCE, packageMap));
- }
- }
- resolvers.add(new FileUriResolver());
- return new SourceFactory(resolvers);
- }
-
- void prepareAnalysisContext() {
- sourceFactory = createSourceFactory();
- context = AnalysisEngine.instance.createAnalysisContext();
- context.sourceFactory = sourceFactory;
- Map<String, String> definedVariables = options.definedVariables;
- if (!definedVariables.isEmpty) {
- DeclaredVariables declaredVariables = context.declaredVariables;
- definedVariables.forEach((String variableName, String value) {
- declaredVariables.define(variableName, value);
- });
- }
- // Uncomment the following to have errors reported on stdout and stderr
- AnalysisEngine.instance.logger = new StdLogger(options.log);
-
- // set options for context
- AnalysisOptionsImpl contextOptions = new AnalysisOptionsImpl();
- contextOptions.cacheSize = _MAX_CACHE_SIZE;
- contextOptions.hint = !options.disableHints;
- contextOptions.enableNullAwareOperators = options.enableNullAwareOperators;
- contextOptions.enableStrictCallChecks = options.enableStrictCallChecks;
- contextOptions.analyzeFunctionBodiesPredicate =
- _analyzeFunctionBodiesPredicate;
- contextOptions.generateImplicitErrors = options.showPackageWarnings;
- contextOptions.generateSdkErrors = options.showSdkWarnings;
- context.analysisOptions = contextOptions;
-
- librarySource = computeLibrarySource();
-
- Uri libraryUri = librarySource.uri;
- if (libraryUri.scheme == 'package' && libraryUri.pathSegments.length > 0) {
- _selfPackageName = libraryUri.pathSegments[0];
- }
-
- // Create and add a ChangeSet
- ChangeSet changeSet = new ChangeSet();
- changeSet.addedSource(librarySource);
- context.applyChanges(changeSet);
- }
-
- /// Fills [errorInfos] using [sources].
- void prepareErrors() {
- for (Source source in sources) {
- context.computeErrors(source);
- var sourceErrors = context.getErrors(source);
- errorInfos.add(sourceErrors);
- }
- }
-
- /// Fills [sources].
- void prepareSources(LibraryElement library) {
- var units = new Set<CompilationUnitElement>();
- var libraries = new Set<LibraryElement>();
- addLibrarySources(library, libraries, units);
- }
-
- /**
- * Setup local fields such as the analysis context for analysis.
- */
- void setupForAnalysis() {
- sources.clear();
- errorInfos.clear();
- if (sourcePath == null) {
- throw new ArgumentError("sourcePath cannot be null");
- }
- // prepare context
- prepareAnalysisContext();
- }
-
- /// The async version of the analysis
- void _analyzeAsync() {
- new Future(context.performAnalysisTask).then((AnalysisResult result) {
- List<ChangeNotice> notices = result.changeNotices;
- if (result.hasMoreWork) {
- // There is more work, record the set of sources, and then call self
- // again to perform next task
- for (ChangeNotice notice in notices) {
- sources.add(notice.source);
- sourceErrorsMap[notice.source] = notice;
- }
- return _analyzeAsync();
- }
- //
- // There are not any more tasks, set error code and print performance
- // numbers.
- //
- // prepare errors
- sourceErrorsMap.forEach((k, v) {
- errorInfos.add(sourceErrorsMap[k]);
- });
-
- // print errors and performance numbers
- _printErrorsAndPerf();
-
- // compute max severity and set exitCode
- ErrorSeverity status = maxErrorSeverity;
- if (status == ErrorSeverity.WARNING && options.warningsAreFatal) {
- status = ErrorSeverity.ERROR;
- }
- exitCode = status.ordinal;
- }).catchError((ex, st) {
- AnalysisEngine.instance.logger.logError("$ex\n$st");
- });
- }
-
- bool _analyzeFunctionBodiesPredicate(Source source) {
- // TODO(paulberry): This function will need to be updated when we add the
- // ability to suppress errors, warnings, and hints for files reached via
- // custom URI's using the "--url-mapping" flag.
- if (source.uri.scheme == 'dart') {
- if (isBatch) {
- // When running in batch mode, the SDK files are cached from one
- // analysis run to the next. So we need to parse function bodies even
- // if the user hasn't asked for errors/warnings from the SDK, since
- // they might ask for errors/warnings from the SDK in the future.
- return true;
- }
- return options.showSdkWarnings;
- }
- if (_isOtherPackage(source.uri)) {
- return options.showPackageWarnings;
- }
- return true;
- }
-
- /// The sync version of analysis.
- ErrorSeverity _analyzeSync(int printMode) {
- // don't try to analyze parts
- if (context.computeKindOf(librarySource) == SourceKind.PART) {
- print("Only libraries can be analyzed.");
- print("$sourcePath is a part and can not be analyzed.");
- return ErrorSeverity.ERROR;
- }
- // resolve library
- var libraryElement = context.computeLibraryElement(librarySource);
- // prepare source and errors
- prepareSources(libraryElement);
- prepareErrors();
-
- // print errors and performance numbers
- if (printMode == 1) {
- _printErrorsAndPerf();
- } else if (printMode == 2) {
- _printColdPerf();
- }
-
- // compute max severity and set exitCode
- ErrorSeverity status = maxErrorSeverity;
- if (status == ErrorSeverity.WARNING && options.warningsAreFatal) {
- status = ErrorSeverity.ERROR;
- }
- return status;
- }
-
- bool _isDesiredError(AnalysisError error) {
- if (error.errorCode.type == ErrorType.TODO) {
- return false;
- }
- if (computeSeverity(error, options.enableTypeChecks) ==
- ErrorSeverity.INFO &&
- options.disableHints) {
- return false;
- }
- return true;
- }
-
- /**
- * Determine whether the given URI refers to a package other than the package
- * being analyzed.
- */
- bool _isOtherPackage(Uri uri) {
- if (uri.scheme != 'package') {
- return false;
- }
- if (_selfPackageName != null &&
- uri.pathSegments.length > 0 &&
- uri.pathSegments[0] == _selfPackageName) {
- return false;
- }
- return true;
- }
-
- _printColdPerf() {
- // print cold VM performance numbers
- int totalTime = JavaSystem.currentTimeMillis() - startTime;
- int otherTime = totalTime;
- for (PerformanceTag tag in PerformanceTag.all) {
- if (tag != PerformanceTag.UNKNOWN) {
- int tagTime = tag.elapsedMs;
- stdout.writeln('${tag.label}-cold:$tagTime');
- otherTime -= tagTime;
- }
- }
- stdout.writeln('other-cold:$otherTime');
- stdout.writeln("total-cold:$totalTime");
- }
-
- _printErrorsAndPerf() {
- // The following is a hack. We currently print out to stderr to ensure that
- // when in batch mode we print to stderr, this is because the prints from
- // batch are made to stderr. The reason that options.shouldBatch isn't used
- // is because when the argument flags are constructed in BatchRunner and
- // passed in from batch mode which removes the batch flag to prevent the
- // "cannot have the batch flag and source file" error message.
- IOSink sink = options.machineFormat ? stderr : stdout;
-
- // print errors
- ErrorFormatter formatter =
- new ErrorFormatter(sink, options, _isDesiredError);
- formatter.formatErrors(errorInfos);
-
- // print performance numbers
- if (options.perf || options.warmPerf) {
- int totalTime = JavaSystem.currentTimeMillis() - startTime;
- int otherTime = totalTime;
- for (PerformanceTag tag in PerformanceTag.all) {
- if (tag != PerformanceTag.UNKNOWN) {
- int tagTime = tag.elapsedMs;
- stdout.writeln('${tag.label}:$tagTime');
- otherTime -= tagTime;
- }
- }
- stdout.writeln('other:$otherTime');
- stdout.writeln("total:$totalTime");
- }
- }
-
- /**
- * Compute the severity of the error; however, if
- * [enableTypeChecks] is false, then de-escalate checked-mode compile time
- * errors to a severity of [ErrorSeverity.INFO].
- */
- static ErrorSeverity computeSeverity(
- AnalysisError error, bool enableTypeChecks) {
- if (!enableTypeChecks &&
- error.errorCode.type == ErrorType.CHECKED_MODE_COMPILE_TIME_ERROR) {
- return ErrorSeverity.INFO;
- }
- return error.errorCode.errorSeverity;
- }
-
- static JavaFile getPackageDirectoryFor(JavaFile sourceFile) {
- // we are going to ask parent file, so get absolute path
- sourceFile = sourceFile.getAbsoluteFile();
- // look in the containing directories
- JavaFile dir = sourceFile.getParentFile();
- while (dir != null) {
- JavaFile packagesDir = new JavaFile.relative(dir, "packages");
- if (packagesDir.exists()) {
- return packagesDir;
- }
- dir = dir.getParentFile();
- }
- // not found
- return null;
- }
-
- /**
- * Convert [sourcePath] into an absolute path.
- */
- static String _normalizeSourcePath(String sourcePath) {
- return new File(sourcePath).absolute.path;
- }
-}
-
-/**
- * This [Logger] prints out information comments to [stdout] and error messages
- * to [stderr].
- */
-class StdLogger extends Logger {
- final bool log;
-
- StdLogger(this.log);
-
- @override
- void logError(String message, [CaughtException exception]) {
- stderr.writeln(message);
- if (exception != null) {
- stderr.writeln(exception);
- }
- }
-
- @override
- void logError2(String message, Object exception) {
- stderr.writeln(message);
- }
-
- @override
- void logInformation(String message, [CaughtException exception]) {
- if (log) {
- stdout.writeln(message);
- if (exception != null) {
- stderr.writeln(exception);
- }
- }
- }
-
- @override
- void logInformation2(String message, Object exception) {
- if (log) {
- stdout.writeln(message);
- }
- }
-}
diff --git a/pkg/analyzer/lib/src/context/cache.dart b/pkg/analyzer/lib/src/context/cache.dart
index 516a895..5ae41bd 100644
--- a/pkg/analyzer/lib/src/context/cache.dart
+++ b/pkg/analyzer/lib/src/context/cache.dart
@@ -11,7 +11,9 @@
show AnalysisEngine, CacheState, InternalAnalysisContext, RetentionPriority;
import 'package:analyzer/src/generated/html.dart';
import 'package:analyzer/src/generated/java_engine.dart';
+import 'package:analyzer/src/generated/source.dart';
import 'package:analyzer/src/generated/utilities_collection.dart';
+import 'package:analyzer/src/generated/utilities_general.dart';
import 'package:analyzer/task/model.dart';
/**
@@ -133,6 +135,8 @@
* Associate the given [entry] with the given [target].
*/
void put(AnalysisTarget target, CacheEntry entry) {
+ entry._cache = this;
+ entry._target = target;
entry.fixExceptionState();
int count = _partitions.length;
for (int i = 0; i < count; i++) {
@@ -212,6 +216,18 @@
}
}
}
+
+ ResultData _getDataFor(TargetedResult result) {
+ AnalysisTarget target = result.target;
+ int count = _partitions.length;
+ for (int i = 0; i < count; i++) {
+ if (_partitions[i].contains(target)) {
+ CacheEntry entry = _partitions[i].get(target);
+ return entry._getResultData(result.result);
+ }
+ }
+ return null;
+ }
}
/**
@@ -226,6 +242,16 @@
static int _EXPLICITLY_ADDED_FLAG = 0;
/**
+ * The cache that contains this entry.
+ */
+ AnalysisCache _cache;
+
+ /**
+ * The target this entry is about.
+ */
+ AnalysisTarget _target;
+
+ /**
* The most recent time at which the state of the target matched the state
* represented by this entry.
*/
@@ -305,6 +331,17 @@
}
/**
+ * Return the memento of the result represented by the given [descriptor].
+ */
+ Object getMemento(ResultDescriptor descriptor) {
+ ResultData data = _resultMap[descriptor];
+ if (data == null) {
+ return null;
+ }
+ return data.memento;
+ }
+
+ /**
* Return the state of the result represented by the given [descriptor].
*/
CacheState getState(ResultDescriptor descriptor) {
@@ -348,9 +385,23 @@
}
/**
- * Set the [CacheState.ERROR] state for given [descriptors], their values to
- * the corresponding default values, and remember the [exception] that caused
- * this state.
+ * Return `true` if the state of the result represented by the given
+ * [descriptor] is [CacheState.INVALID].
+ */
+ bool isInvalid(ResultDescriptor descriptor) =>
+ getState(descriptor) == CacheState.INVALID;
+
+ /**
+ * Return `true` if the state of the result represented by the given
+ * [descriptor] is [CacheState.VALID].
+ */
+ bool isValid(ResultDescriptor descriptor) =>
+ getState(descriptor) == CacheState.VALID;
+
+ /**
+ * For each of the given [descriptors], set their states to
+ * [CacheState.ERROR], their values to the corresponding default values, and
+ * remember the [exception] that caused this state.
*/
void setErrorState(
CaughtException exception, List<ResultDescriptor> descriptors) {
@@ -363,8 +414,8 @@
this._exception = exception;
for (ResultDescriptor descriptor in descriptors) {
ResultData data = _getResultData(descriptor);
- data.state = CacheState.ERROR;
- data.value = descriptor.defaultValue;
+ TargetedResult thisResult = new TargetedResult(_target, descriptor);
+ data.invalidate(_cache, thisResult, CacheState.ERROR);
}
}
@@ -381,7 +432,11 @@
}
_validateStateChange(descriptor, state);
if (state == CacheState.INVALID) {
- _resultMap.remove(descriptor);
+ ResultData data = _resultMap[descriptor];
+ if (data != null) {
+ TargetedResult thisResult = new TargetedResult(_target, descriptor);
+ data.invalidate(_cache, thisResult, CacheState.INVALID);
+ }
} else {
ResultData data = _getResultData(descriptor);
data.state = state;
@@ -397,14 +452,21 @@
/**
* Set the value of the result represented by the given [descriptor] to the
- * given [value].
+ * given [value]. The optional [memento] may help to recompute [value] more
+ * efficiently after invalidation.
*/
/*<V>*/ void setValue(ResultDescriptor /*<V>*/ descriptor, dynamic /*V*/
- value) {
+ value, List<TargetedResult> dependedOn, Object memento) {
_validateStateChange(descriptor, CacheState.VALID);
ResultData data = _getResultData(descriptor);
+ {
+ TargetedResult thisResult = new TargetedResult(_target, descriptor);
+ data.invalidate(_cache, thisResult, CacheState.INVALID);
+ data.setDependedOnResults(_cache, thisResult, dependedOn);
+ }
data.state = CacheState.VALID;
data.value = value == null ? descriptor.defaultValue : value;
+ data.memento = memento;
}
@override
@@ -472,7 +534,7 @@
buffer.write('; ');
buffer.write(result.toString());
buffer.write(' = ');
- buffer.write(data..state);
+ buffer.write(data.state);
}
}
}
@@ -756,24 +818,100 @@
// can be typed.
class ResultData {
/**
+ * The [ResultDescriptor] this result is for.
+ */
+ final ResultDescriptor descriptor;
+
+ /**
* The state of the cached value.
*/
CacheState state;
/**
* The value being cached, or the default value for the result if there is no
- * value (for example, when the [state] is [CacheState.INVALID].
+ * value (for example, when the [state] is [CacheState.INVALID]).
*/
Object value;
/**
+ * The optional data that is remembered with [value] and, when [value] is
+ * invalidated, may help to recompute it more efficiently.
+ */
+ Object memento;
+
+ /**
+ * A list of the results on which this result depends.
+ */
+ List<TargetedResult> dependedOnResults = <TargetedResult>[];
+
+ /**
+ * A list of the results that depend on this result.
+ */
+ List<TargetedResult> dependentResults = <TargetedResult>[];
+
+ /**
* Initialize a newly created result holder to represent the value of data
* described by the given [descriptor].
*/
- ResultData(ResultDescriptor descriptor) {
+ ResultData(this.descriptor) {
state = CacheState.INVALID;
value = descriptor.defaultValue;
}
+
+ /**
+ * Add the given [result] to the list of dependent results.
+ */
+ void addDependentResult(TargetedResult result) {
+ dependentResults.add(result);
+ }
+
+ /**
+ * Invalidate this [ResultData] that corresponds to [thisResult] and
+ * propagate invalidation to the results that depend on this one.
+ */
+ void invalidate(
+ AnalysisCache cache, TargetedResult thisResult, CacheState newState) {
+ // Invalidate this result.
+ state = newState;
+ value = descriptor.defaultValue;
+ // Stop depending on other results.
+ List<TargetedResult> dependedOnResults = this.dependedOnResults;
+ this.dependedOnResults = <TargetedResult>[];
+ dependedOnResults.forEach((TargetedResult dependedOnResult) {
+ ResultData data = cache._getDataFor(dependedOnResult);
+ data.removeDependentResult(thisResult);
+ });
+ // Invalidate results that depend on this result.
+ List<TargetedResult> dependentResults = this.dependentResults;
+ this.dependentResults = <TargetedResult>[];
+ dependentResults.forEach((TargetedResult dependentResult) {
+ ResultData data = cache._getDataFor(dependentResult);
+ data.invalidate(cache, dependentResult, newState);
+ });
+ }
+
+ /**
+ * Remove the given [result] from the list of dependent results.
+ */
+ void removeDependentResult(TargetedResult result) {
+ dependentResults.remove(result);
+ }
+
+ /**
+ * Set the [dependedOn] on which this result depends.
+ */
+ void setDependedOnResults(AnalysisCache cache, TargetedResult thisResult,
+ List<TargetedResult> dependedOn) {
+ dependedOnResults.forEach((TargetedResult dependedOnResult) {
+ ResultData data = cache._getDataFor(dependedOnResult);
+ data.removeDependentResult(thisResult);
+ });
+ dependedOnResults = dependedOn;
+ dependedOnResults.forEach((TargetedResult dependentResult) {
+ ResultData data = cache._getDataFor(dependentResult);
+ data.addDependentResult(thisResult);
+ });
+ }
}
/**
@@ -789,7 +927,50 @@
: super(context, maxCacheSize, DefaultRetentionPolicy.POLICY);
@override
- bool contains(AnalysisTarget target) => target.source.isInSystemLibrary;
+ bool contains(AnalysisTarget target) {
+ Source source = target.source;
+ return source != null && source.isInSystemLibrary;
+ }
+}
+
+/**
+ * A specification of a specific result computed for a specific target.
+ */
+class TargetedResult {
+ /**
+ * An empty list of results.
+ */
+ static final List<TargetedResult> EMPTY_LIST = const <TargetedResult>[];
+
+ /**
+ * The target with which the result is associated.
+ */
+ final AnalysisTarget target;
+
+ /**
+ * The result associated with the target.
+ */
+ final ResultDescriptor result;
+
+ /**
+ * Initialize a new targeted result.
+ */
+ TargetedResult(this.target, this.result);
+
+ @override
+ int get hashCode {
+ return JenkinsSmiHash.combine(target.hashCode, result.hashCode);
+ }
+
+ @override
+ bool operator ==(other) {
+ return other is TargetedResult &&
+ other.target == target &&
+ other.result == result;
+ }
+
+ @override
+ String toString() => '$result for $target';
}
/**
diff --git a/pkg/analyzer/lib/src/context/context.dart b/pkg/analyzer/lib/src/context/context.dart
new file mode 100644
index 0000000..debb32e
--- /dev/null
+++ b/pkg/analyzer/lib/src/context/context.dart
@@ -0,0 +1,2150 @@
+// Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+library analyzer.src.context.context;
+
+import 'dart:async';
+import 'dart:collection';
+
+import 'package:analyzer/src/cancelable_future.dart';
+import 'package:analyzer/src/context/cache.dart' as cache;
+import 'package:analyzer/src/generated/ast.dart';
+import 'package:analyzer/src/generated/constant.dart';
+import 'package:analyzer/src/generated/element.dart';
+import 'package:analyzer/src/generated/engine.dart';
+import 'package:analyzer/src/generated/error.dart';
+import 'package:analyzer/src/generated/html.dart' as ht;
+import 'package:analyzer/src/generated/java_core.dart';
+import 'package:analyzer/src/generated/java_engine.dart';
+import 'package:analyzer/src/generated/resolver.dart';
+import 'package:analyzer/src/generated/scanner.dart';
+import 'package:analyzer/src/generated/sdk.dart' show DartSdk;
+import 'package:analyzer/src/generated/source.dart';
+import 'package:analyzer/src/generated/utilities_collection.dart';
+import 'package:analyzer/src/task/dart.dart';
+import 'package:analyzer/src/task/driver.dart';
+import 'package:analyzer/src/task/manager.dart';
+import 'package:analyzer/task/dart.dart';
+import 'package:analyzer/task/general.dart';
+import 'package:analyzer/task/model.dart';
+
+/**
+ * Type of callback functions used by PendingFuture. Functions of this type
+ * should perform a computation based on the data in [entry] and return it. If
+ * the computation can't be performed yet because more analysis is needed,
+ * `null` should be returned.
+ *
+ * The function may also throw an exception, in which case the corresponding
+ * future will be completed with failure.
+ *
+ * Because this function is called while the state of analysis is being updated,
+ * it should be free of side effects so that it doesn't cause reentrant changes
+ * to the analysis state.
+ */
+typedef T PendingFutureComputer<T>(cache.CacheEntry entry);
+
+/**
+ * An [AnalysisContext] in which analysis can be performed.
+ */
+class AnalysisContextImpl implements InternalAnalysisContext {
+ /**
+ * A client-provided name used to identify this context, or `null` if the
+ * client has not provided a name.
+ */
+ String name;
+
+ /**
+ * The set of analysis options controlling the behavior of this context.
+ */
+ AnalysisOptionsImpl _options = new AnalysisOptionsImpl();
+
+ /**
+ * A flag indicating whether this context is disposed.
+ */
+ bool _disposed = false;
+
+ /**
+ * A cache of content used to override the default content of a source.
+ */
+ ContentCache _contentCache = new ContentCache();
+
+ /**
+ * The source factory used to create the sources that can be analyzed in this
+ * context.
+ */
+ SourceFactory _sourceFactory;
+
+ /**
+ * The set of declared variables used when computing constant values.
+ */
+ DeclaredVariables _declaredVariables = new DeclaredVariables();
+
+ /**
+ * The partition that contains analysis results that are not shared with other
+ * contexts.
+ */
+ cache.CachePartition _privatePartition;
+
+ /**
+ * The cache in which information about the results associated with targets
+ * are stored.
+ */
+ cache.AnalysisCache _cache;
+
+ /**
+ * The task manager used to manage the tasks used to analyze code.
+ */
+ TaskManager _taskManager;
+
+ /**
+ * The analysis driver used to perform analysis.
+ */
+ AnalysisDriver _driver;
+
+ /**
+ * A list containing sources for which data should not be flushed.
+ */
+ List<Source> _priorityOrder = <Source>[];
+
+ /**
+ * A map from all sources for which there are futures pending to a list of
+ * the corresponding PendingFuture objects. These sources will be analyzed
+ * in the same way as priority sources, except with higher priority.
+ */
+ HashMap<AnalysisTarget, List<PendingFuture>> _pendingFutureTargets =
+ new HashMap<AnalysisTarget, List<PendingFuture>>();
+
+ /**
+ * A table mapping sources to the change notices that are waiting to be
+ * returned related to that source.
+ */
+ HashMap<Source, ChangeNoticeImpl> _pendingNotices =
+ new HashMap<Source, ChangeNoticeImpl>();
+
+ /**
+ * Cached information used in incremental analysis or `null` if none.
+ */
+ IncrementalAnalysisCache _incrementalAnalysisCache;
+
+ /**
+ * The [TypeProvider] for this context, `null` if not yet created.
+ */
+ TypeProvider _typeProvider;
+
+ /**
+ * The controller for sending [SourcesChangedEvent]s.
+ */
+ StreamController<SourcesChangedEvent> _onSourcesChangedController;
+
+ /**
+ * The listeners that are to be notified when various analysis results are
+ * produced in this context.
+ */
+ List<AnalysisListener> _listeners = new List<AnalysisListener>();
+
+ /**
+ * The most recently incrementally resolved source, or `null` when it was
+ * already validated, or the most recent change was not incrementally resolved.
+ */
+ Source incrementalResolutionValidation_lastUnitSource;
+
+ /**
+ * The most recently incrementally resolved library source, or `null` when it
+ * was already validated, or the most recent change was not incrementally
+ * resolved.
+ */
+ Source incrementalResolutionValidation_lastLibrarySource;
+
+ /**
+ * The result of incremental resolution result of
+ * [incrementalResolutionValidation_lastSource].
+ */
+ CompilationUnit incrementalResolutionValidation_lastUnit;
+
+ /**
+ * A factory to override how the [ResolverVisitor] is created.
+ */
+ ResolverVisitorFactory resolverVisitorFactory;
+
+ /**
+ * A factory to override how the [TypeResolverVisitor] is created.
+ */
+ TypeResolverVisitorFactory typeResolverVisitorFactory;
+
+ /**
+ * A factory to override how [LibraryResolver] is created.
+ */
+ LibraryResolverFactory libraryResolverFactory;
+
+ /**
+ * Initialize a newly created analysis context.
+ */
+ AnalysisContextImpl() {
+ _privatePartition = new cache.UniversalCachePartition(this,
+ AnalysisOptionsImpl.DEFAULT_CACHE_SIZE,
+ new ContextRetentionPolicy(this));
+ _cache = createCacheFromSourceFactory(null);
+ _taskManager = AnalysisEngine.instance.taskManager;
+ _driver = new AnalysisDriver(_taskManager, this);
+ _onSourcesChangedController =
+ new StreamController<SourcesChangedEvent>.broadcast();
+ }
+
+ @override
+ AnalysisOptions get analysisOptions => _options;
+
+ @override
+ void set analysisOptions(AnalysisOptions options) {
+ bool needsRecompute = this._options.analyzeFunctionBodiesPredicate !=
+ options.analyzeFunctionBodiesPredicate ||
+ this._options.generateImplicitErrors !=
+ options.generateImplicitErrors ||
+ this._options.generateSdkErrors != options.generateSdkErrors ||
+ this._options.dart2jsHint != options.dart2jsHint ||
+ (this._options.hint && !options.hint) ||
+ this._options.preserveComments != options.preserveComments ||
+ this._options.enableNullAwareOperators !=
+ options.enableNullAwareOperators ||
+ this._options.enableStrictCallChecks != options.enableStrictCallChecks;
+ int cacheSize = options.cacheSize;
+ if (this._options.cacheSize != cacheSize) {
+ this._options.cacheSize = cacheSize;
+ _privatePartition.maxCacheSize = cacheSize;
+ }
+ this._options.analyzeFunctionBodiesPredicate =
+ options.analyzeFunctionBodiesPredicate;
+ this._options.generateImplicitErrors = options.generateImplicitErrors;
+ this._options.generateSdkErrors = options.generateSdkErrors;
+ this._options.dart2jsHint = options.dart2jsHint;
+ this._options.enableNullAwareOperators = options.enableNullAwareOperators;
+ this._options.enableStrictCallChecks = options.enableStrictCallChecks;
+ this._options.hint = options.hint;
+ this._options.incremental = options.incremental;
+ this._options.incrementalApi = options.incrementalApi;
+ this._options.incrementalValidation = options.incrementalValidation;
+ this._options.lint = options.lint;
+ this._options.preserveComments = options.preserveComments;
+ if (needsRecompute) {
+ _invalidateAllLocalResolutionInformation(false);
+ }
+ }
+
+ @override
+ void set analysisPriorityOrder(List<Source> sources) {
+ if (sources == null || sources.isEmpty) {
+ _priorityOrder = Source.EMPTY_ARRAY;
+ } else {
+ while (sources.remove(null)) {
+ // Nothing else to do.
+ }
+ if (sources.isEmpty) {
+ _priorityOrder = Source.EMPTY_ARRAY;
+ } else {
+ _priorityOrder = sources;
+ }
+ }
+ }
+
+ @override
+ set contentCache(ContentCache value) {
+ _contentCache = value;
+ }
+
+ @override
+ DeclaredVariables get declaredVariables => _declaredVariables;
+
+ @override
+ List<AnalysisTarget> get explicitTargets {
+ List<AnalysisTarget> targets = <AnalysisTarget>[];
+ MapIterator<AnalysisTarget, cache.CacheEntry> iterator = _cache.iterator();
+ while (iterator.moveNext()) {
+ if (iterator.value.explicitlyAdded) {
+ targets.add(iterator.key);
+ }
+ }
+ return targets;
+ }
+
+ @override
+ List<Source> get htmlSources => _getSources(SourceKind.HTML);
+
+ @override
+ bool get isDisposed => _disposed;
+
+ @override
+ List<Source> get launchableClientLibrarySources {
+ List<Source> sources = new List<Source>();
+ MapIterator<AnalysisTarget, cache.CacheEntry> iterator = _cache.iterator();
+ while (iterator.moveNext()) {
+ AnalysisTarget target = iterator.key;
+ cache.CacheEntry entry = iterator.value;
+ if (target is Source &&
+ entry.getValue(SOURCE_KIND) == SourceKind.LIBRARY &&
+ !target.isInSystemLibrary &&
+ isClientLibrary(target)) {
+ sources.add(target);
+ }
+ }
+ return sources;
+ }
+
+ @override
+ List<Source> get launchableServerLibrarySources {
+ List<Source> sources = new List<Source>();
+ MapIterator<AnalysisTarget, cache.CacheEntry> iterator = _cache.iterator();
+ while (iterator.moveNext()) {
+ AnalysisTarget target = iterator.key;
+ cache.CacheEntry entry = iterator.value;
+ if (target is Source &&
+ entry.getValue(SOURCE_KIND) == SourceKind.LIBRARY &&
+ !target.isInSystemLibrary &&
+ isServerLibrary(target)) {
+ sources.add(target);
+ }
+ }
+ return sources;
+ }
+
+ @override
+ List<Source> get librarySources => _getSources(SourceKind.LIBRARY);
+
+ @override
+ Stream<SourcesChangedEvent> get onSourcesChanged =>
+ _onSourcesChangedController.stream;
+
+ /**
+ * Make _pendingFutureSources available to unit tests.
+ */
+ HashMap<AnalysisTarget, List<PendingFuture>> get pendingFutureSources_forTesting =>
+ _pendingFutureTargets;
+
+ @override
+ List<Source> get prioritySources => _priorityOrder;
+
+ @override
+ List<AnalysisTarget> get priorityTargets => prioritySources;
+
+ @override
+ SourceFactory get sourceFactory => _sourceFactory;
+
+ @override
+ void set sourceFactory(SourceFactory factory) {
+ if (identical(_sourceFactory, factory)) {
+ return;
+ } else if (factory.context != null) {
+ throw new IllegalStateException(
+ "Source factories cannot be shared between contexts");
+ }
+ if (_sourceFactory != null) {
+ _sourceFactory.context = null;
+ }
+ factory.context = this;
+ _sourceFactory = factory;
+ _cache = createCacheFromSourceFactory(factory);
+ _invalidateAllLocalResolutionInformation(true);
+ }
+
+ @override
+ List<Source> get sources {
+ List<Source> sources = new List<Source>();
+ MapIterator<AnalysisTarget, cache.CacheEntry> iterator = _cache.iterator();
+ while (iterator.moveNext()) {
+ AnalysisTarget target = iterator.key;
+ if (target is Source) {
+ sources.add(target);
+ }
+ }
+ return sources;
+ }
+
+ /**
+ * Return a list of the sources that would be processed by
+ * [performAnalysisTask]. This method duplicates, and must therefore be kept
+ * in sync with, [getNextAnalysisTask]. This method is intended to be used for
+ * testing purposes only.
+ */
+ List<Source> get sourcesNeedingProcessing {
+ HashSet<Source> sources = new HashSet<Source>();
+ bool hintsEnabled = _options.hint;
+ bool lintsEnabled = _options.lint;
+
+ MapIterator<AnalysisTarget, cache.CacheEntry> iterator = _cache.iterator();
+ while (iterator.moveNext()) {
+ AnalysisTarget target = iterator.key;
+ if (target is Source) {
+ _getSourcesNeedingProcessing(
+ target, iterator.value, false, hintsEnabled, lintsEnabled, sources);
+ }
+ }
+ return new List<Source>.from(sources);
+ }
+
+ @override
+ AnalysisContextStatistics get statistics {
+ AnalysisContextStatisticsImpl statistics =
+ new AnalysisContextStatisticsImpl();
+ // TODO(brianwilkerson) Implement this.
+// visitCacheItems(statistics._internalPutCacheItem);
+// statistics.partitionData = _cache.partitionData;
+ return statistics;
+ }
+
+ IncrementalAnalysisCache get test_incrementalAnalysisCache {
+ return _incrementalAnalysisCache;
+ }
+
+ set test_incrementalAnalysisCache(IncrementalAnalysisCache value) {
+ _incrementalAnalysisCache = value;
+ }
+
+ List<Source> get test_priorityOrder => _priorityOrder;
+
+ @override
+ TypeProvider get typeProvider {
+ if (_typeProvider != null) {
+ return _typeProvider;
+ }
+ Source coreSource = sourceFactory.forUri(DartSdk.DART_CORE);
+ if (coreSource == null) {
+ throw new AnalysisException("Could not create a source for dart:core");
+ }
+ LibraryElement coreElement = computeLibraryElement(coreSource);
+ if (coreElement == null) {
+ throw new AnalysisException("Could not create an element for dart:core");
+ }
+ Source asyncSource = sourceFactory.forUri(DartSdk.DART_ASYNC);
+ if (asyncSource == null) {
+ throw new AnalysisException("Could not create a source for dart:async");
+ }
+ LibraryElement asyncElement = computeLibraryElement(asyncSource);
+ if (asyncElement == null) {
+ throw new AnalysisException("Could not create an element for dart:async");
+ }
+ _typeProvider = new TypeProviderImpl(coreElement, asyncElement);
+ return _typeProvider;
+ }
+
+ /**
+ * Sets the [TypeProvider] for this context.
+ */
+ void set typeProvider(TypeProvider typeProvider) {
+ _typeProvider = typeProvider;
+ }
+
+ @override
+ void addListener(AnalysisListener listener) {
+ if (!_listeners.contains(listener)) {
+ _listeners.add(listener);
+ }
+ }
+
+ @override
+ void addSourceInfo(Source source, SourceEntry info) {
+ // TODO(brianwilkerson) This method needs to be replaced by something that
+ // will copy CacheEntry's.
+// _cache.put(source, info);
+ }
+
+ @override
+ void applyAnalysisDelta(AnalysisDelta delta) {
+ ChangeSet changeSet = new ChangeSet();
+ delta.analysisLevels.forEach((Source source, AnalysisLevel level) {
+ if (level == AnalysisLevel.NONE) {
+ changeSet.removedSource(source);
+ } else {
+ changeSet.addedSource(source);
+ }
+ });
+ applyChanges(changeSet);
+ }
+
+ @override
+ void applyChanges(ChangeSet changeSet) {
+ if (changeSet.isEmpty) {
+ return;
+ }
+ //
+ // First, compute the list of sources that have been removed.
+ //
+ List<Source> removedSources =
+ new List<Source>.from(changeSet.removedSources);
+ for (SourceContainer container in changeSet.removedContainers) {
+ _addSourcesInContainer(removedSources, container);
+ }
+ //
+ // Then determine which cached results are no longer valid.
+ //
+ for (Source source in changeSet.addedSources) {
+ _sourceAvailable(source);
+ }
+ for (Source source in changeSet.changedSources) {
+ if (_contentCache.getContents(source) != null) {
+ // This source is overridden in the content cache, so the change will
+ // have no effect. Just ignore it to avoid wasting time doing
+ // re-analysis.
+ continue;
+ }
+ _sourceChanged(source);
+ }
+ changeSet.changedContents.forEach((Source key, String value) {
+ _contentsChanged(key, value, false);
+ });
+ changeSet.changedRanges
+ .forEach((Source source, ChangeSet_ContentChange change) {
+ _contentRangeChanged(source, change.contents, change.offset,
+ change.oldLength, change.newLength);
+ });
+ for (Source source in changeSet.deletedSources) {
+ _sourceDeleted(source);
+ }
+ for (Source source in removedSources) {
+ _sourceRemoved(source);
+ }
+ _onSourcesChangedController.add(new SourcesChangedEvent(changeSet));
+ }
+
+ @override
+ String computeDocumentationComment(Element element) {
+ if (element == null) {
+ return null;
+ }
+ Source source = element.source;
+ if (source == null) {
+ return null;
+ }
+ CompilationUnit unit = parseCompilationUnit(source);
+ if (unit == null) {
+ return null;
+ }
+ NodeLocator locator = new NodeLocator.con1(element.nameOffset);
+ AstNode nameNode = locator.searchWithin(unit);
+ while (nameNode != null) {
+ if (nameNode is AnnotatedNode) {
+ Comment comment = nameNode.documentationComment;
+ if (comment == null) {
+ return null;
+ }
+ StringBuffer buffer = new StringBuffer();
+ List<Token> tokens = comment.tokens;
+ for (int i = 0; i < tokens.length; i++) {
+ if (i > 0) {
+ buffer.write("\n");
+ }
+ buffer.write(tokens[i].lexeme);
+ }
+ return buffer.toString();
+ }
+ nameNode = nameNode.parent;
+ }
+ return null;
+ }
+
+ @override
+ List<AnalysisError> computeErrors(Source source) =>
+ _computeResult(source, DART_ERRORS);
+
+ @override
+ List<Source> computeExportedLibraries(Source source) =>
+ _computeResult(source, EXPORTED_LIBRARIES);
+
+ @override
+ // TODO(brianwilkerson) Implement this.
+ HtmlElement computeHtmlElement(Source source) => null;
+
+ @override
+ List<Source> computeImportedLibraries(Source source) =>
+ _computeResult(source, IMPORTED_LIBRARIES);
+
+ @override
+ SourceKind computeKindOf(Source source) =>
+ _computeResult(source, SOURCE_KIND);
+
+ @override
+ LibraryElement computeLibraryElement(Source source) => _computeResult(
+ source, LIBRARY_ELEMENT); //_computeResult(source, HtmlEntry.ELEMENT);
+
+ @override
+ LineInfo computeLineInfo(Source source) => _computeResult(source, LINE_INFO);
+
+ @override
+ @deprecated
+ CompilationUnit computeResolvableCompilationUnit(Source source) {
+ return null;
+ }
+
+ @override
+ CancelableFuture<CompilationUnit> computeResolvedCompilationUnitAsync(
+ Source unitSource, Source librarySource) {
+ if (!AnalysisEngine.isDartFileName(unitSource.shortName) ||
+ !AnalysisEngine.isDartFileName(librarySource.shortName)) {
+ return new CancelableFuture.error(new AnalysisNotScheduledError());
+ }
+ return new _AnalysisFutureHelper<CompilationUnit>(this).computeAsync(
+ new LibrarySpecificUnit(librarySource, unitSource),
+ (cache.CacheEntry entry) {
+ CacheState state = entry.getState(RESOLVED_UNIT);
+ if (state == CacheState.ERROR) {
+ throw entry.exception;
+ } else if (state == CacheState.INVALID) {
+ return null;
+ }
+ return entry.getValue(RESOLVED_UNIT);
+ });
+ }
+
+ /**
+ * Create an analysis cache based on the given source [factory].
+ */
+ cache.AnalysisCache createCacheFromSourceFactory(SourceFactory factory) {
+ if (factory == null) {
+ return new cache.AnalysisCache(<cache.CachePartition>[_privatePartition]);
+ }
+ DartSdk sdk = factory.dartSdk;
+ if (sdk == null) {
+ return new cache.AnalysisCache(<cache.CachePartition>[_privatePartition]);
+ }
+ return new cache.AnalysisCache(<cache.CachePartition>[
+ AnalysisEngine.instance.partitionManager_new.forSdk(sdk),
+ _privatePartition
+ ]);
+ }
+
+ @override
+ void dispose() {
+ _disposed = true;
+ for (List<PendingFuture> pendingFutures in _pendingFutureTargets.values) {
+ for (PendingFuture pendingFuture in pendingFutures) {
+ pendingFuture.forciblyComplete();
+ }
+ }
+ _pendingFutureTargets.clear();
+ }
+
+ @override
+ List<CompilationUnit> ensureResolvedDartUnits(Source unitSource) {
+ // TODO(brianwilkerson) Implement this.
+ return null;
+// cache.CacheEntry entry = _cache.get(unitSource);
+// // Check every library.
+// List<CompilationUnit> units = <CompilationUnit>[];
+// List<Source> containingLibraries = entry.containingLibraries;
+// for (Source librarySource in containingLibraries) {
+// CompilationUnit unit =
+// entry.getValueInLibrary(DartEntry.RESOLVED_UNIT, librarySource);
+// if (unit == null) {
+// units = null;
+// break;
+// }
+// units.add(unit);
+// }
+// // Invalidate the flushed RESOLVED_UNIT to force it eventually.
+// if (units == null) {
+// bool shouldBeScheduled = false;
+// for (Source librarySource in containingLibraries) {
+// if (entry.getStateInLibrary(DartEntry.RESOLVED_UNIT, librarySource) ==
+// CacheState.FLUSHED) {
+// entry.setStateInLibrary(
+// DartEntry.RESOLVED_UNIT, librarySource, CacheState.INVALID);
+// shouldBeScheduled = true;
+// }
+// }
+// if (shouldBeScheduled) {
+// _workManager.add(unitSource, SourcePriority.UNKNOWN);
+// }
+// // We cannot provide resolved units right now,
+// // but the future analysis will.
+// return null;
+// }
+// // done
+// return units;
+ }
+
+ @override
+ bool exists(Source source) {
+ if (source == null) {
+ return false;
+ }
+ if (_contentCache.getContents(source) != null) {
+ return true;
+ }
+ return source.exists();
+ }
+
+ Element findElementById(int id) {
+ // TODO(brianwilkerson) Implement this.
+ return null;
+// _ElementByIdFinder finder = new _ElementByIdFinder(id);
+// try {
+// MapIterator<AnalysisTarget, cache.CacheEntry> iterator =
+// _cache.iterator();
+// while (iterator.moveNext()) {
+// cache.CacheEntry entry = iterator.value;
+// if (entry.getValue(SOURCE_KIND) == SourceKind.LIBRARY) {
+// DartEntry dartEntry = entry;
+// LibraryElement library = dartEntry.getValue(DartEntry.ELEMENT);
+// if (library != null) {
+// library.accept(finder);
+// }
+// }
+// }
+// } on _ElementByIdFinderException {
+// return finder.result;
+// }
+// return null;
+ }
+
+ @override
+ cache.CacheEntry getCacheEntry(AnalysisTarget target) {
+ cache.CacheEntry entry = _cache.get(target);
+ if (entry == null) {
+ entry = new cache.CacheEntry();
+ _cache.put(target, entry);
+ }
+ return entry;
+ }
+
+ @override
+ CompilationUnitElement getCompilationUnitElement(
+ Source unitSource, Source librarySource) {
+ AnalysisTarget target = new LibrarySpecificUnit(librarySource, unitSource);
+ return _getResult(target, COMPILATION_UNIT_ELEMENT);
+ }
+
+ @override
+ TimestampedData<String> getContents(Source source) {
+ String contents = _contentCache.getContents(source);
+ if (contents != null) {
+ return new TimestampedData<String>(
+ _contentCache.getModificationStamp(source), contents);
+ }
+ return source.contents;
+ }
+
+ @override
+ InternalAnalysisContext getContextFor(Source source) {
+ InternalAnalysisContext context = _cache.getContextFor(source);
+ return context == null ? this : context;
+ }
+
+ @override
+ Element getElement(ElementLocation location) {
+ // TODO(brianwilkerson) This should not be a "get" method.
+ try {
+ List<String> components = location.components;
+ Source source = _computeSourceFromEncoding(components[0]);
+ String sourceName = source.shortName;
+ if (AnalysisEngine.isDartFileName(sourceName)) {
+ ElementImpl element = computeLibraryElement(source) as ElementImpl;
+ for (int i = 1; i < components.length; i++) {
+ if (element == null) {
+ return null;
+ }
+ element = element.getChild(components[i]);
+ }
+ return element;
+ }
+ if (AnalysisEngine.isHtmlFileName(sourceName)) {
+ return computeHtmlElement(source);
+ }
+ } catch (exception) {
+ // If the location cannot be decoded for some reason then the underlying
+ // cause should have been logged already and we can fall though to return
+ // null.
+ }
+ return null;
+ }
+
+ @override
+ AnalysisErrorInfo getErrors(Source source) {
+ List<AnalysisError> errors = _getResult(source, DART_ERRORS);
+ LineInfo lineInfo = _getResult(source, LINE_INFO);
+ return new AnalysisErrorInfoImpl(errors, lineInfo);
+ }
+
+ @override
+ HtmlElement getHtmlElement(Source source) {
+ // TODO(brianwilkerson) Implement this.
+// SourceEntry sourceEntry = getReadableSourceEntryOrNull(source);
+// if (sourceEntry is HtmlEntry) {
+// return sourceEntry.getValue(HtmlEntry.ELEMENT);
+// }
+ return null;
+ }
+
+ @override
+ List<Source> getHtmlFilesReferencing(Source source) {
+ SourceKind sourceKind = getKindOf(source);
+ if (sourceKind == null) {
+ return Source.EMPTY_ARRAY;
+ }
+ List<Source> htmlSources = new List<Source>();
+ while (true) {
+ if (sourceKind == SourceKind.PART) {
+ List<Source> librarySources = getLibrariesContaining(source);
+ MapIterator<AnalysisTarget, cache.CacheEntry> iterator =
+ _cache.iterator();
+ while (iterator.moveNext()) {
+ cache.CacheEntry entry = iterator.value;
+ if (entry.getValue(SOURCE_KIND) == SourceKind.HTML) {
+ List<Source> referencedLibraries =
+ (entry as HtmlEntry).getValue(HtmlEntry.REFERENCED_LIBRARIES);
+ if (_containsAny(referencedLibraries, librarySources)) {
+ htmlSources.add(iterator.key);
+ }
+ }
+ }
+ } else {
+ MapIterator<AnalysisTarget, cache.CacheEntry> iterator =
+ _cache.iterator();
+ while (iterator.moveNext()) {
+ cache.CacheEntry entry = iterator.value;
+ if (entry.getValue(SOURCE_KIND) == SourceKind.HTML) {
+ List<Source> referencedLibraries =
+ (entry as HtmlEntry).getValue(HtmlEntry.REFERENCED_LIBRARIES);
+ if (_contains(referencedLibraries, source)) {
+ htmlSources.add(iterator.key);
+ }
+ }
+ }
+ }
+ break;
+ }
+ if (htmlSources.isEmpty) {
+ return Source.EMPTY_ARRAY;
+ }
+ return htmlSources;
+ }
+
+ @override
+ SourceKind getKindOf(Source source) => _getResult(source, SOURCE_KIND);
+
+ @override
+ List<Source> getLibrariesContaining(Source source) {
+ // TODO(brianwilkerson) Implement this.
+// cache.CacheEntry sourceEntry = _cache.get(source);
+// if (sourceEntry is DartEntry) {
+// return sourceEntry.containingLibraries;
+// }
+ return Source.EMPTY_ARRAY;
+ }
+
+ @override
+ List<Source> getLibrariesDependingOn(Source librarySource) {
+ List<Source> dependentLibraries = new List<Source>();
+ MapIterator<AnalysisTarget, cache.CacheEntry> iterator = _cache.iterator();
+ while (iterator.moveNext()) {
+ cache.CacheEntry entry = iterator.value;
+ if (entry.getValue(SOURCE_KIND) == SourceKind.LIBRARY) {
+ if (_contains(entry.getValue(EXPORTED_LIBRARIES), librarySource)) {
+ dependentLibraries.add(iterator.key);
+ }
+ if (_contains(entry.getValue(IMPORTED_LIBRARIES), librarySource)) {
+ dependentLibraries.add(iterator.key);
+ }
+ }
+ }
+ if (dependentLibraries.isEmpty) {
+ return Source.EMPTY_ARRAY;
+ }
+ return dependentLibraries;
+ }
+
+ @override
+ List<Source> getLibrariesReferencedFromHtml(Source htmlSource) {
+ // TODO(brianwilkerson) Implement this.
+// cache.CacheEntry entry = getReadableSourceEntryOrNull(htmlSource);
+// if (entry is HtmlEntry) {
+// HtmlEntry htmlEntry = entry;
+// return htmlEntry.getValue(HtmlEntry.REFERENCED_LIBRARIES);
+// }
+ return Source.EMPTY_ARRAY;
+ }
+
+ @override
+ LibraryElement getLibraryElement(Source source) =>
+ _getResult(source, LIBRARY_ELEMENT);
+
+ @override
+ LineInfo getLineInfo(Source source) => _getResult(source, LINE_INFO);
+
+ @override
+ int getModificationStamp(Source source) {
+ int stamp = _contentCache.getModificationStamp(source);
+ if (stamp != null) {
+ return stamp;
+ }
+ return source.modificationStamp;
+ }
+
+ @override
+ Namespace getPublicNamespace(LibraryElement library) {
+ // TODO(brianwilkerson) Rename this to not start with 'get'.
+ // Note that this is not part of the API of the interface.
+ // TODO(brianwilkerson) The public namespace used to be cached, but no
+ // longer is. Konstantin adds:
+ // The only client of this method is NamespaceBuilder._createExportMapping(),
+ // and it is not used with tasks - instead we compute export namespace once
+ // using BuildExportNamespaceTask and reuse in scopes.
+ NamespaceBuilder builder = new NamespaceBuilder();
+ return builder.createPublicNamespaceForLibrary(library);
+ }
+
+ /**
+ * Return the cache entry associated with the given [source], or `null` if
+ * there is no entry associated with the source.
+ */
+ cache.CacheEntry getReadableSourceEntryOrNull(Source source) =>
+ _cache.get(source);
+
+ @override
+ CompilationUnit getResolvedCompilationUnit(
+ Source unitSource, LibraryElement library) {
+ if (library == null ||
+ !AnalysisEngine.isDartFileName(unitSource.shortName)) {
+ return null;
+ }
+ return getResolvedCompilationUnit2(unitSource, library.source);
+ }
+
+ @override
+ CompilationUnit getResolvedCompilationUnit2(
+ Source unitSource, Source librarySource) {
+ if (!AnalysisEngine.isDartFileName(unitSource.shortName) ||
+ !AnalysisEngine.isDartFileName(librarySource.shortName)) {
+ return null;
+ }
+ return _getResult(
+ new LibrarySpecificUnit(librarySource, unitSource), RESOLVED_UNIT);
+ }
+
+ @override
+ ht.HtmlUnit getResolvedHtmlUnit(Source htmlSource) {
+ // TODO(brianwilkerson) Implement this.
+// SourceEntry sourceEntry = getReadableSourceEntryOrNull(htmlSource);
+// if (sourceEntry is HtmlEntry) {
+// HtmlEntry htmlEntry = sourceEntry;
+// return htmlEntry.getValue(HtmlEntry.RESOLVED_UNIT);
+// }
+ return null;
+ }
+
+ @override
+ List<Source> getSourcesWithFullName(String path) {
+ List<Source> sources = <Source>[];
+ MapIterator<AnalysisTarget, cache.CacheEntry> iterator = _cache.iterator();
+ while (iterator.moveNext()) {
+ AnalysisTarget target = iterator.key;
+ if (target is Source && target.fullName == path) {
+ sources.add(target);
+ }
+ }
+ return sources;
+ }
+
+ @override
+ bool handleContentsChanged(
+ Source source, String originalContents, String newContents, bool notify) {
+ cache.CacheEntry entry = _cache.get(source);
+ if (entry == null) {
+ return false;
+ }
+ bool changed = newContents != originalContents;
+ if (newContents != null) {
+ if (newContents != originalContents) {
+ _incrementalAnalysisCache =
+ IncrementalAnalysisCache.clear(_incrementalAnalysisCache, source);
+ if (!analysisOptions.incremental ||
+ !_tryPoorMansIncrementalResolution(source, newContents)) {
+ _sourceChanged(source);
+ }
+ entry.modificationTime = _contentCache.getModificationStamp(source);
+ entry.setValue(
+ CONTENT, newContents, cache.TargetedResult.EMPTY_LIST, null);
+ } else {
+ entry.modificationTime = _contentCache.getModificationStamp(source);
+ }
+ } else if (originalContents != null) {
+ _incrementalAnalysisCache =
+ IncrementalAnalysisCache.clear(_incrementalAnalysisCache, source);
+ changed = newContents != originalContents;
+ // We are removing the overlay for the file, check if the file's
+ // contents is the same as it was in the overlay.
+ try {
+ TimestampedData<String> fileContents = getContents(source);
+ String fileContentsData = fileContents.data;
+ if (fileContentsData == originalContents) {
+ entry.setValue(
+ CONTENT, fileContentsData, cache.TargetedResult.EMPTY_LIST, null);
+ entry.modificationTime = fileContents.modificationTime;
+ changed = false;
+ }
+ } catch (e) {}
+ // If not the same content (e.g. the file is being closed without save),
+ // then force analysis.
+ if (changed) {
+ _sourceChanged(source);
+ }
+ }
+ if (notify && changed) {
+ _onSourcesChangedController
+ .add(new SourcesChangedEvent.changedContent(source, newContents));
+ }
+ return changed;
+ }
+
+ /**
+ * Invalidates hints in the given [librarySource] and included parts.
+ */
+ void invalidateLibraryHints(Source librarySource) {
+ cache.CacheEntry entry = _cache.get(librarySource);
+ // Prepare sources to invalidate hints in.
+ List<Source> sources = <Source>[librarySource];
+ sources.addAll(entry.getValue(INCLUDED_PARTS));
+ // Invalidate hints.
+ for (Source source in sources) {
+ LibrarySpecificUnit unitTarget =
+ new LibrarySpecificUnit(librarySource, source);
+ cache.CacheEntry unitEntry = _cache.get(unitTarget);
+ if (unitEntry.getState(HINTS) == CacheState.VALID) {
+ unitEntry.setState(HINTS, CacheState.INVALID);
+ }
+ }
+ }
+
+ @override
+ bool isClientLibrary(Source librarySource) {
+ cache.CacheEntry entry = _cache.get(librarySource);
+ return entry.getValue(IS_CLIENT) && entry.getValue(IS_LAUNCHABLE);
+ }
+
+ @override
+ bool isServerLibrary(Source librarySource) {
+ cache.CacheEntry entry = _cache.get(librarySource);
+ return !entry.getValue(IS_CLIENT) && entry.getValue(IS_LAUNCHABLE);
+ }
+
+ @override
+ CompilationUnit parseCompilationUnit(Source source) {
+ if (!AnalysisEngine.isDartFileName(source.shortName)) {
+ return null;
+ }
+ return _computeResult(source, PARSED_UNIT);
+ }
+
+ @override
+ ht.HtmlUnit parseHtmlUnit(Source source) {
+ if (!AnalysisEngine.isHtmlFileName(source.shortName)) {
+ return null;
+ }
+ // TODO(brianwilkerson) Implement HTML analysis.
+ return null; //_computeResult(source, null);
+ }
+
+ @override
+ AnalysisResult performAnalysisTask() {
+ return PerformanceStatistics.performAnaysis.makeCurrentWhile(() {
+ bool done = !_driver.performAnalysisTask();
+ if (done) {
+ done = !_validateCacheConsistency();
+ }
+ List<ChangeNotice> notices = _getChangeNotices(done);
+ if (notices != null) {
+ int noticeCount = notices.length;
+ for (int i = 0; i < noticeCount; i++) {
+ ChangeNotice notice = notices[i];
+ _notifyErrors(notice.source, notice.errors, notice.lineInfo);
+ }
+ }
+ return new AnalysisResult(notices, -1, '', -1);
+ });
+ }
+
+ @override
+ void recordLibraryElements(Map<Source, LibraryElement> elementMap) {
+ elementMap.forEach((Source librarySource, LibraryElement library) {
+ //
+ // Cache the element in the library's info.
+ //
+ cache.CacheEntry entry = getCacheEntry(librarySource);
+ setValue(ResultDescriptor result, value) {
+ entry.setValue(result, value, cache.TargetedResult.EMPTY_LIST, null);
+ }
+ setValue(BUILD_DIRECTIVES_ERRORS, AnalysisError.NO_ERRORS);
+ setValue(BUILD_FUNCTION_TYPE_ALIASES_ERRORS, AnalysisError.NO_ERRORS);
+ setValue(BUILD_LIBRARY_ERRORS, AnalysisError.NO_ERRORS);
+ // CLASS_ELEMENTS
+ setValue(COMPILATION_UNIT_ELEMENT, library.definingCompilationUnit);
+ // CONSTRUCTORS
+ // CONSTRUCTORS_ERRORS
+ entry.setState(CONTENT, CacheState.FLUSHED);
+ setValue(EXPORTED_LIBRARIES, Source.EMPTY_ARRAY);
+ // EXPORT_SOURCE_CLOSURE
+ setValue(IMPORTED_LIBRARIES, Source.EMPTY_ARRAY);
+ // IMPORT_SOURCE_CLOSURE
+ setValue(INCLUDED_PARTS, Source.EMPTY_ARRAY);
+ setValue(IS_CLIENT, true);
+ setValue(IS_LAUNCHABLE, false);
+ setValue(LIBRARY_ELEMENT, library);
+ setValue(LIBRARY_ELEMENT1, library);
+ setValue(LIBRARY_ELEMENT2, library);
+ setValue(LIBRARY_ELEMENT3, library);
+ setValue(LIBRARY_ELEMENT4, library);
+ setValue(LIBRARY_ELEMENT5, library);
+ setValue(LINE_INFO, new LineInfo(<int>[0]));
+ setValue(PARSE_ERRORS, AnalysisError.NO_ERRORS);
+ entry.setState(PARSED_UNIT, CacheState.FLUSHED);
+ entry.setState(RESOLVE_TYPE_NAMES_ERRORS, CacheState.FLUSHED);
+ setValue(SCAN_ERRORS, AnalysisError.NO_ERRORS);
+ setValue(SOURCE_KIND, SourceKind.LIBRARY);
+ entry.setState(TOKEN_STREAM, CacheState.FLUSHED);
+ setValue(UNITS, <Source>[librarySource]);
+
+ LibrarySpecificUnit unit =
+ new LibrarySpecificUnit(librarySource, librarySource);
+ entry = getCacheEntry(unit);
+ setValue(HINTS, AnalysisError.NO_ERRORS);
+ // dartEntry.setValue(LINTS, AnalysisError.NO_ERRORS);
+ entry.setState(RESOLVE_REFERENCES_ERRORS, CacheState.FLUSHED);
+ entry.setState(RESOLVED_UNIT, CacheState.FLUSHED);
+ entry.setState(RESOLVED_UNIT1, CacheState.FLUSHED);
+ entry.setState(RESOLVED_UNIT2, CacheState.FLUSHED);
+ entry.setState(RESOLVED_UNIT3, CacheState.FLUSHED);
+ entry.setState(RESOLVED_UNIT4, CacheState.FLUSHED);
+ entry.setState(RESOLVED_UNIT5, CacheState.FLUSHED);
+ // USED_IMPORTED_ELEMENTS
+ // USED_LOCAL_ELEMENTS
+ setValue(VERIFY_ERRORS, AnalysisError.NO_ERRORS);
+ });
+
+ cache.CacheEntry entry = getCacheEntry(AnalysisContextTarget.request);
+ entry.setValue(
+ TYPE_PROVIDER, typeProvider, cache.TargetedResult.EMPTY_LIST, null);
+ }
+
+ @override
+ void removeListener(AnalysisListener listener) {
+ _listeners.remove(listener);
+ }
+
+ @override
+ CompilationUnit resolveCompilationUnit(
+ Source unitSource, LibraryElement library) {
+ if (library == null) {
+ return null;
+ }
+ return resolveCompilationUnit2(unitSource, library.source);
+ }
+
+ @override
+ CompilationUnit resolveCompilationUnit2(
+ Source unitSource, Source librarySource) {
+ if (!AnalysisEngine.isDartFileName(unitSource.shortName) ||
+ !AnalysisEngine.isDartFileName(librarySource.shortName)) {
+ return null;
+ }
+ return _computeResult(
+ new LibrarySpecificUnit(librarySource, unitSource), RESOLVED_UNIT);
+ }
+
+ @override
+ ht.HtmlUnit resolveHtmlUnit(Source htmlSource) {
+ computeHtmlElement(htmlSource);
+ return parseHtmlUnit(htmlSource);
+ }
+
+ @override
+ void setChangedContents(Source source, String contents, int offset,
+ int oldLength, int newLength) {
+ if (_contentRangeChanged(source, contents, offset, oldLength, newLength)) {
+ _onSourcesChangedController.add(new SourcesChangedEvent.changedRange(
+ source, contents, offset, oldLength, newLength));
+ }
+ }
+
+ @override
+ void setContents(Source source, String contents) {
+ _contentsChanged(source, contents, true);
+ }
+
+ @override
+ void visitCacheItems(void callback(Source source, SourceEntry dartEntry,
+ DataDescriptor rowDesc, CacheState state)) {
+ // TODO(brianwilkerson) Figure out where this is used and adjust the call
+ // sites to use CacheEntry's.
+// bool hintsEnabled = _options.hint;
+// bool lintsEnabled = _options.lint;
+// MapIterator<AnalysisTarget, cache.CacheEntry> iterator = _cache.iterator();
+// while (iterator.moveNext()) {
+// Source source = iterator.key;
+// cache.CacheEntry entry = iterator.value;
+// for (DataDescriptor descriptor in entry.descriptors) {
+// if (descriptor == DartEntry.SOURCE_KIND) {
+// // The source kind is always valid, so the state isn't interesting.
+// continue;
+// } else if (descriptor == DartEntry.CONTAINING_LIBRARIES) {
+// // The list of containing libraries is always valid, so the state
+// // isn't interesting.
+// continue;
+// } else if (descriptor == DartEntry.PUBLIC_NAMESPACE) {
+// // The public namespace isn't computed by performAnalysisTask()
+// // and therefore isn't interesting.
+// continue;
+// } else if (descriptor == HtmlEntry.HINTS) {
+// // We are not currently recording any hints related to HTML.
+// continue;
+// }
+// callback(
+// source, entry, descriptor, entry.getState(descriptor));
+// }
+// if (entry is DartEntry) {
+// // get library-specific values
+// List<Source> librarySources = getLibrariesContaining(source);
+// for (Source librarySource in librarySources) {
+// for (DataDescriptor descriptor in entry.libraryDescriptors) {
+// if (descriptor == DartEntry.BUILT_ELEMENT ||
+// descriptor == DartEntry.BUILT_UNIT) {
+// // These values are not currently being computed, so their state
+// // is not interesting.
+// continue;
+// } else if (!entry.explicitlyAdded &&
+// !_generateImplicitErrors &&
+// (descriptor == DartEntry.VERIFICATION_ERRORS ||
+// descriptor == DartEntry.HINTS ||
+// descriptor == DartEntry.LINTS)) {
+// continue;
+// } else if (source.isInSystemLibrary &&
+// !_generateSdkErrors &&
+// (descriptor == DartEntry.VERIFICATION_ERRORS ||
+// descriptor == DartEntry.HINTS ||
+// descriptor == DartEntry.LINTS)) {
+// continue;
+// } else if (!hintsEnabled && descriptor == DartEntry.HINTS) {
+// continue;
+// } else if (!lintsEnabled && descriptor == DartEntry.LINTS) {
+// continue;
+// }
+// callback(librarySource, entry, descriptor,
+// entry.getStateInLibrary(descriptor, librarySource));
+// }
+// }
+// }
+// }
+ }
+
+ /**
+ * Visit all entries of the content cache.
+ */
+ void visitContentCache(ContentCacheVisitor visitor) {
+ _contentCache.accept(visitor);
+ }
+
+ /**
+ * Add all of the sources contained in the given source [container] to the
+ * given list of [sources].
+ */
+ void _addSourcesInContainer(List<Source> sources, SourceContainer container) {
+ MapIterator<AnalysisTarget, cache.CacheEntry> iterator = _cache.iterator();
+ while (iterator.moveNext()) {
+ Source source = iterator.key;
+ if (container.contains(source)) {
+ sources.add(source);
+ }
+ }
+ }
+
+ /**
+ * Remove the given [pendingFuture] from [_pendingFutureTargets], since the
+ * client has indicated its computation is not needed anymore.
+ */
+ void _cancelFuture(PendingFuture pendingFuture) {
+ List<PendingFuture> pendingFutures =
+ _pendingFutureTargets[pendingFuture.target];
+ if (pendingFutures != null) {
+ pendingFutures.remove(pendingFuture);
+ if (pendingFutures.isEmpty) {
+ _pendingFutureTargets.remove(pendingFuture.target);
+ }
+ }
+ }
+
+ /**
+ * Return the priority that should be used when the source associated with
+ * the given [entry] is added to the work manager.
+ */
+ SourcePriority _computePriority(cache.CacheEntry entry) {
+ // Used in commented out code.
+ SourceKind kind = entry.getValue(SOURCE_KIND);
+ if (kind == SourceKind.LIBRARY) {
+ return SourcePriority.LIBRARY;
+ } else if (kind == SourceKind.PART) {
+ return SourcePriority.NORMAL_PART;
+ }
+ return SourcePriority.UNKNOWN;
+ }
+
+ Object /*V*/ _computeResult(
+ AnalysisTarget target, ResultDescriptor /*<V>*/ descriptor) {
+ cache.CacheEntry entry = getCacheEntry(target);
+ if (descriptor is CompositeResultDescriptor) {
+ List compositeResults = [];
+ for (ResultDescriptor descriptor in descriptor.contributors) {
+ List value = _computeResult(target, descriptor);
+ compositeResults.addAll(value);
+ }
+ return compositeResults;
+ }
+ CacheState state = entry.getState(descriptor);
+ if (state == CacheState.FLUSHED || state == CacheState.INVALID) {
+ _driver.computeResult(target, descriptor);
+ }
+ state = entry.getState(descriptor);
+ if (state == CacheState.ERROR) {
+ throw new AnalysisException(
+ 'Cannot compute $descriptor for $target', entry.exception);
+ }
+ return entry.getValue(descriptor);
+ }
+
+ /**
+ * Given the encoded form of a source ([encoding]), use the source factory to
+ * reconstitute the original source.
+ */
+ Source _computeSourceFromEncoding(String encoding) =>
+ _sourceFactory.fromEncoding(encoding);
+
+ /**
+ * Return `true` if the given list of [sources] contains the given
+ * [targetSource].
+ */
+ bool _contains(List<Source> sources, Source targetSource) {
+ for (Source source in sources) {
+ if (source == targetSource) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ /**
+ * Return `true` if the given list of [sources] contains any of the given
+ * [targetSources].
+ */
+ bool _containsAny(List<Source> sources, List<Source> targetSources) {
+ for (Source targetSource in targetSources) {
+ if (_contains(sources, targetSource)) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ /**
+ * Set the contents of the given [source] to the given [contents] and mark the
+ * source as having changed. The additional [offset], [oldLength] and
+ * [newLength] information is used by the context to determine what reanalysis
+ * is necessary. The method [setChangedContents] triggers a source changed
+ * event where as this method does not.
+ */
+ bool _contentRangeChanged(Source source, String contents, int offset,
+ int oldLength, int newLength) {
+ bool changed = false;
+ String originalContents = _contentCache.setContents(source, contents);
+ if (contents != null) {
+ if (contents != originalContents) {
+ // TODO(brianwilkerson) Find a better way to do incremental analysis.
+// if (_options.incremental) {
+// _incrementalAnalysisCache = IncrementalAnalysisCache.update(
+// _incrementalAnalysisCache, source, originalContents, contents,
+// offset, oldLength, newLength, _cache.get(source));
+// }
+ _sourceChanged(source);
+ changed = true;
+ cache.CacheEntry entry = _cache.get(source);
+ if (entry != null) {
+ entry.modificationTime = _contentCache.getModificationStamp(source);
+ entry.setValue(
+ CONTENT, contents, cache.TargetedResult.EMPTY_LIST, null);
+ }
+ }
+ } else if (originalContents != null) {
+ _incrementalAnalysisCache =
+ IncrementalAnalysisCache.clear(_incrementalAnalysisCache, source);
+ _sourceChanged(source);
+ changed = true;
+ }
+ return changed;
+ }
+
+ /**
+ * Set the contents of the given [source] to the given [contents] and mark the
+ * source as having changed. This has the effect of overriding the default
+ * contents of the source. If the contents are `null` the override is removed
+ * so that the default contents will be returned. If [notify] is true, a
+ * source changed event is triggered.
+ */
+ void _contentsChanged(Source source, String contents, bool notify) {
+ String originalContents = _contentCache.setContents(source, contents);
+ handleContentsChanged(source, originalContents, contents, notify);
+ }
+
+ /**
+ * Create a cache entry for the given [source]. The source was explicitly
+ * added to this context if [explicitlyAdded] is `true`. Return the cache
+ * entry that was created.
+ */
+ cache.CacheEntry _createCacheEntry(Source source, bool explicitlyAdded) {
+ cache.CacheEntry entry = new cache.CacheEntry();
+ entry.modificationTime = getModificationStamp(source);
+ entry.explicitlyAdded = explicitlyAdded;
+ _cache.put(source, entry);
+ return entry;
+ }
+
+ /**
+ * Return a list containing all of the change notices that are waiting to be
+ * returned. If there are no notices, then return either `null` or an empty
+ * list, depending on the value of [nullIfEmpty].
+ */
+ List<ChangeNotice> _getChangeNotices(bool nullIfEmpty) {
+ if (_pendingNotices.isEmpty) {
+ if (nullIfEmpty) {
+ return null;
+ }
+ return ChangeNoticeImpl.EMPTY_ARRAY;
+ }
+ List<ChangeNotice> notices = new List.from(_pendingNotices.values);
+ _pendingNotices.clear();
+ return notices;
+ }
+
+ /**
+ * Return a change notice for the given [source], creating one if one does not
+ * already exist.
+ */
+ ChangeNoticeImpl _getNotice(Source source) {
+ // Used in commented out code.
+ ChangeNoticeImpl notice = _pendingNotices[source];
+ if (notice == null) {
+ notice = new ChangeNoticeImpl(source);
+ _pendingNotices[source] = notice;
+ }
+ return notice;
+ }
+
+ Object _getResult(AnalysisTarget target, ResultDescriptor descriptor) {
+ cache.CacheEntry entry = _cache.get(target);
+ if (entry == null) {
+ return descriptor.defaultValue;
+ }
+ if (descriptor is CompositeResultDescriptor) {
+ List compositeResults = [];
+ for (ResultDescriptor descriptor in descriptor.contributors) {
+ List value = _getResult(target, descriptor);
+ compositeResults.addAll(value);
+ }
+ return compositeResults;
+ }
+ if (entry.isValid(descriptor)) {
+ return entry.getValue(descriptor);
+ }
+ return descriptor.defaultValue;
+ }
+
+ /**
+ * Return a list containing all of the sources known to this context that have
+ * the given [kind].
+ */
+ List<Source> _getSources(SourceKind kind) {
+ List<Source> sources = new List<Source>();
+ MapIterator<AnalysisTarget, cache.CacheEntry> iterator = _cache.iterator();
+ while (iterator.moveNext()) {
+ if (iterator.value.getValue(SOURCE_KIND) == kind &&
+ iterator.key is Source) {
+ sources.add(iterator.key);
+ }
+ }
+ return sources;
+ }
+
+ /**
+ * Look at the given [source] to see whether a task needs to be performed
+ * related to it. If so, add the source to the set of sources that need to be
+ * processed. This method is intended to be used for testing purposes only.
+ */
+ void _getSourcesNeedingProcessing(Source source, cache.CacheEntry entry,
+ bool isPriority, bool hintsEnabled, bool lintsEnabled,
+ HashSet<Source> sources) {
+ CacheState state = entry.getState(CONTENT);
+ if (state == CacheState.INVALID ||
+ (isPriority && state == CacheState.FLUSHED)) {
+ sources.add(source);
+ return;
+ } else if (state == CacheState.ERROR) {
+ return;
+ }
+ state = entry.getState(SOURCE_KIND);
+ if (state == CacheState.INVALID ||
+ (isPriority && state == CacheState.FLUSHED)) {
+ sources.add(source);
+ return;
+ } else if (state == CacheState.ERROR) {
+ return;
+ }
+ SourceKind kind = entry.getValue(SOURCE_KIND);
+ if (kind == SourceKind.LIBRARY || kind == SourceKind.PART) {
+ state = entry.getState(SCAN_ERRORS);
+ if (state == CacheState.INVALID ||
+ (isPriority && state == CacheState.FLUSHED)) {
+ sources.add(source);
+ return;
+ } else if (state == CacheState.ERROR) {
+ return;
+ }
+ state = entry.getState(PARSE_ERRORS);
+ if (state == CacheState.INVALID ||
+ (isPriority && state == CacheState.FLUSHED)) {
+ sources.add(source);
+ return;
+ } else if (state == CacheState.ERROR) {
+ return;
+ }
+// if (isPriority) {
+// if (!entry.hasResolvableCompilationUnit) {
+// sources.add(source);
+// return;
+// }
+// }
+ for (Source librarySource in getLibrariesContaining(source)) {
+ cache.CacheEntry libraryEntry = _cache.get(librarySource);
+ state = libraryEntry.getState(LIBRARY_ELEMENT);
+ if (state == CacheState.INVALID ||
+ (isPriority && state == CacheState.FLUSHED)) {
+ sources.add(source);
+ return;
+ } else if (state == CacheState.ERROR) {
+ return;
+ }
+ cache.CacheEntry unitEntry =
+ _cache.get(new LibrarySpecificUnit(librarySource, source));
+ state = unitEntry.getState(RESOLVED_UNIT);
+ if (state == CacheState.INVALID ||
+ (isPriority && state == CacheState.FLUSHED)) {
+ sources.add(source);
+ return;
+ } else if (state == CacheState.ERROR) {
+ return;
+ }
+ if (_shouldErrorsBeAnalyzed(source, unitEntry)) {
+ state = unitEntry.getState(VERIFY_ERRORS);
+ if (state == CacheState.INVALID ||
+ (isPriority && state == CacheState.FLUSHED)) {
+ sources.add(source);
+ return;
+ } else if (state == CacheState.ERROR) {
+ return;
+ }
+ if (hintsEnabled) {
+ state = unitEntry.getState(HINTS);
+ if (state == CacheState.INVALID ||
+ (isPriority && state == CacheState.FLUSHED)) {
+ sources.add(source);
+ return;
+ } else if (state == CacheState.ERROR) {
+ return;
+ }
+ }
+// if (lintsEnabled) {
+// state = unitEntry.getState(LINTS);
+// if (state == CacheState.INVALID ||
+// (isPriority && state == CacheState.FLUSHED)) {
+// sources.add(source);
+// return;
+// } else if (state == CacheState.ERROR) {
+// return;
+// }
+// }
+ }
+ }
+// } else if (kind == SourceKind.HTML) {
+// CacheState parsedUnitState = entry.getState(HtmlEntry.PARSED_UNIT);
+// if (parsedUnitState == CacheState.INVALID ||
+// (isPriority && parsedUnitState == CacheState.FLUSHED)) {
+// sources.add(source);
+// return;
+// }
+// CacheState resolvedUnitState =
+// entry.getState(HtmlEntry.RESOLVED_UNIT);
+// if (resolvedUnitState == CacheState.INVALID ||
+// (isPriority && resolvedUnitState == CacheState.FLUSHED)) {
+// sources.add(source);
+// return;
+// }
+ }
+ }
+
+ /**
+ * Invalidate all of the resolution results computed by this context. The flag
+ * [invalidateUris] should be `true` if the cached results of converting URIs
+ * to source files should also be invalidated.
+ */
+ void _invalidateAllLocalResolutionInformation(bool invalidateUris) {
+ HashMap<Source, List<Source>> oldPartMap =
+ new HashMap<Source, List<Source>>();
+ // TODO(brianwilkerson) Implement this
+// MapIterator<AnalysisTarget, cache.CacheEntry> iterator =
+// _privatePartition.iterator();
+// while (iterator.moveNext()) {
+// AnalysisTarget target = iterator.key;
+// cache.CacheEntry entry = iterator.value;
+// if (entry is HtmlEntry) {
+// HtmlEntry htmlEntry = entry;
+// htmlEntry.invalidateAllResolutionInformation(invalidateUris);
+// iterator.value = htmlEntry;
+// _workManager.add(target, SourcePriority.HTML);
+// } else if (entry is DartEntry) {
+// DartEntry dartEntry = entry;
+// oldPartMap[target] = dartEntry.getValue(DartEntry.INCLUDED_PARTS);
+// dartEntry.invalidateAllResolutionInformation(invalidateUris);
+// iterator.value = dartEntry;
+// _workManager.add(target, _computePriority(dartEntry));
+// }
+// }
+ _removeFromPartsUsingMap(oldPartMap);
+ }
+
+ /**
+ * In response to a change to at least one of the compilation units in the
+ * library defined by the given [librarySource], invalidate any results that
+ * are dependent on the result of resolving that library.
+ *
+ * <b>Note:</b> Any cache entries that were accessed before this method was
+ * invoked must be re-accessed after this method returns.
+ */
+ void _invalidateLibraryResolution(Source librarySource) {
+ // TODO(brianwilkerson) Figure out whether we still need this.
+ // TODO(brianwilkerson) This could be optimized. There's no need to flush
+ // all of these entries if the public namespace hasn't changed, which will
+ // be a fairly common case. The question is whether we can afford the time
+ // to compute the namespace to look for differences.
+// DartEntry libraryEntry = _getReadableDartEntry(librarySource);
+// if (libraryEntry != null) {
+// List<Source> includedParts =
+// libraryEntry.getValue(DartEntry.INCLUDED_PARTS);
+// libraryEntry.invalidateAllResolutionInformation(false);
+// _workManager.add(librarySource, SourcePriority.LIBRARY);
+// for (Source partSource in includedParts) {
+// SourceEntry partEntry = _cache.get(partSource);
+// if (partEntry is DartEntry) {
+// partEntry.invalidateAllResolutionInformation(false);
+// }
+// }
+// }
+ }
+
+ /**
+ * Log the given debugging [message].
+ */
+ void _logInformation(String message) {
+ AnalysisEngine.instance.logger.logInformation(message);
+ }
+
+ /**
+ * Notify all of the analysis listeners that the errors associated with the
+ * given [source] has been updated to the given [errors].
+ */
+ void _notifyErrors(
+ Source source, List<AnalysisError> errors, LineInfo lineInfo) {
+ int count = _listeners.length;
+ for (int i = 0; i < count; i++) {
+ _listeners[i].computedErrors(this, source, errors, lineInfo);
+ }
+ }
+
+ /**
+ * Remove the given libraries that are keys in the given map from the list of
+ * containing libraries for each of the parts in the corresponding value.
+ */
+ void _removeFromPartsUsingMap(HashMap<Source, List<Source>> oldPartMap) {
+ // TODO(brianwilkerson) Figure out whether we still need this.
+// oldPartMap.forEach((Source librarySource, List<Source> oldParts) {
+// for (int i = 0; i < oldParts.length; i++) {
+// Source partSource = oldParts[i];
+// if (partSource != librarySource) {
+// DartEntry partEntry = _getReadableDartEntry(partSource);
+// if (partEntry != null) {
+// partEntry.removeContainingLibrary(librarySource);
+// if (partEntry.containingLibraries.length == 0 &&
+// !exists(partSource)) {
+// _cache.remove(partSource);
+// }
+// }
+// }
+// }
+// });
+ }
+
+ /**
+ * Remove the given [source] from the priority order if it is in the list.
+ */
+ void _removeFromPriorityOrder(Source source) {
+ int count = _priorityOrder.length;
+ List<Source> newOrder = new List<Source>();
+ for (int i = 0; i < count; i++) {
+ if (_priorityOrder[i] != source) {
+ newOrder.add(_priorityOrder[i]);
+ }
+ }
+ if (newOrder.length < count) {
+ analysisPriorityOrder = newOrder;
+ }
+ }
+
+ /**
+ * Return `true` if errors should be produced for the given [source]. The
+ * [entry] associated with the source is passed in for efficiency.
+ */
+ bool _shouldErrorsBeAnalyzed(Source source, cache.CacheEntry entry) {
+ if (source.isInSystemLibrary) {
+ return _options.generateSdkErrors;
+ } else if (!entry.explicitlyAdded) {
+ return _options.generateImplicitErrors;
+ } else {
+ return true;
+ }
+ }
+
+ /**
+ * Create an entry for the newly added [source] and invalidate any sources
+ * that referenced the source before it existed.
+ */
+ void _sourceAvailable(Source source) {
+ cache.CacheEntry entry = _cache.get(source);
+ if (entry == null) {
+ _createCacheEntry(source, true);
+ } else {
+ // TODO(brianwilkerson) Implement this.
+// _propagateInvalidation(source, entry);
+ }
+ }
+
+ /**
+ * Invalidate the [source] that was changed and any sources that referenced
+ * the source before it existed.
+ */
+ void _sourceChanged(Source source) {
+ cache.CacheEntry entry = _cache.get(source);
+ // If the source is removed, we don't care about it.
+ if (entry == null) {
+ return;
+ }
+ // Check whether the content of the source is the same as it was the last
+ // time.
+ String sourceContent = entry.getValue(CONTENT);
+ if (sourceContent != null) {
+ entry.setState(CONTENT, CacheState.FLUSHED);
+ try {
+ TimestampedData<String> fileContents = getContents(source);
+ if (fileContents.data == sourceContent) {
+ return;
+ }
+ } catch (e) {}
+ }
+ // We need to invalidate the cache.
+ // TODO(brianwilkerson) Implement this.
+// _propagateInvalidation(source, entry);
+ }
+
+ /**
+ * Record that the give [source] has been deleted.
+ */
+ void _sourceDeleted(Source source) {
+ // TODO(brianwilkerson) Implement this.
+// SourceEntry sourceEntry = _cache.get(source);
+// if (sourceEntry is HtmlEntry) {
+// HtmlEntry htmlEntry = sourceEntry;
+// htmlEntry.recordContentError(new CaughtException(
+// new AnalysisException("This source was marked as being deleted"),
+// null));
+// } else if (sourceEntry is DartEntry) {
+// DartEntry dartEntry = sourceEntry;
+// HashSet<Source> libraries = new HashSet<Source>();
+// for (Source librarySource in getLibrariesContaining(source)) {
+// libraries.add(librarySource);
+// for (Source dependentLibrary
+// in getLibrariesDependingOn(librarySource)) {
+// libraries.add(dependentLibrary);
+// }
+// }
+// for (Source librarySource in libraries) {
+// _invalidateLibraryResolution(librarySource);
+// }
+// dartEntry.recordContentError(new CaughtException(
+// new AnalysisException("This source was marked as being deleted"),
+// null));
+// }
+ _removeFromPriorityOrder(source);
+ }
+
+ /**
+ * Record that the given [source] has been removed.
+ */
+ void _sourceRemoved(Source source) {
+ List<Source> containingLibraries = getLibrariesContaining(source);
+ if (containingLibraries != null && containingLibraries.isNotEmpty) {
+ HashSet<Source> libraries = new HashSet<Source>();
+ for (Source librarySource in containingLibraries) {
+ libraries.add(librarySource);
+ for (Source dependentLibrary
+ in getLibrariesDependingOn(librarySource)) {
+ libraries.add(dependentLibrary);
+ }
+ }
+ for (Source librarySource in libraries) {
+ _invalidateLibraryResolution(librarySource);
+ }
+ }
+ _cache.remove(source);
+ _removeFromPriorityOrder(source);
+ }
+
+ /**
+ * TODO(scheglov) A hackish, limited incremental resolution implementation.
+ */
+ bool _tryPoorMansIncrementalResolution(Source unitSource, String newCode) {
+ // TODO(brianwilkerson) Implement this.
+ return false;
+// return PerformanceStatistics.incrementalAnalysis.makeCurrentWhile(() {
+// incrementalResolutionValidation_lastUnitSource = null;
+// incrementalResolutionValidation_lastLibrarySource = null;
+// incrementalResolutionValidation_lastUnit = null;
+// // prepare the entry
+// cache.CacheEntry entry = _cache.get(unitSource);
+// if (entry == null) {
+// return false;
+// }
+// // prepare the (only) library source
+// List<Source> librarySources = getLibrariesContaining(unitSource);
+// if (librarySources.length != 1) {
+// return false;
+// }
+// Source librarySource = librarySources[0];
+// // prepare the library element
+// LibraryElement libraryElement = getLibraryElement(librarySource);
+// if (libraryElement == null) {
+// return false;
+// }
+// // prepare the existing unit
+// CompilationUnit oldUnit =
+// getResolvedCompilationUnit2(unitSource, librarySource);
+// if (oldUnit == null) {
+// return false;
+// }
+// // do resolution
+// Stopwatch perfCounter = new Stopwatch()..start();
+// PoorMansIncrementalResolver resolver = new PoorMansIncrementalResolver(
+// typeProvider, unitSource, entry, oldUnit,
+// analysisOptions.incrementalApi, analysisOptions);
+// bool success = resolver.resolve(newCode);
+// AnalysisEngine.instance.instrumentationService.logPerformance(
+// AnalysisPerformanceKind.INCREMENTAL, perfCounter,
+// 'success=$success,context_id=$_id,code_length=${newCode.length}');
+// if (!success) {
+// return false;
+// }
+// // if validation, remember the result, but throw it away
+// if (analysisOptions.incrementalValidation) {
+// incrementalResolutionValidation_lastUnitSource = oldUnit.element.source;
+// incrementalResolutionValidation_lastLibrarySource =
+// oldUnit.element.library.source;
+// incrementalResolutionValidation_lastUnit = oldUnit;
+// return false;
+// }
+// // prepare notice
+// {
+// LineInfo lineInfo = getLineInfo(unitSource);
+// ChangeNoticeImpl notice = _getNotice(unitSource);
+// notice.resolvedDartUnit = oldUnit;
+// notice.setErrors(entry.allErrors, lineInfo);
+// }
+// // OK
+// return true;
+// });
+ }
+
+ /**
+ * Check the cache for any invalid entries (entries whose modification time
+ * does not match the modification time of the source associated with the
+ * entry). Invalid entries will be marked as invalid so that the source will
+ * be re-analyzed. Return `true` if at least one entry was invalid.
+ */
+ bool _validateCacheConsistency() {
+ int consistencyCheckStart = JavaSystem.nanoTime();
+ List<AnalysisTarget> changedTargets = new List<AnalysisTarget>();
+ List<AnalysisTarget> missingTargets = new List<AnalysisTarget>();
+ MapIterator<AnalysisTarget, cache.CacheEntry> iterator = _cache.iterator();
+ while (iterator.moveNext()) {
+ AnalysisTarget target = iterator.key;
+ cache.CacheEntry entry = iterator.value;
+ if (target is Source) {
+ int sourceTime = getModificationStamp(target);
+ if (sourceTime != entry.modificationTime) {
+ changedTargets.add(target);
+ }
+ }
+ if (entry.exception != null) {
+ if (!exists(target)) {
+ missingTargets.add(target);
+ }
+ }
+ }
+ int count = changedTargets.length;
+ for (int i = 0; i < count; i++) {
+ _sourceChanged(changedTargets[i]);
+ }
+ int removalCount = 0;
+ for (AnalysisTarget target in missingTargets) {
+ if (target is Source &&
+ getLibrariesContaining(target).isEmpty &&
+ getLibrariesDependingOn(target).isEmpty) {
+ _cache.remove(target);
+ removalCount++;
+ }
+ }
+ int consistencyCheckEnd = JavaSystem.nanoTime();
+ if (changedTargets.length > 0 || missingTargets.length > 0) {
+ StringBuffer buffer = new StringBuffer();
+ buffer.write("Consistency check took ");
+ buffer.write((consistencyCheckEnd - consistencyCheckStart) / 1000000.0);
+ buffer.writeln(" ms and found");
+ buffer.write(" ");
+ buffer.write(changedTargets.length);
+ buffer.writeln(" inconsistent entries");
+ buffer.write(" ");
+ buffer.write(missingTargets.length);
+ buffer.write(" missing sources (");
+ buffer.write(removalCount);
+ buffer.writeln(" removed");
+ for (Source source in missingTargets) {
+ buffer.write(" ");
+ buffer.writeln(source.fullName);
+ }
+ _logInformation(buffer.toString());
+ }
+ return changedTargets.length > 0;
+ }
+}
+
+/**
+ * A retention policy used by an analysis context.
+ */
+class ContextRetentionPolicy implements cache.CacheRetentionPolicy {
+ /**
+ * The context associated with this policy.
+ */
+ final AnalysisContextImpl context;
+
+ /**
+ * Initialize a newly created policy to be associated with the given
+ * [context].
+ */
+ ContextRetentionPolicy(this.context);
+
+ @override
+ RetentionPriority getAstPriority(
+ AnalysisTarget target, cache.CacheEntry entry) {
+ int priorityCount = context._priorityOrder.length;
+ for (int i = 0; i < priorityCount; i++) {
+ if (target == context._priorityOrder[i]) {
+ return RetentionPriority.HIGH;
+ }
+ }
+ if (_astIsNeeded(entry)) {
+ return RetentionPriority.MEDIUM;
+ }
+ return RetentionPriority.LOW;
+ }
+
+ bool _astIsNeeded(cache.CacheEntry entry) =>
+ entry.isInvalid(BUILD_FUNCTION_TYPE_ALIASES_ERRORS) ||
+ entry.isInvalid(BUILD_LIBRARY_ERRORS) ||
+ entry.isInvalid(CONSTRUCTORS_ERRORS) ||
+ entry.isInvalid(HINTS) ||
+ //entry.isInvalid(LINTS) ||
+ entry.isInvalid(RESOLVE_REFERENCES_ERRORS) ||
+ entry.isInvalid(RESOLVE_TYPE_NAMES_ERRORS) ||
+ entry.isInvalid(VERIFY_ERRORS);
+}
+
+/**
+ * An object that manages the partitions that can be shared between analysis
+ * contexts.
+ */
+class PartitionManager {
+ /**
+ * The default cache size for a Dart SDK partition.
+ */
+ static int _DEFAULT_SDK_CACHE_SIZE = 256;
+
+ /**
+ * A table mapping SDK's to the partitions used for those SDK's.
+ */
+ HashMap<DartSdk, cache.SdkCachePartition> _sdkPartitions =
+ new HashMap<DartSdk, cache.SdkCachePartition>();
+
+ /**
+ * Clear any cached data being maintained by this manager.
+ */
+ void clearCache() {
+ _sdkPartitions.clear();
+ }
+
+ /**
+ * Return the partition being used for the given [sdk], creating the partition
+ * if necessary.
+ */
+ cache.SdkCachePartition forSdk(DartSdk sdk) {
+ // Call sdk.context now, because when it creates a new
+ // InternalAnalysisContext instance, it calls forSdk() again, so creates an
+ // SdkCachePartition instance.
+ // So, if we initialize context after "partition == null", we end up
+ // with two SdkCachePartition instances.
+ InternalAnalysisContext sdkContext = sdk.context;
+ // Check cache for an existing partition.
+ cache.SdkCachePartition partition = _sdkPartitions[sdk];
+ if (partition == null) {
+ partition =
+ new cache.SdkCachePartition(sdkContext, _DEFAULT_SDK_CACHE_SIZE);
+ _sdkPartitions[sdk] = partition;
+ }
+ return partition;
+ }
+}
+
+/**
+ * Representation of a pending computation which is based on the results of
+ * analysis that may or may not have been completed.
+ */
+class PendingFuture<T> {
+ /**
+ * The context in which this computation runs.
+ */
+ final AnalysisContextImpl _context;
+
+ /**
+ * The target used by this computation to compute its value.
+ */
+ final AnalysisTarget target;
+
+ /**
+ * The function which implements the computation.
+ */
+ final PendingFutureComputer<T> _computeValue;
+
+ /**
+ * The completer that should be completed once the computation has succeeded.
+ */
+ CancelableCompleter<T> _completer;
+
+ PendingFuture(this._context, this.target, this._computeValue) {
+ _completer = new CancelableCompleter<T>(_onCancel);
+ }
+
+ /**
+ * Retrieve the future which will be completed when this object is
+ * successfully evaluated.
+ */
+ CancelableFuture<T> get future => _completer.future;
+
+ /**
+ * Execute [_computeValue], passing it the given [entry], and complete
+ * the pending future if it's appropriate to do so. If the pending future is
+ * completed by this call, true is returned; otherwise false is returned.
+ *
+ * Once this function has returned true, it should not be called again.
+ *
+ * Other than completing the future, this method is free of side effects.
+ * Note that any code the client has attached to the future will be executed
+ * in a microtask, so there is no danger of side effects occurring due to
+ * client callbacks.
+ */
+ bool evaluate(cache.CacheEntry entry) {
+ assert(!_completer.isCompleted);
+ try {
+ T result = _computeValue(entry);
+ if (result == null) {
+ return false;
+ } else {
+ _completer.complete(result);
+ return true;
+ }
+ } catch (exception, stackTrace) {
+ _completer.completeError(exception, stackTrace);
+ return true;
+ }
+ }
+
+ /**
+ * No further analysis updates are expected which affect this future, so
+ * complete it with an AnalysisNotScheduledError in order to avoid
+ * deadlocking the client.
+ */
+ void forciblyComplete() {
+ try {
+ throw new AnalysisNotScheduledError();
+ } catch (exception, stackTrace) {
+ _completer.completeError(exception, stackTrace);
+ }
+ }
+
+ void _onCancel() {
+ _context._cancelFuture(this);
+ }
+}
+
+/**
+ * A helper class used to create futures for AnalysisContextImpl. Using a helper
+ * class allows us to preserve the generic parameter T.
+ */
+class _AnalysisFutureHelper<T> {
+ final AnalysisContextImpl _context;
+
+ _AnalysisFutureHelper(this._context);
+
+ /**
+ * Return a future that will be completed with the result of calling
+ * [computeValue]. If [computeValue] returns non-`null`, the future will be
+ * completed immediately with the resulting value. If it returns `null`, then
+ * it will be re-executed in the future, after the next time the cached
+ * information for [target] has changed. If [computeValue] throws an
+ * exception, the future will fail with that exception.
+ *
+ * If the [computeValue] still returns `null` after there is no further
+ * analysis to be done for [target], then the future will be completed with
+ * the error AnalysisNotScheduledError.
+ *
+ * Since [computeValue] will be called while the state of analysis is being
+ * updated, it should be free of side effects so that it doesn't cause
+ * reentrant changes to the analysis state.
+ */
+ CancelableFuture<T> computeAsync(
+ AnalysisTarget target, T computeValue(cache.CacheEntry entry)) {
+ if (_context.isDisposed) {
+ // No further analysis is expected, so return a future that completes
+ // immediately with AnalysisNotScheduledError.
+ return new CancelableFuture.error(new AnalysisNotScheduledError());
+ }
+ cache.CacheEntry entry = _context.getReadableSourceEntryOrNull(target);
+ if (entry == null) {
+ return new CancelableFuture.error(new AnalysisNotScheduledError());
+ }
+ PendingFuture pendingFuture =
+ new PendingFuture<T>(_context, target, computeValue);
+ if (!pendingFuture.evaluate(entry)) {
+ _context._pendingFutureTargets
+ .putIfAbsent(target, () => <PendingFuture>[])
+ .add(pendingFuture);
+ }
+ return pendingFuture.future;
+ }
+}
diff --git a/pkg/analyzer/lib/src/error_formatter.dart b/pkg/analyzer/lib/src/error_formatter.dart
deleted file mode 100644
index f6d973b..0000000
--- a/pkg/analyzer/lib/src/error_formatter.dart
+++ /dev/null
@@ -1,201 +0,0 @@
-// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-library error_formatter;
-
-import 'package:analyzer/src/analyzer_impl.dart';
-
-import '../options.dart';
-import 'generated/engine.dart';
-import 'generated/error.dart';
-import 'generated/source_io.dart';
-
-/// Allows any [AnalysisError].
-bool _anyError(AnalysisError error) => true;
-
-/// Returns `true` if [AnalysisError] should be printed.
-typedef bool _ErrorFilter(AnalysisError error);
-
-/**
- * Helper for formatting [AnalysisError]s.
- * The two format options are a user consumable format and a machine consumable format.
- */
-class ErrorFormatter {
- final StringSink out;
- final CommandLineOptions options;
- final _ErrorFilter errorFilter;
-
- ErrorFormatter(this.out, this.options, [this.errorFilter = _anyError]);
-
- void formatError(
- Map<AnalysisError, LineInfo> errorToLine, AnalysisError error) {
- Source source = error.source;
- LineInfo_Location location = errorToLine[error].getLocation(error.offset);
- int length = error.length;
- ErrorSeverity severity =
- AnalyzerImpl.computeSeverity(error, options.enableTypeChecks);
- if (options.machineFormat) {
- if (severity == ErrorSeverity.WARNING && options.warningsAreFatal) {
- severity = ErrorSeverity.ERROR;
- }
- out.write(severity);
- out.write('|');
- out.write(error.errorCode.type);
- out.write('|');
- out.write(error.errorCode.name);
- out.write('|');
- out.write(escapePipe(source.fullName));
- out.write('|');
- out.write(location.lineNumber);
- out.write('|');
- out.write(location.columnNumber);
- out.write('|');
- out.write(length);
- out.write('|');
- out.write(escapePipe(error.message));
- } else {
- String errorType = severity.displayName;
- if (error.errorCode.type == ErrorType.HINT ||
- error.errorCode.type == ErrorType.LINT) {
- errorType = error.errorCode.type.displayName;
- }
- // [warning] 'foo' is not a... (/Users/.../tmp/foo.dart, line 1, col 2)
- out.write('[$errorType] ${error.message} ');
- out.write('(${source.fullName}');
- out.write(', line ${location.lineNumber}, col ${location.columnNumber})');
- }
- out.writeln();
- }
-
- void formatErrors(List<AnalysisErrorInfo> errorInfos) {
- var errors = new List<AnalysisError>();
- var errorToLine = new Map<AnalysisError, LineInfo>();
- for (AnalysisErrorInfo errorInfo in errorInfos) {
- for (AnalysisError error in errorInfo.errors) {
- if (errorFilter(error)) {
- errors.add(error);
- errorToLine[error] = errorInfo.lineInfo;
- }
- }
- }
- // sort errors
- errors.sort((AnalysisError error1, AnalysisError error2) {
- // severity
- ErrorSeverity severity1 =
- AnalyzerImpl.computeSeverity(error1, options.enableTypeChecks);
- ErrorSeverity severity2 =
- AnalyzerImpl.computeSeverity(error2, options.enableTypeChecks);
- int compare = severity2.compareTo(severity1);
- if (compare != 0) {
- return compare;
- }
- // path
- compare = Comparable.compare(error1.source.fullName.toLowerCase(),
- error2.source.fullName.toLowerCase());
- if (compare != 0) {
- return compare;
- }
- // offset
- return error1.offset - error2.offset;
- });
- // format errors
- int errorCount = 0;
- int warnCount = 0;
- int hintCount = 0;
- int lintCount = 0;
- for (AnalysisError error in errors) {
- ErrorSeverity severity =
- AnalyzerImpl.computeSeverity(error, options.enableTypeChecks);
- if (severity == ErrorSeverity.ERROR) {
- errorCount++;
- } else if (severity == ErrorSeverity.WARNING) {
- if (options.warningsAreFatal) {
- errorCount++;
- } else {
- if (error.errorCode.type == ErrorType.HINT) {
- hintCount++;
- } else {
- warnCount++;
- }
- }
- } else if (error.errorCode.type == ErrorType.LINT) {
- lintCount++;
- }
- formatError(errorToLine, error);
- }
- // print statistics
- if (!options.machineFormat) {
- var hasErrors = errorCount != 0;
- var hasWarns = warnCount != 0;
- var hasHints = hintCount != 0;
- var hasLints = lintCount != 0;
- bool hasContent = false;
- if (hasErrors) {
- out.write(errorCount);
- out.write(' ');
- out.write(pluralize("error", errorCount));
- hasContent = true;
- }
- if (hasWarns) {
- if (hasContent) {
- if (!hasHints && !hasLints) {
- out.write(' and ');
- } else {
- out.write(", ");
- }
- }
- out.write(warnCount);
- out.write(' ');
- out.write(pluralize("warning", warnCount));
- hasContent = true;
- }
- if (hasHints) {
- if (hasContent) {
- if (!hasLints) {
- out.write(' and ');
- } else {
- out.write(", ");
- }
- }
- out.write(hintCount);
- out.write(' ');
- out.write(pluralize("hint", hintCount));
- hasContent = true;
- }
- if (hasLints) {
- if (hasContent) {
- out.write(" and ");
- }
- out.write(lintCount);
- out.write(' ');
- out.write(pluralize("lint", lintCount));
- hasContent = true;
- }
- if (hasContent) {
- out.writeln(" found.");
- } else {
- out.writeln("No issues found");
- }
- }
- }
-
- static String escapePipe(String input) {
- var result = new StringBuffer();
- for (var c in input.codeUnits) {
- if (c == '\\' || c == '|') {
- result.write('\\');
- }
- result.writeCharCode(c);
- }
- return result.toString();
- }
-
- static String pluralize(String word, int count) {
- if (count == 1) {
- return word;
- } else {
- return word + "s";
- }
- }
-}
diff --git a/pkg/analyzer/lib/src/generated/ast.dart b/pkg/analyzer/lib/src/generated/ast.dart
index 909400d..384593e 100644
--- a/pkg/analyzer/lib/src/generated/ast.dart
+++ b/pkg/analyzer/lib/src/generated/ast.dart
@@ -595,10 +595,8 @@
Token get beginToken => _expression.beginToken;
@override
- Iterable get childEntities => new ChildEntities()
- ..add(_expression)
- ..add(asOperator)
- ..add(_type);
+ Iterable get childEntities =>
+ new ChildEntities()..add(_expression)..add(asOperator)..add(_type);
@override
Token get endToken => _type.endToken;
@@ -1612,8 +1610,7 @@
@override
VariableDeclaration visitVariableDeclaration(VariableDeclaration node) =>
- new VariableDeclaration(null, cloneNodeList(node.metadata),
- cloneNode(node.name), cloneToken(node.equals),
+ new VariableDeclaration(cloneNode(node.name), cloneToken(node.equals),
cloneNode(node.initializer));
@override
@@ -3194,9 +3191,8 @@
}
@override
- Iterable get childEntities => new ChildEntities()
- ..add(awaitKeyword)
- ..add(_expression);
+ Iterable get childEntities =>
+ new ChildEntities()..add(awaitKeyword)..add(_expression);
@override
Token get endToken => _expression.endToken;
@@ -3290,10 +3286,8 @@
}
@override
- Iterable get childEntities => new ChildEntities()
- ..add(_leftOperand)
- ..add(operator)
- ..add(_rightOperand);
+ Iterable get childEntities =>
+ new ChildEntities()..add(_leftOperand)..add(operator)..add(_rightOperand);
@override
Token get endToken => _rightOperand.endToken;
@@ -3498,10 +3492,8 @@
}
@override
- Iterable get childEntities => new ChildEntities()
- ..add(keyword)
- ..add(star)
- ..add(_block);
+ Iterable get childEntities =>
+ new ChildEntities()..add(keyword)..add(star)..add(_block);
@override
Token get endToken => _block.endToken;
@@ -3667,10 +3659,8 @@
Token get beginToken => breakKeyword;
@override
- Iterable get childEntities => new ChildEntities()
- ..add(breakKeyword)
- ..add(_label)
- ..add(semicolon);
+ Iterable get childEntities =>
+ new ChildEntities()..add(breakKeyword)..add(_label)..add(semicolon);
@override
Token get endToken => semicolon;
@@ -4577,9 +4567,8 @@
Token get beginToken => _identifier.beginToken;
@override
- Iterable get childEntities => new ChildEntities()
- ..add(newKeyword)
- ..add(_identifier);
+ Iterable get childEntities =>
+ new ChildEntities()..add(newKeyword)..add(_identifier);
@override
Token get endToken => _identifier.endToken;
@@ -4720,9 +4709,7 @@
Iterable get childEntities {
ChildEntities result = new ChildEntities()..add(_scriptTag);
if (_directivesAreBeforeDeclarations) {
- result
- ..addAll(_directives)
- ..addAll(_declarations);
+ result..addAll(_directives)..addAll(_declarations);
} else {
result.addAll(sortedDirectivesAndDeclarations);
}
@@ -5697,10 +5684,8 @@
Token get beginToken => _type.beginToken;
@override
- Iterable get childEntities => new ChildEntities()
- ..add(_type)
- ..add(period)
- ..add(_name);
+ Iterable get childEntities =>
+ new ChildEntities()..add(_type)..add(period)..add(_name);
@override
Token get endToken {
@@ -5790,10 +5775,8 @@
Token get beginToken => continueKeyword;
@override
- Iterable get childEntities => new ChildEntities()
- ..add(continueKeyword)
- ..add(_label)
- ..add(semicolon);
+ Iterable get childEntities =>
+ new ChildEntities()..add(continueKeyword)..add(_label)..add(semicolon);
@override
Token get endToken => semicolon;
@@ -5894,10 +5877,8 @@
}
@override
- Iterable get childEntities => super._childEntities
- ..add(keyword)
- ..add(_type)
- ..add(_identifier);
+ Iterable get childEntities =>
+ super._childEntities..add(keyword)..add(_type)..add(_identifier);
@override
LocalVariableElement get element {
@@ -6018,10 +5999,8 @@
Token get beginToken => _parameter.beginToken;
@override
- Iterable get childEntities => new ChildEntities()
- ..add(_parameter)
- ..add(separator)
- ..add(_defaultValue);
+ Iterable get childEntities =>
+ new ChildEntities()..add(_parameter)..add(separator)..add(_defaultValue);
/**
* Return the expression computing the default value for the parameter, or
@@ -6974,9 +6953,8 @@
Token get beginToken => _expression.beginToken;
@override
- Iterable get childEntities => new ChildEntities()
- ..add(_expression)
- ..add(semicolon);
+ Iterable get childEntities =>
+ new ChildEntities()..add(_expression)..add(semicolon);
@override
Token get endToken {
@@ -7038,9 +7016,8 @@
Token get beginToken => extendsKeyword;
@override
- Iterable get childEntities => new ChildEntities()
- ..add(extendsKeyword)
- ..add(_superclass);
+ Iterable get childEntities =>
+ new ChildEntities()..add(extendsKeyword)..add(_superclass);
@override
Token get endToken => _superclass.endToken;
@@ -7116,10 +7093,8 @@
}
@override
- Iterable get childEntities => super._childEntities
- ..add(staticKeyword)
- ..add(_fieldList)
- ..add(semicolon);
+ Iterable get childEntities =>
+ super._childEntities..add(staticKeyword)..add(_fieldList)..add(semicolon);
@override
Element get element => null;
@@ -7595,9 +7570,7 @@
}
result.add(parameter);
}
- return result
- ..add(rightDelimiter)
- ..add(rightParenthesis);
+ return result..add(rightDelimiter)..add(rightParenthesis);
}
@override
@@ -8074,9 +8047,8 @@
}
@override
- Iterable get childEntities => new ChildEntities()
- ..add(_parameters)
- ..add(_body);
+ Iterable get childEntities =>
+ new ChildEntities()..add(_parameters)..add(_body);
@override
Token get endToken {
@@ -8189,9 +8161,8 @@
}
@override
- Iterable get childEntities => new ChildEntities()
- ..add(_function)
- ..add(_argumentList);
+ Iterable get childEntities =>
+ new ChildEntities()..add(_function)..add(_argumentList);
@override
Token get endToken => _argumentList.endToken;
@@ -8374,10 +8345,8 @@
}
@override
- Iterable get childEntities => super._childEntities
- ..add(_returnType)
- ..add(identifier)
- ..add(parameters);
+ Iterable get childEntities =>
+ super._childEntities..add(_returnType)..add(identifier)..add(parameters);
@override
Token get endToken => _parameters.endToken;
@@ -10177,8 +10146,7 @@
@override
VariableDeclaration visitVariableDeclaration(VariableDeclaration node) =>
- new VariableDeclaration(null, _cloneNodeList(node.metadata),
- _cloneNode(node.name), _mapToken(node.equals),
+ new VariableDeclaration(_cloneNode(node.name), _mapToken(node.equals),
_cloneNode(node.initializer));
@override
@@ -10948,9 +10916,7 @@
Token get beginToken => _label.beginToken;
@override
- Iterable get childEntities => new ChildEntities()
- ..add(_label)
- ..add(colon);
+ Iterable get childEntities => new ChildEntities()..add(_label)..add(colon);
@override
Token get endToken => colon;
@@ -11082,10 +11048,8 @@
}
@override
- Iterable get childEntities => super._childEntities
- ..add(libraryKeyword)
- ..add(_name)
- ..add(semicolon);
+ Iterable get childEntities =>
+ super._childEntities..add(libraryKeyword)..add(_name)..add(semicolon);
@override
Token get endToken => semicolon;
@@ -11401,10 +11365,8 @@
Token get beginToken => _key.beginToken;
@override
- Iterable get childEntities => new ChildEntities()
- ..add(_key)
- ..add(separator)
- ..add(_value);
+ Iterable get childEntities =>
+ new ChildEntities()..add(_key)..add(separator)..add(_value);
@override
Token get endToken => _value.endToken;
@@ -11900,9 +11862,8 @@
Token get beginToken => _name.beginToken;
@override
- Iterable get childEntities => new ChildEntities()
- ..add(_name)
- ..add(_expression);
+ Iterable get childEntities =>
+ new ChildEntities()..add(_name)..add(_expression);
/**
* Return the element representing the parameter being named by this
@@ -12036,9 +11997,8 @@
Token get beginToken => nativeKeyword;
@override
- Iterable get childEntities => new ChildEntities()
- ..add(nativeKeyword)
- ..add(_name);
+ Iterable get childEntities =>
+ new ChildEntities()..add(nativeKeyword)..add(_name);
@override
Token get endToken => _name.endToken;
@@ -12360,8 +12320,17 @@
@override
Object visitNode(AstNode node) {
+ Token beginToken = node.beginToken;
+ Token endToken = node.endToken;
+ // Don't include synthetic tokens.
+ while (endToken != beginToken) {
+ if (endToken.type == TokenType.EOF || !endToken.isSynthetic) {
+ break;
+ }
+ endToken = endToken.previous;
+ }
+ int end = endToken.end;
int start = node.offset;
- int end = start + node.length;
if (end < _startOffset) {
return null;
}
@@ -13819,10 +13788,8 @@
: super(comment, metadata, partUri);
@override
- Iterable get childEntities => super._childEntities
- ..add(partKeyword)
- ..add(_uri)
- ..add(semicolon);
+ Iterable get childEntities =>
+ super._childEntities..add(partKeyword)..add(_uri)..add(semicolon);
@override
Token get endToken => semicolon;
@@ -14018,9 +13985,8 @@
}
@override
- Iterable get childEntities => new ChildEntities()
- ..add(_operand)
- ..add(operator);
+ Iterable get childEntities =>
+ new ChildEntities()..add(_operand)..add(operator);
@override
Token get endToken => operator;
@@ -14150,10 +14116,8 @@
}
@override
- Iterable get childEntities => new ChildEntities()
- ..add(_prefix)
- ..add(period)
- ..add(_identifier);
+ Iterable get childEntities =>
+ new ChildEntities()..add(_prefix)..add(period)..add(_identifier);
@override
Token get endToken => _identifier.endToken;
@@ -14294,9 +14258,8 @@
}
@override
- Iterable get childEntities => new ChildEntities()
- ..add(operator)
- ..add(_operand);
+ Iterable get childEntities =>
+ new ChildEntities()..add(operator)..add(_operand);
@override
Token get endToken => _operand.endToken;
@@ -14426,10 +14389,8 @@
}
@override
- Iterable get childEntities => new ChildEntities()
- ..add(_target)
- ..add(operator)
- ..add(_propertyName);
+ Iterable get childEntities =>
+ new ChildEntities()..add(_target)..add(operator)..add(_propertyName);
@override
Token get endToken => _propertyName.endToken;
@@ -15355,10 +15316,8 @@
Token get beginToken => returnKeyword;
@override
- Iterable get childEntities => new ChildEntities()
- ..add(returnKeyword)
- ..add(_expression)
- ..add(semicolon);
+ Iterable get childEntities =>
+ new ChildEntities()..add(returnKeyword)..add(_expression)..add(semicolon);
@override
Token get endToken => semicolon;
@@ -16042,10 +16001,8 @@
}
@override
- Iterable get childEntities => super._childEntities
- ..add(keyword)
- ..add(_type)
- ..add(identifier);
+ Iterable get childEntities =>
+ super._childEntities..add(keyword)..add(_type)..add(identifier);
@override
Token get endToken => identifier.endToken;
@@ -17323,9 +17280,8 @@
Token get beginToken => throwKeyword;
@override
- Iterable get childEntities => new ChildEntities()
- ..add(throwKeyword)
- ..add(_expression);
+ Iterable get childEntities =>
+ new ChildEntities()..add(throwKeyword)..add(_expression);
@override
Token get endToken {
@@ -17404,9 +17360,8 @@
}
@override
- Iterable get childEntities => super._childEntities
- ..add(_variableList)
- ..add(semicolon);
+ Iterable get childEntities =>
+ super._childEntities..add(_variableList)..add(semicolon);
@override
Element get element => null;
@@ -18818,9 +18773,8 @@
_typeArguments = _becomeParentOf(typeArguments);
}
- ChildEntities get _childEntities => new ChildEntities()
- ..add(constKeyword)
- ..add(_typeArguments);
+ ChildEntities get _childEntities =>
+ new ChildEntities()..add(constKeyword)..add(_typeArguments);
@override
void visitChildren(AstVisitor visitor) {
@@ -18864,9 +18818,8 @@
Token get beginToken => _name.beginToken;
@override
- Iterable get childEntities => new ChildEntities()
- ..add(_name)
- ..add(_typeArguments);
+ Iterable get childEntities =>
+ new ChildEntities()..add(_name)..add(_typeArguments);
@override
Token get endToken {
@@ -18981,10 +18934,8 @@
}
@override
- Iterable get childEntities => super._childEntities
- ..add(_name)
- ..add(extendsKeyword)
- ..add(_bound);
+ Iterable get childEntities =>
+ super._childEntities..add(_name)..add(extendsKeyword)..add(_bound);
@override
TypeParameterElement get element =>
@@ -19568,6 +19519,11 @@
*
* > variableDeclaration ::=
* > [SimpleIdentifier] ('=' [Expression])?
+ *
+ * TODO(paulberry): the grammar does not allow metadata to be associated with
+ * a VariableDeclaration, and currently we don't record comments for it either.
+ * Consider changing the class hierarchy so that [VariableDeclaration] does not
+ * extend [Declaration].
*/
class VariableDeclaration extends Declaration {
/**
@@ -19588,23 +19544,19 @@
Expression _initializer;
/**
- * Initialize a newly created variable declaration. Either or both of the
- * [comment] and [metadata] can be `null` if the declaration does not have the
- * corresponding attribute. The [equals] and [initializer] can be `null` if
- * there is no initializer.
+ * Initialize a newly created variable declaration. The [equals] and
+ * [initializer] can be `null` if there is no initializer.
*/
- VariableDeclaration(Comment comment, List<Annotation> metadata,
+ VariableDeclaration(
SimpleIdentifier name, this.equals, Expression initializer)
- : super(comment, metadata) {
+ : super(null, null) {
_name = _becomeParentOf(name);
_initializer = _becomeParentOf(initializer);
}
@override
- Iterable get childEntities => super._childEntities
- ..add(_name)
- ..add(equals)
- ..add(_initializer);
+ Iterable get childEntities =>
+ super._childEntities..add(_name)..add(equals)..add(_initializer);
/**
* This overridden implementation of getDocumentationComment() looks in the
@@ -19834,9 +19786,8 @@
Token get beginToken => _variableList.beginToken;
@override
- Iterable get childEntities => new ChildEntities()
- ..add(_variableList)
- ..add(semicolon);
+ Iterable get childEntities =>
+ new ChildEntities()..add(_variableList)..add(semicolon);
@override
Token get endToken => semicolon;
diff --git a/pkg/analyzer/lib/src/generated/constant.dart b/pkg/analyzer/lib/src/generated/constant.dart
index 7c866c1..6aafe29 100644
--- a/pkg/analyzer/lib/src/generated/constant.dart
+++ b/pkg/analyzer/lib/src/generated/constant.dart
@@ -303,6 +303,11 @@
*/
final List<Annotation> annotations = <Annotation>[];
+ /**
+ * True if instance variables marked as "final" should be treated as "const".
+ */
+ bool treatFinalInstanceVarAsConst = false;
+
@override
Object visitAnnotation(Annotation node) {
super.visitAnnotation(node);
@@ -311,6 +316,22 @@
}
@override
+ Object visitClassDeclaration(ClassDeclaration node) {
+ bool prevTreatFinalInstanceVarAsConst = treatFinalInstanceVarAsConst;
+ if (node.element.constructors.any((ConstructorElement e) => e.isConst)) {
+ // Instance vars marked "final" need to be included in the dependency
+ // graph, since constant constructors implicitly use the values in their
+ // initializers.
+ treatFinalInstanceVarAsConst = true;
+ }
+ try {
+ return super.visitClassDeclaration(node);
+ } finally {
+ treatFinalInstanceVarAsConst = prevTreatFinalInstanceVarAsConst;
+ }
+ }
+
+ @override
Object visitConstructorDeclaration(ConstructorDeclaration node) {
super.visitConstructorDeclaration(node);
if (node.constKeyword != null) {
@@ -335,7 +356,13 @@
Object visitVariableDeclaration(VariableDeclaration node) {
super.visitVariableDeclaration(node);
Expression initializer = node.initializer;
- if (initializer != null && node.isConst) {
+ VariableElement element = node.element;
+ if (initializer != null &&
+ (node.isConst ||
+ treatFinalInstanceVarAsConst &&
+ element is FieldElement &&
+ node.isFinal &&
+ !element.isStatic)) {
if (node.element != null) {
variableMap[node.element as PotentiallyConstVariableElement] = node;
}
@@ -454,6 +481,13 @@
void beforeComputeValue(AstNode constNode) {}
/**
+ * This method is called just before getting the constant value of a field
+ * with an initializer. Unit tests will override this method to introduce
+ * additional error checking.
+ */
+ void beforeGetFieldEvaluationResult(FieldElementImpl field) {}
+
+ /**
* This method is called just before getting the constant initializers
* associated with the [constructor]. Unit tests will override this method to
* introduce additional error checking.
@@ -520,6 +554,16 @@
}
}
}
+ for (FieldElement field in element.enclosingElement.fields) {
+ // Note: non-static const isn't allowed but we handle it anyway so that
+ // we won't be confused by incorrect code.
+ if ((field.isFinal || field.isConst) && !field.isStatic) {
+ VariableDeclaration fieldDeclaration = _variableDeclarationMap[field];
+ if (fieldDeclaration != null) {
+ referenceGraph.addEdge(declaration, fieldDeclaration);
+ }
+ }
+ }
for (FormalParameter parameter in declaration.parameters.parameters) {
referenceGraph.addNode(parameter);
referenceGraph.addEdge(declaration, parameter);
@@ -581,6 +625,10 @@
ConstructorElement constructor) =>
constructorDeclarationMap[_getConstructorBase(constructor)];
+ VariableDeclaration findVariableDeclaration(
+ PotentiallyConstVariableElement variable) =>
+ _variableDeclarationMap[variable];
+
/**
* Check that the arguments to a call to fromEnvironment() are correct. The
* [arguments] are the AST nodes of the arguments. The [argumentValues] are
@@ -898,6 +946,25 @@
}
HashMap<String, DartObjectImpl> fieldMap =
new HashMap<String, DartObjectImpl>();
+ // Start with final fields that are initialized at their declaration site.
+ for (FieldElement field in constructor.enclosingElement.fields) {
+ if ((field.isFinal || field.isConst) &&
+ !field.isStatic &&
+ field is ConstFieldElementImpl) {
+ beforeGetFieldEvaluationResult(field);
+ EvaluationResultImpl evaluationResult = field.evaluationResult;
+ DartType fieldType =
+ FieldMember.from(field, constructor.returnType).type;
+ DartObjectImpl fieldValue = evaluationResult.value;
+ if (fieldValue != null && !_runtimeTypeMatch(fieldValue, fieldType)) {
+ errorReporter.reportErrorForNode(
+ CheckedModeCompileTimeErrorCode.CONST_CONSTRUCTOR_FIELD_TYPE_MISMATCH,
+ node, [fieldValue.type, field.name, fieldType]);
+ }
+ fieldMap[field.name] = evaluationResult.value;
+ }
+ }
+ // Now evaluate the constructor declaration.
HashMap<String, DartObjectImpl> parameterMap =
new HashMap<String, DartObjectImpl>();
List<ParameterElement> parameters = constructor.parameters;
diff --git a/pkg/analyzer/lib/src/generated/element.dart b/pkg/analyzer/lib/src/generated/element.dart
index 861b1ea..46b6d03 100644
--- a/pkg/analyzer/lib/src/generated/element.dart
+++ b/pkg/analyzer/lib/src/generated/element.dart
@@ -110,6 +110,11 @@
*/
abstract class ClassElement implements Element {
/**
+ * An empty list of class elements.
+ */
+ static const List<ClassElement> EMPTY_LIST = const <ClassElement>[];
+
+ /**
* Return a list containing all of the accessors (getters and setters)
* declared in this class.
*/
@@ -173,6 +178,12 @@
bool get isEnum;
/**
+ * Return `true` if this class is a mixin application. A class is a mixin
+ * application if it was declared using the syntax "class A = B with C;".
+ */
+ bool get isMixinApplication;
+
+ /**
* Return `true` if this class [isProxy], or if it inherits the proxy
* annotation from a supertype.
*/
@@ -460,40 +471,40 @@
/**
* An empty list of class elements.
*/
+ @deprecated // Use ClassElement.EMPTY_LIST
static const List<ClassElement> EMPTY_ARRAY = const <ClassElement>[];
/**
* A list containing all of the accessors (getters and setters) contained in
* this class.
*/
- List<PropertyAccessorElement> _accessors =
- PropertyAccessorElementImpl.EMPTY_ARRAY;
+ List<PropertyAccessorElement> _accessors = PropertyAccessorElement.EMPTY_LIST;
/**
* A list containing all of the constructors contained in this class.
*/
- List<ConstructorElement> _constructors = ConstructorElementImpl.EMPTY_ARRAY;
+ List<ConstructorElement> _constructors = ConstructorElement.EMPTY_LIST;
/**
* A list containing all of the fields contained in this class.
*/
- List<FieldElement> _fields = FieldElementImpl.EMPTY_ARRAY;
+ List<FieldElement> _fields = FieldElement.EMPTY_LIST;
/**
* A list containing all of the mixins that are applied to the class being
* extended in order to derive the superclass of this class.
*/
- List<InterfaceType> mixins = InterfaceType.EMPTY_ARRAY;
+ List<InterfaceType> mixins = InterfaceType.EMPTY_LIST;
/**
* A list containing all of the interfaces that are implemented by this class.
*/
- List<InterfaceType> interfaces = InterfaceType.EMPTY_ARRAY;
+ List<InterfaceType> interfaces = InterfaceType.EMPTY_LIST;
/**
* A list containing all of the methods contained in this class.
*/
- List<MethodElement> _methods = MethodElementImpl.EMPTY_ARRAY;
+ List<MethodElement> _methods = MethodElement.EMPTY_LIST;
/**
* The superclass of the class, or `null` if the class does not have an
@@ -509,8 +520,7 @@
/**
* A list containing all of the type parameters defined for this class.
*/
- List<TypeParameterElement> _typeParameters =
- TypeParameterElementImpl.EMPTY_ARRAY;
+ List<TypeParameterElement> _typeParameters = TypeParameterElement.EMPTY_LIST;
/**
* The [SourceRange] of the `with` clause, `null` if there is no one.
@@ -656,6 +666,9 @@
bool get isEnum => hasModifier(Modifier.ENUM);
@override
+ bool get isMixinApplication => hasModifier(Modifier.MIXIN_APPLICATION);
+
+ @override
bool get isOrInheritsProxy =>
_safeIsOrInheritsProxy(this, new HashSet<ClassElement>());
@@ -691,6 +704,13 @@
this._methods = methods;
}
+ /**
+ * Set whether this class is a mixin application.
+ */
+ void set mixinApplication(bool isMixinApplication) {
+ setModifier(Modifier.MIXIN_APPLICATION, isMixinApplication);
+ }
+
bool get mixinErrorsReported => hasModifier(Modifier.MIXIN_ERRORS_REPORTED);
/**
@@ -1156,6 +1176,12 @@
*/
abstract class CompilationUnitElement implements Element, UriReferencedElement {
/**
+ * An empty list of compilation unit elements.
+ */
+ static const List<CompilationUnitElement> EMPTY_LIST =
+ const <CompilationUnitElement>[];
+
+ /**
* Return a list containing all of the top-level accessors (getters and
* setters) contained in this compilation unit.
*/
@@ -1240,6 +1266,7 @@
/**
* An empty list of compilation unit elements.
*/
+ @deprecated // Use CompilationUnitElement.EMPTY_LIST
static const List<CompilationUnitElement> EMPTY_ARRAY =
const <CompilationUnitElement>[];
@@ -1252,37 +1279,35 @@
* A list containing all of the top-level accessors (getters and setters)
* contained in this compilation unit.
*/
- List<PropertyAccessorElement> _accessors =
- PropertyAccessorElementImpl.EMPTY_ARRAY;
+ List<PropertyAccessorElement> _accessors = PropertyAccessorElement.EMPTY_LIST;
/**
* A list containing all of the enums contained in this compilation unit.
*/
- List<ClassElement> _enums = ClassElementImpl.EMPTY_ARRAY;
+ List<ClassElement> _enums = ClassElement.EMPTY_LIST;
/**
* A list containing all of the top-level functions contained in this
* compilation unit.
*/
- List<FunctionElement> _functions = FunctionElementImpl.EMPTY_ARRAY;
+ List<FunctionElement> _functions = FunctionElement.EMPTY_LIST;
/**
* A list containing all of the function type aliases contained in this
* compilation unit.
*/
List<FunctionTypeAliasElement> _typeAliases =
- FunctionTypeAliasElementImpl.EMPTY_ARRAY;
+ FunctionTypeAliasElement.EMPTY_LIST;
/**
* A list containing all of the types contained in this compilation unit.
*/
- List<ClassElement> _types = ClassElementImpl.EMPTY_ARRAY;
+ List<ClassElement> _types = ClassElement.EMPTY_LIST;
/**
* A list containing all of the variables contained in this compilation unit.
*/
- List<TopLevelVariableElement> _variables =
- TopLevelVariableElementImpl.EMPTY_ARRAY;
+ List<TopLevelVariableElement> _variables = TopLevelVariableElement.EMPTY_LIST;
/**
* A map from offsets to elements of this unit at these offsets.
@@ -1517,7 +1542,14 @@
}
/**
- * A [FieldElement] for a 'const' field that has an initializer.
+ * A [FieldElement] for a 'const' or 'final' field that has an initializer.
+ *
+ * TODO(paulberry): we should rename this class to reflect the fact that it's
+ * used for both const and final fields. However, we shouldn't do so until
+ * we've created an API for reading the values of constants; until that API is
+ * available, clients are likely to read constant values by casting to
+ * ConstFieldElementImpl, so it would be a breaking change to rename this
+ * class.
*/
class ConstFieldElementImpl extends FieldElementImpl with ConstVariableElement {
/**
@@ -1583,6 +1615,12 @@
abstract class ConstructorElement
implements ClassMemberElement, ExecutableElement {
/**
+ * An empty list of constructor elements.
+ */
+ static const List<ConstructorElement> EMPTY_LIST =
+ const <ConstructorElement>[];
+
+ /**
* Return `true` if this constructor is a const constructor.
*/
bool get isConst;
@@ -1636,6 +1674,7 @@
/**
* An empty list of constructor elements.
*/
+ @deprecated // Use ConstructorElement.EMPTY_LIST
static const List<ConstructorElement> EMPTY_ARRAY =
const <ConstructorElement>[];
@@ -1916,6 +1955,11 @@
*/
abstract class DartType {
/**
+ * An empty list of types.
+ */
+ static const List<DartType> EMPTY_LIST = const <DartType>[];
+
+ /**
* Return the name of this type as it should appear when presented to users in
* contexts such as error messages.
*/
@@ -2062,6 +2106,10 @@
void set evaluationResult(EvaluationResultImpl result) {
this._result = result;
}
+
+ @override
+ DefaultFormalParameter get node =>
+ getNodeMatching((node) => node is DefaultFormalParameter);
}
/**
@@ -2383,6 +2431,11 @@
*/
abstract class ElementAnnotation {
/**
+ * An empty list of annotations.
+ */
+ static const List<ElementAnnotation> EMPTY_LIST = const <ElementAnnotation>[];
+
+ /**
* Return the element representing the field, variable, or const constructor
* being used as an annotation.
*/
@@ -2414,6 +2467,7 @@
/**
* An empty list of annotations.
*/
+ @deprecated // Use ElementAnnotation.EMPTY_LIST
static const List<ElementAnnotationImpl> EMPTY_ARRAY =
const <ElementAnnotationImpl>[];
@@ -2545,7 +2599,7 @@
/**
* A list containing all of the metadata associated with this element.
*/
- List<ElementAnnotation> metadata = ElementAnnotationImpl.EMPTY_ARRAY;
+ List<ElementAnnotation> metadata = ElementAnnotation.EMPTY_LIST;
/**
* A cached copy of the calculated hashCode for this element.
@@ -3299,6 +3353,11 @@
*/
abstract class ExecutableElement implements Element {
/**
+ * An empty list of executable elements.
+ */
+ static const List<ExecutableElement> EMPTY_LIST = const <ExecutableElement>[];
+
+ /**
* Return a list containing all of the functions defined within this
* executable element.
*/
@@ -3379,6 +3438,7 @@
/**
* An empty list of executable elements.
*/
+ @deprecated // Use ExecutableElement.EMPTY_LIST
static const List<ExecutableElement> EMPTY_ARRAY =
const <ExecutableElement>[];
@@ -3386,24 +3446,23 @@
* A list containing all of the functions defined within this executable
* element.
*/
- List<FunctionElement> _functions = FunctionElementImpl.EMPTY_ARRAY;
+ List<FunctionElement> _functions = FunctionElement.EMPTY_LIST;
/**
* A list containing all of the labels defined within this executable element.
*/
- List<LabelElement> _labels = LabelElementImpl.EMPTY_ARRAY;
+ List<LabelElement> _labels = LabelElement.EMPTY_LIST;
/**
* A list containing all of the local variables defined within this executable
* element.
*/
- List<LocalVariableElement> _localVariables =
- LocalVariableElementImpl.EMPTY_ARRAY;
+ List<LocalVariableElement> _localVariables = LocalVariableElement.EMPTY_LIST;
/**
* A list containing all of the parameters defined by this executable element.
*/
- List<ParameterElement> _parameters = ParameterElementImpl.EMPTY_ARRAY;
+ List<ParameterElement> _parameters = ParameterElement.EMPTY_LIST;
/**
* The return type defined by this executable element.
@@ -3684,9 +3743,15 @@
/**
* An empty list of export elements.
*/
+ @deprecated // Use ExportElement.EMPTY_LIST
static const List<ExportElement> EMPTY_ARRAY = const <ExportElement>[];
/**
+ * An empty list of export elements.
+ */
+ static const List<ExportElement> EMPTY_LIST = const <ExportElement>[];
+
+ /**
* Return a list containing the combinators that were specified as part of the
* export directive in the order in which they were specified.
*/
@@ -3713,7 +3778,7 @@
* The combinators that were specified as part of the export directive in the
* order in which they were specified.
*/
- List<NamespaceCombinator> combinators = NamespaceCombinator.EMPTY_ARRAY;
+ List<NamespaceCombinator> combinators = NamespaceCombinator.EMPTY_LIST;
/**
* Initialize a newly created export element at the given [offset].
@@ -3778,6 +3843,11 @@
abstract class FieldElement
implements ClassMemberElement, PropertyInducingElement {
/**
+ * An empty list of field elements.
+ */
+ static const List<FieldElement> EMPTY_LIST = const <FieldElement>[];
+
+ /**
* Return {@code true} if this element is an enum constant.
*/
bool get isEnumConstant;
@@ -3801,6 +3871,7 @@
/**
* An empty list of field elements.
*/
+ @deprecated // Use FieldElement.EMPTY_LIST
static const List<FieldElement> EMPTY_ARRAY = const <FieldElement>[];
/**
@@ -3942,6 +4013,9 @@
bool get isStatic => baseElement.isStatic;
@override
+ VariableDeclaration get node => baseElement.node;
+
+ @override
DartType get propagatedType => substituteFor(baseElement.propagatedType);
@override
@@ -4011,6 +4085,11 @@
*/
abstract class FunctionElement implements ExecutableElement, LocalElement {
/**
+ * An empty list of function elements.
+ */
+ static const List<FunctionElement> EMPTY_LIST = const <FunctionElement>[];
+
+ /**
* The name of the method that can be implemented by a class to allow its
* instances to be invoked as if they were a function.
*/
@@ -4056,6 +4135,7 @@
/**
* An empty list of function elements.
*/
+ @deprecated // Use FunctionElement.EMPTY_LIST
static const List<FunctionElement> EMPTY_ARRAY = const <FunctionElement>[];
/**
@@ -4270,6 +4350,12 @@
*/
abstract class FunctionTypeAliasElement implements Element {
/**
+ * An empty array of type alias elements.
+ */
+ static List<FunctionTypeAliasElement> EMPTY_LIST =
+ new List<FunctionTypeAliasElement>(0);
+
+ /**
* Return the compilation unit in which this type alias is defined.
*/
@override
@@ -4313,13 +4399,14 @@
/**
* An empty array of type alias elements.
*/
+ @deprecated // Use FunctionTypeAliasElement.EMPTY_LIST
static List<FunctionTypeAliasElement> EMPTY_ARRAY =
new List<FunctionTypeAliasElement>(0);
/**
* A list containing all of the parameters defined by this type alias.
*/
- List<ParameterElement> _parameters = ParameterElementImpl.EMPTY_ARRAY;
+ List<ParameterElement> _parameters = ParameterElement.EMPTY_LIST;
/**
* The return type defined by this type alias.
@@ -4334,8 +4421,7 @@
/**
* A list containing all of the type parameters defined for this type.
*/
- List<TypeParameterElement> _typeParameters =
- TypeParameterElementImpl.EMPTY_ARRAY;
+ List<TypeParameterElement> _typeParameters = TypeParameterElement.EMPTY_LIST;
/**
* Initialize a newly created type alias element to have the given name.
@@ -4477,7 +4563,7 @@
/**
* A list containing the actual types of the type arguments.
*/
- List<DartType> typeArguments = TypeImpl.EMPTY_ARRAY;
+ List<DartType> typeArguments = DartType.EMPTY_LIST;
/**
* Initialize a newly created function type to be declared by the given
@@ -4617,7 +4703,7 @@
List<DartType> get normalParameterTypes {
List<ParameterElement> parameters = baseParameters;
if (parameters.length == 0) {
- return TypeImpl.EMPTY_ARRAY;
+ return DartType.EMPTY_LIST;
}
List<DartType> typeParameters =
TypeParameterTypeImpl.getTypes(this.typeParameters);
@@ -4639,7 +4725,7 @@
List<DartType> get optionalParameterTypes {
List<ParameterElement> parameters = baseParameters;
if (parameters.length == 0) {
- return TypeImpl.EMPTY_ARRAY;
+ return DartType.EMPTY_LIST;
}
List<DartType> typeParameters =
TypeParameterTypeImpl.getTypes(this.typeParameters);
@@ -4703,7 +4789,7 @@
if (definingClass != null) {
return definingClass.typeParameters;
}
- return TypeParameterElementImpl.EMPTY_ARRAY;
+ return TypeParameterElement.EMPTY_LIST;
}
@override
@@ -5379,6 +5465,11 @@
*/
abstract class HtmlElement implements Element {
/**
+ * An empty list of HTML file elements.
+ */
+ static const List<HtmlElement> EMPTY_LIST = const <HtmlElement>[];
+
+ /**
* Return a list containing all of the script elements contained in the HTML
* file. This includes scripts with libraries that are defined by the content
* of a script tag as well as libraries that are referenced in the `source`
@@ -5394,6 +5485,7 @@
/**
* An empty list of HTML file elements.
*/
+ @deprecated // Use HtmlElement.EMPTY_LIST
static const List<HtmlElement> EMPTY_ARRAY = const <HtmlElement>[];
/**
@@ -5404,7 +5496,7 @@
/**
* The scripts contained in or referenced from script tags in the HTML file.
*/
- List<HtmlScriptElement> _scripts = HtmlScriptElementImpl.EMPTY_ARRAY;
+ List<HtmlScriptElement> _scripts = HtmlScriptElement.EMPTY_LIST;
/**
* The source that corresponds to this HTML file.
@@ -5434,7 +5526,7 @@
*/
void set scripts(List<HtmlScriptElement> scripts) {
if (scripts.length == 0) {
- this._scripts = HtmlScriptElementImpl.EMPTY_ARRAY;
+ this._scripts = HtmlScriptElement.EMPTY_LIST;
return;
}
for (HtmlScriptElement script in scripts) {
@@ -5475,7 +5567,12 @@
*
* See [EmbeddedHtmlScriptElement], and [ExternalHtmlScriptElement].
*/
-abstract class HtmlScriptElement implements Element {}
+abstract class HtmlScriptElement implements Element {
+ /**
+ * An empty list of HTML script elements.
+ */
+ static const List<HtmlScriptElement> EMPTY_LIST = const <HtmlScriptElement>[];
+}
/**
* A concrete implementation of an [HtmlScriptElement].
@@ -5485,6 +5582,7 @@
/**
* An empty list of HTML script elements.
*/
+ @deprecated // Use HtmlScriptElement.EMPTY_LIST
static const List<HtmlScriptElement> EMPTY_ARRAY =
const <HtmlScriptElement>[];
@@ -5503,9 +5601,15 @@
/**
* An empty list of import elements.
*/
+ @deprecated // Use ImportElement.EMPTY_LIST
static const List<ImportElement> EMPTY_ARRAY = const <ImportElement>[];
/**
+ * An empty list of import elements.
+ */
+ static const List<ImportElement> EMPTY_LIST = const <ImportElement>[];
+
+ /**
* Return a list containing the combinators that were specified as part of the
* import directive in the order in which they were specified.
*/
@@ -5556,7 +5660,7 @@
* The combinators that were specified as part of the import directive in the
* order in which they were specified.
*/
- List<NamespaceCombinator> combinators = NamespaceCombinator.EMPTY_ARRAY;
+ List<NamespaceCombinator> combinators = NamespaceCombinator.EMPTY_LIST;
/**
* The prefix that was specified as part of the import directive, or `null` if
@@ -5611,9 +5715,15 @@
/**
* An empty list of types.
*/
+ @deprecated // Use InterfaceType.EMPTY_LIST
static const List<InterfaceType> EMPTY_ARRAY = const <InterfaceType>[];
/**
+ * An empty list of types.
+ */
+ static const List<InterfaceType> EMPTY_LIST = const <InterfaceType>[];
+
+ /**
* Return a list containing all of the accessors (getters and setters)
* declared in this type.
*/
@@ -5938,7 +6048,7 @@
/**
* A list containing the actual types of the type arguments.
*/
- List<DartType> typeArguments = TypeImpl.EMPTY_ARRAY;
+ List<DartType> typeArguments = DartType.EMPTY_LIST;
/**
* Initialize a newly created type to be declared by the given [element].
@@ -6616,6 +6726,11 @@
*/
abstract class LabelElement implements Element {
/**
+ * An empty list of label elements.
+ */
+ static const List<LabelElement> EMPTY_LIST = const <LabelElement>[];
+
+ /**
* Return the executable element in which this label is defined.
*/
@override
@@ -6629,6 +6744,7 @@
/**
* An empty list of label elements.
*/
+ @deprecated // Use LabelElement.EMPTY_LIST
static const List<LabelElement> EMPTY_ARRAY = const <LabelElement>[];
/**
@@ -6682,6 +6798,11 @@
*/
abstract class LibraryElement implements Element {
/**
+ * An empty list of library elements.
+ */
+ static const List<LibraryElement> EMPTY_LIST = const <LibraryElement>[];
+
+ /**
* Return the compilation unit that defines this library.
*/
CompilationUnitElement get definingCompilationUnit;
@@ -6817,6 +6938,7 @@
/**
* An empty list of library elements.
*/
+ @deprecated // Use LibraryElement.EMPTY_LIST
static const List<LibraryElement> EMPTY_ARRAY = const <LibraryElement>[];
/**
@@ -6839,19 +6961,19 @@
* A list containing specifications of all of the imports defined in this
* library.
*/
- List<ImportElement> _imports = ImportElement.EMPTY_ARRAY;
+ List<ImportElement> _imports = ImportElement.EMPTY_LIST;
/**
* A list containing specifications of all of the exports defined in this
* library.
*/
- List<ExportElement> _exports = ExportElement.EMPTY_ARRAY;
+ List<ExportElement> _exports = ExportElement.EMPTY_LIST;
/**
* A list containing all of the compilation units that are included in this
* library using a `part` directive.
*/
- List<CompilationUnitElement> _parts = CompilationUnitElementImpl.EMPTY_ARRAY;
+ List<CompilationUnitElement> _parts = CompilationUnitElement.EMPTY_LIST;
/**
* The element representing the synthetic function `loadLibrary` that is
@@ -7296,7 +7418,23 @@
/**
* A local variable.
*/
-abstract class LocalVariableElement implements LocalElement, VariableElement {}
+abstract class LocalVariableElement implements LocalElement, VariableElement {
+ /**
+ * An empty list of field elements.
+ */
+ static const List<LocalVariableElement> EMPTY_LIST =
+ const <LocalVariableElement>[];
+
+ /**
+ * Return the resolved [VariableDeclaration] node that declares this
+ * [LocalVariableElement].
+ *
+ * This method is expensive, because resolved AST might be evicted from cache,
+ * so parsing and resolving will be performed.
+ */
+ @override
+ VariableDeclaration get node;
+}
/**
* A concrete implementation of a [LocalVariableElement].
@@ -7306,6 +7444,7 @@
/**
* An empty list of field elements.
*/
+ @deprecated // Use LocalVariableElement.EMPTY_LIST
static const List<LocalVariableElement> EMPTY_ARRAY =
const <LocalVariableElement>[];
@@ -7351,6 +7490,10 @@
ElementKind get kind => ElementKind.LOCAL_VARIABLE;
@override
+ VariableDeclaration get node =>
+ getNodeMatching((node) => node is VariableDeclaration);
+
+ @override
SourceRange get visibleRange {
if (_visibleRangeLength < 0) {
return null;
@@ -7549,6 +7692,11 @@
*/
abstract class MethodElement implements ClassMemberElement, ExecutableElement {
/**
+ * An empty list of method elements.
+ */
+ static const List<MethodElement> EMPTY_LIST = const <MethodElement>[];
+
+ /**
* Return the resolved [MethodDeclaration] node that declares this
* [MethodElement].
*
@@ -7566,6 +7714,7 @@
/**
* An empty list of method elements.
*/
+ @deprecated // Use MethodElement.EMPTY_LIST
static const List<MethodElement> EMPTY_ARRAY = const <MethodElement>[];
/**
@@ -7789,41 +7938,47 @@
static const Modifier MIXIN = const Modifier('MIXIN', 10);
/**
+ * Indicates that a class is a mixin application.
+ */
+ static const Modifier MIXIN_APPLICATION =
+ const Modifier('MIXIN_APPLICATION', 11);
+
+ /**
* Indicates that an error has reported explaining why this class is an
* invalid mixin application.
*/
static const Modifier MIXIN_ERRORS_REPORTED =
- const Modifier('MIXIN_ERRORS_REPORTED', 11);
+ const Modifier('MIXIN_ERRORS_REPORTED', 12);
/**
* Indicates that the value of a parameter or local variable might be mutated
* within the context.
*/
static const Modifier POTENTIALLY_MUTATED_IN_CONTEXT =
- const Modifier('POTENTIALLY_MUTATED_IN_CONTEXT', 12);
+ const Modifier('POTENTIALLY_MUTATED_IN_CONTEXT', 13);
/**
* Indicates that the value of a parameter or local variable might be mutated
* within the scope.
*/
static const Modifier POTENTIALLY_MUTATED_IN_SCOPE =
- const Modifier('POTENTIALLY_MUTATED_IN_SCOPE', 13);
+ const Modifier('POTENTIALLY_MUTATED_IN_SCOPE', 14);
/**
* Indicates that a class contains an explicit reference to 'super'.
*/
static const Modifier REFERENCES_SUPER =
- const Modifier('REFERENCES_SUPER', 14);
+ const Modifier('REFERENCES_SUPER', 15);
/**
* Indicates that the pseudo-modifier 'set' was applied to the element.
*/
- static const Modifier SETTER = const Modifier('SETTER', 15);
+ static const Modifier SETTER = const Modifier('SETTER', 16);
/**
* Indicates that the modifier 'static' was applied to the element.
*/
- static const Modifier STATIC = const Modifier('STATIC', 16);
+ static const Modifier STATIC = const Modifier('STATIC', 17);
/**
* Indicates that the element does not appear in the source code but was
@@ -7831,13 +7986,13 @@
* constructors, an implicit zero-argument constructor will be created and it
* will be marked as being synthetic.
*/
- static const Modifier SYNTHETIC = const Modifier('SYNTHETIC', 17);
+ static const Modifier SYNTHETIC = const Modifier('SYNTHETIC', 18);
/**
* Indicates that a class was defined using an alias.
* TODO(brianwilkerson) This should be renamed to 'ALIAS'.
*/
- static const Modifier TYPEDEF = const Modifier('TYPEDEF', 18);
+ static const Modifier TYPEDEF = const Modifier('TYPEDEF', 19);
static const List<Modifier> values = const [
ABSTRACT,
@@ -7851,6 +8006,7 @@
GETTER,
HAS_EXT_URI,
MIXIN,
+ MIXIN_APPLICATION,
MIXIN_ERRORS_REPORTED,
POTENTIALLY_MUTATED_IN_CONTEXT,
POTENTIALLY_MUTATED_IN_SCOPE,
@@ -7953,7 +8109,7 @@
ElementLocation get location => null;
@override
- List<ElementAnnotation> get metadata => ElementAnnotationImpl.EMPTY_ARRAY;
+ List<ElementAnnotation> get metadata => ElementAnnotation.EMPTY_LIST;
@override
String get name => _name;
@@ -8090,7 +8246,7 @@
* A list the array of executable elements that were used to compose this
* element.
*/
- List<ExecutableElement> _elements = MethodElementImpl.EMPTY_ARRAY;
+ List<ExecutableElement> _elements = MethodElement.EMPTY_LIST;
MultiplyInheritedMethodElementImpl(Identifier name) : super.forNode(name) {
synthetic = true;
@@ -8115,7 +8271,7 @@
* A list the array of executable elements that were used to compose this
* element.
*/
- List<ExecutableElement> _elements = PropertyAccessorElementImpl.EMPTY_ARRAY;
+ List<ExecutableElement> _elements = PropertyAccessorElement.EMPTY_LIST;
MultiplyInheritedPropertyAccessorElementImpl(Identifier name)
: super.forNode(name) {
@@ -8137,8 +8293,15 @@
/**
* An empty list of namespace combinators.
*/
+ @deprecated // Use NamespaceCombinator.EMPTY_LIST
static const List<NamespaceCombinator> EMPTY_ARRAY =
const <NamespaceCombinator>[];
+
+ /**
+ * An empty list of namespace combinators.
+ */
+ static const List<NamespaceCombinator> EMPTY_LIST =
+ const <NamespaceCombinator>[];
}
/**
@@ -8146,6 +8309,11 @@
*/
abstract class ParameterElement implements LocalElement, VariableElement {
/**
+ * An empty list of parameter elements.
+ */
+ static const List<ParameterElement> EMPTY_LIST = const <ParameterElement>[];
+
+ /**
* Return the Dart code of the default value, or `null` if no default value.
*/
String get defaultValueCode;
@@ -8155,6 +8323,9 @@
*/
bool get isInitializingFormal;
+ @override
+ FormalParameter get node;
+
/**
* Return the kind of this parameter.
*/
@@ -8174,8 +8345,9 @@
class ParameterElementImpl extends VariableElementImpl
implements ParameterElement {
/**
- * An empty list of field elements.
+ * An empty list of parameter elements.
*/
+ @deprecated // Use ParameterElement.EMPTY_LIST
static const List<ParameterElement> EMPTY_ARRAY = const <ParameterElement>[];
/**
@@ -8183,7 +8355,7 @@
* There will only be parameters if this parameter is a function typed
* parameter.
*/
- List<ParameterElement> _parameters = ParameterElementImpl.EMPTY_ARRAY;
+ List<ParameterElement> _parameters = ParameterElement.EMPTY_LIST;
/**
* The kind of this parameter.
@@ -8242,6 +8414,10 @@
ElementKind get kind => ElementKind.PARAMETER;
@override
+ FormalParameter get node =>
+ getNodeMatching((node) => node is FormalParameter);
+
+ @override
List<ParameterElement> get parameters => _parameters;
/**
@@ -8388,6 +8564,9 @@
bool get isInitializingFormal => baseElement.isInitializingFormal;
@override
+ FormalParameter get node => baseElement.node;
+
+ @override
ParameterKind get parameterKind => baseElement.parameterKind;
@override
@@ -8517,6 +8696,11 @@
*/
abstract class PrefixElement implements Element {
/**
+ * An empty list of prefix elements.
+ */
+ static const List<PrefixElement> EMPTY_LIST = const <PrefixElement>[];
+
+ /**
* Return the library into which other libraries are imported using this
* prefix.
*/
@@ -8537,12 +8721,13 @@
/**
* An empty list of prefix elements.
*/
+ @deprecated // Use PrefixElement.EMPTY_LIST
static const List<PrefixElement> EMPTY_ARRAY = const <PrefixElement>[];
/**
* A list containing all of the libraries that are imported using this prefix.
*/
- List<LibraryElement> _importedLibraries = LibraryElementImpl.EMPTY_ARRAY;
+ List<LibraryElement> _importedLibraries = LibraryElement.EMPTY_LIST;
/**
* Initialize a newly created method element to have the given [name] and
@@ -8604,6 +8789,12 @@
*/
abstract class PropertyAccessorElement implements ExecutableElement {
/**
+ * An empty list of property accessor elements.
+ */
+ static const List<PropertyAccessorElement> EMPTY_LIST =
+ const <PropertyAccessorElement>[];
+
+ /**
* Return the accessor representing the getter that corresponds to (has the
* same name as) this setter, or `null` if this accessor is not a setter or if
* there is no corresponding getter.
@@ -8643,6 +8834,7 @@
/**
* An empty list of property accessor elements.
*/
+ @deprecated // Use PropertyAccessorElement.EMPTY_LIST
static const List<PropertyAccessorElement> EMPTY_ARRAY =
const <PropertyAccessorElement>[];
@@ -8933,6 +9125,12 @@
*/
abstract class PropertyInducingElement implements VariableElement {
/**
+ * An empty list of elements.
+ */
+ static const List<PropertyInducingElement> EMPTY_LIST =
+ const <PropertyInducingElement>[];
+
+ /**
* Return the getter associated with this variable. If this variable was
* explicitly defined (is not synthetic) then the getter associated with it
* will be synthetic.
@@ -8972,6 +9170,7 @@
/**
* An empty list of elements.
*/
+ @deprecated // Use PropertyInducingElement.EMPTY_LIST
static const List<PropertyInducingElement> EMPTY_ARRAY =
const <PropertyInducingElement>[];
@@ -9287,7 +9486,16 @@
/**
* A top-level variable.
*/
-abstract class TopLevelVariableElement implements PropertyInducingElement {}
+abstract class TopLevelVariableElement implements PropertyInducingElement {
+ /**
+ * An empty list of top-level variable elements.
+ */
+ static const List<TopLevelVariableElement> EMPTY_LIST =
+ const <TopLevelVariableElement>[];
+
+ @override
+ VariableDeclaration get node;
+}
/**
* A concrete implementation of a [TopLevelVariableElement].
@@ -9297,6 +9505,7 @@
/**
* An empty list of top-level variable elements.
*/
+ @deprecated // Use TopLevelVariableElement.EMPTY_LIST
static const List<TopLevelVariableElement> EMPTY_ARRAY =
const <TopLevelVariableElement>[];
@@ -9319,6 +9528,10 @@
ElementKind get kind => ElementKind.TOP_LEVEL_VARIABLE;
@override
+ VariableDeclaration get node =>
+ getNodeMatching((node) => node is VariableDeclaration);
+
+ @override
accept(ElementVisitor visitor) => visitor.visitTopLevelVariableElement(this);
}
@@ -9330,6 +9543,7 @@
/**
* An empty list of types.
*/
+ @deprecated // Use DartType.EMPTY_LIST
static const List<DartType> EMPTY_ARRAY = const <DartType>[];
/**
@@ -9521,6 +9735,12 @@
*/
abstract class TypeParameterElement implements Element {
/**
+ * An empty list of type parameter elements.
+ */
+ static const List<TypeParameterElement> EMPTY_LIST =
+ const <TypeParameterElement>[];
+
+ /**
* Return the type representing the bound associated with this parameter, or
* `null` if this parameter does not have an explicit bound.
*/
@@ -9540,6 +9760,7 @@
/**
* An empty list of type parameter elements.
*/
+ @deprecated // Use TypeParameterElement.EMPTY_LIST
static const List<TypeParameterElement> EMPTY_ARRAY =
const <TypeParameterElement>[];
@@ -9585,6 +9806,11 @@
* The type introduced by a type parameter.
*/
abstract class TypeParameterType implements DartType {
+ /**
+ * An empty list of type parameter types.
+ */
+ static const List<TypeParameterType> EMPTY_LIST = const <TypeParameterType>[];
+
@override
TypeParameterElement get element;
}
@@ -9596,6 +9822,7 @@
/**
* An empty list of type parameter types.
*/
+ @deprecated // Use TypeParameterType.EMPTY_LIST
static const List<TypeParameterType> EMPTY_ARRAY =
const <TypeParameterType>[];
@@ -9704,7 +9931,7 @@
List<TypeParameterElement> typeParameters) {
int count = typeParameters.length;
if (count == 0) {
- return EMPTY_ARRAY;
+ return TypeParameterType.EMPTY_LIST;
}
List<TypeParameterType> types = new List<TypeParameterType>(count);
for (int i = 0; i < count; i++) {
@@ -9853,6 +10080,11 @@
*/
abstract class VariableElement implements Element {
/**
+ * An empty list of variable elements.
+ */
+ static const List<VariableElement> EMPTY_LIST = const <VariableElement>[];
+
+ /**
* Return a synthetic function representing this variable's initializer, or
* `null` if this variable does not have an initializer. The function will
* have no parameters. The return type of the function will be the
@@ -9889,16 +10121,6 @@
bool get isPotentiallyMutatedInScope;
/**
- * Return the resolved [VariableDeclaration] node that declares this
- * [VariableElement].
- *
- * This method is expensive, because resolved AST might be evicted from cache,
- * so parsing and resolving will be performed.
- */
- @override
- VariableDeclaration get node;
-
- /**
* Return the declared type of this variable, or `null` if the variable did
* not have a declared type (such as if it was declared using the keyword
* 'var').
@@ -9914,6 +10136,7 @@
/**
* An empty list of variable elements.
*/
+ @deprecated // Use VariableElement.EMPTY_LIST
static const List<VariableElement> EMPTY_ARRAY = const <VariableElement>[];
/**
@@ -9996,10 +10219,6 @@
bool get isPotentiallyMutatedInScope => false;
@override
- VariableDeclaration get node =>
- getNodeMatching((node) => node is VariableDeclaration);
-
- @override
void appendTo(StringBuffer buffer) {
buffer.write(type);
buffer.write(" ");
@@ -10053,9 +10272,6 @@
baseElement.isPotentiallyMutatedInScope;
@override
- VariableDeclaration get node => baseElement.node;
-
- @override
DartType get type => substituteFor(baseElement.type);
@override
diff --git a/pkg/analyzer/lib/src/generated/element_handle.dart b/pkg/analyzer/lib/src/generated/element_handle.dart
index 0cb42ec..856483b 100644
--- a/pkg/analyzer/lib/src/generated/element_handle.dart
+++ b/pkg/analyzer/lib/src/generated/element_handle.dart
@@ -61,6 +61,9 @@
bool get isEnum => actualElement.isEnum;
@override
+ bool get isMixinApplication => actualElement.isMixinApplication;
+
+ @override
bool get isOrInheritsProxy => actualElement.isOrInheritsProxy;
@override
@@ -600,6 +603,9 @@
@override
ElementKind get kind => ElementKind.FIELD;
+
+ @override
+ VariableDeclaration get node => actualElement.node;
}
/**
@@ -839,6 +845,9 @@
ElementKind get kind => ElementKind.LOCAL_VARIABLE;
@override
+ VariableDeclaration get node => actualElement.node;
+
+ @override
SourceRange get visibleRange => actualElement.visibleRange;
}
@@ -1085,9 +1094,6 @@
actualElement.isPotentiallyMutatedInScope;
@override
- VariableDeclaration get node => actualElement.node;
-
- @override
DartType get type => actualElement.type;
}
/**
diff --git a/pkg/analyzer/lib/src/generated/element_resolver.dart b/pkg/analyzer/lib/src/generated/element_resolver.dart
index 9009aae..33d1617 100644
--- a/pkg/analyzer/lib/src/generated/element_resolver.dart
+++ b/pkg/analyzer/lib/src/generated/element_resolver.dart
@@ -393,6 +393,12 @@
}
@override
+ Object visitEnumDeclaration(EnumDeclaration node) {
+ _setMetadata(node.element, node);
+ return null;
+ }
+
+ @override
Object visitExportDirective(ExportDirective node) {
ExportElement exportElement = node.element;
if (exportElement != null) {
diff --git a/pkg/analyzer/lib/src/generated/engine.dart b/pkg/analyzer/lib/src/generated/engine.dart
index 4cd2f615..2d482d8 100644
--- a/pkg/analyzer/lib/src/generated/engine.dart
+++ b/pkg/analyzer/lib/src/generated/engine.dart
@@ -12,10 +12,14 @@
import 'dart:collection';
import 'package:analyzer/src/cancelable_future.dart';
+import 'package:analyzer/src/context/cache.dart' as cache;
+import 'package:analyzer/src/context/context.dart' as newContext;
import 'package:analyzer/src/generated/incremental_resolution_validator.dart';
import 'package:analyzer/src/plugin/engine_plugin.dart';
import 'package:analyzer/src/services/lint.dart';
+import 'package:analyzer/src/task/manager.dart';
import 'package:analyzer/src/task/task_dart.dart';
+import 'package:analyzer/task/model.dart';
import '../../instrumentation/instrumentation.dart';
import 'ast.dart';
@@ -390,13 +394,6 @@
Stream<SourcesChangedEvent> get onSourcesChanged;
/**
- * Return a list containing all of the sources known to this context whose
- * state is neither valid or flushed. These sources are not safe to update
- * during refactoring, because we might not know all the references in them.
- */
- List<Source> get refactoringUnsafeSources;
-
- /**
* Return the source factory used to create the sources that can be analyzed
* in this context.
*/
@@ -1132,6 +1129,18 @@
DeclaredVariables get declaredVariables => _declaredVariables;
@override
+ List<AnalysisTarget> get explicitTargets {
+ List<AnalysisTarget> targets = <AnalysisTarget>[];
+ MapIterator<Source, SourceEntry> iterator = _cache.iterator();
+ while (iterator.moveNext()) {
+ if (iterator.value.explicitlyAdded) {
+ targets.add(iterator.key);
+ }
+ }
+ return targets;
+ }
+
+ @override
List<Source> get htmlSources => _getSources(SourceKind.HTML);
@override
@@ -1329,20 +1338,7 @@
List<Source> get prioritySources => _priorityOrder;
@override
- List<Source> get refactoringUnsafeSources {
- List<Source> sources = new List<Source>();
- MapIterator<Source, SourceEntry> iterator = _cache.iterator();
- while (iterator.moveNext()) {
- SourceEntry sourceEntry = iterator.value;
- if (sourceEntry is DartEntry) {
- Source source = iterator.key;
- if (!source.isInSystemLibrary && !sourceEntry.isRefactoringSafe) {
- sources.add(source);
- }
- }
- }
- return sources;
- }
+ List<AnalysisTarget> get priorityTargets => prioritySources;
@override
SourceFactory get sourceFactory => _sourceFactory;
@@ -1826,6 +1822,11 @@
}
@override
+ cache.CacheEntry getCacheEntry(AnalysisTarget target) {
+ return null;
+ }
+
+ @override
CompilationUnitElement getCompilationUnitElement(
Source unitSource, Source librarySource) {
LibraryElement libraryElement = getLibraryElement(librarySource);
@@ -5739,6 +5740,23 @@
*/
final PartitionManager partitionManager = new PartitionManager();
+ /**
+ * The partition manager being used to manage the shared partitions.
+ */
+ final newContext.PartitionManager partitionManager_new =
+ new newContext.PartitionManager();
+
+ /**
+ * A flag indicating whether the (new) task model should be used to perform
+ * analysis.
+ */
+ bool useTaskModel = false;
+
+ /**
+ * The task manager used to manage the tasks used to analyze code.
+ */
+ TaskManager _taskManager;
+
AnalysisEngine._();
/**
@@ -5774,6 +5792,17 @@
}
/**
+ * Return the task manager used to manage the tasks used to analyze code.
+ */
+ TaskManager get taskManager {
+ if (_taskManager == null) {
+ _taskManager = new TaskManager();
+ _taskManager.addTaskDescriptors(enginePlugin.taskDescriptors);
+ }
+ return _taskManager;
+ }
+
+ /**
* Clear any caches holding on to analysis results so that a full re-analysis
* will be performed the next time an analysis context is created.
*/
@@ -5785,6 +5814,9 @@
* Create and return a new context in which analysis can be performed.
*/
AnalysisContext createAnalysisContext() {
+ if (useTaskModel) {
+ return new newContext.AnalysisContextImpl();
+ }
return new AnalysisContextImpl();
}
@@ -7172,7 +7204,7 @@
/**
* A pair containing a source and the cache entry associated with that source.
* They are used to reduce the number of times an entry must be looked up in the
- * [cache].
+ * cache.
*/
class CycleBuilder_SourceEntryPair {
/**
@@ -7488,22 +7520,6 @@
return false;
}
- /**
- * Return `true` if this data is safe to use in refactoring.
- */
- bool get isRefactoringSafe {
- ResolutionState state = _resolutionState;
- while (state != null) {
- CacheState resolvedState = state.getState(RESOLVED_UNIT);
- if (resolvedState != CacheState.VALID &&
- resolvedState != CacheState.FLUSHED) {
- return false;
- }
- state = state._nextState;
- }
- return true;
- }
-
@override
SourceKind get kind => getValue(SOURCE_KIND);
@@ -9010,12 +9026,27 @@
set contentCache(ContentCache value);
/**
+ * Return a list of the explicit targets being analyzed by this context.
+ */
+ List<AnalysisTarget> get explicitTargets;
+
+ /**
+ * A factory to override how [LibraryResolver] is created.
+ */
+ LibraryResolverFactory get libraryResolverFactory;
+
+ /**
* Return a list containing all of the sources that have been marked as
* priority sources. Clients must not modify the returned list.
*/
List<Source> get prioritySources;
/**
+ * Return a list of the priority targets being analyzed by this context.
+ */
+ List<AnalysisTarget> get priorityTargets;
+
+ /**
* A factory to override how [ResolverVisitor] is created.
*/
ResolverVisitorFactory get resolverVisitorFactory;
@@ -9036,11 +9067,6 @@
TypeResolverVisitorFactory get typeResolverVisitorFactory;
/**
- * A factory to override how [LibraryResolver] is created.
- */
- LibraryResolverFactory get libraryResolverFactory;
-
- /**
* Add the given [source] with the given [information] to this context.
*/
void addSourceInfo(Source source, SourceEntry information);
@@ -9086,6 +9112,11 @@
List<CompilationUnit> ensureResolvedDartUnits(Source source);
/**
+ * Return the cache entry associated with the given [target].
+ */
+ cache.CacheEntry getCacheEntry(AnalysisTarget target);
+
+ /**
* Return context that owns the given [source].
*/
InternalAnalysisContext getContextFor(Source source);
diff --git a/pkg/analyzer/lib/src/generated/error_verifier.dart b/pkg/analyzer/lib/src/generated/error_verifier.dart
index 9bfb167..ebfbb3b 100644
--- a/pkg/analyzer/lib/src/generated/error_verifier.dart
+++ b/pkg/analyzer/lib/src/generated/error_verifier.dart
@@ -1579,7 +1579,7 @@
SimpleIdentifier fieldName = field.name;
if (getter != null) {
if (_checkForAllInvalidOverrideErrorCodesForExecutable(getter,
- ParameterElementImpl.EMPTY_ARRAY, AstNode.EMPTY_LIST, fieldName)) {
+ ParameterElement.EMPTY_LIST, AstNode.EMPTY_LIST, fieldName)) {
hasProblems = true;
}
}
diff --git a/pkg/analyzer/lib/src/generated/parser.dart b/pkg/analyzer/lib/src/generated/parser.dart
index 0358613..e040afd 100644
--- a/pkg/analyzer/lib/src/generated/parser.dart
+++ b/pkg/analyzer/lib/src/generated/parser.dart
@@ -423,6 +423,9 @@
parser.currentToken = tokenStream;
MethodTrampoline method =
methodTable_Parser['${methodName}_${objects.length}'];
+ if (method == null) {
+ throw new IllegalArgumentException('There is no method named $methodName');
+ }
return method.invoke(parser, objects);
}
@@ -2419,8 +2422,8 @@
//
_reportErrorForCurrentToken(ParserErrorCode.MISSING_IDENTIFIER);
List<VariableDeclaration> variables = new List<VariableDeclaration>();
- variables.add(new VariableDeclaration(
- null, null, _createSyntheticIdentifier(), null, null));
+ variables.add(
+ new VariableDeclaration(_createSyntheticIdentifier(), null, null));
return new FieldDeclaration(commentAndMetadata.comment,
commentAndMetadata.metadata, null,
new VariableDeclarationList(null, null, keyword, null, variables),
@@ -4915,8 +4918,8 @@
//
_reportErrorForCurrentToken(ParserErrorCode.MISSING_IDENTIFIER);
List<VariableDeclaration> variables = new List<VariableDeclaration>();
- variables.add(new VariableDeclaration(
- null, null, _createSyntheticIdentifier(), null, null));
+ variables.add(
+ new VariableDeclaration(_createSyntheticIdentifier(), null, null));
return new TopLevelVariableDeclaration(commentAndMetadata.comment,
commentAndMetadata.metadata,
new VariableDeclarationList(null, null, keyword, null, variables),
@@ -4967,8 +4970,8 @@
semicolon = _createSyntheticToken(TokenType.SEMICOLON);
}
List<VariableDeclaration> variables = new List<VariableDeclaration>();
- variables.add(new VariableDeclaration(
- null, null, _createSyntheticIdentifier(), null, null));
+ variables.add(
+ new VariableDeclaration(_createSyntheticIdentifier(), null, null));
return new TopLevelVariableDeclaration(commentAndMetadata.comment,
commentAndMetadata.metadata,
new VariableDeclarationList(null, null, null, returnType, variables),
@@ -5527,8 +5530,7 @@
_tokenMatches(_peek(), TokenType.COLON))) {
List<VariableDeclaration> variables = new List<VariableDeclaration>();
SimpleIdentifier variableName = parseSimpleIdentifier();
- variables.add(
- new VariableDeclaration(null, null, variableName, null, null));
+ variables.add(new VariableDeclaration(variableName, null, null));
variableList = new VariableDeclarationList(commentAndMetadata.comment,
commentAndMetadata.metadata, null, null, variables);
} else if (_isInitializedVariableDeclaration()) {
@@ -6235,7 +6237,7 @@
_reportErrorForNode(ParserErrorCode.EXTERNAL_METHOD_WITH_BODY, body);
}
} else if (staticKeyword != null) {
- if (body is EmptyFunctionBody) {
+ if (body is EmptyFunctionBody && _parseFunctionBodies) {
_reportErrorForNode(ParserErrorCode.ABSTRACT_STATIC_METHOD, body);
}
}
@@ -6579,8 +6581,7 @@
_reportErrorForCurrentToken(ParserErrorCode.MISSING_STATEMENT);
return new EmptyStatement(_createSyntheticToken(TokenType.SEMICOLON));
} else {
- return new ExpressionStatement(
- parseExpression2(), _expect(TokenType.SEMICOLON));
+ return new ExpressionStatement(parseExpression2(), _expectSemicolon());
}
}
@@ -7471,7 +7472,15 @@
* identifier ('=' expression)?
*/
VariableDeclaration _parseVariableDeclaration() {
- CommentAndMetadata commentAndMetadata = _parseCommentAndMetadata();
+ // TODO(paulberry): prior to the fix for bug 23204, we permitted
+ // annotations before variable declarations (e.g. "String @deprecated s;").
+ // Although such constructions are prohibited by the spec, we may want to
+ // consider handling them anyway to allow for better parser recovery in the
+ // event that the user erroneously tries to use them. However, as a
+ // counterargument, this would likely degrade parser recovery in the event
+ // of a construct like "class C { int @deprecated foo() {} }" (i.e. the
+ // user is in the middle of inserting "int bar;" prior to
+ // "@deprecated foo() {}").
SimpleIdentifier name = parseSimpleIdentifier();
Token equals = null;
Expression initializer = null;
@@ -7479,8 +7488,7 @@
equals = getAndAdvance();
initializer = parseExpression2();
}
- return new VariableDeclaration(commentAndMetadata.comment,
- commentAndMetadata.metadata, name, equals, initializer);
+ return new VariableDeclaration(name, equals, initializer);
}
/**
diff --git a/pkg/analyzer/lib/src/generated/resolver.dart b/pkg/analyzer/lib/src/generated/resolver.dart
index b65279b..29817fd 100644
--- a/pkg/analyzer/lib/src/generated/resolver.dart
+++ b/pkg/analyzer/lib/src/generated/resolver.dart
@@ -2487,6 +2487,7 @@
SimpleIdentifier className = node.name;
ClassElementImpl element = new ClassElementImpl.forNode(className);
element.abstract = node.abstractKeyword != null;
+ element.mixinApplication = true;
element.typedef = true;
List<TypeParameterElement> typeParameters = holder.typeParameters;
element.typeParameters = typeParameters;
@@ -2670,7 +2671,7 @@
bool wasInFunction = _inFunction;
_inFunction = true;
try {
- _visitChildren(holder, expression);
+ _visitChildren(holder, node);
} finally {
_inFunction = wasInFunction;
}
@@ -2765,6 +2766,11 @@
@override
Object visitFunctionExpression(FunctionExpression node) {
+ if (node.parent is FunctionDeclaration) {
+ // visitFunctionDeclaration has already created the element for the
+ // declaration. We just need to visit children.
+ return super.visitFunctionExpression(node);
+ }
ElementHolder holder = new ElementHolder();
bool wasInFunction = _inFunction;
_inFunction = true;
@@ -3062,7 +3068,7 @@
if (_inFieldContext) {
SimpleIdentifier fieldName = node.name;
FieldElementImpl field;
- if (isConst && hasInitializer) {
+ if ((isConst || isFinal) && hasInitializer) {
field = new ConstFieldElementImpl.con1(fieldName);
} else {
field = new FieldElementImpl.forNode(fieldName);
@@ -3301,7 +3307,7 @@
List<PropertyAccessorElement> get accessors {
if (_accessors == null) {
- return PropertyAccessorElementImpl.EMPTY_ARRAY;
+ return PropertyAccessorElement.EMPTY_LIST;
}
List<PropertyAccessorElement> result = _accessors;
_accessors = null;
@@ -3310,7 +3316,7 @@
List<ConstructorElement> get constructors {
if (_constructors == null) {
- return ConstructorElementImpl.EMPTY_ARRAY;
+ return ConstructorElement.EMPTY_LIST;
}
List<ConstructorElement> result = _constructors;
_constructors = null;
@@ -3319,7 +3325,7 @@
List<ClassElement> get enums {
if (_enums == null) {
- return ClassElementImpl.EMPTY_ARRAY;
+ return ClassElement.EMPTY_LIST;
}
List<ClassElement> result = _enums;
_enums = null;
@@ -3328,7 +3334,7 @@
List<FieldElement> get fields {
if (_fields == null) {
- return FieldElementImpl.EMPTY_ARRAY;
+ return FieldElement.EMPTY_LIST;
}
List<FieldElement> result = _fields;
_fields = null;
@@ -3337,7 +3343,7 @@
List<FieldElement> get fieldsWithoutFlushing {
if (_fields == null) {
- return FieldElementImpl.EMPTY_ARRAY;
+ return FieldElement.EMPTY_LIST;
}
List<FieldElement> result = _fields;
return result;
@@ -3345,7 +3351,7 @@
List<FunctionElement> get functions {
if (_functions == null) {
- return FunctionElementImpl.EMPTY_ARRAY;
+ return FunctionElement.EMPTY_LIST;
}
List<FunctionElement> result = _functions;
_functions = null;
@@ -3354,7 +3360,7 @@
List<LabelElement> get labels {
if (_labels == null) {
- return LabelElementImpl.EMPTY_ARRAY;
+ return LabelElement.EMPTY_LIST;
}
List<LabelElement> result = _labels;
_labels = null;
@@ -3363,7 +3369,7 @@
List<LocalVariableElement> get localVariables {
if (_localVariables == null) {
- return LocalVariableElementImpl.EMPTY_ARRAY;
+ return LocalVariableElement.EMPTY_LIST;
}
List<LocalVariableElement> result = _localVariables;
_localVariables = null;
@@ -3372,7 +3378,7 @@
List<MethodElement> get methods {
if (_methods == null) {
- return MethodElementImpl.EMPTY_ARRAY;
+ return MethodElement.EMPTY_LIST;
}
List<MethodElement> result = _methods;
_methods = null;
@@ -3381,7 +3387,7 @@
List<ParameterElement> get parameters {
if (_parameters == null) {
- return ParameterElementImpl.EMPTY_ARRAY;
+ return ParameterElement.EMPTY_LIST;
}
List<ParameterElement> result = _parameters;
_parameters = null;
@@ -3390,7 +3396,7 @@
List<TopLevelVariableElement> get topLevelVariables {
if (_topLevelVariables == null) {
- return TopLevelVariableElementImpl.EMPTY_ARRAY;
+ return TopLevelVariableElement.EMPTY_LIST;
}
List<TopLevelVariableElement> result = _topLevelVariables;
_topLevelVariables = null;
@@ -3399,7 +3405,7 @@
List<FunctionTypeAliasElement> get typeAliases {
if (_typeAliases == null) {
- return FunctionTypeAliasElementImpl.EMPTY_ARRAY;
+ return FunctionTypeAliasElement.EMPTY_LIST;
}
List<FunctionTypeAliasElement> result = _typeAliases;
_typeAliases = null;
@@ -3408,7 +3414,7 @@
List<TypeParameterElement> get typeParameters {
if (_typeParameters == null) {
- return TypeParameterElementImpl.EMPTY_ARRAY;
+ return TypeParameterElement.EMPTY_LIST;
}
List<TypeParameterElement> result = _typeParameters;
_typeParameters = null;
@@ -3417,7 +3423,7 @@
List<ClassElement> get types {
if (_types == null) {
- return ClassElementImpl.EMPTY_ARRAY;
+ return ClassElement.EMPTY_LIST;
}
List<ClassElement> result = _types;
_types = null;
@@ -7683,11 +7689,6 @@
TypeProvider _typeProvider;
/**
- * The object used to access the types from the core library.
- */
- TypeProvider get typeProvider => _typeProvider;
-
- /**
* A table mapping library sources to the information being maintained for those libraries.
*/
HashMap<Source, Library> _libraryMap = new HashMap<Source, Library>();
@@ -7725,6 +7726,11 @@
Set<Library> get resolvedLibraries => _librariesInCycles;
/**
+ * The object used to access the types from the core library.
+ */
+ TypeProvider get typeProvider => _typeProvider;
+
+ /**
* Create an object to represent the information about the library defined by the compilation unit
* with the given source.
*
@@ -7913,6 +7919,18 @@
}
/**
+ * Resolve the identifiers and perform type analysis in the libraries in the current cycle.
+ *
+ * @throws AnalysisException if any of the identifiers could not be resolved or if any of the
+ * libraries could not have their types analyzed
+ */
+ void resolveReferencesAndTypes() {
+ for (Library library in _librariesInCycles) {
+ _resolveReferencesAndTypesInLibrary(library);
+ }
+ }
+
+ /**
* Add a dependency to the given map from the referencing library to the referenced library.
*
* @param dependencyMap the map to which the dependency is to be added
@@ -8467,18 +8485,6 @@
}
/**
- * Resolve the identifiers and perform type analysis in the libraries in the current cycle.
- *
- * @throws AnalysisException if any of the identifiers could not be resolved or if any of the
- * libraries could not have their types analyzed
- */
- void resolveReferencesAndTypes() {
- for (Library library in _librariesInCycles) {
- _resolveReferencesAndTypesInLibrary(library);
- }
- }
-
- /**
* Resolve the identifiers and perform type analysis in the given library.
*
* @param library the library to be resolved
@@ -11305,8 +11311,17 @@
@override
Object visitVariableDeclaration(VariableDeclaration node) {
super.visitVariableDeclaration(node);
- if (node.element.isConst && node.initializer != null) {
- (node.element as ConstVariableElement).constantInitializer =
+ VariableElement element = node.element;
+ // Note: in addition to cloning the initializers for const variables, we
+ // have to clone the initializers for non-static final fields (because if
+ // they occur in a class with a const constructor, they will be needed to
+ // evaluate the const constructor).
+ if ((element.isConst ||
+ (element is FieldElement &&
+ element.isFinal &&
+ !element.isStatic)) &&
+ node.initializer != null) {
+ (element as ConstVariableElement).constantInitializer =
new ConstantAstCloner().cloneNode(node.initializer);
}
return null;
@@ -13272,17 +13287,17 @@
InterfaceType get listType;
/**
+ * Return the type representing the built-in type 'Map'.
+ */
+ InterfaceType get mapType;
+
+ /**
* Return a list containing all of the types that cannot be either extended or
* implemented.
*/
List<InterfaceType> get nonSubtypableTypes;
/**
- * Return the type representing the built-in type 'Map'.
- */
- InterfaceType get mapType;
-
- /**
* Return a [DartObjectImpl] representing the `null` object.
*/
DartObjectImpl get nullObject;
@@ -13774,6 +13789,12 @@
SimpleIdentifier stackTrace = node.stackTraceParameter;
if (stackTrace != null) {
_recordType(stackTrace, typeProvider.stackTraceType);
+ Element element = stackTrace.staticElement;
+ if (element is VariableElementImpl) {
+ element.type = typeProvider.stackTraceType;
+ } else {
+ // TODO(brianwilkerson) Report the internal error
+ }
}
return null;
}
@@ -14519,7 +14540,7 @@
} else if (type is FunctionType) {
return type.typeArguments;
}
- return TypeImpl.EMPTY_ARRAY;
+ return DartType.EMPTY_LIST;
}
/**
@@ -14811,7 +14832,7 @@
aliasElement.typeParameters = alias.typeParameters;
type.typeArguments = alias.type.typeArguments;
} else {
- type.typeArguments = TypeImpl.EMPTY_ARRAY;
+ type.typeArguments = DartType.EMPTY_LIST;
}
}
element.type = type;
diff --git a/pkg/analyzer/lib/src/generated/testing/ast_factory.dart b/pkg/analyzer/lib/src/generated/testing/ast_factory.dart
index 0be2aaa..00ee216 100644
--- a/pkg/analyzer/lib/src/generated/testing/ast_factory.dart
+++ b/pkg/analyzer/lib/src/generated/testing/ast_factory.dart
@@ -905,12 +905,11 @@
}
static VariableDeclaration variableDeclaration(String name) =>
- new VariableDeclaration(null, null, identifier3(name), null, null);
+ new VariableDeclaration(identifier3(name), null, null);
static VariableDeclaration variableDeclaration2(
- String name, Expression initializer) => new VariableDeclaration(null,
- null, identifier3(name), TokenFactory.tokenFromType(TokenType.EQ),
- initializer);
+ String name, Expression initializer) => new VariableDeclaration(
+ identifier3(name), TokenFactory.tokenFromType(TokenType.EQ), initializer);
static VariableDeclarationList variableDeclarationList(Keyword keyword,
TypeName type, List<VariableDeclaration> variables) =>
diff --git a/pkg/analyzer/lib/src/generated/testing/element_factory.dart b/pkg/analyzer/lib/src/generated/testing/element_factory.dart
index ebb0713..497990c 100644
--- a/pkg/analyzer/lib/src/generated/testing/element_factory.dart
+++ b/pkg/analyzer/lib/src/generated/testing/element_factory.dart
@@ -188,7 +188,7 @@
}
static ExportElementImpl exportFor(LibraryElement exportedLibrary,
- [List<NamespaceCombinator> combinators = NamespaceCombinator.EMPTY_ARRAY]) {
+ [List<NamespaceCombinator> combinators = NamespaceCombinator.EMPTY_LIST]) {
ExportElementImpl spec = new ExportElementImpl(-1);
spec.exportedLibrary = exportedLibrary;
spec.combinators = combinators;
@@ -365,7 +365,7 @@
static ImportElementImpl importFor(
LibraryElement importedLibrary, PrefixElement prefix,
- [List<NamespaceCombinator> combinators = NamespaceCombinator.EMPTY_ARRAY]) {
+ [List<NamespaceCombinator> combinators = NamespaceCombinator.EMPTY_LIST]) {
ImportElementImpl spec = new ImportElementImpl(0);
spec.importedLibrary = importedLibrary;
spec.prefix = prefix;
@@ -393,7 +393,7 @@
[List<DartType> argumentTypes]) {
MethodElementImpl method = new MethodElementImpl(methodName, 0);
if (argumentTypes == null) {
- method.parameters = ParameterElementImpl.EMPTY_ARRAY;
+ method.parameters = ParameterElement.EMPTY_LIST;
} else {
int count = argumentTypes.length;
List<ParameterElement> parameters = new List<ParameterElement>(count);
diff --git a/pkg/analyzer/lib/src/plugin/engine_plugin.dart b/pkg/analyzer/lib/src/plugin/engine_plugin.dart
index 3e63016..9cd0577 100644
--- a/pkg/analyzer/lib/src/plugin/engine_plugin.dart
+++ b/pkg/analyzer/lib/src/plugin/engine_plugin.dart
@@ -4,11 +4,11 @@
library analyzer.src.plugin.engine_plugin;
-import 'package:analyzer/plugin/plugin.dart';
import 'package:analyzer/plugin/task.dart';
import 'package:analyzer/src/task/dart.dart';
import 'package:analyzer/src/task/general.dart';
import 'package:analyzer/task/model.dart';
+import 'package:plugin/plugin.dart';
/**
* A plugin that defines the extension points and extensions that are inherently
@@ -40,9 +40,7 @@
/**
* Return a list containing all of the task descriptors that were contributed.
*/
- List<TaskDescriptor> taskDescriptors() {
- return taskExtensionPoint.extensions;
- }
+ List<TaskDescriptor> get taskDescriptors => taskExtensionPoint.extensions;
@override
String get uniqueIdentifier => UNIQUE_IDENTIFIER;
@@ -63,19 +61,27 @@
//
// Register Dart tasks.
//
+ registerExtension(taskId, BuildClassConstructorsTask.DESCRIPTOR);
registerExtension(taskId, BuildCompilationUnitElementTask.DESCRIPTOR);
registerExtension(taskId, BuildDirectiveElementsTask.DESCRIPTOR);
registerExtension(taskId, BuildEnumMemberElementsTask.DESCRIPTOR);
registerExtension(taskId, BuildExportNamespaceTask.DESCRIPTOR);
- registerExtension(taskId, BuildSourceClosuresTask.DESCRIPTOR);
registerExtension(taskId, BuildFunctionTypeAliasesTask.DESCRIPTOR);
+ registerExtension(taskId, BuildLibraryConstructorsTask.DESCRIPTOR);
registerExtension(taskId, BuildLibraryElementTask.DESCRIPTOR);
registerExtension(taskId, BuildPublicNamespaceTask.DESCRIPTOR);
+ registerExtension(taskId, BuildSourceClosuresTask.DESCRIPTOR);
registerExtension(taskId, BuildTypeProviderTask.DESCRIPTOR);
+ registerExtension(taskId, GatherUsedImportedElementsTask.DESCRIPTOR);
+ registerExtension(taskId, GatherUsedLocalElementsTask.DESCRIPTOR);
+ registerExtension(taskId, GenerateHintsTask.DESCRIPTOR);
registerExtension(taskId, ParseDartTask.DESCRIPTOR);
registerExtension(taskId, ResolveLibraryTypeNamesTask.DESCRIPTOR);
+ registerExtension(taskId, ResolveReferencesTask.DESCRIPTOR);
registerExtension(taskId, ResolveUnitTypeNamesTask.DESCRIPTOR);
+ registerExtension(taskId, ResolveVariableReferencesTask.DESCRIPTOR);
registerExtension(taskId, ScanDartTask.DESCRIPTOR);
+ registerExtension(taskId, VerifyUnitTask.DESCRIPTOR);
//
// Register HTML tasks.
//
diff --git a/pkg/analyzer/lib/src/plugin/plugin_impl.dart b/pkg/analyzer/lib/src/plugin/plugin_impl.dart
deleted file mode 100644
index 5b9e8a2..0000000
--- a/pkg/analyzer/lib/src/plugin/plugin_impl.dart
+++ /dev/null
@@ -1,125 +0,0 @@
-// Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-library analyzer.src.plugin.plugin_impl;
-
-import 'dart:collection';
-
-import 'package:analyzer/plugin/plugin.dart';
-
-/**
- * An object that manages the extension points for a single instance of the
- * analysis server.
- */
-class ExtensionManager {
- /**
- * A table mapping the id's of extension points to the corresponding
- * extension points.
- */
- Map<String, ExtensionPointImpl> extensionPoints =
- new HashMap<String, ExtensionPointImpl>();
-
- /**
- * Process each of the given [plugins] by allowing them to register extension
- * points and extensions.
- *
- * An [ExtensionError] will be thrown if any of the plugins throws such an
- * exception while registering with this manager.
- */
- void processPlugins(List<Plugin> plugins) {
- for (Plugin plugin in plugins) {
- plugin.registerExtensionPoints((String identifier,
- [ValidateExtension validateExtension]) =>
- registerExtensionPoint(plugin, identifier, validateExtension));
- }
- for (Plugin plugin in plugins) {
- plugin.registerExtensions(registerExtension);
- }
- }
-
- /**
- * Register an [extension] to the extension point with the given unique
- * [identifier].
- */
- void registerExtension(String identifier, Object extension) {
- ExtensionPointImpl extensionPoint = extensionPoints[identifier];
- if (extensionPoint == null) {
- throw new ExtensionError(
- 'There is no extension point with the id "$identifier"');
- }
- extensionPoint.add(extension);
- }
-
- /**
- * Register an extension point being defined by the given [plugin] with the
- * given simple [identifier] and [validateExtension].
- */
- ExtensionPoint registerExtensionPoint(
- Plugin plugin, String identifier, ValidateExtension validateExtension) {
- String uniqueIdentifier = Plugin.buildUniqueIdentifier(plugin, identifier);
- if (extensionPoints.containsKey(uniqueIdentifier)) {
- throw new ExtensionError(
- 'There is already an extension point with the id "$identifier"');
- }
- ExtensionPointImpl extensionPoint =
- new ExtensionPointImpl(plugin, identifier, validateExtension);
- extensionPoints[uniqueIdentifier] = extensionPoint;
- return extensionPoint;
- }
-}
-
-/**
- * A concrete representation of an extension point.
- */
-class ExtensionPointImpl implements ExtensionPoint {
- @override
- final Plugin plugin;
-
- @override
- final String simpleIdentifier;
-
- /**
- * The function used to validate extensions to this extension point.
- */
- final ValidateExtension validateExtension;
-
- /**
- * The list of extensions to this extension point.
- */
- final List<Object> _extensions = <Object>[];
-
- /**
- * Initialize a newly create extension point to belong to the given [plugin]
- * and have the given [simpleIdentifier]. If [validateExtension] is non-`null`
- * it will be used to validate extensions associated with this extension
- * point.
- */
- ExtensionPointImpl(
- this.plugin, this.simpleIdentifier, this.validateExtension);
-
- /**
- * Return a list containing all of the extensions that have been registered
- * for this extension point.
- */
- List<Object> get extensions => new UnmodifiableListView(_extensions);
-
- /**
- * Return the identifier used to uniquely identify this extension point. The
- * unique identifier is the identifier for the plugin, followed by a period
- * (`.`), followed by the [simpleIdentifier] for the extension point.
- */
- String get uniqueIdentifier =>
- Plugin.buildUniqueIdentifier(plugin, simpleIdentifier);
-
- /**
- * Validate that the given [extension] is appropriate for this extension
- * point, and if it is then add it to the list of registered exceptions.
- */
- void add(Object extension) {
- if (validateExtension != null) {
- validateExtension(extension);
- }
- _extensions.add(extension);
- }
-}
diff --git a/pkg/analyzer/lib/src/task/dart.dart b/pkg/analyzer/lib/src/task/dart.dart
index 93e2f08..14f0d95 100644
--- a/pkg/analyzer/lib/src/task/dart.dart
+++ b/pkg/analyzer/lib/src/task/dart.dart
@@ -18,8 +18,6 @@
import 'package:analyzer/src/generated/scanner.dart';
import 'package:analyzer/src/generated/sdk.dart';
import 'package:analyzer/src/generated/source.dart';
-import 'package:analyzer/src/generated/utilities_general.dart';
-import 'package:analyzer/src/task/driver.dart';
import 'package:analyzer/src/task/general.dart';
import 'package:analyzer/task/dart.dart';
import 'package:analyzer/task/general.dart';
@@ -62,7 +60,7 @@
contributesTo: DART_ERRORS);
/**
- * The [ClassElement]s of a [LibraryUnitTarget].
+ * The [ClassElement]s of a [LibrarySpecificUnit].
*/
final ListResultDescriptor<ClassElement> CLASS_ELEMENTS =
new ListResultDescriptor<ClassElement>('CLASS_ELEMENTS', null);
@@ -281,13 +279,13 @@
new ResultDescriptor<TypeProvider>('TYPE_PROVIDER', null);
/**
- * The [UsedImportedElements] of a [LibraryUnitTarget].
+ * The [UsedImportedElements] of a [LibrarySpecificUnit].
*/
final ResultDescriptor<UsedImportedElements> USED_IMPORTED_ELEMENTS =
new ResultDescriptor<UsedImportedElements>('USED_IMPORTED_ELEMENTS', null);
/**
- * The [UsedLocalElements] of a [LibraryUnitTarget].
+ * The [UsedLocalElements] of a [LibrarySpecificUnit].
*/
final ResultDescriptor<UsedLocalElements> USED_LOCAL_ELEMENTS =
new ResultDescriptor<UsedLocalElements>('USED_LOCAL_ELEMENTS', null);
@@ -336,7 +334,9 @@
ClassElementImpl classElement = this.target;
List<ConstructorElement> superConstructors = inputs[SUPER_CONSTRUCTORS];
DartType superType = classElement.supertype;
- ClassElement superElement = superType.element;
+ if (superType == null) {
+ return;
+ }
//
// Shortcut for ClassElement(s) without implicit constructors.
//
@@ -361,7 +361,7 @@
errors.add(new AnalysisError.con2(classElement.source,
classElement.nameOffset, classElement.name.length,
CompileTimeErrorCode.MIXIN_HAS_NO_CONSTRUCTORS,
- [superElement.name]));
+ [superType.element.name]));
} else {
classElement.constructors = implicitConstructors;
}
@@ -383,7 +383,7 @@
SourceRange withRange = classElement.withClauseRange;
errors.add(new AnalysisError.con2(classElement.source, withRange.offset,
withRange.length, CompileTimeErrorCode.MIXIN_HAS_NO_CONSTRUCTORS,
- [superElement.name]));
+ [superType.element.name]));
classElement.mixinErrorsReported = true;
}
outputs[CONSTRUCTORS] = classElement.constructors;
@@ -471,7 +471,7 @@
* [superType], to the class or mixin application [classElement],
* and pass information about them to [callback].
*
- * Return true if some constructors were considered. (A false return value
+ * Return `true` if some constructors were considered. (A `false` return value
* can only happen if the supeclass is a built-in type, in which case it
* can't be used as a mixin anyway).
*/
@@ -479,6 +479,9 @@
InterfaceType superType, void callback(
ConstructorElement explicitConstructor, List<DartType> parameterTypes,
List<DartType> argumentTypes)) {
+ if (superType == null) {
+ return false;
+ }
ClassElement superclassElement = superType.element;
List<ConstructorElement> constructors = superclassElement.constructors;
int count = constructors.length;
@@ -586,7 +589,7 @@
* input descriptors describing those inputs for a task with the given
* [target].
*/
- static Map<String, TaskInput> buildInputs(LibraryUnitTarget target) {
+ static Map<String, TaskInput> buildInputs(LibrarySpecificUnit target) {
return <String, TaskInput>{
PARSED_UNIT_INPUT_NAME: PARSED_UNIT.of(target.unit)
};
@@ -788,7 +791,7 @@
return <String, TaskInput>{
'defining_LIBRARY_ELEMENT1': LIBRARY_ELEMENT1.of(libSource),
UNIT_INPUT_NAME:
- RESOLVED_UNIT1.of(new LibraryUnitTarget(libSource, libSource)),
+ RESOLVED_UNIT1.of(new LibrarySpecificUnit(libSource, libSource)),
IMPORTS_LIBRARY_ELEMENT_INPUT_NAME:
IMPORTED_LIBRARIES.of(libSource).toMapOf(LIBRARY_ELEMENT1),
EXPORTS_LIBRARY_ELEMENT_INPUT_NAME:
@@ -889,7 +892,7 @@
* input descriptors describing those inputs for a task with the
* given [target].
*/
- static Map<String, TaskInput> buildInputs(LibraryUnitTarget target) {
+ static Map<String, TaskInput> buildInputs(LibrarySpecificUnit target) {
return <String, TaskInput>{
TYPE_PROVIDER_INPUT: TYPE_PROVIDER.of(AnalysisContextTarget.request),
UNIT_INPUT: RESOLVED_UNIT1.of(target)
@@ -1041,7 +1044,7 @@
* input descriptors describing those inputs for a task with the
* given [target].
*/
- static Map<String, TaskInput> buildInputs(LibraryUnitTarget target) {
+ static Map<String, TaskInput> buildInputs(LibrarySpecificUnit target) {
return <String, TaskInput>{
TYPE_PROVIDER_INPUT: TYPE_PROVIDER.of(AnalysisContextTarget.request),
'importsExportNamespace':
@@ -1364,10 +1367,9 @@
static Map<String, TaskInput> buildInputs(Source libSource) {
return <String, TaskInput>{
DEFINING_UNIT_INPUT:
- RESOLVED_UNIT1.of(new LibraryUnitTarget(libSource, libSource)),
+ RESOLVED_UNIT1.of(new LibrarySpecificUnit(libSource, libSource)),
PARTS_UNIT_INPUT: INCLUDED_PARTS.of(libSource).toList((Source unit) {
- LibraryUnitTarget lut = new LibraryUnitTarget(libSource, unit);
- return RESOLVED_UNIT1.of(lut);
+ return RESOLVED_UNIT1.of(new LibrarySpecificUnit(libSource, unit));
})
};
}
@@ -1439,12 +1441,17 @@
/**
* The name of the import closure.
*/
- static const String IMPORT_CLOSURE_INPUT = 'IMPORT_CLOSURE_INPUT';
+ static const String IMPORT_INPUT = 'IMPORT_INPUT';
/**
* The name of the export closure.
*/
- static const String EXPORT_CLOSURE_INPUT = 'EXPORT_CLOSURE_INPUT';
+ static const String EXPORT_INPUT = 'EXPORT_INPUT';
+
+ /**
+ * The name of the import/export closure.
+ */
+ static const String IMPORT_EXPORT_INPUT = 'IMPORT_EXPORT_INPUT';
/**
* The task descriptor describing this kind of task.
@@ -1466,15 +1473,16 @@
@override
void internalPerform() {
- List<Source> importClosure = getRequiredInput(IMPORT_CLOSURE_INPUT);
- List<Source> exportClosure = getRequiredInput(EXPORT_CLOSURE_INPUT);
+ List<Source> importClosure = getRequiredInput(IMPORT_INPUT);
+ List<Source> exportClosure = getRequiredInput(EXPORT_INPUT);
+ List<Source> importExportClosure = getRequiredInput(IMPORT_EXPORT_INPUT);
Source htmlSource = context.sourceFactory.forUri(DartSdk.DART_HTML);
//
// Record outputs.
//
outputs[IMPORT_SOURCE_CLOSURE] = importClosure;
outputs[EXPORT_SOURCE_CLOSURE] = exportClosure;
- outputs[IS_CLIENT] = importClosure.contains(htmlSource);
+ outputs[IS_CLIENT] = importExportClosure.contains(htmlSource);
}
/**
@@ -1484,8 +1492,9 @@
*/
static Map<String, TaskInput> buildInputs(Source libSource) {
return <String, TaskInput>{
- IMPORT_CLOSURE_INPUT: new _ImportSourceClosureTaskInput(libSource),
- EXPORT_CLOSURE_INPUT: new _ExportSourceClosureTaskInput(libSource)
+ IMPORT_INPUT: new _ImportSourceClosureTaskInput(libSource),
+ EXPORT_INPUT: new _ExportSourceClosureTaskInput(libSource),
+ IMPORT_EXPORT_INPUT: new _ImportExportSourceClosureTaskInput(libSource)
};
}
@@ -1538,7 +1547,7 @@
//
TypeProvider typeProvider =
new TypeProviderImpl.forNamespaces(coreNamespace, asyncNamespace);
- (context as ExtendedAnalysisContext).typeProvider = typeProvider;
+ (context as InternalAnalysisContext).typeProvider = typeProvider;
outputs[TYPE_PROVIDER] = typeProvider;
}
@@ -1709,7 +1718,7 @@
* input descriptors describing those inputs for a task with the
* given [target].
*/
- static Map<String, TaskInput> buildInputs(LibraryUnitTarget target) {
+ static Map<String, TaskInput> buildInputs(LibrarySpecificUnit target) {
return <String, TaskInput>{UNIT_INPUT: RESOLVED_UNIT.of(target)};
}
@@ -1718,7 +1727,7 @@
* the given [context].
*/
static GatherUsedImportedElementsTask createTask(
- AnalysisContext context, LibraryUnitTarget target) {
+ AnalysisContext context, LibrarySpecificUnit target) {
return new GatherUsedImportedElementsTask(context, target);
}
}
@@ -1768,7 +1777,7 @@
* input descriptors describing those inputs for a task with the
* given [target].
*/
- static Map<String, TaskInput> buildInputs(LibraryUnitTarget target) {
+ static Map<String, TaskInput> buildInputs(LibrarySpecificUnit target) {
return <String, TaskInput>{UNIT_INPUT: RESOLVED_UNIT.of(target)};
}
@@ -1777,7 +1786,7 @@
* the given [context].
*/
static GatherUsedLocalElementsTask createTask(
- AnalysisContext context, LibraryUnitTarget target) {
+ AnalysisContext context, LibrarySpecificUnit target) {
return new GatherUsedLocalElementsTask(context, target);
}
}
@@ -1871,16 +1880,16 @@
* input descriptors describing those inputs for a task with the
* given [target].
*/
- static Map<String, TaskInput> buildInputs(LibraryUnitTarget target) {
+ static Map<String, TaskInput> buildInputs(LibrarySpecificUnit target) {
Source libSource = target.library;
return <String, TaskInput>{
UNIT_INPUT: RESOLVED_UNIT.of(target),
USED_LOCAL_ELEMENTS_INPUT: UNITS.of(libSource).toList((unit) {
- LibraryUnitTarget target = new LibraryUnitTarget(libSource, unit);
+ LibrarySpecificUnit target = new LibrarySpecificUnit(libSource, unit);
return USED_LOCAL_ELEMENTS.of(target);
}),
USED_IMPORTED_ELEMENTS_INPUT: UNITS.of(libSource).toList((unit) {
- LibraryUnitTarget target = new LibraryUnitTarget(libSource, unit);
+ LibrarySpecificUnit target = new LibrarySpecificUnit(libSource, unit);
return USED_IMPORTED_ELEMENTS.of(target);
})
};
@@ -1897,28 +1906,20 @@
}
/**
- * A pair of a library [Source] and a unit [Source] in this library.
+ * The memento for [ParseDartTask].
*/
-class LibraryUnitTarget implements AnalysisTarget {
- final Source library;
- final Source unit;
-
- LibraryUnitTarget(this.library, this.unit);
-
- @override
- int get hashCode {
- return JenkinsSmiHash.combine(library.hashCode, unit.hashCode);
- }
-
- @override
- Source get source => unit;
-
- @override
- bool operator ==(other) {
- return other is LibraryUnitTarget &&
- other.library == library &&
- other.unit == unit;
- }
+class ParseDartMemento {
+ final Token inputTokenStream;
+ final List<Source> exportedLibraries;
+ final List<Source> importedLibraries;
+ final List<Source> includedParts;
+ final List<AnalysisError> parseErrors;
+ final CompilationUnit parsedUnit;
+ final SourceKind sourceKind;
+ final List<Source> units;
+ ParseDartMemento(this.inputTokenStream, this.exportedLibraries,
+ this.importedLibraries, this.includedParts, this.parseErrors,
+ this.parsedUnit, this.sourceKind, this.units);
}
/**
@@ -1966,6 +1967,21 @@
LineInfo lineInfo = getRequiredInput(LINE_INFO_INPUT_NAME);
Token tokenStream = getRequiredInput(TOKEN_STREAM_INPUT_NAME);
+ if (inputMemento is ParseDartMemento) {
+ ParseDartMemento memento = inputMemento;
+ if (identical(memento.inputTokenStream, tokenStream)) {
+ outputMemento = memento;
+ outputs[EXPORTED_LIBRARIES] = memento.exportedLibraries;
+ outputs[IMPORTED_LIBRARIES] = memento.importedLibraries;
+ outputs[INCLUDED_PARTS] = memento.includedParts;
+ outputs[PARSE_ERRORS] = memento.parseErrors;
+ outputs[PARSED_UNIT] = memento.parsedUnit;
+ outputs[SOURCE_KIND] = memento.sourceKind;
+ outputs[UNITS] = memento.units;
+ return;
+ }
+ }
+
RecordingErrorListener errorListener = new RecordingErrorListener();
Parser parser = new Parser(source, errorListener);
AnalysisOptions options = context.analysisOptions;
@@ -1975,9 +1991,9 @@
bool hasNonPartOfDirective = false;
bool hasPartOfDirective = false;
- HashSet<Source> exportedSources = new HashSet<Source>();
- HashSet<Source> importedSources = new HashSet<Source>();
- HashSet<Source> includedSources = new HashSet<Source>();
+ HashSet<Source> exportedSourceSet = new HashSet<Source>();
+ HashSet<Source> importedSourceSet = new HashSet<Source>();
+ HashSet<Source> includedSourceSet = new HashSet<Source>();
for (Directive directive in unit.directives) {
if (directive is PartOfDirective) {
hasPartOfDirective = true;
@@ -1988,12 +2004,12 @@
resolveDirective(context, source, directive, errorListener);
if (referencedSource != null) {
if (directive is ExportDirective) {
- exportedSources.add(referencedSource);
+ exportedSourceSet.add(referencedSource);
} else if (directive is ImportDirective) {
- importedSources.add(referencedSource);
+ importedSourceSet.add(referencedSource);
} else if (directive is PartDirective) {
if (referencedSource != source) {
- includedSources.add(referencedSource);
+ includedSourceSet.add(referencedSource);
}
} else {
throw new AnalysisException(
@@ -2007,7 +2023,7 @@
// Always include "dart:core" source.
//
Source coreLibrarySource = context.sourceFactory.forUri(DartSdk.DART_CORE);
- importedSources.add(coreLibrarySource);
+ importedSourceSet.add(coreLibrarySource);
//
// Compute kind.
//
@@ -2018,13 +2034,21 @@
//
// Record outputs.
//
- outputs[EXPORTED_LIBRARIES] = exportedSources.toList();
- outputs[IMPORTED_LIBRARIES] = importedSources.toList();
- outputs[INCLUDED_PARTS] = includedSources.toList();
- outputs[PARSE_ERRORS] = errorListener.getErrorsForSource(source);
+ List<Source> exportedSources = exportedSourceSet.toList();
+ List<Source> importedSources = importedSourceSet.toList();
+ List<Source> includedSources = includedSourceSet.toList();
+ List<AnalysisError> parseErrors = errorListener.errors;
+ List<Source> unitSources = <Source>[source]..addAll(includedSourceSet);
+ outputs[EXPORTED_LIBRARIES] = exportedSources;
+ outputs[IMPORTED_LIBRARIES] = importedSources;
+ outputs[INCLUDED_PARTS] = includedSources;
+ outputs[PARSE_ERRORS] = parseErrors;
outputs[PARSED_UNIT] = unit;
outputs[SOURCE_KIND] = sourceKind;
- outputs[UNITS] = <Source>[source]..addAll(includedSources);
+ outputs[UNITS] = unitSources;
+ outputMemento = new ParseDartMemento(tokenStream, exportedSources,
+ importedSources, includedSources, parseErrors, unit, sourceKind,
+ unitSources);
}
/**
@@ -2171,7 +2195,7 @@
.of(libSource)
.toMapOf(UNITS)
.toFlattenList((Source library, Source unit) =>
- RESOLVED_UNIT4.of(new LibraryUnitTarget(library, unit)))
+ RESOLVED_UNIT4.of(new LibrarySpecificUnit(library, unit)))
};
}
@@ -2242,7 +2266,7 @@
* input descriptors describing those inputs for a task with the
* given [target].
*/
- static Map<String, TaskInput> buildInputs(LibraryUnitTarget target) {
+ static Map<String, TaskInput> buildInputs(LibrarySpecificUnit target) {
return <String, TaskInput>{
LIBRARY_INPUT: LIBRARY_ELEMENT.of(target.library),
UNIT_INPUT: RESOLVED_UNIT5.of(target)
@@ -2311,7 +2335,7 @@
* input descriptors describing those inputs for a task with the
* given [target].
*/
- static Map<String, TaskInput> buildInputs(LibraryUnitTarget target) {
+ static Map<String, TaskInput> buildInputs(LibrarySpecificUnit target) {
return <String, TaskInput>{UNIT_INPUT: RESOLVED_UNIT3.of(target)};
}
@@ -2381,7 +2405,7 @@
* input descriptors describing those inputs for a task with the
* given [target].
*/
- static Map<String, TaskInput> buildInputs(LibraryUnitTarget target) {
+ static Map<String, TaskInput> buildInputs(LibrarySpecificUnit target) {
return <String, TaskInput>{
LIBRARY_INPUT: LIBRARY_ELEMENT.of(target.library),
UNIT_INPUT: RESOLVED_UNIT4.of(target)
@@ -2399,6 +2423,17 @@
}
/**
+ * The memento for [ScanDartTask].
+ */
+class ScanDartMemento {
+ final String content;
+ final Token tokenStream;
+ final LineInfo lineInfo;
+ final List<AnalysisError> errors;
+ ScanDartMemento(this.content, this.tokenStream, this.lineInfo, this.errors);
+}
+
+/**
* A task that scans the content of a file, producing a set of Dart tokens.
*/
class ScanDartTask extends SourceBasedAnalysisTask {
@@ -2432,15 +2467,31 @@
Source source = getRequiredSource();
String content = getRequiredInput(CONTENT_INPUT_NAME);
+ if (inputMemento is ScanDartMemento) {
+ ScanDartMemento memento = inputMemento;
+ if (memento.content == content) {
+ outputMemento = memento;
+ outputs[TOKEN_STREAM] = memento.tokenStream;
+ outputs[LINE_INFO] = memento.lineInfo;
+ outputs[SCAN_ERRORS] = memento.errors;
+ return;
+ }
+ }
+
RecordingErrorListener errorListener = new RecordingErrorListener();
Scanner scanner =
new Scanner(source, new CharSequenceReader(content), errorListener);
scanner.preserveComments = context.analysisOptions.preserveComments;
scanner.enableNullAwareOperators =
context.analysisOptions.enableNullAwareOperators;
- outputs[TOKEN_STREAM] = scanner.tokenize();
- outputs[LINE_INFO] = new LineInfo(scanner.lineStarts);
- outputs[SCAN_ERRORS] = errorListener.getErrorsForSource(source);
+
+ Token tokenStream = scanner.tokenize();
+ LineInfo lineInfo = new LineInfo(scanner.lineStarts);
+ List<AnalysisError> errors = errorListener.errors;
+ outputs[TOKEN_STREAM] = tokenStream;
+ outputs[LINE_INFO] = lineInfo;
+ outputs[SCAN_ERRORS] = errors;
+ outputMemento = new ScanDartMemento(content, tokenStream, lineInfo, errors);
}
/**
@@ -2516,7 +2567,7 @@
* input descriptors describing those inputs for a task with the
* given [target].
*/
- static Map<String, TaskInput> buildInputs(LibraryUnitTarget target) {
+ static Map<String, TaskInput> buildInputs(LibrarySpecificUnit target) {
return <String, TaskInput>{UNIT_INPUT: RESOLVED_UNIT.of(target)};
}
@@ -2547,7 +2598,22 @@
/**
* The kind of the source closure to build.
*/
-enum _SourceClosureKind { IMPORT, EXPORT }
+enum _SourceClosureKind { IMPORT, EXPORT, IMPORT_EXPORT }
+
+/**
+ * A [TaskInput] whose value is a list of library sources imported or exported,
+ * directly or indirectly by the target [Source].
+ */
+class _ImportExportSourceClosureTaskInput implements TaskInput<List<Source>> {
+ final Source target;
+
+ _ImportExportSourceClosureTaskInput(this.target);
+
+ @override
+ TaskInputBuilder<List<Source>> createBuilder() =>
+ new _SourceClosureTaskInputBuilder(
+ target, _SourceClosureKind.IMPORT_EXPORT);
+}
/**
* A [TaskInput] whose value is a list of library sources imported directly
@@ -2583,15 +2649,18 @@
@override
void set currentValue(LibraryElement library) {
if (_libraries.add(library)) {
- if (kind == _SourceClosureKind.IMPORT) {
+ if (kind == _SourceClosureKind.IMPORT ||
+ kind == _SourceClosureKind.IMPORT_EXPORT) {
for (ImportElement importElement in library.imports) {
Source importedSource = importElement.importedLibrary.source;
_newSources.add(importedSource);
}
- } else {
+ }
+ if (kind == _SourceClosureKind.EXPORT ||
+ kind == _SourceClosureKind.IMPORT_EXPORT) {
for (ExportElement exportElement in library.exports) {
- Source importedSource = exportElement.exportedLibrary.source;
- _newSources.add(importedSource);
+ Source exportedSource = exportElement.exportedLibrary.source;
+ _newSources.add(exportedSource);
}
}
}
diff --git a/pkg/analyzer/lib/src/task/driver.dart b/pkg/analyzer/lib/src/task/driver.dart
index f077b3a..af608ad 100644
--- a/pkg/analyzer/lib/src/task/driver.dart
+++ b/pkg/analyzer/lib/src/task/driver.dart
@@ -28,7 +28,7 @@
/**
* The context in which analysis is to be performed.
*/
- final ExtendedAnalysisContext context;
+ final InternalAnalysisContext context;
/**
* The work order that was previously computed but that has not yet been
@@ -123,8 +123,17 @@
state == CacheState.IN_PROCESS) {
return null;
}
- return new WorkOrder(taskManager,
- new WorkItem(context, target, taskManager.findTask(target, result)));
+ try {
+ TaskDescriptor taskDescriptor = taskManager.findTask(target, result);
+ Object memento = entry.getMemento(result);
+ WorkItem workItem =
+ new WorkItem(context, target, taskDescriptor, memento);
+ return new WorkOrder(taskManager, workItem);
+ } catch (exception, stackTrace) {
+ throw new AnalysisException(
+ 'Could not create work order (target = $target; result = $result)',
+ new CaughtException(exception, stackTrace));
+ }
}
/**
@@ -204,11 +213,12 @@
task.perform();
CacheEntry entry = context.getCacheEntry(task.target);
if (task.caughtException == null) {
+ List<TargetedResult> dependedOn = item.inputTargetedResults.toList();
Map<ResultDescriptor, dynamic> outputs = task.outputs;
for (ResultDescriptor result in task.descriptor.results) {
// TODO(brianwilkerson) We could check here that a value was produced
// and throw an exception if not (unless we want to allow null values).
- entry.setValue(result, outputs[result]);
+ entry.setValue(result, outputs[result], dependedOn, task.outputMemento);
}
} else {
entry.setErrorState(task.caughtException, item.descriptor.results);
@@ -239,6 +249,20 @@
}
/**
+ * An exception indicating that an attempt was made to perform a task on a
+ * target while gathering the inputs to perform the same task for the same
+ * target.
+ */
+class InfiniteTaskLoopException extends AnalysisException {
+ /**
+ * Initialize a newly created exception to represent an attempt to perform
+ * the task for the target represented by the given [item].
+ */
+ InfiniteTaskLoopException(WorkItem item) : super(
+ 'Infinite loop while performing task ${item.descriptor.name} for ${item.target}');
+}
+
+/**
* A description of a single anaysis task that can be performed to advance
* analysis.
*/
@@ -246,7 +270,7 @@
/**
* The context in which the task will be performed.
*/
- final ExtendedAnalysisContext context;
+ final InternalAnalysisContext context;
/**
* The target for which a task is to be performed.
@@ -259,6 +283,12 @@
final TaskDescriptor descriptor;
/**
+ * The optional data that the task associated with [target] last time.
+ * This data may help to compute outputs more efficiently.
+ */
+ final Object inputMemento;
+
+ /**
* An iterator used to iterate over the descriptors of the inputs to the task,
* or `null` if all of the inputs have been collected and the task can be
* created.
@@ -266,6 +296,12 @@
TaskInputBuilder builder;
/**
+ * The [TargetedResult]s outputs of this task depends on.
+ */
+ final HashSet<TargetedResult> inputTargetedResults =
+ new HashSet<TargetedResult>();
+
+ /**
* The inputs to the task that have been computed.
*/
Map<String, dynamic> inputs;
@@ -282,7 +318,7 @@
* Initialize a newly created work item to compute the inputs for the task
* described by the given descriptor.
*/
- WorkItem(this.context, this.target, this.descriptor) {
+ WorkItem(this.context, this.target, this.descriptor, this.inputMemento) {
AnalysisTarget actualTarget = identical(
target, AnalysisContextTarget.request)
? new AnalysisContextTarget(context)
@@ -303,7 +339,7 @@
if (builder != null) {
throw new StateError("some inputs have not been computed");
}
- return descriptor.createTask(context, target, inputs);
+ return descriptor.createTask(context, target, inputs, inputMemento);
}
/**
@@ -324,14 +360,9 @@
*/
WorkItem gatherInputs(TaskManager taskManager) {
while (builder != null) {
- //
- // TODO(brianwilkerson) Capture information about which inputs were used
- // to compute the results. This information can later be used to compute
- // which results depend on a given result, and hence which results need to
- // be invalidated when one result is invalidated.
- //
AnalysisTarget inputTarget = builder.currentTarget;
ResultDescriptor inputResult = builder.currentResult;
+ inputTargetedResults.add(new TargetedResult(inputTarget, inputResult));
CacheEntry inputEntry = context.getCacheEntry(inputTarget);
CacheState inputState = inputEntry.getState(inputResult);
if (inputState == CacheState.ERROR) {
@@ -353,7 +384,8 @@
try {
TaskDescriptor descriptor =
taskManager.findTask(inputTarget, inputResult);
- return new WorkItem(context, inputTarget, descriptor);
+ Object memento = inputEntry.getMemento(inputResult);
+ return new WorkItem(context, inputTarget, descriptor, memento);
} on AnalysisException catch (exception, stackTrace) {
this.exception = new CaughtException(exception, stackTrace);
return null;
@@ -367,6 +399,9 @@
}
return null;
}
+
+ @override
+ String toString() => 'Run $descriptor on $target';
}
/**
@@ -443,16 +478,3 @@
return false;
}
}
-
-/**
- * An exception indicating that an attempt was made to perform a task on a
- * target while gathering the inputs to perform the same task for the same
- * target.
- */
-class InfiniteTaskLoopException extends AnalysisException {
- /**
- * Initialize a newly created exception to represent an attempt to perform
- * the task for the target represented by the given [item].
- */
- InfiniteTaskLoopException(WorkItem item) : super('Infinite loop while performing task ${item.descriptor.name} for ${item.target}');
-}
diff --git a/pkg/analyzer/lib/src/task/general.dart b/pkg/analyzer/lib/src/task/general.dart
index 8f88327..69a808e 100644
--- a/pkg/analyzer/lib/src/task/general.dart
+++ b/pkg/analyzer/lib/src/task/general.dart
@@ -5,10 +5,10 @@
library analyzer.src.task.general;
import 'package:analyzer/src/generated/engine.dart' hide AnalysisTask;
+import 'package:analyzer/src/generated/java_engine.dart';
import 'package:analyzer/src/generated/source.dart';
import 'package:analyzer/task/general.dart';
import 'package:analyzer/task/model.dart';
-import 'package:analyzer/src/generated/java_engine.dart';
/**
* A task that gets the contents of the source associated with an analysis
@@ -18,7 +18,7 @@
/**
* The task descriptor describing this kind of task.
*/
- static final TaskDescriptor DESCRIPTOR = new TaskDescriptor('GET_CONTENT',
+ static final TaskDescriptor DESCRIPTOR = new TaskDescriptor('GetContentTask',
createTask, buildInputs, <ResultDescriptor>[CONTENT, MODIFICATION_TIME]);
/**
diff --git a/pkg/analyzer/lib/src/task/manager.dart b/pkg/analyzer/lib/src/task/manager.dart
index 71986ab..eebc084 100644
--- a/pkg/analyzer/lib/src/task/manager.dart
+++ b/pkg/analyzer/lib/src/task/manager.dart
@@ -67,6 +67,14 @@
}
/**
+ * Add the task descriptors in the given list of [descriptors] to the list of
+ * analysis task descriptors that can be used to compute analysis results.
+ */
+ void addTaskDescriptors(List<TaskDescriptor> descriptors) {
+ descriptors.forEach(addTaskDescriptor);
+ }
+
+ /**
* Find a task that will compute the given [result] for the given [target].
*/
TaskDescriptor findTask(AnalysisTarget target, ResultDescriptor result) {
diff --git a/pkg/analyzer/lib/src/task/model.dart b/pkg/analyzer/lib/src/task/model.dart
index 66ffb9e..b8671bc 100644
--- a/pkg/analyzer/lib/src/task/model.dart
+++ b/pkg/analyzer/lib/src/task/model.dart
@@ -121,9 +121,10 @@
@override
AnalysisTask createTask(AnalysisContext context, AnalysisTarget target,
- Map<String, dynamic> inputs) {
+ Map<String, dynamic> inputs, Object inputMemento) {
AnalysisTask task = buildTask(context, target);
task.inputs = inputs;
+ task.inputMemento = inputMemento;
return task;
}
diff --git a/pkg/analyzer/lib/task/dart.dart b/pkg/analyzer/lib/task/dart.dart
index 8195549..a4ac9ee1 100644
--- a/pkg/analyzer/lib/task/dart.dart
+++ b/pkg/analyzer/lib/task/dart.dart
@@ -9,6 +9,7 @@
import 'package:analyzer/src/generated/error.dart';
import 'package:analyzer/src/generated/scanner.dart';
import 'package:analyzer/src/generated/source.dart';
+import 'package:analyzer/src/generated/utilities_general.dart';
import 'package:analyzer/task/model.dart';
/**
@@ -120,3 +121,47 @@
*/
final ListResultDescriptor<Source> UNITS =
new ListResultDescriptor<Source>('UNITS', Source.EMPTY_ARRAY);
+
+/**
+ * A specific compilation unit in a specific library.
+ *
+ * This kind of target is associated with information about a compilation unit
+ * that differs based on the library that the unit is a part of. For example,
+ * the result of resolving a compilation unit depends on the imports, which can
+ * change if a single part is included in more than one library.
+ */
+class LibrarySpecificUnit implements AnalysisTarget {
+ /**
+ * The defining compilation unit of the library in which the [unit]
+ * is analyzed.
+ */
+ final Source library;
+
+ /**
+ * The compilation unit which belongs to the [library].
+ */
+ final Source unit;
+
+ /**
+ * Initialize a newly created target for the [unit] in the [library].
+ */
+ LibrarySpecificUnit(this.library, this.unit);
+
+ @override
+ int get hashCode {
+ return JenkinsSmiHash.combine(library.hashCode, unit.hashCode);
+ }
+
+ @override
+ Source get source => unit;
+
+ @override
+ bool operator ==(other) {
+ return other is LibrarySpecificUnit &&
+ other.library == library &&
+ other.unit == unit;
+ }
+
+ @override
+ String toString() => '$unit in $library';
+}
diff --git a/pkg/analyzer/lib/task/model.dart b/pkg/analyzer/lib/task/model.dart
index 973f24e..a648ced 100644
--- a/pkg/analyzer/lib/task/model.dart
+++ b/pkg/analyzer/lib/task/model.dart
@@ -103,6 +103,12 @@
Map<String, dynamic> inputs;
/**
+ * The optional data that the task associated with [target] last time.
+ * This data may help to compute outputs more efficiently.
+ */
+ Object inputMemento;
+
+ /**
* A table mapping result descriptors whose values are produced by this task
* to the values that were produced.
*/
@@ -110,6 +116,12 @@
new HashMap<ResultDescriptor, dynamic>();
/**
+ * An optional data that the task wants to associate with [target].
+ * This data may help later to compute outputs more efficiently.
+ */
+ Object outputMemento;
+
+ /**
* The exception that was thrown while performing this task, or `null` if the
* task completed successfully.
*/
@@ -389,7 +401,7 @@
* used to compute results based on the given [inputs].
*/
AnalysisTask createTask(AnalysisContext context, AnalysisTarget target,
- Map<String, dynamic> inputs);
+ Map<String, dynamic> inputs, Object inputMemento);
}
/**
diff --git a/pkg/analyzer/pubspec.yaml b/pkg/analyzer/pubspec.yaml
index b5cde46..ea3dd0c 100644
--- a/pkg/analyzer/pubspec.yaml
+++ b/pkg/analyzer/pubspec.yaml
@@ -1,13 +1,13 @@
name: analyzer
-version: 0.24.3
+version: 0.25.0+1
author: Dart Team <misc@dartlang.org>
description: Static analyzer for Dart.
homepage: http://www.dartlang.org
environment:
sdk: '>=0.8.10+6 <2.0.0'
dependencies:
- args: '>=0.12.1 <0.13.0'
path: '>=0.9.0 <2.0.0'
+ plugin: '<0.2.0'
watcher: '>=0.9.0 <0.10.0'
dev_dependencies:
typed_mock: '>=0.0.4 <1.0.0'
diff --git a/pkg/analyzer/test/error_test.dart b/pkg/analyzer/test/error_test.dart
deleted file mode 100644
index b396624..0000000
--- a/pkg/analyzer/test/error_test.dart
+++ /dev/null
@@ -1,51 +0,0 @@
-// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-library test.error;
-
-import 'package:unittest/unittest.dart';
-
-import 'utils.dart';
-
-void main() {
- test("a valid Dart file doesn't throw any errors", () {
- expect(errorsForFile('void main() => print("Hello, world!");'), isNull);
- });
-
- test("an empty Dart file doesn't throw any errors", () {
- expect(errorsForFile(''), isNull);
- });
-
- test("an error on the first line", () {
- expect(errorsForFile('void foo;\n'),
- equals("Error in test.dart: Variables cannot have a type of 'void'\n"));
- });
-
- test("an error on the last line", () {
- expect(errorsForFile('\nvoid foo;'),
- equals("Error in test.dart: Variables cannot have a type of 'void'\n"));
- });
-
- test("an error in the middle", () {
- expect(errorsForFile('\nvoid foo;\n'),
- equals("Error in test.dart: Variables cannot have a type of 'void'\n"));
- });
-
- var veryLongString = new List.filled(107, ' ').join('');
-
- test("an error at the end of a very long line", () {
- expect(errorsForFile('$veryLongString void foo;'),
- equals("Error in test.dart: Variables cannot have a type of 'void'\n"));
- });
-
- test("an error at the beginning of a very long line", () {
- expect(errorsForFile('void foo; $veryLongString'),
- equals("Error in test.dart: Variables cannot have a type of 'void'\n"));
- });
-
- test("an error in the middle of a very long line", () {
- expect(errorsForFile('$veryLongString void foo;$veryLongString'),
- equals("Error in test.dart: Variables cannot have a type of 'void'\n"));
- });
-}
diff --git a/pkg/analyzer/test/generated/all_the_rest_test.dart b/pkg/analyzer/test/generated/all_the_rest_test.dart
index a45e012..e16bff6 100644
--- a/pkg/analyzer/test/generated/all_the_rest_test.dart
+++ b/pkg/analyzer/test/generated/all_the_rest_test.dart
@@ -851,6 +851,13 @@
class ConstantFinderTest extends EngineTestCase {
AstNode _node;
+ TypeProvider _typeProvider;
+
+ void setUp() {
+ super.setUp();
+ _typeProvider = new TestTypeProvider();
+ }
+
/**
* Test an annotation that consists solely of an identifier (and hence
* represents a reference to a compile-time constant variable).
@@ -895,6 +902,22 @@
expect(_findVariableDeclarations()[element], same(_node));
}
+ void test_visitVariableDeclaration_final_inClass() {
+ _setupFieldDeclaration('C', 'f', Keyword.FINAL);
+ expect(_findVariableDeclarations(), isEmpty);
+ }
+
+ void test_visitVariableDeclaration_final_inClassWithConstConstructor() {
+ VariableDeclaration field = _setupFieldDeclaration('C', 'f', Keyword.FINAL,
+ hasConstConstructor: true);
+ expect(_findVariableDeclarations()[field.element], same(field));
+ }
+
+ void test_visitVariableDeclaration_final_outsideClass() {
+ _setupVariableDeclaration('v', false, true, isFinal: true);
+ expect(_findVariableDeclarations(), isEmpty);
+ }
+
void test_visitVariableDeclaration_noInitializer() {
_setupVariableDeclaration("v", true, false);
expect(_findVariableDeclarations().isEmpty, isTrue);
@@ -905,6 +928,36 @@
expect(_findVariableDeclarations().isEmpty, isTrue);
}
+ void test_visitVariableDeclaration_static_const_inClass() {
+ VariableDeclaration field =
+ _setupFieldDeclaration('C', 'f', Keyword.CONST, isStatic: true);
+ expect(_findVariableDeclarations()[field.element], same(field));
+ }
+
+ void test_visitVariableDeclaration_static_const_inClassWithConstConstructor() {
+ VariableDeclaration field = _setupFieldDeclaration('C', 'f', Keyword.CONST,
+ isStatic: true, hasConstConstructor: true);
+ expect(_findVariableDeclarations()[field.element], same(field));
+ }
+
+ void test_visitVariableDeclaration_static_final_inClassWithConstConstructor() {
+ _setupFieldDeclaration('C', 'f', Keyword.FINAL,
+ isStatic: true, hasConstConstructor: true);
+ expect(_findVariableDeclarations(), isEmpty);
+ }
+
+ void test_visitVariableDeclaration_uninitialized_final_inClassWithConstConstructor() {
+ _setupFieldDeclaration('C', 'f', Keyword.FINAL,
+ isInitialized: false, hasConstConstructor: true);
+ expect(_findVariableDeclarations(), isEmpty);
+ }
+
+ void test_visitVariableDeclaration_uninitialized_static_const_inClass() {
+ _setupFieldDeclaration('C', 'f', Keyword.CONST,
+ isStatic: true, isInitialized: false);
+ expect(_findVariableDeclarations(), isEmpty);
+ }
+
List<Annotation> _findAnnotations() {
ConstantFinder finder = new ConstantFinder();
_node.accept(finder);
@@ -954,6 +1007,41 @@
return element;
}
+ VariableDeclaration _setupFieldDeclaration(
+ String className, String fieldName, Keyword keyword,
+ {bool isInitialized: true, bool isStatic: false,
+ bool hasConstConstructor: false}) {
+ VariableDeclaration variableDeclaration = isInitialized
+ ? AstFactory.variableDeclaration2(fieldName, AstFactory.integer(0))
+ : AstFactory.variableDeclaration(fieldName);
+ VariableElement fieldElement = ElementFactory.fieldElement(fieldName,
+ isStatic, keyword == Keyword.FINAL, keyword == Keyword.CONST,
+ _typeProvider.intType);
+ variableDeclaration.name.staticElement = fieldElement;
+ FieldDeclaration fieldDeclaration = AstFactory.fieldDeclaration2(
+ isStatic, keyword, <VariableDeclaration>[variableDeclaration]);
+ ClassDeclaration classDeclaration =
+ AstFactory.classDeclaration(null, className, null, null, null, null);
+ classDeclaration.members.add(fieldDeclaration);
+ _node = classDeclaration;
+ ClassElementImpl classElement = ElementFactory.classElement2(className);
+ classElement.fields = <FieldElement>[fieldElement];
+ classDeclaration.name.staticElement = classElement;
+ if (hasConstConstructor) {
+ ConstructorDeclaration constructorDeclaration = AstFactory
+ .constructorDeclaration2(Keyword.CONST, null,
+ AstFactory.identifier3(className), null,
+ AstFactory.formalParameterList(), null,
+ AstFactory.blockFunctionBody2());
+ classDeclaration.members.add(constructorDeclaration);
+ ConstructorElement constructorElement =
+ ElementFactory.constructorElement(classElement, '', true);
+ constructorDeclaration.element = constructorElement;
+ classElement.constructors = <ConstructorElement>[constructorElement];
+ }
+ return variableDeclaration;
+ }
+
void _setupInstanceCreationExpression(String name, bool isConst) {
_node = AstFactory.instanceCreationExpression2(
isConst ? Keyword.CONST : null,
@@ -961,15 +1049,15 @@
}
VariableElement _setupVariableDeclaration(
- String name, bool isConst, bool isInitialized) {
+ String name, bool isConst, bool isInitialized, {isFinal: false}) {
VariableDeclaration variableDeclaration = isInitialized
? AstFactory.variableDeclaration2(name, AstFactory.integer(0))
: AstFactory.variableDeclaration(name);
SimpleIdentifier identifier = variableDeclaration.name;
VariableElement element = ElementFactory.localVariableElement(identifier);
identifier.staticElement = element;
- AstFactory.variableDeclarationList2(
- isConst ? Keyword.CONST : null, [variableDeclaration]);
+ Keyword keyword = isConst ? Keyword.CONST : isFinal ? Keyword.FINAL : null;
+ AstFactory.variableDeclarationList2(keyword, [variableDeclaration]);
_node = variableDeclaration;
return element;
}
@@ -1345,6 +1433,30 @@
const B b = const B();''');
}
+ void test_dependencyOnInitializedNonStaticConst() {
+ // Even though non-static consts are not allowed by the language, we need
+ // to handle them for error recovery purposes.
+ // a depends on A() depends on A.x
+ _assertProperDependencies('''
+class A {
+ const A();
+ const int x = 1;
+}
+const A a = const A();
+''', [CompileTimeErrorCode.CONST_INSTANCE_FIELD]);
+ }
+
+ void test_dependencyOnInitializedFinal() {
+ // a depends on A() depends on A.x
+ _assertProperDependencies('''
+class A {
+ const A();
+ final int x = 1;
+}
+const A a = const A();
+''');
+ }
+
void test_dependencyOnNonFactoryRedirect() {
// a depends on A.foo() depends on A.bar()
_assertProperDependencies(r'''
@@ -1430,6 +1542,40 @@
const y = 2;''');
}
+ void test_final_initialized_at_declaration() {
+ CompilationUnit compilationUnit = resolveSource('''
+class A {
+ final int i = 123;
+ const A();
+}
+
+const A a = const A();
+''');
+ EvaluationResultImpl result =
+ _evaluateInstanceCreationExpression(compilationUnit, 'a');
+ Map<String, DartObjectImpl> fields = _assertType(result, "A");
+ expect(fields, hasLength(1));
+ _assertIntField(fields, "i", 123);
+ }
+
+ void test_non_static_const_initialized_at_declaration() {
+ // Even though non-static consts are not allowed by the language, we need
+ // to handle them for error recovery purposes.
+ CompilationUnit compilationUnit = resolveSource('''
+class A {
+ const int i = 123;
+ const A();
+}
+
+const A a = const A();
+''');
+ EvaluationResultImpl result =
+ _evaluateInstanceCreationExpression(compilationUnit, 'a');
+ Map<String, DartObjectImpl> fields = _assertType(result, "A");
+ expect(fields, hasLength(1));
+ _assertIntField(fields, "i", 123);
+ }
+
void test_fromEnvironment_bool_default_false() {
expect(_assertValidBool(_check_fromEnvironment_bool(null, "false")), false);
}
@@ -4817,6 +4963,7 @@
List<TypeParameterElement> typeParameters = type.typeParameters;
expect(typeParameters, hasLength(0));
expect(type.isAbstract, isTrue);
+ expect(type.isMixinApplication, isFalse);
expect(type.isSynthetic, isFalse);
}
@@ -4835,6 +4982,7 @@
List<TypeParameterElement> typeParameters = type.typeParameters;
expect(typeParameters, hasLength(0));
expect(type.isAbstract, isFalse);
+ expect(type.isMixinApplication, isFalse);
expect(type.isSynthetic, isFalse);
}
@@ -4859,6 +5007,7 @@
expect(typeParameters[0].name, firstVariableName);
expect(typeParameters[1].name, secondVariableName);
expect(type.isAbstract, isFalse);
+ expect(type.isMixinApplication, isFalse);
expect(type.isSynthetic, isFalse);
}
@@ -4885,6 +5034,7 @@
expect(type, isNotNull);
expect(type.name, className);
expect(type.isAbstract, isFalse);
+ expect(type.isMixinApplication, isFalse);
expect(type.isSynthetic, isFalse);
List<TypeParameterElement> typeParameters = type.typeParameters;
expect(typeParameters, hasLength(1));
@@ -4926,6 +5076,7 @@
expect(alias.element, same(type));
expect(type.name, equals('C'));
expect(type.isAbstract, isFalse);
+ expect(type.isMixinApplication, isTrue);
expect(type.isSynthetic, isFalse);
expect(type.typeParameters, isEmpty);
expect(type.fields, isEmpty);
@@ -4953,6 +5104,7 @@
expect(types, hasLength(1));
ClassElement type = types[0];
expect(type.isAbstract, isTrue);
+ expect(type.isMixinApplication, isTrue);
}
void test_visitClassTypeAlias_typeParams() {
@@ -8309,6 +8461,17 @@
}
@override
+ void beforeGetFieldEvaluationResult(FieldElementImpl field) {
+ super.beforeGetFieldEvaluationResult(field);
+ // If we are getting the constant value for a node in the graph, make sure
+ // we properly recorded the dependency.
+ VariableDeclaration node = findVariableDeclaration(field);
+ if (node != null && referenceGraph.nodes.contains(node)) {
+ expect(referenceGraph.containsPath(_nodeBeingEvaluated, node), isTrue);
+ }
+ }
+
+ @override
void beforeGetConstantInitializers(ConstructorElement constructor) {
super.beforeGetConstantInitializers(constructor);
// If we are getting the constant initializers for a node in the graph,
diff --git a/pkg/analyzer/test/generated/compile_time_error_code_test.dart b/pkg/analyzer/test/generated/compile_time_error_code_test.dart
index 7b293a8..da69804 100644
--- a/pkg/analyzer/test/generated/compile_time_error_code_test.dart
+++ b/pkg/analyzer/test/generated/compile_time_error_code_test.dart
@@ -576,6 +576,23 @@
verify([source]);
}
+ void test_bug_23176() {
+ Source source = addSource('''
+class A {
+ const A([x]);
+}
+class B {
+ dynamic @A(const A()) x;
+}
+''');
+ resolve(source);
+ assertErrors(source, [
+ ParserErrorCode.EXPECTED_CLASS_MEMBER,
+ ParserErrorCode.MISSING_CONST_FINAL_VAR_OR_TYPE
+ ]);
+ verify([source]);
+ }
+
void test_builtInIdentifierAsMixinName_classTypeAlias() {
Source source = addSource(r'''
class A {}
diff --git a/pkg/analyzer/test/generated/element_test.dart b/pkg/analyzer/test/generated/element_test.dart
index 7156161..4e8041d 100644
--- a/pkg/analyzer/test/generated/element_test.dart
+++ b/pkg/analyzer/test/generated/element_test.dart
@@ -37,6 +37,7 @@
runReflectiveTests(HtmlElementImplTest);
runReflectiveTests(LibraryElementImplTest);
runReflectiveTests(MultiplyDefinedElementImplTest);
+ runReflectiveTests(ParameterElementImplTest);
}
@reflectiveTest
@@ -915,6 +916,94 @@
@reflectiveTest
class CompilationUnitElementImplTest extends EngineTestCase {
+ void test_getElementAt() {
+ AnalysisContextHelper contextHelper = new AnalysisContextHelper();
+ AnalysisContext context = contextHelper.context;
+ String code = r'''
+class A {
+ int field;
+}
+main() {
+ int localVar = 42;
+}
+''';
+ Source libSource = contextHelper.addSource("/my_lib.dart", code);
+ // prepare library/unit elements
+ LibraryElement libraryElement = context.computeLibraryElement(libSource);
+ CompilationUnitElement unitElement = libraryElement.definingCompilationUnit;
+ // A
+ ClassElement elementA;
+ {
+ int offset = code.indexOf('A {');
+ elementA = unitElement.getElementAt(offset);
+ expect(elementA, isNotNull);
+ expect(elementA.enclosingElement, unitElement);
+ expect(elementA.name, 'A');
+ }
+ // A.field
+ {
+ int offset = code.indexOf('field;');
+ FieldElement element = unitElement.getElementAt(offset);
+ expect(element, isNotNull);
+ expect(element.enclosingElement, elementA);
+ expect(element.name, 'field');
+ }
+ // main
+ FunctionElement mainElement;
+ {
+ int offset = code.indexOf('main() {');
+ mainElement = unitElement.getElementAt(offset);
+ expect(mainElement, isNotNull);
+ expect(mainElement.enclosingElement, unitElement);
+ expect(mainElement.name, 'main');
+ }
+ // main.localVar
+ {
+ int offset = code.indexOf('localVar');
+ LocalVariableElement element = unitElement.getElementAt(offset);
+ expect(element, isNotNull);
+ expect(element.enclosingElement, mainElement);
+ expect(element.name, 'localVar');
+ }
+ // null
+ expect(unitElement.getElementAt(1000), isNull);
+ }
+
+ void test_getElementAt_multipleUnitsInLibrary() {
+ AnalysisContextHelper contextHelper = new AnalysisContextHelper();
+ AnalysisContext context = contextHelper.context;
+ Source libSource = contextHelper.addSource("/my_lib.dart", r'''
+library my_lib;
+part 'unit_a.dart';
+part 'unit_b.dart';
+''');
+ Source unitSourceA =
+ contextHelper.addSource("/unit_a.dart", 'part of my_lib;class A {}');
+ Source unitSourceB =
+ contextHelper.addSource("/unit_b.dart", 'part of my_lib;class B {}');
+ int offset = 'part of my_lib;class A {}'.indexOf('A {}');
+ // prepare library/unit elements
+ context.computeLibraryElement(libSource);
+ CompilationUnitElement unitElementA =
+ context.getCompilationUnitElement(unitSourceA, libSource);
+ CompilationUnitElement unitElementB =
+ context.getCompilationUnitElement(unitSourceB, libSource);
+ // A
+ {
+ ClassElement element = unitElementA.getElementAt(offset);
+ expect(element, isNotNull);
+ expect(element.enclosingElement, unitElementA);
+ expect(element.name, 'A');
+ }
+ // B
+ {
+ ClassElement element = unitElementB.getElementAt(offset);
+ expect(element, isNotNull);
+ expect(element.enclosingElement, unitElementB);
+ expect(element.name, 'B');
+ }
+ }
+
void test_getEnum_declared() {
TestTypeProvider typeProvider = new TestTypeProvider();
CompilationUnitElementImpl unit =
@@ -2634,8 +2723,7 @@
void test_isAssignableTo_void() {
InterfaceTypeImpl intType = _typeProvider.intType;
- expect(
- VoidTypeImpl.instance.isAssignableTo(intType), isFalse);
+ expect(VoidTypeImpl.instance.isAssignableTo(intType), isFalse);
}
void test_isDirectSupertypeOf_extends() {
@@ -3624,6 +3712,90 @@
}
@reflectiveTest
+class ParameterElementImplTest extends EngineTestCase {
+ void test_node_DefaultFormalParameter() {
+ AnalysisContextHelper contextHelper = new AnalysisContextHelper();
+ AnalysisContext context = contextHelper.context;
+ Source source = contextHelper.addSource("/test.dart", r'''
+main([int p = 42]) {
+}''');
+ // prepare CompilationUnitElement
+ LibraryElement libraryElement = context.computeLibraryElement(source);
+ CompilationUnitElement unitElement = libraryElement.definingCompilationUnit;
+ // p
+ {
+ ParameterElement element = unitElement.functions[0].parameters[0];
+ DefaultFormalParameter node = element.node;
+ expect(node, isNotNull);
+ expect(node.identifier.name, 'p');
+ expect(node.element, same(element));
+ }
+ }
+
+ void test_node_FieldFormalParameter() {
+ AnalysisContextHelper contextHelper = new AnalysisContextHelper();
+ AnalysisContext context = contextHelper.context;
+ Source source = contextHelper.addSource("/test.dart", r'''
+class A {
+ int p;
+ A(this.p) {
+ }
+}''');
+ // prepare CompilationUnitElement
+ LibraryElement libraryElement = context.computeLibraryElement(source);
+ CompilationUnitElement unitElement = libraryElement.definingCompilationUnit;
+ // p
+ {
+ ClassElement classA = unitElement.types[0];
+ ConstructorElement constructorA = classA.constructors[0];
+ FieldFormalParameterElement element = constructorA.parameters[0];
+ FieldFormalParameter node = element.node;
+ expect(node, isNotNull);
+ expect(node.identifier.name, 'p');
+ expect(node.element, same(element));
+ }
+ }
+
+ void test_node_FunctionTypedFormalParameter() {
+ AnalysisContextHelper contextHelper = new AnalysisContextHelper();
+ AnalysisContext context = contextHelper.context;
+ Source source = contextHelper.addSource("/test.dart", r'''
+main(p(int a, int b)) {
+}''');
+ // prepare CompilationUnitElement
+ LibraryElement libraryElement = context.computeLibraryElement(source);
+ CompilationUnitElement unitElement = libraryElement.definingCompilationUnit;
+ // p
+ {
+ ParameterElement element = unitElement.functions[0].parameters[0];
+ FunctionTypedFormalParameter node = element.node;
+ expect(node, isNotNull);
+ expect(node.identifier.name, 'p');
+ expect(node.element, same(element));
+ }
+ }
+
+ void test_node_SimpleFormalParameter() {
+ AnalysisContextHelper contextHelper = new AnalysisContextHelper();
+ AnalysisContext context = contextHelper.context;
+ Source source = contextHelper.addSource("/test.dart", r'''
+main(int p) {
+}''');
+ // prepare CompilationUnitElement
+ LibraryElement libraryElement = context.computeLibraryElement(source);
+ CompilationUnitElement unitElement = libraryElement.definingCompilationUnit;
+ // p
+ {
+ ParameterElement element = unitElement.functions[0].parameters[0];
+ SimpleFormalParameter node = element.node;
+ expect(node, isNotNull);
+ expect(node.identifier.name, 'p');
+ expect(node.element, same(element));
+ }
+ }
+}
+
+@reflectiveTest
class TypeParameterTypeImplTest extends EngineTestCase {
void test_creation() {
expect(new TypeParameterTypeImpl(
diff --git a/pkg/analyzer/test/generated/engine_test.dart b/pkg/analyzer/test/generated/engine_test.dart
index 2ecb8d8..06cafa0 100644
--- a/pkg/analyzer/test/generated/engine_test.dart
+++ b/pkg/analyzer/test/generated/engine_test.dart
@@ -11,6 +11,7 @@
import 'dart:collection';
import 'package:analyzer/src/cancelable_future.dart';
+import 'package:analyzer/src/context/cache.dart' show CacheEntry;
import 'package:analyzer/src/generated/ast.dart';
import 'package:analyzer/src/generated/constant.dart';
import 'package:analyzer/src/generated/element.dart';
@@ -33,6 +34,7 @@
import 'package:analyzer/src/services/lint.dart';
import 'package:analyzer/src/string_source.dart';
import 'package:analyzer/src/task/task_dart.dart';
+import 'package:analyzer/task/model.dart' hide AnalysisTask;
import 'package:typed_mock/typed_mock.dart';
import 'package:unittest/unittest.dart';
import 'package:watcher/src/utils.dart';
@@ -1219,21 +1221,6 @@
(obj) => obj is ClassElement, ClassElement, namespace.get("A"));
}
- void test_getRefactoringUnsafeSources() {
- // not sources initially
- List<Source> sources = _context.refactoringUnsafeSources;
- expect(sources, hasLength(0));
- // add new source, unresolved
- Source source = _addSource("/test.dart", "library lib;");
- sources = _context.refactoringUnsafeSources;
- expect(sources, hasLength(1));
- expect(sources[0], source);
- // resolve source
- _context.computeLibraryElement(source);
- sources = _context.refactoringUnsafeSources;
- expect(sources, hasLength(0));
- }
-
void test_getResolvedCompilationUnit_library() {
_context = AnalysisContextFactory.contextWithCore();
_sourceFactory = _context.sourceFactory;
@@ -5445,6 +5432,11 @@
return null;
}
@override
+ List<AnalysisTarget> get explicitTargets {
+ fail("Unexpected invocation of visitCacheItems");
+ return null;
+ }
+ @override
List<Source> get htmlSources {
fail("Unexpected invocation of getHtmlSources");
return null;
@@ -5465,6 +5457,11 @@
return null;
}
@override
+ LibraryResolverFactory get libraryResolverFactory {
+ fail("Unexpected invocation of getLibraryResolverFactory");
+ return null;
+ }
+ @override
List<Source> get librarySources {
fail("Unexpected invocation of getLibrarySources");
return null;
@@ -5489,20 +5486,17 @@
return null;
}
@override
- List<Source> get refactoringUnsafeSources {
- fail("Unexpected invocation of getRefactoringUnsafeSources");
+ List<AnalysisTarget> get priorityTargets {
+ fail("Unexpected invocation of visitCacheItems");
return null;
}
- @override
- LibraryResolverFactory get libraryResolverFactory {
- fail("Unexpected invocation of getLibraryResolverFactory");
- return null;
- }
+
@override
ResolverVisitorFactory get resolverVisitorFactory {
fail("Unexpected invocation of getResolverVisitorFactory");
return null;
}
+
@override
SourceFactory get sourceFactory {
fail("Unexpected invocation of getSourceFactory");
@@ -5513,13 +5507,11 @@
void set sourceFactory(SourceFactory factory) {
fail("Unexpected invocation of setSourceFactory");
}
-
@override
List<Source> get sources {
fail("Unexpected invocation of sources");
return null;
}
-
@override
AnalysisContextStatistics get statistics {
fail("Unexpected invocation of getStatistics");
@@ -5621,6 +5613,11 @@
return false;
}
@override
+ CacheEntry getCacheEntry(AnalysisTarget target) {
+ fail("Unexpected invocation of visitCacheItems");
+ return null;
+ }
+ @override
CompilationUnitElement getCompilationUnitElement(
Source unitSource, Source librarySource) {
fail("Unexpected invocation of getCompilationUnitElement");
@@ -5757,18 +5754,21 @@
void removeListener(AnalysisListener listener) {
fail("Unexpected invocation of removeListener");
}
+
@override
CompilationUnit resolveCompilationUnit(
Source unitSource, LibraryElement library) {
fail("Unexpected invocation of resolveCompilationUnit");
return null;
}
+
@override
CompilationUnit resolveCompilationUnit2(
Source unitSource, Source librarySource) {
fail("Unexpected invocation of resolveCompilationUnit");
return null;
}
+
@override
ht.HtmlUnit resolveHtmlUnit(Source htmlSource) {
fail("Unexpected invocation of resolveHtmlUnit");
@@ -6124,17 +6124,6 @@
}
}
-class TestAnalysisContext_test_getRefactoringUnsafeSources
- extends TestAnalysisContext {
- bool invoked = false;
- TestAnalysisContext_test_getRefactoringUnsafeSources();
- @override
- List<Source> get refactoringUnsafeSources {
- invoked = true;
- return null;
- }
-}
-
class TestAnalysisContext_test_getResolvedCompilationUnit_element
extends TestAnalysisContext {
bool invoked = false;
diff --git a/pkg/analyzer/test/generated/non_error_resolver_test.dart b/pkg/analyzer/test/generated/non_error_resolver_test.dart
index 25ba9fa..cf549d8 100644
--- a/pkg/analyzer/test/generated/non_error_resolver_test.dart
+++ b/pkg/analyzer/test/generated/non_error_resolver_test.dart
@@ -2108,6 +2108,23 @@
verify([source]);
}
+ void test_instance_creation_inside_annotation() {
+ Source source = addSource('''
+class C {
+ const C();
+}
+class D {
+ final C c;
+ const D(this.c);
+}
+@D(const C())
+f() {}
+''');
+ resolve(source);
+ assertNoErrors(source);
+ verify([source]);
+ }
+
void test_instanceAccessToStaticMember_fromComment() {
Source source = addSource(r'''
class A {
diff --git a/pkg/analyzer/test/generated/parser_test.dart b/pkg/analyzer/test/generated/parser_test.dart
index 514c0d7..023c9fa 100644
--- a/pkg/analyzer/test/generated/parser_test.dart
+++ b/pkg/analyzer/test/generated/parser_test.dart
@@ -485,10 +485,6 @@
EngineTestCase.assertInstanceOf((obj) => obj is BinaryExpression,
BinaryExpression, expression.leftOperand);
}
-
- void test_topLevelVariable_withMetadata() {
- ParserTestCase.parseCompilationUnit("String @A string;");
- }
}
/**
@@ -1899,6 +1895,14 @@
[ParserErrorCode.TOP_LEVEL_OPERATOR]);
}
+ void test_topLevelVariable_withMetadata() {
+ ParserTestCase.parseCompilationUnit("String @A string;", [
+ ParserErrorCode.MISSING_IDENTIFIER,
+ ParserErrorCode.EXPECTED_TOKEN,
+ ParserErrorCode.MISSING_CONST_FINAL_VAR_OR_TYPE
+ ]);
+ }
+
void test_typedefInClass_withoutReturnType() {
ParserTestCase.parseCompilationUnit(
"class C { typedef F(x); }", [ParserErrorCode.TYPEDEF_IN_CLASS]);
@@ -2503,6 +2507,15 @@
void test_constFactory_external() {
parse("parseClassMember", <Object>["C"], "external const factory C();");
}
+
+ void test_staticMethod_notParsingFunctionBodies() {
+ ParserTestCase.parseFunctionBodies = false;
+ try {
+ parse4("parseCompilationUnit", "class C { static void m() {} }");
+ } finally {
+ ParserTestCase.parseFunctionBodies = true;
+ }
+ }
}
class ParserTestCase extends EngineTestCase {
@@ -3271,28 +3284,25 @@
void test_importDirectivePartial_as() {
CompilationUnit unit = ParserTestCase.parseCompilationUnit(
- "import 'b.dart' d as b;",
- [ParserErrorCode.UNEXPECTED_TOKEN]);
+ "import 'b.dart' d as b;", [ParserErrorCode.UNEXPECTED_TOKEN]);
ImportDirective importDirective = unit.childEntities.first;
expect(importDirective.asKeyword, isNotNull);
expect(unit.directives, hasLength(1));
expect(unit.declarations, hasLength(0));
}
- void test_importDirectivePartial_show() {
+ void test_importDirectivePartial_hide() {
CompilationUnit unit = ParserTestCase.parseCompilationUnit(
- "import 'b.dart' d show foo;",
- [ParserErrorCode.UNEXPECTED_TOKEN]);
+ "import 'b.dart' d hide foo;", [ParserErrorCode.UNEXPECTED_TOKEN]);
ImportDirective importDirective = unit.childEntities.first;
expect(importDirective.combinators, hasLength(1));
expect(unit.directives, hasLength(1));
expect(unit.declarations, hasLength(0));
}
- void test_importDirectivePartial_hide() {
+ void test_importDirectivePartial_show() {
CompilationUnit unit = ParserTestCase.parseCompilationUnit(
- "import 'b.dart' d hide foo;",
- [ParserErrorCode.UNEXPECTED_TOKEN]);
+ "import 'b.dart' d show foo;", [ParserErrorCode.UNEXPECTED_TOKEN]);
ImportDirective importDirective = unit.childEntities.first;
expect(importDirective.combinators, hasLength(1));
expect(unit.directives, hasLength(1));
diff --git a/pkg/analyzer/test/generated/resolver_test.dart b/pkg/analyzer/test/generated/resolver_test.dart
index fcb6c5c..7382916 100644
--- a/pkg/analyzer/test/generated/resolver_test.dart
+++ b/pkg/analyzer/test/generated/resolver_test.dart
@@ -273,8 +273,7 @@
];
htmlUnit.functions = <FunctionElement>[
ElementFactory.functionElement3("query", elementElement,
- <ClassElement>[provider.stringType.element],
- ClassElementImpl.EMPTY_ARRAY)
+ <ClassElement>[provider.stringType.element], ClassElement.EMPTY_LIST)
];
TopLevelVariableElementImpl document = ElementFactory
.topLevelVariableElement3(
@@ -294,7 +293,7 @@
mathUnit.source = mathSource;
FunctionElement cosElement = ElementFactory.functionElement3("cos",
provider.doubleType.element, <ClassElement>[provider.numType.element],
- ClassElementImpl.EMPTY_ARRAY);
+ ClassElement.EMPTY_LIST);
TopLevelVariableElement ln10Element = ElementFactory
.topLevelVariableElement3("LN10", true, false, provider.doubleType);
TopLevelVariableElement piElement = ElementFactory.topLevelVariableElement3(
@@ -311,10 +310,10 @@
randomElement.constructors = <ConstructorElement>[randomConstructor];
FunctionElement sinElement = ElementFactory.functionElement3("sin",
provider.doubleType.element, <ClassElement>[provider.numType.element],
- ClassElementImpl.EMPTY_ARRAY);
+ ClassElement.EMPTY_LIST);
FunctionElement sqrtElement = ElementFactory.functionElement3("sqrt",
provider.doubleType.element, <ClassElement>[provider.numType.element],
- ClassElementImpl.EMPTY_ARRAY);
+ ClassElement.EMPTY_LIST);
mathUnit.accessors = <PropertyAccessorElement>[
ln10Element.getter,
piElement.getter
@@ -914,6 +913,23 @@
verify([source]);
}
+ void test_fieldTypeMismatch_generic() {
+ Source source = addSource(r'''
+class C<T> {
+ final T x = y;
+ const C();
+}
+const y = 1;
+var v = const C<String>();
+''');
+ resolve(source);
+ assertErrors(source, [
+ CheckedModeCompileTimeErrorCode.CONST_CONSTRUCTOR_FIELD_TYPE_MISMATCH,
+ HintCode.INVALID_ASSIGNMENT
+ ]);
+ verify([source]);
+ }
+
void test_fieldTypeMismatch_unresolved() {
Source source = addSource(r'''
class A {
@@ -929,6 +945,20 @@
verify([source]);
}
+ void test_fieldTypeOk_generic() {
+ Source source = addSource(r'''
+class C<T> {
+ final T x = y;
+ const C();
+}
+const y = 1;
+var v = const C<int>();
+''');
+ resolve(source);
+ assertErrors(source, [HintCode.INVALID_ASSIGNMENT]);
+ verify([source]);
+ }
+
void test_fieldTypeOk_null() {
Source source = addSource(r'''
class A {
@@ -1386,6 +1416,20 @@
_listener.assertNoErrors();
}
+ void test_visitEnumDeclaration() {
+ ClassElementImpl enumElement =
+ ElementFactory.enumElement(_typeProvider, ('E'));
+ EnumDeclaration enumNode = AstFactory.enumDeclaration2('E', []);
+ Annotation annotationNode =
+ AstFactory.annotation(AstFactory.identifier3('a'));
+ annotationNode.element = ElementFactory.classElement2('A');
+ enumNode.metadata.add(annotationNode);
+ enumNode.name.staticElement = enumElement;
+ _resolveNode(enumNode);
+ List<ElementAnnotation> metadata = enumElement.metadata;
+ expect(metadata, hasLength(1));
+ }
+
void test_visitExportDirective_noCombinators() {
ExportDirective directive = AstFactory.exportDirective2(null);
directive.element = ElementFactory
@@ -7737,7 +7781,7 @@
AnalysisContext context, String libraryName, [List<String> typeNames]) {
List<CompilationUnitElement> sourcedCompilationUnits;
if (typeNames == null) {
- sourcedCompilationUnits = CompilationUnitElementImpl.EMPTY_ARRAY;
+ sourcedCompilationUnits = CompilationUnitElement.EMPTY_LIST;
} else {
int count = typeNames.length;
sourcedCompilationUnits = new List<CompilationUnitElement>(count);
diff --git a/pkg/analyzer/test/generated/utilities_test.dart b/pkg/analyzer/test/generated/utilities_test.dart
index d6a6ac5..a95a6d7 100644
--- a/pkg/analyzer/test/generated/utilities_test.dart
+++ b/pkg/analyzer/test/generated/utilities_test.dart
@@ -362,9 +362,8 @@
}
void test_visitCompilationUnit_directive_declaration() {
- _assertClone(AstFactory.compilationUnit4([
- AstFactory.libraryDirective2("l")
- ], [
+ _assertClone(AstFactory.compilationUnit4(
+ [AstFactory.libraryDirective2("l")], [
AstFactory.topLevelVariableDeclaration2(
Keyword.VAR, [AstFactory.variableDeclaration("a")])
]));
@@ -391,9 +390,8 @@
}
void test_visitCompilationUnit_script_directives_declarations() {
- _assertClone(AstFactory.compilationUnit8("!#/bin/dartvm", [
- AstFactory.libraryDirective2("l")
- ], [
+ _assertClone(AstFactory.compilationUnit8("!#/bin/dartvm",
+ [AstFactory.libraryDirective2("l")], [
AstFactory.topLevelVariableDeclaration2(
Keyword.VAR, [AstFactory.variableDeclaration("a")])
]));
@@ -761,9 +759,8 @@
}
void test_visitForStatement_cu() {
- _assertClone(AstFactory.forStatement(null, AstFactory.identifier3("c"), [
- AstFactory.identifier3("u")
- ], AstFactory.block()));
+ _assertClone(AstFactory.forStatement(null, AstFactory.identifier3("c"),
+ [AstFactory.identifier3("u")], AstFactory.block()));
}
void test_visitForStatement_e() {
@@ -778,15 +775,13 @@
void test_visitForStatement_ecu() {
_assertClone(AstFactory.forStatement(AstFactory.identifier3("e"),
- AstFactory.identifier3("c"), [
- AstFactory.identifier3("u")
- ], AstFactory.block()));
+ AstFactory.identifier3("c"), [AstFactory.identifier3("u")],
+ AstFactory.block()));
}
void test_visitForStatement_eu() {
- _assertClone(AstFactory.forStatement(AstFactory.identifier3("e"), null, [
- AstFactory.identifier3("u")
- ], AstFactory.block()));
+ _assertClone(AstFactory.forStatement(AstFactory.identifier3("e"), null,
+ [AstFactory.identifier3("u")], AstFactory.block()));
}
void test_visitForStatement_i() {
@@ -804,16 +799,14 @@
void test_visitForStatement_icu() {
_assertClone(AstFactory.forStatement2(AstFactory.variableDeclarationList2(
Keyword.VAR, [AstFactory.variableDeclaration("i")]),
- AstFactory.identifier3("c"), [
- AstFactory.identifier3("u")
- ], AstFactory.block()));
+ AstFactory.identifier3("c"), [AstFactory.identifier3("u")],
+ AstFactory.block()));
}
void test_visitForStatement_iu() {
_assertClone(AstFactory.forStatement2(AstFactory.variableDeclarationList2(
- Keyword.VAR, [AstFactory.variableDeclaration("i")]), null, [
- AstFactory.identifier3("u")
- ], AstFactory.block()));
+ Keyword.VAR, [AstFactory.variableDeclaration("i")]), null,
+ [AstFactory.identifier3("u")], AstFactory.block()));
}
void test_visitForStatement_u() {
@@ -905,9 +898,8 @@
}
void test_visitImportDirective_combinator() {
- _assertClone(AstFactory.importDirective3("a.dart", null, [
- AstFactory.showCombinator([AstFactory.identifier3("A")])
- ]));
+ _assertClone(AstFactory.importDirective3("a.dart", null,
+ [AstFactory.showCombinator([AstFactory.identifier3("A")])]));
}
void test_visitImportDirective_combinators() {
@@ -926,9 +918,8 @@
}
void test_visitImportDirective_prefix_combinator() {
- _assertClone(AstFactory.importDirective3("a.dart", "p", [
- AstFactory.showCombinator([AstFactory.identifier3("A")])
- ]));
+ _assertClone(AstFactory.importDirective3("a.dart", "p",
+ [AstFactory.showCombinator([AstFactory.identifier3("A")])]));
}
void test_visitImportDirective_prefix_combinators() {
@@ -1343,9 +1334,8 @@
}
void test_visitSwitchCase_singleLabel() {
- _assertClone(AstFactory.switchCase2([
- AstFactory.label2("l1")
- ], AstFactory.identifier3("a"), [AstFactory.block()]));
+ _assertClone(AstFactory.switchCase2([AstFactory.label2("l1")],
+ AstFactory.identifier3("a"), [AstFactory.block()]));
}
void test_visitSwitchDefault_multipleLabels() {
@@ -1405,9 +1395,8 @@
}
void test_visitTryStatement_catch() {
- _assertClone(AstFactory.tryStatement2(AstFactory.block(), [
- AstFactory.catchClause3(AstFactory.typeName4("E"))
- ]));
+ _assertClone(AstFactory.tryStatement2(AstFactory.block(),
+ [AstFactory.catchClause3(AstFactory.typeName4("E"))]));
}
void test_visitTryStatement_catches() {
@@ -1418,9 +1407,9 @@
}
void test_visitTryStatement_catchFinally() {
- _assertClone(AstFactory.tryStatement3(AstFactory.block(), [
- AstFactory.catchClause3(AstFactory.typeName4("E"))
- ], AstFactory.block()));
+ _assertClone(AstFactory.tryStatement3(AstFactory.block(),
+ [AstFactory.catchClause3(AstFactory.typeName4("E"))],
+ AstFactory.block()));
}
void test_visitTryStatement_finally() {
@@ -1487,13 +1476,6 @@
_assertClone(AstFactory.variableDeclaration("a"));
}
- void test_visitVariableDeclaration_withMetadata() {
- VariableDeclaration declaration = AstFactory.variableDeclaration("a");
- declaration.metadata
- .add(AstFactory.annotation(AstFactory.identifier3("deprecated")));
- _assertClone(declaration);
- }
-
void test_visitVariableDeclarationList_const_type() {
_assertClone(AstFactory.variableDeclarationList(Keyword.CONST,
AstFactory.typeName4("C"), [
@@ -3389,9 +3371,8 @@
}
void test_compilationUnit() {
- CompilationUnit node = AstFactory.compilationUnit8("", [
- AstFactory.libraryDirective2("lib")
- ], [
+ CompilationUnit node = AstFactory.compilationUnit8("",
+ [AstFactory.libraryDirective2("lib")], [
AstFactory.topLevelVariableDeclaration2(
null, [AstFactory.variableDeclaration("X")])
]);
@@ -3490,9 +3471,9 @@
void test_enumConstantDeclaration() {
EnumConstantDeclaration node = new EnumConstantDeclaration(
- Comment.createEndOfLineComment(EMPTY_TOKEN_LIST), [
- AstFactory.annotation(AstFactory.identifier3("a"))
- ], AstFactory.identifier3("C"));
+ Comment.createEndOfLineComment(EMPTY_TOKEN_LIST),
+ [AstFactory.annotation(AstFactory.identifier3("a"))],
+ AstFactory.identifier3("C"));
_assertReplace(
node, new Getter_NodeReplacerTest_test_enumConstantDeclaration());
_testAnnotatedNode(node);
@@ -3591,9 +3572,8 @@
void test_forStatement_withInitialization() {
ForStatement node = AstFactory.forStatement(AstFactory.identifier3("a"),
- AstFactory.booleanLiteral(true), [
- AstFactory.integer(0)
- ], AstFactory.block());
+ AstFactory.booleanLiteral(true), [AstFactory.integer(0)],
+ AstFactory.block());
_assertReplace(node,
new Getter_NodeReplacerTest_test_forStatement_withInitialization_3());
_assertReplace(node,
@@ -3607,11 +3587,10 @@
void test_forStatement_withVariables() {
ForStatement node = AstFactory.forStatement2(AstFactory
- .variableDeclarationList2(null, [
- AstFactory.variableDeclaration("i")
- ]), AstFactory.booleanLiteral(true), [
- AstFactory.integer(0)
- ], AstFactory.block());
+ .variableDeclarationList2(
+ null, [AstFactory.variableDeclaration("i")]),
+ AstFactory.booleanLiteral(true), [AstFactory.integer(0)],
+ AstFactory.block());
_assertReplace(
node, new Getter_NodeReplacerTest_test_forStatement_withVariables_2());
_assertReplace(
@@ -3685,9 +3664,8 @@
void test_functionTypedFormalParameter() {
FunctionTypedFormalParameter node = AstFactory.functionTypedFormalParameter(
- AstFactory.typeName4("R"), "f", [
- AstFactory.simpleFormalParameter3("p")
- ]);
+ AstFactory.typeName4("R"), "f",
+ [AstFactory.simpleFormalParameter3("p")]);
node.documentationComment =
Comment.createEndOfLineComment(EMPTY_TOKEN_LIST);
node.metadata = [AstFactory.annotation(AstFactory.identifier3("a"))];
@@ -3790,18 +3768,16 @@
void test_listLiteral() {
ListLiteral node = AstFactory.listLiteral2(null,
- AstFactory.typeArgumentList([AstFactory.typeName4("E")]), [
- AstFactory.identifier3("e")
- ]);
+ AstFactory.typeArgumentList([AstFactory.typeName4("E")]),
+ [AstFactory.identifier3("e")]);
_assertReplace(node, new ListGetter_NodeReplacerTest_test_listLiteral(0));
_testTypedLiteral(node);
}
void test_mapLiteral() {
MapLiteral node = AstFactory.mapLiteral(null,
- AstFactory.typeArgumentList([AstFactory.typeName4("E")]), [
- AstFactory.mapLiteralEntry("k", AstFactory.identifier3("v"))
- ]);
+ AstFactory.typeArgumentList([AstFactory.typeName4("E")]),
+ [AstFactory.mapLiteralEntry("k", AstFactory.identifier3("v"))]);
_assertReplace(node, new ListGetter_NodeReplacerTest_test_mapLiteral(0));
_testTypedLiteral(node);
}
@@ -3970,9 +3946,8 @@
void test_switchStatement() {
SwitchStatement node = AstFactory.switchStatement(
AstFactory.identifier3("x"), [
- AstFactory.switchCase2([AstFactory.label2("l")], AstFactory.integer(0), [
- AstFactory.block()
- ]),
+ AstFactory.switchCase2([AstFactory.label2("l")], AstFactory.integer(0),
+ [AstFactory.block()]),
AstFactory.switchDefault([AstFactory.label2("l")], [AstFactory.block()])
]);
_assertReplace(node, new Getter_NodeReplacerTest_test_switchStatement());
@@ -3998,9 +3973,9 @@
}
void test_tryStatement() {
- TryStatement node = AstFactory.tryStatement3(AstFactory.block(), [
- AstFactory.catchClause("e", [AstFactory.block()])
- ], AstFactory.block());
+ TryStatement node = AstFactory.tryStatement3(AstFactory.block(),
+ [AstFactory.catchClause("e", [AstFactory.block()])],
+ AstFactory.block());
_assertReplace(node, new Getter_NodeReplacerTest_test_tryStatement_2());
_assertReplace(node, new Getter_NodeReplacerTest_test_tryStatement());
_assertReplace(node, new ListGetter_NodeReplacerTest_test_tryStatement(0));
diff --git a/pkg/analyzer/test/options_test.dart b/pkg/analyzer/test/options_test.dart
deleted file mode 100644
index 006fd6b..0000000
--- a/pkg/analyzer/test/options_test.dart
+++ /dev/null
@@ -1,168 +0,0 @@
-// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-library options_test;
-
-import 'package:analyzer/options.dart';
-import 'package:args/args.dart';
-import 'package:unittest/unittest.dart';
-
-import 'reflective_tests.dart';
-
-main() {
- group('AnalyzerOptions.parse()', () {
- test('defaults', () {
- CommandLineOptions options =
- CommandLineOptions.parse(['--dart-sdk', '.', 'foo.dart']);
- expect(options, isNotNull);
- expect(options.dartSdkPath, isNotNull);
- expect(options.disableHints, isFalse);
- expect(options.displayVersion, isFalse);
- expect(options.enableStrictCallChecks, isFalse);
- expect(options.enableTypeChecks, isFalse);
- expect(options.ignoreUnrecognizedFlags, isFalse);
- expect(options.log, isFalse);
- expect(options.machineFormat, isFalse);
- expect(options.packageRootPath, isNull);
- expect(options.perf, isFalse);
- expect(options.shouldBatch, isFalse);
- expect(options.showPackageWarnings, isFalse);
- expect(options.showSdkWarnings, isFalse);
- expect(options.sourceFiles, equals(['foo.dart']));
- expect(options.warmPerf, isFalse);
- expect(options.warningsAreFatal, isFalse);
- expect(options.customUrlMappings, isNotNull);
- expect(options.customUrlMappings.isEmpty, isTrue);
- });
-
- test('batch', () {
- CommandLineOptions options =
- CommandLineOptions.parse(['--dart-sdk', '.', '--batch']);
- expect(options.shouldBatch, isTrue);
- });
-
- test('defined variables', () {
- CommandLineOptions options = CommandLineOptions
- .parse(['--dart-sdk', '.', '-Dfoo=bar', 'foo.dart']);
- expect(options.definedVariables['foo'], equals('bar'));
- expect(options.definedVariables['bar'], isNull);
- });
-
- test('enable strict call checks', () {
- CommandLineOptions options = CommandLineOptions.parse(
- ['--dart-sdk', '.', '--enable-strict-call-checks', 'foo.dart']);
- expect(options.enableStrictCallChecks, isTrue);
- });
-
- test('enable type checks', () {
- CommandLineOptions options = CommandLineOptions
- .parse(['--dart-sdk', '.', '--enable_type_checks', 'foo.dart']);
- expect(options.enableTypeChecks, isTrue);
- });
-
- test('log', () {
- CommandLineOptions options =
- CommandLineOptions.parse(['--dart-sdk', '.', '--log', 'foo.dart']);
- expect(options.log, isTrue);
- });
-
- test('machine format', () {
- CommandLineOptions options = CommandLineOptions
- .parse(['--dart-sdk', '.', '--format=machine', 'foo.dart']);
- expect(options.machineFormat, isTrue);
- });
-
- test('no-hints', () {
- CommandLineOptions options = CommandLineOptions
- .parse(['--dart-sdk', '.', '--no-hints', 'foo.dart']);
- expect(options.disableHints, isTrue);
- });
-
- test('package root', () {
- CommandLineOptions options = CommandLineOptions
- .parse(['--dart-sdk', '.', '-p', 'bar', 'foo.dart']);
- expect(options.packageRootPath, equals('bar'));
- });
-
- test('package warnings', () {
- CommandLineOptions options = CommandLineOptions
- .parse(['--dart-sdk', '.', '--package-warnings', 'foo.dart']);
- expect(options.showPackageWarnings, isTrue);
- });
-
- test('perf', () {
- CommandLineOptions options =
- CommandLineOptions.parse(['--dart-sdk', '.', '--perf', 'foo.dart']);
- expect(options.perf, isTrue);
- });
-
- test('sdk warnings', () {
- CommandLineOptions options = CommandLineOptions
- .parse(['--dart-sdk', '.', '--warnings', 'foo.dart']);
- expect(options.showSdkWarnings, isTrue);
- });
-
- test('sourceFiles', () {
- CommandLineOptions options = CommandLineOptions.parse(
- ['--dart-sdk', '.', '--log', 'foo.dart', 'foo2.dart', 'foo3.dart']);
- expect(
- options.sourceFiles, equals(['foo.dart', 'foo2.dart', 'foo3.dart']));
- });
-
- test('warningsAreFatal', () {
- CommandLineOptions options = CommandLineOptions
- .parse(['--dart-sdk', '.', '--fatal-warnings', 'foo.dart']);
- expect(options.warningsAreFatal, isTrue);
- });
-
- test('customUrlMappings', () {
- CommandLineOptions options = CommandLineOptions.parse([
- '--dart-sdk',
- '.',
- '--url-mapping',
- 'dart:dummy,/path/to/dummy.dart',
- 'foo.dart'
- ]);
- expect(options.customUrlMappings, isNotNull);
- expect(options.customUrlMappings.isEmpty, isFalse);
- expect(options.customUrlMappings['dart:dummy'],
- equals('/path/to/dummy.dart'));
- });
-
-// test('notice unrecognized flags', () {
-// CommandLineOptions options = CommandLineOptions.parse(['--bar', '--baz',
-// 'foo.dart']);
-// expect(options, isNull);
-// });
-
- test('ignore unrecognized flags', () {
- CommandLineOptions options = CommandLineOptions.parse([
- '--ignore-unrecognized-flags',
- '--bar',
- '--baz',
- '--dart-sdk',
- '.',
- 'foo.dart'
- ]);
- expect(options, isNotNull);
- expect(options.sourceFiles, equals(['foo.dart']));
- });
- });
-
- runReflectiveTests(CommandLineParserTest);
-}
-
-@reflectiveTest
-class CommandLineParserTest {
- test_ignoreUnrecognizedOptions() {
- CommandLineParser parser =
- new CommandLineParser(alwaysIgnoreUnrecognized: true);
- parser.addOption('optionA');
- parser.addFlag('flagA');
- ArgResults argResults =
- parser.parse(['--optionA=1', '--optionB=2', '--flagA'], {});
- expect(argResults['optionA'], '1');
- expect(argResults['flagA'], isTrue);
- }
-}
diff --git a/pkg/analyzer/test/parse_compilation_unit_test.dart b/pkg/analyzer/test/parse_compilation_unit_test.dart
index bbc05c4..0e2d3de 100644
--- a/pkg/analyzer/test/parse_compilation_unit_test.dart
+++ b/pkg/analyzer/test/parse_compilation_unit_test.dart
@@ -33,4 +33,10 @@
.contains("Error in <unknown source>: Expected to find ';'");
})));
});
+
+ test("allows you to specify whether or not to parse function bodies", () {
+ var unit = parseCompilationUnit("void main() => print('Hello, world!');",
+ parseFunctionBodies: false);
+ expect(unit.toString(), equals("void main() ;"));
+ });
}
diff --git a/pkg/analyzer/test/plugin/plugin_impl_test.dart b/pkg/analyzer/test/plugin/plugin_impl_test.dart
deleted file mode 100644
index 12d6d04..0000000
--- a/pkg/analyzer/test/plugin/plugin_impl_test.dart
+++ /dev/null
@@ -1,174 +0,0 @@
-// Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-library test.operation;
-
-import 'package:analyzer/plugin/plugin.dart';
-import 'package:analyzer/src/plugin/plugin_impl.dart';
-import 'package:unittest/unittest.dart';
-
-main() {
- groupSep = ' | ';
-
- group('ExtensionManager', () {
- test('processPlugins', () {
- TestPlugin plugin1 = new TestPlugin('plugin1');
- TestPlugin plugin2 = new TestPlugin('plugin1');
- ExtensionManager manager = new ExtensionManager();
- manager.processPlugins([plugin1, plugin2]);
- expect(plugin1.extensionPointsRegistered, true);
- expect(plugin1.extensionsRegistered, true);
- expect(plugin2.extensionPointsRegistered, true);
- expect(plugin2.extensionsRegistered, true);
- });
-
- test('registerExtension - valid', () {
- Plugin plugin = new TestPlugin('plugin');
- ExtensionManager manager = new ExtensionManager();
- ExtensionPoint point =
- manager.registerExtensionPoint(plugin, 'point', null);
- expect(point, isNotNull);
- Object extension = 'extension';
- manager.registerExtension('plugin.point', extension);
- List<Object> extensions = point.extensions;
- expect(extensions, isNotNull);
- expect(extensions, hasLength(1));
- expect(extensions[0], extension);
- });
-
- test('registerExtension - non existent', () {
- ExtensionManager manager = new ExtensionManager();
- expect(() => manager.registerExtension('does not exist', 'extension'),
- throwsA(new isInstanceOf<ExtensionError>()));
- ;
- });
-
- test('registerExtensionPoint - non-conflicting', () {
- Plugin plugin1 = new TestPlugin('plugin1');
- Plugin plugin2 = new TestPlugin('plugin2');
- ExtensionManager manager = new ExtensionManager();
- expect(
- manager.registerExtensionPoint(plugin1, 'point1', null), isNotNull);
- expect(
- manager.registerExtensionPoint(plugin1, 'point2', null), isNotNull);
- expect(
- manager.registerExtensionPoint(plugin2, 'point1', null), isNotNull);
- expect(
- manager.registerExtensionPoint(plugin2, 'point2', null), isNotNull);
- });
-
- test('registerExtensionPoint - conflicting - same plugin', () {
- Plugin plugin1 = new TestPlugin('plugin1');
- ExtensionManager manager = new ExtensionManager();
- expect(
- manager.registerExtensionPoint(plugin1, 'point1', null), isNotNull);
- expect(() => manager.registerExtensionPoint(plugin1, 'point1', null),
- throwsA(new isInstanceOf<ExtensionError>()));
- });
-
- test('registerExtensionPoint - conflicting - different plugins', () {
- Plugin plugin1 = new TestPlugin('plugin1');
- Plugin plugin2 = new TestPlugin('plugin1');
- ExtensionManager manager = new ExtensionManager();
- expect(
- manager.registerExtensionPoint(plugin1, 'point1', null), isNotNull);
- expect(() => manager.registerExtensionPoint(plugin2, 'point1', null),
- throwsA(new isInstanceOf<ExtensionError>()));
- });
- });
-
- group('ExtensionPointImpl', () {
- test('extensions - empty', () {
- Plugin plugin = new TestPlugin('plugin');
- ExtensionPointImpl point = new ExtensionPointImpl(plugin, 'point', null);
- List<Object> extensions = point.extensions;
- expect(extensions, isNotNull);
- expect(extensions, isEmpty);
- });
-
- test('uniqueIdentifier', () {
- Plugin plugin = new TestPlugin('plugin');
- ExtensionPointImpl point = new ExtensionPointImpl(plugin, 'point', null);
- expect(point.uniqueIdentifier, 'plugin.point');
- });
-
- test('add - single', () {
- Plugin plugin = new TestPlugin('plugin');
- ExtensionPointImpl point = new ExtensionPointImpl(plugin, 'point', null);
- Object extension = 'extension';
- point.add(extension);
- List<Object> extensions = point.extensions;
- expect(extensions, isNotNull);
- expect(extensions, hasLength(1));
- expect(extensions[0], extension);
- });
-
- test('add - multiple', () {
- Plugin plugin = new TestPlugin('plugin');
- ExtensionPointImpl point = new ExtensionPointImpl(plugin, 'point', null);
- point.add('extension 1');
- point.add('extension 2');
- point.add('extension 3');
- List<Object> extensions = point.extensions;
- expect(extensions, isNotNull);
- expect(extensions, hasLength(3));
- });
-
- test('add - with validator - valid', () {
- Plugin plugin = new TestPlugin('plugin');
- ExtensionPointImpl point = new ExtensionPointImpl(plugin, 'point',
- (Object extension) {
- if (extension is! String) {
- throw new ExtensionError('');
- }
- });
- point.add('extension');
- });
-
- test('add - with validator - invalid', () {
- Plugin plugin = new TestPlugin('plugin');
- ExtensionPointImpl point = new ExtensionPointImpl(plugin, 'point',
- (Object extension) {
- if (extension is! String) {
- throw new ExtensionError('');
- }
- });
- expect(() => point.add(1), throwsA(new isInstanceOf<ExtensionError>()));
- });
- });
-}
-
-/**
- * A simple plugin that can be used by tests.
- */
-class TestPlugin extends Plugin {
- /**
- * A flag indicating whether the method [registerExtensionPoints] has been
- * invoked.
- */
- bool extensionPointsRegistered = false;
-
- /**
- * A flag indicating whether the method [registerExtensions] has been invoked.
- */
- bool extensionsRegistered = false;
-
- @override
- String uniqueIdentifier;
-
- /**
- * Initialize a newly created plugin to have the given identifier.
- */
- TestPlugin(this.uniqueIdentifier);
-
- @override
- void registerExtensionPoints(RegisterExtensionPoint register) {
- extensionPointsRegistered = true;
- }
-
- @override
- void registerExtensions(RegisterExtension register) {
- extensionsRegistered = true;
- }
-}
diff --git a/pkg/analyzer/test/plugin/test_all.dart b/pkg/analyzer/test/plugin/test_all.dart
deleted file mode 100644
index e8b0ce3..0000000
--- a/pkg/analyzer/test/plugin/test_all.dart
+++ /dev/null
@@ -1,19 +0,0 @@
-// Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-library test.plugin.all;
-
-import 'package:unittest/unittest.dart';
-
-import 'plugin_impl_test.dart' as plugin_impl;
-
-/**
- * Utility for manually running all tests.
- */
-main() {
- groupSep = ' | ';
- group('plugins', () {
- plugin_impl.main();
- });
-}
diff --git a/pkg/analyzer/test/src/context/abstract_context.dart b/pkg/analyzer/test/src/context/abstract_context.dart
new file mode 100644
index 0000000..45925cd
--- /dev/null
+++ b/pkg/analyzer/test/src/context/abstract_context.dart
@@ -0,0 +1,99 @@
+// Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+library test.src.task.abstract_context_test;
+
+import 'package:analyzer/file_system/file_system.dart';
+import 'package:analyzer/file_system/memory_file_system.dart';
+import 'package:analyzer/src/context/context.dart';
+import 'package:analyzer/src/generated/element.dart';
+import 'package:analyzer/src/generated/engine.dart'
+ hide AnalysisContextImpl, AnalysisTask;
+import 'package:analyzer/src/generated/sdk.dart';
+import 'package:analyzer/src/generated/source.dart';
+import 'package:analyzer/src/plugin/engine_plugin.dart';
+import 'package:analyzer/src/task/driver.dart';
+import 'package:analyzer/src/task/manager.dart';
+import 'package:plugin/manager.dart';
+import 'package:unittest/unittest.dart';
+
+import 'mock_sdk.dart';
+
+class AbstractContextTest {
+ MemoryResourceProvider resourceProvider = new MemoryResourceProvider();
+
+ ExtensionManager extensionManager = new ExtensionManager();
+
+ DartSdk sdk = new MockSdk();
+ AnalysisContextImpl context;
+
+ TaskManager taskManager = new TaskManager();
+ AnalysisDriver analysisDriver;
+
+ /**
+ * Assert that the given [elements] has the same number of items as the number
+ * of specified [names], and that for each specified name, a corresponding
+ * element can be found in the given collection with that name.
+ */
+ void assertNamedElements(List<Element> elements, List<String> names) {
+ for (String elemName in names) {
+ bool found = false;
+ for (Element elem in elements) {
+ if (elem.name == elemName) {
+ found = true;
+ break;
+ }
+ }
+ if (!found) {
+ StringBuffer buffer = new StringBuffer();
+ buffer.write("Expected element named: ");
+ buffer.write(elemName);
+ buffer.write("\n but found: ");
+ for (Element elem in elements) {
+ buffer.write(elem.name);
+ buffer.write(", ");
+ }
+ fail(buffer.toString());
+ }
+ }
+ expect(elements, hasLength(names.length));
+ }
+
+ AnalysisContextImpl createAnalysisContext() {
+ return new AnalysisContextImpl();
+ }
+
+ Source newSource(String path, [String content = '']) {
+ File file = resourceProvider.newFile(path, content);
+ return file.createSource();
+ }
+
+ List<Source> newSources(Map<String, String> sourceMap) {
+ List<Source> sources = <Source>[];
+ sourceMap.forEach((String path, String content) {
+ Source source = newSource(path, content);
+ sources.add(source);
+ });
+ return sources;
+ }
+
+ void setUp() {
+ // configure TaskManager
+ {
+ EnginePlugin plugin = AnalysisEngine.instance.enginePlugin;
+ extensionManager.processPlugins([plugin]);
+ taskManager.addTaskDescriptors(plugin.taskDescriptors);
+ }
+ // prepare AnalysisContext
+ context = createAnalysisContext();
+ context.sourceFactory = new SourceFactory(<UriResolver>[
+ new DartUriResolver(sdk),
+ new ResourceUriResolver(resourceProvider)
+ ]);
+ // prepare AnalysisDriver
+ analysisDriver = new AnalysisDriver(taskManager, context);
+ }
+
+ void tearDown() {}
+}
diff --git a/pkg/analyzer/test/src/context/cache_test.dart b/pkg/analyzer/test/src/context/cache_test.dart
index 2be2125..b417269 100644
--- a/pkg/analyzer/test/src/context/cache_test.dart
+++ b/pkg/analyzer/test/src/context/cache_test.dart
@@ -28,15 +28,15 @@
runReflectiveTests(ResultDataTest);
}
+AnalysisCache createCache({AnalysisContext context,
+ RetentionPriority policy: RetentionPriority.LOW}) {
+ CachePartition partition = new UniversalCachePartition(
+ context, 8, new TestCacheRetentionPolicy(policy));
+ return new AnalysisCache(<CachePartition>[partition]);
+}
+
@reflectiveTest
class AnalysisCacheTest extends EngineTestCase {
- AnalysisCache createCache({AnalysisContext context,
- RetentionPriority policy: RetentionPriority.LOW}) {
- CachePartition partition = new UniversalCachePartition(
- context, 8, new TestCacheRetentionPolicy(policy));
- return new AnalysisCache(<CachePartition>[partition]);
- }
-
void test_astSize_empty() {
AnalysisCache cache = createCache();
expect(cache.astSize, 0);
@@ -48,10 +48,10 @@
AnalysisCache cache = createCache();
AnalysisTarget target1 = new TestSource('/test1.dart');
CacheEntry entry1 = new CacheEntry();
- entry1.setValue(result, node);
+ entry1.setValue(result, node, TargetedResult.EMPTY_LIST, null);
AnalysisTarget target2 = new TestSource('/test2.dart');
CacheEntry entry2 = new CacheEntry();
- entry2.setValue(result, node);
+ entry2.setValue(result, node, TargetedResult.EMPTY_LIST, null);
cache.put(target1, entry1);
cache.accessedAst(target1);
cache.put(target2, entry2);
@@ -113,7 +113,7 @@
for (int i = 0; i < size; i++) {
AnalysisTarget target = new TestSource("/test$i.dart");
CacheEntry entry = new CacheEntry();
- entry.setValue(result, node);
+ entry.setValue(result, node, TargetedResult.EMPTY_LIST, null);
cache.put(target, entry);
cache.accessedAst(target);
}
@@ -172,7 +172,7 @@
CaughtException exception = new CaughtException(null, null);
entry.setErrorState(exception, <ResultDescriptor>[result]);
// set the same result to VALID
- entry.setValue(result, 1);
+ entry.setValue(result, 1, TargetedResult.EMPTY_LIST, null);
// fix the exception state
entry.fixExceptionState();
expect(entry.exception, isNull);
@@ -189,7 +189,8 @@
test_flushAstStructures() {
ResultDescriptor result = new ResultDescriptor('test', null);
CacheEntry entry = new CacheEntry();
- entry.setValue(result, new NullLiteral(null));
+ entry.setValue(
+ result, new NullLiteral(null), TargetedResult.EMPTY_LIST, null);
expect(entry.hasAstStructure, true);
entry.flushAstStructures();
expect(entry.hasAstStructure, false);
@@ -208,6 +209,13 @@
expect(entry.getValue(result), defaultValue);
}
+ test_getMemento_noResult() {
+ String defaultValue = 'value';
+ ResultDescriptor result = new ResultDescriptor('test', defaultValue);
+ CacheEntry entry = new CacheEntry();
+ expect(entry.getMemento(result), null);
+ }
+
test_hasAstStructure_false() {
CacheEntry entry = new CacheEntry();
expect(entry.hasAstStructure, false);
@@ -216,7 +224,8 @@
test_hasAstStructure_true() {
ResultDescriptor result = new ResultDescriptor('test', null);
CacheEntry entry = new CacheEntry();
- entry.setValue(result, new NullLiteral(null));
+ entry.setValue(
+ result, new NullLiteral(null), TargetedResult.EMPTY_LIST, null);
expect(entry.hasAstStructure, true);
}
@@ -236,7 +245,7 @@
test_invalidateAllInformation() {
ResultDescriptor result = new ResultDescriptor('test', null);
CacheEntry entry = new CacheEntry();
- entry.setValue(result, 'value');
+ entry.setValue(result, 'value', TargetedResult.EMPTY_LIST, null);
entry.invalidateAllInformation();
expect(entry.getState(result), CacheState.INVALID);
expect(entry.getValue(result), isNull);
@@ -248,9 +257,9 @@
ResultDescriptor result3 = new ResultDescriptor('res3', 3);
// prepare some good state
CacheEntry entry = new CacheEntry();
- entry.setValue(result1, 10);
- entry.setValue(result2, 20);
- entry.setValue(result3, 30);
+ entry.setValue(result1, 10, TargetedResult.EMPTY_LIST, null);
+ entry.setValue(result2, 20, TargetedResult.EMPTY_LIST, null);
+ entry.setValue(result3, 30, TargetedResult.EMPTY_LIST, null);
// set error state
CaughtException exception = new CaughtException(null, null);
entry.setErrorState(exception, <ResultDescriptor>[result1, result2]);
@@ -264,6 +273,42 @@
expect(entry.getValue(result3), 30);
}
+ test_setErrorState_invalidateDependent() {
+ AnalysisCache cache = createCache();
+ AnalysisTarget target = new TestSource();
+ CacheEntry entry = new CacheEntry();
+ cache.put(target, entry);
+ ResultDescriptor result1 = new ResultDescriptor('result1', -1);
+ ResultDescriptor result2 = new ResultDescriptor('result2', -2);
+ ResultDescriptor result3 = new ResultDescriptor('result3', -3);
+ ResultDescriptor result4 = new ResultDescriptor('result4', -4);
+ // set results, all of them are VALID
+ entry.setValue(result1, 111, TargetedResult.EMPTY_LIST, null);
+ entry.setValue(result2, 222, [new TargetedResult(target, result1)], null);
+ entry.setValue(result3, 333, [new TargetedResult(target, result2)], null);
+ entry.setValue(result4, 444, [], null);
+ expect(entry.getState(result1), CacheState.VALID);
+ expect(entry.getState(result2), CacheState.VALID);
+ expect(entry.getState(result3), CacheState.VALID);
+ expect(entry.getState(result4), CacheState.VALID);
+ expect(entry.getValue(result1), 111);
+ expect(entry.getValue(result2), 222);
+ expect(entry.getValue(result3), 333);
+ expect(entry.getValue(result4), 444);
+ // set error state
+ CaughtException exception = new CaughtException(null, null);
+ entry.setErrorState(exception, <ResultDescriptor>[result1]);
+ // result2 and result3 are invalidated, result4 is intact
+ expect(entry.getState(result1), CacheState.ERROR);
+ expect(entry.getState(result2), CacheState.ERROR);
+ expect(entry.getState(result3), CacheState.ERROR);
+ expect(entry.getState(result4), CacheState.VALID);
+ expect(entry.getValue(result1), -1);
+ expect(entry.getValue(result2), -2);
+ expect(entry.getValue(result3), -3);
+ expect(entry.getValue(result4), 444);
+ }
+
test_setErrorState_noDescriptors() {
CaughtException exception = new CaughtException(null, null);
CacheEntry entry = new CacheEntry();
@@ -291,7 +336,7 @@
test_setState_error() {
ResultDescriptor result = new ResultDescriptor('test', null);
CacheEntry entry = new CacheEntry();
- entry.setValue(result, 42);
+ entry.setValue(result, 42, TargetedResult.EMPTY_LIST, null);
// an invalid state change
expect(() {
entry.setState(result, CacheState.ERROR);
@@ -305,7 +350,7 @@
ResultDescriptor result = new ResultDescriptor('test', 1);
CacheEntry entry = new CacheEntry();
// set VALID
- entry.setValue(result, 10);
+ entry.setValue(result, 10, TargetedResult.EMPTY_LIST, null);
expect(entry.getState(result), CacheState.VALID);
expect(entry.getValue(result), 10);
// set FLUSHED
@@ -318,7 +363,7 @@
ResultDescriptor result = new ResultDescriptor('test', 1);
CacheEntry entry = new CacheEntry();
// set VALID
- entry.setValue(result, 10);
+ entry.setValue(result, 10, TargetedResult.EMPTY_LIST, null);
expect(entry.getState(result), CacheState.VALID);
expect(entry.getValue(result), 10);
// set IN_PROCESS
@@ -331,13 +376,49 @@
ResultDescriptor result = new ResultDescriptor('test', 1);
CacheEntry entry = new CacheEntry();
// set VALID
- entry.setValue(result, 10);
+ String memento = 'main() {}';
+ entry.setValue(result, 10, TargetedResult.EMPTY_LIST, memento);
expect(entry.getState(result), CacheState.VALID);
expect(entry.getValue(result), 10);
// set INVALID
entry.setState(result, CacheState.INVALID);
expect(entry.getState(result), CacheState.INVALID);
expect(entry.getValue(result), 1);
+ expect(entry.getMemento(result), memento);
+ }
+
+ test_setState_invalid_invalidateDependent() {
+ AnalysisCache cache = createCache();
+ AnalysisTarget target = new TestSource();
+ CacheEntry entry = new CacheEntry();
+ cache.put(target, entry);
+ ResultDescriptor result1 = new ResultDescriptor('result1', -1);
+ ResultDescriptor result2 = new ResultDescriptor('result2', -2);
+ ResultDescriptor result3 = new ResultDescriptor('result3', -3);
+ ResultDescriptor result4 = new ResultDescriptor('result4', -4);
+ // set results, all of them are VALID
+ entry.setValue(result1, 111, TargetedResult.EMPTY_LIST, null);
+ entry.setValue(result2, 222, [new TargetedResult(target, result1)], null);
+ entry.setValue(result3, 333, [new TargetedResult(target, result2)], null);
+ entry.setValue(result4, 444, [], null);
+ expect(entry.getState(result1), CacheState.VALID);
+ expect(entry.getState(result2), CacheState.VALID);
+ expect(entry.getState(result3), CacheState.VALID);
+ expect(entry.getState(result4), CacheState.VALID);
+ expect(entry.getValue(result1), 111);
+ expect(entry.getValue(result2), 222);
+ expect(entry.getValue(result3), 333);
+ expect(entry.getValue(result4), 444);
+ // invalidate result1, invalidates result2 and result3, result4 is intact
+ entry.setState(result1, CacheState.INVALID);
+ expect(entry.getState(result1), CacheState.INVALID);
+ expect(entry.getState(result2), CacheState.INVALID);
+ expect(entry.getState(result3), CacheState.INVALID);
+ expect(entry.getState(result4), CacheState.VALID);
+ expect(entry.getValue(result1), -1);
+ expect(entry.getValue(result2), -2);
+ expect(entry.getValue(result3), -3);
+ expect(entry.getValue(result4), 444);
}
test_setState_valid() {
@@ -347,12 +428,79 @@
}
test_setValue() {
- String value = 'value';
ResultDescriptor result = new ResultDescriptor('test', null);
+ String value = 'value';
+ String memento = 'main() {}';
CacheEntry entry = new CacheEntry();
- entry.setValue(result, value);
+ entry.setValue(result, value, TargetedResult.EMPTY_LIST, memento);
expect(entry.getState(result), CacheState.VALID);
expect(entry.getValue(result), value);
+ expect(entry.getMemento(result), memento);
+ }
+
+ test_setValue_invalidateDependent() {
+ AnalysisCache cache = createCache();
+ AnalysisTarget target = new TestSource();
+ CacheEntry entry = new CacheEntry();
+ cache.put(target, entry);
+ ResultDescriptor result1 = new ResultDescriptor('result1', -1);
+ ResultDescriptor result2 = new ResultDescriptor('result2', -2);
+ ResultDescriptor result3 = new ResultDescriptor('result3', -3);
+ ResultDescriptor result4 = new ResultDescriptor('result4', -4);
+ // set results, all of them are VALID
+ entry.setValue(result1, 111, TargetedResult.EMPTY_LIST, null);
+ entry.setValue(result2, 222, [new TargetedResult(target, result1)], null);
+ entry.setValue(result3, 333, [new TargetedResult(target, result2)], null);
+ entry.setValue(result4, 444, [], null);
+ expect(entry.getState(result1), CacheState.VALID);
+ expect(entry.getState(result2), CacheState.VALID);
+ expect(entry.getState(result3), CacheState.VALID);
+ expect(entry.getState(result4), CacheState.VALID);
+ expect(entry.getValue(result1), 111);
+ expect(entry.getValue(result2), 222);
+ expect(entry.getValue(result3), 333);
+ expect(entry.getValue(result4), 444);
+ // set result1, invalidates result2 and result3, result4 is intact
+ entry.setValue(result1, 1111, TargetedResult.EMPTY_LIST, null);
+ expect(entry.getState(result1), CacheState.VALID);
+ expect(entry.getState(result2), CacheState.INVALID);
+ expect(entry.getState(result3), CacheState.INVALID);
+ expect(entry.getState(result4), CacheState.VALID);
+ expect(entry.getValue(result1), 1111);
+ expect(entry.getValue(result2), -2);
+ expect(entry.getValue(result3), -3);
+ expect(entry.getValue(result4), 444);
+ }
+
+ test_setValue_invalidateDependent2() {
+ AnalysisCache cache = createCache();
+ AnalysisTarget target1 = new TestSource('a');
+ AnalysisTarget target2 = new TestSource('b');
+ CacheEntry entry1 = new CacheEntry();
+ CacheEntry entry2 = new CacheEntry();
+ cache.put(target1, entry1);
+ cache.put(target2, entry2);
+ ResultDescriptor result1 = new ResultDescriptor('result1', -1);
+ ResultDescriptor result2 = new ResultDescriptor('result2', -2);
+ ResultDescriptor result3 = new ResultDescriptor('result3', -3);
+ // set results, all of them are VALID
+ entry1.setValue(result1, 111, TargetedResult.EMPTY_LIST, null);
+ entry1.setValue(result2, 222, [new TargetedResult(target1, result1)], null);
+ entry2.setValue(result3, 333, [new TargetedResult(target1, result2)], null);
+ expect(entry1.getState(result1), CacheState.VALID);
+ expect(entry1.getState(result2), CacheState.VALID);
+ expect(entry2.getState(result3), CacheState.VALID);
+ expect(entry1.getValue(result1), 111);
+ expect(entry1.getValue(result2), 222);
+ expect(entry2.getValue(result3), 333);
+ // set result1, invalidates result2 and result3
+ entry1.setValue(result1, 1111, TargetedResult.EMPTY_LIST, null);
+ expect(entry1.getState(result1), CacheState.VALID);
+ expect(entry1.getState(result2), CacheState.INVALID);
+ expect(entry2.getState(result3), CacheState.INVALID);
+ expect(entry1.getValue(result1), 1111);
+ expect(entry1.getValue(result2), -2);
+ expect(entry2.getValue(result3), -3);
}
test_toString_empty() {
@@ -364,7 +512,7 @@
String value = 'value';
ResultDescriptor result = new ResultDescriptor('test', null);
CacheEntry entry = new CacheEntry();
- entry.setValue(result, value);
+ entry.setValue(result, value, TargetedResult.EMPTY_LIST, null);
expect(entry.toString(), isNotNull);
}
}
@@ -421,7 +569,7 @@
for (int i = 0; i < size; i++) {
AnalysisTarget target = new TestSource("/test$i.dart");
CacheEntry entry = new CacheEntry();
- entry.setValue(result, node);
+ entry.setValue(result, node, TargetedResult.EMPTY_LIST, null);
partition.put(target, entry);
partition.accessedAst(target);
}
diff --git a/pkg/analyzer/test/src/context/context_test.dart b/pkg/analyzer/test/src/context/context_test.dart
new file mode 100644
index 0000000..92d552f
--- /dev/null
+++ b/pkg/analyzer/test/src/context/context_test.dart
@@ -0,0 +1,2534 @@
+// Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+library test.src.context.context_test;
+
+import 'dart:async';
+import 'dart:collection';
+
+import 'package:analyzer/src/cancelable_future.dart';
+import 'package:analyzer/src/context/cache.dart';
+import 'package:analyzer/src/context/context.dart';
+import 'package:analyzer/src/generated/ast.dart';
+import 'package:analyzer/src/generated/element.dart';
+import 'package:analyzer/src/generated/engine.dart'
+ show
+ AnalysisContext,
+ AnalysisContextStatistics,
+ AnalysisDelta,
+ AnalysisEngine,
+ AnalysisErrorInfo,
+ AnalysisLevel,
+ AnalysisNotScheduledError,
+ AnalysisOptions,
+ AnalysisOptionsImpl,
+ AnalysisResult,
+ ChangeNotice,
+ ChangeSet,
+ IncrementalAnalysisCache,
+ TimestampedData;
+import 'package:analyzer/src/generated/error.dart';
+import 'package:analyzer/src/generated/html.dart' as ht;
+import 'package:analyzer/src/generated/java_engine.dart';
+import 'package:analyzer/src/generated/java_engine_io.dart';
+import 'package:analyzer/src/generated/resolver.dart';
+import 'package:analyzer/src/generated/scanner.dart';
+import 'package:analyzer/src/generated/sdk.dart';
+import 'package:analyzer/src/generated/sdk_io.dart';
+import 'package:analyzer/src/generated/source.dart';
+import 'package:analyzer/src/generated/source_io.dart';
+import 'package:analyzer/src/generated/testing/ast_factory.dart';
+import 'package:analyzer/src/generated/testing/element_factory.dart';
+import 'package:analyzer/src/generated/testing/test_type_provider.dart';
+import 'package:analyzer/src/generated/utilities_dart.dart';
+import 'package:analyzer/src/plugin/engine_plugin.dart';
+import 'package:analyzer/task/dart.dart';
+import 'package:plugin/manager.dart';
+import 'package:unittest/unittest.dart';
+import 'package:watcher/src/utils.dart';
+
+import '../../generated/engine_test.dart';
+import '../../generated/test_support.dart';
+import '../../reflective_tests.dart';
+import '../mock_sdk.dart';
+
+main() {
+ groupSep = ' | ';
+ runReflectiveTests(AnalysisContextImplTest);
+}
+
+contextWithCore() {
+ return new AnalysisContextForTests();
+}
+
+/**
+ * An analysis context that has a fake SDK that is much smaller and faster for
+ * testing purposes.
+ */
+class AnalysisContextForTests extends AnalysisContextImpl {
+ AnalysisContextForTests() {
+ DartSdk sdk = new MockSdk();
+ SourceFactory sourceFactory =
+ new SourceFactory([new DartUriResolver(sdk), new FileUriResolver()]);
+ this.sourceFactory = sourceFactory;
+// initWithCore();
+ }
+
+ @override
+ void set analysisOptions(AnalysisOptions options) {
+ AnalysisOptions currentOptions = analysisOptions;
+ bool needsRecompute = currentOptions.analyzeFunctionBodiesPredicate !=
+ options.analyzeFunctionBodiesPredicate ||
+ currentOptions.generateImplicitErrors !=
+ options.generateImplicitErrors ||
+ currentOptions.generateSdkErrors != options.generateSdkErrors ||
+ currentOptions.dart2jsHint != options.dart2jsHint ||
+ (currentOptions.hint && !options.hint) ||
+ currentOptions.preserveComments != options.preserveComments ||
+ currentOptions.enableNullAwareOperators !=
+ options.enableNullAwareOperators ||
+ currentOptions.enableStrictCallChecks != options.enableStrictCallChecks;
+ if (needsRecompute) {
+ fail(
+ "Cannot set options that cause the sources to be reanalyzed in a test context");
+ }
+ super.analysisOptions = options;
+ }
+
+ @override
+ LibraryResolverFactory get libraryResolverFactory => null;
+
+ @override
+ bool exists(Source source) =>
+ super.exists(source) || sourceFactory.dartSdk.context.exists(source);
+
+ @override
+ TimestampedData<String> getContents(Source source) {
+ if (source.isInSystemLibrary) {
+ return sourceFactory.dartSdk.context.getContents(source);
+ }
+ return super.getContents(source);
+ }
+
+ @override
+ int getModificationStamp(Source source) {
+ if (source.isInSystemLibrary) {
+ return sourceFactory.dartSdk.context.getModificationStamp(source);
+ }
+ return super.getModificationStamp(source);
+ }
+
+ /**
+ * Initialize the given analysis context with a fake core library already resolved.
+ *
+ * @param context the context to be initialized (not `null`)
+ * @return the analysis context that was created
+ */
+ void initWithCore() {
+ AnalysisContext coreContext = sourceFactory.dartSdk.context;
+ //
+ // dart:core
+ //
+ TestTypeProvider provider = new TestTypeProvider();
+ typeProvider = provider;
+ CompilationUnitElementImpl coreUnit =
+ new CompilationUnitElementImpl("core.dart");
+ Source coreSource = sourceFactory.forUri(DartSdk.DART_CORE);
+ coreContext.setContents(coreSource, "");
+ coreUnit.source = coreSource;
+ ClassElementImpl proxyClassElement = ElementFactory.classElement2("_Proxy");
+ coreUnit.types = <ClassElement>[
+ provider.boolType.element,
+ provider.deprecatedType.element,
+ provider.doubleType.element,
+ provider.functionType.element,
+ provider.intType.element,
+ provider.iterableType.element,
+ provider.iteratorType.element,
+ provider.listType.element,
+ provider.mapType.element,
+ provider.nullType.element,
+ provider.numType.element,
+ provider.objectType.element,
+ proxyClassElement,
+ provider.stackTraceType.element,
+ provider.stringType.element,
+ provider.symbolType.element,
+ provider.typeType.element
+ ];
+ coreUnit.functions = <FunctionElement>[
+ ElementFactory.functionElement3("identical", provider.boolType.element,
+ <ClassElement>[
+ provider.objectType.element,
+ provider.objectType.element
+ ], null),
+ ElementFactory.functionElement3("print", VoidTypeImpl.instance.element,
+ <ClassElement>[provider.objectType.element], null)
+ ];
+ TopLevelVariableElement proxyTopLevelVariableElt = ElementFactory
+ .topLevelVariableElement3("proxy", true, false, proxyClassElement.type);
+ TopLevelVariableElement deprecatedTopLevelVariableElt = ElementFactory
+ .topLevelVariableElement3(
+ "deprecated", true, false, provider.deprecatedType);
+ coreUnit.accessors = <PropertyAccessorElement>[
+ proxyTopLevelVariableElt.getter,
+ deprecatedTopLevelVariableElt.getter
+ ];
+ coreUnit.topLevelVariables = <TopLevelVariableElement>[
+ proxyTopLevelVariableElt,
+ deprecatedTopLevelVariableElt
+ ];
+ LibraryElementImpl coreLibrary = new LibraryElementImpl.forNode(
+ coreContext, AstFactory.libraryIdentifier2(["dart", "core"]));
+ coreLibrary.definingCompilationUnit = coreUnit;
+ //
+ // dart:async
+ //
+ CompilationUnitElementImpl asyncUnit =
+ new CompilationUnitElementImpl("async.dart");
+ Source asyncSource = sourceFactory.forUri(DartSdk.DART_ASYNC);
+ coreContext.setContents(asyncSource, "");
+ asyncUnit.source = asyncSource;
+ // Future
+ ClassElementImpl futureElement =
+ ElementFactory.classElement2("Future", ["T"]);
+ InterfaceType futureType = futureElement.type;
+ // factory Future.value([value])
+ ConstructorElementImpl futureConstructor =
+ ElementFactory.constructorElement2(futureElement, "value");
+ futureConstructor.parameters = <ParameterElement>[
+ ElementFactory.positionalParameter2("value", provider.dynamicType)
+ ];
+ futureConstructor.factory = true;
+ (futureConstructor.type as FunctionTypeImpl).typeArguments =
+ futureElement.type.typeArguments;
+ futureElement.constructors = <ConstructorElement>[futureConstructor];
+ // Future then(onValue(T value), { Function onError });
+ List<ParameterElement> parameters = <ParameterElement>[
+ ElementFactory.requiredParameter2(
+ "value", futureElement.typeParameters[0].type)
+ ];
+ FunctionTypeAliasElementImpl aliasElement =
+ new FunctionTypeAliasElementImpl.forNode(null);
+ aliasElement.synthetic = true;
+ aliasElement.parameters = parameters;
+ aliasElement.returnType = provider.dynamicType;
+ aliasElement.enclosingElement = asyncUnit;
+ FunctionTypeImpl aliasType = new FunctionTypeImpl.con2(aliasElement);
+ aliasElement.shareTypeParameters(futureElement.typeParameters);
+ aliasType.typeArguments = futureElement.type.typeArguments;
+ MethodElement thenMethod = ElementFactory.methodElementWithParameters(
+ "then", futureElement.type.typeArguments, futureType, [
+ ElementFactory.requiredParameter2("onValue", aliasType),
+ ElementFactory.namedParameter2("onError", provider.functionType)
+ ]);
+ futureElement.methods = <MethodElement>[thenMethod];
+ // Completer
+ ClassElementImpl completerElement =
+ ElementFactory.classElement2("Completer", ["T"]);
+ ConstructorElementImpl completerConstructor =
+ ElementFactory.constructorElement2(completerElement, null);
+ (completerConstructor.type as FunctionTypeImpl).typeArguments =
+ completerElement.type.typeArguments;
+ completerElement.constructors = <ConstructorElement>[completerConstructor];
+ asyncUnit.types = <ClassElement>[
+ completerElement,
+ futureElement,
+ ElementFactory.classElement2("Stream", ["T"])
+ ];
+ LibraryElementImpl asyncLibrary = new LibraryElementImpl.forNode(
+ coreContext, AstFactory.libraryIdentifier2(["dart", "async"]));
+ asyncLibrary.definingCompilationUnit = asyncUnit;
+ //
+ // dart:html
+ //
+ CompilationUnitElementImpl htmlUnit =
+ new CompilationUnitElementImpl("html_dartium.dart");
+ Source htmlSource = sourceFactory.forUri(DartSdk.DART_HTML);
+ coreContext.setContents(htmlSource, "");
+ htmlUnit.source = htmlSource;
+ ClassElementImpl elementElement = ElementFactory.classElement2("Element");
+ InterfaceType elementType = elementElement.type;
+ ClassElementImpl canvasElement =
+ ElementFactory.classElement("CanvasElement", elementType);
+ ClassElementImpl contextElement =
+ ElementFactory.classElement2("CanvasRenderingContext");
+ InterfaceType contextElementType = contextElement.type;
+ ClassElementImpl context2dElement = ElementFactory.classElement(
+ "CanvasRenderingContext2D", contextElementType);
+ canvasElement.methods = <MethodElement>[
+ ElementFactory.methodElement(
+ "getContext", contextElementType, [provider.stringType])
+ ];
+ canvasElement.accessors = <PropertyAccessorElement>[
+ ElementFactory.getterElement("context2D", false, context2dElement.type)
+ ];
+ canvasElement.fields = canvasElement.accessors
+ .map((PropertyAccessorElement accessor) => accessor.variable)
+ .toList();
+ ClassElementImpl documentElement =
+ ElementFactory.classElement("Document", elementType);
+ ClassElementImpl htmlDocumentElement =
+ ElementFactory.classElement("HtmlDocument", documentElement.type);
+ htmlDocumentElement.methods = <MethodElement>[
+ ElementFactory.methodElement(
+ "query", elementType, <DartType>[provider.stringType])
+ ];
+ htmlUnit.types = <ClassElement>[
+ ElementFactory.classElement("AnchorElement", elementType),
+ ElementFactory.classElement("BodyElement", elementType),
+ ElementFactory.classElement("ButtonElement", elementType),
+ canvasElement,
+ contextElement,
+ context2dElement,
+ ElementFactory.classElement("DivElement", elementType),
+ documentElement,
+ elementElement,
+ htmlDocumentElement,
+ ElementFactory.classElement("InputElement", elementType),
+ ElementFactory.classElement("SelectElement", elementType)
+ ];
+ htmlUnit.functions = <FunctionElement>[
+ ElementFactory.functionElement3("query", elementElement,
+ <ClassElement>[provider.stringType.element], ClassElement.EMPTY_LIST)
+ ];
+ TopLevelVariableElementImpl document = ElementFactory
+ .topLevelVariableElement3(
+ "document", false, true, htmlDocumentElement.type);
+ htmlUnit.topLevelVariables = <TopLevelVariableElement>[document];
+ htmlUnit.accessors = <PropertyAccessorElement>[document.getter];
+ LibraryElementImpl htmlLibrary = new LibraryElementImpl.forNode(
+ coreContext, AstFactory.libraryIdentifier2(["dart", "dom", "html"]));
+ htmlLibrary.definingCompilationUnit = htmlUnit;
+ //
+ // dart:math
+ //
+ CompilationUnitElementImpl mathUnit =
+ new CompilationUnitElementImpl("math.dart");
+ Source mathSource = sourceFactory.forUri("dart:math");
+ coreContext.setContents(mathSource, "");
+ mathUnit.source = mathSource;
+ FunctionElement cosElement = ElementFactory.functionElement3("cos",
+ provider.doubleType.element, <ClassElement>[provider.numType.element],
+ ClassElement.EMPTY_LIST);
+ TopLevelVariableElement ln10Element = ElementFactory
+ .topLevelVariableElement3("LN10", true, false, provider.doubleType);
+ TopLevelVariableElement piElement = ElementFactory.topLevelVariableElement3(
+ "PI", true, false, provider.doubleType);
+ ClassElementImpl randomElement = ElementFactory.classElement2("Random");
+ randomElement.abstract = true;
+ ConstructorElementImpl randomConstructor =
+ ElementFactory.constructorElement2(randomElement, null);
+ randomConstructor.factory = true;
+ ParameterElementImpl seedParam = new ParameterElementImpl("seed", 0);
+ seedParam.parameterKind = ParameterKind.POSITIONAL;
+ seedParam.type = provider.intType;
+ randomConstructor.parameters = <ParameterElement>[seedParam];
+ randomElement.constructors = <ConstructorElement>[randomConstructor];
+ FunctionElement sinElement = ElementFactory.functionElement3("sin",
+ provider.doubleType.element, <ClassElement>[provider.numType.element],
+ ClassElement.EMPTY_LIST);
+ FunctionElement sqrtElement = ElementFactory.functionElement3("sqrt",
+ provider.doubleType.element, <ClassElement>[provider.numType.element],
+ ClassElement.EMPTY_LIST);
+ mathUnit.accessors = <PropertyAccessorElement>[
+ ln10Element.getter,
+ piElement.getter
+ ];
+ mathUnit.functions = <FunctionElement>[cosElement, sinElement, sqrtElement];
+ mathUnit.topLevelVariables = <TopLevelVariableElement>[
+ ln10Element,
+ piElement
+ ];
+ mathUnit.types = <ClassElement>[randomElement];
+ LibraryElementImpl mathLibrary = new LibraryElementImpl.forNode(
+ coreContext, AstFactory.libraryIdentifier2(["dart", "math"]));
+ mathLibrary.definingCompilationUnit = mathUnit;
+ //
+ // Set empty sources for the rest of the libraries.
+ //
+ Source source = sourceFactory.forUri("dart:_interceptors");
+ coreContext.setContents(source, "");
+ source = sourceFactory.forUri("dart:_js_helper");
+ coreContext.setContents(source, "");
+ //
+ // Record the elements.
+ //
+ HashMap<Source, LibraryElement> elementMap =
+ new HashMap<Source, LibraryElement>();
+ elementMap[coreSource] = coreLibrary;
+ elementMap[asyncSource] = asyncLibrary;
+ elementMap[htmlSource] = htmlLibrary;
+ elementMap[mathSource] = mathLibrary;
+ recordLibraryElements(elementMap);
+ elementMap.forEach((Source librarySource, LibraryElement library) {
+ CompilationUnit unit = new CompilationUnit(null, null, null, null, null);
+ unit.element = library.definingCompilationUnit;
+ CacheEntry entry = getCacheEntry(librarySource);
+ entry.setValue(PARSED_UNIT, unit, TargetedResult.EMPTY_LIST, null);
+ });
+ }
+
+ /**
+ * Set the analysis options, even if they would force re-analysis. This method should only be
+ * invoked before the fake SDK is initialized.
+ *
+ * @param options the analysis options to be set
+ */
+ void _internalSetAnalysisOptions(AnalysisOptions options) {
+ super.analysisOptions = options;
+ }
+}
+
+@reflectiveTest
+class AnalysisContextImplTest extends EngineTestCase {
+ /**
+ * An analysis context whose source factory is [sourceFactory].
+ */
+ AnalysisContextImpl _context;
+
+ /**
+ * The source factory associated with the analysis [context].
+ */
+ SourceFactory _sourceFactory;
+
+ void fail_applyChanges_empty() {
+ _context.applyChanges(new ChangeSet());
+ expect(_context.performAnalysisTask().changeNotices, isNull);
+ // This test appears to be flaky. If it is named "test_" it fails, if it's
+ // named "fail_" it doesn't fail. I'm guessing that it's dependent on some
+ // other test being run (or not).
+ fail('Should have failed');
+ }
+
+ void fail_applyChanges_overriddenSource() {
+ // Note: addSource adds the source to the contentCache.
+ Source source = _addSource("/test.dart", "library test;");
+ _context.computeErrors(source);
+ while (!_context.sourcesNeedingProcessing.isEmpty) {
+ _context.performAnalysisTask();
+ }
+ // Adding the source as a changedSource should have no effect since
+ // it is already overridden in the content cache.
+ ChangeSet changeSet = new ChangeSet();
+ changeSet.changedSource(source);
+ _context.applyChanges(changeSet);
+ expect(_context.sourcesNeedingProcessing, hasLength(0));
+ }
+
+ Future fail_applyChanges_remove() {
+ _context = contextWithCore();
+ SourcesChangedListener listener = new SourcesChangedListener();
+ _context.onSourcesChanged.listen(listener.onData);
+ _sourceFactory = _context.sourceFactory;
+ String libAContents = r'''
+library libA;
+import 'libB.dart';''';
+ Source libA = _addSource("/libA.dart", libAContents);
+ String libBContents = "library libB;";
+ Source libB = _addSource("/libB.dart", libBContents);
+ LibraryElement libAElement = _context.computeLibraryElement(libA);
+ expect(libAElement, isNotNull);
+ List<LibraryElement> importedLibraries = libAElement.importedLibraries;
+ expect(importedLibraries, hasLength(2));
+ _context.computeErrors(libA);
+ _context.computeErrors(libB);
+ expect(_context.sourcesNeedingProcessing, hasLength(0));
+ _context.setContents(libB, null);
+ _removeSource(libB);
+ List<Source> sources = _context.sourcesNeedingProcessing;
+ expect(sources, hasLength(1));
+ expect(sources[0], same(libA));
+ libAElement = _context.computeLibraryElement(libA);
+ importedLibraries = libAElement.importedLibraries;
+ expect(importedLibraries, hasLength(1));
+ return pumpEventQueue().then((_) {
+ listener.assertEvent(wereSourcesAdded: true);
+ listener.assertEvent(changedSources: [libA]);
+ listener.assertEvent(wereSourcesAdded: true);
+ listener.assertEvent(changedSources: [libB]);
+ listener.assertEvent(changedSources: [libB]);
+ listener.assertEvent(wereSourcesRemovedOrDeleted: true);
+ listener.assertNoMoreEvents();
+ });
+ }
+
+ Future fail_applyChanges_removeContainer() {
+ _context = contextWithCore();
+ SourcesChangedListener listener = new SourcesChangedListener();
+ _context.onSourcesChanged.listen(listener.onData);
+ _sourceFactory = _context.sourceFactory;
+ String libAContents = r'''
+library libA;
+import 'libB.dart';''';
+ Source libA = _addSource("/libA.dart", libAContents);
+ String libBContents = "library libB;";
+ Source libB = _addSource("/libB.dart", libBContents);
+ _context.computeLibraryElement(libA);
+ _context.computeErrors(libA);
+ _context.computeErrors(libB);
+ expect(_context.sourcesNeedingProcessing, hasLength(0));
+ ChangeSet changeSet = new ChangeSet();
+ SourceContainer removedContainer =
+ new _AnalysisContextImplTest_test_applyChanges_removeContainer(libB);
+ changeSet.removedContainer(removedContainer);
+ _context.applyChanges(changeSet);
+ List<Source> sources = _context.sourcesNeedingProcessing;
+ expect(sources, hasLength(1));
+ expect(sources[0], same(libA));
+ return pumpEventQueue().then((_) {
+ listener.assertEvent(wereSourcesAdded: true);
+ listener.assertEvent(changedSources: [libA]);
+ listener.assertEvent(wereSourcesAdded: true);
+ listener.assertEvent(changedSources: [libB]);
+ listener.assertEvent(wereSourcesRemovedOrDeleted: true);
+ listener.assertNoMoreEvents();
+ });
+ }
+
+ void fail_computeErrors_dart_none() {
+ Source source = _addSource("/lib.dart", "library lib;");
+ List<AnalysisError> errors = _context.computeErrors(source);
+ expect(errors, hasLength(0));
+ }
+
+ void fail_computeErrors_dart_part() {
+ Source librarySource =
+ _addSource("/lib.dart", "library lib; part 'part.dart';");
+ Source partSource = _addSource("/part.dart", "part of 'lib';");
+ _context.parseCompilationUnit(librarySource);
+ List<AnalysisError> errors = _context.computeErrors(partSource);
+ expect(errors, isNotNull);
+ expect(errors.length > 0, isTrue);
+ }
+
+ void fail_computeErrors_dart_some() {
+ Source source = _addSource("/lib.dart", "library 'lib';");
+ List<AnalysisError> errors = _context.computeErrors(source);
+ expect(errors, isNotNull);
+ expect(errors.length > 0, isTrue);
+ }
+
+ void fail_computeErrors_html_none() {
+ Source source = _addSource("/test.html", "<html></html>");
+ List<AnalysisError> errors = _context.computeErrors(source);
+ expect(errors, hasLength(0));
+ }
+
+ void fail_computeHtmlElement_valid() {
+ Source source = _addSource("/test.html", "<html></html>");
+ HtmlElement element = _context.computeHtmlElement(source);
+ expect(element, isNotNull);
+ expect(_context.computeHtmlElement(source), same(element));
+ }
+
+ void fail_computeImportedLibraries_none() {
+ Source source = _addSource("/test.dart", "library test;");
+ expect(_context.computeImportedLibraries(source), hasLength(0));
+ }
+
+ void fail_computeImportedLibraries_some() {
+ // addSource("/lib1.dart", "library lib1;");
+ // addSource("/lib2.dart", "library lib2;");
+ Source source = _addSource(
+ "/test.dart", "library test; import 'lib1.dart'; import 'lib2.dart';");
+ expect(_context.computeImportedLibraries(source), hasLength(2));
+ }
+
+ void fail_computeKindOf_html() {
+ Source source = _addSource("/test.html", "");
+ expect(_context.computeKindOf(source), same(SourceKind.HTML));
+ }
+
+ void fail_computeResolvableCompilationUnit_dart_exception() {
+ TestSource source = _addSourceWithException("/test.dart");
+ try {
+ _context.computeResolvableCompilationUnit(source);
+ fail("Expected AnalysisException");
+ } on AnalysisException {
+ // Expected
+ }
+ }
+
+ void fail_computeResolvableCompilationUnit_html_exception() {
+ Source source = _addSource("/lib.html", "<html></html>");
+ try {
+ _context.computeResolvableCompilationUnit(source);
+ fail("Expected AnalysisException");
+ } on AnalysisException {
+ // Expected
+ }
+ }
+
+ void fail_computeResolvableCompilationUnit_valid() {
+ Source source = _addSource("/lib.dart", "library lib;");
+ CompilationUnit parsedUnit = _context.parseCompilationUnit(source);
+ expect(parsedUnit, isNotNull);
+ CompilationUnit resolvedUnit =
+ _context.computeResolvableCompilationUnit(source);
+ expect(resolvedUnit, isNotNull);
+ expect(resolvedUnit, same(parsedUnit));
+ }
+
+ Future fail_computeResolvedCompilationUnitAsync_dispose() {
+ _context = contextWithCore();
+ _sourceFactory = _context.sourceFactory;
+ Source source = _addSource("/lib.dart", "library lib;");
+ // Complete all pending analysis tasks and flush the AST so that it won't
+ // be available immediately.
+ _performPendingAnalysisTasks();
+ CacheEntry entry = _context.getReadableSourceEntryOrNull(source);
+ entry.flushAstStructures();
+ CancelableFuture<CompilationUnit> future =
+ _context.computeResolvedCompilationUnitAsync(source, source);
+ bool completed = false;
+ future.then((CompilationUnit unit) {
+ fail('Future should have completed with error');
+ }, onError: (error) {
+ expect(error, new isInstanceOf<AnalysisNotScheduledError>());
+ completed = true;
+ });
+ expect(completed, isFalse);
+ expect(_context.pendingFutureSources_forTesting, isNotEmpty);
+ // Disposing of the context should cause all pending futures to complete
+ // with AnalysisNotScheduled, so that no clients are left hanging.
+ _context.dispose();
+ expect(_context.pendingFutureSources_forTesting, isEmpty);
+ return pumpEventQueue().then((_) {
+ expect(completed, isTrue);
+ expect(_context.pendingFutureSources_forTesting, isEmpty);
+ });
+ }
+
+ Future fail_computeResolvedCompilationUnitAsync_unrelatedLibrary() {
+ _context = contextWithCore();
+ _sourceFactory = _context.sourceFactory;
+ Source librarySource = _addSource("/lib.dart", "library lib;");
+ Source partSource = _addSource("/part.dart", "part of foo;");
+ bool completed = false;
+ _context
+ .computeResolvedCompilationUnitAsync(partSource, librarySource)
+ .then((_) {
+ // TODO(brianwilkerson) Uncomment the line below (and figure out why
+ // invoking 'fail' directly causes a failing test to fail.
+ //fail('Expected resolution to fail');
+ }, onError: (e) {
+ expect(e, new isInstanceOf<AnalysisNotScheduledError>());
+ completed = true;
+ });
+ return pumpEventQueue().then((_) {
+ expect(completed, isFalse);
+ _performPendingAnalysisTasks();
+ }).then((_) => pumpEventQueue()).then((_) {
+ expect(completed, isTrue);
+ });
+ }
+
+ void fail_extractContext() {
+ fail("Implement this");
+ }
+
+ void fail_getElement_constructor_named() {
+ Source source = _addSource("/lib.dart", r'''
+class A {
+ A.named() {}
+}''');
+ _analyzeAll_assertFinished();
+ LibraryElement library = _context.computeLibraryElement(source);
+ ClassElement classA = _findClass(library.definingCompilationUnit, "A");
+ ConstructorElement constructor = classA.constructors[0];
+ ElementLocation location = constructor.location;
+ Element element = _context.getElement(location);
+ expect(element, same(constructor));
+ }
+
+ void fail_getElement_constructor_unnamed() {
+ Source source = _addSource("/lib.dart", r'''
+class A {
+ A() {}
+}''');
+ _analyzeAll_assertFinished();
+ LibraryElement library = _context.computeLibraryElement(source);
+ ClassElement classA = _findClass(library.definingCompilationUnit, "A");
+ ConstructorElement constructor = classA.constructors[0];
+ ElementLocation location = constructor.location;
+ Element element = _context.getElement(location);
+ expect(element, same(constructor));
+ }
+
+ void fail_getElement_enum() {
+ Source source = _addSource('/test.dart', 'enum MyEnum {A, B, C}');
+ _analyzeAll_assertFinished();
+ LibraryElement library = _context.computeLibraryElement(source);
+ ClassElement myEnum = library.definingCompilationUnit.getEnum('MyEnum');
+ ElementLocation location = myEnum.location;
+ Element element = _context.getElement(location);
+ expect(element, same(myEnum));
+ }
+
+ void fail_getErrors_dart_none() {
+ Source source = _addSource("/lib.dart", "library lib;");
+ var errorInfo = _context.getErrors(source);
+ expect(errorInfo, isNotNull);
+ List<AnalysisError> errors = errorInfo.errors;
+ expect(errors, hasLength(0));
+ _context.computeErrors(source);
+ errors = errorInfo.errors;
+ expect(errors, hasLength(0));
+ }
+
+ void fail_getErrors_dart_some() {
+ Source source = _addSource("/lib.dart", "library 'lib';");
+ var errorInfo = _context.getErrors(source);
+ expect(errorInfo, isNotNull);
+ List<AnalysisError> errors = errorInfo.errors;
+ expect(errors, hasLength(0));
+ _context.computeErrors(source);
+ errors = errorInfo.errors;
+ expect(errors, hasLength(1));
+ }
+
+ void fail_getErrors_html_none() {
+ Source source = _addSource("/test.html", "<html></html>");
+ AnalysisErrorInfo errorInfo = _context.getErrors(source);
+ expect(errorInfo, isNotNull);
+ List<AnalysisError> errors = errorInfo.errors;
+ expect(errors, hasLength(0));
+ _context.computeErrors(source);
+ errors = errorInfo.errors;
+ expect(errors, hasLength(0));
+ }
+
+ void fail_getErrors_html_some() {
+ Source source = _addSource("/test.html", r'''
+<html><head>
+<script type='application/dart' src='test.dart'/>
+</head></html>''');
+ AnalysisErrorInfo errorInfo = _context.getErrors(source);
+ expect(errorInfo, isNotNull);
+ List<AnalysisError> errors = errorInfo.errors;
+ expect(errors, hasLength(0));
+ _context.computeErrors(source);
+ errors = errorInfo.errors;
+ expect(errors, hasLength(1));
+ }
+
+ void fail_getHtmlElement_html() {
+ Source source = _addSource("/test.html", "<html></html>");
+ HtmlElement element = _context.getHtmlElement(source);
+ expect(element, isNull);
+ _context.computeHtmlElement(source);
+ element = _context.getHtmlElement(source);
+ expect(element, isNotNull);
+ }
+
+ void fail_getHtmlFilesReferencing_library() {
+ Source htmlSource = _addSource("/test.html", r'''
+<html><head>
+<script type='application/dart' src='test.dart'/>
+<script type='application/dart' src='test.js'/>
+</head></html>''');
+ Source librarySource = _addSource("/test.dart", "library lib;");
+ List<Source> result = _context.getHtmlFilesReferencing(librarySource);
+ expect(result, hasLength(0));
+ _context.parseHtmlUnit(htmlSource);
+ result = _context.getHtmlFilesReferencing(librarySource);
+ expect(result, hasLength(1));
+ expect(result[0], htmlSource);
+ }
+
+ void fail_getHtmlFilesReferencing_part() {
+ _context = contextWithCore();
+ _sourceFactory = _context.sourceFactory;
+ Source htmlSource = _addSource("/test.html", r'''
+<html><head>
+<script type='application/dart' src='test.dart'/>
+<script type='application/dart' src='test.js'/>
+</head></html>''');
+ Source librarySource =
+ _addSource("/test.dart", "library lib; part 'part.dart';");
+ Source partSource = _addSource("/part.dart", "part of lib;");
+ _context.computeLibraryElement(librarySource);
+ List<Source> result = _context.getHtmlFilesReferencing(partSource);
+ expect(result, hasLength(0));
+ _context.parseHtmlUnit(htmlSource);
+ result = _context.getHtmlFilesReferencing(partSource);
+ expect(result, hasLength(1));
+ expect(result[0], htmlSource);
+ }
+
+ void fail_getHtmlSources() {
+ List<Source> sources = _context.htmlSources;
+ expect(sources, hasLength(0));
+ Source source = _addSource("/test.html", "");
+ _context.computeKindOf(source);
+ sources = _context.htmlSources;
+ expect(sources, hasLength(1));
+ expect(sources[0], source);
+ }
+
+ void fail_getKindOf_html() {
+ Source source = _addSource("/test.html", "");
+ expect(_context.getKindOf(source), same(SourceKind.HTML));
+ }
+
+ void fail_getLibrariesContaining() {
+ _context = contextWithCore();
+ _sourceFactory = _context.sourceFactory;
+ Source librarySource = _addSource("/lib.dart", r'''
+library lib;
+part 'part.dart';''');
+ Source partSource = _addSource("/part.dart", "part of lib;");
+ _context.computeLibraryElement(librarySource);
+ List<Source> result = _context.getLibrariesContaining(librarySource);
+ expect(result, hasLength(1));
+ expect(result[0], librarySource);
+ result = _context.getLibrariesContaining(partSource);
+ expect(result, hasLength(1));
+ expect(result[0], librarySource);
+ }
+
+ void fail_getLibrariesReferencedFromHtml() {
+ _context = contextWithCore();
+ _sourceFactory = _context.sourceFactory;
+ Source htmlSource = _addSource("/test.html", r'''
+<html><head>
+<script type='application/dart' src='test.dart'/>
+<script type='application/dart' src='test.js'/>
+</head></html>''');
+ Source librarySource = _addSource("/test.dart", "library lib;");
+ _context.computeLibraryElement(librarySource);
+ _context.parseHtmlUnit(htmlSource);
+ List<Source> result = _context.getLibrariesReferencedFromHtml(htmlSource);
+ expect(result, hasLength(1));
+ expect(result[0], librarySource);
+ }
+
+ void fail_getResolvedCompilationUnit_library() {
+ _context = contextWithCore();
+ _sourceFactory = _context.sourceFactory;
+ Source source = _addSource("/lib.dart", "library libb;");
+ LibraryElement library = _context.computeLibraryElement(source);
+ expect(_context.getResolvedCompilationUnit(source, library), isNotNull);
+ _context.setContents(source, "library lib;");
+ expect(_context.getResolvedCompilationUnit(source, library), isNull);
+ }
+
+ void fail_getResolvedHtmlUnit() {
+ _context = contextWithCore();
+ _sourceFactory = _context.sourceFactory;
+ Source source = _addSource("/test.html", "<html></html>");
+ expect(_context.getResolvedHtmlUnit(source), isNull);
+ _context.resolveHtmlUnit(source);
+ expect(_context.getResolvedHtmlUnit(source), isNotNull);
+ }
+
+ void fail_mergeContext() {
+ fail("Implement this");
+ }
+
+ void fail_parseHtmlUnit_noErrors() {
+ Source source = _addSource("/lib.html", "<html></html>");
+ ht.HtmlUnit unit = _context.parseHtmlUnit(source);
+ expect(unit, isNotNull);
+ }
+
+ void fail_parseHtmlUnit_resolveDirectives() {
+ Source libSource = _addSource("/lib.dart", r'''
+library lib;
+class ClassA {}''');
+ Source source = _addSource("/lib.html", r'''
+<html>
+<head>
+ <script type='application/dart'>
+ import 'lib.dart';
+ ClassA v = null;
+ </script>
+</head>
+<body>
+</body>
+</html>''');
+ ht.HtmlUnit unit = _context.parseHtmlUnit(source);
+ expect(unit, isNotNull);
+ // import directive should be resolved
+ ht.XmlTagNode htmlNode = unit.tagNodes[0];
+ ht.XmlTagNode headNode = htmlNode.tagNodes[0];
+ ht.HtmlScriptTagNode scriptNode = headNode.tagNodes[0];
+ CompilationUnit script = scriptNode.script;
+ ImportDirective importNode = script.directives[0] as ImportDirective;
+ expect(importNode.uriContent, isNotNull);
+ expect(importNode.source, libSource);
+ }
+
+ void fail_performAnalysisTask_addPart() {
+ Source libSource = _addSource("/lib.dart", r'''
+library lib;
+part 'part.dart';''');
+ // run all tasks without part
+ _analyzeAll_assertFinished();
+ // add part and run all tasks
+ Source partSource = _addSource("/part.dart", r'''
+part of lib;
+''');
+ _analyzeAll_assertFinished();
+ // "libSource" should be here
+ List<Source> librariesWithPart =
+ _context.getLibrariesContaining(partSource);
+ expect(librariesWithPart, unorderedEquals([libSource]));
+ }
+
+ void fail_performAnalysisTask_changeLibraryContents() {
+ Source libSource =
+ _addSource("/test.dart", "library lib; part 'test-part.dart';");
+ Source partSource = _addSource("/test-part.dart", "part of lib;");
+ _analyzeAll_assertFinished();
+ expect(
+ _context.getResolvedCompilationUnit2(libSource, libSource), isNotNull,
+ reason: "library resolved 1");
+ expect(
+ _context.getResolvedCompilationUnit2(partSource, libSource), isNotNull,
+ reason: "part resolved 1");
+ // update and analyze #1
+ _context.setContents(libSource, "library lib;");
+ expect(_context.getResolvedCompilationUnit2(libSource, libSource), isNull,
+ reason: "library changed 2");
+ expect(_context.getResolvedCompilationUnit2(partSource, libSource), isNull,
+ reason: "part changed 2");
+ _analyzeAll_assertFinished();
+ expect(
+ _context.getResolvedCompilationUnit2(libSource, libSource), isNotNull,
+ reason: "library resolved 2");
+ expect(_context.getResolvedCompilationUnit2(partSource, libSource), isNull,
+ reason: "part resolved 2");
+ // update and analyze #2
+ _context.setContents(libSource, "library lib; part 'test-part.dart';");
+ expect(_context.getResolvedCompilationUnit2(libSource, libSource), isNull,
+ reason: "library changed 3");
+ expect(_context.getResolvedCompilationUnit2(partSource, libSource), isNull,
+ reason: "part changed 3");
+ _analyzeAll_assertFinished();
+ expect(
+ _context.getResolvedCompilationUnit2(libSource, libSource), isNotNull,
+ reason: "library resolved 2");
+ expect(
+ _context.getResolvedCompilationUnit2(partSource, libSource), isNotNull,
+ reason: "part resolved 3");
+ }
+
+ void fail_performAnalysisTask_changeLibraryThenPartContents() {
+ Source libSource =
+ _addSource("/test.dart", "library lib; part 'test-part.dart';");
+ Source partSource = _addSource("/test-part.dart", "part of lib;");
+ _analyzeAll_assertFinished();
+ expect(
+ _context.getResolvedCompilationUnit2(libSource, libSource), isNotNull,
+ reason: "library resolved 1");
+ expect(
+ _context.getResolvedCompilationUnit2(partSource, libSource), isNotNull,
+ reason: "part resolved 1");
+ // update and analyze #1
+ _context.setContents(libSource, "library lib;");
+ expect(_context.getResolvedCompilationUnit2(libSource, libSource), isNull,
+ reason: "library changed 2");
+ expect(_context.getResolvedCompilationUnit2(partSource, libSource), isNull,
+ reason: "part changed 2");
+ _analyzeAll_assertFinished();
+ expect(
+ _context.getResolvedCompilationUnit2(libSource, libSource), isNotNull,
+ reason: "library resolved 2");
+ expect(_context.getResolvedCompilationUnit2(partSource, libSource), isNull,
+ reason: "part resolved 2");
+ // update and analyze #2
+ _context.setContents(partSource, "part of lib; // 1");
+ // Assert that changing the part's content does not effect the library
+ // now that it is no longer part of that library
+ expect(
+ _context.getResolvedCompilationUnit2(libSource, libSource), isNotNull,
+ reason: "library changed 3");
+ expect(_context.getResolvedCompilationUnit2(partSource, libSource), isNull,
+ reason: "part changed 3");
+ _analyzeAll_assertFinished();
+ expect(
+ _context.getResolvedCompilationUnit2(libSource, libSource), isNotNull,
+ reason: "library resolved 3");
+ expect(_context.getResolvedCompilationUnit2(partSource, libSource), isNull,
+ reason: "part resolved 3");
+ }
+
+ void fail_performAnalysisTask_changePartContents_makeItAPart() {
+ Source libSource = _addSource("/lib.dart", r'''
+library lib;
+part 'part.dart';
+void f(x) {}''');
+ Source partSource = _addSource("/part.dart", "void g() { f(null); }");
+ _analyzeAll_assertFinished();
+ expect(
+ _context.getResolvedCompilationUnit2(libSource, libSource), isNotNull,
+ reason: "library resolved 1");
+ expect(
+ _context.getResolvedCompilationUnit2(partSource, libSource), isNotNull,
+ reason: "part resolved 1");
+ // update and analyze
+ _context.setContents(partSource, r'''
+part of lib;
+void g() { f(null); }''');
+ expect(_context.getResolvedCompilationUnit2(libSource, libSource), isNull,
+ reason: "library changed 2");
+ expect(_context.getResolvedCompilationUnit2(partSource, libSource), isNull,
+ reason: "part changed 2");
+ _analyzeAll_assertFinished();
+ expect(
+ _context.getResolvedCompilationUnit2(libSource, libSource), isNotNull,
+ reason: "library resolved 2");
+ expect(
+ _context.getResolvedCompilationUnit2(partSource, libSource), isNotNull,
+ reason: "part resolved 2");
+ expect(_context.getErrors(libSource).errors, hasLength(0));
+ expect(_context.getErrors(partSource).errors, hasLength(0));
+ }
+
+ /**
+ * https://code.google.com/p/dart/issues/detail?id=12424
+ */
+ void fail_performAnalysisTask_changePartContents_makeItNotPart() {
+ Source libSource = _addSource("/lib.dart", r'''
+library lib;
+part 'part.dart';
+void f(x) {}''');
+ Source partSource = _addSource("/part.dart", r'''
+part of lib;
+void g() { f(null); }''');
+ _analyzeAll_assertFinished();
+ expect(_context.getErrors(libSource).errors, hasLength(0));
+ expect(_context.getErrors(partSource).errors, hasLength(0));
+ // Remove 'part' directive, which should make "f(null)" an error.
+ _context.setContents(partSource, r'''
+//part of lib;
+void g() { f(null); }''');
+ _analyzeAll_assertFinished();
+ expect(_context.getErrors(libSource).errors.length != 0, isTrue);
+ }
+
+ void fail_performAnalysisTask_changePartContents_noSemanticChanges() {
+ Source libSource =
+ _addSource("/test.dart", "library lib; part 'test-part.dart';");
+ Source partSource = _addSource("/test-part.dart", "part of lib;");
+ _analyzeAll_assertFinished();
+ expect(
+ _context.getResolvedCompilationUnit2(libSource, libSource), isNotNull,
+ reason: "library resolved 1");
+ expect(
+ _context.getResolvedCompilationUnit2(partSource, libSource), isNotNull,
+ reason: "part resolved 1");
+ // update and analyze #1
+ _context.setContents(partSource, "part of lib; // 1");
+ expect(_context.getResolvedCompilationUnit2(libSource, libSource), isNull,
+ reason: "library changed 2");
+ expect(_context.getResolvedCompilationUnit2(partSource, libSource), isNull,
+ reason: "part changed 2");
+ _analyzeAll_assertFinished();
+ expect(
+ _context.getResolvedCompilationUnit2(libSource, libSource), isNotNull,
+ reason: "library resolved 2");
+ expect(
+ _context.getResolvedCompilationUnit2(partSource, libSource), isNotNull,
+ reason: "part resolved 2");
+ // update and analyze #2
+ _context.setContents(partSource, "part of lib; // 12");
+ expect(_context.getResolvedCompilationUnit2(libSource, libSource), isNull,
+ reason: "library changed 3");
+ expect(_context.getResolvedCompilationUnit2(partSource, libSource), isNull,
+ reason: "part changed 3");
+ _analyzeAll_assertFinished();
+ expect(
+ _context.getResolvedCompilationUnit2(libSource, libSource), isNotNull,
+ reason: "library resolved 3");
+ expect(
+ _context.getResolvedCompilationUnit2(partSource, libSource), isNotNull,
+ reason: "part resolved 3");
+ }
+
+ void fail_performAnalysisTask_getContentException_dart() {
+ // add source that throw an exception on "get content"
+ Source source = new _Source_getContent_throwException('test.dart');
+ {
+ ChangeSet changeSet = new ChangeSet();
+ changeSet.addedSource(source);
+ _context.applyChanges(changeSet);
+ }
+ // prepare errors
+ _analyzeAll_assertFinished();
+ List<AnalysisError> errors = _context.getErrors(source).errors;
+ // validate errors
+ expect(errors, hasLength(1));
+ AnalysisError error = errors[0];
+ expect(error.source, same(source));
+ expect(error.errorCode, ScannerErrorCode.UNABLE_GET_CONTENT);
+ }
+
+ void fail_performAnalysisTask_getContentException_html() {
+ // add source that throw an exception on "get content"
+ Source source = new _Source_getContent_throwException('test.html');
+ {
+ ChangeSet changeSet = new ChangeSet();
+ changeSet.addedSource(source);
+ _context.applyChanges(changeSet);
+ }
+ // prepare errors
+ _analyzeAll_assertFinished();
+ List<AnalysisError> errors = _context.getErrors(source).errors;
+ // validate errors
+ expect(errors, hasLength(1));
+ AnalysisError error = errors[0];
+ expect(error.source, same(source));
+ expect(error.errorCode, ScannerErrorCode.UNABLE_GET_CONTENT);
+ }
+
+ void fail_performAnalysisTask_importedLibraryAdd() {
+ Source libASource =
+ _addSource("/libA.dart", "library libA; import 'libB.dart';");
+ _analyzeAll_assertFinished();
+ expect(
+ _context.getResolvedCompilationUnit2(libASource, libASource), isNotNull,
+ reason: "libA resolved 1");
+ expect(_hasAnalysisErrorWithErrorSeverity(_context.getErrors(libASource)),
+ isTrue, reason: "libA has an error");
+ // add libB.dart and analyze
+ Source libBSource = _addSource("/libB.dart", "library libB;");
+ _analyzeAll_assertFinished();
+ expect(
+ _context.getResolvedCompilationUnit2(libASource, libASource), isNotNull,
+ reason: "libA resolved 2");
+ expect(
+ _context.getResolvedCompilationUnit2(libBSource, libBSource), isNotNull,
+ reason: "libB resolved 2");
+ expect(!_hasAnalysisErrorWithErrorSeverity(_context.getErrors(libASource)),
+ isTrue, reason: "libA doesn't have errors");
+ }
+
+ void fail_performAnalysisTask_importedLibraryAdd_html() {
+ Source htmlSource = _addSource("/page.html", r'''
+<html><body><script type="application/dart">
+ import '/libB.dart';
+ main() {print('hello dart');}
+</script></body></html>''');
+ _analyzeAll_assertFinished();
+ expect(_context.getResolvedHtmlUnit(htmlSource), isNotNull,
+ reason: "htmlUnit resolved 1");
+ expect(_hasAnalysisErrorWithErrorSeverity(_context.getErrors(htmlSource)),
+ isTrue, reason: "htmlSource has an error");
+ // add libB.dart and analyze
+ Source libBSource = _addSource("/libB.dart", "library libB;");
+ _analyzeAll_assertFinished();
+ expect(_context.getResolvedHtmlUnit(htmlSource), isNotNull,
+ reason: "htmlUnit resolved 1");
+ expect(
+ _context.getResolvedCompilationUnit2(libBSource, libBSource), isNotNull,
+ reason: "libB resolved 2");
+ // TODO (danrubel) commented out to fix red bots
+// AnalysisErrorInfo errors = _context.getErrors(htmlSource);
+// expect(
+// !_hasAnalysisErrorWithErrorSeverity(errors),
+// isTrue,
+// reason: "htmlSource doesn't have errors");
+ }
+
+ void fail_performAnalysisTask_importedLibraryDelete() {
+ Source libASource =
+ _addSource("/libA.dart", "library libA; import 'libB.dart';");
+ Source libBSource = _addSource("/libB.dart", "library libB;");
+ _analyzeAll_assertFinished();
+ expect(
+ _context.getResolvedCompilationUnit2(libASource, libASource), isNotNull,
+ reason: "libA resolved 1");
+ expect(
+ _context.getResolvedCompilationUnit2(libBSource, libBSource), isNotNull,
+ reason: "libB resolved 1");
+ expect(!_hasAnalysisErrorWithErrorSeverity(_context.getErrors(libASource)),
+ isTrue, reason: "libA doesn't have errors");
+ // remove libB.dart content and analyze
+ _context.setContents(libBSource, null);
+ _analyzeAll_assertFinished();
+ expect(
+ _context.getResolvedCompilationUnit2(libASource, libASource), isNotNull,
+ reason: "libA resolved 2");
+ expect(_hasAnalysisErrorWithErrorSeverity(_context.getErrors(libASource)),
+ isTrue, reason: "libA has an error");
+ }
+
+ void fail_performAnalysisTask_importedLibraryDelete_html() {
+ // NOTE: This was failing before converting to the new task model.
+ Source htmlSource = _addSource("/page.html", r'''
+<html><body><script type="application/dart">
+ import 'libB.dart';
+ main() {print('hello dart');}
+</script></body></html>''');
+ Source libBSource = _addSource("/libB.dart", "library libB;");
+ _analyzeAll_assertFinished();
+ expect(_context.getResolvedHtmlUnit(htmlSource), isNotNull,
+ reason: "htmlUnit resolved 1");
+ expect(
+ _context.getResolvedCompilationUnit2(libBSource, libBSource), isNotNull,
+ reason: "libB resolved 1");
+ expect(!_hasAnalysisErrorWithErrorSeverity(_context.getErrors(htmlSource)),
+ isTrue, reason: "htmlSource doesn't have errors");
+ // remove libB.dart content and analyze
+ _context.setContents(libBSource, null);
+ _analyzeAll_assertFinished();
+ expect(_context.getResolvedHtmlUnit(htmlSource), isNotNull,
+ reason: "htmlUnit resolved 1");
+ AnalysisErrorInfo errors = _context.getErrors(htmlSource);
+ expect(_hasAnalysisErrorWithErrorSeverity(errors), isTrue,
+ reason: "htmlSource has an error");
+ }
+
+ void fail_performAnalysisTask_IOException() {
+ TestSource source = _addSourceWithException2("/test.dart", "library test;");
+ int oldTimestamp = _context.getModificationStamp(source);
+ source.generateExceptionOnRead = false;
+ _analyzeAll_assertFinished();
+ expect(source.readCount, 1);
+ source.generateExceptionOnRead = true;
+ do {
+ _changeSource(source, "");
+ // Ensure that the timestamp differs,
+ // so that analysis engine notices the change
+ } while (oldTimestamp == _context.getModificationStamp(source));
+ _analyzeAll_assertFinished();
+ expect(source.readCount, 2);
+ }
+
+ void fail_performAnalysisTask_missingPart() {
+ Source source =
+ _addSource("/test.dart", "library lib; part 'no-such-file.dart';");
+ _analyzeAll_assertFinished();
+ expect(_context.getLibraryElement(source), isNotNull,
+ reason: "performAnalysisTask failed to compute an element model");
+ }
+
+ void fail_recordLibraryElements() {
+ fail("Implement this");
+ }
+
+ void fail_resolveCompilationUnit_import_relative() {
+ _context = contextWithCore();
+ Source sourceA =
+ _addSource("/libA.dart", "library libA; import 'libB.dart'; class A{}");
+ _addSource("/libB.dart", "library libB; class B{}");
+ CompilationUnit compilationUnit =
+ _context.resolveCompilationUnit2(sourceA, sourceA);
+ expect(compilationUnit, isNotNull);
+ LibraryElement library = compilationUnit.element.library;
+ List<LibraryElement> importedLibraries = library.importedLibraries;
+ assertNamedElements(importedLibraries, ["dart.core", "libB"]);
+ List<LibraryElement> visibleLibraries = library.visibleLibraries;
+ assertNamedElements(visibleLibraries, ["dart.core", "libA", "libB"]);
+ }
+
+ void fail_resolveCompilationUnit_import_relative_cyclic() {
+ _context = contextWithCore();
+ Source sourceA =
+ _addSource("/libA.dart", "library libA; import 'libB.dart'; class A{}");
+ _addSource("/libB.dart", "library libB; import 'libA.dart'; class B{}");
+ CompilationUnit compilationUnit =
+ _context.resolveCompilationUnit2(sourceA, sourceA);
+ expect(compilationUnit, isNotNull);
+ LibraryElement library = compilationUnit.element.library;
+ List<LibraryElement> importedLibraries = library.importedLibraries;
+ assertNamedElements(importedLibraries, ["dart.core", "libB"]);
+ List<LibraryElement> visibleLibraries = library.visibleLibraries;
+ assertNamedElements(visibleLibraries, ["dart.core", "libA", "libB"]);
+ }
+
+ void fail_resolveHtmlUnit() {
+ Source source = _addSource("/lib.html", "<html></html>");
+ ht.HtmlUnit unit = _context.resolveHtmlUnit(source);
+ expect(unit, isNotNull);
+ }
+
+ void fail_setAnalysisOptions_reduceAnalysisPriorityOrder() {
+ AnalysisOptionsImpl options =
+ new AnalysisOptionsImpl.con1(_context.analysisOptions);
+ List<Source> sources = new List<Source>();
+ for (int index = 0; index < options.cacheSize; index++) {
+ sources.add(_addSource("/lib.dart$index", ""));
+ }
+ _context.analysisPriorityOrder = sources;
+ int oldPriorityOrderSize = _getPriorityOrder(_context).length;
+ options.cacheSize = options.cacheSize - 10;
+ _context.analysisOptions = options;
+ expect(oldPriorityOrderSize > _getPriorityOrder(_context).length, isTrue);
+ }
+
+ void fail_setAnalysisPriorityOrder_lessThanCacheSize() {
+ AnalysisOptions options = _context.analysisOptions;
+ List<Source> sources = new List<Source>();
+ for (int index = 0; index < options.cacheSize; index++) {
+ sources.add(_addSource("/lib.dart$index", ""));
+ }
+ _context.analysisPriorityOrder = sources;
+ expect(options.cacheSize > _getPriorityOrder(_context).length, isTrue);
+ }
+
+ Future fail_setChangedContents_libraryWithPart() {
+ AnalysisOptionsImpl options = new AnalysisOptionsImpl();
+ options.incremental = true;
+ _context = new AnalysisContextForTests();
+ _context.analysisOptions = options;
+ SourcesChangedListener listener = new SourcesChangedListener();
+ _context.onSourcesChanged.listen(listener.onData);
+ _sourceFactory = _context.sourceFactory;
+ String oldCode = r'''
+library lib;
+part 'part.dart';
+int a = 0;''';
+ Source librarySource = _addSource("/lib.dart", oldCode);
+ String partContents = r'''
+part of lib;
+int b = a;''';
+ Source partSource = _addSource("/part.dart", partContents);
+ LibraryElement element = _context.computeLibraryElement(librarySource);
+ CompilationUnit unit =
+ _context.getResolvedCompilationUnit(librarySource, element);
+ expect(unit, isNotNull);
+ int offset = oldCode.indexOf("int a") + 4;
+ String newCode = r'''
+library lib;
+part 'part.dart';
+int ya = 0;''';
+ expect(_getIncrementalAnalysisCache(_context), isNull);
+ _context.setChangedContents(librarySource, newCode, offset, 0, 1);
+ expect(_context.getContents(librarySource).data, newCode);
+ IncrementalAnalysisCache incrementalCache =
+ _getIncrementalAnalysisCache(_context);
+ expect(incrementalCache.librarySource, librarySource);
+ expect(incrementalCache.resolvedUnit, same(unit));
+ expect(_context.getResolvedCompilationUnit2(partSource, librarySource),
+ isNull);
+ expect(incrementalCache.newContents, newCode);
+ return pumpEventQueue().then((_) {
+ listener.assertEvent(wereSourcesAdded: true);
+ listener.assertEvent(changedSources: [librarySource]);
+ listener.assertEvent(wereSourcesAdded: true);
+ listener.assertEvent(changedSources: [partSource]);
+ listener.assertEvent(changedSources: [librarySource]);
+ listener.assertNoMoreEvents();
+ });
+ }
+
+ void fail_setContents_unchanged_consistentModificationTime() {
+ String contents = "// foo";
+ Source source = _addSource("/test.dart", contents);
+ // do all, no tasks
+ _analyzeAll_assertFinished();
+ {
+ AnalysisResult result = _context.performAnalysisTask();
+ expect(result.changeNotices, isNull);
+ }
+ // set the same contents, still no tasks
+ _context.setContents(source, contents);
+ {
+ AnalysisResult result = _context.performAnalysisTask();
+ expect(result.changeNotices, isNull);
+ }
+ }
+
+ void fail_unreadableSource() {
+ _context = contextWithCore();
+ _sourceFactory = _context.sourceFactory;
+ Source test1 = _addSource("/test1.dart", r'''
+import 'test2.dart';
+library test1;''');
+ Source test2 = _addSource("/test2.dart", r'''
+import 'test1.dart';
+import 'test3.dart';
+library test2;''');
+ Source test3 = _addSourceWithException("/test3.dart");
+ _analyzeAll_assertFinished();
+ // test1 and test2 should have been successfully analyzed
+ // despite the fact that test3 couldn't be read.
+ expect(_context.computeLibraryElement(test1), isNotNull);
+ expect(_context.computeLibraryElement(test2), isNotNull);
+ expect(_context.computeLibraryElement(test3), isNull);
+ }
+
+ @override
+ void setUp() {
+ EnginePlugin enginePlugin = AnalysisEngine.instance.enginePlugin;
+ if (enginePlugin.taskExtensionPoint == null) {
+ ExtensionManager manager = new ExtensionManager();
+ manager.processPlugins([enginePlugin]);
+ }
+
+ _context = new AnalysisContextImpl();
+ _sourceFactory = new SourceFactory([
+ new DartUriResolver(DirectoryBasedDartSdk.defaultSdk),
+ new FileUriResolver()
+ ]);
+ _context.sourceFactory = _sourceFactory;
+ AnalysisOptionsImpl options =
+ new AnalysisOptionsImpl.con1(_context.analysisOptions);
+ options.cacheSize = 256;
+ _context.analysisOptions = options;
+ }
+
+ @override
+ void tearDown() {
+ _context = null;
+ _sourceFactory = null;
+ super.tearDown();
+ }
+
+ Future test_applyChanges_add() {
+ SourcesChangedListener listener = new SourcesChangedListener();
+ _context.onSourcesChanged.listen(listener.onData);
+ expect(_context.sourcesNeedingProcessing.isEmpty, isTrue);
+ Source source =
+ new FileBasedSource.con1(FileUtilities2.createFile("/test.dart"));
+ ChangeSet changeSet = new ChangeSet();
+ changeSet.addedSource(source);
+ _context.applyChanges(changeSet);
+ expect(_context.sourcesNeedingProcessing.contains(source), isTrue);
+ return pumpEventQueue().then((_) {
+ listener.assertEvent(wereSourcesAdded: true);
+ listener.assertNoMoreEvents();
+ });
+ }
+
+ Future test_applyChanges_change() {
+ SourcesChangedListener listener = new SourcesChangedListener();
+ _context.onSourcesChanged.listen(listener.onData);
+ expect(_context.sourcesNeedingProcessing.isEmpty, isTrue);
+ Source source =
+ new FileBasedSource.con1(FileUtilities2.createFile("/test.dart"));
+ ChangeSet changeSet1 = new ChangeSet();
+ changeSet1.addedSource(source);
+ _context.applyChanges(changeSet1);
+ expect(_context.sourcesNeedingProcessing.contains(source), isTrue);
+ Source source2 =
+ new FileBasedSource.con1(FileUtilities2.createFile("/test2.dart"));
+ ChangeSet changeSet2 = new ChangeSet();
+ changeSet2.addedSource(source2);
+ changeSet2.changedSource(source);
+ _context.applyChanges(changeSet2);
+ return pumpEventQueue().then((_) {
+ listener.assertEvent(wereSourcesAdded: true);
+ listener.assertEvent(wereSourcesAdded: true, changedSources: [source]);
+ listener.assertNoMoreEvents();
+ });
+ }
+
+ Future test_applyChanges_change_content() {
+ SourcesChangedListener listener = new SourcesChangedListener();
+ _context.onSourcesChanged.listen(listener.onData);
+ expect(_context.sourcesNeedingProcessing.isEmpty, isTrue);
+ Source source =
+ new FileBasedSource.con1(FileUtilities2.createFile("/test.dart"));
+ ChangeSet changeSet1 = new ChangeSet();
+ changeSet1.addedSource(source);
+ _context.applyChanges(changeSet1);
+ expect(_context.sourcesNeedingProcessing.contains(source), isTrue);
+ Source source2 =
+ new FileBasedSource.con1(FileUtilities2.createFile("/test2.dart"));
+ ChangeSet changeSet2 = new ChangeSet();
+ changeSet2.addedSource(source2);
+ changeSet2.changedContent(source, 'library test;');
+ _context.applyChanges(changeSet2);
+ return pumpEventQueue().then((_) {
+ listener.assertEvent(wereSourcesAdded: true);
+ listener.assertEvent(wereSourcesAdded: true, changedSources: [source]);
+ listener.assertNoMoreEvents();
+ });
+ }
+
+ void test_applyChanges_change_flush_element() {
+ _context = contextWithCore();
+ _sourceFactory = _context.sourceFactory;
+ Source librarySource = _addSource("/lib.dart", r'''
+library lib;
+int a = 0;''');
+ expect(_context.computeLibraryElement(librarySource), isNotNull);
+ _context.setContents(librarySource, r'''
+library lib;
+int aa = 0;''');
+ expect(_context.getLibraryElement(librarySource), isNull);
+ }
+
+ Future test_applyChanges_change_multiple() {
+ _context = contextWithCore();
+ SourcesChangedListener listener = new SourcesChangedListener();
+ _context.onSourcesChanged.listen(listener.onData);
+ _sourceFactory = _context.sourceFactory;
+ String libraryContents1 = r'''
+library lib;
+part 'part.dart';
+int a = 0;''';
+ Source librarySource = _addSource("/lib.dart", libraryContents1);
+ String partContents1 = r'''
+part of lib;
+int b = a;''';
+ Source partSource = _addSource("/part.dart", partContents1);
+ _context.computeLibraryElement(librarySource);
+ String libraryContents2 = r'''
+library lib;
+part 'part.dart';
+int aa = 0;''';
+ _context.setContents(librarySource, libraryContents2);
+ String partContents2 = r'''
+part of lib;
+int b = aa;''';
+ _context.setContents(partSource, partContents2);
+ _context.computeLibraryElement(librarySource);
+ CompilationUnit libraryUnit =
+ _context.resolveCompilationUnit2(librarySource, librarySource);
+ expect(libraryUnit, isNotNull);
+ CompilationUnit partUnit =
+ _context.resolveCompilationUnit2(partSource, librarySource);
+ expect(partUnit, isNotNull);
+ TopLevelVariableDeclaration declaration =
+ libraryUnit.declarations[0] as TopLevelVariableDeclaration;
+ Element declarationElement = declaration.variables.variables[0].element;
+ TopLevelVariableDeclaration use =
+ partUnit.declarations[0] as TopLevelVariableDeclaration;
+ Element useElement = (use.variables.variables[
+ 0].initializer as SimpleIdentifier).staticElement;
+ expect((useElement as PropertyAccessorElement).variable,
+ same(declarationElement));
+ return pumpEventQueue().then((_) {
+ listener.assertEvent(wereSourcesAdded: true);
+ listener.assertEvent(changedSources: [librarySource]);
+ listener.assertEvent(wereSourcesAdded: true);
+ listener.assertEvent(changedSources: [partSource]);
+ listener.assertEvent(changedSources: [librarySource]);
+ listener.assertEvent(changedSources: [partSource]);
+ listener.assertNoMoreEvents();
+ });
+ }
+
+ Future test_applyChanges_change_range() {
+ SourcesChangedListener listener = new SourcesChangedListener();
+ _context.onSourcesChanged.listen(listener.onData);
+ expect(_context.sourcesNeedingProcessing.isEmpty, isTrue);
+ Source source =
+ new FileBasedSource.con1(FileUtilities2.createFile("/test.dart"));
+ ChangeSet changeSet1 = new ChangeSet();
+ changeSet1.addedSource(source);
+ _context.applyChanges(changeSet1);
+ expect(_context.sourcesNeedingProcessing.contains(source), isTrue);
+ Source source2 =
+ new FileBasedSource.con1(FileUtilities2.createFile("/test2.dart"));
+ ChangeSet changeSet2 = new ChangeSet();
+ changeSet2.addedSource(source2);
+ changeSet2.changedRange(source, 'library test;', 0, 0, 13);
+ _context.applyChanges(changeSet2);
+ return pumpEventQueue().then((_) {
+ listener.assertEvent(wereSourcesAdded: true);
+ listener.assertEvent(wereSourcesAdded: true, changedSources: [source]);
+ listener.assertNoMoreEvents();
+ });
+ }
+
+ void test_computeDocumentationComment_block() {
+ _context = contextWithCore();
+ _sourceFactory = _context.sourceFactory;
+ String comment = "/** Comment */";
+ Source source = _addSource("/test.dart", """
+$comment
+class A {}""");
+ LibraryElement libraryElement = _context.computeLibraryElement(source);
+ expect(libraryElement, isNotNull);
+ ClassElement classElement = libraryElement.definingCompilationUnit.types[0];
+ expect(libraryElement, isNotNull);
+ expect(_context.computeDocumentationComment(classElement), comment);
+ }
+
+ void test_computeDocumentationComment_none() {
+ _context = contextWithCore();
+ _sourceFactory = _context.sourceFactory;
+ Source source = _addSource("/test.dart", "class A {}");
+ LibraryElement libraryElement = _context.computeLibraryElement(source);
+ expect(libraryElement, isNotNull);
+ ClassElement classElement = libraryElement.definingCompilationUnit.types[0];
+ expect(libraryElement, isNotNull);
+ expect(_context.computeDocumentationComment(classElement), isNull);
+ }
+
+ void test_computeDocumentationComment_null() {
+ expect(_context.computeDocumentationComment(null), isNull);
+ }
+
+ void test_computeDocumentationComment_singleLine_multiple_EOL_n() {
+ _context = contextWithCore();
+ _sourceFactory = _context.sourceFactory;
+ String comment = "/// line 1\n/// line 2\n/// line 3\n";
+ Source source = _addSource("/test.dart", "${comment}class A {}");
+ LibraryElement libraryElement = _context.computeLibraryElement(source);
+ expect(libraryElement, isNotNull);
+ ClassElement classElement = libraryElement.definingCompilationUnit.types[0];
+ expect(libraryElement, isNotNull);
+ String actual = _context.computeDocumentationComment(classElement);
+ expect(actual, "/// line 1\n/// line 2\n/// line 3");
+ }
+
+ void test_computeDocumentationComment_singleLine_multiple_EOL_rn() {
+ _context = contextWithCore();
+ _sourceFactory = _context.sourceFactory;
+ String comment = "/// line 1\r\n/// line 2\r\n/// line 3\r\n";
+ Source source = _addSource("/test.dart", "${comment}class A {}");
+ LibraryElement libraryElement = _context.computeLibraryElement(source);
+ expect(libraryElement, isNotNull);
+ ClassElement classElement = libraryElement.definingCompilationUnit.types[0];
+ expect(libraryElement, isNotNull);
+ String actual = _context.computeDocumentationComment(classElement);
+ expect(actual, "/// line 1\n/// line 2\n/// line 3");
+ }
+
+ void test_computeExportedLibraries_none() {
+ Source source = _addSource("/test.dart", "library test;");
+ expect(_context.computeExportedLibraries(source), hasLength(0));
+ }
+
+ void test_computeExportedLibraries_some() {
+ // addSource("/lib1.dart", "library lib1;");
+ // addSource("/lib2.dart", "library lib2;");
+ Source source = _addSource(
+ "/test.dart", "library test; export 'lib1.dart'; export 'lib2.dart';");
+ expect(_context.computeExportedLibraries(source), hasLength(2));
+ }
+
+ void test_computeHtmlElement_nonHtml() {
+ Source source = _addSource("/test.dart", "library test;");
+ expect(_context.computeHtmlElement(source), isNull);
+ }
+
+ void test_computeKindOf_library() {
+ Source source = _addSource("/test.dart", "library lib;");
+ expect(_context.computeKindOf(source), same(SourceKind.LIBRARY));
+ }
+
+ void test_computeKindOf_libraryAndPart() {
+ Source source = _addSource("/test.dart", "library lib; part of lib;");
+ expect(_context.computeKindOf(source), same(SourceKind.LIBRARY));
+ }
+
+ void test_computeKindOf_part() {
+ Source source = _addSource("/test.dart", "part of lib;");
+ expect(_context.computeKindOf(source), same(SourceKind.PART));
+ }
+
+ void test_computeLibraryElement() {
+ _context = contextWithCore();
+ _sourceFactory = _context.sourceFactory;
+ Source source = _addSource("/test.dart", "library lib;");
+ LibraryElement element = _context.computeLibraryElement(source);
+ expect(element, isNotNull);
+ }
+
+ void test_computeLineInfo_dart() {
+ Source source = _addSource("/test.dart", r'''
+library lib;
+
+main() {}''');
+ LineInfo info = _context.computeLineInfo(source);
+ expect(info, isNotNull);
+ }
+
+ void test_computeLineInfo_html() {
+ Source source = _addSource("/test.html", r'''
+<html>
+ <body>
+ <h1>A</h1>
+ </body>
+</html>''');
+ LineInfo info = _context.computeLineInfo(source);
+ expect(info, isNotNull);
+ }
+
+ Future test_computeResolvedCompilationUnitAsync_afterDispose() {
+ _context = contextWithCore();
+ _sourceFactory = _context.sourceFactory;
+ Source source = _addSource("/lib.dart", "library lib;");
+ // Complete all pending analysis tasks and flush the AST so that it won't
+ // be available immediately.
+ _performPendingAnalysisTasks();
+ CacheEntry entry = _context.getReadableSourceEntryOrNull(source);
+ entry.flushAstStructures();
+ // Dispose of the context.
+ _context.dispose();
+ // Any attempt to start an asynchronous computation should return a future
+ // which completes with error.
+ CancelableFuture<CompilationUnit> future =
+ _context.computeResolvedCompilationUnitAsync(source, source);
+ bool completed = false;
+ future.then((CompilationUnit unit) {
+ fail('Future should have completed with error');
+ }, onError: (error) {
+ expect(error, new isInstanceOf<AnalysisNotScheduledError>());
+ completed = true;
+ });
+ return pumpEventQueue().then((_) {
+ expect(completed, isTrue);
+ });
+ }
+
+ void test_dispose() {
+ expect(_context.isDisposed, isFalse);
+ _context.dispose();
+ expect(_context.isDisposed, isTrue);
+ }
+
+ void test_exists_false() {
+ TestSource source = new TestSource();
+ source.exists2 = false;
+ expect(_context.exists(source), isFalse);
+ }
+
+ void test_exists_null() {
+ expect(_context.exists(null), isFalse);
+ }
+
+ void test_exists_overridden() {
+ Source source = new TestSource();
+ _context.setContents(source, "");
+ expect(_context.exists(source), isTrue);
+ }
+
+ void test_exists_true() {
+ expect(_context.exists(new AnalysisContextImplTest_Source_exists_true()),
+ isTrue);
+ }
+
+ void test_getAnalysisOptions() {
+ expect(_context.analysisOptions, isNotNull);
+ }
+
+ void test_getContents_fromSource() {
+ String content = "library lib;";
+ TimestampedData<String> contents =
+ _context.getContents(new TestSource('/test.dart', content));
+ expect(contents.data.toString(), content);
+ }
+
+ void test_getContents_overridden() {
+ String content = "library lib;";
+ Source source = new TestSource();
+ _context.setContents(source, content);
+ TimestampedData<String> contents = _context.getContents(source);
+ expect(contents.data.toString(), content);
+ }
+
+ void test_getContents_unoverridden() {
+ String content = "library lib;";
+ Source source = new TestSource('/test.dart', content);
+ _context.setContents(source, "part of lib;");
+ _context.setContents(source, null);
+ TimestampedData<String> contents = _context.getContents(source);
+ expect(contents.data.toString(), content);
+ }
+
+ void test_getDeclaredVariables() {
+ _context = contextWithCore();
+ expect(_context.declaredVariables, isNotNull);
+ }
+
+ void test_getElement() {
+ _context = contextWithCore();
+ _sourceFactory = _context.sourceFactory;
+ LibraryElement core =
+ _context.computeLibraryElement(_sourceFactory.forUri("dart:core"));
+ expect(core, isNotNull);
+ ClassElement classObject =
+ _findClass(core.definingCompilationUnit, "Object");
+ expect(classObject, isNotNull);
+ ElementLocation location = classObject.location;
+ Element element = _context.getElement(location);
+ expect(element, same(classObject));
+ }
+
+ void test_getHtmlElement_dart() {
+ Source source = _addSource("/test.dart", "");
+ expect(_context.getHtmlElement(source), isNull);
+ expect(_context.computeHtmlElement(source), isNull);
+ expect(_context.getHtmlElement(source), isNull);
+ }
+
+ void test_getHtmlFilesReferencing_html() {
+ _context = contextWithCore();
+ _sourceFactory = _context.sourceFactory;
+ Source htmlSource = _addSource("/test.html", r'''
+<html><head>
+<script type='application/dart' src='test.dart'/>
+<script type='application/dart' src='test.js'/>
+</head></html>''');
+ Source librarySource = _addSource("/test.dart", "library lib;");
+ Source secondHtmlSource = _addSource("/test.html", "<html></html>");
+ _context.computeLibraryElement(librarySource);
+ List<Source> result = _context.getHtmlFilesReferencing(secondHtmlSource);
+ expect(result, hasLength(0));
+ _context.parseHtmlUnit(htmlSource);
+ result = _context.getHtmlFilesReferencing(secondHtmlSource);
+ expect(result, hasLength(0));
+ }
+
+ void test_getKindOf_library() {
+ Source source = _addSource("/test.dart", "library lib;");
+ expect(_context.getKindOf(source), same(SourceKind.UNKNOWN));
+ _context.computeKindOf(source);
+ expect(_context.getKindOf(source), same(SourceKind.LIBRARY));
+ }
+
+ void test_getKindOf_part() {
+ Source source = _addSource("/test.dart", "part of lib;");
+ expect(_context.getKindOf(source), same(SourceKind.UNKNOWN));
+ _context.computeKindOf(source);
+ expect(_context.getKindOf(source), same(SourceKind.PART));
+ }
+
+ void test_getKindOf_unknown() {
+ Source source = _addSource("/test.css", "");
+ expect(_context.getKindOf(source), same(SourceKind.UNKNOWN));
+ }
+
+ void test_getLaunchableClientLibrarySources_doesNotImportHtml() {
+ _context = contextWithCore();
+ _sourceFactory = _context.sourceFactory;
+ Source source = _addSource("/test.dart", r'''
+main() {}''');
+ _context.computeLibraryElement(source);
+ List<Source> sources = _context.launchableClientLibrarySources;
+ expect(sources, isEmpty);
+ }
+
+ void test_getLaunchableClientLibrarySources_importsHtml_explicitly() {
+ _context = contextWithCore();
+ _sourceFactory = _context.sourceFactory;
+ List<Source> sources = _context.launchableClientLibrarySources;
+ expect(sources, isEmpty);
+ Source source = _addSource("/test.dart", r'''
+import 'dart:html';
+main() {}''');
+ _context.computeLibraryElement(source);
+ sources = _context.launchableClientLibrarySources;
+ expect(sources, unorderedEquals([source]));
+ }
+
+ void test_getLaunchableClientLibrarySources_importsHtml_implicitly() {
+ _context = contextWithCore();
+ _sourceFactory = _context.sourceFactory;
+ List<Source> sources = _context.launchableClientLibrarySources;
+ expect(sources, isEmpty);
+ _addSource("/a.dart", r'''
+import 'dart:html';
+''');
+ Source source = _addSource("/test.dart", r'''
+import 'a.dart';
+main() {}''');
+ _context.computeLibraryElement(source);
+ sources = _context.launchableClientLibrarySources;
+ expect(sources, unorderedEquals([source]));
+ }
+
+ void test_getLaunchableClientLibrarySources_importsHtml_implicitly2() {
+ _context = contextWithCore();
+ _sourceFactory = _context.sourceFactory;
+ List<Source> sources = _context.launchableClientLibrarySources;
+ expect(sources, isEmpty);
+ _addSource("/a.dart", r'''
+export 'dart:html';
+''');
+ Source source = _addSource("/test.dart", r'''
+import 'a.dart';
+main() {}''');
+ _context.computeLibraryElement(source);
+ sources = _context.launchableClientLibrarySources;
+ expect(sources, unorderedEquals([source]));
+ }
+
+ void test_getLaunchableServerLibrarySources() {
+ _context = contextWithCore();
+ _sourceFactory = _context.sourceFactory;
+ expect(_context.launchableServerLibrarySources, isEmpty);
+ Source source = _addSource("/test.dart", "main() {}");
+ _context.computeLibraryElement(source);
+ expect(_context.launchableServerLibrarySources, unorderedEquals([source]));
+ }
+
+ void test_getLaunchableServerLibrarySources_importsHtml_explicitly() {
+ _context = contextWithCore();
+ _sourceFactory = _context.sourceFactory;
+ Source source = _addSource("/test.dart", r'''
+import 'dart:html';
+main() {}
+''');
+ _context.computeLibraryElement(source);
+ expect(_context.launchableServerLibrarySources, isEmpty);
+ }
+
+ void test_getLaunchableServerLibrarySources_importsHtml_implicitly() {
+ _context = contextWithCore();
+ _sourceFactory = _context.sourceFactory;
+ _addSource("/imports_html.dart", r'''
+import 'dart:html';
+''');
+ Source source = _addSource("/test.dart", r'''
+import 'imports_html.dart';
+main() {}''');
+ _context.computeLibraryElement(source);
+ expect(_context.launchableServerLibrarySources, isEmpty);
+ }
+
+ void test_getLaunchableServerLibrarySources_noMain() {
+ _context = contextWithCore();
+ _sourceFactory = _context.sourceFactory;
+ Source source = _addSource("/test.dart", '');
+ _context.computeLibraryElement(source);
+ expect(_context.launchableServerLibrarySources, isEmpty);
+ }
+
+ void test_getLibrariesDependingOn() {
+ _context = contextWithCore();
+ _sourceFactory = _context.sourceFactory;
+ Source libASource = _addSource("/libA.dart", "library libA;");
+ _addSource("/libB.dart", "library libB;");
+ Source lib1Source = _addSource("/lib1.dart", r'''
+library lib1;
+import 'libA.dart';
+export 'libB.dart';''');
+ Source lib2Source = _addSource("/lib2.dart", r'''
+library lib2;
+import 'libB.dart';
+export 'libA.dart';''');
+ _context.computeLibraryElement(lib1Source);
+ _context.computeLibraryElement(lib2Source);
+ List<Source> result = _context.getLibrariesDependingOn(libASource);
+ expect(result, unorderedEquals([lib1Source, lib2Source]));
+ }
+
+ void test_getLibrariesReferencedFromHtml_no() {
+ _context = contextWithCore();
+ _sourceFactory = _context.sourceFactory;
+ Source htmlSource = _addSource("/test.html", r'''
+<html><head>
+<script type='application/dart' src='test.js'/>
+</head></html>''');
+ _addSource("/test.dart", "library lib;");
+ _context.parseHtmlUnit(htmlSource);
+ List<Source> result = _context.getLibrariesReferencedFromHtml(htmlSource);
+ expect(result, hasLength(0));
+ }
+
+ void test_getLibraryElement() {
+ _context = contextWithCore();
+ _sourceFactory = _context.sourceFactory;
+ Source source = _addSource("/test.dart", "library lib;");
+ LibraryElement element = _context.getLibraryElement(source);
+ expect(element, isNull);
+ _context.computeLibraryElement(source);
+ element = _context.getLibraryElement(source);
+ expect(element, isNotNull);
+ }
+
+ void test_getLibrarySources() {
+ List<Source> sources = _context.librarySources;
+ int originalLength = sources.length;
+ Source source = _addSource("/test.dart", "library lib;");
+ _context.computeKindOf(source);
+ sources = _context.librarySources;
+ expect(sources, hasLength(originalLength + 1));
+ for (Source returnedSource in sources) {
+ if (returnedSource == source) {
+ return;
+ }
+ }
+ fail("The added source was not in the list of library sources");
+ }
+
+ void test_getLineInfo() {
+ Source source = _addSource("/test.dart", r'''
+library lib;
+
+main() {}''');
+ LineInfo info = _context.getLineInfo(source);
+ expect(info, isNull);
+ _context.parseCompilationUnit(source);
+ info = _context.getLineInfo(source);
+ expect(info, isNotNull);
+ }
+
+ void test_getModificationStamp_fromSource() {
+ int stamp = 42;
+ expect(_context.getModificationStamp(
+ new AnalysisContextImplTest_Source_getModificationStamp_fromSource(
+ stamp)), stamp);
+ }
+
+ void test_getModificationStamp_overridden() {
+ int stamp = 42;
+ Source source =
+ new AnalysisContextImplTest_Source_getModificationStamp_overridden(
+ stamp);
+ _context.setContents(source, "");
+ expect(stamp != _context.getModificationStamp(source), isTrue);
+ }
+
+ void test_getPublicNamespace_element() {
+ _context = contextWithCore();
+ _sourceFactory = _context.sourceFactory;
+ Source source = _addSource("/test.dart", "class A {}");
+ LibraryElement library = _context.computeLibraryElement(source);
+ expect(library, isNotNull);
+ Namespace namespace = _context.getPublicNamespace(library);
+ expect(namespace, isNotNull);
+ EngineTestCase.assertInstanceOf(
+ (obj) => obj is ClassElement, ClassElement, namespace.get("A"));
+ }
+
+ void test_getResolvedCompilationUnit_library_null() {
+ _context = contextWithCore();
+ _sourceFactory = _context.sourceFactory;
+ Source source = _addSource("/lib.dart", "library lib;");
+ expect(_context.getResolvedCompilationUnit(source, null), isNull);
+ }
+
+ void test_getResolvedCompilationUnit_source_dart() {
+ _context = contextWithCore();
+ _sourceFactory = _context.sourceFactory;
+ Source source = _addSource("/lib.dart", "library lib;");
+ expect(_context.getResolvedCompilationUnit2(source, source), isNull);
+ _context.resolveCompilationUnit2(source, source);
+ expect(_context.getResolvedCompilationUnit2(source, source), isNotNull);
+ }
+
+ void test_getResolvedCompilationUnit_source_html() {
+ _context = contextWithCore();
+ _sourceFactory = _context.sourceFactory;
+ Source source = _addSource("/test.html", "<html></html>");
+ expect(_context.getResolvedCompilationUnit2(source, source), isNull);
+ expect(_context.resolveCompilationUnit2(source, source), isNull);
+ expect(_context.getResolvedCompilationUnit2(source, source), isNull);
+ }
+
+ void test_getSourceFactory() {
+ expect(_context.sourceFactory, same(_sourceFactory));
+ }
+
+ void test_getSourcesWithFullName() {
+ String filePath = '/foo/lib/file.dart';
+ List<Source> expected = <Source>[];
+ ChangeSet changeSet = new ChangeSet();
+
+ TestSourceWithUri source1 =
+ new TestSourceWithUri(filePath, Uri.parse('file://$filePath'));
+ expected.add(source1);
+ changeSet.addedSource(source1);
+
+ TestSourceWithUri source2 =
+ new TestSourceWithUri(filePath, Uri.parse('package:foo/file.dart'));
+ expected.add(source2);
+ changeSet.addedSource(source2);
+
+ _context.applyChanges(changeSet);
+ expect(
+ _context.getSourcesWithFullName(filePath), unorderedEquals(expected));
+ }
+
+ void test_getStatistics() {
+ AnalysisContextStatistics statistics = _context.statistics;
+ expect(statistics, isNotNull);
+ // The following lines are fragile.
+ // The values depend on the number of libraries in the SDK.
+// assertLength(0, statistics.getCacheRows());
+// assertLength(0, statistics.getExceptions());
+// assertLength(0, statistics.getSources());
+ }
+
+ void test_isClientLibrary_dart() {
+ _context = contextWithCore();
+ _sourceFactory = _context.sourceFactory;
+ Source source = _addSource("/test.dart", r'''
+import 'dart:html';
+
+main() {}''');
+ expect(_context.isClientLibrary(source), isFalse);
+ expect(_context.isServerLibrary(source), isFalse);
+ _context.computeLibraryElement(source);
+ expect(_context.isClientLibrary(source), isTrue);
+ expect(_context.isServerLibrary(source), isFalse);
+ }
+
+ void test_isClientLibrary_html() {
+ Source source = _addSource("/test.html", "<html></html>");
+ expect(_context.isClientLibrary(source), isFalse);
+ }
+
+ void test_isServerLibrary_dart() {
+ _context = contextWithCore();
+ _sourceFactory = _context.sourceFactory;
+ Source source = _addSource("/test.dart", r'''
+library lib;
+
+main() {}''');
+ expect(_context.isClientLibrary(source), isFalse);
+ expect(_context.isServerLibrary(source), isFalse);
+ _context.computeLibraryElement(source);
+ expect(_context.isClientLibrary(source), isFalse);
+ expect(_context.isServerLibrary(source), isTrue);
+ }
+
+ void test_isServerLibrary_html() {
+ Source source = _addSource("/test.html", "<html></html>");
+ expect(_context.isServerLibrary(source), isFalse);
+ }
+
+ void test_parseCompilationUnit_errors() {
+ Source source = _addSource("/lib.dart", "library {");
+ CompilationUnit compilationUnit = _context.parseCompilationUnit(source);
+ expect(compilationUnit, isNotNull);
+ var errorInfo = _context.getErrors(source);
+ expect(errorInfo, isNotNull);
+ List<AnalysisError> errors = errorInfo.errors;
+ expect(errors, isNotNull);
+ expect(errors.length > 0, isTrue);
+ }
+
+ void test_parseCompilationUnit_exception() {
+ Source source = _addSourceWithException("/test.dart");
+ try {
+ _context.parseCompilationUnit(source);
+ fail("Expected AnalysisException");
+ } on AnalysisException {
+ // Expected
+ }
+ }
+
+ void test_parseCompilationUnit_html() {
+ Source source = _addSource("/test.html", "<html></html>");
+ expect(_context.parseCompilationUnit(source), isNull);
+ }
+
+ void test_parseCompilationUnit_noErrors() {
+ Source source = _addSource("/lib.dart", "library lib;");
+ CompilationUnit compilationUnit = _context.parseCompilationUnit(source);
+ expect(compilationUnit, isNotNull);
+ AnalysisErrorInfo errorInfo = _context.getErrors(source);
+ expect(errorInfo, isNotNull);
+ expect(errorInfo.errors, hasLength(0));
+ }
+
+// void test_resolveCompilationUnit_sourceChangeDuringResolution() {
+// _context = new _AnalysisContext_sourceChangeDuringResolution();
+// AnalysisContextFactory.initContextWithCore(_context);
+// _sourceFactory = _context.sourceFactory;
+// Source source = _addSource("/lib.dart", "library lib;");
+// CompilationUnit compilationUnit =
+// _context.resolveCompilationUnit2(source, source);
+// expect(compilationUnit, isNotNull);
+// expect(_context.getLineInfo(source), isNotNull);
+// }
+
+ void test_parseCompilationUnit_nonExistentSource() {
+ Source source =
+ new FileBasedSource.con1(FileUtilities2.createFile("/test.dart"));
+ try {
+ _context.parseCompilationUnit(source);
+ fail("Expected AnalysisException because file does not exist");
+ } on AnalysisException {
+ // Expected result
+ }
+ }
+
+ void test_performAnalysisTask_modifiedAfterParse() {
+ // TODO(scheglov) no threads in Dart
+// Source source = _addSource("/test.dart", "library lib;");
+// int initialTime = _context.getModificationStamp(source);
+// List<Source> sources = new List<Source>();
+// sources.add(source);
+// _context.analysisPriorityOrder = sources;
+// _context.parseCompilationUnit(source);
+// while (initialTime == JavaSystem.currentTimeMillis()) {
+// Thread.sleep(1);
+// // Force the modification time to be different.
+// }
+// _context.setContents(source, "library test;");
+// JUnitTestCase.assertTrue(initialTime != _context.getModificationStamp(source));
+// _analyzeAll_assertFinished();
+// JUnitTestCase.assertNotNullMsg("performAnalysisTask failed to compute an element model", _context.getLibraryElement(source));
+ }
+
+ void test_resolveCompilationUnit_library() {
+ _context = contextWithCore();
+ _sourceFactory = _context.sourceFactory;
+ Source source = _addSource("/lib.dart", "library lib;");
+ LibraryElement library = _context.computeLibraryElement(source);
+ CompilationUnit compilationUnit =
+ _context.resolveCompilationUnit(source, library);
+ expect(compilationUnit, isNotNull);
+ expect(compilationUnit.element, isNotNull);
+ }
+
+ void test_resolveCompilationUnit_source() {
+ _context = contextWithCore();
+ _sourceFactory = _context.sourceFactory;
+ Source source = _addSource("/lib.dart", "library lib;");
+ CompilationUnit compilationUnit =
+ _context.resolveCompilationUnit2(source, source);
+ expect(compilationUnit, isNotNull);
+ }
+
+ void test_setAnalysisOptions() {
+ AnalysisOptionsImpl options = new AnalysisOptionsImpl();
+ options.cacheSize = 42;
+ options.dart2jsHint = false;
+ options.hint = false;
+ _context.analysisOptions = options;
+ AnalysisOptions result = _context.analysisOptions;
+ expect(result.cacheSize, options.cacheSize);
+ expect(result.dart2jsHint, options.dart2jsHint);
+ expect(result.hint, options.hint);
+ }
+
+ void test_setAnalysisPriorityOrder_empty() {
+ _context.analysisPriorityOrder = new List<Source>();
+ }
+
+ void test_setAnalysisPriorityOrder_nonEmpty() {
+ List<Source> sources = new List<Source>();
+ sources.add(_addSource("/lib.dart", "library lib;"));
+ _context.analysisPriorityOrder = sources;
+ }
+
+ void test_setChangedContents_notResolved() {
+ _context = contextWithCore();
+ AnalysisOptionsImpl options =
+ new AnalysisOptionsImpl.con1(_context.analysisOptions);
+ options.incremental = true;
+ _context.analysisOptions = options;
+ _sourceFactory = _context.sourceFactory;
+ String oldCode = r'''
+library lib;
+int a = 0;''';
+ Source librarySource = _addSource("/lib.dart", oldCode);
+ int offset = oldCode.indexOf("int a") + 4;
+ String newCode = r'''
+library lib;
+int ya = 0;''';
+ _context.setChangedContents(librarySource, newCode, offset, 0, 1);
+ expect(_context.getContents(librarySource).data, newCode);
+ expect(_getIncrementalAnalysisCache(_context), isNull);
+ }
+
+ Future test_setContents_libraryWithPart() {
+ _context = contextWithCore();
+ SourcesChangedListener listener = new SourcesChangedListener();
+ _context.onSourcesChanged.listen(listener.onData);
+ _sourceFactory = _context.sourceFactory;
+ String libraryContents1 = r'''
+library lib;
+part 'part.dart';
+int a = 0;''';
+ Source librarySource = _addSource("/lib.dart", libraryContents1);
+ String partContents1 = r'''
+part of lib;
+int b = a;''';
+ Source partSource = _addSource("/part.dart", partContents1);
+ _context.computeLibraryElement(librarySource);
+ IncrementalAnalysisCache incrementalCache = new IncrementalAnalysisCache(
+ librarySource, librarySource, null, null, null, 0, 0, 0);
+ _setIncrementalAnalysisCache(_context, incrementalCache);
+ expect(_getIncrementalAnalysisCache(_context), same(incrementalCache));
+ String libraryContents2 = r'''
+library lib;
+part 'part.dart';
+int aa = 0;''';
+ _context.setContents(librarySource, libraryContents2);
+ expect(_context.getResolvedCompilationUnit2(partSource, librarySource),
+ isNull);
+ expect(_getIncrementalAnalysisCache(_context), isNull);
+ return pumpEventQueue().then((_) {
+ listener.assertEvent(wereSourcesAdded: true);
+ listener.assertEvent(changedSources: [librarySource]);
+ listener.assertEvent(wereSourcesAdded: true);
+ listener.assertEvent(changedSources: [partSource]);
+ listener.assertEvent(changedSources: [librarySource]);
+ listener.assertNoMoreEvents();
+ });
+ }
+
+ void test_setContents_null() {
+ _context = contextWithCore();
+ _sourceFactory = _context.sourceFactory;
+ Source librarySource = _addSource("/lib.dart", r'''
+library lib;
+int a = 0;''');
+ _context.computeLibraryElement(librarySource);
+ IncrementalAnalysisCache incrementalCache = new IncrementalAnalysisCache(
+ librarySource, librarySource, null, null, null, 0, 0, 0);
+ _setIncrementalAnalysisCache(_context, incrementalCache);
+ expect(_getIncrementalAnalysisCache(_context), same(incrementalCache));
+ _context.setContents(librarySource, null);
+ expect(_context.getResolvedCompilationUnit2(librarySource, librarySource),
+ isNull);
+ expect(_getIncrementalAnalysisCache(_context), isNull);
+ }
+
+ void test_setSourceFactory() {
+ expect(_context.sourceFactory, _sourceFactory);
+ SourceFactory factory = new SourceFactory([]);
+ _context.sourceFactory = factory;
+ expect(_context.sourceFactory, factory);
+ }
+
+ void test_updateAnalysis() {
+ expect(_context.sourcesNeedingProcessing.isEmpty, isTrue);
+ Source source =
+ new FileBasedSource.con1(FileUtilities2.createFile("/test.dart"));
+ AnalysisDelta delta = new AnalysisDelta();
+ delta.setAnalysisLevel(source, AnalysisLevel.ALL);
+ _context.applyAnalysisDelta(delta);
+ expect(_context.sourcesNeedingProcessing.contains(source), isTrue);
+ delta = new AnalysisDelta();
+ delta.setAnalysisLevel(source, AnalysisLevel.NONE);
+ _context.applyAnalysisDelta(delta);
+ expect(_context.sourcesNeedingProcessing.contains(source), isFalse);
+ }
+
+ Future xtest_computeResolvedCompilationUnitAsync() {
+ _context = contextWithCore();
+ _sourceFactory = _context.sourceFactory;
+ Source source = _addSource("/lib.dart", "library lib;");
+ // Complete all pending analysis tasks and flush the AST so that it won't
+ // be available immediately.
+ _performPendingAnalysisTasks();
+ CacheEntry entry = _context.getReadableSourceEntryOrNull(source);
+ entry.flushAstStructures();
+ bool completed = false;
+ _context
+ .computeResolvedCompilationUnitAsync(source, source)
+ .then((CompilationUnit unit) {
+ expect(unit, isNotNull);
+ completed = true;
+ });
+ return pumpEventQueue().then((_) {
+ expect(completed, isFalse);
+ _performPendingAnalysisTasks();
+ }).then((_) => pumpEventQueue()).then((_) {
+ expect(completed, isTrue);
+ });
+ }
+
+ Future xtest_computeResolvedCompilationUnitAsync_cancel() {
+ _context = contextWithCore();
+ _sourceFactory = _context.sourceFactory;
+ Source source = _addSource("/lib.dart", "library lib;");
+ // Complete all pending analysis tasks and flush the AST so that it won't
+ // be available immediately.
+ _performPendingAnalysisTasks();
+ CacheEntry entry = _context.getReadableSourceEntryOrNull(source);
+ entry.flushAstStructures();
+ CancelableFuture<CompilationUnit> future =
+ _context.computeResolvedCompilationUnitAsync(source, source);
+ bool completed = false;
+ future.then((CompilationUnit unit) {
+ fail('Future should have been canceled');
+ }, onError: (error) {
+ expect(error, new isInstanceOf<FutureCanceledError>());
+ completed = true;
+ });
+ expect(completed, isFalse);
+ expect(_context.pendingFutureSources_forTesting, isNotEmpty);
+ future.cancel();
+ expect(_context.pendingFutureSources_forTesting, isEmpty);
+ return pumpEventQueue().then((_) {
+ expect(completed, isTrue);
+ expect(_context.pendingFutureSources_forTesting, isEmpty);
+ });
+ }
+
+ void xtest_performAnalysisTask_stress() {
+ int maxCacheSize = 4;
+ AnalysisOptionsImpl options =
+ new AnalysisOptionsImpl.con1(_context.analysisOptions);
+ options.cacheSize = maxCacheSize;
+ _context.analysisOptions = options;
+ int sourceCount = maxCacheSize + 2;
+ List<Source> sources = new List<Source>();
+ ChangeSet changeSet = new ChangeSet();
+ for (int i = 0; i < sourceCount; i++) {
+ Source source = _addSource("/lib$i.dart", "library lib$i;");
+ sources.add(source);
+ changeSet.addedSource(source);
+ }
+ _context.applyChanges(changeSet);
+ _context.analysisPriorityOrder = sources;
+ for (int i = 0; i < 1000; i++) {
+ List<ChangeNotice> notice = _context.performAnalysisTask().changeNotices;
+ if (notice == null) {
+ //System.out.println("test_performAnalysisTask_stress: " + i);
+ break;
+ }
+ }
+ List<ChangeNotice> notice = _context.performAnalysisTask().changeNotices;
+ if (notice != null) {
+ fail(
+ "performAnalysisTask failed to terminate after analyzing all sources");
+ }
+ }
+
+ Source _addSource(String fileName, String contents) {
+ Source source =
+ new FileBasedSource.con1(FileUtilities2.createFile(fileName));
+ ChangeSet changeSet = new ChangeSet();
+ changeSet.addedSource(source);
+ _context.applyChanges(changeSet);
+ _context.setContents(source, contents);
+ return source;
+ }
+
+ TestSource _addSourceWithException(String fileName) {
+ return _addSourceWithException2(fileName, "");
+ }
+
+ TestSource _addSourceWithException2(String fileName, String contents) {
+ TestSource source = new TestSource(fileName, contents);
+ source.generateExceptionOnRead = true;
+ ChangeSet changeSet = new ChangeSet();
+ changeSet.addedSource(source);
+ _context.applyChanges(changeSet);
+ return source;
+ }
+
+ /**
+ * Perform analysis tasks up to 512 times and asserts that that was enough.
+ */
+ void _analyzeAll_assertFinished() {
+ _analyzeAll_assertFinished2(512);
+ }
+
+ /**
+ * Perform analysis tasks up to the given number of times and asserts that that was enough.
+ *
+ * @param maxIterations the maximum number of tasks to perform
+ */
+ void _analyzeAll_assertFinished2(int maxIterations) {
+ for (int i = 0; i < maxIterations; i++) {
+ List<ChangeNotice> notice = _context.performAnalysisTask().changeNotices;
+ if (notice == null) {
+ return;
+ }
+ }
+ fail("performAnalysisTask failed to terminate after analyzing all sources");
+ }
+
+ void _changeSource(TestSource source, String contents) {
+ source.setContents(contents);
+ ChangeSet changeSet = new ChangeSet();
+ changeSet.changedSource(source);
+ _context.applyChanges(changeSet);
+ }
+
+ /**
+ * Search the given compilation unit for a class with the given name. Return the class with the
+ * given name, or `null` if the class cannot be found.
+ *
+ * @param unit the compilation unit being searched
+ * @param className the name of the class being searched for
+ * @return the class with the given name
+ */
+ ClassElement _findClass(CompilationUnitElement unit, String className) {
+ for (ClassElement classElement in unit.types) {
+ if (classElement.displayName == className) {
+ return classElement;
+ }
+ }
+ return null;
+ }
+
+ IncrementalAnalysisCache _getIncrementalAnalysisCache(
+ AnalysisContextImpl context2) {
+ return context2.test_incrementalAnalysisCache;
+ }
+
+ List<Source> _getPriorityOrder(AnalysisContextImpl context2) {
+ return context2.test_priorityOrder;
+ }
+
+ void _performPendingAnalysisTasks([int maxTasks = 20]) {
+ for (int i = 0; _context.performAnalysisTask().hasMoreWork; i++) {
+ if (i > maxTasks) {
+ fail('Analysis did not terminate.');
+ }
+ }
+ }
+
+ void _removeSource(Source source) {
+ ChangeSet changeSet = new ChangeSet();
+ changeSet.removedSource(source);
+ _context.applyChanges(changeSet);
+ }
+
+ void _setIncrementalAnalysisCache(
+ AnalysisContextImpl context, IncrementalAnalysisCache incrementalCache) {
+ context.test_incrementalAnalysisCache = incrementalCache;
+ }
+
+ /**
+ * Returns `true` if there is an [AnalysisError] with [ErrorSeverity.ERROR] in
+ * the given [AnalysisErrorInfo].
+ */
+ static bool _hasAnalysisErrorWithErrorSeverity(AnalysisErrorInfo errorInfo) {
+ List<AnalysisError> errors = errorInfo.errors;
+ for (AnalysisError analysisError in errors) {
+ if (analysisError.errorCode.errorSeverity == ErrorSeverity.ERROR) {
+ return true;
+ }
+ }
+ return false;
+ }
+}
+
+//class FakeSdk extends DirectoryBasedDartSdk {
+// FakeSdk(JavaFile arg0) : super(arg0);
+//
+// @override
+// LibraryMap initialLibraryMap(bool useDart2jsPaths) {
+// LibraryMap map = new LibraryMap();
+// _addLibrary(map, DartSdk.DART_ASYNC, false, "async.dart");
+// _addLibrary(map, DartSdk.DART_CORE, false, "core.dart");
+// _addLibrary(map, DartSdk.DART_HTML, false, "html_dartium.dart");
+// _addLibrary(map, "dart:math", false, "math.dart");
+// _addLibrary(map, "dart:_interceptors", true, "_interceptors.dart");
+// _addLibrary(map, "dart:_js_helper", true, "_js_helper.dart");
+// return map;
+// }
+//
+// void _addLibrary(LibraryMap map, String uri, bool isInternal, String path) {
+// SdkLibraryImpl library = new SdkLibraryImpl(uri);
+// if (isInternal) {
+// library.category = "Internal";
+// }
+// library.path = path;
+// map.setLibrary(uri, library);
+// }
+//}
+
+class _AnalysisContextImplTest_test_applyChanges_removeContainer
+ implements SourceContainer {
+ Source libB;
+ _AnalysisContextImplTest_test_applyChanges_removeContainer(this.libB);
+ @override
+ bool contains(Source source) => source == libB;
+}
+
+class _Source_getContent_throwException extends NonExistingSource {
+ _Source_getContent_throwException(String name)
+ : super(name, UriKind.FILE_URI);
+
+ @override
+ TimestampedData<String> get contents {
+ throw 'Read error';
+ }
+
+ @override
+ bool exists() => true;
+}
diff --git a/pkg/analyzer/test/src/context/mock_sdk.dart b/pkg/analyzer/test/src/context/mock_sdk.dart
new file mode 100644
index 0000000..e5b7bcb
--- /dev/null
+++ b/pkg/analyzer/test/src/context/mock_sdk.dart
@@ -0,0 +1,337 @@
+// Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+library test.src.mock_sdk;
+
+import 'package:analyzer/file_system/file_system.dart' as resource;
+import 'package:analyzer/file_system/memory_file_system.dart' as resource;
+import 'package:analyzer/src/context/cache.dart';
+import 'package:analyzer/src/context/context.dart';
+import 'package:analyzer/src/generated/engine.dart'
+ show AnalysisEngine, ChangeSet;
+import 'package:analyzer/src/generated/sdk.dart';
+import 'package:analyzer/src/generated/source.dart';
+
+class MockSdk implements DartSdk {
+ static const _MockSdkLibrary LIB_CORE = const _MockSdkLibrary('dart:core',
+ '/lib/core/core.dart', '''
+library dart.core;
+
+import 'dart:async';
+
+class Object {
+ bool operator ==(other) => identical(this, other);
+ String toString() => 'a string';
+ int get hashCode => 0;
+}
+
+class Function {}
+class StackTrace {}
+class Symbol {}
+class Type {}
+
+abstract class Comparable<T> {
+ int compareTo(T other);
+}
+
+abstract class String implements Comparable<String> {
+ external factory String.fromCharCodes(Iterable<int> charCodes,
+ [int start = 0, int end]);
+ bool get isEmpty => false;
+ bool get isNotEmpty => false;
+ int get length => 0;
+ String toUpperCase();
+ List<int> get codeUnits;
+}
+
+class bool extends Object {}
+abstract class num implements Comparable<num> {
+ bool operator <(num other);
+ bool operator <=(num other);
+ bool operator >(num other);
+ bool operator >=(num other);
+ num operator +(num other);
+ num operator -(num other);
+ num operator *(num other);
+ num operator /(num other);
+ int toInt();
+ num abs();
+ int round();
+}
+abstract class int extends num {
+ bool get isEven => false;
+ int operator -();
+ external static int parse(String source,
+ { int radix,
+ int onError(String source) });
+}
+class double extends num {}
+class DateTime extends Object {}
+class Null extends Object {}
+
+class Deprecated extends Object {
+ final String expires;
+ const Deprecated(this.expires);
+}
+const Object deprecated = const Deprecated("next release");
+
+class Iterator<E> {
+ bool moveNext();
+ E get current;
+}
+
+abstract class Iterable<E> {
+ Iterator<E> get iterator;
+ bool get isEmpty;
+}
+
+abstract class List<E> implements Iterable<E> {
+ void add(E value);
+ E operator [](int index);
+ void operator []=(int index, E value);
+ Iterator<E> get iterator => null;
+ void clear();
+}
+
+abstract class Map<K, V> extends Object {
+ Iterable<K> get keys;
+}
+
+external bool identical(Object a, Object b);
+
+void print(Object object) {}
+
+class _Override {
+ const _Override();
+}
+const Object override = const _Override();
+''');
+
+ static const _MockSdkLibrary LIB_ASYNC = const _MockSdkLibrary('dart:async',
+ '/lib/async/async.dart', '''
+library dart.async;
+
+import 'dart:math';
+
+class Future<T> {
+ factory Future.delayed(Duration duration, [T computation()]) => null;
+ factory Future.value([value]) => null;
+ static Future wait(List<Future> futures) => null;
+}
+
+class Stream<T> {}
+abstract class StreamTransformer<S, T> {}
+''');
+
+ static const _MockSdkLibrary LIB_COLLECTION = const _MockSdkLibrary(
+ 'dart:collection', '/lib/collection/collection.dart', '''
+library dart.collection;
+
+abstract class HashMap<K, V> implements Map<K, V> {}
+''');
+
+ static const _MockSdkLibrary LIB_CONVERT = const _MockSdkLibrary(
+ 'dart:convert', '/lib/convert/convert.dart', '''
+library dart.convert;
+
+import 'dart:async';
+
+abstract class Converter<S, T> implements StreamTransformer {}
+class JsonDecoder extends Converter<String, Object> {}
+''');
+
+ static const _MockSdkLibrary LIB_MATH = const _MockSdkLibrary('dart:math',
+ '/lib/math/math.dart', '''
+library dart.math;
+const double E = 2.718281828459045;
+const double PI = 3.1415926535897932;
+const double LN10 = 2.302585092994046;
+num min(num a, num b) => 0;
+num max(num a, num b) => 0;
+external double cos(num x);
+external double sin(num x);
+external double sqrt(num x);
+class Random {
+ bool nextBool() => true;
+ double nextDouble() => 2.0;
+ int nextInt() => 1;
+}
+''');
+
+ static const _MockSdkLibrary LIB_HTML = const _MockSdkLibrary('dart:html',
+ '/lib/html/dartium/html_dartium.dart', '''
+library dart.html;
+class HtmlElement {}
+''');
+
+ static const List<SdkLibrary> LIBRARIES = const [
+ LIB_CORE,
+ LIB_ASYNC,
+ LIB_COLLECTION,
+ LIB_CONVERT,
+ LIB_MATH,
+ LIB_HTML,
+ ];
+
+ final resource.MemoryResourceProvider provider =
+ new resource.MemoryResourceProvider();
+
+ /**
+ * The [AnalysisContextImpl] which is used for all of the sources.
+ */
+ AnalysisContextImpl _analysisContext;
+
+ MockSdk() {
+ LIBRARIES.forEach((_MockSdkLibrary library) {
+ provider.newFile(library.path, library.content);
+ });
+ }
+
+ @override
+ AnalysisContextImpl get context {
+ if (_analysisContext == null) {
+ _analysisContext = new _SdkAnalysisContext(this);
+ SourceFactory factory = new SourceFactory([new DartUriResolver(this)]);
+ _analysisContext.sourceFactory = factory;
+ ChangeSet changeSet = new ChangeSet();
+ for (String uri in uris) {
+ Source source = factory.forUri(uri);
+ changeSet.addedSource(source);
+ }
+ _analysisContext.applyChanges(changeSet);
+ }
+ return _analysisContext;
+ }
+
+ @override
+ List<SdkLibrary> get sdkLibraries => LIBRARIES;
+
+ @override
+ String get sdkVersion => throw unimplemented;
+
+ UnimplementedError get unimplemented => new UnimplementedError();
+
+ @override
+ List<String> get uris {
+ List<String> uris = <String>[];
+ for (SdkLibrary library in LIBRARIES) {
+ uris.add(library.shortName);
+ }
+ return uris;
+ }
+
+ @override
+ Source fromFileUri(Uri uri) {
+ String filePath = uri.path;
+ String libPath = '/lib';
+ if (!filePath.startsWith("$libPath/")) {
+ return null;
+ }
+ for (SdkLibrary library in LIBRARIES) {
+ String libraryPath = library.path;
+ if (filePath.replaceAll('\\', '/') == libraryPath) {
+ try {
+ resource.File file = provider.getResource(uri.path);
+ Uri dartUri = Uri.parse(library.shortName);
+ return file.createSource(dartUri);
+ } catch (exception) {
+ return null;
+ }
+ }
+ if (filePath.startsWith("$libraryPath/")) {
+ String pathInLibrary = filePath.substring(libraryPath.length + 1);
+ String path = '${library.shortName}/${pathInLibrary}';
+ try {
+ resource.File file = provider.getResource(uri.path);
+ Uri dartUri = new Uri(scheme: 'dart', path: path);
+ return file.createSource(dartUri);
+ } catch (exception) {
+ return null;
+ }
+ }
+ }
+ return null;
+ }
+
+ @override
+ SdkLibrary getSdkLibrary(String dartUri) {
+ // getSdkLibrary() is only used to determine whether a library is internal
+ // to the SDK. The mock SDK doesn't have any internals, so it's safe to
+ // return null.
+ return null;
+ }
+
+ @override
+ Source mapDartUri(String dartUri) {
+ const Map<String, String> uriToPath = const {
+ "dart:core": "/lib/core/core.dart",
+ "dart:html": "/lib/html/dartium/html_dartium.dart",
+ "dart:async": "/lib/async/async.dart",
+ "dart:collection": "/lib/collection/collection.dart",
+ "dart:convert": "/lib/convert/convert.dart",
+ "dart:math": "/lib/math/math.dart"
+ };
+
+ String path = uriToPath[dartUri];
+ if (path != null) {
+ resource.File file = provider.getResource(path);
+ Uri uri = new Uri(scheme: 'dart', path: dartUri.substring(5));
+ return file.createSource(uri);
+ }
+
+ // If we reach here then we tried to use a dartUri that's not in the
+ // table above.
+ return null;
+ }
+}
+
+class _MockSdkLibrary implements SdkLibrary {
+ final String shortName;
+ final String path;
+ final String content;
+
+ const _MockSdkLibrary(this.shortName, this.path, this.content);
+
+ @override
+ String get category => throw unimplemented;
+
+ @override
+ bool get isDart2JsLibrary => throw unimplemented;
+
+ @override
+ bool get isDocumented => throw unimplemented;
+
+ @override
+ bool get isImplementation => throw unimplemented;
+
+ @override
+ bool get isInternal => throw unimplemented;
+
+ @override
+ bool get isShared => throw unimplemented;
+
+ @override
+ bool get isVmLibrary => throw unimplemented;
+
+ UnimplementedError get unimplemented => new UnimplementedError();
+}
+
+/**
+ * An [AnalysisContextImpl] that only contains sources for a Dart SDK.
+ */
+class _SdkAnalysisContext extends AnalysisContextImpl {
+ final DartSdk sdk;
+
+ _SdkAnalysisContext(this.sdk);
+
+ @override
+ AnalysisCache createCacheFromSourceFactory(SourceFactory factory) {
+ if (factory == null) {
+ return super.createCacheFromSourceFactory(factory);
+ }
+ return new AnalysisCache(<CachePartition>[
+ AnalysisEngine.instance.partitionManager_new.forSdk(sdk)
+ ]);
+ }
+}
diff --git a/pkg/analyzer/test/src/context/test_all.dart b/pkg/analyzer/test/src/context/test_all.dart
index 8b733b0..fe1b98c 100644
--- a/pkg/analyzer/test/src/context/test_all.dart
+++ b/pkg/analyzer/test/src/context/test_all.dart
@@ -7,11 +7,13 @@
import 'package:unittest/unittest.dart';
import 'cache_test.dart' as cache_test;
+import 'context_test.dart' as context_test;
/// Utility for manually running all tests.
main() {
groupSep = ' | ';
group('task tests', () {
cache_test.main();
+ context_test.main();
});
}
diff --git a/pkg/analyzer/test/src/task/dart_test.dart b/pkg/analyzer/test/src/task/dart_test.dart
index 6ddf3d9..c2a5ea5 100644
--- a/pkg/analyzer/test/src/task/dart_test.dart
+++ b/pkg/analyzer/test/src/task/dart_test.dart
@@ -4,30 +4,21 @@
library test.src.task.dart_test;
-import 'package:analyzer/file_system/file_system.dart';
-import 'package:analyzer/file_system/memory_file_system.dart';
import 'package:analyzer/src/context/cache.dart';
import 'package:analyzer/src/generated/ast.dart';
import 'package:analyzer/src/generated/element.dart';
-import 'package:analyzer/src/generated/engine.dart'
- hide AnalysisTask, GetContentTask, ParseDartTask, ScanDartTask;
import 'package:analyzer/src/generated/error.dart';
import 'package:analyzer/src/generated/resolver.dart';
-import 'package:analyzer/src/generated/sdk.dart';
import 'package:analyzer/src/generated/source.dart';
import 'package:analyzer/src/task/dart.dart';
-import 'package:analyzer/src/task/driver.dart';
-import 'package:analyzer/src/task/general.dart';
-import 'package:analyzer/src/task/manager.dart';
import 'package:analyzer/task/dart.dart';
import 'package:analyzer/task/general.dart';
import 'package:analyzer/task/model.dart';
-import 'package:typed_mock/typed_mock.dart';
import 'package:unittest/unittest.dart';
import '../../generated/test_support.dart';
import '../../reflective_tests.dart';
-import '../mock_sdk.dart';
+import '../context/abstract_context.dart';
main() {
groupSep = ' | ';
@@ -57,7 +48,7 @@
@reflectiveTest
class BuildClassConstructorsTaskTest extends _AbstractDartTaskTest {
test_perform_ClassDeclaration_errors_mixinHasNoConstructors() {
- Source source = _newSource('/test.dart', '''
+ Source source = newSource('/test.dart', '''
class B {
B({x});
}
@@ -81,7 +72,7 @@
}
test_perform_ClassDeclaration_explicitConstructors() {
- Source source = _newSource('/test.dart', '''
+ Source source = newSource('/test.dart', '''
class B {
B(p);
}
@@ -109,7 +100,7 @@
}
test_perform_ClassTypeAlias() {
- Source source = _newSource('/test.dart', '''
+ Source source = newSource('/test.dart', '''
class B {
B(int i);
}
@@ -136,7 +127,7 @@
}
test_perform_ClassTypeAlias_errors_mixinHasNoConstructors() {
- Source source = _newSource('/test.dart', '''
+ Source source = newSource('/test.dart', '''
class B {
B({x});
}
@@ -163,7 +154,8 @@
@reflectiveTest
class BuildCompilationUnitElementTaskTest extends _AbstractDartTaskTest {
test_buildInputs() {
- LibraryUnitTarget target = new LibraryUnitTarget(emptySource, emptySource);
+ LibrarySpecificUnit target =
+ new LibrarySpecificUnit(emptySource, emptySource);
Map<String, TaskInput> inputs =
BuildCompilationUnitElementTask.buildInputs(target);
expect(inputs, isNotNull);
@@ -214,8 +206,8 @@
}
void _performBuildTask(String content) {
- Source source = _newSource('/test.dart', content);
- AnalysisTarget target = new LibraryUnitTarget(source, source);
+ Source source = newSource('/test.dart', content);
+ AnalysisTarget target = new LibrarySpecificUnit(source, source);
_computeResult(target, RESOLVED_UNIT1);
expect(task, new isInstanceOf<BuildCompilationUnitElementTask>());
}
@@ -251,7 +243,7 @@
}
test_perform() {
- List<Source> sources = _newSources({
+ List<Source> sources = newSources({
'/libA.dart': '''
library libA;
import 'libB.dart';
@@ -278,7 +270,7 @@
_assertErrorsWithCodes([]);
// validate directives
CompilationUnit libraryUnitA = context
- .getCacheEntry(new LibraryUnitTarget(sourceA, sourceA))
+ .getCacheEntry(new LibrarySpecificUnit(sourceA, sourceA))
.getValue(RESOLVED_UNIT1);
{
ImportDirective importNode = libraryUnitA.directives[1];
@@ -310,7 +302,7 @@
}
test_perform_combinators() {
- List<Source> sources = _newSources({
+ List<Source> sources = newSources({
'/libA.dart': '''
library libA;
import 'libB.dart' show A, B hide C, D;
@@ -325,7 +317,7 @@
expect(task, new isInstanceOf<BuildDirectiveElementsTask>());
// prepare outputs
CompilationUnit libraryUnitA = context
- .getCacheEntry(new LibraryUnitTarget(sourceA, sourceA))
+ .getCacheEntry(new LibrarySpecificUnit(sourceA, sourceA))
.getValue(RESOLVED_UNIT1);
// no errors
_assertErrorsWithCodes([]);
@@ -347,7 +339,7 @@
}
test_perform_error_exportOfNonLibrary() {
- List<Source> sources = _newSources({
+ List<Source> sources = newSources({
'/libA.dart': '''
library libA;
export 'part.dart';
@@ -365,7 +357,7 @@
}
test_perform_error_importOfNonLibrary() {
- List<Source> sources = _newSources({
+ List<Source> sources = newSources({
'/libA.dart': '''
library libA;
import 'part.dart';
@@ -383,7 +375,7 @@
}
test_perform_hasExtUri() {
- List<Source> sources = _newSources({
+ List<Source> sources = newSources({
'/lib.dart': '''
import 'dart-ext:doesNotExist.dart';
'''
@@ -398,7 +390,7 @@
}
test_perform_importPrefix() {
- List<Source> sources = _newSources({
+ List<Source> sources = newSources({
'/libA.dart': '''
library libA;
import 'libB.dart' as pref;
@@ -418,7 +410,7 @@
expect(task, new isInstanceOf<BuildDirectiveElementsTask>());
// prepare outputs
CompilationUnit libraryUnitA = context
- .getCacheEntry(new LibraryUnitTarget(sourceA, sourceA))
+ .getCacheEntry(new LibrarySpecificUnit(sourceA, sourceA))
.getValue(RESOLVED_UNIT1);
// validate directives
{
@@ -459,12 +451,12 @@
@reflectiveTest
class BuildEnumMemberElementsTaskTest extends _AbstractDartTaskTest {
test_perform() {
- Source source = _newSource('/test.dart', '''
+ Source source = newSource('/test.dart', '''
enum MyEnum {
A, B
}
''');
- _computeResult(new LibraryUnitTarget(source, source), RESOLVED_UNIT2);
+ _computeResult(new LibrarySpecificUnit(source, source), RESOLVED_UNIT2);
expect(task, new isInstanceOf<BuildEnumMemberElementsTask>());
CompilationUnit unit = outputs[RESOLVED_UNIT2];
// validate Element
@@ -521,11 +513,11 @@
@reflectiveTest
class BuildExportNamespaceTaskTest extends _AbstractDartTaskTest {
test_perform_entryPoint() {
- Source sourceA = _newSource('/a.dart', '''
+ Source sourceA = newSource('/a.dart', '''
library lib_a;
export 'b.dart';
''');
- Source sourceB = _newSource('/b.dart', '''
+ Source sourceB = newSource('/b.dart', '''
library lib_b;
main() {}
''');
@@ -541,21 +533,21 @@
}
test_perform_hideCombinator() {
- Source sourceA = _newSource('/a.dart', '''
+ Source sourceA = newSource('/a.dart', '''
library lib_a;
export 'b.dart' hide B1;
class A1 {}
class A2 {}
class _A3 {}
''');
- _newSource('/b.dart', '''
+ newSource('/b.dart', '''
library lib_b;
class B1 {}
class B2 {}
class B3 {}
class _B4 {}
''');
- _newSource('/c.dart', '''
+ newSource('/c.dart', '''
library lib_c;
class C1 {}
class C2 {}
@@ -573,14 +565,14 @@
}
test_perform_showCombinator() {
- Source sourceA = _newSource('/a.dart', '''
+ Source sourceA = newSource('/a.dart', '''
library lib_a;
export 'b.dart' show B1;
class A1 {}
class A2 {}
class _A3 {}
''');
- _newSource('/b.dart', '''
+ newSource('/b.dart', '''
library lib_b;
class B1 {}
class B2 {}
@@ -598,12 +590,12 @@
}
test_perform_showCombinator_setter() {
- Source sourceA = _newSource('/a.dart', '''
+ Source sourceA = newSource('/a.dart', '''
library lib_a;
export 'b.dart' show topLevelB;
class A {}
''');
- _newSource('/b.dart', '''
+ newSource('/b.dart', '''
library lib_b;
int topLevelB;
''');
@@ -622,11 +614,11 @@
@reflectiveTest
class BuildFunctionTypeAliasesTaskTest extends _AbstractDartTaskTest {
test_perform() {
- Source source = _newSource('/test.dart', '''
+ Source source = newSource('/test.dart', '''
typedef int F(G g);
typedef String G(int p);
''');
- LibraryUnitTarget target = new LibraryUnitTarget(source, source);
+ LibrarySpecificUnit target = new LibrarySpecificUnit(source, source);
_computeResult(target, RESOLVED_UNIT3);
expect(task, new isInstanceOf<BuildFunctionTypeAliasesTask>());
// validate
@@ -649,10 +641,10 @@
}
test_perform_errors() {
- Source source = _newSource('/test.dart', '''
+ Source source = newSource('/test.dart', '''
typedef int F(NoSuchType p);
''');
- LibraryUnitTarget target = new LibraryUnitTarget(source, source);
+ LibrarySpecificUnit target = new LibrarySpecificUnit(source, source);
_computeResult(target, BUILD_FUNCTION_TYPE_ALIASES_ERRORS);
expect(task, new isInstanceOf<BuildFunctionTypeAliasesTask>());
// validate
@@ -665,7 +657,7 @@
@reflectiveTest
class BuildLibraryConstructorsTaskTest extends _AbstractDartTaskTest {
test_perform() {
- Source source = _newSource('/test.dart', '''
+ Source source = newSource('/test.dart', '''
class B {
B(int i);
}
@@ -936,12 +928,12 @@
}
void _performBuildTask(Map<String, String> sourceMap) {
- List<Source> sources = _newSources(sourceMap);
+ List<Source> sources = newSources(sourceMap);
Source libSource = sources.first;
_computeResult(libSource, LIBRARY_ELEMENT1);
expect(task, new isInstanceOf<BuildLibraryElementTask>());
libraryUnit = context
- .getCacheEntry(new LibraryUnitTarget(libSource, libSource))
+ .getCacheEntry(new LibrarySpecificUnit(libSource, libSource))
.getValue(RESOLVED_UNIT1);
libraryUnitElement = libraryUnit.element;
librarySource = libraryUnitElement.source;
@@ -988,7 +980,7 @@
}
test_perform() {
- List<Source> sources = _newSources({
+ List<Source> sources = newSources({
'/lib.dart': '''
library lib;
part 'part.dart';
@@ -1013,19 +1005,19 @@
@reflectiveTest
class BuildSourceClosuresTaskTest extends _AbstractDartTaskTest {
test_perform_exportClosure() {
- Source sourceA = _newSource('/a.dart', '''
+ Source sourceA = newSource('/a.dart', '''
library lib_a;
export 'b.dart';
''');
- Source sourceB = _newSource('/b.dart', '''
+ Source sourceB = newSource('/b.dart', '''
library lib_b;
export 'c.dart';
''');
- Source sourceC = _newSource('/c.dart', '''
+ Source sourceC = newSource('/c.dart', '''
library lib_c;
export 'a.dart';
''');
- Source sourceD = _newSource('/d.dart', '''
+ Source sourceD = newSource('/d.dart', '''
library lib_d;
''');
// a.dart
@@ -1052,19 +1044,19 @@
}
test_perform_importClosure() {
- Source sourceA = _newSource('/a.dart', '''
+ Source sourceA = newSource('/a.dart', '''
library lib_a;
import 'b.dart';
''');
- Source sourceB = _newSource('/b.dart', '''
+ Source sourceB = newSource('/b.dart', '''
library lib_b;
import 'c.dart';
''');
- Source sourceC = _newSource('/c.dart', '''
+ Source sourceC = newSource('/c.dart', '''
library lib_c;
import 'a.dart';
''');
- Source sourceD = _newSource('/d.dart', '''
+ Source sourceD = newSource('/d.dart', '''
library lib_d;
''');
Source coreSource = context.sourceFactory.resolveUri(null, 'dart:core');
@@ -1099,11 +1091,11 @@
}
test_perform_isClient_false() {
- Source sourceA = _newSource('/a.dart', '''
+ Source sourceA = newSource('/a.dart', '''
library lib_a;
import 'b.dart';
''');
- _newSource('/b.dart', '''
+ newSource('/b.dart', '''
library lib_b;
''');
_computeResult(sourceA, IS_CLIENT);
@@ -1111,8 +1103,21 @@
expect(outputs[IS_CLIENT], isFalse);
}
- test_perform_isClient_true_direct() {
- Source sourceA = _newSource('/a.dart', '''
+ test_perform_isClient_true_export_indirect() {
+ newSource('/exports_html.dart', '''
+library lib_exports_html;
+export 'dart:html';
+''');
+ Source source = newSource('/test.dart', '''
+import 'exports_html.dart';
+''');
+ _computeResult(source, IS_CLIENT);
+ expect(task, new isInstanceOf<BuildSourceClosuresTask>());
+ expect(outputs[IS_CLIENT], isTrue);
+ }
+
+ test_perform_isClient_true_import_direct() {
+ Source sourceA = newSource('/a.dart', '''
library lib_a;
import 'dart:html';
''');
@@ -1121,12 +1126,12 @@
expect(outputs[IS_CLIENT], isTrue);
}
- test_perform_isClient_true_indirect() {
- Source sourceA = _newSource('/a.dart', '''
+ test_perform_isClient_true_import_indirect() {
+ Source sourceA = newSource('/a.dart', '''
library lib_a;
import 'b.dart';
''');
- _newSource('/b.dart', '''
+ newSource('/b.dart', '''
library lib_b;
import 'dart:html';
''');
@@ -1156,15 +1161,15 @@
Set<String> usedElementNames;
test_perform() {
- _newSource('/a.dart', r'''
+ newSource('/a.dart', r'''
library lib_a;
class A {}
''');
- _newSource('/b.dart', r'''
+ newSource('/b.dart', r'''
library lib_b;
class B {}
''');
- Source source = _newSource('/test.dart', r'''
+ Source source = newSource('/test.dart', r'''
import 'a.dart';
import 'b.dart';
main() {
@@ -1176,7 +1181,7 @@
}
void _computeUsedElements(Source source) {
- LibraryUnitTarget target = new LibraryUnitTarget(source, source);
+ LibrarySpecificUnit target = new LibrarySpecificUnit(source, source);
_computeResult(target, USED_IMPORTED_ELEMENTS);
expect(task, new isInstanceOf<GatherUsedImportedElementsTask>());
usedElements = outputs[USED_IMPORTED_ELEMENTS];
@@ -1190,7 +1195,7 @@
Set<String> usedElementNames;
test_perform_localVariable() {
- Source source = _newSource('/test.dart', r'''
+ Source source = newSource('/test.dart', r'''
main() {
var v1 = 1;
var v2 = 2;
@@ -1202,7 +1207,7 @@
}
test_perform_method() {
- Source source = _newSource('/test.dart', r'''
+ Source source = newSource('/test.dart', r'''
class A {
_m1() {}
_m2() {}
@@ -1220,7 +1225,7 @@
}
void _computeUsedElements(Source source) {
- LibraryUnitTarget target = new LibraryUnitTarget(source, source);
+ LibrarySpecificUnit target = new LibrarySpecificUnit(source, source);
_computeResult(target, USED_LOCAL_ELEMENTS);
expect(task, new isInstanceOf<GatherUsedLocalElementsTask>());
usedElements = outputs[USED_LOCAL_ELEMENTS];
@@ -1231,11 +1236,11 @@
@reflectiveTest
class GenerateHintsTaskTest extends _AbstractDartTaskTest {
test_perform_bestPractices_missingReturn() {
- Source source = _newSource('/test.dart', '''
+ Source source = newSource('/test.dart', '''
int main() {
}
''');
- LibraryUnitTarget target = new LibraryUnitTarget(source, source);
+ LibrarySpecificUnit target = new LibrarySpecificUnit(source, source);
_computeResult(target, HINTS);
expect(task, new isInstanceOf<GenerateHintsTask>());
// validate
@@ -1244,14 +1249,14 @@
}
test_perform_dart2js() {
- Source source = _newSource('/test.dart', '''
+ Source source = newSource('/test.dart', '''
main(p) {
if (p is double) {
print('double');
}
}
''');
- LibraryUnitTarget target = new LibraryUnitTarget(source, source);
+ LibrarySpecificUnit target = new LibrarySpecificUnit(source, source);
_computeResult(target, HINTS);
expect(task, new isInstanceOf<GenerateHintsTask>());
// validate
@@ -1260,14 +1265,14 @@
}
test_perform_deadCode() {
- Source source = _newSource('/test.dart', '''
+ Source source = newSource('/test.dart', '''
main() {
if (false) {
print('how?');
}
}
''');
- LibraryUnitTarget target = new LibraryUnitTarget(source, source);
+ LibrarySpecificUnit target = new LibrarySpecificUnit(source, source);
_computeResult(target, HINTS);
expect(task, new isInstanceOf<GenerateHintsTask>());
// validate
@@ -1276,18 +1281,18 @@
}
test_perform_imports_duplicateImport() {
- _newSource('/a.dart', r'''
+ newSource('/a.dart', r'''
library lib_a;
class A {}
''');
- Source source = _newSource('/test.dart', r'''
+ Source source = newSource('/test.dart', r'''
import 'a.dart';
import 'a.dart';
main() {
new A();
}
''');
- LibraryUnitTarget target = new LibraryUnitTarget(source, source);
+ LibrarySpecificUnit target = new LibrarySpecificUnit(source, source);
_computeResult(target, HINTS);
expect(task, new isInstanceOf<GenerateHintsTask>());
// validate
@@ -1296,21 +1301,21 @@
}
test_perform_imports_unusedImport_one() {
- _newSource('/a.dart', r'''
+ newSource('/a.dart', r'''
library lib_a;
class A {}
''');
- _newSource('/b.dart', r'''
+ newSource('/b.dart', r'''
library lib_b;
class B {}
''');
- Source source = _newSource('/test.dart', r'''
+ Source source = newSource('/test.dart', r'''
import 'a.dart';
import 'b.dart';
main() {
new A();
}''');
- LibraryUnitTarget target = new LibraryUnitTarget(source, source);
+ LibrarySpecificUnit target = new LibrarySpecificUnit(source, source);
_computeResult(target, HINTS);
expect(task, new isInstanceOf<GenerateHintsTask>());
// validate
@@ -1319,16 +1324,16 @@
}
test_perform_imports_unusedImport_zero() {
- _newSource('/a.dart', r'''
+ newSource('/a.dart', r'''
library lib_a;
class A {}
''');
- Source source = _newSource('/test.dart', r'''
+ Source source = newSource('/test.dart', r'''
import 'a.dart';
main() {
new A();
}''');
- LibraryUnitTarget target = new LibraryUnitTarget(source, source);
+ LibrarySpecificUnit target = new LibrarySpecificUnit(source, source);
_computeResult(target, HINTS);
expect(task, new isInstanceOf<GenerateHintsTask>());
// validate
@@ -1337,14 +1342,14 @@
}
test_perform_overrideVerifier() {
- Source source = _newSource('/test.dart', '''
+ Source source = newSource('/test.dart', '''
class A {}
class B {
@override
m() {}
}
''');
- LibraryUnitTarget target = new LibraryUnitTarget(source, source);
+ LibrarySpecificUnit target = new LibrarySpecificUnit(source, source);
_computeResult(target, HINTS);
expect(task, new isInstanceOf<GenerateHintsTask>());
// validate
@@ -1354,12 +1359,12 @@
}
test_perform_todo() {
- Source source = _newSource('/test.dart', '''
+ Source source = newSource('/test.dart', '''
main() {
// TODO(developer) foo bar
}
''');
- LibraryUnitTarget target = new LibraryUnitTarget(source, source);
+ LibrarySpecificUnit target = new LibrarySpecificUnit(source, source);
_computeResult(target, HINTS);
expect(task, new isInstanceOf<GenerateHintsTask>());
// validate
@@ -1368,14 +1373,14 @@
}
test_perform_unusedLocalElements_class() {
- Source source = _newSource('/test.dart', '''
+ Source source = newSource('/test.dart', '''
class _A {}
class _B {}
main() {
new _A();
}
''');
- LibraryUnitTarget target = new LibraryUnitTarget(source, source);
+ LibrarySpecificUnit target = new LibrarySpecificUnit(source, source);
_computeResult(target, HINTS);
expect(task, new isInstanceOf<GenerateHintsTask>());
// validate
@@ -1384,12 +1389,12 @@
}
test_perform_unusedLocalElements_localVariable() {
- Source source = _newSource('/test.dart', '''
+ Source source = newSource('/test.dart', '''
main() {
var v = 42;
}
''');
- LibraryUnitTarget target = new LibraryUnitTarget(source, source);
+ LibrarySpecificUnit target = new LibrarySpecificUnit(source, source);
_computeResult(target, HINTS);
expect(task, new isInstanceOf<GenerateHintsTask>());
// validate
@@ -1399,7 +1404,7 @@
}
test_perform_unusedLocalElements_method() {
- Source source = _newSource('/my_lib.dart', '''
+ Source source = newSource('/my_lib.dart', '''
library my_lib;
part 'my_part.dart';
class A {
@@ -1408,14 +1413,14 @@
_mc() {}
}
''');
- _newSource('/my_part.dart', '''
+ newSource('/my_part.dart', '''
part of my_lib;
f(A a) {
a._mb();
}
''');
- LibraryUnitTarget target = new LibraryUnitTarget(source, source);
+ LibrarySpecificUnit target = new LibrarySpecificUnit(source, source);
_computeResult(target, HINTS);
expect(task, new isInstanceOf<GenerateHintsTask>());
// validate
@@ -1509,8 +1514,27 @@
expect(outputs[UNITS], hasLength(2));
}
+ test_perform_useMemento() {
+ String content = r'''
+library lib;
+import 'lib2.dart';
+export 'lib3.dart';
+part 'part.dart';
+class A {''';
+ AnalysisTarget target = newSource('/test.dart', content);
+ _computeResult(target, PARSED_UNIT);
+ // update content
+ context.setContents(target, content);
+ assertIsInvalid(target, PARSED_UNIT);
+ // recompute
+ _computeResult(target, PARSED_UNIT);
+ assertIsValid(target, PARSED_UNIT);
+ // values from the memento are returned
+ assertSameResults(ParseDartTask.DESCRIPTOR.results);
+ }
+
void _performParseTask(String content) {
- AnalysisTarget target = _newSource('/test.dart', content);
+ AnalysisTarget target = newSource('/test.dart', content);
_computeResult(target, PARSED_UNIT);
expect(task, new isInstanceOf<ParseDartTask>());
}
@@ -1526,13 +1550,13 @@
@reflectiveTest
class ResolveLibraryTypeNamesTaskTest extends _AbstractDartTaskTest {
test_perform() {
- Source sourceLib = _newSource('/my_lib.dart', '''
+ Source sourceLib = newSource('/my_lib.dart', '''
library my_lib;
part 'my_part.dart';
class A {}
class B extends A {}
''');
- _newSource('/my_part.dart', '''
+ newSource('/my_part.dart', '''
part of my_lib;
class C extends A {}
''');
@@ -1551,22 +1575,22 @@
}
test_perform_deep() {
- Source sourceA = _newSource('/a.dart', '''
+ Source sourceA = newSource('/a.dart', '''
library a;
import 'b.dart';
class A extends B {}
''');
- _newSource('/b.dart', '''
+ newSource('/b.dart', '''
library b;
import 'c.dart';
part 'b2.dart';
class B extends B2 {}
''');
- _newSource('/b2.dart', '''
+ newSource('/b2.dart', '''
part of b;
class B2 extends C {}
''');
- _newSource('/c.dart', '''
+ newSource('/c.dart', '''
library c;
class C {}
''');
@@ -1593,7 +1617,7 @@
@reflectiveTest
class ResolveReferencesTaskTest extends _AbstractDartTaskTest {
test_perform() {
- Source source = _newSource('/test.dart', '''
+ Source source = newSource('/test.dart', '''
class A {
m() {}
}
@@ -1601,7 +1625,7 @@
a.m();
}
''');
- LibraryUnitTarget target = new LibraryUnitTarget(source, source);
+ LibrarySpecificUnit target = new LibrarySpecificUnit(source, source);
// prepare unit and "a.m()" invocation
CompilationUnit unit;
MethodInvocation invocation;
@@ -1627,14 +1651,14 @@
}
test_perform_errors() {
- Source source = _newSource('/test.dart', '''
+ Source source = newSource('/test.dart', '''
class A {
}
main(A a) {
a.unknownMethod();
}
''');
- LibraryUnitTarget target = new LibraryUnitTarget(source, source);
+ LibrarySpecificUnit target = new LibrarySpecificUnit(source, source);
_computeResult(target, RESOLVED_UNIT);
expect(task, new isInstanceOf<ResolveReferencesTask>());
// validate
@@ -1647,12 +1671,12 @@
@reflectiveTest
class ResolveUnitTypeNamesTaskTest extends _AbstractDartTaskTest {
test_perform() {
- Source source = _newSource('/test.dart', '''
+ Source source = newSource('/test.dart', '''
class A {}
class B extends A {}
int f(String p) => p.length;
''');
- LibraryUnitTarget target = new LibraryUnitTarget(source, source);
+ LibrarySpecificUnit target = new LibrarySpecificUnit(source, source);
_computeResult(target, RESOLVED_UNIT4);
expect(task, new isInstanceOf<ResolveUnitTypeNamesTask>());
// validate
@@ -1674,10 +1698,10 @@
}
test_perform_errors() {
- Source source = _newSource('/test.dart', '''
+ Source source = newSource('/test.dart', '''
NoSuchClass f() => null;
''');
- LibraryUnitTarget target = new LibraryUnitTarget(source, source);
+ LibrarySpecificUnit target = new LibrarySpecificUnit(source, source);
_computeResult(target, RESOLVE_TYPE_NAMES_ERRORS);
expect(task, new isInstanceOf<ResolveUnitTypeNamesTask>());
// validate
@@ -1700,7 +1724,7 @@
}
test_perform_local() {
- Source source = _newSource('/test.dart', '''
+ Source source = newSource('/test.dart', '''
main() {
var v1 = 1;
var v2 = 1;
@@ -1714,7 +1738,7 @@
}
}
''');
- LibraryUnitTarget target = new LibraryUnitTarget(source, source);
+ LibrarySpecificUnit target = new LibrarySpecificUnit(source, source);
_computeResult(target, RESOLVED_UNIT5);
expect(task, new isInstanceOf<ResolveVariableReferencesTask>());
// validate
@@ -1727,7 +1751,7 @@
}
test_perform_parameter() {
- Source source = _newSource('/test.dart', '''
+ Source source = newSource('/test.dart', '''
main(p1, p2, p3, p4) {
p2 = 2;
p4 = 2;
@@ -1737,7 +1761,7 @@
}
}
''');
- LibraryUnitTarget target = new LibraryUnitTarget(source, source);
+ LibrarySpecificUnit target = new LibrarySpecificUnit(source, source);
_computeResult(target, RESOLVED_UNIT5);
expect(task, new isInstanceOf<ResolveVariableReferencesTask>());
// validate
@@ -1798,8 +1822,21 @@
expect(outputs[TOKEN_STREAM], isNotNull);
}
+ test_perform_useMemento() {
+ AnalysisTarget target = newSource('/test.dart', 'main() {}');
+ _computeResult(target, TOKEN_STREAM);
+ // update content
+ context.setContents(target, 'main() {}');
+ assertIsInvalid(target, TOKEN_STREAM);
+ // recompute
+ _computeResult(target, TOKEN_STREAM);
+ assertIsValid(target, TOKEN_STREAM);
+ // values from the memento are returned
+ assertSameResults(ScanDartTask.DESCRIPTOR.results);
+ }
+
void _performScanTask(String content) {
- AnalysisTarget target = _newSource('/test.dart', content);
+ AnalysisTarget target = newSource('/test.dart', content);
_computeResult(target, TOKEN_STREAM);
expect(task, new isInstanceOf<ScanDartTask>());
}
@@ -1808,14 +1845,14 @@
@reflectiveTest
class VerifyUnitTaskTest extends _AbstractDartTaskTest {
test_perform_verifyError() {
- Source source = _newSource('/test.dart', '''
+ Source source = newSource('/test.dart', '''
main() {
if (42) {
print('Not bool!');
}
}
''');
- LibraryUnitTarget target = new LibraryUnitTarget(source, source);
+ LibrarySpecificUnit target = new LibrarySpecificUnit(source, source);
_computeResult(target, VERIFY_ERRORS);
expect(task, new isInstanceOf<VerifyUnitTask>());
// validate
@@ -1825,60 +1862,39 @@
}
}
-class _AbstractDartTaskTest extends EngineTestCase {
- MemoryResourceProvider resourceProvider = new MemoryResourceProvider();
+class _AbstractDartTaskTest extends AbstractContextTest {
Source emptySource;
- DartSdk sdk = new MockSdk();
- _MockContext context = new _MockContext();
- Map<AnalysisTarget, CacheEntry> entryMap = <AnalysisTarget, CacheEntry>{};
-
- TaskManager taskManager = new TaskManager();
- AnalysisDriver analysisDriver;
-
AnalysisTask task;
+ Map<ResultDescriptor<dynamic>, dynamic> oldOutputs;
Map<ResultDescriptor<dynamic>, dynamic> outputs;
GatheringErrorListener errorListener = new GatheringErrorListener();
- CacheEntry getCacheEntry(AnalysisTarget target) {
- return entryMap.putIfAbsent(target, () => new CacheEntry());
+ void assertIsInvalid(AnalysisTarget target, ResultDescriptor descriptor) {
+ CacheEntry entry = context.getCacheEntry(target);
+ expect(entry.isInvalid(descriptor), isTrue);
+ }
+
+ void assertIsValid(AnalysisTarget target, ResultDescriptor descriptor) {
+ CacheEntry entry = context.getCacheEntry(target);
+ expect(entry.isValid(descriptor), isTrue);
+ }
+
+ void assertSameResults(List<ResultDescriptor> descriptors) {
+ descriptors.forEach((descriptor) {
+ var oldResult = oldOutputs[descriptor];
+ var newResult = outputs[descriptor];
+ expect(newResult, same(oldResult), reason: descriptor.name);
+ });
}
void setUp() {
- emptySource = _newSource('/test.dart');
- // prepare AnalysisContext
- context.sourceFactory = new SourceFactory(<UriResolver>[
- new DartUriResolver(sdk),
- new ResourceUriResolver(resourceProvider)
- ]);
- // prepare TaskManager
- taskManager.addTaskDescriptor(GetContentTask.DESCRIPTOR);
- taskManager.addTaskDescriptor(ScanDartTask.DESCRIPTOR);
- taskManager.addTaskDescriptor(ParseDartTask.DESCRIPTOR);
- taskManager.addTaskDescriptor(BuildClassConstructorsTask.DESCRIPTOR);
- taskManager.addTaskDescriptor(BuildCompilationUnitElementTask.DESCRIPTOR);
- taskManager.addTaskDescriptor(BuildLibraryConstructorsTask.DESCRIPTOR);
- taskManager.addTaskDescriptor(BuildLibraryElementTask.DESCRIPTOR);
- taskManager.addTaskDescriptor(BuildPublicNamespaceTask.DESCRIPTOR);
- taskManager.addTaskDescriptor(BuildDirectiveElementsTask.DESCRIPTOR);
- taskManager.addTaskDescriptor(BuildSourceClosuresTask.DESCRIPTOR);
- taskManager.addTaskDescriptor(BuildExportNamespaceTask.DESCRIPTOR);
- taskManager.addTaskDescriptor(BuildEnumMemberElementsTask.DESCRIPTOR);
- taskManager.addTaskDescriptor(BuildFunctionTypeAliasesTask.DESCRIPTOR);
- taskManager.addTaskDescriptor(BuildTypeProviderTask.DESCRIPTOR);
- taskManager.addTaskDescriptor(GatherUsedImportedElementsTask.DESCRIPTOR);
- taskManager.addTaskDescriptor(GatherUsedLocalElementsTask.DESCRIPTOR);
- taskManager.addTaskDescriptor(GenerateHintsTask.DESCRIPTOR);
- taskManager.addTaskDescriptor(ResolveUnitTypeNamesTask.DESCRIPTOR);
- taskManager.addTaskDescriptor(ResolveLibraryTypeNamesTask.DESCRIPTOR);
- taskManager.addTaskDescriptor(ResolveReferencesTask.DESCRIPTOR);
- taskManager.addTaskDescriptor(ResolveVariableReferencesTask.DESCRIPTOR);
- taskManager.addTaskDescriptor(VerifyUnitTask.DESCRIPTOR);
- // prepare AnalysisDriver
- analysisDriver = new AnalysisDriver(taskManager, context);
+ super.setUp();
+ emptySource = newSource('/test.dart');
}
void _computeResult(AnalysisTarget target, ResultDescriptor result) {
+ oldOutputs = outputs;
task = analysisDriver.computeResult(target, result);
expect(task.caughtException, isNull);
outputs = task.outputs;
@@ -1893,43 +1909,4 @@
errorListener = new GatheringErrorListener();
errorListener.addAll(errors);
}
-
- Source _newSource(String path, [String content = '']) {
- File file = resourceProvider.newFile(path, content);
- return file.createSource();
- }
-
- List<Source> _newSources(Map<String, String> sourceMap) {
- List<Source> sources = <Source>[];
- sourceMap.forEach((String path, String content) {
- File file = resourceProvider.newFile(path, content);
- Source source = file.createSource();
- sources.add(source);
- });
- return sources;
- }
-}
-
-class _MockContext extends TypedMock implements ExtendedAnalysisContext {
- AnalysisOptionsImpl analysisOptions = new AnalysisOptionsImpl();
- SourceFactory sourceFactory;
- TypeProvider typeProvider;
-
- Map<AnalysisTarget, CacheEntry> entryMap = <AnalysisTarget, CacheEntry>{};
-
- String get name => '_MockContext';
-
- bool exists(Source source) => source.exists();
-
- @override
- CacheEntry getCacheEntry(AnalysisTarget target) {
- return entryMap.putIfAbsent(target, () => new CacheEntry());
- }
-
- TimestampedData<String> getContents(Source source) => source.contents;
-
- noSuchMethod(Invocation invocation) {
- print('noSuchMethod: ${invocation.memberName}');
- return super.noSuchMethod(invocation);
- }
}
diff --git a/pkg/analyzer/test/src/task/driver_test.dart b/pkg/analyzer/test/src/task/driver_test.dart
index 093a91f..d69dbe4 100644
--- a/pkg/analyzer/test/src/task/driver_test.dart
+++ b/pkg/analyzer/test/src/task/driver_test.dart
@@ -4,29 +4,20 @@
library test.src.task.driver_test;
-import 'dart:async';
-import 'dart:collection';
-
-import 'package:analyzer/src/cancelable_future.dart';
import 'package:analyzer/src/context/cache.dart';
-import 'package:analyzer/src/generated/ast.dart';
-import 'package:analyzer/src/generated/constant.dart';
-import 'package:analyzer/src/generated/element.dart';
-import 'package:analyzer/src/generated/engine.dart' hide AnalysisTask;
-import 'package:analyzer/src/generated/error.dart';
-import 'package:analyzer/src/generated/html.dart';
+import 'package:analyzer/src/context/context.dart';
+import 'package:analyzer/src/generated/engine.dart'
+ hide AnalysisContextImpl, AnalysisTask;
import 'package:analyzer/src/generated/java_engine.dart';
-import 'package:analyzer/src/generated/resolver.dart';
-import 'package:analyzer/src/generated/source.dart';
import 'package:analyzer/src/task/driver.dart';
import 'package:analyzer/src/task/inputs.dart';
import 'package:analyzer/src/task/manager.dart';
import 'package:analyzer/task/model.dart';
import 'package:unittest/unittest.dart';
-import '../../generated/resolver_test.dart';
import '../../generated/test_support.dart';
import '../../reflective_tests.dart';
+import '../context/abstract_context.dart';
import 'test_support.dart';
main() {
@@ -37,15 +28,9 @@
}
@reflectiveTest
-class AnalysisDriverTest extends EngineTestCase {
- TaskManager manager;
- _TestContext context;
- AnalysisDriver driver;
-
- void setUp() {
- manager = new TaskManager();
- context = new _TestContext();
- driver = new AnalysisDriver(manager, context);
+class AnalysisDriverTest extends AbstractContextTest {
+ AnalysisContextImpl createAnalysisContext() {
+ return new _TestContext();
}
test_computeResult() {
@@ -55,17 +40,17 @@
TaskDescriptor descriptor = new TaskDescriptor(
'task', (context, target) => task, (target) => {}, [result]);
task = new TestAnalysisTask(context, target, descriptor: descriptor);
- manager.addTaskDescriptor(descriptor);
+ taskManager.addTaskDescriptor(descriptor);
- driver.computeResult(target, result);
+ analysisDriver.computeResult(target, result);
expect(context.getCacheEntry(target).getValue(result), 1);
}
test_create() {
- expect(driver, isNotNull);
- expect(driver.context, context);
- expect(driver.currentWorkOrder, isNull);
- expect(driver.taskManager, manager);
+ expect(analysisDriver, isNotNull);
+ expect(analysisDriver.context, context);
+ expect(analysisDriver.currentWorkOrder, isNull);
+ expect(analysisDriver.taskManager, taskManager);
}
test_createNextWorkOrder_complete() {
@@ -75,14 +60,16 @@
TaskDescriptor descriptor = new TaskDescriptor('task',
(context, target) => new TestAnalysisTask(context, target),
(target) => {}, [result]);
- manager.addGeneralResult(result);
- manager.addTaskDescriptor(descriptor);
+ taskManager.addGeneralResult(result);
+ taskManager.addTaskDescriptor(descriptor);
context.priorityTargets.add(priorityTarget);
- context.getCacheEntry(priorityTarget).setValue(result, '');
+ context.getCacheEntry(priorityTarget).setValue(
+ result, '', TargetedResult.EMPTY_LIST, null);
context.explicitTargets.add(normalTarget);
- context.getCacheEntry(priorityTarget).setValue(result, '');
+ context.getCacheEntry(priorityTarget).setValue(
+ result, '', TargetedResult.EMPTY_LIST, null);
- expect(driver.createNextWorkOrder(), isNull);
+ expect(analysisDriver.createNextWorkOrder(), isNull);
}
test_createNextWorkOrder_normalTarget() {
@@ -92,14 +79,15 @@
TaskDescriptor descriptor = new TaskDescriptor('task',
(context, target) => new TestAnalysisTask(context, target),
(target) => {}, [result]);
- manager.addGeneralResult(result);
- manager.addTaskDescriptor(descriptor);
+ taskManager.addGeneralResult(result);
+ taskManager.addTaskDescriptor(descriptor);
context.priorityTargets.add(priorityTarget);
- context.getCacheEntry(priorityTarget).setValue(result, '');
+ context.getCacheEntry(priorityTarget).setValue(
+ result, '', TargetedResult.EMPTY_LIST, null);
context.explicitTargets.add(normalTarget);
context.getCacheEntry(normalTarget).setState(result, CacheState.INVALID);
- WorkOrder workOrder = driver.createNextWorkOrder();
+ WorkOrder workOrder = analysisDriver.createNextWorkOrder();
expect(workOrder, isNotNull);
expect(workOrder.moveNext(), true);
expect(workOrder.currentItem.target, normalTarget);
@@ -110,10 +98,10 @@
TaskDescriptor descriptor = new TaskDescriptor('task',
(context, target) => new TestAnalysisTask(context, target),
(target) => {}, [result]);
- manager.addGeneralResult(result);
- manager.addTaskDescriptor(descriptor);
+ taskManager.addGeneralResult(result);
+ taskManager.addTaskDescriptor(descriptor);
- expect(driver.createNextWorkOrder(), isNull);
+ expect(analysisDriver.createNextWorkOrder(), isNull);
}
test_createNextWorkOrder_priorityTarget() {
@@ -123,14 +111,14 @@
TaskDescriptor descriptor = new TaskDescriptor('task',
(context, target) => new TestAnalysisTask(context, target),
(target) => {}, [result]);
- manager.addGeneralResult(result);
- manager.addTaskDescriptor(descriptor);
+ taskManager.addGeneralResult(result);
+ taskManager.addTaskDescriptor(descriptor);
context.priorityTargets.add(priorityTarget);
context.getCacheEntry(priorityTarget).setState(result, CacheState.INVALID);
context.explicitTargets.add(normalTarget);
context.getCacheEntry(normalTarget).setState(result, CacheState.INVALID);
- WorkOrder workOrder = driver.createNextWorkOrder();
+ WorkOrder workOrder = analysisDriver.createNextWorkOrder();
expect(workOrder, isNotNull);
expect(workOrder.moveNext(), true);
expect(workOrder.currentItem.target, priorityTarget);
@@ -143,7 +131,7 @@
context.getCacheEntry(target).setErrorState(
exception, <ResultDescriptor>[result]);
- expect(driver.createWorkOrderForResult(target, result), isNull);
+ expect(analysisDriver.createWorkOrderForResult(target, result), isNull);
}
test_createWorkOrderForResult_inProcess() {
@@ -151,7 +139,7 @@
ResultDescriptor result = new ResultDescriptor('result', null);
context.getCacheEntry(target).setState(result, CacheState.IN_PROCESS);
- expect(driver.createWorkOrderForResult(target, result), isNull);
+ expect(analysisDriver.createWorkOrderForResult(target, result), isNull);
}
test_createWorkOrderForResult_invalid() {
@@ -160,19 +148,21 @@
TaskDescriptor descriptor = new TaskDescriptor('task',
(context, target) => new TestAnalysisTask(context, target),
(target) => {}, [result]);
- manager.addTaskDescriptor(descriptor);
+ taskManager.addTaskDescriptor(descriptor);
context.getCacheEntry(target).setState(result, CacheState.INVALID);
- WorkOrder workOrder = driver.createWorkOrderForResult(target, result);
+ WorkOrder workOrder =
+ analysisDriver.createWorkOrderForResult(target, result);
expect(workOrder, isNotNull);
}
test_createWorkOrderForResult_valid() {
AnalysisTarget target = new TestSource();
ResultDescriptor result = new ResultDescriptor('result', null);
- context.getCacheEntry(target).setValue(result, '');
+ context.getCacheEntry(target).setValue(
+ result, '', TargetedResult.EMPTY_LIST, null);
- expect(driver.createWorkOrderForResult(target, result), isNull);
+ expect(analysisDriver.createWorkOrderForResult(target, result), isNull);
}
test_createWorkOrderForTarget_complete_generalTarget_generalResult() {
@@ -214,13 +204,42 @@
TaskDescriptor descriptor = new TaskDescriptor(
'task', (context, target) => task, (target) => {}, [result]);
task = new TestAnalysisTask(context, target, descriptor: descriptor);
- manager.addTaskDescriptor(descriptor);
- manager.addGeneralResult(result);
+ taskManager.addTaskDescriptor(descriptor);
+ taskManager.addGeneralResult(result);
context.priorityTargets.add(target);
- expect(driver.performAnalysisTask(), true);
- expect(driver.performAnalysisTask(), true);
- expect(driver.performAnalysisTask(), false);
+ expect(analysisDriver.performAnalysisTask(), true);
+ expect(analysisDriver.performAnalysisTask(), true);
+ expect(analysisDriver.performAnalysisTask(), false);
+ }
+
+ test_performAnalysisTask_infiniteLoop() {
+ AnalysisTarget target = new TestSource();
+ ResultDescriptor resultA = new ResultDescriptor('resultA', -1);
+ ResultDescriptor resultB = new ResultDescriptor('resultB', -2);
+ // configure tasks
+ TestAnalysisTask task1;
+ TestAnalysisTask task2;
+ TaskDescriptor descriptor1 = new TaskDescriptor('task1',
+ (context, target) => task1, (target) => {
+ 'inputB': new SimpleTaskInput<int>(target, resultB)
+ }, [resultA]);
+ TaskDescriptor descriptor2 = new TaskDescriptor('task2',
+ (context, target) => task2, (target) => {
+ 'inputA': new SimpleTaskInput<int>(target, resultA)
+ }, [resultB]);
+ task1 = new TestAnalysisTask(context, target, descriptor: descriptor1);
+ task2 = new TestAnalysisTask(context, target, descriptor: descriptor2);
+ taskManager.addTaskDescriptor(descriptor1);
+ taskManager.addTaskDescriptor(descriptor2);
+ context.explicitTargets.add(target);
+ taskManager.addGeneralResult(resultB);
+ // prepare work order
+ expect(analysisDriver.performAnalysisTask(), true);
+ expect(analysisDriver.performAnalysisTask(), true);
+ CaughtException exception = context.getCacheEntry(target).exception;
+ expect(exception, isNotNull);
+ expect(exception.exception, new isInstanceOf<InfiniteTaskLoopException>());
}
test_performAnalysisTask_inputsFirst() {
@@ -240,53 +259,50 @@
descriptor: descriptor1, results: [resultA], value: 10);
task2 = new TestAnalysisTask(context, target,
descriptor: descriptor2, value: 20);
- manager.addTaskDescriptor(descriptor1);
- manager.addTaskDescriptor(descriptor2);
+ taskManager.addTaskDescriptor(descriptor1);
+ taskManager.addTaskDescriptor(descriptor2);
context.explicitTargets.add(target);
- manager.addGeneralResult(resultB);
+ taskManager.addGeneralResult(resultB);
// prepare work order
- expect(driver.performAnalysisTask(), true);
+ expect(analysisDriver.performAnalysisTask(), true);
expect(context.getCacheEntry(target).getValue(resultA), -1);
expect(context.getCacheEntry(target).getValue(resultB), -2);
// compute resultA
- expect(driver.performAnalysisTask(), true);
+ expect(analysisDriver.performAnalysisTask(), true);
expect(context.getCacheEntry(target).getValue(resultA), 10);
expect(context.getCacheEntry(target).getValue(resultB), -2);
// compute resultB
- expect(driver.performAnalysisTask(), true);
+ expect(analysisDriver.performAnalysisTask(), true);
expect(context.getCacheEntry(target).getValue(resultA), 10);
expect(context.getCacheEntry(target).getValue(resultB), 20);
// done
- expect(driver.performAnalysisTask(), false);
+ expect(analysisDriver.performAnalysisTask(), false);
}
- test_performAnalysisTask_infiniteLoop() {
+ test_performAnalysisTask_recordMemento() {
AnalysisTarget target = new TestSource();
- ResultDescriptor resultA = new ResultDescriptor('resultA', -1);
- ResultDescriptor resultB = new ResultDescriptor('resultB', -2);
+ ResultDescriptor result = new ResultDescriptor('result', -1);
// configure tasks
- TestAnalysisTask task1;
- TestAnalysisTask task2;
- TaskDescriptor descriptor1 = new TaskDescriptor(
- 'task1', (context, target) => task1, (target) => {
- 'inputB': new SimpleTaskInput<int>(target, resultB)
- }, [resultA]);
- TaskDescriptor descriptor2 = new TaskDescriptor('task2',
- (context, target) => task2, (target) => {
- 'inputA': new SimpleTaskInput<int>(target, resultA)
- }, [resultB]);
- task1 = new TestAnalysisTask(context, target, descriptor: descriptor1);
- task2 = new TestAnalysisTask(context, target, descriptor: descriptor2);
- manager.addTaskDescriptor(descriptor1);
- manager.addTaskDescriptor(descriptor2);
+ TestAnalysisTask task;
+ TaskDescriptor descriptor = new TaskDescriptor(
+ 'task', (context, target) => task, (target) => {}, [result]);
+ task = new TestAnalysisTask(context, target,
+ descriptor: descriptor,
+ memento: 'my mem',
+ results: [result],
+ value: 10);
+ taskManager.addTaskDescriptor(descriptor);
context.explicitTargets.add(target);
- manager.addGeneralResult(resultB);
+ taskManager.addGeneralResult(result);
// prepare work order
- expect(driver.performAnalysisTask(), true);
- expect(driver.performAnalysisTask(), true);
- CaughtException exception = context.getCacheEntry(target).exception;
- expect(exception, isNotNull);
- expect(exception.exception, new isInstanceOf<InfiniteTaskLoopException>());
+ expect(analysisDriver.performAnalysisTask(), true);
+ expect(context.getCacheEntry(target).getValue(result), -1);
+ // compute result
+ expect(analysisDriver.performAnalysisTask(), true);
+ expect(context.getCacheEntry(target).getValue(result), 10);
+ expect(context.getCacheEntry(target).getMemento(result), 'my mem');
+ // done
+ expect(analysisDriver.performAnalysisTask(), false);
}
test_performWorkItem_exceptionInTask() {
@@ -299,9 +315,9 @@
'task', (context, target) => task, (target) => {}, [result]);
task = new TestAnalysisTask(context, target,
descriptor: descriptor, exception: exception);
- WorkItem item = new WorkItem(context, target, descriptor);
+ WorkItem item = new WorkItem(context, target, descriptor, null);
- driver.performWorkItem(item);
+ analysisDriver.performWorkItem(item);
CacheEntry targetEntry = context.getCacheEntry(item.target);
expect(targetEntry.exception, exception);
expect(targetEntry.getState(result), CacheState.ERROR);
@@ -314,9 +330,9 @@
TaskDescriptor descriptor = new TaskDescriptor(
'task', (context, target) => task, (target) => {}, [result]);
task = new TestAnalysisTask(context, target, descriptor: descriptor);
- WorkItem item = new WorkItem(context, target, descriptor);
+ WorkItem item = new WorkItem(context, target, descriptor, null);
- driver.performWorkItem(item);
+ analysisDriver.performWorkItem(item);
CacheEntry targetEntry = context.getCacheEntry(item.target);
expect(targetEntry.exception, isNull);
expect(targetEntry.getState(result), CacheState.VALID);
@@ -330,10 +346,10 @@
(target) => {}, [result]);
CaughtException exception =
new CaughtException(new AnalysisException(), null);
- WorkItem item = new WorkItem(context, target, descriptor);
+ WorkItem item = new WorkItem(context, target, descriptor, null);
item.exception = exception;
- driver.performWorkItem(item);
+ analysisDriver.performWorkItem(item);
CacheEntry targetEntry = context.getCacheEntry(item.target);
expect(targetEntry.exception, exception);
expect(targetEntry.getState(result), CacheState.ERROR);
@@ -345,11 +361,11 @@
(context, target) => new TestAnalysisTask(context, target),
(target) => {'one': inputResult.of(target)},
[new ResultDescriptor('output', null)]);
- driver.currentWorkOrder =
- new WorkOrder(manager, new WorkItem(null, null, descriptor));
+ analysisDriver.currentWorkOrder =
+ new WorkOrder(taskManager, new WorkItem(null, null, descriptor, null));
- driver.reset();
- expect(driver.currentWorkOrder, isNull);
+ analysisDriver.reset();
+ expect(analysisDriver.currentWorkOrder, isNull);
}
/**
@@ -367,24 +383,25 @@
(context, target) => new TestAnalysisTask(context, target),
(target) => {}, [result]);
if (priorityResult) {
- manager.addPriorityResult(result);
+ taskManager.addPriorityResult(result);
} else {
- manager.addGeneralResult(result);
+ taskManager.addGeneralResult(result);
}
- manager.addTaskDescriptor(descriptor);
+ taskManager.addTaskDescriptor(descriptor);
if (priorityTarget) {
context.priorityTargets.add(target);
} else {
context.explicitTargets.add(target);
}
if (complete) {
- context.getCacheEntry(target).setValue(result, '');
+ context.getCacheEntry(target).setValue(
+ result, '', TargetedResult.EMPTY_LIST, null);
} else {
context.getCacheEntry(target).setState(result, CacheState.INVALID);
}
WorkOrder workOrder =
- driver.createWorkOrderForTarget(target, priorityTarget);
+ analysisDriver.createWorkOrderForTarget(target, priorityTarget);
if (complete) {
expect(workOrder, isNull);
} else if (priorityResult) {
@@ -398,18 +415,20 @@
@reflectiveTest
class WorkItemTest extends EngineTestCase {
test_buildTask_complete() {
- AnalysisContext context = new _TestContext();
+ AnalysisContext context = new AnalysisContextImpl();
AnalysisTarget target = new TestSource();
TaskDescriptor descriptor = new TaskDescriptor('task',
(context, target) => new TestAnalysisTask(context, target),
(target) => {}, [new ResultDescriptor('output', null)]);
- WorkItem item = new WorkItem(context, target, descriptor);
+ Object memento = new Object();
+ WorkItem item = new WorkItem(context, target, descriptor, memento);
AnalysisTask task = item.buildTask();
expect(task, isNotNull);
+ expect(task.inputMemento, memento);
}
test_buildTask_incomplete() {
- AnalysisContext context = new _TestContext();
+ AnalysisContext context = new AnalysisContextImpl();
AnalysisTarget target = new TestSource();
ResultDescriptor inputResult = new ResultDescriptor('input', null);
List<ResultDescriptor> outputResults =
@@ -417,30 +436,32 @@
TaskDescriptor descriptor = new TaskDescriptor('task', (context, target) =>
new TestAnalysisTask(context, target, results: outputResults),
(target) => {'one': inputResult.of(target)}, outputResults);
- WorkItem item = new WorkItem(context, target, descriptor);
+ WorkItem item = new WorkItem(context, target, descriptor, null);
expect(() => item.buildTask(), throwsStateError);
}
test_create() {
- AnalysisContext context = new _TestContext();
+ AnalysisContext context = new AnalysisContextImpl();
AnalysisTarget target = new TestSource();
+ Object memento = new Object();
TaskDescriptor descriptor = new TaskDescriptor(
'task', null, (target) => {}, [new ResultDescriptor('result', null)]);
- WorkItem item = new WorkItem(context, target, descriptor);
+ WorkItem item = new WorkItem(context, target, descriptor, memento);
expect(item, isNotNull);
expect(item.context, context);
expect(item.descriptor, descriptor);
+ expect(item.inputMemento, memento);
expect(item.target, target);
}
test_gatherInputs_complete() {
TaskManager manager = new TaskManager();
- AnalysisContext context = new _TestContext();
+ AnalysisContext context = new AnalysisContextImpl();
AnalysisTarget target = new TestSource();
TaskDescriptor descriptor = new TaskDescriptor('task',
(context, target) => new TestAnalysisTask(context, target),
(target) => {}, [new ResultDescriptor('output', null)]);
- WorkItem item = new WorkItem(context, target, descriptor);
+ WorkItem item = new WorkItem(context, target, descriptor, null);
WorkItem result = item.gatherInputs(manager);
expect(result, isNull);
expect(item.exception, isNull);
@@ -448,10 +469,11 @@
test_gatherInputs_incomplete() {
TaskManager manager = new TaskManager();
- AnalysisContext context = new _TestContext();
+ AnalysisContextImpl context = new AnalysisContextImpl();
AnalysisTarget target = new TestSource();
ResultDescriptor resultA = new ResultDescriptor('resultA', null);
ResultDescriptor resultB = new ResultDescriptor('resultB', null);
+ // prepare tasks
TaskDescriptor task1 = new TaskDescriptor('task', (context, target) =>
new TestAnalysisTask(context, target, results: [resultA]),
(target) => {}, [resultA]);
@@ -460,20 +482,30 @@
(target) => {'one': resultA.of(target)}, [resultB]);
manager.addTaskDescriptor(task1);
manager.addTaskDescriptor(task2);
- WorkItem item = new WorkItem(context, target, task2);
- expect(item.gatherInputs(manager), isNotNull);
+ // configure memento for "resultA"
+ dynamic memento = 'main() {}';
+ {
+ CacheEntry cacheEntry = context.getCacheEntry(target);
+ cacheEntry.setValue(resultA, null, TargetedResult.EMPTY_LIST, memento);
+ cacheEntry.setState(resultA, CacheState.INVALID);
+ }
+ // gather inputs
+ WorkItem item = new WorkItem(context, target, task2, null);
+ WorkItem inputItem = item.gatherInputs(manager);
+ expect(inputItem, isNotNull);
+ expect(inputItem.inputMemento, memento);
}
test_gatherInputs_invalid() {
TaskManager manager = new TaskManager();
- AnalysisContext context = new _TestContext();
+ AnalysisContext context = new AnalysisContextImpl();
AnalysisTarget target = new TestSource();
ResultDescriptor inputResult = new ResultDescriptor('input', null);
TaskDescriptor descriptor = new TaskDescriptor('task',
(context, target) => new TestAnalysisTask(context, target),
(target) => {'one': inputResult.of(target)},
[new ResultDescriptor('output', null)]);
- WorkItem item = new WorkItem(context, target, descriptor);
+ WorkItem item = new WorkItem(context, target, descriptor, null);
WorkItem result = item.gatherInputs(manager);
expect(result, isNull);
expect(item.exception, isNotNull);
@@ -487,7 +519,7 @@
TaskDescriptor descriptor = new TaskDescriptor(
'task', null, (_) => {}, [new ResultDescriptor('result', null)]);
WorkOrder order =
- new WorkOrder(manager, new WorkItem(null, null, descriptor));
+ new WorkOrder(manager, new WorkItem(null, null, descriptor, null));
expect(order, isNotNull);
expect(order.currentItem, isNull);
expect(order.pendingItems, hasLength(1));
@@ -498,7 +530,7 @@
TaskManager manager = new TaskManager();
TaskDescriptor descriptor = new TaskDescriptor(
'task', null, (_) => {}, [new ResultDescriptor('result', null)]);
- WorkItem workItem = new WorkItem(null, null, descriptor);
+ WorkItem workItem = new WorkItem(null, null, descriptor, null);
WorkOrder order = new WorkOrder(manager, workItem);
// "item" has no child items
expect(order.moveNext(), isTrue);
@@ -509,366 +541,14 @@
}
}
-class _TestContext implements ExtendedAnalysisContext {
- InternalAnalysisContext baseContext =
- AnalysisContextFactory.contextWithCore();
-
+/**
+ * An [AnalysisContextImpl] which allows to set explicit and implicit targets
+ * directly.
+ */
+class _TestContext extends AnalysisContextImpl {
@override
List<AnalysisTarget> explicitTargets = <AnalysisTarget>[];
- Map<AnalysisTarget, CacheEntry> entryMap =
- new HashMap<AnalysisTarget, CacheEntry>();
-
@override
List<AnalysisTarget> priorityTargets = <AnalysisTarget>[];
-
- String name = 'Test Context';
-
- _TestContext();
-
- AnalysisOptions get analysisOptions => baseContext.analysisOptions;
-
- void set analysisOptions(AnalysisOptions options) {
- baseContext.analysisOptions = options;
- }
-
- @override
- void set analysisPriorityOrder(List<Source> sources) {
- baseContext.analysisPriorityOrder = sources;
- }
-
- @override
- set contentCache(ContentCache value) {
- baseContext.contentCache = value;
- }
-
- @override
- DeclaredVariables get declaredVariables => baseContext.declaredVariables;
-
- @override
- List<Source> get htmlSources => baseContext.htmlSources;
-
- @override
- bool get isDisposed => baseContext.isDisposed;
-
- @override
- List<Source> get launchableClientLibrarySources =>
- baseContext.launchableClientLibrarySources;
-
- @override
- List<Source> get launchableServerLibrarySources =>
- baseContext.launchableServerLibrarySources;
-
- @override
- List<Source> get librarySources => baseContext.librarySources;
-
- @override
- Stream<SourcesChangedEvent> get onSourcesChanged =>
- baseContext.onSourcesChanged;
-
- @override
- List<Source> get prioritySources => baseContext.prioritySources;
-
- @override
- List<Source> get refactoringUnsafeSources =>
- baseContext.refactoringUnsafeSources;
-
- @override
- LibraryResolverFactory get libraryResolverFactory =>
- baseContext.libraryResolverFactory;
-
- @override
- ResolverVisitorFactory get resolverVisitorFactory =>
- baseContext.resolverVisitorFactory;
-
- SourceFactory get sourceFactory => baseContext.sourceFactory;
-
- void set sourceFactory(SourceFactory factory) {
- baseContext.sourceFactory = factory;
- }
-
- @override
- List<Source> get sources => baseContext.sources;
-
- @override
- AnalysisContextStatistics get statistics => baseContext.statistics;
-
- @override
- TypeProvider get typeProvider => baseContext.typeProvider;
-
- @override
- void set typeProvider(TypeProvider typeProvider) {
- baseContext.typeProvider = typeProvider;
- }
-
- @override
- TypeResolverVisitorFactory get typeResolverVisitorFactory =>
- baseContext.typeResolverVisitorFactory;
-
- @override
- void addListener(AnalysisListener listener) {
- baseContext.addListener(listener);
- }
-
- @override
- void addSourceInfo(Source source, SourceEntry info) {
- baseContext.addSourceInfo(source, info);
- }
-
- @override
- void applyAnalysisDelta(AnalysisDelta delta) {
- baseContext.applyAnalysisDelta(delta);
- }
-
- @override
- void applyChanges(ChangeSet changeSet) {
- baseContext.applyChanges(changeSet);
- }
-
- @override
- String computeDocumentationComment(Element element) {
- return baseContext.computeDocumentationComment(element);
- }
-
- @override
- List<AnalysisError> computeErrors(Source source) {
- return baseContext.computeErrors(source);
- }
-
- @override
- List<Source> computeExportedLibraries(Source source) {
- return baseContext.computeExportedLibraries(source);
- }
-
- @override
- HtmlElement computeHtmlElement(Source source) {
- return baseContext.computeHtmlElement(source);
- }
-
- @override
- List<Source> computeImportedLibraries(Source source) {
- return baseContext.computeImportedLibraries(source);
- }
-
- @override
- SourceKind computeKindOf(Source source) {
- return baseContext.computeKindOf(source);
- }
-
- @override
- LibraryElement computeLibraryElement(Source source) {
- return baseContext.computeLibraryElement(source);
- }
-
- @override
- LineInfo computeLineInfo(Source source) {
- return baseContext.computeLineInfo(source);
- }
-
- @override
- CompilationUnit computeResolvableCompilationUnit(Source source) {
- return baseContext.computeResolvableCompilationUnit(source);
- }
-
- @override
- CancelableFuture<CompilationUnit> computeResolvedCompilationUnitAsync(
- Source source, Source librarySource) {
- return baseContext.computeResolvedCompilationUnitAsync(
- source, librarySource);
- }
-
- @override
- void dispose() {
- baseContext.dispose();
- }
-
- @override
- List<CompilationUnit> ensureResolvedDartUnits(Source source) {
- return baseContext.ensureResolvedDartUnits(source);
- }
-
- @override
- bool exists(Source source) {
- return baseContext.exists(source);
- }
-
- @override
- CacheEntry getCacheEntry(AnalysisTarget target) {
- return entryMap.putIfAbsent(target, () => new CacheEntry());
- }
-
- @override
- CompilationUnitElement getCompilationUnitElement(
- Source unitSource, Source librarySource) {
- return baseContext.getCompilationUnitElement(unitSource, librarySource);
- }
-
- @override
- TimestampedData<String> getContents(Source source) {
- return baseContext.getContents(source);
- }
-
- @override
- InternalAnalysisContext getContextFor(Source source) {
- return baseContext.getContextFor(source);
- }
-
- @override
- Element getElement(ElementLocation location) {
- return baseContext.getElement(location);
- }
-
- @override
- AnalysisErrorInfo getErrors(Source source) {
- return baseContext.getErrors(source);
- }
-
- @override
- HtmlElement getHtmlElement(Source source) {
- return baseContext.getHtmlElement(source);
- }
-
- @override
- List<Source> getHtmlFilesReferencing(Source source) {
- return baseContext.getHtmlFilesReferencing(source);
- }
-
- @override
- SourceKind getKindOf(Source source) {
- return baseContext.getKindOf(source);
- }
-
- @override
- List<Source> getLibrariesContaining(Source source) {
- return baseContext.getLibrariesContaining(source);
- }
-
- @override
- List<Source> getLibrariesDependingOn(Source librarySource) {
- return baseContext.getLibrariesDependingOn(librarySource);
- }
-
- @override
- List<Source> getLibrariesReferencedFromHtml(Source htmlSource) {
- return baseContext.getLibrariesReferencedFromHtml(htmlSource);
- }
-
- @override
- LibraryElement getLibraryElement(Source source) {
- return baseContext.getLibraryElement(source);
- }
-
- @override
- LineInfo getLineInfo(Source source) {
- return baseContext.getLineInfo(source);
- }
-
- @override
- int getModificationStamp(Source source) {
- return baseContext.getModificationStamp(source);
- }
-
- @override
- Namespace getPublicNamespace(LibraryElement library) {
- return baseContext.getPublicNamespace(library);
- }
-
- @override
- CompilationUnit getResolvedCompilationUnit(
- Source unitSource, LibraryElement library) {
- return baseContext.getResolvedCompilationUnit(unitSource, library);
- }
-
- @override
- CompilationUnit getResolvedCompilationUnit2(
- Source unitSource, Source librarySource) {
- return baseContext.getResolvedCompilationUnit2(unitSource, librarySource);
- }
-
- @override
- HtmlUnit getResolvedHtmlUnit(Source htmlSource) {
- return baseContext.getResolvedHtmlUnit(htmlSource);
- }
-
- @override
- List<Source> getSourcesWithFullName(String path) {
- return baseContext.getSourcesWithFullName(path);
- }
-
- @override
- bool handleContentsChanged(
- Source source, String originalContents, String newContents, bool notify) {
- return baseContext.handleContentsChanged(
- source, originalContents, newContents, notify);
- }
-
- @override
- bool isClientLibrary(Source librarySource) {
- return baseContext.isClientLibrary(librarySource);
- }
-
- @override
- bool isServerLibrary(Source librarySource) {
- return baseContext.isServerLibrary(librarySource);
- }
-
- @override
- CompilationUnit parseCompilationUnit(Source source) {
- return baseContext.parseCompilationUnit(source);
- }
-
- @override
- HtmlUnit parseHtmlUnit(Source source) {
- return baseContext.parseHtmlUnit(source);
- }
-
- @override
- AnalysisResult performAnalysisTask() {
- return baseContext.performAnalysisTask();
- }
-
- @override
- void recordLibraryElements(Map<Source, LibraryElement> elementMap) {
- baseContext.recordLibraryElements(elementMap);
- }
-
- @override
- void removeListener(AnalysisListener listener) {
- baseContext.removeListener(listener);
- }
-
- @override
- CompilationUnit resolveCompilationUnit(
- Source unitSource, LibraryElement library) {
- return baseContext.resolveCompilationUnit(unitSource, library);
- }
-
- @override
- CompilationUnit resolveCompilationUnit2(
- Source unitSource, Source librarySource) {
- return baseContext.resolveCompilationUnit2(unitSource, librarySource);
- }
-
- @override
- HtmlUnit resolveHtmlUnit(Source htmlSource) {
- return baseContext.resolveHtmlUnit(htmlSource);
- }
-
- @override
- void setChangedContents(Source source, String contents, int offset,
- int oldLength, int newLength) {
- baseContext.setChangedContents(
- source, contents, offset, oldLength, newLength);
- }
-
- @override
- void setContents(Source source, String contents) {
- baseContext.setContents(source, contents);
- }
-
- @override
- void visitCacheItems(void callback(Source source, SourceEntry dartEntry,
- DataDescriptor rowDesc, CacheState state)) {
- baseContext.visitCacheItems(callback);
- }
}
diff --git a/pkg/analyzer/test/src/task/model_test.dart b/pkg/analyzer/test/src/task/model_test.dart
index fcc7f2b..5fd31ec7 100644
--- a/pkg/analyzer/test/src/task/model_test.dart
+++ b/pkg/analyzer/test/src/task/model_test.dart
@@ -58,7 +58,8 @@
@reflectiveTest
class ContributionPointImplTest extends EngineTestCase {
test_contributors_empty() {
- CompositeResultDescriptorImpl point = new CompositeResultDescriptorImpl('point');
+ CompositeResultDescriptorImpl point =
+ new CompositeResultDescriptorImpl('point');
List<ResultDescriptor> contributors = point.contributors;
expect(contributors, isEmpty);
}
@@ -66,7 +67,8 @@
test_contributors_nonEmpty() {
ResultDescriptorImpl result1 = new ResultDescriptorImpl('result1', null);
ResultDescriptorImpl result2 = new ResultDescriptorImpl('result2', null);
- CompositeResultDescriptorImpl point = new CompositeResultDescriptorImpl('point');
+ CompositeResultDescriptorImpl point =
+ new CompositeResultDescriptorImpl('point');
point.recordContributor(result1);
point.recordContributor(result2);
List<ResultDescriptor> contributors = point.contributors;
@@ -84,7 +86,8 @@
test_name() {
String name = 'point';
- CompositeResultDescriptorImpl point = new CompositeResultDescriptorImpl(name);
+ CompositeResultDescriptorImpl point =
+ new CompositeResultDescriptorImpl(name);
expect(point.name, name);
}
}
@@ -92,7 +95,8 @@
@reflectiveTest
class ResultDescriptorImplTest extends EngineTestCase {
test_create_withContribution() {
- CompositeResultDescriptorImpl point = new CompositeResultDescriptorImpl('point');
+ CompositeResultDescriptorImpl point =
+ new CompositeResultDescriptorImpl('point');
ResultDescriptorImpl result =
new ResultDescriptorImpl('result', null, contributesTo: point);
expect(result, isNotNull);
@@ -144,10 +148,13 @@
AnalysisContext context = null;
AnalysisTarget target = new TestSource();
Map<String, dynamic> inputs = {};
- AnalysisTask createTask = descriptor.createTask(context, target, inputs);
+ String inputMemento = 'main() {}';
+ AnalysisTask createTask =
+ descriptor.createTask(context, target, inputs, inputMemento);
expect(createTask, isNotNull);
expect(createTask.context, context);
expect(createTask.inputs, inputs);
+ expect(createTask.inputMemento, inputMemento);
expect(createTask.target, target);
}
}
diff --git a/pkg/analyzer/test/src/task/test_support.dart b/pkg/analyzer/test/src/task/test_support.dart
index 80cd7c3..7ac0d82 100644
--- a/pkg/analyzer/test/src/task/test_support.dart
+++ b/pkg/analyzer/test/src/task/test_support.dart
@@ -23,6 +23,11 @@
CaughtException exception;
/**
+ * The memento to associate with the result.
+ */
+ dynamic memento;
+
+ /**
* The results whose values are to be provided as outputs from this task.
*/
List<ResultDescriptor> results;
@@ -33,7 +38,8 @@
int value;
TestAnalysisTask(AnalysisContext context, AnalysisTarget target,
- {this.descriptor, this.exception, this.results, this.value: 1})
+ {this.descriptor, this.exception, this.memento, this.results,
+ this.value: 1})
: super(context, target);
@override
@@ -47,10 +53,12 @@
for (ResultDescriptor result in results) {
outputs[result] = value++;
}
+ outputMemento = memento;
} else if (descriptor != null) {
for (ResultDescriptor result in descriptor.results) {
outputs[result] = value++;
}
+ outputMemento = memento;
}
}
}
diff --git a/pkg/analyzer/test/test_all.dart b/pkg/analyzer/test/test_all.dart
index acf1154..222beb8 100644
--- a/pkg/analyzer/test/test_all.dart
+++ b/pkg/analyzer/test/test_all.dart
@@ -8,13 +8,10 @@
import 'cancelable_future_test.dart' as cancelable_future_test;
import 'enum_test.dart' as enum_test;
-import 'error_test.dart' as error;
import 'file_system/test_all.dart' as file_system;
import 'generated/test_all.dart' as generated;
import 'instrumentation/test_all.dart' as instrumentation;
-import 'options_test.dart' as options;
import 'parse_compilation_unit_test.dart' as parse_compilation_unit;
-import 'plugin/test_all.dart' as plugin_test_all;
import 'source/test_all.dart' as source;
import 'src/test_all.dart' as src;
import 'task/test_all.dart' as task;
@@ -25,13 +22,10 @@
group('analysis engine', () {
cancelable_future_test.main();
enum_test.main();
- error.main();
file_system.main();
generated.main();
instrumentation.main();
- options.main();
parse_compilation_unit.main();
- plugin_test_all.main();
source.main();
src.main();
task.main();
diff --git a/pkg/analyzer2dart/lib/src/cps_generator.dart b/pkg/analyzer2dart/lib/src/cps_generator.dart
index 2360c16..24a5eb2 100644
--- a/pkg/analyzer2dart/lib/src/cps_generator.dart
+++ b/pkg/analyzer2dart/lib/src/cps_generator.dart
@@ -11,11 +11,10 @@
import 'package:analyzer/src/generated/source.dart';
import 'package:analyzer/src/generated/element.dart' as analyzer;
-import 'package:compiler/src/dart2jslib.dart'
+import 'package:compiler/src/constant_system_dart.dart'
show DART_CONSTANT_SYSTEM;
import 'package:compiler/src/cps_ir/cps_ir_nodes.dart' as ir;
import 'package:compiler/src/cps_ir/cps_ir_builder.dart';
-import 'package:compiler/src/cps_ir/cps_ir_builder_task.dart';
import 'package:compiler/src/universe/universe.dart';
import 'semantic_visitor.dart';
@@ -201,10 +200,9 @@
analyzer.Element staticElement = semantics.element;
dart2js.Element element = converter.convertElement(staticElement);
List<ir.Primitive> arguments = visitArguments(node.argumentList);
- return irBuilder.buildStaticInvocation(
+ return irBuilder.buildStaticFunctionInvocation(
element,
- createSelectorFromMethodInvocation(
- node.argumentList, node.methodName.name),
+ createCallStructureFromMethodInvocation(node.argumentList),
arguments);
}
@@ -217,13 +215,16 @@
AccessSemantics semantics) {
analyzer.Element staticElement = semantics.element;
dart2js.Element element = converter.convertElement(staticElement);
- ir.Primitive receiver = irBuilder.buildLocalGet(element);
List<ir.Definition> arguments = visitArguments(node.argumentList);
- return irBuilder.buildCallInvocation(
- receiver,
- createSelectorFromMethodInvocation(
- node.argumentList, node.methodName.name),
- arguments);
+ CallStructure callStructure = createCallStructureFromMethodInvocation(
+ node.argumentList);
+ if (semantics.kind == AccessKind.LOCAL_FUNCTION) {
+ return irBuilder.buildLocalFunctionInvocation(
+ element, callStructure, arguments);
+ } else {
+ return irBuilder.buildLocalVariableInvocation(
+ element, callStructure, arguments);
+ }
}
@override
@@ -245,7 +246,7 @@
List<ir.Definition> arguments = visitArguments(node.argumentList);
return irBuilder.buildCallInvocation(
target,
- createSelectorFromMethodInvocation(node.argumentList, 'call'),
+ createCallStructureFromMethodInvocation(node.argumentList),
arguments);
}
@@ -257,13 +258,9 @@
dart2js.Element element = converter.convertElement(staticElement);
dart2js.DartType type = converter.convertType(node.staticType);
List<ir.Primitive> arguments = visitArguments(node.argumentList);
- String name = '';
- if (node.constructorName.name != null) {
- name = node.constructorName.name.name;
- }
return irBuilder.buildConstructorInvocation(
element,
- createSelectorFromMethodInvocation(node.argumentList, name),
+ createCallStructureFromMethodInvocation(node.argumentList),
type,
arguments);
}
@@ -272,36 +269,36 @@
@override
ir.Constant visitNullLiteral(NullLiteral node) {
- return irBuilder.buildNullLiteral();
+ return irBuilder.buildNullConstant();
}
@override
ir.Constant visitBooleanLiteral(BooleanLiteral node) {
- return irBuilder.buildBooleanLiteral(node.value);
+ return irBuilder.buildBooleanConstant(node.value);
}
@override
ir.Constant visitDoubleLiteral(DoubleLiteral node) {
- return irBuilder.buildDoubleLiteral(node.value);
+ return irBuilder.buildDoubleConstant(node.value);
}
@override
ir.Constant visitIntegerLiteral(IntegerLiteral node) {
- return irBuilder.buildIntegerLiteral(node.value);
+ return irBuilder.buildIntegerConstant(node.value);
}
@override
visitAdjacentStrings(AdjacentStrings node) {
String value = node.stringValue;
if (value != null) {
- return irBuilder.buildStringLiteral(value);
+ return irBuilder.buildStringConstant(value);
}
giveUp(node, "Non constant adjacent strings.");
}
@override
ir.Constant visitSimpleStringLiteral(SimpleStringLiteral node) {
- return irBuilder.buildStringLiteral(node.value);
+ return irBuilder.buildStringConstant(node.value);
}
@override
@@ -347,7 +344,12 @@
}
ir.Primitive handleLocalAccess(AstNode node, AccessSemantics semantics) {
- return irBuilder.buildLocalGet(getLocal(node, semantics));
+ dart2js.Element local = getLocal(node, semantics);
+ if (semantics.kind == AccessKind.LOCAL_FUNCTION) {
+ return irBuilder.buildLocalFunctionGet(local);
+ } else {
+ return irBuilder.buildLocalVariableGet(local);
+ }
}
ir.Primitive handleLocalAssignment(AssignmentExpression node,
@@ -355,7 +357,7 @@
if (node.operator.lexeme != '=') {
return giveUp(node, 'Assignment operator: ${node.operator.lexeme}');
}
- return irBuilder.buildLocalSet(
+ return irBuilder.buildLocalVariableSet(
getLocal(node, semantics),
build(node.rightHandSide));
}
@@ -390,7 +392,7 @@
// [TreeShaker] and shared with the [CpsGeneratingVisitor].
assert(invariant(node, target.isTopLevel || target.isStatic,
'$target expected to be top-level or static.'));
- return irBuilder.buildStaticSet(target, build(node.rightHandSide));
+ return irBuilder.buildStaticFieldSet(target, build(node.rightHandSide));
}
@override
@@ -410,7 +412,7 @@
// [TreeShaker] and shared with the [CpsGeneratingVisitor].
assert(invariant(node, target.isTopLevel || target.isStatic,
'$target expected to be top-level or static.'));
- return irBuilder.buildStaticGet(target);
+ return irBuilder.buildStaticFieldGet(target);
}
ir.Primitive handleBinaryExpression(BinaryExpression node,
diff --git a/pkg/analyzer2dart/lib/src/dart_backend.dart b/pkg/analyzer2dart/lib/src/dart_backend.dart
index 880f968..317fd2c 100644
--- a/pkg/analyzer2dart/lib/src/dart_backend.dart
+++ b/pkg/analyzer2dart/lib/src/dart_backend.dart
@@ -4,10 +4,12 @@
library analyzer2dart.dart_backend;
-import 'package:compiler/src/elements/elements.dart';
+import 'package:compiler/src/constant_system_dart.dart';
+import 'package:compiler/src/constants/constant_system.dart';
import 'package:compiler/src/dart_backend/dart_backend.dart';
import 'package:compiler/src/dart2jslib.dart';
import 'package:compiler/src/dart_types.dart';
+import 'package:compiler/src/elements/elements.dart';
import 'driver.dart';
import 'converted_world.dart';
diff --git a/pkg/analyzer2dart/lib/src/modely.dart b/pkg/analyzer2dart/lib/src/modely.dart
index e69d5f0..640680f 100644
--- a/pkg/analyzer2dart/lib/src/modely.dart
+++ b/pkg/analyzer2dart/lib/src/modely.dart
@@ -84,7 +84,7 @@
get enclosingElement => unsupported('enclosingElement');
@override
- accept(_) => unsupported('accept');
+ accept(_, __) => unsupported('accept');
@override
void addMetadata(_) => unsupported('addMetadata');
@@ -381,8 +381,9 @@
with AnalyzableElementY,
AstElementY,
TopLevelElementMixin,
- FunctionElementMixin
- implements dart2js.FunctionElement {
+ FunctionElementMixin,
+ MemberElementMixin
+ implements dart2js.MethodElement {
analyzer.FunctionElement get element => super.element;
@override
@@ -391,6 +392,9 @@
TopLevelFunctionElementY(ElementConverter converter,
analyzer.FunctionElement element)
: super(converter, element);
+
+ @override
+ get nestedClosures => unsupported('nestedClosures');
}
class LocalFunctionElementY extends ElementY
@@ -894,4 +898,4 @@
abstract class MemberElementMixin implements dart2js.MemberElement {
dart2js.Name get memberName => new dart2js.Name(name, library);
-}
\ No newline at end of file
+}
diff --git a/pkg/analyzer2dart/lib/src/util.dart b/pkg/analyzer2dart/lib/src/util.dart
index e4b0d33..67ee97e 100644
--- a/pkg/analyzer2dart/lib/src/util.dart
+++ b/pkg/analyzer2dart/lib/src/util.dart
@@ -8,11 +8,11 @@
import 'package:analyzer/analyzer.dart';
import 'package:analyzer/src/generated/source.dart';
+import 'package:compiler/src/elements/elements.dart' show PublicName;
import 'package:compiler/src/universe/universe.dart';
import 'package:compiler/src/io/source_file.dart';
-Selector createSelectorFromMethodInvocation(ArgumentList node,
- String name) {
+CallStructure createCallStructureFromMethodInvocation(ArgumentList node) {
int arity = 0;
List<String> namedArguments = <String>[];
for (Expression argument in node.arguments) {
@@ -22,7 +22,14 @@
arity++;
}
}
- return new Selector.call(name, null, arity, namedArguments);
+ return new CallStructure(arity, namedArguments);
+}
+
+Selector createSelectorFromMethodInvocation(ArgumentList node,
+ String name) {
+ CallStructure callStructure = createCallStructureFromMethodInvocation(node);
+ // TODO(johnniwinther): Support private names.
+ return new Selector(SelectorKind.CALL, new PublicName(name), callStructure);
}
/// Prints [message] together with source code pointed to by [node] from
diff --git a/pkg/analyzer2dart/test/end2end_data.dart b/pkg/analyzer2dart/test/end2end_data.dart
index 2ad4598..20b680f 100644
--- a/pkg/analyzer2dart/test/end2end_data.dart
+++ b/pkg/analyzer2dart/test/end2end_data.dart
@@ -165,12 +165,6 @@
const Group('Top level field', const <TestSpec>[
const TestSpec('''
-main(args) {
- return deprecated;
-}
-'''),
-
- const TestSpec('''
var field;
main(args) {
return field;
@@ -285,8 +279,7 @@
}
''', '''
main(a) {
- a = a ? "" : a;
- print(a);
+ print(a = a ? "" : a);
return a;
}
'''),
@@ -332,120 +325,120 @@
const Group('Binary expressions', const <TestSpec>[
const TestSpec('''
-main(a) {
- return a + deprecated;
+main(a, b) {
+ return a + b;
}
'''),
const TestSpec('''
-main(a) {
- return a - deprecated;
+main(a, b) {
+ return a - b;
}
'''),
const TestSpec('''
-main(a) {
- return a * deprecated;
+main(a, b) {
+ return a * b;
}
'''),
const TestSpec('''
-main(a) {
- return a / deprecated;
+main(a, b) {
+ return a / b;
}
'''),
const TestSpec('''
-main(a) {
- return a ~/ deprecated;
+main(a, b) {
+ return a ~/ b;
}
'''),
const TestSpec('''
-main(a) {
- return a % deprecated;
+main(a, b) {
+ return a % b;
}
'''),
const TestSpec('''
-main(a) {
- return a < deprecated;
+main(a, b) {
+ return a < b;
}
'''),
const TestSpec('''
-main(a) {
- return a <= deprecated;
+main(a, b) {
+ return a <= b;
}
'''),
const TestSpec('''
-main(a) {
- return a > deprecated;
+main(a, b) {
+ return a > b;
}
'''),
const TestSpec('''
-main(a) {
- return a >= deprecated;
+main(a, b) {
+ return a >= b;
}
'''),
const TestSpec('''
-main(a) {
- return a << deprecated;
+main(a, b) {
+ return a << b;
}
'''),
const TestSpec('''
-main(a) {
- return a >> deprecated;
+main(a, b) {
+ return a >> b;
}
'''),
const TestSpec('''
-main(a) {
- return a & deprecated;
+main(a, b) {
+ return a & b;
}
'''),
const TestSpec('''
-main(a) {
- return a | deprecated;
+main(a, b) {
+ return a | b;
}
'''),
const TestSpec('''
-main(a) {
- return a ^ deprecated;
+main(a, b) {
+ return a ^ b;
}
'''),
const TestSpec('''
-main(a) {
- return a == deprecated;
+main(a, b) {
+ return a == b;
}
'''),
const TestSpec('''
-main(a) {
- return a != deprecated;
+main(a, b) {
+ return a != b;
}
''','''
-main(a) {
- return !(a == deprecated);
+main(a, b) {
+ return !(a == b);
}
'''),
const TestSpec('''
-main(a) {
- return a && deprecated;
+main(a, b) {
+ return a && b;
}
'''),
const TestSpec('''
-main(a) {
- return a || deprecated;
+main(a, b) {
+ return a || b;
}
'''),
]),
diff --git a/pkg/compiler/lib/src/apiimpl.dart b/pkg/compiler/lib/src/apiimpl.dart
index 7449c7a7..b571d40 100644
--- a/pkg/compiler/lib/src/apiimpl.dart
+++ b/pkg/compiler/lib/src/apiimpl.dart
@@ -66,6 +66,7 @@
disableTypeInferenceFlag:
hasOption(options, '--disable-type-inference'),
preserveComments: hasOption(options, '--preserve-comments'),
+ useCpsIr: hasOption(options, '--use-cps-ir'),
verbose: hasOption(options, '--verbose'),
sourceMapUri: extractUriOption(options, '--source-map='),
outputUri: extractUriOption(options, '--out='),
@@ -82,6 +83,7 @@
forceIncrementalSupport ||
hasOption(options, '--incremental-support'),
suppressWarnings: hasOption(options, '--suppress-warnings'),
+ fatalWarnings: hasOption(options, '--fatal-warnings'),
enableExperimentalMirrors:
hasOption(options, '--enable-experimental-mirrors'),
generateCodeWithCompileTimeErrors:
@@ -354,7 +356,8 @@
api.Diagnostic kind) {
leg.SourceSpan span = spanFromSpannable(node);
if (identical(kind, api.Diagnostic.ERROR)
- || identical(kind, api.Diagnostic.CRASH)) {
+ || identical(kind, api.Diagnostic.CRASH)
+ || (fatalWarnings && identical(kind, api.Diagnostic.WARNING))) {
compilationFailed = true;
}
// [:span.uri:] might be [:null:] in case of a [Script] with no [uri]. For
diff --git a/pkg/compiler/lib/src/closure.dart b/pkg/compiler/lib/src/closure.dart
index ac68fbd..242fb82 100644
--- a/pkg/compiler/lib/src/closure.dart
+++ b/pkg/compiler/lib/src/closure.dart
@@ -143,7 +143,9 @@
String toString() => "ClosureFieldElement($name)";
- accept(ElementVisitor visitor) => visitor.visitClosureFieldElement(this);
+ accept(ElementVisitor visitor, arg) {
+ return visitor.visitClosureFieldElement(this, arg);
+ }
Element get analyzableElement => closureClass.methodElement.analyzableElement;
@@ -214,7 +216,9 @@
get enclosingElement => methodElement;
- accept(ElementVisitor visitor) => visitor.visitClosureClassElement(this);
+ accept(ElementVisitor visitor, arg) {
+ return visitor.visitClosureClassElement(this, arg);
+ }
}
/// A local variable that contains the box object holding the [BoxFieldElement]
@@ -242,7 +246,9 @@
final VariableElement variableElement;
- accept(ElementVisitor visitor) => visitor.visitBoxFieldElement(this);
+ accept(ElementVisitor visitor, arg) {
+ return visitor.visitBoxFieldElement(this, arg);
+ }
@override
bool get hasNode => false;
diff --git a/pkg/compiler/lib/src/compile_time_constants.dart b/pkg/compiler/lib/src/compile_time_constants.dart
index c6f1af4..83e1307 100644
--- a/pkg/compiler/lib/src/compile_time_constants.dart
+++ b/pkg/compiler/lib/src/compile_time_constants.dart
@@ -2,7 +2,22 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-part of dart2js;
+library dart2js.compile_time_constant_evaluator;
+
+import 'constant_system_dart.dart';
+import 'constants/constant_system.dart';
+import 'constants/expressions.dart';
+import 'constants/values.dart';
+import 'dart_types.dart';
+import 'dart2jslib.dart' show Compiler, CompilerTask, MessageKind, invariant;
+import 'elements/elements.dart';
+import 'elements/modelx.dart' show FunctionElementX;
+import 'helpers/helpers.dart';
+import 'resolution/resolution.dart';
+import 'resolution/operators.dart';
+import 'tree/tree.dart';
+import 'util/util.dart' show Link;
+import 'universe/universe.dart' show CallStructure;
/// A [ConstantEnvironment] provides access for constants compiled for variable
/// initializers.
@@ -27,14 +42,21 @@
/// if possible.
void compileVariable(VariableElement element);
- /// Compiles the compile-time constant for [node], or reports an error if
- /// [node] is not a compile-time constant.
+ /// Compiles the constant for [node].
+ ///
+ /// Reports an error if [node] is not a compile-time constant and
+ /// [enforceConst].
+ ///
+ /// If `!enforceConst`, then if [node] is a "runtime constant" (for example
+ /// a reference to a deferred constant) it will be returned - otherwise null
+ /// is returned.
///
/// Depending on implementation, the constant compiler might also compute
- /// the compile-time constant for the backend interpretation of constants.
+ /// the constant for the backend interpretation of constants.
///
/// The returned constant is always of the frontend interpretation.
- ConstantExpression compileNode(Node node, TreeElements elements);
+ ConstantExpression compileNode(Node node, TreeElements elements,
+ {bool enforceConst: true});
/// Compiles the compile-time constant for the value [metadata], or reports an
/// error if the value is not a compile-time constant.
@@ -145,7 +167,7 @@
ConstantExpression value;
if (initializer == null) {
// No initial value.
- value = new PrimitiveConstantExpression(new NullConstantValue());
+ value = new NullConstantExpression(new NullConstantValue());
} else {
value = compileNodeWithDefinitions(
initializer, definitions, isConst: isConst);
@@ -199,8 +221,9 @@
return constant != null ? constant.expression : null;
}
- ConstantExpression compileNode(Node node, TreeElements elements) {
- return compileNodeWithDefinitions(node, elements);
+ ConstantExpression compileNode(Node node, TreeElements elements,
+ {bool enforceConst: true}) {
+ return compileNodeWithDefinitions(node, elements, isConst: enforceConst);
}
ConstantExpression compileMetadata(MetadataAnnotation metadata,
@@ -287,19 +310,22 @@
AstConstant visitLiteralBool(LiteralBool node) {
return new AstConstant(
- context, node, new PrimitiveConstantExpression(
+ context, node, new BoolConstantExpression(
+ node.value,
constantSystem.createBool(node.value)));
}
AstConstant visitLiteralDouble(LiteralDouble node) {
return new AstConstant(
- context, node, new PrimitiveConstantExpression(
+ context, node, new DoubleConstantExpression(
+ node.value,
constantSystem.createDouble(node.value)));
}
AstConstant visitLiteralInt(LiteralInt node) {
return new AstConstant(
- context, node, new PrimitiveConstantExpression(
+ context, node, new IntConstantExpression(
+ node.value,
constantSystem.createInt(node.value)));
}
@@ -368,13 +394,14 @@
AstConstant visitLiteralNull(LiteralNull node) {
return new AstConstant(
- context, node, new PrimitiveConstantExpression(
+ context, node, new NullConstantExpression(
constantSystem.createNull()));
}
AstConstant visitLiteralString(LiteralString node) {
return new AstConstant(
- context, node, new PrimitiveConstantExpression(
+ context, node, new StringConstantExpression(
+ node.dartString.slowToString(),
constantSystem.createString(node.dartString)));
}
@@ -440,23 +467,22 @@
String text = node.slowNameString;
List<AstConstant> arguments =
<AstConstant>[new AstConstant(context, node,
- new PrimitiveConstantExpression(constantSystem.createString(
- new DartString.literal(text))))];
- AstConstant constant = makeConstructedConstant(
- compiler, handler, context, node, type, compiler.symbolConstructor,
- CallStructure.ONE_ARG,
- arguments, arguments);
+ new StringConstantExpression(
+ text,
+ constantSystem.createString(new LiteralDartString(text))))];
+ ConstructorElement constructor = compiler.symbolConstructor;
+ AstConstant constant = createConstructorInvocation(
+ node, type, constructor, CallStructure.ONE_ARG,
+ normalizedArguments: arguments);
return new AstConstant(
context, node, new SymbolConstantExpression(constant.value, text));
}
- AstConstant makeTypeConstant(Node node, DartType elementType) {
+ ConstantExpression makeTypeConstant(DartType elementType) {
DartType constantType =
compiler.backend.typeImplementation.computeType(compiler);
- return new AstConstant(
- context, node, new TypeConstantExpression(
- new TypeConstantValue(elementType, constantType),
- elementType));
+ return new TypeConstantExpression(
+ new TypeConstantValue(elementType, constantType), elementType);
}
/// Returns true if the prefix of the send resolves to a deferred import
@@ -472,7 +498,7 @@
if (Elements.isClass(element) || Elements.isTypedef(element)) {
TypeDeclarationElement typeDeclarationElement = element;
DartType type = typeDeclarationElement.rawType;
- return makeTypeConstant(node, type);
+ return new AstConstant(element, node, makeTypeConstant(type));
}
return signalNotCompileTimeConstant(node);
}
@@ -481,32 +507,27 @@
AstConstant visitSend(Send send) {
Element element = elements[send];
if (send.isPropertyAccess) {
- if (isDeferredUse(send)) {
- return signalNotCompileTimeConstant(send,
- message: MessageKind.DEFERRED_COMPILE_TIME_CONSTANT);
- }
+ ConstantExpression result;
+
if (Elements.isStaticOrTopLevelFunction(element)) {
FunctionElementX function = element;
function.computeType(compiler);
- return new AstConstant(
- context, send, new FunctionConstantExpression(
- new FunctionConstantValue(function),
- function));
+ result = new FunctionConstantExpression(
+ new FunctionConstantValue(function), function);
} else if (Elements.isStaticOrTopLevelField(element)) {
- ConstantExpression result;
+ ConstantExpression elementExpression;
if (element.isConst) {
- result = handler.compileConstant(element);
+ elementExpression = handler.compileConstant(element);
} else if (element.isFinal && !isEvaluatingConstant) {
- result = handler.compileVariable(element);
+ elementExpression = handler.compileVariable(element);
}
- if (result != null) {
- return new AstConstant(
- context, send,
- new VariableConstantExpression(result.value, element));
+ if (elementExpression != null) {
+ result =
+ new VariableConstantExpression(elementExpression.value, element);
}
} else if (Elements.isClass(element) || Elements.isTypedef(element)) {
assert(elements.isTypeLiteral(send));
- return makeTypeConstant(send, elements.getTypeLiteralType(send));
+ result = makeTypeConstant(elements.getTypeLiteralType(send));
} else if (send.receiver != null) {
if (send.selector.asIdentifier().source == "length") {
AstConstant left = evaluate(send.receiver);
@@ -514,22 +535,37 @@
StringConstantValue stringConstantValue = left.value;
DartString string = stringConstantValue.primitiveValue;
IntConstantValue length = constantSystem.createInt(string.length);
- return new AstConstant(
- context, send, new VariableConstantExpression(length, element));
+ result = new VariableConstantExpression(length, element);
}
}
// Fall through to error handling.
} else if (!Elements.isUnresolved(element)
&& element.isVariable
&& element.isConst) {
- ConstantExpression result = handler.compileConstant(element);
- if (result != null) {
- return new AstConstant(
- context, send,
- new VariableConstantExpression(result.value, element));
+ ConstantExpression variableExpression =
+ handler.compileConstant(element);
+ if (variableExpression != null) {
+ result = new VariableConstantExpression(variableExpression.value,
+ element);
}
}
- return signalNotCompileTimeConstant(send);
+ if (result == null) {
+ return signalNotCompileTimeConstant(send);
+ }
+ if (isDeferredUse(send)) {
+ if (isEvaluatingConstant) {
+ error(send, MessageKind.DEFERRED_COMPILE_TIME_CONSTANT);
+ }
+ PrefixElement prefix = compiler.deferredLoadTask
+ .deferredPrefixElement(send, elements);
+ result = new DeferredConstantExpression(
+ new DeferredConstantValue(result.value, prefix),
+ result,
+ prefix);
+ compiler.deferredLoadTask
+ .registerConstantDeferredUse(result.value, prefix);
+ }
+ return new AstConstant(context, send, result);
} else if (send.isCall) {
if (element == compiler.identicalFunction
&& send.argumentCount() == 2) {
@@ -542,8 +578,8 @@
constantSystem.identity.fold(left.value, right.value);
if (result != null) {
return new AstConstant(
- context, send, new BinaryConstantExpression(result,
- left.expression, 'identical', right.expression));
+ context, send, new IdenticalConstantExpression(result,
+ left.expression, right.expression));
}
}
return signalNotCompileTimeConstant(send);
@@ -553,10 +589,11 @@
if (receiverConstant == null) {
return null;
}
- Operator op = send.selector;
- UnaryOperation operation = constantSystem.lookupUnary(op.source);
+ Operator node = send.selector;
+ UnaryOperator operator = UnaryOperator.parse(node.source);
+ UnaryOperation operation = constantSystem.lookupUnary(operator);
if (operation == null) {
- compiler.internalError(op, "Unexpected operator.");
+ compiler.internalError(send.selector, "Unexpected operator.");
}
ConstantValue folded = operation.fold(receiverConstant.value);
if (folded == null) {
@@ -564,7 +601,7 @@
}
return new AstConstant(
context, send, new UnaryConstantExpression(folded,
- op.source, receiverConstant.expression));
+ operator, receiverConstant.expression));
} else if (send.isOperator && !send.isPostfix) {
assert(send.argumentCount() == 1);
AstConstant left = evaluate(send.receiver);
@@ -574,37 +611,41 @@
}
ConstantValue leftValue = left.value;
ConstantValue rightValue = right.value;
- Operator op = send.selector.asOperator();
+ Operator node = send.selector.asOperator();
+ BinaryOperator operator = BinaryOperator.parse(node.source);
ConstantValue folded = null;
- switch (op.source) {
- case "==":
- if (leftValue.isPrimitive && rightValue.isPrimitive) {
- folded = constantSystem.equal.fold(leftValue, rightValue);
- }
- break;
- case "!=":
- if (leftValue.isPrimitive && rightValue.isPrimitive) {
- BoolConstantValue areEquals =
- constantSystem.equal.fold(leftValue, rightValue);
- if (areEquals == null) {
- folded = null;
- } else {
- folded = areEquals.negate();
+ // operator is null when `node=="is"`
+ if (operator != null) {
+ switch (operator.kind) {
+ case BinaryOperatorKind.EQ:
+ if (leftValue.isPrimitive && rightValue.isPrimitive) {
+ folded = constantSystem.equal.fold(leftValue, rightValue);
}
- }
- break;
- default:
- BinaryOperation operation = constantSystem.lookupBinary(op.source);
- if (operation != null) {
- folded = operation.fold(leftValue, rightValue);
- }
+ break;
+ case BinaryOperatorKind.NOT_EQ:
+ if (leftValue.isPrimitive && rightValue.isPrimitive) {
+ BoolConstantValue areEquals =
+ constantSystem.equal.fold(leftValue, rightValue);
+ if (areEquals == null) {
+ folded = null;
+ } else {
+ folded = areEquals.negate();
+ }
+ }
+ break;
+ default:
+ BinaryOperation operation = constantSystem.lookupBinary(operator);
+ if (operation != null) {
+ folded = operation.fold(leftValue, rightValue);
+ }
+ }
}
if (folded == null) {
return signalNotCompileTimeConstant(send);
}
return new AstConstant(
context, send, new BinaryConstantExpression(folded,
- left.expression, op.source, right.expression));
+ left.expression, operator, right.expression));
}
return signalNotCompileTimeConstant(send);
}
@@ -689,7 +730,7 @@
}
Send send = node.send;
- FunctionElement constructor = elements[send];
+ ConstructorElement constructor = elements[send];
if (Elements.isUnresolved(constructor)) {
return signalNotCompileTimeConstant(node);
}
@@ -701,119 +742,168 @@
message: MessageKind.DEFERRED_COMPILE_TIME_CONSTANT_CONSTRUCTION);
}
+ InterfaceType type = elements.getType(node);
+ CallStructure callStructure = elements.getSelector(send).callStructure;
+
+ return createConstructorInvocation(
+ node, type, constructor, callStructure,
+ arguments: node.send.arguments);
+ }
+
+ AstConstant createConstructorInvocation(
+ Node node,
+ InterfaceType type,
+ ConstructorElement constructor,
+ CallStructure callStructure,
+ {Link<Node> arguments,
+ List<AstConstant> normalizedArguments}) {
// TODO(ahe): This is nasty: we must eagerly analyze the
// constructor to ensure the redirectionTarget has been computed
// correctly. Find a way to avoid this.
compiler.analyzeElement(constructor.declaration);
- InterfaceType type = elements.getType(node);
- CallStructure callStructure = elements.getSelector(send).callStructure;
+ // The redirection chain of this element may not have been resolved through
+ // a post-process action, so we have to make sure it is done here.
+ compiler.resolver.resolveRedirectionChain(constructor, node);
+ InterfaceType constructedType =
+ constructor.computeEffectiveTargetType(type);
+ ConstructorElement target = constructor.effectiveTarget;
+ // The constructor must be an implementation to ensure that field
+ // initializers are handled correctly.
+ ConstructorElement implementation = target.implementation;
- Map<Node, AstConstant> concreteArgumentMap =
- <Node, AstConstant>{};
- for (Link<Node> link = send.arguments; !link.isEmpty; link = link.tail) {
- Node argument = link.head;
- NamedArgument namedArgument = argument.asNamedArgument();
- if (namedArgument != null) {
- argument = namedArgument.expression;
- }
- concreteArgumentMap[argument] = evaluateConstant(argument);
+ if (implementation.isErroneous) {
+ return new AstConstant(
+ context, node, new ConstructedConstantExpression(
+ new ConstructedConstantValue(
+ constructedType, const <FieldElement, ConstantValue>{}),
+ type,
+ constructor,
+ callStructure,
+ const <ConstantExpression>[]));
}
- List<AstConstant> normalizedArguments =
- evaluateArgumentsToConstructor(
- node, callStructure, send.arguments, constructor.implementation,
- compileArgument: (node) => concreteArgumentMap[node]);
- List<AstConstant> concreteArguments =
- concreteArgumentMap.values.toList();
-
- if (constructor == compiler.intEnvironment ||
- constructor == compiler.boolEnvironment ||
- constructor == compiler.stringEnvironment) {
-
- AstConstant createEvaluatedConstant(ConstantValue value) {
- return new AstConstant(
- context, node, new ConstructedConstantExpression(
- value,
- type,
- constructor,
- elements.getSelector(send).callStructure,
- concreteArguments.map((e) => e.expression).toList()));
- }
-
- var firstArgument = normalizedArguments[0].value;
- ConstantValue defaultValue = normalizedArguments[1].value;
-
- if (firstArgument.isNull) {
- compiler.reportError(
- send.arguments.head, MessageKind.NULL_NOT_ALLOWED);
- return null;
- }
-
- if (!firstArgument.isString) {
- DartType type = defaultValue.getType(compiler.coreTypes);
- compiler.reportError(
- send.arguments.head, MessageKind.NOT_ASSIGNABLE,
- {'fromType': type, 'toType': compiler.stringClass.rawType});
- return null;
- }
-
- if (constructor == compiler.intEnvironment &&
- !(defaultValue.isNull || defaultValue.isInt)) {
- DartType type = defaultValue.getType(compiler.coreTypes);
- compiler.reportError(
- send.arguments.tail.head, MessageKind.NOT_ASSIGNABLE,
- {'fromType': type, 'toType': compiler.intClass.rawType});
- return null;
- }
-
- if (constructor == compiler.boolEnvironment &&
- !(defaultValue.isNull || defaultValue.isBool)) {
- DartType type = defaultValue.getType(compiler.coreTypes);
- compiler.reportError(
- send.arguments.tail.head, MessageKind.NOT_ASSIGNABLE,
- {'fromType': type, 'toType': compiler.boolClass.rawType});
- return null;
- }
-
- if (constructor == compiler.stringEnvironment &&
- !(defaultValue.isNull || defaultValue.isString)) {
- DartType type = defaultValue.getType(compiler.coreTypes);
- compiler.reportError(
- send.arguments.tail.head, MessageKind.NOT_ASSIGNABLE,
- {'fromType': type, 'toType': compiler.stringClass.rawType});
- return null;
- }
-
- String value =
- compiler.fromEnvironment(firstArgument.primitiveValue.slowToString());
-
- if (value == null) {
- return createEvaluatedConstant(defaultValue);
- } else if (constructor == compiler.intEnvironment) {
- int number = int.parse(value, onError: (_) => null);
- return createEvaluatedConstant(
- (number == null)
- ? defaultValue
- : constantSystem.createInt(number));
- } else if (constructor == compiler.boolEnvironment) {
- if (value == 'true') {
- return createEvaluatedConstant(constantSystem.createBool(true));
- } else if (value == 'false') {
- return createEvaluatedConstant(constantSystem.createBool(false));
- } else {
- return createEvaluatedConstant(defaultValue);
+ List<AstConstant> concreteArguments;
+ if (arguments != null) {
+ Map<Node, AstConstant> concreteArgumentMap =
+ <Node, AstConstant>{};
+ for (Link<Node> link = arguments; !link.isEmpty; link = link.tail) {
+ Node argument = link.head;
+ NamedArgument namedArgument = argument.asNamedArgument();
+ if (namedArgument != null) {
+ argument = namedArgument.expression;
}
- } else {
- assert(constructor == compiler.stringEnvironment);
- return createEvaluatedConstant(
- constantSystem.createString(new DartString.literal(value)));
+ concreteArgumentMap[argument] = evaluateConstant(argument);
}
+
+ normalizedArguments = evaluateArgumentsToConstructor(
+ node, callStructure, arguments, implementation,
+ compileArgument: (node) => concreteArgumentMap[node]);
+ concreteArguments = concreteArgumentMap.values.toList();
+ } else {
+ assert(normalizedArguments != null);
+ concreteArguments = normalizedArguments;
+ }
+
+ if (target == compiler.intEnvironment ||
+ target == compiler.boolEnvironment ||
+ target == compiler.stringEnvironment) {
+ return createFromEnvironmentConstant(
+ node, constructedType, target,
+ callStructure, normalizedArguments, concreteArguments);
} else {
return makeConstructedConstant(
- compiler, handler, context,
- node, type, constructor, callStructure,
- concreteArguments, normalizedArguments);
+ compiler, handler, context, node,
+ type, constructor,
+ constructedType, implementation,
+ callStructure, concreteArguments, normalizedArguments);
+ }
+ }
+
+ AstConstant createFromEnvironmentConstant(
+ Node node,
+ InterfaceType type,
+ ConstructorElement constructor,
+ CallStructure callStructure,
+ List<AstConstant> normalizedArguments,
+ List<AstConstant> concreteArguments) {
+ AstConstant createEvaluatedConstant(ConstantValue value) {
+ return new AstConstant(
+ context, node, new ConstructedConstantExpression(
+ value,
+ type,
+ constructor,
+ callStructure,
+ concreteArguments.map((e) => e.expression).toList()));
+ }
+
+ var firstArgument = normalizedArguments[0].value;
+ ConstantValue defaultValue = normalizedArguments[1].value;
+
+ if (firstArgument.isNull) {
+ compiler.reportError(
+ normalizedArguments[0].node, MessageKind.NULL_NOT_ALLOWED);
+ return null;
+ }
+
+ if (!firstArgument.isString) {
+ DartType type = defaultValue.getType(compiler.coreTypes);
+ compiler.reportError(
+ normalizedArguments[0].node, MessageKind.NOT_ASSIGNABLE,
+ {'fromType': type, 'toType': compiler.stringClass.rawType});
+ return null;
+ }
+
+ if (constructor == compiler.intEnvironment &&
+ !(defaultValue.isNull || defaultValue.isInt)) {
+ DartType type = defaultValue.getType(compiler.coreTypes);
+ compiler.reportError(
+ normalizedArguments[1].node, MessageKind.NOT_ASSIGNABLE,
+ {'fromType': type, 'toType': compiler.intClass.rawType});
+ return null;
+ }
+
+ if (constructor == compiler.boolEnvironment &&
+ !(defaultValue.isNull || defaultValue.isBool)) {
+ DartType type = defaultValue.getType(compiler.coreTypes);
+ compiler.reportError(
+ normalizedArguments[1].node, MessageKind.NOT_ASSIGNABLE,
+ {'fromType': type, 'toType': compiler.boolClass.rawType});
+ return null;
+ }
+
+ if (constructor == compiler.stringEnvironment &&
+ !(defaultValue.isNull || defaultValue.isString)) {
+ DartType type = defaultValue.getType(compiler.coreTypes);
+ compiler.reportError(
+ normalizedArguments[1].node, MessageKind.NOT_ASSIGNABLE,
+ {'fromType': type, 'toType': compiler.stringClass.rawType});
+ return null;
+ }
+
+ String value =
+ compiler.fromEnvironment(firstArgument.primitiveValue.slowToString());
+
+ if (value == null) {
+ return createEvaluatedConstant(defaultValue);
+ } else if (constructor == compiler.intEnvironment) {
+ int number = int.parse(value, onError: (_) => null);
+ return createEvaluatedConstant(
+ (number == null)
+ ? defaultValue
+ : constantSystem.createInt(number));
+ } else if (constructor == compiler.boolEnvironment) {
+ if (value == 'true') {
+ return createEvaluatedConstant(constantSystem.createBool(true));
+ } else if (value == 'false') {
+ return createEvaluatedConstant(constantSystem.createBool(false));
+ } else {
+ return createEvaluatedConstant(defaultValue);
+ }
+ } else {
+ assert(constructor == compiler.stringEnvironment);
+ return createEvaluatedConstant(
+ constantSystem.createString(new DartString.literal(value)));
}
}
@@ -824,37 +914,37 @@
Node node,
InterfaceType type,
ConstructorElement constructor,
+ InterfaceType constructedType,
+ ConstructorElement target,
CallStructure callStructure,
List<AstConstant> concreteArguments,
List<AstConstant> normalizedArguments) {
+ if (target.isRedirectingFactory) {
+ // This happens is case of cyclic redirection.
+ assert(invariant(node, compiler.compilationFailed,
+ message: "makeConstructedConstant can only be called with the "
+ "effective target: $constructor"));
+ return new AstConstant(
+ context, node, new ErroneousConstantExpression());
+ }
assert(invariant(node, callStructure.signatureApplies(constructor) ||
compiler.compilationFailed,
message: "Call structure $callStructure does not apply to constructor "
"$constructor."));
- // The redirection chain of this element may not have been resolved through
- // a post-process action, so we have to make sure it is done here.
- compiler.resolver.resolveRedirectionChain(constructor, node);
- InterfaceType constructedType =
- constructor.computeEffectiveTargetType(type);
- ConstructorElement target = constructor.effectiveTarget;
- ClassElement classElement = target.enclosingClass;
- // The constructor must be an implementation to ensure that field
- // initializers are handled correctly.
- target = target.implementation;
- assert(invariant(node, target.isImplementation));
-
ConstructorEvaluator evaluator = new ConstructorEvaluator(
constructedType, target, handler, compiler);
evaluator.evaluateConstructorFieldValues(normalizedArguments);
- List<AstConstant> fieldConstants =
- evaluator.buildFieldConstants(classElement);
-
+ Map<FieldElement, AstConstant> fieldConstants =
+ evaluator.buildFieldConstants(target.enclosingClass);
+ Map<FieldElement, ConstantValue> fieldValues =
+ <FieldElement, ConstantValue>{};
+ fieldConstants.forEach((FieldElement field, AstConstant astConstant) {
+ fieldValues[field] = astConstant.value;
+ });
return new AstConstant(
context, node, new ConstructedConstantExpression(
- new ConstructedConstantValue(
- constructedType,
- fieldConstants.map((e) => e.value).toList()),
+ new ConstructedConstantValue(constructedType, fieldValues),
type,
constructor,
callStructure,
@@ -877,7 +967,7 @@
error(node, message);
return new AstConstant(
- null, node, new PrimitiveConstantExpression(new NullConstantValue()));
+ null, node, new NullConstantExpression(new NullConstantValue()));
}
// Else we don't need to do anything. The final handler is only
// optimistically trying to compile constants. So it is normal that we
@@ -1074,8 +1164,10 @@
/// Builds a normalized list of the constant values for each field in the
/// inheritance chain of [classElement].
- List<AstConstant> buildFieldConstants(ClassElement classElement) {
- List<AstConstant> fieldConstants = <AstConstant>[];
+ Map<FieldElement, AstConstant> buildFieldConstants(
+ ClassElement classElement) {
+ Map<FieldElement, AstConstant> fieldConstants =
+ <FieldElement, AstConstant>{};
classElement.implementation.forEachInstanceField(
(ClassElement enclosing, FieldElement field) {
AstConstant fieldValue = fieldValues[field];
@@ -1084,7 +1176,7 @@
fieldValue = new AstConstant.fromDefaultValue(
field, handler.compileConstant(field));
}
- fieldConstants.add(fieldValue);
+ fieldConstants[field] = fieldValue;
},
includeSuperAndInjectedMembers: true);
return fieldConstants;
diff --git a/pkg/compiler/lib/src/compiler.dart b/pkg/compiler/lib/src/compiler.dart
index 6bbcd29..4671212 100644
--- a/pkg/compiler/lib/src/compiler.dart
+++ b/pkg/compiler/lib/src/compiler.dart
@@ -564,6 +564,10 @@
/// Register an is check to the backend.
void onIsCheck(DartType type, Registry registry) {}
+ /// Called during resolution to notify to the backend that the
+ /// program has a for-in loop.
+ void onSyncForIn(Registry registry) {}
+
/// Register an as check to the backend.
void onAsCheck(DartType type, Registry registry) {}
@@ -718,6 +722,10 @@
*/
final bool preserveComments;
+ /// Use the new CPS based backend end. This flag works for both the Dart and
+ /// JavaScript backend.
+ final bool useCpsIr;
+
/**
* Is the compiler in verbose mode.
*/
@@ -749,6 +757,7 @@
Map<Uri, SuppressionInfo> suppressedWarnings = <Uri, SuppressionInfo>{};
final bool suppressWarnings;
+ final bool fatalWarnings;
/// If `true`, some values are cached for reuse in incremental compilation.
/// Incremental compilation is basically calling [run] more than once.
@@ -999,6 +1008,7 @@
this.analyzeMain: false,
bool analyzeSignaturesOnly: false,
this.preserveComments: false,
+ this.useCpsIr: false,
this.verbose: false,
this.sourceMapUri: null,
this.outputUri: null,
@@ -1009,6 +1019,7 @@
this.showPackageWarnings: false,
this.useContentSecurityPolicy: false,
this.suppressWarnings: false,
+ this.fatalWarnings: false,
bool hasIncrementalSupport: false,
this.enableExperimentalMirrors: false,
this.allowNativeExtensions: false,
@@ -1047,9 +1058,17 @@
globalDependencies =
new CodegenRegistry(this, new TreeElementMapping(null));
+ SourceInformationFactory sourceInformationFactory =
+ const SourceInformationFactory();
+ if (generateSourceMap) {
+ sourceInformationFactory =
+ const bool.fromEnvironment('USE_NEW_SOURCE_INFO', defaultValue: false)
+ ? const PositionSourceInformationFactory()
+ : const StartEndSourceInformationFactory();
+ }
if (emitJavaScript) {
- js_backend.JavaScriptBackend jsBackend =
- new js_backend.JavaScriptBackend(this, generateSourceMap);
+ js_backend.JavaScriptBackend jsBackend = new js_backend.JavaScriptBackend(
+ this, sourceInformationFactory, generateSourceMap: generateSourceMap);
backend = jsBackend;
} else {
backend = new dart_backend.DartBackend(this, strips,
@@ -1068,7 +1087,7 @@
resolver = new ResolverTask(this, backend.constantCompilerTask),
closureToClassMapper = new closureMapping.ClosureTask(this),
checker = new TypeCheckerTask(this),
- irBuilder = new IrBuilderTask(this),
+ irBuilder = new IrBuilderTask(this, sourceInformationFactory),
typesTask = new ti.TypesTask(this),
constants = backend.constantCompilerTask,
deferredLoadTask = new DeferredLoadTask(this),
@@ -1468,7 +1487,7 @@
bool irEnabled() {
// TODO(sigurdm,kmillikin): Support checked-mode checks.
- return const bool.fromEnvironment('USE_NEW_BACKEND') &&
+ return useCpsIr &&
backend is DartBackend &&
!enableTypeAssertions &&
!enableConcreteTypeInference;
diff --git a/pkg/compiler/lib/src/constant_system_dart.dart b/pkg/compiler/lib/src/constant_system_dart.dart
index 0c507a7..a827d59 100644
--- a/pkg/compiler/lib/src/constant_system_dart.dart
+++ b/pkg/compiler/lib/src/constant_system_dart.dart
@@ -2,7 +2,13 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-part of dart2js;
+library dart2js.constant_system.dart;
+
+import 'constants/constant_system.dart';
+import 'constants/values.dart';
+import 'dart2jslib.dart' show Compiler;
+import 'dart_types.dart';
+import 'tree/tree.dart' show DartString;
const DART_CONSTANT_SYSTEM = const DartConstantSystem();
diff --git a/pkg/compiler/lib/src/constant_system.dart b/pkg/compiler/lib/src/constants/constant_system.dart
similarity index 64%
rename from pkg/compiler/lib/src/constant_system.dart
rename to pkg/compiler/lib/src/constants/constant_system.dart
index 6a1bfb0..e8260b9 100644
--- a/pkg/compiler/lib/src/constant_system.dart
+++ b/pkg/compiler/lib/src/constants/constant_system.dart
@@ -2,7 +2,13 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-part of dart2js;
+library dart2js.constant_system;
+
+import '../dart_types.dart';
+import '../dart2jslib.dart' show Compiler;
+import '../resolution/operators.dart';
+import '../tree/tree.dart' show DartString;
+import 'values.dart';
abstract class Operation {
String get name;
@@ -75,35 +81,35 @@
/** Returns true if the [constant] is null at runtime. */
bool isNull(ConstantValue constant);
- UnaryOperation lookupUnary(String operator) {
- switch (operator) {
- case '~': return bitNot;
- case '-': return negate;
- case '!': return not;
+ UnaryOperation lookupUnary(UnaryOperator operator) {
+ switch (operator.kind) {
+ case UnaryOperatorKind.COMPLEMENT: return bitNot;
+ case UnaryOperatorKind.NEGATE: return negate;
+ case UnaryOperatorKind.NOT: return not;
default: return null;
}
}
- BinaryOperation lookupBinary(String operator) {
- switch (operator) {
- case "+": return add;
- case "-": return subtract;
- case "*": return multiply;
- case "/": return divide;
- case "%": return modulo;
- case "~/": return truncatingDivide;
- case "|": return bitOr;
- case "&": return bitAnd;
- case "^": return bitXor;
- case "||": return booleanOr;
- case "&&": return booleanAnd;
- case "<<": return shiftLeft;
- case ">>": return shiftRight;
- case "<": return less;
- case "<=": return lessEqual;
- case ">": return greater;
- case ">=": return greaterEqual;
- case "==": return equal;
+ BinaryOperation lookupBinary(BinaryOperator operator) {
+ switch (operator.kind) {
+ case BinaryOperatorKind.ADD: return add;
+ case BinaryOperatorKind.SUB: return subtract;
+ case BinaryOperatorKind.MUL: return multiply;
+ case BinaryOperatorKind.DIV: return divide;
+ case BinaryOperatorKind.MOD: return modulo;
+ case BinaryOperatorKind.IDIV: return truncatingDivide;
+ case BinaryOperatorKind.OR: return bitOr;
+ case BinaryOperatorKind.AND: return bitAnd;
+ case BinaryOperatorKind.XOR: return bitXor;
+ case BinaryOperatorKind.LOGICAL_OR: return booleanOr;
+ case BinaryOperatorKind.LOGICAL_AND: return booleanAnd;
+ case BinaryOperatorKind.SHL: return shiftLeft;
+ case BinaryOperatorKind.SHR: return shiftRight;
+ case BinaryOperatorKind.LT: return less;
+ case BinaryOperatorKind.LTEQ: return lessEqual;
+ case BinaryOperatorKind.GT: return greater;
+ case BinaryOperatorKind.GTEQ: return greaterEqual;
+ case BinaryOperatorKind.EQ: return equal;
default: return null;
}
}
diff --git a/pkg/compiler/lib/src/constants/expressions.dart b/pkg/compiler/lib/src/constants/expressions.dart
index c24b66d..c454975 100644
--- a/pkg/compiler/lib/src/constants/expressions.dart
+++ b/pkg/compiler/lib/src/constants/expressions.dart
@@ -7,12 +7,37 @@
import '../dart2jslib.dart' show assertDebugMode;
import '../dart_types.dart';
import '../elements/elements.dart' show
+ ConstructorElement,
Element,
FunctionElement,
+ PrefixElement,
VariableElement;
+import '../resolution/operators.dart';
import '../universe/universe.dart' show CallStructure;
import 'values.dart';
+enum ConstantExpressionKind {
+ BINARY,
+ BOOL,
+ CONCATENATE,
+ CONDITIONAL,
+ CONSTRUCTED,
+ DEFERRED,
+ DOUBLE,
+ ERRONEOUS,
+ FUNCTION,
+ IDENTICAL,
+ INT,
+ LIST,
+ MAP,
+ NULL,
+ STRING,
+ SYMBOL,
+ TYPE,
+ UNARY,
+ VARIABLE,
+}
+
/// An expression that is a compile-time constant.
///
/// Whereas [ConstantValue] represent a compile-time value, a
@@ -23,6 +48,10 @@
/// For instance, multiple `const` constructors may be used to create the same
/// object, and different `const` variables may hold the same value.
abstract class ConstantExpression {
+ int _hashCode;
+
+ ConstantExpressionKind get kind;
+
/// Returns the value of this constant expression.
ConstantValue get value;
@@ -38,6 +67,25 @@
return printer.toString();
}
+ int _computeHashCode();
+
+ int get hashCode {
+ if (_hashCode == null) {
+ _hashCode = _computeHashCode();
+ }
+ return _hashCode;
+ }
+
+ bool _equals(ConstantExpression other);
+
+ bool operator ==(other) {
+ if (identical(this, other)) return true;
+ if (other is! ConstantExpression) return false;
+ if (kind != other.kind) return false;
+ if (hashCode != other.hashCode) return false;
+ return _equals(other);
+ }
+
String toString() {
assertDebugMode('Use ConstantExpression.getText() instead of '
'ConstantExpression.toString()');
@@ -49,26 +97,120 @@
class ErroneousConstantExpression extends ConstantExpression {
final PrimitiveConstantValue value = new NullConstantValue();
- ErroneousConstantExpression();
+ ConstantExpressionKind get kind => ConstantExpressionKind.ERRONEOUS;
accept(ConstantExpressionVisitor visitor, [context]) {
// Do nothing. This is an error.
}
+
+ @override
+ int _computeHashCode() => 13;
+
+ @override
+ bool _equals(ErroneousConstantExpression other) => true;
}
-/// Boolean, int, double, string, or null constant.
-class PrimitiveConstantExpression extends ConstantExpression {
+/// A boolean, int, double, string, or null constant.
+abstract class PrimitiveConstantExpression extends ConstantExpression {
final PrimitiveConstantValue value;
- PrimitiveConstantExpression(this.value) {
- assert(value != null);
- }
+ PrimitiveConstantExpression(this.value);
+
+ /// The primitive value of this contant expression.
+ get primitiveValue;
accept(ConstantExpressionVisitor visitor, [context]) {
return visitor.visitPrimitive(this, context);
}
}
+/// Boolean literal constant.
+class BoolConstantExpression extends PrimitiveConstantExpression {
+ final bool primitiveValue;
+
+ BoolConstantExpression(this.primitiveValue,
+ PrimitiveConstantValue value) : super(value);
+
+ ConstantExpressionKind get kind => ConstantExpressionKind.BOOL;
+
+ @override
+ int _computeHashCode() => 13 * primitiveValue.hashCode;
+
+ @override
+ bool _equals(BoolConstantExpression other) {
+ return primitiveValue == other.primitiveValue;
+ }
+}
+
+/// Integer literal constant.
+class IntConstantExpression extends PrimitiveConstantExpression {
+ final int primitiveValue;
+
+ IntConstantExpression(this.primitiveValue,
+ PrimitiveConstantValue value) : super(value);
+
+ ConstantExpressionKind get kind => ConstantExpressionKind.INT;
+
+ @override
+ int _computeHashCode() => 17 * primitiveValue.hashCode;
+
+ @override
+ bool _equals(IntConstantExpression other) {
+ return primitiveValue == other.primitiveValue;
+ }
+}
+
+/// Double literal constant.
+class DoubleConstantExpression extends PrimitiveConstantExpression {
+ final double primitiveValue;
+
+ DoubleConstantExpression(this.primitiveValue,
+ PrimitiveConstantValue value) : super(value);
+
+ ConstantExpressionKind get kind => ConstantExpressionKind.DOUBLE;
+
+ @override
+ int _computeHashCode() => 19 * primitiveValue.hashCode;
+
+ @override
+ bool _equals(DoubleConstantExpression other) {
+ return primitiveValue == other.primitiveValue;
+ }
+}
+
+/// String literal constant.
+class StringConstantExpression extends PrimitiveConstantExpression {
+ final String primitiveValue;
+
+ StringConstantExpression(this.primitiveValue,
+ PrimitiveConstantValue value) : super(value);
+
+ ConstantExpressionKind get kind => ConstantExpressionKind.STRING;
+
+ @override
+ int _computeHashCode() => 23 * primitiveValue.hashCode;
+
+ @override
+ bool _equals(StringConstantExpression other) {
+ return primitiveValue == other.primitiveValue;
+ }
+}
+
+/// Null literal constant.
+class NullConstantExpression extends PrimitiveConstantExpression {
+ NullConstantExpression(PrimitiveConstantValue value) : super(value);
+
+ ConstantExpressionKind get kind => ConstantExpressionKind.NULL;
+
+ get primitiveValue => null;
+
+ @override
+ int _computeHashCode() => 29;
+
+ @override
+ bool _equals(NullConstantExpression other) => true;
+}
+
/// Literal list constant.
class ListConstantExpression extends ConstantExpression {
final ListConstantValue value;
@@ -77,9 +219,30 @@
ListConstantExpression(this.value, this.type, this.values);
+ ConstantExpressionKind get kind => ConstantExpressionKind.LIST;
+
accept(ConstantExpressionVisitor visitor, [context]) {
return visitor.visitList(this, context);
}
+
+ @override
+ int _computeHashCode() {
+ int hashCode = 13 * type.hashCode + 17 * values.length;
+ for (ConstantExpression value in values) {
+ hashCode ^= 19 * value.hashCode;
+ }
+ return hashCode;
+ }
+
+ @override
+ bool _equals(ListConstantExpression other) {
+ if (type != other.type) return false;
+ if (values.length != other.values.length) return false;
+ for (int i = 0; i < values.length; i++) {
+ if (values[i] != other.values[i]) return false;
+ }
+ return true;
+ }
}
/// Literal map constant.
@@ -91,16 +254,38 @@
MapConstantExpression(this.value, this.type, this.keys, this.values);
+ ConstantExpressionKind get kind => ConstantExpressionKind.MAP;
+
accept(ConstantExpressionVisitor visitor, [context]) {
return visitor.visitMap(this, context);
}
+
+ @override
+ int _computeHashCode() {
+ int hashCode = 13 * type.hashCode + 17 * values.length;
+ for (ConstantExpression value in values) {
+ hashCode ^= 19 * value.hashCode;
+ }
+ return hashCode;
+ }
+
+ @override
+ bool _equals(MapConstantExpression other) {
+ if (type != other.type) return false;
+ if (values.length != other.values.length) return false;
+ for (int i = 0; i < values.length; i++) {
+ if (keys[i] != other.keys[i]) return false;
+ if (values[i] != other.values[i]) return false;
+ }
+ return true;
+ }
}
/// Invocation of a const constructor.
class ConstructedConstantExpression extends ConstantExpression {
final ConstantValue value;
final InterfaceType type;
- final FunctionElement target;
+ final ConstructorElement target;
final CallStructure callStructure;
final List<ConstantExpression> arguments;
@@ -113,22 +298,66 @@
assert(type.element == target.enclosingClass);
}
+ ConstantExpressionKind get kind => ConstantExpressionKind.CONSTRUCTED;
+
accept(ConstantExpressionVisitor visitor, [context]) {
return visitor.visitConstructed(this, context);
}
+
+ @override
+ int _computeHashCode() {
+ int hashCode =
+ 13 * type.hashCode +
+ 17 * target.hashCode +
+ 19 * callStructure.hashCode;
+ for (ConstantExpression value in arguments) {
+ hashCode ^= 23 * value.hashCode;
+ }
+ return hashCode;
+ }
+
+ @override
+ bool _equals(ConstructedConstantExpression other) {
+ if (type != other.type) return false;
+ if (target != other.target) return false;
+ if (callStructure != other.callStructure) return false;
+ for (int i = 0; i < arguments.length; i++) {
+ if (arguments[i] != other.arguments[i]) return false;
+ }
+ return true;
+ }
}
/// String literal with juxtaposition and/or interpolations.
-// TODO(johnniwinther): Do we need this?
class ConcatenateConstantExpression extends ConstantExpression {
final StringConstantValue value;
final List<ConstantExpression> arguments;
ConcatenateConstantExpression(this.value, this.arguments);
+ ConstantExpressionKind get kind => ConstantExpressionKind.CONCATENATE;
+
accept(ConstantExpressionVisitor visitor, [context]) {
return visitor.visitConcatenate(this, context);
}
+
+ @override
+ int _computeHashCode() {
+ int hashCode = 17 * arguments.length;
+ for (ConstantExpression value in arguments) {
+ hashCode ^= 19 * value.hashCode;
+ }
+ return hashCode;
+ }
+
+ @override
+ bool _equals(ConcatenateConstantExpression other) {
+ if (arguments.length != other.arguments.length) return false;
+ for (int i = 0; i < arguments.length; i++) {
+ if (arguments[i] != other.arguments[i]) return false;
+ }
+ return true;
+ }
}
/// Symbol literal.
@@ -138,9 +367,19 @@
SymbolConstantExpression(this.value, this.name);
+ ConstantExpressionKind get kind => ConstantExpressionKind.SYMBOL;
+
accept(ConstantExpressionVisitor visitor, [context]) {
return visitor.visitSymbol(this, context);
}
+
+ @override
+ int _computeHashCode() => 13 * name.hashCode;
+
+ @override
+ bool _equals(SymbolConstantExpression other) {
+ return name == other.name;
+ }
}
/// Type literal.
@@ -153,9 +392,19 @@
assert(type is GenericType || type is DynamicType);
}
+ ConstantExpressionKind get kind => ConstantExpressionKind.TYPE;
+
accept(ConstantExpressionVisitor visitor, [context]) {
return visitor.visitType(this, context);
}
+
+ @override
+ int _computeHashCode() => 13 * type.hashCode;
+
+ @override
+ bool _equals(TypeConstantExpression other) {
+ return type == other.type;
+ }
}
/// Reference to a constant local, top-level, or static variable.
@@ -165,9 +414,19 @@
VariableConstantExpression(this.value, this.element);
+ ConstantExpressionKind get kind => ConstantExpressionKind.VARIABLE;
+
accept(ConstantExpressionVisitor visitor, [context]) {
return visitor.visitVariable(this, context);
}
+
+ @override
+ int _computeHashCode() => 13 * element.hashCode;
+
+ @override
+ bool _equals(VariableConstantExpression other) {
+ return element == other.element;
+ }
}
/// Reference to a top-level or static function.
@@ -177,72 +436,140 @@
FunctionConstantExpression(this.value, this.element);
+ ConstantExpressionKind get kind => ConstantExpressionKind.FUNCTION;
+
accept(ConstantExpressionVisitor visitor, [context]) {
return visitor.visitFunction(this, context);
}
+
+ @override
+ int _computeHashCode() => 13 * element.hashCode;
+
+ @override
+ bool _equals(FunctionConstantExpression other) {
+ return element == other.element;
+ }
}
-/// A constant binary expression like `a * b` or `identical(a, b)`.
+/// A constant binary expression like `a * b`.
class BinaryConstantExpression extends ConstantExpression {
final ConstantValue value;
final ConstantExpression left;
- final String operator;
+ final BinaryOperator operator;
final ConstantExpression right;
BinaryConstantExpression(this.value, this.left, this.operator, this.right) {
- assert(PRECEDENCE_MAP[operator] != null);
+ assert(PRECEDENCE_MAP[operator.kind] != null);
}
+ ConstantExpressionKind get kind => ConstantExpressionKind.BINARY;
+
accept(ConstantExpressionVisitor visitor, [context]) {
return visitor.visitBinary(this, context);
}
- int get precedence => PRECEDENCE_MAP[operator];
+ int get precedence => PRECEDENCE_MAP[operator.kind];
- static const Map<String, int> PRECEDENCE_MAP = const {
- 'identical': 15,
- '==': 6,
- '!=': 6,
- '&&': 5,
- '||': 4,
- '^': 9,
- '&': 10,
- '|': 8,
- '>>': 11,
- '<<': 11,
- '+': 12,
- '-': 12,
- '*': 13,
- '/': 13,
- '~/': 13,
- '>': 7,
- '<': 7,
- '>=': 7,
- '<=': 7,
- '%': 13,
+ @override
+ int _computeHashCode() {
+ return 13 * operator.hashCode +
+ 17 * left.hashCode +
+ 19 * right.hashCode;
+ }
+
+ @override
+ bool _equals(BinaryConstantExpression other) {
+ return operator == other.operator &&
+ left == other.left &&
+ right == other.right;
+ }
+
+ static const Map<BinaryOperatorKind, int> PRECEDENCE_MAP = const {
+ BinaryOperatorKind.EQ: 6,
+ BinaryOperatorKind.NOT_EQ: 6,
+ BinaryOperatorKind.LOGICAL_AND: 5,
+ BinaryOperatorKind.LOGICAL_OR: 4,
+ BinaryOperatorKind.XOR: 9,
+ BinaryOperatorKind.AND: 10,
+ BinaryOperatorKind.OR: 8,
+ BinaryOperatorKind.SHR: 11,
+ BinaryOperatorKind.SHL: 11,
+ BinaryOperatorKind.ADD: 12,
+ BinaryOperatorKind.SUB: 12,
+ BinaryOperatorKind.MUL: 13,
+ BinaryOperatorKind.DIV: 13,
+ BinaryOperatorKind.IDIV: 13,
+ BinaryOperatorKind.GT: 7,
+ BinaryOperatorKind.LT: 7,
+ BinaryOperatorKind.GTEQ: 7,
+ BinaryOperatorKind.LTEQ: 7,
+ BinaryOperatorKind.MOD: 13,
};
}
+/// A constant identical invocation like `identical(a, b)`.
+class IdenticalConstantExpression extends ConstantExpression {
+ final ConstantValue value;
+ final ConstantExpression left;
+ final ConstantExpression right;
+
+ IdenticalConstantExpression(this.value, this.left, this.right);
+
+ ConstantExpressionKind get kind => ConstantExpressionKind.IDENTICAL;
+
+ accept(ConstantExpressionVisitor visitor, [context]) {
+ return visitor.visitIdentical(this, context);
+ }
+
+ int get precedence => 15;
+
+ @override
+ int _computeHashCode() {
+ return 17 * left.hashCode +
+ 19 * right.hashCode;
+ }
+
+ @override
+ bool _equals(IdenticalConstantExpression other) {
+ return left == other.left &&
+ right == other.right;
+ }
+}
+
/// A unary constant expression like `-a`.
class UnaryConstantExpression extends ConstantExpression {
final ConstantValue value;
- final String operator;
+ final UnaryOperator operator;
final ConstantExpression expression;
UnaryConstantExpression(this.value, this.operator, this.expression) {
- assert(PRECEDENCE_MAP[operator] != null);
+ assert(PRECEDENCE_MAP[operator.kind] != null);
}
+ ConstantExpressionKind get kind => ConstantExpressionKind.UNARY;
+
accept(ConstantExpressionVisitor visitor, [context]) {
return visitor.visitUnary(this, context);
}
- int get precedence => PRECEDENCE_MAP[operator];
+ int get precedence => PRECEDENCE_MAP[operator.kind];
- static const Map<String, int> PRECEDENCE_MAP = const {
- '!': 14,
- '~': 14,
- '-': 14,
+ @override
+ int _computeHashCode() {
+ return 13 * operator.hashCode +
+ 17 * expression.hashCode;
+ }
+
+ @override
+ bool _equals(UnaryConstantExpression other) {
+ return operator == other.operator &&
+ expression == other.expression;
+ }
+
+ static const Map<UnaryOperatorKind, int> PRECEDENCE_MAP = const {
+ UnaryOperatorKind.NOT: 14,
+ UnaryOperatorKind.COMPLEMENT: 14,
+ UnaryOperatorKind.NEGATE: 14,
};
}
@@ -258,11 +585,54 @@
this.trueExp,
this.falseExp);
+ ConstantExpressionKind get kind => ConstantExpressionKind.CONDITIONAL;
+
accept(ConstantExpressionVisitor visitor, [context]) {
return visitor.visitConditional(this, context);
}
int get precedence => 3;
+
+ @override
+ int _computeHashCode() {
+ return 13 * condition.hashCode +
+ 17 * trueExp.hashCode +
+ 19 * falseExp.hashCode;
+ }
+
+ @override
+ bool _equals(ConditionalConstantExpression other) {
+ return condition == other.condition &&
+ trueExp == other.trueExp &&
+ falseExp == other.falseExp;
+ }
+}
+
+/// A constant expression referenced with a deferred prefix.
+/// For example `lib.C`.
+class DeferredConstantExpression extends ConstantExpression {
+ final ConstantValue value;
+ final ConstantExpression expression;
+ final PrefixElement prefix;
+
+ DeferredConstantExpression(this.value, this.expression, this.prefix);
+
+ ConstantExpressionKind get kind => ConstantExpressionKind.DEFERRED;
+
+ @override
+ int _computeHashCode() {
+ return 13 * expression.hashCode;
+ }
+
+ @override
+ bool _equals(DeferredConstantExpression other) {
+ return expression == other.expression;
+ }
+
+ @override
+ accept(ConstantExpressionVisitor visitor, [context]) {
+ return visitor.visitDeferred(this, context);
+ }
}
abstract class ConstantExpressionVisitor<C, R> {
@@ -282,8 +652,10 @@
R visitVariable(VariableConstantExpression exp, C context);
R visitFunction(FunctionConstantExpression exp, C context);
R visitBinary(BinaryConstantExpression exp, C context);
+ R visitIdentical(IdenticalConstantExpression exp, C context);
R visitUnary(UnaryConstantExpression exp, C context);
R visitConditional(ConditionalConstantExpression exp, C context);
+ R visitDeferred(DeferredConstantExpression exp, C context);
}
/// Represents the declaration of a constant [element] with value [expression].
@@ -435,19 +807,20 @@
@override
void visitBinary(BinaryConstantExpression exp, [_]) {
- if (exp.operator == 'identical') {
- sb.write('identical(');
- visit(exp.left);
- sb.write(', ');
- visit(exp.right);
- sb.write(')');
- } else {
- write(exp, exp.left);
- sb.write(' ');
- sb.write(exp.operator);
- sb.write(' ');
- write(exp, exp.right);
- }
+ write(exp, exp.left);
+ sb.write(' ');
+ sb.write(exp.operator.name);
+ sb.write(' ');
+ write(exp, exp.right);
+ }
+
+ @override
+ void visitIdentical(IdenticalConstantExpression exp, [_]) {
+ sb.write('identical(');
+ visit(exp.left);
+ sb.write(', ');
+ visit(exp.right);
+ sb.write(')');
}
@override
@@ -465,5 +838,12 @@
write(exp, exp.falseExp);
}
+ @override
+ visitDeferred(DeferredConstantExpression exp, context) {
+ sb.write(exp.prefix.deferredImport.prefix.source);
+ sb.write('.');
+ write(exp, exp.expression);
+ }
+
String toString() => sb.toString();
}
\ No newline at end of file
diff --git a/pkg/compiler/lib/src/constants/values.dart b/pkg/compiler/lib/src/constants/values.dart
index cf6f2be..45f47ea 100644
--- a/pkg/compiler/lib/src/constants/values.dart
+++ b/pkg/compiler/lib/src/constants/values.dart
@@ -11,11 +11,12 @@
import '../elements/elements.dart'
show ClassElement,
Element,
+ FieldElement,
FunctionElement,
PrefixElement;
import '../tree/tree.dart' hide unparse;
import '../types/types.dart' as ti show TypeMask;
-import '../util/util.dart' show SMI_MASK;
+import '../util/util.dart' show Hashing;
abstract class ConstantValueVisitor<R, A> {
const ConstantValueVisitor();
@@ -234,7 +235,7 @@
return primitiveValue == otherInt.primitiveValue;
}
- int get hashCode => primitiveValue & SMI_MASK;
+ int get hashCode => primitiveValue & Hashing.SMI_MASK;
DartString toDartString() {
return new DartString.literal(primitiveValue.toString());
@@ -444,21 +445,11 @@
ListConstantValue(InterfaceType type, List<ConstantValue> entries)
: this.entries = entries,
- hashCode = _computeHash(type, entries),
+ hashCode = Hashing.listHash(entries, Hashing.objectHash(type)),
super(type);
bool get isList => true;
- static int _computeHash(DartType type, List<ConstantValue> entries) {
- // TODO(floitsch): create a better hash.
- int hash = 7;
- for (ConstantValue input in entries) {
- hash ^= input.hashCode;
- }
- hash ^= type.hashCode;
- return hash;
- }
-
bool operator ==(var other) {
if (other is !ListConstantValue) return false;
ListConstantValue otherList = other;
@@ -511,28 +502,15 @@
List<ConstantValue> values)
: this.keys = keys,
this.values = values,
- this.hashCode = computeHash(type, keys, values),
+ this.hashCode = Hashing.listHash(values,
+ Hashing.listHash(keys,
+ Hashing.objectHash(type))),
super(type) {
assert(keys.length == values.length);
}
bool get isMap => true;
- static int computeHash(DartType type,
- List<ConstantValue> keys,
- List<ConstantValue> values) {
- // TODO(floitsch): create a better hash.
- int hash = 0;
- for (ConstantValue key in keys) {
- hash ^= key.hashCode;
- }
- for (ConstantValue value in values) {
- hash ^= value.hashCode;
- }
- hash ^= type.hashCode;
- return hash;
- }
-
bool operator ==(var other) {
if (other is !MapConstantValue) return false;
MapConstantValue otherMap = other;
@@ -645,64 +623,44 @@
}
class ConstructedConstantValue extends ObjectConstantValue {
- final List<ConstantValue> fields;
+ final Map<FieldElement, ConstantValue> fields;
final int hashCode;
- ConstructedConstantValue(InterfaceType type, List<ConstantValue> fields)
+ ConstructedConstantValue(InterfaceType type,
+ Map<FieldElement, ConstantValue> fields)
: this.fields = fields,
- hashCode = computeHash(type, fields),
+ hashCode = Hashing.mapHash(fields, Hashing.objectHash(type)),
super(type) {
assert(type != null);
}
bool get isConstructedObject => true;
- static int computeHash(DartType type, List<ConstantValue> fields) {
- // TODO(floitsch): create a better hash.
- int hash = 0;
- for (ConstantValue field in fields) {
- hash ^= field.hashCode;
- }
- hash ^= type.hashCode;
- return hash;
- }
-
bool operator ==(var otherVar) {
if (otherVar is !ConstructedConstantValue) return false;
ConstructedConstantValue other = otherVar;
if (hashCode != other.hashCode) return false;
if (type != other.type) return false;
if (fields.length != other.fields.length) return false;
- for (int i = 0; i < fields.length; i++) {
- if (fields[i] != other.fields[i]) return false;
+ for (FieldElement field in fields.keys) {
+ if (fields[field] != other.fields[field]) return false;
}
return true;
}
- List<ConstantValue> getDependencies() => fields;
+ List<ConstantValue> getDependencies() => fields.values.toList();
accept(ConstantValueVisitor visitor, arg) {
return visitor.visitConstructed(this, arg);
}
- Map<Element, ConstantValue> get fieldElements {
- // TODO(ahe): Refactor constant system to store this information directly.
- ClassElement classElement = type.element;
- int count = 0;
- Map<Element, ConstantValue> result = new Map<Element, ConstantValue>();
- classElement.implementation.forEachInstanceField((holder, field) {
- result[field] = fields[count++];
- }, includeSuperAndInjectedMembers: true);
- return result;
- }
-
String unparse() {
StringBuffer sb = new StringBuffer();
sb.write(type.name);
_unparseTypeArguments(sb);
sb.write('(');
int i = 0;
- fieldElements.forEach((Element field, ConstantValue value) {
+ fields.forEach((FieldElement field, ConstantValue value) {
if (i > 0) sb.write(',');
sb.write(field.name);
sb.write('=');
@@ -719,7 +677,7 @@
sb.write(type);
sb.write('(');
int i = 0;
- fieldElements.forEach((Element field, ConstantValue value) {
+ fields.forEach((FieldElement field, ConstantValue value) {
if (i > 0) sb.write(',');
sb.write(field.name);
sb.write('=');
diff --git a/pkg/compiler/lib/src/cps_ir/cps_ir_builder.dart b/pkg/compiler/lib/src/cps_ir/cps_ir_builder.dart
index 5f35a3f..d511047 100644
--- a/pkg/compiler/lib/src/cps_ir/cps_ir_builder.dart
+++ b/pkg/compiler/lib/src/cps_ir/cps_ir_builder.dart
@@ -4,6 +4,7 @@
library dart2js.ir_builder;
+import '../constants/constant_system.dart';
import '../constants/expressions.dart';
import '../constants/values.dart' show PrimitiveConstantValue;
import '../dart_types.dart';
@@ -12,6 +13,7 @@
import '../io/source_information.dart';
import '../tree/tree.dart' as ast;
import '../closure.dart' hide ClosureScope;
+import '../universe/universe.dart' show SelectorKind;
import 'cps_ir_nodes.dart' as ir;
import 'cps_ir_builder_task.dart' show DartCapturedVariables,
GlobalProgramInformation;
@@ -161,7 +163,7 @@
for (Iterable<LocalVariableElement> boxedOnEntry in _boxedTryVariables) {
for (LocalVariableElement variable in boxedOnEntry) {
assert(builder.isInMutableVariable(variable));
- ir.Primitive value = builder.buildLocalGet(variable);
+ ir.Primitive value = builder.buildLocalVariableGet(variable);
builder.environment.update(variable, value);
}
}
@@ -374,7 +376,7 @@
}
/// Shared state between delimited IrBuilders within the same function.
-class IrBuilderDelimitedState {
+class IrBuilderSharedState {
final ConstantSystem constantSystem;
/// A stack of collectors for breaks.
@@ -393,7 +395,7 @@
final List<ir.Definition> functionParameters = <ir.Definition>[];
- IrBuilderDelimitedState(this.constantSystem, this.currentElement);
+ IrBuilderSharedState(this.constantSystem, this.currentElement);
ir.Parameter get thisParameter => _thisParameter;
void set thisParameter(ir.Parameter value) {
@@ -416,20 +418,6 @@
abstract class IrBuilder {
IrBuilder _makeInstance();
- /// True if [local] should currently be accessed from a [ir.MutableVariable].
- bool isInMutableVariable(Local local);
-
- /// Creates a [ir.MutableVariable] for the given local.
- void makeMutableVariable(Local local);
-
- /// Remove an [ir.MutableVariable] for a local.
- ///
- /// Subsequent access to the local will be direct rather than through the
- /// mutable variable. This is used for variables that do not spend their
- /// entire lifetime as mutable variables (e.g., variables that are boxed
- /// in mutable variables for a try block).
- void removeMutableVariable(Local local);
-
void declareLocalVariable(LocalVariableElement element,
{ir.Primitive initialValue});
@@ -480,7 +468,7 @@
final List<ir.Parameter> _parameters = <ir.Parameter>[];
- IrBuilderDelimitedState state;
+ IrBuilderSharedState state;
/// A map from variable indexes to their values.
///
@@ -488,6 +476,36 @@
/// in the map; look up their [BoxLocal] instead.
Environment environment;
+ /// A map from mutable local variables to their [ir.MutableVariable]s.
+ ///
+ /// Mutable variables are treated as boxed. Writes to them are observable
+ /// side effects.
+ Map<Local, ir.MutableVariable> mutableVariables;
+
+ /// True if [local] should currently be accessed from a [ir.MutableVariable].
+ bool isInMutableVariable(Local local) {
+ return mutableVariables.containsKey(local);
+ }
+
+ /// Creates a [ir.MutableVariable] for the given local.
+ void makeMutableVariable(Local local) {
+ mutableVariables[local] =
+ new ir.MutableVariable(local.executableContext, local);
+ }
+
+ /// Remove an [ir.MutableVariable] for a local.
+ ///
+ /// Subsequent access to the local will be direct rather than through the
+ /// mutable variable.
+ void removeMutableVariable(Local local) {
+ mutableVariables.remove(local);
+ }
+
+ /// Gets the [MutableVariable] containing the value of [local].
+ ir.MutableVariable getMutableVariable(Local local) {
+ return mutableVariables[local];
+ }
+
// The IR builder maintains a context, which is an expression with a hole in
// it. The hole represents the focus where new expressions can be added.
// The context is implemented by 'root' which is the root of the expression
@@ -517,8 +535,9 @@
/// Initialize a new top-level IR builder.
void _init(ConstantSystem constantSystem, ExecutableElement currentElement) {
- state = new IrBuilderDelimitedState(constantSystem, currentElement);
+ state = new IrBuilderSharedState(constantSystem, currentElement);
environment = new Environment.empty();
+ mutableVariables = <Local, ir.MutableVariable>{};
}
/// Construct a delimited visitor for visiting a subtree.
@@ -533,25 +552,29 @@
IrBuilder makeDelimitedBuilder([Environment env = null]) {
return _makeInstance()
..state = state
- ..environment = env != null ? env : new Environment.from(environment);
+ ..environment = env != null ? env : new Environment.from(environment)
+ ..mutableVariables = mutableVariables;
}
/// Construct a builder for making constructor field initializers.
IrBuilder makeInitializerBuilder() {
return _makeInstance()
- ..state = new IrBuilderDelimitedState(state.constantSystem,
- state.currentElement)
- ..environment = new Environment.from(environment);
+ ..state = new IrBuilderSharedState(state.constantSystem,
+ state.currentElement)
+ ..environment = new Environment.from(environment)
+ ..mutableVariables = mutableVariables;
}
/// Construct a builder for an inner function.
IrBuilder makeInnerFunctionBuilder(ExecutableElement currentElement) {
- IrBuilderDelimitedState innerState =
- new IrBuilderDelimitedState(state.constantSystem, currentElement)
+ IrBuilderSharedState innerState =
+ new IrBuilderSharedState(state.constantSystem, currentElement)
..enclosingMethodThisParameter = state.enclosingMethodThisParameter;
return _makeInstance()
..state = innerState
- ..environment = new Environment.empty();
+ ..environment = new Environment.empty()
+ ..mutableVariables =
+ new Map<Local, ir.MutableVariable>.from(mutableVariables);
}
bool get isOpen => _root == null || _current != null;
@@ -622,7 +645,7 @@
assert(!element.isInstanceMember);
assert(isOpen);
return _continueWithExpression(
- (k) => new ir.InvokeStatic(element, selector, k, arguments,
+ (k) => new ir.InvokeStatic(element, selector, arguments, k,
sourceInformation));
}
@@ -633,60 +656,74 @@
assert(isOpen);
return _continueWithExpression(
(k) => new ir.InvokeMethodDirectly(
- buildThis(), target, selector, k, arguments));
+ buildThis(), target, selector, arguments, k));
}
ir.Primitive _buildInvokeDynamic(ir.Primitive receiver,
Selector selector,
- List<ir.Primitive> arguments) {
+ List<ir.Primitive> arguments,
+ {SourceInformation sourceInformation}) {
assert(isOpen);
return _continueWithExpression(
- (k) => new ir.InvokeMethod(receiver, selector, k, arguments));
+ (k) => new ir.InvokeMethod(receiver, selector, arguments, k,
+ sourceInformation: sourceInformation));
}
ir.Primitive _buildInvokeCall(ir.Primitive target,
- Selector selector,
- List<ir.Definition> arguments) {
- Selector callSelector = new Selector.callClosureFrom(selector);
- return _buildInvokeDynamic(target, callSelector, arguments);
+ CallStructure callStructure,
+ List<ir.Definition> arguments,
+ {SourceInformation sourceInformation}) {
+ Selector selector = callStructure.callSelector;
+ return _buildInvokeDynamic(target, selector, arguments,
+ sourceInformation: sourceInformation);
}
- /// Create a constant literal from [constant].
- ir.Constant buildConstantLiteral(ConstantExpression constant) {
+ /// Create a [ir.Constant] from [constant] and add it to the CPS term.
+ ir.Constant buildConstant(ConstantExpression constant) {
assert(isOpen);
return addPrimitive(new ir.Constant(constant));
}
- // Helper for building primitive literals.
- ir.Constant _buildPrimitiveConstant(PrimitiveConstantValue constant) {
- return buildConstantLiteral(new PrimitiveConstantExpression(constant));
+ /// Create an integer constant and add it to the CPS term.
+ ir.Constant buildIntegerConstant(int value) {
+ return buildConstant(new IntConstantExpression(
+ value,
+ state.constantSystem.createInt(value)));
}
- /// Create an integer literal.
- ir.Constant buildIntegerLiteral(int value) {
- return _buildPrimitiveConstant(state.constantSystem.createInt(value));
+ /// Create a double constant and add it to the CPS term.
+ ir.Constant buildDoubleConstant(double value) {
+ return buildConstant(new DoubleConstantExpression(
+ value,
+ state.constantSystem.createDouble(value)));
}
- /// Create an double literal.
- ir.Constant buildDoubleLiteral(double value) {
- return _buildPrimitiveConstant(state.constantSystem.createDouble(value));
+ /// Create a Boolean constant and add it to the CPS term.
+ ir.Constant buildBooleanConstant(bool value) {
+ return buildConstant(new BoolConstantExpression(
+ value,
+ state.constantSystem.createBool(value)));
}
- /// Create an bool literal.
- ir.Constant buildBooleanLiteral(bool value) {
- return _buildPrimitiveConstant(state.constantSystem.createBool(value));
+ /// Create a null constant and add it to the CPS term.
+ ir.Constant buildNullConstant() {
+ return buildConstant(new NullConstantExpression(
+ state.constantSystem.createNull()));
}
- /// Create an null literal.
- ir.Constant buildNullLiteral() {
- return _buildPrimitiveConstant(state.constantSystem.createNull());
+ /// Create a string constant and add it to the CPS term.
+ ir.Constant buildStringConstant(String value) {
+ return buildConstant(new StringConstantExpression(
+ value,
+ state.constantSystem.createString(new ast.DartString.literal(value))));
}
- /// Create a string literal.
- ir.Constant buildStringLiteral(String value) {
- return _buildPrimitiveConstant(
- state.constantSystem.createString(new ast.DartString.literal(value)));
+ /// Create a string constant and add it to the CPS term.
+ ir.Constant buildDartStringConstant(ast.DartString value) {
+ return buildConstant(new StringConstantExpression(
+ value.slowToString(),
+ state.constantSystem.createString(value)));
}
/// Creates a non-constant list literal of the provided [type] and with the
@@ -781,7 +818,7 @@
*/
void _ensureReturn() {
if (!isOpen) return;
- ir.Constant constant = buildNullLiteral();
+ ir.Constant constant = buildNullConstant();
add(new ir.InvokeContinuation(state.returnContinuation, [constant]));
_current = null;
}
@@ -863,33 +900,84 @@
state.localConstants, defaults);
}
- /// Create a super invocation where the method name and the argument structure
- /// are defined by [selector] and the argument values are defined by
- /// [arguments].
- ir.Primitive buildSuperInvocation(Element target,
- Selector selector,
- List<ir.Primitive> arguments);
-
- /// Create a getter invocation of the [target] on the super class.
- ir.Primitive buildSuperGet(Element target) {
- Selector selector = new Selector.getter(target.name, target.library);
- return buildSuperInvocation(target, selector, const <ir.Primitive>[]);
+ /// Create a invocation of the [method] on the super class where the call
+ /// structure is defined [callStructure] and the argument values are defined
+ /// by [arguments].
+ ir.Primitive buildSuperMethodInvocation(MethodElement method,
+ CallStructure callStructure,
+ List<ir.Primitive> arguments) {
+ // TODO(johnniwinther): This shouldn't be necessary.
+ SelectorKind kind = Elements.isOperatorName(method.name)
+ ? SelectorKind.OPERATOR : SelectorKind.CALL;
+ Selector selector =
+ new Selector(kind, method.memberName, callStructure);
+ return _buildInvokeSuper(method, selector, arguments);
}
- /// Create a setter invocation of the [target] on the super class of with
- /// [value].
- ir.Primitive buildSuperSet(Element target, ir.Primitive value) {
- Selector selector = new Selector.setter(target.name, target.library);
- buildSuperInvocation(target, selector, [value]);
+ /// Create a read access of the [field] on the super class.
+ ir.Primitive buildSuperFieldGet(FieldElement field) {
+ // TODO(johnniwinther): This should have its own ir node.
+ return _buildInvokeSuper(
+ field,
+ new Selector.getter(field.name, field.library),
+ const <ir.Primitive>[]);
+ }
+
+ /// Create a read access of the [method] on the super class, i.e. a
+ /// closurization of [method].
+ ir.Primitive buildSuperMethodGet(MethodElement method) {
+ // TODO(johnniwinther): This should have its own ir node.
+ return _buildInvokeSuper(
+ method,
+ new Selector.getter(method.name, method.library),
+ const <ir.Primitive>[]);
+ }
+
+ /// Create a getter invocation of the [getter] on the super class.
+ ir.Primitive buildSuperGetterGet(MethodElement getter) {
+ // TODO(johnniwinther): This should have its own ir node.
+ return _buildInvokeSuper(
+ getter,
+ new Selector.getter(getter.name, getter.library),
+ const <ir.Primitive>[]);
+ }
+
+ /// Create a write access to the [field] on the super class of with [value].
+ ir.Primitive buildSuperFieldSet(Element field, ir.Primitive value) {
+ // TODO(johnniwinther): This should have its own ir node.
+ _buildInvokeSuper(
+ field,
+ new Selector.setter(field.name, field.library),
+ <ir.Primitive>[value]);
return value;
}
- /// Create an index set invocation on the super class with the provided
- /// [index] and [value].
- ir.Primitive buildSuperIndexSet(Element target,
+ /// Create an setter invocation of the [setter] on the super class with
+ /// [value].
+ ir.Primitive buildSuperSetterSet(MethodElement setter,
+ ir.Primitive value) {
+ // TODO(johnniwinther): This should have its own ir node.
+ _buildInvokeSuper(
+ setter,
+ new Selector.setter(setter.name, setter.library),
+ <ir.Primitive>[value]);
+ return value;
+ }
+
+ /// Create an invocation of the index [method] on the super class with
+ /// the provided [index].
+ ir.Primitive buildSuperIndex(MethodElement method,
+ ir.Primitive index) {
+ return _buildInvokeSuper(
+ method, new Selector.index(), <ir.Primitive>[index]);
+ }
+
+ /// Create an invocation of the index set [method] on the super class with
+ /// the provided [index] and [value].
+ ir.Primitive buildSuperIndexSet(MethodElement method,
ir.Primitive index,
ir.Primitive value) {
- _buildInvokeSuper(target, new Selector.indexSet(),
+ _buildInvokeSuper(method, new Selector.indexSet(),
<ir.Primitive>[index, value]);
return value;
}
@@ -930,56 +1018,128 @@
return value;
}
- /// Create a read access of [local].
- ir.Primitive buildLocalGet(LocalElement element);
+ ir.Primitive _buildLocalGet(LocalElement element);
- /// Create a write access to [local] with the provided [value].
- ir.Primitive buildLocalSet(LocalElement element, ir.Primitive value);
-
- /// Create an invocation of the local [element] where argument structure is
- /// defined by [selector] and the argument values are defined by [arguments].
- ir.Primitive buildLocalInvocation(LocalElement element,
- Selector selector,
- List<ir.Primitive> arguments) {
- return buildCallInvocation(buildLocalGet(element), selector, arguments);
+ /// Create a read access of the [local] variable or parameter.
+ ir.Primitive buildLocalVariableGet(LocalElement local) {
+ // TODO(johnniwinther): Separate function access from variable access.
+ return _buildLocalGet(local);
}
- /// Create a static invocation of [element] where argument structure is
- /// defined by [selector] and the argument values are defined by [arguments].
- ir.Primitive buildStaticInvocation(Element element,
- Selector selector,
- List<ir.Primitive> arguments,
- {SourceInformation sourceInformation}) {
- return _buildInvokeStatic(element, selector, arguments, sourceInformation);
+ /// Create a read access of the local [function], i.e. closurization of
+ /// [function].
+ ir.Primitive buildLocalFunctionGet(LocalFunctionElement function) {
+ // TODO(johnniwinther): Separate function access from variable access.
+ return _buildLocalGet(function);
}
- /// Create a static getter invocation of [element] where the getter name is
- /// defined by [selector].
- ir.Primitive buildStaticGet(Element element,
- {SourceInformation sourceInformation}) {
- Selector selector = new Selector.getter(element.name, element.library);
+ /// Create a write access to the [local] variable or parameter with the
+ /// provided [value].
+ ir.Primitive buildLocalVariableSet(LocalElement local, ir.Primitive value);
+
+ /// Create an invocation of the the [local] variable or parameter where
+ /// argument structure is defined by [callStructure] and the argument values
+ /// are defined by [arguments].
+ ir.Primitive buildLocalVariableInvocation(LocalVariableElement local,
+ CallStructure callStructure,
+ List<ir.Primitive> arguments) {
+ return buildCallInvocation(
+ buildLocalVariableGet(local), callStructure, arguments);
+ }
+
+ /// Create an invocation of the local [function] where argument structure is
+ /// defined by [callStructure] and the argument values are defined by
+ /// [arguments].
+ ir.Primitive buildLocalFunctionInvocation(
+ LocalFunctionElement function,
+ CallStructure callStructure,
+ List<ir.Primitive> arguments) {
+ // TODO(johnniwinther): Maybe this should have its own ir node.
+ return buildCallInvocation(
+ buildLocalFunctionGet(function), callStructure, arguments);
+ }
+
+ /// Create a static invocation of [function] where argument structure is
+ /// defined by [callStructure] and the argument values are defined by
+ /// [arguments].
+ ir.Primitive buildStaticFunctionInvocation(
+ MethodElement function,
+ CallStructure callStructure,
+ List<ir.Primitive> arguments,
+ {SourceInformation sourceInformation}) {
+ Selector selector =
+ new Selector(SelectorKind.CALL, function.memberName, callStructure);
+ return _buildInvokeStatic(
+ function, selector, arguments, sourceInformation);
+ }
+
+ /// Create a read access of the static [field].
+ ir.Primitive buildStaticFieldGet(FieldElement field,
+ {SourceInformation sourceInformation}) {
+ Selector selector = new Selector.getter(field.name, field.library);
// TODO(karlklose,sigurdm): build different nodes for getters.
return _buildInvokeStatic(
- element, selector, const <ir.Primitive>[], sourceInformation);
+ field, selector, const <ir.Primitive>[], sourceInformation);
}
- /// Create a static setter invocation of [element] where the setter name and
- /// argument are defined by [selector] and [value], respectively.
- ir.Primitive buildStaticSet(Element element,
- ir.Primitive value,
- {SourceInformation sourceInformation}) {
- Selector selector = new Selector.setter(element.name, element.library);
+ /// Create a getter invocation of the static [getter].
+ ir.Primitive buildStaticGetterGet(MethodElement getter,
+ {SourceInformation sourceInformation}) {
+ Selector selector = new Selector.getter(getter.name, getter.library);
+ // TODO(karlklose,sigurdm): build different nodes for getters.
+ return _buildInvokeStatic(
+ getter, selector, const <ir.Primitive>[], sourceInformation);
+ }
+
+ /// Create a read access of the static [function], i.e. a closurization of
+ /// [function].
+ ir.Primitive buildStaticFunctionGet(MethodElement function,
+ {SourceInformation sourceInformation}) {
+ Selector selector =
+ new Selector.getter(function.name, function.library);
+ // TODO(karlklose,sigurdm): build different nodes for getters.
+ return _buildInvokeStatic(
+ function, selector, const <ir.Primitive>[], sourceInformation);
+ }
+
+ /// Create a write access to the static [field] with the [value].
+ ir.Primitive buildStaticFieldSet(FieldElement field,
+ ir.Primitive value,
+ {SourceInformation sourceInformation}) {
+ Selector selector = new Selector.setter(field.name, field.library);
// TODO(karlklose,sigurdm): build different nodes for setters.
_buildInvokeStatic(
- element, selector, <ir.Primitive>[value], sourceInformation);
+ field, selector, <ir.Primitive>[value], sourceInformation);
return value;
}
+ /// Create a setter invocation of the static [setter] with the [value].
+ ir.Primitive buildStaticSetterSet(MethodElement setter,
+ ir.Primitive value,
+ {SourceInformation sourceInformation}) {
+ Selector selector = new Selector.setter(setter.name, setter.library);
+ // TODO(karlklose,sigurdm): build different nodes for setters.
+ _buildInvokeStatic(
+ setter, selector, <ir.Primitive>[value], sourceInformation);
+ return value;
+ }
+
+ /// Create an erroneous invocation where argument structure is defined by
+ /// [selector] and the argument values are defined by [arguments].
+ // TODO(johnniwinther): Make this more fine-grained.
+ ir.Primitive buildErroneousInvocation(
+ Element element,
+ Selector selector,
+ List<ir.Primitive> arguments) {
+ // TODO(johnniwinther): This should have its own ir node.
+ return _buildInvokeStatic(element, selector, arguments, null);
+ }
+
/// Create a constructor invocation of [element] on [type] where the
- /// constructor name and argument structure are defined by [selector] and the
- /// argument values are defined by [arguments].
+ /// constructor name and argument structure are defined by [callStructure] and
+ /// the argument values are defined by [arguments].
ir.Primitive buildConstructorInvocation(FunctionElement element,
- Selector selector,
+ CallStructure callStructure,
DartType type,
List<ir.Primitive> arguments);
@@ -987,16 +1147,18 @@
ir.Primitive buildStringConcatenation(List<ir.Primitive> arguments) {
assert(isOpen);
return _continueWithExpression(
- (k) => new ir.ConcatenateStrings(k, arguments));
+ (k) => new ir.ConcatenateStrings(arguments, k));
}
/// Create an invocation of the `call` method of [functionExpression], where
- /// the named arguments are given by [selector].
+ /// the structure of arguments are given by [callStructure].
ir.Primitive buildCallInvocation(
ir.Primitive functionExpression,
- Selector selector,
- List<ir.Definition> arguments) {
- return _buildInvokeCall(functionExpression, selector, arguments);
+ CallStructure callStructure,
+ List<ir.Definition> arguments,
+ {SourceInformation sourceInformation}) {
+ return _buildInvokeCall(functionExpression, callStructure, arguments,
+ sourceInformation: sourceInformation);
}
/// Creates an if-then-else statement with the provided [condition] where the
@@ -1146,7 +1308,7 @@
ir.Primitive condition = buildCondition(this);
if (condition == null) {
// If the condition is empty then the body is entered unconditionally.
- condition = buildBooleanLiteral(true);
+ condition = buildBooleanConstant(true);
}
JumpCollector breakCollector =
new ForwardJumpCollector(environment, target: target);
@@ -1273,8 +1435,8 @@
add(new ir.LetCont(iteratorInvoked,
new ir.InvokeMethod(expressionReceiver,
new Selector.getter("iterator", null),
- iteratorInvoked,
- emptyArguments)));
+ emptyArguments,
+ iteratorInvoked)));
// Fill with:
// let cont loop(x, ...) =
@@ -1289,8 +1451,8 @@
add(new ir.LetCont(moveNextInvoked,
new ir.InvokeMethod(iterator,
new Selector.call("moveNext", null, 0),
- moveNextInvoked,
- emptyArguments)));
+ emptyArguments,
+ moveNextInvoked)));
// As a delimited term, build:
// <<BODY>> =
@@ -1309,14 +1471,22 @@
ir.Continuation currentInvoked = new ir.Continuation([currentValue]);
bodyBuilder.add(new ir.LetCont(currentInvoked,
new ir.InvokeMethod(iterator, new Selector.getter("current", null),
- currentInvoked, emptyArguments)));
+ emptyArguments, currentInvoked)));
// TODO(sra): Does this cover all cases? The general setter case include
// super.
+ // TODO(johnniwinther): Extract this as a provided strategy.
if (Elements.isLocal(variableElement)) {
- bodyBuilder.buildLocalSet(variableElement, currentValue);
- } else if (Elements.isStaticOrTopLevel(variableElement) ||
- Elements.isErroneous(variableElement)) {
- bodyBuilder.buildStaticSet(variableElement, currentValue);
+ bodyBuilder.buildLocalVariableSet(variableElement, currentValue);
+ } else if (Elements.isErroneous(variableElement)) {
+ bodyBuilder.buildErroneousInvocation(variableElement,
+ new Selector.setter(variableElement.name, variableElement.library),
+ <ir.Primitive>[currentValue]);
+ } else if (Elements.isStaticOrTopLevel(variableElement)) {
+ if (variableElement.isField) {
+ bodyBuilder.buildStaticFieldSet(variableElement, currentValue);
+ } else {
+ bodyBuilder.buildStaticSetterSet(variableElement, currentValue);
+ }
} else {
ir.Primitive receiver = bodyBuilder.buildThis();
assert(receiver != null);
@@ -1576,15 +1746,13 @@
JumpCollector join = new ForwardJumpCollector(environment);
IrBuilder tryCatchBuilder = makeDelimitedBuilder();
- // Variables that are boxed due to being captured in a closure are boxed
- // for their entire lifetime, and so they do not need to be boxed on
- // entry to any try block. They are not filtered out before this because
- // we can not identify all of them in the same pass where we identify the
- // variables assigned in the try (they may be captured by a closure after
- // the try statement).
+ // Variables treated as mutable in a try are not mutable outside of it.
+ // Work with a copy of the outer builder's mutable variables.
+ tryCatchBuilder.mutableVariables =
+ new Map<Local, ir.MutableVariable>.from(mutableVariables);
for (LocalVariableElement variable in tryStatementInfo.boxedOnEntry) {
assert(!tryCatchBuilder.isInMutableVariable(variable));
- ir.Primitive value = tryCatchBuilder.buildLocalGet(variable);
+ ir.Primitive value = tryCatchBuilder.buildLocalVariableGet(variable);
tryCatchBuilder.makeMutableVariable(variable);
tryCatchBuilder.declareLocalVariable(variable, initialValue: value);
}
@@ -1611,11 +1779,9 @@
IrBuilder catchBuilder = tryCatchBuilder.makeDelimitedBuilder();
for (LocalVariableElement variable in tryStatementInfo.boxedOnEntry) {
assert(catchBuilder.isInMutableVariable(variable));
- ir.Primitive value = catchBuilder.buildLocalGet(variable);
- // Note that we remove the variable from the set of mutable variables
- // here (and not above for the try body). This is because the set of
- // mutable variables is global for the whole function and not local to
- // a delimited builder.
+ ir.Primitive value = catchBuilder.buildLocalVariableGet(variable);
+ // After this point, the variables that were boxed on entry to the try
+ // are no longer treated as mutable.
catchBuilder.removeMutableVariable(variable);
catchBuilder.environment.update(variable, value);
}
@@ -1626,13 +1792,15 @@
LocalVariableElement exceptionVariable =
catchClauseInfo.exceptionVariable;
ir.Parameter exceptionParameter = new ir.Parameter(exceptionVariable);
- catchBuilder.environment.extend(exceptionVariable, exceptionParameter);
+ catchBuilder.declareLocalVariable(exceptionVariable,
+ initialValue: exceptionParameter);
ir.Parameter traceParameter;
LocalVariableElement stackTraceVariable =
catchClauseInfo.stackTraceVariable;
if (stackTraceVariable != null) {
traceParameter = new ir.Parameter(stackTraceVariable);
- catchBuilder.environment.extend(stackTraceVariable, traceParameter);
+ catchBuilder.declareLocalVariable(stackTraceVariable,
+ initialValue: traceParameter);
} else {
// Use a dummy continuation parameter for the stack trace parameter.
// This will ensure that all handlers have two parameters and so they
@@ -1664,7 +1832,7 @@
// Return without a subexpression is translated as if it were return null.
assert(isOpen);
if (value == null) {
- value = buildNullLiteral();
+ value = buildNullConstant();
}
add(new ir.InvokeContinuation(state.returnContinuation, [value]));
_current = null;
@@ -1743,6 +1911,23 @@
return false;
}
+ void buildThrow(ir.Primitive value) {
+ assert(isOpen);
+ add(new ir.Throw(value));
+ _current = null;
+ }
+
+ ir.Primitive buildNonTailThrow(ir.Primitive value) {
+ assert(isOpen);
+ return addPrimitive(new ir.NonTailThrow(value));
+ }
+
+ void buildRethrow() {
+ assert(isOpen);
+ add(new ir.Rethrow());
+ _current = null;
+ }
+
/// Create a negation of [condition].
ir.Primitive buildNegation(ir.Primitive condition) {
// ! e is translated as e ? false : true
@@ -1755,7 +1940,8 @@
ir.Continuation elseContinuation = new ir.Continuation([]);
ir.Constant makeBoolConstant(bool value) {
- return new ir.Constant(new PrimitiveConstantExpression(
+ return new ir.Constant(new BoolConstantExpression(
+ value,
state.constantSystem.createBool(value)));
}
@@ -1790,7 +1976,6 @@
ir.Primitive check = _continueWithExpression(
(k) => new ir.TypeOperator(receiver, type, k, isTypeTest: isTypeTest));
return isNotCheck ? buildNegation(check) : check;
-
}
/// Create a lazy and/or expression. [leftValue] is the value of the left
@@ -1819,11 +2004,11 @@
// If we don't evaluate the right subexpression, the value of the whole
// expression is this constant.
- ir.Constant leftBool = emptyBuilder.buildBooleanLiteral(isLazyOr);
+ ir.Constant leftBool = emptyBuilder.buildBooleanConstant(isLazyOr);
// If we do evaluate the right subexpression, the value of the expression
// is a true or false constant.
- ir.Constant rightTrue = rightTrueBuilder.buildBooleanLiteral(true);
- ir.Constant rightFalse = rightFalseBuilder.buildBooleanLiteral(false);
+ ir.Constant rightTrue = rightTrueBuilder.buildBooleanConstant(true);
+ ir.Constant rightFalse = rightFalseBuilder.buildBooleanConstant(false);
// Treat the result values as named values in the environment, so they
// will be treated as arguments to the join-point continuation.
@@ -1883,23 +2068,8 @@
/// Shared state between DartIrBuilders within the same method.
class DartIrBuilderSharedState {
- /// Maps local variables to their corresponding [MutableVariable] object.
- final Map<Local, ir.MutableVariable> local2mutable =
- <Local, ir.MutableVariable>{};
-
- /// Creates a [MutableVariable] for the given local.
- void makeMutableVariable(Local local) {
- ir.MutableVariable variable =
- new ir.MutableVariable(local.executableContext, local);
- local2mutable[local] = variable;
- }
-
/// [MutableVariable]s that should temporarily be treated as registers.
final Set<Local> registerizedMutableVariables = new Set<Local>();
-
- DartIrBuilderSharedState(Set<Local> capturedVariables) {
- capturedVariables.forEach(makeMutableVariable);
- }
}
/// Dart-specific subclass of [IrBuilder].
@@ -1918,28 +2088,17 @@
DartIrBuilder(ConstantSystem constantSystem,
ExecutableElement currentElement,
Set<Local> capturedVariables)
- : dartState = new DartIrBuilderSharedState(capturedVariables) {
+ : dartState = new DartIrBuilderSharedState() {
_init(constantSystem, currentElement);
+ capturedVariables.forEach(makeMutableVariable);
}
+ @override
bool isInMutableVariable(Local local) {
- return dartState.local2mutable.containsKey(local) &&
+ return mutableVariables.containsKey(local) &&
!dartState.registerizedMutableVariables.contains(local);
}
- void makeMutableVariable(Local local) {
- dartState.makeMutableVariable(local);
- }
-
- void removeMutableVariable(Local local) {
- dartState.local2mutable.remove(local);
- }
-
- /// Gets the [MutableVariable] containing the value of [local].
- ir.MutableVariable getMutableVariable(Local local) {
- return dartState.local2mutable[local];
- }
-
void _enterScope(ClosureScope scope) {
assert(scope == null);
}
@@ -1952,7 +2111,7 @@
List<LocalElement> loopVariables) {
assert(scope == null);
for (LocalElement loopVariable in loopVariables) {
- if (dartState.local2mutable.containsKey(loopVariable)) {
+ if (mutableVariables.containsKey(loopVariable)) {
// Temporarily keep the loop variable in a primitive.
// The loop variable will be added to environment when
// [declareLocalVariable] is called.
@@ -1965,7 +2124,7 @@
List<LocalElement> loopVariables) {
assert(scope == null);
for (LocalElement loopVariable in loopVariables) {
- if (dartState.local2mutable.containsKey(loopVariable)) {
+ if (mutableVariables.containsKey(loopVariable)) {
// Move from [Primitive] into [MutableVariable].
dartState.registerizedMutableVariables.remove(loopVariable);
add(new ir.LetMutable(getMutableVariable(loopVariable),
@@ -2027,7 +2186,7 @@
{ir.Primitive initialValue}) {
assert(isOpen);
if (initialValue == null) {
- initialValue = buildNullLiteral();
+ initialValue = buildNullConstant();
}
if (isInMutableVariable(variableElement)) {
add(new ir.LetMutable(getMutableVariable(variableElement),
@@ -2058,7 +2217,8 @@
}
/// Create a read access of [local].
- ir.Primitive buildLocalGet(LocalElement local) {
+ @override
+ ir.Primitive _buildLocalGet(LocalElement local) {
assert(isOpen);
if (isInMutableVariable(local)) {
// Do not use [local] as a hint on [result]. The variable should always
@@ -2070,7 +2230,8 @@
}
/// Create a write access to [local] with the provided [value].
- ir.Primitive buildLocalSet(LocalElement local, ir.Primitive value) {
+ @override
+ ir.Primitive buildLocalVariableSet(LocalElement local, ir.Primitive value) {
assert(isOpen);
if (isInMutableVariable(local)) {
add(new ir.SetMutableVariable(getMutableVariable(local), value));
@@ -2085,21 +2246,17 @@
return state.enclosingMethodThisParameter;
}
- ir.Primitive buildSuperInvocation(Element target,
- Selector selector,
- List<ir.Primitive> arguments) {
- return _buildInvokeSuper(target, selector, arguments);
- }
-
@override
- ir.Primitive buildConstructorInvocation(FunctionElement element,
- Selector selector,
+ ir.Primitive buildConstructorInvocation(ConstructorElement element,
+ CallStructure callStructure,
DartType type,
List<ir.Primitive> arguments) {
assert(isOpen);
+ Selector selector =
+ new Selector(SelectorKind.CALL, element.memberName, callStructure);
return _continueWithExpression(
- (k) => new ir.InvokeConstructor(type, element, selector, k,
- arguments));
+ (k) => new ir.InvokeConstructor(type, element, selector,
+ arguments, k));
}
}
@@ -2136,12 +2293,6 @@
_init(constantSystem, currentElement);
}
- Map<ast.TryStatement, TryStatementInfo> get tryStatements => null;
- Set<Local> get mutableCapturedVariables => null;
- bool isInMutableVariable(Local local) => false;
- void makeMutableVariable(Local local) {}
- void removeMutableVariable(Local local) {}
-
void enterInitializers() {
assert(jsState.inInitializers == false);
jsState.inInitializers = true;
@@ -2228,13 +2379,16 @@
{ir.Primitive initialValue}) {
assert(isOpen);
if (initialValue == null) {
- initialValue = buildNullLiteral();
+ initialValue = buildNullConstant();
}
ClosureLocation location = jsState.boxedVariables[variableElement];
if (location != null) {
add(new ir.SetField(environment.lookup(location.box),
location.field,
initialValue));
+ } else if (isInMutableVariable(variableElement)) {
+ add(new ir.LetMutable(getMutableVariable(variableElement),
+ initialValue));
} else {
initialValue.useElementAsHint(variableElement);
environment.extend(variableElement, initialValue);
@@ -2262,8 +2416,9 @@
new ir.CreateInstance(classElement, arguments, const <ir.Primitive>[]));
}
- /// Create a read access of [local].
- ir.Primitive buildLocalGet(LocalElement local) {
+ /// Create a read access of [local] variable or parameter.
+ @override
+ ir.Primitive _buildLocalGet(LocalElement local) {
assert(isOpen);
ClosureLocation location = jsState.boxedVariables[local];
if (location != null) {
@@ -2276,8 +2431,10 @@
}
}
- /// Create a write access to [local] with the provided [value].
- ir.Primitive buildLocalSet(LocalElement local, ir.Primitive value) {
+ /// Create a write access to [local] variable or parameter with the provided
+ /// [value].
+ @override
+ ir.Primitive buildLocalVariableSet(LocalElement local, ir.Primitive value) {
assert(isOpen);
ClosureLocation location = jsState.boxedVariables[local];
if (location != null) {
@@ -2331,25 +2488,15 @@
return state.thisParameter;
}
- ir.Primitive buildSuperInvocation(Element target,
- Selector selector,
- List<ir.Primitive> arguments) {
- // Direct calls to FieldElements are currently problematic because the
- // backend will not issue a getter for the field unless it finds a dynamic
- // access that matches its getter.
- // As a workaround, we generate GetField for this case, although ideally
- // this should be the result of inlining the field's getter.
- if (target is FieldElement) {
- if (selector.isGetter) {
- return addPrimitive(new ir.GetField(buildThis(), target));
- } else {
- assert(selector.isSetter);
- add(new ir.SetField(buildThis(), target, arguments.single));
- return arguments.single;
- }
- } else {
- return _buildInvokeSuper(target, selector, arguments);
- }
+ @override
+ ir.Primitive buildSuperFieldGet(FieldElement target) {
+ return addPrimitive(new ir.GetField(buildThis(), target));
+ }
+
+ @override
+ ir.Primitive buildSuperFieldSet(FieldElement target, ir.Primitive value) {
+ add(new ir.SetField(buildThis(), target, value));
+ return value;
}
ir.Primitive buildInvokeDirectly(FunctionElement target,
@@ -2360,7 +2507,7 @@
new Selector.call(target.name, target.library, arguments.length);
return _continueWithExpression(
(k) => new ir.InvokeMethodDirectly(
- receiver, target, selector, k, arguments));
+ receiver, target, selector, arguments, k));
}
/// Loads parameters to a constructor body into the environment.
@@ -2382,39 +2529,42 @@
@override
ir.Primitive buildConstructorInvocation(ConstructorElement element,
- Selector selector,
+ CallStructure callStructure,
DartType type,
List<ir.Primitive> arguments) {
assert(isOpen);
-
+ Selector selector =
+ new Selector(SelectorKind.CALL, element.memberName, callStructure);
ClassElement cls = element.enclosingClass;
if (program.requiresRuntimeTypesFor(cls)) {
InterfaceType interface = type;
Iterable<ir.Primitive> typeArguments =
interface.typeArguments.map((DartType argument) {
return type.treatAsRaw
- ? buildNullLiteral()
+ ? buildNullConstant()
: buildTypeExpression(argument);
});
arguments = new List<ir.Primitive>.from(arguments)
..addAll(typeArguments);
}
return _continueWithExpression(
- (k) => new ir.InvokeConstructor(type, element, selector, k,
- arguments));
+ (k) => new ir.InvokeConstructor(type, element, selector,
+ arguments, k));
}
ir.Primitive buildTypeExpression(DartType type) {
if (type is TypeVariableType) {
return buildTypeVariableAccess(buildThis(), type);
- } else {
- assert(type is InterfaceType);
+ } else if (type is InterfaceType) {
List<ir.Primitive> arguments = <ir.Primitive>[];
type.forEachTypeVariable((TypeVariableType variable) {
ir.Primitive value = buildTypeVariableAccess(buildThis(), variable);
arguments.add(value);
});
return addPrimitive(new ir.TypeExpression(type, arguments));
+ } else {
+ // TypedefType can reach here, and possibly other things.
+ throw 'unimplemented translation of type expression $type';
}
}
diff --git a/pkg/compiler/lib/src/cps_ir/cps_ir_builder_task.dart b/pkg/compiler/lib/src/cps_ir/cps_ir_builder_task.dart
index a433c46..5252b0f 100644
--- a/pkg/compiler/lib/src/cps_ir/cps_ir_builder_task.dart
+++ b/pkg/compiler/lib/src/cps_ir/cps_ir_builder_task.dart
@@ -12,7 +12,6 @@
import '../elements/elements.dart';
import '../elements/modelx.dart' show SynthesizedConstructorElementX,
ConstructorBodyElementX, FunctionSignatureX;
-import '../io/source_file.dart';
import '../io/source_information.dart';
import '../js_backend/js_backend.dart' show JavaScriptBackend;
import '../resolution/semantic_visitor.dart';
@@ -42,11 +41,11 @@
*/
class IrBuilderTask extends CompilerTask {
final Map<Element, ir.RootNode> nodes = <Element, ir.RootNode>{};
- final bool generateSourceMap;
+ final SourceInformationFactory sourceInformationFactory;
String bailoutMessage = null;
- IrBuilderTask(Compiler compiler, {this.generateSourceMap: true})
+ IrBuilderTask(Compiler compiler, this.sourceInformationFactory)
: super(compiler);
String get name => 'IR builder';
@@ -67,9 +66,8 @@
TreeElements elementsMapping = element.resolvedAst.elements;
element = element.implementation;
return compiler.withCurrentElement(element, () {
- SourceInformationBuilder sourceInformationBuilder = generateSourceMap
- ? new PositionSourceInformationBuilder(element)
- : const SourceInformationBuilder();
+ SourceInformationBuilder sourceInformationBuilder =
+ sourceInformationFactory.forContext(element);
IrBuilderVisitor builder =
compiler.backend is JavaScriptBackend
@@ -95,6 +93,9 @@
}
bool canBuild(Element element) {
+ // If using JavaScript backend, don't try to bail out early.
+ if (compiler.backend is JavaScriptBackend) return true;
+
if (element is TypedefElement) return false;
if (element is FunctionElement) {
// TODO(sigurdm): Support native functions for dart2js.
@@ -129,8 +130,11 @@
* to the [builder] and return the last added statement for trees that represent
* an expression.
*/
-abstract class IrBuilderVisitor extends SemanticVisitor<ir.Primitive, dynamic>
+// TODO(johnniwinther): Implement [SemanticDeclVisitor].
+abstract class IrBuilderVisitor extends ast.Visitor<ir.Primitive>
with IrBuilderMixin<ast.Node>,
+ SemanticSendResolvedMixin<ir.Primitive, dynamic>,
+ SendResolverMixin,
BaseImplementationOfStaticsMixin<ir.Primitive, dynamic>,
BaseImplementationOfLocalsMixin<ir.Primitive, dynamic>,
BaseImplementationOfDynamicsMixin<ir.Primitive, dynamic>,
@@ -139,6 +143,7 @@
BaseImplementationOfNewMixin<ir.Primitive, dynamic>,
ErrorBulkMixin<ir.Primitive, dynamic>
implements SemanticSendVisitor<ir.Primitive, dynamic> {
+ final TreeElements elements;
final Compiler compiler;
final SourceInformationBuilder sourceInformationBuilder;
@@ -169,13 +174,14 @@
// arguments, and what the arguments are.
/// Construct a top-level visitor.
- IrBuilderVisitor(TreeElements elements,
+ IrBuilderVisitor(this.elements,
this.compiler,
- this.sourceInformationBuilder)
- : super(elements);
+ this.sourceInformationBuilder);
@override
- bulkHandleNode(ast.Node node, String message, _) => giveup(node, message);
+ bulkHandleNode(ast.Node node, String message, _) {
+ giveup(node, message.replaceFirst('#', '$node'));
+ }
String bailoutMessage = null;
@@ -214,7 +220,7 @@
///
/// For the Dart backend, returns [arguments].
List<ir.Primitive> normalizeDynamicArguments(
- Selector selector,
+ CallStructure callStructure,
List<ir.Primitive> arguments);
ir.RootNode _makeFunctionBody(FunctionElement element,
@@ -260,7 +266,8 @@
if (parameterElement.isInitializingFormal) {
InitializingFormalElement initializingFormal = parameterElement;
withBuilder(irBuilder.makeInitializerBuilder(), () {
- ir.Primitive value = irBuilder.buildLocalGet(parameterElement);
+ ir.Primitive value =
+ irBuilder.buildLocalVariableGet(parameterElement);
result.add(irBuilder.makeFieldInitializer(
initializingFormal.fieldElement,
irBuilder.makeBody(value)));
@@ -357,7 +364,20 @@
// where (C', _) = Build(e, C)
ir.Primitive visitExpressionStatement(ast.ExpressionStatement node) {
assert(irBuilder.isOpen);
- visit(node.expression);
+ if (node.expression is ast.Throw) {
+ // Throw expressions that occur as statements are translated differently
+ // from ones that occur as subexpressions. This is achieved by peeking
+ // at statement-level expressions here.
+ irBuilder.buildThrow(visit(node.expression));
+ } else {
+ visit(node.expression);
+ }
+ return null;
+ }
+
+ ir.Primitive visitRethrow(ast.Rethrow node) {
+ assert(irBuilder.isOpen);
+ irBuilder.buildRethrow();
return null;
}
@@ -483,13 +503,9 @@
}
visitTryStatement(ast.TryStatement node) {
- // Try/catch is not yet implemented in the JS backend.
- if (tryStatements == null) {
- return giveup(node, 'try/catch in the JS backend');
- }
// Multiple catch blocks are not yet implemented.
if (node.catchBlocks.isEmpty ||
- node.catchBlocks.nodes.tail == null) {
+ !node.catchBlocks.nodes.tail.isEmpty) {
return giveup(node, 'not exactly one catch block');
}
// 'on T' catch blocks are not yet implemented.
@@ -533,32 +549,32 @@
// Build(Literal(c), C) = C[let val x = Constant(c) in [], x]
ir.Primitive visitLiteralBool(ast.LiteralBool node) {
assert(irBuilder.isOpen);
- return translateConstant(node);
+ return irBuilder.buildBooleanConstant(node.value);
}
ir.Primitive visitLiteralDouble(ast.LiteralDouble node) {
assert(irBuilder.isOpen);
- return translateConstant(node);
+ return irBuilder.buildDoubleConstant(node.value);
}
ir.Primitive visitLiteralInt(ast.LiteralInt node) {
assert(irBuilder.isOpen);
- return translateConstant(node);
+ return irBuilder.buildIntegerConstant(node.value);
}
ir.Primitive visitLiteralNull(ast.LiteralNull node) {
assert(irBuilder.isOpen);
- return translateConstant(node);
+ return irBuilder.buildNullConstant();
}
ir.Primitive visitLiteralString(ast.LiteralString node) {
assert(irBuilder.isOpen);
- return translateConstant(node);
+ return irBuilder.buildDartStringConstant(node.dartString);
}
ConstantExpression getConstantForNode(ast.Node node) {
ConstantExpression constant =
- compiler.backend.constantCompilerTask.compileNode(node, elements);
+ compiler.backend.constants.getConstantForNode(node, elements);
assert(invariant(node, constant != null,
message: 'No constant computed for $node'));
return constant;
@@ -624,7 +640,7 @@
var oldCascadeReceiver = _currentCascadeReceiver;
// Throw away the result of visiting the expression.
// Instead we return the result of visiting the CascadeReceiver.
- this.visit(node.expression);
+ visit(node.expression);
ir.Primitive receiver = _currentCascadeReceiver;
_currentCascadeReceiver = oldCascadeReceiver;
return receiver;
@@ -632,12 +648,17 @@
// ## Sends ##
@override
- ir.Primitive visitAssert(
- ast.Send node,
- ast.Node condition,
- _) {
+ ir.Primitive visitAssert(ast.Send node, ast.Node condition, _) {
assert(irBuilder.isOpen);
- return giveup(node, 'Assert');
+ if (compiler.enableUserAssertions) {
+ return giveup(node, 'assert in checked mode not implemented');
+ } else {
+ // The call to assert and its argument expression must be ignored
+ // in production mode.
+ // Assertions can only occur in expression statements, so no value needs
+ // to be returned.
+ return null;
+ }
}
ir.Primitive visitNamedArgument(ast.NamedArgument node) {
@@ -652,8 +673,9 @@
Selector selector, _) {
ir.Primitive receiver = visit(expression);
List<ir.Primitive> arguments = node.arguments.mapToList(visit);
- arguments = normalizeDynamicArguments(selector, arguments);
- return irBuilder.buildCallInvocation(receiver, selector, arguments);
+ arguments = normalizeDynamicArguments(selector.callStructure, arguments);
+ return irBuilder.buildCallInvocation(
+ receiver, selector.callStructure, arguments);
}
/// Returns `true` if [node] is a super call.
@@ -666,7 +688,7 @@
ir.Primitive handleConstantGet(
ast.Node node,
ConstantExpression constant, _) {
- return irBuilder.buildConstantLiteral(constant);
+ return irBuilder.buildConstant(constant);
}
/// If [node] is null, returns this.
@@ -691,7 +713,17 @@
ast.Send node,
ConstantExpression constant,
_) {
- return irBuilder.buildConstantLiteral(constant);
+ return irBuilder.buildConstant(constant);
+ }
+
+ @override
+ ir.Primitive visitLocalVariableGet(
+ ast.Send node,
+ LocalVariableElement element,
+ _) {
+ return element.isConst
+ ? irBuilder.buildConstant(getConstantForVariable(element))
+ : irBuilder.buildLocalVariableGet(element);
}
@override
@@ -699,22 +731,23 @@
ast.Send node,
LocalElement element,
_) {
- if (element.isConst) {
- return translateConstant(node);
- }
- return irBuilder.buildLocalGet(element);
+ return irBuilder.buildLocalVariableGet(element);
}
@override
- ir.Primitive handleStaticFieldGet(
+ ir.Primitive visitLocalFunctionGet(
ast.Send node,
- FieldElement field,
+ LocalFunctionElement function,
_) {
- if (field.isConst) {
- return translateConstant(node);
- }
- return irBuilder.buildStaticGet(field,
- sourceInformation: sourceInformationBuilder.buildGet(node));
+ return irBuilder.buildLocalFunctionGet(function);
+ }
+
+ @override
+ ir.Primitive handleStaticFieldGet(ast.Send node, FieldElement field, _) {
+ return field.isConst
+ ? irBuilder.buildConstant(getConstantForVariable(field))
+ : irBuilder.buildStaticFieldGet(field,
+ sourceInformation: sourceInformationBuilder.buildGet(node));
}
@override
@@ -726,7 +759,7 @@
if (function.isForeign(compiler.backend)) {
return giveup(node, 'handleStaticFunctionGet: foreign: $function');
}
- return translateConstant(node);
+ return giveup(node, 'handleStaticFunctionGet: $function');
}
@override
@@ -734,8 +767,7 @@
ast.Send node,
FunctionElement getter,
_) {
- return irBuilder.buildStaticInvocation(getter,
- new Selector.getter(getter.name, getter.library), const []);
+ return irBuilder.buildStaticGetterGet(getter);
}
@override
@@ -743,7 +775,7 @@
ast.Send node,
FieldElement field,
_) {
- return irBuilder.buildSuperGet(field);
+ return irBuilder.buildSuperFieldGet(field);
}
@override
@@ -751,7 +783,7 @@
ast.Send node,
FunctionElement getter,
_) {
- return irBuilder.buildSuperGet(getter);
+ return irBuilder.buildSuperGetterGet(getter);
}
@override
@@ -759,7 +791,23 @@
ast.Send node,
MethodElement method,
_) {
- return irBuilder.buildSuperGet(method);
+ return irBuilder.buildSuperMethodGet(method);
+ }
+
+ @override
+ ir.Primitive visitUnresolvedGet(
+ ast.Send node,
+ Element element,
+ _) {
+ return giveup(node, 'visitUnresolvedGet');
+ }
+
+ @override
+ ir.Primitive visitUnresolvedSuperGet(
+ ast.Send node,
+ Element element,
+ _) {
+ return giveup(node, 'visitUnresolvedSuperGet');
}
@override
@@ -841,7 +889,7 @@
Selector selector = new Selector.binaryOperator(operator.selectorName);
ir.Primitive receiver = visit(left);
List<ir.Primitive> arguments = <ir.Primitive>[visit(right)];
- arguments = normalizeDynamicArguments(selector, arguments);
+ arguments = normalizeDynamicArguments(selector.callStructure, arguments);
return irBuilder.buildDynamicInvocation(receiver, selector, arguments);
}
@@ -860,17 +908,18 @@
Selector selector = new Selector.index();
ir.Primitive target = visit(receiver);
List<ir.Primitive> arguments = <ir.Primitive>[visit(index)];
- arguments = normalizeDynamicArguments(selector, arguments);
+ arguments = normalizeDynamicArguments(selector.callStructure, arguments);
return irBuilder.buildDynamicInvocation(target, selector, arguments);
}
ir.Primitive translateSuperBinary(FunctionElement function,
op.BinaryOperator operator,
ast.Node argument) {
- Selector selector = new Selector.binaryOperator(operator.selectorName);
+ CallStructure callStructure = CallStructure.ONE_ARG;
List<ir.Primitive> arguments = <ir.Primitive>[visit(argument)];
- arguments = normalizeDynamicArguments(selector, arguments);
- return irBuilder.buildSuperInvocation(function, selector, arguments);
+ arguments = normalizeDynamicArguments(callStructure, arguments);
+ return irBuilder.buildSuperMethodInvocation(
+ function, callStructure, arguments);
}
@override
@@ -884,15 +933,31 @@
}
@override
+ ir.Primitive visitUnresolvedSuperBinary(
+ ast.Send node,
+ Element element,
+ op.BinaryOperator operator,
+ ast.Node argument,
+ _) {
+ return giveup(node, 'visitUnresolvedSuperBinary');
+ }
+
+ @override
ir.Primitive visitSuperIndex(
ast.Send node,
FunctionElement function,
ast.Node index,
_) {
- Selector selector = new Selector.index();
- List<ir.Primitive> arguments = <ir.Primitive>[visit(index)];
- arguments = normalizeDynamicArguments(selector, arguments);
- return irBuilder.buildSuperInvocation(function, selector, arguments);
+ return irBuilder.buildSuperIndex(function, visit(index));
+ }
+
+ @override
+ ir.Primitive visitUnresolvedSuperIndex(
+ ast.Send node,
+ Element element,
+ ast.Node index,
+ _) {
+ return giveup(node, 'visitUnresolvedSuperIndex');
}
@override
@@ -959,20 +1024,25 @@
op.UnaryOperator operator,
FunctionElement function,
_) {
- // TODO(johnniwinther): Clean up the creation of selectors.
- Selector selector = new Selector(
- SelectorKind.OPERATOR,
- new PublicName(operator.selectorName),
- CallStructure.NO_ARGS);
- return irBuilder.buildSuperInvocation(function, selector, const []);
+ return irBuilder.buildSuperMethodInvocation(
+ function, CallStructure.NO_ARGS, const []);
+ }
+
+ @override
+ ir.Primitive visitUnresolvedSuperUnary(
+ ast.Send node,
+ op.UnaryOperator operator,
+ Element element,
+ _) {
+ return giveup(node, 'visitUnresolvedSuperUnary');
}
// TODO(johnniwinther): Handle this in the [IrBuilder] to ensure the correct
// semantic correlation between arguments and invocation.
List<ir.Primitive> translateDynamicArguments(ast.NodeList nodeList,
- Selector selector) {
+ CallStructure callStructure) {
List<ir.Primitive> arguments = nodeList.nodes.mapToList(visit);
- return normalizeDynamicArguments(selector, arguments);
+ return normalizeDynamicArguments(callStructure, arguments);
}
// TODO(johnniwinther): Handle this in the [IrBuilder] to ensure the correct
@@ -986,19 +1056,10 @@
ir.Primitive translateCallInvoke(ir.Primitive target,
ast.NodeList arguments,
- Selector selector) {
+ CallStructure callStructure) {
- return irBuilder.buildCallInvocation(target, selector,
- translateDynamicArguments(arguments, selector));
- }
-
- ir.Primitive translateConstantInvoke(ConstantExpression constant,
- ast.NodeList arguments,
- Selector selector) {
- return translateCallInvoke(
- irBuilder.buildConstantLiteral(constant),
- arguments,
- selector);
+ return irBuilder.buildCallInvocation(target, callStructure,
+ translateDynamicArguments(arguments, callStructure));
}
@override
@@ -1006,9 +1067,10 @@
ast.Send node,
ConstantExpression constant,
ast.NodeList arguments,
- Selector selector,
+ CallStructure callStructure,
_) {
- return translateConstantInvoke(constant, arguments, selector);
+ ir.Primitive target = irBuilder.buildConstant(constant);
+ return translateCallInvoke(target, arguments, callStructure);
}
@override
@@ -1020,17 +1082,28 @@
_) {
return irBuilder.buildDynamicInvocation(
translateReceiver(receiver), selector,
- translateDynamicArguments(arguments, selector));
+ translateDynamicArguments(arguments, selector.callStructure));
}
ir.Primitive handleLocalInvoke(
ast.Send node,
LocalElement element,
ast.NodeList arguments,
- Selector selector,
+ CallStructure callStructure,
_) {
- return irBuilder.buildLocalInvocation(element, selector,
- translateDynamicArguments(arguments, selector));
+ return irBuilder.buildLocalVariableInvocation(element, callStructure,
+ translateDynamicArguments(arguments, callStructure));
+ }
+
+ @override
+ ir.Primitive visitLocalFunctionInvoke(
+ ast.Send node,
+ LocalFunctionElement function,
+ ast.NodeList arguments,
+ CallStructure callStructure,
+ _) {
+ return irBuilder.buildLocalFunctionInvocation(function, callStructure,
+ translateDynamicArguments(arguments, callStructure));
}
@override
@@ -1038,11 +1111,12 @@
ast.Send node,
FieldElement field,
ast.NodeList arguments,
- Selector selector,
+ CallStructure callStructure,
_) {
- return translateCallInvoke(
- irBuilder.buildStaticGet(field),
- arguments, selector);
+ ir.Primitive target = irBuilder.buildStaticFieldGet(field);
+ return irBuilder.buildCallInvocation(target,
+ callStructure,
+ translateDynamicArguments(arguments, callStructure));
}
@override
@@ -1050,27 +1124,41 @@
ast.Send node,
MethodElement function,
ast.NodeList arguments,
- Selector selector,
+ CallStructure callStructure,
_) {
// TODO(karlklose): support foreign functions.
if (function.isForeign(compiler.backend)) {
return giveup(node, 'handleStaticFunctionInvoke: foreign: $function');
}
- return irBuilder.buildStaticInvocation(function, selector,
- translateStaticArguments(arguments, function, selector.callStructure),
+ return irBuilder.buildStaticFunctionInvocation(function, callStructure,
+ translateStaticArguments(arguments, function, callStructure),
sourceInformation: sourceInformationBuilder.buildCall(node));
}
@override
+ ir.Primitive handleStaticFunctionIncompatibleInvoke(
+ ast.Send node,
+ MethodElement function,
+ ast.NodeList arguments,
+ CallStructure callStructure,
+ _) {
+ return giveup(node, 'handleStaticFunctionIncompatibleInvoke');
+ }
+
+ @override
ir.Primitive handleStaticGetterInvoke(
ast.Send node,
FunctionElement getter,
ast.NodeList arguments,
- Selector selector,
+ CallStructure callStructure,
_) {
- return translateCallInvoke(
- irBuilder.buildStaticGet(getter),
- arguments, selector);
+ if (getter.isForeign(compiler.backend)) {
+ return giveup(node, 'handleStaticGetterInvoke: foreign: $getter');
+ }
+ ir.Primitive target = irBuilder.buildStaticGetterGet(getter);
+ return irBuilder.buildCallInvocation(target,
+ callStructure,
+ translateDynamicArguments(arguments, callStructure));
}
@override
@@ -1078,11 +1166,12 @@
ast.Send node,
FieldElement field,
ast.NodeList arguments,
- Selector selector,
+ CallStructure callStructure,
_) {
- return translateCallInvoke(
- irBuilder.buildSuperGet(field),
- arguments, selector);
+ ir.Primitive target = irBuilder.buildSuperFieldGet(field);
+ return irBuilder.buildCallInvocation(target,
+ callStructure,
+ translateDynamicArguments(arguments, callStructure));
}
@override
@@ -1090,11 +1179,12 @@
ast.Send node,
FunctionElement getter,
ast.NodeList arguments,
- Selector selector,
+ CallStructure callStructure,
_) {
- return translateCallInvoke(
- irBuilder.buildSuperGet(getter),
- arguments, selector);
+ ir.Primitive target = irBuilder.buildSuperGetterGet(getter);
+ return irBuilder.buildCallInvocation(target,
+ callStructure,
+ translateDynamicArguments(arguments, callStructure));
}
@override
@@ -1102,19 +1192,49 @@
ast.Send node,
MethodElement method,
ast.NodeList arguments,
+ CallStructure callStructure,
+ _) {
+ return irBuilder.buildSuperMethodInvocation(method, callStructure,
+ translateDynamicArguments(arguments, callStructure));
+ }
+
+ @override
+ ir.Primitive visitSuperMethodIncompatibleInvoke(
+ ast.Send node,
+ MethodElement method,
+ ast.NodeList arguments,
+ CallStructure callStructure,
+ _) {
+ return giveup(node, 'visitSuperMethodIncompatibleInvoke');
+ }
+
+ @override
+ ir.Primitive visitUnresolvedInvoke(
+ ast.Send node,
+ Element element,
+ ast.NodeList arguments,
Selector selector,
_) {
- return irBuilder.buildSuperInvocation(method, selector,
- translateDynamicArguments(arguments, selector));
+ return giveup(node, 'visitUnresolvedInvoke');
+ }
+
+ @override
+ ir.Primitive visitUnresolvedSuperInvoke(
+ ast.Send node,
+ Element element,
+ ast.NodeList arguments,
+ Selector selector,
+ _) {
+ return giveup(node, 'visitUnresolvedSuperInvoke');
}
@override
ir.Primitive visitThisInvoke(
ast.Send node,
ast.NodeList arguments,
- Selector selector,
+ CallStructure callStructure,
_) {
- return translateCallInvoke(irBuilder.buildThis(), arguments, selector);
+ return translateCallInvoke(irBuilder.buildThis(), arguments, callStructure);
}
@override
@@ -1122,21 +1242,12 @@
ast.Send node,
TypeVariableElement element,
ast.NodeList arguments,
- Selector selector,
+ CallStructure callStructure,
_) {
return translateCallInvoke(
translateTypeVariableTypeLiteral(element),
arguments,
- selector);
- }
-
- @override
- ir.Primitive visitTypedefTypeLiteralInvoke(
- ast.Send node,
- TypeConstantExpression constant,
- ast.NodeList arguments,
- Selector selector, _) {
- return translateConstantInvoke(constant, arguments, selector);
+ callStructure);
}
// TODO(johnniwinther): This should be a method on [IrBuilder].
@@ -1178,7 +1289,8 @@
getValue: () {
Selector selector = new Selector.index();
List<ir.Primitive> arguments = <ir.Primitive>[indexValue];
- arguments = normalizeDynamicArguments(selector, arguments);
+ arguments =
+ normalizeDynamicArguments(selector.callStructure, arguments);
return irBuilder.buildDynamicInvocation(target, selector, arguments);
},
operator: operator,
@@ -1200,10 +1312,7 @@
ir.Primitive indexValue = visit(index);
return translateCompound(
getValue: () {
- Selector selector = new Selector.index();
- List<ir.Primitive> arguments = <ir.Primitive>[indexValue];
- arguments = normalizeDynamicArguments(selector, arguments);
- return irBuilder.buildSuperInvocation(getter, selector, arguments);
+ return irBuilder.buildSuperIndex(getter, indexValue);
},
operator: operator,
rhs: rhs,
@@ -1221,8 +1330,9 @@
Selector operatorSelector =
new Selector.binaryOperator(operator.selectorName);
List<ir.Primitive> arguments =
- <ir.Primitive>[irBuilder.buildIntegerLiteral(1)];
- arguments = normalizeDynamicArguments(operatorSelector, arguments);
+ <ir.Primitive>[irBuilder.buildIntegerConstant(1)];
+ arguments = normalizeDynamicArguments(
+ operatorSelector.callStructure, arguments);
ir.Primitive result =
irBuilder.buildDynamicInvocation(value, operatorSelector, arguments);
setValue(result);
@@ -1238,7 +1348,8 @@
Selector operatorSelector =
new Selector.binaryOperator(operator.selectorName);
List<ir.Primitive> arguments = <ir.Primitive>[visit(rhs)];
- arguments = normalizeDynamicArguments(operatorSelector, arguments);
+ arguments = normalizeDynamicArguments(
+ operatorSelector.callStructure, arguments);
ir.Primitive result =
irBuilder.buildDynamicInvocation(value, operatorSelector, arguments);
setValue(result);
@@ -1304,11 +1415,11 @@
ast.Node rhs,
_) {
return translateCompound(
- getValue: () => irBuilder.buildLocalGet(element),
+ getValue: () => irBuilder.buildLocalVariableGet(element),
operator: operator,
rhs: rhs,
setValue: (ir.Primitive result) {
- irBuilder.buildLocalSet(element, result);
+ irBuilder.buildLocalVariableSet(element, result);
});
}
@@ -1320,10 +1431,10 @@
arg,
{bool isPrefix}) {
return translatePrefixPostfix(
- getValue: () => irBuilder.buildLocalGet(element),
+ getValue: () => irBuilder.buildLocalVariableGet(element),
operator: operator,
setValue: (ir.Primitive result) {
- irBuilder.buildLocalSet(element, result);
+ irBuilder.buildLocalVariableSet(element, result);
},
isPrefix: isPrefix);
}
@@ -1334,7 +1445,7 @@
LocalElement element,
ast.Node rhs,
_) {
- return irBuilder.buildLocalSet(element, visit(rhs));
+ return irBuilder.buildLocalVariableSet(element, visit(rhs));
}
@override
@@ -1345,11 +1456,11 @@
ast.Node rhs,
_) {
return translateCompound(
- getValue: () => irBuilder.buildStaticGet(field),
+ getValue: () => irBuilder.buildStaticFieldGet(field),
operator: operator,
rhs: rhs,
setValue: (ir.Primitive result) {
- irBuilder.buildStaticSet(field, result);
+ irBuilder.buildStaticFieldSet(field, result);
});
}
@@ -1361,10 +1472,10 @@
arg,
{bool isPrefix}) {
return translatePrefixPostfix(
- getValue: () => irBuilder.buildStaticGet(field),
+ getValue: () => irBuilder.buildStaticFieldGet(field),
operator: operator,
setValue: (ir.Primitive result) {
- irBuilder.buildStaticSet(field, result);
+ irBuilder.buildStaticFieldSet(field, result);
},
isPrefix: isPrefix);
}
@@ -1375,7 +1486,7 @@
FieldElement field,
ast.Node rhs,
_) {
- return irBuilder.buildStaticSet(field, visit(rhs));
+ return irBuilder.buildStaticFieldSet(field, visit(rhs));
}
@override
@@ -1384,7 +1495,7 @@
FieldElement field,
ast.Node rhs,
_) {
- return irBuilder.buildSuperSet(field, visit(rhs));
+ return irBuilder.buildSuperFieldSet(field, visit(rhs));
}
@override
@@ -1393,7 +1504,7 @@
FunctionElement setter,
ast.Node rhs,
_) {
- return irBuilder.buildSuperSet(setter, visit(rhs));
+ return irBuilder.buildSuperSetterSet(setter, visit(rhs));
}
@override
@@ -1405,11 +1516,11 @@
ast.Node rhs,
_) {
return translateCompound(
- getValue: () => irBuilder.buildStaticGet(getter),
+ getValue: () => irBuilder.buildStaticGetterGet(getter),
operator: operator,
rhs: rhs,
setValue: (ir.Primitive result) {
- irBuilder.buildStaticSet(setter, result);
+ irBuilder.buildStaticSetterSet(setter, result);
});
}
@@ -1422,10 +1533,10 @@
arg,
{bool isPrefix}) {
return translatePrefixPostfix(
- getValue: () => irBuilder.buildSuperGet(readField),
+ getValue: () => irBuilder.buildSuperFieldGet(readField),
operator: operator,
setValue: (ir.Primitive result) {
- irBuilder.buildSuperSet(writtenField, result);
+ irBuilder.buildSuperFieldSet(writtenField, result);
},
isPrefix: isPrefix);
}
@@ -1439,10 +1550,10 @@
arg,
{bool isPrefix}) {
return translatePrefixPostfix(
- getValue: () => irBuilder.buildSuperGet(field),
+ getValue: () => irBuilder.buildSuperFieldGet(field),
operator: operator,
setValue: (ir.Primitive result) {
- irBuilder.buildSuperSet(setter, result);
+ irBuilder.buildSuperSetterSet(setter, result);
},
isPrefix: isPrefix);
}
@@ -1456,10 +1567,10 @@
arg,
{bool isPrefix}) {
return translatePrefixPostfix(
- getValue: () => irBuilder.buildSuperGet(getter),
+ getValue: () => irBuilder.buildSuperGetterGet(getter),
operator: operator,
setValue: (ir.Primitive result) {
- irBuilder.buildSuperSet(field, result);
+ irBuilder.buildSuperFieldSet(field, result);
},
isPrefix: isPrefix);
}
@@ -1473,10 +1584,10 @@
arg,
{bool isPrefix}) {
return translatePrefixPostfix(
- getValue: () => irBuilder.buildSuperGet(getter),
+ getValue: () => irBuilder.buildSuperGetterGet(getter),
operator: operator,
setValue: (ir.Primitive result) {
- irBuilder.buildSuperSet(setter, result);
+ irBuilder.buildSuperSetterSet(setter, result);
},
isPrefix: isPrefix);
}
@@ -1490,10 +1601,10 @@
arg,
{bool isPrefix}) {
return translatePrefixPostfix(
- getValue: () => irBuilder.buildSuperGet(method),
+ getValue: () => irBuilder.buildSuperMethodGet(method),
operator: operator,
setValue: (ir.Primitive result) {
- irBuilder.buildSuperSet(setter, result);
+ irBuilder.buildSuperSetterSet(setter, result);
},
isPrefix: isPrefix);
}
@@ -1507,10 +1618,10 @@
arg,
{bool isPrefix}) {
return translatePrefixPostfix(
- getValue: () => irBuilder.buildStaticGet(getter),
+ getValue: () => irBuilder.buildStaticGetterGet(getter),
operator: operator,
setValue: (ir.Primitive result) {
- irBuilder.buildStaticSet(setter, result);
+ irBuilder.buildStaticSetterSet(setter, result);
},
isPrefix: isPrefix);
}
@@ -1524,11 +1635,11 @@
ast.Node rhs,
_) {
return translateCompound(
- getValue: () => irBuilder.buildStaticGet(method),
+ getValue: () => irBuilder.buildStaticFunctionGet(method),
operator: operator,
rhs: rhs,
setValue: (ir.Primitive result) {
- irBuilder.buildStaticSet(setter, result);
+ irBuilder.buildStaticSetterSet(setter, result);
});
}
@@ -1541,10 +1652,10 @@
arg,
{bool isPrefix}) {
return translatePrefixPostfix(
- getValue: () => irBuilder.buildStaticGet(getter),
+ getValue: () => irBuilder.buildStaticFunctionGet(getter),
operator: operator,
setValue: (ir.Primitive result) {
- irBuilder.buildStaticSet(setter, result);
+ irBuilder.buildStaticSetterSet(setter, result);
},
isPrefix: isPrefix);
}
@@ -1563,14 +1674,16 @@
getValue: () {
Selector selector = new Selector.index();
List<ir.Primitive> arguments = <ir.Primitive>[indexValue];
- arguments = normalizeDynamicArguments(selector, arguments);
+ arguments =
+ normalizeDynamicArguments(selector.callStructure, arguments);
return irBuilder.buildDynamicInvocation(target, selector, arguments);
},
operator: operator,
setValue: (ir.Primitive result) {
Selector selector = new Selector.indexSet();
List<ir.Primitive> arguments = <ir.Primitive>[indexValue, result];
- arguments = normalizeDynamicArguments(selector, arguments);
+ arguments =
+ normalizeDynamicArguments(selector.callStructure, arguments);
irBuilder.buildDynamicInvocation(target, selector, arguments);
},
isPrefix: isPrefix);
@@ -1588,19 +1701,11 @@
ir.Primitive indexValue = visit(index);
return translatePrefixPostfix(
getValue: () {
- Selector selector = new Selector.index();
- List<ir.Primitive> arguments = <ir.Primitive>[indexValue];
- arguments = normalizeDynamicArguments(selector, arguments);
- return irBuilder.buildSuperInvocation(
- indexFunction, selector, arguments);
+ return irBuilder.buildSuperIndex(indexFunction, indexValue);
},
operator: operator,
setValue: (ir.Primitive result) {
- Selector selector = new Selector.indexSet();
- List<ir.Primitive> arguments = <ir.Primitive>[indexValue, result];
- arguments = normalizeDynamicArguments(selector, arguments);
- irBuilder.buildSuperInvocation(
- indexSetFunction, selector, arguments);
+ irBuilder.buildSuperIndexSet(indexSetFunction, indexValue, result);
},
isPrefix: isPrefix);
}
@@ -1611,7 +1716,7 @@
FunctionElement setter,
ast.Node rhs,
_) {
- return irBuilder.buildStaticSet(setter, visit(rhs));
+ return irBuilder.buildStaticSetterSet(setter, visit(rhs));
}
@override
@@ -1622,11 +1727,11 @@
ast.Node rhs,
_) {
return translateCompound(
- getValue: () => irBuilder.buildSuperGet(field),
+ getValue: () => irBuilder.buildSuperFieldGet(field),
operator: operator,
rhs: rhs,
setValue: (ir.Primitive result) {
- irBuilder.buildSuperSet(field, result);
+ irBuilder.buildSuperFieldSet(field, result);
});
}
@@ -1638,10 +1743,10 @@
op.IncDecOperator operator,
_) {
return translatePrefixPostfix(
- getValue: () => irBuilder.buildSuperGet(readField),
+ getValue: () => irBuilder.buildSuperFieldGet(readField),
operator: operator,
setValue: (ir.Primitive result) {
- irBuilder.buildSuperSet(writtenField, result);
+ irBuilder.buildSuperFieldSet(writtenField, result);
},
isPrefix: false);
}
@@ -1654,10 +1759,10 @@
op.IncDecOperator operator,
_) {
return translatePrefixPostfix(
- getValue: () => irBuilder.buildSuperGet(readField),
+ getValue: () => irBuilder.buildSuperFieldGet(readField),
operator: operator,
setValue: (ir.Primitive result) {
- irBuilder.buildSuperSet(writtenField, result);
+ irBuilder.buildSuperFieldSet(writtenField, result);
},
isPrefix: true);
}
@@ -1671,11 +1776,11 @@
ast.Node rhs,
_) {
return translateCompound(
- getValue: () => irBuilder.buildSuperGet(field),
+ getValue: () => irBuilder.buildSuperFieldGet(field),
operator: operator,
rhs: rhs,
setValue: (ir.Primitive result) {
- irBuilder.buildSuperSet(setter, result);
+ irBuilder.buildSuperSetterSet(setter, result);
});
}
@@ -1688,11 +1793,11 @@
ast.Node rhs,
_) {
return translateCompound(
- getValue: () => irBuilder.buildSuperGet(getter),
+ getValue: () => irBuilder.buildSuperGetterGet(getter),
operator: operator,
rhs: rhs,
setValue: (ir.Primitive result) {
- irBuilder.buildSuperSet(field, result);
+ irBuilder.buildSuperFieldSet(field, result);
});
}
@@ -1705,11 +1810,11 @@
ast.Node rhs,
_) {
return translateCompound(
- getValue: () => irBuilder.buildSuperGet(getter),
+ getValue: () => irBuilder.buildSuperGetterGet(getter),
operator: operator,
rhs: rhs,
setValue: (ir.Primitive result) {
- irBuilder.buildSuperSet(setter, result);
+ irBuilder.buildSuperSetterSet(setter, result);
});
}
@@ -1722,29 +1827,14 @@
ast.Node rhs,
_) {
return translateCompound(
- getValue: () => irBuilder.buildSuperGet(method),
+ getValue: () => irBuilder.buildSuperMethodGet(method),
operator: operator,
rhs: rhs,
setValue: (ir.Primitive result) {
- irBuilder.buildSuperSet(setter, result);
+ irBuilder.buildSuperSetterSet(setter, result);
});
}
- @override
- ir.Primitive handleConstructorInvoke(
- ast.NewExpression node,
- ConstructorElement constructor,
- DartType type,
- ast.NodeList arguments,
- Selector selector, _) {
- List<ir.Primitive> arguments =
- node.send.arguments.mapToList(visit, growable:false);
- arguments = normalizeStaticArguments(
- selector.callStructure, constructor, arguments);
- return irBuilder.buildConstructorInvocation(
- constructor, selector, type, arguments);
- }
-
ir.Primitive visitStringJuxtaposition(ast.StringJuxtaposition node) {
assert(irBuilder.isOpen);
ir.Primitive first = visit(node.first);
@@ -1767,13 +1857,20 @@
ir.Primitive translateConstant(ast.Node node) {
assert(irBuilder.isOpen);
- return irBuilder.buildConstantLiteral(getConstantForNode(node));
+ return irBuilder.buildConstant(getConstantForNode(node));
+ }
+
+ ir.Primitive visitThrow(ast.Throw node) {
+ assert(irBuilder.isOpen);
+ // This function is not called for throw expressions occurring as
+ // statements.
+ return irBuilder.buildNonTailThrow(visit(node.expression));
}
ir.RootNode nullIfGiveup(ir.RootNode action()) {
try {
return action();
- } catch(e, tr) {
+ } catch(e) {
if (e == ABORT_IRNODE_BUILDER) {
return null;
}
@@ -2013,13 +2110,16 @@
ir.RootNode buildExecutable(ExecutableElement element) {
return nullIfGiveup(() {
+ ir.RootNode root;
if (element is FieldElement) {
- return buildField(element);
+ root = buildField(element);
} else if (element is FunctionElement || element is ConstructorElement) {
- return buildFunction(element);
+ root = buildFunction(element);
} else {
compiler.internalError(element, "Unexpected element type $element");
}
+ new CleanupPass().visit(root);
+ return root;
});
}
@@ -2084,7 +2184,7 @@
}
List<ir.Primitive> normalizeDynamicArguments(
- Selector selector,
+ CallStructure callStructure,
List<ir.Primitive> arguments) {
return arguments;
}
@@ -2097,6 +2197,22 @@
irBuilder.add(new ir.LetPrim(prim));
return prim;
}
+
+ @override
+ ir.Primitive handleConstructorInvoke(
+ ast.NewExpression node,
+ ConstructorElement constructor,
+ DartType type,
+ ast.NodeList arguments,
+ CallStructure callStructure, _) {
+ List<ir.Primitive> arguments =
+ node.send.arguments.mapToList(visit, growable:false);
+ return irBuilder.buildConstructorInvocation(
+ constructor,
+ callStructure,
+ type,
+ arguments);
+ }
}
/// The [IrBuilder]s view on the information about the program that has been
@@ -2217,21 +2333,27 @@
ir.RootNode buildExecutable(ExecutableElement element) {
return nullIfGiveup(() {
+ ir.RootNode root;
switch (element.kind) {
case ElementKind.GENERATIVE_CONSTRUCTOR:
- return buildConstructor(element);
+ root = buildConstructor(element);
+ break;
case ElementKind.GENERATIVE_CONSTRUCTOR_BODY:
- return buildConstructorBody(element);
+ root = buildConstructorBody(element);
+ break;
case ElementKind.FUNCTION:
case ElementKind.GETTER:
case ElementKind.SETTER:
- return buildFunction(element);
+ root = buildFunction(element);
+ break;
default:
compiler.internalError(element, "Unexpected element type $element");
}
+ new CleanupPass().visit(root);
+ return root;
});
}
@@ -2328,7 +2450,7 @@
classElement.forEachInstanceField((ClassElement c, FieldElement field) {
ir.Primitive value = fieldValues[field];
if (value != null) {
- instanceArguments.add(fieldValues[field]);
+ instanceArguments.add(value);
} else {
assert(Elements.isNativeOrExtendsNative(c));
// Native fields are initialized elsewhere.
@@ -2384,7 +2506,7 @@
} else {
// Fields without an initializer default to null.
// This value will be overwritten below if an initializer is found.
- fieldValues[field] = irBuilder.buildNullLiteral();
+ fieldValues[field] = irBuilder.buildNullConstant();
}
}
});
@@ -2394,7 +2516,7 @@
if (parameter.isInitializingFormal) {
InitializingFormalElement fieldParameter = parameter;
fieldValues[fieldParameter.fieldElement] =
- irBuilder.buildLocalGet(parameter);
+ irBuilder.buildLocalVariableGet(parameter);
}
});
// Evaluate constructor initializers, e.g. `Foo() : x = 50`.
@@ -2474,7 +2596,7 @@
if (param.initializer != null) {
value = inlineExpression(target, param.initializer);
} else {
- value = irBuilder.buildNullLiteral();
+ value = irBuilder.buildNullConstant();
}
}
irBuilder.declareLocalVariable(param, initialValue: value);
@@ -2559,6 +2681,17 @@
return parameters;
}
+ DartCapturedVariables _analyzeCapturedVariables(ast.Node node) {
+ DartCapturedVariables variables = new DartCapturedVariables(elements);
+ try {
+ variables.analyze(node);
+ } catch (e) {
+ bailoutMessage = variables.bailoutMessage;
+ rethrow;
+ }
+ return variables;
+ }
+
/// Builds the IR for the body of a constructor.
///
/// This function is invoked from one or more "factory" constructors built by
@@ -2571,6 +2704,15 @@
node,
elements);
+ // We compute variables boxed in mutable variables on entry to each try
+ // block, not including variables captured by a closure (which are boxed
+ // in the heap). This duplicates some of the work of closure conversion
+ // without directly using the results. This duplication is wasteful and
+ // error-prone.
+ // TODO(kmillikin): We should combine closure conversion and try/catch
+ // variable analysis in some way.
+ DartCapturedVariables variables = _analyzeCapturedVariables(node);
+ tryStatements = variables.tryStatements;
JsIrBuilder builder = getBuilderFor(body);
return withBuilder(builder, () {
@@ -2593,6 +2735,8 @@
element,
node,
elements);
+ DartCapturedVariables variables = _analyzeCapturedVariables(node);
+ tryStatements = variables.tryStatements;
IrBuilder builder = getBuilderFor(element);
return withBuilder(builder, () => _makeFunctionBody(element, node));
}
@@ -2600,7 +2744,7 @@
/// Creates a primitive for the default value of [parameter].
ir.Primitive translateDefaultValue(ParameterElement parameter) {
if (parameter.initializer == null) {
- return irBuilder.buildNullLiteral();
+ return irBuilder.buildNullConstant();
} else {
return inlineConstant(parameter.executableContext, parameter.initializer);
}
@@ -2655,9 +2799,8 @@
/// Normalizes order of named arguments.
List<ir.Primitive> normalizeDynamicArguments(
- Selector selector,
+ CallStructure callStructure,
List<ir.Primitive> arguments) {
- CallStructure callStructure = selector.callStructure;
assert(arguments.length == callStructure.argumentCount);
// Optimization: don't copy the argument list for trivial cases.
if (callStructure.namedArguments.isEmpty) return arguments;
@@ -2683,45 +2826,90 @@
irBuilder.add(new ir.LetPrim(type));
return type;
}
+
+ @override
+ ir.Primitive handleConstructorInvoke(
+ ast.NewExpression node,
+ ConstructorElement constructor,
+ DartType type,
+ ast.NodeList arguments,
+ CallStructure callStructure,
+ _) {
+ List<ir.Primitive> arguments =
+ node.send.arguments.mapToList(visit, growable:false);
+ arguments = normalizeStaticArguments(
+ callStructure, constructor, arguments);
+ return irBuilder.buildConstructorInvocation(
+ constructor.effectiveTarget,
+ callStructure,
+ constructor.computeEffectiveTargetType(type),
+ arguments);
+ }
}
-/// Interface for generating [SourceInformation] for the CPS.
-class SourceInformationBuilder {
- const SourceInformationBuilder();
+/// Perform simple post-processing on the initial CPS-translated root term.
+///
+/// This pass performs backend-independent post-processing on the translated
+/// term. It is implemented separately from the optimization passes because
+/// it is required for correctness of the implementation.
+///
+/// It performs the following translations:
+/// - Replace [ir.LetPrim] binding a [ir.NonTailThrow] with a [ir.Throw]
+/// expression.
+class CleanupPass extends ir.RecursiveVisitor {
+ RemovalVisitor _remover = new RemovalVisitor();
- /// Create a [SourceInformationBuilder] for [element].
- SourceInformationBuilder forContext(AstElement element) => this;
+ ir.Expression replacementFor(ir.Expression expression) {
+ if (expression != null && expression is ir.LetPrim) {
+ ir.Primitive primitive = expression.primitive;
+ if (primitive is ir.NonTailThrow) {
+ _remover.visit(expression);
+ return new ir.Throw(primitive.value.definition);
+ }
+ }
+ return expression;
+ }
- /// Generate [SourceInformation] for the read access in [node].
- SourceInformation buildGet(ast.Node node) => null;
+ processLetPrim(ir.LetPrim node) {
+ node.body = replacementFor(node.body);
+ }
- /// Generate [SourceInformation] for the invocation in [node].
- SourceInformation buildCall(ast.Node node) => null;
+ processLetCont(ir.LetCont node) {
+ node.body = replacementFor(node.body);
+ }
+
+ processLetHandler(ir.LetHandler node) {
+ node.body = replacementFor(node.body);
+ }
+
+ processLetMutable(ir.LetMutable node) {
+ node.body = replacementFor(node.body);
+ }
+
+ processSetMutableVariable(ir.SetMutableVariable node) {
+ node.body = replacementFor(node.body);
+ }
+
+ processDeclareFunction(ir.DeclareFunction node) {
+ node.body = replacementFor(node.body);
+ }
+
+ processSetField(ir.SetField node) {
+ node.body = replacementFor(node.body);
+ }
+
+ processContinuation(ir.Continuation node) {
+ node.body = replacementFor(node.body);
+ }
+
+ processBody(ir.Body node) {
+ node.body = replacementFor(node.body);
+ }
}
-/// [SourceInformationBuilder] that generates [PositionSourceInformation].
-class PositionSourceInformationBuilder implements SourceInformationBuilder {
- final SourceFile sourceFile;
- final String name;
-
- PositionSourceInformationBuilder(AstElement element)
- : sourceFile = element.compilationUnit.script.file,
- name = element.name;
-
- @override
- SourceInformation buildGet(ast.Node node) {
- return new PositionSourceInformation(
- new TokenSourceLocation(sourceFile, node.getBeginToken(), name));
- }
-
- @override
- SourceInformation buildCall(ast.Node node) {
- return new PositionSourceInformation(
- new TokenSourceLocation(sourceFile, node.getBeginToken(), name));
- }
-
- @override
- SourceInformationBuilder forContext(AstElement element) {
- return new PositionSourceInformationBuilder(element);
+/// Visit a just-deleted subterm and unlink all [Reference]s in it.
+class RemovalVisitor extends ir.RecursiveVisitor {
+ processReference(ir.Reference reference) {
+ reference.unlink();
}
}
diff --git a/pkg/compiler/lib/src/cps_ir/cps_ir_nodes.dart b/pkg/compiler/lib/src/cps_ir/cps_ir_nodes.dart
index b0a305d..7577607 100644
--- a/pkg/compiler/lib/src/cps_ir/cps_ir_nodes.dart
+++ b/pkg/compiler/lib/src/cps_ir/cps_ir_nodes.dart
@@ -8,7 +8,6 @@
import '../constants/expressions.dart';
import '../constants/values.dart' as values show ConstantValue;
-import '../cps_ir/optimizers.dart';
import '../dart_types.dart' show DartType, GenericType, TypeVariableType;
import '../dart2jslib.dart' as dart2js show
CURRENT_ELEMENT_SPANNABLE,
@@ -37,11 +36,12 @@
bool get hasAtMostOneUse => firstRef == null || firstRef.next == null;
bool get hasExactlyOneUse => firstRef != null && firstRef.next == null;
+ bool get hasNoUses => firstRef == null;
bool get hasAtLeastOneUse => firstRef != null;
bool get hasMultipleUses => !hasAtMostOneUse;
void substituteFor(Definition<T> other) {
- if (other.firstRef == null) return;
+ if (other.hasNoUses) return;
Reference<T> previous, current = other.firstRef;
do {
current.definition = this;
@@ -51,6 +51,7 @@
previous.next = firstRef;
if (firstRef != null) firstRef.previous = previous;
firstRef = other.firstRef;
+ other.firstRef = null;
}
}
@@ -225,17 +226,17 @@
*/
final Selector selector;
- final Reference<Continuation> continuation;
final List<Reference<Primitive>> arguments;
+ final Reference<Continuation> continuation;
final SourceInformation sourceInformation;
InvokeStatic(this.target,
this.selector,
- Continuation cont,
List<Primitive> args,
+ Continuation cont,
this.sourceInformation)
- : continuation = new Reference<Continuation>(cont),
- arguments = _referenceList(args) {
+ : arguments = _referenceList(args),
+ continuation = new Reference<Continuation>(cont) {
assert(target is ErroneousElement || selector.name == target.name);
}
@@ -264,22 +265,26 @@
Reference<Primitive> receiver;
Selector selector;
CallingConvention callingConvention;
- final Reference<Continuation> continuation;
final List<Reference<Primitive>> arguments;
+ final Reference<Continuation> continuation;
+ final SourceInformation sourceInformation;
InvokeMethod(Primitive receiver,
Selector selector,
+ List<Primitive> arguments,
Continuation continuation,
- List<Primitive> arguments)
+ {SourceInformation sourceInformation})
: this.internal(new Reference<Primitive>(receiver),
selector,
+ _referenceList(arguments),
new Reference<Continuation>(continuation),
- _referenceList(arguments));
+ sourceInformation);
InvokeMethod.internal(this.receiver,
this.selector,
- this.continuation,
this.arguments,
+ this.continuation,
+ this.sourceInformation,
[this.callingConvention = CallingConvention.DART]) {
assert(isValid);
}
@@ -331,17 +336,17 @@
Reference<Primitive> receiver;
final Element target;
final Selector selector;
- final Reference<Continuation> continuation;
final List<Reference<Primitive>> arguments;
+ final Reference<Continuation> continuation;
InvokeMethodDirectly(Primitive receiver,
this.target,
this.selector,
- Continuation cont,
- List<Primitive> args)
+ List<Primitive> args,
+ Continuation cont)
: this.receiver = new Reference<Primitive>(receiver),
- continuation = new Reference<Continuation>(cont),
- arguments = _referenceList(args) {
+ arguments = _referenceList(args),
+ continuation = new Reference<Continuation>(cont) {
assert(selector != null);
assert(selector.kind == SelectorKind.CALL ||
selector.kind == SelectorKind.OPERATOR ||
@@ -359,8 +364,8 @@
class InvokeConstructor extends Expression implements Invoke {
final DartType type;
final FunctionElement target;
- final Reference<Continuation> continuation;
final List<Reference<Primitive>> arguments;
+ final Reference<Continuation> continuation;
final Selector selector;
/// The class being instantiated. This is the same as `target.enclosingClass`
@@ -373,10 +378,10 @@
InvokeConstructor(this.type,
this.target,
this.selector,
- Continuation cont,
- List<Primitive> args)
- : continuation = new Reference<Continuation>(cont),
- arguments = _referenceList(args) {
+ List<Primitive> args,
+ Continuation cont)
+ : arguments = _referenceList(args),
+ continuation = new Reference<Continuation>(cont) {
assert(dart2js.invariant(target,
target.isErroneous ||
type.isDynamic ||
@@ -415,16 +420,51 @@
/// Invoke [toString] on each argument and concatenate the results.
class ConcatenateStrings extends Expression {
- final Reference<Continuation> continuation;
final List<Reference<Primitive>> arguments;
+ final Reference<Continuation> continuation;
- ConcatenateStrings(Continuation cont, List<Primitive> args)
- : continuation = new Reference<Continuation>(cont),
- arguments = _referenceList(args);
+ ConcatenateStrings(List<Primitive> args, Continuation cont)
+ : arguments = _referenceList(args),
+ continuation = new Reference<Continuation>(cont);
accept(Visitor visitor) => visitor.visitConcatenateStrings(this);
}
+/// Throw a value.
+///
+/// Throw is an expression, i.e., it always occurs in tail position with
+/// respect to a body or expression.
+class Throw extends Expression {
+ Reference<Primitive> value;
+
+ Throw(Primitive value) : value = new Reference<Primitive>(value);
+
+ accept(Visitor visitor) => visitor.visitThrow(this);
+}
+
+/// Rethrow
+///
+/// Rethrow can only occur inside a continuation bound by [LetHandler]. It
+/// implicitly throws the exception parameter of the enclosing handler with
+/// the same stack trace as the enclosing handler.
+class Rethrow extends Expression {
+ accept(Visitor visitor) => visitor.visitRethrow(this);
+}
+
+/// A throw occurring in non-tail position.
+///
+/// The CPS translation of an expression produces a primitive as the value
+/// of the expression. For convenience in the implementation of the
+/// translation, a [NonTailThrow] is used as that value. A cleanup pass
+/// removes these and replaces them with [Throw] expressions.
+class NonTailThrow extends Primitive {
+ final Reference<Primitive> value;
+
+ NonTailThrow(Primitive value) : value = new Reference<Primitive>(value);
+
+ accept(Visitor visitor) => visitor.visitNonTailThrow(this);
+}
+
/// Gets the value from a [MutableVariable].
///
/// [MutableVariable]s can be seen as ref cells that are not first-class
@@ -945,6 +985,8 @@
T visitInvokeMethodDirectly(InvokeMethodDirectly node);
T visitInvokeConstructor(InvokeConstructor node);
T visitConcatenateStrings(ConcatenateStrings node);
+ T visitThrow(Throw node);
+ T visitRethrow(Rethrow node);
T visitBranch(Branch node);
T visitTypeOperator(TypeOperator node);
T visitSetMutableVariable(SetMutableVariable node);
@@ -960,6 +1002,7 @@
T visitParameter(Parameter node);
T visitContinuation(Continuation node);
T visitMutableVariable(MutableVariable node);
+ T visitNonTailThrow(NonTailThrow node);
// JavaScript specific nodes.
@@ -1114,6 +1157,17 @@
node.arguments.forEach(processReference);
}
+ processThrow(Throw node) {}
+ visitThrow(Throw node) {
+ processThrow(node);
+ processReference(node.value);
+ }
+
+ processRethrow(Rethrow node) {}
+ visitRethrow(Rethrow node) {
+ processRethrow(node);
+ }
+
processBranch(Branch node) {}
visitBranch(Branch node) {
processBranch(node);
@@ -1163,10 +1217,14 @@
}
processConstant(Constant node) {}
- visitConstant(Constant node) => processConstant(node);
+ visitConstant(Constant node) {
+ processConstant(node);
+ }
processReifyTypeVar(ReifyTypeVar node) {}
- visitReifyTypeVar(ReifyTypeVar node) => processReifyTypeVar(node);
+ visitReifyTypeVar(ReifyTypeVar node) {
+ processReifyTypeVar(node);
+ }
processCreateFunction(CreateFunction node) {}
visitCreateFunction(CreateFunction node) {
@@ -1186,7 +1244,9 @@
}
processParameter(Parameter node) {}
- visitParameter(Parameter node) => processParameter(node);
+ visitParameter(Parameter node) {
+ processParameter(node);
+ }
processContinuation(Continuation node) {}
visitContinuation(Continuation node) {
@@ -1256,9 +1316,14 @@
}
processTypeExpression(TypeExpression node) {}
- @override
visitTypeExpression(TypeExpression node) {
processTypeExpression(node);
node.arguments.forEach(processReference);
}
+
+ processNonTailThrow(NonTailThrow node) {}
+ visitNonTailThrow(NonTailThrow node) {
+ processNonTailThrow(node);
+ processReference(node.value);
+ }
}
diff --git a/pkg/compiler/lib/src/cps_ir/cps_ir_nodes_sexpr.dart b/pkg/compiler/lib/src/cps_ir/cps_ir_nodes_sexpr.dart
index a645fb9..8a99d443 100644
--- a/pkg/compiler/lib/src/cps_ir/cps_ir_nodes_sexpr.dart
+++ b/pkg/compiler/lib/src/cps_ir/cps_ir_nodes_sexpr.dart
@@ -238,7 +238,16 @@
String name = access(node.continuation);
if (node.isRecursive) name = 'rec $name';
String args = node.arguments.map(access).join(' ');
- return '$indentation($InvokeContinuation $name ($args))';
+ return '$indentation(InvokeContinuation $name ($args))';
+ }
+
+ String visitThrow(Throw node) {
+ String value = access(node.value);
+ return '$indentation(Throw $value)';
+ }
+
+ String visitRethrow(Rethrow node) {
+ return '$indentation(Rethrow)';
}
String visitBranch(Branch node) {
@@ -355,11 +364,15 @@
return '(ReadTypeVariable ${access(node.target)}.${node.variable})';
}
- @override
String visitTypeExpression(TypeExpression node) {
String args = node.arguments.map(access).join(', ');
return '(TypeExpression ${node.dartType.toString()} $args)';
}
+
+ String visitNonTailThrow(NonTailThrow node) {
+ String value = access(node.value);
+ return '(NonTailThrow $value)';
+ }
}
class ConstantStringifier extends ConstantValueVisitor<String, Null> {
@@ -374,7 +387,7 @@
}
String visitFunction(FunctionConstantValue constant, _) {
- return _failWith(constant);
+ return '(Function "${constant.unparse()}")';
}
String visitNull(NullConstantValue constant, _) {
@@ -470,7 +483,7 @@
}
String getName(Node node) {
- assert(_names.containsKey(node));
+ if (!_names.containsKey(node)) return 'MISSING_NAME';
return _names[node];
}
}
diff --git a/pkg/compiler/lib/src/cps_ir/cps_ir_tracer.dart b/pkg/compiler/lib/src/cps_ir/cps_ir_tracer.dart
index 92b81e2..ae35ea7 100644
--- a/pkg/compiler/lib/src/cps_ir/cps_ir_tracer.dart
+++ b/pkg/compiler/lib/src/cps_ir/cps_ir_tracer.dart
@@ -204,6 +204,17 @@
printStmt(dummy, "ConcatenateStrings ($args) $kont");
}
+ visitThrow(cps_ir.Throw node) {
+ String dummy = names.name(node);
+ String value = formatReference(node.value);
+ printStmt(dummy, "Throw $value");
+ }
+
+ visitRethrow(cps_ir.Rethrow node) {
+ String dummy = names.name(node);
+ printStmt(dummy, "Rethrow");
+ }
+
visitLiteralList(cps_ir.LiteralList node) {
String dummy = names.name(node);
String values = node.values.map(formatReference).join(', ');
@@ -340,22 +351,24 @@
return 'GetMutableVariable $variable';
}
- @override
visitReadTypeVariable(cps_ir.ReadTypeVariable node) {
return "ReadTypeVariable ${node.variable.element} "
"${formatReference(node.target)}";
}
- @override
visitReifyRuntimeType(cps_ir.ReifyRuntimeType node) {
return "ReifyRuntimeType ${formatReference(node.value)}";
}
- @override
visitTypeExpression(cps_ir.TypeExpression node) {
return "TypeExpression ${node.dartType} "
"${node.arguments.map(formatReference).join(', ')}";
}
+
+ visitNonTailThrow(cps_ir.NonTailThrow node) {
+ String value = formatReference(node.value);
+ return "NonTailThrow($value)";
+ }
}
/**
@@ -507,6 +520,12 @@
addEdgeToContinuation(exp.continuation);
}
+ visitThrow(cps_ir.Throw exp) {
+ }
+
+ visitRethrow(cps_ir.Rethrow exp) {
+ }
+
visitSetMutableVariable(cps_ir.SetMutableVariable exp) {
visit(exp.body);
}
@@ -590,18 +609,19 @@
unexpectedNode(node);
}
- @override
visitReadTypeVariable(cps_ir.ReadTypeVariable node) {
unexpectedNode(node);
}
- @override
visitReifyRuntimeType(cps_ir.ReifyRuntimeType node) {
unexpectedNode(node);
}
- @override
visitTypeExpression(cps_ir.TypeExpression node) {
unexpectedNode(node);
}
+
+ visitNonTailThrow(cps_ir.NonTailThrow node) {
+ unexpectedNode(node);
+ }
}
diff --git a/pkg/compiler/lib/src/cps_ir/optimizers.dart b/pkg/compiler/lib/src/cps_ir/optimizers.dart
index 4db77c8..8fd3f50 100644
--- a/pkg/compiler/lib/src/cps_ir/optimizers.dart
+++ b/pkg/compiler/lib/src/cps_ir/optimizers.dart
@@ -4,26 +4,15 @@
library dart2js.cps_ir.optimizers;
-import '../constants/expressions.dart' show
- ConstantExpression,
- PrimitiveConstantExpression;
-import '../constants/values.dart';
-import '../dart_types.dart' as types;
-import '../dart2jslib.dart' as dart2js;
-import '../tree/tree.dart' show LiteralDartString;
-import '../util/util.dart';
import 'cps_ir_nodes.dart';
-import '../types/types.dart' show TypeMask, TypesTask;
-import '../core_types.dart' show CoreTypes;
-import '../types/constants.dart' show computeTypeMask;
-import '../elements/elements.dart' show ClassElement, Element, Entity,
- FieldElement, FunctionElement, ParameterElement;
-import '../dart2jslib.dart' show ClassWorld;
-part 'type_propagation.dart';
+export 'type_propagation.dart' show TypePropagator, TypeSystem,
+ UnitTypeSystem, TypeMaskSystem;
+
part 'redundant_phi.dart';
part 'shrinking_reductions.dart';
+
/// An optimization pass over the CPS IR.
abstract class Pass {
/// Applies optimizations to root, rewriting it in the process.
diff --git a/pkg/compiler/lib/src/cps_ir/shrinking_reductions.dart b/pkg/compiler/lib/src/cps_ir/shrinking_reductions.dart
index 445838e..edc8121 100644
--- a/pkg/compiler/lib/src/cps_ir/shrinking_reductions.dart
+++ b/pkg/compiler/lib/src/cps_ir/shrinking_reductions.dart
@@ -601,6 +601,10 @@
node.body.parent = node;
}
+ processThrow(Throw node) {
+ node.value.parent = node;
+ }
+
// Definitions.
processLiteralList(LiteralList node) {
diff --git a/pkg/compiler/lib/src/cps_ir/type_propagation.dart b/pkg/compiler/lib/src/cps_ir/type_propagation.dart
index 234df38..f66f370 100644
--- a/pkg/compiler/lib/src/cps_ir/type_propagation.dart
+++ b/pkg/compiler/lib/src/cps_ir/type_propagation.dart
@@ -2,7 +2,22 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-part of dart2js.cps_ir.optimizers;
+import 'optimizers.dart' show Pass, ParentVisitor;
+
+import '../constants/constant_system.dart';
+import '../constants/expressions.dart';
+import '../resolution/operators.dart';
+import '../constants/values.dart';
+import '../dart_types.dart' as types;
+import '../dart2jslib.dart' as dart2js;
+import '../tree/tree.dart' show LiteralDartString;
+import 'cps_ir_nodes.dart';
+import '../types/types.dart' show TypeMask, TypesTask;
+import '../types/constants.dart' show computeTypeMask;
+import '../elements/elements.dart' show ClassElement, Element, Entity,
+ FieldElement, FunctionElement, ParameterElement;
+import '../dart2jslib.dart' show ClassWorld;
+import '../universe/universe.dart';
abstract class TypeSystem<T> {
T get dynamicType;
@@ -15,10 +30,13 @@
T get mapType;
T getReturnType(FunctionElement element);
+ T getSelectorReturnType(Selector selector);
T getParameterType(ParameterElement element);
- bool areAssignable(T a, T b);
T join(T a, T b);
T typeOf(ConstantValue constant);
+
+ /// True if all values satisfying [type] are booleans (null is not a boolean).
+ bool isDefinitelyBool(T type);
}
class UnitTypeSystem implements TypeSystem<String> {
@@ -33,11 +51,13 @@
get stringType => UNIT;
get typeType => UNIT;
- bool areAssignable(a, b) => true;
getParameterType(_) => UNIT;
getReturnType(_) => UNIT;
+ getSelectorReturnType(_) => UNIT;
join(a, b) => UNIT;
typeOf(_) => UNIT;
+
+ bool isDefinitelyBool(_) => false;
}
class TypeMaskSystem implements TypeSystem<TypeMask> {
@@ -66,10 +86,8 @@
return inferrer.getGuaranteedReturnTypeOfElement(function);
}
- @override
- // TODO(karlklose): Do not base this on containsMask.
- bool areAssignable(TypeMask a, TypeMask b) {
- return a.containsMask(b, classWorld) || b.containsMask(a, classWorld);
+ TypeMask getSelectorReturnType(Selector selector) {
+ return inferrer.getGuaranteedTypeOfSelector(selector);
}
@override
@@ -81,6 +99,10 @@
TypeMask typeOf(ConstantValue constant) {
return computeTypeMask(inferrer.compiler, constant);
}
+
+ bool isDefinitelyBool(TypeMask t) {
+ return t.containsOnlyBool(classWorld) && !t.isNullable;
+ }
}
/**
@@ -100,7 +122,7 @@
// The constant system is used for evaluation of expressions with constant
// arguments.
- final dart2js.ConstantSystem _constantSystem;
+ final ConstantSystem _constantSystem;
final TypeSystem _typeSystem;
final dart2js.InternalErrorFunction _internalError;
final Map<Node, _AbstractValue> _types;
@@ -132,8 +154,8 @@
// Transform. Uses the data acquired in the previous analysis phase to
// replace branches with fixed targets and side-effect-free expressions
// with constant results.
- _TransformingVisitor transformer = new _TransformingVisitor(
- analyzer.reachableNodes, analyzer.values, _internalError);
+ _TransformingVisitor<T> transformer = new _TransformingVisitor<T>(
+ analyzer.reachableNodes, analyzer.values, _internalError, _typeSystem);
transformer.transform(root);
}
@@ -144,13 +166,17 @@
* Uses the information from a preceding analysis pass in order to perform the
* actual transformations on the CPS graph.
*/
-class _TransformingVisitor extends RecursiveVisitor {
+class _TransformingVisitor<T> extends RecursiveVisitor {
final Set<Node> reachable;
final Map<Node, _AbstractValue> values;
+ final TypeSystem<T> typeSystem;
final dart2js.InternalErrorFunction internalError;
- _TransformingVisitor(this.reachable, this.values, this.internalError);
+ _TransformingVisitor(this.reachable,
+ this.values,
+ this.internalError,
+ this.typeSystem);
void transform(RootNode root) {
visit(root);
@@ -172,7 +198,7 @@
// Set up the replacement structure.
PrimitiveConstantValue primitiveConstant = value.constant;
ConstantExpression constExp =
- new PrimitiveConstantExpression(primitiveConstant);
+ const ConstantExpressionCreator().convert(primitiveConstant);
Constant constant = new Constant(constExp);
LetPrim letPrim = new LetPrim(constant);
InvokeContinuation invoke =
@@ -285,6 +311,24 @@
visitLetPrim(letPrim);
}
}
+
+ _AbstractValue<T> getValue(Primitive primitive) {
+ _AbstractValue<T> value = values[primitive];
+ return value == null ? new _AbstractValue.nothing() : value;
+ }
+
+ void visitIdentical(Identical node) {
+ Primitive left = node.left.definition;
+ Primitive right = node.right.definition;
+ _AbstractValue<T> leftValue = getValue(left);
+ _AbstractValue<T> rightValue = getValue(right);
+ // Replace identical(x, true) by x when x is known to be a boolean.
+ if (leftValue.isDefinitelyBool(typeSystem) &&
+ rightValue.isConstant &&
+ rightValue.constant.isTrue) {
+ left.substituteFor(node);
+ }
+ }
}
/**
@@ -309,30 +353,22 @@
// since their lattice value has changed.
final Set<Definition> defWorkset = new Set<Definition>();
- final dart2js.ConstantSystem constantSystem;
+ final ConstantSystem constantSystem;
final TypeSystem<T> typeSystem;
final dart2js.InternalErrorFunction internalError;
final types.DartTypes _dartTypes;
- _AbstractValue<T> unknownDynamic;
+ _AbstractValue<T> nothing = new _AbstractValue.nothing();
- _AbstractValue<T> unknown([T t]) {
- if (t == null) {
- return unknownDynamic;
- } else {
- return new _AbstractValue<T>.unknown(t);
- }
- }
-
- _AbstractValue<T> nonConst([T type]) {
+ _AbstractValue<T> nonConstant([T type]) {
if (type == null) {
type = typeSystem.dynamicType;
}
- return new _AbstractValue<T>.nonConst(type);
+ return new _AbstractValue<T>.nonConstant(type);
}
_AbstractValue<T> constantValue(ConstantValue constant, T type) {
- return new _AbstractValue<T>(constant, type);
+ return new _AbstractValue<T>.constantValue(constant, type);
}
// Stores the current lattice value for nodes. Note that it contains not only
@@ -345,9 +381,7 @@
this.values,
this.internalError,
this._dartTypes)
- : this.unknownDynamic =
- new _AbstractValue<T>.unknown(typeSystem.dynamicType),
- this.typeSystem = typeSystem;
+ : this.typeSystem = typeSystem;
void analyze(RootNode root) {
reachableNodes.clear();
@@ -388,12 +422,12 @@
}
}
- /// Returns the lattice value corresponding to [node], defaulting to unknown.
+ /// Returns the lattice value corresponding to [node], defaulting to nothing.
///
/// Never returns null.
_AbstractValue<T> getValue(Node node) {
_AbstractValue<T> value = values[node];
- return (value == null) ? unknown() : value;
+ return (value == null) ? nothing : value;
}
/// Joins the passed lattice [updateValue] to the current value of [node],
@@ -406,7 +440,7 @@
return;
}
- // Values may only move in the direction UNKNOWN -> CONSTANT -> NONCONST.
+ // Values may only move in the direction NOTHING -> CONSTANT -> NONCONST.
assert(newValue.kind >= oldValue.kind);
values[node] = newValue;
@@ -424,7 +458,7 @@
void visitFunctionDefinition(FunctionDefinition node) {
if (node.thisParameter != null) {
- setValue(node.thisParameter, nonConst());
+ setValue(node.thisParameter, nonConstant());
}
node.parameters.forEach(visit);
setReachable(node.body);
@@ -471,7 +505,9 @@
// trace here. The way we do that depends on how we handle 'on T' catch
// clauses.
setReachable(node.handler);
- node.handler.parameters.forEach((Parameter p) => setValue(p, nonConst()));
+ for (Parameter param in node.handler.parameters) {
+ setValue(param, nonConstant());
+ }
}
void visitLetMutable(LetMutable node) {
@@ -489,7 +525,7 @@
T returnType = target is FieldElement
? typeSystem.dynamicType
: typeSystem.getReturnType(node.target);
- setValue(returnValue, nonConst(returnType));
+ setValue(returnValue, nonConstant(returnType));
}
void visitInvokeContinuation(InvokeContinuation node) {
@@ -518,20 +554,14 @@
}
_AbstractValue<T> lhs = getValue(node.receiver.definition);
- if (lhs.isUnknown) {
- // This may seem like a missed opportunity for evaluating short-circuiting
- // boolean operations; we are currently skipping these intentionally since
- // expressions such as `(new Foo() || true)` may introduce type errors
- // and thus evaluation to `true` would not be correct.
- // TODO(jgruber): Handle such cases while ensuring that new Foo() and
- // a type-check (in checked mode) are still executed.
+ if (lhs.isNothing) {
return; // And come back later.
} else if (lhs.isNonConst) {
- setValues(nonConst());
+ setValues(nonConstant(typeSystem.getSelectorReturnType(node.selector)));
return;
} else if (!node.selector.isOperator) {
// TODO(jgruber): Handle known methods on constants such as String.length.
- setValues(nonConst());
+ setValues(nonConstant());
return;
}
@@ -544,7 +574,8 @@
if (opname == "unary-") {
opname = "-";
}
- dart2js.UnaryOperation operation = constantSystem.lookupUnary(opname);
+ UnaryOperation operation = constantSystem.lookupUnary(
+ UnaryOperator.parse(opname));
if (operation != null) {
result = operation.fold(lhs.constant);
}
@@ -553,11 +584,12 @@
_AbstractValue<T> rhs = getValue(node.arguments[0].definition);
if (!rhs.isConstant) {
- setValues(rhs);
+ setValues(nonConstant());
return;
}
- dart2js.BinaryOperation operation = constantSystem.lookupBinary(opname);
+ BinaryOperation operation = constantSystem.lookupBinary(
+ BinaryOperator.parse(opname));
if (operation != null) {
result = operation.fold(lhs.constant, rhs.constant);
}
@@ -566,10 +598,10 @@
// Update value of the continuation parameter. Again, this is effectively
// a phi.
if (result == null) {
- setValues(nonConst());
+ setValues(nonConstant());
} else {
T type = typeSystem.typeOf(result);
- setValues(new _AbstractValue<T>(result, type));
+ setValues(constantValue(result, type));
}
}
@@ -580,7 +612,7 @@
assert(cont.parameters.length == 1);
Parameter returnValue = cont.parameters[0];
// TODO(karlklose): lookup the function and get ites return type.
- setValue(returnValue, nonConst());
+ setValue(returnValue, nonConstant());
}
void visitInvokeConstructor(InvokeConstructor node) {
@@ -589,7 +621,7 @@
assert(cont.parameters.length == 1);
Parameter returnValue = cont.parameters[0];
- setValue(returnValue, nonConst());
+ setValue(returnValue, nonConstant());
}
void visitConcatenateStrings(ConcatenateStrings node) {
@@ -623,31 +655,39 @@
});
LiteralDartString dartString = new LiteralDartString(allStrings.join());
ConstantValue constant = new StringConstantValue(dartString);
- setValues(new _AbstractValue<T>(constant, type));
+ setValues(constantValue(constant, type));
} else {
- setValues(nonConst(type));
+ setValues(nonConstant(type));
}
}
+ void visitThrow(Throw node) {
+ }
+
+ void visitRethrow(Rethrow node) {
+ }
+
+ void visitNonTailThrow(NonTailThrow node) {
+ internalError(null, 'found non-tail throw after they were eliminated');
+ }
+
void visitBranch(Branch node) {
IsTrue isTrue = node.condition;
_AbstractValue<T> conditionCell = getValue(isTrue.value.definition);
- if (conditionCell.isUnknown) {
+ if (conditionCell.isNothing) {
return; // And come back later.
} else if (conditionCell.isNonConst) {
setReachable(node.trueContinuation.definition);
setReachable(node.falseContinuation.definition);
- } else if (conditionCell.isConstant &&
- !(conditionCell.constant.isBool)) {
+ } else if (conditionCell.isConstant && !conditionCell.constant.isBool) {
// Treat non-bool constants in condition as non-const since they result
// in type errors in checked mode.
// TODO(jgruber): Default to false in unchecked mode.
setReachable(node.trueContinuation.definition);
setReachable(node.falseContinuation.definition);
- setValue(isTrue.value.definition, nonConst(typeSystem.boolType));
- } else if (conditionCell.isConstant &&
- conditionCell.constant.isBool) {
+ setValue(isTrue.value.definition, nonConstant(typeSystem.boolType));
+ } else if (conditionCell.isConstant && conditionCell.constant.isBool) {
BoolConstantValue boolConstant = conditionCell.constant;
setReachable((boolConstant.isTrue) ?
node.trueContinuation.definition : node.falseContinuation.definition);
@@ -666,14 +706,14 @@
if (node.isTypeCast) {
// TODO(jgruber): Add support for `as` casts.
- setValues(nonConst());
+ setValues(nonConstant());
}
_AbstractValue<T> cell = getValue(node.receiver.definition);
- if (cell.isUnknown) {
+ if (cell.isNothing) {
return; // And come back later.
} else if (cell.isNonConst) {
- setValues(nonConst(cell.type));
+ setValues(nonConstant(cell.type));
} else if (node.type.kind == types.TypeKind.INTERFACE) {
// Receiver is a constant, perform is-checks at compile-time.
@@ -715,13 +755,13 @@
void visitLiteralList(LiteralList node) {
// Constant lists are translated into (Constant ListConstant(...)) IR nodes,
// and thus LiteralList nodes are NonConst.
- setValue(node, nonConst(typeSystem.listType));
+ setValue(node, nonConstant(typeSystem.listType));
}
void visitLiteralMap(LiteralMap node) {
// Constant maps are translated into (Constant MapConstant(...)) IR nodes,
// and thus LiteralMap nodes are NonConst.
- setValue(node, nonConst(typeSystem.mapType));
+ setValue(node, nonConstant(typeSystem.mapType));
}
void visitConstant(Constant node) {
@@ -730,7 +770,7 @@
}
void visitReifyTypeVar(ReifyTypeVar node) {
- setValue(node, nonConst(typeSystem.typeType));
+ setValue(node, nonConstant(typeSystem.typeType));
}
void visitCreateFunction(CreateFunction node) {
@@ -755,7 +795,7 @@
T type = (source is ParameterElement)
? typeSystem.getParameterType(source)
: typeSystem.dynamicType;
- setValue(node, nonConst(type));
+ setValue(node, nonConstant(type));
} else if (node.parent is LetMutable || node.parent is DeclareFunction) {
// Mutable values bound by LetMutable or DeclareFunction could have
// known values.
@@ -767,11 +807,12 @@
void visitParameter(Parameter node) {
Entity source = node.hint;
// TODO(karlklose): remove reference to the element model.
- T type = (source is ParameterElement) ? typeSystem.getParameterType(source)
+ T type = (source is ParameterElement)
+ ? typeSystem.getParameterType(source)
: typeSystem.dynamicType;
if (node.parent is RootNode) {
// Functions may escape and thus their parameters must be non-constant.
- setValue(node, nonConst(type));
+ setValue(node, nonConstant(type));
} else if (node.parent is Continuation) {
// Continuations on the other hand are local, and parameters can have
// some other abstract value than non-constant.
@@ -802,25 +843,20 @@
_AbstractValue<T> rightConst = getValue(node.right.definition);
ConstantValue leftValue = leftConst.constant;
ConstantValue rightValue = rightConst.constant;
- if (leftConst.isUnknown || rightConst.isUnknown) {
+ if (leftConst.isNothing || rightConst.isNothing) {
// Come back later.
return;
} else if (!leftConst.isConstant || !rightConst.isConstant) {
T leftType = leftConst.type;
T rightType = rightConst.type;
- if (!typeSystem.areAssignable(leftType, rightType)) {
- setValue(node,
- constantValue(new FalseConstantValue(), typeSystem.boolType));
- } else {
- setValue(node, nonConst(typeSystem.boolType));
- }
+ setValue(node, nonConstant(typeSystem.boolType));
} else if (leftValue.isPrimitive && rightValue.isPrimitive) {
assert(leftConst.isConstant && rightConst.isConstant);
PrimitiveConstantValue left = leftValue;
PrimitiveConstantValue right = rightValue;
ConstantValue result =
new BoolConstantValue(left.primitiveValue == right.primitiveValue);
- setValue(node, new _AbstractValue<T>(result, typeSystem.boolType));
+ setValue(node, constantValue(result, typeSystem.boolType));
}
}
@@ -829,7 +865,7 @@
}
void visitGetField(GetField node) {
- setValue(node, nonConst());
+ setValue(node, nonConstant());
}
void visitSetField(SetField node) {
@@ -837,28 +873,28 @@
}
void visitCreateBox(CreateBox node) {
- setValue(node, nonConst());
+ setValue(node, nonConstant());
}
void visitCreateInstance(CreateInstance node) {
- setValue(node, nonConst());
+ setValue(node, nonConstant());
}
void visitReifyRuntimeType(ReifyRuntimeType node) {
- setValue(node, nonConst(typeSystem.typeType));
+ setValue(node, nonConstant(typeSystem.typeType));
}
void visitReadTypeVariable(ReadTypeVariable node) {
// TODO(karlklose): come up with a type marker for JS entities or switch to
// real constants of type [Type].
- setValue(node, nonConst());
+ setValue(node, nonConstant());
}
@override
visitTypeExpression(TypeExpression node) {
// TODO(karlklose): come up with a type marker for JS entities or switch to
// real constants of type [Type].
- setValue(node, nonConst());
+ setValue(node, nonConstant());
}
}
@@ -867,11 +903,12 @@
///
/// The different kinds of abstract values represents the knowledge about the
/// constness of the value:
-/// UNKNOWN: may be some as yet undetermined constant.
-/// CONSTANT: is a constant as stored in the local field.
-/// NONCONST: not a constant.
+/// NOTHING: cannot have any value
+/// CONSTANT: is a constant. The value is stored in the [constant] field,
+/// and the type of the constant is in the [type] field.
+/// NONCONST: not a constant, but [type] may hold some information.
class _AbstractValue<T> {
- static const int UNKNOWN = 0;
+ static const int NOTHING = 0;
static const int CONSTANT = 1;
static const int NONCONST = 2;
@@ -881,35 +918,35 @@
_AbstractValue._internal(this.kind, this.constant, this.type) {
assert(kind != CONSTANT || constant != null);
- assert(type != null);
}
- _AbstractValue(ConstantValue constant, T type)
+ _AbstractValue.nothing()
+ : this._internal(NOTHING, null, null);
+
+ _AbstractValue.constantValue(ConstantValue constant, T type)
: this._internal(CONSTANT, constant, type);
- _AbstractValue.unknown(T type)
- : this._internal(UNKNOWN, null, type);
-
- _AbstractValue.nonConst(T type)
+ _AbstractValue.nonConstant(T type)
: this._internal(NONCONST, null, type);
- bool get isUnknown => (kind == UNKNOWN);
+ bool get isNothing => (kind == NOTHING);
bool get isConstant => (kind == CONSTANT);
bool get isNonConst => (kind == NONCONST);
int get hashCode {
- return kind | (constant.hashCode * 5) | type.hashCode * 7;
+ int hash = kind * 31 + constant.hashCode * 59 + type.hashCode * 67;
+ return hash & 0x3fffffff;
}
bool operator ==(_AbstractValue that) {
- return that.kind == this.kind &&
- that.constant == this.constant &&
- that.type == this.type;
+ return that.kind == this.kind &&
+ that.constant == this.constant &&
+ that.type == this.type;
}
String toString() {
switch (kind) {
- case UNKNOWN: return "Unknown";
+ case NOTHING: return "Nothing";
case CONSTANT: return "Constant: $constant: $type";
case NONCONST: return "Non-constant: $type";
default: assert(false);
@@ -921,15 +958,95 @@
_AbstractValue join(_AbstractValue that, TypeSystem typeSystem) {
assert(that != null);
- if (this.isUnknown) {
+ if (isNothing) {
return that;
- } else if (that.isUnknown) {
+ } else if (that.isNothing) {
return this;
- } else if (this.isConstant && that.isConstant &&
- this.constant == that.constant) {
+ } else if (isConstant && that.isConstant && constant == that.constant) {
return this;
} else {
- return new _AbstractValue.nonConst(typeSystem.join(this.type, that.type));
+ return new _AbstractValue.nonConstant(
+ typeSystem.join(this.type, that.type));
}
}
+
+ /// True if all members of this value are booleans.
+ bool isDefinitelyBool(TypeSystem<T> typeSystem) {
+ if (kind == NOTHING) return true;
+ return typeSystem.isDefinitelyBool(type);
+ }
}
+
+class ConstantExpressionCreator
+ implements ConstantValueVisitor<ConstantExpression, dynamic> {
+
+ const ConstantExpressionCreator();
+
+ ConstantExpression convert(ConstantValue value) => value.accept(this, null);
+
+ @override
+ ConstantExpression visitBool(BoolConstantValue constant, _) {
+ return new BoolConstantExpression(constant.primitiveValue, constant);
+ }
+
+ @override
+ ConstantExpression visitConstructed(ConstructedConstantValue constant, arg) {
+ throw new UnsupportedError("ConstantExpressionCreator.visitConstructed");
+ }
+
+ @override
+ ConstantExpression visitDeferred(DeferredConstantValue constant, arg) {
+ throw new UnsupportedError("ConstantExpressionCreator.visitDeferred");
+ }
+
+ @override
+ ConstantExpression visitDouble(DoubleConstantValue constant, arg) {
+ return new DoubleConstantExpression(constant.primitiveValue, constant);
+ }
+
+ @override
+ ConstantExpression visitDummy(DummyConstantValue constant, arg) {
+ throw new UnsupportedError("ConstantExpressionCreator.visitDummy");
+ }
+
+ @override
+ ConstantExpression visitFunction(FunctionConstantValue constant, arg) {
+ throw new UnsupportedError("ConstantExpressionCreator.visitFunction");
+ }
+
+ @override
+ ConstantExpression visitInt(IntConstantValue constant, arg) {
+ return new IntConstantExpression(constant.primitiveValue, constant);
+ }
+
+ @override
+ ConstantExpression visitInterceptor(InterceptorConstantValue constant, arg) {
+ throw new UnsupportedError("ConstantExpressionCreator.visitInterceptor");
+ }
+
+ @override
+ ConstantExpression visitList(ListConstantValue constant, arg) {
+ throw new UnsupportedError("ConstantExpressionCreator.visitList");
+ }
+
+ @override
+ ConstantExpression visitMap(MapConstantValue constant, arg) {
+ throw new UnsupportedError("ConstantExpressionCreator.visitMap");
+ }
+
+ @override
+ ConstantExpression visitNull(NullConstantValue constant, arg) {
+ return new NullConstantExpression(constant);
+ }
+
+ @override
+ ConstantExpression visitString(StringConstantValue constant, arg) {
+ return new StringConstantExpression(
+ constant.primitiveValue.slowToString(), constant);
+ }
+
+ @override
+ ConstantExpression visitType(TypeConstantValue constant, arg) {
+ throw new UnsupportedError("ConstantExpressionCreator.visitType");
+ }
+}
\ No newline at end of file
diff --git a/pkg/compiler/lib/src/dart2js.dart b/pkg/compiler/lib/src/dart2js.dart
index 6f3d3fa2..5469e39 100644
--- a/pkg/compiler/lib/src/dart2js.dart
+++ b/pkg/compiler/lib/src/dart2js.dart
@@ -296,11 +296,13 @@
diagnosticHandler.showWarnings = false;
passThrough('--suppress-warnings');
}),
+ new OptionHandler('--fatal-warnings', passThrough),
new OptionHandler('--suppress-hints',
(_) => diagnosticHandler.showHints = false),
new OptionHandler(
'--output-type=dart|--output-type=dart-multi|--output-type=js',
setOutputType),
+ new OptionHandler('--use-cps-ir', passThrough),
new OptionHandler('--verbose', setVerbose),
new OptionHandler('--version', (_) => wantVersion = true),
new OptionHandler('--library-root=.+', setLibraryRoot),
@@ -562,6 +564,9 @@
--suppress-warnings
Do not display any warnings.
+ --fatal-warnings
+ Treat warnings as compilation errors.
+
--suppress-hints
Do not display any hints.
@@ -626,6 +631,9 @@
--generate-code-with-compile-time-errors
Generates output even if the program contains compile-time errors. Use the
exit code to determine if compilation failed.
+
+ --use-cps-ir
+ Experimental. Use the new CPS based backend for code generation.
'''.trim());
}
diff --git a/pkg/compiler/lib/src/dart2jslib.dart b/pkg/compiler/lib/src/dart2jslib.dart
index 2491ebc..fc659d3 100644
--- a/pkg/compiler/lib/src/dart2jslib.dart
+++ b/pkg/compiler/lib/src/dart2jslib.dart
@@ -12,6 +12,9 @@
import '../compiler.dart' as api;
import 'cache_strategy.dart';
import 'closure.dart' as closureMapping;
+import 'compile_time_constants.dart';
+import 'constant_system_dart.dart';
+import 'constants/constant_system.dart';
import 'constants/expressions.dart';
import 'constants/values.dart';
import 'core_types.dart';
@@ -33,7 +36,7 @@
DeferredLoaderGetterElementX;
import 'helpers/helpers.dart'; // Included for debug helpers.
import 'io/code_output.dart' show CodeBuffer;
-import 'io/source_information.dart' show SourceInformation;
+import 'io/source_information.dart';
import 'js/js.dart' as js;
import 'js_backend/js_backend.dart' as js_backend;
import 'library_loader.dart'
@@ -74,10 +77,7 @@
CURRENT_ELEMENT_SPANNABLE,
NO_LOCATION_SPANNABLE;
-part 'compile_time_constants.dart';
part 'compiler.dart';
-part 'constant_system.dart';
-part 'constant_system_dart.dart';
part 'diagnostic_listener.dart';
part 'enqueue.dart';
part 'resolved_visitor.dart';
diff --git a/pkg/compiler/lib/src/dart_backend/backend.dart b/pkg/compiler/lib/src/dart_backend/backend.dart
index 409b61f..90ae82e 100644
--- a/pkg/compiler/lib/src/dart_backend/backend.dart
+++ b/pkg/compiler/lib/src/dart_backend/backend.dart
@@ -182,18 +182,18 @@
assert(checkTreeIntegrity(treeRoot));
}
- applyTreePass(new StatementRewriter());
+ applyTreePass(new StatementRewriter(isDartMode: true));
applyTreePass(new VariableMerger());
applyTreePass(new LoopRewriter());
applyTreePass(new LogicalRewriter());
+ applyTreePass(new PullIntoInitializers());
// Backend-specific transformations.
new backend_ast_emitter.UnshadowParameters().unshadow(treeRoot);
context.traceGraph('Unshadow parameters', treeRoot);
TreeElementMapping treeElements = new TreeElementMapping(element);
- backend_ast.RootNode backendAst =
- backend_ast_emitter.emit(treeRoot);
+ backend_ast.RootNode backendAst = backend_ast_emitter.emit(treeRoot);
Node frontend_ast = backend2frontend.emit(treeElements, backendAst);
return new ElementAst(frontend_ast, treeElements);
@@ -521,9 +521,11 @@
});
}
- ConstantExpression compileNode(Node node, TreeElements elements) {
+ ConstantExpression compileNode(Node node, TreeElements elements,
+ {bool enforceConst: true}) {
return measure(() {
- return constantCompiler.compileNodeWithDefinitions(node, elements);
+ return constantCompiler.compileNodeWithDefinitions(node, elements,
+ isConst: enforceConst);
});
}
diff --git a/pkg/compiler/lib/src/dart_backend/backend_ast_emitter.dart b/pkg/compiler/lib/src/dart_backend/backend_ast_emitter.dart
index 4131146..a578d2e 100644
--- a/pkg/compiler/lib/src/dart_backend/backend_ast_emitter.dart
+++ b/pkg/compiler/lib/src/dart_backend/backend_ast_emitter.dart
@@ -142,6 +142,25 @@
return name;
}
+ /// Adds declarations for all variables that are still undeclared.
+ void declareRemainingVariables() {
+ // These variables can be referenced from other variable initializers if
+ // they are set by an assignment expression, so we declare variables before
+ // those with initializers.
+ List<VariableDeclaration> declarations = <VariableDeclaration>[];
+ for (tree.Variable variable in variableNames.keys) {
+ if (!declaredVariables.contains(variable)) {
+ String name = getVariableName(variable);
+ VariableDeclaration decl = new VariableDeclaration(name);
+ decl.element = variable.element;
+ declarations.add(decl);
+ declaredVariables.add(variable);
+ }
+ }
+ // Prepend all variables at once to avoid quadratic blowup.
+ variables.insertAll(0, declarations);
+ }
+
String getConstantName(VariableElement element) {
assert(element.kind == ElementKind.VARIABLE);
if (element.enclosingElement != currentElement) {
@@ -301,11 +320,7 @@
// Some of the variable declarations have already been added
// if their first assignment could be pulled into the initializer.
// Add the remaining variable declarations now.
- for (tree.Variable variable in context.variableNames.keys) {
- if (!context.declaredVariables.contains(variable)) {
- context.addDeclaration(variable);
- }
- }
+ context.declareRemainingVariables();
// Add constant declarations.
List<VariableDeclaration> constants = <VariableDeclaration>[];
@@ -329,18 +344,14 @@
bodyParts.add(new VariableDeclarations(context.variables));
}
bodyParts.addAll(context.statements);
-
body = new Block(bodyParts);
-
}
- FunctionType functionType = context.currentElement.type;
-
return new ConstructorDefinition(
parameters,
body,
initializers,
- context.currentElement.name, definition.element.isConst)
- ..element = context.currentElement;
+ context.currentElement.name,
+ definition.element.isConst)..element = context.currentElement;
}
@override
@@ -370,12 +381,7 @@
// Some of the variable declarations have already been added
// if their first assignment could be pulled into the initializer.
// Add the remaining variable declarations now.
- for (tree.Variable variable in context.variableNames.keys) {
- if (!context.declaredVariables.contains(variable) &&
- !context.handlerVariables.contains(variable)) {
- context.addDeclaration(variable);
- }
- }
+ context.declareRemainingVariables();
// Add constant declarations.
List<VariableDeclaration> constants = <VariableDeclaration>[];
@@ -498,13 +504,28 @@
@override
void visitExpressionStatement(tree.ExpressionStatement stmt,
BuilderContext<Statement> context) {
+ if (stmt.expression is tree.Assign) {
+ emitAssignStatement(stmt.expression, stmt, context);
+ return;
+ }
Expression e = visitExpression(stmt.expression, context);
context.addStatement(new ExpressionStatement(e));
-
visitStatement(stmt.next, context);
}
@override
+ void visitVariableDeclaration(tree.VariableDeclaration node,
+ BuilderContext<Statement> context) {
+ Expression value = visitExpression(node.value, context);
+ String name = context.getVariableName(node.variable);
+ VariableDeclaration decl = new VariableDeclaration(name, value)
+ ..element = node.variable.element;
+ context.declaredVariables.add(node.variable);
+ context.addStatement(new VariableDeclarations([decl]));
+ visitStatement(node.next, context);
+ }
+
+ @override
void visitLabeledStatement(tree.LabeledStatement stmt,
BuilderContext<Statement> context) {
Block block = visitInSubContext(stmt.body, context, fallthrough: stmt.next);
@@ -515,63 +536,48 @@
bool isNullLiteral(Expression exp) => exp is Literal && exp.value.isNull;
- @override
- void visitAssign(tree.Assign stmt,
- BuilderContext<Statement> context) {
+ void emitAssignStatement(tree.Assign assign,
+ tree.Statement statement,
+ BuilderContext<Statement> context) {
// Try to emit a local function declaration. This is useful for functions
// that may occur in expression context, but could not be inlined anywhere.
- if (stmt.variable.element is FunctionElement &&
- stmt.value is tree.FunctionExpression &&
- !context.declaredVariables.contains(stmt.variable) &&
- stmt.variable.writeCount == 1) {
- tree.FunctionExpression functionExp = stmt.value;
+ if (assign.variable.element is FunctionElement &&
+ assign.value is tree.FunctionExpression &&
+ !context.declaredVariables.contains(assign.variable) &&
+ assign.variable.writeCount == 1) {
+ tree.FunctionExpression functionExp = assign.value;
FunctionExpression function =
makeSubFunction(functionExp.definition, context);
FunctionDeclaration decl = new FunctionDeclaration(function);
context.addStatement(decl);
- context.declaredVariables.add(stmt.variable);
+ context.declaredVariables.add(assign.variable);
- visitStatement(stmt.next, context);
+ visitStatement(statement.next, context);
return;
}
- bool isFirstOccurrence = (context.variableNames[stmt.variable] == null);
- bool isDeclaredHere = stmt.variable.host == context.currentElement;
- String name = context.getVariableName(stmt.variable);
- Expression definition = visitExpression(stmt.value, context);
+ Expression definition = visitExpression(assign.value, context);
+ bool isFirstOccurrence = (context.variableNames[assign.variable] == null);
+ bool isDeclaredHere = assign.variable.host == context.currentElement;
+ bool isFirstStatement = context.firstStatement == statement;
// Try to pull into initializer.
- if (context.firstStatement == stmt && isFirstOccurrence && isDeclaredHere) {
+ if (isFirstStatement && isFirstOccurrence && isDeclaredHere) {
if (isNullLiteral(definition)) definition = null;
- context.addDeclaration(stmt.variable, definition);
- context.firstStatement = stmt.next;
- visitStatement(stmt.next, context);
- return;
- }
-
- // Emit a variable declaration if we are required to do so.
- // For captured variables, this ensures that a fresh variable is created.
- if (stmt.isDeclaration) {
- assert(isFirstOccurrence);
- assert(isDeclaredHere);
- if (isNullLiteral(definition)) definition = null;
- VariableDeclaration decl = new VariableDeclaration(name, definition)
- ..element = stmt.variable.element;
- context.declaredVariables.add(stmt.variable);
- context.addStatement(new VariableDeclarations([decl]));
- visitStatement(stmt.next, context);
+ context.addDeclaration(assign.variable, definition);
+ context.firstStatement = statement.next;
+ visitStatement(statement.next, context);
return;
}
context.addStatement(new ExpressionStatement(makeAssignment(
- context.makeVariableAccess(stmt.variable),
+ context.makeVariableAccess(assign.variable),
definition)));
- visitStatement(stmt.next, context);
+ visitStatement(statement.next, context);
}
@override
- void visitReturn(tree.Return stmt,
- BuilderContext<Statement> context) {
+ void visitReturn(tree.Return stmt, BuilderContext<Statement> context) {
if (context.currentElement.isGenerativeConstructor &&
!context.inInitializer) {
assert(() {
@@ -586,8 +592,18 @@
}
@override
- void visitBreak(tree.Break stmt,
- BuilderContext<Statement> context) {
+ void visitThrow(tree.Throw stmt, BuilderContext<Statement> context) {
+ Expression value = visitExpression(stmt.value, context);
+ context.addStatement(new ExpressionStatement(new Throw(value)));
+ }
+
+ @override
+ void visitRethrow(tree.Rethrow stmt, BuilderContext<Statement> context) {
+ context.addStatement(new Rethrow());
+ }
+
+ @override
+ void visitBreak(tree.Break stmt, BuilderContext<Statement> context) {
tree.Statement fall = context.fallthrough;
if (stmt.target.binding.next == fall) {
// Fall through to break target
@@ -653,6 +669,7 @@
VariableDeclaration exceptionParameter =
new VariableDeclaration(context.getVariableName(exceptionVariable));
exceptionParameter.element = exceptionVariable.element;
+ stmt.catchParameters.forEach(context.declaredVariables.add);
if (stmt.catchParameters.length == 2) {
tree.Variable stackTraceVariable = stmt.catchParameters[1];
context.handlerVariables.add(stackTraceVariable);
@@ -878,6 +895,14 @@
return context.makeVariableAccess(exp.variable);
}
+ @override
+ Expression visitAssign(tree.Assign node, BuilderContext<Statement> context) {
+ // This is called only when an assignment occurs in expression context.
+ return makeAssignment(
+ context.makeVariableAccess(node.variable),
+ visitExpression(node.value, context));
+ }
+
FunctionExpression makeSubFunction(tree.FunctionDefinition function,
BuilderContext<Statement> context) {
return visitFunctionDefinition(function,
@@ -904,13 +929,15 @@
}
List<Statement> buildInInitializerContext(tree.Statement root,
- BuilderContext context) {
+ BuilderContext context) {
BuilderContext inner = new BuilderContext<Statement>.initializer(context);
inner.currentElement = context.currentElement;
+ inner.firstStatement = root;
visitStatement(root, inner);
List<Statement> bodyParts;
for (tree.Variable variable in inner.variableNames.keys) {
- if (!context.declaredVariables.contains(variable)) {
+ if (!context.declaredVariables.contains(variable) &&
+ !inner.declaredVariables.contains(variable)) {
inner.addDeclaration(variable);
}
}
@@ -1232,6 +1259,12 @@
}
@override
+ Expression visitIdentical(IdenticalConstantExpression exp,
+ BuilderContext<Statement> context) {
+ return handlePrimitiveConstant(exp.value);
+ }
+
+ @override
Expression visitConditional(ConditionalConstantExpression exp,
BuilderContext<Statement> context) {
if (exp.condition.value.isTrue) {
@@ -1246,6 +1279,12 @@
BuilderContext<Statement> context) {
return handlePrimitiveConstant(exp.value);
}
+
+ @override
+ Expression visitDeferred(DeferredConstantExpression exp,
+ BuilderContext<Statement> context) {
+ return exp.expression.accept(this);
+ }
}
/// Moves function parameters into a separate variable if one of its uses is
@@ -1290,7 +1329,10 @@
param.element);
definition.parameters[i] = newParam;
definition.replaceEachBody((tree.Statement body) {
- return new tree.Assign(param, new tree.VariableUse(newParam), body);
+ return tree.Assign.makeStatement(
+ param,
+ new tree.VariableUse(newParam),
+ body);
});
newParam.writeCount = 1; // Being a parameter counts as a write.
param.writeCount--; // Not a parameter anymore.
diff --git a/pkg/compiler/lib/src/dart_backend/backend_ast_to_frontend_ast.dart b/pkg/compiler/lib/src/dart_backend/backend_ast_to_frontend_ast.dart
index b15a4e2..454ee91 100644
--- a/pkg/compiler/lib/src/dart_backend/backend_ast_to_frontend_ast.dart
+++ b/pkg/compiler/lib/src/dart_backend/backend_ast_to_frontend_ast.dart
@@ -24,7 +24,7 @@
/// it emits. This helps indicate which functions were translated by the new
/// backend.
bool INSERT_NEW_BACKEND_COMMENT =
- const bool.fromEnvironment('USE_NEW_BACKEND', defaultValue: false);
+ const bool.fromEnvironment("INSERT_NEW_BACKEND_COMMENT");
/// Converts backend ASTs to frontend ASTs.
class TreePrinter {
diff --git a/pkg/compiler/lib/src/dart_backend/dart_backend.dart b/pkg/compiler/lib/src/dart_backend/dart_backend.dart
index fbc3437..790daa0 100644
--- a/pkg/compiler/lib/src/dart_backend/dart_backend.dart
+++ b/pkg/compiler/lib/src/dart_backend/dart_backend.dart
@@ -13,6 +13,8 @@
import '../tree/tree.dart';
import '../cps_ir/cps_ir_nodes.dart' as cps_ir;
import '../cps_ir/cps_ir_nodes_sexpr.dart';
+import '../compile_time_constants.dart';
+import '../constants/constant_system.dart';
import '../constants/expressions.dart';
import '../cps_ir/optimizers.dart';
import '../cps_ir/optimizers.dart' as cps_opt;
diff --git a/pkg/compiler/lib/src/dart_backend/placeholder_collector.dart b/pkg/compiler/lib/src/dart_backend/placeholder_collector.dart
index 4d47c14..91ed149 100644
--- a/pkg/compiler/lib/src/dart_backend/placeholder_collector.dart
+++ b/pkg/compiler/lib/src/dart_backend/placeholder_collector.dart
@@ -37,23 +37,63 @@
DeclarationTypePlaceholder(this.typeNode, this.requiresVar);
}
-class SendVisitor extends OldResolvedVisitor {
+class SendVisitor extends Visitor {
+ final TreeElements elements;
final PlaceholderCollector collector;
- SendVisitor(this.collector, TreeElements elements)
- : super(elements);
+ SendVisitor(this.collector, this.elements);
- visitOperatorSend(Send node) {
- }
-
- visitForeignSend(Send node) {}
-
- visitSuperSend(Send node) {
+ visitSend(Send node) {
Element element = elements[node];
- if (element != null && element.isConstructor) {
- collector.tryMakeConstructorPlaceholder(node, element);
+ if (elements.isAssert(node)) {
+ return;
+ } else if (elements.isTypeLiteral(node)) {
+ DartType type = elements.getTypeLiteralType(node);
+ if (!type.isDynamic) {
+ if (type is TypeVariableType) {
+ collector.makeTypeVariablePlaceholder(node.selector, type);
+ } else {
+ collector.makeTypePlaceholder(node.selector, type);
+ }
+ }
+ } else if (node.isSuperCall) {
+ if (element != null && element.isConstructor) {
+ collector.tryMakeConstructorPlaceholder(node, element);
+ } else {
+ collector.tryMakeMemberPlaceholder(node.selector);
+ }
+ } else if (node.isOperator) {
+ return;
+ } else if (node.isPropertyAccess) {
+ if (!Elements.isUnresolved(element) && element.impliesType) {
+ collector.makeElementPlaceholder(node, element);
+ } else {
+ visitGetterSend(node);
+ }
+ } else if (element != null && Initializers.isConstructorRedirect(node)) {
+ visitStaticSend(node);
+ } else if (Elements.isClosureSend(node, element)) {
+ if (element != null) {
+ collector.tryMakeLocalPlaceholder(element, node.selector);
+ }
} else {
- collector.tryMakeMemberPlaceholder(node.selector);
+ if (Elements.isUnresolved(element)) {
+ if (element == null) {
+ // Example: f() with 'f' unbound.
+ // This can only happen inside an instance method.
+ visitDynamicSend(node);
+ } else {
+ visitStaticSend(node);
+ }
+ } else if (element.isInstanceMember) {
+ // Example: f() with 'f' bound to instance method.
+ visitDynamicSend(node);
+ } else if (!element.isInstanceMember) {
+ // Example: A.f() or f() with 'f' bound to a static function.
+ // Also includes new A() or new A.named() which is treated like a
+ // static call to a factory.
+ visitStaticSend(node);
+ }
}
}
@@ -64,13 +104,6 @@
}
}
- visitClosureSend(Send node) {
- final element = elements[node];
- if (element != null) {
- collector.tryMakeLocalPlaceholder(element, node.selector);
- }
- }
-
visitGetterSend(Send node) {
final element = elements[node];
// element == null means dynamic property access.
@@ -100,10 +133,6 @@
}
}
- visitAssertSend(node) {
- visitStaticSend(node);
- }
-
visitStaticSend(Send node) {
Element element = elements[node];
collector.mirrorRenamer.registerStaticSend(
@@ -138,19 +167,8 @@
collector.internalError(reason, node: node);
}
- visitTypePrefixSend(Send node) {
- collector.makeElementPlaceholder(node, elements[node]);
- }
-
- visitTypeLiteralSend(Send node) {
- DartType type = elements.getTypeLiteralType(node);
- if (!type.isDynamic) {
- if (type is TypeVariableType) {
- collector.makeTypeVariablePlaceholder(node.selector, type);
- } else {
- collector.makeTypePlaceholder(node.selector, type);
- }
- }
+ visitNode(Node node) {
+ internalError(node, "Unhandled node");
}
}
diff --git a/pkg/compiler/lib/src/dart_types.dart b/pkg/compiler/lib/src/dart_types.dart
index b9c90fe..18f9fa4 100644
--- a/pkg/compiler/lib/src/dart_types.dart
+++ b/pkg/compiler/lib/src/dart_types.dart
@@ -887,32 +887,62 @@
abstract class DartTypeVisitor<R, A> {
const DartTypeVisitor();
+ R visit(DartType type, A argument) => type.accept(this, argument);
+
+ R visitVoidType(VoidType type, A argument) => null;
+
+ R visitTypeVariableType(TypeVariableType type, A argument) => null;
+
+ R visitFunctionType(FunctionType type, A argument) => null;
+
+ R visitMalformedType(MalformedType type, A argument) => null;
+
+ R visitStatementType(StatementType type, A argument) => null;
+
+ R visitInterfaceType(InterfaceType type, A argument) => null;
+
+ R visitTypedefType(TypedefType type, A argument) => null;
+
+ R visitDynamicType(DynamicType type, A argument) => null;
+}
+
+abstract class BaseDartTypeVisitor<R, A> extends DartTypeVisitor<R, A> {
+ const BaseDartTypeVisitor();
+
R visitType(DartType type, A argument);
+ @override
R visitVoidType(VoidType type, A argument) =>
visitType(type, argument);
+ @override
R visitTypeVariableType(TypeVariableType type, A argument) =>
visitType(type, argument);
+ @override
R visitFunctionType(FunctionType type, A argument) =>
visitType(type, argument);
+ @override
R visitMalformedType(MalformedType type, A argument) =>
visitType(type, argument);
+ @override
R visitStatementType(StatementType type, A argument) =>
visitType(type, argument);
R visitGenericType(GenericType type, A argument) =>
visitType(type, argument);
+ @override
R visitInterfaceType(InterfaceType type, A argument) =>
visitGenericType(type, argument);
+ @override
R visitTypedefType(TypedefType type, A argument) =>
visitGenericType(type, argument);
+ @override
R visitDynamicType(DynamicType type, A argument) =>
visitType(type, argument);
}
@@ -920,7 +950,8 @@
/**
* Abstract visitor for determining relations between types.
*/
-abstract class AbstractTypeRelation extends DartTypeVisitor<bool, DartType> {
+abstract class AbstractTypeRelation
+ extends BaseDartTypeVisitor<bool, DartType> {
final Compiler compiler;
CoreTypes get coreTypes => compiler.coreTypes;
@@ -1661,7 +1692,7 @@
/// visited type by structurally matching it with the argument type. If the
/// constraints are too complex or the two types are too different, `false`
/// is returned. Otherwise, the [constraintMap] holds the valid constraints.
-class MoreSpecificSubtypeVisitor extends DartTypeVisitor<bool, DartType> {
+class MoreSpecificSubtypeVisitor extends BaseDartTypeVisitor<bool, DartType> {
final Compiler compiler;
Map<TypeVariableType, DartType> constraintMap;
@@ -1749,7 +1780,7 @@
/// Visitor used to print type annotation like they used in the source code.
/// The visitor is especially for printing a function type like
/// `(Foo,[Bar])->Baz` as `Baz m(Foo a1, [Bar a2])`.
-class TypeDeclarationFormatter extends DartTypeVisitor<dynamic, String> {
+class TypeDeclarationFormatter extends BaseDartTypeVisitor<dynamic, String> {
Set<String> usedNames;
StringBuffer sb;
@@ -1777,7 +1808,7 @@
return proposal;
}
- void visit(DartType type) {
+ void visit(DartType type, [_]) {
type.accept(this, null);
}
diff --git a/pkg/compiler/lib/src/deferred_load.dart b/pkg/compiler/lib/src/deferred_load.dart
index 00eaf84c..b4ef154 100644
--- a/pkg/compiler/lib/src/deferred_load.dart
+++ b/pkg/compiler/lib/src/deferred_load.dart
@@ -38,6 +38,8 @@
TypedefElement,
VoidElement;
+import 'dart_types.dart';
+
import 'util/util.dart' show
Link, makeUnique;
import 'util/uri_extras.dart' as uri_extras;
@@ -192,7 +194,6 @@
/// Returns the [OutputUnit] where [constant] belongs.
OutputUnit outputUnitForConstant(ConstantValue constant) {
if (!isProgramSplit) return mainOutputUnit;
-
return _constantToOutputUnit[constant];
}
@@ -247,16 +248,6 @@
Set<ConstantValue> constants,
isMirrorUsage) {
- /// Recursively add the constant and its dependencies to [constants].
- void addConstants(ConstantValue constant) {
- if (constants.contains(constant)) return;
- constants.add(constant);
- if (constant is ConstructedConstantValue) {
- elements.add(constant.type.element);
- }
- constant.getDependencies().forEach(addConstants);
- }
-
/// Collects all direct dependencies of [element].
///
/// The collected dependent elements and constants are are added to
@@ -287,7 +278,7 @@
}
treeElements.forEachConstantNode((Node node, _) {
// Explicitly depend on the backend constants.
- addConstants(
+ constants.add(
backend.constants.getConstantForNode(node, treeElements).value);
});
elements.addAll(treeElements.otherDependencies);
@@ -298,9 +289,38 @@
ConstantExpression constant =
backend.constants.getConstantForMetadata(metadata);
if (constant != null) {
- addConstants(constant.value);
+ constants.add(constant.value);
}
}
+
+ collectTypeDependencies(DartType type) {
+ if (type is FunctionType) {
+ for (DartType argumentType in type.parameterTypes) {
+ collectTypeDependencies(argumentType);
+ }
+ for (DartType argumentType in type.optionalParameterTypes) {
+ collectTypeDependencies(argumentType);
+ }
+ for (DartType argumentType in type.namedParameterTypes) {
+ collectTypeDependencies(argumentType);
+ }
+ collectTypeDependencies(type.returnType);
+ } else if (type is TypedefType) {
+ elements.add(type.element);
+ collectTypeDependencies(type.unalias(compiler));
+ } else if (type is InterfaceType) {
+ elements.add(type.element);
+ }
+ }
+
+ if (element is FunctionElement &&
+ compiler.resolverWorld.closurizedMembers.contains(element)) {
+ collectTypeDependencies(element.type);
+ }
+
+ // TODO(sigurdm): Also collect types that are used in is checks and for
+ // checked mode.
+
if (element.isClass) {
// If we see a class, add everything its live instance members refer
// to. Static members are not relevant, unless we are processing
@@ -370,40 +390,70 @@
return result;
}
- /// Recursively traverses the graph of dependencies from [element], mapping
- /// deferred imports to each dependency it needs in the sets
- /// [_importedDeferredBy] and [_constantsDeferredBy].
- void _mapDependencies(Element element, Import import,
- {isMirrorUsage: false}) {
- Set<Element> elements = _importedDeferredBy.putIfAbsent(import,
- () => new Set<Element>());
+ /// Add all dependencies of [constant] to the mapping of [import].
+ void _mapConstantDependencies(ConstantValue constant, Import import) {
Set<ConstantValue> constants = _constantsDeferredBy.putIfAbsent(import,
() => new Set<ConstantValue>());
+ if (constants.contains(constant)) return;
+ constants.add(constant);
+ if (constant is ConstructedConstantValue) {
+ _mapDependencies(element: constant.type.element, import: import);
+ }
+ constant.getDependencies().forEach((ConstantValue dependency) {
+ _mapConstantDependencies(dependency, import);
+ });
+ }
- // Only process elements once, unless we are doing dependencies due to
- // mirrors, which are added in additional traversals.
- if (!isMirrorUsage && elements.contains(element)) return;
- // Anything used directly by main will be loaded from the start
- // We do not need to traverse it again.
- if (import != _fakeMainImport && _mainElements.contains(element)) return;
+ /// Recursively traverses the graph of dependencies from one of [element]
+ /// or [constant], mapping deferred imports to each dependency it needs in the
+ /// sets [_importedDeferredBy] and [_constantsDeferredBy].
+ /// Only one of [element] and [constant] should be given.
+ void _mapDependencies({Element element,
+ Import import,
+ isMirrorUsage: false}) {
- // Here we modify [_importedDeferredBy].
- elements.add(element);
+ Set<Element> elements = _importedDeferredBy.putIfAbsent(import,
+ () => new Set<Element>());
+
Set<Element> dependentElements = new Set<Element>();
+ Set<ConstantValue> dependentConstants = new Set<ConstantValue>();
- // This call can modify [_importedDeferredBy] and [_constantsDeferredBy].
- _collectAllElementsAndConstantsResolvedFrom(
- element, dependentElements, constants, isMirrorUsage);
+ LibraryElement library;
- LibraryElement library = element.library;
+ if (element != null) {
+ // Only process elements once, unless we are doing dependencies due to
+ // mirrors, which are added in additional traversals.
+ if (!isMirrorUsage && elements.contains(element)) return;
+ // Anything used directly by main will be loaded from the start
+ // We do not need to traverse it again.
+ if (import != _fakeMainImport && _mainElements.contains(element)) return;
+ elements.add(element);
+
+
+ // This call can modify [dependentElements] and [dependentConstants].
+ _collectAllElementsAndConstantsResolvedFrom(
+ element, dependentElements, dependentConstants, isMirrorUsage);
+
+ library = element.library;
+ }
+
for (Element dependency in dependentElements) {
if (_isExplicitlyDeferred(dependency, library)) {
for (Import deferredImport in _getImports(dependency, library)) {
- _mapDependencies(dependency, deferredImport);
- };
+ _mapDependencies(element: dependency, import: deferredImport);
+ }
} else {
- _mapDependencies(dependency, import);
+ _mapDependencies(element: dependency, import: import);
+ }
+ }
+
+ for (ConstantValue dependency in dependentConstants) {
+ if (dependency is DeferredConstantValue) {
+ _mapConstantDependencies(dependency,
+ dependency.prefix.deferredImport);
+ } else {
+ _mapConstantDependencies(dependency, import);
}
}
}
@@ -420,7 +470,8 @@
// So we have to filter them out here.
if (element is AnalyzableElementX && !element.hasTreeElements) return;
if (compiler.backend.isAccessibleByReflection(element)) {
- _mapDependencies(element, deferredImport, isMirrorUsage: true);
+ _mapDependencies(element: element, import: deferredImport,
+ isMirrorUsage: true);
}
}
@@ -435,8 +486,8 @@
ConstantExpression constant =
backend.constants.getConstantForMetadata(metadata);
if (constant != null) {
- _mapDependencies(constant.value.getType(compiler.coreTypes).element,
- deferredImport);
+ _mapConstantDependencies(constant.value,
+ deferredImport);
}
}
for (LibraryTag tag in library.tags) {
@@ -444,8 +495,8 @@
ConstantExpression constant =
backend.constants.getConstantForMetadata(metadata);
if (constant != null) {
- _mapDependencies(constant.value.getType(compiler.coreTypes).element,
- deferredImport);
+ _mapConstantDependencies(constant.value,
+ deferredImport);
}
}
}
@@ -482,7 +533,7 @@
metadata.constant.value.getType(compiler.coreTypes).element;
if (element == deferredLibraryClass) {
ConstructedConstantValue constant = metadata.constant.value;
- StringConstantValue s = constant.fields[0];
+ StringConstantValue s = constant.fields.values.single;
result = s.primitiveValue.slowToString();
break;
}
@@ -549,14 +600,14 @@
measureElement(mainLibrary, () {
// Starting from main, traverse the program and find all dependencies.
- _mapDependencies(compiler.mainFunction, _fakeMainImport);
+ _mapDependencies(element: compiler.mainFunction, import: _fakeMainImport);
// Also add "global" dependencies to the main OutputUnit. These are
// things that the backend need but cannot associate with a particular
// element, for example, startRootIsolate. This set also contains
// elements for which we lack precise information.
for (Element element in compiler.globalDependencies.otherDependencies) {
- _mapDependencies(element, _fakeMainImport);
+ _mapDependencies(element: element, import: _fakeMainImport);
}
// Now check to see if we have to add more elements due to mirrors.
@@ -584,6 +635,8 @@
.imports.add(import);
}
}
+ }
+ for (Import import in _constantsDeferredBy.keys) {
for (ConstantValue constant in _constantsDeferredBy[import]) {
// Only one file should be loaded when the program starts, so make
// sure that only one OutputUnit is created for [fakeMainImport].
diff --git a/pkg/compiler/lib/src/dump_info.dart b/pkg/compiler/lib/src/dump_info.dart
index 5792cac..e023461 100644
--- a/pkg/compiler/lib/src/dump_info.dart
+++ b/pkg/compiler/lib/src/dump_info.dart
@@ -80,7 +80,8 @@
}
}
-class ElementToJsonVisitor extends ElementVisitor<Map<String, dynamic>> {
+class ElementToJsonVisitor
+ extends BaseElementVisitor<Map<String, dynamic>, dynamic> {
final GroupedIdMapper mapper = new GroupedIdMapper();
final Compiler compiler;
@@ -96,10 +97,12 @@
dart2jsVersion = compiler.hasBuildId ? compiler.buildId : null;
for (var library in compiler.libraryLoader.libraries.toList()) {
- library.accept(this);
+ visit(library);
}
}
+ Map<String, dynamic> visit(Element e, [_]) => e.accept(this, null);
+
// If keeping the element is in question (like if a function has a size
// of zero), only keep it if it holds dependencies to elsewhere.
bool shouldKeep(Element element) {
@@ -113,7 +116,7 @@
// Memoization of the JSON creating process.
Map<String, dynamic> process(Element element) {
- return jsonCache.putIfAbsent(element, () => element.accept(this));
+ return jsonCache.putIfAbsent(element, () => visit(element));
}
// Returns the id of an [element] if it has already been processed.
@@ -127,15 +130,16 @@
}
}
- Map<String, dynamic> visitElement(Element element) {
+ Map<String, dynamic> visitElement(Element element, _) {
return null;
}
- Map<String, dynamic> visitConstructorBodyElement(ConstructorBodyElement e) {
- return visitFunctionElement(e.constructor);
+ Map<String, dynamic> visitConstructorBodyElement(
+ ConstructorBodyElement e, _) {
+ return visitFunctionElement(e.constructor, _);
}
- Map<String, dynamic> visitLibraryElement(LibraryElement element) {
+ Map<String, dynamic> visitLibraryElement(LibraryElement element, _) {
var id = mapper._library.add(element);
List<String> children = <String>[];
@@ -165,7 +169,7 @@
};
}
- Map<String, dynamic> visitTypedefElement(TypedefElement element) {
+ Map<String, dynamic> visitTypedefElement(TypedefElement element, _) {
String id = mapper._typedef.add(element);
return element.alias == null
? null
@@ -177,7 +181,7 @@
};
}
- Map<String, dynamic> visitFieldElement(FieldElement element) {
+ Map<String, dynamic> visitFieldElement(FieldElement element, _) {
String id = mapper._field.add(element);
List<String> children = [];
StringBuffer emittedCode = compiler.dumpInfoTask.codeOf(element);
@@ -223,7 +227,7 @@
};
}
- Map<String, dynamic> visitClassElement(ClassElement element) {
+ Map<String, dynamic> visitClassElement(ClassElement element, _) {
String id = mapper._class.add(element);
List<String> children = [];
@@ -282,7 +286,7 @@
};
}
- Map<String, dynamic> visitFunctionElement(FunctionElement element) {
+ Map<String, dynamic> visitFunctionElement(FunctionElement element, _) {
String id = mapper._function.add(element);
String name = element.name;
String kind = "function";
@@ -305,9 +309,9 @@
var enclosingElement = element.enclosingElement;
if (enclosingElement.isField ||
- enclosingElement.isFunction ||
- element.isClosure ||
- enclosingElement.isConstructor) {
+ enclosingElement.isFunction ||
+ element.isClosure ||
+ enclosingElement.isConstructor) {
kind = "closure";
name = "<unnamed>";
} else if (modifiers['static']) {
@@ -323,23 +327,25 @@
kind = "constructor";
}
- if (emittedCode != null) {
+ if (element.hasFunctionSignature) {
FunctionSignature signature = element.functionSignature;
- returnType = signature.type.returnType.toString();
signature.forEachParameter((parameter) {
parameters.add({
'name': parameter.name,
- 'type': compiler.typesTask
- .getGuaranteedTypeOfElement(parameter).toString(),
- 'declaredType': parameter.node.type.toString()
+ 'type': '${compiler.typesTask.getGuaranteedTypeOfElement(parameter)}',
+ 'declaredType': '${parameter.node.type}'
});
});
- inferredReturnType = compiler.typesTask
- .getGuaranteedReturnTypeOfElement(element).toString();
- sideEffects = compiler.world.getSideEffectsOfElement(element).toString();
- code = emittedCode.toString();
}
+ if (element.isInstanceMember && !element.isAbstract &&
+ compiler.world.allFunctions.contains(element)) {
+ returnType = '${element.type.returnType}';
+ }
+ inferredReturnType =
+ '${compiler.typesTask.getGuaranteedReturnTypeOfElement(element)}';
+ sideEffects = compiler.world.getSideEffectsOfElement(element).toString();
+
if (element is MemberElement) {
MemberElement member = element as MemberElement;
for (Element closure in member.nestedClosures) {
@@ -376,7 +382,7 @@
'parameters': parameters,
'sideEffects': sideEffects,
'inlinedCount': inlinedCount,
- 'code': code,
+ 'code': emittedCode == null ? null : '$emittedCode',
'type': element.type.toString(),
'outputUnit': mapper._outputUnit.add(outputUnit)
};
@@ -410,7 +416,6 @@
// A mapping from Javascript AST Nodes to the size of their
// pretty-printed contents.
final Map<jsAst.Node, int> _nodeToSize = <jsAst.Node, int>{};
- final Map<jsAst.Node, int> _nodeBeforeSize = <jsAst.Node, int>{};
final Map<Element, int> _fieldNameToSize = <Element, int>{};
final Map<Element, Set<Selector>> selectorsFromElement = {};
@@ -461,29 +466,6 @@
}
}
- /**
- * A callback that can be called before a jsAst [node] is
- * pretty-printed. The size of the code buffer ([aftersize])
- * is also passed.
- */
- void enteringAst(jsAst.Node node, int beforeSize) {
- if (isTracking(node)) {
- _nodeBeforeSize[node] = beforeSize;
- }
- }
-
- /**
- * A callback that can be called after a jsAst [node] is
- * pretty-printed. The size of the code buffer ([aftersize])
- * is also passed.
- */
- void exitingAst(jsAst.Node node, int afterSize) {
- if (isTracking(node)) {
- int diff = afterSize - _nodeBeforeSize[node];
- recordAstSize(node, diff);
- }
- }
-
// Returns true if we care about tracking the size of
// this node.
bool isTracking(jsAst.Node code) {
@@ -507,10 +489,10 @@
// Records the size of a dart AST node after it has been
// pretty-printed into the output buffer.
- void recordAstSize(jsAst.Node code, int size) {
- if (compiler.dumpInfo) {
+ void recordAstSize(jsAst.Node node, int size) {
+ if (isTracking(node)) {
//TODO: should I be incrementing here instead?
- _nodeToSize[code] = size;
+ _nodeToSize[node] = size;
}
}
@@ -575,7 +557,7 @@
void dumpInfoJson(StringSink buffer) {
- JsonEncoder encoder = const JsonEncoder();
+ JsonEncoder encoder = const JsonEncoder.withIndent(' ');
DateTime startToJsonTime = new DateTime.now();
Map<String, List<Map<String, String>>> holding =
diff --git a/pkg/compiler/lib/src/elements/elements.dart b/pkg/compiler/lib/src/elements/elements.dart
index b845ffc..dc86504 100644
--- a/pkg/compiler/lib/src/elements/elements.dart
+++ b/pkg/compiler/lib/src/elements/elements.dart
@@ -422,7 +422,7 @@
/// Returns the [Element] that holds the [TreeElements] for this element.
AnalyzableElement get analyzableElement;
- accept(ElementVisitor visitor);
+ accept(ElementVisitor visitor, arg);
}
class Elements {
@@ -490,6 +490,12 @@
return true;
}
+ static bool hasAccessToTypeVariables(Element element) {
+ Element outer = element.outermostEnclosingMemberOrTopLevel;
+ return (outer != null && outer.isFactoryConstructor) ||
+ !isInStaticContext(element);
+ }
+
static bool isStaticOrTopLevelField(Element element) {
return isStaticOrTopLevel(element)
&& (identical(element.kind, ElementKind.FIELD)
diff --git a/pkg/compiler/lib/src/elements/modelx.dart b/pkg/compiler/lib/src/elements/modelx.dart
index a8cea0a..7d96a64 100644
--- a/pkg/compiler/lib/src/elements/modelx.dart
+++ b/pkg/compiler/lib/src/elements/modelx.dart
@@ -326,7 +326,9 @@
String toString() => '<$name: $message>';
- accept(ElementVisitor visitor) => visitor.visitErroneousElement(this);
+ accept(ElementVisitor visitor, arg) {
+ return visitor.visitErroneousElement(this, arg);
+ }
}
/// A constructor that was synthesized to recover from a compile-time error.
@@ -475,7 +477,9 @@
return unwrapped;
}
- accept(ElementVisitor visitor) => visitor.visitWarnOnUseElement(this);
+ accept(ElementVisitor visitor, arg) {
+ return visitor.visitWarnOnUseElement(this, arg);
+ }
}
abstract class AmbiguousElementX extends ElementX implements AmbiguousElement {
@@ -517,7 +521,9 @@
return set;
}
- accept(ElementVisitor visitor) => visitor.visitAmbiguousElement(this);
+ accept(ElementVisitor visitor, arg) {
+ return visitor.visitAmbiguousElement(this, arg);
+ }
bool get isTopLevel => false;
@@ -725,7 +731,9 @@
Element get analyzableElement => library;
- accept(ElementVisitor visitor) => visitor.visitCompilationUnitElement(this);
+ accept(ElementVisitor visitor, arg) {
+ return visitor.visitCompilationUnitElement(this, arg);
+ }
}
class Importers {
@@ -1104,7 +1112,9 @@
return getLibraryOrScriptName().compareTo(other.getLibraryOrScriptName());
}
- accept(ElementVisitor visitor) => visitor.visitLibraryElement(this);
+ accept(ElementVisitor visitor, arg) {
+ return visitor.visitLibraryElement(this, arg);
+ }
// TODO(johnniwinther): Remove these when issue 18630 is fixed.
LibraryElementX get patch => super.patch;
@@ -1137,7 +1147,9 @@
importScope.addImport(this, element, import, listener);
}
- accept(ElementVisitor visitor) => visitor.visitPrefixElement(this);
+ accept(ElementVisitor visitor, arg) {
+ return visitor.visitPrefixElement(this, arg);
+ }
void markAsDeferred(Import deferredImport) {
_deferredImport = deferredImport;
@@ -1211,7 +1223,9 @@
hasBeenCheckedForCycles = true;
}
- accept(ElementVisitor visitor) => visitor.visitTypedefElement(this);
+ accept(ElementVisitor visitor, arg) {
+ return visitor.visitTypedefElement(this, arg);
+ }
// A typedef cannot be patched therefore defines itself.
AstElement get definingElement => this;
@@ -1348,7 +1362,9 @@
// cases, for example, for function typed parameters.
Token get position => token;
- accept(ElementVisitor visitor) => visitor.visitVariableElement(this);
+ accept(ElementVisitor visitor, arg) {
+ return visitor.visitVariableElement(this, arg);
+ }
DeclarationSite get declarationSite => variables;
}
@@ -1380,7 +1396,9 @@
: super(name.source, ElementKind.FIELD, enclosingElement,
variables, name.token);
- accept(ElementVisitor visitor) => visitor.visitFieldElement(this);
+ accept(ElementVisitor visitor, arg) {
+ return visitor.visitFieldElement(this, arg);
+ }
MemberElement get memberContext => this;
@@ -1451,7 +1469,9 @@
}
// TODO(ahe): Should this throw or do nothing?
- accept(ElementVisitor visitor) => visitor.visitFieldElement(this);
+ accept(ElementVisitor visitor, arg) {
+ return visitor.visitFieldElement(this, arg);
+ }
// TODO(ahe): Should return the context of the error site?
MemberElement get memberContext => this;
@@ -1524,7 +1544,9 @@
FunctionType get functionType => type;
- accept(ElementVisitor visitor) => visitor.visitFormalElement(this);
+ accept(ElementVisitor visitor, arg) {
+ return visitor.visitFormalElement(this, arg);
+ }
// A parameter is defined by the declaration element.
AstElement get definingElement => declaration;
@@ -1557,7 +1579,9 @@
MemberElement get memberContext => executableContext.memberContext;
- accept(ElementVisitor visitor) => visitor.visitParameterElement(this);
+ accept(ElementVisitor visitor, arg) {
+ return visitor.visitParameterElement(this, arg);
+ }
bool get isLocal => true;
}
@@ -1594,7 +1618,9 @@
variables, identifier, initializer,
isOptional: isOptional, isNamed: isNamed);
- accept(ElementVisitor visitor) => visitor.visitFieldParameterElement(this);
+ accept(ElementVisitor visitor, arg) {
+ return visitor.visitFieldParameterElement(this, arg);
+ }
MemberElement get memberContext => enclosingElement;
@@ -1675,7 +1701,9 @@
return isClassMember && !isStatic;
}
- accept(ElementVisitor visitor) => visitor.visitAbstractFieldElement(this);
+ accept(ElementVisitor visitor, arg) {
+ return visitor.visitAbstractFieldElement(this, arg);
+ }
bool get isAbstract {
return getter != null && getter.isAbstract
@@ -1863,7 +1891,9 @@
_hasNoBody;
}
- accept(ElementVisitor visitor) => visitor.visitFunctionElement(this);
+ accept(ElementVisitor visitor, arg) {
+ return visitor.visitFunctionElement(this, arg);
+ }
// A function is defined by the implementation element.
AstElement get definingElement => implementation;
@@ -2038,7 +2068,9 @@
Element get analyzableElement => constructor.analyzableElement;
- accept(ElementVisitor visitor) => visitor.visitConstructorBodyElement(this);
+ accept(ElementVisitor visitor, arg) {
+ return visitor.visitConstructorBodyElement(this, arg);
+ }
MemberElement get memberContext => constructor;
}
@@ -2054,17 +2086,24 @@
final ConstructorElement definingConstructor;
final bool isDefaultConstructor;
- SynthesizedConstructorElementX(String name,
- this.definingConstructor,
- Element enclosing,
- this.isDefaultConstructor)
- : super(name,
+ SynthesizedConstructorElementX.notForDefault(String name,
+ this.definingConstructor,
+ Element enclosing)
+ : isDefaultConstructor = false,
+ super(name,
ElementKind.GENERATIVE_CONSTRUCTOR,
Modifiers.EMPTY,
- enclosing);
+ enclosing) ;
- SynthesizedConstructorElementX.forDefault(superMember, Element enclosing)
- : this('', superMember, enclosing, true);
+ SynthesizedConstructorElementX.forDefault(this.definingConstructor,
+ Element enclosing)
+ : isDefaultConstructor = true,
+ super('',
+ ElementKind.GENERATIVE_CONSTRUCTOR,
+ Modifiers.EMPTY,
+ enclosing) {
+ typeCache = new FunctionType.synthesized(enclosingClass.thisType);
+ }
FunctionExpression parseNode(DiagnosticListener listener) => null;
@@ -2076,11 +2115,21 @@
bool get isSynthesized => true;
+ DartType get type {
+ if (isDefaultConstructor) {
+ return super.type;
+ } else {
+ // TODO(johnniwinther): Ensure that the function type substitutes type
+ // variables correctly.
+ return definingConstructor.type;
+ }
+ }
+
FunctionSignature computeSignature(compiler) {
if (functionSignatureCache != null) return functionSignatureCache;
if (isDefaultConstructor) {
return functionSignatureCache = new FunctionSignatureX(
- type: new FunctionType(this, enclosingClass.thisType));
+ type: type);
}
if (definingConstructor.isErroneous) {
return functionSignatureCache =
@@ -2092,8 +2141,8 @@
definingConstructor.computeSignature(compiler);
}
- accept(ElementVisitor visitor) {
- return visitor.visitFunctionElement(this);
+ accept(ElementVisitor visitor, arg) {
+ return visitor.visitFunctionElement(this, arg);
}
}
@@ -2697,7 +2746,9 @@
Node parseNode(Compiler compiler) => node;
@override
- accept(ElementVisitor visitor) => visitor.visitEnumClassElement(this);
+ accept(ElementVisitor visitor, arg) {
+ return visitor.visitEnumClassElement(this, arg);
+ }
List<DartType> computeTypeParameters(Compiler compiler) => const <DartType>[];
@@ -2857,7 +2908,9 @@
return createTypeVariables(named.typeParameters);
}
- accept(ElementVisitor visitor) => visitor.visitMixinApplicationElement(this);
+ accept(ElementVisitor visitor, arg) {
+ return visitor.visitMixinApplicationElement(this, arg);
+ }
}
class LabelDefinitionX implements LabelDefinition {
@@ -2946,7 +2999,9 @@
Token get position => node.getBeginToken();
- accept(ElementVisitor visitor) => visitor.visitTypeVariableElement(this);
+ accept(ElementVisitor visitor, arg) {
+ return visitor.visitTypeVariableElement(this, arg);
+ }
// A type variable cannot be patched therefore defines itself.
AstElement get definingElement => this;
diff --git a/pkg/compiler/lib/src/elements/visitor.dart b/pkg/compiler/lib/src/elements/visitor.dart
index a1b2745..e3e610a 100644
--- a/pkg/compiler/lib/src/elements/visitor.dart
+++ b/pkg/compiler/lib/src/elements/visitor.dart
@@ -10,35 +10,156 @@
ClosureClassElement,
ClosureFieldElement;
-abstract class ElementVisitor<R> {
- R visit(Element e) => e.accept(this);
+abstract class ElementVisitor<R, A> {
+ const ElementVisitor();
- R visitElement(Element e);
- R visitErroneousElement(ErroneousElement e) => visitFunctionElement(e);
- R visitWarnOnUseElement(WarnOnUseElement e) => visitElement(e);
- R visitAmbiguousElement(AmbiguousElement e) => visitElement(e);
- R visitScopeContainerElement(ScopeContainerElement e) => visitElement(e);
- R visitCompilationUnitElement(CompilationUnitElement e) => visitElement(e);
- R visitLibraryElement(LibraryElement e) => visitScopeContainerElement(e);
- R visitPrefixElement(PrefixElement e) => visitElement(e);
- R visitTypedefElement(TypedefElement e) => visitElement(e);
- R visitVariableElement(VariableElement e) => visitElement(e);
- R visitParameterElement(ParameterElement e) => visitVariableElement(e);
- R visitFormalElement(FormalElement e) => visitElement(e);
- R visitFieldElement(FieldElement e) => visitVariableElement(e);
- R visitFieldParameterElement(InitializingFormalElement e) =>
- visitParameterElement(e);
- R visitAbstractFieldElement(AbstractFieldElement e) => visitElement(e);
- R visitFunctionElement(FunctionElement e) => visitElement(e);
- R visitConstructorBodyElement(ConstructorBodyElement e) => visitElement(e);
- R visitClassElement(ClassElement e) => visitScopeContainerElement(e);
- R visitTypeDeclarationElement(TypeDeclarationElement e) => visitElement(e);
- R visitMixinApplicationElement(MixinApplicationElement e) {
- return visitClassElement(e);
+ R visit(Element e, A arg) => e.accept(this, arg);
+
+ R visitErroneousElement(ErroneousElement e, A arg) => null;
+ R visitWarnOnUseElement(WarnOnUseElement e, A arg) => null;
+ R visitAmbiguousElement(AmbiguousElement e, A arg) => null;
+ R visitCompilationUnitElement(CompilationUnitElement e, A arg) => null;
+ R visitLibraryElement(LibraryElement e, A arg) => null;
+ R visitPrefixElement(PrefixElement e, A arg) => null;
+ R visitTypedefElement(TypedefElement e, A arg) => null;
+ R visitVariableElement(VariableElement e, A arg) => null;
+ R visitParameterElement(ParameterElement e, A arg) => null;
+ R visitFormalElement(FormalElement e, A arg) => null;
+ R visitFieldElement(FieldElement e, A arg) => null;
+ R visitFieldParameterElement(InitializingFormalElement e, A arg) => null;
+ R visitAbstractFieldElement(AbstractFieldElement e, A arg) => null;
+ R visitFunctionElement(FunctionElement e, A arg) => null;
+ R visitConstructorBodyElement(ConstructorBodyElement e, A arg) => null;
+ R visitClassElement(ClassElement e, A arg) => null;
+ R visitMixinApplicationElement(MixinApplicationElement e, A arg) => null;
+ R visitEnumClassElement(EnumClassElement e, A arg) => null;
+ R visitTypeVariableElement(TypeVariableElement e, A arg) => null;
+ R visitBoxFieldElement(BoxFieldElement e, A arg) => null;
+ R visitClosureClassElement(ClosureClassElement e, A arg) => null;
+ R visitClosureFieldElement(ClosureFieldElement e, A arg) => null;
+}
+
+
+abstract class BaseElementVisitor<R, A> extends ElementVisitor<R, A> {
+ const BaseElementVisitor();
+
+ R visitElement(Element e, A arg);
+
+ @override
+ R visitErroneousElement(ErroneousElement e, A arg) {
+ return visitFunctionElement(e, arg);
}
- R visitEnumClassElement(EnumClassElement e) => visitClassElement(e);
- R visitTypeVariableElement(TypeVariableElement e) => visitElement(e);
- R visitBoxFieldElement(BoxFieldElement e) => visitElement(e);
- R visitClosureClassElement(ClosureClassElement e) => visitClassElement(e);
- R visitClosureFieldElement(ClosureFieldElement e) => visitVariableElement(e);
+
+ @override
+ R visitWarnOnUseElement(WarnOnUseElement e, A arg) {
+ return visitElement(e, arg);
+ }
+
+ @override
+ R visitAmbiguousElement(AmbiguousElement e, A arg) {
+ return visitElement(e, arg);
+ }
+
+ R visitScopeContainerElement(ScopeContainerElement e, A arg) {
+ return visitElement(e, arg);
+ }
+
+ @override
+ R visitCompilationUnitElement(CompilationUnitElement e, A arg) {
+ return visitElement(e, arg);
+ }
+
+ @override
+ R visitLibraryElement(LibraryElement e, A arg) {
+ return visitScopeContainerElement(e, arg);
+ }
+
+ @override
+ R visitPrefixElement(PrefixElement e, A arg) {
+ return visitElement(e, arg);
+ }
+
+ @override
+ R visitTypedefElement(TypedefElement e, A arg) {
+ return visitElement(e, arg);
+ }
+
+ @override
+ R visitVariableElement(VariableElement e, A arg) {
+ return visitElement(e, arg);
+ }
+
+ @override
+ R visitParameterElement(ParameterElement e, A arg) {
+ return visitVariableElement(e, arg);
+ }
+
+ @override
+ R visitFormalElement(FormalElement e, A arg) {
+ return visitElement(e, arg);
+ }
+
+ @override
+ R visitFieldElement(FieldElement e, A arg) {
+ return visitVariableElement(e, arg);
+ }
+
+ @override
+ R visitFieldParameterElement(InitializingFormalElement e, A arg) {
+ return visitParameterElement(e, arg);
+ }
+
+ @override
+ R visitAbstractFieldElement(AbstractFieldElement e, A arg) {
+ return visitElement(e, arg);
+ }
+
+ @override
+ R visitFunctionElement(FunctionElement e, A arg) {
+ return visitElement(e, arg);
+ }
+
+ @override
+ R visitConstructorBodyElement(ConstructorBodyElement e, A arg) {
+ return visitElement(e, arg);
+ }
+
+ @override
+ R visitClassElement(ClassElement e, A arg) {
+ return visitScopeContainerElement(e, arg);
+ }
+
+ R visitTypeDeclarationElement(TypeDeclarationElement e, A arg) {
+ return visitElement(e, arg);
+ }
+
+ @override
+ R visitMixinApplicationElement(MixinApplicationElement e, A arg) {
+ return visitClassElement(e, arg);
+ }
+
+ @override
+ R visitEnumClassElement(EnumClassElement e, A arg) {
+ return visitClassElement(e, arg);
+ }
+
+ @override
+ R visitTypeVariableElement(TypeVariableElement e, A arg) {
+ return visitElement(e, arg);
+ }
+
+ @override
+ R visitBoxFieldElement(BoxFieldElement e, A arg) {
+ return visitElement(e, arg);
+ }
+
+ @override
+ R visitClosureClassElement(ClosureClassElement e, A arg) {
+ return visitClassElement(e, arg);
+ }
+
+ @override
+ R visitClosureFieldElement(ClosureFieldElement e, A arg) {
+ return visitVariableElement(e, arg);
+ }
}
\ No newline at end of file
diff --git a/pkg/compiler/lib/src/enqueue.dart b/pkg/compiler/lib/src/enqueue.dart
index adc2363..da3afed 100644
--- a/pkg/compiler/lib/src/enqueue.dart
+++ b/pkg/compiler/lib/src/enqueue.dart
@@ -783,6 +783,10 @@
nativeEnqueuer.registerJsEmbeddedGlobalCall(node, resolver);
}
+ void registerJsBuiltinCall(Send node, ResolverVisitor resolver) {
+ nativeEnqueuer.registerJsBuiltinCall(node, resolver);
+ }
+
void _logSpecificSummary(log(message)) {
log('Resolved ${resolvedElements.length} elements.');
}
diff --git a/pkg/compiler/lib/src/inferrer/concrete_types_inferrer.dart b/pkg/compiler/lib/src/inferrer/concrete_types_inferrer.dart
index 5247fe3..c742d51 100644
--- a/pkg/compiler/lib/src/inferrer/concrete_types_inferrer.dart
+++ b/pkg/compiler/lib/src/inferrer/concrete_types_inferrer.dart
@@ -2368,20 +2368,17 @@
}
/**
- * Same as super.visitGetterSend except it records the type of nodes in test
+ * Same as super.handleLocalGet except it records the type of nodes in test
* mode.
*/
@override
- ConcreteType visitGetterSend(Send node) {
+ ConcreteType handleLocalGet(Send node, LocalElement local) {
if (inferrer.testMode) {
- var element = elements[node];
- if (element is Local) {
- ConcreteType type = locals.use(element);
- if (type != null) {
- inferrer.augmentInferredType(node, type);
- }
+ ConcreteType type = locals.use(local);
+ if (type != null) {
+ inferrer.augmentInferredType(node, type);
}
}
- return super.visitGetterSend(node);
+ return super.handleLocalGet(node, local);
}
}
diff --git a/pkg/compiler/lib/src/inferrer/inferrer_visitor.dart b/pkg/compiler/lib/src/inferrer/inferrer_visitor.dart
index 889827e..fa961f2 100644
--- a/pkg/compiler/lib/src/inferrer/inferrer_visitor.dart
+++ b/pkg/compiler/lib/src/inferrer/inferrer_visitor.dart
@@ -4,9 +4,12 @@
library inferrer_visitor;
+import '../constants/constant_system.dart';
+import '../constants/expressions.dart';
import '../dart2jslib.dart' hide Selector, TypedSelector;
import '../dart_types.dart';
import '../elements/elements.dart';
+import '../resolution/operators.dart';
import '../tree/tree.dart';
import '../universe/universe.dart';
import '../util/util.dart';
@@ -703,17 +706,9 @@
locals = new LocalsHandler<T>(inferrer, types, compiler, node, fieldScope);
}
- T visitSendSet(SendSet node);
+ T handleSendSet(SendSet node);
- T visitSuperSend(Send node);
-
- T visitStaticSend(Send node);
-
- T visitGetterSend(Send node);
-
- T visitClosureSend(Send node);
-
- T visitDynamicSend(Send node);
+ T handleDynamicInvoke(Send node);
T visitAsyncForIn(AsyncForIn node);
@@ -723,23 +718,21 @@
T visitFunctionExpression(FunctionExpression node);
- T visitAssertSend(Send node) {
+ @override
+ T visitAssert(Send node, Node expression, _) {
if (!compiler.enableUserAssertions) {
return types.nullType;
}
- // TODO(johnniwinther): Don't handle assert like a regular static call since
- // it break the selector name check.
- return visitStaticSend(node);
+ return handleAssert(node, expression);
}
+ /// Handle an enabled assertion of [expression].
+ T handleAssert(Send node, Node expression);
+
T visitNode(Node node) {
return node.visitChildren(this);
}
- T visitNewExpression(NewExpression node) {
- return node.send.accept(this);
- }
-
T visit(Node node) {
return node == null ? null : node.accept(this);
}
@@ -809,10 +802,78 @@
return types.dynamicType;
}
- T visitTypeLiteralSend(Send node) {
+ T handleTypeLiteralGet() {
return types.typeType;
}
+ T handleTypeLiteralInvoke(NodeList arguments) {
+ return types.dynamicType;
+ }
+
+ T visitClassTypeLiteralGet(
+ Send node,
+ ConstantExpression constant,
+ _) {
+ return handleTypeLiteralGet();
+ }
+
+ T visitClassTypeLiteralInvoke(
+ Send node,
+ ConstantExpression constant,
+ NodeList arguments,
+ CallStructure callStructure,
+ _) {
+ return handleTypeLiteralInvoke(arguments);
+ }
+
+ T visitTypedefTypeLiteralGet(
+ Send node,
+ ConstantExpression constant,
+ _) {
+ return handleTypeLiteralGet();
+ }
+
+ T visitTypedefTypeLiteralInvoke(
+ Send node,
+ ConstantExpression constant,
+ NodeList arguments,
+ CallStructure callStructure,
+ _) {
+ return handleTypeLiteralInvoke(arguments);
+ }
+
+ T visitTypeVariableTypeLiteralGet(
+ Send node,
+ TypeVariableElement element,
+ _) {
+ return handleTypeLiteralGet();
+ }
+
+ T visitTypeVariableTypeLiteralInvoke(
+ Send node,
+ TypeVariableElement element,
+ NodeList arguments,
+ CallStructure callStructure,
+ _) {
+ return handleTypeLiteralInvoke(arguments);
+ }
+
+ T visitDynamicTypeLiteralGet(
+ Send node,
+ ConstantExpression constant,
+ _) {
+ return handleTypeLiteralGet();
+ }
+
+ T visitDynamicTypeLiteralInvoke(
+ Send node,
+ ConstantExpression constant,
+ NodeList arguments,
+ CallStructure callStructure,
+ _) {
+ return handleTypeLiteralInvoke(arguments);
+ }
+
bool isThisOrSuper(Node node) => node.isThis() || node.isSuper();
Element get outermostElement {
@@ -911,87 +972,133 @@
}
}
- T visitOperatorSend(Send node) {
- Operator op = node.selector;
- if ("[]" == op.source) {
- return visitDynamicSend(node);
- } else if ("&&" == op.source) {
- conditionIsSimple = false;
- bool oldAccumulateIsChecks = accumulateIsChecks;
- List<Send> oldIsChecks = isChecks;
- if (!accumulateIsChecks) {
- accumulateIsChecks = true;
- isChecks = <Send>[];
- }
- visit(node.receiver);
- LocalsHandler<T> saved = locals;
- locals = new LocalsHandler<T>.from(locals, node);
- updateIsChecks(isChecks, usePositive: true);
- LocalsHandler<T> narrowed;
- if (oldAccumulateIsChecks) {
- narrowed = new LocalsHandler<T>.topLevelCopyOf(locals);
- } else {
- accumulateIsChecks = false;
- isChecks = oldIsChecks;
- }
- visit(node.arguments.head);
- if (oldAccumulateIsChecks) {
+ @override
+ T visitIndex(Send node, Node receiver, Node index, _) {
+ return handleDynamicInvoke(node);
+ }
- bool invalidatedInRightHandSide (Send test) {
- Element receiver = elements[test.receiver];
- if (receiver is LocalElement) {
- return narrowed.locals[receiver] != locals.locals[receiver];
- }
- return false;
- }
+ @override
+ T visitDynamicPropertyInvoke(
+ Send node,
+ Node receiver,
+ NodeList arguments,
+ Selector selector,
+ _) {
+ return handleDynamicInvoke(node);
+ }
- isChecks.removeWhere(invalidatedInRightHandSide);
- }
- saved.mergeDiamondFlow(locals, null);
- locals = saved;
- return types.boolType;
- } else if ("||" == op.source) {
- conditionIsSimple = false;
- List<Send> tests = <Send>[];
- bool isSimple = handleCondition(node.receiver, tests);
- LocalsHandler<T> saved = locals;
- locals = new LocalsHandler<T>.from(locals, node);
- if (isSimple) updateIsChecks(tests, usePositive: false);
- bool oldAccumulateIsChecks = accumulateIsChecks;
- accumulateIsChecks = false;
- visit(node.arguments.head);
- accumulateIsChecks = oldAccumulateIsChecks;
- saved.mergeDiamondFlow(locals, null);
- locals = saved;
- return types.boolType;
- } else if ("!" == op.source) {
- bool oldAccumulateIsChecks = accumulateIsChecks;
- accumulateIsChecks = false;
- node.visitChildren(this);
- accumulateIsChecks = oldAccumulateIsChecks;
- return types.boolType;
- } else if ("is" == op.source) {
- potentiallyAddIsCheck(node);
- node.visitChildren(this);
- return types.boolType;
- } else if ("as" == op.source) {
- T receiverType = visit(node.receiver);
- DartType type = elements.getType(node.arguments.head);
- return types.narrowType(receiverType, type);
- } else if (node.argumentsNode is Prefix) {
- // Unary operator.
- return visitDynamicSend(node);
- } else if ('===' == op.source
- || '!==' == op.source) {
- node.visitChildren(this);
- return types.boolType;
- } else if ('!=' == op.source) {
- visitDynamicSend(node);
- return types.boolType;
- } else {
- // Binary operator.
- return visitDynamicSend(node);
+ @override
+ T visitThisPropertyInvoke(
+ Send node,
+ NodeList arguments,
+ Selector selector,
+ _) {
+ return handleDynamicInvoke(node);
+ }
+
+ @override
+ T visitLogicalAnd(Send node, Node left, Node right, _) {
+ conditionIsSimple = false;
+ bool oldAccumulateIsChecks = accumulateIsChecks;
+ List<Send> oldIsChecks = isChecks;
+ if (!accumulateIsChecks) {
+ accumulateIsChecks = true;
+ isChecks = <Send>[];
}
+ visit(left);
+ LocalsHandler<T> saved = locals;
+ locals = new LocalsHandler<T>.from(locals, node);
+ updateIsChecks(isChecks, usePositive: true);
+ LocalsHandler<T> narrowed;
+ if (oldAccumulateIsChecks) {
+ narrowed = new LocalsHandler<T>.topLevelCopyOf(locals);
+ } else {
+ accumulateIsChecks = false;
+ isChecks = oldIsChecks;
+ }
+ visit(right);
+ if (oldAccumulateIsChecks) {
+
+ bool invalidatedInRightHandSide (Send test) {
+ Element receiver = elements[test.receiver];
+ if (receiver is LocalElement) {
+ return narrowed.locals[receiver] != locals.locals[receiver];
+ }
+ return false;
+ }
+
+ isChecks.removeWhere(invalidatedInRightHandSide);
+ }
+ saved.mergeDiamondFlow(locals, null);
+ locals = saved;
+ return types.boolType;
+ }
+
+ @override
+ T visitLogicalOr(Send node, Node left, Node right, _) {
+ conditionIsSimple = false;
+ List<Send> tests = <Send>[];
+ bool isSimple = handleCondition(left, tests);
+ LocalsHandler<T> saved = locals;
+ locals = new LocalsHandler<T>.from(locals, node);
+ if (isSimple) updateIsChecks(tests, usePositive: false);
+ bool oldAccumulateIsChecks = accumulateIsChecks;
+ accumulateIsChecks = false;
+ visit(right);
+ accumulateIsChecks = oldAccumulateIsChecks;
+ saved.mergeDiamondFlow(locals, null);
+ locals = saved;
+ return types.boolType;
+ }
+
+ @override
+ T visitNot(Send node, Node expression, _) {
+ bool oldAccumulateIsChecks = accumulateIsChecks;
+ accumulateIsChecks = false;
+ visit(expression);
+ accumulateIsChecks = oldAccumulateIsChecks;
+ return types.boolType;
+ }
+
+ @override
+ T visitIs(Send node, Node expression, DartType type, _) {
+ potentiallyAddIsCheck(node);
+ visit(expression);
+ return types.boolType;
+ }
+
+ @override
+ T visitIsNot(Send node, Node expression, DartType type, _) {
+ potentiallyAddIsCheck(node);
+ visit(expression);
+ return types.boolType;
+ }
+
+ @override
+ T visitAs(Send node, Node expression, DartType type, _) {
+ T receiverType = visit(expression);
+ return types.narrowType(receiverType, type);
+ }
+
+ @override
+ T visitUnary(Send node, UnaryOperator operator, Node expression, _) {
+ return handleDynamicInvoke(node);
+ }
+
+ @override
+ T visitNotEquals(Send node, Node left, Node right, _) {
+ handleDynamicInvoke(node);
+ return types.boolType;
+ }
+
+ @override
+ T visitEquals(Send node, Node left, Node right, _) {
+ return handleDynamicInvoke(node);
+ }
+
+ @override
+ T visitBinary(Send node, Node left, BinaryOperator operator, Node right, _) {
+ return handleDynamicInvoke(node);
}
// Because some nodes just visit their children, we may end up
@@ -1233,7 +1340,7 @@
return null;
}
- void internalError(Spannable node, String reason) {
+ internalError(Spannable node, String reason) {
compiler.internalError(node, reason);
}
diff --git a/pkg/compiler/lib/src/inferrer/simple_types_inferrer.dart b/pkg/compiler/lib/src/inferrer/simple_types_inferrer.dart
index d58c45d..e3bdac5 100644
--- a/pkg/compiler/lib/src/inferrer/simple_types_inferrer.dart
+++ b/pkg/compiler/lib/src/inferrer/simple_types_inferrer.dart
@@ -5,24 +5,26 @@
library simple_types_inferrer;
import '../closure.dart' show ClosureClassMap, ClosureScope;
+import '../cps_ir/cps_ir_nodes.dart' as cps_ir show Node;
import '../dart_types.dart'
show DartType, InterfaceType, FunctionType, TypeKind;
import '../elements/elements.dart';
import '../js_backend/js_backend.dart' as js;
import '../native/native.dart' as native;
+import '../resolution/operators.dart' as op;
import '../tree/tree.dart' as ast;
-import '../cps_ir/cps_ir_nodes.dart' as cps_ir show Node;
-import '../util/util.dart' show Link, Spannable, Setlet;
import '../types/types.dart'
show TypesInferrer, FlatTypeMask, TypeMask, ContainerTypeMask,
ElementTypeMask, ValueTypeMask, TypeSystem, MinimalInferrerEngine;
+import '../util/util.dart' show Link, Spannable, Setlet;
import 'inferrer_visitor.dart';
// BUG(8802): There's a bug in the analyzer that makes the re-export
// of Selector from dart2jslib.dart fail. For now, we work around that
// by importing universe.dart explicitly and disabling the re-export.
import '../dart2jslib.dart' hide Selector, TypedSelector;
-import '../universe/universe.dart' show Selector, SideEffects, TypedSelector;
+import '../universe/universe.dart'
+ show Selector, SideEffects, TypedSelector, CallStructure;
/**
* An implementation of [TypeSystem] for [TypeMask].
@@ -773,7 +775,8 @@
|| (element != null && element.isInstanceMember);
}
- T visitSendSet(ast.SendSet node) {
+ @override
+ T handleSendSet(ast.SendSet node) {
Element element = elements[node];
if (!Elements.isUnresolved(element) && element.impliesType) {
node.visitChildren(this);
@@ -966,33 +969,219 @@
return rhsType;
}
- T visitSuperSend(ast.Send node) {
- Element element = elements[node];
+ /// Handle a super access or invocation that results in a `noSuchMethod` call.
+ T handleErroneousSuperSend(ast.Send node) {
ArgumentsTypes arguments = node.isPropertyAccess
? null
: analyzeArguments(node.arguments);
- if (visitingInitializers) {
- seenSuperConstructorCall = true;
- analyzeSuperConstructorCall(element, arguments);
- }
Selector selector = elements.getSelector(node);
- // TODO(ngeoffray): We could do better here if we knew what we
+ // TODO(herhut): We could do better here if we knew what we
// are calling does not expose this.
isThisExposed = true;
- if (Elements.isUnresolved(element)
- || !selector.applies(element, compiler.world)) {
- // Ensure we create a node, to make explicit the call to the
- // `noSuchMethod` handler.
- return handleDynamicSend(node, selector, superType, arguments);
- } else if (node.isPropertyAccess
- || element.isFunction
- || element.isGenerativeConstructor) {
- return handleStaticSend(node, selector, element, arguments);
- } else {
- return inferrer.registerCalledClosure(
- node, selector, inferrer.typeOfElement(element),
- outermostElement, arguments, sideEffects, inLoop);
- }
+ // Ensure we create a node, to make explicit the call to the
+ // `noSuchMethod` handler.
+ return handleDynamicSend(node, selector, superType, arguments);
+ }
+
+ /// Handle a .call invocation on the values retrieved from the super
+ /// [element]. For instance `super.foo(bar)` where `foo` is a field or getter.
+ T handleSuperClosureCall(
+ ast.Send node,
+ Element element,
+ ast.NodeList arguments) {
+ ArgumentsTypes argumentTypes = analyzeArguments(arguments.nodes);
+ Selector selector = elements.getSelector(node);
+ // TODO(herhut): We could do better here if we knew what we
+ // are calling does not expose this.
+ isThisExposed = true;
+ return inferrer.registerCalledClosure(
+ node, selector, inferrer.typeOfElement(element),
+ outermostElement, argumentTypes, sideEffects, inLoop);
+ }
+
+ /// Handle an invocation of super [method].
+ T handleSuperMethodInvoke(ast.Send node,
+ MethodElement method,
+ ArgumentsTypes arguments) {
+ // TODO(herhut): We could do better here if we knew what we
+ // are calling does not expose this.
+ isThisExposed = true;
+ return handleStaticSend(
+ node, elements.getSelector(node), method, arguments);
+ }
+
+ /// Handle access to a super field or getter [element].
+ T handleSuperGet(ast.Send node,
+ Element element) {
+ // TODO(herhut): We could do better here if we knew what we
+ // are calling does not expose this.
+ isThisExposed = true;
+ return handleStaticSend(
+ node, elements.getSelector(node), element, null);
+ }
+
+ /// Handle super constructor invocation.
+ @override
+ T handleSuperConstructorInvoke(ast.Send node) {
+ Element element = elements[node];
+ ArgumentsTypes arguments = analyzeArguments(node.arguments);
+ assert(visitingInitializers);
+ seenSuperConstructorCall = true;
+ analyzeSuperConstructorCall(element, arguments);
+ return handleStaticSend(
+ node, elements.getSelector(node), element, arguments);
+ }
+
+ @override
+ T visitUnresolvedSuperIndex(
+ ast.Send node,
+ Element element,
+ ast.Node index,
+ _) {
+ return handleErroneousSuperSend(node);
+ }
+
+ @override
+ T visitUnresolvedSuperUnary(
+ ast.Send node,
+ op.UnaryOperator operator,
+ Element element,
+ _) {
+ return handleErroneousSuperSend(node);
+ }
+
+ @override
+ T visitUnresolvedSuperBinary(
+ ast.Send node,
+ Element element,
+ op.BinaryOperator operator,
+ ast.Node argument,
+ _) {
+ return handleErroneousSuperSend(node);
+ }
+
+ @override
+ T visitUnresolvedSuperGet(
+ ast.Send node,
+ Element element,
+ _) {
+ return handleErroneousSuperSend(node);
+ }
+
+ @override
+ T visitUnresolvedSuperInvoke(
+ ast.Send node,
+ Element element,
+ ast.Node argument,
+ Selector selector,
+ _) {
+ return handleErroneousSuperSend(node);
+ }
+
+ @override
+ T visitSuperFieldGet(
+ ast.Send node,
+ FieldElement field,
+ _) {
+ return handleSuperGet(node, field);
+ }
+
+ @override
+ T visitSuperGetterGet(
+ ast.Send node,
+ MethodElement method,
+ _) {
+ return handleSuperGet(node, method);
+ }
+
+ @override
+ T visitSuperMethodGet(
+ ast.Send node,
+ MethodElement method,
+ _) {
+ return handleSuperGet(node, method);
+ }
+
+ @override
+ T visitSuperFieldInvoke(
+ ast.Send node,
+ FieldElement field,
+ ast.NodeList arguments,
+ CallStructure callStructure,
+ _) {
+ return handleSuperClosureCall(node, field, arguments);
+ }
+
+ @override
+ T visitSuperGetterInvoke(
+ ast.Send node,
+ MethodElement getter,
+ ast.NodeList arguments,
+ CallStructure callStructure,
+ _) {
+ return handleSuperClosureCall(node, getter, arguments);
+ }
+
+ @override
+ T visitSuperMethodInvoke(
+ ast.Send node,
+ MethodElement method,
+ ast.NodeList arguments,
+ CallStructure callStructure,
+ _) {
+ return handleSuperMethodInvoke(
+ node, method, analyzeArguments(arguments.nodes));
+ }
+
+ @override
+ T visitSuperIndex(
+ ast.Send node,
+ MethodElement method,
+ ast.Node index,
+ _) {
+ return handleSuperMethodInvoke(
+ node, method, analyzeArguments(node.arguments));
+ }
+
+ @override
+ T visitSuperEquals(
+ ast.Send node,
+ MethodElement method,
+ ast.Node argument,
+ _) {
+ return handleSuperMethodInvoke(
+ node, method, analyzeArguments(node.arguments));
+ }
+
+ @override
+ T visitSuperBinary(
+ ast.Send node,
+ MethodElement method,
+ op.BinaryOperator operator,
+ ast.Node argument,
+ _) {
+ return handleSuperMethodInvoke(
+ node, method, analyzeArguments(node.arguments));
+ }
+
+ @override
+ T visitSuperUnary(
+ ast.Send node,
+ op.UnaryOperator operator,
+ MethodElement method,
+ _) {
+ return handleSuperMethodInvoke(
+ node, method, analyzeArguments(node.arguments));
+ }
+
+ @override
+ T visitSuperMethodIncompatibleInvoke(
+ ast.Send node,
+ MethodElement method,
+ ast.NodeList arguments,
+ CallStructure callStructure,
+ _) {
+ return handleErroneousSuperSend(node);
}
// Try to find the length given to a fixed array constructor call.
@@ -1020,12 +1209,34 @@
return inferrer.registerAwait(node, futureType);
}
+ @override
+ T handleAssert(ast.Send node, ast.Node expression) {
+ js.JavaScriptBackend backend = compiler.backend;
+ Element element = backend.assertMethod;
+ ArgumentsTypes<T> arguments =
+ new ArgumentsTypes<T>(<T>[expression.accept(this)], null);
+ return handleStaticSend(
+ node, new Selector.fromElement(element), element, arguments);
+ }
+
+ @override
+ T handleTypeLiteralInvoke(ast.NodeList arguments) {
+ // This is reached when users forget to put a `new` in front of a type
+ // literal. The emitter will generate an actual call (even though it is
+ // likely invalid), and for that it needs to have the arguments processed
+ // as well.
+ analyzeArguments(arguments.nodes);
+ return super.handleTypeLiteralInvoke(arguments);
+ }
+
T visitStaticSend(ast.Send node) {
+ assert(!elements.isAssert(node));
Element element = elements[node];
- if (elements.isAssert(node)) {
- js.JavaScriptBackend backend = compiler.backend;
- element = backend.assertMethod;
- }
+ return handleConstructorSend(node, element);
+ }
+
+ /// Handle constructor invocation of [element].
+ T handleConstructorSend(ast.Send node, ConstructorElement element) {
ArgumentsTypes arguments = analyzeArguments(node.arguments);
if (visitingInitializers) {
if (ast.Initializers.isConstructorRedirect(node)) {
@@ -1048,13 +1259,15 @@
}
}
if (element.isForeign(compiler.backend)) {
- return handleForeignSend(node);
+ return handleForeignSend(node, element);
}
Selector selector = elements.getSelector(node);
// In erroneous code the number of arguments in the selector might not
// match the function element.
// TODO(polux): return nonNullEmpty and check it doesn't break anything
- if (!selector.applies(element, compiler.world)) return types.dynamicType;
+ if (!selector.applies(element, compiler.world)) {
+ return types.dynamicType;
+ }
T returnType = handleStaticSend(node, selector, element, arguments);
if (Elements.isGrowableListConstructorCall(element, node, compiler)) {
@@ -1085,28 +1298,143 @@
node, () => types.allocateList(
types.nonNullExact(constructor.enclosingClass), node,
outermostElement, elementType, length));
- } else if (element.isFunction || element.isConstructor) {
- return returnType;
} else {
- assert(element.isField || element.isGetter);
- return inferrer.registerCalledClosure(
- node, selector, inferrer.typeOfElement(element),
- outermostElement, arguments, sideEffects, inLoop);
+ return returnType;
}
}
- T handleForeignSend(ast.Send node) {
+ T handleNewExpression(ast.NewExpression node) {
+ return visitStaticSend(node.send);
+ }
+
+ /// Handle invocation of a top level or static field or getter [element].
+ T handleStaticFieldOrGetterInvoke(ast.Send node, Element element) {
ArgumentsTypes arguments = analyzeArguments(node.arguments);
Selector selector = elements.getSelector(node);
- String name = selector.name;
- handleStaticSend(node, selector, elements[node], arguments);
- if (name == 'JS' || name == 'JS_EMBEDDED_GLOBAL') {
+ handleStaticSend(node, selector, element, arguments);
+ return inferrer.registerCalledClosure(
+ node, selector, inferrer.typeOfElement(element),
+ outermostElement, arguments, sideEffects, inLoop);
+ }
+
+ /// Handle invocation of a top level or static [function].
+ T handleStaticFunctionInvoke(ast.Send node, MethodElement function) {
+ if (function.isForeign(compiler.backend)) {
+ return handleForeignSend(node, function);
+ }
+ ArgumentsTypes arguments = analyzeArguments(node.arguments);
+ Selector selector = elements.getSelector(node);
+ return handleStaticSend(node, selector, function, arguments);
+ }
+
+ /// Handle an static invocation of an unresolved target or with incompatible
+ /// arguments to a resolved target.
+ T handleInvalidStaticInvoke(ast.Send node) {
+ analyzeArguments(node.arguments);
+ return types.dynamicType;
+ }
+
+ @override
+ T visitStaticFieldInvoke(
+ ast.Send node,
+ FieldElement field,
+ ast.NodeList arguments,
+ CallStructure callStructure,
+ _) {
+ return handleStaticFieldOrGetterInvoke(node, field);
+ }
+
+ @override
+ T visitStaticFunctionInvoke(
+ ast.Send node,
+ MethodElement function,
+ ast.NodeList arguments,
+ CallStructure callStructure,
+ _) {
+ return handleStaticFunctionInvoke(node, function);
+ }
+
+ @override
+ T visitStaticFunctionIncompatibleInvoke(
+ ast.Send node,
+ MethodElement function,
+ ast.NodeList arguments,
+ CallStructure callStructure,
+ _) {
+ return handleInvalidStaticInvoke(node);
+ }
+
+ @override
+ T visitStaticGetterInvoke(
+ ast.Send node,
+ FunctionElement getter,
+ ast.NodeList arguments,
+ CallStructure callStructure,
+ _) {
+ return handleStaticFieldOrGetterInvoke(node, getter);
+ }
+
+ @override
+ T visitTopLevelFieldInvoke(
+ ast.Send node,
+ FieldElement field,
+ ast.NodeList arguments,
+ CallStructure callStructure,
+ _) {
+ return handleStaticFieldOrGetterInvoke(node, field);
+ }
+
+ @override
+ T visitTopLevelFunctionInvoke(
+ ast.Send node,
+ MethodElement function,
+ ast.NodeList arguments,
+ CallStructure callStructure,
+ _) {
+ return handleStaticFunctionInvoke(node, function);
+ }
+
+ @override
+ T visitTopLevelFunctionIncompatibleInvoke(
+ ast.Send node,
+ MethodElement function,
+ ast.NodeList arguments,
+ CallStructure callStructure,
+ _) {
+ return handleInvalidStaticInvoke(node);
+ }
+
+ @override
+ T visitTopLevelGetterInvoke(
+ ast.Send node,
+ FunctionElement getter,
+ ast.NodeList arguments,
+ CallStructure callStructure,
+ _) {
+ return handleStaticFieldOrGetterInvoke(node, getter);
+ }
+
+ @override
+ T visitUnresolvedInvoke(
+ ast.Send node,
+ Element element,
+ ast.NodeList arguments,
+ Selector selector,
+ _) {
+ return handleInvalidStaticInvoke(node);
+ }
+
+ T handleForeignSend(ast.Send node, Element element) {
+ ArgumentsTypes arguments = analyzeArguments(node.arguments);
+ Selector selector = elements.getSelector(node);
+ String name = element.name;
+ handleStaticSend(node, selector, element, arguments);
+ if (name == 'JS' || name == 'JS_EMBEDDED_GLOBAL' || name == 'JS_BUILTIN') {
native.NativeBehavior nativeBehavior =
compiler.enqueuer.resolution.nativeEnqueuer.getNativeBehaviorOf(node);
sideEffects.add(nativeBehavior.sideEffects);
return inferrer.typeOfNativeBehavior(nativeBehavior);
- } else if (name == 'JS_GET_NAME'
- || name == 'JS_NULL_CLASS_NAME'
+ } else if (name == 'JS_NULL_CLASS_NAME'
|| name == 'JS_OBJECT_CLASS_NAME'
|| name == 'JS_OPERATOR_IS_PREFIX'
|| name == 'JS_OPERATOR_AS_PREFIX'
@@ -1138,46 +1466,196 @@
}
T visitGetterSend(ast.Send node) {
- Element element = elements[node];
- Selector selector = elements.getSelector(node);
- if (Elements.isStaticOrTopLevelField(element)) {
- return handleStaticSend(node, selector, element, null);
- } else if (Elements.isInstanceSend(node, elements)) {
- return visitDynamicSend(node);
- } else if (Elements.isStaticOrTopLevelFunction(element)) {
- return handleStaticSend(node, selector, element, null);
- } else if (Elements.isErroneous(element)) {
- return types.dynamicType;
- } else if (element.isLocal) {
- LocalElement local = element;
- assert(locals.use(local) != null);
- return locals.use(local);
- } else {
- assert(element is PrefixElement);
- return null;
+ if (elements[node] is! PrefixElement) {
+ // TODO(johnniwinther): Remove this when no longer called from
+ // [handleSendSet].
+ internalError(node, "Unexpected visitGetterSend");
}
+ return null;
}
- T visitClosureSend(ast.Send node) {
- assert(node.receiver == null);
- T closure = node.selector.accept(this);
+ /// Read a local variable, function or parameter.
+ T handleLocalGet(ast.Send node, LocalElement local) {
+ assert(locals.use(local) != null);
+ return locals.use(local);
+ }
+
+ /// Read a static or top level field.
+ T handleStaticFieldGet(ast.Send node, FieldElement field) {
+ return handleStaticSend(node, elements.getSelector(node), field, null);
+ }
+
+ /// Invoke a static or top level getter.
+ T handleStaticGetterGet(ast.Send node, MethodElement getter) {
+ return handleStaticSend(node, elements.getSelector(node), getter, null);
+ }
+
+ /// Closurize a static or top level function.
+ T handleStaticFunctionGet(ast.Send node, MethodElement function) {
+ return handleStaticSend(node, elements.getSelector(node), function, null);
+ }
+
+ @override
+ T visitDynamicPropertyGet(
+ ast.Send node,
+ ast.Node receiver,
+ Selector selector,
+ _) {
+ return handleDynamicGet(node);
+ }
+
+ @override
+ T visitLocalVariableGet(
+ ast.Send node,
+ LocalVariableElement variable,
+ _) {
+ return handleLocalGet(node, variable);
+ }
+
+ @override
+ T visitParameterGet(
+ ast.Send node,
+ ParameterElement parameter,
+ _) {
+ return handleLocalGet(node, parameter);
+ }
+
+ @override
+ T visitLocalFunctionGet(
+ ast.Send node,
+ LocalFunctionElement function,
+ _) {
+ return handleLocalGet(node, function);
+ }
+
+ @override
+ T visitStaticFieldGet(
+ ast.Send node,
+ FieldElement field,
+ _) {
+ return handleStaticFieldGet(node, field);
+ }
+
+ @override
+ T visitStaticFunctionGet(
+ ast.Send node,
+ MethodElement function,
+ _) {
+ return handleStaticFunctionGet(node, function);
+ }
+
+ @override
+ T visitStaticGetterGet(
+ ast.Send node,
+ FunctionElement getter,
+ _) {
+ return handleStaticGetterGet(node, getter);
+ }
+
+ @override
+ T visitThisPropertyGet(
+ ast.Send node,
+ Selector selector,
+ _) {
+ return handleDynamicGet(node);
+ }
+
+ @override
+ T visitTopLevelFieldGet(
+ ast.Send node,
+ FieldElement field,
+ _) {
+ return handleStaticFieldGet(node, field);
+ }
+
+ @override
+ T visitTopLevelFunctionGet(
+ ast.Send node,
+ MethodElement function,
+ _) {
+ return handleStaticFunctionGet(node, function);
+ }
+
+ @override
+ T visitTopLevelGetterGet(
+ ast.Send node,
+ FunctionElement getter,
+ _) {
+ return handleStaticGetterGet(node, getter);
+ }
+
+ @override
+ T visitUnresolvedGet(
+ ast.Send node,
+ Element element,
+ _) {
+ return types.dynamicType;
+ }
+
+ /// Handle .call invocation on [closure].
+ T handleCallInvoke(ast.Send node, T closure) {
ArgumentsTypes arguments = analyzeArguments(node.arguments);
- Element element = elements[node];
Selector selector = elements.getSelector(node);
- if (element != null && element.isFunction) {
- assert(element.isLocal);
- if (!selector.applies(element, compiler.world)) return types.dynamicType;
- // This only works for function statements. We need a
- // more sophisticated type system with function types to support
- // more.
- return inferrer.registerCalledElement(
- node, selector, outermostElement, element, arguments,
- sideEffects, inLoop);
- } else {
- return inferrer.registerCalledClosure(
- node, selector, closure, outermostElement, arguments,
- sideEffects, inLoop);
- }
+ return inferrer.registerCalledClosure(
+ node, selector, closure, outermostElement, arguments,
+ sideEffects, inLoop);
+ }
+
+ @override
+ T visitExpressionInvoke(
+ ast.Send node,
+ ast.Node expression,
+ ast.NodeList arguments,
+ Selector selector,
+ _) {
+ return handleCallInvoke(node, expression.accept(this));
+ }
+
+ @override
+ T visitThisInvoke(
+ ast.Send node,
+ ast.NodeList arguments,
+ CallStructure callStructure,
+ _) {
+ return handleCallInvoke(node, thisType);
+ }
+
+ @override
+ T visitParameterInvoke(
+ ast.Send node,
+ ParameterElement parameter,
+ ast.NodeList arguments,
+ CallStructure callStructure,
+ _) {
+ return handleCallInvoke(node, locals.use(parameter));
+ }
+
+ @override
+ T visitLocalVariableInvoke(
+ ast.Send node,
+ LocalVariableElement variable,
+ ast.NodeList arguments,
+ CallStructure callStructure,
+ _) {
+ return handleCallInvoke(node, locals.use(variable));
+ }
+
+ @override
+ T visitLocalFunctionInvoke(
+ ast.Send node,
+ LocalFunctionElement function,
+ ast.NodeList arguments,
+ CallStructure callStructure,
+ _) {
+ ArgumentsTypes argumentTypes = analyzeArguments(node.arguments);
+ Selector selector = elements.getSelector(node);
+ if (!selector.applies(function, compiler.world)) return types.dynamicType;
+ // This only works for function statements. We need a
+ // more sophisticated type system with function types to support
+ // more.
+ return inferrer.registerCalledElement(
+ node, selector, outermostElement, function, argumentTypes,
+ sideEffects, inLoop);
}
T handleStaticSend(ast.Node node,
@@ -1227,7 +1705,15 @@
sideEffects, inLoop);
}
- T visitDynamicSend(ast.Send node) {
+ T handleDynamicInvoke(ast.Send node) {
+ return _handleDynamicSend(node);
+ }
+
+ T handleDynamicGet(ast.Send node) {
+ return _handleDynamicSend(node);
+ }
+
+ T _handleDynamicSend(ast.Send node) {
Element element = elements[node];
T receiverType;
bool isCallOnThis = false;
diff --git a/pkg/compiler/lib/src/io/code_output.dart b/pkg/compiler/lib/src/io/code_output.dart
index 8566f23..1b4075d 100644
--- a/pkg/compiler/lib/src/io/code_output.dart
+++ b/pkg/compiler/lib/src/io/code_output.dart
@@ -8,13 +8,6 @@
import 'source_information.dart';
-class CodeOutputMarker {
- final int offsetDelta;
- final SourceLocation sourcePosition;
-
- CodeOutputMarker(this.offsetDelta, this.sourcePosition);
-}
-
abstract class CodeOutputListener {
void onText(String text);
void onDone(int length);
@@ -41,8 +34,8 @@
/// Closes the output. Further writes will cause a [StateError].
void close();
- /// Sets the [sourcePosition] for the code next added to this output.
- void setSourceLocation(SourceLocation sourcePosition);
+ /// Adds a [sourceLocation] at the specified [targetOffset] in the buffer.
+ void addSourceLocation(int targetOffset, SourceLocation sourcePosition);
/// Applies [f] to every marker in this output.
void forEachSourceLocation(void f(int targetOffset,
@@ -50,9 +43,7 @@
}
abstract class AbstractCodeOutput extends CodeOutput {
- List<CodeOutputMarker> markers = new List<CodeOutputMarker>();
- int lastBufferOffset = 0;
- int mappedRangeCounter = 0;
+ Map<int, List<SourceLocation>> markers = <int, List<SourceLocation>>{};
bool isClosed = false;
void _addInternal(String text);
@@ -62,22 +53,17 @@
if (isClosed) {
throw new StateError("Code output is closed. Trying to write '$text'.");
}
- if (mappedRangeCounter == 0) setSourceLocation(null);
_addInternal(text);
}
@override
void addBuffer(CodeBuffer other) {
if (other.markers.length > 0) {
- CodeOutputMarker firstMarker = other.markers[0];
- int offsetDelta =
- length + firstMarker.offsetDelta - lastBufferOffset;
- markers.add(new CodeOutputMarker(offsetDelta,
- firstMarker.sourcePosition));
- for (int i = 1; i < other.markers.length; ++i) {
- markers.add(other.markers[i]);
- }
- lastBufferOffset = length + other.lastBufferOffset;
+ other.markers.forEach(
+ (int targetOffset, List<SourceLocation> sourceLocations) {
+ markers.putIfAbsent(length + targetOffset, () => <SourceLocation>[])
+ .addAll(sourceLocations);
+ });
}
if (!other.isClosed) {
other.close();
@@ -85,29 +71,19 @@
_addInternal(other.getText());
}
- void beginMappedRange() {
- ++mappedRangeCounter;
+ void addSourceLocation(int targetOffset,
+ SourceLocation sourceLocation) {
+ assert(targetOffset <= length);
+ List<SourceLocation> sourceLocations =
+ markers.putIfAbsent(targetOffset, () => <SourceLocation>[]);
+ sourceLocations.add(sourceLocation);
}
- void endMappedRange() {
- assert(mappedRangeCounter > 0);
- --mappedRangeCounter;
- }
-
- void setSourceLocation(SourceLocation sourcePosition) {
- if (sourcePosition == null) {
- if (markers.length > 0 && markers.last.sourcePosition == null) return;
- }
- int offsetDelta = length - lastBufferOffset;
- markers.add(new CodeOutputMarker(offsetDelta, sourcePosition));
- lastBufferOffset = length;
- }
-
- void forEachSourceLocation(void f(int targetOffset, var sourcePosition)) {
- int targetOffset = 0;
- markers.forEach((marker) {
- targetOffset += marker.offsetDelta;
- f(targetOffset, marker.sourcePosition);
+ void forEachSourceLocation(void f(int targetOffset, var sourceLocation)) {
+ markers.forEach((int targetOffset, List<SourceLocation> sourceLocations) {
+ for (SourceLocation sourceLocation in sourceLocations) {
+ f(targetOffset, sourceLocation);
+ }
});
}
diff --git a/pkg/compiler/lib/src/io/source_information.dart b/pkg/compiler/lib/src/io/source_information.dart
index 6ee34e6..601256d 100644
--- a/pkg/compiler/lib/src/io/source_information.dart
+++ b/pkg/compiler/lib/src/io/source_information.dart
@@ -4,30 +4,79 @@
library dart2js.source_information;
-import '../dart2jslib.dart' show SourceSpan;
+import '../dart2jslib.dart' show SourceSpan, MessageKind;
import '../elements/elements.dart' show AstElement;
import '../scanner/scannerlib.dart' show Token;
import '../tree/tree.dart' show Node;
import '../js/js.dart' show JavaScriptNodeSourceInformation;
-import 'code_output.dart';
import 'source_file.dart';
/// Interface for passing source information, for instance for use in source
/// maps, through the backend.
abstract class SourceInformation extends JavaScriptNodeSourceInformation {
SourceSpan get sourceSpan;
- void beginMapping(CodeOutput output);
- void endMapping(CodeOutput output);
+
+ /// The source location associated with the start of the JS node.
+ SourceLocation get startPosition => null;
+
+ /// The source location associated with the closing of the JS node.
+ SourceLocation get closingPosition => null;
+
+ /// The source location associated with the end of the JS node.
+ SourceLocation get endPosition => null;
+}
+
+/// Factory for creating [SourceInformationBuilder]s.
+class SourceInformationFactory {
+ const SourceInformationFactory();
+
+ /// Create a [SourceInformationBuilder] for [element].
+ SourceInformationBuilder forContext(AstElement element) {
+ return const SourceInformationBuilder();
+ }
+}
+
+/// Interface for generating [SourceInformation].
+class SourceInformationBuilder {
+ const SourceInformationBuilder();
+
+ /// Create a [SourceInformationBuilder] for [element].
+ SourceInformationBuilder forContext(AstElement element) {
+ return this;
+ }
+
+ /// Generate [SourceInformation] the declaration of [element].
+ SourceInformation buildDeclaration(AstElement element) => null;
+
+ /// Generate [SourceInformation] for the generic [node].
+ @deprecated
+ SourceInformation buildGeneric(Node node) => null;
+
+ /// Generate [SourceInformation] for the return [node].
+ SourceInformation buildReturn(Node node) => null;
+
+ /// Generate [SourceInformation] for the loop [node].
+ SourceInformation buildLoop(Node node) => null;
+
+ /// Generate [SourceInformation] for the read access in [node].
+ SourceInformation buildGet(Node node) => null;
+
+ /// Generate [SourceInformation] for the invocation in [node].
+ SourceInformation buildCall(Node node) => null;
}
/// Source information that contains start source position and optionally an
/// end source position.
-class StartEndSourceInformation implements SourceInformation {
+class StartEndSourceInformation extends SourceInformation {
+ @override
final SourceLocation startPosition;
+
+ @override
final SourceLocation endPosition;
StartEndSourceInformation(this.startPosition, [this.endPosition]);
+ @override
SourceSpan get sourceSpan {
Uri uri = startPosition.sourceUri;
int begin = startPosition.offset;
@@ -35,22 +84,9 @@
return new SourceSpan(uri, begin, end);
}
- void beginMapping(CodeBuffer output) {
- output.beginMappedRange();
- output.setSourceLocation(startPosition);
- }
-
- void endMapping(CodeBuffer output) {
- if (endPosition != null) {
- output.setSourceLocation(endPosition);
- }
- output.endMappedRange();
- }
-
int get hashCode {
- return (startPosition.hashCode * 17 +
- endPosition.hashCode * 19)
- & 0x7FFFFFFF;
+ return 0x7FFFFFFF &
+ (startPosition.hashCode * 17 + endPosition.hashCode * 19);
}
bool operator ==(other) {
@@ -83,11 +119,11 @@
SourceLocation sourcePosition, endSourcePosition;
if (beginToken.charOffset < sourceFile.length) {
sourcePosition =
- new TokenSourceLocation(sourceFile, beginToken, name);
+ new OffsetSourceLocation(sourceFile, beginToken.charOffset, name);
}
if (endToken.charOffset < sourceFile.length) {
endSourcePosition =
- new TokenSourceLocation(sourceFile, endToken, name);
+ new OffsetSourceLocation(sourceFile, endToken.charOffset, name);
}
return new StartEndSourceInformation(sourcePosition, endSourcePosition);
}
@@ -104,44 +140,123 @@
}
}
+class StartEndSourceInformationFactory implements SourceInformationFactory {
+ const StartEndSourceInformationFactory();
+
+ @override
+ SourceInformationBuilder forContext(AstElement element) {
+ return new StartEndSourceInformationBuilder(element);
+ }
+}
+
+/// [SourceInformationBuilder] that generates [PositionSourceInformation].
+class StartEndSourceInformationBuilder extends SourceInformationBuilder {
+ final SourceFile sourceFile;
+ final String name;
+
+ StartEndSourceInformationBuilder(AstElement element)
+ : sourceFile = element.compilationUnit.script.file,
+ name = element.name;
+
+ SourceInformation buildDeclaration(AstElement element) {
+ return StartEndSourceInformation.computeSourceInformation(element);
+ }
+
+ SourceLocation sourceFileLocationForToken(Token token) {
+ SourceLocation location =
+ new OffsetSourceLocation(sourceFile, token.charOffset, name);
+ checkValidSourceFileLocation(location, sourceFile, token.charOffset);
+ return location;
+ }
+
+ void checkValidSourceFileLocation(
+ SourceLocation location, SourceFile sourceFile, int offset) {
+ if (!location.isValid) {
+ throw MessageKind.INVALID_SOURCE_FILE_LOCATION.message(
+ {'offset': offset,
+ 'fileName': sourceFile.filename,
+ 'length': sourceFile.length});
+ }
+ }
+
+ @override
+ SourceInformation buildLoop(Node node) {
+ return new StartEndSourceInformation(
+ sourceFileLocationForToken(node.getBeginToken()),
+ sourceFileLocationForToken(node.getEndToken()));
+ }
+
+ @override
+ SourceInformation buildGeneric(Node node) {
+ return new StartEndSourceInformation(
+ sourceFileLocationForToken(node.getBeginToken()));
+ }
+
+ @override
+ SourceInformation buildReturn(Node node) => buildGeneric(node);
+
+ @override
+ SourceInformation buildGet(Node node) => buildGeneric(node);
+
+ @override
+ SourceInformation buildCall(Node node) => buildGeneric(node);
+
+ @override
+ SourceInformationBuilder forContext(
+ AstElement element, {SourceInformation sourceInformation}) {
+ return new StartEndSourceInformationBuilder(element);
+ }
+}
+
/// [SourceInformation] that consists of an offset position into the source
/// code.
-class PositionSourceInformation implements SourceInformation {
- final SourceLocation sourcePosition;
-
- PositionSourceInformation(this.sourcePosition);
+class PositionSourceInformation extends SourceInformation {
+ @override
+ final SourceLocation startPosition;
@override
- void beginMapping(CodeOutput output) {
- output.setSourceLocation(sourcePosition);
- }
+ final SourceLocation closingPosition;
+
+ PositionSourceInformation(this.startPosition,
+ [this.closingPosition]);
@override
- void endMapping(CodeOutput output) {
- // Do nothing.
- }
-
SourceSpan get sourceSpan {
- Uri uri = sourcePosition.sourceUri;
- int offset = sourcePosition.offset;
+ SourceLocation location =
+ startPosition != null ? startPosition : closingPosition;
+ Uri uri = location.sourceUri;
+ int offset = location.offset;
return new SourceSpan(uri, offset, offset);
}
int get hashCode {
- return sourcePosition.hashCode * 17 & 0x7FFFFFFF;
+ return 0x7FFFFFFF &
+ (startPosition.hashCode * 17 + closingPosition.hashCode * 19);
}
bool operator ==(other) {
if (identical(this, other)) return true;
if (other is! PositionSourceInformation) return false;
- return sourcePosition == other.sourcePosition;
+ return startPosition == other.startPosition &&
+ closingPosition == other.closingPosition;
}
String toString() {
StringBuffer sb = new StringBuffer();
- sb.write('${sourcePosition.sourceUri}:');
+ if (startPosition != null) {
+ sb.write('${startPosition.sourceUri}:');
+ } else {
+ sb.write('${closingPosition.sourceUri}:');
+ }
// Use 1-based line/column info to match usual dart tool output.
- sb.write('[${sourcePosition.line + 1},${sourcePosition.column + 1}]');
+ if (startPosition != null) {
+ sb.write('[${startPosition.line + 1},'
+ '${startPosition.column + 1}]');
+ }
+ if (closingPosition != null) {
+ sb.write('-[${closingPosition.line + 1},'
+ '${closingPosition.column + 1}]');
+ }
return sb.toString();
}
}
@@ -196,17 +311,71 @@
}
}
-class TokenSourceLocation extends SourceLocation {
- final Token token;
+class OffsetSourceLocation extends SourceLocation {
+ final int offset;
final String sourceName;
- TokenSourceLocation(SourceFile sourceFile, this.token, this.sourceName)
- : super(sourceFile);
-
- @override
- int get offset => token.charOffset;
+ OffsetSourceLocation(SourceFile sourceFile, this.offset, this.sourceName)
+ : super(sourceFile);
String toString() {
return '${super.toString()}:$sourceName';
}
}
+
+class PositionSourceInformationFactory implements SourceInformationFactory {
+ const PositionSourceInformationFactory();
+
+ @override
+ SourceInformationBuilder forContext(AstElement element) {
+ return new PositionSourceInformationBuilder(element);
+ }
+}
+
+/// [SourceInformationBuilder] that generates [PositionSourceInformation].
+class PositionSourceInformationBuilder implements SourceInformationBuilder {
+ final SourceFile sourceFile;
+ final String name;
+
+ PositionSourceInformationBuilder(AstElement element)
+ : sourceFile = element.implementation.compilationUnit.script.file,
+ name = element.name;
+
+ SourceInformation buildDeclaration(AstElement element) {
+ if (element.isSynthesized) {
+ return new PositionSourceInformation(
+ new OffsetSourceLocation(
+ sourceFile, element.position.charOffset, name));
+ } else {
+ return new PositionSourceInformation(
+ null,
+ new OffsetSourceLocation(sourceFile,
+ element.resolvedAst.node.getEndToken().charOffset, name));
+ }
+ }
+
+ SourceInformation buildBegin(Node node) {
+ return new PositionSourceInformation(new OffsetSourceLocation(
+ sourceFile, node.getBeginToken().charOffset, name));
+ }
+
+ @override
+ SourceInformation buildGeneric(Node node) => buildBegin(node);
+
+ @override
+ SourceInformation buildReturn(Node node) => buildBegin(node);
+
+ @override
+ SourceInformation buildLoop(Node node) => buildBegin(node);
+
+ @override
+ SourceInformation buildGet(Node node) => buildBegin(node);
+
+ @override
+ SourceInformation buildCall(Node node) => buildBegin(node);
+
+ @override
+ SourceInformationBuilder forContext(AstElement element) {
+ return new PositionSourceInformationBuilder(element);
+ }
+}
diff --git a/pkg/compiler/lib/src/io/source_map_builder.dart b/pkg/compiler/lib/src/io/source_map_builder.dart
index bf614ab..28b52a5 100644
--- a/pkg/compiler/lib/src/io/source_map_builder.dart
+++ b/pkg/compiler/lib/src/io/source_map_builder.dart
@@ -10,111 +10,24 @@
import 'source_information.dart' show SourceLocation;
class SourceMapBuilder {
- static const int VLQ_BASE_SHIFT = 5;
- static const int VLQ_BASE_MASK = (1 << 5) - 1;
- static const int VLQ_CONTINUATION_BIT = 1 << 5;
- static const int VLQ_CONTINUATION_MASK = 1 << 5;
- static const String BASE64_DIGITS = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmn'
- 'opqrstuvwxyz0123456789+/';
/// The URI of the source map file.
final Uri sourceMapUri;
/// The URI of the target language file.
final Uri targetFileUri;
- LineColumnProvider lineColumnProvider;
- List<SourceMapEntry> entries;
-
- Map<Uri, int> sourceUriMap;
- List<Uri> sourceUriList;
- Map<String, int> sourceNameMap;
- List<String> sourceNameList;
-
- int previousTargetLine;
- int previousTargetColumn;
- int previousSourceUriIndex;
- int previousSourceLine;
- int previousSourceColumn;
- int previousSourceNameIndex;
- bool firstEntryInLine;
+ final LineColumnProvider lineColumnProvider;
+ final List<SourceMapEntry> entries = new List<SourceMapEntry>();
SourceMapBuilder(this.sourceMapUri,
this.targetFileUri,
- this.lineColumnProvider) {
- entries = new List<SourceMapEntry>();
-
- sourceUriMap = new Map<Uri, int>();
- sourceUriList = new List<Uri>();
- sourceNameMap = new Map<String, int>();
- sourceNameList = new List<String>();
-
- previousTargetLine = 0;
- previousTargetColumn = 0;
- previousSourceUriIndex = 0;
- previousSourceLine = 0;
- previousSourceColumn = 0;
- previousSourceNameIndex = 0;
- firstEntryInLine = true;
- }
-
- resetPreviousSourceLocation() {
- previousSourceUriIndex = 0;
- previousSourceLine = 0;
- previousSourceColumn = 0;
- previousSourceNameIndex = 0;
- }
-
- updatePreviousSourceLocation(SourceLocation sourceLocation) {
- previousSourceLine = sourceLocation.line;
- previousSourceColumn = sourceLocation.column;
- Uri sourceUri = sourceLocation.sourceUri;
- previousSourceUriIndex = indexOf(sourceUriList, sourceUri, sourceUriMap);
- String sourceName = sourceLocation.sourceName;
- if (sourceName != null) {
- previousSourceNameIndex =
- indexOf(sourceNameList, sourceName, sourceNameMap);
- }
- }
-
- bool sameAsPreviousLocation(SourceLocation sourceLocation) {
- if (sourceLocation == null) {
- return true;
- }
- int sourceUriIndex =
- indexOf(sourceUriList, sourceLocation.sourceUri, sourceUriMap);
- return
- sourceUriIndex == previousSourceUriIndex &&
- sourceLocation.line == previousSourceLine &&
- sourceLocation.column == previousSourceColumn;
- }
+ this.lineColumnProvider);
void addMapping(int targetOffset, SourceLocation sourceLocation) {
-
- bool sameLine(int position, otherPosition) {
- return lineColumnProvider.getLine(position) ==
- lineColumnProvider.getLine(otherPosition);
- }
-
- if (!entries.isEmpty && sameLine(targetOffset, entries.last.targetOffset)) {
- if (sameAsPreviousLocation(sourceLocation)) {
- // The entry points to the same source location as the previous entry in
- // the same line, hence it is not needed for the source map.
- //
- // TODO(zarah): Remove this check and make sure that [addMapping] is not
- // called for this position. Instead, when consecutive lines in the
- // generated code point to the same source location, record this and use
- // it to generate the entries of the source map.
- return;
- }
- }
-
- if (sourceLocation != null) {
- updatePreviousSourceLocation(sourceLocation);
- }
entries.add(new SourceMapEntry(sourceLocation, targetOffset));
}
- void printStringListOn(List<String> strings, StringBuffer buffer) {
+ void printStringListOn(Iterable<String> strings, StringBuffer buffer) {
bool first = true;
buffer.write('[');
for (String string in strings) {
@@ -128,11 +41,46 @@
}
String build() {
- resetPreviousSourceLocation();
- StringBuffer mappingsBuffer = new StringBuffer();
- entries.forEach((SourceMapEntry entry) {
- writeEntry(entry, mappingsBuffer);
+
+ LineColumnMap<SourceMapEntry> lineColumnMap =
+ new LineColumnMap<SourceMapEntry>();
+ Map<Uri, LineColumnMap<SourceMapEntry>> sourceLocationMap =
+ <Uri, LineColumnMap<SourceMapEntry>>{};
+ entries.forEach((SourceMapEntry sourceMapEntry) {
+ int line = lineColumnProvider.getLine(sourceMapEntry.targetOffset);
+ int column =
+ lineColumnProvider.getColumn(line, sourceMapEntry.targetOffset);
+ lineColumnMap.add(line, column, sourceMapEntry);
+
+ SourceLocation location = sourceMapEntry.sourceLocation;
+ if (location != null) {
+ LineColumnMap<SourceMapEntry> sourceLineColumnMap =
+ sourceLocationMap.putIfAbsent(location.sourceUri,
+ () => new LineColumnMap<SourceMapEntry>());
+ sourceLineColumnMap.add(location.line, location.column, sourceMapEntry);
+ }
});
+
+ return _build(lineColumnMap);
+ }
+
+ String _build(LineColumnMap<SourceMapEntry> lineColumnMap) {
+ IndexMap<Uri> uriMap = new IndexMap<Uri>();
+ IndexMap<String> nameMap = new IndexMap<String>();
+
+ lineColumnMap.forEachElement((SourceMapEntry entry) {
+ SourceLocation sourceLocation = entry.sourceLocation;
+ if (sourceLocation != null) {
+ uriMap.register(sourceLocation.sourceUri);
+ if (sourceLocation.sourceName != null) {
+ nameMap.register(sourceLocation.sourceName);
+ }
+ }
+ });
+
+ StringBuffer mappingsBuffer = new StringBuffer();
+ writeEntries(lineColumnMap, uriMap, nameMap, mappingsBuffer);
+
StringBuffer buffer = new StringBuffer();
buffer.write('{\n');
buffer.write(' "version": 3,\n');
@@ -142,16 +90,15 @@
}
buffer.write(' "sourceRoot": "",\n');
buffer.write(' "sources": ');
- List<String> relativeSourceUriList = <String>[];
+ Iterable<String> relativeSourceUriList = const <String>[];
if (sourceMapUri != null) {
- relativeSourceUriList = sourceUriList
- .map((u) => relativize(sourceMapUri, u, false))
- .toList();
+ relativeSourceUriList = uriMap.elements
+ .map((u) => relativize(sourceMapUri, u, false));
}
printStringListOn(relativeSourceUriList, buffer);
buffer.write(',\n');
buffer.write(' "names": ');
- printStringListOn(sourceNameList, buffer);
+ printStringListOn(nameMap.elements, buffer);
buffer.write(',\n');
buffer.write(' "mappings": "');
buffer.write(mappingsBuffer);
@@ -159,73 +106,105 @@
return buffer.toString();
}
- void writeEntry(SourceMapEntry entry, StringBuffer output) {
- int targetLine = lineColumnProvider.getLine(entry.targetOffset);
- int targetColumn =
- lineColumnProvider.getColumn(targetLine, entry.targetOffset);
+ void writeEntries(LineColumnMap<SourceMapEntry> entries,
+ IndexMap<Uri> uriMap,
+ IndexMap<String> nameMap,
+ StringBuffer output) {
+ SourceLocation previousSourceLocation;
+ int previousTargetLine = 0;
+ DeltaEncoder targetColumnEncoder = new DeltaEncoder();
+ bool firstEntryInLine = true;
+ DeltaEncoder sourceUriIndexEncoder = new DeltaEncoder();
+ DeltaEncoder sourceLineEncoder = new DeltaEncoder();
+ DeltaEncoder sourceColumnEncoder = new DeltaEncoder();
+ DeltaEncoder sourceNameIndexEncoder = new DeltaEncoder();
- if (targetLine > previousTargetLine) {
- for (int i = previousTargetLine; i < targetLine; ++i) {
- output.write(';');
+ entries.forEach((int targetLine,
+ int targetColumn,
+ SourceMapEntry entry) {
+ SourceLocation sourceLocation = entry.sourceLocation;
+ if (sourceLocation == previousSourceLocation) {
+ return;
}
- previousTargetLine = targetLine;
- previousTargetColumn = 0;
- firstEntryInLine = true;
- }
- if (!firstEntryInLine) {
- output.write(',');
- }
- firstEntryInLine = false;
+ if (targetLine > previousTargetLine) {
+ for (int i = previousTargetLine; i < targetLine; ++i) {
+ output.write(';');
+ }
+ previousTargetLine = targetLine;
+ previousSourceLocation = null;
+ targetColumnEncoder.reset();
+ firstEntryInLine = true;
+ }
- encodeVLQ(output, targetColumn - previousTargetColumn);
- previousTargetColumn = targetColumn;
+ if (!firstEntryInLine) {
+ output.write(',');
+ }
+ firstEntryInLine = false;
- if (entry.sourceLocation == null) return;
+ targetColumnEncoder.encode(output, targetColumn);
- Uri sourceUri = entry.sourceLocation.sourceUri;
- int sourceLine = entry.sourceLocation.line;
- int sourceColumn = entry.sourceLocation.column;
- String sourceName = entry.sourceLocation.sourceName;
+ if (sourceLocation == null) {
+ return;
+ }
- int sourceUriIndex = indexOf(sourceUriList, sourceUri, sourceUriMap);
- encodeVLQ(output, sourceUriIndex - previousSourceUriIndex);
- encodeVLQ(output, sourceLine - previousSourceLine);
- encodeVLQ(output, sourceColumn - previousSourceColumn);
+ Uri sourceUri = sourceLocation.sourceUri;
+ sourceUriIndexEncoder.encode(output, uriMap[sourceUri]);
+ sourceLineEncoder.encode(output, sourceLocation.line);
+ sourceColumnEncoder.encode(output, sourceLocation.column);
- if (sourceName != null) {
- int sourceNameIndex = indexOf(sourceNameList, sourceName, sourceNameMap);
- encodeVLQ(output, sourceNameIndex - previousSourceNameIndex);
- }
+ String sourceName = sourceLocation.sourceName;
+ if (sourceName != null) {
+ sourceNameIndexEncoder.encode(output, nameMap[sourceName]);
+ }
- // Update previous source location to ensure the next indices are relative
- // to those if [entry.sourceLocation].
- updatePreviousSourceLocation(entry.sourceLocation);
- }
-
- int indexOf(List list, value, Map<dynamic, int> map) {
- return map.putIfAbsent(value, () {
- int index = list.length;
- list.add(value);
- return index;
+ previousSourceLocation = sourceLocation;
});
}
+}
- static void encodeVLQ(StringBuffer output, int value) {
+/// Encoder for value deltas in VLQ format.
+class DeltaEncoder {
+ /// The last emitted value of the encoder.
+ int _value = 0;
+
+ /// Reset the encoder to its initial state.
+ void reset() {
+ _value = 0;
+ }
+
+ /// Writes the VLQ of delta between [value] and the last emitted value into
+ /// [output] and updates the last emitted value of the encoder.
+ void encode(StringBuffer output, int value) {
+ _value = encodeVLQ(output, value, _value);
+ }
+
+ static const int VLQ_BASE_SHIFT = 5;
+ static const int VLQ_BASE_MASK = (1 << 5) - 1;
+ static const int VLQ_CONTINUATION_BIT = 1 << 5;
+ static const int VLQ_CONTINUATION_MASK = 1 << 5;
+ static const String BASE64_DIGITS = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmn'
+ 'opqrstuvwxyz0123456789+/';
+
+ /// Writes the VLQ of delta between [value] and [offset] into [output] and
+ /// return [value].
+ static int encodeVLQ(StringBuffer output, int value, int offset) {
+ int delta = value - offset;
int signBit = 0;
- if (value < 0) {
+ if (delta < 0) {
signBit = 1;
- value = -value;
+ delta = -delta;
}
- value = (value << 1) | signBit;
+ delta = (delta << 1) | signBit;
do {
- int digit = value & VLQ_BASE_MASK;
- value >>= VLQ_BASE_SHIFT;
- if (value > 0) {
+ int digit = delta & VLQ_BASE_MASK;
+ delta >>= VLQ_BASE_SHIFT;
+ if (delta > 0) {
digit |= VLQ_CONTINUATION_BIT;
}
output.write(BASE64_DIGITS[digit]);
- } while (value > 0);
+ } while (delta > 0);
+ return value;
}
}
@@ -235,3 +214,93 @@
SourceMapEntry(this.sourceLocation, this.targetOffset);
}
+
+/// Map from line/column pairs to lists of [T] elements.
+class LineColumnMap<T> {
+ Map<int, Map<int, List<T>>> _map = <int, Map<int, List<T>>>{};
+
+ /// Returns the list of elements associated with ([line],[column]).
+ List<T> _getList(int line, int column) {
+ Map<int, List<T>> lineMap = _map.putIfAbsent(line, () => <int, List<T>>{});
+ return lineMap.putIfAbsent(column, () => <T>[]);
+ }
+
+ /// Adds [element] to the end of the list of elements associated with
+ /// ([line],[column]).
+ void add(int line, int column, T element) {
+ _getList(line, column).add(element);
+ }
+
+ /// Adds [element] to the beginning of the list of elements associated with
+ /// ([line],[column]).
+ void addFirst(int line, int column, T element) {
+ _getList(line, column).insert(0, element);
+ }
+
+ /// Calls [f] with the line number for each line with associated elements.
+ ///
+ /// [f] is called in increasing line order.
+ void forEachLine(f(int line)) {
+ List<int> lines = _map.keys.toList()..sort();
+ lines.forEach(f);
+ }
+
+ /// Returns the elements for the first the column in [line] that has
+ /// associated elements.
+ List<T> getFirstElementsInLine(int line) {
+ Map<int, List<T>> lineMap = _map[line];
+ if (lineMap == null) return null;
+ List<int> columns = lineMap.keys.toList()..sort();
+ return lineMap[columns.first];
+ }
+
+ /// Calls [f] for each column with associated elements in [line].
+ ///
+ /// [f] is called in increasing column order.
+ void forEachColumn(int line, f(int column, List<T> elements)) {
+ Map<int, List<T>> lineMap = _map[line];
+ if (lineMap != null) {
+ List<int> columns = lineMap.keys.toList()..sort();
+ columns.forEach((int column) {
+ f(column, lineMap[column]);
+ });
+ }
+ }
+
+ /// Calls [f] for each line/column/element triplet in the map.
+ ///
+ /// [f] is called in increasing line, column, element order.
+ void forEach(f(int line, int column, T element)) {
+ List<int> lines = _map.keys.toList()..sort();
+ for (int line in lines) {
+ Map<int, List<T>> lineMap = _map[line];
+ List<int> columns = lineMap.keys.toList()..sort();
+ for (int column in columns) {
+ lineMap[column].forEach((e) => f(line, column, e));
+ }
+ }
+ }
+
+ /// Calls [f] for each element associated in the map.
+ ///
+ /// [f] is called in increasing line, column, element order.
+ void forEachElement(f(T element)) {
+ forEach((line, column, element) => f(element));
+ }
+}
+
+/// Map from [T] elements to assigned indices.
+class IndexMap<T> {
+ Map<T, int> map = <T, int>{};
+
+ /// Register [element] and returns its index.
+ int register(T element) {
+ return map.putIfAbsent(element, () => map.length);
+ }
+
+ /// Returns the index of [element].
+ int operator [](T element) => map[element];
+
+ /// Returns the indexed elements.
+ Iterable<T> get elements => map.keys;
+}
diff --git a/pkg/compiler/lib/src/js/js.dart b/pkg/compiler/lib/src/js/js.dart
index ec8766a..378b89e 100644
--- a/pkg/compiler/lib/src/js/js.dart
+++ b/pkg/compiler/lib/src/js/js.dart
@@ -7,6 +7,7 @@
import 'package:js_ast/js_ast.dart';
export 'package:js_ast/js_ast.dart';
+import '../helpers/helpers.dart';
import '../io/code_output.dart' show CodeBuffer;
import '../io/source_information.dart' show SourceInformation;
import '../js_emitter/js_emitter.dart' show USE_NEW_EMITTER;
@@ -33,31 +34,56 @@
final leg.Compiler compiler;
final DumpInfoTask monitor;
final CodeBuffer outBuffer = new CodeBuffer();
+ Node rootNode;
Dart2JSJavaScriptPrintingContext(leg.Compiler this.compiler,
DumpInfoTask this.monitor);
+ @override
void error(String message) {
compiler.internalError(NO_LOCATION_SPANNABLE, message);
}
+ @override
void emit(String string) {
outBuffer.add(string);
}
- void enterNode(Node node) {
+ @override
+ void enterNode(Node node, int startPosition) {
SourceInformation sourceInformation = node.sourceInformation;
if (sourceInformation != null) {
- sourceInformation.beginMapping(outBuffer);
+ if (rootNode == null) {
+ rootNode = node;
+ }
+ if (sourceInformation.startPosition != null) {
+ outBuffer.addSourceLocation(
+ startPosition, sourceInformation.startPosition);
+ }
}
- if (monitor != null) monitor.enteringAst(node, outBuffer.length);
}
- void exitNode(Node node) {
- if (monitor != null) monitor.exitingAst(node, outBuffer.length);
+ void exitNode(Node node,
+ int startPosition,
+ int endPosition,
+ int closingPosition) {
SourceInformation sourceInformation = node.sourceInformation;
if (sourceInformation != null) {
- sourceInformation.endMapping(outBuffer);
+ if (closingPosition != null &&
+ sourceInformation.closingPosition != null) {
+ outBuffer.addSourceLocation(
+ closingPosition, sourceInformation.closingPosition);
+ }
+ if (sourceInformation.endPosition != null) {
+ outBuffer.addSourceLocation(endPosition, sourceInformation.endPosition);
+ }
+ if (rootNode == node) {
+ outBuffer.addSourceLocation(endPosition, null);
+ rootNode = null;
+ }
+ }
+ if (monitor != null) {
+ monitor.recordAstSize(node, endPosition - startPosition);
}
}
}
diff --git a/pkg/compiler/lib/src/js_backend/backend.dart b/pkg/compiler/lib/src/js_backend/backend.dart
index 94c62a4..aeb4fb8 100644
--- a/pkg/compiler/lib/src/js_backend/backend.dart
+++ b/pkg/compiler/lib/src/js_backend/backend.dart
@@ -6,8 +6,6 @@
const VERBOSE_OPTIMIZER_HINTS = false;
-const bool USE_CPS_IR = const bool.fromEnvironment("USE_CPS_IR");
-
class JavaScriptItemCompilationContext extends ItemCompilationContext {
final Set<HInstruction> boundsChecked = new Set<HInstruction>();
final Set<HInstruction> allocatedFixedLists = new Set<HInstruction>();
@@ -304,6 +302,7 @@
Element jsStringToString;
Element jsStringOperatorAdd;
Element objectEquals;
+ Element cachedCheckConcurrentModificationError;
ClassElement typeLiteralClass;
ClassElement mapLiteralClass;
@@ -311,6 +310,8 @@
ClassElement typeVariableClass;
ConstructorElement mapLiteralConstructor;
ConstructorElement mapLiteralConstructorEmpty;
+ Element mapLiteralUntypedMaker;
+ Element mapLiteralUntypedEmptyMaker;
ClassElement noSideEffectsClass;
ClassElement noThrowsClass;
@@ -510,6 +511,9 @@
/// Holds the class for the [JsGetName] enum.
EnumClassElement jsGetNameEnum;
+ /// Holds the class for the [JsBuiltins] enum.
+ EnumClassElement jsBuiltinEnum;
+
/// True if a call to preserveMetadataMarker has been seen. This means that
/// metadata must be retained for dart:mirrors to work correctly.
bool mustRetainMetadata = false;
@@ -598,7 +602,9 @@
bool enabledNoSuchMethod = false;
- JavaScriptBackend(Compiler compiler, bool generateSourceMap)
+ JavaScriptBackend(Compiler compiler,
+ SourceInformationFactory sourceInformationFactory,
+ {bool generateSourceMap: true})
: namer = determineNamer(compiler),
oneShotInterceptors = new Map<String, Selector>(),
interceptedElements = new Map<String, Set<Element>>(),
@@ -606,16 +612,16 @@
specializedGetInterceptors = new Map<String, Set<ClassElement>>(),
super(compiler) {
emitter = new CodeEmitterTask(compiler, namer, generateSourceMap);
- typeVariableHandler = new TypeVariableHandler(this);
+ typeVariableHandler = new TypeVariableHandler(compiler);
customElementsAnalysis = new CustomElementsAnalysis(this);
noSuchMethodRegistry = new NoSuchMethodRegistry(this);
constantCompilerTask = new JavaScriptConstantTask(compiler);
resolutionCallbacks = new JavaScriptResolutionCallbacks(this);
patchResolverTask = new PatchResolverTask(compiler);
- functionCompiler = USE_CPS_IR
+ functionCompiler = compiler.useCpsIr
? new CpsFunctionCompiler(
- compiler, this, generateSourceMap: generateSourceMap)
- : new SsaFunctionCompiler(this, generateSourceMap);
+ compiler, this, sourceInformationFactory)
+ : new SsaFunctionCompiler(this, sourceInformationFactory);
}
ConstantSystem get constantSystem => constants.constantSystem;
@@ -964,7 +970,8 @@
Enqueuer enqueuer,
Registry registry) {
if (!cls.typeVariables.isEmpty) {
- typeVariableHandler.registerClassWithTypeVariables(cls);
+ typeVariableHandler.registerClassWithTypeVariables(cls, enqueuer,
+ registry);
}
// Register any helper that will be needed by the backend.
@@ -1016,10 +1023,27 @@
}
return ctor;
}
+ Element getMember(String name) {
+ // The constructor is on the patch class, but dart2js unit tests don't
+ // have a patch class.
+ ClassElement implementation = cls.patch != null ? cls.patch : cls;
+ Element element = implementation.lookupLocalMember(name);
+ if (element == null || !element.isFunction || !element.isStatic) {
+ compiler.internalError(mapLiteralClass,
+ "Map literal class $mapLiteralClass missing "
+ "'$name' static member function");
+ }
+ return element;
+ }
mapLiteralConstructor = getFactory('_literal', 1);
mapLiteralConstructorEmpty = getFactory('_empty', 0);
enqueueInResolution(mapLiteralConstructor, registry);
enqueueInResolution(mapLiteralConstructorEmpty, registry);
+
+ mapLiteralUntypedMaker = getMember('_makeLiteral');
+ mapLiteralUntypedEmptyMaker = getMember('_makeEmpty');
+ enqueueInResolution(mapLiteralUntypedMaker, registry);
+ enqueueInResolution(mapLiteralUntypedEmptyMaker, registry);
}
}
if (cls == closureClass) {
@@ -1618,6 +1642,18 @@
element == jsFixedArrayClass;
}
+ /// Return [true] if the class is represented by a native JavaSCript type in
+ /// the generated code.
+ bool isNativePrimitiveType(ClassElement cls ) {
+ // TODO(karlklose): cleanup/merge with hasDirectCheck, when the rest of the
+ // checks are implemented in the CPS IR.
+ return cls == compiler.intClass ||
+ cls == compiler.numClass ||
+ cls == compiler.doubleClass ||
+ cls == compiler.boolClass ||
+ cls == compiler.stringClass;
+ }
+
bool mayGenerateInstanceofCheck(DartType type) {
// We can use an instanceof check for raw types that have no subclass that
// is mixed-in or in an implements clause.
@@ -1644,6 +1680,18 @@
return findHelper('throwAbstractClassInstantiationError');
}
+ Element getCheckConcurrentModificationError() {
+ if (cachedCheckConcurrentModificationError == null) {
+ cachedCheckConcurrentModificationError =
+ findHelper('checkConcurrentModificationError');
+ }
+ return cachedCheckConcurrentModificationError;
+ }
+
+ Element getThrowConcurrentModificationError() {
+ return findHelper('throwConcurrentModificationError');
+ }
+
Element getStringInterpolationHelper() {
return findHelper('S');
}
@@ -1836,7 +1884,6 @@
if (element == disableTreeShakingMarker) {
compiler.disableTypeInferenceForMirrors = true;
isTreeShakingDisabled = true;
- typeVariableHandler.onTreeShakingDisabled(enqueuer);
} else if (element == preserveNamesMarker) {
mustPreserveNames = true;
} else if (element == preserveMetadataMarker) {
@@ -2019,6 +2066,7 @@
preserveNamesMarker = find(library, 'preserveNames');
} else if (uri == DART_EMBEDDED_NAMES) {
jsGetNameEnum = find(library, 'JsGetName');
+ jsBuiltinEnum = find(library, 'JsBuiltin');
} else if (uri == DART_HTML) {
htmlLibraryIsLoaded = true;
}
@@ -2733,6 +2781,13 @@
registerBackendStaticInvocation(backend.getTraceFromException(), registry);
}
+ void onSyncForIn(Registry registry) {
+ assert(registry.isForResolution);
+ // The SSA builder recognizes certain for-in loops and can generate calls to
+ // throwConcurrentModificationError.
+ registerBackendStaticInvocation(
+ backend.getCheckConcurrentModificationError(), registry);
+ }
void onTypeVariableExpression(Registry registry) {
assert(registry.isForResolution);
diff --git a/pkg/compiler/lib/src/js_backend/codegen/codegen.dart b/pkg/compiler/lib/src/js_backend/codegen/codegen.dart
index 2fa219b..95b1dee 100644
--- a/pkg/compiler/lib/src/js_backend/codegen/codegen.dart
+++ b/pkg/compiler/lib/src/js_backend/codegen/codegen.dart
@@ -13,6 +13,9 @@
import '../../util/maplet.dart';
import '../../constants/values.dart';
import '../../dart2jslib.dart';
+import '../../dart_types.dart';
+
+part 'type_test_emitter.dart';
class CodegenBailout {
final tree_ir.Node node;
@@ -24,7 +27,8 @@
}
class CodeGenerator extends tree_ir.StatementVisitor
- with tree_ir.ExpressionVisitor<js.Expression> {
+ with tree_ir.ExpressionVisitor<js.Expression>,
+ TypeTestEmitter {
final CodegenRegistry registry;
final Glue glue;
@@ -59,18 +63,52 @@
List<js.Parameter> parameters = new List<js.Parameter>();
Set<tree_ir.Variable> parameterSet = new Set<tree_ir.Variable>();
+ Set<String> declaredVariables = new Set<String>();
for (tree_ir.Variable parameter in function.parameters) {
String name = getVariableName(parameter);
parameters.add(new js.Parameter(name));
parameterSet.add(parameter);
+ declaredVariables.add(name);
}
List<js.VariableInitialization> jsVariables = <js.VariableInitialization>[];
+ // Declare variables with an initializer. Pull statements into the
+ // initializer until we find a statement that cannot be pulled in.
+ int accumulatorIndex = 0;
+ while (accumulatorIndex < accumulator.length) {
+ js.Node node = accumulator[accumulatorIndex];
+
+ // Check that node is an assignment to a local variable.
+ if (node is! js.ExpressionStatement) break;
+ js.ExpressionStatement stmt = node;
+ if (stmt.expression is! js.Assignment) break;
+ js.Assignment assign = stmt.expression;
+ if (assign.leftHandSide is! js.VariableUse) break;
+ if (assign.op != null) break; // Compound assignment.
+ js.VariableUse use = assign.leftHandSide;
+
+ // We cannot declare a variable more than once.
+ if (!declaredVariables.add(use.name)) break;
+
+ js.VariableInitialization jsVariable = new js.VariableInitialization(
+ new js.VariableDeclaration(use.name),
+ assign.value);
+ jsVariables.add(jsVariable);
+
+ ++accumulatorIndex;
+ }
+
+ // Discard the statements that were pulled in the initializer.
+ if (accumulatorIndex > 0) {
+ accumulator = accumulator.sublist(accumulatorIndex);
+ }
+
+ // Declare remaining variables.
for (tree_ir.Variable variable in variableNames.keys) {
- if (parameterSet.contains(variable)) continue;
String name = getVariableName(variable);
+ if (declaredVariables.contains(name)) continue;
js.VariableInitialization jsVariable = new js.VariableInitialization(
new js.VariableDeclaration(name),
null);
@@ -107,10 +145,6 @@
}
// Synthesize a variable name that isn't used elsewhere.
- // The [usedVariableNames] set is shared between nested emitters,
- // so this also prevents clash with variables in an enclosing/inner scope.
- // The renaming phase after codegen will further prefix local variables
- // so they cannot clash with top-level variables or fields.
String prefix = variable.element == null ? 'v' : variable.element.name;
int counter = 0;
name = glue.safeVariableName(variable.element == null
@@ -209,8 +243,7 @@
checkStaticTargetIsValid(node, node.target);
if (node.constant != null) return giveup(node);
- ClassElement instantiatedClass = node.target.enclosingClass;
- registry.registerInstantiatedClass(instantiatedClass);
+ registry.registerInstantiatedType(node.type);
Selector selector = node.selector;
FunctionElement target = node.target;
List<js.Expression> arguments = visitArguments(node.arguments);
@@ -225,7 +258,8 @@
registry.registerDynamicSetter(selector);
} else {
assert(invariant(CURRENT_ELEMENT_SPANNABLE,
- selector.isCall || selector.isOperator || selector.isIndex,
+ selector.isCall || selector.isOperator ||
+ selector.isIndex || selector.isIndexSet,
message: 'unexpected kind ${selector.kind}'));
// TODO(sigurdm): We should find a better place to register the call.
Selector call = new Selector.callClosureFrom(selector);
@@ -351,8 +385,16 @@
@override
js.Expression visitTypeOperator(tree_ir.TypeOperator node) {
- return giveup(node);
- // TODO: implement visitTypeOperator
+ if (!node.isTypeTest) {
+ giveup(node, 'type casts not implemented.');
+ }
+ DartType type = node.type;
+ if (type is InterfaceType && type.typeArguments.isEmpty) {
+ glue.registerIsCheck(type, registry);
+ js.Expression value = visitExpression(node.receiver);
+ return emitSubtypeTest(node, value, type);
+ }
+ return giveup(node, 'type check unimplemented for $type.');
}
@override
@@ -365,6 +407,13 @@
}
@override
+ js.Expression visitAssign(tree_ir.Assign node) {
+ return new js.Assignment(
+ buildVariableAccess(node.variable),
+ visitExpression(node.value));
+ }
+
+ @override
void visitContinue(tree_ir.Continue node) {
tree_ir.Statement fallthrough = this.fallthrough;
if (node.target.binding == fallthrough) {
@@ -388,13 +437,13 @@
@override
void visitIf(tree_ir.If node) {
accumulator.add(new js.If(visitExpression(node.condition),
- buildBody(node.thenStatement),
- buildBody(node.elseStatement)));
+ buildBodyStatement(node.thenStatement),
+ buildBodyStatement(node.elseStatement)));
}
@override
void visitLabeledStatement(tree_ir.LabeledStatement node) {
- accumulator.add(buildLabeled(() => buildBody(node.body),
+ accumulator.add(buildLabeled(() => buildBodyStatement(node.body),
node.label,
node.next));
visitStatement(node.next);
@@ -414,17 +463,6 @@
}
@override
- void visitAssign(tree_ir.Assign node) {
- tree_ir.Expression value = node.value;
- js.Expression definition = visitExpression(value);
-
- accumulator.add(new js.ExpressionStatement(new js.Assignment(
- buildVariableAccess(node.variable),
- definition)));
- visitStatement(node.next);
- }
-
- @override
void visitBreak(tree_ir.Break node) {
tree_ir.Statement fallthrough = this.fallthrough;
if (node.target.binding.next == fallthrough) {
@@ -450,20 +488,29 @@
}
/// Builds a nested statement.
- js.Statement buildBody(tree_ir.Statement statement) {
+ js.Statement buildBodyStatement(tree_ir.Statement statement) {
List<js.Statement> savedAccumulator = accumulator;
- accumulator = new List<js.Statement>();
+ accumulator = <js.Statement>[];
visitStatement(statement);
js.Statement result = _bodyAsStatement();
accumulator = savedAccumulator;
return result;
}
+ js.Block buildBodyBlock(tree_ir.Statement statement) {
+ List<js.Statement> savedAccumulator = accumulator;
+ accumulator = <js.Statement>[];
+ visitStatement(statement);
+ js.Statement result = new js.Block(accumulator);
+ accumulator = savedAccumulator;
+ return result;
+ }
+
js.Statement buildWhile(js.Expression condition,
tree_ir.Statement body,
tree_ir.Label label,
tree_ir.Statement fallthroughStatement) {
- return buildLabeled(() => new js.While(condition, buildBody(body)),
+ return buildLabeled(() => new js.While(condition, buildBodyStatement(body)),
label,
fallthroughStatement);
}
@@ -490,9 +537,24 @@
}
@override
+ void visitThrow(tree_ir.Throw node) {
+ accumulator.add(new js.Throw(visitExpression(node.value)));
+ }
+
+ @override
+ void visitRethrow(tree_ir.Rethrow node) {
+ glue.reportInternalError('rethrow seen in JavaScript output');
+ }
+
+ @override
void visitTry(tree_ir.Try node) {
- // TODO(kmillikin): implement TryStatement.
- return giveup(node);
+ js.Block tryBlock = buildBodyBlock(node.tryBody);
+ tree_ir.Variable exceptionVariable = node.catchParameters.first;
+ js.VariableDeclaration exceptionParameter =
+ new js.VariableDeclaration(getVariableName(exceptionVariable));
+ js.Block catchBlock = buildBodyBlock(node.catchBody);
+ js.Catch catchPart = new js.Catch(exceptionParameter, catchBlock);
+ accumulator.add(new js.Try(tryBlock, catchPart, null));
}
@override
@@ -503,6 +565,10 @@
@override
js.Expression visitCreateInstance(tree_ir.CreateInstance node) {
ClassElement cls = node.classElement;
+ // TODO(asgerf): To allow inlining of InvokeConstructor, CreateInstance must
+ // carry a DartType so we can register the instantiated type
+ // with its type arguments. Otherwise dataflow analysis is
+ // needed to reconstruct the instantiated type.
registry.registerInstantiatedClass(cls);
js.Expression instance = new js.New(
glue.constructorAccess(cls),
@@ -530,14 +596,12 @@
}
@override
- void visitSetField(tree_ir.SetField node) {
+ js.Assignment visitSetField(tree_ir.SetField node) {
js.PropertyAccess field =
new js.PropertyAccess.field(
visitExpression(node.object),
glue.instanceFieldPropertyName(node.field));
- js.Assignment asn = new js.Assignment(field, visitExpression(node.value));
- accumulator.add(new js.ExpressionStatement(asn));
- visitStatement(node.next);
+ return new js.Assignment(field, visitExpression(node.value));
}
js.Expression buildStaticHelperInvocation(FunctionElement helper,
@@ -596,6 +660,11 @@
return errorUnsupportedNode(node);
}
+ @override
+ visitVariableDeclaration(tree_ir.VariableDeclaration node) {
+ return errorUnsupportedNode(node);
+ }
+
errorUnsupportedNode(tree_ir.DartSpecificNode node) {
throw "Unsupported node in JS backend: $node";
}
diff --git a/pkg/compiler/lib/src/js_backend/codegen/glue.dart b/pkg/compiler/lib/src/js_backend/codegen/glue.dart
index 642e136..47d5b39 100644
--- a/pkg/compiler/lib/src/js_backend/codegen/glue.dart
+++ b/pkg/compiler/lib/src/js_backend/codegen/glue.dart
@@ -11,7 +11,7 @@
import '../../constants/values.dart';
import '../../elements/elements.dart';
import '../../constants/expressions.dart';
-import '../../dart_types.dart' show DartType, TypeVariableType;
+import '../../dart_types.dart' show DartType, TypeVariableType, InterfaceType;
/// Encapsulates the dependencies of the function-compiler to the compiler,
/// backend and emitter.
@@ -20,9 +20,14 @@
class Glue {
final Compiler _compiler;
+ CodegenEnqueuer get _enqueuer => _compiler.enqueuer.codegen;
+
+ FunctionElement get getInterceptorMethod => _backend.getInterceptorMethod;
+
JavaScriptBackend get _backend => _compiler.backend;
CodeEmitterTask get _emitter => _backend.emitter;
+
Namer get _namer => _backend.namer;
Glue(this._compiler);
@@ -71,10 +76,8 @@
return _namer.invocationName(selector);
}
- FunctionElement get getInterceptorMethod => _backend.getInterceptorMethod;
-
void registerUseInterceptorInCodegen() {
- _backend.registerUseInterceptor(_compiler.enqueuer.codegen);
+ _backend.registerUseInterceptor(_enqueuer);
}
bool isInterceptedSelector(Selector selector) {
@@ -121,6 +124,18 @@
_backend.namer.globalObjectFor(_backend.interceptorsLibrary));
}
+ FunctionElement getWrapExceptionHelper() {
+ return _backend.getWrapExceptionHelper();
+ }
+
+ FunctionElement getExceptionUnwrapper() {
+ return _backend.getExceptionUnwrapper();
+ }
+
+ FunctionElement getTraceFromException() {
+ return _backend.getTraceFromException();
+ }
+
FunctionElement getCreateRuntimeType() {
return _backend.getCreateRuntimeType();
}
@@ -137,6 +152,10 @@
return _backend.getGetTypeArgumentByIndex();
}
+ FunctionElement getAddRuntimeTypeInformation() {
+ return _backend.getSetRuntimeTypeInfo();
+ }
+
js.Expression getSubstitutionName(ClassElement cls) {
return js.string(_namer.substitutionName(cls));
}
@@ -155,10 +174,6 @@
});
}
- FunctionElement getAddRuntimeTypeInformation() {
- return _backend.getSetRuntimeTypeInfo();
- }
-
js.Expression generateTypeRepresentation(DartType dartType,
List<js.Expression> arguments) {
int variableIndex = 0;
@@ -168,4 +183,28 @@
assert(variableIndex == arguments.length);
return representation;
}
+
+ bool isNativePrimitiveType(DartType type) {
+ if (type is! InterfaceType) return false;
+ return _backend.isNativePrimitiveType(type.element);
+ }
+
+ void registerIsCheck(DartType type, Registry registry) {
+ _enqueuer.registerIsCheck(type, registry);
+ _backend.registerIsCheckForCodegen(type, _enqueuer, registry);
+ }
+
+ bool isIntClass(ClassElement cls) => cls == _compiler.intClass;
+
+ bool isStringClass(ClassElement cls) => cls == _compiler.stringClass;
+
+ bool isBoolClass(ClassElement cls) => cls == _compiler.boolClass;
+
+ bool isNumClass(ClassElement cls) => cls == _compiler.numClass;
+
+ bool isDoubleClass(ClassElement cls) => cls == _compiler.doubleClass;
+
+ String getTypeTestTag(DartType type) {
+ return _backend.namer.operatorIsType(type);
+ }
}
diff --git a/pkg/compiler/lib/src/js_backend/codegen/js_tree_builder.dart b/pkg/compiler/lib/src/js_backend/codegen/js_tree_builder.dart
index ecd3f59..3499f38 100644
--- a/pkg/compiler/lib/src/js_backend/codegen/js_tree_builder.dart
+++ b/pkg/compiler/lib/src/js_backend/codegen/js_tree_builder.dart
@@ -37,7 +37,7 @@
identicalFunction,
identicalSelector,
<Expression>[getVariableUse(node.left),
- getVariableUse(node.right)]);
+ getVariableUse(node.right)])..isEffectivelyConstant = true;
}
Expression visitInterceptor(cps_ir.Interceptor node) {
@@ -48,7 +48,7 @@
return new InvokeStatic(
getInterceptor,
selector,
- <Expression>[getVariableUse(node.input)]);
+ <Expression>[getVariableUse(node.input)])..isEffectivelyConstant = true;
}
Expression visitGetField(cps_ir.GetField node) {
@@ -56,10 +56,11 @@
}
Statement visitSetField(cps_ir.SetField node) {
- return new SetField(getVariableUse(node.object),
- node.field,
- getVariableUse(node.value),
- visit(node.body));
+ SetField setField =
+ new SetField(getVariableUse(node.object),
+ node.field,
+ getVariableUse(node.value));
+ return new ExpressionStatement(setField, visit(node.body));
}
Expression visitCreateBox(cps_ir.CreateBox node) {
diff --git a/pkg/compiler/lib/src/js_backend/codegen/task.dart b/pkg/compiler/lib/src/js_backend/codegen/task.dart
index a4ef0d9..89cf74c 100644
--- a/pkg/compiler/lib/src/js_backend/codegen/task.dart
+++ b/pkg/compiler/lib/src/js_backend/codegen/task.dart
@@ -10,6 +10,7 @@
import 'unsugar.dart';
import '../js_backend.dart';
+import '../../constants/constant_system.dart';
import '../../dart2jslib.dart';
import '../../cps_ir/cps_ir_nodes.dart' as cps;
import '../../cps_ir/cps_ir_builder.dart';
@@ -20,7 +21,7 @@
ForwardingTypeMask;
import '../../elements/elements.dart';
import '../../js/js.dart' as js;
-import '../../io/source_information.dart' show StartEndSourceInformation;
+import '../../io/source_information.dart' show SourceInformationFactory;
import '../../tree_ir/tree_ir_builder.dart' as tree_builder;
import '../../dart_backend/backend_ast_emitter.dart' as backend_ast_emitter;
import '../../cps_ir/optimizers.dart';
@@ -38,6 +39,7 @@
final ConstantSystem constantSystem;
final Compiler compiler;
final Glue glue;
+ final SourceInformationFactory sourceInformationFactory;
TypeSystem types;
@@ -49,9 +51,10 @@
IrBuilderTask get irBuilderTask => compiler.irBuilder;
CpsFunctionCompiler(Compiler compiler, JavaScriptBackend backend,
- {bool generateSourceMap: true})
+ SourceInformationFactory sourceInformationFactory)
: fallbackCompiler =
- new ssa.SsaFunctionCompiler(backend, generateSourceMap),
+ new ssa.SsaFunctionCompiler(backend, sourceInformationFactory),
+ this.sourceInformationFactory = sourceInformationFactory,
constantSystem = backend.constantSystem,
compiler = compiler,
glue = new Glue(compiler);
@@ -208,10 +211,11 @@
assert(checkTreeIntegrity(node));
}
- applyTreePass(new StatementRewriter());
+ applyTreePass(new StatementRewriter(isDartMode: false));
applyTreePass(new VariableMerger());
applyTreePass(new LoopRewriter());
applyTreePass(new LogicalRewriter());
+ applyTreePass(new PullIntoInitializers());
return node;
}
@@ -219,7 +223,6 @@
js.Fun compileToJavaScript(CodegenWorkItem work,
tree_ir.FunctionDefinition definition) {
CodeGenerator codeGen = new CodeGenerator(glue, work.registry);
-
return attachPosition(codeGen.buildFunction(definition), work.element);
}
@@ -230,6 +233,7 @@
js.Node attachPosition(js.Node node, AstElement element) {
return node.withSourceInformation(
- StartEndSourceInformation.computeSourceInformation(element));
+ sourceInformationFactory.forContext(element)
+ .buildDeclaration(element));
}
}
diff --git a/pkg/compiler/lib/src/js_backend/codegen/type_test_emitter.dart b/pkg/compiler/lib/src/js_backend/codegen/type_test_emitter.dart
new file mode 100644
index 0000000..49b28e6
--- /dev/null
+++ b/pkg/compiler/lib/src/js_backend/codegen/type_test_emitter.dart
@@ -0,0 +1,63 @@
+// Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+part of code_generator;
+
+abstract class TypeTestEmitter {
+ giveup(node, reason);
+ Glue get glue;
+
+ js.Expression emitSubtypeTest(tree_ir.Node node,
+ js.Expression value,
+ DartType type) {
+ return glue.isNativePrimitiveType(type)
+ ? emitNativeSubtypeTest(node, value, type.element)
+ : emitGeneralSubtypeTest(node, value, type);
+ }
+
+ js.Expression emitNativeSubtypeTest(tree_ir.Node node,
+ js.Expression value,
+ ClassElement cls) {
+ if (glue.isIntClass(cls)) {
+ return _emitIntCheck(value);
+ } else if (glue.isStringClass(cls)) {
+ return _emitTypeofCheck(value, 'string');
+ } else if (glue.isBoolClass(cls)) {
+ return _emitTypeofCheck(value, 'boolean');
+ } else if (glue.isNumClass(cls) || glue.isDoubleClass(cls)) {
+ return _emitNumCheck(value);
+ } else {
+ return giveup(value, 'type check unimplemented for ${cls.name}.');
+ }
+ }
+
+ js.Expression emitGeneralSubtypeTest(tree_ir.Node node,
+ js.Expression value,
+ InterfaceType type) {
+ return new js.Binary('&&',
+ new js.Prefix('!!', value),
+ new js.Prefix('!!',
+ new js.PropertyAccess.field(value, glue.getTypeTestTag(type))));
+ }
+
+ js.Expression _emitNumCheck(js.Expression value) {
+ return _emitTypeofCheck(value, 'number');
+ }
+
+ js.Expression _emitBigIntCheck(js.Expression value) {
+ return js.js('Math.floor(#) === #', [value, value]);
+ }
+
+ js.Expression _emitIntCheck(js.Expression value) {
+ return new js.Binary('&&',
+ _emitNumCheck(value),
+ _emitBigIntCheck(value));
+ }
+
+ js.Expression _emitTypeofCheck(js.Expression value, String type) {
+ return new js.Binary('===',
+ new js.Prefix("typeof", value),
+ js.string(type));
+ }
+}
diff --git a/pkg/compiler/lib/src/js_backend/codegen/unsugar.dart b/pkg/compiler/lib/src/js_backend/codegen/unsugar.dart
index a071b47..cf1e3ed 100644
--- a/pkg/compiler/lib/src/js_backend/codegen/unsugar.dart
+++ b/pkg/compiler/lib/src/js_backend/codegen/unsugar.dart
@@ -6,7 +6,8 @@
import '../../cps_ir/optimizers.dart';
import '../../constants/expressions.dart';
import '../../constants/values.dart';
-import '../../elements/elements.dart' show ClassElement, FieldElement, Element;
+import '../../elements/elements.dart'
+ show ClassElement, FieldElement, FunctionElement, Element;
import '../../js_backend/codegen/glue.dart';
import '../../dart2jslib.dart' show Selector, World;
@@ -15,14 +16,21 @@
///
/// Performs the following rewrites:
/// - rewrite [IsTrue] in a [Branch] to do boolean conversion.
+/// - converts two-parameter exception handlers to one-parameter ones.
class UnsugarVisitor extends RecursiveVisitor {
Glue _glue;
+ ParentVisitor _parentVisitor = new ParentVisitor();
+
+ // In a catch block, rethrow implicitly throws the block's exception
+ // parameter. This is the exception parameter when nested in a catch
+ // block and null otherwise.
+ Parameter _exceptionParameter = null;
UnsugarVisitor(this._glue);
void rewrite(FunctionDefinition function) {
// Set all parent pointers.
- new ParentVisitor().visit(function);
+ _parentVisitor.visit(function);
visit(function);
}
@@ -34,7 +42,8 @@
Constant get trueConstant {
return new Constant(
- new PrimitiveConstantExpression(
+ new BoolConstantExpression(
+ true,
new TrueConstantValue()));
}
@@ -47,6 +56,93 @@
let.parent = parent;
}
+ /// Insert a static call to [function] at the point of [node] with result
+ /// [result].
+ ///
+ /// Rewrite [node] to
+ ///
+ /// let cont continuation(result) = node
+ /// in invoke function arguments continuation
+ void insertStaticCall(FunctionElement function, List<Primitive> arguments,
+ Parameter result,
+ Expression node) {
+ InteriorNode parent = node.parent;
+ Continuation continuation = new Continuation([result]);
+ continuation.body = node;
+ _parentVisitor.processContinuation(continuation);
+
+ Selector selector = new Selector.fromElement(function);
+ // TODO(johnniwinther): Come up with an implementation of SourceInformation
+ // for calls such as this one that don't appear in the original source.
+ InvokeStatic invoke =
+ new InvokeStatic(function, selector, arguments, continuation, null);
+ _parentVisitor.processInvokeStatic(invoke);
+
+ LetCont letCont = new LetCont(continuation, invoke);
+ _parentVisitor.processLetCont(letCont);
+
+ parent.body = letCont;
+ letCont.parent = parent;
+ }
+
+ processLetHandler(LetHandler node) {
+ // BEFORE: Handlers have two parameters, exception and stack trace.
+ // AFTER: Handlers have a single parameter, which is unwrapped to get
+ // the exception and stack trace.
+ _exceptionParameter = node.handler.parameters.first;
+ Parameter stackTraceParameter = node.handler.parameters.last;
+ Expression body = node.handler.body;
+ if (_exceptionParameter.hasAtLeastOneUse ||
+ stackTraceParameter.hasAtLeastOneUse) {
+ Parameter exceptionValue = new Parameter(null);
+ exceptionValue.substituteFor(_exceptionParameter);
+ insertStaticCall(_glue.getExceptionUnwrapper(), [_exceptionParameter],
+ exceptionValue, body);
+
+ if (stackTraceParameter.hasAtLeastOneUse) {
+ Parameter stackTraceValue = new Parameter(null);
+ stackTraceValue.substituteFor(stackTraceParameter);
+ insertStaticCall(_glue.getTraceFromException(), [exceptionValue],
+ stackTraceValue, body);
+ }
+ }
+
+ assert(stackTraceParameter.hasNoUses);
+ node.handler.parameters.removeLast();
+ }
+
+ @override
+ visitLetHandler(LetHandler node) {
+ assert(node.handler.parameters.length == 2);
+ Parameter previousExceptionParameter = _exceptionParameter;
+ _exceptionParameter = node.handler.parameters.first;
+ processLetHandler(node);
+ visit(node.handler);
+ _exceptionParameter = previousExceptionParameter;
+
+ visit(node.body);
+ }
+
+ processThrow(Throw node) {
+ // The subexpression of throw is wrapped in the JavaScript output.
+ Parameter value = new Parameter(null);
+ insertStaticCall(_glue.getWrapExceptionHelper(), [node.value.definition],
+ value, node);
+ node.value.unlink();
+ node.value = new Reference<Primitive>(value);
+ }
+
+ processRethrow(Rethrow node) {
+ // Rethrow can only appear in a catch block. It throws that block's
+ // (wrapped) caught exception.
+ Throw replacement = new Throw(_exceptionParameter);
+ InteriorNode parent = node.parent;
+ parent.body = replacement;
+ replacement.parent = parent;
+ // The original rethrow does not have any references that we need to
+ // worry about unlinking.
+ }
+
processInvokeMethod(InvokeMethod node) {
Selector selector = node.selector;
// TODO(karlklose): should we rewrite all selectors?
@@ -67,7 +163,7 @@
Primitive makeNull() {
NullConstantValue nullConst = new NullConstantValue();
- return new Constant(new PrimitiveConstantExpression(nullConst));
+ return new Constant(new NullConstantExpression(nullConst));
}
processInvokeMethodDirectly(InvokeMethodDirectly node) {
diff --git a/pkg/compiler/lib/src/js_backend/constant_emitter.dart b/pkg/compiler/lib/src/js_backend/constant_emitter.dart
index 8f5738f..1b3e95f 100644
--- a/pkg/compiler/lib/src/js_backend/constant_emitter.dart
+++ b/pkg/compiler/lib/src/js_backend/constant_emitter.dart
@@ -272,14 +272,15 @@
Element element = constant.type.element;
if (element.isForeign(backend)
&& element.name == 'JS_CONST') {
- StringConstantValue str = constant.fields[0];
+ StringConstantValue str = constant.fields.values.single;
String value = str.primitiveValue.slowToString();
return new jsAst.LiteralExpression(stripComments(value));
}
jsAst.Expression constructor =
backend.emitter.constructorAccess(constant.type.element);
List<jsAst.Expression> fields =
- constant.fields.map(constantReferenceGenerator).toList(growable: false);
+ constant.fields.values.map(constantReferenceGenerator)
+ .toList(growable: false);
jsAst.New instantiation = new jsAst.New(constructor, fields);
return maybeAddTypeArguments(constant.type, instantiation);
}
diff --git a/pkg/compiler/lib/src/js_backend/constant_handler_javascript.dart b/pkg/compiler/lib/src/js_backend/constant_handler_javascript.dart
index fb24254..0f66c0d 100644
--- a/pkg/compiler/lib/src/js_backend/constant_handler_javascript.dart
+++ b/pkg/compiler/lib/src/js_backend/constant_handler_javascript.dart
@@ -41,11 +41,14 @@
});
}
- ConstantExpression compileNode(Node node, TreeElements elements) {
+ ConstantExpression compileNode(Node node, TreeElements elements,
+ {bool enforceConst: true}) {
return measure(() {
ConstantExpression result =
- dartConstantCompiler.compileNode(node, elements);
- jsConstantCompiler.compileNode(node, elements);
+ dartConstantCompiler.compileNode(node, elements,
+ enforceConst: enforceConst);
+ jsConstantCompiler.compileNode(node, elements,
+ enforceConst: enforceConst);
return result;
});
}
@@ -163,8 +166,9 @@
return initialValue;
}
- ConstantExpression compileNode(Node node, TreeElements elements) {
- return compileNodeWithDefinitions(node, elements);
+ ConstantExpression compileNode(Node node, TreeElements elements,
+ {bool enforceConst: true}) {
+ return compileNodeWithDefinitions(node, elements, isConst: enforceConst);
}
ConstantExpression compileNodeWithDefinitions(Node node,
@@ -213,19 +217,18 @@
void forgetElement(Element element) {
super.forgetElement(element);
- element.accept(new ForgetConstantElementVisitor(this));
+ const ForgetConstantElementVisitor().visit(element, this);
if (element is AstElement && element.hasNode) {
element.node.accept(new ForgetConstantNodeVisitor(this));
}
}
}
-class ForgetConstantElementVisitor extends ElementVisitor {
- final JavaScriptConstantCompiler constants;
+class ForgetConstantElementVisitor
+ extends BaseElementVisitor<dynamic, JavaScriptConstantCompiler> {
+ const ForgetConstantElementVisitor();
- ForgetConstantElementVisitor(this.constants);
-
- void visitElement(Element e) {
+ void visitElement(Element e, JavaScriptConstantCompiler constants) {
for (MetadataAnnotation data in e.metadata) {
constants.metadataConstantMap.remove(data);
if (data.hasNode) {
@@ -234,10 +237,11 @@
}
}
- void visitFunctionElement(FunctionElement e) {
- super.visitFunctionElement(e);
+ void visitFunctionElement(FunctionElement e,
+ JavaScriptConstantCompiler constants) {
+ super.visitFunctionElement(e, constants);
if (e.hasFunctionSignature) {
- e.functionSignature.forEachParameter(this.visit);
+ e.functionSignature.forEachParameter((p) => visit(p, constants));
}
}
}
diff --git a/pkg/compiler/lib/src/js_backend/constant_system_javascript.dart b/pkg/compiler/lib/src/js_backend/constant_system_javascript.dart
index deadc5f..fc97cad 100644
--- a/pkg/compiler/lib/src/js_backend/constant_system_javascript.dart
+++ b/pkg/compiler/lib/src/js_backend/constant_system_javascript.dart
@@ -2,7 +2,16 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-part of js_backend;
+library dart2js.constant_system.js;
+
+import '../constants/constant_system.dart';
+import '../constants/values.dart';
+import '../constant_system_dart.dart';
+import '../dart_types.dart';
+import '../dart2jslib.dart' show Compiler;
+import '../elements/elements.dart' show ClassElement;
+import '../tree/tree.dart' show DartString, LiteralDartString;
+import 'js_backend.dart';
const JAVA_SCRIPT_CONSTANT_SYSTEM = const JavaScriptConstantSystem();
@@ -343,10 +352,6 @@
super(type, keyList.entries, values);
bool get isMap => true;
- TypeMask computeMask(Compiler compiler) {
- return compiler.typesTask.constMapType;
- }
-
List<ConstantValue> getDependencies() {
List<ConstantValue> result = <ConstantValue>[];
if (onlyStringKeys) {
diff --git a/pkg/compiler/lib/src/js_backend/custom_elements_analysis.dart b/pkg/compiler/lib/src/js_backend/custom_elements_analysis.dart
index 9a5c8e98..99c46ca 100644
--- a/pkg/compiler/lib/src/js_backend/custom_elements_analysis.dart
+++ b/pkg/compiler/lib/src/js_backend/custom_elements_analysis.dart
@@ -193,6 +193,7 @@
if (member.isGenerativeConstructor) {
// Ignore constructors that cannot be called with zero arguments.
FunctionElement constructor = member;
+ constructor.computeSignature(compiler);
FunctionSignature parameters = constructor.functionSignature;
if (parameters.requiredParameterCount == 0) {
result.add(member);
diff --git a/pkg/compiler/lib/src/js_backend/js_backend.dart b/pkg/compiler/lib/src/js_backend/js_backend.dart
index c07946b..ad59c4a 100644
--- a/pkg/compiler/lib/src/js_backend/js_backend.dart
+++ b/pkg/compiler/lib/src/js_backend/js_backend.dart
@@ -12,12 +12,15 @@
show JsGetName;
import '../closure.dart';
+import '../compile_time_constants.dart';
+import '../constants/constant_system.dart';
import '../constants/expressions.dart';
import '../constants/values.dart';
import '../dart2jslib.dart';
import '../dart_types.dart';
import '../elements/elements.dart';
import '../io/code_output.dart';
+import '../io/source_information.dart' show SourceInformationFactory;
import '../js/js.dart' as jsAst;
import '../js/js.dart' show js;
import '../js_emitter/js_emitter.dart'
@@ -37,17 +40,18 @@
import '../util/util.dart';
import '../elements/visitor.dart' show
- ElementVisitor;
+ BaseElementVisitor;
import '../js_backend/codegen/task.dart';
-import 'patch_resolver.dart';
import '../resolution/resolution.dart' show ResolutionRegistry;
+import 'constant_system_javascript.dart';
+import 'patch_resolver.dart';
+
part 'backend.dart';
part 'checked_mode_helpers.dart';
part 'constant_emitter.dart';
part 'constant_handler_javascript.dart';
-part 'constant_system_javascript.dart';
part 'custom_elements_analysis.dart';
part 'minify_namer.dart';
part 'namer.dart';
diff --git a/pkg/compiler/lib/src/js_backend/namer.dart b/pkg/compiler/lib/src/js_backend/namer.dart
index af5ac3b..4e15e5d 100644
--- a/pkg/compiler/lib/src/js_backend/namer.dart
+++ b/pkg/compiler/lib/src/js_backend/namer.dart
@@ -245,6 +245,9 @@
// next-generation plugin, this results in starting a new Java process.
"java", "Packages", "netscape", "sun", "JavaObject", "JavaClass",
"JavaArray", "JavaMember",
+
+ // ES6 collections.
+ "Map",
];
static const List<String> reservedGlobalObjectNames = const <String>[
@@ -399,6 +402,7 @@
JavaScriptBackend get backend => compiler.backend;
+ String get deferredTypesName => 'deferredTypes';
String get isolateName => 'Isolate';
String get isolatePropertiesName => r'$isolateProperties';
String get noSuchMethodName => publicInstanceMethodNameByArity(
@@ -1504,8 +1508,8 @@
@override
void visitConstructed(ConstructedConstantValue constant, [_]) {
addRoot(constant.type.element.name);
- for (int i = 0; i < constant.fields.length; i++) {
- _visit(constant.fields[i]);
+ for (ConstantValue value in constant.fields.values) {
+ _visit(value);
if (failed) return;
}
}
@@ -1608,8 +1612,8 @@
@override
int visitConstructed(ConstructedConstantValue constant, [_]) {
int hash = _hashString(3, constant.type.element.name);
- for (int i = 0; i < constant.fields.length; i++) {
- hash = _combine(hash, _visit(constant.fields[i]));
+ for (ConstantValue value in constant.fields.values) {
+ hash = _combine(hash, _visit(value));
}
return hash;
}
@@ -1710,7 +1714,7 @@
}
}
-class FunctionTypeNamer extends DartTypeVisitor {
+class FunctionTypeNamer extends BaseDartTypeVisitor {
final Compiler compiler;
StringBuffer sb;
@@ -1724,7 +1728,7 @@
return sb.toString();
}
- visit(DartType type) {
+ visit(DartType type, [_]) {
type.accept(this, null);
}
diff --git a/pkg/compiler/lib/src/js_backend/runtime_types.dart b/pkg/compiler/lib/src/js_backend/runtime_types.dart
index 8aefed6..e14487f 100644
--- a/pkg/compiler/lib/src/js_backend/runtime_types.dart
+++ b/pkg/compiler/lib/src/js_backend/runtime_types.dart
@@ -607,7 +607,7 @@
}
}
-class TypeRepresentationGenerator extends DartTypeVisitor {
+class TypeRepresentationGenerator implements DartTypeVisitor {
final Compiler compiler;
OnVariableCallback onVariable;
ShouldEncodeTypedefCallback shouldEncodeTypedef;
@@ -638,9 +638,8 @@
return backend.emitter.typeAccess(element);
}
- visit(DartType type) {
- return type.accept(this, null);
- }
+ @override
+ visit(DartType type, [_]) => type.accept(this, null);
visitTypeVariableType(TypeVariableType type, _) {
return onVariable(type);
@@ -673,6 +672,21 @@
return new jsAst.ArrayInitializer(elements);
}
+ /// Returns the JavaScript template to determine at runtime if a type object
+ /// is a function type.
+ jsAst.Template get templateForIsFunctionType {
+ return jsAst.js.expressionTemplateFor("'${namer.functionTypeTag}' in #");
+ }
+
+ /// Returns the JavaScript template that creates at runtime a new function
+ /// type object.
+ jsAst.Template get templateForCreateFunctionType {
+ // The value of the functionTypeTag can be anything. We use "dynaFunc" for
+ // easier debugging.
+ return jsAst.js.expressionTemplateFor(
+ '{ ${namer.functionTypeTag}: "dynafunc" }');
+ }
+
visitFunctionType(FunctionType type, _) {
List<jsAst.Property> properties = <jsAst.Property>[];
@@ -680,7 +694,9 @@
properties.add(new jsAst.Property(js.string(name), value));
}
- addProperty(namer.functionTypeTag, js.string(''));
+ // Type representations for functions have a property which is a tag marking
+ // them as function types. The value is not used, so '1' is just a dummy.
+ addProperty(namer.functionTypeTag, js.number(1));
if (type.returnType.isVoid) {
addProperty(namer.functionTypeVoidReturnTag, js('true'));
} else if (!type.returnType.treatAsDynamic) {
@@ -738,7 +754,7 @@
}
}
- visitType(DartType type, _) {
+ visitStatementType(StatementType type, _) {
compiler.internalError(NO_LOCATION_SPANNABLE,
'Unexpected type: $type (${type.kind}).');
}
@@ -779,25 +795,17 @@
ArgumentCollector(this.backend);
collect(DartType type, {bool isTypeArgument: false}) {
- type.accept(this, isTypeArgument);
+ visit(type, isTypeArgument);
}
/// Collect all types in the list as if they were arguments of an
/// InterfaceType.
collectAll(List<DartType> types) {
for (DartType type in types) {
- type.accept(this, true);
+ visit(type, true);
}
}
- visitType(DartType type, _) {
- // Do nothing.
- }
-
- visitDynamicType(DynamicType type, _) {
- // Do not collect [:dynamic:].
- }
-
visitTypedefType(TypedefType type, bool isTypeArgument) {
type.unalias(backend.compiler).accept(this, isTypeArgument);
}
@@ -819,25 +827,17 @@
FunctionArgumentCollector(this.backend);
collect(DartType type) {
- type.accept(this, false);
+ visit(type, false);
}
/// Collect all types in the list as if they were arguments of an
/// InterfaceType.
collectAll(Link<DartType> types) {
- for (Link<DartType> link = types; !link.isEmpty; link = link.tail) {
- link.head.accept(this, true);
+ for (DartType type in types) {
+ visit(type, true);
}
}
- visitType(DartType type, _) {
- // Do nothing.
- }
-
- visitDynamicType(DynamicType type, _) {
- // Do not collect [:dynamic:].
- }
-
visitTypedefType(TypedefType type, bool inFunctionType) {
type.unalias(backend.compiler).accept(this, inFunctionType);
}
diff --git a/pkg/compiler/lib/src/js_backend/type_variable_handler.dart b/pkg/compiler/lib/src/js_backend/type_variable_handler.dart
index bf9a5f2..6344a1d 100644
--- a/pkg/compiler/lib/src/js_backend/type_variable_handler.dart
+++ b/pkg/compiler/lib/src/js_backend/type_variable_handler.dart
@@ -8,60 +8,66 @@
* Handles construction of TypeVariable constants needed at runtime.
*/
class TypeVariableHandler {
- JavaScriptBackend backend;
- FunctionElement typeVariableConstructor;
- CompileTimeConstantEvaluator evaluator;
+ final Compiler _compiler;
+ FunctionElement _typeVariableConstructor;
+ CompileTimeConstantEvaluator _evaluator;
/**
- * Contains all instantiated classes that have type variables and are needed
- * for reflection.
+ * Set to 'true' on first encounter of a class with type variables.
*/
- List<ClassElement> typeVariableClasses = new List<ClassElement>();
+ bool _seenClassesWithTypeVariables = false;
/**
* Maps a class element to a list with indices that point to type variables
* constants for each of the class' type variables.
*/
- Map<ClassElement, List<int>> typeVariables =
+ Map<ClassElement, List<int>> _typeVariables =
new Map<ClassElement, List<int>>();
/**
* Maps a TypeVariableType to the index pointing to the constant representing
* the corresponding type variable at runtime.
*/
- Map<TypeVariableElement, int> typeVariableConstants =
+ Map<TypeVariableElement, int> _typeVariableConstants =
new Map<TypeVariableElement, int>();
- TypeVariableHandler(this.backend);
+ TypeVariableHandler(this._compiler);
- ClassElement get typeVariableClass => backend.typeVariableClass;
- CodeEmitterTask get task => backend.emitter;
- MetadataCollector get metadataCollector => task.metadataCollector;
- Compiler get compiler => backend.compiler;
+ ClassElement get _typeVariableClass => _backend.typeVariableClass;
+ CodeEmitterTask get _task => _backend.emitter;
+ MetadataCollector get _metadataCollector => _task.metadataCollector;
+ JavaScriptBackend get _backend => _compiler.backend;
- void registerClassWithTypeVariables(ClassElement cls) {
- if (typeVariableClasses != null) {
- typeVariableClasses.add(cls);
+ void registerClassWithTypeVariables(ClassElement cls, Enqueuer enqueuer,
+ Registry registry) {
+ if (enqueuer.isResolutionQueue) {
+ // On first encounter, we have to ensure that the support classes get
+ // resolved.
+ if (!_seenClassesWithTypeVariables) {
+ _backend.enqueueClass(
+ enqueuer, _typeVariableClass, registry);
+ _typeVariableClass.ensureResolved(_compiler);
+ Link constructors = _typeVariableClass.constructors;
+ if (constructors.isEmpty && constructors.tail.isEmpty) {
+ _compiler.internalError(_typeVariableClass,
+ "Class '$_typeVariableClass' should only have one constructor");
+ }
+ _typeVariableConstructor = _typeVariableClass.constructors.head;
+ _backend.enqueueInResolution(_typeVariableConstructor, registry);
+ enqueuer.registerInstantiatedType(_typeVariableClass.rawType,
+ registry);
+ enqueuer.registerStaticUse(_backend.getCreateRuntimeType());
+ _seenClassesWithTypeVariables = true;
+ }
+ } else {
+ if (_backend.isAccessibleByReflection(cls)) {
+ _processTypeVariablesOf(cls);
+ }
}
}
- void processTypeVariablesOf(ClassElement cls) {
- //TODO(zarah): Running through all the members is suboptimal. Change this
- // as part of marking elements for reflection.
- bool hasMemberNeededForReflection(ClassElement cls) {
- bool result = false;
- cls.implementation.forEachMember((ClassElement cls, Element member) {
- result = result || backend.referencedFromMirrorSystem(member);
- });
- return result;
- }
-
- if (!backend.referencedFromMirrorSystem(cls) &&
- !hasMemberNeededForReflection(cls)) {
- return;
- }
-
- InterfaceType typeVariableType = typeVariableClass.thisType;
+ void _processTypeVariablesOf(ClassElement cls) {
+ InterfaceType typeVariableType = _typeVariableClass.thisType;
List<int> constants = <int>[];
for (TypeVariableType currentTypeVariable in cls.typeVariables) {
@@ -69,17 +75,19 @@
AstConstant wrapConstant(ConstantExpression constant) {
return new AstConstant(typeVariableElement,
- typeVariableElement.node,
- constant);
+ typeVariableElement.node,
+ constant);
}
- ConstantExpression name = new PrimitiveConstantExpression(
- backend.constantSystem.createString(
+ ConstantExpression name = new StringConstantExpression(
+ currentTypeVariable.name,
+ _backend.constantSystem.createString(
new DartString.literal(currentTypeVariable.name)));
- ConstantExpression bound = new PrimitiveConstantExpression(
- backend.constantSystem.createInt(
- metadataCollector.reifyType(typeVariableElement.bound)));
- ConstantExpression type = backend.constants.createTypeConstant(cls);
+ int boundIndex = _metadataCollector.reifyType(typeVariableElement.bound);
+ ConstantExpression bound = new IntConstantExpression(
+ boundIndex,
+ _backend.constantSystem.createInt(boundIndex));
+ ConstantExpression type = _backend.constants.createTypeConstant(cls);
List<AstConstant> arguments =
[wrapConstant(type), wrapConstant(name), wrapConstant(bound)];
@@ -87,45 +95,24 @@
// constructed constants.
AstConstant constant =
CompileTimeConstantEvaluator.makeConstructedConstant(
- compiler,
- backend.constants,
+ _compiler,
+ _backend.constants,
typeVariableElement,
typeVariableElement.node,
typeVariableType,
- typeVariableConstructor,
+ _typeVariableConstructor,
+ typeVariableType,
+ _typeVariableConstructor,
const CallStructure.unnamed(3),
arguments,
arguments);
ConstantValue value = constant.value;
- backend.registerCompileTimeConstant(value, compiler.globalDependencies);
- backend.constants.addCompileTimeConstantForEmission(value);
+ _backend.registerCompileTimeConstant(value, _compiler.globalDependencies);
+ _backend.constants.addCompileTimeConstantForEmission(value);
constants.add(
- reifyTypeVariableConstant(value, currentTypeVariable.element));
+ _reifyTypeVariableConstant(value, currentTypeVariable.element));
}
- typeVariables[cls] = constants;
- }
-
- void onTreeShakingDisabled(Enqueuer enqueuer) {
- if (enqueuer.isResolutionQueue) {
- backend.enqueueClass(
- enqueuer, typeVariableClass, compiler.globalDependencies);
- typeVariableClass.ensureResolved(compiler);
- Link constructors = typeVariableClass.constructors;
- if (constructors.isEmpty && constructors.tail.isEmpty) {
- compiler.internalError(typeVariableClass,
- "Class '$typeVariableClass' should only have one constructor");
- }
- typeVariableConstructor = typeVariableClass.constructors.head;
- backend.enqueueInResolution(typeVariableConstructor,
- compiler.globalDependencies);
- enqueuer.registerInstantiatedType(typeVariableClass.rawType,
- compiler.globalDependencies);
- enqueuer.registerStaticUse(backend.getCreateRuntimeType());
- } else if (typeVariableClasses != null) {
- List<ClassElement> worklist = typeVariableClasses;
- typeVariableClasses = null;
- worklist.forEach((cls) => processTypeVariablesOf(cls));
- }
+ _typeVariables[cls] = constants;
}
/**
@@ -136,16 +123,16 @@
* entry in the list has already been reserved and the constant is added
* there, otherwise a new entry for [c] is created.
*/
- int reifyTypeVariableConstant(ConstantValue c, TypeVariableElement variable) {
- String name = jsAst.prettyPrint(task.constantReference(c),
- compiler).getText();
+ int _reifyTypeVariableConstant(ConstantValue c, TypeVariableElement variable) {
+ String name = jsAst.prettyPrint(_task.constantReference(c),
+ _compiler).getText();
int index;
- if (typeVariableConstants.containsKey(variable)) {
- index = typeVariableConstants[variable];
- metadataCollector.globalMetadata[index] = name;
+ if (_typeVariableConstants.containsKey(variable)) {
+ index = _typeVariableConstants[variable];
+ _metadataCollector.globalMetadata[index] = name;
} else {
- index = metadataCollector.addGlobalMetadata(name);
- typeVariableConstants[variable] = index;
+ index = _metadataCollector.addGlobalMetadata(name);
+ _typeVariableConstants[variable] = index;
}
return index;
}
@@ -161,18 +148,18 @@
* on the allocated entry.
*/
int reifyTypeVariable(TypeVariableElement variable) {
- if (typeVariableConstants.containsKey(variable)) {
- return typeVariableConstants[variable];
+ if (_typeVariableConstants.containsKey(variable)) {
+ return _typeVariableConstants[variable];
}
// TODO(15613): Remove quotes.
- metadataCollector.globalMetadata.add('"Placeholder for ${variable}"');
- return typeVariableConstants[variable] =
- metadataCollector.globalMetadata.length - 1;
+ _metadataCollector.globalMetadata.add('"Placeholder for ${variable}"');
+ return _typeVariableConstants[variable] =
+ _metadataCollector.globalMetadata.length - 1;
}
List<int> typeVariablesOf(ClassElement classElement) {
- List<int> result = typeVariables[classElement];
+ List<int> result = _typeVariables[classElement];
if (result == null) {
result = const <int>[];
}
diff --git a/pkg/compiler/lib/src/js_emitter/code_emitter_task.dart b/pkg/compiler/lib/src/js_emitter/code_emitter_task.dart
index dc22368..23c282e 100644
--- a/pkg/compiler/lib/src/js_emitter/code_emitter_task.dart
+++ b/pkg/compiler/lib/src/js_emitter/code_emitter_task.dart
@@ -124,6 +124,11 @@
return emitter.typeAccess(e);
}
+ /// Returns the JS template for the given [builtin].
+ jsAst.Template builtinTemplateFor(JsBuiltin builtin) {
+ return emitter.templateForBuiltin(builtin);
+ }
+
void registerReadTypeVariable(TypeVariableElement element) {
readTypeVariables.add(element);
}
@@ -449,5 +454,8 @@
/// Returns the JS code for accessing the given [constant].
jsAst.Expression constantReference(ConstantValue constant);
+ /// Returns the JS template for the given [builtin].
+ jsAst.Template templateForBuiltin(JsBuiltin builtin);
+
void invalidateCaches();
}
diff --git a/pkg/compiler/lib/src/js_emitter/js_emitter.dart b/pkg/compiler/lib/src/js_emitter/js_emitter.dart
index 510933b..3b4bfa0 100644
--- a/pkg/compiler/lib/src/js_emitter/js_emitter.dart
+++ b/pkg/compiler/lib/src/js_emitter/js_emitter.dart
@@ -87,6 +87,8 @@
import 'package:_internal/compiler/js_lib/shared/embedded_names.dart'
as embeddedNames;
+import 'package:_internal/compiler/js_lib/shared/embedded_names.dart' show
+ JsBuiltin;
import '../native/native.dart' as native;
part 'class_stub_generator.dart';
diff --git a/pkg/compiler/lib/src/js_emitter/metadata_collector.dart b/pkg/compiler/lib/src/js_emitter/metadata_collector.dart
index 9876dac..bd4ab29 100644
--- a/pkg/compiler/lib/src/js_emitter/metadata_collector.dart
+++ b/pkg/compiler/lib/src/js_emitter/metadata_collector.dart
@@ -15,12 +15,13 @@
/// A map used to canonicalize the entries of globalMetadata.
final Map<String, int> _globalMetadataMap = <String, int>{};
- /// A list of JS expression representing types including function types and
- /// typedefs.
- final List<String> types = <String>[];
+ /// A map with lists of JS expressions, one list for each output unit. The
+ /// entries represent types including function types and typedefs.
+ final Map<OutputUnit, List<String>> types = <OutputUnit, List<String>>{};
/// A map used to canonicalize the entries of types.
- final Map<String, int> _typesMap = <String, int>{};
+ final Map<OutputUnit, Map<String, int>> _typesMap =
+ <OutputUnit, Map<String, int>>{};
MetadataCollector(this._compiler, this._emitter);
@@ -90,11 +91,19 @@
_emitter.constantReference(constant.value), _compiler).getText());
}
- int reifyType(DartType type) {
+ int reifyType(DartType type, {bool ignoreTypeVariables: false}) {
+ return reifyTypeForOutputUnit(type,
+ _compiler.deferredLoadTask.mainOutputUnit,
+ ignoreTypeVariables: ignoreTypeVariables);
+ }
+
+ int reifyTypeForOutputUnit(DartType type, OutputUnit outputUnit,
+ {bool ignoreTypeVariables: false}) {
jsAst.Expression representation =
_backend.rti.getTypeRepresentation(
type,
(variable) {
+ if (ignoreTypeVariables) return new jsAst.LiteralNull();
return js.number(
_typeVariableHandler.reifyTypeVariable(
variable.element));
@@ -103,8 +112,8 @@
return _backend.isAccessibleByReflection(typedef.element);
});
- return addType(
- jsAst.prettyPrint(representation, _compiler).getText());
+ return addTypeInOutputUnit(
+ jsAst.prettyPrint(representation, _compiler).getText(), outputUnit);
}
int reifyName(String name) {
@@ -118,10 +127,17 @@
});
}
- int addType(String compiledType) {
- return _typesMap.putIfAbsent(compiledType, () {
- types.add(compiledType);
- return types.length - 1;
+ int addTypeInOutputUnit(String compiledType, OutputUnit outputUnit) {
+ if (_typesMap[outputUnit] == null) {
+ _typesMap[outputUnit] = <String, int>{};
+ }
+ return _typesMap[outputUnit].putIfAbsent(compiledType, () {
+
+ if (types[outputUnit] == null)
+ types[outputUnit] = <String>[];
+
+ types[outputUnit].add(compiledType);
+ return types[outputUnit].length - 1;
});
}
diff --git a/pkg/compiler/lib/src/js_emitter/model.dart b/pkg/compiler/lib/src/js_emitter/model.dart
index 5a49cf1..7fa389b 100644
--- a/pkg/compiler/lib/src/js_emitter/model.dart
+++ b/pkg/compiler/lib/src/js_emitter/model.dart
@@ -55,20 +55,23 @@
/// data.
List<String> get metadata => _metadataCollector.globalMetadata;
- /// A list of pretty-printed JavaScript expressions.
+ /// A map with lists of pretty-printed JavaScript expressions.
///
- /// This list must be emitted in the `TYPES` embedded global.
- /// The list references constants and must hence be emitted after constants
- /// have been initialized.
+ /// There is one list for each output unit. The list belonging to the main
+ /// unit must be emitted in the `TYPES` embedded global. The list references
+ /// constants and must hence be emitted after constants have been initialized.
///
/// Note: the metadata is derived from the task's `metadataCollector`. The
/// list must not be emitted before all operations on it are done. For
/// example, the old emitter generates metadata when emitting reflection
/// data.
- List<String> get metadataTypes => _metadataCollector.types;
+ Map<OutputUnit, List<String>> get metadataTypes
+ => _metadataCollector.types;
+
bool get isSplit => fragments.length > 1;
Iterable<Fragment> get deferredFragments => fragments.skip(1);
+ Fragment get mainFragment => fragments.first;
}
/**
diff --git a/pkg/compiler/lib/src/js_emitter/new_emitter/emitter.dart b/pkg/compiler/lib/src/js_emitter/new_emitter/emitter.dart
index ef11a58..6a55d08 100644
--- a/pkg/compiler/lib/src/js_emitter/new_emitter/emitter.dart
+++ b/pkg/compiler/lib/src/js_emitter/new_emitter/emitter.dart
@@ -4,6 +4,9 @@
library dart2js.new_js_emitter.emitter;
+import 'package:_internal/compiler/js_lib/shared/embedded_names.dart' show
+ JsBuiltin;
+
import '../program_builder.dart' show ProgramBuilder;
import '../model.dart';
import 'model_emitter.dart';
@@ -21,11 +24,16 @@
import '../js_emitter.dart' as emitterTask show
Emitter;
+import '../../util/util.dart' show
+ NO_LOCATION_SPANNABLE;
+
class Emitter implements emitterTask.Emitter {
final Compiler _compiler;
final Namer namer;
final ModelEmitter _emitter;
+ JavaScriptBackend get _backend => _compiler.backend;
+
Emitter(Compiler compiler, Namer namer, NativeEmitter nativeEmitter)
: this._compiler = compiler,
this.namer = namer,
@@ -66,12 +74,12 @@
}
js.PropertyAccess _globalPropertyAccess(Element element) {
- String name = namer.globalPropertyName(element);
- js.PropertyAccess pa = new js.PropertyAccess.field(
- new js.VariableUse(namer.globalObjectFor(element)),
- name);
- return pa;
- }
+ String name = namer.globalPropertyName(element);
+ js.PropertyAccess pa = new js.PropertyAccess.field(
+ new js.VariableUse(namer.globalObjectFor(element)),
+ name);
+ return pa;
+ }
@override
js.Expression isolateLazyInitializerAccess(FieldElement element) {
@@ -122,5 +130,42 @@
}
@override
- void invalidateCaches() {}
+ js.Template templateForBuiltin(JsBuiltin builtin) {
+ String typeNameProperty = ModelEmitter.typeNameProperty;
+
+ switch (builtin) {
+ case JsBuiltin.dartObjectConstructor:
+ return js.js.expressionTemplateYielding(
+ typeAccess(_compiler.objectClass));
+
+ case JsBuiltin.isFunctionType:
+ return _backend.rti.representationGenerator.templateForIsFunctionType;
+
+ case JsBuiltin.isFunctionTypeLiteral:
+ String functionClassName =
+ _backend.namer.runtimeTypeName(_compiler.functionClass);
+
+ return js.js.expressionTemplateFor(
+ '#.$typeNameProperty === "$functionClassName"');
+
+ case JsBuiltin.typeName:
+ return js.js.expressionTemplateFor("#.$typeNameProperty");
+
+ case JsBuiltin.rawRuntimeType:
+ return js.js.expressionTemplateFor("#.constructor");
+
+ case JsBuiltin.createFunctionType:
+ return _backend.rti.representationGenerator
+ .templateForCreateFunctionType;
+
+ default:
+ _compiler.internalError(NO_LOCATION_SPANNABLE,
+ "Unhandled Builtin: $builtin");
+ return null;
+ }
+ }
+
+ @override
+ void invalidateCaches() {
+ }
}
diff --git a/pkg/compiler/lib/src/js_emitter/new_emitter/model_emitter.dart b/pkg/compiler/lib/src/js_emitter/new_emitter/model_emitter.dart
index 32c5a63..23646b7 100644
--- a/pkg/compiler/lib/src/js_emitter/new_emitter/model_emitter.dart
+++ b/pkg/compiler/lib/src/js_emitter/new_emitter/model_emitter.dart
@@ -50,6 +50,8 @@
static const String deferredExtension = "part.js";
+ static const String typeNameProperty = r"builtin$cls";
+
ModelEmitter(Compiler compiler, Namer namer, this.nativeEmitter)
: this.compiler = compiler,
this.namer = namer {
@@ -132,7 +134,9 @@
// deferred hash (which depends on the output) when emitting the main
// fragment.
fragments.skip(1).forEach((DeferredFragment deferredUnit) {
- js.Expression ast = emitDeferredFragment(deferredUnit, program.holders);
+ List<String> types = program.metadataTypes[deferredUnit.outputUnit];
+ js.Expression ast = emitDeferredFragment(types, deferredUnit,
+ program.holders);
String code = js.prettyPrint(ast, compiler).getText();
totalSize += code.length;
compiler.outputProvider(deferredUnit.outputFileName, deferredExtension)
@@ -384,15 +388,19 @@
globals.add(new js.Property(js.string(IS_HUNK_INITIALIZED),
isHunkInitializedFunction));
+ js.Expression typesAccess = generateEmbeddedGlobalAccess(TYPES);
+
/// See [emitEmbeddedGlobalsForDeferredLoading] for the format of the
/// deferred hunk.
js.Expression initializeLoadedHunkFunction =
js.js("""
function(hash) {
var hunk = $deferredInitializersGlobal[hash];
- $setupProgramName(hunk[0]);
+ $setupProgramName(hunk[0], #typesAccess.length);
eval(hunk[1]);
- }""");
+ var deferredTypes = eval(hunk[2]);
+ #typesAccess.push.apply(#typesAccess, deferredTypes);
+ }""", {'typesAccess': typesAccess});
globals.add(new js.Property(js.string(INITIALIZE_LOADED_HUNK),
initializeLoadedHunkFunction));
@@ -420,12 +428,16 @@
}
metadataGlobals.add(createGlobal(program.metadata, METADATA));
- metadataGlobals.add(createGlobal(program.metadataTypes, TYPES));
+ List<String> types =
+ program.metadataTypes[program.fragments.first.outputUnit];
+ if (types == null) types = <String>[];
+ metadataGlobals.add(createGlobal(types, TYPES));
return metadataGlobals;
}
- js.Expression emitDeferredFragment(DeferredFragment fragment,
+ js.Expression emitDeferredFragment(List<String> types,
+ DeferredFragment fragment,
List<Holder> holders) {
// TODO(floitsch): initialize eager classes.
// TODO(floitsch): the hash must depend on the output.
@@ -447,8 +459,14 @@
emitEagerClassInitializations(fragment.libraries);
js.LiteralString immediateString = unparse(compiler, immediateCode);
+
+ js.Expression deferredTypes = types == null
+ ? js.string("[]")
+ : js.string("[${types.join(",")}]");
+
js.ArrayInitializer hunk =
- new js.ArrayInitializer([deferredArray, immediateString]);
+ new js.ArrayInitializer([deferredArray, immediateString,
+ deferredTypes]);
return js.js("$deferredInitializersGlobal[$hash] = #", hunk);
}
@@ -663,7 +681,7 @@
/// * [DartMethod.optionalParameterDefaultValues]
static final String parseFunctionDescriptorBoilerplate = r"""
-function parseFunctionDescriptor(proto, name, descriptor) {
+function parseFunctionDescriptor(proto, name, descriptor, typesOffset) {
if (descriptor instanceof Array) {
// 'pos' points to the last read entry.
var f, pos = -1;
@@ -685,6 +703,9 @@
isIntercepted = descriptor[++pos];
tearOffName = descriptor[++pos];
reflectionInfo = descriptor[++pos];
+ if (typeof reflectionInfo == "number") {
+ reflectionInfo = reflectionInfo + typesOffset;
+ }
}
// We iterate in blocks of 3 but have to stop before we reach the (optional)
@@ -839,19 +860,20 @@
// Counter to generate unique names for tear offs.
var functionCounter = 0;
- function $setupProgramName(program) {
+ function $setupProgramName(program, typesOffset) {
for (var i = 0; i < program.length - 2; i++) {
- setupLibrary(program[i]);
+ setupLibrary(program[i], typesOffset);
}
setupLazyStatics(program[i]);
setupConstants(program[i + 1]);
}
- function setupLibrary(library) {
+ function setupLibrary(library, typesOffset) {
var statics = library[0];
for (var i = 0; i < statics.length; i += 3) {
var holderIndex = statics[i + 1];
- setupStatic(statics[i], holders[holderIndex], statics[i + 2]);
+ setupStatic(statics[i], holders[holderIndex], statics[i + 2],
+ typesOffset);
}
var classes = library[1];
@@ -876,7 +898,7 @@
}
holdersMap[name] = holders[holderIndex];
- setupClass(name, holders[holderIndex], cls);
+ setupClass(name, holders[holderIndex], cls, typesOffset);
}
}
@@ -902,7 +924,7 @@
}
}
- function setupStatic(name, holder, descriptor) {
+ function setupStatic(name, holder, descriptor, typesOffset) {
if (typeof descriptor == 'string') {
holder[name] = function() {
if (descriptor == null) {
@@ -918,7 +940,7 @@
} else {
// Parse the tear off information and generate compile handlers.
// TODO(herhut): Share parser with instance methods.
- function compileAllStubs() {
+ function compileAllStubs(typesOffset) {
var funs;
var fun = compile(name, descriptor[0]);
fun[#callName] = descriptor[1];
@@ -936,8 +958,12 @@
}
if (descriptor[2] != null) { // tear-off name.
// functions, reflectionInfo, isStatic, name, isIntercepted.
+ var reflectionInfo = descriptor[3];
+ if (typeof reflectionInfo == "number") {
+ reflectionInfo = reflectionInfo + typesOffset;
+ }
holder[descriptor[2]] =
- tearOff(funs, descriptor[3], true, name, false);
+ tearOff(funs, reflectionInfo, true, name, false);
}
if (pos < descriptor.length) {
fun[#argumentCount] = descriptor[pos];
@@ -945,25 +971,25 @@
}
}
- function setupCompileAllAndDelegateStub(name) {
+ function setupCompileAllAndDelegateStub(name, typesOffset) {
holder[name] = function() {
// The descriptor is null if we already compiled this function. This
// happens when we have calls to the static as arguments to the
// static: `foo(foo(499))`;
if (descriptor != null) {
- compileAllStubs();
+ compileAllStubs(typesOffset);
descriptor = null; // GC the descriptor.
}
return holder[name].apply(this, arguments);
};
}
- setupCompileAllAndDelegateStub(name);
+ setupCompileAllAndDelegateStub(name, typesOffset);
for (var pos = 4; pos < descriptor.length; pos += 3) {
- setupCompileAllAndDelegateStub(descriptor[pos]);
+ setupCompileAllAndDelegateStub(descriptor[pos], typesOffset);
}
if (descriptor[2] != null) { // tear-off name.
- setupCompileAllAndDelegateStub(descriptor[2])
+ setupCompileAllAndDelegateStub(descriptor[2], typesOffset)
}
}
}
@@ -1006,11 +1032,11 @@
};
}
- function setupClass(name, holder, descriptor) {
+ function setupClass(name, holder, descriptor, typesOffset) {
var patch = function() {
if (patch.ensureResolved == patch) {
// We have not yet been compiled.
- var constructor = compileConstructor(name, descriptor);
+ var constructor = compileConstructor(name, descriptor, typesOffset);
holder[name] = constructor;
name = holder = descriptor = null; // GC the captured arguments.
// Make sure we can invoke 'ensureResolved' multiple times on the patch
@@ -1039,7 +1065,7 @@
#parseFunctionDescriptor;
- function compileConstructor(name, descriptor) {
+ function compileConstructor(name, descriptor, typesOffset) {
descriptor = compile(name, descriptor);
var prototype = determinePrototype(descriptor);
var constructor;
@@ -1062,10 +1088,11 @@
}
for (var i = functionsIndex; i < descriptor.length; i += 2) {
- parseFunctionDescriptor(prototype, descriptor[i], descriptor[i + 1]);
+ parseFunctionDescriptor(prototype, descriptor[i], descriptor[i + 1],
+ typesOffset);
}
- constructor.builtin\$cls = name; // Needed for RTI.
+ constructor.$typeNameProperty = name; // Needed for RTI.
constructor.prototype = prototype;
prototype[#operatorIsPrefix + name] = constructor;
prototype.constructor = constructor;
@@ -1126,7 +1153,7 @@
}
}
- $setupProgramName(program);
+ $setupProgramName(program, 0);
// Initialize globals.
#embeddedGlobals;
diff --git a/pkg/compiler/lib/src/js_emitter/old_emitter/class_emitter.dart b/pkg/compiler/lib/src/js_emitter/old_emitter/class_emitter.dart
index cd1c967..dc1f7da 100644
--- a/pkg/compiler/lib/src/js_emitter/old_emitter/class_emitter.dart
+++ b/pkg/compiler/lib/src/js_emitter/old_emitter/class_emitter.dart
@@ -12,7 +12,7 @@
/**
* Documentation wanted -- johnniwinther
*/
- void emitClass(Class cls, ClassBuilder enclosingBuilder) {
+ void emitClass(Class cls, ClassBuilder enclosingBuilder, Fragment fragment) {
ClassElement classElement = cls.element;
assert(invariant(classElement, classElement.isDeclaration));
@@ -52,7 +52,8 @@
builder.addProperty(name, function);
}
- emitClassBuilderWithReflectionData(cls, builder, enclosingBuilder);
+ emitClassBuilderWithReflectionData(cls, builder, enclosingBuilder,
+ fragment);
}
/**
* Emits the precompiled constructor when in CSP mode.
@@ -74,7 +75,7 @@
String constructorName = namer.className(classElement);
OutputUnit outputUnit =
compiler.deferredLoadTask.outputUnitForElement(classElement);
- emitter.emitPrecompiledConstructor(
+ emitter.assemblePrecompiledConstructor(
outputUnit, constructorName, constructorAst, fieldNames);
}
@@ -272,7 +273,8 @@
void emitClassBuilderWithReflectionData(Class cls,
ClassBuilder classBuilder,
- ClassBuilder enclosingBuilder) {
+ ClassBuilder enclosingBuilder,
+ Fragment fragment) {
ClassElement classElement = cls.element;
String className = cls.name;
@@ -307,8 +309,9 @@
statics.add(property);
}
+ // TODO(herhut): Do not grab statics out of the properties.
ClassBuilder classProperties =
- emitter.elementDescriptors.remove(classElement);
+ emitter.elementDescriptors[fragment].remove(classElement);
if (classProperties != null) {
statics.addAll(classProperties.properties);
}
@@ -334,8 +337,7 @@
for (DartType interface in classElement.interfaces) {
types.add(task.metadataCollector.reifyType(interface));
}
- enclosingBuilder.addProperty("+$reflectionName",
- new jsAst.ArrayInitializer(types.map(js.number).toList()));
+ enclosingBuilder.addProperty("+$reflectionName", js.numArray(types));
}
}
}
diff --git a/pkg/compiler/lib/src/js_emitter/old_emitter/container_builder.dart b/pkg/compiler/lib/src/js_emitter/old_emitter/container_builder.dart
index 394a1ca..bd070c7 100644
--- a/pkg/compiler/lib/src/js_emitter/old_emitter/container_builder.dart
+++ b/pkg/compiler/lib/src/js_emitter/old_emitter/container_builder.dart
@@ -117,10 +117,6 @@
expressions.add(stub.code);
if (member.isInstanceMember) {
expressions.add(js.string(invocationName));
- } else {
- // TOOD(floitsch): Since we know when reading static data versus
- // instance data, we can eliminate this element.
- expressions.add(js('null'));
}
String callName = stub.callName;
String callSelectorString = (callName == null) ? 'null' : '"$callName"';
diff --git a/pkg/compiler/lib/src/js_emitter/old_emitter/emitter.dart b/pkg/compiler/lib/src/js_emitter/old_emitter/emitter.dart
index 4b2d79c..240e771 100644
--- a/pkg/compiler/lib/src/js_emitter/old_emitter/emitter.dart
+++ b/pkg/compiler/lib/src/js_emitter/old_emitter/emitter.dart
@@ -84,8 +84,8 @@
*/
// TODO(ahe): Generate statics with their class, and store only libraries in
// this map.
- final Map<Element, ClassBuilder> elementDescriptors =
- new Map<Element, ClassBuilder>();
+ final Map<Fragment, Map<Element, ClassBuilder>> elementDescriptors =
+ new Map<Fragment, Map<Element, ClassBuilder>>();
final bool generateSourceMap;
@@ -269,6 +269,39 @@
return globalPropertyAccess(element);
}
+ @override
+ jsAst.Template templateForBuiltin(JsBuiltin builtin) {
+ switch (builtin) {
+ case JsBuiltin.dartObjectConstructor:
+ return jsAst.js.expressionTemplateYielding(
+ typeAccess(compiler.objectClass));
+
+ case JsBuiltin.isFunctionType:
+ return backend.rti.representationGenerator.templateForIsFunctionType;
+
+ case JsBuiltin.isFunctionTypeLiteral:
+ String functionClassName =
+ backend.namer.runtimeTypeName(compiler.functionClass);
+ return jsAst.js.expressionTemplateFor(
+ '#.$typeNameProperty === "$functionClassName"');
+
+ case JsBuiltin.typeName:
+ return jsAst.js.expressionTemplateFor("#.$typeNameProperty");
+
+ case JsBuiltin.rawRuntimeType:
+ return jsAst.js.expressionTemplateFor("#.constructor");
+
+ case JsBuiltin.createFunctionType:
+ return backend.rti.representationGenerator
+ .templateForCreateFunctionType;
+
+ default:
+ compiler.internalError(NO_LOCATION_SPANNABLE,
+ "Unhandled Builtin: $builtin");
+ return null;
+ }
+ }
+
List<jsAst.Statement> buildTrivialNsmHandlers(){
return nsmEmitter.buildTrivialNsmHandlers();
}
@@ -434,14 +467,15 @@
cspPrecompiledConstructorNamesFor(outputUnit))]);
}
- void emitClass(Class cls, ClassBuilder enclosingBuilder) {
+ void assembleClass(Class cls, ClassBuilder enclosingBuilder,
+ Fragment fragment) {
ClassElement classElement = cls.element;
compiler.withCurrentElement(classElement, () {
if (compiler.hasIncrementalSupport) {
ClassBuilder cachedBuilder =
cachedClassBuilders.putIfAbsent(classElement, () {
ClassBuilder builder = new ClassBuilder(classElement, namer);
- classEmitter.emitClass(cls, builder);
+ classEmitter.emitClass(cls, builder, fragment);
return builder;
});
invariant(classElement, cachedBuilder.fields.isEmpty);
@@ -450,12 +484,13 @@
invariant(classElement, cachedBuilder.fieldMetadata == null);
enclosingBuilder.properties.addAll(cachedBuilder.properties);
} else {
- classEmitter.emitClass(cls, enclosingBuilder);
+ classEmitter.emitClass(cls, enclosingBuilder, fragment);
}
});
}
- void emitStaticFunctions(Iterable<Method> staticFunctions) {
+ void assembleStaticFunctions(Iterable<Method> staticFunctions,
+ Fragment fragment) {
if (staticFunctions == null) return;
for (Method method in staticFunctions) {
@@ -465,7 +500,8 @@
if (element == null) continue;
ClassBuilder builder = new ClassBuilder(element, namer);
containerBuilder.addMemberMethod(method, builder);
- getElementDescriptor(element).properties.addAll(builder.properties);
+ getElementDescriptor(element, fragment).properties
+ .addAll(builder.properties);
}
}
@@ -616,26 +652,38 @@
}
}
- void emitMetadata(Program program, CodeOutput output) {
+ void emitMetadata(Program program, CodeOutput output, OutputUnit outputUnit) {
- addMetadataGlobal(List<String> list, String global) {
- String globalAccess = generateEmbeddedGlobalAccessString(global);
- output.add('$globalAccess$_=$_[');
- for (String data in list) {
- if (data is String) {
- if (data != 'null') {
- output.add(data);
- }
- } else {
- throw 'Unexpected value in ${global}: ${Error.safeToString(data)}';
- }
- output.add(',$n');
- }
- output.add('];$n');
- }
+ jsAst.Expression constructList(List<String> list) {
+ String listAsString = list == null ? '[]' : '[${list.join(",")}]';
+ return js.uncachedExpressionTemplate(listAsString).instantiate([]);
+ }
- addMetadataGlobal(program.metadata, embeddedNames.METADATA);
- addMetadataGlobal(program.metadataTypes, embeddedNames.TYPES);
+ List<String> types = program.metadataTypes[outputUnit];
+
+ if (outputUnit == compiler.deferredLoadTask.mainOutputUnit) {
+ jsAst.Expression metadataAccess =
+ generateEmbeddedGlobalAccess(embeddedNames.METADATA);
+ jsAst.Expression typesAccess =
+ generateEmbeddedGlobalAccess(embeddedNames.TYPES);
+
+ output.addBuffer(
+ jsAst.prettyPrint(new jsAst.Block([
+ js.statement('# = #;', [metadataAccess,
+ constructList(program.metadata)]),
+ js.statement('# = #;', [typesAccess, constructList(types)])]),
+ compiler, monitor: compiler.dumpInfoTask));
+ output.add(n);
+ } else if (types != null) {
+ output.addBuffer(
+ jsAst.prettyPrint(
+ js.statement('var ${namer.deferredTypesName} = #;',
+ constructList(types)),
+ compiler, monitor: compiler.dumpInfoTask));
+ if (compiler.enableMinification) {
+ output.add('\n');
+ }
+ }
}
void emitCompileTimeConstants(CodeOutput output,
@@ -941,7 +989,8 @@
output.add(N);
}
- void writeLibraryDescriptor(CodeOutput output, LibraryElement library) {
+ void writeLibraryDescriptor(CodeOutput output, LibraryElement library,
+ Fragment fragment) {
var uri = "";
if (!compiler.enableMinification || backend.mustPreserveUris) {
uri = library.canonicalUri;
@@ -949,7 +998,7 @@
uri = relativize(compiler.outputUri, library.canonicalUri, false);
}
}
- ClassBuilder descriptor = elementDescriptors[library];
+ ClassBuilder descriptor = elementDescriptors[fragment][library];
if (descriptor == null) {
// Nothing of the library was emitted.
// TODO(floitsch): this should not happen. We currently have an example
@@ -988,10 +1037,10 @@
..add('],$n');
}
- void emitPrecompiledConstructor(OutputUnit outputUnit,
- String constructorName,
- jsAst.Expression constructorAst,
- List<String> fields) {
+ void assemblePrecompiledConstructor(OutputUnit outputUnit,
+ String constructorName,
+ jsAst.Expression constructorAst,
+ List<String> fields) {
cspPrecompiledFunctionFor(outputUnit).add(
new jsAst.FunctionDeclaration(
new jsAst.VariableDeclaration(constructorName), constructorAst));
@@ -1003,7 +1052,7 @@
cspPrecompiledFunctionFor(outputUnit).add(js.statement(r'''
{
- #constructorName.builtin$cls = #constructorNameString;
+ #constructorName.#typeNameProperty = #constructorNameString;
if (!"name" in #constructorName)
#constructorName.name = #constructorNameString;
$desc = $collectedClasses.#constructorName[1];
@@ -1014,6 +1063,7 @@
}
}''',
{"constructorName": constructorName,
+ "typeNameProperty": typeNameProperty,
"constructorNameString": js.string(constructorName),
"hasIsolateSupport": hasIsolateSupport,
"fieldNamesArray": fieldNamesArray}));
@@ -1021,8 +1071,9 @@
cspPrecompiledConstructorNamesFor(outputUnit).add(js('#', constructorName));
}
- void emitTypedefs() {
- OutputUnit mainOutputUnit = compiler.deferredLoadTask.mainOutputUnit;
+ void assembleTypedefs(Program program) {
+ Fragment mainFragment = program.mainFragment;
+ OutputUnit mainOutputUnit = mainFragment.outputUnit;
// Emit all required typedef declarations into the main output unit.
// TODO(karlklose): unify required classes and typedefs to declarations
@@ -1031,7 +1082,10 @@
LibraryElement library = typedef.library;
// TODO(karlklose): add a TypedefBuilder and move this code there.
DartType type = typedef.alias;
- int typeIndex = task.metadataCollector.reifyType(type);
+ // TODO(zarah): reify type variables once reflection on type arguments of
+ // typedefs is supported.
+ int typeIndex =
+ task.metadataCollector.reifyType(type, ignoreTypeVariables: true);
ClassBuilder builder = new ClassBuilder(typedef, namer);
builder.addProperty(embeddedNames.TYPEDEF_TYPE_PROPERTY_NAME,
js.number(typeIndex));
@@ -1046,17 +1100,17 @@
jsAst.Node declaration = builder.toObjectInitializer();
String mangledName = namer.globalPropertyName(typedef);
String reflectionName = getReflectionName(typedef, mangledName);
- getElementDescriptor(library)
+ getElementDescriptor(library, mainFragment)
..addProperty(mangledName, declaration)
..addProperty("+$reflectionName", js.string(''));
// Also emit a trivial constructor for CSP mode.
String constructorName = mangledName;
jsAst.Expression constructorAst = js('function() {}');
List<String> fieldNames = [];
- emitPrecompiledConstructor(mainOutputUnit,
- constructorName,
- constructorAst,
- fieldNames);
+ assemblePrecompiledConstructor(mainOutputUnit,
+ constructorName,
+ constructorAst,
+ fieldNames);
}
}
@@ -1121,19 +1175,29 @@
}
}
- void emitLibrary(Library library) {
+ void assembleLibrary(Library library, Fragment fragment) {
LibraryElement libraryElement = library.element;
- emitStaticFunctions(library.statics);
+ assembleStaticFunctions(library.statics, fragment);
- ClassBuilder libraryBuilder = getElementDescriptor(libraryElement);
+ ClassBuilder libraryBuilder =
+ getElementDescriptor(libraryElement, fragment);
for (Class cls in library.classes) {
- emitClass(cls, libraryBuilder);
+ assembleClass(cls, libraryBuilder, fragment);
}
classEmitter.emitFields(library, libraryBuilder, emitStatics: true);
}
+ void assembleProgram(Program program) {
+ for (Fragment fragment in program.fragments) {
+ for (Library library in fragment.libraries) {
+ assembleLibrary(library, fragment);
+ }
+ }
+ assembleTypedefs(program);
+ }
+
void emitMainOutputUnit(Program program,
Map<OutputUnit, String> deferredLoadHashes) {
MainFragment mainFragment = program.fragments.first;
@@ -1233,24 +1297,25 @@
mainOutput.add('$isolateProperties$_=$_$isolatePropertiesName$N');
emitFunctionThatReturnsNull(mainOutput);
- mainFragment.libraries.forEach(emitLibrary);
Iterable<LibraryElement> libraries =
task.outputLibraryLists[mainOutputUnit];
if (libraries == null) libraries = [];
- emitTypedefs();
emitMangledNames(mainOutput);
- checkEverythingEmitted(elementDescriptors.keys);
+ Map<Element, ClassBuilder> descriptors = elementDescriptors[mainFragment];
+ if (descriptors == null) descriptors = const {};
+
+ checkEverythingEmitted(descriptors.keys);
CodeBuffer libraryBuffer = new CodeBuffer();
for (LibraryElement library in Elements.sortedByPosition(libraries)) {
- writeLibraryDescriptor(libraryBuffer, library);
- elementDescriptors.remove(library);
+ writeLibraryDescriptor(libraryBuffer, library, mainFragment);
+ descriptors.remove(library);
}
- if (elementDescriptors.isNotEmpty) {
- List<Element> remainingLibraries = elementDescriptors.keys
+ if (descriptors.isNotEmpty) {
+ List<Element> remainingLibraries = descriptors.keys
.where((Element e) => e is LibraryElement)
.toList();
@@ -1260,8 +1325,8 @@
for (LibraryElement element in remainingLibraries) {
assert(element is LibraryElement || compiler.hasIncrementalSupport);
if (element is LibraryElement) {
- writeLibraryDescriptor(libraryBuffer, element);
- elementDescriptors.remove(element);
+ writeLibraryDescriptor(libraryBuffer, element, mainFragment);
+ descriptors.remove(element);
}
}
}
@@ -1290,7 +1355,7 @@
mainOutput.add(N);
}
- mainOutput.add('$setupProgramName(dart)$N');
+ mainOutput.add('$setupProgramName(dart, 0)$N');
interceptorEmitter.emitGetInterceptorMethods(mainOutput);
interceptorEmitter.emitOneShotInterceptors(mainOutput);
@@ -1323,7 +1388,7 @@
mainOutput.add('\n');
- emitMetadata(program, mainOutput);
+ emitMetadata(program, mainOutput, mainOutputUnit);
isolateProperties = isolatePropertiesName;
// The following code should not use the short-hand for the
@@ -1527,10 +1592,9 @@
for (Fragment fragment in program.deferredFragments) {
OutputUnit outputUnit = fragment.outputUnit;
+ Map<Element, ClassBuilder> descriptors = elementDescriptors[fragment];
- fragment.libraries.forEach(emitLibrary);
-
- if (elementDescriptors.isNotEmpty) {
+ if (descriptors != null && descriptors.isNotEmpty) {
Iterable<LibraryElement> libraries =
task.outputLibraryLists[outputUnit];
if (libraries == null) libraries = [];
@@ -1539,8 +1603,8 @@
CodeBuffer buffer = new CodeBuffer();
outputBuffers[outputUnit] = buffer;
for (LibraryElement library in Elements.sortedByPosition(libraries)) {
- writeLibraryDescriptor(buffer, library);
- elementDescriptors.remove(library);
+ writeLibraryDescriptor(buffer, library, fragment);
+ descriptors.remove(library);
}
}
}
@@ -1552,6 +1616,8 @@
Program program = programBuilder.buildProgram(
storeFunctionTypesInMetadata: true);
+ assembleProgram(program);
+
// Shorten the code by using [namer.currentIsolate] as temporary.
isolateProperties = namer.currentIsolate;
@@ -1583,7 +1649,7 @@
return '';
}
- ClassBuilder getElementDescriptor(Element element) {
+ ClassBuilder getElementDescriptor(Element element, Fragment fragment) {
Element owner = element.library;
if (!element.isLibrary && !element.isTopLevel && !element.isNative) {
// For static (not top level) elements, record their code in a buffer
@@ -1601,9 +1667,9 @@
if (owner == null) {
compiler.internalError(element, 'Owner is null.');
}
- return elementDescriptors.putIfAbsent(
- owner,
- () => new ClassBuilder(owner, namer));
+ return elementDescriptors
+ .putIfAbsent(fragment, () => new Map<Element, ClassBuilder>())
+ .putIfAbsent(owner, () => new ClassBuilder(owner, namer));
}
/// Emits support-code for deferred loading into [output].
@@ -1728,6 +1794,8 @@
'$globalsHolder.$setupProgramName$N')
..add('var ${namer.isolateName}$_=$_'
'${globalsHolder}.${namer.isolateName}$N');
+ String typesAccess =
+ generateEmbeddedGlobalAccessString(embeddedNames.TYPES);
if (libraryDescriptorBuffer != null) {
// TODO(ahe): This defines a lot of properties on the
// Isolate.prototype object. We know this will turn it into a
@@ -1753,7 +1821,13 @@
allowVariableMinification: false));
output.add(N);
}
- output.add('$setupProgramName(dart)$N');
+ output.add('$setupProgramName(dart, ${typesAccess}.length)$N');
+ }
+
+ if (task.metadataCollector.types[outputUnit] != null) {
+ emitMetadata(program, output, outputUnit);
+ output.add('${typesAccess}.'
+ 'push.apply(${typesAccess},$_${namer.deferredTypesName})$N');
}
// Set the currentIsolate variable to the current isolate (which is
diff --git a/pkg/compiler/lib/src/js_emitter/old_emitter/setup_program_builder.dart b/pkg/compiler/lib/src/js_emitter/old_emitter/setup_program_builder.dart
index 906afab..58ad5bd 100644
--- a/pkg/compiler/lib/src/js_emitter/old_emitter/setup_program_builder.dart
+++ b/pkg/compiler/lib/src/js_emitter/old_emitter/setup_program_builder.dart
@@ -21,8 +21,10 @@
const RANGE3_ADJUST =
- (FIRST_FIELD_CODE + RANGE1_SIZE + RANGE2_SIZE - RANGE3_FIRST);
-String get setupProgramName => 'setupProgram';
-
+const String setupProgramName ='setupProgram';
+// TODO(floitsch): make sure this property can't clash with anything. It's
+// unlikely since it lives on types, but still.
+const String typeNameProperty = r'builtin$cls';
jsAst.Statement buildSetupProgram(Program program, Compiler compiler,
JavaScriptBackend backend,
@@ -141,7 +143,7 @@
'deferredActionString': js.string(namer.deferredAction)};
String skeleton = '''
-function $setupProgramName(programData) {
+function $setupProgramName(programData, typesOffset) {
"use strict";
if (#needsClassSupport) {
@@ -237,7 +239,7 @@
body += "this." + #deferredActionString + "();";
}
str += ") {\\n" + body + "}\\n";
- str += name + ".builtin\$cls=\\"" + name + "\\";\\n";
+ str += name + ".$typeNameProperty=\\"" + name + "\\";\\n";
str += "\$desc=\$collectedClasses." + name + "[1];\\n";
str += name + ".prototype = \$desc;\\n";
if (typeof defineClass.name != "string") {
@@ -667,17 +669,19 @@
var funcs = [prototype[name] = prototype[alias] = f];
f.\$stubName = name;
functions.push(name);
- for (; index < array.length; index += 2) {
- f = array[index + 1];
+ for (index++; index < array.length; index++) {
+ f = array[index];
if (typeof f != "function") break;
- f.\$stubName = ${readString("array", "index + 2")};
+ if (!isStatic) {
+ f.\$stubName = ${readString("array", "++index")};
+ }
funcs.push(f);
if (f.\$stubName) {
prototype[f.\$stubName] = f;
functions.push(f.\$stubName);
}
}
- index++;
+
for (var i = 0; i < funcs.length; index++, i++) {
funcs[i].\$callName = ${readString("array", "index")};
}
@@ -694,6 +698,8 @@
var isIntercepted =
requiredParameterCount + optionalParameterCount != funcs[0].length;
var functionTypeIndex = ${readFunctionType("array", "2")};
+ if (typeof functionTypeIndex == "number")
+ ${readFunctionType("array", "2")} = functionTypeIndex + typesOffset;
var unmangledNameIndex = $unmangledNameIndex;
if (getterStubName) {
diff --git a/pkg/compiler/lib/src/js_emitter/program_builder.dart b/pkg/compiler/lib/src/js_emitter/program_builder.dart
index b2cb77f..0b90141 100644
--- a/pkg/compiler/lib/src/js_emitter/program_builder.dart
+++ b/pkg/compiler/lib/src/js_emitter/program_builder.dart
@@ -547,7 +547,9 @@
js.Expression functionType;
if (canTearOff || canBeReflected) {
- functionType = _generateFunctionType(memberType);
+ OutputUnit outputUnit =
+ _compiler.deferredLoadTask.outputUnitForElement(element);
+ functionType = _generateFunctionType(memberType, outputUnit);
}
int requiredParameterCount;
@@ -569,12 +571,13 @@
functionType: functionType);
}
- js.Expression _generateFunctionType(DartType type) {
+ js.Expression _generateFunctionType(DartType type, OutputUnit outputUnit) {
if (type.containsTypeVariables) {
js.Expression thisAccess = js.js(r'this.$receiver');
return backend.rti.getSignatureEncoding(type, thisAccess);
} else {
- return js.number(backend.emitter.metadataCollector.reifyType(type));
+ return js.number(backend.emitter.metadataCollector.
+ reifyTypeForOutputUnit(type, outputUnit));
}
}
@@ -718,7 +721,9 @@
js.Expression functionType;
DartType type = element.type;
if (needsTearOff || canBeReflected) {
- functionType = _generateFunctionType(type);
+ OutputUnit outputUnit =
+ _compiler.deferredLoadTask.outputUnitForElement(element);
+ functionType = _generateFunctionType(type, outputUnit);
}
int requiredParameterCount;
diff --git a/pkg/compiler/lib/src/mirrors/dart2js_instance_mirrors.dart b/pkg/compiler/lib/src/mirrors/dart2js_instance_mirrors.dart
index f5e4b11..b29b582 100644
--- a/pkg/compiler/lib/src/mirrors/dart2js_instance_mirrors.dart
+++ b/pkg/compiler/lib/src/mirrors/dart2js_instance_mirrors.dart
@@ -229,7 +229,7 @@
}
class Dart2JsConstructedConstantMirror extends Dart2JsConstantMirror {
- Map<String,ConstantValue> _fieldMapCache;
+ Map<String, ConstantValue> _fieldMapCache;
Dart2JsConstructedConstantMirror(Dart2JsMirrorSystem mirrorSystem,
ConstantExpression constant,
@@ -238,17 +238,13 @@
ConstructedConstantValue get _value => super._value;
- Map<String,ConstantValue> get _fieldMap {
+ Map<String, ConstantValue> get _fieldMap {
if (_fieldMapCache == null) {
- _fieldMapCache = new Map<String,ConstantValue>();
+ _fieldMapCache = new Map<String, ConstantValue>();
if (identical(_value.type.element.kind, ElementKind.CLASS)) {
- var index = 0;
- ClassElement element = _value.type.element;
- element.forEachInstanceField((_, Element field) {
- String fieldName = field.name;
- _fieldMapCache.putIfAbsent(fieldName, () => _value.fields[index]);
- index++;
- }, includeSuperAndInjectedMembers: true);
+ _value.fields.forEach((FieldElement field, ConstantValue value) {
+ _fieldMapCache[field.name] = value;
+ });
}
}
return _fieldMapCache;
diff --git a/pkg/compiler/lib/src/mirrors/dart2js_library_mirror.dart b/pkg/compiler/lib/src/mirrors/dart2js_library_mirror.dart
index 46c2a92..fd2504a 100644
--- a/pkg/compiler/lib/src/mirrors/dart2js_library_mirror.dart
+++ b/pkg/compiler/lib/src/mirrors/dart2js_library_mirror.dart
@@ -163,6 +163,11 @@
}
List<InstanceMirror> get metadata => const <InstanceMirror>[];
+
+ /*Future<LibraryMirror>*/ loadLibrary() {
+ throw new UnsupportedError(
+ 'LibraryDependencyMirror.loadLibrary unsupported.');
+ }
}
class Dart2JsCombinatorMirror implements CombinatorSourceMirror {
diff --git a/pkg/compiler/lib/src/mirrors/source_mirrors.dart b/pkg/compiler/lib/src/mirrors/source_mirrors.dart
index 0afbd8e..14e6c13 100644
--- a/pkg/compiler/lib/src/mirrors/source_mirrors.dart
+++ b/pkg/compiler/lib/src/mirrors/source_mirrors.dart
@@ -142,6 +142,10 @@
/// Returns the source location for this import/export declaration.
SourceLocation get location;
+
+ /// Returns a future that completes when the library is loaded and initates a
+ /// load if one has not already happened.
+ /*Future<LibraryMirror>*/ loadLibrary();
}
/// A mirror on a show/hide combinator declared on a library dependency.
diff --git a/pkg/compiler/lib/src/mirrors_used.dart b/pkg/compiler/lib/src/mirrors_used.dart
index 5c2476c..05f0720 100644
--- a/pkg/compiler/lib/src/mirrors_used.dart
+++ b/pkg/compiler/lib/src/mirrors_used.dart
@@ -4,6 +4,8 @@
library dart2js.mirrors_used;
+import 'compile_time_constants.dart' show
+ ConstantCompiler;
import 'constants/expressions.dart';
import 'constants/values.dart' show
ConstantValue,
@@ -20,7 +22,6 @@
import 'dart2jslib.dart' show
Compiler,
CompilerTask,
- ConstantCompiler,
MessageKind,
TreeElements,
invariant;
@@ -328,7 +329,7 @@
/// Convert a [constant] to an instance of [MirrorUsage] using information
/// that was resolved during [MirrorUsageAnalyzerTask.validate].
MirrorUsage buildUsage(ConstructedConstantValue constant) {
- Map<Element, ConstantValue> fields = constant.fieldElements;
+ Map<Element, ConstantValue> fields = constant.fields;
VariableElement symbolsField = compiler.mirrorsUsedClass.lookupLocalMember(
'symbols');
VariableElement targetsField = compiler.mirrorsUsedClass.lookupLocalMember(
diff --git a/pkg/compiler/lib/src/native/behavior.dart b/pkg/compiler/lib/src/native/behavior.dart
index 3898e7d..6e6c53a 100644
--- a/pkg/compiler/lib/src/native/behavior.dart
+++ b/pkg/compiler/lib/src/native/behavior.dart
@@ -29,6 +29,25 @@
final int _bits;
const NativeThrowBehavior._(this._bits);
+ bool get canThrow => this != NEVER;
+
+ /// Does this behavior always throw a noSuchMethod check on a null first
+ /// argument before any side effect or other exception?
+ // TODO(sra): Extend NativeThrowBehavior with the concept of NSM guard
+ // followed by other potential behavior.
+ bool get isNullNSMGuard => this == MAY_THROW_ONLY_ON_FIRST_ARGUMENT_ACCESS;
+
+ /// Does this behavior always act as a null noSuchMethod check, and has no
+ /// other throwing behavior?
+ bool get isOnlyNullNSMGuard =>
+ this == MAY_THROW_ONLY_ON_FIRST_ARGUMENT_ACCESS;
+
+ /// Returns the behavior if we assume the first argument is not null.
+ NativeThrowBehavior get onNonNull {
+ if (this == MAY_THROW_ONLY_ON_FIRST_ARGUMENT_ACCESS) return NEVER;
+ return this;
+ }
+
String toString() {
if (this == NEVER) return 'never';
if (this == MAY) return 'may';
@@ -87,17 +106,31 @@
bool isAllocation = false;
bool useGvn = false;
+ // TODO(sra): Make NativeBehavior immutable so PURE and PURE_ALLOCATION can be
+ // final constant-like objects.
+ static NativeBehavior get PURE => NativeBehavior._makePure();
+ static NativeBehavior get PURE_ALLOCATION =>
+ NativeBehavior._makePure(isAllocation: true);
+
String toString() {
return 'NativeBehavior('
- 'returns: ${typesReturned}, '
- 'creates: ${typesInstantiated}, '
- 'sideEffects: ${sideEffects}, '
- 'throws: ${throwBehavior}'
+ 'returns: ${typesReturned}'
+ ', creates: ${typesInstantiated}'
+ ', sideEffects: ${sideEffects}'
+ ', throws: ${throwBehavior}'
'${isAllocation ? ", isAllocation" : ""}'
'${useGvn ? ", useGvn" : ""}'
')';
}
+ static NativeBehavior _makePure({bool isAllocation: false}) {
+ NativeBehavior behavior = new NativeBehavior();
+ behavior.sideEffects.clearAllDependencies();
+ behavior.sideEffects.clearAllSideEffects();
+ behavior.throwBehavior = NativeThrowBehavior.NEVER;
+ behavior.isAllocation = isAllocation;
+ return behavior;
+ }
/// Processes the type specification string of a call to JS and stores the
/// result in the [typesReturned] and [typesInstantiated]. It furthermore
@@ -470,34 +503,48 @@
new SideEffectsVisitor(behavior.sideEffects)
.visit(behavior.codeTemplate.ast);
}
+ if (!throwBehaviorFromSpecString) {
+ behavior.throwBehavior =
+ new ThrowBehaviorVisitor().analyze(behavior.codeTemplate.ast);
+ }
return behavior;
}
- static NativeBehavior ofJsEmbeddedGlobalCall(Send jsGlobalCall,
- Compiler compiler,
- resolver) {
+ static void _fillNativeBehaviorOfBuiltinOrEmbeddedGlobal(
+ NativeBehavior behavior,
+ Send jsBuiltinOrEmbeddedGlobalCall,
+ Compiler compiler,
+ ResolverVisitor resolver,
+ {bool isBuiltin,
+ List<String> validTags}) {
// The first argument of a JS-embedded global call is a string encoding
// the type of the code.
//
// 'Type1|Type2'. A union type.
// '=Object'. A JavaScript Object, no subtype.
- Link<Node> argNodes = jsGlobalCall.arguments;
+ String builtinOrGlobal = isBuiltin ? "builtin" : "embedded global";
+
+ Link<Node> argNodes = jsBuiltinOrEmbeddedGlobalCall.arguments;
if (argNodes.isEmpty) {
- compiler.internalError(jsGlobalCall,
- "JS embedded global expression has no type.");
+ compiler.internalError(jsBuiltinOrEmbeddedGlobalCall,
+ "JS $builtinOrGlobal expression has no type.");
}
// We don't check the given name. That needs to be done at a later point.
- // This is, because we want to allow non-literals as names.
+ // This is, because we want to allow non-literals (like references to
+ // enums) as names.
if (argNodes.tail.isEmpty) {
- compiler.internalError(jsGlobalCall, 'Embedded Global is missing name.');
+ compiler.internalError(jsBuiltinOrEmbeddedGlobalCall,
+ 'JS $builtinOrGlobal is missing name.');
}
- if (!argNodes.tail.tail.isEmpty) {
- compiler.internalError(argNodes.tail.tail.head,
- 'Embedded Global has more than 2 arguments');
+ if (!isBuiltin) {
+ if (!argNodes.tail.tail.isEmpty) {
+ compiler.internalError(argNodes.tail.tail.head,
+ 'JS embedded global has more than 2 arguments');
+ }
}
LiteralString specLiteral = argNodes.head.asLiteralString();
@@ -507,8 +554,6 @@
compiler.internalError(argNodes.head, "Unexpected first argument.");
}
- NativeBehavior behavior = new NativeBehavior();
-
String specString = specLiteral.dartString.slowToString();
dynamic resolveType(String typeString) {
@@ -516,17 +561,50 @@
typeString,
compiler,
(name) => resolver.resolveTypeFromString(specLiteral, name),
- jsGlobalCall);
+ jsBuiltinOrEmbeddedGlobalCall);
}
- processSpecString(compiler, jsGlobalCall,
+ void setSideEffects(SideEffects newEffects) {
+ behavior.sideEffects.setTo(newEffects);
+ }
+
+ processSpecString(compiler, jsBuiltinOrEmbeddedGlobalCall,
specString,
- validTags: const ['returns', 'creates'],
+ validTags: validTags,
resolveType: resolveType,
+ setSideEffects: setSideEffects,
typesReturned: behavior.typesReturned,
typesInstantiated: behavior.typesInstantiated,
objectType: compiler.objectClass.computeType(compiler),
nullType: compiler.nullClass.computeType(compiler));
+ }
+
+ static NativeBehavior ofJsBuiltinCall(Send jsBuiltinCall,
+ Compiler compiler,
+ ResolverVisitor resolver) {
+ NativeBehavior behavior = new NativeBehavior();
+ behavior.sideEffects.setTo(new SideEffects());
+
+ _fillNativeBehaviorOfBuiltinOrEmbeddedGlobal(
+ behavior, jsBuiltinCall, compiler, resolver, isBuiltin: true);
+
+ return behavior;
+ }
+
+ static NativeBehavior ofJsEmbeddedGlobalCall(Send jsEmbeddedGlobalCall,
+ Compiler compiler,
+ ResolverVisitor resolver) {
+ NativeBehavior behavior = new NativeBehavior();
+ // TODO(sra): Allow the use site to override these defaults.
+ // Embedded globals are usually pre-computed data structures or JavaScript
+ // functions that never change.
+ behavior.sideEffects.setTo(new SideEffects.empty());
+ behavior.throwBehavior = NativeThrowBehavior.NEVER;
+
+ _fillNativeBehaviorOfBuiltinOrEmbeddedGlobal(
+ behavior, jsEmbeddedGlobalCall, compiler, resolver,
+ isBuiltin: false,
+ validTags: const ['returns', 'creates']);
return behavior;
}
@@ -616,14 +694,14 @@
ConstructedConstantValue constructedObject = value;
if (constructedObject.type.element != annotationClass) continue;
- List<ConstantValue> fields = constructedObject.fields;
+ Iterable<ConstantValue> fields = constructedObject.fields.values;
// TODO(sra): Better validation of the constant.
- if (fields.length != 1 || !fields[0].isString) {
+ if (fields.length != 1 || !fields.single.isString) {
PartialMetadataAnnotation partial = annotation;
compiler.internalError(annotation,
'Annotations needs one string: ${partial.parseNode(compiler)}');
}
- StringConstantValue specStringConstant = fields[0];
+ StringConstantValue specStringConstant = fields.single;
String specString = specStringConstant.toDartString().slowToString();
for (final typeString in specString.split('|')) {
var type = _parseType(typeString, compiler, lookup, annotation);
diff --git a/pkg/compiler/lib/src/native/enqueue.dart b/pkg/compiler/lib/src/native/enqueue.dart
index a7c7af9..11968db 100644
--- a/pkg/compiler/lib/src/native/enqueue.dart
+++ b/pkg/compiler/lib/src/native/enqueue.dart
@@ -54,6 +54,18 @@
// TODO(sra): The entry from codegen will not have a resolver.
void registerJsEmbeddedGlobalCall(Send node, ResolverVisitor resolver) {}
+ /**
+ * Handles JS-compiler builtin calls, which can be an instantiation point for
+ * types.
+ *
+ * For example, the following code instantiates and returns a String class
+ *
+ * JS_BUILTIN('String', 'int2string', 0)
+ *
+ */
+ // TODO(sra): The entry from codegen will not have a resolver.
+ void registerJsBuiltinCall(Send node, ResolverVisitor resolver) {}
+
/// Emits a summary information using the [log] function.
void logSummary(log(message)) {}
@@ -312,14 +324,14 @@
ConstructedConstantValue constructedObject = value;
if (constructedObject.type.element != annotationClass) continue;
- List<ConstantValue> fields = constructedObject.fields;
+ Iterable<ConstantValue> fields = constructedObject.fields.values;
// TODO(sra): Better validation of the constant.
- if (fields.length != 1 || fields[0] is! StringConstantValue) {
+ if (fields.length != 1 || fields.single is! StringConstantValue) {
PartialMetadataAnnotation partial = annotation;
compiler.internalError(annotation,
'Annotations needs one string: ${partial.parseNode(compiler)}');
}
- StringConstantValue specStringConstant = fields[0];
+ StringConstantValue specStringConstant = fields.single;
String specString = specStringConstant.toDartString().slowToString();
if (name == null) {
name = specString;
@@ -492,6 +504,14 @@
flushQueue();
}
+ void registerJsBuiltinCall(Send node, ResolverVisitor resolver) {
+ NativeBehavior behavior =
+ NativeBehavior.ofJsBuiltinCall(node, compiler, resolver);
+ processNativeBehavior(behavior, node);
+ nativeBehaviors[node] = behavior;
+ flushQueue();
+ }
+
NativeBehavior getNativeBehaviorOf(Send node) => nativeBehaviors[node];
processNativeBehavior(NativeBehavior behavior, cause) {
diff --git a/pkg/compiler/lib/src/native/js.dart b/pkg/compiler/lib/src/native/js.dart
index 1cbe8da..7dc7d70 100644
--- a/pkg/compiler/lib/src/native/js.dart
+++ b/pkg/compiler/lib/src/native/js.dart
@@ -81,3 +81,189 @@
node.visitChildren(this);
}
}
+
+
+/// ThrowBehaviorVisitor generates a NativeThrowBehavior describing the
+/// exception behavior of a JavaScript expression.
+///
+/// The result is semi-conservative, giving reasonable results for many simple
+/// JS fragments. The non-conservative part is the assumption that binary
+/// operators are used on 'good' operands that do not force arbirary code to be
+/// executed via conversions (valueOf() and toString() methods).
+///
+/// In many cases a JS fragment has more precise behavior. In these cases the
+/// behavior should be described as a property of the JS fragment. For example,
+/// Object.keys(#) has a TypeError on null / undefined, which can only be known
+/// in the calling context.
+///
+class ThrowBehaviorVisitor extends js.BaseVisitor<NativeThrowBehavior> {
+
+ ThrowBehaviorVisitor();
+
+ NativeThrowBehavior analyze(js.Node node) {
+ return visit(node);
+ }
+
+ // TODO(sra): Add [sequence] functionality to NativeThrowBehavior.
+ /// Returns the combined behavior of sequential execution of code having
+ /// behavior [first] followed by code having behavior [second].
+ static NativeThrowBehavior sequence(NativeThrowBehavior first,
+ NativeThrowBehavior second) {
+ if (first == NativeThrowBehavior.MUST) return first;
+ if (second == NativeThrowBehavior.MUST) return second;
+ if (second == NativeThrowBehavior.NEVER) return first;
+ if (first == NativeThrowBehavior.NEVER) return second;
+ // Both are one of MAY or MAY_THROW_ONLY_ON_FIRST_ARGUMENT_ACCESS.
+ return NativeThrowBehavior.MAY;
+ }
+
+ // TODO(sra): Add [choice] functionality to NativeThrowBehavior.
+ /// Returns the combined behavior of a choice between two paths with behaviors
+ /// [first] and [second].
+ static NativeThrowBehavior choice(NativeThrowBehavior first,
+ NativeThrowBehavior second) {
+ if (first == second) return first; // Both paths have same behaviour.
+ return NativeThrowBehavior.MAY;
+ }
+
+ NativeThrowBehavior visit(js.Node node) {
+ return node.accept(this);
+ }
+
+ NativeThrowBehavior visitNode(js.Node node) {
+ return NativeThrowBehavior.MAY;
+ }
+
+ NativeThrowBehavior visitLiteral(js.Literal node) {
+ return NativeThrowBehavior.NEVER;
+ }
+
+ NativeThrowBehavior visitInterpolatedExpression(js.InterpolatedNode node) {
+ return NativeThrowBehavior.NEVER;
+ }
+
+ NativeThrowBehavior visitInterpolatedSelector(js.InterpolatedNode node) {
+ return NativeThrowBehavior.NEVER;
+ }
+
+ NativeThrowBehavior visitObjectInitializer(js.ObjectInitializer node) {
+ NativeThrowBehavior result = NativeThrowBehavior.NEVER;
+ for (js.Property property in node.properties) {
+ result = sequence(result, visit(property));
+ }
+ return result;
+ }
+
+ NativeThrowBehavior visitProperty(js.Property node) {
+ return sequence(visit(node.name), visit(node.value));
+ }
+
+ NativeThrowBehavior visitAssignment(js.Assignment node) {
+ // TODO(sra): Can we make "#.p = #" be null(1)?
+ return NativeThrowBehavior.MAY;
+ }
+
+ NativeThrowBehavior visitCall(js.Call node) {
+ return NativeThrowBehavior.MAY;
+ }
+
+ NativeThrowBehavior visitNew(js.New node) {
+ // TODO(sra): `new Array(x)` where `x` is a small number.
+ return NativeThrowBehavior.MAY;
+ }
+
+ NativeThrowBehavior visitBinary(js.Binary node) {
+ NativeThrowBehavior left = visit(node.left);
+ NativeThrowBehavior right = visit(node.right);
+ switch (node.op) {
+ // We make the non-conservative assumption that these operations are not
+ // used in ways that force calling arbitrary code via valueOf or
+ // toString().
+ case "*":
+ case "/":
+ case "%":
+ case "+":
+ case "-":
+ case "<<":
+ case ">>":
+ case ">>>":
+ case "<":
+ case ">":
+ case "<=":
+ case ">=":
+ case "==":
+ case "===":
+ case "!=":
+ case "!==":
+ case "&":
+ case "^":
+ case "|":
+ return sequence(left, right);
+
+ case ',':
+ return sequence(left, right);
+
+ case "&&":
+ case "||":
+ return choice(left, sequence(left, right));
+
+ case "instanceof":
+ case "in":
+ default:
+ return NativeThrowBehavior.MAY;
+ }
+ }
+
+ NativeThrowBehavior visitThrow(js.Throw node) {
+ return NativeThrowBehavior.MUST;
+ }
+
+ NativeThrowBehavior visitPrefix(js.Prefix node) {
+ if (node.op == 'typeof' && node.argument is js.VariableUse)
+ return NativeThrowBehavior.NEVER;
+ NativeThrowBehavior result = visit(node.argument);
+ switch (node.op) {
+ case '+':
+ case '-':
+ case '!':
+ case '~':
+ case 'void':
+ case 'typeof':
+ return result;
+ default:
+ return NativeThrowBehavior.MAY;
+ }
+ }
+
+ NativeThrowBehavior visitVariableUse(js.VariableUse node) {
+ // We could get a ReferenceError unless the variable is in scope. The AST
+ // could distinguish in-scope and out-of scope references. For JS fragments,
+ // the only use of VariableUse should be for global references. Certain
+ // global names are almost certainly not reference errors, e.g 'Array'.
+ switch (node.name) {
+ case 'Array':
+ case 'Object':
+ return NativeThrowBehavior.NEVER;
+ default:
+ return NativeThrowBehavior.MAY;
+ }
+ }
+
+ NativeThrowBehavior visitAccess(js.PropertyAccess node) {
+ // TODO(sra): We need a representation where the nsm guard behaviour is
+ // maintained when combined with other throwing behaviour.
+ js.Node receiver = node.receiver;
+ NativeThrowBehavior first = visit(receiver);
+ NativeThrowBehavior second = visit(node.selector);
+
+ if (receiver is js.InterpolatedExpression &&
+ receiver.isPositional &&
+ receiver.nameOrPosition == 0) {
+ first = NativeThrowBehavior.MAY_THROW_ONLY_ON_FIRST_ARGUMENT_ACCESS;
+ } else {
+ first = NativeThrowBehavior.MAY;
+ }
+
+ return sequence(first, second);
+ }
+}
diff --git a/pkg/compiler/lib/src/resolution/access_semantics.dart b/pkg/compiler/lib/src/resolution/access_semantics.dart
index 10800dd..ecd16c0 100644
--- a/pkg/compiler/lib/src/resolution/access_semantics.dart
+++ b/pkg/compiler/lib/src/resolution/access_semantics.dart
@@ -116,6 +116,9 @@
/// The destination of the access is unresolved in a static context.
UNRESOLVED,
+
+ /// The destination of the access is unresolved super access.
+ UNRESOLVED_SUPER,
}
enum CompoundAccessKind {
@@ -294,6 +297,9 @@
StaticAccess.unresolved(this.element)
: super._(AccessKind.UNRESOLVED);
+
+ StaticAccess.unresolvedSuper(this.element)
+ : super._(AccessKind.UNRESOLVED_SUPER);
}
class CompoundAccessSemantics extends AccessSemantics {
@@ -307,6 +313,22 @@
: super._(AccessKind.COMPOUND);
Element get element => setter;
+
+ String toString() {
+ StringBuffer sb = new StringBuffer();
+ sb.write('CompoundAccessSemantics[');
+ sb.write('kind=$compoundAccessKind');
+ if (getter != null) {
+ sb.write(',getter=');
+ sb.write('${getter}');
+ }
+ if (setter != null) {
+ sb.write(',setter=');
+ sb.write('${setter}');
+ }
+ sb.write(']');
+ return sb.toString();
+ }
}
/// Enum representing the different kinds of destinations which a constructor
diff --git a/pkg/compiler/lib/src/resolution/members.dart b/pkg/compiler/lib/src/resolution/members.dart
index da69760..986663e 100644
--- a/pkg/compiler/lib/src/resolution/members.dart
+++ b/pkg/compiler/lib/src/resolution/members.dart
@@ -1960,8 +1960,7 @@
outer != null && outer.isFactoryConstructor;
if (!outer.isClass &&
!outer.isTypedef &&
- !isInFactoryConstructor &&
- Elements.isInStaticContext(visitor.enclosingElement)) {
+ !Elements.hasAccessToTypeVariables(visitor.enclosingElement)) {
registry.registerThrowRuntimeError();
type = reportFailureAndCreateType(
MessageKind.TYPE_VARIABLE_WITHIN_STATIC_MEMBER,
@@ -2112,6 +2111,9 @@
* This field is updated when nested closures are visited.
*/
Element enclosingElement;
+
+ /// Whether we are in a context where `this` is accessible (this will be false
+ /// in static contexts, factory methods, and field initializers).
bool inInstanceContext;
bool inCheckContext;
bool inCatchBlock;
@@ -2262,11 +2264,17 @@
inStaticContext(() => visit(node));
}
- ErroneousElement warnAndCreateErroneousElement(Node node,
- String name,
- MessageKind kind,
- [Map arguments = const {}]) {
- compiler.reportWarning(node, kind, arguments);
+ ErroneousElement reportAndCreateErroneousElement(
+ Node node,
+ String name,
+ MessageKind kind,
+ Map arguments,
+ {bool isError: false}) {
+ if (isError) {
+ compiler.reportError(node, kind, arguments);
+ } else {
+ compiler.reportWarning(node, kind, arguments);
+ }
// TODO(ahe): Use [allowedCategory] to synthesize a more precise subclass
// of [ErroneousElementX]. For example, [ErroneousFieldElementX],
// [ErroneousConstructorElementX], etc.
@@ -2300,18 +2308,40 @@
element = reportLookupErrorIfAny(element, node, node.source);
if (element == null) {
if (!inInstanceContext) {
- element = warnAndCreateErroneousElement(
- node, node.source, MessageKind.CANNOT_RESOLVE,
- {'name': node});
+ // We report an error within initializers because `this` is implicitly
+ // accessed when unqualified identifiers are not resolved. For
+ // details, see section 16.14.3 of the spec (2nd edition):
+ // An unqualified invocation `i` of the form `id(a1, ...)`
+ // ...
+ // If `i` does not occur inside a top level or static function, `i`
+ // is equivalent to `this.id(a1 , ...)`.
+ bool inInitializer = enclosingElement.isGenerativeConstructor ||
+ (enclosingElement.isInstanceMember && enclosingElement.isField);
+ MessageKind kind;
+ Map arguments = {'name': name};
+ if (inInitializer) {
+ kind = MessageKind.CANNOT_RESOLVE_IN_INITIALIZER;
+ } else if (name == 'await') {
+ var functionName = enclosingElement.name;
+ if (functionName == '') {
+ kind = MessageKind.CANNOT_RESOLVE_AWAIT_IN_CLOSURE;
+ } else {
+ kind = MessageKind.CANNOT_RESOLVE_AWAIT;
+ arguments['functionName'] = functionName;
+ }
+ } else {
+ kind = MessageKind.CANNOT_RESOLVE;
+ }
+ element = reportAndCreateErroneousElement(node, name, kind,
+ arguments, isError: inInitializer);
registry.registerThrowNoSuchMethod();
}
} else if (element.isErroneous) {
// Use the erroneous element.
} else {
if ((element.kind.category & allowedCategory) == 0) {
- element = warnAndCreateErroneousElement(
- node, name,
- MessageKind.GENERIC,
+ element = reportAndCreateErroneousElement(
+ node, name, MessageKind.GENERIC,
// TODO(ahe): Improve error message. Need UX input.
{'text': "is not an expression $element"});
}
@@ -2601,7 +2631,7 @@
// [target] may be null which means invoking noSuchMethod on
// super.
if (target == null) {
- target = warnAndCreateErroneousElement(
+ target = reportAndCreateErroneousElement(
node, name, MessageKind.NO_SUCH_SUPER_MEMBER,
{'className': currentClass, 'memberName': name});
// We still need to register the invocation, because we might
@@ -2640,13 +2670,13 @@
MessageKind kind = (target == null)
? MessageKind.MEMBER_NOT_FOUND
: MessageKind.MEMBER_NOT_STATIC;
- return new ElementResult(warnAndCreateErroneousElement(
+ return new ElementResult(reportAndCreateErroneousElement(
node, name, kind,
{'className': receiverClass.name, 'memberName': name}));
} else if (isPrivateName(name) &&
target.library != enclosingElement.library) {
registry.registerThrowNoSuchMethod();
- return new ElementResult(warnAndCreateErroneousElement(
+ return new ElementResult(reportAndCreateErroneousElement(
node, name, MessageKind.PRIVATE_ACCESS,
{'libraryName': target.library.getLibraryOrScriptName(),
'name': name}));
@@ -2656,15 +2686,14 @@
target = prefix.lookupLocalMember(name);
if (Elements.isUnresolved(target)) {
registry.registerThrowNoSuchMethod();
- return new ElementResult(warnAndCreateErroneousElement(
+ return new ElementResult(reportAndCreateErroneousElement(
node, name, MessageKind.NO_SUCH_LIBRARY_MEMBER,
{'libraryName': prefix.name, 'memberName': name}));
} else if (target.isAmbiguous) {
registry.registerThrowNoSuchMethod();
AmbiguousElement ambiguous = target;
- target = warnAndCreateErroneousElement(node, name,
- ambiguous.messageKind,
- ambiguous.messageArguments);
+ target = reportAndCreateErroneousElement(
+ node, name, ambiguous.messageKind, ambiguous.messageArguments);
ambiguous.diagnose(enclosingElement, compiler);
return new ElementResult(target);
} else if (target.kind == ElementKind.CLASS) {
@@ -2805,14 +2834,13 @@
target = field.getter;
if (target == null && !inInstanceContext) {
registry.registerThrowNoSuchMethod();
- target =
- warnAndCreateErroneousElement(node.selector, field.name,
- MessageKind.CANNOT_RESOLVE_GETTER);
+ target = reportAndCreateErroneousElement(node.selector, field.name,
+ MessageKind.CANNOT_RESOLVE_GETTER, const {});
}
} else if (target.isTypeVariable) {
ClassElement cls = target.enclosingClass;
assert(enclosingElement.enclosingClass == cls);
- if (Elements.isInStaticContext(enclosingElement)) {
+ if (!Elements.hasAccessToTypeVariables(enclosingElement)) {
compiler.reportError(node,
MessageKind.TYPE_VARIABLE_WITHIN_STATIC_MEMBER,
{'typeVariableName': node.selector});
@@ -2840,7 +2868,7 @@
// Don't try to make constants of calls to type literals.
if (!node.isCall) {
- analyzeConstantDeferred(node);
+ analyzeConstantDeferred(node, enforceConst: false);
} else {
// The node itself is not a constant but we register the selector (the
// identifier that refers to the class/typedef) as a constant.
@@ -2850,7 +2878,7 @@
// the type literal from the selector.
registry.useElement(node.selector, target);
}
- analyzeConstantDeferred(node.selector);
+ analyzeConstantDeferred(node.selector, enforceConst: false);
}
}
if (isPotentiallyMutableTarget(target)) {
@@ -2933,6 +2961,8 @@
registry.registerJsCall(node, this);
} else if (selector.name == 'JS_EMBEDDED_GLOBAL') {
registry.registerJsEmbeddedGlobalCall(node, this);
+ } else if (selector.name == 'JS_BUILTIN') {
+ registry.registerJsBuiltinCall(node, this);
} else if (selector.name == 'JS_INTERCEPTOR_CONSTANT') {
if (!node.argumentsNode.isEmpty) {
Node argument = node.argumentsNode.nodes.head;
@@ -2981,30 +3011,51 @@
setter = field.setter;
getter = field.getter;
if (setter == null && !inInstanceContext) {
- setter = warnAndCreateErroneousElement(
- node.selector, field.name, MessageKind.CANNOT_RESOLVE_SETTER);
+ setter = reportAndCreateErroneousElement(node.selector, field.name,
+ MessageKind.CANNOT_RESOLVE_SETTER, const {});
registry.registerThrowNoSuchMethod();
}
if (isComplex && getter == null && !inInstanceContext) {
- getter = warnAndCreateErroneousElement(
- node.selector, field.name, MessageKind.CANNOT_RESOLVE_GETTER);
+ getter = reportAndCreateErroneousElement(node.selector, field.name,
+ MessageKind.CANNOT_RESOLVE_GETTER, const {});
registry.registerThrowNoSuchMethod();
}
} else if (target.impliesType) {
- setter = warnAndCreateErroneousElement(
- node.selector, target.name, MessageKind.ASSIGNING_TYPE);
+ setter = reportAndCreateErroneousElement(node.selector, target.name,
+ MessageKind.ASSIGNING_TYPE, const {});
registry.registerThrowNoSuchMethod();
- } else if (target.isFinal ||
- target.isConst ||
- (target.isFunction &&
- Elements.isStaticOrTopLevelFunction(target) &&
- !target.isSetter)) {
- if (target.isFunction) {
- setter = warnAndCreateErroneousElement(
- node.selector, target.name, MessageKind.ASSIGNING_METHOD);
+ } else if (target.isFinal || target.isConst) {
+ if (Elements.isStaticOrTopLevelField(target) || target.isLocal) {
+ setter = reportAndCreateErroneousElement(
+ node.selector, target.name, MessageKind.CANNOT_RESOLVE_SETTER,
+ const {});
+ } else if (node.isSuperCall) {
+ setter = reportAndCreateErroneousElement(
+ node.selector, target.name, MessageKind.SETTER_NOT_FOUND_IN_SUPER,
+ {'name': target.name, 'className': currentClass.name});
+ registry.registerSuperNoSuchMethod();
} else {
- setter = warnAndCreateErroneousElement(
- node.selector, target.name, MessageKind.CANNOT_RESOLVE_SETTER);
+ // For instance fields we don't report a warning here because the type
+ // checker will detect this as well and report a better error message
+ // with the context of the containing class.
+ }
+ registry.registerThrowNoSuchMethod();
+ } else if (target.isFunction && target.name != '[]=') {
+ assert(!target.isSetter);
+ if (Elements.isStaticOrTopLevelFunction(target) || target.isLocal) {
+ setter = reportAndCreateErroneousElement(
+ node.selector, target.name, MessageKind.ASSIGNING_METHOD,
+ const {});
+ } else if (node.isSuperCall) {
+ setter = reportAndCreateErroneousElement(
+ node.selector, target.name, MessageKind.ASSIGNING_METHOD_IN_SUPER,
+ {'name': target.name,
+ 'superclassName': target.enclosingElement.name});
+ registry.registerSuperNoSuchMethod();
+ } else {
+ // For instance methods we don't report a warning here because the
+ // type checker will detect this as well and report a better error
+ // message with the context of the containing class.
}
registry.registerThrowNoSuchMethod();
}
@@ -3035,7 +3086,7 @@
if (node.isSuperCall) {
getter = currentClass.lookupSuperSelector(getterSelector);
if (getter == null) {
- target = warnAndCreateErroneousElement(
+ target = reportAndCreateErroneousElement(
node, selector.name, MessageKind.NO_SUCH_SUPER_MEMBER,
{'className': currentClass, 'memberName': selector.name});
registry.registerSuperNoSuchMethod();
@@ -3390,10 +3441,10 @@
}
}
- void analyzeConstant(Node node) {
+ void analyzeConstant(Node node, {enforceConst: true}) {
ConstantExpression constant =
compiler.resolver.constantCompiler.compileNode(
- node, registry.mapping);
+ node, registry.mapping, enforceConst: enforceConst);
if (constant == null) {
assert(invariant(node, compiler.compilationFailed));
@@ -3425,9 +3476,9 @@
}
}
- void analyzeConstantDeferred(Node node) {
+ void analyzeConstantDeferred(Node node, {bool enforceConst: true}) {
addDeferredAction(enclosingElement, () {
- analyzeConstant(node);
+ analyzeConstant(node, enforceConst: enforceConst);
});
}
@@ -3613,6 +3664,7 @@
}
visitSyncForIn(SyncForIn node) {
+ registry.registerSyncForIn(node);
registry.setIteratorSelector(node, compiler.iteratorSelector);
registry.registerDynamicGetter(compiler.iteratorSelector);
registry.setCurrentSelector(node, compiler.currentSelector);
@@ -4121,7 +4173,7 @@
// TODO(johnniwinther): Replace with a traversal on the AST when the type
// annotations in typedef alias are stored in a [TreeElements] mapping.
-class TypedefCyclicVisitor extends DartTypeVisitor {
+class TypedefCyclicVisitor extends BaseDartTypeVisitor {
final Compiler compiler;
final TypedefElementX element;
bool hasCyclicReference = false;
@@ -4443,8 +4495,8 @@
FunctionElement createForwardingConstructor(ConstructorElement target,
ClassElement enclosing) {
- return new SynthesizedConstructorElementX(
- target.name, target, enclosing, false);
+ return new SynthesizedConstructorElementX.notForDefault(
+ target.name, target, enclosing);
}
void doApplyMixinTo(MixinApplicationElementX mixinApplication,
diff --git a/pkg/compiler/lib/src/resolution/operators.dart b/pkg/compiler/lib/src/resolution/operators.dart
index 3207aca..e862c30 100644
--- a/pkg/compiler/lib/src/resolution/operators.dart
+++ b/pkg/compiler/lib/src/resolution/operators.dart
@@ -4,6 +4,8 @@
library dart2js.operators;
+import '../elements/elements.dart';
+
enum UnaryOperatorKind {
NOT,
NEGATE,
@@ -43,7 +45,6 @@
}
}
-
enum BinaryOperatorKind {
EQ,
NOT_EQ,
@@ -63,6 +64,8 @@
AND,
OR,
XOR,
+ LOGICAL_AND,
+ LOGICAL_OR,
}
class BinaryOperator {
@@ -71,7 +74,10 @@
const BinaryOperator._(this.kind, this.name);
+ /// `true` if this operator can be implemented through an `operator [name]`
+ /// method.
bool get isUserDefinable => true;
+
String get selectorName => name;
String toString() => name;
@@ -147,6 +153,14 @@
static const BinaryOperator XOR =
const BinaryOperator._(BinaryOperatorKind.XOR, '^');
+ /// The logical && operator.
+ static const BinaryOperator LOGICAL_AND =
+ const _LogicalOperator(BinaryOperatorKind.LOGICAL_AND, '&&');
+
+ /// The binary | operator.
+ static const BinaryOperator LOGICAL_OR =
+ const _LogicalOperator(BinaryOperatorKind.LOGICAL_OR, '||');
+
static BinaryOperator parse(String value) {
switch (value) {
case '==': return EQ;
@@ -167,12 +181,15 @@
case '&': return AND;
case '^': return XOR;
case '|': return OR;
+ case '&&': return LOGICAL_AND;
+ case '||': return LOGICAL_OR;
default: return null;
}
}
}
-/// The operator !=, which is not user definable operator but instead is a negation
+/// The operator !=, which is not user definable operator but instead is a
+/// negation of a call to user definable operator, namely ==.
class _NotEqualsOperator extends BinaryOperator {
const _NotEqualsOperator() : super._(BinaryOperatorKind.NOT_EQ, '!=');
@@ -181,6 +198,17 @@
String get selectorName => '==';
}
+/// The operators && and || which are not user definable operators but control
+/// structures.
+class _LogicalOperator extends BinaryOperator {
+ const _LogicalOperator(BinaryOperatorKind kind, String name)
+ : super._(kind, name);
+
+ bool get isUserDefinable => false;
+
+ String get selectorName => null;
+}
+
enum AssignmentOperatorKind {
ASSIGN,
ADD,
diff --git a/pkg/compiler/lib/src/resolution/registry.dart b/pkg/compiler/lib/src/resolution/registry.dart
index 8b37559..00ee9a5 100644
--- a/pkg/compiler/lib/src/resolution/registry.dart
+++ b/pkg/compiler/lib/src/resolution/registry.dart
@@ -279,6 +279,12 @@
world.registerJsEmbeddedGlobalCall(node, visitor);
}
+ // TODO(johnniwinther): Remove the [ResolverVisitor] dependency. Its only
+ // needed to lookup types in the current scope.
+ void registerJsBuiltinCall(Node node, ResolverVisitor visitor) {
+ world.registerJsBuiltinCall(node, visitor);
+ }
+
void registerGetOfStaticFunction(FunctionElement element) {
world.registerGetOfStaticFunction(element);
}
@@ -331,6 +337,10 @@
backend.resolutionCallbacks.onStackTraceInCatch(this);
}
+ void registerSyncForIn(Node node) {
+ backend.resolutionCallbacks.onSyncForIn(this);
+ }
+
ClassElement defaultSuperclass(ClassElement element) {
return backend.defaultSuperclass(element);
}
diff --git a/pkg/compiler/lib/src/resolution/resolution.dart b/pkg/compiler/lib/src/resolution/resolution.dart
index 326bd39..19039c8 100644
--- a/pkg/compiler/lib/src/resolution/resolution.dart
+++ b/pkg/compiler/lib/src/resolution/resolution.dart
@@ -6,6 +6,7 @@
import 'dart:collection' show Queue;
+import '../compile_time_constants.dart';
import '../constants/expressions.dart';
import '../constants/values.dart';
import '../dart_backend/dart_backend.dart' show DartBackend;
diff --git a/pkg/compiler/lib/src/resolution/semantic_visitor.dart b/pkg/compiler/lib/src/resolution/semantic_visitor.dart
index 3957d1d..b626bba 100644
--- a/pkg/compiler/lib/src/resolution/semantic_visitor.dart
+++ b/pkg/compiler/lib/src/resolution/semantic_visitor.dart
@@ -20,11 +20,10 @@
part 'semantic_visitor_mixins.dart';
part 'send_resolver.dart';
-abstract class SemanticVisitor<R, A> extends Visitor<R>
- with SendResolverMixin {
- TreeElements elements;
-
- SemanticVisitor(this.elements);
+/// Mixin that couples a [SendResolverMixin] to a [SemanticSendVisitor] in a
+/// [Visitor].
+abstract class SemanticSendResolvedMixin<R, A>
+ implements Visitor<R>, SendResolverMixin {
SemanticSendVisitor<R, A> get sendVisitor;
@@ -72,6 +71,75 @@
}
}
+/// Mixin that couples a [DeclarationResolverMixin] to a
+/// [SemanticDeclarationVisitor] in a [Visitor].
+abstract class SemanticDeclarationResolvedMixin<R, A>
+ implements Visitor<R>, DeclarationResolverMixin {
+
+ SemanticDeclarationVisitor<R, A> get declVisitor;
+
+ @override
+ R visitFunctionExpression(FunctionExpression node) {
+ // TODO(johnniwinther): Support argument.
+ A arg = null;
+
+ DeclStructure structure = computeFunctionStructure(node);
+ if (structure == null) {
+ return internalError(node, 'No structure for $node');
+ } else {
+ return structure.dispatch(declVisitor, node, arg);
+ }
+ }
+
+ visitInitializers(NodeList initializers, A arg) {
+ if (initializers != null) {
+ for (Node node in initializers) {
+ InitializerStructure structure = computeInitializerStructure(node);
+ if (structure == null) {
+ return internalError(node, 'No structure for $node');
+ } else {
+ return structure.dispatch(declVisitor, node, arg);
+ }
+ }
+ }
+ }
+
+ visitParameters(NodeList parameters, A arg) {
+ List<ParameterStructure> structures =
+ computeParameterStructures(parameters);
+ for (ParameterStructure structure in structures) {
+ structure.dispatch(declVisitor, arg);
+ }
+ }
+
+ @override
+ R visitVariableDefinitions(VariableDefinitions definitions) {
+ // TODO(johnniwinther): Support argument.
+ A arg = null;
+
+ computeVariableStructures(
+ definitions,
+ (Node node, VariableStructure structure) {
+ if (structure == null) {
+ return internalError(node, 'No structure for $node');
+ } else {
+ return structure.dispatch(declVisitor, node, arg);
+ }
+ });
+ return null;
+ }
+}
+
+abstract class SemanticVisitor<R, A> extends Visitor<R>
+ with SemanticSendResolvedMixin<R, A>,
+ SendResolverMixin,
+ SemanticDeclarationResolvedMixin<R, A>,
+ DeclarationResolverMixin {
+ TreeElements elements;
+
+ SemanticVisitor(this.elements);
+}
+
// TODO(johnniwinther): Add visits for [visitLocalConstantGet],
// [visitLocalConstantInvoke], [visitStaticConstantGet], etc.
abstract class SemanticSendVisitor<R, A> {
@@ -124,7 +192,7 @@
Send node,
ParameterElement parameter,
NodeList arguments,
- Selector selector,
+ CallStructure callStructure,
A arg);
/// Read of the local [variable].
@@ -180,7 +248,7 @@
Send node,
LocalVariableElement variable,
NodeList arguments,
- Selector selector,
+ CallStructure callStructure,
A arg);
/// Closurization of the local [function].
@@ -222,7 +290,7 @@
Send node,
LocalFunctionElement function,
NodeList arguments,
- Selector selector,
+ CallStructure callStructure,
A arg);
/// Getter call on [receiver] of the property defined by [selector].
@@ -344,7 +412,7 @@
R visitThisInvoke(
Send node,
NodeList arguments,
- Selector selector,
+ CallStructure callStructure,
A arg);
@@ -409,7 +477,7 @@
Send node,
FieldElement field,
NodeList arguments,
- Selector selector,
+ CallStructure callStructure,
A arg);
/// Closurization of the super [method].
@@ -441,7 +509,24 @@
Send node,
MethodElement method,
NodeList arguments,
- Selector selector,
+ CallStructure callStructure,
+ A arg);
+
+ /// Invocation of the super [method] with incompatible [arguments].
+ ///
+ /// For instance
+ /// class B {
+ /// foo(a, b) {}
+ /// }
+ /// class C extends B {
+ /// m() { super.foo(null); } // One argument missing.
+ /// }
+ ///
+ R visitSuperMethodIncompatibleInvoke(
+ Send node,
+ MethodElement method,
+ NodeList arguments,
+ CallStructure callStructure,
A arg);
/// Assignment of [rhs] to the super [method].
@@ -536,7 +621,7 @@
Send node,
FunctionElement getter,
NodeList arguments,
- Selector selector,
+ CallStructure callStructure,
A arg);
/// Invocation of the super [setter] with [arguments].
@@ -553,7 +638,7 @@
Send node,
FunctionElement setter,
NodeList arguments,
- Selector selector,
+ CallStructure callStructure,
A arg);
/// Invocation of a [expression] with [arguments].
@@ -621,7 +706,7 @@
Send node,
FieldElement field,
NodeList arguments,
- Selector selector,
+ CallStructure callStructure,
A arg);
/// Closurization of the static [function].
@@ -649,7 +734,22 @@
Send node,
MethodElement function,
NodeList arguments,
- Selector selector,
+ CallStructure callStructure,
+ A arg);
+
+ /// Invocation of the static [function] with incompatible [arguments].
+ ///
+ /// For instance
+ /// class C {
+ /// static foo(a, b) {}
+ /// }
+ /// m() { C.foo(null); }
+ ///
+ R visitStaticFunctionIncompatibleInvoke(
+ Send node,
+ MethodElement function,
+ NodeList arguments,
+ CallStructure callStructure,
A arg);
/// Assignment of [rhs] to the static [function].
@@ -732,7 +832,7 @@
Send node,
FunctionElement getter,
NodeList arguments,
- Selector selector,
+ CallStructure callStructure,
A arg);
/// Invocation of the static [setter] with [arguments].
@@ -747,7 +847,7 @@
Send node,
FunctionElement setter,
NodeList arguments,
- Selector selector,
+ CallStructure callStructure,
A arg);
/// Read of the top level [field].
@@ -795,7 +895,7 @@
Send node,
FieldElement field,
NodeList arguments,
- Selector selector,
+ CallStructure callStructure,
A arg);
/// Closurization of the top level [function].
@@ -819,7 +919,22 @@
Send node,
MethodElement function,
NodeList arguments,
- Selector selector,
+ CallStructure callStructure,
+ A arg);
+
+ /// Invocation of the top level [function] with incompatible [arguments].
+ ///
+ /// For instance
+ /// class C {
+ /// static foo(a, b) {}
+ /// }
+ /// m() { C.foo(null); }
+ ///
+ R visitTopLevelFunctionIncompatibleInvoke(
+ Send node,
+ MethodElement function,
+ NodeList arguments,
+ CallStructure callStructure,
A arg);
/// Assignment of [rhs] to the top level [function].
@@ -890,7 +1005,7 @@
Send node,
FunctionElement getter,
NodeList arguments,
- Selector selector,
+ CallStructure callStructure,
A arg);
/// Invocation of the top level [setter] with [arguments].
@@ -903,7 +1018,7 @@
Send node,
FunctionElement setter,
NodeList arguments,
- Selector selector,
+ CallStructure callStructure,
A arg);
/// Read of the type literal for class [element].
@@ -927,7 +1042,7 @@
Send node,
ConstantExpression constant,
NodeList arguments,
- Selector selector,
+ CallStructure callStructure,
A arg);
/// Assignment of [rhs] to the type literal for class [element].
@@ -963,7 +1078,7 @@
Send node,
ConstantExpression constant,
NodeList arguments,
- Selector selector,
+ CallStructure callStructure,
A arg);
/// Assignment of [rhs] to the type literal for typedef [element].
@@ -1002,7 +1117,7 @@
Send node,
TypeVariableElement element,
NodeList arguments,
- Selector selector,
+ CallStructure callStructure,
A arg);
/// Assignment of [rhs] to the type literal for type variable [element].
@@ -1037,7 +1152,7 @@
Send node,
ConstantExpression constant,
NodeList arguments,
- Selector selector,
+ CallStructure callStructure,
A arg);
/// Assignment of [rhs] to the type literal for `dynamic`.
@@ -1214,7 +1329,7 @@
/// m(a) => super[a];
/// }
///
- R errorUnresolvedSuperIndex(
+ R visitUnresolvedSuperIndex(
Send node,
Element element,
Node index,
@@ -2581,7 +2696,7 @@
Send node,
ConstantExpression constant,
NodeList arguments,
- Selector selector,
+ CallStructure callStreucture,
A arg);
/// Read of the unresolved [element].
@@ -2597,7 +2712,20 @@
/// m7() => prefix.C.unresolved;
///
// TODO(johnniwinther): Split the cases in which a prefix is resolved.
- R errorUnresolvedGet(
+ R visitUnresolvedGet(
+ Send node,
+ Element element,
+ A arg);
+
+ /// Read of the unresolved super [element].
+ ///
+ /// For instance
+ /// class B {}
+ /// class C {
+ /// m() => super.foo;
+ /// }
+ ///
+ R visitUnresolvedSuperGet(
Send node,
Element element,
A arg);
@@ -2634,7 +2762,22 @@
/// m7() => prefix.C.unresolved(null, 42);
///
// TODO(johnniwinther): Split the cases in which a prefix is resolved.
- R errorUnresolvedInvoke(
+ R visitUnresolvedInvoke(
+ Send node,
+ Element element,
+ NodeList arguments,
+ Selector selector,
+ A arg);
+
+ /// Invocation of the unresolved super [element] with [arguments].
+ ///
+ /// For instance
+ /// class B {}
+ /// class C extends B {
+ /// m() => super.foo();
+ /// }
+ ///
+ R visitUnresolvedSuperInvoke(
Send node,
Element element,
NodeList arguments,
@@ -2742,7 +2885,7 @@
/// m() => -super;
/// }
///
- R errorUnresolvedSuperUnary(
+ R visitUnresolvedSuperUnary(
Send node,
UnaryOperator operator,
Element element,
@@ -2757,7 +2900,7 @@
/// m() => super + 42;
/// }
///
- R errorUnresolvedSuperBinary(
+ R visitUnresolvedSuperBinary(
Send node,
Element element,
BinaryOperator operator,
@@ -2808,7 +2951,7 @@
ConstructorElement constructor,
InterfaceType type,
NodeList arguments,
- Selector selector,
+ CallStructure callStructure,
A arg);
/// Invocation of a redirecting generative [constructor] on [type] with
@@ -2828,7 +2971,7 @@
ConstructorElement constructor,
InterfaceType type,
NodeList arguments,
- Selector selector,
+ CallStructure callStructure,
A arg);
/// Invocation of a factory [constructor] on [type] with [arguments].
@@ -2847,7 +2990,7 @@
ConstructorElement constructor,
InterfaceType type,
NodeList arguments,
- Selector selector,
+ CallStructure callStructure,
A arg);
/// Invocation of a factory [constructor] on [type] with [arguments] where
@@ -2872,7 +3015,7 @@
ConstructorElement effectiveTarget,
InterfaceType effectiveTargetType,
NodeList arguments,
- Selector selector,
+ CallStructure callStructure,
A arg);
/// Invocation of an unresolved [constructor] on [type] with [arguments].
@@ -2922,7 +3065,7 @@
ConstructorElement element,
InterfaceType type,
NodeList arguments,
- Selector selector,
+ CallStructure callStructure,
A arg);
/// Invocation of a factory [constructor] on [type] with [arguments] where
@@ -2945,3 +3088,552 @@
Selector selector,
A arg);
}
+
+abstract class SemanticDeclarationVisitor<R, A> {
+ R apply(Node node, A arg);
+
+ /// Apply this visitor to the [parameters].
+ applyParameters(NodeList parameters, A arg);
+
+ /// Apply this visitor to the constructor [initializers].
+ applyInitializers(NodeList initializers, A arg);
+
+ /// A declaration of a top level [getter].
+ ///
+ /// For instance
+ /// get m => 42;
+ ///
+ R visitTopLevelGetterDeclaration(
+ FunctionExpression node,
+ MethodElement getter,
+ Node body,
+ A arg);
+
+ /// A declaration of a top level [setter].
+ ///
+ /// For instance
+ /// set m(a) {}
+ ///
+ R visitTopLevelSetterDeclaration(
+ FunctionExpression node,
+ MethodElement setter,
+ NodeList parameters,
+ Node body,
+ A arg);
+
+ /// A declaration of a top level [function].
+ ///
+ /// For instance
+ /// m(a) {}
+ ///
+ R visitTopLevelFunctionDeclaration(
+ FunctionExpression node,
+ MethodElement function,
+ NodeList parameters,
+ Node body,
+ A arg);
+
+ /// A declaration of a static [getter].
+ ///
+ /// For instance
+ /// class C {
+ /// static get m => 42;
+ /// }
+ ///
+ R visitStaticGetterDeclaration(
+ FunctionExpression node,
+ MethodElement getter,
+ Node body,
+ A arg);
+
+ /// A declaration of a static [setter].
+ ///
+ /// For instance
+ /// class C {
+ /// static set m(a) {}
+ /// }
+ ///
+ R visitStaticSetterDeclaration(
+ FunctionExpression node,
+ MethodElement setter,
+ NodeList parameters,
+ Node body,
+ A arg);
+
+ /// A declaration of a static [function].
+ ///
+ /// For instance
+ /// class C {
+ /// static m(a) {}
+ /// }
+ ///
+ R visitStaticFunctionDeclaration(
+ FunctionExpression node,
+ MethodElement function,
+ NodeList parameters,
+ Node body,
+ A arg);
+
+ /// A declaration of an abstract instance [getter].
+ ///
+ /// For instance
+ /// abstract class C {
+ /// get m;
+ /// }
+ ///
+ R visitAbstractGetterDeclaration(
+ FunctionExpression node,
+ MethodElement getter,
+ A arg);
+
+ /// A declaration of an abstract instance [setter].
+ ///
+ /// For instance
+ /// abstract class C {
+ /// set m(a);
+ /// }
+ ///
+ R visitAbstractSetterDeclaration(
+ FunctionExpression node,
+ MethodElement setter,
+ NodeList parameters,
+ A arg);
+
+ /// A declaration of an abstract instance [method].
+ ///
+ /// For instance
+ /// abstract class C {
+ /// m(a);
+ /// }
+ ///
+ R visitAbstractMethodDeclaration(
+ FunctionExpression node,
+ MethodElement method,
+ NodeList parameters,
+ A arg);
+
+ /// A declaration of an instance [getter].
+ ///
+ /// For instance
+ /// class C {
+ /// get m => 42;
+ /// }
+ ///
+ R visitInstanceGetterDeclaration(
+ FunctionExpression node,
+ MethodElement getter,
+ Node body,
+ A arg);
+
+ /// A declaration of an instance [setter].
+ ///
+ /// For instance
+ /// class C {
+ /// set m(a) {}
+ /// }
+ ///
+ R visitInstanceSetterDeclaration(
+ FunctionExpression node,
+ MethodElement setter,
+ NodeList parameters,
+ Node body,
+ A arg);
+
+ /// A declaration of an instance [method].
+ ///
+ /// For instance
+ /// class C {
+ /// m(a) {}
+ /// }
+ ///
+ R visitInstanceMethodDeclaration(
+ FunctionExpression node,
+ MethodElement method,
+ NodeList parameters,
+ Node body,
+ A arg);
+
+ /// A declaration of a local [function].
+ ///
+ /// For instance `local` in
+ /// m() {
+ /// local(a) {}
+ /// }
+ ///
+ R visitLocalFunctionDeclaration(
+ FunctionExpression node,
+ LocalFunctionElement function,
+ NodeList parameters,
+ Node body,
+ A arg);
+
+ /// A declaration of a [closure].
+ ///
+ /// For instance `(a) {}` in
+ /// m() {
+ /// var closure = (a) {};
+ /// }
+ ///
+ R visitClosureDeclaration(
+ FunctionExpression node,
+ LocalFunctionElement closure,
+ NodeList parameters,
+ Node body,
+ A arg);
+
+ /// A declaration of the [index]th [parameter] in a constructor, setter,
+ /// method or function.
+ ///
+ /// For instance `a` in
+ /// m(a) {}
+ ///
+ R visitParameterDeclaration(
+ VariableDefinitions node,
+ Node definition,
+ ParameterElement parameter,
+ int index,
+ A arg);
+
+ /// A declaration of the [index]th optional [parameter] in a constructor,
+ /// method or function with the explicit [defaultValue]. If no default value
+ /// is declared, [defaultValue] is `null`.
+ ///
+ /// For instance `a` in
+ /// m([a = 42]) {}
+ ///
+ R visitOptionalParameterDeclaration(
+ VariableDefinitions node,
+ Node definition,
+ ParameterElement parameter,
+ ConstantExpression defaultValue,
+ int index,
+ A arg);
+
+ /// A declaration of a named [parameter] in a constructor, method or function
+ /// with the explicit [defaultValue]. If no default value is declared,
+ /// [defaultValue] is `null`.
+ ///
+ /// For instance `a` in
+ /// m({a: 42}) {}
+ ///
+ R visitNamedParameterDeclaration(
+ VariableDefinitions node,
+ Node definition,
+ ParameterElement parameter,
+ ConstantExpression defaultValue,
+ A arg);
+
+ /// A declaration of the [index]th [parameter] as an initializing formal in a
+ /// constructor.
+ ///
+ /// For instance `a` in
+ /// class C {
+ /// var a;
+ /// C(this.a);
+ /// }
+ ///
+ R visitInitializingFormalDeclaration(
+ VariableDefinitions node,
+ Node definition,
+ InitializingFormalElement parameter,
+ int index,
+ A arg);
+
+ /// A declaration of the [index]th optional [parameter] as an initializing
+ /// formal in a constructor with the explicit [defaultValue]. If no default
+ /// value is declared, [defaultValue] is `null`.
+ ///
+ /// For instance `a` in
+ /// class C {
+ /// var a;
+ /// C([this.a = 42]);
+ /// }
+ ///
+ R visitOptionalInitializingFormalDeclaration(
+ VariableDefinitions node,
+ Node definition,
+ InitializingFormalElement parameter,
+ ConstantExpression defaultValue,
+ int index,
+ A arg);
+
+ /// A declaration of a named [parameter] as an initializing formal in a
+ /// constructor with the explicit [defaultValue]. If no default value is
+ /// declared, [defaultValue] is `null`.
+ ///
+ /// For instance `a` in
+ /// class C {
+ /// var a;
+ /// C({this.a: 42});
+ /// }
+ ///
+ R visitNamedInitializingFormalDeclaration(
+ VariableDefinitions node,
+ Node definition,
+ InitializingFormalElement parameter,
+ ConstantExpression defaultValue,
+ A arg);
+
+ /// A declaration of a local [variable] with the explicit [initializer]. If
+ /// no initializer is declared, [initializer] is `null`.
+ ///
+ /// For instance `a` in
+ /// m() {
+ /// var a = 42;
+ /// }
+ ///
+ R visitLocalVariableDeclaration(
+ VariableDefinitions node,
+ Node definition,
+ LocalVariableElement variable,
+ Node initializer,
+ A arg);
+
+ /// A declaration of a local constant [variable] initialized to [constant].
+ ///
+ /// For instance `a` in
+ /// m() {
+ /// const a = 42;
+ /// }
+ ///
+ R visitLocalConstantDeclaration(
+ VariableDefinitions node,
+ Node definition,
+ LocalVariableElement variable,
+ ConstantExpression constant,
+ A arg);
+
+ /// A declaration of a top level [field] with the explicit [initializer].
+ /// If no initializer is declared, [initializer] is `null`.
+ ///
+ /// For instance `a` in
+ /// var a = 42;
+ ///
+ R visitTopLevelFieldDeclaration(
+ VariableDefinitions node,
+ Node definition,
+ FieldElement field,
+ Node initializer,
+ A arg);
+
+ /// A declaration of a top level constant [field] initialized to [constant].
+ ///
+ /// For instance `a` in
+ /// const a = 42;
+ ///
+ R visitTopLevelConstantDeclaration(
+ VariableDefinitions node,
+ Node definition,
+ FieldElement field,
+ ConstantExpression constant,
+ A arg);
+
+ /// A declaration of a static [field] with the explicit [initializer].
+ /// If no initializer is declared, [initializer] is `null`.
+ ///
+ /// For instance `a` in
+ /// class C {
+ /// static var a = 42;
+ /// }
+ ///
+ R visitStaticFieldDeclaration(
+ VariableDefinitions node,
+ Node definition,
+ FieldElement field,
+ Node initializer,
+ A arg);
+
+ /// A declaration of a static constant [field] initialized to [constant].
+ ///
+ /// For instance `a` in
+ /// class C {
+ /// static const a = 42;
+ /// }
+ ///
+ R visitStaticConstantDeclaration(
+ VariableDefinitions node,
+ Node definition,
+ FieldElement field,
+ ConstantExpression constant,
+ A arg);
+
+ /// A declaration of an instance [field] with the explicit [initializer].
+ /// If no initializer is declared, [initializer] is `null`.
+ ///
+ /// For instance `a` in
+ /// class C {
+ /// var a = 42;
+ /// }
+ ///
+ R visitInstanceFieldDeclaration(
+ VariableDefinitions node,
+ Node definition,
+ FieldElement field,
+ Node initializer,
+ A arg);
+
+ /// A declaration of a generative [constructor] with the explicit constructor
+ /// [initializers].
+ ///
+ /// For instance `C` in
+ /// class C {
+ /// var a;
+ /// C(a) : this.a = a, super();
+ /// }
+ ///
+ R visitGenerativeConstructorDeclaration(
+ FunctionExpression node,
+ ConstructorElement constructor,
+ NodeList parameters,
+ NodeList initializers,
+ Node body,
+ A arg);
+
+ /// A declaration of a redirecting generative [constructor] with
+ /// [initializers] containing the redirecting constructor invocation.
+ ///
+ /// For instance `C` in
+ /// class C {
+ /// C() : this._();
+ /// C._();
+ /// }
+ ///
+ R visitRedirectingGenerativeConstructorDeclaration(
+ FunctionExpression node,
+ ConstructorElement constructor,
+ NodeList parameters,
+ NodeList initializers,
+ A arg);
+
+ /// A declaration of a factory [constructor].
+ ///
+ /// For instance `C` in
+ /// class C {
+ /// factory C(a) => null;
+ /// }
+ ///
+ R visitFactoryConstructorDeclaration(
+ FunctionExpression node,
+ ConstructorElement constructor,
+ NodeList parameters,
+ Node body,
+ A arg);
+
+ /// A declaration of a redirecting factory [constructor]. The immediate
+ /// redirection target and its type is provided in [redirectionTarget] and
+ /// [redirectionType], respectively.
+ ///
+ /// For instance
+ /// class C<T> {
+ /// factory C() = C<int>.a;
+ /// factory C.a() = C<C<T>>.b;
+ /// C.b();
+ /// }
+ /// where `C` has the redirection target `C.a` of type `C<int>` and `C.a` has
+ /// the redirection target `C.b` of type `C<C<T>>`.
+ ///
+ R visitRedirectingFactoryConstructorDeclaration(
+ FunctionExpression node,
+ ConstructorElement constructor,
+ NodeList parameters,
+ InterfaceType redirectionType,
+ ConstructorElement redirectionTarget,
+ A arg);
+
+ /// An initializer of [field] with [initializer] as found in constructor
+ /// initializers.
+ ///
+ /// For instance `this.a = 42` in
+ /// class C {
+ /// var a;
+ /// C() : this.a = 42;
+ /// }
+ ///
+ R visitFieldInitializer(
+ SendSet node,
+ FieldElement field,
+ Node initializer,
+ A arg);
+
+ /// An initializer of an unresolved field with [initializer] as found in
+ /// generative constructor initializers.
+ ///
+ /// For instance `this.a = 42` in
+ /// class C {
+ /// C() : this.a = 42;
+ /// }
+ ///
+ R errorUnresolvedFieldInitializer(
+ SendSet node,
+ Element element,
+ Node initializer,
+ A arg);
+
+ /// An super constructor invocation of [superConstructor] with [arguments] as
+ /// found in generative constructor initializers.
+ ///
+ /// For instance `super(42)` in
+ /// class B {
+ /// B(a);
+ /// }
+ /// class C extends B {
+ /// C() : super(42);
+ /// }
+ ///
+ R visitSuperConstructorInvoke(
+ Send node,
+ ConstructorElement superConstructor,
+ InterfaceType type,
+ NodeList arguments,
+ Selector selector,
+ A arg);
+
+ /// An super constructor invocation of an unresolved with [arguments] as
+ /// found in generative constructor initializers.
+ ///
+ /// For instance `super(42)` in
+ /// class B {
+ /// B(a);
+ /// }
+ /// class C extends B {
+ /// C() : super.unresolved(42);
+ /// }
+ ///
+ R errorUnresolvedSuperConstructorInvoke(
+ Send node,
+ Element element,
+ NodeList arguments,
+ Selector selector,
+ A arg);
+
+ /// An this constructor invocation of [thisConstructor] with [arguments] as
+ /// found in a redirecting generative constructors initializer.
+ ///
+ /// For instance `this._(42)` in
+ /// class C {
+ /// C() : this._(42);
+ /// C._(a);
+ /// }
+ ///
+ R visitThisConstructorInvoke(
+ Send node,
+ ConstructorElement thisConstructor,
+ NodeList arguments,
+ Selector selector,
+ A arg);
+
+ /// An this constructor invocation of an unresolved constructor with
+ /// [arguments] as found in a redirecting generative constructors initializer.
+ ///
+ /// For instance `this._(42)` in
+ /// class C {
+ /// C() : this._(42);
+ /// }
+ ///
+ R errorUnresolvedThisConstructorInvoke(
+ Send node,
+ Element element,
+ NodeList arguments,
+ Selector selector,
+ A arg);
+}
diff --git a/pkg/compiler/lib/src/resolution/semantic_visitor_mixins.dart b/pkg/compiler/lib/src/resolution/semantic_visitor_mixins.dart
index f1951bf..dce195b 100644
--- a/pkg/compiler/lib/src/resolution/semantic_visitor_mixins.dart
+++ b/pkg/compiler/lib/src/resolution/semantic_visitor_mixins.dart
@@ -4,15 +4,24 @@
part of dart2js.semantics_visitor;
+/// Interface for bulk handling of a [Node] in a semantic visitor.
+abstract class BulkHandle<R, A> {
+ /// Handle [node] either regardless of semantics or to report that [node] is
+ /// unhandled. [message] contains a message template for the latter case:
+ /// Replace '#' in [message] by `node.toString()` to create a message for the
+ /// error.
+ R bulkHandleNode(Node node, String message, A arg);
+}
+
/// Mixin that implements all `errorX` methods of [SemanticSendVisitor] by
/// delegating to a bulk handler.
///
/// Use this mixin to provide a trivial implementation for all `errorX` methods.
-abstract class ErrorBulkMixin<R, A> implements SemanticSendVisitor<R, A> {
- R bulkHandleNode(Node node, String message, A arg);
+abstract class ErrorBulkMixin<R, A>
+ implements SemanticSendVisitor<R, A>, BulkHandle<R, A> {
R bulkHandleError(Node node, A arg) {
- return bulkHandleNode(node, "Error expression `$node` unhandled.", arg);
+ return bulkHandleNode(node, "Error expression `#` unhandled.", arg);
}
@override
@@ -29,7 +38,7 @@
ConstructorElement element,
InterfaceType type,
NodeList arguments,
- Selector selector,
+ CallStructure callStructure,
A arg) {
return bulkHandleError(node, arg);
}
@@ -272,7 +281,7 @@
Send node,
FunctionElement setter,
NodeList arguments,
- Selector selector,
+ CallStructure callStructure,
A arg) {
return bulkHandleError(node, arg);
}
@@ -308,7 +317,7 @@
Send node,
FunctionElement setter,
NodeList arguments,
- Selector selector,
+ CallStructure callStructure,
A arg) {
return bulkHandleError(node, arg);
}
@@ -344,7 +353,7 @@
Send node,
FunctionElement setter,
NodeList arguments,
- Selector selector,
+ CallStructure callStructure,
A arg) {
return bulkHandleError(node, arg);
}
@@ -456,24 +465,6 @@
}
@override
- R errorUnresolvedGet(
- Send node,
- Element element,
- A arg) {
- return bulkHandleError(node, arg);
- }
-
- @override
- R errorUnresolvedInvoke(
- Send node,
- Element element,
- NodeList arguments,
- Selector selector,
- A arg) {
- return bulkHandleError(node, arg);
- }
-
- @override
R errorUnresolvedPostfix(
Send node,
Element element,
@@ -523,15 +514,6 @@
}
@override
- R errorUnresolvedSuperIndex(
- Send node,
- Element function,
- Node index,
- A arg) {
- return bulkHandleError(node, arg);
- }
-
- @override
R errorUnresolvedSuperIndexPostfix(
Send node,
Element function,
@@ -562,20 +544,10 @@
}
@override
- R errorUnresolvedSuperBinary(
+ R errorUndefinedUnaryExpression(
Send node,
- Element element,
- BinaryOperator operator,
- Node argument,
- A arg) {
- return bulkHandleError(node, arg);
- }
-
- @override
- R errorUnresolvedSuperUnary(
- Send node,
- UnaryOperator operator,
- Element element,
+ Operator operator,
+ Node expression,
A arg) {
return bulkHandleError(node, arg);
}
@@ -589,15 +561,6 @@
A arg) {
return bulkHandleError(node, arg);
}
-
- @override
- R errorUndefinedUnaryExpression(
- Send node,
- Operator operator,
- Node expression,
- A arg) {
- return bulkHandleError(node, arg);
- }
}
/// Mixin that implements all `visitXPrefix` methods of [SemanticSendVisitor] by
@@ -605,11 +568,11 @@
///
/// Use this mixin to provide a trivial implementation for all `visitXPrefix`
/// methods.
-abstract class PrefixBulkMixin<R, A> implements SemanticSendVisitor<R, A> {
- R bulkHandleNode(Node node, String message, A arg);
+abstract class PrefixBulkMixin<R, A>
+ implements SemanticSendVisitor<R, A>, BulkHandle<R, A> {
R bulkHandlePrefix(Send node, A arg) {
- return bulkHandleNode(node, "Prefix expression `$node` unhandled.", arg);
+ return bulkHandleNode(node, "Prefix expression `#` unhandled.", arg);
}
@override
@@ -795,11 +758,11 @@
///
/// Use this mixin to provide a trivial implementation for all `visitXPostfix`
/// methods.
-abstract class PostfixBulkMixin<R, A> implements SemanticSendVisitor<R, A> {
- R bulkHandleNode(Node node, String message, A arg);
+abstract class PostfixBulkMixin<R, A>
+ implements SemanticSendVisitor<R, A>, BulkHandle<R, A> {
R bulkHandlePostfix(Send node, A arg) {
- return bulkHandleNode(node, "Postfix expression `$node` unhandled.", arg);
+ return bulkHandleNode(node, "Postfix expression `#` unhandled.", arg);
}
@override
@@ -985,11 +948,11 @@
///
/// Use this mixin to provide a trivial implementation for all `xCompound`
/// methods.
-abstract class CompoundBulkMixin<R, A> implements SemanticSendVisitor<R, A> {
- R bulkHandleNode(Node node, String message, A arg);
+abstract class CompoundBulkMixin<R, A>
+ implements SemanticSendVisitor<R, A>, BulkHandle<R, A> {
R bulkHandleCompound(Send node, A arg) {
- return bulkHandleNode(node, "Compound assignment `$node` unhandled.", arg);
+ return bulkHandleNode(node, "Compound assignment `#` unhandled.", arg);
}
@override
@@ -1159,11 +1122,11 @@
///
/// Use this mixin to provide a trivial implementation for all `visitXInvoke`
/// methods.
-abstract class InvokeBulkMixin<R, A> implements SemanticSendVisitor<R, A> {
- R bulkHandleNode(Node node, String message, A arg);
+abstract class InvokeBulkMixin<R, A>
+ implements SemanticSendVisitor<R, A>, BulkHandle<R, A> {
R bulkHandleInvoke(Send node, A arg) {
- return bulkHandleNode(node, "Invocation `$node` unhandled.", arg);
+ return bulkHandleNode(node, "Invocation `#` unhandled.", arg);
}
@override
@@ -1171,7 +1134,7 @@
Send node,
ConstantExpression constant,
NodeList arguments,
- Selector selector,
+ CallStructure callStructure,
A arg) {
return bulkHandleInvoke(node, arg);
}
@@ -1191,7 +1154,7 @@
Send node,
ConstantExpression constant,
NodeList arguments,
- Selector selector,
+ CallStructure callStructure,
A arg) {
return bulkHandleInvoke(node, arg);
}
@@ -1211,7 +1174,7 @@
Send node,
LocalFunctionElement function,
NodeList arguments,
- Selector selector,
+ CallStructure callStructure,
A arg) {
return bulkHandleInvoke(node, arg);
}
@@ -1221,7 +1184,7 @@
Send node,
LocalVariableElement variable,
NodeList arguments,
- Selector selector,
+ CallStructure callStructure,
A arg) {
return bulkHandleInvoke(node, arg);
}
@@ -1231,7 +1194,7 @@
Send node,
ParameterElement parameter,
NodeList arguments,
- Selector selector,
+ CallStructure callStructure,
A arg) {
return bulkHandleInvoke(node, arg);
}
@@ -1241,7 +1204,7 @@
Send node,
FieldElement field,
NodeList arguments,
- Selector selector,
+ CallStructure callStructure,
A arg) {
return bulkHandleInvoke(node, arg);
}
@@ -1251,7 +1214,17 @@
Send node,
MethodElement function,
NodeList arguments,
- Selector selector,
+ CallStructure callStructure,
+ A arg) {
+ return bulkHandleInvoke(node, arg);
+ }
+
+ @override
+ R visitStaticFunctionIncompatibleInvoke(
+ Send node,
+ MethodElement function,
+ NodeList arguments,
+ CallStructure callStructure,
A arg) {
return bulkHandleInvoke(node, arg);
}
@@ -1261,7 +1234,7 @@
Send node,
FunctionElement getter,
NodeList arguments,
- Selector selector,
+ CallStructure callStructure,
A arg) {
return bulkHandleInvoke(node, arg);
}
@@ -1271,7 +1244,7 @@
Send node,
FieldElement field,
NodeList arguments,
- Selector selector,
+ CallStructure callStructure,
A arg) {
return bulkHandleInvoke(node, arg);
}
@@ -1281,7 +1254,7 @@
Send node,
FunctionElement getter,
NodeList arguments,
- Selector selector,
+ CallStructure callStructure,
A arg) {
return bulkHandleInvoke(node, arg);
}
@@ -1291,7 +1264,17 @@
Send node,
MethodElement method,
NodeList arguments,
- Selector selector,
+ CallStructure callStructure,
+ A arg) {
+ return bulkHandleInvoke(node, arg);
+ }
+
+ @override
+ R visitSuperMethodIncompatibleInvoke(
+ Send node,
+ MethodElement method,
+ NodeList arguments,
+ CallStructure callStructure,
A arg) {
return bulkHandleInvoke(node, arg);
}
@@ -1300,7 +1283,7 @@
R visitThisInvoke(
Send node,
NodeList arguments,
- Selector selector,
+ CallStructure callStructure,
A arg) {
return bulkHandleInvoke(node, arg);
}
@@ -1319,7 +1302,7 @@
Send node,
FieldElement field,
NodeList arguments,
- Selector selector,
+ CallStructure callStructure,
A arg) {
return bulkHandleInvoke(node, arg);
}
@@ -1329,7 +1312,17 @@
Send node,
MethodElement function,
NodeList arguments,
- Selector selector,
+ CallStructure callStructure,
+ A arg) {
+ return bulkHandleInvoke(node, arg);
+ }
+
+ @override
+ R visitTopLevelFunctionIncompatibleInvoke(
+ Send node,
+ MethodElement function,
+ NodeList arguments,
+ CallStructure callStructure,
A arg) {
return bulkHandleInvoke(node, arg);
}
@@ -1339,7 +1332,7 @@
Send node,
FunctionElement getter,
NodeList arguments,
- Selector selector,
+ CallStructure callStructure,
A arg) {
return bulkHandleInvoke(node, arg);
}
@@ -1349,7 +1342,7 @@
Send node,
TypeVariableElement element,
NodeList arguments,
- Selector selector,
+ CallStructure callStructure,
A arg) {
return bulkHandleInvoke(node, arg);
}
@@ -1359,7 +1352,7 @@
Send node,
ConstantExpression constant,
NodeList arguments,
- Selector selector,
+ CallStructure callStructure,
A arg) {
return bulkHandleInvoke(node, arg);
}
@@ -1369,6 +1362,26 @@
Send node,
ConstantExpression constant,
NodeList arguments,
+ CallStructure callStructure,
+ A arg) {
+ return bulkHandleInvoke(node, arg);
+ }
+
+ @override
+ R visitUnresolvedInvoke(
+ Send node,
+ Element element,
+ NodeList arguments,
+ Selector selector,
+ A arg) {
+ return bulkHandleInvoke(node, arg);
+ }
+
+ @override
+ R visitUnresolvedSuperInvoke(
+ Send node,
+ Element function,
+ NodeList arguments,
Selector selector,
A arg) {
return bulkHandleInvoke(node, arg);
@@ -1380,11 +1393,11 @@
///
/// Use this mixin to provide a trivial implementation for all `visitXGet`
/// methods.
-abstract class GetBulkMixin<R, A> implements SemanticSendVisitor<R, A> {
- R bulkHandleNode(Node node, String message, A arg);
+abstract class GetBulkMixin<R, A>
+ implements SemanticSendVisitor<R, A>, BulkHandle<R, A> {
R bulkHandleGet(Node node, A arg) {
- return bulkHandleNode(node, "Read `$node` unhandled.", arg);
+ return bulkHandleNode(node, "Read `#` unhandled.", arg);
}
@override
@@ -1544,6 +1557,22 @@
A arg) {
return bulkHandleGet(node, arg);
}
+
+ @override
+ R visitUnresolvedGet(
+ Send node,
+ Element element,
+ A arg) {
+ return bulkHandleGet(node, arg);
+ }
+
+ @override
+ R visitUnresolvedSuperGet(
+ Send node,
+ Element element,
+ A arg) {
+ return bulkHandleGet(node, arg);
+ }
}
/// Mixin that implements all `visitXSet` methods of [SemanticSendVisitor] by
@@ -1551,11 +1580,11 @@
///
/// Use this mixin to provide a trivial implementation for all `visitXSet`
/// methods.
-abstract class SetBulkMixin<R, A> implements SemanticSendVisitor<R, A> {
- R bulkHandleNode(Node node, String message, A arg);
+abstract class SetBulkMixin<R, A>
+ implements SemanticSendVisitor<R, A>, BulkHandle<R, A> {
R bulkHandleSet(Send node, A arg) {
- return bulkHandleNode(node, "Assignment `$node` unhandled.", arg);
+ return bulkHandleNode(node, "Assignment `#` unhandled.", arg);
}
@override
@@ -1655,11 +1684,11 @@
///
/// Use this mixin to provide a trivial implementation for all `visitXIndexSet`
/// methods.
-abstract class IndexSetBulkMixin<R, A> implements SemanticSendVisitor<R, A> {
- R bulkHandleNode(Node node, String message, A arg);
+abstract class IndexSetBulkMixin<R, A>
+ implements SemanticSendVisitor<R, A>, BulkHandle<R, A> {
R bulkHandleIndexSet(Send node, A arg) {
- return bulkHandleNode(node, "Index set expression `$node` unhandled.", arg);
+ return bulkHandleNode(node, "Index set expression `#` unhandled.", arg);
}
@override
@@ -1711,11 +1740,11 @@
///
/// Use this mixin to provide a trivial implementation for all binary visitor
/// methods.
-abstract class BinaryBulkMixin<R, A> implements SemanticSendVisitor<R, A> {
- R bulkHandleNode(Node node, String message, A arg);
+abstract class BinaryBulkMixin<R, A>
+ implements SemanticSendVisitor<R, A>, BulkHandle<R, A> {
R bulkHandleBinary(Send node, A arg) {
- return bulkHandleNode(node, "Binary expression `$node` unhandled.", arg);
+ return bulkHandleNode(node, "Binary expression `#` unhandled.", arg);
}
@override
@@ -1791,6 +1820,35 @@
A arg) {
return bulkHandleBinary(node, arg);
}
+
+ @override
+ R visitUnresolvedSuperBinary(
+ Send node,
+ FunctionElement function,
+ BinaryOperator operator,
+ Node argument,
+ A arg) {
+ return bulkHandleBinary(node, arg);
+ }
+
+ @override
+ R visitUnresolvedSuperInvoke(
+ Send node,
+ Element function,
+ NodeList arguments,
+ Selector selector,
+ A arg) {
+ return bulkHandleBinary(node, arg);
+ }
+
+ @override
+ R visitUnresolvedSuperIndex(
+ Send node,
+ FunctionElement function,
+ Node index,
+ A arg) {
+ return bulkHandleBinary(node, arg);
+ }
}
/// Mixin that implements all unary visitor methods in [SemanticSendVisitor] by
@@ -1798,11 +1856,11 @@
///
/// Use this mixin to provide a trivial implementation for all unary visitor
/// methods.
-abstract class UnaryBulkMixin<R, A> implements SemanticSendVisitor<R, A> {
- R bulkHandleNode(Node node, String message, A arg);
+abstract class UnaryBulkMixin<R, A>
+ implements SemanticSendVisitor<R, A>, BulkHandle<R, A> {
R bulkHandleUnary(Send node, A arg) {
- return bulkHandleNode(node, "Unary expression `$node` unhandled.", arg);
+ return bulkHandleNode(node, "Unary expression `#` unhandled.", arg);
}
@override
@@ -1814,8 +1872,11 @@
}
@override
- R visitSuperUnary(Send node, UnaryOperator operator,
- FunctionElement function, A arg) {
+ R visitSuperUnary(
+ Send node,
+ UnaryOperator operator,
+ FunctionElement function,
+ A arg) {
return bulkHandleUnary(node, arg);
}
@@ -1827,6 +1888,15 @@
A arg) {
return bulkHandleUnary(node, arg);
}
+
+ @override
+ R visitUnresolvedSuperUnary(
+ Send node,
+ UnaryOperator operator,
+ FunctionElement function,
+ A arg) {
+ return bulkHandleUnary(node, arg);
+ }
}
/// Mixin that implements all purely structural visitor methods in
@@ -1834,8 +1904,8 @@
///
/// Use this mixin to provide a trivial implementation for all purely structural
/// visitor methods.
-abstract class BaseBulkMixin<R, A> implements SemanticSendVisitor<R, A> {
- R bulkHandleNode(Node node, String message, A arg);
+abstract class BaseBulkMixin<R, A>
+ implements SemanticSendVisitor<R, A>, BulkHandle<R, A> {
@override
R visitAs(
@@ -1843,7 +1913,7 @@
Node expression,
DartType type,
A arg) {
- return bulkHandleNode(node, 'As cast `$node` unhandled.', arg);
+ return bulkHandleNode(node, 'As cast `#` unhandled.', arg);
}
@override
@@ -1851,7 +1921,7 @@
Send node,
Node expression,
A arg) {
- return bulkHandleNode(node, 'Assert `$node` unhandled.', arg);
+ return bulkHandleNode(node, 'Assert `#` unhandled.', arg);
}
@override
@@ -1860,7 +1930,7 @@
Node expression,
DartType type,
A arg) {
- return bulkHandleNode(node, 'Is test `$node` unhandled.', arg);
+ return bulkHandleNode(node, 'Is test `#` unhandled.', arg);
}
@override
@@ -1869,7 +1939,7 @@
Node expression,
DartType type,
A arg) {
- return bulkHandleNode(node, 'Is not test `$node` unhandled.', arg);
+ return bulkHandleNode(node, 'Is not test `#` unhandled.', arg);
}
@override
@@ -1878,7 +1948,7 @@
Node left,
Node right,
A arg) {
- return bulkHandleNode(node, 'Lazy and `$node` unhandled.', arg);
+ return bulkHandleNode(node, 'Lazy and `#` unhandled.', arg);
}
@override
@@ -1887,7 +1957,7 @@
Node left,
Node right,
A arg) {
- return bulkHandleNode(node, 'Lazy or `$node` unhandled.', arg);
+ return bulkHandleNode(node, 'Lazy or `#` unhandled.', arg);
}
}
@@ -1896,11 +1966,11 @@
///
/// Use this mixin to provide a trivial implementation for `super` calls
/// visitor methods.
-abstract class SuperBulkMixin<R, A> implements SemanticSendVisitor<R, A> {
- R bulkHandleNode(Node node, String message, A arg);
+abstract class SuperBulkMixin<R, A>
+ implements SemanticSendVisitor<R, A>, BulkHandle<R, A> {
R bulkHandleSuper(Send node, A arg) {
- return bulkHandleNode(node, "Super call `$node` unhandled.", arg);
+ return bulkHandleNode(node, "Super call `#` unhandled.", arg);
}
@override
@@ -1977,7 +2047,7 @@
Send node,
FieldElement field,
NodeList arguments,
- Selector selector,
+ CallStructure callStructure,
A arg) {
return bulkHandleSuper(node, arg);
}
@@ -2084,7 +2154,7 @@
Send node,
FunctionElement getter,
NodeList arguments,
- Selector selector,
+ CallStructure callStructure,
A arg) {
return bulkHandleSuper(node, arg);
}
@@ -2143,7 +2213,17 @@
Send node,
MethodElement method,
NodeList arguments,
- Selector selector,
+ CallStructure callStructure,
+ A arg) {
+ return bulkHandleSuper(node, arg);
+ }
+
+ @override
+ R visitSuperMethodIncompatibleInvoke(
+ Send node,
+ MethodElement method,
+ NodeList arguments,
+ CallStructure callStructure,
A arg) {
return bulkHandleSuper(node, arg);
}
@@ -2205,14 +2285,60 @@
A arg) {
return bulkHandleSuper(node, arg);
}
+
+ @override
+ R visitUnresolvedSuperBinary(
+ Send node,
+ Element element,
+ BinaryOperator operator,
+ Node argument,
+ A arg) {
+ return bulkHandleSuper(node, arg);
+ }
+
+ @override
+ R visitUnresolvedSuperGet(
+ Send node,
+ Element element,
+ A arg) {
+ return bulkHandleSuper(node, arg);
+ }
+
+ @override
+ R visitUnresolvedSuperInvoke(
+ Send node,
+ Element function,
+ NodeList arguments,
+ Selector selector,
+ A arg) {
+ return bulkHandleSuper(node, arg);
+ }
+
+ @override
+ R visitUnresolvedSuperIndex(
+ Send node,
+ Element function,
+ Node index,
+ A arg) {
+ return bulkHandleSuper(node, arg);
+ }
+
+ @override
+ R visitUnresolvedSuperUnary(
+ Send node,
+ UnaryOperator operator,
+ Element element,
+ A arg) {
+ return bulkHandleSuper(node, arg);
+ }
}
-abstract class NewBulkMixin<R, A> implements SemanticSendVisitor<R, A> {
- R bulkHandleNode(Node node, String message, A arg);
+abstract class NewBulkMixin<R, A>
+ implements SemanticSendVisitor<R, A>, BulkHandle<R, A> {
R bulkHandleNew(NewExpression node, A arg) {
return bulkHandleNode(
- node, "Constructor invocation `$node` unhandled.", arg);
+ node, "Constructor invocation `#` unhandled.", arg);
}
@override
@@ -2228,7 +2354,7 @@
ConstructorElement constructor,
InterfaceType type,
NodeList arguments,
- Selector selector,
+ CallStructure callStructure,
A arg) {
return bulkHandleNew(node, arg);
}
@@ -2238,7 +2364,7 @@
ConstructorElement constructor,
InterfaceType type,
NodeList arguments,
- Selector selector,
+ CallStructure callStructure,
A arg) {
return bulkHandleNew(node, arg);
}
@@ -2248,7 +2374,7 @@
ConstructorElement constructor,
InterfaceType type,
NodeList arguments,
- Selector selector,
+ CallStructure callStructure,
A arg) {
return bulkHandleNew(node, arg);
}
@@ -2260,7 +2386,7 @@
ConstructorElement effectiveTarget,
InterfaceType effectiveTargetType,
NodeList arguments,
- Selector selector,
+ CallStructure callStructure,
A arg) {
return bulkHandleNew(node, arg);
}
@@ -2271,7 +2397,7 @@
/// This class is useful in itself, but shows how to use the `BulkX` mixins and
/// tests that the union of the `BulkX` mixins implement all `visit` and `error`
/// methods of [SemanticSendVisitor].
-class BulkVisitor<R, A> extends SemanticSendVisitor<R, A>
+class BulkSendVisitor<R, A> extends SemanticSendVisitor<R, A>
with GetBulkMixin<R, A>,
SetBulkMixin<R, A>,
ErrorBulkMixin<R, A>,
@@ -2286,17 +2412,487 @@
NewBulkMixin<R, A> {
@override
R apply(Node node, A arg) {
- throw new UnimplementedError("BulkVisitor.apply unimplemented");
+ throw new UnimplementedError("BulkSendVisitor.apply unimplemented");
}
@override
R bulkHandleNode(Node node, String message, A arg) {
- throw new UnimplementedError("BulkVisitor.bulkHandleNode unimplemented");
+ throw new UnimplementedError(
+ "BulkSendVisitor.bulkHandleNode unimplemented");
}
}
+/// Mixin that implements all `visitXParameterDecl` and
+/// `visitXInitializingFormalDecl` methods of [SemanticDeclarationVisitor]
+/// by delegating to a bulk handler.
+///
+/// Use this mixin to provide a trivial implementation for these methods.
+abstract class ParameterBulkMixin<R, A>
+ implements SemanticDeclarationVisitor<R, A>, BulkHandle<R, A> {
+
+ R bulkHandleParameterDeclaration(VariableDefinitions node, A arg) {
+ return bulkHandleNode(
+ node, "Parameter declaration `#` unhandled.", arg);
+ }
+
+ @override
+ R visitInitializingFormalDeclaration(
+ VariableDefinitions node,
+ Node definition,
+ InitializingFormalElement parameter,
+ int index,
+ A arg) {
+ return bulkHandleParameterDeclaration(node, arg);
+ }
+
+ @override
+ R visitNamedInitializingFormalDeclaration(
+ VariableDefinitions node,
+ Node definition,
+ InitializingFormalElement parameter,
+ ConstantExpression defaultValue,
+ A arg) {
+ return bulkHandleParameterDeclaration(node, arg);
+ }
+
+ @override
+ R visitNamedParameterDeclaration(
+ VariableDefinitions node,
+ Node definition,
+ ParameterElement parameter,
+ ConstantExpression defaultValue,
+ A arg) {
+ return bulkHandleParameterDeclaration(node, arg);
+ }
+
+ @override
+ R visitOptionalInitializingFormalDeclaration(
+ VariableDefinitions node,
+ Node definition,
+ InitializingFormalElement parameter,
+ ConstantExpression defaultValue,
+ int index,
+ A arg) {
+ return bulkHandleParameterDeclaration(node, arg);
+ }
+
+ @override
+ R visitOptionalParameterDeclaration(
+ VariableDefinitions node,
+ Node definition,
+ ParameterElement parameter,
+ ConstantExpression defaultValue,
+ int index,
+ A arg) {
+ return bulkHandleParameterDeclaration(node, arg);
+ }
+
+ @override
+ R visitParameterDeclaration(
+ VariableDefinitions node,
+ Node definition,
+ ParameterElement parameter,
+ int index,
+ A arg) {
+ return bulkHandleParameterDeclaration(node, arg);
+ }
+}
+
+/// Mixin that implements all `visitXConstructorDecl` methods of
+/// [SemanticDeclarationVisitor] by delegating to a bulk handler.
+///
+/// Use this mixin to provide a trivial implementation for these methods.
+abstract class ConstructorBulkMixin<R, A>
+ implements SemanticDeclarationVisitor<R, A>, BulkHandle<R, A> {
+
+ R bulkHandleConstructorDeclaration(FunctionExpression node, A arg) {
+ return bulkHandleNode(
+ node, "Constructor declaration `#` unhandled.", arg);
+ }
+
+ @override
+ R visitFactoryConstructorDeclaration(
+ FunctionExpression node,
+ ConstructorElement constructor,
+ NodeList parameters,
+ Node body,
+ A arg) {
+ return bulkHandleConstructorDeclaration(node, arg);
+ }
+
+ @override
+ R visitGenerativeConstructorDeclaration(
+ FunctionExpression node,
+ ConstructorElement constructor,
+ NodeList parameters,
+ NodeList initializers,
+ Node body,
+ A arg) {
+ return bulkHandleConstructorDeclaration(node, arg);
+ }
+
+ @override
+ R visitRedirectingFactoryConstructorDeclaration(
+ FunctionExpression node,
+ ConstructorElement constructor,
+ NodeList parameters,
+ InterfaceType redirectionType,
+ ConstructorElement redirectionTarget,
+ A arg) {
+ return bulkHandleConstructorDeclaration(node, arg);
+ }
+
+ @override
+ R visitRedirectingGenerativeConstructorDeclaration(
+ FunctionExpression node,
+ ConstructorElement constructor,
+ NodeList parameters,
+ NodeList initializers,
+ A arg) {
+ return bulkHandleConstructorDeclaration(node, arg);
+ }
+}
+
+/// Mixin that implements all constructor initializer visitor methods of
+/// [SemanticDeclarationVisitor] by delegating to a bulk handler.
+///
+/// Use this mixin to provide a trivial implementation for these methods.
+abstract class InitializerBulkMixin<R, A>
+ implements SemanticDeclarationVisitor<R, A>, BulkHandle<R, A> {
+
+ R bulkHandleInitializer(Send node, A arg) {
+ return bulkHandleNode(
+ node, "Initializer `#` unhandled.", arg);
+ }
+
+ @override
+ R errorUnresolvedFieldInitializer(
+ SendSet node,
+ Element element,
+ Node initializer,
+ A arg) {
+ return bulkHandleInitializer(node, arg);
+ }
+
+ @override
+ R errorUnresolvedSuperConstructorInvoke(
+ Send node,
+ Element element,
+ NodeList arguments,
+ Selector selector,
+ A arg) {
+ return bulkHandleInitializer(node, arg);
+ }
+
+ @override
+ R errorUnresolvedThisConstructorInvoke(
+ Send node,
+ Element element,
+ NodeList arguments,
+ Selector selector,
+ A arg) {
+ return bulkHandleInitializer(node, arg);
+ }
+
+ @override
+ R visitFieldInitializer(
+ SendSet node,
+ FieldElement field,
+ Node initializer,
+ A arg) {
+ return bulkHandleInitializer(node, arg);
+ }
+
+ @override
+ R visitSuperConstructorInvoke(
+ Send node,
+ ConstructorElement superConstructor,
+ InterfaceType type,
+ NodeList arguments,
+ Selector selector,
+ A arg) {
+ return bulkHandleInitializer(node, arg);
+ }
+
+ @override
+ R visitThisConstructorInvoke(
+ Send node,
+ ConstructorElement thisConstructor,
+ NodeList arguments,
+ Selector selector,
+ A arg) {
+ return bulkHandleInitializer(node, arg);
+ }
+}
+
+/// Mixin that implements all function declaration visitor methods of
+/// [SemanticDeclarationVisitor] by delegating to a bulk handler.
+///
+/// Use this mixin to provide a trivial implementation for these methods.
+abstract class FunctionBulkMixin<R, A>
+ implements SemanticDeclarationVisitor<R, A>, BulkHandle<R, A> {
+
+ R bulkHandleFunctionDeclaration(FunctionExpression node, A arg) {
+ return bulkHandleNode(
+ node, "Function declaration `#` unhandled.", arg);
+ }
+
+ @override
+ R visitAbstractGetterDeclaration(
+ FunctionExpression node,
+ MethodElement getter,
+ A arg) {
+ return bulkHandleFunctionDeclaration(node, arg);
+ }
+
+ @override
+ R visitAbstractMethodDeclaration(
+ FunctionExpression node,
+ MethodElement method,
+ NodeList parameters,
+ A arg) {
+ return bulkHandleFunctionDeclaration(node, arg);
+ }
+
+ @override
+ R visitAbstractSetterDeclaration(
+ FunctionExpression node,
+ MethodElement setter,
+ NodeList parameters,
+ A arg) {
+ return bulkHandleFunctionDeclaration(node, arg);
+ }
+
+ @override
+ R visitClosureDeclaration(
+ FunctionExpression node,
+ LocalFunctionElement closure,
+ NodeList parameters,
+ Node body,
+ A arg) {
+ return bulkHandleFunctionDeclaration(node, arg);
+ }
+
+ @override
+ R visitInstanceGetterDeclaration(
+ FunctionExpression node,
+ MethodElement getter,
+ Node body,
+ A arg) {
+ return bulkHandleFunctionDeclaration(node, arg);
+ }
+
+ @override
+ R visitInstanceMethodDeclaration(
+ FunctionExpression node,
+ MethodElement method,
+ NodeList parameters,
+ Node body,
+ A arg) {
+ return bulkHandleFunctionDeclaration(node, arg);
+ }
+
+ @override
+ R visitInstanceSetterDeclaration(
+ FunctionExpression node,
+ MethodElement setter,
+ NodeList parameters,
+ Node body,
+ A arg) {
+ return bulkHandleFunctionDeclaration(node, arg);
+ }
+
+ @override
+ R visitLocalFunctionDeclaration(
+ FunctionExpression node,
+ LocalFunctionElement function,
+ NodeList parameters,
+ Node body,
+ A arg) {
+ return bulkHandleFunctionDeclaration(node, arg);
+ }
+
+ @override
+ R visitStaticFunctionDeclaration(
+ FunctionExpression node,
+ MethodElement function,
+ NodeList parameters,
+ Node body,
+ A arg) {
+ return bulkHandleFunctionDeclaration(node, arg);
+ }
+
+ @override
+ R visitStaticGetterDeclaration(
+ FunctionExpression node,
+ MethodElement getter,
+ Node body,
+ A arg) {
+ return bulkHandleFunctionDeclaration(node, arg);
+ }
+
+ @override
+ R visitStaticSetterDeclaration(
+ FunctionExpression node,
+ MethodElement setter,
+ NodeList parameters,
+ Node body,
+ A arg) {
+ return bulkHandleFunctionDeclaration(node, arg);
+ }
+
+ @override
+ R visitTopLevelFunctionDeclaration(
+ FunctionExpression node,
+ MethodElement function,
+ NodeList parameters,
+ Node body,
+ A arg) {
+ return bulkHandleFunctionDeclaration(node, arg);
+ }
+
+ @override
+ R visitTopLevelGetterDeclaration(
+ FunctionExpression node,
+ MethodElement getter,
+ Node body,
+ A arg) {
+ return bulkHandleFunctionDeclaration(node, arg);
+ }
+
+ @override
+ R visitTopLevelSetterDeclaration(
+ FunctionExpression node,
+ MethodElement setter,
+ NodeList parameters,
+ Node body,
+ A arg) {
+ return bulkHandleFunctionDeclaration(node, arg);
+ }
+}
+
+/// Mixin that implements all variable/field declaration visitor methods of
+/// [SemanticDeclarationVisitor] by delegating to a bulk handler.
+///
+/// Use this mixin to provide a trivial implementation for these methods.
+abstract class VariableBulkMixin<R, A>
+ implements SemanticDeclarationVisitor<R, A>, BulkHandle<R, A> {
+
+ R bulkHandleVariableDeclaration(VariableDefinitions node, A arg) {
+ return bulkHandleNode(
+ node, "Variable declaration `#` unhandled.", arg);
+ }
+
+ @override
+ R visitInstanceFieldDeclaration(
+ VariableDefinitions node,
+ Node definition,
+ FieldElement field,
+ Node initializer,
+ A arg) {
+ return bulkHandleVariableDeclaration(node, arg);
+ }
+
+ @override
+ R visitLocalConstantDeclaration(
+ VariableDefinitions node,
+ Node definition,
+ LocalVariableElement variable,
+ ConstantExpression constant,
+ A arg) {
+ return bulkHandleVariableDeclaration(node, arg);
+ }
+
+ @override
+ R visitLocalVariableDeclaration(
+ VariableDefinitions node,
+ Node definition,
+ LocalVariableElement variable,
+ Node initializer,
+ A arg) {
+ return bulkHandleVariableDeclaration(node, arg);
+ }
+
+ @override
+ R visitStaticConstantDeclaration(
+ VariableDefinitions node,
+ Node definition,
+ FieldElement field,
+ ConstantExpression constant,
+ A arg) {
+ return bulkHandleVariableDeclaration(node, arg);
+ }
+
+ @override
+ R visitStaticFieldDeclaration(
+ VariableDefinitions node,
+ Node definition,
+ FieldElement field,
+ Node initializer,
+ A arg) {
+ return bulkHandleVariableDeclaration(node, arg);
+ }
+
+ @override
+ R visitTopLevelConstantDeclaration(
+ VariableDefinitions node,
+ Node definition,
+ FieldElement field,
+ ConstantExpression constant,
+ A arg) {
+ return bulkHandleVariableDeclaration(node, arg);
+ }
+
+ @override
+ R visitTopLevelFieldDeclaration(
+ VariableDefinitions node,
+ Node definition,
+ FieldElement field,
+ Node initializer,
+ A arg) {
+ return bulkHandleVariableDeclaration(node, arg);
+ }
+}
+
+/// Visitor that implements [SemanticDeclarationVisitor] by the use of `BulkX`
+/// mixins.
+///
+/// This class is useful in itself, but shows how to use the `BulkX` mixins and
+/// tests that the union of the `BulkX` mixins implement all `visit` and `error`
+/// methods of [SemanticDeclarationVisitor].
+class BulkDeclarationVisitor<R, A> extends SemanticDeclarationVisitor<R, A>
+ with ConstructorBulkMixin<R, A>,
+ FunctionBulkMixin<R, A>,
+ VariableBulkMixin<R, A>,
+ ParameterBulkMixin<R, A>,
+ InitializerBulkMixin<R, A> {
+ @override
+ R apply(Node node, A arg) {
+ throw new UnimplementedError("BulkDeclVisitor.apply unimplemented");
+ }
+
+ @override
+ R bulkHandleNode(Node node, String message, A arg) {
+ throw new UnimplementedError(
+ "BulkDeclVisitor.bulkHandleNode unimplemented");
+ }
+
+ @override
+ applyInitializers(NodeList initializers, A arg) {
+ throw new UnimplementedError(
+ "BulkDeclVisitor.applyInitializers unimplemented");
+ }
+
+ @override
+ applyParameters(NodeList parameters, A arg) {
+ throw new UnimplementedError(
+ "BulkDeclVisitor.applyParameters unimplemented");
+ }
+}
+
+
/// [SemanticSendVisitor] that visits subnodes.
-class TraversalMixin<R, A> implements SemanticSendVisitor<R, A> {
+class TraversalSendMixin<R, A> implements SemanticSendVisitor<R, A> {
@override
R apply(Node node, A arg) {
throw new UnimplementedError("TraversalMixin.apply unimplemented");
@@ -2508,7 +3104,7 @@
Send node,
FunctionElement setter,
NodeList arguments,
- Selector selector,
+ CallStructure callStructure,
A arg) {
apply(arguments, arg);
return null;
@@ -2547,7 +3143,7 @@
Send node,
FunctionElement setter,
NodeList arguments,
- Selector selector,
+ CallStructure callStructure,
A arg) {
apply(arguments, arg);
return null;
@@ -2586,7 +3182,7 @@
Send node,
FunctionElement setter,
NodeList arguments,
- Selector selector,
+ CallStructure callStructure,
A arg) {
apply(arguments, arg);
return null;
@@ -2613,7 +3209,7 @@
}
@override
- R errorUnresolvedSuperIndex(
+ R visitUnresolvedSuperIndex(
Send node,
Element function,
Node index,
@@ -2623,6 +3219,25 @@
}
@override
+ R visitUnresolvedSuperGet(
+ Send node,
+ Element element,
+ A arg) {
+ return null;
+ }
+
+ @override
+ R visitUnresolvedSuperInvoke(
+ Send node,
+ Element function,
+ NodeList arguments,
+ Selector selector,
+ A arg) {
+ apply(arguments, arg);
+ return null;
+ }
+
+ @override
R visitAs(
Send node,
Node expression,
@@ -2677,7 +3292,7 @@
Send node,
ConstantExpression constant,
NodeList arguments,
- Selector selector,
+ CallStructure callStructure,
A arg) {
apply(arguments, arg);
return null;
@@ -2728,7 +3343,7 @@
Send node,
ConstantExpression constant,
NodeList arguments,
- Selector selector,
+ CallStructure callStructure,
A arg) {
apply(arguments, arg);
return null;
@@ -2829,7 +3444,7 @@
Send node,
ConstantExpression constant,
NodeList arguments,
- Selector selector,
+ CallStructure callStructure,
A arg) {
apply(arguments, arg);
return null;
@@ -2933,7 +3548,7 @@
Send node,
LocalFunctionElement function,
NodeList arguments,
- Selector selector,
+ CallStructure callStructure,
A arg) {
apply(arguments, arg);
return null;
@@ -2963,7 +3578,7 @@
Send node,
LocalVariableElement variable,
NodeList arguments,
- Selector selector,
+ CallStructure callStructure,
A arg) {
apply(arguments, arg);
return null;
@@ -3063,7 +3678,7 @@
Send node,
ParameterElement parameter,
NodeList arguments,
- Selector selector,
+ CallStructure callStructure,
A arg) {
apply(arguments, arg);
return null;
@@ -3121,7 +3736,7 @@
Send node,
FieldElement field,
NodeList arguments,
- Selector selector,
+ CallStructure callStructure,
A arg) {
apply(arguments, arg);
return null;
@@ -3168,7 +3783,18 @@
Send node,
MethodElement function,
NodeList arguments,
- Selector selector,
+ CallStructure callStructure,
+ A arg) {
+ apply(arguments, arg);
+ return null;
+ }
+
+ @override
+ R visitStaticFunctionIncompatibleInvoke(
+ Send node,
+ MethodElement function,
+ NodeList arguments,
+ CallStructure callStructure,
A arg) {
apply(arguments, arg);
return null;
@@ -3187,7 +3813,7 @@
Send node,
FunctionElement getter,
NodeList arguments,
- Selector selector,
+ CallStructure callStructure,
A arg) {
apply(arguments, arg);
return null;
@@ -3345,7 +3971,7 @@
Send node,
FieldElement field,
NodeList arguments,
- Selector selector,
+ CallStructure callStructure,
A arg) {
apply(arguments, arg);
return null;
@@ -3456,7 +4082,7 @@
Send node,
FunctionElement getter,
NodeList arguments,
- Selector selector,
+ CallStructure callStructure,
A arg) {
apply(arguments, arg);
return null;
@@ -3529,7 +4155,18 @@
Send node,
MethodElement method,
NodeList arguments,
- Selector selector,
+ CallStructure callStructure,
+ A arg) {
+ apply(arguments, arg);
+ return null;
+ }
+
+ @override
+ R visitSuperMethodIncompatibleInvoke(
+ Send node,
+ MethodElement method,
+ NodeList arguments,
+ CallStructure callStructure,
A arg) {
apply(arguments, arg);
return null;
@@ -3605,7 +4242,7 @@
R visitThisInvoke(
Send node,
NodeList arguments,
- Selector selector,
+ CallStructure callStructure,
A arg) {
apply(arguments, arg);
return null;
@@ -3695,7 +4332,7 @@
Send node,
FieldElement field,
NodeList arguments,
- Selector selector,
+ CallStructure callStructure,
A arg) {
apply(arguments, arg);
return null;
@@ -3742,7 +4379,18 @@
Send node,
MethodElement function,
NodeList arguments,
- Selector selector,
+ CallStructure callStructure,
+ A arg) {
+ apply(arguments, arg);
+ return null;
+ }
+
+ @override
+ R visitTopLevelFunctionIncompatibleInvoke(
+ Send node,
+ MethodElement function,
+ NodeList arguments,
+ CallStructure callStructure,
A arg) {
apply(arguments, arg);
return null;
@@ -3761,7 +4409,7 @@
Send node,
FunctionElement getter,
NodeList arguments,
- Selector selector,
+ CallStructure callStructure,
A arg) {
apply(arguments, arg);
return null;
@@ -3865,7 +4513,7 @@
Send node,
TypeVariableElement element,
NodeList arguments,
- Selector selector,
+ CallStructure callStructure,
A arg) {
apply(arguments, arg);
return null;
@@ -3913,7 +4561,7 @@
Send node,
ConstantExpression constant,
NodeList arguments,
- Selector selector,
+ CallStructure callStructure,
A arg) {
apply(arguments, arg);
return null;
@@ -3959,7 +4607,7 @@
}
@override
- R errorUnresolvedGet(
+ R visitUnresolvedGet(
Send node,
Element element,
A arg) {
@@ -3967,7 +4615,7 @@
}
@override
- R errorUnresolvedInvoke(
+ R visitUnresolvedInvoke(
Send node,
Element element,
NodeList arguments,
@@ -4053,7 +4701,7 @@
}
@override
- R errorUnresolvedSuperBinary(
+ R visitUnresolvedSuperBinary(
Send node,
Element element,
BinaryOperator operator,
@@ -4064,7 +4712,7 @@
}
@override
- R errorUnresolvedSuperUnary(
+ R visitUnresolvedSuperUnary(
Send node,
UnaryOperator operator,
Element element,
@@ -4142,7 +4790,6 @@
return null;
}
- @override
R visitConstConstructorInvoke(
NewExpression node,
ConstructedConstantExpression constant,
@@ -4173,12 +4820,14 @@
apply(arguments, arg);
return null;
}
+
+ @override
R visitFactoryConstructorInvoke(
NewExpression node,
ConstructorElement constructor,
InterfaceType type,
NodeList arguments,
- Selector selector,
+ CallStructure callStructure,
A arg) {
apply(arguments, arg);
return null;
@@ -4190,7 +4839,7 @@
ConstructorElement constructor,
InterfaceType type,
NodeList arguments,
- Selector selector,
+ CallStructure callStructure,
A arg) {
apply(arguments, arg);
return null;
@@ -4204,7 +4853,7 @@
ConstructorElement effectiveTarget,
InterfaceType effectiveTargetType,
NodeList arguments,
- Selector selector,
+ CallStructure callStructure,
A arg) {
apply(arguments, arg);
return null;
@@ -4216,7 +4865,7 @@
ConstructorElement constructor,
InterfaceType type,
NodeList arguments,
- Selector selector,
+ CallStructure callStructure,
A arg) {
apply(arguments, arg);
return null;
@@ -4228,7 +4877,7 @@
ConstructorElement element,
InterfaceType type,
NodeList arguments,
- Selector selector,
+ CallStructure callStructure,
A arg) {
apply(arguments, arg);
return null;
@@ -4247,20 +4896,467 @@
}
}
+/// [SemanticDeclarationVisitor] that visits subnodes.
+class TraversalDeclarationMixin<R, A>
+ implements SemanticDeclarationVisitor<R, A> {
+ @override
+ R apply(Node node, A arg) {
+ throw new UnimplementedError("TraversalMixin.apply unimplemented");
+ }
+
+ @override
+ applyInitializers(NodeList initializers, A arg) {
+ throw new UnimplementedError(
+ "TraversalMixin.applyInitializers unimplemented");
+ }
+
+ @override
+ applyParameters(NodeList parameters, A arg) {
+ throw new UnimplementedError(
+ "TraversalMixin.applyParameters unimplemented");
+ }
+
+ @override
+ R visitAbstractMethodDeclaration(
+ FunctionExpression node,
+ MethodElement method,
+ NodeList parameters,
+ A arg) {
+ applyParameters(parameters, arg);
+ return null;
+ }
+
+ @override
+ R visitClosureDeclaration(
+ FunctionExpression node,
+ LocalFunctionElement function,
+ NodeList parameters,
+ Node body,
+ A arg) {
+ applyParameters(parameters, arg);
+ apply(body, arg);
+ return null;
+ }
+
+ @override
+ R visitFactoryConstructorDeclaration(
+ FunctionExpression node,
+ ConstructorElement constructor,
+ NodeList parameters,
+ Node body,
+ A arg) {
+ applyParameters(parameters, arg);
+ apply(body, arg);
+ return null;
+ }
+
+ @override
+ R visitFieldInitializer(
+ SendSet node,
+ FieldElement field,
+ Node initializer,
+ A arg) {
+ apply(initializer, arg);
+ return null;
+ }
+
+ @override
+ R visitGenerativeConstructorDeclaration(
+ FunctionExpression node,
+ ConstructorElement constructor,
+ NodeList parameters,
+ NodeList initializers,
+ Node body,
+ A arg) {
+ applyParameters(parameters, arg);
+ applyInitializers(initializers, arg);
+ apply(body, arg);
+ return null;
+ }
+
+ @override
+ R visitInstanceMethodDeclaration(
+ FunctionExpression node,
+ MethodElement method,
+ NodeList parameters,
+ Node body,
+ A arg) {
+ applyParameters(parameters, arg);
+ apply(body, arg);
+ return null;
+ }
+
+ @override
+ R visitLocalFunctionDeclaration(
+ FunctionExpression node,
+ LocalFunctionElement function,
+ NodeList parameters,
+ Node body,
+ A arg) {
+ applyParameters(parameters, arg);
+ apply(body, arg);
+ return null;
+ }
+
+ @override
+ R visitRedirectingFactoryConstructorDeclaration(
+ FunctionExpression node,
+ ConstructorElement constructor,
+ NodeList parameters,
+ InterfaceType redirectionType,
+ ConstructorElement redirectionTarget,
+ A arg) {
+ applyParameters(parameters, arg);
+ return null;
+ }
+
+ @override
+ R visitRedirectingGenerativeConstructorDeclaration(
+ FunctionExpression node,
+ ConstructorElement constructor,
+ NodeList parameters,
+ NodeList initializers,
+ A arg) {
+ applyParameters(parameters, arg);
+ applyInitializers(initializers, arg);
+ return null;
+ }
+
+ @override
+ R visitStaticFunctionDeclaration(
+ FunctionExpression node,
+ MethodElement function,
+ NodeList parameters,
+ Node body,
+ A arg) {
+ applyParameters(parameters, arg);
+ apply(body, arg);
+ return null;
+ }
+
+ @override
+ R visitSuperConstructorInvoke(
+ Send node,
+ ConstructorElement superConstructor,
+ InterfaceType type,
+ NodeList arguments,
+ Selector selector,
+ A arg) {
+ apply(arguments, arg);
+ return null;
+ }
+
+ @override
+ R visitThisConstructorInvoke(
+ Send node,
+ ConstructorElement thisConstructor,
+ NodeList arguments,
+ Selector selector,
+ A arg) {
+ apply(arguments, arg);
+ return null;
+ }
+
+ @override
+ R visitTopLevelFunctionDeclaration(
+ FunctionExpression node,
+ MethodElement function,
+ NodeList parameters,
+ Node body,
+ A arg) {
+ applyParameters(parameters, arg);
+ apply(body, arg);
+ return null;
+ }
+
+ @override
+ R errorUnresolvedFieldInitializer(
+ SendSet node,
+ Element element,
+ Node initializer,
+ A arg) {
+ apply(initializer, arg);
+ return null;
+ }
+
+ @override
+ R errorUnresolvedSuperConstructorInvoke(
+ Send node,
+ Element element,
+ NodeList arguments,
+ Selector selector,
+ A arg) {
+ apply(arguments, arg);
+ return null;
+ }
+
+ @override
+ R errorUnresolvedThisConstructorInvoke(
+ Send node,
+ Element element,
+ NodeList arguments,
+ Selector selector,
+ A arg) {
+ apply(arguments, arg);
+ return null;
+ }
+
+ @override
+ R visitLocalVariableDeclaration(
+ VariableDefinitions node,
+ Node definition,
+ LocalVariableElement variable,
+ Node initializer,
+ A arg) {
+ if (initializer != null) {
+ apply(initializer, arg);
+ }
+ return null;
+ }
+
+ @override
+ R visitOptionalParameterDeclaration(
+ VariableDefinitions node,
+ Node definition,
+ ParameterElement parameter,
+ ConstantExpression defaultValue,
+ int index,
+ A arg) {
+ return null;
+ }
+
+ @override
+ R visitParameterDeclaration(
+ VariableDefinitions node,
+ Node definition,
+ ParameterElement parameter,
+ int index,
+ A arg) {
+ return null;
+ }
+
+ @override
+ R visitInitializingFormalDeclaration(
+ VariableDefinitions node,
+ Node definition,
+ InitializingFormalElement initializingFormal,
+ int index,
+ A arg) {
+ return null;
+ }
+
+ @override
+ R visitLocalConstantDeclaration(
+ VariableDefinitions node,
+ Node definition,
+ LocalVariableElement variable,
+ ConstantExpression constant,
+ A arg) {
+ return null;
+ }
+
+ @override
+ R visitNamedInitializingFormalDeclaration(
+ VariableDefinitions node,
+ Node definition,
+ InitializingFormalElement initializingFormal,
+ ConstantExpression defaultValue,
+ A arg) {
+ return null;
+ }
+
+ @override
+ R visitNamedParameterDeclaration(
+ VariableDefinitions node,
+ Node definition,
+ ParameterElement parameter,
+ ConstantExpression defaultValue,
+ A arg) {
+ return null;
+ }
+
+ @override
+ R visitOptionalInitializingFormalDeclaration(
+ VariableDefinitions node,
+ Node definition,
+ InitializingFormalElement initializingFormal,
+ ConstantExpression defaultValue,
+ int index,
+ A arg) {
+ return null;
+ }
+
+ @override
+ R visitInstanceFieldDeclaration(
+ VariableDefinitions node,
+ Node definition,
+ FieldElement field,
+ Node initializer,
+ A arg) {
+ if (initializer != null) {
+ apply(initializer, arg);
+ }
+ return null;
+ }
+
+ @override
+ R visitStaticConstantDeclaration(
+ VariableDefinitions node,
+ Node definition,
+ FieldElement field,
+ ConstantExpression constant,
+ A arg) {
+ return null;
+ }
+
+ @override
+ R visitStaticFieldDeclaration(
+ VariableDefinitions node,
+ Node definition,
+ FieldElement field,
+ Node initializer,
+ A arg) {
+ if (initializer != null) {
+ apply(initializer, arg);
+ }
+ return null;
+ }
+
+ @override
+ R visitTopLevelConstantDeclaration(
+ VariableDefinitions node,
+ Node definition,
+ FieldElement field,
+ ConstantExpression constant,
+ A arg) {
+ return null;
+ }
+
+ @override
+ R visitTopLevelFieldDeclaration(
+ VariableDefinitions node,
+ Node definition,
+ FieldElement field,
+ Node initializer,
+ A arg) {
+ if (initializer != null) {
+ apply(initializer, arg);
+ }
+ return null;
+ }
+
+ @override
+ R visitAbstractGetterDeclaration(
+ FunctionExpression node,
+ MethodElement getter,
+ A arg) {
+ return null;
+ }
+
+ @override
+ R visitAbstractSetterDeclaration(
+ FunctionExpression node,
+ MethodElement setter,
+ NodeList parameters,
+ A arg) {
+ applyParameters(parameters, arg);
+ return null;
+ }
+
+ @override
+ R visitInstanceGetterDeclaration(
+ FunctionExpression node,
+ MethodElement getter,
+ Node body,
+ A arg) {
+ apply(body, arg);
+ return null;
+ }
+
+ @override
+ R visitInstanceSetterDeclaration(
+ FunctionExpression node,
+ MethodElement setter,
+ NodeList parameters,
+ Node body,
+ A arg) {
+ applyParameters(parameters, arg);
+ apply(body, arg);
+ return null;
+ }
+
+ @override
+ R visitStaticGetterDeclaration(
+ FunctionExpression node,
+ MethodElement getter,
+ Node body,
+ A arg) {
+ apply(body, arg);
+ return null;
+ }
+
+ @override
+ R visitStaticSetterDeclaration(
+ FunctionExpression node,
+ MethodElement setter,
+ NodeList parameters,
+ Node body,
+ A arg) {
+ applyParameters(parameters, arg);
+ apply(body, arg);
+ return null;
+ }
+
+ @override
+ R visitTopLevelGetterDeclaration(
+ FunctionExpression node,
+ MethodElement getter,
+ Node body,
+ A arg) {
+ apply(body, arg);
+ return null;
+ }
+
+ @override
+ R visitTopLevelSetterDeclaration(
+ FunctionExpression node,
+ MethodElement setter,
+ NodeList parameters,
+ Node body,
+ A arg) {
+ applyParameters(parameters, arg);
+ apply(body, arg);
+ return null;
+ }
+}
+
/// AST visitor that visits all normal [Send] and [SendSet] nodes using the
/// [SemanticVisitor].
class TraversalVisitor<R, A> extends SemanticVisitor<R, A>
- with TraversalMixin<R, A> {
+ with TraversalSendMixin<R, A>,
+ TraversalDeclarationMixin<R, A> {
TraversalVisitor(TreeElements elements) : super(elements);
SemanticSendVisitor<R, A> get sendVisitor => this;
+ SemanticDeclarationVisitor<R, A> get declVisitor => this;
+
R apply(Node node, A arg) {
node.accept(this);
return null;
}
@override
+ applyInitializers(NodeList initializers, A arg) {
+ visitInitializers(initializers, arg);
+ }
+
+ @override
+ applyParameters(NodeList parameters, A arg) {
+ visitParameters(parameters, arg);
+ }
+
+ @override
internalError(Spannable spannable, String message) {
throw new SpannableAssertionFailure(spannable, message);
}
@@ -4270,28 +5366,6 @@
node.visitChildren(this);
return null;
}
-
- void visitParameters(NodeList parameters) {
-
- }
-
- void visitInitializers(NodeList initializers) {
- // TODO(johnniwinther): Visit subnodes of initializers.
- }
-
- @override
- R visitFunctionExpression(FunctionExpression node) {
- if (node.parameters != null) {
- visitParameters(node.parameters);
- }
- if (node.initializers != null) {
- visitInitializers(node.initializers);
- }
- if (node.body != null) {
- apply(node.body, null);
- }
- return null;
- }
}
/// Mixin that groups all `visitStaticX` and `visitTopLevelX` method by
@@ -4317,7 +5391,7 @@
Send node,
FieldElement field,
NodeList arguments,
- Selector selector,
+ CallStructure callStructure,
A arg);
R handleStaticFieldPostfixPrefix(
@@ -4342,7 +5416,14 @@
Send node,
MethodElement function,
NodeList arguments,
- Selector selector,
+ CallStructure callStructure,
+ A arg);
+
+ R handleStaticFunctionIncompatibleInvoke(
+ Send node,
+ MethodElement function,
+ NodeList arguments,
+ CallStructure callStructure,
A arg);
R handleStaticGetterGet(
@@ -4354,7 +5435,7 @@
Send node,
FunctionElement getter,
NodeList arguments,
- Selector selector,
+ CallStructure callStructure,
A arg);
R handleStaticGetterSetterCompound(
@@ -4418,9 +5499,9 @@
Send node,
FieldElement field,
NodeList arguments,
- Selector selector,
+ CallStructure callStructure,
A arg) {
- return handleStaticFieldInvoke(node, field, arguments, selector, arg);
+ return handleStaticFieldInvoke(node, field, arguments, callStructure, arg);
}
@override
@@ -4465,9 +5546,21 @@
Send node,
MethodElement function,
NodeList arguments,
- Selector selector,
+ CallStructure callStructure,
A arg) {
- return handleStaticFunctionInvoke(node, function, arguments, selector, arg);
+ return handleStaticFunctionInvoke(
+ node, function, arguments, callStructure, arg);
+ }
+
+ @override
+ R visitStaticFunctionIncompatibleInvoke(
+ Send node,
+ MethodElement function,
+ NodeList arguments,
+ CallStructure callStructure,
+ A arg) {
+ return handleStaticFunctionIncompatibleInvoke(
+ node, function, arguments, callStructure, arg);
}
@override
@@ -4483,9 +5576,10 @@
Send node,
FunctionElement getter,
NodeList arguments,
- Selector selector,
+ CallStructure callStructure,
A arg) {
- return handleStaticGetterInvoke(node, getter, arguments, selector, arg);
+ return handleStaticGetterInvoke(
+ node, getter, arguments, callStructure, arg);
}
@override
@@ -4588,9 +5682,9 @@
Send node,
FieldElement field,
NodeList arguments,
- Selector selector,
+ CallStructure callStructure,
A arg) {
- return handleStaticFieldInvoke(node, field, arguments, selector, arg);
+ return handleStaticFieldInvoke(node, field, arguments, callStructure, arg);
}
@override
@@ -4635,9 +5729,21 @@
Send node,
MethodElement function,
NodeList arguments,
- Selector selector,
+ CallStructure callStructure,
A arg) {
- return handleStaticFunctionInvoke(node, function, arguments, selector, arg);
+ return handleStaticFunctionInvoke(
+ node, function, arguments, callStructure, arg);
+ }
+
+ @override
+ R visitTopLevelFunctionIncompatibleInvoke(
+ Send node,
+ MethodElement function,
+ NodeList arguments,
+ CallStructure callStructure,
+ A arg) {
+ return handleStaticFunctionIncompatibleInvoke(
+ node, function, arguments, callStructure, arg);
}
@override
@@ -4653,9 +5759,10 @@
Send node,
FunctionElement getter,
NodeList arguments,
- Selector selector,
+ CallStructure callStructure,
A arg) {
- return handleStaticGetterInvoke(node, getter, arguments, selector, arg);
+ return handleStaticGetterInvoke(
+ node, getter, arguments, callStructure, arg);
}
@override
@@ -4759,7 +5866,7 @@
Send node,
LocalElement element,
NodeList arguments,
- Selector selector,
+ CallStructure callStructure,
A arg);
R handleLocalPostfixPrefix(
@@ -4788,9 +5895,9 @@
Send node,
LocalFunctionElement function,
NodeList arguments,
- Selector selector,
+ CallStructure callStructure,
A arg) {
- return handleLocalInvoke(node, function, arguments, selector, arg);
+ return handleLocalInvoke(node, function, arguments, callStructure, arg);
}
@override
@@ -4816,9 +5923,9 @@
Send node,
LocalVariableElement variable,
NodeList arguments,
- Selector selector,
+ CallStructure callStructure,
A arg) {
- return handleLocalInvoke(node, variable, arguments, selector, arg);
+ return handleLocalInvoke(node, variable, arguments, callStructure, arg);
}
@override
@@ -4873,9 +5980,9 @@
Send node,
ParameterElement parameter,
NodeList arguments,
- Selector selector,
+ CallStructure callStructure,
A arg) {
- return handleLocalInvoke(node, parameter, arguments, selector, arg);
+ return handleLocalInvoke(node, parameter, arguments, callStructure, arg);
}
@override
@@ -4924,7 +6031,7 @@
Send node,
ConstantExpression constant,
NodeList arguments,
- Selector selector,
+ CallStructure callStructure,
A arg);
@override
@@ -4940,9 +6047,9 @@
Send node,
ConstantExpression constant,
NodeList arguments,
- Selector selector,
+ CallStructure callStructure,
A arg) {
- return handleConstantInvoke(node, constant, arguments, selector, arg);
+ return handleConstantInvoke(node, constant, arguments, callStructure, arg);
}
@override
@@ -4966,9 +6073,9 @@
Send node,
ConstantExpression constant,
NodeList arguments,
- Selector selector,
+ CallStructure callStructure,
A arg) {
- return handleConstantInvoke(node, constant, arguments, selector, arg);
+ return handleConstantInvoke(node, constant, arguments, callStructure, arg);
}
@override
@@ -4984,9 +6091,9 @@
Send node,
ConstantExpression constant,
NodeList arguments,
- Selector selector,
+ CallStructure callStructure,
A arg) {
- return handleConstantInvoke(node, constant, arguments, selector, arg);
+ return handleConstantInvoke(node, constant, arguments, callStructure, arg);
}
@override
@@ -5002,9 +6109,9 @@
Send node,
ConstantExpression constant,
NodeList arguments,
- Selector selector,
+ CallStructure callStructure,
A arg) {
- return handleConstantInvoke(node, constant, arguments, selector, arg);
+ return handleConstantInvoke(node, constant, arguments, callStructure, arg);
}
}
@@ -5441,7 +6548,7 @@
ConstructorElement constructor,
DartType type,
NodeList arguments,
- Selector selector,
+ CallStructure callStructure,
A arg);
R visitGenerativeConstructorInvoke(
@@ -5449,10 +6556,10 @@
ConstructorElement constructor,
InterfaceType type,
NodeList arguments,
- Selector selector,
+ CallStructure callStructure,
A arg) {
return handleConstructorInvoke(
- node, constructor, type, arguments, selector, arg);
+ node, constructor, type, arguments, callStructure, arg);
}
R visitRedirectingGenerativeConstructorInvoke(
@@ -5460,10 +6567,10 @@
ConstructorElement constructor,
InterfaceType type,
NodeList arguments,
- Selector selector,
+ CallStructure callStructure,
A arg) {
return handleConstructorInvoke(
- node, constructor, type, arguments, selector, arg);
+ node, constructor, type, arguments, callStructure, arg);
}
R visitFactoryConstructorInvoke(
@@ -5471,10 +6578,10 @@
ConstructorElement constructor,
InterfaceType type,
NodeList arguments,
- Selector selector,
+ CallStructure callStructure,
A arg) {
return handleConstructorInvoke(
- node, constructor, type, arguments, selector, arg);
+ node, constructor, type, arguments, callStructure, arg);
}
R visitRedirectingFactoryConstructorInvoke(
@@ -5484,9 +6591,9 @@
ConstructorElement effectiveTarget,
InterfaceType effectiveTargetType,
NodeList arguments,
- Selector selector,
+ CallStructure callStructure,
A arg) {
return handleConstructorInvoke(
- node, constructor, type, arguments, selector, arg);
+ node, constructor, type, arguments, callStructure, arg);
}
}
diff --git a/pkg/compiler/lib/src/resolution/send_resolver.dart b/pkg/compiler/lib/src/resolution/send_resolver.dart
index 0ddce75..b8eeb2fe 100644
--- a/pkg/compiler/lib/src/resolution/send_resolver.dart
+++ b/pkg/compiler/lib/src/resolution/send_resolver.dart
@@ -234,6 +234,18 @@
case SendStructureKind.SET:
return new SetStructure(semantics, selector);
case SendStructureKind.INVOKE:
+ switch (semantics.kind) {
+ case AccessKind.STATIC_METHOD:
+ case AccessKind.SUPER_METHOD:
+ case AccessKind.TOPLEVEL_METHOD:
+ // TODO(johnniwinther): Should local function also be handled here?
+ if (!selector.callStructure.signatureApplies(semantics.element)) {
+ return new IncompatibleInvokeStructure(semantics, selector);
+ }
+ break;
+ default:
+ break;
+ }
return new InvokeStructure(semantics, selector);
case SendStructureKind.UNARY:
return new UnaryStructure(semantics, unaryOperator, selector);
@@ -328,7 +340,7 @@
}
} else if (node.isSuperCall) {
if (Elements.isUnresolved(element)) {
- return new StaticAccess.unresolved(element);
+ return new StaticAccess.unresolvedSuper(element);
} else if (isCompound && Elements.isUnresolved(getter)) {
// TODO(johnniwinther): Ensure that [getter] is not null. This happens
// in the case of missing super getter.
@@ -385,6 +397,8 @@
} else {
if (Elements.isErroneous(element)) {
return new StaticAccess.unresolved(element);
+ } else if (isCompound && Elements.isErroneous(getter)) {
+ return new StaticAccess.unresolved(getter);
} else if (element == null || element.isInstanceMember) {
if (node.receiver == null || node.receiver.isThis()) {
return new AccessSemantics.thisProperty();
@@ -453,15 +467,333 @@
NewStructure computeNewStructure(NewExpression node) {
if (node.isConst) {
- return new ConstInvokeStructure(elements.getConstant(node));
+ ConstantExpression constant = elements.getConstant(node);
+ if (constant is ConstructedConstantExpression) {
+ return new ConstInvokeStructure(constant);
+ }
}
+
Element element = elements[node.send];
Selector selector = elements.getSelector(node.send);
DartType type = elements.getType(node);
- ConstructorAccessSemantics constructorAccessSemantics =
- computeConstructorAccessSemantics(element, type);
+ ConstructorAccessSemantics constructorAccessSemantics;
+ if (node.isConst) {
+ // This is a non-constant constant constructor invocation, like
+ // `const Const(method())`.
+ constructorAccessSemantics = new ConstructorAccessSemantics(
+ ConstructorAccessKind.ERRONEOUS, element, type);
+ } else {
+ constructorAccessSemantics =
+ computeConstructorAccessSemantics(element, type);
+ }
return new NewInvokeStructure(constructorAccessSemantics, selector);
}
}
+abstract class DeclStructure<R, A> {
+ final FunctionElement element;
+
+ DeclStructure(this.element);
+
+ /// Calls the matching visit method on [visitor] with [node] and [arg].
+ R dispatch(SemanticDeclarationVisitor<R, A> visitor,
+ FunctionExpression node,
+ A arg);
+}
+
+enum ConstructorKind {
+ GENERATIVE,
+ REDIRECTING_GENERATIVE,
+ FACTORY,
+ REDIRECTING_FACTORY,
+}
+
+class ConstructorDeclStructure<R, A> extends DeclStructure<R, A> {
+ final ConstructorKind kind;
+
+ ConstructorDeclStructure(this.kind, ConstructorElement constructor)
+ : super(constructor);
+
+ R dispatch(SemanticDeclarationVisitor<R, A> visitor,
+ FunctionExpression node,
+ A arg) {
+ switch (kind) {
+ case ConstructorKind.GENERATIVE:
+ return visitor.visitGenerativeConstructorDeclaration(
+ node, element, node.parameters, node.initializers, node.body, arg);
+ case ConstructorKind.REDIRECTING_GENERATIVE:
+ return visitor.visitRedirectingGenerativeConstructorDeclaration(
+ node, element, node.parameters, node.initializers, arg);
+ case ConstructorKind.FACTORY:
+ return visitor.visitFactoryConstructorDeclaration(
+ node, element, node.parameters, node.body, arg);
+ default:
+ break;
+ }
+ throw new SpannableAssertionFailure(node,
+ "Unhandled constructor declaration kind: ${kind}");
+ }
+}
+
+class RedirectingFactoryConstructorDeclStructure<R, A>
+ extends DeclStructure<R, A> {
+ InterfaceType redirectionTargetType;
+ ConstructorElement redirectionTarget;
+
+ RedirectingFactoryConstructorDeclStructure(
+ ConstructorElement constructor,
+ this.redirectionTargetType,
+ this.redirectionTarget)
+ : super(constructor);
+
+ R dispatch(SemanticDeclarationVisitor<R, A> visitor,
+ FunctionExpression node,
+ A arg) {
+ return visitor.visitRedirectingFactoryConstructorDeclaration(
+ node, element, node.parameters,
+ redirectionTargetType, redirectionTarget, arg);
+ }
+}
+
+enum FunctionKind {
+ TOP_LEVEL_GETTER,
+ TOP_LEVEL_SETTER,
+ TOP_LEVEL_FUNCTION,
+ STATIC_GETTER,
+ STATIC_SETTER,
+ STATIC_FUNCTION,
+ ABSTRACT_GETTER,
+ ABSTRACT_SETTER,
+ ABSTRACT_METHOD,
+ INSTANCE_GETTER,
+ INSTANCE_SETTER,
+ INSTANCE_METHOD,
+ LOCAL_FUNCTION,
+ CLOSURE,
+}
+
+class FunctionDeclStructure<R, A>
+ extends DeclStructure<R, A> {
+ final FunctionKind kind;
+
+ FunctionDeclStructure(this.kind, FunctionElement function)
+ : super(function);
+
+ R dispatch(SemanticDeclarationVisitor<R, A> visitor,
+ FunctionExpression node,
+ A arg) {
+ switch (kind) {
+ case FunctionKind.TOP_LEVEL_GETTER:
+ return visitor.visitTopLevelGetterDeclaration(
+ node, element, node.body, arg);
+ case FunctionKind.TOP_LEVEL_SETTER:
+ return visitor.visitTopLevelSetterDeclaration(
+ node, element, node.parameters, node.body, arg);
+ case FunctionKind.TOP_LEVEL_FUNCTION:
+ return visitor.visitTopLevelFunctionDeclaration(
+ node, element, node.parameters, node.body, arg);
+ case FunctionKind.STATIC_GETTER:
+ return visitor.visitStaticGetterDeclaration(
+ node, element, node.body, arg);
+ case FunctionKind.STATIC_SETTER:
+ return visitor.visitStaticSetterDeclaration(
+ node, element, node.parameters, node.body, arg);
+ case FunctionKind.STATIC_FUNCTION:
+ return visitor.visitStaticFunctionDeclaration(
+ node, element, node.parameters, node.body, arg);
+ case FunctionKind.ABSTRACT_GETTER:
+ return visitor.visitAbstractGetterDeclaration(
+ node, element, arg);
+ case FunctionKind.ABSTRACT_SETTER:
+ return visitor.visitAbstractSetterDeclaration(
+ node, element, node.parameters, arg);
+ case FunctionKind.ABSTRACT_METHOD:
+ return visitor.visitAbstractMethodDeclaration(
+ node, element, node.parameters, arg);
+ case FunctionKind.INSTANCE_GETTER:
+ return visitor.visitInstanceGetterDeclaration(
+ node, element, node.body, arg);
+ case FunctionKind.INSTANCE_SETTER:
+ return visitor.visitInstanceSetterDeclaration(
+ node, element, node.parameters, node.body, arg);
+ case FunctionKind.INSTANCE_METHOD:
+ return visitor.visitInstanceMethodDeclaration(
+ node, element, node.parameters, node.body, arg);
+ case FunctionKind.LOCAL_FUNCTION:
+ return visitor.visitLocalFunctionDeclaration(
+ node, element, node.parameters, node.body, arg);
+ case FunctionKind.CLOSURE:
+ return visitor.visitClosureDeclaration(
+ node, element, node.parameters, node.body, arg);
+ }
+ }
+}
+
+abstract class DeclarationResolverMixin {
+ TreeElements get elements;
+
+ internalError(Spannable spannable, String message);
+
+ ConstructorKind computeConstructorKind(ConstructorElement constructor) {
+ if (constructor.isRedirectingFactory) {
+ return ConstructorKind.REDIRECTING_FACTORY;
+ } else if (constructor.isFactoryConstructor) {
+ return ConstructorKind.FACTORY;
+ } else if (constructor.isRedirectingGenerative) {
+ return ConstructorKind.REDIRECTING_GENERATIVE;
+ } else {
+ return ConstructorKind.GENERATIVE;
+ }
+ }
+
+ DeclStructure computeFunctionStructure(FunctionExpression node) {
+ FunctionElement element = elements.getFunctionDefinition(node);
+ if (element.isConstructor) {
+ ConstructorElement constructor = element;
+ ConstructorKind kind = computeConstructorKind(constructor);
+ if (kind == ConstructorKind.REDIRECTING_FACTORY) {
+ return new RedirectingFactoryConstructorDeclStructure(
+ constructor,
+ elements.getType(node.body),
+ constructor.immediateRedirectionTarget);
+ } else {
+ return new ConstructorDeclStructure(kind, element);
+ }
+ } else {
+ FunctionKind kind;
+ if (element.isLocal) {
+ if (element.name.isEmpty) {
+ kind = FunctionKind.CLOSURE;
+ } else {
+ kind = FunctionKind.LOCAL_FUNCTION;
+ }
+ } else if (element.isInstanceMember) {
+ if (element.isGetter) {
+ kind = element.isAbstract
+ ? FunctionKind.ABSTRACT_GETTER
+ : FunctionKind.INSTANCE_GETTER;
+ } else if (element.isSetter) {
+ kind = element.isAbstract
+ ? FunctionKind.ABSTRACT_SETTER
+ : FunctionKind.INSTANCE_SETTER;
+ } else {
+ kind = element.isAbstract
+ ? FunctionKind.ABSTRACT_METHOD
+ : FunctionKind.INSTANCE_METHOD;
+ }
+ } else if (element.isStatic) {
+ if (element.isGetter) {
+ kind = FunctionKind.STATIC_GETTER;
+ } else if (element.isSetter) {
+ kind = FunctionKind.STATIC_SETTER;
+ } else {
+ kind = FunctionKind.STATIC_FUNCTION;
+ }
+ } else if (element.isTopLevel) {
+ if (element.isGetter) {
+ kind = FunctionKind.TOP_LEVEL_GETTER;
+ } else if (element.isSetter) {
+ kind = FunctionKind.TOP_LEVEL_SETTER;
+ } else {
+ kind = FunctionKind.TOP_LEVEL_FUNCTION;
+ }
+ } else {
+ return internalError(node, "Unhandled function expression.");
+ }
+ return new FunctionDeclStructure(kind, element);
+ }
+ }
+
+ InitializerStructure computeInitializerStructure(Send node) {
+ Element element = elements[node];
+ if (node.asSendSet() != null) {
+ return new FieldInitializerStructure(element);
+ } else if (Initializers.isConstructorRedirect(node)) {
+ return new ThisConstructorInvokeStructure(
+ element, elements.getSelector(node));
+ } else if (Initializers.isSuperConstructorCall(node)) {
+ return new SuperConstructorInvokeStructure(
+ element,
+ elements.analyzedElement.enclosingClass.supertype,
+ elements.getSelector(node));
+ }
+ return internalError(node, "Unhandled initializer.");
+ }
+
+ List<ParameterStructure> computeParameterStructures(NodeList parameters) {
+ List<ParameterStructure> list = <ParameterStructure>[];
+ int index = 0;
+ for (Node node in parameters) {
+ NodeList optionalParameters = node.asNodeList();
+ if (optionalParameters != null) {
+ bool isNamed = optionalParameters.beginToken.stringValue == '{';
+ for (Node node in optionalParameters) {
+ list.add(computeParameterStructure(
+ node, index++, isRequired: false, isNamed: isNamed));
+ }
+ } else {
+ list.add(computeParameterStructure(node, index++));
+ }
+ }
+ return list;
+ }
+
+ ParameterStructure computeParameterStructure(
+ VariableDefinitions definitions,
+ int index,
+ {bool isRequired: true, bool isNamed: false}) {
+ Node node = definitions.definitions.nodes.single;
+ ParameterElement element = elements[node];
+ if (element == null) {
+ throw new SpannableAssertionFailure(
+ node, "No parameter structure for $node.");
+ }
+ if (isRequired) {
+ return new RequiredParameterStructure(
+ definitions, node, element, index);
+ } else {
+ ConstantExpression defaultValue;
+ if (element.initializer != null) {
+ defaultValue = elements.getConstant(element.initializer);
+ }
+ if (isNamed) {
+ return new NamedParameterStructure(
+ definitions, node, element, defaultValue);
+ } else {
+ return new OptionalParameterStructure(
+ definitions, node, element, defaultValue, index);
+ }
+ }
+ }
+
+ void computeVariableStructures(
+ VariableDefinitions definitions,
+ void callback(Node node, VariableStructure structure)) {
+ for (Node node in definitions.definitions) {
+ callback(definitions, computeVariableStructure(node));
+ }
+ }
+
+ VariableStructure computeVariableStructure(Node node) {
+ VariableElement element = elements[node];
+ VariableKind kind;
+ if (element.isLocal) {
+ kind = VariableKind.LOCAL_VARIABLE;
+ } else if (element.isInstanceMember) {
+ kind = VariableKind.INSTANCE_FIELD;
+ } else if (element.isStatic) {
+ kind = VariableKind.STATIC_FIELD;
+ } else if (element.isTopLevel) {
+ kind = VariableKind.TOP_LEVEL_FIELD;
+ } else {
+ return internalError(node, "Unexpected variable $element.");
+ }
+ if (element.isConst) {
+ ConstantExpression constant = elements.getConstant(element.initializer);
+ return new ConstantVariableStructure(kind, node, element, constant);
+ } else {
+ return new NonConstantVariableStructure(kind, node, element);
+ }
+ }
+}
diff --git a/pkg/compiler/lib/src/resolution/send_structure.dart b/pkg/compiler/lib/src/resolution/send_structure.dart
index d507dda..475451f 100644
--- a/pkg/compiler/lib/src/resolution/send_structure.dart
+++ b/pkg/compiler/lib/src/resolution/send_structure.dart
@@ -14,11 +14,18 @@
import '../universe/universe.dart';
import '../util/util.dart';
+/// Interface for the structure of the semantics of a [Send] or [NewExpression]
+/// node.
+abstract class SemanticSendStructure<R, A> {
+ /// Calls the matching visit method on [visitor] with [node] and [arg].
+ R dispatch(SemanticSendVisitor<R, A> visitor, Node node, A arg);
+}
+
/// Interface for the structure of the semantics of a [Send] node.
///
/// Subclasses handle each of the [Send] variations; `assert(e)`, `a && b`,
/// `a.b`, `a.b(c)`, etc.
-abstract class SendStructure<R, A> {
+abstract class SendStructure<R, A> extends SemanticSendStructure<R, A> {
/// Calls the matching visit method on [visitor] with [send] and [arg].
R dispatch(SemanticSendVisitor<R, A> visitor, Send send, A arg);
}
@@ -142,8 +149,13 @@
final AccessSemantics semantics;
/// The [Selector] for the invocation.
+ // TODO(johnniwinther): Store this only for dynamic invocations.
final Selector selector;
+ /// The [CallStructure] of the invocation.
+ // TODO(johnniwinther): Store this directly for static invocations.
+ CallStructure get callStructure => selector.callStructure;
+
InvokeStructure(this.semantics, this.selector);
R dispatch(SemanticSendVisitor<R, A> visitor, Send node, A arg) {
@@ -162,7 +174,7 @@
node.argumentsNode,
// TODO(johnniwinther): Store the call selector instead of the
// selector using the name of the function.
- new Selector.callClosureFrom(selector),
+ callStructure,
arg);
case AccessKind.LOCAL_VARIABLE:
return visitor.visitLocalVariableInvoke(
@@ -171,7 +183,7 @@
node.argumentsNode,
// TODO(johnniwinther): Store the call selector instead of the
// selector using the name of the variable.
- new Selector.callClosureFrom(selector),
+ callStructure,
arg);
case AccessKind.PARAMETER:
return visitor.visitParameterInvoke(
@@ -180,91 +192,91 @@
node.argumentsNode,
// TODO(johnniwinther): Store the call selector instead of the
// selector using the name of the parameter.
- new Selector.callClosureFrom(selector),
+ callStructure,
arg);
case AccessKind.STATIC_FIELD:
return visitor.visitStaticFieldInvoke(
node,
semantics.element,
node.argumentsNode,
- selector,
+ callStructure,
arg);
case AccessKind.STATIC_METHOD:
return visitor.visitStaticFunctionInvoke(
node,
semantics.element,
node.argumentsNode,
- selector,
+ callStructure,
arg);
case AccessKind.STATIC_GETTER:
return visitor.visitStaticGetterInvoke(
node,
semantics.element,
node.argumentsNode,
- selector,
+ callStructure,
arg);
case AccessKind.STATIC_SETTER:
return visitor.errorStaticSetterInvoke(
node,
semantics.element,
node.argumentsNode,
- selector,
+ callStructure,
arg);
case AccessKind.TOPLEVEL_FIELD:
return visitor.visitTopLevelFieldInvoke(
node,
semantics.element,
node.argumentsNode,
- selector,
+ callStructure,
arg);
case AccessKind.TOPLEVEL_METHOD:
return visitor.visitTopLevelFunctionInvoke(
node,
semantics.element,
node.argumentsNode,
- selector,
+ callStructure,
arg);
case AccessKind.TOPLEVEL_GETTER:
return visitor.visitTopLevelGetterInvoke(
node,
semantics.element,
node.argumentsNode,
- selector,
+ callStructure,
arg);
case AccessKind.TOPLEVEL_SETTER:
return visitor.errorTopLevelSetterInvoke(
node,
semantics.element,
node.argumentsNode,
- selector,
+ callStructure,
arg);
case AccessKind.CLASS_TYPE_LITERAL:
return visitor.visitClassTypeLiteralInvoke(
node,
semantics.constant,
node.argumentsNode,
- selector,
+ callStructure,
arg);
case AccessKind.TYPEDEF_TYPE_LITERAL:
return visitor.visitTypedefTypeLiteralInvoke(
node,
semantics.constant,
node.argumentsNode,
- selector,
+ callStructure,
arg);
case AccessKind.DYNAMIC_TYPE_LITERAL:
return visitor.visitDynamicTypeLiteralInvoke(
node,
semantics.constant,
node.argumentsNode,
- selector,
+ callStructure,
arg);
case AccessKind.TYPE_PARAMETER_TYPE_LITERAL:
return visitor.visitTypeVariableTypeLiteralInvoke(
node,
semantics.element,
node.argumentsNode,
- selector,
+ callStructure,
arg);
case AccessKind.EXPRESSION:
return visitor.visitExpressionInvoke(
@@ -277,7 +289,7 @@
return visitor.visitThisInvoke(
node,
node.argumentsNode,
- selector,
+ callStructure,
arg);
case AccessKind.THIS_PROPERTY:
return visitor.visitThisPropertyInvoke(
@@ -290,38 +302,45 @@
node,
semantics.element,
node.argumentsNode,
- selector,
+ callStructure,
arg);
case AccessKind.SUPER_METHOD:
return visitor.visitSuperMethodInvoke(
node,
semantics.element,
node.argumentsNode,
- selector,
+ callStructure,
arg);
case AccessKind.SUPER_GETTER:
return visitor.visitSuperGetterInvoke(
node,
semantics.element,
node.argumentsNode,
- selector,
+ callStructure,
arg);
case AccessKind.SUPER_SETTER:
return visitor.errorSuperSetterInvoke(
node,
semantics.element,
node.argumentsNode,
- selector,
+ callStructure,
arg);
case AccessKind.CONSTANT:
return visitor.visitConstantInvoke(
node,
semantics.constant,
node.argumentsNode,
- selector,
+ callStructure,
arg);
case AccessKind.UNRESOLVED:
- return visitor.errorUnresolvedInvoke(
+ return visitor.visitUnresolvedInvoke(
+ node,
+ semantics.element,
+ node.argumentsNode,
+ selector,
+ arg);
+ case AccessKind.UNRESOLVED_SUPER:
+ return visitor.visitUnresolvedSuperInvoke(
node,
semantics.element,
node.argumentsNode,
@@ -334,7 +353,57 @@
throw new SpannableAssertionFailure(node, "Invalid invoke: ${semantics}");
}
- String toString() => 'invoke($selector,$semantics)';
+ String toString() => 'invoke($selector, $semantics)';
+}
+
+/// The structure for a [Send] that is an incompatible invocation, i.e. an
+/// invocation of a known target where the call structure does not match.
+class IncompatibleInvokeStructure<R, A> implements SendStructure<R, A> {
+ /// The target of the invocation.
+ final AccessSemantics semantics;
+
+ /// The [Selector] for the invocation.
+ // TODO(johnniwinther): Store this only for dynamic invocations.
+ final Selector selector;
+
+ /// The [CallStructure] of the invocation.
+ // TODO(johnniwinther): Store this directly for static invocations.
+ CallStructure get callStructure => selector.callStructure;
+
+ IncompatibleInvokeStructure(this.semantics, this.selector);
+
+ R dispatch(SemanticSendVisitor<R, A> visitor, Send node, A arg) {
+ switch (semantics.kind) {
+ case AccessKind.STATIC_METHOD:
+ return visitor.visitStaticFunctionIncompatibleInvoke(
+ node,
+ semantics.element,
+ node.argumentsNode,
+ callStructure,
+ arg);
+ case AccessKind.SUPER_METHOD:
+ return visitor.visitSuperMethodIncompatibleInvoke(
+ node,
+ semantics.element,
+ node.argumentsNode,
+ callStructure,
+ arg);
+ case AccessKind.TOPLEVEL_METHOD:
+ return visitor.visitTopLevelFunctionIncompatibleInvoke(
+ node,
+ semantics.element,
+ node.argumentsNode,
+ callStructure,
+ arg);
+ default:
+ // TODO(johnniwinther): Support more variants of this invoke structure.
+ break;
+ }
+ throw new SpannableAssertionFailure(
+ node, "Invalid incompatible invoke: ${semantics}");
+ }
+
+ String toString() => 'incompatible-invoke($selector, $semantics)';
}
/// The structure for a [Send] that is a read access.
@@ -467,7 +536,12 @@
semantics.constant,
arg);
case AccessKind.UNRESOLVED:
- return visitor.errorUnresolvedGet(
+ return visitor.visitUnresolvedGet(
+ node,
+ semantics.element,
+ arg);
+ case AccessKind.UNRESOLVED_SUPER:
+ return visitor.visitUnresolvedSuperGet(
node,
semantics.element,
arg);
@@ -478,7 +552,7 @@
throw new SpannableAssertionFailure(node, "Invalid getter: ${semantics}");
}
- String toString() => 'get($selector,$semantics)';
+ String toString() => 'get($selector, $semantics)';
}
/// The structure for a [Send] that is an assignment.
@@ -629,6 +703,8 @@
case AccessKind.CONSTANT:
// TODO(johnniwinther): Should this be a valid case?
break;
+ case AccessKind.UNRESOLVED_SUPER:
+ // TODO(johnniwinther): Handle this separately.
case AccessKind.UNRESOLVED:
return visitor.errorUnresolvedSet(
node,
@@ -701,8 +777,8 @@
operator,
semantics.element,
arg);
- case AccessKind.UNRESOLVED:
- return visitor.errorUnresolvedSuperUnary(
+ case AccessKind.UNRESOLVED_SUPER:
+ return visitor.visitUnresolvedSuperUnary(
node,
operator,
semantics.element,
@@ -760,8 +836,8 @@
semantics.element,
node.arguments.single,
arg);
- case AccessKind.UNRESOLVED:
- return visitor.errorUnresolvedSuperIndex(
+ case AccessKind.UNRESOLVED_SUPER:
+ return visitor.visitUnresolvedSuperIndex(
node,
semantics.element,
node.arguments.single,
@@ -878,8 +954,8 @@
operator,
node.arguments.single,
arg);
- case AccessKind.UNRESOLVED:
- return visitor.errorUnresolvedSuperBinary(
+ case AccessKind.UNRESOLVED_SUPER:
+ return visitor.visitUnresolvedSuperBinary(
node,
semantics.element,
operator,
@@ -941,7 +1017,9 @@
node.arguments.first,
node.arguments.tail.head,
arg);
+ case AccessKind.UNRESOLVED_SUPER:
case AccessKind.UNRESOLVED:
+ // TODO(johnniwinther): Support these through [AccessKind.COMPOUND].
return visitor.errorUnresolvedSuperIndexSet(
node,
semantics.element,
@@ -990,7 +1068,9 @@
node.arguments.single,
operator,
arg);
+ case AccessKind.UNRESOLVED_SUPER:
case AccessKind.UNRESOLVED:
+ // TODO(johnniwinther): Support these through [AccessKind.COMPOUND].
return visitor.errorUnresolvedSuperIndexPrefix(
node,
semantics.element,
@@ -1053,7 +1133,9 @@
node.arguments.single,
operator,
arg);
+ case AccessKind.UNRESOLVED_SUPER:
case AccessKind.UNRESOLVED:
+ // TODO(johnniwinther): Support these through [AccessKind.COMPOUND].
return visitor.errorUnresolvedSuperIndexPostfix(
node,
semantics.element,
@@ -1230,7 +1312,9 @@
case AccessKind.CONSTANT:
// TODO(johnniwinther): Should this be a valid case?
break;
+ case AccessKind.UNRESOLVED_SUPER:
case AccessKind.UNRESOLVED:
+ // TODO(johnniwinther): Support these through [AccessKind.COMPOUND].
return visitor.errorUnresolvedCompound(
node,
semantics.element,
@@ -1346,7 +1430,9 @@
operator,
node.arguments.tail.head,
arg);
+ case AccessKind.UNRESOLVED_SUPER:
case AccessKind.UNRESOLVED:
+ // TODO(johnniwinther): Support these through [AccessKind.COMPOUND].
return visitor.errorUnresolvedSuperCompoundIndexSet(
node,
semantics.element,
@@ -1515,7 +1601,9 @@
case AccessKind.CONSTANT:
// TODO(johnniwinther): Should this be a valid case?
break;
+ case AccessKind.UNRESOLVED_SUPER:
case AccessKind.UNRESOLVED:
+ // TODO(johnniwinther): Support these through [AccessKind.COMPOUND].
return visitor.errorUnresolvedPrefix(
node,
semantics.element,
@@ -1729,7 +1817,9 @@
case AccessKind.CONSTANT:
// TODO(johnniwinther): Should this be a valid case?
break;
+ case AccessKind.UNRESOLVED_SUPER:
case AccessKind.UNRESOLVED:
+ // TODO(johnniwinther): Support these through [AccessKind.COMPOUND].
return visitor.errorUnresolvedPostfix(
node,
semantics.element,
@@ -1811,7 +1901,7 @@
}
/// The structure for a [NewExpression] of a new invocation.
-abstract class NewStructure<R, A> {
+abstract class NewStructure<R, A> implements SemanticSendStructure<R, A> {
/// Calls the matching visit method on [visitor] with [node] and [arg].
R dispatch(SemanticSendVisitor<R, A> visitor, NewExpression node, A arg);
}
@@ -1824,30 +1914,32 @@
NewInvokeStructure(this.semantics, this.selector);
+ CallStructure get callStructure => selector.callStructure;
+
R dispatch(SemanticSendVisitor<R, A> visitor, NewExpression node, A arg) {
switch (semantics.kind) {
case ConstructorAccessKind.GENERATIVE:
return visitor.visitGenerativeConstructorInvoke(
node, semantics.element, semantics.type,
- node.send.argumentsNode, selector, arg);
+ node.send.argumentsNode, callStructure, arg);
case ConstructorAccessKind.REDIRECTING_GENERATIVE:
return visitor.visitRedirectingGenerativeConstructorInvoke(
node, semantics.element, semantics.type,
- node.send.argumentsNode, selector, arg);
+ node.send.argumentsNode, callStructure, arg);
case ConstructorAccessKind.FACTORY:
return visitor.visitFactoryConstructorInvoke(
node, semantics.element, semantics.type,
- node.send.argumentsNode, selector, arg);
+ node.send.argumentsNode, callStructure, arg);
case ConstructorAccessKind.REDIRECTING_FACTORY:
return visitor.visitRedirectingFactoryConstructorInvoke(
node, semantics.element, semantics.type,
semantics.effectiveTargetSemantics.element,
semantics.effectiveTargetSemantics.type,
- node.send.argumentsNode, selector, arg);
+ node.send.argumentsNode, callStructure, arg);
case ConstructorAccessKind.ABSTRACT:
return visitor.errorAbstractClassConstructorInvoke(
node, semantics.element, semantics.type,
- node.send.argumentsNode, selector, arg);
+ node.send.argumentsNode, callStructure, arg);
case ConstructorAccessKind.ERRONEOUS:
return visitor.errorUnresolvedConstructorInvoke(
node, semantics.element, semantics.type,
@@ -1874,3 +1966,206 @@
}
}
+/// The structure of a parameter declaration.
+abstract class ParameterStructure<R, A> {
+ final VariableDefinitions definitions;
+ final Node node;
+ final ParameterElement parameter;
+
+ ParameterStructure(this.definitions, this.node, this.parameter);
+
+ /// Calls the matching visit method on [visitor] with [definitions] and [arg].
+ R dispatch(SemanticDeclarationVisitor<R, A> visitor, A arg);
+}
+
+/// The structure of a required parameter declaration.
+class RequiredParameterStructure<R, A> extends ParameterStructure<R, A> {
+ final int index;
+
+ RequiredParameterStructure(
+ VariableDefinitions definitions,
+ Node node,
+ ParameterElement parameter,
+ this.index)
+ : super(definitions, node, parameter);
+
+ @override
+ R dispatch(SemanticDeclarationVisitor<R, A> visitor,
+ A arg) {
+ if (parameter.isInitializingFormal) {
+ return visitor.visitInitializingFormalDeclaration(
+ definitions, node, parameter, index, arg);
+ } else {
+ return visitor.visitParameterDeclaration(
+ definitions, node, parameter, index, arg);
+ }
+ }
+}
+
+/// The structure of a optional positional parameter declaration.
+class OptionalParameterStructure<R, A> extends ParameterStructure<R, A> {
+ final ConstantExpression defaultValue;
+ final int index;
+
+ OptionalParameterStructure(
+ VariableDefinitions definitions,
+ Node node,
+ ParameterElement parameter,
+ this.defaultValue,
+ this.index)
+ : super(definitions, node, parameter);
+
+ @override
+ R dispatch(SemanticDeclarationVisitor<R, A> visitor,
+ A arg) {
+ if (parameter.isInitializingFormal) {
+ return visitor.visitOptionalInitializingFormalDeclaration(
+ definitions, node, parameter, defaultValue, index, arg);
+ } else {
+ return visitor.visitOptionalParameterDeclaration(
+ definitions, node, parameter, defaultValue, index, arg);
+ }
+ }
+}
+
+/// The structure of a optional named parameter declaration.
+class NamedParameterStructure<R, A> extends ParameterStructure<R, A> {
+ final ConstantExpression defaultValue;
+
+ NamedParameterStructure(
+ VariableDefinitions definitions,
+ Node node,
+ ParameterElement parameter,
+ this.defaultValue)
+ : super(definitions, node, parameter);
+
+ @override
+ R dispatch(SemanticDeclarationVisitor<R, A> visitor,
+ A arg) {
+ if (parameter.isInitializingFormal) {
+ return visitor.visitNamedInitializingFormalDeclaration(
+ definitions, node, parameter, defaultValue, arg);
+ } else {
+ return visitor.visitNamedParameterDeclaration(
+ definitions, node, parameter, defaultValue, arg);
+ }
+ }
+}
+
+
+enum VariableKind {
+ TOP_LEVEL_FIELD,
+ STATIC_FIELD,
+ INSTANCE_FIELD,
+ LOCAL_VARIABLE,
+}
+
+abstract class VariableStructure<R, A> {
+ final VariableKind kind;
+ final Node node;
+ final VariableElement variable;
+
+ VariableStructure(this.kind, this.node, this.variable);
+
+ R dispatch(SemanticDeclarationVisitor<R, A> visitor,
+ VariableDefinitions definitions,
+ A arg);
+}
+
+class NonConstantVariableStructure<R, A>
+ extends VariableStructure<R, A> {
+ NonConstantVariableStructure(
+ VariableKind kind, Node node, VariableElement variable)
+ : super(kind, node, variable);
+
+ R dispatch(SemanticDeclarationVisitor<R, A> visitor,
+ VariableDefinitions definitions,
+ A arg) {
+ switch (kind) {
+ case VariableKind.TOP_LEVEL_FIELD:
+ return visitor.visitTopLevelFieldDeclaration(
+ definitions, node, variable, variable.initializer, arg);
+ case VariableKind.STATIC_FIELD:
+ return visitor.visitStaticFieldDeclaration(
+ definitions, node, variable, variable.initializer, arg);
+ case VariableKind.INSTANCE_FIELD:
+ return visitor.visitInstanceFieldDeclaration(
+ definitions, node, variable, variable.initializer, arg);
+ case VariableKind.LOCAL_VARIABLE:
+ return visitor.visitLocalVariableDeclaration(
+ definitions, node, variable, variable.initializer, arg);
+ }
+ }
+}
+
+class ConstantVariableStructure<R, A>
+ extends VariableStructure<R, A> {
+ final ConstantExpression constant;
+
+ ConstantVariableStructure(
+ VariableKind kind, Node node, VariableElement variable, this.constant)
+ : super(kind, node, variable);
+
+ R dispatch(SemanticDeclarationVisitor<R, A> visitor,
+ VariableDefinitions definitions,
+ A arg) {
+ switch (kind) {
+ case VariableKind.TOP_LEVEL_FIELD:
+ return visitor.visitTopLevelConstantDeclaration(
+ definitions, node, variable, constant, arg);
+ case VariableKind.STATIC_FIELD:
+ return visitor.visitStaticConstantDeclaration(
+ definitions, node, variable, constant, arg);
+ case VariableKind.LOCAL_VARIABLE:
+ return visitor.visitLocalConstantDeclaration(
+ definitions, node, variable, constant, arg);
+ default:
+ }
+ throw new SpannableAssertionFailure(
+ node, "Invalid constant variable: $variable");
+ }
+}
+
+abstract class InitializerStructure<R, A> {
+ R dispatch(SemanticDeclarationVisitor<R, A> visitor, Send node, A arg);
+
+ bool get isSuperConstructorInvoke => false;
+}
+
+class FieldInitializerStructure<R, A> extends InitializerStructure<R, A> {
+ final FieldElement field;
+
+ FieldInitializerStructure(this.field);
+
+ R dispatch(SemanticDeclarationVisitor<R, A> visitor, Send node, A arg) {
+ return visitor.visitFieldInitializer(
+ node, field, node.arguments.single, arg);
+ }
+}
+
+class SuperConstructorInvokeStructure<R, A> extends InitializerStructure<R, A> {
+ final ConstructorElement constructor;
+ final InterfaceType type;
+ final Selector selector;
+
+ SuperConstructorInvokeStructure(this.constructor, this.type, this.selector);
+
+ R dispatch(SemanticDeclarationVisitor<R, A> visitor, Send node, A arg) {
+ return visitor.visitSuperConstructorInvoke(
+ node, constructor, type, node.argumentsNode, selector, arg);
+ }
+
+ bool get isSuperConstructorInvoke => true;
+}
+
+class ThisConstructorInvokeStructure<R, A> extends InitializerStructure<R, A> {
+ final ConstructorElement constructor;
+ final Selector selector;
+
+ ThisConstructorInvokeStructure(this.constructor, this.selector);
+
+ R dispatch(SemanticDeclarationVisitor<R, A> visitor, Send node, A arg) {
+ return visitor.visitThisConstructorInvoke(
+ node, constructor, node.argumentsNode, selector, arg);
+ }
+}
diff --git a/pkg/compiler/lib/src/resolved_visitor.dart b/pkg/compiler/lib/src/resolved_visitor.dart
index 561746b..9cd81ba 100644
--- a/pkg/compiler/lib/src/resolved_visitor.dart
+++ b/pkg/compiler/lib/src/resolved_visitor.dart
@@ -17,26 +17,42 @@
CLOSURE,
DYNAMIC,
ERROR,
+ SEND_SET,
+ NEW,
+ SUPER_CONSTRUCTOR,
}
/// Abstract interface for a [ResolvedVisitor].
// TODO(johnniwinther): Remove this.
abstract class ResolvedKindVisitor<R> {
+ @deprecated
R visitSuperSend(Send node);
+
+ @deprecated
R visitOperatorSend(Send node);
R visitGetterSend(Send node);
+
+ @deprecated
R visitClosureSend(Send node);
+ @deprecated
R visitDynamicSend(Send node);
R visitStaticSend(Send node);
+ R handleSuperConstructorInvoke(Send node);
+ R handleSendSet(SendSet node);
+ R handleNewExpression(NewExpression node);
+
/// Visitor callback for a type literal.
+ @deprecated
R visitTypeLiteralSend(Send node);
/// Visitor callback for the class prefix of a static access, like `Foo` in
/// `Foo.staticField`.
- // TODO(johnniwinther): Remove this when not needed by the dart backend.
+ // TODO(johnniwinther): Remove this when not needed by the inferrer.
+ @deprecated
R visitTypePrefixSend(Send node);
+ @deprecated
R visitAssertSend(Send node);
internalError(Spannable node, String reason);
@@ -56,6 +72,11 @@
ResolvedKind visitTypeLiteralSend(Send node) => ResolvedKind.TYPE_LITERAL;
ResolvedKind visitTypePrefixSend(Send node) => ResolvedKind.TYPE_PREFIX;
ResolvedKind visitAssertSend(Send node) => ResolvedKind.ASSERT;
+ ResolvedKind handleSuperConstructorInvoke(Send node) {
+ return ResolvedKind.SUPER_CONSTRUCTOR;
+ }
+ ResolvedKind handleSendSet(SendSet node) => ResolvedKind.SEND_SET;
+ ResolvedKind handleNewExpression(NewExpression node) => ResolvedKind.NEW;
internalError(Spannable node, String reason) => ResolvedKind.ERROR;
}
@@ -78,6 +99,9 @@
} else if (elements.isTypeLiteral(node)) {
return visitor.visitTypeLiteralSend(node);
} else if (node.isSuperCall) {
+ if (element != null && element.isConstructor) {
+ return visitor.handleSuperConstructorInvoke(node);
+ }
return visitor.visitSuperSend(node);
} else if (node.isOperator) {
return visitor.visitOperatorSend(node);
@@ -122,16 +146,6 @@
}
}
-// TODO(johnniwinther): Remove this. Currently need by the old dart2dart
-// backend.
-abstract class OldResolvedVisitor<R> extends BaseResolvedVisitor<R> {
- OldResolvedVisitor(TreeElements elements) : super(elements);
-
- R visitSend(Send node) {
- return _oldDispatch(node, this);
- }
-}
-
abstract class NewResolvedVisitor<R> extends BaseResolvedVisitor<R>
with SendResolverMixin,
GetBulkMixin<R, dynamic>,
@@ -162,7 +176,7 @@
Element element = elements[node];
if (element != null && element.isConstructor) {
if (node.isSuperCall) {
- return kindVisitor.visitSuperSend(node);
+ return kindVisitor.handleSuperConstructorInvoke(node);
} else {
return kindVisitor.visitStaticSend(node);
}
@@ -185,19 +199,90 @@
}
}
+ @override
+ R visitDynamicSend(Send node) {
+ return internalError(node, "visitDynamicSend is deprecated");
+ }
+
+ @override
+ R visitSuperSend(Send node) {
+ return internalError(node, "visitSuperSend is deprecated");
+ }
+
+ @override
+ R visitOperatorSend(Send node) {
+ return internalError(node, "visitOperaterSend is deprecated");
+ }
+
+ @override
+ R visitClosureSend(Send node) {
+ return internalError(node, "visitClosureSend is deprecated");
+ }
+
+ @override
+ R visitTypeLiteralSend(Send node) {
+ return internalError(node, "visitTypeLiteralSend is deprecated");
+ }
+
+ @override
+ R visitTypePrefixSend(Send node) {
+ return internalError(node, "visitTypePrefixSend is deprecated");
+ }
+
+ @override
+ R visitAssertSend(Send node) {
+ return internalError(node, "visitAssertSend is deprecated");
+ }
+
+ bool checkResolvedKind(Node node,
+ ResolvedKind oldKind,
+ ResolvedKind newKind) {
+ return invariant(node, oldKind == newKind, message: '$oldKind != $newKind');
+ }
+
+ ResolvedKind computeResolvedKindFromStructure(
+ Node node, SemanticSendStructure structure) {
+ return structure.dispatch(
+ _resolvedKindDispatcher, node, const ResolvedKindComputer());
+ }
+
+ @override
R visitSend(Send node) {
- ResolvedKind oldKind;
- ResolvedKind newKind;
- assert(invariant(node, () {
- oldKind = _oldDispatch(node, const ResolvedKindComputer());
- newKind = _newDispatch(
- node, const ResolvedKindComputer(), _resolvedKindDispatcher);
- return oldKind == newKind;
- }, message: () => '$oldKind != $newKind'));
+ assert(checkResolvedKind(
+ node,
+ _oldDispatch(node, const ResolvedKindComputer()),
+ _newDispatch(node, const ResolvedKindComputer(),
+ _resolvedKindDispatcher)));
return _newDispatch(node, this, this);
}
@override
+ R visitSendSet(Send node) {
+ SendStructure structure = computeSendStructure(node);
+ if (structure == null) {
+ return internalError(node, 'No structure for $node');
+ } else {
+ assert(checkResolvedKind(node,
+ ResolvedKind.SEND_SET,
+ computeResolvedKindFromStructure(node, structure)));
+ return structure.dispatch(this, node, structure);
+ }
+ }
+
+ @override
+ R visitNewExpression(NewExpression node) {
+ NewStructure structure = computeNewStructure(node);
+ if (structure == null) {
+ return internalError(node, 'No structure for $node');
+ } else {
+ assert(checkResolvedKind(node,
+ ResolvedKind.NEW,
+ computeResolvedKindFromStructure(node, structure)));
+ return structure.dispatch(this, node, structure);
+ }
+ }
+
+ @override
R apply(Node node, arg) {
return visitNode(node);
}
@@ -206,8 +291,8 @@
R bulkHandleNode(
Node node,
String message,
- SendStructure sendStructure) {
- return sendStructure.dispatch(_semanticDispatcher, node, this);
+ SemanticSendStructure structure) {
+ return structure.dispatch(_semanticDispatcher, node, this);
}
}
@@ -239,13 +324,16 @@
Node node,
String message,
ResolvedKindVisitor<R> visitor) {
- // Set, Compound, IndexSet, and NewExpression are not handled by
- // [ResolvedVisitor].
return bulkHandleError(node, visitor);
}
R bulkHandleError(Node node, ResolvedKindVisitor<R> visitor) {
- return visitor.internalError(node, "No resolved kind for node.");
+ if (node.asSendSet() != null) {
+ return visitor.handleSendSet(node);
+ } else if (node.asNewExpression() != null) {
+ return visitor.handleNewExpression(node);
+ }
+ return visitor.internalError(node, "No resolved kind for $node.");
}
@override
@@ -261,20 +349,43 @@
@override
R bulkHandlePrefix(Node node, ResolvedKindVisitor<R> visitor) {
- return visitor.visitOperatorSend(node);
+ return visitor.handleSendSet(node);
}
@override
R bulkHandlePostfix(Node node, ResolvedKindVisitor<R> visitor) {
- return visitor.visitOperatorSend(node);
+ return visitor.handleSendSet(node);
}
@override
R bulkHandleSuper(Node node, ResolvedKindVisitor<R> visitor) {
+ if (node.asSendSet() != null) {
+ return visitor.handleSendSet(node);
+ }
return visitor.visitSuperSend(node);
}
@override
+ R bulkHandleSet(SendSet node, ResolvedKindVisitor<R> visitor) {
+ return visitor.handleSendSet(node);
+ }
+
+ @override
+ R bulkHandleCompound(SendSet node, ResolvedKindVisitor<R> visitor) {
+ return visitor.handleSendSet(node);
+ }
+
+ @override
+ R bulkHandleIndexSet(SendSet node, ResolvedKindVisitor<R> visitor) {
+ return visitor.handleSendSet(node);
+ }
+
+ @override
+ R bulkHandleNew(NewExpression node, ResolvedKindVisitor<R> visitor) {
+ return visitor.handleNewExpression(node);
+ }
+
+ @override
R errorInvalidAssert(
Send node,
NodeList arguments,
@@ -288,7 +399,7 @@
LocalFunctionElement function,
op.IncDecOperator operator,
ResolvedKindVisitor<R> visitor) {
- return visitor.visitOperatorSend(node);
+ return visitor.handleSendSet(node);
}
@override
@@ -297,7 +408,7 @@
LocalFunctionElement function,
op.IncDecOperator operator,
ResolvedKindVisitor<R> visitor) {
- return visitor.visitOperatorSend(node);
+ return visitor.handleSendSet(node);
}
@override
@@ -313,7 +424,7 @@
Send node,
FunctionElement setter,
NodeList arguments,
- Selector selector,
+ CallStructure callStructure,
ResolvedKindVisitor<R> visitor) {
return visitor.visitStaticSend(node);
}
@@ -331,7 +442,7 @@
Send node,
FunctionElement setter,
NodeList arguments,
- Selector selector,
+ CallStructure callStructure,
ResolvedKindVisitor<R> visitor) {
return visitor.visitSuperSend(node);
}
@@ -349,7 +460,7 @@
Send node,
FunctionElement setter,
NodeList arguments,
- Selector selector,
+ CallStructure callStructure,
ResolvedKindVisitor<R> visitor) {
return visitor.visitStaticSend(node);
}
@@ -374,26 +485,20 @@
}
@override
- R errorUnresolvedGet(
+ R visitUnresolvedGet(
Send node,
Element element,
ResolvedKindVisitor<R> visitor) {
- if (node.isSuperCall) {
- return visitor.visitSuperSend(node);
- }
return visitor.visitGetterSend(node);
}
@override
- R errorUnresolvedInvoke(
+ R visitUnresolvedInvoke(
Send node,
Element element,
NodeList arguments,
Selector selector,
ResolvedKindVisitor<R> visitor) {
- if (node.isSuperCall) {
- return visitor.visitSuperSend(node);
- }
return visitor.visitStaticSend(node);
}
@@ -403,10 +508,7 @@
Element element,
op.IncDecOperator operator,
ResolvedKindVisitor<R> visitor) {
- if (node.isSuperCall) {
- return visitor.visitSuperSend(node);
- }
- return visitor.visitOperatorSend(node);
+ return visitor.handleSendSet(node);
}
@override
@@ -415,29 +517,7 @@
Element element,
op.IncDecOperator operator,
ResolvedKindVisitor<R> visitor) {
- if (node.isSuperCall) {
- return visitor.visitSuperSend(node);
- }
- return visitor.visitOperatorSend(node);
- }
-
- @override
- R errorUnresolvedSuperBinary(
- Send node,
- Element element,
- op.BinaryOperator operator,
- Node argument,
- ResolvedKindVisitor<R> visitor) {
- return visitor.visitSuperSend(node);
- }
-
- @override
- R errorUnresolvedSuperUnary(
- Send node,
- op.UnaryOperator operator,
- Element element,
- ResolvedKindVisitor<R> visitor) {
- return visitor.visitSuperSend(node);
+ return visitor.handleSendSet(node);
}
@override
@@ -572,7 +652,7 @@
Send node,
ParameterElement parameter,
NodeList arguments,
- Selector selector,
+ CallStructure callStructure,
ResolvedKindVisitor<R> visitor) {
return visitor.visitClosureSend(node);
}
@@ -582,7 +662,7 @@
Send node,
LocalVariableElement variable,
NodeList arguments,
- Selector selector,
+ CallStructure callStructure,
ResolvedKindVisitor<R> visitor) {
return visitor.visitClosureSend(node);
}
@@ -592,7 +672,7 @@
Send node,
LocalFunctionElement function,
NodeList arguments,
- Selector selector,
+ CallStructure callStructure,
ResolvedKindVisitor<R> visitor) {
return visitor.visitClosureSend(node);
}
@@ -601,7 +681,7 @@
R visitThisInvoke(
Send node,
NodeList arguments,
- Selector selector,
+ CallStructure callStructure,
ResolvedKindVisitor<R> visitor) {
return visitor.visitClosureSend(node);
}
@@ -643,7 +723,7 @@
Send node,
ConstantExpression constant,
NodeList arguments,
- Selector selector,
+ CallStructure callStructure,
ResolvedKindVisitor<R> visitor) {
return visitor.visitTypeLiteralSend(node);
}
@@ -653,7 +733,7 @@
Send node,
ConstantExpression constant,
NodeList arguments,
- Selector selector,
+ CallStructure callStructure,
ResolvedKindVisitor<R> visitor) {
return visitor.visitTypeLiteralSend(node);
}
@@ -663,7 +743,7 @@
Send node,
ConstantExpression constant,
NodeList arguments,
- Selector selector,
+ CallStructure callStructure,
ResolvedKindVisitor<R> visitor) {
return visitor.visitTypeLiteralSend(node);
}
@@ -673,7 +753,7 @@
Send node,
TypeVariableElement element,
NodeList arguments,
- Selector selector,
+ CallStructure callStructure,
ResolvedKindVisitor<R> visitor) {
return visitor.visitTypeLiteralSend(node);
}
@@ -695,13 +775,4 @@
ResolvedKindVisitor<R> visitor) {
return visitor.visitSuperSend(node);
}
-
- @override
- R errorUnresolvedSuperIndex(
- Send node,
- Element function,
- Node index,
- ResolvedKindVisitor<R> visitor) {
- return visitor.visitSuperSend(node);
- }
}
diff --git a/pkg/compiler/lib/src/scanner/class_element_parser.dart b/pkg/compiler/lib/src/scanner/class_element_parser.dart
index 27c7b9f..9bf1523 100644
--- a/pkg/compiler/lib/src/scanner/class_element_parser.dart
+++ b/pkg/compiler/lib/src/scanner/class_element_parser.dart
@@ -91,7 +91,9 @@
Modifiers get modifiers =>
cachedNode != null ? cachedNode.modifiers : Modifiers.EMPTY;
- accept(ElementVisitor visitor) => visitor.visitClassElement(this);
+ accept(ElementVisitor visitor, arg) {
+ return visitor.visitClassElement(this, arg);
+ }
PartialClassElement copyWithEnclosing(CompilationUnitElement enclosing) {
return new PartialClassElement(name, beginToken, endToken, enclosing, id);
diff --git a/pkg/compiler/lib/src/ssa/builder.dart b/pkg/compiler/lib/src/ssa/builder.dart
index 189b9b8..e4b5c8b 100644
--- a/pkg/compiler/lib/src/ssa/builder.dart
+++ b/pkg/compiler/lib/src/ssa/builder.dart
@@ -9,9 +9,10 @@
SsaBuilderTask builder;
SsaOptimizerTask optimizer;
- SsaFunctionCompiler(JavaScriptBackend backend, bool generateSourceMap)
- : generator = new SsaCodeGeneratorTask(backend),
- builder = new SsaBuilderTask(backend, generateSourceMap),
+ SsaFunctionCompiler(JavaScriptBackend backend,
+ SourceInformationFactory sourceInformationFactory)
+ : generator = new SsaCodeGeneratorTask(backend, sourceInformationFactory),
+ builder = new SsaBuilderTask(backend, sourceInformationFactory),
optimizer = new SsaOptimizerTask(backend);
/// Generates JavaScript code for `work.element`.
@@ -96,11 +97,11 @@
class SsaBuilderTask extends CompilerTask {
final CodeEmitterTask emitter;
final JavaScriptBackend backend;
- final bool generateSourceMap;
+ final SourceInformationFactory sourceInformationFactory;
String get name => 'SSA builder';
- SsaBuilderTask(JavaScriptBackend backend, this.generateSourceMap)
+ SsaBuilderTask(JavaScriptBackend backend, this.sourceInformationFactory)
: emitter = backend.emitter,
backend = backend,
super(backend.compiler);
@@ -112,7 +113,8 @@
HInstruction.idCounter = 0;
SsaBuilder builder =
new SsaBuilder(
- backend, work, emitter.nativeEmitter, generateSourceMap);
+ backend, work, emitter.nativeEmitter,
+ sourceInformationFactory);
HGraph graph;
ElementKind kind = element.kind;
if (kind == ElementKind.GENERATIVE_CONSTRUCTOR) {
@@ -199,6 +201,10 @@
/// variables are in scope.
ClassElement get contextClass => executableContext.contextClass;
+ SourceInformationBuilder get sourceInformationBuilder {
+ return builder.sourceInformationBuilder;
+ }
+
LocalsHandler(this.builder, this.executableContext);
/// Substituted type variables occurring in [type] into the context of
@@ -242,9 +248,11 @@
// TODO(floitsch): Clean up this hack. Should we create a box-object by
// just creating an empty object literal?
JavaScriptBackend backend = builder.backend;
- HInstruction box = new HForeignCode(js.js.parseForeignJS('{}'),
- backend.nonNullType,
- <HInstruction>[]);
+ HInstruction box = new HForeignCode(
+ js.js.parseForeignJS('{}'),
+ backend.nonNullType,
+ <HInstruction>[],
+ nativeBehavior: native.NativeBehavior.PURE_ALLOCATION);
builder.add(box);
return box;
}
@@ -991,7 +999,7 @@
final ConstantSystem constantSystem;
final CodegenWorkItem work;
final RuntimeTypes rti;
- final bool generateSourceMap;
+ SourceInformationBuilder sourceInformationBuilder;
bool inLazyInitializerExpression = false;
/* This field is used by the native handler. */
@@ -1079,7 +1087,7 @@
SsaBuilder(JavaScriptBackend backend,
CodegenWorkItem work,
this.nativeEmitter,
- this.generateSourceMap)
+ SourceInformationFactory sourceInformationFactory)
: this.compiler = backend.compiler,
this.backend = backend,
this.constantSystem = backend.constantSystem,
@@ -1088,6 +1096,8 @@
super(work.resolutionTree) {
localsHandler = new LocalsHandler(this, work.element);
sourceElementStack.add(work.element);
+ sourceInformationBuilder =
+ sourceInformationFactory.forContext(work.element.implementation);
}
CodegenRegistry get registry => work.registry;
@@ -1158,20 +1168,6 @@
add(attachPosition(instruction, node));
}
- SourceFile currentSourceFile() {
- return sourceElement.implementation.compilationUnit.script.file;
- }
-
- void checkValidSourceFileLocation(
- SourceLocation location, SourceFile sourceFile, int offset) {
- if (!location.isValid) {
- throw MessageKind.INVALID_SOURCE_FILE_LOCATION.message(
- {'offset': offset,
- 'fileName': sourceFile.filename,
- 'length': sourceFile.length});
- }
- }
-
/**
* Returns a complete argument list for a call of [function].
*/
@@ -1458,8 +1454,13 @@
assert(element is FunctionElement || element is VariableElement);
return compiler.withCurrentElement(element, () {
// The [sourceElementStack] contains declaration elements.
+ SourceInformationBuilder oldSourceInformationBuilder =
+ sourceInformationBuilder;
+ sourceInformationBuilder =
+ sourceInformationBuilder.forContext(element.implementation);
sourceElementStack.add(element.declaration);
var result = f();
+ sourceInformationBuilder = oldSourceInformationBuilder;
sourceElementStack.removeLast();
return result;
});
@@ -1517,12 +1518,6 @@
return graph.addConstant(getConstantForNode(node), compiler);
}
- bool isLazilyInitialized(VariableElement element) {
- ConstantExpression initialValue =
- backend.constants.getConstantForVariable(element);
- return initialValue == null;
- }
-
TypeMask cachedTypeOfThis;
TypeMask getTypeOfThis() {
@@ -2511,40 +2506,22 @@
}
HInstruction attachPosition(HInstruction target, ast.Node node) {
- if (generateSourceMap && node != null) {
- target.sourceInformation = sourceInformationForBeginToken(node);
+ if (node != null) {
+ target.sourceInformation = sourceInformationBuilder.buildGeneric(node);
}
return target;
}
- SourceInformation sourceInformationForBeginToken(ast.Node node) {
- return new StartEndSourceInformation(sourceFileLocationForBeginToken(node));
- }
-
- SourceInformation sourceInformationForBeginEndToken(ast.Node node) {
- return new StartEndSourceInformation(
- sourceFileLocationForBeginToken(node),
- sourceFileLocationForEndToken(node));
- }
-
- SourceLocation sourceFileLocationForBeginToken(ast.Node node) =>
- sourceFileLocationForToken(node, node.getBeginToken());
-
- SourceLocation sourceFileLocationForEndToken(ast.Node node) =>
- sourceFileLocationForToken(node, node.getEndToken());
-
- SourceLocation sourceFileLocationForToken(ast.Node node, Token token) {
- SourceFile sourceFile = currentSourceFile();
- SourceLocation location =
- new TokenSourceLocation(sourceFile, token, sourceElement.name);
- checkValidSourceFileLocation(location, sourceFile, token.charOffset);
- return location;
- }
-
void visit(ast.Node node) {
if (node != null) node.accept(this);
}
+ /// Visit [node] and pop the resulting [HInstruction].
+ HInstruction visitAndPop(ast.Node node) {
+ node.accept(this);
+ return pop();
+ }
+
visitBlock(ast.Block node) {
assert(!isAborted());
if (!isReachable) return; // This can only happen when inlining.
@@ -2810,7 +2787,7 @@
wrapExpressionGraph(updateGraph),
conditionBlock.loopInformation.target,
conditionBlock.loopInformation.labels,
- sourceInformationForBeginEndToken(loop));
+ sourceInformationBuilder.buildLoop(loop));
startBlock.setBlockFlow(info, current);
loopInfo.loopBlockInformation = info;
@@ -3027,7 +3004,7 @@
null,
loopEntryBlock.loopInformation.target,
loopEntryBlock.loopInformation.labels,
- sourceInformationForBeginEndToken(node));
+ sourceInformationBuilder.buildLoop(node));
loopEntryBlock.setBlockFlow(loopBlockInfo, current);
loopInfo.loopBlockInformation = loopBlockInfo;
} else {
@@ -3072,8 +3049,6 @@
// TODO(johnniwinther): Is [registerStaticUse] equivalent to
// [addToWorkList]?
registry.registerStaticUse(callElement);
- // TODO(ahe): This should be registered in codegen, not here.
- registry.registerInstantiatedClass(closureClassElement);
List<HInstruction> capturedVariables = <HInstruction>[];
closureClassElement.closureFields.forEach((ClosureFieldElement field) {
@@ -3124,30 +3099,42 @@
branchBuilder.handleIf(visitCondition, visitThen, visitElse);
}
- void visitLogicalAndOr(ast.Send node, ast.Operator op) {
+ @override
+ void visitLogicalAnd(ast.Send node, ast.Node left, ast.Node right, _) {
SsaBranchBuilder branchBuilder = new SsaBranchBuilder(this, node);
branchBuilder.handleLogicalAndOrWithLeftNode(
- node.receiver,
- () { visit(node.argumentsNode); },
- isAnd: ("&&" == op.source));
+ left,
+ () { visit(right); },
+ isAnd: true);
}
- void visitLogicalNot(ast.Send node) {
+ @override
+ void visitLogicalOr(ast.Send node, ast.Node left, ast.Node right, _) {
+ SsaBranchBuilder branchBuilder = new SsaBranchBuilder(this, node);
+ branchBuilder.handleLogicalAndOrWithLeftNode(
+ left,
+ () { visit(right); },
+ isAnd: false);
+ }
+
+ @override
+ void visitNot(ast.Send node, ast.Node expression, _) {
assert(node.argumentsNode is ast.Prefix);
- visit(node.receiver);
+ visit(expression);
HNot not = new HNot(popBoolified(), backend.boolType);
pushWithPosition(not, node);
}
- void visitUnarySend(ast.Send node, ast.Operator op) {
+ @override
+ void visitUnary(ast.Send node,
+ UnaryOperator operator,
+ ast.Node expression,_) {
assert(node.argumentsNode is ast.Prefix);
- visit(node.receiver);
- assert(!identical(op.token.kind, PLUS_TOKEN));
- HInstruction operand = pop();
+ HInstruction operand = visitAndPop(expression);
// See if we can constant-fold right away. This avoids rewrites later on.
if (operand is HConstant) {
- UnaryOperation operation = constantSystem.lookupUnary(op.source);
+ UnaryOperation operation = constantSystem.lookupUnary(operator);
HConstant constant = operand;
ConstantValue folded = operation.fold(constant.constant);
if (folded != null) {
@@ -3159,27 +3146,47 @@
pushInvokeDynamic(node, elements.getSelector(node), [operand]);
}
+ @override
+ void visitBinary(ast.Send node,
+ ast.Node left,
+ BinaryOperator operator,
+ ast.Node right, _) {
+ handleBinary(node, left, right);
+ }
+
+ @override
+ void visitIndex(ast.Send node, ast.Node receiver, ast.Node index, _) {
+ generateDynamicSend(node);
+ }
+
+ @override
+ void visitEquals(ast.Send node, ast.Node left, ast.Node right, _) {
+ handleBinary(node, left, right);
+ }
+
+ @override
+ void visitNotEquals(ast.Send node, ast.Node left, ast.Node right, _) {
+ handleBinary(node, left, right);
+ pushWithPosition(new HNot(popBoolified(), backend.boolType), node.selector);
+ }
+
+ void handleBinary(ast.Send node, ast.Node left, ast.Node right) {
+ visitBinarySend(
+ visitAndPop(left),
+ visitAndPop(right),
+ elements.getSelector(node),
+ node,
+ location: node.selector);
+ }
+
+ /// TODO(johnniwinther): Merge [visitBinarySend] with [handleBinary] and
+ /// remove use of [location] for source information.
void visitBinarySend(HInstruction left,
- ast.Operator op,
HInstruction right,
Selector selector,
- ast.Send send) {
- switch (op.source) {
- case "===":
- pushWithPosition(
- new HIdentity(left, right, null, backend.boolType), op);
- return;
- case "!==":
- HIdentity eq = new HIdentity(left, right, null, backend.boolType);
- add(eq);
- pushWithPosition(new HNot(eq, backend.boolType), op);
- return;
- }
-
- pushInvokeDynamic(send, selector, [left, right], location: op);
- if (op.source == '!=') {
- pushWithPosition(new HNot(popBoolified(), backend.boolType), op);
- }
+ ast.Send send,
+ {ast.Node location}) {
+ pushInvokeDynamic(send, selector, [left, right], location: location);
}
HInstruction generateInstanceSendReceiver(ast.Send send) {
@@ -3228,85 +3235,192 @@
}
}
- void generateGetter(ast.Send send, Element element) {
- if (element != null && element.isForeign(backend)) {
- visitForeignGetter(send);
- } else if (Elements.isStaticOrTopLevelField(element)) {
- ConstantExpression constant;
- if (element.isField && !element.isAssignable) {
+ /// Generate read access of an unresolved static or top level entity.
+ void generateStaticUnresolvedGet(ast.Send node, Element element) {
+ if (element is ErroneousElement) {
+ // An erroneous element indicates an unresolved static getter.
+ generateThrowNoSuchMethod(
+ node,
+ noSuchMethodTargetSymbolString(element, 'get'),
+ argumentNodes: const Link<ast.Node>());
+ } else {
+ // This happens when [element] has parse errors.
+ assert(invariant(node, element.isErroneous));
+ // TODO(ahe): Do something like the above, that is, emit a runtime
+ // error.
+ stack.add(graph.addConstantNull(compiler));
+ }
+ }
+
+ /// Read a static or top level [field] of constant value.
+ void generateStaticConstGet(
+ ast.Send node,
+ FieldElement field,
+ ConstantExpression constant) {
+ ConstantValue value = constant.value;
+ HConstant instruction;
+ // Constants that are referred via a deferred prefix should be referred
+ // by reference.
+ PrefixElement prefix = compiler.deferredLoadTask
+ .deferredPrefixElement(node, elements);
+ if (prefix != null) {
+ instruction = graph.addDeferredConstant(value, prefix, compiler);
+ } else {
+ instruction = graph.addConstant(value, compiler);
+ }
+ stack.add(instruction);
+ // The inferrer may have found a better type than the constant
+ // handler in the case of lists, because the constant handler
+ // does not look at elements in the list.
+ TypeMask type =
+ TypeMaskFactory.inferredTypeForElement(field, compiler);
+ if (!type.containsAll(compiler.world) &&
+ !instruction.isConstantNull()) {
+ // TODO(13429): The inferrer should know that an element
+ // cannot be null.
+ instruction.instructionType = type.nonNullable();
+ }
+ }
+
+ /// Read a static or top level [field].
+ void generateStaticFieldGet(ast.Send node, FieldElement field) {
+ generateIsDeferredLoadedCheckIfNeeded(node);
+
+ ConstantExpression constant =
+ backend.constants.getConstantForVariable(field);
+ if (constant != null) {
+ if (!field.isAssignable) {
// A static final or const. Get its constant value and inline it if
// the value can be compiled eagerly.
- constant = backend.constants.getConstantForVariable(element);
- }
- if (constant != null) {
- ConstantValue value = constant.value;
- HConstant instruction;
- // Constants that are referred via a deferred prefix should be referred
- // by reference.
- PrefixElement prefix = compiler.deferredLoadTask
- .deferredPrefixElement(send, elements);
- if (prefix != null) {
- instruction = graph.addDeferredConstant(value, prefix, compiler);
- } else {
- instruction = graph.addConstant(value, compiler);
- }
- stack.add(instruction);
- // The inferrer may have found a better type than the constant
- // handler in the case of lists, because the constant handler
- // does not look at elements in the list.
- TypeMask type =
- TypeMaskFactory.inferredTypeForElement(element, compiler);
- if (!type.containsAll(compiler.world) &&
- !instruction.isConstantNull()) {
- // TODO(13429): The inferrer should know that an element
- // cannot be null.
- instruction.instructionType = type.nonNullable();
- }
- } else if (element.isField && isLazilyInitialized(element)) {
- HInstruction instruction = new HLazyStatic(
- element,
- TypeMaskFactory.inferredTypeForElement(element, compiler));
+ generateStaticConstGet(node, field, constant);
+ } else {
+ // TODO(5346): Try to avoid the need for calling [declaration] before
+ // creating an [HStatic].
+ HInstruction instruction = new HStatic(
+ field.declaration,
+ TypeMaskFactory.inferredTypeForElement(field, compiler));
push(instruction);
- } else {
- if (element.isGetter) {
- pushInvokeStatic(send, element, <HInstruction>[]);
- } else {
- // TODO(5346): Try to avoid the need for calling [declaration] before
- // creating an [HStatic].
- HInstruction instruction = new HStatic(
- element.declaration,
- TypeMaskFactory.inferredTypeForElement(element, compiler));
- push(instruction);
- }
- }
- } else if (Elements.isInstanceSend(send, elements)) {
- HInstruction receiver = generateInstanceSendReceiver(send);
- generateInstanceGetterWithCompiledReceiver(
- send, elements.getSelector(send), receiver);
- } else if (Elements.isStaticOrTopLevelFunction(element)) {
- // TODO(5346): Try to avoid the need for calling [declaration] before
- // creating an [HStatic].
- push(new HStatic(element.declaration, backend.nonNullType));
- // TODO(ahe): This should be registered in codegen.
- registry.registerGetOfStaticFunction(element.declaration);
- } else if (Elements.isErroneous(element)) {
- if (element is ErroneousElement) {
- // An erroneous element indicates an unresolved static getter.
- generateThrowNoSuchMethod(
- send,
- noSuchMethodTargetSymbolString(element, 'get'),
- argumentNodes: const Link<ast.Node>());
- } else {
- // TODO(ahe): Do something like the above, that is, emit a runtime
- // error.
- stack.add(graph.addConstantNull(compiler));
}
} else {
- LocalElement local = element;
- stack.add(localsHandler.readLocal(local));
+ HInstruction instruction = new HLazyStatic(
+ field,
+ TypeMaskFactory.inferredTypeForElement(field, compiler));
+ push(instruction);
}
}
+ /// Generate a getter invocation of the static or top level [getter].
+ void generateStaticGetterGet(ast.Send node, MethodElement getter) {
+ if (getter.isDeferredLoaderGetter) {
+ generateDeferredLoaderGet(node, getter);
+ } else {
+ generateIsDeferredLoadedCheckIfNeeded(node);
+ pushInvokeStatic(node, getter, <HInstruction>[]);
+ }
+ }
+
+ /// Generate a dynamic getter invocation.
+ void generateDynamicGet(ast.Send node) {
+ HInstruction receiver = generateInstanceSendReceiver(node);
+ generateInstanceGetterWithCompiledReceiver(
+ node, elements.getSelector(node), receiver);
+ }
+
+ /// Generate a closurization of the static or top level [function].
+ void generateStaticFunctionGet(ast.Send node, MethodElement function) {
+ generateIsDeferredLoadedCheckIfNeeded(node);
+ // TODO(5346): Try to avoid the need for calling [declaration] before
+ // creating an [HStatic].
+ push(new HStatic(function.declaration, backend.nonNullType));
+ // TODO(ahe): This should be registered in codegen.
+ registry.registerGetOfStaticFunction(function.declaration);
+ }
+
+ /// Read a local variable, function or parameter.
+ void handleLocalGet(LocalElement local) {
+ stack.add(localsHandler.readLocal(local));
+ }
+
+ @override
+ void visitDynamicPropertyGet(
+ ast.Send node,
+ ast.Node receiver,
+ Selector selector,
+ _) {
+ generateDynamicGet(node);
+ }
+
+ @override
+ void visitLocalVariableGet(ast.Send node, LocalVariableElement variable, _) {
+ handleLocalGet(variable);
+ }
+
+ @override
+ void visitParameterGet(ast.Send node, ParameterElement parameter, _) {
+ handleLocalGet(parameter);
+ }
+
+ @override
+ void visitLocalFunctionGet(ast.Send node, LocalFunctionElement function, _) {
+ handleLocalGet(function);
+ }
+
+ @override
+ void visitStaticFieldGet(
+ ast.Send node,
+ FieldElement field,
+ _) {
+ generateStaticFieldGet(node, field);
+ }
+
+ @override
+ void visitStaticFunctionGet(
+ ast.Send node,
+ MethodElement function,
+ _) {
+ generateStaticFunctionGet(node, function);
+ }
+
+ @override
+ void visitStaticGetterGet(
+ ast.Send node,
+ FunctionElement getter,
+ _) {
+ generateStaticGetterGet(node, getter);
+ }
+
+ @override
+ void visitThisPropertyGet(
+ ast.Send node,
+ Selector selector,
+ _) {
+ generateDynamicGet(node);
+ }
+
+ @override
+ void visitTopLevelFieldGet(
+ ast.Send node,
+ FieldElement field,
+ _) {
+ generateStaticFieldGet(node, field);
+ }
+
+ @override
+ void visitTopLevelFunctionGet(
+ ast.Send node,
+ MethodElement function,
+ _) {
+ generateStaticFunctionGet(node, function);
+ }
+
+ @override
+ void visitTopLevelGetterGet(
+ ast.Send node,
+ FunctionElement getter,
+ _) {
+ generateStaticGetterGet(node, getter);
+ }
+
void generateInstanceSetterWithCompiledReceiver(ast.Send send,
HInstruction receiver,
HInstruction value,
@@ -3382,12 +3496,6 @@
return interceptor;
}
- HForeignCode createForeign(js.Template code,
- TypeMask type,
- List<HInstruction> inputs) {
- return new HForeignCode(code, type, inputs);
- }
-
HLiteralList buildLiteralList(List<HInstruction> inputs) {
return new HLiteralList(inputs, backend.extendableArrayType);
}
@@ -3416,59 +3524,40 @@
// template manager build them.
js.Template code = js.js.uncachedExpressionTemplate(template);
HInstruction representation =
- createForeign(code, backend.readableArrayType, inputs);
+ new HForeignCode(code, backend.readableArrayType, inputs,
+ nativeBehavior: native.NativeBehavior.PURE_ALLOCATION);
return representation;
}
}
- visitOperatorSend(ast.Send node) {
- ast.Operator op = node.selector;
- if ("[]" == op.source) {
- visitDynamicSend(node);
- } else if ("&&" == op.source ||
- "||" == op.source) {
- visitLogicalAndOr(node, op);
- } else if ("!" == op.source) {
- visitLogicalNot(node);
- } else if (node.argumentsNode is ast.Prefix) {
- visitUnarySend(node, op);
- } else if ("is" == op.source) {
- visitIsSend(node);
- } else if ("as" == op.source) {
- visit(node.receiver);
- HInstruction expression = pop();
- DartType type = elements.getType(node.typeAnnotationFromIsCheckOrCast);
- if (type.isMalformed) {
- ErroneousElement element = type.element;
- generateTypeError(node, element.message);
- } else {
- HInstruction converted = buildTypeConversion(
- expression,
- localsHandler.substInContext(type),
- HTypeConversion.CAST_TYPE_CHECK);
- if (converted != expression) add(converted);
- stack.add(converted);
- }
+ @override
+ void visitAs(ast.Send node, ast.Node expression, DartType type, _) {
+ HInstruction expressionInstruction = visitAndPop(expression);
+ if (type.isMalformed) {
+ ErroneousElement element = type.element;
+ generateTypeError(node, element.message);
} else {
- visit(node.receiver);
- visit(node.argumentsNode);
- var right = pop();
- var left = pop();
- visitBinarySend(left, op, right, elements.getSelector(node), node);
+ HInstruction converted = buildTypeConversion(
+ expressionInstruction,
+ localsHandler.substInContext(type),
+ HTypeConversion.CAST_TYPE_CHECK);
+ if (converted != expressionInstruction) add(converted);
+ stack.add(converted);
}
}
- void visitIsSend(ast.Send node) {
- visit(node.receiver);
- HInstruction expression = pop();
- bool isNot = node.isIsNotCheck;
- DartType type = elements.getType(node.typeAnnotationFromIsCheckOrCast);
- HInstruction instruction = buildIsNode(node, type, expression);
- if (isNot) {
- add(instruction);
- instruction = new HNot(instruction, backend.boolType);
- }
- push(instruction);
+ @override
+ void visitIs(ast.Send node, ast.Node expression, DartType type, _) {
+ HInstruction expressionInstruction = visitAndPop(expression);
+ push(buildIsNode(node, type, expressionInstruction));
+ }
+
+ @override
+ void visitIsNot(ast.Send node, ast.Node expression, DartType type, _) {
+ HInstruction expressionInstruction = visitAndPop(expression);
+ HInstruction instruction = buildIsNode(node, type, expressionInstruction);
+ add(instruction);
+ push(new HNot(instruction, backend.boolType));
}
HInstruction buildIsNode(ast.Node node,
@@ -3592,7 +3681,8 @@
}
}
- visitDynamicSend(ast.Send node) {
+ /// Generate a dynamic method, getter or setter invocation.
+ void generateDynamicSend(ast.Send node) {
Selector selector = elements.getSelector(node);
List<HInstruction> inputs = <HInstruction>[];
@@ -3607,32 +3697,78 @@
}
}
- visitClosureSend(ast.Send node) {
- Selector selector = elements.getSelector(node);
- assert(node.receiver == null);
- Element element = elements[node];
- HInstruction closureTarget;
- if (element == null) {
- visit(node.selector);
- closureTarget = pop();
- } else {
- LocalElement local = element;
- closureTarget = localsHandler.readLocal(local);
- }
- var inputs = <HInstruction>[];
- inputs.add(closureTarget);
- addDynamicSendArgumentsToList(node, inputs);
- Selector closureSelector = new Selector.callClosureFrom(selector);
- pushWithPosition(
- new HInvokeClosure(closureSelector, inputs, backend.dynamicType),
- node);
+ @override
+ visitDynamicPropertyInvoke(
+ ast.Send node,
+ ast.Node receiver,
+ ast.NodeList arguments,
+ Selector selector,
+ _) {
+ generateDynamicSend(node);
+ }
+
+ @override
+ visitThisPropertyInvoke(
+ ast.Send node,
+ ast.NodeList arguments,
+ Selector selector,
+ _) {
+ generateDynamicSend(node);
+ }
+
+ @override
+ visitExpressionInvoke(
+ ast.Send node,
+ ast.Node expression,
+ ast.NodeList arguments,
+ Selector selector,
+ _) {
+ generateCallInvoke(node, visitAndPop(expression));
+ }
+
+ @override
+ visitThisInvoke(
+ ast.Send node,
+ ast.NodeList arguments,
+ CallStructure callStructure,
+ _) {
+ generateCallInvoke(node, localsHandler.readThis());
+ }
+
+ @override
+ visitParameterInvoke(
+ ast.Send node,
+ ParameterElement parameter,
+ ast.NodeList arguments,
+ CallStructure callStructure,
+ _) {
+ generateCallInvoke(node, localsHandler.readLocal(parameter));
+ }
+
+ @override
+ visitLocalVariableInvoke(
+ ast.Send node,
+ LocalVariableElement variable,
+ ast.NodeList arguments,
+ CallStructure callStructure,
+ _) {
+ generateCallInvoke(node, localsHandler.readLocal(variable));
+ }
+
+ @override
+ visitLocalFunctionInvoke(
+ ast.Send node,
+ LocalFunctionElement function,
+ ast.NodeList arguments,
+ CallStructure callStructure,
+ _) {
+ generateCallInvoke(node, localsHandler.readLocal(function));
}
void handleForeignJs(ast.Send node) {
Link<ast.Node> link = node.arguments;
- // If the invoke is on foreign code, don't visit the first
- // argument, which is the type, and the second argument,
- // which is the foreign code.
+ // Don't visit the first argument, which is the type, and the second
+ // argument, which is the foreign code.
if (link.isEmpty || link.tail.isEmpty) {
compiler.internalError(node.argumentsNode,
'At least two arguments expected.');
@@ -3647,15 +3783,16 @@
TypeMaskFactory.fromNativeBehavior(nativeBehavior, compiler);
if (nativeBehavior.codeTemplate.isExpression) {
- push(new HForeignCode(nativeBehavior.codeTemplate, ssaType, inputs,
- effects: nativeBehavior.sideEffects,
- nativeBehavior: nativeBehavior));
+ push(new HForeignCode(
+ nativeBehavior.codeTemplate, ssaType, inputs,
+ effects: nativeBehavior.sideEffects,
+ nativeBehavior: nativeBehavior));
} else {
- push(new HForeignCode(nativeBehavior.codeTemplate, ssaType, inputs,
- isStatement: true,
- effects: nativeBehavior.sideEffects,
- nativeBehavior: nativeBehavior,
- canThrow: true));
+ push(new HForeignCode(
+ nativeBehavior.codeTemplate, ssaType, inputs,
+ isStatement: true,
+ effects: nativeBehavior.sideEffects,
+ nativeBehavior: nativeBehavior));
}
}
@@ -3752,7 +3889,7 @@
default:
for (int i = 1; i < arguments.length; i++) {
compiler.reportError(
- arguments[i], MessageKind.GENERIC,
+ arguments[i], MessageKind.GENERIC,
{'text': 'Error: Extra argument to JS_GET_NAME.'});
}
return;
@@ -3773,6 +3910,47 @@
argument, JsGetName.values[index])));
}
+ void handleForeignJsBuiltin(ast.Send node) {
+ List<ast.Node> arguments = node.arguments.toList();
+ ast.Node argument;
+ if (arguments.length < 2) {
+ compiler.reportError(
+ node, MessageKind.GENERIC,
+ {'text': 'Error: Expected at least two arguments to JS_BUILTIN.'});
+ }
+
+ Element builtinElement = elements[arguments[1]];
+ if (builtinElement == null ||
+ (builtinElement is! FieldElement) ||
+ builtinElement.enclosingClass != backend.jsBuiltinEnum) {
+ compiler.reportError(
+ argument, MessageKind.GENERIC,
+ {'text': 'Error: Expected a JsBuiltin enum value.'});
+ }
+ EnumClassElement enumClass = builtinElement.enclosingClass;
+ int index = enumClass.enumValues.indexOf(builtinElement);
+
+ js.Template template =
+ backend.emitter.builtinTemplateFor(JsBuiltin.values[index]);
+
+ List<HInstruction> compiledArguments = <HInstruction>[];
+ for (int i = 2; i < arguments.length; i++) {
+ visit(arguments[i]);
+ compiledArguments.add(pop());
+ }
+
+ native.NativeBehavior nativeBehavior =
+ compiler.enqueuer.resolution.nativeEnqueuer.getNativeBehaviorOf(node);
+
+ TypeMask ssaType =
+ TypeMaskFactory.fromNativeBehavior(nativeBehavior, compiler);
+
+ push(new HForeignCode(template,
+ ssaType,
+ compiledArguments,
+ nativeBehavior: nativeBehavior));
+ }
+
void handleForeignJsEmbeddedGlobal(ast.Send node) {
List<ast.Node> arguments = node.arguments.toList();
ast.Node globalNameNode;
@@ -3796,7 +3974,7 @@
}
return;
}
- visit(arguments[1]);
+ visit(globalNameNode);
HInstruction globalNameHNode = pop();
if (!globalNameHNode.isConstantString()) {
compiler.reportError(
@@ -3814,7 +3992,8 @@
compiler.enqueuer.resolution.nativeEnqueuer.getNativeBehaviorOf(node);
TypeMask ssaType =
TypeMaskFactory.fromNativeBehavior(nativeBehavior, compiler);
- push(new HForeignCode(expr, ssaType, const []));
+ push(new HForeignCode(expr, ssaType, const [],
+ nativeBehavior: nativeBehavior));
}
void handleJsInterceptorConstant(ast.Send node) {
@@ -3886,10 +4065,12 @@
}
registry.registerStaticUse(element);
- push(new HForeignCode(js.js.expressionTemplateYielding(
- backend.emitter.staticFunctionAccess(element)),
- backend.dynamicType,
- <HInstruction>[]));
+ push(new HForeignCode(
+ js.js.expressionTemplateYielding(
+ backend.emitter.staticFunctionAccess(element)),
+ backend.dynamicType,
+ <HInstruction>[],
+ nativeBehavior: native.NativeBehavior.PURE));
return params;
}
@@ -3909,20 +4090,12 @@
String isolateName = backend.namer.currentIsolate;
SideEffects sideEffects = new SideEffects.empty();
sideEffects.setAllSideEffects();
- push(new HForeignCode(js.js.parseForeignJS("$isolateName = #"),
- backend.dynamicType,
- <HInstruction>[pop()],
- effects: sideEffects));
- }
-
- void handleForeignDartObjectJsConstructorFunction(ast.Send node) {
- if (!node.arguments.isEmpty) {
- compiler.internalError(node.argumentsNode, 'Too many arguments.');
- }
- push(new HForeignCode(js.js.expressionTemplateYielding(
- backend.emitter.typeAccess(compiler.objectClass)),
- backend.dynamicType,
- <HInstruction>[]));
+ push(new HForeignCode(
+ js.js.parseForeignJS("$isolateName = #"),
+ backend.dynamicType,
+ <HInstruction>[pop()],
+ nativeBehavior: native.NativeBehavior.PURE,
+ effects: sideEffects));
}
void handleForeignJsCurrentIsolate(ast.Send node) {
@@ -3934,9 +4107,8 @@
<HInstruction>[]));
}
- visitForeignSend(ast.Send node) {
- Selector selector = elements.getSelector(node);
- String name = selector.name;
+ void handleForeignSend(ast.Send node, FunctionElement element) {
+ String name = element.name;
if (name == 'JS') {
handleForeignJs(node);
} else if (name == 'JS_CURRENT_ISOLATE_CONTEXT') {
@@ -3960,10 +4132,6 @@
// TODO(floitsch): this should be a JS_NAME.
String name = backend.namer.runtimeTypeName(compiler.nullClass);
stack.add(addConstantString(name));
- } else if (name == 'JS_FUNCTION_CLASS_NAME') {
- // TODO(floitsch): this should be a JS_NAME.
- String name = backend.namer.runtimeTypeName(compiler.functionClass);
- stack.add(addConstantString(name));
} else if (name == 'JS_OPERATOR_AS_PREFIX') {
// TODO(floitsch): this should be a JS_NAME.
stack.add(addConstantString(backend.namer.operatorAsPrefix));
@@ -3973,9 +4141,6 @@
} else if (name == 'JS_TYPEDEF_TAG') {
// TODO(floitsch): this should be a JS_NAME.
stack.add(addConstantString(backend.namer.typedefTag));
- } else if (name == 'JS_FUNCTION_TYPE_TAG') {
- // TODO(floitsch): this should be a JS_NAME.
- stack.add(addConstantString(backend.namer.functionTypeTag));
} else if (name == 'JS_FUNCTION_TYPE_VOID_RETURN_TAG') {
// TODO(floitsch): this should be a JS_NAME.
stack.add(addConstantString(backend.namer.functionTypeVoidReturnTag));
@@ -3997,8 +4162,6 @@
// TODO(floitsch): this should be a JS_NAME.
stack.add(addConstantString(
backend.namer.functionTypeNamedParametersTag));
- } else if (name == 'JS_DART_OBJECT_CONSTRUCTOR') {
- handleForeignDartObjectJsConstructorFunction(node);
} else if (name == 'JS_IS_INDEXABLE_FIELD_NAME') {
// TODO(floitsch): this should be a JS_NAME.
Element element = backend.findHelper('JavaScriptIndexingBehavior');
@@ -4009,6 +4172,8 @@
handleForeignJsGetName(node);
} else if (name == 'JS_EMBEDDED_GLOBAL') {
handleForeignJsEmbeddedGlobal(node);
+ } else if (name == 'JS_BUILTIN') {
+ handleForeignJsBuiltin(node);
} else if (name == 'JS_GET_FLAG') {
handleForeingJsGetFlag(node);
} else if (name == 'JS_EFFECT') {
@@ -4018,15 +4183,13 @@
} else if (name == 'JS_STRING_CONCAT') {
handleJsStringConcat(node);
} else {
- throw "Unknown foreign: ${selector}";
+ throw "Unknown foreign: ${element}";
}
}
- visitForeignGetter(ast.Send node) {
- Element element = elements[node];
+ generateDeferredLoaderGet(ast.Send node, FunctionElement deferredLoader) {
// Until now we only handle these as getters.
- invariant(node, element.isDeferredLoaderGetter);
- FunctionElement deferredLoader = element;
+ invariant(node, deferredLoader.isDeferredLoaderGetter);
Element loadFunction = compiler.loadLibraryFunction;
PrefixElement prefixElement = deferredLoader.enclosingElement;
String loadId = compiler.deferredLoadTask
@@ -4091,45 +4254,215 @@
push(buildInvokeSuper(compiler.noSuchMethodSelector, element, inputs));
}
- visitSuperSend(ast.Send node) {
+ /// Generate a call to a super method or constructor.
+ void generateSuperInvoke(ast.Send node, FunctionElement function) {
+ // TODO(5347): Try to avoid the need for calling [implementation] before
+ // calling [makeStaticArgumentList].
+ Selector selector = elements.getSelector(node);
+ assert(invariant(node,
+ selector.applies(function.implementation, compiler.world),
+ message: "$selector does not apply to ${function.implementation}"));
+ List<HInstruction> inputs =
+ makeStaticArgumentList(selector.callStructure,
+ node.arguments,
+ function.implementation);
+ push(buildInvokeSuper(selector, function, inputs));
+ }
+
+ /// Access the value from the super [element].
+ void handleSuperGet(ast.Send node, Element element) {
+ Selector selector = elements.getSelector(node);
+ push(buildInvokeSuper(selector, element, const <HInstruction>[]));
+ }
+
+ /// Invoke .call on the value retrieved from the super [element].
+ void handleSuperCallInvoke(ast.Send node, Element element) {
+ Selector selector = elements.getSelector(node);
+ HInstruction target =
+ buildInvokeSuper(selector, element, const <HInstruction>[]);
+ add(target);
+ generateCallInvoke(node, target);
+ }
+
+ /// Invoke super [method].
+ void handleSuperMethodInvoke(
+ ast.Send node,
+ MethodElement method) {
+ generateSuperInvoke(node, method);
+ }
+
+ /// Access an unresolved super property.
+ void handleUnresolvedSuperInvoke(ast.Send node) {
+ Selector selector = elements.getSelector(node);
+ List<HInstruction> arguments = <HInstruction>[];
+ if (!node.isPropertyAccess) {
+ addGenericSendArgumentsToList(node.arguments, arguments);
+ }
+ generateSuperNoSuchMethodSend(node, selector, arguments);
+ }
+
+ /// Handle super constructor invocation.
+ @override
+ void handleSuperConstructorInvoke(ast.Send node) {
Selector selector = elements.getSelector(node);
Element element = elements[node];
- if (Elements.isUnresolved(element)) {
- List<HInstruction> arguments = <HInstruction>[];
- if (!node.isPropertyAccess) {
- addGenericSendArgumentsToList(node.arguments, arguments);
- }
- return generateSuperNoSuchMethodSend(node, selector, arguments);
- }
- List<HInstruction> inputs = <HInstruction>[];
- if (node.isPropertyAccess) {
- push(buildInvokeSuper(selector, element, inputs));
- } else if (element.isFunction || element.isGenerativeConstructor) {
- if (selector.applies(element, compiler.world)) {
- // TODO(5347): Try to avoid the need for calling [implementation] before
- // calling [makeStaticArgumentList].
- FunctionElement function = element.implementation;
- assert(selector.applies(function, compiler.world));
- inputs = makeStaticArgumentList(selector.callStructure,
- node.arguments,
- function);
- push(buildInvokeSuper(selector, element, inputs));
- } else if (element.isGenerativeConstructor) {
- generateWrongArgumentCountError(node, element, node.arguments);
- } else {
- addGenericSendArgumentsToList(node.arguments, inputs);
- generateSuperNoSuchMethodSend(node, selector, inputs);
- }
+ if (selector.applies(element, compiler.world)) {
+ generateSuperInvoke(node, element);
} else {
- HInstruction target = buildInvokeSuper(selector, element, inputs);
- add(target);
- inputs = <HInstruction>[target];
- addDynamicSendArgumentsToList(node, inputs);
- Selector closureSelector = new Selector.callClosureFrom(selector);
- push(new HInvokeClosure(closureSelector, inputs, backend.dynamicType));
+ generateWrongArgumentCountError(node, element, node.arguments);
}
}
+ @override
+ void visitUnresolvedSuperIndex(
+ ast.Send node,
+ Element element,
+ ast.Node index,
+ _) {
+ handleUnresolvedSuperInvoke(node);
+ }
+
+ @override
+ void visitUnresolvedSuperUnary(
+ ast.Send node,
+ UnaryOperator operator,
+ Element element,
+ _) {
+ handleUnresolvedSuperInvoke(node);
+ }
+
+ @override
+ void visitUnresolvedSuperBinary(
+ ast.Send node,
+ Element element,
+ BinaryOperator operator,
+ ast.Node argument,
+ _) {
+ handleUnresolvedSuperInvoke(node);
+ }
+
+ @override
+ void visitUnresolvedSuperGet(
+ ast.Send node,
+ Element element,
+ _) {
+ handleUnresolvedSuperInvoke(node);
+ }
+
+ @override
+ void visitUnresolvedSuperInvoke(
+ ast.Send node,
+ Element element,
+ ast.Node argument,
+ Selector selector,
+ _) {
+ handleUnresolvedSuperInvoke(node);
+ }
+
+ @override
+ void visitSuperFieldGet(
+ ast.Send node,
+ FieldElement field,
+ _) {
+ handleSuperGet(node, field);
+ }
+
+ @override
+ void visitSuperGetterGet(
+ ast.Send node,
+ MethodElement method,
+ _) {
+ handleSuperGet(node, method);
+ }
+
+ @override
+ void visitSuperMethodGet(
+ ast.Send node,
+ MethodElement method,
+ _) {
+ handleSuperGet(node, method);
+ }
+
+ @override
+ void visitSuperFieldInvoke(
+ ast.Send node,
+ FieldElement field,
+ ast.NodeList arguments,
+ CallStructure callStructure,
+ _) {
+ handleSuperCallInvoke(node, field);
+ }
+
+ @override
+ void visitSuperGetterInvoke(
+ ast.Send node,
+ MethodElement getter,
+ ast.NodeList arguments,
+ CallStructure callStructure,
+ _) {
+ handleSuperCallInvoke(node, getter);
+ }
+
+ @override
+ void visitSuperMethodInvoke(
+ ast.Send node,
+ MethodElement method,
+ ast.NodeList arguments,
+ CallStructure callStructure,
+ _) {
+ handleSuperMethodInvoke(node, method);
+ }
+
+ @override
+ void visitSuperIndex(
+ ast.Send node,
+ MethodElement method,
+ ast.Node index,
+ _) {
+ handleSuperMethodInvoke(node, method);
+ }
+
+ @override
+ void visitSuperEquals(
+ ast.Send node,
+ MethodElement method,
+ ast.Node argument,
+ _) {
+ handleSuperMethodInvoke(node, method);
+ }
+
+ @override
+ void visitSuperBinary(
+ ast.Send node,
+ MethodElement method,
+ BinaryOperator operator,
+ ast.Node argument,
+ _) {
+ handleSuperMethodInvoke(node, method);
+ }
+
+ @override
+ void visitSuperUnary(
+ ast.Send node,
+ UnaryOperator operator,
+ MethodElement method,
+ _) {
+ handleSuperMethodInvoke(node, method);
+ }
+
+ @override
+ void visitSuperMethodIncompatibleInvoke(
+ ast.Send node,
+ MethodElement method,
+ ast.NodeList arguments,
+ CallStructure callStructure,
+ _) {
+ Selector selector = elements.getSelector(node);
+ List<HInstruction> inputs = <HInstruction>[];
+ addGenericSendArgumentsToList(arguments.nodes, inputs);
+ generateSuperNoSuchMethodSend(node, selector, inputs);
+ }
+
bool needsSubstitutionForTypeVariableAccess(ClassElement cls) {
ClassWorld classWorld = compiler.world;
if (classWorld.isUsedAsMixin(cls)) return true;
@@ -4254,7 +4587,8 @@
});
js.Template code = js.js.uncachedExpressionTemplate(template);
- HInstruction result = createForeign(code, backend.stringType, inputs);
+ HInstruction result = new HForeignCode(code, backend.stringType, inputs,
+ nativeBehavior: native.NativeBehavior.PURE);
add(result);
return result;
}
@@ -4421,17 +4755,19 @@
var constant = inputs[0];
if (constant.constant.primitiveValue >= 0) canThrow = false;
}
- HForeignCode foreign = new HForeignCode(
- code, elementType, inputs, nativeBehavior: behavior,
- canThrow: canThrow);
+ HForeignCode foreign = new HForeignCode(code, elementType, inputs,
+ nativeBehavior: behavior,
+ throwBehavior: canThrow
+ ? native.NativeThrowBehavior.MAY
+ : native.NativeThrowBehavior.NEVER);
push(foreign);
TypesInferrer inferrer = compiler.typesTask.typesInferrer;
if (inferrer.isFixedArrayCheckedForGrowable(send)) {
js.Template code = js.js.parseForeignJS(r'#.fixed$length = Array');
// We set the instruction as [canThrow] to avoid it being dead code.
// We need a finer grained side effect.
- add(new HForeignCode(
- code, backend.nullType, [stack.last], canThrow: true));
+ add(new HForeignCode(code, backend.nullType, [stack.last],
+ throwBehavior: native.NativeThrowBehavior.MAY));
}
} else if (isGrowableListConstructorCall) {
push(buildLiteralList(<HInstruction>[]));
@@ -4544,125 +4880,289 @@
return false;
}
- visitAssertSend(node) {
+ @override
+ visitAssert(ast.Send node, ast.Node expression, _) {
if (!compiler.enableUserAssertions) {
stack.add(graph.addConstantNull(compiler));
return;
}
- // TODO(johnniwinther): Don't handle assert like a regular static call.
- // It breaks the selector name check since the assert helper method cannot
- // be called `assert` and therefore does not match the selector like a
- // regular method.
- visitStaticSend(node);
+ assert(invariant(node, node.arguments.tail.isEmpty,
+ message: "Invalid assertion: $node"));
+ generateStaticFunctionInvoke(
+ node, backend.assertMethod, CallStructure.ONE_ARG);
}
visitStaticSend(ast.Send node) {
- CallStructure callStructure = elements.getSelector(node).callStructure;
- Element element = elements[node];
- if (elements.isAssert(node)) {
- element = backend.assertMethod;
- }
- if (element.isForeign(backend) && element.isFunction) {
- visitForeignSend(node);
- return;
- }
- if (element.isErroneous) {
- if (element is ErroneousElement) {
- // An erroneous element indicates that the funciton could not be
- // resolved (a warning has been issued).
- generateThrowNoSuchMethod(node,
- noSuchMethodTargetSymbolString(element),
- argumentNodes: node.arguments);
- } else {
- // TODO(ahe): Do something like [generateWrongArgumentCountError].
- stack.add(graph.addConstantNull(compiler));
- }
- return;
- }
- invariant(element, !element.isGenerativeConstructor);
+ internalError(node, "Unexpected visitStaticSend");
+ }
+
+ /// Generate an invocation to the static or top level [function].
+ void generateStaticFunctionInvoke(
+ ast.Send node,
+ FunctionElement function,
+ CallStructure callStructure) {
generateIsDeferredLoadedCheckIfNeeded(node);
- if (element.isFunction) {
- // TODO(5347): Try to avoid the need for calling [implementation] before
- // calling [makeStaticArgumentList].
- if (!callStructure.signatureApplies(element.implementation)) {
- generateWrongArgumentCountError(node, element, node.arguments);
- return;
- }
- List<HInstruction> inputs =
- makeStaticArgumentList(callStructure,
- node.arguments,
- element.implementation);
+ List<HInstruction> inputs = makeStaticArgumentList(
+ callStructure,
+ node.arguments,
+ function.implementation);
- if (element == compiler.identicalFunction) {
- pushWithPosition(
- new HIdentity(inputs[0], inputs[1], null, backend.boolType), node);
- return;
- }
-
- pushInvokeStatic(node, element, inputs);
- } else {
- generateGetter(node, element);
- List<HInstruction> inputs = <HInstruction>[pop()];
- addDynamicSendArgumentsToList(node, inputs);
- Selector closureSelector = callStructure.callSelector;
+ if (function == compiler.identicalFunction) {
pushWithPosition(
- new HInvokeClosure(closureSelector, inputs, backend.dynamicType),
- node);
+ new HIdentity(inputs[0], inputs[1], null, backend.boolType), node);
+ return;
+ } else {
+ pushInvokeStatic(node, function, inputs);
}
}
+ /// Generate an invocation to a static or top level function with the wrong
+ /// number of arguments.
+ void generateStaticFunctionIncompatibleInvoke(ast.Send node,
+ Element element) {
+ generateWrongArgumentCountError(node, element, node.arguments);
+ }
+
+ @override
+ void visitStaticFieldInvoke(
+ ast.Send node,
+ FieldElement field,
+ ast.NodeList arguments,
+ CallStructure callStructure,
+ _) {
+ generateStaticFieldGet(node, field);
+ generateCallInvoke(node, pop());
+ }
+
+ @override
+ void visitStaticFunctionInvoke(
+ ast.Send node,
+ MethodElement function,
+ ast.NodeList arguments,
+ CallStructure callStructure,
+ _) {
+ generateStaticFunctionInvoke(node, function, callStructure);
+ }
+
+ @override
+ void visitStaticFunctionIncompatibleInvoke(
+ ast.Send node,
+ MethodElement function,
+ ast.NodeList arguments,
+ CallStructure callStructure,
+ _) {
+ generateStaticFunctionIncompatibleInvoke(node, function);
+ }
+
+ @override
+ void visitStaticGetterInvoke(
+ ast.Send node,
+ FunctionElement getter,
+ ast.NodeList arguments,
+ CallStructure callStructure,
+ _) {
+ generateStaticGetterGet(node, getter);
+ generateCallInvoke(node, pop());
+ }
+
+ @override
+ void visitTopLevelFieldInvoke(
+ ast.Send node,
+ FieldElement field,
+ ast.NodeList arguments,
+ CallStructure callStructure,
+ _) {
+ generateStaticFieldGet(node, field);
+ generateCallInvoke(node, pop());
+ }
+
+ @override
+ void visitTopLevelFunctionInvoke(
+ ast.Send node,
+ MethodElement function,
+ ast.NodeList arguments,
+ CallStructure callStructure,
+ _) {
+ if (function.isForeign(backend)) {
+ handleForeignSend(node, function);
+ } else {
+ generateStaticFunctionInvoke(node, function, callStructure);
+ }
+ }
+
+ @override
+ void visitTopLevelFunctionIncompatibleInvoke(
+ ast.Send node,
+ MethodElement function,
+ ast.NodeList arguments,
+ CallStructure callStructure,
+ _) {
+ generateStaticFunctionIncompatibleInvoke(node, function);
+ }
+
+ @override
+ void visitTopLevelGetterInvoke(
+ ast.Send node,
+ FunctionElement getter,
+ ast.NodeList arguments,
+ CallStructure callStructure,
+ _) {
+ generateStaticGetterGet(node, getter);
+ generateCallInvoke(node, pop());
+ }
+
+ @override
+ void visitUnresolvedGet(
+ ast.Send node,
+ Element element,
+ _) {
+ generateStaticUnresolvedGet(node, element);
+ }
+
+ @override
+ void visitUnresolvedInvoke(
+ ast.Send node,
+ Element element,
+ ast.NodeList arguments,
+ Selector selector,
+ _) {
+ if (element is ErroneousElement) {
+ // An erroneous element indicates that the funciton could not be
+ // resolved (a warning has been issued).
+ generateThrowNoSuchMethod(node,
+ noSuchMethodTargetSymbolString(element),
+ argumentNodes: node.arguments);
+ } else {
+ // TODO(ahe): Do something like [generateWrongArgumentCountError].
+ stack.add(graph.addConstantNull(compiler));
+ }
+ return;
+ }
+
HConstant addConstantString(String string) {
ast.DartString dartString = new ast.DartString.literal(string);
ConstantValue constant = constantSystem.createString(dartString);
return graph.addConstant(constant, compiler);
}
- visitTypePrefixSend(ast.Send node) {
- compiler.internalError(node, "visitTypePrefixSend should not be called.");
+ visitClassTypeLiteralGet(
+ ast.Send node,
+ ConstantExpression constant,
+ _) {
+ generateConstantTypeLiteral(node);
}
- visitTypeLiteralSend(ast.Send node) {
- DartType type = elements.getTypeLiteralType(node);
- if (type.isInterfaceType || type.isTypedef || type.isDynamic) {
- // TODO(karlklose): add type representation
- if (node.isCall) {
- // The node itself is not a constant but we register the selector (the
- // identifier that refers to the class/typedef) as a constant.
- stack.add(addConstant(node.selector));
- } else {
- stack.add(addConstant(node));
- }
- } else if (type.isTypeVariable) {
- type = localsHandler.substInContext(type);
- HInstruction value = analyzeTypeArgument(type);
- pushInvokeStatic(node,
- backend.getRuntimeTypeToString(),
- [value],
- backend.stringType);
- pushInvokeStatic(node,
- backend.getCreateRuntimeType(),
- [pop()]);
- } else {
- internalError(node, 'unexpected type kind ${type.kind}');
- }
+ visitClassTypeLiteralInvoke(
+ ast.Send node,
+ ConstantExpression constant,
+ ast.NodeList arguments,
+ CallStructure callStructure,
+ _) {
+ generateConstantTypeLiteral(node);
+ generateTypeLiteralCall(node);
+ }
+
+ visitTypedefTypeLiteralGet(
+ ast.Send node,
+ ConstantExpression constant,
+ _) {
+ generateConstantTypeLiteral(node);
+ }
+
+ visitTypedefTypeLiteralInvoke(
+ ast.Send node,
+ ConstantExpression constant,
+ ast.NodeList arguments,
+ CallStructure callStructure,
+ _) {
+ generateConstantTypeLiteral(node);
+ generateTypeLiteralCall(node);
+ }
+
+ visitTypeVariableTypeLiteralGet(
+ ast.Send node,
+ TypeVariableElement element,
+ _) {
+ generateTypeVariableLiteral(node, element.type);
+ }
+
+ visitTypeVariableTypeLiteralInvoke(
+ ast.Send node,
+ TypeVariableElement element,
+ ast.NodeList arguments,
+ CallStructure callStructure,
+ _) {
+ generateTypeVariableLiteral(node, element.type);
+ generateTypeLiteralCall(node);
+ }
+
+ visitDynamicTypeLiteralGet(
+ ast.Send node,
+ ConstantExpression constant,
+ _) {
+ generateConstantTypeLiteral(node);
+ }
+
+ visitDynamicTypeLiteralInvoke(
+ ast.Send node,
+ ConstantExpression constant,
+ ast.NodeList arguments,
+ CallStructure callStructure,
+ _) {
+ generateConstantTypeLiteral(node);
+ generateTypeLiteralCall(node);
+ }
+
+ /// Generate the constant value for a constant type literal.
+ void generateConstantTypeLiteral(ast.Send node) {
+ generateIsDeferredLoadedCheckIfNeeded(node);
+ // TODO(karlklose): add type representation
if (node.isCall) {
- // This send is of the form 'e(...)', where e is resolved to a type
- // reference. We create a regular closure call on the result of the type
- // reference instead of creating a NoSuchMethodError to avoid pulling it
- // in if it is not used (e.g., in a try/catch).
- HInstruction target = pop();
- Selector selector = elements.getSelector(node);
- List<HInstruction> inputs = <HInstruction>[target];
- addDynamicSendArgumentsToList(node, inputs);
- Selector closureSelector = new Selector.callClosureFrom(selector);
- push(new HInvokeClosure(closureSelector, inputs, backend.dynamicType));
+ // The node itself is not a constant but we register the selector (the
+ // identifier that refers to the class/typedef) as a constant.
+ stack.add(addConstant(node.selector));
+ } else {
+ stack.add(addConstant(node));
}
}
+ /// Generate the literal for [typeVariable] in the current context.
+ void generateTypeVariableLiteral(ast.Send node,
+ TypeVariableType typeVariable) {
+ DartType type = localsHandler.substInContext(typeVariable);
+ HInstruction value = analyzeTypeArgument(type);
+ pushInvokeStatic(node,
+ backend.getRuntimeTypeToString(),
+ [value],
+ backend.stringType);
+ pushInvokeStatic(node,
+ backend.getCreateRuntimeType(),
+ [pop()]);
+ }
+
+ /// Generate a call to a type literal.
+ void generateTypeLiteralCall(ast.Send node) {
+ // This send is of the form 'e(...)', where e is resolved to a type
+ // reference. We create a regular closure call on the result of the type
+ // reference instead of creating a NoSuchMethodError to avoid pulling it
+ // in if it is not used (e.g., in a try/catch).
+ HInstruction target = pop();
+ generateCallInvoke(node, target);
+ }
+
+ /// Generate a '.call' invocation on [target].
+ void generateCallInvoke(ast.Send node, HInstruction target) {
+ Selector selector = elements.getSelector(node);
+ List<HInstruction> inputs = <HInstruction>[target];
+ addDynamicSendArgumentsToList(node, inputs);
+ Selector closureSelector = new Selector.callClosureFrom(selector);
+ pushWithPosition(
+ new HInvokeClosure(closureSelector, inputs, backend.dynamicType), node);
+ }
+
visitGetterSend(ast.Send node) {
- generateIsDeferredLoadedCheckIfNeeded(node);
- generateGetter(node, elements[node]);
+ internalError(node, "Unexpected visitGetterSend");
}
// TODO(antonm): migrate rest of SsaFromAstMixin to internalError.
@@ -4748,7 +5248,8 @@
existingArguments: existingArguments);
}
- visitNewExpression(ast.NewExpression node) {
+ @override
+ handleNewExpression(ast.NewExpression node) {
Element element = elements[node.send];
final bool isSymbolConstructor = element == compiler.symbolConstructor;
if (!Elements.isErroneous(element)) {
@@ -4775,7 +5276,7 @@
stack.add(addConstant(node));
if (isSymbolConstructor) {
ConstructedConstantValue symbol = getConstantForNode(node);
- StringConstantValue stringConstant = symbol.fields.single;
+ StringConstantValue stringConstant = symbol.fields.values.single;
String nameString = stringConstant.toDartString().slowToString();
registry.registerConstSymbol(nameString);
}
@@ -4931,11 +5432,14 @@
assert(arguments.tail.isEmpty);
rhs = pop();
}
- visitBinarySend(receiver, node.assignmentOperator, rhs,
- elements.getOperatorSelectorInComplexSendSet(node), node);
+ visitBinarySend(receiver, rhs,
+ elements.getOperatorSelectorInComplexSendSet(node),
+ node,
+ location: node.assignmentOperator);
}
- visitSendSet(ast.SendSet node) {
+ @override
+ handleSendSet(ast.SendSet node) {
generateIsDeferredLoadedCheckIfNeeded(node);
Element element = elements[node];
if (!Elements.isUnresolved(element) && element.impliesType) {
@@ -5001,7 +5505,7 @@
stack.add(result);
} else if (node.isIndex) {
if ("=" == op.source) {
- visitDynamicSend(node);
+ generateDynamicSend(node);
} else {
visit(node.receiver);
HInstruction receiver = pop();
@@ -5062,8 +5566,18 @@
receiver = generateInstanceSendReceiver(node);
generateInstanceGetterWithCompiledReceiver(
node, elements.getGetterSelectorInComplexSendSet(node), receiver);
+ } else if (getter.isErroneous) {
+ generateStaticUnresolvedGet(node, getter);
+ } else if (getter.isField) {
+ generateStaticFieldGet(node, getter);
+ } else if (getter.isGetter) {
+ generateStaticGetterGet(node, getter);
+ } else if (getter.isFunction) {
+ generateStaticFunctionGet(node, getter);
+ } else if (getter.isLocal) {
+ handleLocalGet(getter);
} else {
- generateGetter(node, getter);
+ internalError(node, "Unexpected getter: $getter");
}
HInstruction getterInstruction = pop();
handleComplexOperatorSend(node, getterInstruction, node.arguments);
@@ -5491,15 +6005,37 @@
}
visitSyncForIn(ast.SyncForIn node) {
+ // The 'get iterator' selector for this node has the inferred receiver type.
+ // If the receiver supports JavaScript indexing we generate an indexing loop
+ // instead of allocating an iterator object.
+
+ // This scheme recognizes for-in on direct lists. It does not recognize all
+ // uses of ArrayIterator. They still occur when the receiver is an Iterable
+ // with a `get iterator` method that delegate to another Iterable and the
+ // method is inlined. We would require full scalar replacement in that
+ // case.
+
+ Selector selector = elements.getIteratorSelector(node);
+ TypeMask mask = selector.mask;
+
+ ClassWorld classWorld = compiler.world;
+ if (mask != null && mask.satisfies(backend.jsIndexableClass, classWorld)) {
+ return buildSyncForInIndexable(node, mask);
+ }
+ buildSyncForInIterator(node);
+ }
+
+ buildSyncForInIterator(ast.SyncForIn node) {
// Generate a structure equivalent to:
// Iterator<E> $iter = <iterable>.iterator;
// while ($iter.moveNext()) {
- // E <declaredIdentifier> = $iter.current;
+ // <declaredIdentifier> = $iter.current;
// <body>
// }
// The iterator is shared between initializer, condition and body.
HInstruction iterator;
+
void buildInitializer() {
Selector selector = elements.getIteratorSelector(node);
visit(node.expression);
@@ -5507,40 +6043,147 @@
pushInvokeDynamic(node, selector, [receiver]);
iterator = pop();
}
+
HInstruction buildCondition() {
Selector selector = elements.getMoveNextSelector(node);
pushInvokeDynamic(node, selector, [iterator]);
return popBoolified();
}
+
void buildBody() {
Selector call = elements.getCurrentSelector(node);
pushInvokeDynamic(node, call, [iterator]);
-
- ast.Node identifier = node.declaredIdentifier;
- Element variable = elements.getForInVariable(node);
- Selector selector = elements.getSelector(identifier);
-
- HInstruction value = pop();
- if (identifier.asSend() != null
- && Elements.isInstanceSend(identifier, elements)) {
- HInstruction receiver = generateInstanceSendReceiver(identifier);
- assert(receiver != null);
- generateInstanceSetterWithCompiledReceiver(
- null,
- receiver,
- value,
- selector: selector,
- location: identifier);
- } else {
- generateNonInstanceSetter(null, variable, value, location: identifier);
- }
- pop(); // Pop the value pushed by the setter call.
-
+ buildAssignLoopVariable(node, pop());
visit(node.body);
}
+
handleLoop(node, buildInitializer, buildCondition, () {}, buildBody);
}
+ buildAssignLoopVariable(ast.ForIn node, HInstruction value) {
+ ast.Node identifier = node.declaredIdentifier;
+ Element variable = elements.getForInVariable(node);
+ Selector selector = elements.getSelector(identifier);
+
+ if (identifier.asSend() != null &&
+ Elements.isInstanceSend(identifier, elements)) {
+ HInstruction receiver = generateInstanceSendReceiver(identifier);
+ assert(receiver != null);
+ generateInstanceSetterWithCompiledReceiver(
+ null,
+ receiver,
+ value,
+ selector: selector,
+ location: identifier);
+ } else {
+ generateNonInstanceSetter(null, variable, value, location: identifier);
+ }
+ pop(); // Discard the value pushed by the setter call.
+ }
+
+ buildSyncForInIndexable(ast.ForIn node, TypeMask arrayType) {
+ // Generate a structure equivalent to:
+ //
+ // int end = a.length;
+ // for (int i = 0;
+ // i < a.length;
+ // checkConcurrentModificationError(a.length == end, a), ++i) {
+ // <declaredIdentifier> = a[i];
+ // <body>
+ // }
+ Element loopVariable = elements.getForInVariable(node);
+ SyntheticLocal indexVariable = new SyntheticLocal('_i', loopVariable);
+ TypeMask boolType = backend.boolType;
+
+ // These variables are shared by initializer, condition, body and update.
+ HInstruction array; // Set in buildInitializer.
+ bool isFixed; // Set in buildInitializer.
+ HInstruction originalLength = null; // Set for growable lists.
+
+ HInstruction buildGetLength() {
+ Element lengthElement = backend.jsIndexableLength;
+ HFieldGet result = new HFieldGet(
+ lengthElement, array, backend.positiveIntType,
+ isAssignable: !isFixed);
+ add(result);
+ return result;
+ }
+
+ void buildConcurrentModificationErrorCheck() {
+ if (originalLength == null) return;
+ // The static call checkConcurrentModificationError() is expanded in
+ // codegen to:
+ //
+ // array.length == _end || throwConcurrentModificationError(array)
+ //
+ HInstruction length = buildGetLength();
+ push(new HIdentity(length, originalLength, null, boolType));
+ pushInvokeStatic(node,
+ backend.getCheckConcurrentModificationError(),
+ [pop(), array]);
+ pop();
+ }
+
+ void buildInitializer() {
+ visit(node.expression);
+ array = pop();
+ isFixed = isFixedLength(array.instructionType, compiler);
+ localsHandler.updateLocal(indexVariable,
+ graph.addConstantInt(0, compiler));
+ originalLength = buildGetLength();
+ }
+
+ HInstruction buildCondition() {
+ HInstruction index = localsHandler.readLocal(indexVariable);
+ HInstruction length = buildGetLength();
+ HInstruction compare = new HLess(index, length, null, boolType);
+ add(compare);
+ return compare;
+ }
+
+ void buildBody() {
+ // If we had mechanically inlined ArrayIterator.moveNext(), it would have
+ // inserted the ConcurrentModificationError check as part of the
+ // condition. It is not necessary on the first iteration since there is
+ // no code between calls to `get iterator` and `moveNext`, so the test is
+ // moved to the loop update.
+
+ // Find a type for the element. Use the element type of the indexer of the
+ // array, as this is stronger than the iterator's `get current` type, for
+ // example, `get current` includes null.
+ // TODO(sra): The element type of a container type mask might be better.
+ Selector selector = new Selector.index();
+ Selector refined = new TypedSelector(arrayType, selector, compiler.world);
+ TypeMask type =
+ TypeMaskFactory.inferredTypeForSelector(refined, compiler);
+
+ HInstruction index = localsHandler.readLocal(indexVariable);
+ HInstruction value = new HIndex(array, index, null, type);
+ add(value);
+
+ buildAssignLoopVariable(node, value);
+ visit(node.body);
+ }
+
+ void buildUpdate() {
+ // See buildBody as to why we check here.
+ buildConcurrentModificationErrorCheck();
+
+ // TODO(sra): It would be slightly shorter to generate `a[i++]` in the
+ // body (and that more closely follows what an inlined iterator would do)
+ // but the code is horrible as `i+1` is carried around the loop in an
+ // additional variable.
+ HInstruction index = localsHandler.readLocal(indexVariable);
+ HInstruction one = graph.addConstantInt(1, compiler);
+ HInstruction addInstruction =
+ new HAdd(index, one, null, backend.positiveIntType);
+ add(addInstruction);
+ localsHandler.updateLocal(indexVariable, addInstruction);
+ }
+
+ handleLoop(node, buildInitializer, buildCondition, buildUpdate, buildBody);
+ }
+
visitLabel(ast.Label node) {
compiler.internalError(node, 'SsaFromAstMixin.visitLabel.');
}
@@ -5601,7 +6244,7 @@
listInputs.add(pop());
}
- ConstructorElement constructor;
+ Element constructor;
List<HInstruction> inputs = <HInstruction>[];
if (listInputs.isEmpty) {
@@ -5626,12 +6269,30 @@
ClassElement cls = constructor.enclosingClass;
if (backend.classNeedsRti(cls)) {
+ List<HInstruction> typeInputs = <HInstruction>[];
List<DartType> typeVariable = cls.typeVariables;
expectedType.typeArguments.forEach((DartType argument) {
- inputs.add(analyzeTypeArgument(argument));
+ typeInputs.add(analyzeTypeArgument(argument));
});
+
+ // We lift this common call pattern into a helper function to save space
+ // in the output.
+ if (typeInputs.every((HInstruction input) => input.isNull())) {
+ if (listInputs.isEmpty) {
+ constructor = backend.mapLiteralUntypedEmptyMaker;
+ } else {
+ constructor = backend.mapLiteralUntypedMaker;
+ }
+ } else {
+ inputs.addAll(typeInputs);
+ }
}
+ // If rti is needed and the map literal has no type parameters,
+ // 'constructor' is a static function that forwards the call to the factory
+ // constructor without type parameters.
+ assert(constructor is ConstructorElement || constructor is FunctionElement);
+
// The instruction type will always be a subtype of the mapLiteralClass, but
// type inference might discover a more specific type, or find nothing (in
// dart2js unit tests).
@@ -5875,9 +6536,11 @@
// a test of the target.
void buildCondition() {
js.Template code = js.js.parseForeignJS('#');
- push(createForeign(code,
- backend.boolType,
- [localsHandler.readLocal(switchTarget)]));
+ push(new HForeignCode(
+ code,
+ backend.boolType,
+ [localsHandler.readLocal(switchTarget)],
+ nativeBehavior: native.NativeBehavior.PURE));
}
handleIf(node, buildCondition, buildLoop, () => {});
}
@@ -6862,9 +7525,7 @@
TypeBuilder(this.classWorld);
- void visitType(DartType type, _) {
- throw 'Internal error $type';
- }
+ void visit(DartType type, SsaBuilder builder) => type.accept(this, builder);
void visitVoidType(VoidType type, SsaBuilder builder) {
ClassElement cls = builder.backend.findHelper('VoidRuntimeType');
@@ -6924,10 +7585,6 @@
throw 'not implemented visitStatementType($type)';
}
- void visitGenericType(GenericType type, SsaBuilder builder) {
- throw 'not implemented visitGenericType($type)';
- }
-
void visitInterfaceType(InterfaceType type, SsaBuilder builder) {
List<HInstruction> inputs = <HInstruction>[];
for (DartType typeArgument in type.typeArguments) {
diff --git a/pkg/compiler/lib/src/ssa/codegen.dart b/pkg/compiler/lib/src/ssa/codegen.dart
index ea200c3..75bab2a 100644
--- a/pkg/compiler/lib/src/ssa/codegen.dart
+++ b/pkg/compiler/lib/src/ssa/codegen.dart
@@ -7,10 +7,13 @@
class SsaCodeGeneratorTask extends CompilerTask {
final JavaScriptBackend backend;
+ final SourceInformationFactory sourceInformationFactory;
- SsaCodeGeneratorTask(JavaScriptBackend backend)
+ SsaCodeGeneratorTask(JavaScriptBackend backend,
+ this.sourceInformationFactory)
: this.backend = backend,
super(backend.compiler);
+
String get name => 'SSA code generator';
NativeEmitter get nativeEmitter => backend.emitter.nativeEmitter;
@@ -31,8 +34,9 @@
? const js.AsyncModifier.syncStar()
: const js.AsyncModifier.sync());
- return attachPosition(
- new js.Fun(parameters, body, asyncModifier: asyncModifier), element);
+ return new js.Fun(parameters, body, asyncModifier: asyncModifier)
+ .withSourceInformation(sourceInformationFactory.forContext(element)
+ .buildDeclaration(element));
}
js.Expression generateCode(CodegenWorkItem work, HGraph graph) {
@@ -46,10 +50,13 @@
js.Expression generateLazyInitializer(work, graph) {
return measure(() {
compiler.tracer.traceGraph("codegen", graph);
+ SourceInformation sourceInformation =
+ sourceInformationFactory.forContext(work.element)
+ .buildDeclaration(work.element);
SsaCodeGenerator codegen = new SsaCodeGenerator(backend, work);
codegen.visitGraph(graph);
- return new js.Fun(codegen.parameters,
- attachPosition(codegen.body, work.element));
+ return new js.Fun(codegen.parameters, codegen.body)
+ .withSourceInformation(sourceInformation);
});
}
@@ -135,7 +142,8 @@
// if branches.
SubGraph subGraph;
- SsaCodeGenerator(this.backend, CodegenWorkItem work)
+ SsaCodeGenerator(this.backend, CodegenWorkItem work,
+ {SourceInformation sourceInformation})
: this.work = work,
declaredLocals = new Set<String>(),
collectedVariableDeclarations = new Set<String>(),
@@ -1624,16 +1632,42 @@
Element element = node.element;
List<DartType> instantiatedTypes = node.instantiatedTypes;
- registry.registerStaticInvocation(element);
-
if (instantiatedTypes != null && !instantiatedTypes.isEmpty) {
instantiatedTypes.forEach((type) {
registry.registerInstantiatedType(type);
});
}
- push(backend.emitter.staticFunctionAccess(node.element));
- push(new js.Call(pop(), visitArguments(node.inputs, start: 0)), node);
+ List<js.Expression> arguments = visitArguments(node.inputs, start: 0);
+
+ if (element == backend.getCheckConcurrentModificationError()) {
+ // Manually inline the [checkConcurrentModificationError] function. This
+ // function is only called from a for-loop update. Ideally we would just
+ // generate the conditionalcontrol flow in the builder but it adds basic
+ // blocks in the loop update that interfere with other optimizations and
+ // confuses loop recognition.
+
+ assert(arguments.length == 2);
+ Element throwFunction = backend.getThrowConcurrentModificationError();
+ registry.registerStaticInvocation(throwFunction);
+
+ // Calling using `(0, #)(#)` instead of `#(#)` separates the property load
+ // of the static function access from the call. For some reason this
+ // helps V8 see that the call never happens so V8 makes the call a
+ // deoptimization. This removes the call from the optimized loop, making
+ // more optimizations available to the loop. This form is 50% faster on
+ // some small loop, almost as fast as loops with no concurrent
+ // modification check.
+ push(js.js('# || (0, #)(#)',[
+ arguments[0],
+ backend.emitter.staticFunctionAccess(throwFunction),
+ arguments[1]]));
+ } else {
+ registry.registerStaticInvocation(element);
+ push(backend.emitter.staticFunctionAccess(element));
+ push(new js.Call(pop(), arguments), node);
+ }
+
}
visitInvokeSuper(HInvokeSuper node) {
@@ -1782,6 +1816,12 @@
List<js.Expression> arguments = visitArguments(node.inputs, start: 0);
push(new js.New(jsClassReference, arguments), node);
registerForeignTypes(node);
+ // We also use ForeignNew to instantiate closure classes that belong to
+ // function expressions. We have to register their use here, as otherwise
+ // code for them might not be emitted.
+ if (node.element.isClosure) {
+ registry.registerInstantiatedClass(node.element);
+ }
if (node.instantiatedTypes == null) {
return;
}
diff --git a/pkg/compiler/lib/src/ssa/codegen_helpers.dart b/pkg/compiler/lib/src/ssa/codegen_helpers.dart
index 531f323..e6bf13d 100644
--- a/pkg/compiler/lib/src/ssa/codegen_helpers.dart
+++ b/pkg/compiler/lib/src/ssa/codegen_helpers.dart
@@ -614,7 +614,9 @@
bool hasAnyStatement(HBasicBlock block, HInstruction instruction) {
// If [instruction] is not in [block], then if the block is not
// empty, we know there will be a statement to emit.
- if (!identical(instruction.block, block)) return !identical(block.last, block.first);
+ if (!identical(instruction.block, block)) {
+ return !identical(block.last, block.first);
+ }
// If [instruction] is not the last instruction of the block
// before the control flow instruction, or the last instruction,
diff --git a/pkg/compiler/lib/src/ssa/nodes.dart b/pkg/compiler/lib/src/ssa/nodes.dart
index e5a6c70..e642ede 100644
--- a/pkg/compiler/lib/src/ssa/nodes.dart
+++ b/pkg/compiler/lib/src/ssa/nodes.dart
@@ -188,6 +188,8 @@
HConstant addDeferredConstant(ConstantValue constant, PrefixElement prefix,
Compiler compiler) {
+ // TODO(sigurdm,johnniwinter): These deferred constants should be created
+ // by the constant evaluator.
ConstantValue wrapper = new DeferredConstantValue(constant, prefix);
compiler.deferredLoadTask.registerConstantDeferredUse(wrapper, prefix);
return addConstant(wrapper, compiler);
@@ -842,6 +844,11 @@
&& !canThrow();
}
+ /// An instruction is an 'allocation' is it is the sole alias for an object.
+ /// This applies to to instructions that allocate new objects and can be
+ /// extended to methods that return other allocations without escaping them.
+ bool get isAllocation => false;
+
/// Overridden by [HCheck] to return the actual non-[HCheck]
/// instruction it checks against.
HInstruction nonCheck() => this;
@@ -1713,37 +1720,52 @@
class HForeignCode extends HForeign {
final js.Template codeTemplate;
final bool isStatement;
- final bool _canThrow;
final native.NativeBehavior nativeBehavior;
+ native.NativeThrowBehavior throwBehavior;
HForeignCode(this.codeTemplate,
- TypeMask type,
- List<HInstruction> inputs,
- {this.isStatement: false,
- SideEffects effects,
- native.NativeBehavior nativeBehavior,
- canThrow: false})
+ TypeMask type,
+ List<HInstruction> inputs,
+ {this.isStatement: false,
+ SideEffects effects,
+ native.NativeBehavior nativeBehavior,
+ native.NativeThrowBehavior throwBehavior})
: this.nativeBehavior = nativeBehavior,
- this._canThrow = canThrow,
+ this.throwBehavior = throwBehavior,
super(type, inputs) {
- if(codeTemplate == null) throw this;
+ assert(codeTemplate != null);
if (effects == null && nativeBehavior != null) {
effects = nativeBehavior.sideEffects;
}
+ if (this.throwBehavior == null) {
+ this.throwBehavior = (nativeBehavior == null)
+ ? native.NativeThrowBehavior.MAY
+ : nativeBehavior.throwBehavior;
+ }
+ assert(this.throwBehavior != null);
+
if (effects != null) sideEffects.add(effects);
}
- HForeignCode.statement(codeTemplate, List<HInstruction> inputs,
- SideEffects effects,
- native.NativeBehavior nativeBehavior,
- TypeMask type)
+ HForeignCode.statement(js.Template codeTemplate, List<HInstruction> inputs,
+ SideEffects effects,
+ native.NativeBehavior nativeBehavior,
+ TypeMask type)
: this(codeTemplate, type, inputs, isStatement: true,
effects: effects, nativeBehavior: nativeBehavior);
accept(HVisitor visitor) => visitor.visitForeignCode(this);
bool isJsStatement() => isStatement;
- bool canThrow() => _canThrow || super.canThrow();
+ bool canThrow() => canBeNull()
+ ? throwBehavior.canThrow
+ : throwBehavior.onNonNull.canThrow;
+
+ bool onlyThrowsNSM() => throwBehavior.isOnlyNullNSMGuard;
+
+ bool get isAllocation => nativeBehavior != null &&
+ nativeBehavior.isAllocation &&
+ !canBeNull();
}
class HForeignNew extends HForeign {
@@ -1760,6 +1782,8 @@
: super(type, inputs);
accept(HVisitor visitor) => visitor.visitForeignNew(this);
+
+ bool get isAllocation => true;
}
abstract class HInvokeBinary extends HInstruction {
@@ -2165,7 +2189,7 @@
input.usedBy.add(this);
}
- toString() => 'phi';
+ toString() => 'phi $id';
accept(HVisitor visitor) => visitor.visitPhi(this);
}
@@ -2404,6 +2428,8 @@
HLiteralList(List<HInstruction> inputs, TypeMask type) : super(inputs, type);
toString() => 'literal list';
accept(HVisitor visitor) => visitor.visitLiteralList(this);
+
+ bool get isAllocation => true;
}
/**
diff --git a/pkg/compiler/lib/src/ssa/optimize.dart b/pkg/compiler/lib/src/ssa/optimize.dart
index 0692383..752019a 100644
--- a/pkg/compiler/lib/src/ssa/optimize.dart
+++ b/pkg/compiler/lib/src/ssa/optimize.dart
@@ -55,6 +55,7 @@
new SsaTypePropagator(compiler),
new SsaCodeMotion(),
new SsaLoadElimination(compiler),
+ new SsaRedundantPhiEliminator(),
new SsaDeadPhiEliminator(),
new SsaTypePropagator(compiler),
new SsaValueRangeAnalyzer(compiler, constantSystem, this, work),
@@ -197,6 +198,14 @@
assert(inputs.length == 1);
HInstruction input = inputs[0];
if (input.isBoolean(compiler)) return input;
+
+ // If the code is unreachable, remove the HBoolify. This can happen when
+ // there is a throw expression in a short-circuit conditional. Removing the
+ // unreachable HBoolify makes it easier to reconstruct the short-circuit
+ // operation.
+ if (input.instructionType.isEmpty && !input.instructionType.isNullable)
+ return input;
+
// All values that cannot be 'true' are boolified to false.
TypeMask mask = input.instructionType;
if (!mask.contains(backend.jsBoolClass, compiler.world)) {
@@ -513,35 +522,46 @@
TypeMask leftType = left.instructionType;
TypeMask rightType = right.instructionType;
+ HInstruction makeTrue() => graph.addConstantBool(true, compiler);
+ HInstruction makeFalse() => graph.addConstantBool(false, compiler);
+
// Intersection of int and double return conflicting, so
// we don't optimize on numbers to preserve the runtime semantics.
if (!(left.isNumberOrNull(compiler) && right.isNumberOrNull(compiler))) {
TypeMask intersection = leftType.intersection(rightType, compiler.world);
if (intersection.isEmpty && !intersection.isNullable) {
- return graph.addConstantBool(false, compiler);
+ return makeFalse();
}
}
if (left.isNull() && right.isNull()) {
- return graph.addConstantBool(true, compiler);
+ return makeTrue();
+ }
+
+ HInstruction compareConstant(HConstant constant, HInstruction input) {
+ if (constant.constant.isTrue) {
+ return input;
+ } else {
+ return new HNot(input, backend.boolType);
+ }
}
if (left.isConstantBoolean() && right.isBoolean(compiler)) {
- HConstant constant = left;
- if (constant.constant.isTrue) {
- return right;
- } else {
- return new HNot(right, backend.boolType);
- }
+ return compareConstant(left, right);
}
if (right.isConstantBoolean() && left.isBoolean(compiler)) {
- HConstant constant = right;
- if (constant.constant.isTrue) {
- return left;
- } else {
- return new HNot(left, backend.boolType);
- }
+ return compareConstant(right, left);
+ }
+
+
+ if (identical(left.nonCheck(), right.nonCheck())) {
+ // Avoid constant-folding `identical(x, x)` when `x` might be double. The
+ // dart2js runtime has not always been consistent with the Dart
+ // specification (section 16.0.1), which makes distinctions on NaNs and
+ // -0.0 that are hard to implement efficiently.
+ if (left.isIntegerOrNull(compiler)) return makeTrue();
+ if (!left.canBePrimitiveNumber(compiler)) return makeTrue();
}
return null;
@@ -738,7 +758,7 @@
ConstantValue constant = receiver.constant;
if (constant.isConstructedObject) {
ConstructedConstantValue constructedConstant = constant;
- Map<Element, ConstantValue> fields = constructedConstant.fieldElements;
+ Map<Element, ConstantValue> fields = constructedConstant.fields;
ConstantValue value = fields[node.element];
if (value != null) {
return graph.addConstant(value, compiler);
@@ -822,6 +842,19 @@
return new HFieldSet(field, receiver, value);
}
+ HInstruction visitInvokeStatic(HInvokeStatic node) {
+ if (node.element == backend.getCheckConcurrentModificationError()) {
+ if (node.inputs.length == 2) {
+ HInstruction firstArgument = node.inputs[0];
+ if (firstArgument is HConstant) {
+ HConstant constant = firstArgument;
+ if (constant.constant.isTrue) return constant;
+ }
+ }
+ }
+ return node;
+ }
+
HInstruction visitStringConcat(HStringConcat node) {
// Simplify string concat:
//
@@ -1004,6 +1037,13 @@
/// Returns true of [foreign] will throw an noSuchMethod error if
/// receiver is `null` before having any other side-effects.
bool templateThrowsNSMonNull(HForeignCode foreign, HInstruction receiver) {
+ if (foreign.inputs.length < 1) return false;
+ if (foreign.inputs.first != receiver) return false;
+ if (foreign.throwBehavior.isNullNSMGuard) return true;
+
+ // TODO(sra): Fix NativeThrowBehavior to distinguish MAY from
+ // throws-nsm-on-null-followed-by-MAY and remove all the code below.
+
// We look for a template of the form
//
// #.something -or- #.something()
@@ -1022,7 +1062,7 @@
js.PropertyAccess access = node;
if (access.receiver is js.InterpolatedExpression) {
js.InterpolatedExpression hole = access.receiver;
- return hole.isPositional && foreign.inputs.first == receiver;
+ return hole.isPositional && hole.nameOrPosition == 0;
}
}
return false;
@@ -1900,6 +1940,9 @@
}
void visitInstruction(HInstruction instruction) {
+ if (instruction.isAllocation) {
+ memorySet.registerAllocation(instruction);
+ }
memorySet.killAffectedBy(instruction);
}
diff --git a/pkg/compiler/lib/src/ssa/ssa.dart b/pkg/compiler/lib/src/ssa/ssa.dart
index 1081923..2bef586 100644
--- a/pkg/compiler/lib/src/ssa/ssa.dart
+++ b/pkg/compiler/lib/src/ssa/ssa.dart
@@ -7,6 +7,8 @@
import 'dart:collection';
import '../closure.dart';
+import '../constant_system_dart.dart';
+import '../constants/constant_system.dart';
import '../constants/expressions.dart';
import '../constants/values.dart';
import '../deferred_load.dart' show DeferredLoadTask;
@@ -24,6 +26,7 @@
import '../js_backend/js_backend.dart';
import '../js_emitter/js_emitter.dart' show CodeEmitterTask, NativeEmitter;
import '../native/native.dart' as native;
+import '../resolution/operators.dart';
import '../scanner/scannerlib.dart'
show PartialFunctionElement, Token, PLUS_TOKEN;
import '../tree/tree.dart' as ast;
diff --git a/pkg/compiler/lib/src/tree_ir/optimization/logical_rewriter.dart b/pkg/compiler/lib/src/tree_ir/optimization/logical_rewriter.dart
index 9a856ba..941b22c 100644
--- a/pkg/compiler/lib/src/tree_ir/optimization/logical_rewriter.dart
+++ b/pkg/compiler/lib/src/tree_ir/optimization/logical_rewriter.dart
@@ -312,7 +312,7 @@
// !true ==> false
if (!polarity) {
values.BoolConstantValue value = e.value;
- return new Constant.primitive(value.negate());
+ return new Constant.bool(value.negate());
}
return e;
}
@@ -343,6 +343,5 @@
return new LogicalOperator.or(e1, e2);
}
}
-
}
diff --git a/pkg/compiler/lib/src/tree_ir/optimization/loop_rewriter.dart b/pkg/compiler/lib/src/tree_ir/optimization/loop_rewriter.dart
index e2b7011..0129c0d 100644
--- a/pkg/compiler/lib/src/tree_ir/optimization/loop_rewriter.dart
+++ b/pkg/compiler/lib/src/tree_ir/optimization/loop_rewriter.dart
@@ -4,9 +4,31 @@
part of tree_ir.optimization;
-/// Rewrites [WhileTrue] statements with an [If] body into a [WhileCondition],
-/// in situations where only one of the branches contains a [Continue] to the
-/// loop. Schematically:
+/// Rewrites [WhileTrue] statements.
+///
+/// Before this phase, loops usually contain a lot of "exit code", that is,
+/// code that happens at a point where a [Continue] can no longer be reached,
+/// and is therefore not really part of the loop.
+/// Exit code is moved down after the loop using the following rewrites rules:
+///
+/// EXTRACT LABELED STATEMENT:
+///
+/// L:
+/// while (true) {
+/// L2: {
+/// S1 (has references to L)
+/// }
+/// S2 (has no references to L)
+/// }
+///
+/// ==>
+///
+/// L2: {
+/// L: while (true) S1
+/// }
+/// S2
+///
+/// INTRODUCE CONDITIONAL LOOP:
///
/// L:
/// while (true) {
@@ -25,8 +47,10 @@
///
/// A similar transformation is used when S2 occurs in the 'then' position.
///
-/// Note that the above pattern needs no iteration since nested ifs
+/// Note that the last pattern above needs no iteration since nested ifs
/// have been collapsed previously in the [StatementRewriter] phase.
+///
+/// [WhileCondition] statements exist only after this phase.
class LoopRewriter extends RecursiveTransformer
implements Pass {
String get passName => 'Loop rewriter';
@@ -49,6 +73,28 @@
Statement visitWhileTrue(WhileTrue node) {
assert(!usedContinueLabels.contains(node.label));
+
+ // Pull labeled statements outside the loop when possible.
+ // [head] and [tail] are the first and last labeled statements that were
+ // pulled out, and null when none have been pulled out.
+ LabeledStatement head, tail;
+ while (node.body is LabeledStatement) {
+ LabeledStatement inner = node.body;
+ inner.next = visitStatement(inner.next);
+ bool nextHasContinue = usedContinueLabels.remove(node.label);
+ if (nextHasContinue) break;
+ node.body = inner.body;
+ inner.body = node;
+ if (head == null) {
+ head = tail = inner;
+ } else {
+ tail.body = inner;
+ tail = inner;
+ }
+ }
+
+ // Rewrite while(true) to while(condition).
+ Statement loop = node;
if (node.body is If) {
If body = node.body;
body.thenStatement = visitStatement(body.thenStatement);
@@ -57,23 +103,31 @@
bool elseHasContinue = usedContinueLabels.remove(node.label);
if (thenHasContinue && !elseHasContinue) {
node.label.binding = null; // Prepare to rebind the label.
- return new WhileCondition(
+ loop = new WhileCondition(
node.label,
body.condition,
body.thenStatement,
body.elseStatement);
} else if (!thenHasContinue && elseHasContinue) {
node.label.binding = null;
- return new WhileCondition(
+ loop = new WhileCondition(
node.label,
new Not(body.condition),
body.elseStatement,
body.thenStatement);
}
+ } else if (node.body is LabeledStatement) {
+ // If the body is a labeled statement, its .next has already been visited.
+ LabeledStatement body = node.body;
+ body.body = visitStatement(body.body);
+ usedContinueLabels.remove(node.label);
} else {
node.body = visitStatement(node.body);
usedContinueLabels.remove(node.label);
}
- return node;
+
+ if (head == null) return loop;
+ tail.body = loop;
+ return head;
}
}
diff --git a/pkg/compiler/lib/src/tree_ir/optimization/optimization.dart b/pkg/compiler/lib/src/tree_ir/optimization/optimization.dart
index 7dae5cd..e57bdc9 100644
--- a/pkg/compiler/lib/src/tree_ir/optimization/optimization.dart
+++ b/pkg/compiler/lib/src/tree_ir/optimization/optimization.dart
@@ -5,6 +5,7 @@
import 'variable_merger.dart';
export 'variable_merger.dart' show VariableMerger;
+export 'pull_into_initializers.dart' show PullIntoInitializers;
part 'logical_rewriter.dart';
part 'loop_rewriter.dart';
diff --git a/pkg/compiler/lib/src/tree_ir/optimization/pull_into_initializers.dart b/pkg/compiler/lib/src/tree_ir/optimization/pull_into_initializers.dart
new file mode 100644
index 0000000..a45b9f2
--- /dev/null
+++ b/pkg/compiler/lib/src/tree_ir/optimization/pull_into_initializers.dart
@@ -0,0 +1,317 @@
+// Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+import 'optimization.dart' show Pass;
+import '../tree_ir_nodes.dart';
+
+/// Pulls assignment expressions to the top of the function body so they can be
+/// translated into declaration-site variable initializaters.
+///
+/// This reverts the assignment expression propagation performed by
+/// [StatementRewriter] in cases where it not beneficial.
+///
+/// EXAMPLE:
+///
+/// var x = foo(),
+/// y = bar(x);
+///
+/// ==> [StatementRewriter]
+///
+/// var x,
+/// y = bar(x = foo());
+///
+/// ==> [PullIntoInitializers] restores the initializer for x
+///
+/// var x = foo(),
+/// y = bar(x);
+///
+///
+/// Sometimes the assignment propagation will trigger another optimization
+/// in the [StatementRewriter] which then prevents [PullIntoInitializers] from
+/// restoring the initializer. This is acceptable, since most optimizations
+/// at that level are better than restoring an initializer.
+///
+/// EXAMPLE:
+///
+/// var x = foo(),
+/// y = bar();
+/// baz(x, y, y);
+///
+/// ==> [StatementRewriter]
+///
+/// var y;
+/// baz(foo(), y = bar(), y);
+///
+/// [PullIntoInitializers] cannot pull `y` into an initializer because
+/// the impure expressions `foo()` and `bar()` would then be swapped.
+///
+class PullIntoInitializers implements Pass {
+ String get passName => 'Pull into initializers';
+
+ void rewrite(RootNode node) {
+ node.replaceEachBody((Statement body) {
+ return new BodyRewriter().rewriteBody(node.parameters, body);
+ });
+ }
+}
+
+class BodyRewriter extends ExpressionVisitor<Expression> {
+ Set<Variable> assignedVariables = new Set<Variable>();
+
+ /// The fragment between [first] and [last] holds the statements
+ /// we pulled into the initializer block.
+ ///
+ /// The *initializer block* is a sequence of [ExpressionStatement]s with
+ /// [Assign]s that we create in the beginning of the body, with the intent
+ /// that code generation will convert them to variable initializers.
+ ///
+ /// The block is empty when both are `null`.
+ Statement first, last;
+
+ /// True if an impure expression has been returned by visitExpression.
+ ///
+ /// Expressions cannot be pulled into an initializer if this might reorder
+ /// impure expressions.
+ ///
+ /// A visit method may not be called while this flag is set, meaning all
+ /// visitor methods must check the flag between visiting subexpressions.
+ bool seenImpure;
+
+ /// Appends a statement to the initializer block.
+ void append(Statement node) {
+ if (first == null) {
+ first = last = node;
+ } else {
+ last.next = node;
+ last = node;
+ }
+ }
+
+ /// Pulls assignment expressions from [node] into the initializer block
+ /// by calling [append].
+ ///
+ /// Returns a transformed expression where the pulled assignments are
+ /// replaced by variable uses.
+ Expression rewriteExpression(Expression node) {
+ seenImpure = false;
+ return visitExpression(node);
+ }
+
+ Statement rewriteBody(List<Variable> parameters, Statement body) {
+ assignedVariables.addAll(parameters);
+
+ // [body] represents the first statement after the initializer block.
+ // Repeatedly pull assignment statements into the initializer block.
+ while (body is ExpressionStatement) {
+ ExpressionStatement stmt = body;
+ stmt.expression = rewriteExpression(stmt.expression);
+ if (stmt.expression is VariableUse) {
+ // The entire expression was pulled into an initializer.
+ // This can happen when the expression was an assignment that was
+ // pulled into the initializer block and replaced by a variable use.
+ // Discard the statement and try to pull in more initializers from
+ // the next statement.
+ destroyVariableUse(stmt.expression);
+ body = stmt.next;
+ } else {
+ // The whole expression could not be pulled into an initializer, so we
+ // have reached the end of the initializer block.
+ break;
+ }
+ }
+
+ // [If] and [Return] statements terminate the initializer block, but the
+ // initial expression they contain may be pulled up into an initializer.
+ // It's ok to pull an assignment across a label so look for the first
+ // non-labeled statement and try to pull its initial subexpression.
+ Statement entryNode = unfoldLabeledStatements(body);
+ if (entryNode is If) {
+ entryNode.condition = rewriteExpression(entryNode.condition);
+ } else if (entryNode is Return) {
+ entryNode.value = rewriteExpression(entryNode.value);
+ }
+
+ append(body);
+ assert(first != null); // Because we just appended the body.
+ return first;
+ }
+
+ void destroyVariableUse(VariableUse node) {
+ --node.variable.readCount;
+ }
+
+ Statement unfoldLabeledStatements(Statement node) {
+ while (node is LabeledStatement) {
+ node = (node as LabeledStatement).body;
+ }
+ return node;
+ }
+
+ Expression visitAssign(Assign node) {
+ assert(!seenImpure);
+ node.value = visitExpression(node.value);
+ if (!assignedVariables.add(node.variable)) {
+ // This is not the first assignment to the variable, so it cannot be
+ // pulled into an initializer.
+ // We have to leave the assignment here, and assignments are impure.
+ seenImpure = true;
+ return node;
+ } else {
+ // Pull the assignment into an initializer.
+ // We will leave behind a variable use, which is pure, so we can
+ // disregard any impure expressions seen in the right-hand side.
+ seenImpure = false;
+ append(new ExpressionStatement(node, null));
+ return new VariableUse(node.variable);
+ }
+ }
+
+ void rewriteList(List<Expression> list) {
+ for (int i = 0; i < list.length; i++) {
+ list[i] = visitExpression(list[i]);
+ if (seenImpure) return;
+ }
+ }
+
+ Expression visitInvokeStatic(InvokeStatic node) {
+ rewriteList(node.arguments);
+ seenImpure = true;
+ return node;
+ }
+
+ Expression visitInvokeMethod(InvokeMethod node) {
+ node.receiver = visitExpression(node.receiver);
+ if (seenImpure) return node;
+ rewriteList(node.arguments);
+ seenImpure = true;
+ return node;
+ }
+
+ Expression visitInvokeMethodDirectly(InvokeMethodDirectly node) {
+ node.receiver = visitExpression(node.receiver);
+ if (seenImpure) return node;
+ rewriteList(node.arguments);
+ seenImpure = true;
+ return node;
+ }
+
+ Expression visitInvokeConstructor(InvokeConstructor node) {
+ rewriteList(node.arguments);
+ seenImpure = true;
+ return node;
+ }
+
+ Expression visitConcatenateStrings(ConcatenateStrings node) {
+ rewriteList(node.arguments);
+ seenImpure = true;
+ return node;
+ }
+
+ Expression visitTypeExpression(TypeExpression node) {
+ rewriteList(node.arguments);
+ return node;
+ }
+
+ Expression visitConditional(Conditional node) {
+ node.condition = visitExpression(node.condition);
+ if (seenImpure) return node;
+ node.thenExpression = visitExpression(node.thenExpression);
+ if (seenImpure) return node;
+ node.elseExpression = visitExpression(node.elseExpression);
+ return node;
+ }
+
+ Expression visitLogicalOperator(LogicalOperator node) {
+ node.left = visitExpression(node.left);
+ if (seenImpure) return node;
+ node.right = visitExpression(node.right);
+ return node;
+ }
+
+ Expression visitLiteralList(LiteralList node) {
+ rewriteList(node.values);
+ if (node.type != null) seenImpure = true; // Type casts can throw.
+ return node;
+ }
+
+ Expression visitLiteralMap(LiteralMap node) {
+ for (LiteralMapEntry entry in node.entries) {
+ entry.key = visitExpression(entry.key);
+ if (seenImpure) return node;
+ entry.value = visitExpression(entry.value);
+ if (seenImpure) return node;
+ }
+ if (node.type != null) seenImpure = true; // Type casts can throw.
+ return node;
+ }
+
+ Expression visitTypeOperator(TypeOperator node) {
+ node.receiver = visitExpression(node.receiver);
+ if (!node.isTypeTest) seenImpure = true; // Type cast can throw.
+ return node;
+ }
+
+ void visitInnerFunction(FunctionDefinition node) {
+ node.body = new BodyRewriter().rewriteBody(node.parameters, node.body);
+ }
+
+ Expression visitFunctionExpression(FunctionExpression node) {
+ visitInnerFunction(node.definition);
+ return node;
+ }
+
+ Expression visitGetField(GetField node) {
+ node.object = visitExpression(node.object);
+ seenImpure = true;
+ return node;
+ }
+
+ Expression visitSetField(SetField node) {
+ node.object = visitExpression(node.object);
+ if (seenImpure) return node;
+ node.value = visitExpression(node.value);
+ seenImpure = true;
+ return node;
+ }
+
+ Expression visitCreateBox(CreateBox node) {
+ return node;
+ }
+
+ Expression visitCreateInstance(CreateInstance node) {
+ rewriteList(node.arguments);
+ return node;
+ }
+
+ Expression visitReifyRuntimeType(ReifyRuntimeType node) {
+ node.value = visitExpression(node.value);
+ return node;
+ }
+
+ Expression visitReadTypeVariable(ReadTypeVariable node) {
+ node.target = visitExpression(node.target);
+ return node;
+ }
+
+ Expression visitConstant(Constant node) {
+ return node;
+ }
+
+ Expression visitThis(This node) {
+ return node;
+ }
+
+ Expression visitReifyTypeVar(ReifyTypeVar node) {
+ return node;
+ }
+
+ Expression visitNot(Not node) {
+ node.operand = visitExpression(node.operand);
+ return node;
+ }
+
+ Expression visitVariableUse(VariableUse node) {
+ return node;
+ }
+}
diff --git a/pkg/compiler/lib/src/tree_ir/optimization/statement_rewriter.dart b/pkg/compiler/lib/src/tree_ir/optimization/statement_rewriter.dart
index 88ab5d8..766d825 100644
--- a/pkg/compiler/lib/src/tree_ir/optimization/statement_rewriter.dart
+++ b/pkg/compiler/lib/src/tree_ir/optimization/statement_rewriter.dart
@@ -6,7 +6,8 @@
/**
* Performs the following transformations on the tree:
- * - Assignment propagation
+ * - Assignment inlining
+ * - Assignment expression propagation
* - If-to-conditional conversion
* - Flatten nested ifs
* - Break inlining
@@ -16,8 +17,8 @@
* introduce redexes of each other.
*
*
- * ASSIGNMENT PROPAGATION:
- * Single-use definitions are propagated to their use site when possible.
+ * ASSIGNMENT INLINING:
+ * Single-use definitions are inlined at their use site when possible.
* For example:
*
* { v0 = foo(); return v0; }
@@ -41,6 +42,19 @@
* propagating a definition.
*
*
+ * ASSIGNMENT EXPRESSION PROPAGATION:
+ * Definitions with multiple uses are propagated to their first use site
+ * when possible. For example:
+ *
+ * { v0 = foo(); bar(v0); return v0; }
+ * ==>
+ * { bar(v0 = foo()); return v0; }
+ *
+ * Note that the [RestoreInitializers] phase will later undo this rewrite
+ * in cases where it prevents an assignment from being pulled into an
+ * initializer.
+ *
+ *
* IF-TO-CONDITIONAL CONVERSION:
* If-statement are converted to conditional expressions when possible.
* For example:
@@ -99,9 +113,21 @@
node.replaceEachBody(visitStatement);
}
- // The binding environment. The rightmost element of the list is the nearest
- // available enclosing binding.
- List<Assign> environment = <Assign>[];
+ /// True if targeting Dart.
+ final bool isDartMode;
+
+ /// The most recently evaluated impure expressions, with the most recent
+ /// expression being last.
+ ///
+ /// Most importantly, this contains [Assign] expressions that we attempt to
+ /// inline at their use site. It also contains other impure expressions that
+ /// we can propagate to a variable use if they are known to return the value
+ /// of that variable.
+ ///
+ /// Except for [Conditional]s, expressions in the environment have
+ /// not been processed, and all their subexpressions must therefore be
+ /// variables uses.
+ List<Expression> environment = <Expression>[];
/// Binding environment for variables that are assigned to effectively
/// constant expressions (see [isEffectivelyConstant]).
@@ -111,12 +137,22 @@
/// for a break to L' if L maps to L'.
Map<Label, Jump> labelRedirects = <Label, Jump>{};
+ /// Number of uses of the given variable that are still unseen.
+ /// Used to detect the first use of a variable (since we do backwards
+ /// traversal, the first use is the last one seen).
+ Map<Variable, int> unseenUses = <Variable, int>{};
+
/// Rewriter for methods.
- StatementRewriter() : constantEnvironment = <Variable, Expression>{};
+ StatementRewriter({this.isDartMode})
+ : constantEnvironment = <Variable, Expression>{} {
+ assert(isDartMode != null);
+ }
/// Rewriter for nested functions.
StatementRewriter.nested(StatementRewriter parent)
- : constantEnvironment = parent.constantEnvironment;
+ : constantEnvironment = parent.constantEnvironment,
+ unseenUses = parent.unseenUses,
+ isDartMode = parent.isDartMode;
/// A set of labels that can be safely inlined at their use.
///
@@ -134,34 +170,91 @@
}
void inEmptyEnvironment(void action()) {
- List<Assign> oldEnvironment = environment;
- environment = <Assign>[];
+ List oldEnvironment = environment;
+ environment = <Expression>[];
action();
assert(environment.isEmpty);
environment = oldEnvironment;
}
- Expression visitExpression(Expression e) => e.processed ? e : e.accept(this);
+ /// Left-hand side of the given assignment, or `null` if not an assignment.
+ Variable getLeftHand(Expression e) {
+ return e is Assign ? e.variable : null;
+ }
+
+ /// If the given expression always returns the value of one of its
+ /// subexpressions, returns that subexpression, otherwise `null`.
+ Expression getValueSubexpression(Expression e) {
+ if (isDartMode &&
+ e is InvokeMethod &&
+ (e.selector.isSetter || e.selector.isIndexSet)) {
+ return e.arguments.last;
+ }
+ if (e is SetField) return e.value;
+ return null;
+ }
+
+ /// If the given expression always returns the value of one of its
+ /// subexpressions, and that subexpression is a variable use, returns that
+ /// variable. Otherwise `null`.
+ Variable getRightHand(Expression e) {
+ Expression value = getValueSubexpression(e);
+ return value is VariableUse ? value.variable : null;
+ }
@override
Expression visitVariableUse(VariableUse node) {
+ // Count of number of unseen uses remaining.
+ unseenUses.putIfAbsent(node.variable, () => node.variable.readCount);
+ --unseenUses[node.variable];
+
+ // We traverse the tree right-to-left, so when we have seen all uses,
+ // it means we are looking at the first use.
+ assert(unseenUses[node.variable] < node.variable.readCount);
+ assert(unseenUses[node.variable] >= 0);
+ bool isFirstUse = unseenUses[node.variable] == 0;
+
// Propagate constant to use site.
Expression constant = constantEnvironment[node.variable];
if (constant != null) {
--node.variable.readCount;
- return constant;
+ return visitExpression(constant);
}
- // Propagate a variable's definition to its use site if:
- // 1. It has a single use, to avoid code growth and potential duplication
- // of side effects, AND
- // 2. It was the most recent expression evaluated so that we do not
- // reorder expressions with side effects.
- if (!environment.isEmpty &&
- environment.last.variable == node.variable &&
- node.variable.readCount == 1) {
- --node.variable.readCount;
- return visitExpression(environment.removeLast().value);
+ // Try to propagate another expression into this variable use.
+ if (!environment.isEmpty) {
+ Expression binding = environment.last;
+
+ // Is this variable assigned by the most recently evaluated impure
+ // expression?
+ //
+ // If so, propagate the assignment, e.g:
+ //
+ // { x = foo(); bar(x, x) } ==> bar(x = foo(), x)
+ //
+ // We must ensure that no other uses separate this use from the
+ // assignment. We therefore only propagate assignments into the first use.
+ //
+ // Note that if this is only use, `visitAssign` will then remove the
+ // redundant assignment.
+ if (getLeftHand(binding) == node.variable && isFirstUse) {
+ environment.removeLast();
+ --node.variable.readCount;
+ return visitExpression(binding);
+ }
+
+ // Is the most recently evaluated impure expression known to have the
+ // value of this variable?
+ //
+ // If so, we can replace this use with the impure expression, e.g:
+ //
+ // { E.foo = x; bar(x) } ==> bar(E.foo = x)
+ //
+ if (getRightHand(binding) == node.variable) {
+ environment.removeLast();
+ --node.variable.readCount;
+ return visitExpression(binding);
+ }
}
// If the definition could not be propagated, leave the variable use.
@@ -177,44 +270,76 @@
return exp is Constant ||
exp is This ||
exp is ReifyTypeVar ||
+ exp is InvokeStatic && exp.isEffectivelyConstant ||
exp is VariableUse && constantEnvironment.containsKey(exp.variable);
}
- Statement visitAssign(Assign node) {
- if (isEffectivelyConstant(node.value) &&
- node.variable.writeCount == 1) {
+ /// True if [node] is an assignment that can be propagated as a constant.
+ bool isEffectivelyConstantAssignment(Expression node) {
+ return node is Assign &&
+ node.variable.writeCount == 1 &&
+ isEffectivelyConstant(node.value);
+ }
+
+ Statement visitExpressionStatement(ExpressionStatement stmt) {
+ if (isEffectivelyConstantAssignment(stmt.expression)) {
+ Assign assign = stmt.expression;
// Handle constant assignments specially.
// They are always safe to propagate (though we should avoid duplication).
// Moreover, they should not prevent other expressions from propagating.
- if (node.variable.readCount <= 1) {
+ if (assign.variable.readCount <= 1) {
// A single-use constant should always be propagted to its use site.
- constantEnvironment[node.variable] = visitExpression(node.value);
- --node.variable.writeCount;
- return visitStatement(node.next);
+ constantEnvironment[assign.variable] = assign.value;
+ --assign.variable.writeCount;
+ return visitStatement(stmt.next);
} else {
// With more than one use, we cannot propagate the constant.
// Visit the following statement without polluting [environment] so
// that any preceding non-constant assignments might still propagate.
- node.next = visitStatement(node.next);
- node.value = visitExpression(node.value);
- return node;
+ stmt.next = visitStatement(stmt.next);
+ assign.value = visitExpression(assign.value);
+ return stmt;
}
- } else {
- // Try to propagate assignment, and block previous assignment until this
- // has propagated.
- environment.add(node);
- Statement next = visitStatement(node.next);
- if (!environment.isEmpty && environment.last == node) {
- // The definition could not be propagated. Residualize the let binding.
- node.next = next;
- environment.removeLast();
- node.value = visitExpression(node.value);
- return node;
- }
- assert(!environment.contains(node));
- --node.variable.writeCount; // This assignment was removed.
- return next;
}
+ // Try to propagate the expression, and block previous impure expressions
+ // until this has propagated.
+ environment.add(stmt.expression);
+ stmt.next = visitStatement(stmt.next);
+ if (!environment.isEmpty && environment.last == stmt.expression) {
+ // Retain the expression statement.
+ environment.removeLast();
+ stmt.expression = visitExpression(stmt.expression);
+ return stmt;
+ } else {
+ // Expression was propagated into the successor.
+ return stmt.next;
+ }
+ }
+
+ Expression visitAssign(Assign node) {
+ node.value = visitExpression(node.value);
+ // Remove assignments to variables without any uses. This can happen
+ // because the assignment was propagated into its use, e.g:
+ //
+ // { x = foo(); bar(x) } ==> bar(x = foo()) ==> bar(foo())
+ //
+ if (node.variable.readCount == 0) {
+ --node.variable.writeCount;
+ return node.value;
+ }
+ return node;
+ }
+
+ Statement visitVariableDeclaration(VariableDeclaration node) {
+ if (isEffectivelyConstant(node.value)) {
+ node.next = visitStatement(node.next);
+ } else {
+ inEmptyEnvironment(() {
+ node.next = visitStatement(node.next);
+ });
+ }
+ node.value = visitExpression(node.value);
+ return node;
}
Expression visitInvokeStatic(InvokeStatic node) {
@@ -256,13 +381,25 @@
}
Expression visitConditional(Conditional node) {
- node.condition = visitExpression(node.condition);
-
- inEmptyEnvironment(() {
- node.thenExpression = visitExpression(node.thenExpression);
- node.elseExpression = visitExpression(node.elseExpression);
- });
-
+ // Conditional expressions do not exist in the input, but they are
+ // introduced by if-to-conditional conversion.
+ // Their subexpressions have already been processed; do not reprocess them.
+ //
+ // Note that this can only happen for conditional expressions. It is an
+ // error for any other type of expression to be visited twice or to be
+ // created and then visited. We use this special treatment of conditionals
+ // to allow for assignment inlining after if-to-conditional conversion.
+ //
+ // There are several reasons we should not reprocess the subexpressions:
+ //
+ // - It will mess up the [seenUses] counter, since a single use will be
+ // counted twice.
+ //
+ // - Other visit methods assume that all subexpressions are variable uses
+ // because they come fresh out of the tree IR builder.
+ //
+ // - Reprocessing can be expensive.
+ //
return node;
}
@@ -298,6 +435,14 @@
return node;
}
+ Statement visitThrow(Throw node) {
+ node.value = visitExpression(node.value);
+ return node;
+ }
+
+ Statement visitRethrow(Rethrow node) {
+ return node;
+ }
Statement visitBreak(Break node) {
// Redirect through chain of breaks.
@@ -362,20 +507,16 @@
inEmptyEnvironment(() {
node.thenStatement = visitStatement(node.thenStatement);
node.elseStatement = visitStatement(node.elseStatement);
+
+ tryCollapseIf(node);
});
- tryCollapseIf(node);
-
- Statement reduced = combineStatementsWithSubexpressions(
+ Statement reduced = combineStatementsInBranches(
node.thenStatement,
node.elseStatement,
- (t,f) => new Conditional(node.condition, t, f)..processed = true);
+ node.condition);
if (reduced != null) {
- // TODO(asgerf): Avoid revisiting nodes or visiting nodes that we created.
- // This breaks the assumption that all subexpressions are
- // variable uses, and it can be expensive.
- // Revisit in case the break can now be inlined.
- return visitStatement(reduced);
+ return reduced;
}
return node;
@@ -440,22 +581,7 @@
return node;
}
- Statement visitExpressionStatement(ExpressionStatement node) {
- node.expression = visitExpression(node.expression);
- // Do not allow propagation of assignments past an expression evaluated
- // for its side effects because it risks reordering side effects.
- // TODO(kmillikin): Rethink this. Some propagation is benign,
- // e.g. variables, or other pure values that are not destroyed by
- // the expression statement. If they can occur here they should be
- // handled well.
- inEmptyEnvironment(() {
- node.next = visitStatement(node.next);
- });
- return node;
- }
-
- Statement visitSetField(SetField node) {
- node.next = visitStatement(node.next);
+ Expression visitSetField(SetField node) {
node.value = visitExpression(node.value);
node.object = visitExpression(node.object);
return node;
@@ -511,43 +637,93 @@
///
/// If non-null is returned, the caller MUST discard [s] and [t] and use
/// the returned statement instead.
- static Statement combineStatementsWithSubexpressions(
+ Statement combineStatementsInBranches(
Statement s,
Statement t,
- Expression combine(Expression s, Expression t)) {
+ Expression condition) {
if (s is Return && t is Return) {
- return new Return(combine(s.value, t.value));
- }
- if (s is Assign && t is Assign && s.variable == t.variable) {
- Statement next = combineStatements(s.next, t.next);
- if (next != null) {
- // Destroy both original assignments to the variable.
- --s.variable.writeCount;
- --t.variable.writeCount;
- // The Assign constructor will increment the reference count again.
- return new Assign(s.variable,
- combine(s.value, t.value),
- next);
- }
+ return new Return(new Conditional(condition, s.value, t.value));
}
if (s is ExpressionStatement && t is ExpressionStatement) {
+ // Combine the two expressions and the two successor statements.
+ //
+ // C ? {E1 ; S1} : {E2 ; S2}
+ // ==>
+ // (C ? E1 : E2) : combine(S1, S2)
+ //
+ // If E1 and E2 are assignments, we want to propagate these into the
+ // combined statement.
+ //
+ // It might not be possible to combine the statements, so we combine the
+ // expressions, put the result in the environment, and then uncombine the
+ // expressions if the statements could not be combined.
+
+ // Combine the expressions.
+ CombinedExpressions values =
+ combineAsConditional(s.expression, t.expression, condition);
+
+ // Put this into the environment and try to combine the statements.
+ // We are not in risk of reprocessing the original subexpressions because
+ // the combined expression will always hide them inside a Conditional.
+ environment.add(values.combined);
Statement next = combineStatements(s.next, t.next);
- if (next != null) {
- return new ExpressionStatement(combine(s.expression, t.expression),
- next);
+
+ if (next == null) {
+ // Statements could not be combined.
+ // Restore the environment and uncombine expressions again.
+ environment.removeLast();
+ values.uncombine();
+ return null;
+ } else if (!environment.isEmpty && environment.last == values.combined) {
+ // Statements were combined but the combined expression could not be
+ // propagated. Leave it as an expression statement here.
+ environment.removeLast();
+ s.expression = values.combined;
+ s.next = next;
+ return s;
+ } else {
+ // Statements were combined and the combined expressions were
+ // propagated into the combined statement.
+ return next;
}
}
return null;
}
+ /// Creates the expression `[condition] ? [s] : [t]` or an equivalent
+ /// expression if something better can be done.
+ ///
+ /// In particular, assignments will be merged as follows:
+ ///
+ /// C ? (v = E1) : (v = E2)
+ /// ==>
+ /// v = C ? E1 : E2
+ ///
+ /// The latter form is more compact and can also be inlined.
+ CombinedExpressions combineAsConditional(
+ Expression s,
+ Expression t,
+ Expression condition) {
+ if (s is Assign && t is Assign && s.variable == t.variable) {
+ Expression values = new Conditional(condition, s.value, t.value);
+ return new CombinedAssigns(s, t, new CombinedExpressions(values));
+ }
+ return new CombinedExpressions(new Conditional(condition, s, t));
+ }
+
/// Returns a statement equivalent to both [s] and [t], or null if [s] and
/// [t] are incompatible.
/// If non-null is returned, the caller MUST discard [s] and [t] and use
/// the returned statement instead.
/// If two breaks are combined, the label's break counter will be decremented.
- static Statement combineStatements(Statement s, Statement t) {
+ Statement combineStatements(Statement s, Statement t) {
if (s is Break && t is Break && s.target == t.target) {
--t.target.useCount; // Two breaks become one.
+ if (s.target.useCount == 1 && safeForInlining.contains(s.target)) {
+ // Only one break remains; inline it.
+ --s.target.useCount;
+ return visitStatement(s.target.binding.next);
+ }
return s;
}
if (s is Continue && t is Continue && s.target == t.target) {
@@ -555,20 +731,35 @@
return s;
}
if (s is Return && t is Return) {
- Expression e = combineExpressions(s.value, t.value);
- if (e != null) {
- return new Return(e);
+ CombinedExpressions values = combineExpressions(s.value, t.value);
+ if (values != null) {
+ return new Return(values.combined);
}
}
- if (s is Assign && t is Assign &&
- s.variable == t.variable &&
- isSameVariable(s.value, t.value)) {
+ if (s is ExpressionStatement && t is ExpressionStatement) {
+ CombinedExpressions values =
+ combineExpressions(s.expression, t.expression);
+ if (values == null) return null;
+ environment.add(values.combined);
Statement next = combineStatements(s.next, t.next);
- if (next != null) {
+ if (next == null) {
+ // The successors could not be combined.
+ // Restore the environment and uncombine the values again.
+ assert(environment.last == values.combined);
+ environment.removeLast();
+ values.uncombine();
+ return null;
+ } else if (!environment.isEmpty && environment.last == values.combined) {
+ // The successors were combined but the combined expressions were not
+ // propagated. Leave the combined expression as a statement.
+ environment.removeLast();
+ s.expression = values.combined;
s.next = next;
- --t.variable.writeCount;
- --(t.value as VariableUse).variable.readCount;
return s;
+ } else {
+ // The successors were combined, and the combined expressions were
+ // propagated into the successors.
+ return next;
}
}
return null;
@@ -577,13 +768,18 @@
/// Returns an expression equivalent to both [e1] and [e2].
/// If non-null is returned, the caller must discard [e1] and [e2] and use
/// the resulting expression in the tree.
- static Expression combineExpressions(Expression e1, Expression e2) {
+ CombinedExpressions combineExpressions(Expression e1, Expression e2) {
if (e1 is VariableUse && e2 is VariableUse && e1.variable == e2.variable) {
- --e1.variable.readCount; // Two references become one.
- return e1;
+ return new CombinedUses(e1, e2);
+ }
+ if (e1 is Assign && e2 is Assign && e1.variable == e2.variable) {
+ CombinedExpressions values = combineExpressions(e1.value, e2.value);
+ if (values != null) {
+ return new CombinedAssigns(e1, e2, values);
+ }
}
if (e1 is Constant && e2 is Constant && e1.value == e2.value) {
- return e1;
+ return new CombinedExpressions(e1);
}
return null;
}
@@ -597,8 +793,9 @@
///
/// [branch1] and [branch2] control the position of the S statement.
///
- /// Returns true if another collapse redex might have been introduced.
+ /// Must be called with an empty environment.
void tryCollapseIf(If node) {
+ assert(environment.isEmpty);
// Repeatedly try to collapse nested ifs.
// The transformation is shrinking (destroys an if) so it remains linear.
// Here is an example where more than one iteration is required:
@@ -653,24 +850,13 @@
makeCondition(outerIf.condition, branch1),
makeCondition(innerIf.condition, branch2));
outerIf.thenStatement = innerThen;
-
- // Try to inline the remaining break. Do not propagate assignments.
- inEmptyEnvironment(() {
- // TODO(asgerf): Avoid quadratic cost from repeated processing. This
- // should be easier after we introduce basic blocks.
- outerIf.elseStatement = visitStatement(combinedElse);
- });
-
+ outerIf.elseStatement = combinedElse;
return outerIf.elseStatement is If;
}
}
return false;
}
- static bool isSameVariable(Expression e1, Expression e2) {
- return e1 is VariableUse && e2 is VariableUse && e1.variable == e2.variable;
- }
-
Expression makeCondition(Expression e, bool polarity) {
return polarity ? e : new Not(e);
}
@@ -679,3 +865,63 @@
return polarity ? node.thenStatement : node.elseStatement;
}
}
+
+/// Result of combining two expressions, with the potential for reverting the
+/// combination.
+///
+/// Reverting a combination is done by calling [uncombine]. In this case,
+/// both the original expressions should remain in the tree, and the [combined]
+/// expression should be orphaned.
+///
+/// Explicitly reverting a combination is necessary to maintain variable
+/// reference counts.
+abstract class CombinedExpressions {
+ Expression get combined;
+ void uncombine();
+
+ factory CombinedExpressions(Expression e) = GenericCombinedExpressions;
+}
+
+/// Combines assignments of form `[variable] := E1` and `[variable] := E2` into
+/// a single assignment of form `[variable] := combine(E1, E2)`.
+class CombinedAssigns implements CombinedExpressions {
+ Assign assign1, assign2;
+ CombinedExpressions value;
+ Expression combined;
+
+ CombinedAssigns(this.assign1, this.assign2, this.value) {
+ assert(assign1.variable == assign2.variable);
+ assign1.variable.writeCount -= 2; // Destroy the two original assignemnts.
+ combined = new Assign(assign1.variable, value.combined);
+ }
+
+ void uncombine() {
+ value.uncombine();
+ ++assign1.variable.writeCount; // Restore original reference count.
+ }
+}
+
+/// Combines two variable uses into one.
+class CombinedUses implements CombinedExpressions {
+ VariableUse use1, use2;
+ Expression combined;
+
+ CombinedUses(this.use1, this.use2) {
+ assert(use1.variable == use2.variable);
+ use1.variable.readCount -= 2; // Destroy both the original uses.
+ combined = new VariableUse(use1.variable);
+ }
+
+ void uncombine() {
+ ++use1.variable.readCount; // Restore original reference count.
+ }
+}
+
+/// Result of combining two expressions that do not affect reference counting.
+class GenericCombinedExpressions implements CombinedExpressions {
+ Expression combined;
+
+ GenericCombinedExpressions(this.combined);
+
+ void uncombine() {}
+}
diff --git a/pkg/compiler/lib/src/tree_ir/optimization/variable_merger.dart b/pkg/compiler/lib/src/tree_ir/optimization/variable_merger.dart
index f1b64cf..fb69832 100644
--- a/pkg/compiler/lib/src/tree_ir/optimization/variable_merger.dart
+++ b/pkg/compiler/lib/src/tree_ir/optimization/variable_merger.dart
@@ -4,7 +4,7 @@
library tree_ir.optimization.variable_merger;
-import 'optimization.dart' show Pass, PassMixin;
+import 'optimization.dart' show Pass;
import '../tree_ir_nodes.dart';
import '../../elements/elements.dart' show Local, ParameterElement;
@@ -34,7 +34,7 @@
builder.build(node.parameters, body);
_computeLiveness(builder.blocks);
Map<Variable, Variable> subst =
- _computeRegisterAllocation(builder.blocks);
+ _computeRegisterAllocation(builder.blocks, node.parameters);
new SubstituteVariables(subst).apply(node);
});
}
@@ -165,10 +165,14 @@
read(node.variable);
}
+ visitVariableDeclaration(VariableDeclaration node) {
+ assert(node.variable.isCaptured);
+ visitStatement(node.next);
+ }
+
visitAssign(Assign node) {
visitExpression(node.value);
write(node.variable);
- visitStatement(node.next);
}
visitIf(If node) {
@@ -227,16 +231,17 @@
visitConditional(Conditional node) {
visitExpression(node.condition);
- // TODO(asgerf): When assignment expressions are added, this is no longer
- // sound; then we need to handle as a branch.
+ Block afterCondition = _currentBlock;
+ branchFrom(afterCondition);
visitExpression(node.thenExpression);
+ branchFrom(afterCondition);
visitExpression(node.elseExpression);
}
visitLogicalOperator(LogicalOperator node) {
visitExpression(node.left);
- // TODO(asgerf): When assignment expressions are added, this is no longer
- // sound; then we need to handle as a branch.
+ Block afterCondition = _currentBlock;
+ branchFrom(afterCondition);
visitExpression(node.right);
}
@@ -350,20 +355,20 @@
///
/// We never merge variables that originated from distinct source variables,
/// so we build a separate register interference graph for each source variable.
-Map<Variable, Variable> _computeRegisterAllocation(List<Block> blocks) {
+Map<Variable, Variable> _computeRegisterAllocation(List<Block> blocks,
+ List<Variable> parameters) {
Map<Variable, Set<Variable>> interference = <Variable, Set<Variable>>{};
/// Group for the given variable. We attempt to merge variables in the same
/// group.
- /// By default, variables are grouped based on their source variable, but
- /// this can be disabled for testing purposes.
- Local group(Variable variable) {
- if (NO_PRESERVE_VARS) {
- // Parameters may not occur more than once in a parameter list,
- // so except for parameters, we try to merge all variables.
- return variable.element is ParameterElement ? variable.element : null;
- }
- return variable.element;
+ /// By default, variables are grouped based on their source variable name,
+ /// but this can be disabled for testing purposes.
+ String group(Variable variable) {
+ if (NO_PRESERVE_VARS) return '';
+ // Group variables based on the source variable's name, not its element,
+ // so if multiple locals are declared with the same name, they will
+ // map to the same (hoisted) variable in the output.
+ return variable.element == null ? '' : variable.element.name;
}
Set<Variable> empty = new Set<Variable>();
@@ -372,7 +377,7 @@
// live after the assignment (if it came from the same source variable).
for (Block block in blocks) {
// Group the liveOut set by source variable.
- Map<Local, Set<Variable>> liveOut = <Local, Set<Variable>>{};
+ Map<String, Set<Variable>> liveOut = <String, Set<Variable>>{};
for (Variable variable in block.liveOut) {
liveOut.putIfAbsent(
group(variable),
@@ -409,10 +414,22 @@
List<Variable> variables = interference.keys.toList();
variables.sort((x, y) => interference[y].length - interference[x].length);
- Map<Local, List<Variable>> registers = <Local, List<Variable>>{};
+ Map<String, List<Variable>> registers = <String, List<Variable>>{};
Map<Variable, Variable> subst = <Variable, Variable>{};
+ // Parameters are special in that they must have a ParameterElement and
+ // cannot be merged with each other. Ensure that they are not substituted.
+ // Other variables can still be substituted by a parameter.
+ for (Variable parameter in parameters) {
+ if (parameter.isCaptured) continue;
+ subst[parameter] = parameter;
+ registers[group(parameter)] = <Variable>[parameter];
+ }
+
for (Variable v1 in variables) {
+ // Parameters have already been assigned a substitute; skip those.
+ if (subst.containsKey(v1)) continue;
+
List<Variable> register = registers[group(v1)];
// Optimization: For the first variable in a group, allocate a new color
@@ -493,22 +510,41 @@
return node;
}
- Statement visitAssign(Assign node) {
+ Expression visitAssign(Assign node) {
node.variable = replaceWrite(node.variable);
-
- visitExpression(node.value);
- node.next = visitStatement(node.next);
+ node.value = visitExpression(node.value);
// Remove assignments of form "x := x"
if (node.value is VariableUse) {
VariableUse value = node.value;
if (value.variable == node.variable) {
- value.variable.readCount--;
- node.variable.writeCount--;
- return node.next;
+ --node.variable.writeCount;
+ return value;
}
}
return node;
}
+
+ Statement visitExpressionStatement(ExpressionStatement node) {
+ node.expression = visitExpression(node.expression);
+ node.next = visitStatement(node.next);
+ if (node.expression is VariableUse) {
+ VariableUse use = node.expression;
+ --use.variable.readCount;
+ return node.next;
+ }
+ return node;
+ }
+
+ Statement visitVariableDeclaration(VariableDeclaration node) {
+ // VariableDeclaration is only used for captured variables, which are never
+ // merged, so this is not strictly necessary. But it's nicer if this class
+ // works for arbitrary substitution maps.
+ node.variable = replaceWrite(node.variable);
+ node.value = visitExpression(node.value);
+ node.next = visitStatement(node.next);
+ return node;
+ }
+
}
diff --git a/pkg/compiler/lib/src/tree_ir/tree_ir_builder.dart b/pkg/compiler/lib/src/tree_ir/tree_ir_builder.dart
index fda5ca6..5a61847 100644
--- a/pkg/compiler/lib/src/tree_ir/tree_ir_builder.dart
+++ b/pkg/compiler/lib/src/tree_ir/tree_ir_builder.dart
@@ -153,7 +153,8 @@
if (variable is cps_ir.Parameter) {
return getVariable(variable);
} else {
- return addMutableVariable(variable as cps_ir.MutableVariable);
+ return addMutableVariable(variable as cps_ir.MutableVariable)
+ ..isCaptured = true;
}
}
@@ -214,15 +215,13 @@
cps_ir.Parameter parameter,
Expression argument,
Statement buildRest()) {
- Statement assignment;
+ Expression expr;
if (parameter.hasAtLeastOneUse) {
- Variable variable = getVariable(parameter);
- assignment = new Assign(variable, argument, null);
+ expr = new Assign(getVariable(parameter), argument);
} else {
- assignment = new ExpressionStatement(argument, null);
+ expr = argument;
}
- assignment.next = buildRest();
- return assignment;
+ return new ExpressionStatement(expr, buildRest());
}
/// Simultaneously assigns each argument to the corresponding parameter,
@@ -264,9 +263,9 @@
Statement first, current;
void addAssignment(Variable dst, Expression src) {
if (first == null) {
- first = current = new Assign(dst, src, null);
+ first = current = Assign.makeStatement(dst, src);
} else {
- current = current.next = new Assign(dst, src, null);
+ current = current.next = Assign.makeStatement(dst, src);
}
}
@@ -371,7 +370,7 @@
definition.next = visit(node.body);
return definition;
} else {
- return new Assign(variable, definition, visit(node.body));
+ return Assign.makeStatement(variable, definition, visit(node.body));
}
}
@@ -454,6 +453,19 @@
return continueWithExpression(node.continuation, concat);
}
+ Statement visitThrow(cps_ir.Throw node) {
+ Expression value = getVariableUse(node.value);
+ return new Throw(value);
+ }
+
+ Statement visitRethrow(cps_ir.Rethrow node) {
+ return new Rethrow();
+ }
+
+ Expression visitNonTailThrow(cps_ir.NonTailThrow node) {
+ unexpectedNode(node);
+ }
+
Statement continueWithExpression(cps_ir.Reference continuation,
Expression expression) {
cps_ir.Continuation cont = continuation.definition;
@@ -474,8 +486,10 @@
Statement body = visit(node.body);
// If the variable was captured by an inner function in the body, this
// must be declared here so we assign to a fresh copy of the variable.
- bool needsDeclaration = variable.isCaptured;
- return new Assign(variable, value, body, isDeclaration: needsDeclaration);
+ if (variable.isCaptured) {
+ return new VariableDeclaration(variable, value, body);
+ }
+ return Assign.makeStatement(variable, value, body);
}
Expression visitGetMutableVariable(cps_ir.GetMutableVariable node) {
@@ -485,7 +499,7 @@
Statement visitSetMutableVariable(cps_ir.SetMutableVariable node) {
Variable variable = getMutableVariable(node.variable.definition);
Expression value = getVariableUse(node.value);
- return new Assign(variable, value, visit(node.body));
+ return Assign.makeStatement(variable, value, visit(node.body));
}
Statement visitDeclareFunction(cps_ir.DeclareFunction node) {
diff --git a/pkg/compiler/lib/src/tree_ir/tree_ir_integrity.dart b/pkg/compiler/lib/src/tree_ir/tree_ir_integrity.dart
index 8829e70..20225c9 100644
--- a/pkg/compiler/lib/src/tree_ir/tree_ir_integrity.dart
+++ b/pkg/compiler/lib/src/tree_ir/tree_ir_integrity.dart
@@ -65,17 +65,16 @@
read(node.variable);
}
+ visitVariableDeclaration(VariableDeclaration node) {
+ visitExpression(node.value);
+ declare(node.variable);
+ visitStatement(node.next);
+ undeclare(node.variable);
+ }
+
visitAssign(Assign node) {
visitExpression(node.value);
- if (node.isDeclaration) {
- declare(node.variable);
- } else {
- write(node.variable);
- }
- visitStatement(node.next);
- if (node.isDeclaration) {
- undeclare(node.variable);
- }
+ write(node.variable);
}
visitTry(Try node) {
diff --git a/pkg/compiler/lib/src/tree_ir/tree_ir_nodes.dart b/pkg/compiler/lib/src/tree_ir/tree_ir_nodes.dart
index 92abcc8..5c86d83 100644
--- a/pkg/compiler/lib/src/tree_ir/tree_ir_nodes.dart
+++ b/pkg/compiler/lib/src/tree_ir/tree_ir_nodes.dart
@@ -42,13 +42,6 @@
abstract class Expression extends Node {
accept(ExpressionVisitor v);
accept1(ExpressionVisitor1 v, arg);
-
- /// Temporary variable used by [StatementRewriter].
- /// If set to true, this expression has already had enclosing assignments
- /// propagated into its variables, and should not be processed again.
- /// It is only set for expressions that are known to be in risk of redundant
- /// processing.
- bool processed = false;
}
abstract class Statement extends Node {
@@ -143,6 +136,24 @@
}
}
+class Assign extends Expression {
+ Variable variable;
+ Expression value;
+
+ Assign(this.variable, this.value) {
+ variable.writeCount++;
+ }
+
+ accept(ExpressionVisitor v) => v.visitAssign(this);
+ accept1(ExpressionVisitor1 v, arg) => v.visitAssign(this, arg);
+
+ static ExpressionStatement makeStatement(Variable variable,
+ Expression value,
+ [Statement next]) {
+ return new ExpressionStatement(new Assign(variable, value), next);
+ }
+}
+
/**
* Common interface for invocations with arguments.
*/
@@ -162,6 +173,14 @@
final Selector selector;
final SourceInformation sourceInformation;
+ /// True if the [target] is known not to diverge or read or write any
+ /// mutable state.
+ ///
+ /// This is set for calls to `getInterceptor` and `identical` to indicate
+ /// that they can be safely be moved across an impure expression
+ /// (assuming the [arguments] are not affected by the impure expression).
+ bool isEffectivelyConstant = false;
+
InvokeStatic(this.target, this.selector, this.arguments,
{this.sourceInformation});
@@ -254,8 +273,9 @@
Constant(this.expression);
- Constant.primitive(values.PrimitiveConstantValue primitiveValue)
- : expression = new PrimitiveConstantExpression(primitiveValue);
+ Constant.bool(values.BoolConstantValue constantValue)
+ : expression = new BoolConstantExpression(
+ constantValue.primitiveValue, constantValue);
accept(ExpressionVisitor visitor) => visitor.visitConstant(this);
accept1(ExpressionVisitor1 visitor, arg) => visitor.visitConstant(this, arg);
@@ -519,33 +539,26 @@
accept1(StatementVisitor1 visitor, arg) => visitor.visitContinue(this, arg);
}
-/**
- * An assignments of an [Expression] to a [Variable].
- *
- * In contrast to the CPS-based IR, non-primitive expressions can be assigned
- * to variables.
- */
-class Assign extends Statement {
- Statement next;
+/// Declares a captured [variable] with an initial [value].
+///
+/// All uses of the variable must be inside the [next] statement.
+class VariableDeclaration extends Statement implements DartSpecificNode {
Variable variable;
Expression value;
+ Statement next;
- /// If true, this assignes to a fresh variable scoped to the [next]
- /// statement.
- ///
- /// Variable declarations themselves are hoisted to function level.
- bool isDeclaration;
-
- /// Creates an assignment to [variable] and updates its `writeCount`.
- Assign(this.variable, this.value, this.next,
- { this.isDeclaration: false }) {
- variable.writeCount++;
+ VariableDeclaration(this.variable, this.value, this.next) {
+ assert(variable.isCaptured); // Because otherwise no declaration is needed.
+ ++variable.writeCount;
}
- bool get hasExactlyOneUse => variable.readCount == 1;
+ accept(StatementVisitor visitor) {
+ return visitor.visitVariableDeclaration(this);
+ }
- accept(StatementVisitor visitor) => visitor.visitAssign(this);
- accept1(StatementVisitor1 visitor, arg) => visitor.visitAssign(this, arg);
+ accept1(StatementVisitor1 visitor, arg) {
+ return visitor.visitVariableDeclaration(this, arg);
+ }
}
/**
@@ -570,6 +583,37 @@
accept1(StatementVisitor1 visitor, arg) => visitor.visitReturn(this, arg);
}
+/// A throw statement.
+///
+/// In the Tree IR, throw is a statement (like JavaScript and unlike Dart).
+/// It does not have a successor statement.
+class Throw extends Statement {
+ Expression value;
+
+ Statement get next => null;
+ void set next(Statement s) => throw 'UNREACHABLE';
+
+ Throw(this.value);
+
+ accept(StatementVisitor visitor) => visitor.visitThrow(this);
+ accept1(StatementVisitor1 visitor, arg) => visitor.visitThrow(this, arg);
+}
+
+/// A rethrow of an exception.
+///
+/// Rethrow can only occur nested inside a catch block. It implicitly throws
+/// the block's caught exception value without changing the caught stack
+/// trace. It does not have a successor statement.
+class Rethrow extends Statement {
+ Statement get next => null;
+ void set next(Statement s) => throw 'UNREACHABLE';
+
+ Rethrow();
+
+ accept(StatementVisitor visitor) => visitor.visitRethrow(this);
+ accept1(StatementVisitor1 visitor, arg) => visitor.visitRethrow(this, arg);
+}
+
/**
* A conditional branch based on the true value of an [Expression].
*/
@@ -818,16 +862,15 @@
accept1(ExpressionVisitor1 visitor, arg) => visitor.visitGetField(this, arg);
}
-class SetField extends Statement implements JsSpecificNode {
+class SetField extends Expression implements JsSpecificNode {
Expression object;
Element field;
Expression value;
- Statement next;
- SetField(this.object, this.field, this.value, this.next);
+ SetField(this.object, this.field, this.value);
- accept(StatementVisitor visitor) => visitor.visitSetField(this);
- accept1(StatementVisitor1 visitor, arg) => visitor.visitSetField(this, arg);
+ accept(ExpressionVisitor visitor) => visitor.visitSetField(this);
+ accept1(ExpressionVisitor1 visitor, arg) => visitor.visitSetField(this, arg);
}
class ReifyRuntimeType extends Expression implements JsSpecificNode {
@@ -880,6 +923,7 @@
abstract class ExpressionVisitor<E> {
E visitExpression(Expression node) => node.accept(this);
E visitVariableUse(VariableUse node);
+ E visitAssign(Assign node);
E visitInvokeStatic(InvokeStatic node);
E visitInvokeMethod(InvokeMethod node);
E visitInvokeMethodDirectly(InvokeMethodDirectly node);
@@ -901,11 +945,13 @@
E visitReifyRuntimeType(ReifyRuntimeType node);
E visitReadTypeVariable(ReadTypeVariable node);
E visitTypeExpression(TypeExpression node);
+ E visitSetField(SetField node);
}
abstract class ExpressionVisitor1<E, A> {
E visitExpression(Expression node, A arg) => node.accept1(this, arg);
E visitVariableUse(VariableUse node, A arg);
+ E visitAssign(Assign node, A arg);
E visitInvokeStatic(InvokeStatic node, A arg);
E visitInvokeMethod(InvokeMethod node, A arg);
E visitInvokeMethodDirectly(InvokeMethodDirectly node, A arg);
@@ -927,38 +973,41 @@
E visitReifyRuntimeType(ReifyRuntimeType node, A arg);
E visitReadTypeVariable(ReadTypeVariable node, A arg);
E visitTypeExpression(TypeExpression node, A arg);
+ E visitSetField(SetField node, A arg);
}
abstract class StatementVisitor<S> {
S visitStatement(Statement node) => node.accept(this);
S visitLabeledStatement(LabeledStatement node);
- S visitAssign(Assign node);
S visitReturn(Return node);
+ S visitThrow(Throw node);
+ S visitRethrow(Rethrow node);
S visitBreak(Break node);
S visitContinue(Continue node);
S visitIf(If node);
S visitWhileTrue(WhileTrue node);
S visitWhileCondition(WhileCondition node);
S visitFunctionDeclaration(FunctionDeclaration node);
+ S visitVariableDeclaration(VariableDeclaration node);
S visitExpressionStatement(ExpressionStatement node);
S visitTry(Try node);
- S visitSetField(SetField node);
}
abstract class StatementVisitor1<S, A> {
S visitStatement(Statement node, A arg) => node.accept1(this, arg);
S visitLabeledStatement(LabeledStatement node, A arg);
- S visitAssign(Assign node, A arg);
S visitReturn(Return node, A arg);
+ S visitThrow(Throw node, A arg);
+ S visitRethrow(Rethrow node, A arg);
S visitBreak(Break node, A arg);
S visitContinue(Continue node, A arg);
S visitIf(If node, A arg);
S visitWhileTrue(WhileTrue node, A arg);
S visitWhileCondition(WhileCondition node, A arg);
S visitFunctionDeclaration(FunctionDeclaration node, A arg);
+ S visitVariableDeclaration(VariableDeclaration node, A arg);
S visitExpressionStatement(ExpressionStatement node, A arg);
S visitTry(Try node, A arg);
- S visitSetField(SetField node, A arg);
}
abstract class RootVisitor<T> {
@@ -981,6 +1030,7 @@
T visitSuperInitializer(SuperInitializer node);
}
+
abstract class InitializerVisitor1<T, A> {
T visitInitializer(Initializer node, A arg) => node.accept1(this, arg);
T visitFieldInitializer(FieldInitializer node, A arg);
@@ -993,12 +1043,22 @@
visitInnerFunction(FunctionDefinition node);
- visitVariable(Variable node) {}
+ visitVariable(Variable variable) {}
visitVariableUse(VariableUse node) {
visitVariable(node.variable);
}
+ visitVariableDeclaration(VariableDeclaration node) {
+ visitVariable(node.variable);
+ visitStatement(node.next);
+ }
+
+ visitAssign(Assign node) {
+ visitVariable(node.variable);
+ visitExpression(node.value);
+ }
+
visitInvokeStatic(InvokeStatic node) {
node.arguments.forEach(visitExpression);
}
@@ -1066,16 +1126,16 @@
visitStatement(node.next);
}
- visitAssign(Assign node) {
- visitExpression(node.value);
- visitVariable(node.variable);
- visitStatement(node.next);
- }
-
visitReturn(Return node) {
visitExpression(node.value);
}
+ visitThrow(Throw node) {
+ visitExpression(node.value);
+ }
+
+ visitRethrow(Rethrow node) {}
+
visitBreak(Break node) {}
visitContinue(Continue node) {}
@@ -1118,7 +1178,6 @@
visitSetField(SetField node) {
visitExpression(node.object);
visitExpression(node.value);
- visitStatement(node.next);
}
visitCreateBox(CreateBox node) {
@@ -1161,6 +1220,16 @@
visitVariableUse(VariableUse node) => node;
+ visitVariableDeclaration(VariableDeclaration node) {
+ node.next = visitStatement(node.next);
+ return node;
+ }
+
+ visitAssign(Assign node) {
+ node.value = visitExpression(node.value);
+ return node;
+ }
+
visitInvokeStatic(InvokeStatic node) {
_replaceExpressions(node.arguments);
return node;
@@ -1241,17 +1310,18 @@
return node;
}
- visitAssign(Assign node) {
- node.value = visitExpression(node.value);
- node.next = visitStatement(node.next);
- return node;
- }
-
visitReturn(Return node) {
node.value = visitExpression(node.value);
return node;
}
+ visitThrow(Throw node) {
+ node.value = visitExpression(node.value);
+ return node;
+ }
+
+ visitRethrow(Rethrow node) => node;
+
visitBreak(Break node) => node;
visitContinue(Continue node) => node;
@@ -1301,7 +1371,6 @@
visitSetField(SetField node) {
node.object = visitExpression(node.object);
node.value = visitExpression(node.value);
- node.next = visitStatement(node.next);
return node;
}
diff --git a/pkg/compiler/lib/src/tree_ir/tree_ir_tracer.dart b/pkg/compiler/lib/src/tree_ir/tree_ir_tracer.dart
index a6423f3..703885e 100644
--- a/pkg/compiler/lib/src/tree_ir/tree_ir_tracer.dart
+++ b/pkg/compiler/lib/src/tree_ir/tree_ir_tracer.dart
@@ -76,12 +76,15 @@
visitStatement(node.next);
}
- visitAssign(Assign node) {
+ visitReturn(Return node) {
_addStatement(node);
- visitStatement(node.next);
}
- visitReturn(Return node) {
+ visitThrow(Throw node) {
+ _addStatement(node);
+ }
+
+ visitRethrow(Rethrow node) {
_addStatement(node);
}
@@ -173,11 +176,10 @@
visitStatement(node.next);
}
- visitSetField(SetField node) {
+ visitVariableDeclaration(VariableDeclaration node) {
_addStatement(node);
visitStatement(node.next);
}
-
}
class TreeTracer extends TracerUtil with StatementVisitor {
@@ -266,18 +268,18 @@
// These do not get added to a block's list of statements.
}
- visitAssign(Assign node) {
- String name = names.varName(node.variable);
- String rhs = expr(node.value);
- Variable v = node.variable;
- String extra = "(r=${v.readCount}, w=${v.writeCount})";
- printStatement(null, "assign $name = $rhs $extra");
- }
-
visitReturn(Return node) {
printStatement(null, "return ${expr(node.value)}");
}
+ visitThrow(Throw node) {
+ printStatement(null, "throw ${expr(node.value)}");
+ }
+
+ visitRethrow(Rethrow node) {
+ printStatement(null, "rethrow");
+ }
+
visitBreak(Break node) {
printStatement(null, "break ${collector.breakTargets[node.target].name}");
}
@@ -321,6 +323,12 @@
printStatement(null, 'function ${node.definition.element.name}');
}
+ visitVariableDeclaration(VariableDeclaration node) {
+ String variable = names.varName(node.variable);
+ String value = expr(node.value);
+ printStatement(null, 'declare $variable = $value');
+ }
+
visitSetField(SetField node) {
String object = expr(node.object);
String field = node.field.name;
@@ -345,6 +353,12 @@
return names.varName(node.variable);
}
+ String visitAssign(Assign node) {
+ String variable = names.varName(node.variable);
+ String value = visitExpression(node.value);
+ return '$variable = $value';
+ }
+
String formatArguments(Invoke node) {
List<String> args = new List<String>();
int positionalArgumentCount = node.selector.positionalArgumentCount;
@@ -426,7 +440,10 @@
}
static bool usesInfixNotation(Expression node) {
- return node is Conditional || node is LogicalOperator;
+ return node is Conditional ||
+ node is LogicalOperator ||
+ node is Assign ||
+ node is SetField;
}
String visitConditional(Conditional node) {
@@ -483,6 +500,16 @@
return '$object.$field';
}
+ String visitSetField(SetField node) {
+ String object = visitExpression(node.object);
+ String field = node.field.name;
+ if (usesInfixNotation(node.object)) {
+ object = '($object)';
+ }
+ String value = visitExpression(node.value);
+ return '$object.$field = $value';
+ }
+
String visitCreateBox(CreateBox node) {
return 'CreateBox';
}
diff --git a/pkg/compiler/lib/src/typechecker.dart b/pkg/compiler/lib/src/typechecker.dart
index 078086c..82d8291 100644
--- a/pkg/compiler/lib/src/typechecker.dart
+++ b/pkg/compiler/lib/src/typechecker.dart
@@ -817,6 +817,17 @@
// getter.
reportTypeWarning(node, MessageKind.GETTER_NOT_FOUND,
{'className': receiverType.name, 'memberName': name});
+ } else if (name == 'await') {
+ Map arguments = {'className': receiverType.name};
+ String functionName = executableContext.name;
+ MessageKind kind;
+ if (functionName == '') {
+ kind = MessageKind.AWAIT_MEMBER_NOT_FOUND_IN_CLOSURE;
+ } else {
+ kind = MessageKind.AWAIT_MEMBER_NOT_FOUND;
+ arguments['functionName'] = functionName;
+ }
+ reportTypeWarning(node, kind, arguments);
} else {
reportTypeWarning(node, MessageKind.MEMBER_NOT_FOUND,
{'className': receiverType.name, 'memberName': name});
@@ -912,18 +923,18 @@
if (error) {
// TODO(johnniwinther): Improve access to declaring element and handle
// synthesized member signatures. Currently function typed instance
- // members provide no access to there own name.
+ // members provide no access to their own name.
if (element == null) {
element = type.element;
- } else if (type.element.isTypedef) {
- if (element != null) {
- reportTypeInfo(element,
- MessageKind.THIS_IS_THE_DECLARATION,
- {'name': element.name});
- }
+ } else if (type.isTypedef) {
+ reportTypeInfo(element,
+ MessageKind.THIS_IS_THE_DECLARATION,
+ {'name': element.name});
element = type.element;
}
- reportTypeInfo(element, MessageKind.THIS_IS_THE_METHOD);
+ if (element != null) {
+ reportTypeInfo(element, MessageKind.THIS_IS_THE_METHOD);
+ }
}
} else {
while(!arguments.isEmpty) {
diff --git a/pkg/compiler/lib/src/universe/side_effects.dart b/pkg/compiler/lib/src/universe/side_effects.dart
index 01e4407..6b35429 100644
--- a/pkg/compiler/lib/src/universe/side_effects.dart
+++ b/pkg/compiler/lib/src/universe/side_effects.dart
@@ -28,7 +28,10 @@
setDependsOnSomething();
}
- SideEffects.empty();
+ SideEffects.empty() {
+ clearAllDependencies();
+ clearAllSideEffects();
+ }
bool operator==(other) => _flags == other._flags;
diff --git a/pkg/compiler/lib/src/universe/universe.dart b/pkg/compiler/lib/src/universe/universe.dart
index 590bb54..712b870 100644
--- a/pkg/compiler/lib/src/universe/universe.dart
+++ b/pkg/compiler/lib/src/universe/universe.dart
@@ -285,12 +285,8 @@
// TODO(johnniwinther): Cache hash code?
int get hashCode {
- int named = namedArguments.length;
- int hash = mixHashCodeBits(argumentCount, named);
- for (int i = 0; i < named; i++) {
- hash = mixHashCodeBits(hash, namedArguments[i].hashCode);
- }
- return hash;
+ return Hashing.listHash(namedArguments,
+ Hashing.objectHash(argumentCount, namedArguments.length));
}
bool operator ==(other) {
@@ -759,9 +755,9 @@
Name name,
CallStructure callStructure) {
// Add bits from name and kind.
- int hash = mixHashCodeBits(name.hashCode, kind.hashCode);
+ int hash = Hashing.mixHashCodeBits(name.hashCode, kind.hashCode);
// Add bits from the call structure.
- return mixHashCodeBits(hash, callStructure.hashCode);
+ return Hashing.mixHashCodeBits(hash, callStructure.hashCode);
}
String toString() {
@@ -810,7 +806,7 @@
.putIfAbsent(untyped, () => new Map<TypeMask, TypedSelector>());
TypedSelector result = map[mask];
if (result == null) {
- int hashCode = mixHashCodeBits(untyped.hashCode, mask.hashCode);
+ int hashCode = Hashing.mixHashCodeBits(untyped.hashCode, mask.hashCode);
result = map[mask] = new TypedSelector.internal(mask, untyped, hashCode);
}
return result;
diff --git a/pkg/compiler/lib/src/use_unused_api.dart b/pkg/compiler/lib/src/use_unused_api.dart
index 538a0e2..dd54759 100644
--- a/pkg/compiler/lib/src/use_unused_api.dart
+++ b/pkg/compiler/lib/src/use_unused_api.dart
@@ -11,6 +11,7 @@
import '../compiler.dart' as api;
import 'colors.dart' as colors;
+import 'constants/constant_system.dart' as constants;
import 'constants/values.dart' as constants;
import 'cps_ir/cps_ir_builder.dart' as ir_builder;
import 'cps_ir/cps_ir_builder_task.dart' as ir_builder;
@@ -26,6 +27,7 @@
import 'inferrer/concrete_types_inferrer.dart' as concrete_types_inferrer;
import 'inferrer/type_graph_inferrer.dart' as type_graph_inferrer;
import 'io/code_output.dart' as io;
+import 'io/source_map_builder.dart' as io;
import 'js/js.dart' as js;
import 'js_backend/js_backend.dart' as js_backend;
import 'js_emitter/js_emitter.dart' as js_emitter;
@@ -41,8 +43,8 @@
PartialClassElement,
PartialFunctionElement;
-class ElementVisitor extends elements_visitor.ElementVisitor {
- visitElement(e) {}
+class ElementVisitor extends elements_visitor.BaseElementVisitor {
+ visitElement(e, a) {}
}
void main(List<String> arguments) {
@@ -64,7 +66,7 @@
useColor();
useFilenames();
useSsa(null);
- useCodeBuffer(null);
+ useIo(null, null);
usedByTests();
useElements(null, null, null, null, null);
useIr(null, null);
@@ -82,7 +84,7 @@
}
void useConstant(constants.ConstantValue constant,
- dart2jslib.ConstantSystem cs) {
+ constants.ConstantSystem cs) {
constant.isObject;
cs.isBool(constant);
}
@@ -154,28 +156,28 @@
void useElementVisitor(ElementVisitor visitor) {
visitor
- ..visit(null)
- ..visitAbstractFieldElement(null)
- ..visitAmbiguousElement(null)
- ..visitBoxFieldElement(null)
- ..visitClassElement(null)
- ..visitClosureClassElement(null)
- ..visitClosureFieldElement(null)
- ..visitCompilationUnitElement(null)
- ..visitConstructorBodyElement(null)
- ..visitElement(null)
- ..visitErroneousElement(null)
- ..visitFieldParameterElement(null)
- ..visitFunctionElement(null)
- ..visitLibraryElement(null)
- ..visitMixinApplicationElement(null)
- ..visitPrefixElement(null)
- ..visitScopeContainerElement(null)
- ..visitTypeDeclarationElement(null)
- ..visitTypeVariableElement(null)
- ..visitTypedefElement(null)
- ..visitVariableElement(null)
- ..visitWarnOnUseElement(null);
+ ..visit(null, null)
+ ..visitAbstractFieldElement(null, null)
+ ..visitAmbiguousElement(null, null)
+ ..visitBoxFieldElement(null, null)
+ ..visitClassElement(null, null)
+ ..visitClosureClassElement(null, null)
+ ..visitClosureFieldElement(null, null)
+ ..visitCompilationUnitElement(null, null)
+ ..visitConstructorBodyElement(null, null)
+ ..visitElement(null, null)
+ ..visitErroneousElement(null, null)
+ ..visitFieldParameterElement(null, null)
+ ..visitFunctionElement(null, null)
+ ..visitLibraryElement(null, null)
+ ..visitMixinApplicationElement(null, null)
+ ..visitPrefixElement(null, null)
+ ..visitScopeContainerElement(null, null)
+ ..visitTypeDeclarationElement(null, null)
+ ..visitTypeVariableElement(null, null)
+ ..visitTypedefElement(null, null)
+ ..visitVariableElement(null, null)
+ ..visitWarnOnUseElement(null, null);
}
useJsNode(js.Node node) {
@@ -211,7 +213,11 @@
new ssa.HStatementSequenceInformation(null);
}
-useCodeBuffer(io.CodeBuffer buffer) {
+useIo(io.CodeBuffer buffer, io.LineColumnMap map) {
+ map..addFirst(null, null, null)
+ ..forEachLine(null)
+ ..getFirstElementsInLine(null)
+ ..forEachColumn(null, null);
}
usedByTests() {
@@ -252,11 +258,7 @@
..hasIr(null)
..getIr(null);
builder
- ..buildIntegerLiteral(null)
- ..buildDoubleLiteral(null)
- ..buildBooleanLiteral(null)
- ..buildNullLiteral()
- ..buildStringLiteral(null)
+ ..buildStringConstant(null)
..buildDynamicGet(null, null);
}
@@ -288,8 +290,9 @@
}
useSemanticVisitor() {
- new semantic_visitor.BulkVisitor().apply(null, null);
+ new semantic_visitor.BulkSendVisitor().apply(null, null);
new semantic_visitor.TraversalVisitor(null).apply(null, null);
+ new semantic_visitor.BulkDeclarationVisitor().apply(null, null);
}
class DummyTreeVisitor extends tree_ir.RootVisitor
diff --git a/pkg/compiler/lib/src/util/util.dart b/pkg/compiler/lib/src/util/util.dart
index b825d18..d26a5c3 100644
--- a/pkg/compiler/lib/src/util/util.dart
+++ b/pkg/compiler/lib/src/util/util.dart
@@ -14,25 +14,53 @@
part 'indentation.dart';
part 'link.dart';
-/// If an integer is masked by this constant, the result is guaranteed to be in
-/// Smi range.
-const int SMI_MASK = 0x3fffffff;
+/// Helper functions for creating hash codes.
+class Hashing {
+ /// If an integer is masked by this constant, the result is guaranteed to be
+ /// in Smi range.
+ static const int SMI_MASK = 0x3fffffff;
-/// Mix the bits of [value] and merge them with [existing].
-int mixHashCodeBits(int existing, int value) {
- // Spread the bits of value. Try to stay in the 30-bit range to
- // avoid overflowing into a more expensive integer representation.
- int h = value & 0x1fffffff;
- h += ((h & 0x3fff) << 15) ^ 0x1fffcd7d;
- h ^= (h >> 10);
- h += ((h & 0x3ffffff) << 3);
- h ^= (h >> 6);
- h += ((h & 0x7ffffff) << 2) + ((h & 0x7fff) << 14);
- h ^= (h >> 16);
- // Combine the two hash values.
- int high = existing >> 15;
- int low = existing & 0x7fff;
- return ((high * 13) ^ (low * 997) ^ h) & SMI_MASK;
+ /// Mix the bits of [value] and merge them with [existing].
+ static int mixHashCodeBits(int existing, int value) {
+ // Spread the bits of value. Try to stay in the 30-bit range to
+ // avoid overflowing into a more expensive integer representation.
+ int h = value & 0x1fffffff;
+ h += ((h & 0x3fff) << 15) ^ 0x1fffcd7d;
+ h ^= (h >> 10);
+ h += ((h & 0x3ffffff) << 3);
+ h ^= (h >> 6);
+ h += ((h & 0x7ffffff) << 2) + ((h & 0x7fff) << 14);
+ h ^= (h >> 16);
+ // Combine the two hash values.
+ int high = existing >> 15;
+ int low = existing & 0x7fff;
+ return ((high * 13) ^ (low * 997) ^ h) & SMI_MASK;
+ }
+
+ /// Mix the bits of `object.hashCode` with [existing].
+ static int objectHash(Object object, [int existing = 0]) {
+ return mixHashCodeBits(existing, object.hashCode);
+ }
+
+ /// Mix the bits of the element hash codes of [list] with [existing].
+ static int listHash(List list, [int existing = 0]) {
+ int h = existing;
+ int length = list.length;
+ for (int i = 0; i < length; i++) {
+ h = mixHashCodeBits(h, list[i].hashCode);
+ }
+ return h;
+ }
+
+ /// Mix the bits of the key/value hash codes from [map] with [existing].
+ static int mapHash(Map map, [int existing = 0]) {
+ int h = existing;
+ for (var key in map.keys) {
+ h = mixHashCodeBits(h, key.hashCode);
+ h = mixHashCodeBits(h, map[key].hashCode);
+ }
+ return h;
+ }
}
/**
diff --git a/pkg/compiler/lib/src/warnings.dart b/pkg/compiler/lib/src/warnings.dart
index 94714195..1b1272ee 100644
--- a/pkg/compiler/lib/src/warnings.dart
+++ b/pkg/compiler/lib/src/warnings.dart
@@ -121,6 +121,28 @@
static const MessageKind MEMBER_NOT_FOUND = const MessageKind(
"No member named '#{memberName}' in class '#{className}'.");
+ static const MessageKind AWAIT_MEMBER_NOT_FOUND = const MessageKind(
+ "No member named 'await' in class '#{className}'.",
+ howToFix: "Did you mean to add the 'async' marker "
+ "to '#{functionName}'?",
+ examples: const ["""
+class A {
+ m() => await -3;
+}
+main() => new A().m();
+"""]);
+
+ static const MessageKind AWAIT_MEMBER_NOT_FOUND_IN_CLOSURE =
+ const MessageKind("No member named 'await' in class '#{className}'.",
+ howToFix: "Did you mean to add the 'async' marker "
+ "to the enclosing function?",
+ examples: const ["""
+class A {
+ m() => () => await -3;
+}
+main() => new A().m();
+"""]);
+
static const MessageKind METHOD_NOT_FOUND = const MessageKind(
"No method named '#{memberName}' in class '#{className}'.");
@@ -130,6 +152,9 @@
static const MessageKind SETTER_NOT_FOUND = const MessageKind(
"No setter named '#{memberName}' in class '#{className}'.");
+ static const MessageKind SETTER_NOT_FOUND_IN_SUPER = const MessageKind(
+ "No setter named '#{name}' in superclass of '#{className}'.");
+
static const MessageKind GETTER_NOT_FOUND = const MessageKind(
"No getter named '#{memberName}' in class '#{className}'.");
@@ -155,6 +180,35 @@
static const MessageKind CANNOT_RESOLVE = const MessageKind(
"Cannot resolve '#{name}'.");
+ static const MessageKind CANNOT_RESOLVE_AWAIT = const MessageKind(
+ "Cannot resolve '#{name}'.",
+ howToFix: "Did you mean to add the 'async' marker "
+ "to '#{functionName}'?",
+ examples: const [
+ "main() => await -3;",
+ "foo() => await -3; main() => foo();"
+ ]);
+
+ static const MessageKind CANNOT_RESOLVE_AWAIT_IN_CLOSURE = const MessageKind(
+ "Cannot resolve '#{name}'.",
+ howToFix: "Did you mean to add the 'async' marker "
+ "to the enclosing function?",
+ examples: const [
+ "main() { (() => await -3)(); }",
+ ]);
+
+ static const MessageKind CANNOT_RESOLVE_IN_INITIALIZER = const MessageKind(
+ "Cannot resolve '#{name}'. It would be implicitly looked up on this "
+ "instance, but instances are not available in initializers.",
+ howToFix: "Try correcting the unresolved reference or move the "
+ "initialization to a constructor body.",
+ examples: const ["""
+class A {
+ var test = unresolvedName;
+}
+main() => new A();
+"""]);
+
static const MessageKind CANNOT_RESOLVE_CONSTRUCTOR = const MessageKind(
"Cannot resolve constructor '#{constructorName}'.");
@@ -1114,6 +1168,10 @@
static const MessageKind ASSIGNING_METHOD = const MessageKind(
"Cannot assign a value to a method.");
+ static const MessageKind ASSIGNING_METHOD_IN_SUPER = const MessageKind(
+ "Cannot assign a value to method '#{name}' "
+ "in superclass '#{superclassName}'.");
+
static const MessageKind ASSIGNING_TYPE = const MessageKind(
"Cannot assign a value to a type.");
diff --git a/pkg/docgen/lib/src/models/model_helpers.dart b/pkg/docgen/lib/src/models/model_helpers.dart
index d587681..816d4d3 100644
--- a/pkg/docgen/lib/src/models/model_helpers.dart
+++ b/pkg/docgen/lib/src/models/model_helpers.dart
@@ -101,6 +101,12 @@
}
@override
+ Annotation visitIdentical(IdenticalConstantExpression exp,
+ AnnotationInfo context) {
+ return null;
+ }
+
+ @override
Annotation visitConcatenate(ConcatenateConstantExpression exp,
AnnotationInfo context) {
return null;
@@ -166,6 +172,12 @@
AnnotationInfo context) {
return createAnnotation(exp.element, context);
}
+
+ @override
+ Annotation visitDeferred(DeferredConstantExpression exp,
+ AnnotationInfo context) {
+ return exp.expression.accept(this, context);
+ }
}
/// A declaration is private if itself is private, or the owner is private.
diff --git a/pkg/docgen/pubspec.yaml b/pkg/docgen/pubspec.yaml
index e9f59be..d3c1b29 100644
--- a/pkg/docgen/pubspec.yaml
+++ b/pkg/docgen/pubspec.yaml
@@ -3,7 +3,7 @@
description: A documentation generator for the Dart repository.
homepage: https://www.dartlang.org/
dependencies:
- args: '>=0.9.0 <0.13.0'
+ args: '>=0.9.0 <0.14.0'
logging: '>=0.9.0 <0.10.0'
markdown: 0.7.0
path: '>=0.9.0 <2.0.0'
diff --git a/pkg/js_ast/lib/src/builder.dart b/pkg/js_ast/lib/src/builder.dart
index 5d8da87..12f204e 100644
--- a/pkg/js_ast/lib/src/builder.dart
+++ b/pkg/js_ast/lib/src/builder.dart
@@ -257,6 +257,15 @@
}
/**
+ * Creates an Expression template for the given [source].
+ *
+ * The returned template is cached.
+ */
+ Template expressionTemplateFor(String source) {
+ return _findExpressionTemplate(source);
+ }
+
+ /**
* Creates an Expression template without caching the result.
*/
Template uncachedExpressionTemplate(String source) {
@@ -611,11 +620,14 @@
position++;
if (position == src.length) break;
int code = src.codeUnitAt(position);
- // Special code to disallow ! and / in non-first position in token, so
- // that !! parses as two tokens and != parses as one, while =/ parses
- // as a an equals token followed by a regexp literal start.
- newCat = (code == charCodes.$BANG || code == charCodes.$SLASH)
- ? NONE
+ // Special code to disallow !, ~ and / in non-first position in token,
+ // so that !! and ~~ parse as two tokens and != parses as one, while =/
+ // parses as a an equals token followed by a regexp literal start.
+ newCat =
+ (code == charCodes.$BANG ||
+ code == charCodes.$SLASH ||
+ code == charCodes.$TILDE)
+ ? NONE
: category(code);
} while (!singleCharCategory(cat) &&
(cat == newCat ||
diff --git a/pkg/js_ast/lib/src/printer.dart b/pkg/js_ast/lib/src/printer.dart
index f362be5..917fcf4 100644
--- a/pkg/js_ast/lib/src/printer.dart
+++ b/pkg/js_ast/lib/src/printer.dart
@@ -26,11 +26,24 @@
/// Adds [string] to the output.
void emit(String string);
- /// Callback immediately before printing [node]. Whitespace may be printed
- /// after this callback before the first non-whitespace character for [node].
- void enterNode(Node node) {}
- /// Callback after printing the last character representing [node].
- void exitNode(Node node) {}
+ /// Callback for the start of printing of [node]. [startPosition] is the
+ /// position of the first non-whitespace character of [node].
+ ///
+ /// [enterNode] is called in pre-traversal order.
+ void enterNode(Node node, int startPosition) {}
+
+ /// Callback for the end of printing of [node]. [startPosition] is the
+ /// position of the first non-whitespace character of [node] (also provided
+ /// in the [enterNode] callback), [endPosition] is the position immediately
+ /// following the last character of [node]. [closingPosition] is the
+ /// position of the ending delimiter of [node]. This is only provided for
+ /// [Fun] nodes and is `null` otherwise.
+ ///
+ /// [enterNode] is called in post-traversal order.
+ void exitNode(Node node,
+ int startPosition,
+ int endPosition,
+ int closingPosition) {}
}
/// A simple implementation of [JavaScriptPrintingContext] suitable for tests.
@@ -52,6 +65,7 @@
final DanglingElseVisitor danglingElseVisitor;
final LocalNamer localNamer;
+ int _charCount = 0;
bool inForInit = false;
bool atStatementBegin = false;
bool pendingSemicolon = false;
@@ -98,31 +112,33 @@
_indentLevel--;
}
-
/// Always emit a newline, even under `enableMinification`.
void forceLine() {
- out("\n");
+ out("\n", isWhitespace: true);
}
+
/// Emits a newline for readability.
void lineOut() {
if (!shouldCompressOutput) forceLine();
}
+
void spaceOut() {
- if (!shouldCompressOutput) out(" ");
+ if (!shouldCompressOutput) out(" ", isWhitespace: true);
}
String lastAddedString = null;
+
int get lastCharCode {
if (lastAddedString == null) return 0;
assert(lastAddedString.length != "");
return lastAddedString.codeUnitAt(lastAddedString.length - 1);
}
- void out(String str) {
+ void out(String str, {bool isWhitespace: false}) {
if (str != "") {
if (pendingSemicolon) {
if (!shouldCompressOutput) {
- context.emit(";");
+ _emit(";");
} else if (str != "}") {
// We want to output newline instead of semicolon because it makes
// the raw stack traces much easier to read and it also makes line-
@@ -137,19 +153,22 @@
// than newlines because the former doesn't need escaping.
if (options.preferSemicolonToNewlineInMinifiedOutput ||
expressionContinuationRegExp.hasMatch(str)) {
- context.emit(";");
+ _emit(";");
} else {
- context.emit("\n");
+ _emit("\n");
}
}
}
if (pendingSpace &&
(!shouldCompressOutput || identifierCharacterRegExp.hasMatch(str))) {
- context.emit(" ");
+ _emit(" ");
}
pendingSpace = false;
pendingSemicolon = false;
- context.emit(str);
+ if (!isWhitespace) {
+ enterNode();
+ }
+ _emit(str);
lastAddedString = str;
}
}
@@ -168,22 +187,50 @@
}
}
- void outIndent(String str) { indent(); out(str); }
- void outIndentLn(String str) { indent(); outLn(str); }
+ void outIndent(String str) {
+ indent();
+ out(str);
+ }
+
+ void outIndentLn(String str) {
+ indent();
+ outLn(str);
+ }
+
void indent() {
if (!shouldCompressOutput) {
- out(indentation);
+ out(indentation, isWhitespace: true);
}
}
- visit(Node node) {
- context.enterNode(node);
- node.accept(this);
- context.exitNode(node);
+ EnterExitNode currentNode;
+
+ void _emit(String text) {
+ context.emit(text);
+ _charCount += text.length;
}
- visitCommaSeparated(List<Node> nodes, int hasRequiredType,
- {bool newInForInit, bool newAtStatementBegin}) {
+ void startNode(Node node) {
+ currentNode = new EnterExitNode(currentNode, node);
+ }
+
+ void enterNode() {
+ currentNode.addToNode(context, _charCount);
+ }
+
+ void endNode(Node node) {
+ assert(currentNode.node == node);
+ currentNode = currentNode.exitNode(context, _charCount);
+ }
+
+ void visit(Node node) {
+ startNode(node);
+ node.accept(this);
+ endNode(node);
+ }
+
+ void visitCommaSeparated(List<Node> nodes, int hasRequiredType,
+ {bool newInForInit, bool newAtStatementBegin}) {
for (int i = 0; i < nodes.length; i++) {
if (i != 0) {
atStatementBegin = false;
@@ -196,12 +243,15 @@
}
}
- visitAll(List<Node> nodes) {
+ void visitAll(List<Node> nodes) {
nodes.forEach(visit);
}
- visitProgram(Program program) {
- visitAll(program.body);
+ @override
+ void visitProgram(Program program) {
+ if (program.body.isNotEmpty) {
+ visitAll(program.body);
+ }
}
Statement unwrapBlockIfSingleStatement(Statement body) {
@@ -223,7 +273,7 @@
if (shouldCompressOutput && needsSeparation) {
// If [shouldCompressOutput] is false, then the 'lineOut' will insert
// the separation.
- out(" ");
+ out(" ", isWhitespace: true);
} else {
lineOut();
}
@@ -235,18 +285,18 @@
void blockOutWithoutBraces(Node node) {
if (node is Block) {
- context.enterNode(node);
+ startNode(node);
Block block = node;
block.statements.forEach(blockOutWithoutBraces);
- context.exitNode(node);
+ endNode(node);
} else {
visit(node);
}
}
- void blockOut(Block node, {bool shouldIndent, bool needsNewline}) {
+ int blockOut(Block node, {bool shouldIndent, bool needsNewline}) {
if (shouldIndent) indent();
- context.enterNode(node);
+ startNode(node);
out("{");
lineOut();
indentMore();
@@ -254,22 +304,27 @@
indentLess();
indent();
out("}");
- context.exitNode(node);
+ int closingPosition = _charCount - 1;
+ endNode(node);
if (needsNewline) lineOut();
+ return closingPosition;
}
- visitBlock(Block block) {
+ @override
+ void visitBlock(Block block) {
blockOut(block, shouldIndent: true, needsNewline: true);
}
- visitExpressionStatement(ExpressionStatement expressionStatement) {
+ @override
+ void visitExpressionStatement(ExpressionStatement node) {
indent();
- visitNestedExpression(expressionStatement.expression, EXPRESSION,
+ visitNestedExpression(node.expression, EXPRESSION,
newInForInit: false, newAtStatementBegin: true);
outSemicolonLn();
}
- visitEmptyStatement(EmptyStatement nop) {
+ @override
+ void visitEmptyStatement(EmptyStatement node) {
outIndentLn(";");
}
@@ -313,11 +368,13 @@
}
}
- visitIf(If node) {
+ @override
+ void visitIf(If node) {
ifOut(node, true);
}
- visitFor(For loop) {
+ @override
+ void visitFor(For loop) {
outIndent("for");
spaceOut();
out("(");
@@ -342,7 +399,8 @@
needsSeparation: false, needsNewline: true);
}
- visitForIn(ForIn loop) {
+ @override
+ void visitForIn(ForIn loop) {
outIndent("for");
spaceOut();
out("(");
@@ -357,7 +415,8 @@
needsSeparation: false, needsNewline: true);
}
- visitWhile(While loop) {
+ @override
+ void visitWhile(While loop) {
outIndent("while");
spaceOut();
out("(");
@@ -368,7 +427,8 @@
needsSeparation: false, needsNewline: true);
}
- visitDo(Do loop) {
+ @override
+ void visitDo(Do loop) {
outIndent("do");
if (blockBody(unwrapBlockIfSingleStatement(loop.body),
needsSeparation: true, needsNewline: false)) {
@@ -385,7 +445,8 @@
outSemicolonLn();
}
- visitContinue(Continue node) {
+ @override
+ void visitContinue(Continue node) {
if (node.targetLabel == null) {
outIndent("continue");
} else {
@@ -394,7 +455,8 @@
outSemicolonLn();
}
- visitBreak(Break node) {
+ @override
+ void visitBreak(Break node) {
if (node.targetLabel == null) {
outIndent("break");
} else {
@@ -403,7 +465,8 @@
outSemicolonLn();
}
- visitReturn(Return node) {
+ @override
+ void visitReturn(Return node) {
if (node.value == null) {
outIndent("return");
} else {
@@ -415,7 +478,8 @@
outSemicolonLn();
}
- visitDartYield(DartYield node) {
+ @override
+ void visitDartYield(DartYield node) {
if (node.hasStar) {
outIndent("yield*");
} else {
@@ -427,8 +491,8 @@
outSemicolonLn();
}
-
- visitThrow(Throw node) {
+ @override
+ void visitThrow(Throw node) {
outIndent("throw");
pendingSpace = true;
visitNestedExpression(node.expression, EXPRESSION,
@@ -436,7 +500,8 @@
outSemicolonLn();
}
- visitTry(Try node) {
+ @override
+ void visitTry(Try node) {
outIndent("try");
blockBody(node.body, needsSeparation: true, needsNewline: false);
if (node.catchPart != null) {
@@ -451,7 +516,8 @@
}
}
- visitCatch(Catch node) {
+ @override
+ void visitCatch(Catch node) {
spaceOut();
out("catch");
spaceOut();
@@ -462,7 +528,8 @@
blockBody(node.body, needsSeparation: false, needsNewline: false);
}
- visitSwitch(Switch node) {
+ @override
+ void visitSwitch(Switch node) {
outIndent("switch");
spaceOut();
out("(");
@@ -477,7 +544,8 @@
outIndentLn("}");
}
- visitCase(Case node) {
+ @override
+ void visitCase(Case node) {
outIndent("case");
pendingSpace = true;
visitNestedExpression(node.expression, EXPRESSION,
@@ -490,7 +558,8 @@
}
}
- visitDefault(Default node) {
+ @override
+ void visitDefault(Default node) {
outIndentLn("default:");
if (!node.body.statements.isEmpty) {
indentMore();
@@ -499,7 +568,8 @@
}
}
- visitLabeledStatement(LabeledStatement node) {
+ @override
+ void visitLabeledStatement(LabeledStatement node) {
Statement body = unwrapBlockIfSingleStatement(node.body);
// `label: break label;`
// Does not work on IE. The statement is a nop, so replace it by an empty
@@ -514,7 +584,7 @@
blockBody(body, needsSeparation: false, needsNewline: true);
}
- void functionOut(Fun fun, Node name, VarCollector vars) {
+ int functionOut(Fun fun, Node name, VarCollector vars) {
out("function");
if (name != null) {
out(" ");
@@ -533,19 +603,27 @@
case const AsyncModifier.sync():
break;
case const AsyncModifier.async():
- out(' async');
+ out(' ', isWhitespace: true);
+ out('async');
break;
case const AsyncModifier.syncStar():
- out(' sync*');
+ out(' ', isWhitespace: true);
+ out('sync*');
break;
case const AsyncModifier.asyncStar():
- out(' async*');
+ out(' ', isWhitespace: true);
+ out('async*');
break;
}
- blockBody(fun.body, needsSeparation: false, needsNewline: false);
+ spaceOut();
+ int closingPosition =
+ blockOut(fun.body, shouldIndent: false, needsNewline: false);
localNamer.leaveScope();
+ return closingPosition;
+
}
+ @override
visitFunctionDeclaration(FunctionDeclaration declaration) {
VarCollector vars = new VarCollector();
vars.visitFunctionDeclaration(declaration);
@@ -580,12 +658,14 @@
}
}
+ @override
visitVariableDeclarationList(VariableDeclarationList list) {
out("var ");
visitCommaSeparated(list.declarations, ASSIGNMENT,
newInForInit: inForInit, newAtStatementBegin: false);
}
+ @override
visitAssignment(Assignment assignment) {
visitNestedExpression(assignment.leftHandSide, LEFT_HAND_SIDE,
newInForInit: inForInit,
@@ -602,10 +682,12 @@
}
}
+ @override
visitVariableInitialization(VariableInitialization initialization) {
visitAssignment(initialization);
}
+ @override
visitConditional(Conditional cond) {
visitNestedExpression(cond.condition, LOGICAL_OR,
newInForInit: inForInit,
@@ -623,6 +705,7 @@
newInForInit: inForInit, newAtStatementBegin: false);
}
+ @override
visitNew(New node) {
out("new ");
visitNestedExpression(node.target, CALL,
@@ -633,6 +716,7 @@
out(")");
}
+ @override
visitCall(Call call) {
visitNestedExpression(call.target, LEFT_HAND_SIDE,
newInForInit: inForInit,
@@ -643,7 +727,8 @@
out(")");
}
- visitBinary(Binary binary) {
+ @override
+ void visitBinary(Binary binary) {
Expression left = binary.left;
Expression right = binary.right;
String op = binary.op;
@@ -732,9 +817,9 @@
if (op == "in" || op == "instanceof") {
// There are cases where the space is not required but without further
// analysis we cannot know.
- out(" ");
+ out(" ", isWhitespace: true);
out(op);
- out(" ");
+ out(" ", isWhitespace: true);
} else {
if (leftSpace) spaceOut();
out(op);
@@ -745,7 +830,8 @@
newAtStatementBegin: false);
}
- visitPrefix(Prefix unary) {
+ @override
+ void visitPrefix(Prefix unary) {
String op = unary.op;
switch (op) {
case "delete":
@@ -754,16 +840,16 @@
// There are cases where the space is not required but without further
// analysis we cannot know.
out(op);
- out(" ");
+ out(" ", isWhitespace: true);
break;
case "+":
case "++":
- if (lastCharCode == charCodes.$PLUS) out(" ");
+ if (lastCharCode == charCodes.$PLUS) out(" ", isWhitespace: true);
out(op);
break;
case "-":
case "--":
- if (lastCharCode == charCodes.$MINUS) out(" ");
+ if (lastCharCode == charCodes.$MINUS) out(" ", isWhitespace: true);
out(op);
break;
default:
@@ -773,26 +859,31 @@
newInForInit: inForInit, newAtStatementBegin: false);
}
- visitPostfix(Postfix postfix) {
+ @override
+ void visitPostfix(Postfix postfix) {
visitNestedExpression(postfix.argument, LEFT_HAND_SIDE,
newInForInit: inForInit,
newAtStatementBegin: atStatementBegin);
out(postfix.op);
}
- visitVariableUse(VariableUse ref) {
+ @override
+ void visitVariableUse(VariableUse ref) {
out(localNamer.getName(ref.name));
}
- visitThis(This node) {
+ @override
+ void visitThis(This node) {
out("this");
}
- visitVariableDeclaration(VariableDeclaration decl) {
+ @override
+ void visitVariableDeclaration(VariableDeclaration decl) {
out(localNamer.getName(decl.name));
}
- visitParameter(Parameter param) {
+ @override
+ void visitParameter(Parameter param) {
out(localNamer.getName(param.name));
}
@@ -821,7 +912,8 @@
return true;
}
- visitAccess(PropertyAccess access) {
+ @override
+ void visitAccess(PropertyAccess access) {
visitNestedExpression(access.receiver, CALL,
newInForInit: inForInit,
newAtStatementBegin: atStatementBegin);
@@ -830,7 +922,7 @@
LiteralString selectorString = selector;
String fieldWithQuotes = selectorString.value;
if (isValidJavaScriptId(fieldWithQuotes)) {
- if (access.receiver is LiteralNumber) out(" ");
+ if (access.receiver is LiteralNumber) out(" ", isWhitespace: true);
out(".");
out(fieldWithQuotes.substring(1, fieldWithQuotes.length - 1));
return;
@@ -842,39 +934,49 @@
out("]");
}
- visitNamedFunction(NamedFunction namedFunction) {
+ @override
+ void visitNamedFunction(NamedFunction namedFunction) {
VarCollector vars = new VarCollector();
vars.visitNamedFunction(namedFunction);
- functionOut(namedFunction.function, namedFunction.name, vars);
+ startNode(namedFunction.function);
+ currentNode.closingPosition =
+ functionOut(namedFunction.function, namedFunction.name, vars);
+ endNode(namedFunction.function);
}
- visitFun(Fun fun) {
+ @override
+ void visitFun(Fun fun) {
VarCollector vars = new VarCollector();
vars.visitFun(fun);
- functionOut(fun, null, vars);
+ currentNode.closingPosition = functionOut(fun, null, vars);
}
- visitLiteralBool(LiteralBool node) {
+ @override
+ void visitLiteralBool(LiteralBool node) {
out(node.value ? "true" : "false");
}
- visitLiteralString(LiteralString node) {
+ @override
+ void visitLiteralString(LiteralString node) {
out(node.value);
}
- visitLiteralNumber(LiteralNumber node) {
+ @override
+ void visitLiteralNumber(LiteralNumber node) {
int charCode = node.value.codeUnitAt(0);
if (charCode == charCodes.$MINUS && lastCharCode == charCodes.$MINUS) {
- out(" ");
+ out(" ", isWhitespace: true);
}
out(node.value);
}
- visitLiteralNull(LiteralNull node) {
+ @override
+ void visitLiteralNull(LiteralNull node) {
out("null");
}
- visitArrayInitializer(ArrayInitializer node) {
+ @override
+ void visitArrayInitializer(ArrayInitializer node) {
out("[");
List<Expression> elements = node.elements;
for (int i = 0; i < elements.length; i++) {
@@ -897,11 +999,13 @@
out("]");
}
- visitArrayHole(ArrayHole node) {
- throw "Unreachable";
+ @override
+ void visitArrayHole(ArrayHole node) {
+ context.error("Unreachable");
}
- visitObjectInitializer(ObjectInitializer node) {
+ @override
+ void visitObjectInitializer(ObjectInitializer node) {
// Print all the properties on one line until we see a function-valued
// property. Ideally, we would use a proper pretty-printer to make the
// decision based on layout.
@@ -928,7 +1032,8 @@
out("}");
}
- visitProperty(Property node) {
+ @override
+ void visitProperty(Property node) {
if (node.name is LiteralString) {
LiteralString nameString = node.name;
String name = nameString.value;
@@ -948,11 +1053,13 @@
newInForInit: false, newAtStatementBegin: false);
}
- visitRegExpLiteral(RegExpLiteral node) {
+ @override
+ void visitRegExpLiteral(RegExpLiteral node) {
out(node.pattern);
}
- visitLiteralExpression(LiteralExpression node) {
+ @override
+ void visitLiteralExpression(LiteralExpression node) {
String template = node.template;
List<Expression> inputs = node.inputs;
@@ -970,34 +1077,42 @@
}
}
- visitLiteralStatement(LiteralStatement node) {
+ @override
+ void visitLiteralStatement(LiteralStatement node) {
outLn(node.code);
}
- visitInterpolatedNode(InterpolatedNode node) {
+ void visitInterpolatedNode(InterpolatedNode node) {
out('#${node.nameOrPosition}');
}
- visitInterpolatedExpression(InterpolatedExpression node) =>
+ @override
+ void visitInterpolatedExpression(InterpolatedExpression node) =>
visitInterpolatedNode(node);
- visitInterpolatedLiteral(InterpolatedLiteral node) =>
+ @override
+ void visitInterpolatedLiteral(InterpolatedLiteral node) =>
visitInterpolatedNode(node);
- visitInterpolatedParameter(InterpolatedParameter node) =>
+ @override
+ void visitInterpolatedParameter(InterpolatedParameter node) =>
visitInterpolatedNode(node);
- visitInterpolatedSelector(InterpolatedSelector node) =>
+ @override
+ void visitInterpolatedSelector(InterpolatedSelector node) =>
visitInterpolatedNode(node);
- visitInterpolatedStatement(InterpolatedStatement node) {
+ @override
+ void visitInterpolatedStatement(InterpolatedStatement node) {
outLn('#${node.nameOrPosition}');
}
- visitInterpolatedDeclaration(InterpolatedDeclaration node) {
+ @override
+ void visitInterpolatedDeclaration(InterpolatedDeclaration node) {
visitInterpolatedNode(node);
}
+ @override
void visitComment(Comment node) {
if (shouldCompressOutput) return;
String comment = node.comment.trim();
@@ -1011,6 +1126,7 @@
}
}
+ @override
void visitAwait(Await node) {
out("await ");
visit(node.expression);
@@ -1025,8 +1141,8 @@
OrderedSet() : set = new Set<T>(), list = <T>[];
void add(T x) {
- if (!set.contains(x)) {
- set.add(x);
+ if (set.add(x)) {
+ // [Set.add] returns `true` if 'x' was added.
list.add(x);
}
}
@@ -1274,3 +1390,33 @@
return newName;
}
}
+
+/// Information pertaining the enter and exit callbacks for [node].
+class EnterExitNode {
+ final EnterExitNode parent;
+ final Node node;
+
+ int startPosition;
+ int closingPosition;
+
+ EnterExitNode(this.parent, this.node);
+
+ void addToNode(JavaScriptPrintingContext context, int position) {
+ if (startPosition == null) {
+ // [position] is the start position of [node].
+ if (parent != null) {
+ // This might be the start position of the parent as well.
+ parent.addToNode(context, position);
+ }
+ startPosition = position;
+ context.enterNode(node, position);
+ }
+ }
+
+ EnterExitNode exitNode(JavaScriptPrintingContext context, int position) {
+ // Enter must happen before exit.
+ addToNode(context, position);
+ context.exitNode(node, startPosition, position, closingPosition);
+ return parent;
+ }
+}
\ No newline at end of file
diff --git a/pkg/js_ast/test/printer_callback_test.dart b/pkg/js_ast/test/printer_callback_test.dart
new file mode 100644
index 0000000..1a1db35
--- /dev/null
+++ b/pkg/js_ast/test/printer_callback_test.dart
@@ -0,0 +1,161 @@
+// Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+// Test that JS printer callbacks occur when expected.
+
+library js_ast.printer.callback_test;
+
+import 'package:js_ast/js_ast.dart';
+import 'package:unittest/unittest.dart';
+
+enum TestMode {
+ NONE,
+ ENTER,
+ DELIMITER,
+ EXIT,
+}
+
+const DATA = const [
+ const {
+ TestMode.NONE: """
+function(a, b) {
+ return null;
+}""",
+ TestMode.ENTER: """
+@0function(@1a, @2b) @3{
+ @4return @5null;
+}""",
+ TestMode.DELIMITER: """
+function(a, b) {
+ return null;
+@0}""",
+ TestMode.EXIT: """
+function(a@1, b@2) {
+ return null@5;
+@4}@3@0"""
+ },
+
+ const {
+ TestMode.NONE: """
+function() {
+ if (true) {
+ foo1();
+ foo2();
+ } else {
+ bar1();
+ bar2();
+ }
+ while (false) {
+ baz3();
+ baz4();
+ }
+}""",
+ TestMode.ENTER: """
+@0function() @1{
+ @2if (@3true) @4{
+ @5@6@7foo1();
+ @8@9@10foo2();
+ } else @11{
+ @12@13@14bar1();
+ @15@16@17bar2();
+ }
+ @18while (@19false) @20{
+ @21@22@23baz3();
+ @24@25@26baz4();
+ }
+}""",
+ TestMode.DELIMITER: """
+function() {
+ if (true) {
+ foo1();
+ foo2();
+ } else {
+ bar1();
+ bar2();
+ }
+ while (false) {
+ baz3();
+ baz4();
+ }
+@0}""",
+ TestMode.EXIT: """
+function() {
+ if (true@3) {
+ foo1@7()@6;
+@5 foo2@10()@9;
+@8 }@4 else {
+ bar1@14()@13;
+@12 bar2@17()@16;
+@15 }@11
+@2 while (false@19) {
+ baz3@23()@22;
+@21 baz4@26()@25;
+@24 }@20
+@18}@1@0""",
+ },
+];
+
+void check(Map<TestMode, String> map) {
+ String code = map[TestMode.NONE];
+ JavaScriptPrintingOptions options = new JavaScriptPrintingOptions();
+ Node node = js.parseForeignJS(code).instantiate({});
+ map.forEach((TestMode mode, String expectedOutput) {
+ Context context = new Context(mode);
+ new Printer(options, context).visit(node);
+ expect(context.getText(), equals(expectedOutput),
+ reason: "Unexpected output for $code in $mode");
+ });
+}
+
+class Context extends SimpleJavaScriptPrintingContext {
+ final TestMode mode;
+ final Map<Node, int> idMap = {};
+ final Map<int, List<String>> tagMap = {};
+
+ Context(this.mode);
+
+ int id(Node node) => idMap.putIfAbsent(node, () => idMap.length);
+
+ String tag(int value) => '@$value';
+
+ void enterNode(Node node, int startPosition) {
+ int value = id(node);
+ if (mode == TestMode.ENTER) {
+ tagMap.putIfAbsent(startPosition, () => []).add(tag(value));
+ }
+ }
+
+ void exitNode(Node node,
+ int startPosition,
+ int endPosition,
+ int delimiterPosition) {
+ int value = id(node);
+ if (mode == TestMode.DELIMITER && delimiterPosition != null) {
+ tagMap.putIfAbsent(delimiterPosition, () => []).add(tag(value));
+ } else if (mode == TestMode.EXIT) {
+ tagMap.putIfAbsent(endPosition, () => []).add(tag(value));
+ }
+ }
+
+ String getText() {
+ String text = super.getText();
+ int offset = 0;
+ StringBuffer sb = new StringBuffer();
+ for (int position in tagMap.keys.toList()..sort()) {
+ if (offset < position) {
+ sb.write(text.substring(offset, position));
+ }
+ tagMap[position].forEach((String tag) => sb.write(tag));
+ offset = position;
+ }
+ if (offset < text.length) {
+ sb.write(text.substring(offset));
+ }
+ return sb.toString();
+ }
+}
+
+void main() {
+ DATA.forEach(check);
+}
diff --git a/pkg/mock/CHANGELOG.md b/pkg/mock/CHANGELOG.md
deleted file mode 100644
index 3fb0aa8..0000000
--- a/pkg/mock/CHANGELOG.md
+++ /dev/null
@@ -1,13 +0,0 @@
-## 0.11.0+2
-
-* Updated documentation link.
-
-## 0.11.0+1
-
-* Updated unittest dependency.
-
-## 0.11.0
-
- * Removed deprecated `sharedLog`
-
- * Improved support for calling arbitrary methods via a proxy
diff --git a/pkg/mock/LICENSE b/pkg/mock/LICENSE
deleted file mode 100644
index 5c60afe..0000000
--- a/pkg/mock/LICENSE
+++ /dev/null
@@ -1,26 +0,0 @@
-Copyright 2014, the Dart project authors. All rights reserved.
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are
-met:
-
- * Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
- * Redistributions in binary form must reproduce the above
- copyright notice, this list of conditions and the following
- disclaimer in the documentation and/or other materials provided
- with the distribution.
- * Neither the name of Google Inc. nor the names of its
- contributors may be used to endorse or promote products derived
- from this software without specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
diff --git a/pkg/mock/lib/mock.dart b/pkg/mock/lib/mock.dart
deleted file mode 100644
index 0732cb4..0000000
--- a/pkg/mock/lib/mock.dart
+++ /dev/null
@@ -1,117 +0,0 @@
-// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-/**
- * A simple mocking/spy library.
- *
- * To create a mock objects for some class T, create a new class using:
- *
- * class MockT extends Mock implements T {};
- *
- * Then specify the [Behavior] of the Mock for different methods using
- * [when] (to select the method and parameters) and then the [Action]s
- * for the [Behavior] by calling [thenReturn], [alwaysReturn], [thenThrow],
- * [alwaysThrow], [thenCall] or [alwaysCall].
- *
- * [thenReturn], [thenThrow] and [thenCall] are one-shot so you would
- * typically call these more than once to specify a sequence of actions;
- * this can be done with chained calls, e.g.:
- *
- * m.when(callsTo('foo')).
- * thenReturn(0).thenReturn(1).thenReturn(2);
- *
- * [thenCall] and [alwaysCall] allow you to proxy mocked methods, chaining
- * to some other implementation. This provides a way to implement 'spies'.
- *
- * For getters and setters, use "get foo" and "set foo"-style arguments
- * to [callsTo].
- *
- * You can disable logging for a particular [Behavior] easily:
- *
- * m.when(callsTo('bar')).logging = false;
- *
- * You can then use the mock object. Once you are done, to verify the
- * behavior, use [getLogs] to extract a relevant subset of method call
- * logs and apply [Matchers] to these through calling [verify].
- *
- * A Mock can be given a name when constructed. In this case instead of
- * keeping its own log, it uses a shared log. This can be useful to get an
- * audit trail of interleaved behavior. It is the responsibility of the user
- * to ensure that mock names, if used, are unique.
- *
- * Limitations:
- *
- * * only positional parameters are supported (up to 10);
- * * to mock getters you will need to include parentheses in the call
- * (e.g. m.length() will work but not m.length).
- *
- * Here is a simple example:
- *
- * class MockList extends Mock implements List {};
- *
- * List m = new MockList();
- * m.when(callsTo('add', anything)).alwaysReturn(0);
- *
- * m.add('foo');
- * m.add('bar');
- *
- * getLogs(m, callsTo('add', anything)).verify(happenedExactly(2));
- * getLogs(m, callsTo('add', 'foo')).verify(happenedOnce);
- * getLogs(m, callsTo('add', 'isNull)).verify(neverHappened);
- *
- * Note that we don't need to provide argument matchers for all arguments,
- * but we do need to provide arguments for all matchers. So this is allowed:
- *
- * m.when(callsTo('add')).alwaysReturn(0);
- * m.add(1, 2);
- *
- * But this is not allowed and will throw an exception:
- *
- * m.when(callsTo('add', anything, anything)).alwaysReturn(0);
- * m.add(1);
- *
- * Here is a way to implement a 'spy', which is where we log the call
- * but then hand it off to some other function, which is the same
- * method in a real instance of the class being mocked:
- *
- * class Foo {
- * bar(a, b, c) => a + b + c;
- * }
- *
- * class MockFoo extends Mock implements Foo {
- * Foo real;
- * MockFoo() {
- * real = new Foo();
- * this.when(callsTo('bar')).alwaysCall(real.bar);
- * }
- * }
- *
- * However, there is an even easier way, by calling [Mock.spy], e.g.:
- *
- * var foo = new Foo();
- * var spy = new Mock.spy(foo);
- * print(spy.bar(1, 2, 3));
- *
- * Spys created with Mock.spy do not have user-defined behavior;
- * they are simply proxies, and thus will throw an exception if
- * you call [when]. They capture all calls in the log, so you can
- * do assertions on their history, such as:
- *
- * spy.getLogs(callsTo('bar')).verify(happenedOnce);
- *
- * [pub]: http://pub.dartlang.org
- */
-
-library mock;
-
-export 'src/action.dart';
-export 'src/behavior.dart';
-export 'src/call_matcher.dart';
-export 'src/log_entry.dart';
-export 'src/log_entry_list.dart';
-export 'src/mock.dart';
-export 'src/responder.dart';
-export 'src/result_matcher.dart';
-export 'src/result_set_matcher.dart';
-export 'src/times_matcher.dart';
diff --git a/pkg/mock/lib/src/action.dart b/pkg/mock/lib/src/action.dart
deleted file mode 100644
index 1712b2c..0000000
--- a/pkg/mock/lib/src/action.dart
+++ /dev/null
@@ -1,26 +0,0 @@
-// Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-library mock.action;
-
-/** The ways in which a call to a mock method can be handled. */
-class Action {
- /** Do nothing (void method) */
- static const IGNORE = const Action._('IGNORE');
-
- /** Return a supplied value. */
- static const RETURN = const Action._('RETURN');
-
- /** Throw a supplied value. */
- static const THROW = const Action._('THROW');
-
- /** Call a supplied function. */
- static const PROXY = const Action._('PROXY');
-
- const Action._(this.name);
-
- final String name;
-
- String toString() => 'Action: $name';
-}
diff --git a/pkg/mock/lib/src/behavior.dart b/pkg/mock/lib/src/behavior.dart
deleted file mode 100644
index 7385a13..0000000
--- a/pkg/mock/lib/src/behavior.dart
+++ /dev/null
@@ -1,83 +0,0 @@
-// Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-library mock.behavior;
-
-import 'action.dart';
-import 'call_matcher.dart';
-import 'responder.dart';
-
-/**
- * A [Behavior] represents how a [Mock] will respond to one particular
- * type of method call.
- */
-class Behavior {
- CallMatcher matcher; // The method call matcher.
- List<Responder> actions; // The values to return/throw or proxies to call.
- bool logging = true;
-
- Behavior(this.matcher) {
- actions = new List<Responder>();
- }
-
- /**
- * Adds a [Responder] that returns a [value] for [count] calls
- * (1 by default).
- */
- Behavior thenReturn(value, [count = 1]) {
- actions.add(new Responder(value, count, Action.RETURN));
- return this; // For chaining calls.
- }
-
- /** Adds a [Responder] that repeatedly returns a [value]. */
- Behavior alwaysReturn(value) {
- return thenReturn(value, 0);
- }
-
- /**
- * Adds a [Responder] that throws [value] [count]
- * times (1 by default).
- */
- Behavior thenThrow(value, [count = 1]) {
- actions.add(new Responder(value, count, Action.THROW));
- return this; // For chaining calls.
- }
-
- /** Adds a [Responder] that throws [value] endlessly. */
- Behavior alwaysThrow(value) {
- return thenThrow(value, 0);
- }
-
- /**
- * [thenCall] creates a proxy Responder, that is called [count]
- * times (1 by default; 0 is used for unlimited calls, and is
- * exposed as [alwaysCall]). [value] is the function that will
- * be called with the same arguments that were passed to the
- * mock. Proxies can be used to wrap real objects or to define
- * more complex return/throw behavior. You could even (if you
- * wanted) use proxies to emulate the behavior of thenReturn;
- * e.g.:
- *
- * m.when(callsTo('foo')).thenReturn(0)
- *
- * is equivalent to:
- *
- * m.when(callsTo('foo')).thenCall(() => 0)
- */
- Behavior thenCall(value, [count = 1]) {
- actions.add(new Responder(value, count, Action.PROXY));
- return this; // For chaining calls.
- }
-
- /** Creates a repeating proxy call. */
- Behavior alwaysCall(value) {
- return thenCall(value, 0);
- }
-
- /** Returns true if a method call matches the [Behavior]. */
- bool matches(String method, List args) => matcher.matches(method, args);
-
- /** Returns the [matcher]'s representation. */
- String toString() => matcher.toString();
-}
diff --git a/pkg/mock/lib/src/call_matcher.dart b/pkg/mock/lib/src/call_matcher.dart
deleted file mode 100644
index ff6e5e5..0000000
--- a/pkg/mock/lib/src/call_matcher.dart
+++ /dev/null
@@ -1,134 +0,0 @@
-// Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-library mock.call_matcher;
-
-import 'package:matcher/matcher.dart';
-
-import 'util.dart';
-
-/**
- * A [CallMatcher] is a special matcher used to match method calls (i.e.
- * a method name and set of arguments). It is not a [Matcher] like the
- * unit test [Matcher], but instead represents a method name and a
- * collection of [Matcher]s, one per argument, that will be applied
- * to the parameters to decide if the method call is a match.
- */
-class CallMatcher {
- Matcher nameFilter;
- List<Matcher> argMatchers;
-
- /**
- * Constructor for [CallMatcher]. [name] can be null to
- * match anything, or a literal [String], a predicate [Function],
- * or a [Matcher]. The various arguments can be scalar values or
- * [Matcher]s.
- */
- CallMatcher([name,
- arg0 = NO_ARG,
- arg1 = NO_ARG,
- arg2 = NO_ARG,
- arg3 = NO_ARG,
- arg4 = NO_ARG,
- arg5 = NO_ARG,
- arg6 = NO_ARG,
- arg7 = NO_ARG,
- arg8 = NO_ARG,
- arg9 = NO_ARG]) {
- if (name == null) {
- nameFilter = anything;
- } else {
- nameFilter = wrapMatcher(name);
- }
- argMatchers = new List<Matcher>();
- if (identical(arg0, NO_ARG)) return;
- argMatchers.add(wrapMatcher(arg0));
- if (identical(arg1, NO_ARG)) return;
- argMatchers.add(wrapMatcher(arg1));
- if (identical(arg2, NO_ARG)) return;
- argMatchers.add(wrapMatcher(arg2));
- if (identical(arg3, NO_ARG)) return;
- argMatchers.add(wrapMatcher(arg3));
- if (identical(arg4, NO_ARG)) return;
- argMatchers.add(wrapMatcher(arg4));
- if (identical(arg5, NO_ARG)) return;
- argMatchers.add(wrapMatcher(arg5));
- if (identical(arg6, NO_ARG)) return;
- argMatchers.add(wrapMatcher(arg6));
- if (identical(arg7, NO_ARG)) return;
- argMatchers.add(wrapMatcher(arg7));
- if (identical(arg8, NO_ARG)) return;
- argMatchers.add(wrapMatcher(arg8));
- if (identical(arg9, NO_ARG)) return;
- argMatchers.add(wrapMatcher(arg9));
- }
-
- /**
- * We keep our behavior specifications in a Map, which is keyed
- * by the [CallMatcher]. To make the keys unique and to get a
- * descriptive value for the [CallMatcher] we have this override
- * of [toString()].
- */
- String toString() {
- Description d = new StringDescription();
- d.addDescriptionOf(nameFilter);
- // If the nameFilter was a simple string - i.e. just a method name -
- // strip the quotes to make this more natural in appearance.
- if (d.toString()[0] == "'") {
- d.replace(d.toString().substring(1, d.toString().length - 1));
- }
- d.add('(');
- for (var i = 0; i < argMatchers.length; i++) {
- if (i > 0) d.add(', ');
- d.addDescriptionOf(argMatchers[i]);
- }
- d.add(')');
- return d.toString();
- }
-
- /**
- * Given a [method] name and list of [arguments], return true
- * if it matches this [CallMatcher.
- */
- bool matches(String method, List arguments) {
- var matchState = {};
- if (!nameFilter.matches(method, matchState)) {
- return false;
- }
- var numArgs = (arguments == null) ? 0 : arguments.length;
- if (numArgs < argMatchers.length) {
- throw new Exception("Less arguments than matchers for $method.");
- }
- for (var i = 0; i < argMatchers.length; i++) {
- if (!argMatchers[i].matches(arguments[i], matchState)) {
- return false;
- }
- }
- return true;
- }
-}
-
-/**
- * Returns a [CallMatcher] for the specified signature. [method] can be
- * null to match anything, or a literal [String], a predicate [Function],
- * or a [Matcher]. The various arguments can be scalar values or [Matcher]s.
- * To match getters and setters, use "get " and "set " prefixes on the names.
- * For example, for a property "foo", you could use "get foo" and "set foo"
- * as literal string arguments to callsTo to match the getter and setter
- * of "foo".
- */
-CallMatcher callsTo([method,
- arg0 = NO_ARG,
- arg1 = NO_ARG,
- arg2 = NO_ARG,
- arg3 = NO_ARG,
- arg4 = NO_ARG,
- arg5 = NO_ARG,
- arg6 = NO_ARG,
- arg7 = NO_ARG,
- arg8 = NO_ARG,
- arg9 = NO_ARG]) {
- return new CallMatcher(method, arg0, arg1, arg2, arg3, arg4,
- arg5, arg6, arg7, arg8, arg9);
-}
diff --git a/pkg/mock/lib/src/log_entry.dart b/pkg/mock/lib/src/log_entry.dart
deleted file mode 100644
index 85f9061..0000000
--- a/pkg/mock/lib/src/log_entry.dart
+++ /dev/null
@@ -1,66 +0,0 @@
-// Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-library mock.log_entry;
-
-import 'package:matcher/matcher.dart';
-
-import 'action.dart';
-import 'util.dart';
-
-/**
- * Every call to a [Mock] object method is logged. The logs are
- * kept in instances of [LogEntry].
- */
-class LogEntry {
- /** The time of the event. */
- DateTime time;
-
- /** The mock object name, if any. */
- final String mockName;
-
- /** The method name. */
- final String methodName;
-
- /** The parameters. */
- final List args;
-
- /** The behavior that resulted. */
- final Action action;
-
- /** The value that was returned (if no throw). */
- final value;
-
- LogEntry(this.mockName, this.methodName,
- this.args, this.action, [this.value]) {
- time = new DateTime.now();
- }
-
- String _pad2(int val) => (val >= 10 ? '$val' : '0$val');
-
- String toString([DateTime baseTime]) {
- Description d = new StringDescription();
- if (baseTime == null) {
- // Show absolute time.
- d.add('${time.hour}:${_pad2(time.minute)}:'
- '${_pad2(time.second)}.${time.millisecond}> ');
- } else {
- // Show relative time.
- int delta = time.millisecondsSinceEpoch - baseTime.millisecondsSinceEpoch;
- int secs = delta ~/ 1000;
- int msecs = delta % 1000;
- d.add('$secs.$msecs> ');
- }
- d.add('${qualifiedName(mockName, methodName)}(');
- if (args != null) {
- for (var i = 0; i < args.length; i++) {
- if (i != 0) d.add(', ');
- d.addDescriptionOf(args[i]);
- }
- }
- d.add(') ${action == Action.THROW ? "threw" : "returned"} ');
- d.addDescriptionOf(value);
- return d.toString();
- }
-}
diff --git a/pkg/mock/lib/src/log_entry_list.dart b/pkg/mock/lib/src/log_entry_list.dart
deleted file mode 100644
index b96baab..0000000
--- a/pkg/mock/lib/src/log_entry_list.dart
+++ /dev/null
@@ -1,564 +0,0 @@
-// Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-library mock.log_entry_list;
-
-import 'package:matcher/matcher.dart';
-
-import 'call_matcher.dart';
-import 'log_entry.dart';
-import 'util.dart';
-
-/**
-* [StepValidator]s are used by [stepwiseValidate] in [LogEntryList], which
-* iterates through the list and call the [StepValidator] function with the
-* log [List] and position. The [StepValidator] should return the number of
-* positions to advance upon success, or zero upon failure. When zero is
-* returned an error is reported.
-*/
-typedef int StepValidator(List<LogEntry> logs, int pos);
-
-/**
- * We do verification on a list of [LogEntry]s. To allow chaining
- * of calls to verify, we encapsulate such a list in the [LogEntryList]
- * class.
- */
-class LogEntryList {
- String filter;
- List<LogEntry> logs;
- LogEntryList([this.filter]) {
- logs = new List<LogEntry>();
- }
-
- /** Add a [LogEntry] to the log. */
- add(LogEntry entry) => logs.add(entry);
-
- /** Get the first entry, or null if no entries. */
- get first => (logs == null || logs.length == 0) ? null : logs[0];
-
- /** Get the last entry, or null if no entries. */
- get last => (logs == null || logs.length == 0) ? null : logs.last;
-
- /** Creates a LogEntry predicate function from the argument. */
- Function _makePredicate(arg) {
- if (arg == null) {
- return (e) => true;
- } else if (arg is CallMatcher) {
- return (e) => arg.matches(e.methodName, e.args);
- } else if (arg is Function) {
- return arg;
- } else {
- throw new Exception("Invalid argument to _makePredicate.");
- }
- }
-
- /**
- * Create a new [LogEntryList] consisting of [LogEntry]s from
- * this list that match the specified [mockNameFilter] and [logFilter].
- * [mockNameFilter] can be null, a [String], a predicate [Function],
- * or a [Matcher]. If [mockNameFilter] is null, this is the same as
- * [anything].
- * If [logFilter] is null, all entries in the log will be returned.
- * Otherwise [logFilter] should be a [CallMatcher] or predicate function
- * that takes a [LogEntry] and returns a bool.
- * If [destructive] is true, the log entries are removed from the
- * original list.
- */
- LogEntryList getMatches([mockNameFilter,
- logFilter,
- Matcher actionMatcher,
- bool destructive = false]) {
- if (mockNameFilter == null) {
- mockNameFilter = anything;
- } else {
- mockNameFilter = wrapMatcher(mockNameFilter);
- }
- Function entryFilter = _makePredicate(logFilter);
- String filterName = qualifiedName(mockNameFilter, logFilter.toString());
- LogEntryList rtn = new LogEntryList(filterName);
- var matchState = {};
- for (var i = 0; i < logs.length; i++) {
- LogEntry entry = logs[i];
- if (mockNameFilter.matches(entry.mockName, matchState) &&
- entryFilter(entry)) {
- if (actionMatcher == null ||
- actionMatcher.matches(entry, matchState)) {
- rtn.add(entry);
- if (destructive) {
- int startIndex = i--;
- logs.removeRange(startIndex, startIndex + 1);
- }
- }
- }
- }
- return rtn;
- }
-
- /** Apply a unit test [Matcher] to the [LogEntryList]. */
- LogEntryList verify(Matcher matcher) {
- if (_mockFailureHandler == null) {
- _mockFailureHandler =
- new _MockFailureHandler(getOrCreateExpectFailureHandler());
- }
- expect(logs, matcher, reason: filter, failureHandler: _mockFailureHandler);
- return this;
- }
-
- /**
- * Iterate through the list and call the [validator] function with the
- * log [List] and position. The [validator] should return the number of
- * positions to advance upon success, or zero upon failure. When zero is
- * returned an error is reported. [reason] can be used to provide a
- * more descriptive failure message. If a failure occurred false will be
- * returned (unless the failure handler itself threw an exception);
- * otherwise true is returned.
- * The use case here is to perform more complex validations; for example
- * we may want to assert that the return value from some function is
- * later used as a parameter to a following function. If we filter the logs
- * to include just these two functions we can write a simple validator to
- * do this check.
- */
- bool stepwiseValidate(StepValidator validator, [String reason = '']) {
- if (_mockFailureHandler == null) {
- _mockFailureHandler =
- new _MockFailureHandler(getOrCreateExpectFailureHandler());
- }
- var i = 0;
- while (i < logs.length) {
- var n = validator(logs, i);
- if (n == 0) {
- if (reason.length > 0) {
- reason = ': $reason';
- }
- _mockFailureHandler.fail("Stepwise validation failed at $filter "
- "position $i$reason");
- return false;
- } else {
- i += n;
- }
- }
- return true;
- }
-
- /**
- * Turn the logs into human-readable text. If [baseTime] is specified
- * then each entry is prefixed with the offset from that time in
- * milliseconds; otherwise the time of day is used.
- */
- String toString([DateTime baseTime]) {
- String s = '';
- for (var e in logs) {
- s = '$s${e.toString(baseTime)}\n';
- }
- return s;
- }
-
- /**
- * Find the first log entry that satisfies [logFilter] and
- * return its position. A search [start] position can be provided
- * to allow for repeated searches. [logFilter] can be a [CallMatcher],
- * or a predicate function that takes a [LogEntry] argument and returns
- * a bool. If [logFilter] is null, it will match any [LogEntry].
- * If no entry is found, then [failureReturnValue] is returned.
- * After each check the position is updated by [skip], so using
- * [skip] of -1 allows backward searches, using a [skip] of 2 can
- * be used to check pairs of adjacent entries, and so on.
- */
- int findLogEntry(logFilter, [int start = 0, int failureReturnValue = -1,
- skip = 1]) {
- logFilter = _makePredicate(logFilter);
- int pos = start;
- while (pos >= 0 && pos < logs.length) {
- if (logFilter(logs[pos])) {
- return pos;
- }
- pos += skip;
- }
- return failureReturnValue;
- }
-
- /**
- * Returns log events that happened up to the first one that
- * satisfies [logFilter]. If [inPlace] is true, then returns
- * this LogEntryList after removing the from the first satisfier;
- * onwards otherwise a new list is created. [description]
- * is used to create a new name for the resulting list.
- * [defaultPosition] is used as the index of the matching item in
- * the case that no match is found.
- */
- LogEntryList _head(logFilter, bool inPlace,
- String description, int defaultPosition) {
- if (filter != null) {
- description = '$filter $description';
- }
- int pos = findLogEntry(logFilter, 0, defaultPosition);
- if (inPlace) {
- if (pos < logs.length) {
- logs.removeRange(pos, logs.length);
- }
- filter = description;
- return this;
- } else {
- LogEntryList newList = new LogEntryList(description);
- for (var i = 0; i < pos; i++) {
- newList.logs.add(logs[i]);
- }
- return newList;
- }
- }
-
- /**
- * Returns log events that happened from the first one that
- * satisfies [logFilter]. If [inPlace] is true, then returns
- * this LogEntryList after removing the entries up to the first
- * satisfier; otherwise a new list is created. [description]
- * is used to create a new name for the resulting list.
- * [defaultPosition] is used as the index of the matching item in
- * the case that no match is found.
- */
- LogEntryList _tail(logFilter, bool inPlace,
- String description, int defaultPosition) {
- if (filter != null) {
- description = '$filter $description';
- }
- int pos = findLogEntry(logFilter, 0, defaultPosition);
- if (inPlace) {
- if (pos > 0) {
- logs.removeRange(0, pos);
- }
- filter = description;
- return this;
- } else {
- LogEntryList newList = new LogEntryList(description);
- while (pos < logs.length) {
- newList.logs.add(logs[pos++]);
- }
- return newList;
- }
- }
-
- /**
- * Returns log events that happened after [when]. If [inPlace]
- * is true, then it returns this LogEntryList after removing
- * the entries that happened up to [when]; otherwise a new
- * list is created.
- */
- LogEntryList after(DateTime when, [bool inPlace = false]) =>
- _tail((e) => e.time.isAfter(when), inPlace, 'after $when', logs.length);
-
- /**
- * Returns log events that happened from [when] onwards. If
- * [inPlace] is true, then it returns this LogEntryList after
- * removing the entries that happened before [when]; otherwise
- * a new list is created.
- */
- LogEntryList from(DateTime when, [bool inPlace = false]) =>
- _tail((e) => !e.time.isBefore(when), inPlace, 'from $when', logs.length);
-
- /**
- * Returns log events that happened until [when]. If [inPlace]
- * is true, then it returns this LogEntryList after removing
- * the entries that happened after [when]; otherwise a new
- * list is created.
- */
- LogEntryList until(DateTime when, [bool inPlace = false]) =>
- _head((e) => e.time.isAfter(when), inPlace, 'until $when', logs.length);
-
- /**
- * Returns log events that happened before [when]. If [inPlace]
- * is true, then it returns this LogEntryList after removing
- * the entries that happened from [when] onwards; otherwise a new
- * list is created.
- */
- LogEntryList before(DateTime when, [bool inPlace = false]) =>
- _head((e) => !e.time.isBefore(when),
- inPlace,
- 'before $when',
- logs.length);
-
- /**
- * Returns log events that happened after [logEntry]'s time.
- * If [inPlace] is true, then it returns this LogEntryList after
- * removing the entries that happened up to [when]; otherwise a new
- * list is created. If [logEntry] is null the current time is used.
- */
- LogEntryList afterEntry(LogEntry logEntry, [bool inPlace = false]) =>
- after(logEntry == null ? new DateTime.now() : logEntry.time);
-
- /**
- * Returns log events that happened from [logEntry]'s time onwards.
- * If [inPlace] is true, then it returns this LogEntryList after
- * removing the entries that happened before [when]; otherwise
- * a new list is created. If [logEntry] is null the current time is used.
- */
- LogEntryList fromEntry(LogEntry logEntry, [bool inPlace = false]) =>
- from(logEntry == null ? new DateTime.now() : logEntry.time);
-
- /**
- * Returns log events that happened until [logEntry]'s time. If
- * [inPlace] is true, then it returns this LogEntryList after removing
- * the entries that happened after [when]; otherwise a new
- * list is created. If [logEntry] is null the epoch time is used.
- */
- LogEntryList untilEntry(LogEntry logEntry, [bool inPlace = false]) =>
- until(logEntry == null ?
- new DateTime.fromMillisecondsSinceEpoch(0) : logEntry.time);
-
- /**
- * Returns log events that happened before [logEntry]'s time. If
- * [inPlace] is true, then it returns this LogEntryList after removing
- * the entries that happened from [when] onwards; otherwise a new
- * list is created. If [logEntry] is null the epoch time is used.
- */
- LogEntryList beforeEntry(LogEntry logEntry, [bool inPlace = false]) =>
- before(logEntry == null ?
- new DateTime.fromMillisecondsSinceEpoch(0) : logEntry.time);
-
- /**
- * Returns log events that happened after the first event in [segment].
- * If [inPlace] is true, then it returns this LogEntryList after removing
- * the entries that happened earlier; otherwise a new list is created.
- */
- LogEntryList afterFirst(LogEntryList segment, [bool inPlace = false]) =>
- afterEntry(segment.first, inPlace);
-
- /**
- * Returns log events that happened after the last event in [segment].
- * If [inPlace] is true, then it returns this LogEntryList after removing
- * the entries that happened earlier; otherwise a new list is created.
- */
- LogEntryList afterLast(LogEntryList segment, [bool inPlace = false]) =>
- afterEntry(segment.last, inPlace);
-
- /**
- * Returns log events that happened from the time of the first event in
- * [segment] onwards. If [inPlace] is true, then it returns this
- * LogEntryList after removing the earlier entries; otherwise a new list
- * is created.
- */
- LogEntryList fromFirst(LogEntryList segment, [bool inPlace = false]) =>
- fromEntry(segment.first, inPlace);
-
- /**
- * Returns log events that happened from the time of the last event in
- * [segment] onwards. If [inPlace] is true, then it returns this
- * LogEntryList after removing the earlier entries; otherwise a new list
- * is created.
- */
- LogEntryList fromLast(LogEntryList segment, [bool inPlace = false]) =>
- fromEntry(segment.last, inPlace);
-
- /**
- * Returns log events that happened until the first event in [segment].
- * If [inPlace] is true, then it returns this LogEntryList after removing
- * the entries that happened later; otherwise a new list is created.
- */
- LogEntryList untilFirst(LogEntryList segment, [bool inPlace = false]) =>
- untilEntry(segment.first, inPlace);
-
- /**
- * Returns log events that happened until the last event in [segment].
- * If [inPlace] is true, then it returns this LogEntryList after removing
- * the entries that happened later; otherwise a new list is created.
- */
- LogEntryList untilLast(LogEntryList segment, [bool inPlace = false]) =>
- untilEntry(segment.last, inPlace);
-
- /**
- * Returns log events that happened before the first event in [segment].
- * If [inPlace] is true, then it returns this LogEntryList after removing
- * the entries that happened later; otherwise a new list is created.
- */
- LogEntryList beforeFirst(LogEntryList segment, [bool inPlace = false]) =>
- beforeEntry(segment.first, inPlace);
-
- /**
- * Returns log events that happened before the last event in [segment].
- * If [inPlace] is true, then it returns this LogEntryList after removing
- * the entries that happened later; otherwise a new list is created.
- */
- LogEntryList beforeLast(LogEntryList segment, [bool inPlace = false]) =>
- beforeEntry(segment.last, inPlace);
-
- /**
- * Iterate through the LogEntryList looking for matches to the entries
- * in [keys]; for each match found the closest [distance] neighboring log
- * entries that match [mockNameFilter] and [logFilter] will be included in
- * the result. If [isPreceding] is true we use the neighbors that precede
- * the matched entry; else we use the neighbors that followed.
- * If [includeKeys] is true then the entries in [keys] that resulted in
- * entries in the output list are themselves included in the output list. If
- * [distance] is zero then all matches are included.
- */
- LogEntryList _neighboring(bool isPreceding,
- LogEntryList keys,
- mockNameFilter,
- logFilter,
- int distance,
- bool includeKeys) {
- String filterName = 'Calls to '
- '${qualifiedName(mockNameFilter, logFilter.toString())} '
- '${isPreceding?"preceding":"following"} ${keys.filter}';
-
- LogEntryList rtn = new LogEntryList(filterName);
-
- // Deal with the trivial case.
- if (logs.length == 0 || keys.logs.length == 0) {
- return rtn;
- }
-
- // Normalize the mockNameFilter and logFilter values.
- if (mockNameFilter == null) {
- mockNameFilter = anything;
- } else {
- mockNameFilter = wrapMatcher(mockNameFilter);
- }
- logFilter = _makePredicate(logFilter);
-
- // The scratch list is used to hold matching entries when we
- // are doing preceding neighbors. The remainingCount is used to
- // keep track of how many matching entries we can still add in the
- // current segment (0 if we are doing doing following neighbors, until
- // we get our first key match).
- List scratch = null;
- int remainingCount = 0;
- if (isPreceding) {
- scratch = new List();
- remainingCount = logs.length;
- }
-
- var keyIterator = keys.logs.iterator;
- keyIterator.moveNext();
- LogEntry keyEntry = keyIterator.current;
- Map matchState = {};
-
- for (LogEntry logEntry in logs) {
- // If we have a log entry match, copy the saved matches from the
- // scratch buffer into the return list, as well as the matching entry,
- // if appropriate, and reset the scratch buffer. Continue processing
- // from the next key entry.
- if (keyEntry == logEntry) {
- if (scratch != null) {
- int numToCopy = scratch.length;
- if (distance > 0 && distance < numToCopy) {
- numToCopy = distance;
- }
- for (var i = scratch.length - numToCopy; i < scratch.length; i++) {
- rtn.logs.add(scratch[i]);
- }
- scratch.clear();
- } else {
- remainingCount = distance > 0 ? distance : logs.length;
- }
- if (includeKeys) {
- rtn.logs.add(keyEntry);
- }
- if (keyIterator.moveNext()) {
- keyEntry = keyIterator.current;
- } else if (isPreceding) { // We're done.
- break;
- }
- } else if (remainingCount > 0 &&
- mockNameFilter.matches(logEntry.mockName, matchState) &&
- logFilter(logEntry)) {
- if (scratch != null) {
- scratch.add(logEntry);
- } else {
- rtn.logs.add(logEntry);
- --remainingCount;
- }
- }
- }
- return rtn;
- }
-
- /**
- * Iterate through the LogEntryList looking for matches to the entries
- * in [keys]; for each match found the closest [distance] prior log entries
- * that match [mocknameFilter] and [logFilter] will be included in the result.
- * If [includeKeys] is true then the entries in [keys] that resulted in
- * entries in the output list are themselves included in the output list. If
- * [distance] is zero then all matches are included.
- *
- * The idea here is that you could find log entries that are related to
- * other logs entries in some temporal sense. For example, say we have a
- * method commit() that returns -1 on failure. Before commit() gets called
- * the value being committed is created by process(). We may want to find
- * the calls to process() that preceded calls to commit() that failed.
- * We could do this with:
- *
- * print(log.preceding(log.getLogs(callsTo('commit'), returning(-1)),
- * logFilter: callsTo('process')).toString());
- *
- * We might want to include the details of the failing calls to commit()
- * to see what parameters were passed in, in which case we would set
- * [includeKeys].
- *
- * As another simple example, say we wanted to know the three method
- * calls that immediately preceded each failing call to commit():
- *
- * print(log.preceding(log.getLogs(callsTo('commit'), returning(-1)),
- * distance: 3).toString());
- */
- LogEntryList preceding(LogEntryList keys,
- {mockNameFilter: null,
- logFilter: null,
- int distance: 1,
- bool includeKeys: false}) =>
- _neighboring(true, keys, mockNameFilter, logFilter,
- distance, includeKeys);
-
- /**
- * Iterate through the LogEntryList looking for matches to the entries
- * in [keys]; for each match found the closest [distance] subsequent log
- * entries that match [mocknameFilter] and [logFilter] will be included in
- * the result. If [includeKeys] is true then the entries in [keys] that
- * resulted in entries in the output list are themselves included in the
- * output list. If [distance] is zero then all matches are included.
- * See [preceding] for a usage example.
- */
- LogEntryList following(LogEntryList keys,
- {mockNameFilter: null,
- logFilter: null,
- int distance: 1,
- bool includeKeys: false}) =>
- _neighboring(false, keys, mockNameFilter, logFilter,
- distance, includeKeys);
-}
-
-_MockFailureHandler _mockFailureHandler = null;
-
-/**
- * The failure handler for the [expect()] calls that occur in [verify()]
- * methods in the mock objects. This calls the real failure handler used
- * by the unit test library after formatting the error message with
- * the custom formatter.
- */
-class _MockFailureHandler implements FailureHandler {
- FailureHandler proxy;
- _MockFailureHandler(this.proxy);
- void fail(String reason) {
- proxy.fail(reason);
- }
- void failMatch(actual, Matcher matcher, String reason,
- Map matchState, bool verbose) {
- proxy.fail(_mockingErrorFormatter(actual, matcher, reason,
- matchState, verbose));
- }
-}
-
-/**
- * The error formatter for mocking is a bit different from the default one
- * for unit testing; instead of the third argument being a 'reason'
- * it is instead a [signature] describing the method signature filter
- * that was used to select the logs that were verified.
- */
-String _mockingErrorFormatter(actual, Matcher matcher, String signature,
- Map matchState, bool verbose) {
- var description = new StringDescription();
- description.add('Expected ${signature} ').addDescriptionOf(matcher).
- add('\n but: ');
- matcher.describeMismatch(actual, description, matchState, verbose).add('.');
- return description.toString();
-}
diff --git a/pkg/mock/lib/src/mock.dart b/pkg/mock/lib/src/mock.dart
deleted file mode 100644
index bdbb8f3..0000000
--- a/pkg/mock/lib/src/mock.dart
+++ /dev/null
@@ -1,280 +0,0 @@
-// Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-library mock.mock;
-
-// TOOD(kevmoo): just use `Map`
-import 'dart:collection' show LinkedHashMap;
-import 'dart:mirrors';
-
-import 'package:matcher/matcher.dart';
-
-import 'action.dart';
-import 'behavior.dart';
-import 'call_matcher.dart';
-import 'log_entry.dart';
-import 'log_entry_list.dart';
-import 'responder.dart';
-import 'util.dart';
-
-/** The base class for all mocked objects. */
-@proxy
-class Mock {
- /** The mock name. Needed if the log is shared; optional otherwise. */
- final String name;
-
- /** The set of [Behavior]s supported. */
- final LinkedHashMap<String, Behavior> _behaviors;
-
- /** How to handle unknown method calls - swallow or throw. */
- final bool _throwIfNoBehavior;
-
- /** For spys, the real object that we are spying on. */
- final Object _realObject;
-
- /** The [log] of calls made. Only used if [name] is null. */
- LogEntryList log;
-
- /** Whether to create an audit log or not. */
- bool _logging;
-
- bool get logging => _logging;
- set logging(bool value) {
- if (value && log == null) {
- log = new LogEntryList();
- }
- _logging = value;
- }
-
- /**
- * Default constructor. Unknown method calls are allowed and logged,
- * the mock has no name, and has its own log.
- */
- Mock() :
- _throwIfNoBehavior = false, log = null, name = null, _realObject = null,
- _behaviors = new LinkedHashMap<String,Behavior>() {
- logging = true;
- }
-
- /**
- * This constructor makes a mock that has a [name] and possibly uses
- * a shared [log]. If [throwIfNoBehavior] is true, any calls to methods
- * that have no defined behaviors will throw an exception; otherwise they
- * will be allowed and logged (but will not do anything).
- * If [enableLogging] is false, no logging will be done initially (whether
- * or not a [log] is supplied), but [logging] can be set to true later.
- */
- Mock.custom({this.name,
- this.log,
- throwIfNoBehavior: false,
- enableLogging: true})
- : _throwIfNoBehavior = throwIfNoBehavior, _realObject = null,
- _behaviors = new LinkedHashMap<String,Behavior>() {
- if (log != null && name == null) {
- throw new Exception("Mocks with shared logs must have a name.");
- }
- logging = enableLogging;
- }
-
- /**
- * This constructor creates a spy with no user-defined behavior.
- * This is simply a proxy for a real object that passes calls
- * through to that real object but captures an audit trail of
- * calls made to the object that can be queried and validated
- * later.
- */
- Mock.spy(this._realObject, {this.name, this.log})
- : _behaviors = null,
- _throwIfNoBehavior = true {
- logging = true;
- }
-
- /**
- * [when] is used to create a new or extend an existing [Behavior].
- * A [CallMatcher] [filter] must be supplied, and the [Behavior]s for
- * that signature are returned (being created first if needed).
- *
- * Typical use case:
- *
- * mock.when(callsTo(...)).alwaysReturn(...);
- */
- Behavior when(CallMatcher logFilter) {
- String key = logFilter.toString();
- if (!_behaviors.containsKey(key)) {
- Behavior b = new Behavior(logFilter);
- _behaviors[key] = b;
- return b;
- } else {
- return _behaviors[key];
- }
- }
-
- /**
- * This is the handler for method calls. We loop through the list
- * of [Behavior]s, and find the first match that still has return
- * values available, and then do the action specified by that
- * return value. If we find no [Behavior] to apply an exception is
- * thrown.
- */
- noSuchMethod(Invocation invocation) {
- var method = MirrorSystem.getName(invocation.memberName);
- var args = invocation.positionalArguments;
- if (invocation.isGetter) {
- method = 'get $method';
- } else if (invocation.isSetter) {
- method = 'set $method';
- // Remove the trailing '='.
- if (method[method.length - 1] == '=') {
- method = method.substring(0, method.length - 1);
- }
- }
- if (_behaviors == null) { // Spy.
- var mirror = reflect(_realObject);
- try {
- var result = mirror.delegate(invocation);
- log.add(new LogEntry(name, method, args, Action.PROXY, result));
- return result;
- } catch (e) {
- log.add(new LogEntry(name, method, args, Action.THROW, e));
- throw e;
- }
- }
- bool matchedMethodName = false;
- Map matchState = {};
- for (String k in _behaviors.keys) {
- Behavior b = _behaviors[k];
- if (b.matcher.nameFilter.matches(method, matchState)) {
- matchedMethodName = true;
- }
- if (b.matches(method, args)) {
- List actions = b.actions;
- if (actions == null || actions.length == 0) {
- continue; // No return values left in this Behavior.
- }
- // Get the first response.
- Responder response = actions[0];
- // If it is exhausted, remove it from the list.
- // Note that for endlessly repeating values, we started the count at
- // 0, so we get a potentially useful value here, which is the
- // (negation of) the number of times we returned the value.
- if (--response.count == 0) {
- actions.removeRange(0, 1);
- }
- // Do the response.
- Action action = response.action;
- var value = response.value;
- if (action == Action.RETURN) {
- if (_logging && b.logging) {
- log.add(new LogEntry(name, method, args, action, value));
- }
- return value;
- } else if (action == Action.THROW) {
- if (_logging && b.logging) {
- log.add(new LogEntry(name, method, args, action, value));
- }
- throw value;
- } else if (action == Action.PROXY) {
- var mir = reflect(value) as ClosureMirror;
- var rtn = mir.invoke(#call, invocation.positionalArguments,
- invocation.namedArguments).reflectee;
- if (_logging && b.logging) {
- log.add(new LogEntry(name, method, args, action, rtn));
- }
- return rtn;
- }
- }
- }
- if (matchedMethodName) {
- // User did specify behavior for this method, but all the
- // actions are exhausted. This is considered an error.
- throw new Exception('No more actions for method '
- '${qualifiedName(name, method)}.');
- } else if (_throwIfNoBehavior) {
- throw new Exception('No behavior specified for method '
- '${qualifiedName(name, method)}.');
- }
- // Otherwise user hasn't specified behavior for this method; we don't throw
- // so we can underspecify.
- if (_logging) {
- log.add(new LogEntry(name, method, args, Action.IGNORE));
- }
- }
-
- /** [verifyZeroInteractions] returns true if no calls were made */
- bool verifyZeroInteractions() {
- if (log == null) {
- // This means we created the mock with logging off and have never turned
- // it on, so it doesn't make sense to verify behavior on such a mock.
- throw new
- Exception("Can't verify behavior when logging was never enabled.");
- }
- return log.logs.length == 0;
- }
-
- /**
- * [getLogs] extracts all calls from the call log that match the
- * [logFilter], and returns the matching list of [LogEntry]s. If
- * [destructive] is false (the default) the matching calls are left
- * in the log, else they are removed. Removal allows us to verify a
- * set of interactions and then verify that there are no other
- * interactions left. [actionMatcher] can be used to further
- * restrict the returned logs based on the action the mock performed.
- * [logFilter] can be a [CallMatcher] or a predicate function that
- * takes a [LogEntry] and returns a bool.
- *
- * Typical usage:
- *
- * getLogs(callsTo(...)).verify(...);
- */
- LogEntryList getLogs([CallMatcher logFilter,
- Matcher actionMatcher,
- bool destructive = false]) {
- if (log == null) {
- // This means we created the mock with logging off and have never turned
- // it on, so it doesn't make sense to get logs from such a mock.
- throw new
- Exception("Can't retrieve logs when logging was never enabled.");
- } else {
- return log.getMatches(name, logFilter, actionMatcher, destructive);
- }
- }
-
- /**
- * Useful shorthand method that creates a [CallMatcher] from its arguments
- * and then calls [getLogs].
- */
- LogEntryList calls(method,
- [arg0 = NO_ARG,
- arg1 = NO_ARG,
- arg2 = NO_ARG,
- arg3 = NO_ARG,
- arg4 = NO_ARG,
- arg5 = NO_ARG,
- arg6 = NO_ARG,
- arg7 = NO_ARG,
- arg8 = NO_ARG,
- arg9 = NO_ARG]) =>
- getLogs(callsTo(method, arg0, arg1, arg2, arg3, arg4,
- arg5, arg6, arg7, arg8, arg9));
-
- /** Clear the behaviors for the Mock. */
- void resetBehavior() => _behaviors.clear();
-
- /** Clear the logs for the Mock. */
- void clearLogs() {
- if (log != null) {
- if (name == null) { // This log is not shared.
- log.logs.clear();
- } else { // This log may be shared.
- log.logs = log.logs.where((e) => e.mockName != name).toList();
- }
- }
- }
-
- /** Clear both logs and behavior. */
- void reset() {
- resetBehavior();
- clearLogs();
- }
-}
diff --git a/pkg/mock/lib/src/responder.dart b/pkg/mock/lib/src/responder.dart
deleted file mode 100644
index ef0dd71..0000000
--- a/pkg/mock/lib/src/responder.dart
+++ /dev/null
@@ -1,21 +0,0 @@
-// Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-library mock.responder;
-
-import 'action.dart';
-
-/**
- * The behavior of a method call in the mock library is specified
- * with [Responder]s. A [Responder] has a [value] to throw
- * or return (depending on the type of [action]),
- * and can either be one-shot, multi-shot, or infinitely repeating,
- * depending on the value of [count (1, greater than 1, or 0 respectively).
- */
-class Responder {
- final Object value;
- final Action action;
- int count;
- Responder(this.value, [this.count = 1, this.action = Action.RETURN]);
-}
diff --git a/pkg/mock/lib/src/result_matcher.dart b/pkg/mock/lib/src/result_matcher.dart
deleted file mode 100644
index aaf5806..0000000
--- a/pkg/mock/lib/src/result_matcher.dart
+++ /dev/null
@@ -1,68 +0,0 @@
-// Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-library mock.result_matcher;
-
-import 'package:matcher/matcher.dart';
-
-import 'action.dart';
-import 'log_entry.dart';
-
-/**
- * [_ResultMatcher]s are used to make assertions about the results
- * of method calls. These can be used as optional parameters to [getLogs].
- */
-class _ResultMatcher extends Matcher {
- final Action action;
- final Matcher value;
-
- const _ResultMatcher(this.action, this.value);
-
- bool matches(item, Map matchState) {
- if (item is! LogEntry) {
- return false;
- }
- // normalize the action; _PROXY is like _RETURN.
- Action eaction = item.action;
- if (eaction == Action.PROXY) {
- eaction = Action.RETURN;
- }
- return (eaction == action && value.matches(item.value, matchState));
- }
-
- Description describe(Description description) {
- description.add(' to ');
- if (action == Action.RETURN || action == Action.PROXY) {
- description.add('return ');
- } else {
- description.add('throw ');
- }
- return description.addDescriptionOf(value);
- }
-
- Description describeMismatch(item, Description mismatchDescription,
- Map matchState, bool verbose) {
- if (item.action == Action.RETURN || item.action == Action.PROXY) {
- mismatchDescription.add('returned ');
- } else {
- mismatchDescription.add('threw ');
- }
- mismatchDescription.add(item.value);
- return mismatchDescription;
- }
-}
-
-/**
- *[returning] matches log entries where the call to a method returned
- * a value that matched [value].
- */
-Matcher returning(value) =>
- new _ResultMatcher(Action.RETURN, wrapMatcher(value));
-
-/**
- *[throwing] matches log entrues where the call to a method threw
- * a value that matched [value].
- */
-Matcher throwing(value) =>
- new _ResultMatcher(Action.THROW, wrapMatcher(value));
diff --git a/pkg/mock/lib/src/result_set_matcher.dart b/pkg/mock/lib/src/result_set_matcher.dart
deleted file mode 100644
index d4c2177..0000000
--- a/pkg/mock/lib/src/result_set_matcher.dart
+++ /dev/null
@@ -1,144 +0,0 @@
-// Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-library mock.result_set_matcher;
-
-import 'package:matcher/matcher.dart';
-
-import 'action.dart';
-import 'log_entry.dart';
-
-/** Special values for use with [_ResultSetMatcher] [frequency]. */
-class _Frequency {
- /** Every call/throw must match */
- static const ALL = const _Frequency._('ALL');
-
- /** At least one call/throw must match. */
- static const SOME = const _Frequency._('SOME');
-
- /** No calls/throws should match. */
- static const NONE = const _Frequency._('NONE');
-
- const _Frequency._(this.name);
-
- final String name;
-}
-
-/**
- * [_ResultSetMatcher]s are used to make assertions about the results
- * of method calls. When filtering an execution log by calling
- * [getLogs], a [LogEntrySet] of matching call logs is returned;
- * [_ResultSetMatcher]s can then assert various things about this
- * (sub)set of logs.
- *
- * We could make this class use _ResultMatcher but it doesn't buy that
- * match and adds some perf hit, so there is some duplication here.
- */
-class _ResultSetMatcher extends Matcher {
- final Action action;
- final Matcher value;
- final _Frequency frequency; // ALL, SOME, or NONE.
-
- const _ResultSetMatcher(this.action, this.value, this.frequency);
-
- bool matches(logList, Map matchState) {
- for (LogEntry entry in logList) {
- // normalize the action; PROXY is like RETURN.
- Action eaction = entry.action;
- if (eaction == Action.PROXY) {
- eaction = Action.RETURN;
- }
- if (eaction == action && value.matches(entry.value, matchState)) {
- if (frequency == _Frequency.NONE) {
- addStateInfo(matchState, {'entry': entry});
- return false;
- } else if (frequency == _Frequency.SOME) {
- return true;
- }
- } else {
- // Mismatch.
- if (frequency == _Frequency.ALL) { // We need just one mismatch to fail.
- addStateInfo(matchState, {'entry': entry});
- return false;
- }
- }
- }
- // If we get here, then if count is _ALL we got all matches and
- // this is success; otherwise we got all mismatched which is
- // success for count == _NONE and failure for count == _SOME.
- return (frequency != _Frequency.SOME);
- }
-
- Description describe(Description description) {
- description.add(' to ');
- description.add(frequency == _Frequency.ALL ? 'alway ' :
- (frequency == _Frequency.NONE ? 'never ' : 'sometimes '));
- if (action == Action.RETURN || action == Action.PROXY)
- description.add('return ');
- else
- description.add('throw ');
- return description.addDescriptionOf(value);
- }
-
- Description describeMismatch(logList, Description mismatchDescription,
- Map matchState, bool verbose) {
- if (frequency != _Frequency.SOME) {
- LogEntry entry = matchState['entry'];
- if (entry.action == Action.RETURN || entry.action == Action.PROXY) {
- mismatchDescription.add('returned');
- } else {
- mismatchDescription.add('threw');
- }
- mismatchDescription.add(' value that ');
- value.describeMismatch(entry.value, mismatchDescription,
- matchState['state'], verbose);
- mismatchDescription.add(' at least once');
- } else {
- mismatchDescription.add('never did');
- }
- return mismatchDescription;
- }
-}
-
-/**
- *[alwaysReturned] asserts that all matching calls to a method returned
- * a value that matched [value].
- */
-Matcher alwaysReturned(value) =>
- new _ResultSetMatcher(Action.RETURN, wrapMatcher(value), _Frequency.ALL);
-
-/**
- *[sometimeReturned] asserts that at least one matching call to a method
- * returned a value that matched [value].
- */
-Matcher sometimeReturned(value) =>
- new _ResultSetMatcher(Action.RETURN, wrapMatcher(value), _Frequency.SOME);
-
-/**
- *[neverReturned] asserts that no matching calls to a method returned
- * a value that matched [value].
- */
-Matcher neverReturned(value) =>
- new _ResultSetMatcher(Action.RETURN, wrapMatcher(value), _Frequency.NONE);
-
-/**
- *[alwaysThrew] asserts that all matching calls to a method threw
- * a value that matched [value].
- */
-Matcher alwaysThrew(value) =>
- new _ResultSetMatcher(Action.THROW, wrapMatcher(value), _Frequency.ALL);
-
-/**
- *[sometimeThrew] asserts that at least one matching call to a method threw
- * a value that matched [value].
- */
-Matcher sometimeThrew(value) =>
- new _ResultSetMatcher(Action.THROW, wrapMatcher(value), _Frequency.SOME);
-
-/**
- *[neverThrew] asserts that no matching call to a method threw
- * a value that matched [value].
- */
-Matcher neverThrew(value) =>
- new _ResultSetMatcher(Action.THROW, wrapMatcher(value), _Frequency.NONE);
diff --git a/pkg/mock/lib/src/times_matcher.dart b/pkg/mock/lib/src/times_matcher.dart
deleted file mode 100644
index 225fc94..0000000
--- a/pkg/mock/lib/src/times_matcher.dart
+++ /dev/null
@@ -1,65 +0,0 @@
-// Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-library mock.times_matcher;
-
-import 'package:matcher/matcher.dart';
-
-/**
- * [_TimesMatcher]s are used to make assertions about the number of
- * times a method was called.
- */
-class _TimesMatcher extends Matcher {
- final int min, max;
-
- const _TimesMatcher(this.min, [this.max = -1]);
-
- bool matches(logList, Map matchState) => logList.length >= min &&
- (max < 0 || logList.length <= max);
-
- Description describe(Description description) {
- description.add('to be called ');
- if (max < 0) {
- description.add('at least $min');
- } else if (max == min) {
- description.add('$max');
- } else if (min == 0) {
- description.add('at most $max');
- } else {
- description.add('between $min and $max');
- }
- return description.add(' times');
- }
-
- Description describeMismatch(logList, Description mismatchDescription,
- Map matchState, bool verbose) =>
- mismatchDescription.add('was called ${logList.length} times');
-}
-
-/** [happenedExactly] matches an exact number of calls. */
-Matcher happenedExactly(count) {
- return new _TimesMatcher(count, count);
-}
-
-/** [happenedAtLeast] matches a minimum number of calls. */
-Matcher happenedAtLeast(count) {
- return new _TimesMatcher(count);
-}
-
-/** [happenedAtMost] matches a maximum number of calls. */
-Matcher happenedAtMost(count) {
- return new _TimesMatcher(0, count);
-}
-
-/** [neverHappened] matches zero calls. */
-const Matcher neverHappened = const _TimesMatcher(0, 0);
-
-/** [happenedOnce] matches exactly one call. */
-const Matcher happenedOnce = const _TimesMatcher(1, 1);
-
-/** [happenedAtLeastOnce] matches one or more calls. */
-const Matcher happenedAtLeastOnce = const _TimesMatcher(1);
-
-/** [happenedAtMostOnce] matches zero or one call. */
-const Matcher happenedAtMostOnce = const _TimesMatcher(0, 1);
diff --git a/pkg/mock/lib/src/util.dart b/pkg/mock/lib/src/util.dart
deleted file mode 100644
index 5341b88..0000000
--- a/pkg/mock/lib/src/util.dart
+++ /dev/null
@@ -1,28 +0,0 @@
-// Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-library mock.util;
-
-import 'package:matcher/matcher.dart';
-
-/** Utility function for optionally qualified method names */
-String qualifiedName(owner, String method) {
- if (owner == null || identical(owner, anything)) {
- return method;
- } else if (owner is Matcher) {
- Description d = new StringDescription();
- d.addDescriptionOf(owner);
- d.add('.');
- d.add(method);
- return d.toString();
- } else {
- return '$owner.$method';
- }
-}
-
-/** Sentinel value for representing no argument. */
-class _Sentinel {
- const _Sentinel();
-}
-const NO_ARG = const _Sentinel();
diff --git a/pkg/mock/pubspec.yaml b/pkg/mock/pubspec.yaml
deleted file mode 100644
index 6599be6..0000000
--- a/pkg/mock/pubspec.yaml
+++ /dev/null
@@ -1,11 +0,0 @@
-name: mock
-version: 0.11.0+2
-author: Dart Team <misc@dartlang.org>
-description: A library for mocking classes
-homepage: https://pub.dartlang.org/packages/mock
-environment:
- sdk: '>=1.0.0 <2.0.0'
-dependencies:
- matcher: '>=0.10.0 <0.12.0'
-dev_dependencies:
- unittest: '>=0.10.0 <0.12.0'
diff --git a/pkg/mock/test/mock_regexp_negative_test.dart b/pkg/mock/test/mock_regexp_negative_test.dart
deleted file mode 100644
index c22ac41..0000000
--- a/pkg/mock/test/mock_regexp_negative_test.dart
+++ /dev/null
@@ -1,18 +0,0 @@
-// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-library mock.mock_regexp_negative_test;
-
-import 'package:unittest/unittest.dart' show test;
-import 'package:matcher/matcher.dart';
-import 'package:mock/mock.dart';
-
-void main() {
- test('Mocking: RegExp CallMatcher bad', () {
- var m = new Mock();
- m.when(callsTo(matches('^[A-Z]'))).
- alwaysThrow('Method names must start with lower case.');
- m.Test();
- });
-}
diff --git a/pkg/mock/test/mock_stepwise_negative_test.dart b/pkg/mock/test/mock_stepwise_negative_test.dart
deleted file mode 100644
index 769e972..0000000
--- a/pkg/mock/test/mock_stepwise_negative_test.dart
+++ /dev/null
@@ -1,20 +0,0 @@
-// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-library mock.mock_stepwise_negative_test;
-
-import 'package:unittest/unittest.dart' show test;
-import 'package:mock/mock.dart';
-
-main() {
- test('Mocking: stepwiseValidate', () {
- LogEntryList logList = new LogEntryList('test');
- for (var i = 0; i < 10; i++) {
- LogEntry e = new LogEntry(null, 'foo', [i], Action.IGNORE);
- logList.add(e);
- }
- int total = 0;
- logList.stepwiseValidate((log, pos) => 0);
- });
-}
diff --git a/pkg/mock/test/mock_test.dart b/pkg/mock/test/mock_test.dart
deleted file mode 100644
index a4f6db0..0000000
--- a/pkg/mock/test/mock_test.dart
+++ /dev/null
@@ -1,736 +0,0 @@
-// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-library mock.test;
-
-import 'package:unittest/unittest.dart' show test, group, skip_test;
-import 'package:matcher/matcher.dart';
-import 'package:mock/mock.dart';
-
-class MockList extends Mock implements List {
- dynamic noSuchMethod(Invocation invocation) => super.noSuchMethod(invocation);
-}
-
-class Foo {
- sum(a, b, c) => a + b + c;
-}
-
-class FooSpy extends Mock implements Foo {
- final Foo real = new Foo();
-
- FooSpy() {
- this.when(callsTo('sum')).alwaysCall(real.sum);
- }
-
- dynamic noSuchMethod(Invocation invocation) => super.noSuchMethod(invocation);
-}
-
-LogEntry makeTestLogEntry(String methodName, List args, int time,
- [String mockName]) {
- LogEntry e = new LogEntry(mockName, methodName, args, Action.IGNORE);
- e.time = new DateTime.fromMillisecondsSinceEpoch(time, isUtc: true);
- return e;
-}
-
-LogEntryList makeTestLog() {
- var args = new List();
- return new LogEntryList('test')
- ..add(makeTestLogEntry('a', args, 1000))
- ..add(makeTestLogEntry('b', args, 2000))
- ..add(makeTestLogEntry('c', args, 3000));
-}
-
-void main() {
- test('Mocking: Basics', () {
- var m = new Mock();
- // intentional no-opp access to m.length
- var foo = m.length;
- m.getLogs(callsTo('get length')).verify(happenedOnce);
-
- m.when(callsTo('foo', 1, 2)).thenReturn('A').thenReturn('B');
- m.when(callsTo('foo', 1, 1)).thenReturn('C');
- m.when(callsTo('foo', 9, anything)).thenReturn('D');
- m.when(callsTo('bar', anything, anything)).thenReturn('E');
- m.when(callsTo('foobar')).thenReturn('F');
-
- var s = '${m.foo(1,2)}${m.foo(1,1)}${m.foo(9,10)}'
- '${m.bar(1,1)}${m.foo(1,2)}';
- m.getLogs(callsTo('foo', anything, anything)).verify(happenedExactly(4));
- m.getLogs(callsTo('foo', 1, anything)).verify(happenedExactly(3));
- m.getLogs(callsTo('foo', 9, anything)).verify(happenedOnce);
- m.getLogs(callsTo('foo', anything, 2)).verify(happenedExactly(2));
- m.getLogs(callsTo('foobar')).verify(neverHappened);
- m.getLogs(callsTo('foo', 10, anything)).verify(neverHappened);
- m.getLogs(callsTo('foo'), returning(anyOf('A', 'C'))).
- verify(happenedExactly(2));
- expect(s, 'ACDEB');
- });
-
- test('Mocking: getters/setters', () {
- var m = new Mock();
- var x = 0;
- m.when(callsTo('get foo')).alwaysReturn(3);
- m.when(callsTo('set foo')).alwaysCall((v) { x = v; });
- m.when(callsTo('get bar')).alwaysReturn(5);
- m.when(callsTo('set bar')).alwaysCall((v) { x = 2 * v; });
- expect(m.foo, 3);
- expect(m.bar, 5);
- m.foo = 10;
- expect(x, 10);
- m.bar = 8;
- expect(x, 16);
- });
-
- test('Mocking: Mock List', () {
- var l = new MockList();
- l.when(callsTo('get length')).thenReturn(1);
- l.when(callsTo('add', anything)).alwaysReturn(0);
- l.add('foo');
- expect(l.length, 1);
-
- var m = new MockList();
- m.when(callsTo('add', anything)).alwaysReturn(0);
-
- m.add('foo');
- m.add('bar');
-
- m.getLogs(callsTo('add')).verify(happenedExactly(2));
- m.getLogs(callsTo('add', 'foo')).verify(happenedOnce);
- });
-
- test('Mocking: Spy', () {
- var p = new FooSpy();
- p.sum(1, 2, 3);
- p.getLogs(callsTo('sum')).verify(happenedOnce);
- p.sum(2, 2, 2);
- p.getLogs(callsTo('sum')).verify(happenedExactly(2));
- p.getLogs(callsTo('sum')).verify(sometimeReturned(6));
- p.getLogs(callsTo('sum')).verify(alwaysReturned(6));
- p.getLogs(callsTo('sum')).verify(neverReturned(5));
- p.sum(2, 2, 1);
- p.getLogs(callsTo('sum')).verify(sometimeReturned(5));
- });
-
- test('Mocking: Excess Calls', () {
- var m = new Mock();
- m.when(callsTo('foo')).alwaysReturn(null);
- expect(() { m.foo(); }, returnsNormally);
- expect(() { m.foo(); }, returnsNormally);
- expect(
- () {
- m.getLogs(callsTo('foo')).verify(happenedOnce);
- },
- throwsA(
- (e) =>
- collapseWhitespace(e.toString()) ==
- "Expected foo() to be called 1 times but:"
- " was called 2 times.")
- );
- });
-
- test('Mocking: No action', () {
- var m = new Mock();
- m.when(callsTo('foo')).thenReturn(null);
- expect(() => m.foo(), returnsNormally);
- expect(() => m.foo(), throwsA((e) =>
- e.toString() == 'Exception: No more actions for method foo.'));
- });
-
- test('Mocking: No matching return', () {
- var p = new FooSpy();
- p.sum(1, 2, 3);
- expect(() => p.getLogs(callsTo('sum')).verify(sometimeReturned(0)),
- throwsA((e) => collapseWhitespace(e.toString()) ==
- "Expected sum() to sometimes return <0> but: never did.")
- );
- });
-
- test('Mocking: No behavior', () {
- var m = new Mock.custom(throwIfNoBehavior:true);
- m.when(callsTo('foo')).thenReturn(null);
- expect(() => m.foo(), returnsNormally);
- expect(() => m.bar(), throwsA((e) => e.toString() ==
- 'Exception: No behavior specified for method bar.'));
- });
-
- test('Mocking: Shared logList', () {
- var logList = new LogEntryList();
- var m1 = new Mock.custom(name: 'm1', log: logList);
- var m2 = new Mock.custom(name: 'm2', log: logList);
- m1.foo();
- m2.foo();
- m1.bar();
- m2.bar();
- expect(logList.logs.length, 4);
- logList.getMatches(anything, callsTo('foo')).verify(happenedExactly(2));
- logList.getMatches('m1', callsTo('foo')).verify(happenedOnce);
- logList.getMatches('m1', callsTo('bar')).verify(happenedOnce);
- m2.getLogs(callsTo('foo')).verify(happenedOnce);
- m2.getLogs(callsTo('bar')).verify(happenedOnce);
- });
-
- test('Mocking: Null CallMatcher', () {
- var m = new Mock();
- m.when(callsTo(null, 1)).alwaysReturn(2);
- m.when(callsTo(null, 2)).alwaysReturn(4);
- expect(m.foo(1), 2);
- expect(m.foo(2), 4);
- expect(m.bar(1), 2);
- expect(m.bar(2), 4);
- m.getLogs(callsTo()).verify(happenedExactly(4));
- m.getLogs(callsTo(null, 1)).verify(happenedExactly(2));
- m.getLogs(callsTo(null, 2)).verify(happenedExactly(2));
- m.getLogs(null, returning(1)).verify(neverHappened);
- m.getLogs(null, returning(2)).verify(happenedExactly(2));
- m.getLogs(null, returning(4)).verify(happenedExactly(2));
- });
-
- test('Mocking: RegExp CallMatcher good', () {
- var m = new Mock();
- m.when(callsTo(matches('^[A-Z]'))).
- alwaysThrow('Method names must start with lower case.');
- m.test();
- });
-
- test('Mocking: No logging', () {
- var m = new Mock.custom(enableLogging: false);
- m.Test();
- expect(() => m.getLogs(callsTo('Test')), throwsA((e) => e.toString() ==
- "Exception: Can't retrieve logs when logging was never enabled."));
- });
-
- test('Mocking: Find logList entry', () {
- LogEntryList logList = makeTestLog();
- // Basic behavior, with call matcher.
- expect(logList.findLogEntry(callsTo('a')), 0);
- expect(logList.findLogEntry(callsTo('b')), 1);
- expect(logList.findLogEntry(callsTo('c')), 2);
- expect(logList.findLogEntry(callsTo('d')), -1);
- // Find using predicate.
- expect(logList.findLogEntry((le) => le.methodName == 'a'), 0);
- expect(logList.findLogEntry((le) => le.methodName == 'b'), 1);
- expect(logList.findLogEntry((le) => le.methodName == 'c'), 2);
- // Test explicit return value.
- expect(logList.findLogEntry((le) => le.methodName == 'd', 0, 3), 3);
- // Find from start of logList.
- expect(logList.findLogEntry(callsTo('a'), 0), 0);
- expect(logList.findLogEntry(callsTo('b'), 0), 1);
- expect(logList.findLogEntry(callsTo('c'), 0), 2);
- // Find from second entry in logList.
- expect(logList.findLogEntry(callsTo('a'), 1), -1);
- expect(logList.findLogEntry(callsTo('b'), 1), 1);
- expect(logList.findLogEntry(callsTo('c'), 1), 2);
- // Find from last entry in logList.
- expect(logList.findLogEntry(callsTo('a'), 2), -1);
- expect(logList.findLogEntry(callsTo('b'), 2), -1);
- expect(logList.findLogEntry(callsTo('c'), 2), 2);
- // Find from start position passed end of logList.
- expect(logList.findLogEntry(callsTo('a'), 3), -1);
- expect(logList.findLogEntry(callsTo('b'), 3), -1);
- expect(logList.findLogEntry(callsTo('c'), 3), -1);
- // No restriction on entry.
- expect(logList.findLogEntry(null, 0), 0);
- expect(logList.findLogEntry(null, 1), 1);
- expect(logList.findLogEntry(null, 2), 2);
- expect(logList.findLogEntry(null, 3), -1);
- });
-
- test('Mocking: from,after,before,until', () {
- LogEntryList logList = makeTestLog();
- LogEntryList log2;
- DateTime t0 = new DateTime.fromMillisecondsSinceEpoch(0, isUtc: true);
- DateTime t1000 = new DateTime.fromMillisecondsSinceEpoch(1000, isUtc: true);
- DateTime t2000 = new DateTime.fromMillisecondsSinceEpoch(2000, isUtc: true);
- DateTime t3000 = new DateTime.fromMillisecondsSinceEpoch(3000, isUtc: true);
- DateTime t4000 = new DateTime.fromMillisecondsSinceEpoch(4000, isUtc: true);
-
- log2 = logList.before(t0);
- expect(log2.logs, hasLength(0));
- expect(log2.filter, 'test before 1970-01-01 00:00:00.000Z');
- log2 = logList.until(t0);
- expect(log2.logs, hasLength(0));
- expect(log2.filter, 'test until 1970-01-01 00:00:00.000Z');
- log2 = logList.from(t0);
- expect(log2.logs, hasLength(3));
- expect(log2.first.methodName, 'a');
- expect(log2.last.methodName, 'c');
- expect(log2.filter, 'test from 1970-01-01 00:00:00.000Z');
- log2 = logList.after(t0);
- expect(log2.logs, hasLength(3));
- expect(log2.first.methodName, 'a');
- expect(log2.last.methodName, 'c');
- expect(log2.filter, 'test after 1970-01-01 00:00:00.000Z');
-
- log2 = logList.before(t1000);
- expect(log2.logs, hasLength(0));
- log2 = logList.until(t1000);
- expect(log2.logs, hasLength(1));
- expect(log2.first.methodName, 'a');
- expect(log2.last.methodName, 'a');
- log2 = logList.from(t1000);
- expect(log2.logs, hasLength(3));
- expect(log2.first.methodName, 'a');
- expect(log2.last.methodName, 'c');
- log2 = logList.after(t1000);
- expect(log2.logs, hasLength(2));
- expect(log2.first.methodName, 'b');
- expect(log2.last.methodName, 'c');
-
- log2 = logList.before(t2000);
- expect(log2.logs, hasLength(1));
- expect(log2.first.methodName, 'a');
- expect(log2.last.methodName, 'a');
- log2 = logList.until(t2000);
- expect(log2.logs, hasLength(2));
- expect(log2.first.methodName, 'a');
- expect(log2.last.methodName, 'b');
- log2 = logList.from(t2000);
- expect(log2.logs, hasLength(2));
- expect(log2.first.methodName, 'b');
- expect(log2.last.methodName, 'c');
- log2 = logList.after(t2000);
- expect(log2.logs, hasLength(1));
- expect(log2.first.methodName, 'c');
- expect(log2.last.methodName, 'c');
-
- log2 = logList.before(t3000);
- expect(log2.logs, hasLength(2));
- expect(log2.first.methodName, 'a');
- expect(log2.last.methodName, 'b');
- log2 = logList.until(t3000);
- expect(log2.logs, hasLength(3));
- expect(log2.first.methodName, 'a');
- expect(log2.last.methodName, 'c');
-
- log2 = logList.from(t3000);
- expect(log2.logs, hasLength(1));
- expect(log2.first.methodName, 'c');
- expect(log2.last.methodName, 'c');
- log2 = logList.after(t3000);
- expect(log2.logs, hasLength(0));
-
- log2 = logList.before(t4000);
- expect(log2.logs, hasLength(3));
- expect(log2.first.methodName, 'a');
- expect(log2.last.methodName, 'c');
- log2 = logList.until(t4000);
- expect(log2.logs, hasLength(3));
- expect(log2.first.methodName, 'a');
- expect(log2.last.methodName, 'c');
- log2 = logList.from(t4000);
- expect(log2.logs, hasLength(0));
- log2 = logList.after(t4000);
- expect(log2.logs, hasLength(0));
- });
-
- test('Mocking: inplace from,after,before,until', () {
- DateTime t0 = new DateTime.fromMillisecondsSinceEpoch(0, isUtc: true);
- DateTime t1000 = new DateTime.fromMillisecondsSinceEpoch(1000, isUtc: true);
- DateTime t2000 = new DateTime.fromMillisecondsSinceEpoch(2000, isUtc: true);
- DateTime t3000 = new DateTime.fromMillisecondsSinceEpoch(3000, isUtc: true);
- DateTime t4000 = new DateTime.fromMillisecondsSinceEpoch(4000, isUtc: true);
-
- LogEntryList logList = makeTestLog().before(t0, true);
- expect(logList.logs, hasLength(0));
- expect(logList.filter, 'test before 1970-01-01 00:00:00.000Z');
- logList = makeTestLog().until(t0, true);
- expect(logList.logs, hasLength(0));
- expect(logList.filter, 'test until 1970-01-01 00:00:00.000Z');
- logList = makeTestLog().from(t0, true);
- expect(logList.logs, hasLength(3));
- expect(logList.first.methodName, 'a');
- expect(logList.last.methodName, 'c');
- expect(logList.filter, 'test from 1970-01-01 00:00:00.000Z');
- logList = makeTestLog().after(t0, true);
- expect(logList.logs, hasLength(3));
- expect(logList.first.methodName, 'a');
- expect(logList.last.methodName, 'c');
- expect(logList.filter, 'test after 1970-01-01 00:00:00.000Z');
-
- logList = makeTestLog().before(t1000, true);
- expect(logList.logs, hasLength(0));
- logList = makeTestLog().until(t1000, true);
- expect(logList.logs, hasLength(1));
- expect(logList.first.methodName, 'a');
- expect(logList.last.methodName, 'a');
- logList = makeTestLog().from(t1000, true);
- expect(logList.logs, hasLength(3));
- expect(logList.first.methodName, 'a');
- expect(logList.last.methodName, 'c');
- logList = makeTestLog().after(t1000, true);
- expect(logList.logs, hasLength(2));
- expect(logList.first.methodName, 'b');
- expect(logList.last.methodName, 'c');
-
- logList = makeTestLog().before(t2000, true);
- expect(logList.logs, hasLength(1));
- expect(logList.first.methodName, 'a');
- expect(logList.last.methodName, 'a');
- logList = makeTestLog().until(t2000, true);
- expect(logList.logs, hasLength(2));
- expect(logList.first.methodName, 'a');
- expect(logList.last.methodName, 'b');
- logList = makeTestLog().from(t2000, true);
- expect(logList.logs, hasLength(2));
- expect(logList.first.methodName, 'b');
- expect(logList.last.methodName, 'c');
- logList = makeTestLog().after(t2000, true);
- expect(logList.logs, hasLength(1));
- expect(logList.first.methodName, 'c');
- expect(logList.last.methodName, 'c');
-
- logList = makeTestLog().before(t3000, true);
- expect(logList.logs, hasLength(2));
- expect(logList.first.methodName, 'a');
- expect(logList.last.methodName, 'b');
- logList = makeTestLog().until(t3000, true);
- expect(logList.logs, hasLength(3));
- expect(logList.first.methodName, 'a');
- expect(logList.last.methodName, 'c');
- logList = makeTestLog().from(t3000, true);
- expect(logList.logs, hasLength(1));
- expect(logList.first.methodName, 'c');
- expect(logList.last.methodName, 'c');
- logList = makeTestLog().after(t3000);
- expect(logList.logs, hasLength(0));
-
- logList = makeTestLog().before(t4000, true);
- expect(logList.logs, hasLength(3));
- expect(logList.first.methodName, 'a');
- expect(logList.last.methodName, 'c');
- logList = makeTestLog().until(t4000, true);
- expect(logList.logs, hasLength(3));
- expect(logList.first.methodName, 'a');
- expect(logList.last.methodName, 'c');
- logList = makeTestLog().from(t4000, true);
- expect(logList.logs, hasLength(0));
- logList = makeTestLog().after(t4000, true);
- expect(logList.logs, hasLength(0));
- });
-
- test('Mocking: Neighbors', () {
- LogEntryList logList = new LogEntryList('test');
- List args0 = new List();
- List args1 = new List();
- args1.add('test');
- LogEntry e0 = makeTestLogEntry('foo', args0, 1000);
- logList.add(e0);
- LogEntry e1 = makeTestLogEntry('bar1', args0, 2000, 'a');
- logList.add(e1);
- LogEntry e2 = makeTestLogEntry('bar1', args1, 3000, 'b');
- logList.add(e2);
- LogEntry e3 = makeTestLogEntry('foo', args0, 4000);
- logList.add(e3);
- LogEntry e4 = makeTestLogEntry('hello', args0, 4500);
- logList.add(e4);
- LogEntry e5 = makeTestLogEntry('bar2', args0, 5000, 'a');
- logList.add(e5);
- LogEntry e6 = makeTestLogEntry('bar2', args1, 6000, 'b');
- logList.add(e6);
- LogEntry e7 = makeTestLogEntry('foo', args0, 7000);
- logList.add(e7);
- LogEntry e8 = makeTestLogEntry('bar3', args0, 8000, 'a');
- logList.add(e8);
- LogEntry e9 = makeTestLogEntry('bar3', args1, 9000, 'b');
- logList.add(e9);
- LogEntry e10 = makeTestLogEntry('foo', args0, 10000);
- logList.add(e10);
-
- LogEntryList keyList = new LogEntryList('keys');
-
- // Test with empty key list.
-
- LogEntryList result;
- result = logList.preceding(keyList);
- expect(result.logs, hasLength(0));
-
- result = logList.preceding(keyList, includeKeys: true);
- expect(result.logs, hasLength(0));
-
- // Single key, distance 1, no restrictions.
-
- keyList.add(e3);
- result = logList.preceding(keyList);
- expect(result.logs, orderedEquals([e2]));
-
- result = logList.following(keyList);
- expect(result.logs, orderedEquals([e4]));
-
- // Single key, distance 2, no restrictions.
-
- result = logList.preceding(keyList, distance: 2);
- expect(result.logs, orderedEquals([e1, e2]));
-
- result = logList.following(keyList, distance: 2);
- expect(result.logs, orderedEquals([e4, e5]));
-
- // Single key, distance 3, no restrictions.
-
- result = logList.preceding(keyList, distance: 3);
- expect(result.logs, orderedEquals([e0, e1, e2]));
-
- result = logList.following(keyList, distance: 3);
- expect(result.logs, orderedEquals([e4, e5, e6]));
-
- // Include keys in result
-
- result = logList.preceding(keyList, distance: 3, includeKeys: true);
- expect(result.logs, orderedEquals([e0, e1, e2, e3]));
-
- result = logList.following(keyList, distance: 3, includeKeys: true);
- expect(result.logs, orderedEquals([e3, e4, e5, e6]));
-
- // Restrict the matches
-
- result = logList.preceding(keyList, logFilter:callsTo(startsWith('bar')),
- distance:3);
- expect(result.logs, orderedEquals([e1, e2]));
-
- result = logList.preceding(keyList, logFilter:callsTo(startsWith('bar')),
- distance:3, includeKeys:true);
- expect(result.logs, orderedEquals([e1, e2, e3]));
-
- result = logList.preceding(keyList, mockNameFilter: equals('a'),
- logFilter: callsTo(startsWith('bar')), distance:3);
- expect(result.logs, orderedEquals([e1]));
-
- result = logList.preceding(keyList, mockNameFilter: equals('a'),
- logFilter: callsTo(startsWith('bar')), distance:3, includeKeys:true);
- expect(result.logs, orderedEquals([e1, e3]));
-
- keyList.logs.clear();
- keyList.add(e0);
- keyList.add(e3);
- keyList.add(e7);
-
- result = logList.preceding(keyList);
- expect(result.logs, orderedEquals([e2, e6]));
-
- result = logList.following(keyList);
- expect(result.logs, orderedEquals([e1, e4, e8]));
-
- result = logList.preceding(keyList, includeKeys: true);
- expect(result.logs, orderedEquals([e0, e2, e3, e6, e7]));
-
- result = logList.following(keyList, includeKeys: true);
- expect(result.logs, orderedEquals([e0, e1, e3, e4, e7, e8]));
-
- keyList.logs.clear();
- keyList.add(e3);
- keyList.add(e7);
- keyList.add(e10);
-
- result = logList.preceding(keyList);
- expect(result.logs, orderedEquals([e2, e6, e9]));
-
- result = logList.following(keyList);
- expect(result.logs, orderedEquals([e4, e8]));
-
- result = logList.preceding(keyList, includeKeys: true);
- expect(result.logs, orderedEquals([e2, e3, e6, e7, e9, e10]));
-
- result = logList.following(keyList, includeKeys: true);
- expect(result.logs, orderedEquals([e3, e4, e7, e8, e10]));
-
- keyList.logs.clear();
- keyList.add(e0);
- keyList.add(e3);
- keyList.add(e7);
- keyList.add(e10);
-
- result = logList.preceding(keyList);
- expect(result.logs, orderedEquals([e2, e6, e9]));
-
- result = logList.following(keyList);
- expect(result.logs, orderedEquals([e1, e4, e8]));
-
- result = logList.preceding(keyList, includeKeys: true);
- expect(result.logs, orderedEquals([e0, e2, e3, e6, e7, e9, e10]));
-
- result = logList.following(keyList, includeKeys: true);
- expect(result.logs, orderedEquals([e0, e1, e3, e4, e7, e8, e10]));
-
- keyList.logs.clear();
- keyList.add(e0);
- keyList.add(e3);
- keyList.add(e7);
-
- result = logList.preceding(keyList, distance: 3);
- expect(result.logs, orderedEquals([e1, e2, e4, e5, e6]));
-
- result = logList.following(keyList, distance: 3);
- expect(result.logs, orderedEquals([e1, e2, e4, e5, e6, e8, e9, e10]));
-
- result = logList.preceding(keyList, distance: 3, includeKeys: true);
- expect(result.logs, orderedEquals([e0, e1, e2, e3, e4, e5, e6, e7]));
-
- result = logList.following(keyList, distance:3, includeKeys:true);
- expect(result.logs, orderedEquals([e0, e1, e2, e3, e4, e5, e6,
- e7, e8, e9, e10]));
-
- keyList.logs.clear();
- keyList.add(e3);
- keyList.add(e7);
- keyList.add(e10);
-
- result = logList.preceding(keyList, distance: 3);
- expect(result.logs, orderedEquals([e0, e1, e2, e4, e5, e6, e8, e9]));
-
- result = logList.following(keyList, distance: 3);
- expect(result.logs, orderedEquals([e4, e5, e6, e8, e9]));
-
- result = logList.preceding(keyList, distance:3, includeKeys:true);
- expect(result.logs, orderedEquals([e0, e1, e2, e3, e4, e5, e6,
- e7, e8, e9, e10]));
-
- result = logList.following(keyList, distance: 3, includeKeys: true);
- expect(result.logs, orderedEquals([e3, e4, e5, e6, e7, e8, e9, e10]));
-
- keyList.logs.clear();
- keyList.add(e0);
- keyList.add(e3);
- keyList.add(e7);
- keyList.add(e10);
-
- result = logList.preceding(keyList, distance: 3);
- expect(result.logs, orderedEquals([e1, e2, e4, e5, e6, e8, e9]));
-
- result = logList.following(keyList, distance: 3);
- expect(result.logs, orderedEquals([e1, e2, e4, e5, e6, e8, e9]));
-
- result = logList.preceding(keyList, distance:3, includeKeys:true);
- expect(result.logs, orderedEquals([e0, e1, e2, e3, e4, e5, e6,
- e7, e8, e9, e10]));
-
- result = logList.following(keyList, distance:3, includeKeys:true);
- expect(result.logs, orderedEquals([e0, e1, e2, e3, e4, e5, e6,
- e7, e8, e9, e10]));
- });
-
- test('Mocking: stepwiseValidate', () {
- LogEntryList logList = new LogEntryList('test');
- for (var i = 0; i < 10; i++) {
- LogEntry e = new LogEntry(null, 'foo', [i], Action.IGNORE);
- logList.add(e);
- }
- int total = 0;
- logList.stepwiseValidate((log, pos) {
- total += log[pos].args[0] * log[pos + 1].args[0];
- expect(log[pos + 1].args[0] - log[pos].args[0], equals(1));
- return 2;
- });
- expect(total, equals((0 * 1) + (2 * 3) + (4 * 5) + (6 * 7) + (8 * 9)));
- });
-
- test('Mocking: clearLogs', () {
- var m = new Mock();
- m.foo();
- m.foo();
- m.foo();
- expect(m.log.logs, hasLength(3));
- m.clearLogs();
- expect(m.log.logs, hasLength(0));
- LogEntryList log = new LogEntryList();
- var m1 = new Mock.custom(name: 'm1', log: log);
- var m2 = new Mock.custom(name: 'm2', log: log);
- var m3 = new Mock.custom(name: 'm3', log: log);
- for (var i = 0; i < 3; i++) {
- m1.foo();
- m2.bar();
- m3.pow();
- }
- expect(log.logs, hasLength(9));
- m1.clearLogs();
- expect(log.logs, hasLength(6));
- m1.clearLogs();
- expect(log.logs, hasLength(6));
- expect(log.logs.every((e) => e.mockName == 'm2' || e.mockName == 'm3'),
- isTrue);
- m2.clearLogs();
- expect(log.logs, hasLength(3));
- expect(log.logs.every((e) => e.mockName == 'm3'), isTrue);
- m3.clearLogs();
- expect(log.logs, hasLength(0));
- });
-
- // TODO(kevmoo): figure out why this test is failing
- skip_test("Mocking: instances", () {
- var alice = new Object();
- var bob = new Object();
- var m = new Mock();
- m.when(callsTo("foo", alice)).alwaysReturn(true);
- m.when(callsTo("foo", bob)).alwaysReturn(false);
- expect(m.foo(alice), true);
- expect(m.foo(bob), false);
- expect(m.foo(alice), true);
- expect(m.foo(bob), false);
- });
-
- test("Behavior ordering", () {
- // This is distinct from value ordering, i.e.
- //
- // m.when(...).thenReturn(1).thenReturn(2)
- //
- // Here we want to test using distinct matchers being
- // applied in order, so we have a single call that
- // matches 3 different behaviors, and test that
- // the behaviors are applied in the order they are
- // defined.
- var m = new Mock();
- m.when(callsTo("foo")).thenReturn("A");
- m.when(callsTo("foo", "bar")).thenReturn("B");
- m.when(callsTo("foo", "bar", "mock")).alwaysReturn("C");
- expect(m.foo("bar", "mock"), "A");
- expect(m.foo("bar", "mock"), "B");
- expect(m.foo("bar", "mock"), "C");
- expect(m.foo("bar", "mock"), "C");
- m.resetBehavior();
-
- m.when(callsTo("foo")).thenReturn("A");
- m.when(callsTo("foo", "bar", "mock")).alwaysReturn("C");
- m.when(callsTo("foo", "bar")).thenReturn("B");
- expect(m.foo("bar", "mock"), "A");
- expect(m.foo("bar", "mock"), "C");
- expect(m.foo("bar", "mock"), "C");
- expect(m.foo("bar", "mock"), "C");
- m.resetBehavior();
-
- m.when(callsTo("foo", "bar")).thenReturn("B");
- m.when(callsTo("foo")).thenReturn("A");
- m.when(callsTo("foo", "bar", "mock")).alwaysReturn("C");
- expect(m.foo("bar", "mock"), "B");
- expect(m.foo("bar", "mock"), "A");
- expect(m.foo("bar", "mock"), "C");
- expect(m.foo("bar", "mock"), "C");
- m.resetBehavior();
-
- m.when(callsTo("foo", "bar")).thenReturn("B");
- m.when(callsTo("foo", "bar", "mock")).alwaysReturn("C");
- m.when(callsTo("foo")).thenReturn("A");
- expect(m.foo("bar", "mock"), "B");
- expect(m.foo("bar", "mock"), "C");
- expect(m.foo("bar", "mock"), "C");
- expect(m.foo("bar", "mock"), "C");
- m.resetBehavior();
-
- m.when(callsTo("foo", "bar", "mock")).alwaysReturn("C");
- m.when(callsTo("foo")).thenReturn("A");
- m.when(callsTo("foo", "bar")).thenReturn("B");
- expect(m.foo("bar", "mock"), "C");
- expect(m.foo("bar", "mock"), "C");
- expect(m.foo("bar", "mock"), "C");
- expect(m.foo("bar", "mock"), "C");
- m.resetBehavior();
- });
-
- test('Spys', () {
- var real = new Foo();
- var spy = new Mock.spy(real);
- var sum = spy.sum(1, 2, 3);
- expect(sum, 6);
- expect(() => spy.total(1, 2, 3), throwsNoSuchMethodError);
- spy.getLogs(callsTo('sum')).verify(happenedExactly(1));
- spy.getLogs(callsTo('total')).verify(happenedExactly(1));
- });
-}
diff --git a/pkg/pkg.gyp b/pkg/pkg.gyp
index 54a5a5f..eed2aac 100644
--- a/pkg/pkg.gyp
+++ b/pkg/pkg.gyp
@@ -14,8 +14,6 @@
'../tools/make_links.py',
'<!@(["python", "../tools/list_pkg_directories.py", "."])',
'<!@(["python", "../tools/list_pkg_directories.py", '
- '"third_party"])',
- '<!@(["python", "../tools/list_pkg_directories.py", '
'"../third_party/pkg"])',
'<!@(["python", "../tools/list_pkg_directories.py", '
'"../third_party/pkg_tested"])',
diff --git a/pkg/pkg.status b/pkg/pkg.status
index a38d8eb..afbb77b 100644
--- a/pkg/pkg.status
+++ b/pkg/pkg.status
@@ -15,8 +15,6 @@
docgen/test/inherited_comments_test: Fail # issue 22233
[ $compiler == none && ($runtime == drt || $runtime == dartium || $runtime == ContentShellOnAndroid) ]
-third_party/angular_tests/browser_test/*: Skip # github perf_api.dart issue 5
-third_party/angular_tests/browser_test/core_dom/shadow_root_options: Fail # Issue 19329
mutation_observer: Skip # Issue 21149
unittest/*: Skip # Issue 21949
@@ -30,16 +28,10 @@
analyzer/test/generated/element_test: SkipSlow # Times out
analyzer/test/generated/parser_test: SkipSlow # Times out
docgen/test/*: SkipSlow
-third_party/html5lib/test/tokenizer_test: SkipSlow # Times out
[ $runtime == vm && $system == windows]
analysis_server/test/analysis/get_errors_test: Skip # runtime error, Issue 22180
-[ $runtime == vm && ( $arch == simarm || $arch == simmips ) ]
-docgen/test/*: SkipSlow
-third_party/html5lib/test/tokenizer_test: Pass, Slow
-analysis_server/*: SkipSlow # Timeout in some tests.
-
[ $compiler == dart2js ]
collection/test/equality_test/01: Fail # Issue 1533
collection/test/equality_test/02: Fail # Issue 1533
@@ -48,7 +40,6 @@
collection/test/equality_test/05: Fail # Issue 1533
collection/test/equality_test/none: Pass, Fail # Issue 14348
docgen/test/*: SkipSlow # Far too slow
-third_party/angular_tests/browser_test: Pass, Slow # Large dart2js compile time
typed_data/test/typed_buffers_test/01: Fail # Not supporting Int64List, Uint64List.
analyzer/test/generated/engine_test: SkipSlow
analyzer/test/generated/static_type_warning_code_test: Pass, Slow
@@ -71,9 +62,6 @@
[ $compiler == dart2js && $checked ]
crypto/test/base64_test: Slow, Pass
-[ $compiler == dart2js && $runtime == drt ]
-third_party/angular_tests/browser_test/core_dom/shadow_root_options: Fail # Issue 19329
-
[ $runtime == d8 ]
analysis_server/test/analysis_notification_overrides_test: Pass, Slow # Issue 19756
analysis_server/test/analysis_notification_occurrences_test: Pass, Slow # Issue 19756
@@ -104,9 +92,6 @@
collection/test/unmodifiable_collection_test: SkipSlow # Times out. Issue 22050
async/test/stream_zip_test: SkipSlow # Times out. Issue 22050
-[ $runtime == vm || $runtime == d8 || $runtime == jsshell ]
-third_party/angular_tests/browser_test: SkipByDesign # uses dart:html
-
[$compiler == dart2dart]
*: Skip
@@ -118,26 +103,12 @@
# Unexplained errors only occuring on Safari 6.1 and earlier.
typed_data/test/typed_buffers_test: RuntimeError
-# Skip browser-specific tests on VM
-[ $runtime == vm ]
-third_party/angular_tests/vm_test: Fail # Uses removed APIs. See issue 18733.
-
[ $runtime == vm && $system == windows ]
analyzer/test/generated/all_the_rest_test: Fail # Issue 21772
[ $compiler == dartanalyzer || $compiler == dart2analyzer ]
-# These tests are runtime negative but statically positive, so we skip
-# them in the analyzer.
-mock/test/mock_regexp_negative_test: Skip
-mock/test/mock_stepwise_negative_test: Skip
-
compiler/samples/compile_loop/compile_loop: CompileTimeError # Issue 16524
-[ $compiler == dartanalyzer || $compiler == dart2analyzer ]
-# This test uses third_party/pkg/perf_api/lib/perf_api.dart, which
-# contains illegal constant constructors.
-third_party/angular_tests/browser_test: CompileTimeError
-
[ $compiler == dart2js && $csp ]
# This test cannot run under CSP because it is injecting a JavaScript polyfill
mutation_observer: Skip
@@ -157,13 +128,8 @@
observe/test/transformer_test: Fail, OK # Uses dart:io.
observe/test/unique_message_test: SkipByDesign # Uses dart:io.
stub_core_library/test/*: Fail, OK # Uses dart:io.
-third_party/angular_tests/browser_test/core_dom/cookies: Fail # Issue 16337
-third_party/angular_tests/vm_test: SkipByDesign # Uses dart:io
-third_party/html5lib/test/parser_test: SkipByDesign # Uses dart:io.
-third_party/html5lib/test/selectors/*: SkipByDesign # Uses dart:io.
-third_party/html5lib/test/tokenizer_test: SkipByDesign # Uses dart:io.
-[ $arch == simarm64 || $arch == armv5te ]
+[ $runtime == vm && ($arch == simarm64 || $arch == simarm || $arch == simarmv5te || $arch == simmips || $arch == armv5te) ]
# Timeout. These are not unit tests. They do not run efficiently on our
# simulator or low-end devices.
*: Skip
@@ -171,24 +137,513 @@
[ $runtime == vm ]
# Skip tests on the VM if the package depends on dart:html
mutation_observer: Skip
-third_party/html5lib/test/browser/browser_test: Skip
-
-[ $compiler == dartanalyzer || $compiler == dart2analyzer ]
-third_party/angular_tests/vm_test: StaticWarning # Uses removed APIs. See issue 18733.
-
-[ $runtime == safari || $runtime == safarimobilesim || $runtime == chrome || $runtime == ff || $ie ]
-# Various issues due to limited browser testing in Angular.
-third_party/angular_tests/*: Skip
[ $compiler == dart2js && $runtime == chrome && $system == macos ]
third_party/di_tests/di_test: Pass, Slow # Issue 22896
-[ $unchecked ]
-third_party/angular_tests/browser_test/angular: SkipByDesign # Requires checked mode.
-third_party/angular_tests/browser_test/core/scope: SkipByDesign # Requires checked mode.
-third_party/angular_tests/browser_test/core/zone: SkipByDesign # Requires checked mode.
-third_party/angular_tests/browser_test/directive/ng_repeat: Skip # Issue 17152
-third_party/angular_tests/browser_test/change_detection/dirty_checking_change_detector: Skip # Issue 17152
-
[ $use_repository_packages ]
analyzer/test/*: PubGetError
+
+[ $compiler == dart2js && $cps_ir ]
+analysis_server/tool/spec/check_all_test: Crash # unsupported element kind: context:field
+analyzer2dart/test/driver_test: Crash # cannot compile methods that need interceptor calling convention.
+analyzer2dart/test/end2end_test: Crash # Please triage this failure.
+analyzer2dart/test/identifier_semantics_test: Crash # cannot compile methods that need interceptor calling convention.
+analyzer2dart/test/sexpr_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+analyzer2dart/test/tree_shaker_test: Crash # cannot compile methods that need interceptor calling convention.
+analyzer/test/cancelable_future_test: Crash # Unhandled node
+analyzer/test/enum_test: Crash # Unhandled node
+analyzer/test/file_system/memory_file_system_test: Crash # Unhandled node
+analyzer/test/file_system/physical_resource_provider_test: Crash # Unhandled node
+analyzer/test/file_system/resource_uri_resolver_test: Crash # Unhandled node
+analyzer/test/generated/all_the_rest_test: Crash # Unhandled node
+analyzer/test/generated/ast_test: Crash # Unhandled node
+analyzer/test/generated/compile_time_error_code_test: Crash # Unhandled node
+analyzer/test/generated/element_test: Crash # Unhandled node
+analyzer/test/generated/incremental_resolver_test: Crash # Unhandled node
+analyzer/test/generated/incremental_scanner_test: Crash # Unhandled node
+analyzer/test/generated/java_core_test: Crash # try/finally
+analyzer/test/generated/java_io_test: Crash # try/finally
+analyzer/test/generated/non_error_resolver_test: Crash # Unhandled node
+analyzer/test/generated/parser_test: Crash # Unhandled node
+analyzer/test/generated/resolver_test: Crash # Unhandled node
+analyzer/test/generated/scanner_test: Crash # Unhandled node
+analyzer/test/generated/static_type_warning_code_test: Crash # Unhandled node
+analyzer/test/generated/static_warning_code_test: Crash # Unhandled node
+analyzer/test/generated/utilities_test: Crash # Unhandled node
+analyzer/test/instrumentation/instrumentation_test: Crash # try/finally
+analyzer/test/parse_compilation_unit_test: Crash # cannot compile methods that need interceptor calling convention.
+analyzer/test/plugin/plugin_impl_test: Crash # try/finally
+analyzer/test/source/package_map_provider_test: Crash # try/finally
+analyzer/test/source/package_map_resolver_test: Crash # Unhandled node
+analyzer/test/src/context/cache_test: Crash # Unhandled node
+analyzer/test/src/context/context_test: Crash # try/finally
+analyzer/test/src/task/dart_test: Crash # Unhandled node
+analyzer/test/src/task/driver_test: Crash # Unhandled node
+analyzer/test/src/task/general_test: Crash # Unhandled node
+analyzer/test/src/task/inputs_test: Crash # Unhandled node
+analyzer/test/src/task/manager_test: Crash # Unhandled node
+analyzer/test/src/task/model_test: Crash # Unhandled node
+analyzer/test/src/util/asserts_test: Crash # Unhandled node
+analyzer/test/src/util/lru_map_test: Crash # Unhandled node
+fixnum/test/int_32_test: Crash # try/finally
+fixnum/test/int_64_test: Crash # try/finally
+_internal/lib/pub/test/ascii_tree_test: Crash # cannot compile methods that need interceptor calling convention.
+_internal/lib/pub/test/barback/all_includes_all_default_directories_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/barback/directory_args_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/barback/fails_if_args_with_all_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/barback/fails_if_dir_arg_does_not_exist_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/barback/fails_if_dir_outside_package_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/barback/fails_if_no_default_dirs_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/barback/fails_on_all_with_no_buildable_directories_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/barback/fails_on_disallowed_directories_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/barback/fails_on_overlapping_directories_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/barback/subdirectories_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/build/allows_arbitrary_modes_test: Crash # Unhandled node
+_internal/lib/pub/test/build/can_specify_output_directory_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/build/cleans_entire_build_directory_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/build/copies_browser_js_next_to_entrypoints_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/build/copies_browser_js_with_dependency_override_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/build/copies_browser_js_with_dev_dependency_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/build/copies_non_dart_files_to_build_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/build/defaults_to_release_mode_test: Crash # Unhandled node
+_internal/lib/pub/test/build/handles_long_paths_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/build/includes_assets_from_dependencies_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/build/includes_dart_files_from_dependencies_in_debug_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/build/includes_dart_files_in_debug_mode_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/build/outputs_error_to_json_test: Crash # Unhandled node
+_internal/lib/pub/test/build/outputs_results_to_json_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/build/preserves_htaccess_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/cache/add/adds_latest_matching_version_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/cache/add/adds_latest_version_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/cache/add/all_adds_all_matching_versions_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/cache/add/all_with_some_versions_present_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/cache/add/already_cached_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/cache/add/bad_version_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/cache/add/missing_package_arg_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/cache/add/no_matching_version_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/cache/add/package_not_found_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/cache/add/unexpected_arguments_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/cache/list_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/cache/repair/empty_cache_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/cache/repair/handles_corrupted_binstub_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/cache/repair/handles_corrupted_global_lockfile_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/cache/repair/handles_failure_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/cache/repair/handles_orphaned_binstub_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/cache/repair/recompiles_snapshots_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/cache/repair/reinstalls_git_packages_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/cache/repair/reinstalls_hosted_packages_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/cache/repair/updates_binstubs_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/dart2js/allows_import_in_dart_code_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/dart2js/compiles_entrypoints_in_root_package_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/dart2js/compiles_generated_dart_file_test: Crash # Unhandled node
+_internal/lib/pub/test/dart2js/compiles_generated_file_from_dependency_outside_web_test: Crash # Unhandled node
+_internal/lib/pub/test/dart2js/compiles_generated_file_from_dependency_test: Crash # Unhandled node
+_internal/lib/pub/test/dart2js/compiles_imported_generated_file_test: Crash # Unhandled node
+_internal/lib/pub/test/dart2js/converts_isolate_entrypoint_in_web_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/dart2js/does_not_compile_if_disabled_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/dart2js/does_not_compile_until_its_output_is_requested_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/dart2js/does_not_support_invalid_command_line_options_type_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/dart2js/does_not_support_invalid_environment_type_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/dart2js/does_not_support_invalid_option_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/dart2js/doesnt_support_invalid_type_for_boolean_option_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/dart2js/ignores_entrypoint_in_dependency_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/dart2js/ignores_entrypoints_in_lib_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/dart2js/ignores_non_entrypoint_dart_files_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/dart2js/includes_source_maps_if_sourceMaps_true_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/dart2js/includes_source_maps_in_debug_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/dart2js/minifies_in_release_mode_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/dart2js/minify_configuration_overrides_mode_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/dart2js/omits_source_map_if_sourceMaps_false_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/dart2js/omits_source_map_in_release_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/dart2js/outputs_deferred_libraries_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/dart2js/passes_along_environment_constants_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/dart2js/reports_dart_parse_errors_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/dart2js/source_maps_include_core_libs_in_subdirectory_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/dart2js/source_maps_include_core_libs_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/dart2js/supports_configuration_with_build_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/dart2js/supports_valid_options_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/dart2js/unminified_in_nonrelease_mode_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/dependency_computer/conservative_dependencies_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/dependency_computer/cycle_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/dependency_computer/dev_transformers_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/dependency_computer/error_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/dependency_computer/import_dependencies_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/dependency_computer/no_dependencies_test: Crash # (throw new StateError("Unexpected call to wrapFuture with no current " "schedule.")): Unhandled node
+_internal/lib/pub/test/dependency_computer/transformers_needed_by_library_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/dependency_override_test: Crash # try/finally
+_internal/lib/pub/test/deps_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/dev_dependency_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/downgrade/does_not_show_other_versions_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/downgrade/doesnt_change_git_dependencies_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/downgrade/dry_run_does_not_apply_changes_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/downgrade/unlock_dependers_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/downgrade/unlock_if_necessary_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/error_group_test: Crash # try/finally
+_internal/lib/pub/test/get/broken_symlink_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/get/cache_transformed_dependency_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/get/dry_run_does_not_apply_changes_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/get/git/check_out_and_upgrade_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/get/git/check_out_branch_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/get/git/check_out_revision_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/get/git/check_out_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/get/git/check_out_transitive_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/get/git/check_out_twice_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/get/git/check_out_unfetched_revision_of_cached_repo_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/get/git/check_out_with_trailing_slash_test: Crash # try/finally
+_internal/lib/pub/test/get/git/dependency_name_match_pubspec_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/get/git/different_repo_name_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/get/git/doesnt_fetch_if_nothing_changes_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/get/git/locked_revision_without_repo_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/get/git/lock_version_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/get/git/require_pubspec_name_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/get/git/require_pubspec_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/get/git/stay_locked_if_compatible_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/get/git/unlock_if_incompatible_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/get/hosted/avoid_network_requests_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/get/hosted/cached_pubspec_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/get/hosted/does_no_network_requests_when_possible_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/get/hosted/do_not_upgrade_on_removed_constraints_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/get/hosted/gets_a_package_with_busted_dev_dependencies_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/get/hosted/get_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/get/hosted/get_transitive_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/get/hosted/resolve_constraints_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/get/hosted/stay_locked_if_compatible_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/get/hosted/stay_locked_if_new_is_satisfied_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/get/hosted/stay_locked_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/get/hosted/unlock_if_incompatible_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/get/hosted/unlock_if_new_is_unsatisfied_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/get/hosted/unlock_if_version_doesnt_exist_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/get/path/absolute_path_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/get/path/absolute_symlink_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/get/path/empty_pubspec_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/get/path/nonexistent_dir_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/get/path/no_pubspec_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/get/path/path_is_file_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/get/path/relative_path_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/get/path/relative_symlink_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/get/path/shared_dependency_symlink_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/get/path/shared_dependency_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/get/relative_symlink_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/get/switch_source_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/global/activate/activate_git_after_hosted_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/global/activate/activate_hosted_after_git_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/global/activate/activate_hosted_after_path_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/global/activate/activate_path_after_hosted_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/global/activate/bad_version_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/global/activate/cached_package_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/global/activate/constraint_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/global/activate/constraint_with_path_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/global/activate/different_version_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/global/activate/doesnt_snapshot_path_executables_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/global/activate/empty_constraint_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/global/activate/git_package_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/global/activate/ignores_active_version_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/global/activate/installs_dependencies_for_git_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/global/activate/installs_dependencies_for_path_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/global/activate/installs_dependencies_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/global/activate/missing_git_repo_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/global/activate/missing_package_arg_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/global/activate/outdated_binstub_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/global/activate/path_package_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/global/activate/reactivating_git_upgrades_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/global/activate/removes_old_lockfile_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/global/activate/snapshots_git_executables_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/global/activate/snapshots_hosted_executables_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/global/activate/supports_version_solver_backtracking_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/global/activate/uncached_package_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/global/activate/unexpected_arguments_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/global/activate/unknown_package_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/global/binstubs/binstub_runs_executable_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/global/binstubs/binstub_runs_global_run_if_no_snapshot_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/global/binstubs/binstub_runs_precompiled_snapshot_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/global/binstubs/creates_executables_in_pubspec_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/global/binstubs/does_not_warn_if_no_executables_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/global/binstubs/does_not_warn_if_on_path_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/global/binstubs/explicit_and_no_executables_options_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/global/binstubs/explicit_executables_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/global/binstubs/missing_script_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/global/binstubs/name_collision_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/global/binstubs/name_collision_with_overwrite_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/global/binstubs/no_executables_flag_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/global/binstubs/outdated_binstub_runs_pub_global_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/global/binstubs/outdated_snapshot_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/global/binstubs/path_package_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/global/binstubs/reactivate_removes_old_executables_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/global/binstubs/removes_even_if_not_in_pubspec_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/global/binstubs/removes_when_deactivated_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/global/binstubs/unknown_explicit_executable_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/global/binstubs/warns_if_not_on_path_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/global/deactivate/deactivate_and_reactivate_package_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/global/deactivate/git_package_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/global/deactivate/hosted_package_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/global/deactivate/missing_package_arg_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/global/deactivate/path_package_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/global/deactivate/removes_precompiled_snapshots_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/global/deactivate/unexpected_arguments_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/global/deactivate/unknown_package_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/global/list_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/global/run/errors_if_outside_bin_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/global/run/implicit_executable_name_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/global/run/missing_executable_arg_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/global/run/missing_path_package_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/global/run/mode_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/global/run/nonexistent_script_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/global/run/recompiles_if_sdk_is_out_of_date_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/global/run/reflects_changes_to_local_package_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/global/run/runs_git_script_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/global/run/runs_path_script_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/global/run/runs_script_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/global/run/runs_transformer_test: Crash # Unhandled node
+_internal/lib/pub/test/global/run/unknown_package_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/global/run/uses_old_lockfile_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/hosted/fail_gracefully_on_missing_package_test: Crash # try/finally
+_internal/lib/pub/test/hosted/fail_gracefully_on_url_resolve_test: Crash # try/finally
+_internal/lib/pub/test/hosted/offline_test: Crash # try/finally
+_internal/lib/pub/test/hosted/remove_removed_dependency_test: Crash # try/finally
+_internal/lib/pub/test/hosted/remove_removed_transitive_dependency_test: Crash # try/finally
+_internal/lib/pub/test/hosted/version_negotiation_test: Crash # try/finally
+_internal/lib/pub/test/implicit_barback_dependency_test: Crash # "on T" catch block
+_internal/lib/pub/test/implicit_dependency_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/io_test: Crash # try/finally
+_internal/lib/pub/test/lish/archives_and_uploads_a_package_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/lish/cloud_storage_upload_doesnt_redirect_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/lish/cloud_storage_upload_provides_an_error_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/lish/does_not_publish_if_private_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/lish/does_not_publish_if_private_with_server_arg_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/lish/force_cannot_be_combined_with_dry_run_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/lish/force_does_not_publish_if_private_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/lish/force_does_not_publish_if_there_are_errors_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/lish/force_publishes_if_tests_are_no_warnings_or_errors_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/lish/force_publishes_if_there_are_warnings_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/lish/many_files_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/lish/package_creation_provides_a_malformed_error_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/lish/package_creation_provides_a_malformed_success_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/lish/package_creation_provides_an_error_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/lish/package_creation_provides_invalid_json_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/lish/package_validation_has_an_error_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/lish/package_validation_has_a_warning_and_continues_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/lish/package_validation_has_a_warning_and_is_canceled_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/lish/preview_errors_if_private_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/lish/preview_package_validation_has_a_warning_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/lish/preview_package_validation_has_no_warnings_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/lish/server_arg_does_not_override_private_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/lish/server_arg_overrides_publish_to_url_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/lish/upload_form_fields_has_a_non_string_value_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/lish/upload_form_fields_is_not_a_map_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/lish/upload_form_is_missing_fields_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/lish/upload_form_is_missing_url_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/lish/upload_form_provides_an_error_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/lish/upload_form_provides_invalid_json_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/lish/upload_form_url_is_not_a_string_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/lish/uses_publish_to_url_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/list_package_dirs/ignores_updated_pubspec_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/list_package_dirs/includes_dev_dependencies_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/list_package_dirs/lists_dependency_directories_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/list_package_dirs/lockfile_error_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/list_package_dirs/missing_pubspec_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/list_package_dirs/no_lockfile_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/list_package_dirs/pubspec_error_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/lock_file_test: Crash # try/finally
+_internal/lib/pub/test/no_package_symlinks_test: Crash # try/finally
+_internal/lib/pub/test/oauth2/with_a_malformed_credentials_authenticates_again_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/oauth2/with_an_expired_credentials_refreshes_and_saves_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/oauth2/with_an_expired_credentials_without_a_refresh_token_authenticates_again_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/oauth2/with_a_pre_existing_credentials_does_not_authenticate_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/oauth2/with_a_server_rejected_refresh_token_authenticates_again_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/oauth2/with_no_credentials_authenticates_and_saves_credentials_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/oauth2/with_server_rejected_credentials_authenticates_again_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/package_list_files_test: Crash # try/finally
+_internal/lib/pub/test/preprocess_test: Crash # try/finally
+_internal/lib/pub/test/pub_get_and_upgrade_test: Crash # try/finally
+_internal/lib/pub/test/pubspec_test: Crash # try/finally
+_internal/lib/pub/test/pub_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/pub_uploader_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/real_version_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/run/allows_dart_extension_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/run/app_can_read_from_stdin_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/run/displays_transformer_logs_test: Crash # Unhandled node
+_internal/lib/pub/test/run/does_not_run_on_transformer_error_test: Crash # Unhandled node
+_internal/lib/pub/test/run/doesnt_load_an_unnecessary_transformer_test: Crash # Unhandled node
+_internal/lib/pub/test/run/errors_if_no_executable_is_given_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/run/errors_if_only_transitive_dependency_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/run/errors_if_path_in_dependency_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/run/forwards_signal_posix_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/run/ignores_explicit_dart2js_transformer_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/run/includes_parent_directories_of_entrypoint_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/run/mode_test: Crash # Unhandled node
+_internal/lib/pub/test/run/nonexistent_dependency_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/run/nonexistent_script_in_dependency_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/run/nonexistent_script_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/run/passes_along_arguments_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/run/runs_a_generated_script_test: Crash # Unhandled node
+_internal/lib/pub/test/run/runs_app_in_directory_in_entrypoint_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/run/runs_app_in_entrypoint_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/run/runs_app_in_entrypoint_with_warning_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/run/runs_from_a_dependency_override_after_dependency_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/run/runs_named_app_in_dependency_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/run/runs_named_app_in_dev_dependency_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/run/runs_shorthand_app_in_dependency_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/run/runs_the_script_in_checked_mode_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/run/runs_transformer_in_entrypoint_test: Crash # Unhandled node
+_internal/lib/pub/test/serve/404_page_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/serve/allows_arbitrary_modes_test: Crash # Unhandled node
+_internal/lib/pub/test/serve/defaults_to_debug_mode_test: Crash # Unhandled node
+_internal/lib/pub/test/serve/does_not_crash_if_an_unused_dart_file_has_a_syntax_error_test: Crash # Unhandled node
+_internal/lib/pub/test/serve/does_not_get_first_if_a_dependency_is_removed_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/serve/does_not_get_first_if_git_url_did_not_change_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/serve/does_not_get_first_if_locked_matches_override_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/serve/does_not_get_first_if_locked_version_matches_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/serve/does_not_serve_dart_in_release_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/serve/does_not_serve_hidden_assets_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/serve/does_not_watch_compiled_js_files_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/serve/gets_first_if_dependency_added_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/serve/gets_first_if_dependency_is_not_installed_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/serve/gets_first_if_dependency_version_changed_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/serve/gets_first_if_dev_dependency_changed_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/serve/gets_first_if_git_ref_changed_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/serve/gets_first_if_git_url_changed_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/serve/gets_first_if_no_lockfile_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/serve/gets_first_if_path_dependency_changed_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/serve/gets_first_if_source_changed_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/serve/gets_first_if_transitive_dependency_is_not_installed_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/serve/invalid_method_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/serve/invalid_urls_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/serve/missing_asset_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/serve/missing_dependency_file_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/serve/missing_file_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/serve/native_watch_added_file_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/serve/native_watch_modified_file_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/serve/native_watch_removed_file_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/serve/native_watch_replaced_file_test: Crash # Unhandled node
+_internal/lib/pub/test/serve/serve_from_app_lib_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/serve/serve_from_app_web_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/serve/serve_from_dependency_lib_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/serve/serves_file_with_space_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/serve/serves_index_html_for_directories_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/serve/serves_web_and_test_dirs_by_default_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/serve/supports_cross_origin_header_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/serve/supports_user_defined_declaring_transformers_test: Crash # Unhandled node
+_internal/lib/pub/test/serve/supports_user_defined_lazy_transformers_test: Crash # Unhandled node
+_internal/lib/pub/test/serve/unknown_dependency_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/serve/uses_appropriate_mime_types_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/serve/watch_added_file_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/serve/watch_modified_file_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/serve/watch_removed_file_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/serve/web_socket/exit_on_close_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/serve/web_socket/path_to_urls_errors_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/serve/web_socket/path_to_urls_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/serve/web_socket/path_to_urls_with_line_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/serve/web_socket/serve_directory_already_served_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/serve/web_socket/serve_directory_and_immediately_request_asset_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/serve/web_socket/serve_directory_and_immediately_serve_again_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/serve/web_socket/serve_directory_and_immediately_unserve_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/serve/web_socket/serve_directory_arg_errors_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/serve/web_socket/serve_directory_overlapping_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/serve/web_socket/serve_directory_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/serve/web_socket/unserve_directory_arg_errors_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/serve/web_socket/unserve_directory_not_served_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/serve/web_socket/unserve_directory_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/serve/web_socket/url_to_asset_id_errors_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/serve/web_socket/url_to_asset_id_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/serve/web_socket/url_to_asset_id_with_line_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/snapshot/creates_a_snapshot_for_immediate_and_transitive_dep_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/snapshot/creates_a_snapshot_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/snapshot/doesnt_load_irrelevant_transformers_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/snapshot/doesnt_resnapshot_when_a_dependency_is_unchanged_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/snapshot/doesnt_snapshot_an_entrypoint_dependency_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/snapshot/doesnt_snapshot_path_dependency_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/snapshot/doesnt_snapshot_transitive_dependencies_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/snapshot/prints_errors_for_broken_snapshots_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/snapshot/recompiles_if_the_sdk_is_out_of_date_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/snapshot/snapshots_transformed_code_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/snapshot/updates_snapshot_for_git_dependency_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/snapshot/upgrades_snapshot_for_dependency_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/snapshot/upgrades_snapshot_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/transcript_test: Crash # cannot compile methods that need interceptor calling convention.
+_internal/lib/pub/test/transformer/asset_not_found_exceptions_are_detectable_test: Crash # Unhandled node
+_internal/lib/pub/test/transformer/a_transformer_rejects_its_config_test: Crash # Unhandled node
+_internal/lib/pub/test/transformer/cache_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/transformer/can_log_messages_test: Crash # Unhandled node
+_internal/lib/pub/test/transformer/can_use_consume_primary_test: Crash # Unhandled node
+_internal/lib/pub/test/transformer/can_use_has_input_test: Crash # Unhandled node
+_internal/lib/pub/test/transformer/can_use_read_input_as_string_test: Crash # Unhandled node
+_internal/lib/pub/test/transformer/can_use_read_input_test: Crash # Unhandled node
+_internal/lib/pub/test/transformer/configuration/configuration_defaults_to_empty_map_test: Crash # Unhandled node
+_internal/lib/pub/test/transformer/configuration/passes_configuration_to_a_transformer_test: Crash # Unhandled node
+_internal/lib/pub/test/transformer/configuration/with_configuration_only_instantiates_configurable_transformers_test: Crash # Unhandled node
+_internal/lib/pub/test/transformer/dart2js_transformer_before_another_transformer_test: Crash # Unhandled node
+_internal/lib/pub/test/transformer/does_not_run_a_transform_on_an_input_in_another_package_test: Crash # Unhandled node
+_internal/lib/pub/test/transformer/exclusion/exclude_asset_glob_test: Crash # Unhandled node
+_internal/lib/pub/test/transformer/exclusion/exclude_asset_list_test: Crash # Unhandled node
+_internal/lib/pub/test/transformer/exclusion/exclude_asset_prefix_test: Crash # Unhandled node
+_internal/lib/pub/test/transformer/exclusion/exclude_asset_string_test: Crash # Unhandled node
+_internal/lib/pub/test/transformer/exclusion/include_asset_glob_test: Crash # Unhandled node
+_internal/lib/pub/test/transformer/exclusion/include_asset_list_test: Crash # Unhandled node
+_internal/lib/pub/test/transformer/exclusion/include_asset_prefix_test: Crash # Unhandled node
+_internal/lib/pub/test/transformer/exclusion/include_asset_string_test: Crash # Unhandled node
+_internal/lib/pub/test/transformer/exclusion/includes_before_excludes_test: Crash # Unhandled node
+_internal/lib/pub/test/transformer/exclusion/works_on_aggregate_transformer_test: Crash # Unhandled node
+_internal/lib/pub/test/transformer/exclusion/works_on_dart2js_test: Crash # Unhandled node
+_internal/lib/pub/test/transformer/exclusion/works_on_lazy_transformer_test: Crash # Unhandled node
+_internal/lib/pub/test/transformer/exclusion/works_on_transformer_group_test: Crash # Unhandled node
+_internal/lib/pub/test/transformer/fails_to_load_a_file_that_defines_no_transforms_test: Crash # Unhandled node
+_internal/lib/pub/test/transformer/fails_to_load_a_non_existent_transform_test: Crash # Unhandled node
+_internal/lib/pub/test/transformer/fails_to_load_an_unconfigurable_transformer_when_config_is_passed_test: Crash # Unhandled node
+_internal/lib/pub/test/transformer/fails_to_load_a_pubspec_with_reserved_transformer_test: Crash # Unhandled node
+_internal/lib/pub/test/transformer/fails_to_load_a_transform_from_a_non_dependency_test: Crash # Unhandled node
+_internal/lib/pub/test/transformer/fails_to_load_a_transform_with_an_import_error_test: Crash # Unhandled node
+_internal/lib/pub/test/transformer/fails_to_load_a_transform_with_a_syntax_error_test: Crash # Unhandled node
+_internal/lib/pub/test/transformer/loads_a_declaring_aggregate_transformer_test: Crash # Unhandled node
+_internal/lib/pub/test/transformer/loads_a_diamond_transformer_dependency_graph_test: Crash # Unhandled node
+_internal/lib/pub/test/transformer/loads_a_lazy_aggregate_transformer_test: Crash # Unhandled node
+_internal/lib/pub/test/transformer/loads_an_aggregate_transformer_test: Crash # Unhandled node
+_internal/lib/pub/test/transformer/loads_a_transformer_defined_in_an_exported_library_test: Crash # Unhandled node
+_internal/lib/pub/test/transformer/loads_different_configurations_from_the_same_isolate_test: Crash # Unhandled node
+_internal/lib/pub/test/transformer/multiple_transformers_reject_their_config_test: Crash # Unhandled node
+_internal/lib/pub/test/transformer/prefers_transformer_to_library_name_test: Crash # Unhandled node
+_internal/lib/pub/test/transformer/prints_a_transform_error_in_apply_test: Crash # Unhandled node
+_internal/lib/pub/test/transformer/prints_a_transform_interface_error_test: Crash # Unhandled node
+_internal/lib/pub/test/transformer/runs_a_local_transform_on_the_application_package_test: Crash # Unhandled node
+_internal/lib/pub/test/transformer/runs_a_third_party_transformer_on_a_local_transformer_test: Crash # Unhandled node
+_internal/lib/pub/test/transformer/runs_a_third_party_transform_on_the_application_package_test: Crash # Unhandled node
+_internal/lib/pub/test/transformer/runs_a_transformer_group_test: Crash # Unhandled node
+_internal/lib/pub/test/transformer/runs_a_transformer_on_a_dependency_test: Crash # Unhandled node
+_internal/lib/pub/test/transformer/runs_one_third_party_transformer_on_another_test: Crash # Unhandled node
+_internal/lib/pub/test/transformer/supports_a_transformer_that_doesnt_return_futures_test: Crash # Unhandled node
+_internal/lib/pub/test/unknown_source_test: Crash # try/finally
+_internal/lib/pub/test/upgrade/dry_run_does_not_apply_changes_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/upgrade/git/do_not_upgrade_if_unneeded_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/upgrade/git/upgrade_locked_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/upgrade/git/upgrade_one_locked_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/upgrade/git/upgrade_to_incompatible_pubspec_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/upgrade/git/upgrade_to_nonexistent_pubspec_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/upgrade/hosted/unlock_dependers_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/upgrade/hosted/unlock_if_necessary_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/upgrade/hosted/upgrade_removed_constraints_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/upgrade/report/describes_change_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/upgrade/report/does_not_show_newer_versions_for_locked_packages_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/upgrade/report/highlights_overrides_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/upgrade/report/leading_character_shows_change_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/upgrade/report/shows_newer_available_versions_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/upgrade/report/shows_number_of_changed_dependencies_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/utils_test: Crash # try/finally
+_internal/lib/pub/test/validator/compiled_dartdoc_test: Crash # try/finally
+_internal/lib/pub/test/validator/dependency_override_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/validator/dependency_test: Crash # try/finally
+_internal/lib/pub/test/validator/directory_test: Crash # try/finally
+_internal/lib/pub/test/validator/executable_test: Crash # try/finally
+_internal/lib/pub/test/validator/license_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/validator/name_test: Crash # try/finally
+_internal/lib/pub/test/validator/pubspec_field_test: Crash # try/finally
+_internal/lib/pub/test/validator/sdk_constraint_test: Crash # (throw new StateError("Unexpected call to wrapFuture with no current " "schedule.")): Unhandled node
+_internal/lib/pub/test/validator/size_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/validator/utf8_readme_test: Crash # unsupported element kind: _defaultEnvironment:field
+_internal/lib/pub/test/version_solver_test: Crash # try/finally
+js_ast/test/printer_callback_test: Crash # Please triage this failure.
+microlytics/test/dart_microlytics_test: Crash # (throw new ExpectException(message)): Unhandled node
+stub_core_library/test/stub_test: Crash # try/finally
+third_party/di_tests/di_test: Crash # try/finally
+typed_data/test/typed_buffers_test/01: Crash # cannot compile methods that need interceptor calling convention.
+typed_data/test/typed_buffers_test/none: Crash # cannot compile methods that need interceptor calling convention.
+typed_mock/test/typed_mock_test: Crash # try/finally
diff --git a/pkg/pkgbuild.status b/pkg/pkgbuild.status
index ae03c7f..7484d4a 100644
--- a/pkg/pkgbuild.status
+++ b/pkg/pkgbuild.status
@@ -8,11 +8,8 @@
[ $use_repository_packages ]
pkg/analyzer: PubGetError
-pkg/browser: PubGetError
samples/third_party/angular_todo: Fail # angular needs to be updated
samples/third_party/todomvc_performance: Skip # dependencies are not in the repo
-third_party/pkg/intl: PubGetError # Issue 19782
-third_party/pkg/html5lib: PubGetError # angular needs to be updated
[ $use_public_packages ]
samples/third_party/angular_todo: Pass, Slow
diff --git a/pkg/stub_core_library/pubspec.yaml b/pkg/stub_core_library/pubspec.yaml
index fb6fce3..767b950 100644
--- a/pkg/stub_core_library/pubspec.yaml
+++ b/pkg/stub_core_library/pubspec.yaml
@@ -1,6 +1,6 @@
name: stub_core_library
description: A repo-internal package for creating core library stubs.
dependencies:
- args: ">=0.11.0 <0.13.0"
+ args: ">=0.11.0 <0.14.0"
analyzer: ">=0.22.0-dev <0.23.0"
path: ">=1.1.0 <2.0.0"
diff --git a/pkg/third_party/angular_tests/browser_test.dart b/pkg/third_party/angular_tests/browser_test.dart
deleted file mode 100644
index 6563e6d..0000000
--- a/pkg/third_party/angular_tests/browser_test.dart
+++ /dev/null
@@ -1,329 +0,0 @@
-/// auto-generated by update_angular.sh
-
-// Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-library angular_browser_tests;
-
-import 'package:angular/mock/module.dart';
-import 'package:unittest/html_individual_config.dart';
-import 'package:unittest/unittest.dart';
-import '../../../third_party/pkg/angular/test/angular_spec.dart' as test_0;
-import '../../../third_party/pkg/angular/test/bootstrap_spec.dart' as test_1;
-import '../../../third_party/pkg/angular/test/change_detection/dirty_checking_change_detector_spec.dart' as test_2;
-import '../../../third_party/pkg/angular/test/change_detection/watch_group_spec.dart' as test_3;
-import '../../../third_party/pkg/angular/test/core/cache_spec.dart' as test_4;
-import '../../../third_party/pkg/angular/test/core/core_directive_spec.dart' as test_5;
-import '../../../third_party/pkg/angular/test/core/interpolate_spec.dart' as test_6;
-import '../../../third_party/pkg/angular/test/core/parser/generated_getter_setter_spec.dart' as test_7;
-import '../../../third_party/pkg/angular/test/core/parser/lexer_spec.dart' as test_8;
-import '../../../third_party/pkg/angular/test/core/parser/parser_spec.dart' as test_9;
-import '../../../third_party/pkg/angular/test/core/parser/static_parser_spec.dart' as test_10;
-import '../../../third_party/pkg/angular/test/core/registry_spec.dart' as test_11;
-import '../../../third_party/pkg/angular/test/core/scope_spec.dart' as test_12;
-import '../../../third_party/pkg/angular/test/core/templateurl_spec.dart' as test_13;
-import '../../../third_party/pkg/angular/test/core/zone_spec.dart' as test_14;
-import '../../../third_party/pkg/angular/test/core_dom/block_spec.dart' as test_15;
-import '../../../third_party/pkg/angular/test/core_dom/compiler_spec.dart' as test_16;
-import '../../../third_party/pkg/angular/test/core_dom/cookies_spec.dart' as test_17;
-import '../../../third_party/pkg/angular/test/core_dom/directive_spec.dart' as test_18;
-import '../../../third_party/pkg/angular/test/core_dom/http_spec.dart' as test_19;
-import '../../../third_party/pkg/angular/test/core_dom/ng_mustache_spec.dart' as test_20;
-import '../../../third_party/pkg/angular/test/core_dom/node_cursor_spec.dart' as test_21;
-import '../../../third_party/pkg/angular/test/core_dom/selector_spec.dart' as test_22;
-import '../../../third_party/pkg/angular/test/core_dom/shadow_root_options_spec.dart' as test_23;
-import '../../../third_party/pkg/angular/test/directive/input_select_spec.dart' as test_24;
-import '../../../third_party/pkg/angular/test/directive/ng_a_spec.dart' as test_25;
-import '../../../third_party/pkg/angular/test/directive/ng_bind_html_spec.dart' as test_26;
-import '../../../third_party/pkg/angular/test/directive/ng_bind_spec.dart' as test_27;
-import '../../../third_party/pkg/angular/test/directive/ng_bind_template_spec.dart' as test_28;
-import '../../../third_party/pkg/angular/test/directive/ng_class_spec.dart' as test_29;
-import '../../../third_party/pkg/angular/test/directive/ng_cloak_spec.dart' as test_30;
-import '../../../third_party/pkg/angular/test/directive/ng_events_spec.dart' as test_31;
-import '../../../third_party/pkg/angular/test/directive/ng_form_spec.dart' as test_32;
-import '../../../third_party/pkg/angular/test/directive/ng_if_spec.dart' as test_33;
-import '../../../third_party/pkg/angular/test/directive/ng_include_spec.dart' as test_34;
-import '../../../third_party/pkg/angular/test/directive/ng_model_spec.dart' as test_35;
-import '../../../third_party/pkg/angular/test/directive/ng_model_validators_spec.dart' as test_36;
-import '../../../third_party/pkg/angular/test/directive/ng_non_bindable_spec.dart' as test_37;
-import '../../../third_party/pkg/angular/test/directive/ng_pluralize_spec.dart' as test_38;
-import '../../../third_party/pkg/angular/test/directive/ng_repeat_spec.dart' as test_39;
-import '../../../third_party/pkg/angular/test/directive/ng_show_hide_spec.dart' as test_40;
-import '../../../third_party/pkg/angular/test/directive/ng_src_boolean_spec.dart' as test_41;
-import '../../../third_party/pkg/angular/test/directive/ng_style_spec.dart' as test_42;
-import '../../../third_party/pkg/angular/test/directive/ng_switch_spec.dart' as test_43;
-import '../../../third_party/pkg/angular/test/directive/ng_template_spec.dart' as test_44;
-import '../../../third_party/pkg/angular/test/filter/currency_spec.dart' as test_45;
-import '../../../third_party/pkg/angular/test/filter/date_spec.dart' as test_46;
-import '../../../third_party/pkg/angular/test/filter/filter_spec.dart' as test_47;
-import '../../../third_party/pkg/angular/test/filter/json_spec.dart' as test_48;
-import '../../../third_party/pkg/angular/test/filter/limit_to_spec.dart' as test_49;
-import '../../../third_party/pkg/angular/test/filter/lowercase_spec.dart' as test_50;
-import '../../../third_party/pkg/angular/test/filter/number_spec.dart' as test_51;
-import '../../../third_party/pkg/angular/test/filter/order_by_spec.dart' as test_52;
-import '../../../third_party/pkg/angular/test/filter/uppercase_spec.dart' as test_53;
-import '../../../third_party/pkg/angular/test/introspection_spec.dart' as test_54;
-import '../../../third_party/pkg/angular/test/mock/http_backend_spec.dart' as test_55;
-import '../../../third_party/pkg/angular/test/mock/test_bed_spec.dart' as test_56;
-import '../../../third_party/pkg/angular/test/mock/zone_spec.dart' as test_57;
-import '../../../third_party/pkg/angular/test/routing/ng_bind_route_spec.dart' as test_58;
-import '../../../third_party/pkg/angular/test/routing/ng_view_spec.dart' as test_59;
-import '../../../third_party/pkg/angular/test/routing/routing_spec.dart' as test_60;
-import '../../../third_party/pkg/angular/test/_specs_spec.dart' as test_61;
-
-main() {
- useHtmlIndividualConfiguration();
-
- setUp(() {
- setUpInjector();
- });
-
- group('angular', () {
- test_0.main();
- });
-
- group('bootstrap', () {
- test_1.main();
- });
-
- group('change_detection/dirty_checking_change_detector', () {
- test_2.main();
- });
-
- group('change_detection/watch_group', () {
- test_3.main();
- });
-
- group('core/cache', () {
- test_4.main();
- });
-
- group('core/core_directive', () {
- test_5.main();
- });
-
- group('core/interpolate', () {
- test_6.main();
- });
-
- group('core/parser/generated_getter_setter', () {
- test_7.main();
- });
-
- group('core/parser/lexer', () {
- test_8.main();
- });
-
- group('core/parser/parser', () {
- test_9.main();
- });
-
- group('core/parser/static_parser', () {
- test_10.main();
- });
-
- group('core/registry', () {
- test_11.main();
- });
-
- group('core/scope', () {
- test_12.main();
- });
-
- group('core/templateurl', () {
- test_13.main();
- });
-
- group('core/zone', () {
- test_14.main();
- });
-
- group('core_dom/block', () {
- test_15.main();
- });
-
- group('core_dom/compiler', () {
- test_16.main();
- });
-
- group('core_dom/cookies', () {
- test_17.main();
- });
-
- group('core_dom/directive', () {
- test_18.main();
- });
-
- group('core_dom/http', () {
- test_19.main();
- });
-
- group('core_dom/ng_mustache', () {
- test_20.main();
- });
-
- group('core_dom/node_cursor', () {
- test_21.main();
- });
-
- group('core_dom/selector', () {
- test_22.main();
- });
-
- group('core_dom/shadow_root_options', () {
- test_23.main();
- });
-
- group('directive/input_select', () {
- test_24.main();
- });
-
- group('directive/ng_a', () {
- test_25.main();
- });
-
- group('directive/ng_bind_html', () {
- test_26.main();
- });
-
- group('directive/ng_bind', () {
- test_27.main();
- });
-
- group('directive/ng_bind_template', () {
- test_28.main();
- });
-
- group('directive/ng_class', () {
- test_29.main();
- });
-
- group('directive/ng_cloak', () {
- test_30.main();
- });
-
- group('directive/ng_events', () {
- test_31.main();
- });
-
- group('directive/ng_form', () {
- test_32.main();
- });
-
- group('directive/ng_if', () {
- test_33.main();
- });
-
- group('directive/ng_include', () {
- test_34.main();
- });
-
- group('directive/ng_model', () {
- test_35.main();
- });
-
- group('directive/ng_model_validators', () {
- test_36.main();
- });
-
- group('directive/ng_non_bindable', () {
- test_37.main();
- });
-
- group('directive/ng_pluralize', () {
- test_38.main();
- });
-
- group('directive/ng_repeat', () {
- test_39.main();
- });
-
- group('directive/ng_show_hide', () {
- test_40.main();
- });
-
- group('directive/ng_src_boolean', () {
- test_41.main();
- });
-
- group('directive/ng_style', () {
- test_42.main();
- });
-
- group('directive/ng_switch', () {
- test_43.main();
- });
-
- group('directive/ng_template', () {
- test_44.main();
- });
-
- group('filter/currency', () {
- test_45.main();
- });
-
- group('filter/date', () {
- test_46.main();
- });
-
- group('filter/filter', () {
- test_47.main();
- });
-
- group('filter/json', () {
- test_48.main();
- });
-
- group('filter/limit_to', () {
- test_49.main();
- });
-
- group('filter/lowercase', () {
- test_50.main();
- });
-
- group('filter/number', () {
- test_51.main();
- });
-
- group('filter/order_by', () {
- test_52.main();
- });
-
- group('filter/uppercase', () {
- test_53.main();
- });
-
- group('introspection', () {
- test_54.main();
- });
-
- group('mock/http_backend', () {
- test_55.main();
- });
-
- group('mock/test_bed', () {
- test_56.main();
- });
-
- group('mock/zone', () {
- test_57.main();
- });
-
- group('routing/ng_bind_route', () {
- test_58.main();
- });
-
- group('routing/ng_view', () {
- test_59.main();
- });
-
- group('routing/routing', () {
- test_60.main();
- });
-
- group('_specs', () {
- test_61.main();
- });
-}
diff --git a/pkg/third_party/angular_tests/browser_test.html b/pkg/third_party/angular_tests/browser_test.html
deleted file mode 100644
index 1ada647..0000000
--- a/pkg/third_party/angular_tests/browser_test.html
+++ /dev/null
@@ -1,23 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
- <meta http-equiv="X-UA-Compatible" content="IE=edge">
- <meta name="dart.unittest" content="full-stack-traces">
- <title> browser_test.dart </title>
- <style>
- .unittest-table { font-family:monospace; border:1px; }
- .unittest-pass { background: #6b3;}
- .unittest-fail { background: #d55;}
- .unittest-error { background: #a11;}
- </style>
- <script src="/packages/shadow_dom/shadow_dom.debug.js"></script>
-</head>
-<body>
- <h1> Running browser_test.dart </h1>
- <script type="text/javascript"
- src="/root_dart/tools/testing/dart/test_controller.js"></script>
- <script type="text/javascript"
- src="/packages/browser/interop.js"></script>
- %TEST_SCRIPTS%
-</body>
-</html>
diff --git a/pkg/third_party/angular_tests/vm_test.dart b/pkg/third_party/angular_tests/vm_test.dart
deleted file mode 100644
index d7a71af..0000000
--- a/pkg/third_party/angular_tests/vm_test.dart
+++ /dev/null
@@ -1,29 +0,0 @@
-/// auto-generated by update_angular.sh
-
-// Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-library angular_vm_tests;
-
-import 'package:unittest/compact_vm_config.dart';
-import 'package:unittest/unittest.dart';
-import '../../../third_party/pkg/angular/test/tools/html_extractor_spec.dart' as test_0;
-import '../../../third_party/pkg/angular/test/tools/selector_spec.dart' as test_1;
-import '../../../third_party/pkg/angular/test/tools/source_metadata_extractor_spec.dart' as test_2;
-
-main() {
- useCompactVMConfiguration();
-
- group('tools/html_extractor', () {
- test_0.main();
- });
-
- group('tools/selector', () {
- test_1.main();
- });
-
- group('tools/source_metadata_extractor', () {
- test_2.main();
- });
-}
diff --git a/pkg/third_party/di_tests/di_test.dart b/pkg/third_party/di_tests/di_test.dart
deleted file mode 100644
index 4260fa0..0000000
--- a/pkg/third_party/di_tests/di_test.dart
+++ /dev/null
@@ -1,19 +0,0 @@
-// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-
-library angular.di.test;
-
-import 'package:unittest/unittest.dart';
-import '../../../third_party/pkg/di/test/main.dart' as di;
-
-/**
- * Tests Angular's DI package
- */
-main() {
-
- group('main', () {
- di.main();
- });
-}
diff --git a/runtime/bin/bin.gypi b/runtime/bin/bin.gypi
index 08413e4..1137354 100644
--- a/runtime/bin/bin.gypi
+++ b/runtime/bin/bin.gypi
@@ -185,6 +185,7 @@
'toolsets': ['host', 'target'],
'include_dirs': [
'..',
+ '../../third_party',
'../include',
],
'includes': [
@@ -282,6 +283,7 @@
'toolsets': ['host', 'target'],
'include_dirs': [
'..',
+ '../../third_party',
],
'includes': [
'io_impl_sources.gypi',
diff --git a/runtime/bin/builtin.dart b/runtime/bin/builtin.dart
index 1f9584d..59338260 100644
--- a/runtime/bin/builtin.dart
+++ b/runtime/bin/builtin.dart
@@ -353,7 +353,6 @@
case 'package':
return _filePathFromUri(_resolvePackageUri(uri).toString());
case 'data':
- case 'embedder-package':
case 'http':
case 'https':
return uri.toString();
diff --git a/runtime/bin/directory.cc b/runtime/bin/directory.cc
index 097a6d8..fa48b0e 100644
--- a/runtime/bin/directory.cc
+++ b/runtime/bin/directory.cc
@@ -143,6 +143,7 @@
Dart_Null(),
0,
NULL);
+ if (Dart_IsError(results)) Dart_PropagateError(results);
SyncDirectoryListing sync_listing(results,
DartUtils::GetStringValue(path),
DartUtils::GetBooleanValue(recursive),
diff --git a/runtime/bin/filter.h b/runtime/bin/filter.h
index c104c88..2dad3ca 100644
--- a/runtime/bin/filter.h
+++ b/runtime/bin/filter.h
@@ -8,7 +8,7 @@
#include "bin/builtin.h"
#include "bin/utils.h"
-#include "../third_party/zlib/zlib.h"
+#include "zlib/zlib.h"
namespace dart {
diff --git a/runtime/bin/gen_snapshot.cc b/runtime/bin/gen_snapshot.cc
index 06d8a02..be575c1 100644
--- a/runtime/bin/gen_snapshot.cc
+++ b/runtime/bin/gen_snapshot.cc
@@ -337,7 +337,7 @@
if (builtinId != Builtin::kInvalidLibrary) {
// Special case for importing a builtin library.
if (tag == Dart_kImportTag) {
- return Builtin::LoadAndCheckLibrary(builtinId);
+ return Builtin::LoadLibrary(url, builtinId);
}
ASSERT(tag == Dart_kSourceTag);
return DartUtils::NewError("Unable to part '%s' ", url_string);
diff --git a/runtime/bin/main.cc b/runtime/bin/main.cc
index 9fa8de9..ef61bb4 100644
--- a/runtime/bin/main.cc
+++ b/runtime/bin/main.cc
@@ -754,6 +754,8 @@
"--enable-vm-service[:<port number>]\n"
" enables the VM service and listens on specified port for connections\n"
" (default port number is 8181)\n"
+"--noopt\n"
+" run unoptimized code only\n"
"\n"
"The following options are only used for VM development and may\n"
"be changed in any future version:\n");
diff --git a/runtime/bin/process_android.cc b/runtime/bin/process_android.cc
index bb91cbb..9265531 100644
--- a/runtime/bin/process_android.cc
+++ b/runtime/bin/process_android.cc
@@ -379,34 +379,29 @@
private:
int CreatePipes() {
int result;
- result = TEMP_FAILURE_RETRY(pipe(exec_control_));
+ result = TEMP_FAILURE_RETRY(pipe2(exec_control_, O_CLOEXEC));
if (result < 0) {
return CleanupAndReturnError();
}
- FDUtils::SetCloseOnExec(exec_control_[0]);
- FDUtils::SetCloseOnExec(exec_control_[1]);
// For a detached process the pipe to connect stdout is still used for
// signaling when to do the first fork.
- result = TEMP_FAILURE_RETRY(pipe(read_in_));
+ result = TEMP_FAILURE_RETRY(pipe2(read_in_, O_CLOEXEC));
if (result < 0) {
return CleanupAndReturnError();
}
- FDUtils::SetCloseOnExec(read_in_[0]);
// For detached processes the pipe to connect stderr and stdin are not used.
if (mode_ != kDetached) {
- result = TEMP_FAILURE_RETRY(pipe(read_err_));
+ result = TEMP_FAILURE_RETRY(pipe2(read_err_, O_CLOEXEC));
if (result < 0) {
return CleanupAndReturnError();
}
- FDUtils::SetCloseOnExec(read_err_[0]);
- result = TEMP_FAILURE_RETRY(pipe(write_out_));
+ result = TEMP_FAILURE_RETRY(pipe2(write_out_, O_CLOEXEC));
if (result < 0) {
return CleanupAndReturnError();
}
- FDUtils::SetCloseOnExec(write_out_[1]);
}
return 0;
@@ -430,25 +425,17 @@
void ExecProcess() {
- VOID_TEMP_FAILURE_RETRY(close(write_out_[1]));
- VOID_TEMP_FAILURE_RETRY(close(read_in_[0]));
- VOID_TEMP_FAILURE_RETRY(close(read_err_[0]));
- VOID_TEMP_FAILURE_RETRY(close(exec_control_[0]));
-
if (TEMP_FAILURE_RETRY(dup2(write_out_[0], STDIN_FILENO)) == -1) {
ReportChildError();
}
- VOID_TEMP_FAILURE_RETRY(close(write_out_[0]));
if (TEMP_FAILURE_RETRY(dup2(read_in_[1], STDOUT_FILENO)) == -1) {
ReportChildError();
}
- VOID_TEMP_FAILURE_RETRY(close(read_in_[1]));
if (TEMP_FAILURE_RETRY(dup2(read_err_[1], STDERR_FILENO)) == -1) {
ReportChildError();
}
- VOID_TEMP_FAILURE_RETRY(close(read_err_[1]));
if (working_directory_ != NULL &&
TEMP_FAILURE_RETRY(chdir(working_directory_)) == -1) {
@@ -527,12 +514,10 @@
int RegisterProcess(pid_t pid) {
int result;
int event_fds[2];
- result = TEMP_FAILURE_RETRY(pipe(event_fds));
+ result = TEMP_FAILURE_RETRY(pipe2(event_fds, O_CLOEXEC));
if (result < 0) {
return CleanupAndReturnError();
}
- FDUtils::SetCloseOnExec(event_fds[0]);
- FDUtils::SetCloseOnExec(event_fds[1]);
ProcessInfoList::AddProcess(pid, event_fds[1]);
*exit_event_ = event_fds[0];
diff --git a/runtime/bin/process_linux.cc b/runtime/bin/process_linux.cc
index a511cd9..cd9c639 100644
--- a/runtime/bin/process_linux.cc
+++ b/runtime/bin/process_linux.cc
@@ -378,34 +378,29 @@
private:
int CreatePipes() {
int result;
- result = TEMP_FAILURE_RETRY(pipe(exec_control_));
+ result = TEMP_FAILURE_RETRY(pipe2(exec_control_, O_CLOEXEC));
if (result < 0) {
return CleanupAndReturnError();
}
- FDUtils::SetCloseOnExec(exec_control_[0]);
- FDUtils::SetCloseOnExec(exec_control_[1]);
// For a detached process the pipe to connect stdout is still used for
// signaling when to do the first fork.
- result = TEMP_FAILURE_RETRY(pipe(read_in_));
+ result = TEMP_FAILURE_RETRY(pipe2(read_in_, O_CLOEXEC));
if (result < 0) {
return CleanupAndReturnError();
}
- FDUtils::SetCloseOnExec(read_in_[0]);
// For detached processes the pipe to connect stderr and stdin are not used.
if (mode_ != kDetached) {
- result = TEMP_FAILURE_RETRY(pipe(read_err_));
+ result = TEMP_FAILURE_RETRY(pipe2(read_err_, O_CLOEXEC));
if (result < 0) {
return CleanupAndReturnError();
}
- FDUtils::SetCloseOnExec(read_err_[0]);
- result = TEMP_FAILURE_RETRY(pipe(write_out_));
+ result = TEMP_FAILURE_RETRY(pipe2(write_out_, O_CLOEXEC));
if (result < 0) {
return CleanupAndReturnError();
}
- FDUtils::SetCloseOnExec(write_out_[1]);
}
return 0;
@@ -429,25 +424,17 @@
void ExecProcess() {
- VOID_TEMP_FAILURE_RETRY(close(write_out_[1]));
- VOID_TEMP_FAILURE_RETRY(close(read_in_[0]));
- VOID_TEMP_FAILURE_RETRY(close(read_err_[0]));
- VOID_TEMP_FAILURE_RETRY(close(exec_control_[0]));
-
if (TEMP_FAILURE_RETRY(dup2(write_out_[0], STDIN_FILENO)) == -1) {
ReportChildError();
}
- VOID_TEMP_FAILURE_RETRY(close(write_out_[0]));
if (TEMP_FAILURE_RETRY(dup2(read_in_[1], STDOUT_FILENO)) == -1) {
ReportChildError();
}
- VOID_TEMP_FAILURE_RETRY(close(read_in_[1]));
if (TEMP_FAILURE_RETRY(dup2(read_err_[1], STDERR_FILENO)) == -1) {
ReportChildError();
}
- VOID_TEMP_FAILURE_RETRY(close(read_err_[1]));
if (working_directory_ != NULL &&
TEMP_FAILURE_RETRY(chdir(working_directory_)) == -1) {
@@ -526,12 +513,10 @@
int RegisterProcess(pid_t pid) {
int result;
int event_fds[2];
- result = TEMP_FAILURE_RETRY(pipe(event_fds));
+ result = TEMP_FAILURE_RETRY(pipe2(event_fds, O_CLOEXEC));
if (result < 0) {
return CleanupAndReturnError();
}
- FDUtils::SetCloseOnExec(event_fds[0]);
- FDUtils::SetCloseOnExec(event_fds[1]);
ProcessInfoList::AddProcess(pid, event_fds[1]);
*exit_event_ = event_fds[0];
diff --git a/runtime/bin/process_macos.cc b/runtime/bin/process_macos.cc
index d24a599..7ef89b1 100644
--- a/runtime/bin/process_macos.cc
+++ b/runtime/bin/process_macos.cc
@@ -392,6 +392,7 @@
return CleanupAndReturnError();
}
FDUtils::SetCloseOnExec(read_in_[0]);
+ FDUtils::SetCloseOnExec(read_in_[1]);
// For detached processes the pipe to connect stderr and stdin are not used.
if (mode_ != kDetached) {
@@ -400,11 +401,13 @@
return CleanupAndReturnError();
}
FDUtils::SetCloseOnExec(read_err_[0]);
+ FDUtils::SetCloseOnExec(read_err_[1]);
result = TEMP_FAILURE_RETRY(pipe(write_out_));
if (result < 0) {
return CleanupAndReturnError();
}
+ FDUtils::SetCloseOnExec(write_out_[0]);
FDUtils::SetCloseOnExec(write_out_[1]);
}
@@ -429,25 +432,17 @@
void ExecProcess() {
- VOID_TEMP_FAILURE_RETRY(close(write_out_[1]));
- VOID_TEMP_FAILURE_RETRY(close(read_in_[0]));
- VOID_TEMP_FAILURE_RETRY(close(read_err_[0]));
- VOID_TEMP_FAILURE_RETRY(close(exec_control_[0]));
-
if (TEMP_FAILURE_RETRY(dup2(write_out_[0], STDIN_FILENO)) == -1) {
ReportChildError();
}
- VOID_TEMP_FAILURE_RETRY(close(write_out_[0]));
if (TEMP_FAILURE_RETRY(dup2(read_in_[1], STDOUT_FILENO)) == -1) {
ReportChildError();
}
- VOID_TEMP_FAILURE_RETRY(close(read_in_[1]));
if (TEMP_FAILURE_RETRY(dup2(read_err_[1], STDERR_FILENO)) == -1) {
ReportChildError();
}
- VOID_TEMP_FAILURE_RETRY(close(read_err_[1]));
if (working_directory_ != NULL &&
TEMP_FAILURE_RETRY(chdir(working_directory_)) == -1) {
diff --git a/runtime/bin/vmservice/server.dart b/runtime/bin/vmservice/server.dart
index 2530f37..9818e58 100644
--- a/runtime/bin/vmservice/server.dart
+++ b/runtime/bin/vmservice/server.dart
@@ -35,17 +35,9 @@
}
}
- void post(var serial, dynamic result) {
+ void post(dynamic result) {
try {
- if (serial == null && result is! String) {
- socket.add(result);
- } else {
- Map map = {
- 'id': serial,
- 'result': result
- };
- socket.add(JSON.encode(map));
- }
+ socket.add(result);
} catch (_) {
print("Ignoring error posting over WebSocket.");
}
@@ -68,7 +60,7 @@
HttpRequestClient(this.request, VMService service)
: super(service, sendEvents:false);
- void post(var serial, String result) {
+ void post(String result) {
request.response..headers.contentType = jsonContentType
..write(result)
..close();
diff --git a/runtime/include/dart_api.h b/runtime/include/dart_api.h
index af5f977..7094b4b 100755
--- a/runtime/include/dart_api.h
+++ b/runtime/include/dart_api.h
@@ -1399,6 +1399,16 @@
/**
* Returns an Integer with the provided value.
*
+ * \param value The unsigned value of the integer.
+ *
+ * \return The Integer object if no error occurs. Otherwise returns
+ * an error handle.
+ */
+DART_EXPORT Dart_Handle Dart_NewIntegerFromUint64(uint64_t value);
+
+/**
+ * Returns an Integer with the provided value.
+ *
* \param value The value of the integer represented as a C string
* containing a hexadecimal number.
*
diff --git a/runtime/lib/array_patch.dart b/runtime/lib/array_patch.dart
index 37c697c..109938b 100644
--- a/runtime/lib/array_patch.dart
+++ b/runtime/lib/array_patch.dart
@@ -48,6 +48,11 @@
return makeListFixedLength(list);
}
+ /* patch */ factory List.unmodifiable(Iterable elements) {
+ List result = new List<E>.from(elements, growable: false);
+ return makeFixedListUnmodifiable(result);
+ }
+
// Factory constructing a mutable List from a parser generated List literal.
// [elements] contains elements that are already type checked.
factory List._fromLiteral(List elements) {
diff --git a/runtime/lib/compact_hash.dart b/runtime/lib/compact_hash.dart
index f093b49..9375fa8 100644
--- a/runtime/lib/compact_hash.dart
+++ b/runtime/lib/compact_hash.dart
@@ -3,6 +3,7 @@
// BSD-style license that can be found in the LICENSE file.
import 'dart:typed_data';
+import 'dart:_internal' as internal;
// Hash table with open addressing that separates the index from keys/values.
abstract class _HashBase {
@@ -29,7 +30,7 @@
// bits are wasted to avoid Mint allocation.
// TODO(koda): Reclaim the bits by making the compiler treat hash patterns
// as unsigned words.
- int _hashMask = int.is64Bit() ?
+ int _hashMask = internal.is64Bit ?
(1 << (32 - _INITIAL_INDEX_BITS)) - 1 :
(1 << (30 - _INITIAL_INDEX_BITS)) - 1;
diff --git a/runtime/lib/errors_patch.dart b/runtime/lib/errors_patch.dart
index cd984e5..01920ed 100644
--- a/runtime/lib/errors_patch.dart
+++ b/runtime/lib/errors_patch.dart
@@ -2,7 +2,7 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-import 'dart:mirrors' show MirrorSystem;
+import 'dart:_internal' as internal;
import 'dart:convert' show JSON;
patch class Error {
@@ -226,7 +226,7 @@
var args_message = args_mismatch ? " with matching arguments" : "";
var msg;
var memberName =
- (_memberName == null) ? "" : MirrorSystem.getName(_memberName);
+ (_memberName == null) ? "" : internal.Symbol.getUnmangledName(_memberName);
if (type == _InvocationMirror._LOCAL_VAR) {
return "cannot assign to final variable '$memberName'.\n\n";
@@ -290,7 +290,7 @@
if (i > 0) {
actual_buf.write(", ");
}
- actual_buf.write(MirrorSystem.getName(key));
+ actual_buf.write(internal.Symbol.getUnmangledName(key));
actual_buf.write(": ");
actual_buf.write(Error.safeToString(value));
i++;
@@ -307,7 +307,7 @@
receiver_str = Error.safeToString(_receiver);
}
var memberName =
- (_memberName == null) ? "" : MirrorSystem.getName(_memberName);
+ (_memberName == null) ? "" : internal.Symbol.getUnmangledName(_memberName);
var type = _invocation_type & _InvocationMirror._TYPE_MASK;
if (type == _InvocationMirror._LOCAL_VAR) {
msg_buf.write(
diff --git a/runtime/lib/growable_array.cc b/runtime/lib/growable_array.cc
index 1a3a94b..8181e73 100644
--- a/runtime/lib/growable_array.cc
+++ b/runtime/lib/growable_array.cc
@@ -95,4 +95,11 @@
return Array::MakeArray(array);
}
+
+DEFINE_NATIVE_ENTRY(Internal_makeFixedListUnmodifiable, 1) {
+ GET_NON_NULL_NATIVE_ARGUMENT(Array, array, arguments->NativeArgAt(0));
+ array.MakeImmutable();
+ return array.raw();
+}
+
} // namespace dart
diff --git a/runtime/lib/integers_patch.dart b/runtime/lib/integers_patch.dart
index eec05e1..3a21ca6 100644
--- a/runtime/lib/integers_patch.dart
+++ b/runtime/lib/integers_patch.dart
@@ -5,13 +5,14 @@
// VM implementation of int.
+import 'dart:_internal' as internal;
+
patch class int {
/* patch */ const factory int.fromEnvironment(String name,
{int defaultValue})
native "Integer_fromEnvironment";
- static bool is64Bit() => 1 << 32 is _Smi;
static int _tryParseSmi(String str, int first, int last) {
assert(first <= last);
@@ -26,7 +27,7 @@
return null; // Empty.
}
}
- var smiLimit = is64Bit() ? 18 : 9;
+ var smiLimit = internal.is64Bit ? 18 : 9;
if ((last - ix) >= smiLimit) {
return null; // May not fit into a Smi.
}
@@ -112,7 +113,7 @@
static int _parseRadix(String source, int radix,
int start, int end, int sign) {
- int tableIndex = (radix - 2) * 4 + (int.is64Bit() ? 2 : 0);
+ int tableIndex = (radix - 2) * 4 + (internal.is64Bit ? 2 : 0);
int blockSize = _PARSE_LIMITS[tableIndex];
int length = end - start;
if (length <= blockSize) {
diff --git a/runtime/lib/internal_patch.dart b/runtime/lib/internal_patch.dart
index 0da1bc2..86c4a5a 100644
--- a/runtime/lib/internal_patch.dart
+++ b/runtime/lib/internal_patch.dart
@@ -5,6 +5,9 @@
patch List makeListFixedLength(List growableList)
native "Internal_makeListFixedLength";
+patch List makeFixedListUnmodifiable(List fixedLengthList)
+ native "Internal_makeFixedListUnmodifiable";
+
class VMLibraryHooks {
// Example: "dart:isolate _Timer._factory"
static var timerFactory;
@@ -15,3 +18,7 @@
patch class CodeUnits {
static final int cid = ClassID.getID(new CodeUnits(""));
}
+
+final bool is64Bit = _inquireIs64Bit();
+
+bool _inquireIs64Bit() native "Internal_inquireIs64Bit";
\ No newline at end of file
diff --git a/runtime/lib/isolate_patch.dart b/runtime/lib/isolate_patch.dart
index cd71ced..100d951 100644
--- a/runtime/lib/isolate_patch.dart
+++ b/runtime/lib/isolate_patch.dart
@@ -97,6 +97,12 @@
}
}
+ImmediateCallback _removePendingImmediateCallback() {
+ var callback = _pendingImmediateCallback;
+ _pendingImmediateCallback = null;
+ return callback;
+}
+
/// The embedder can execute this function to get hold of
/// [_isolateScheduleImmediate] above.
Function _getIsolateScheduleImmediateClosure() {
@@ -371,11 +377,13 @@
_sendOOB(controlPort, msg);
}
- /* patch */ void addOnExitListener(SendPort responsePort) {
- var msg = new List(3)
+ /* patch */ void addOnExitListener(SendPort responsePort,
+ {Object response}) {
+ var msg = new List(4)
..[0] = 0 // Make room for OOB message type.
..[1] = _ADD_EXIT
- ..[2] = responsePort;
+ ..[2] = responsePort
+ ..[3] = response;
_sendOOB(controlPort, msg);
}
@@ -396,7 +404,7 @@
_sendOOB(controlPort, msg);
}
- /* patch */ void kill([int priority = BEFORE_NEXT_EVENT]) {
+ /* patch */ void kill({int priority: BEFORE_NEXT_EVENT}) {
var msg = new List(4)
..[0] = 0 // Make room for OOB message type.
..[1] = _KILL
@@ -405,12 +413,14 @@
_sendOOB(controlPort, msg);
}
- /* patch */ void ping(SendPort responsePort, [int pingType = IMMEDIATE]) {
- var msg = new List(4)
+ /* patch */ void ping(SendPort responsePort, {Object response,
+ int priority: IMMEDIATE}) {
+ var msg = new List(5)
..[0] = 0 // Make room for OOM message type.
..[1] = _PING
..[2] = responsePort
- ..[3] = pingType;
+ ..[3] = priority
+ ..[4] = response;
_sendOOB(controlPort, msg);
}
diff --git a/runtime/lib/mirrors.cc b/runtime/lib/mirrors.cc
index cfa2e8c..63e05d0 100644
--- a/runtime/lib/mirrors.cc
+++ b/runtime/lib/mirrors.cc
@@ -18,6 +18,11 @@
namespace dart {
+#define PROPOGATE_IF_MALFOMRED(type) \
+ if (type.IsMalformed()) { \
+ Exceptions::PropagateError(Error::Handle(type.error())); \
+ } \
+
static RawInstance* CreateMirror(const String& mirror_class_name,
const Array& constructor_arguments) {
const Library& mirrors_lib = Library::Handle(Library::MirrorsLibrary());
@@ -205,7 +210,7 @@
for (intptr_t i = 0; i < args.Length(); i++) {
type ^= args.TypeAt(i);
ASSERT(type.IsTypeParameter());
- ASSERT(!type.IsMalformed());
+ PROPOGATE_IF_MALFOMRED(type);
ASSERT(type.IsFinalized());
name ^= type.name();
result.SetAt(2 * i, name);
@@ -242,26 +247,29 @@
static RawInstance* CreateMethodMirror(const Function& func,
const Instance& owner_mirror,
const AbstractType& instantiator) {
- const Array& args = Array::Handle(Array::New(13));
+ const Array& args = Array::Handle(Array::New(6));
args.SetAt(0, MirrorReference::Handle(MirrorReference::New(func)));
String& name = String::Handle(func.name());
name = String::IdentifierPrettyNameRetainPrivate(name);
args.SetAt(1, name);
-
args.SetAt(2, owner_mirror);
args.SetAt(3, instantiator);
args.SetAt(4, Bool::Get(func.is_static()));
- args.SetAt(5, Bool::Get(func.is_abstract()));
- args.SetAt(6, Bool::Get(func.IsGetterFunction()));
- args.SetAt(7, Bool::Get(func.IsSetterFunction()));
- bool isConstructor = (func.kind() == RawFunction::kConstructor);
- args.SetAt(8, Bool::Get(isConstructor));
- args.SetAt(9, Bool::Get(isConstructor && func.is_const()));
- args.SetAt(10, Bool::Get(isConstructor && func.IsGenerativeConstructor()));
- args.SetAt(11, Bool::Get(isConstructor && func.is_redirecting()));
- args.SetAt(12, Bool::Get(isConstructor && func.IsFactory()));
+ intptr_t kind_flags = 0;
+ kind_flags |= (func.is_abstract() << Mirrors::kAbstract);
+ kind_flags |= (func.IsGetterFunction() << Mirrors::kGetter);
+ kind_flags |= (func.IsSetterFunction() << Mirrors::kSetter);
+ bool is_ctor = (func.kind() == RawFunction::kConstructor);
+ kind_flags |= (is_ctor << Mirrors::kConstructor);
+ kind_flags |= ((is_ctor && func.is_const()) << Mirrors::kConstCtor);
+ kind_flags |= ((is_ctor && func.IsGenerativeConstructor())
+ << Mirrors::kGenerativeCtor);
+ kind_flags |= ((is_ctor && func.is_redirecting())
+ << Mirrors::kRedirectingCtor);
+ kind_flags |= ((is_ctor && func.IsFactory()) << Mirrors::kFactoryCtor);
+ args.SetAt(5, Smi::Handle(Smi::New(kind_flags)));
return CreateMirror(Symbols::_LocalMethodMirror(), args);
}
@@ -355,6 +363,7 @@
static RawInstance* CreateLibraryMirror(const Library& lib) {
+ ASSERT(!lib.IsNull());
const Array& args = Array::Handle(Array::New(3));
args.SetAt(0, MirrorReference::Handle(MirrorReference::New(lib)));
String& str = String::Handle();
@@ -381,7 +390,7 @@
static RawInstance* CreateLibraryDependencyMirror(const Instance& importer,
const Namespace& ns,
- const String& prefix,
+ const LibraryPrefix& prefix,
const bool is_import,
const bool is_deferred) {
const Library& importee = Library::Handle(ns.library());
@@ -418,9 +427,10 @@
const Array& args = Array::Handle(Array::New(7));
args.SetAt(0, importer);
- args.SetAt(1, importee_mirror);
+ args.SetAt(1, importee.Loaded() ? importee_mirror : prefix);
args.SetAt(2, combinators);
- args.SetAt(3, prefix);
+ args.SetAt(3, prefix.IsNull() ? Object::null_object()
+ : String::Handle(prefix.name()));
args.SetAt(4, Bool::Get(is_import));
args.SetAt(5, Bool::Get(is_deferred));
args.SetAt(6, metadata);
@@ -428,6 +438,17 @@
}
+DEFINE_NATIVE_ENTRY(LibraryMirror_fromPrefix, 1) {
+ GET_NON_NULL_NATIVE_ARGUMENT(LibraryPrefix, prefix,
+ arguments->NativeArgAt(0));
+ const Library& deferred_lib = Library::Handle(prefix.GetLibrary(0));
+ if (!deferred_lib.Loaded()) {
+ return Instance::null();
+ }
+ return CreateLibraryMirror(deferred_lib);
+}
+
+
DEFINE_NATIVE_ENTRY(LibraryMirror_libraryDependencies, 2) {
GET_NON_NULL_NATIVE_ARGUMENT(Instance, lib_mirror, arguments->NativeArgAt(0));
GET_NON_NULL_NATIVE_ARGUMENT(MirrorReference, ref, arguments->NativeArgAt(1));
@@ -436,7 +457,7 @@
Array& ports = Array::Handle();
Namespace& ns = Namespace::Handle();
Instance& dep = Instance::Handle();
- String& prefix = String::Handle();
+ LibraryPrefix& prefix = LibraryPrefix::Handle();
GrowableObjectArray& deps =
GrowableObjectArray::Handle(GrowableObjectArray::New());
@@ -468,14 +489,13 @@
while (entries.HasNext()) {
entry = entries.GetNext();
if (entry.IsLibraryPrefix()) {
- const LibraryPrefix& lib_prefix = LibraryPrefix::Cast(entry);
- prefix = lib_prefix.name();
- ports = lib_prefix.imports();
+ prefix ^= entry.raw();
+ ports = prefix.imports();
for (intptr_t i = 0; i < ports.Length(); i++) {
ns ^= ports.At(i);
if (!ns.IsNull()) {
dep = CreateLibraryDependencyMirror(lib_mirror, ns, prefix, true,
- lib_prefix.is_deferred_load());
+ prefix.is_deferred_load());
if (!dep.IsNull()) {
deps.Add(dep);
}
@@ -487,6 +507,7 @@
return deps.raw();
}
+
static RawInstance* CreateTypeMirror(const AbstractType& type) {
if (type.IsTypeRef()) {
AbstractType& ref_type = AbstractType::Handle(TypeRef::Cast(type).type());
@@ -495,19 +516,18 @@
return CreateTypeMirror(ref_type);
}
ASSERT(type.IsFinalized());
- ASSERT(!type.IsMalformed());
+ PROPOGATE_IF_MALFOMRED(type);
+
if (type.HasResolvedTypeClass()) {
const Class& cls = Class::Handle(type.type_class());
// Handle void and dynamic types.
if (cls.IsVoidClass()) {
Array& args = Array::Handle(Array::New(1));
args.SetAt(0, Symbols::Void());
- // TODO(mlippautz): Create once in the VM isolate and retrieve from there.
return CreateMirror(Symbols::_SpecialTypeMirror(), args);
} else if (cls.IsDynamicClass()) {
Array& args = Array::Handle(Array::New(1));
args.SetAt(0, Symbols::Dynamic());
- // TODO(mlippautz): Create once in the VM isolate and retrieve from there.
return CreateMirror(Symbols::_SpecialTypeMirror(), args);
}
return CreateClassMirror(cls, type, Bool::False(), Object::null_instance());
@@ -539,31 +559,26 @@
}
-static RawInstance* CreateMirrorSystem() {
+static void VerifyMethodKindShifts() {
+#ifdef DEBUG
Isolate* isolate = Isolate::Current();
- const GrowableObjectArray& libraries = GrowableObjectArray::Handle(
- isolate, isolate->object_store()->libraries());
+ const Library& lib = Library::Handle(isolate, Library::MirrorsLibrary());
+ const Class& cls = Class::Handle(isolate,
+ lib.LookupClassAllowPrivate(Symbols::_LocalMethodMirror()));
+ const Error& error = Error::Handle(isolate, cls.EnsureIsFinalized(isolate));
+ ASSERT(error.IsNull());
- const intptr_t num_libraries = libraries.Length();
- const GrowableObjectArray& library_mirrors = GrowableObjectArray::Handle(
- isolate, GrowableObjectArray::New(num_libraries));
- Library& library = Library::Handle(isolate);
- Instance& library_mirror = Instance::Handle(isolate);
+ Field& field = Field::Handle();
+ Smi& value = Smi::Handle();
- for (int i = 0; i < num_libraries; i++) {
- library ^= libraries.At(i);
- library_mirror = CreateLibraryMirror(library);
- if (!library_mirror.IsNull()) {
- library_mirrors.Add(library_mirror);
- }
- }
-
- const Instance& isolate_mirror = Instance::Handle(CreateIsolateMirror());
-
- const Array& args = Array::Handle(Array::New(2));
- args.SetAt(0, library_mirrors);
- args.SetAt(1, isolate_mirror);
- return CreateMirror(Symbols::_LocalMirrorSystem(), args);
+ #define CHECK_KIND_SHIFT(name) \
+ field = cls.LookupField(String::Handle(String::New(#name))); \
+ ASSERT(!field.IsNull()); \
+ value ^= field.value(); \
+ ASSERT(value.Value() == Mirrors::name);
+ MIRRORS_KIND_SHIFT_LIST(CHECK_KIND_SHIFT)
+ #undef CHECK_KIND_SHIFT
+#endif
}
@@ -747,7 +762,7 @@
static RawAbstractType* InstantiateType(const AbstractType& type,
const AbstractType& instantiator) {
ASSERT(type.IsFinalized());
- ASSERT(!type.IsMalformed());
+ PROPOGATE_IF_MALFOMRED(type);
if (type.IsInstantiated() || instantiator.IsNull()) {
return type.Canonicalize();
@@ -755,7 +770,7 @@
ASSERT(!instantiator.IsNull());
ASSERT(instantiator.IsFinalized());
- ASSERT(!instantiator.IsMalformed());
+ PROPOGATE_IF_MALFOMRED(instantiator);
const TypeArguments& type_args =
TypeArguments::Handle(instantiator.arguments());
@@ -771,14 +786,37 @@
}
-DEFINE_NATIVE_ENTRY(Mirrors_makeLocalMirrorSystem, 0) {
- return CreateMirrorSystem();
+DEFINE_NATIVE_ENTRY(MirrorSystem_libraries, 0) {
+ const GrowableObjectArray& libraries = GrowableObjectArray::Handle(
+ isolate, isolate->object_store()->libraries());
+
+ const intptr_t num_libraries = libraries.Length();
+ const GrowableObjectArray& library_mirrors = GrowableObjectArray::Handle(
+ isolate, GrowableObjectArray::New(num_libraries));
+ Library& library = Library::Handle(isolate);
+ Instance& library_mirror = Instance::Handle(isolate);
+
+ for (int i = 0; i < num_libraries; i++) {
+ library ^= libraries.At(i);
+ library_mirror = CreateLibraryMirror(library);
+ if (!library_mirror.IsNull() && library.Loaded()) {
+ library_mirrors.Add(library_mirror);
+ }
+ }
+ return library_mirrors.raw();
+}
+
+
+DEFINE_NATIVE_ENTRY(MirrorSystem_isolate, 0) {
+ VerifyMethodKindShifts();
+
+ return CreateIsolateMirror();
}
DEFINE_NATIVE_ENTRY(Mirrors_makeLocalClassMirror, 1) {
GET_NON_NULL_NATIVE_ARGUMENT(AbstractType, type, arguments->NativeArgAt(0));
- ASSERT(!type.IsMalformed());
+ PROPOGATE_IF_MALFOMRED(type);
ASSERT(type.IsFinalized());
ASSERT(type.HasResolvedTypeClass());
const Class& cls = Class::Handle(type.type_class());
@@ -892,18 +930,18 @@
}
-DEFINE_NATIVE_ENTRY(ClassMirror_library, 1) {
+DEFINE_NATIVE_ENTRY(ClassMirror_libraryUri, 1) {
GET_NON_NULL_NATIVE_ARGUMENT(MirrorReference, ref, arguments->NativeArgAt(0));
const Class& klass = Class::Handle(ref.GetClassReferent());
const Library& library = Library::Handle(klass.library());
ASSERT(!library.IsNull());
- return CreateLibraryMirror(library);
+ return library.url();
}
DEFINE_NATIVE_ENTRY(ClassMirror_supertype, 1) {
GET_NON_NULL_NATIVE_ARGUMENT(AbstractType, type, arguments->NativeArgAt(0));
- ASSERT(!type.IsMalformed());
+ PROPOGATE_IF_MALFOMRED(type);
ASSERT(type.IsFinalized());
if (!type.HasResolvedTypeClass()) {
Exceptions::ThrowArgumentError(type);
@@ -918,7 +956,7 @@
DEFINE_NATIVE_ENTRY(ClassMirror_supertype_instantiated, 1) {
GET_NON_NULL_NATIVE_ARGUMENT(AbstractType, type, arguments->NativeArgAt(0));
- ASSERT(!type.IsMalformed());
+ PROPOGATE_IF_MALFOMRED(type);
ASSERT(type.IsFinalized());
if (!type.HasResolvedTypeClass()) {
Exceptions::ThrowArgumentError(type);
@@ -932,7 +970,7 @@
DEFINE_NATIVE_ENTRY(ClassMirror_interfaces, 1) {
GET_NON_NULL_NATIVE_ARGUMENT(AbstractType, type, arguments->NativeArgAt(0));
- ASSERT(!type.IsMalformed());
+ PROPOGATE_IF_MALFOMRED(type);
ASSERT(type.IsFinalized());
if (!type.HasResolvedTypeClass()) {
Exceptions::ThrowArgumentError(type);
@@ -949,7 +987,7 @@
DEFINE_NATIVE_ENTRY(ClassMirror_interfaces_instantiated, 1) {
GET_NON_NULL_NATIVE_ARGUMENT(AbstractType, type, arguments->NativeArgAt(0));
- ASSERT(!type.IsMalformed());
+ PROPOGATE_IF_MALFOMRED(type);
ASSERT(type.IsFinalized());
if (!type.HasResolvedTypeClass()) {
Exceptions::ThrowArgumentError(type);
@@ -977,7 +1015,7 @@
DEFINE_NATIVE_ENTRY(ClassMirror_mixin, 1) {
GET_NON_NULL_NATIVE_ARGUMENT(AbstractType, type, arguments->NativeArgAt(0));
- ASSERT(!type.IsMalformed());
+ PROPOGATE_IF_MALFOMRED(type);
ASSERT(type.IsFinalized());
if (!type.HasResolvedTypeClass()) {
Exceptions::ThrowArgumentError(type);
@@ -995,7 +1033,7 @@
GET_NON_NULL_NATIVE_ARGUMENT(AbstractType,
instantiator,
arguments->NativeArgAt(1));
- ASSERT(!type.IsMalformed());
+ PROPOGATE_IF_MALFOMRED(type);
ASSERT(type.IsFinalized());
if (!type.HasResolvedTypeClass()) {
Exceptions::ThrowArgumentError(type);
@@ -1892,45 +1930,7 @@
DEFINE_NATIVE_ENTRY(MethodMirror_source, 1) {
GET_NON_NULL_NATIVE_ARGUMENT(MirrorReference, ref, arguments->NativeArgAt(0));
const Function& func = Function::Handle(ref.GetFunctionReferent());
- if (func.IsImplicitConstructor() || func.IsSignatureFunction()) {
- // We may need to handle more cases when the restrictions on mixins are
- // relaxed. In particular we might start associating some source with the
- // forwarding constructors when it becomes possible to specify a particular
- // constructor from the mixin to use.
- return Instance::null();
- }
- const Script& script = Script::Handle(func.script());
- const TokenStream& stream = TokenStream::Handle(script.tokens());
- if (!script.HasSource()) {
- // When source is not available, avoid printing the whole token stream and
- // doing expensive position calculations.
- return stream.GenerateSource(func.token_pos(), func.end_token_pos() + 1);
- }
-
- const TokenStream::Iterator tkit(stream, func.end_token_pos());
- intptr_t from_line;
- intptr_t from_col;
- intptr_t to_line;
- intptr_t to_col;
- script.GetTokenLocation(func.token_pos(), &from_line, &from_col);
- script.GetTokenLocation(func.end_token_pos(), &to_line, &to_col);
- intptr_t last_tok_len = String::Handle(tkit.CurrentLiteral()).Length();
- // Handle special cases for end tokens of closures (where we exclude the last
- // token):
- // (1) "foo(() => null, bar);": End token is `,', but we don't print it.
- // (2) "foo(() => null);": End token is ')`, but we don't print it.
- // (3) "var foo = () => null;": End token is `;', but in this case the token
- // semicolon belongs to the assignment so we skip it.
- if ((tkit.CurrentTokenKind() == Token::kCOMMA) || // Case 1.
- (tkit.CurrentTokenKind() == Token::kRPAREN) || // Case 2.
- (tkit.CurrentTokenKind() == Token::kSEMICOLON &&
- String::Handle(func.name()).Equals("<anonymous closure>"))) { // Case 3.
- last_tok_len = 0;
- }
- const Instance& result = Instance::Handle(
- script.GetSnippet(from_line, from_col, to_line, to_col + last_tok_len));
- ASSERT(!result.IsNull());
- return result.raw();
+ return func.GetSource();
}
diff --git a/runtime/lib/mirrors.h b/runtime/lib/mirrors.h
index 90fcdc6..dc09109 100644
--- a/runtime/lib/mirrors.h
+++ b/runtime/lib/mirrors.h
@@ -5,8 +5,30 @@
#ifndef LIB_MIRRORS_H_
#define LIB_MIRRORS_H_
+#include "vm/allocation.h"
+
namespace dart {
+class Mirrors : public AllStatic {
+ public:
+ #define MIRRORS_KIND_SHIFT_LIST(V) \
+ V(kAbstract) \
+ V(kGetter) \
+ V(kSetter) \
+ V(kConstructor) \
+ V(kConstCtor) \
+ V(kGenerativeCtor) \
+ V(kRedirectingCtor) \
+ V(kFactoryCtor) \
+
+ // These offsets much be kept in sync with those in mirrors_impl.dart.
+ enum KindShifts {
+ #define DEFINE_KIND_SHIFT_ENUM(name) name,
+ MIRRORS_KIND_SHIFT_LIST(DEFINE_KIND_SHIFT_ENUM)
+ #undef DEFINE_KIND_SHIFT_ENUM
+ };
+};
+
} // namespace dart
#endif // LIB_MIRRORS_H_
diff --git a/runtime/lib/mirrors_impl.dart b/runtime/lib/mirrors_impl.dart
index e3f87ba..ee139b6 100644
--- a/runtime/lib/mirrors_impl.dart
+++ b/runtime/lib/mirrors_impl.dart
@@ -5,7 +5,9 @@
// VM-specific implementation of the dart:mirrors library.
import "dart:collection" show UnmodifiableListView, UnmodifiableMapView;
+import "dart:async" show Future;
+var dirty = false;
final emptyList = new UnmodifiableListView([]);
final emptyMap = new UnmodifiableMapView({});
@@ -15,17 +17,11 @@
String toString() => _msg;
}
-Map _makeMemberMap(List mirrors) {
- return new UnmodifiableMapView<Symbol, DeclarationMirror>(
- new Map<Symbol, DeclarationMirror>.fromIterable(
- mirrors, key: (e) => e.simpleName));
-}
-
-String _n(Symbol symbol) => _symbol_dev.Symbol.getName(symbol);
+String _n(Symbol symbol) => internal.Symbol.getName(symbol);
Symbol _s(String name) {
if (name == null) return null;
- return new _symbol_dev.Symbol.unvalidated(name);
+ return new internal.Symbol.unvalidated(name);
}
Symbol _computeQualifiedName(DeclarationMirror owner, Symbol simpleName) {
@@ -224,30 +220,28 @@
}
}
-
class _LocalMirrorSystem extends MirrorSystem {
- final Map<Uri, LibraryMirror> libraries;
- final IsolateMirror isolate;
+ final TypeMirror dynamicType = new _SpecialTypeMirror('dynamic');
+ final TypeMirror voidType = new _SpecialTypeMirror('void');
- _LocalMirrorSystem(List<LibraryMirror> libraries, this.isolate)
- : this.libraries = new Map<Uri, LibraryMirror>.fromIterable(
- libraries, key: (e) => e.uri);
-
- TypeMirror _dynamicType = null;
- TypeMirror get dynamicType {
- if (_dynamicType == null) {
- _dynamicType = new _SpecialTypeMirror('dynamic');
+ var _libraries;
+ Map<Uri, LibraryMirror> get libraries {
+ if ((_libraries == null) || dirty) {
+ _libraries = new Map<Uri, LibraryMirror>.fromIterable(
+ _computeLibraries(), key: (e) => e.uri);
}
- return _dynamicType;
+ return _libraries;
}
+ static _computeLibraries() native "MirrorSystem_libraries";
- TypeMirror _voidType = null;
- TypeMirror get voidType {
- if (_voidType == null) {
- _voidType = new _SpecialTypeMirror('void');
+ var _isolate;
+ IsolateMirror get isolate {
+ if (_isolate == null) {
+ _isolate = _computeIsolate();
}
- return _voidType;
+ return _isolate;
}
+ static _computeIsolate() native "MirrorSystem_isolate";
String toString() => "MirrorSystem for isolate '${isolate.debugName}'";
}
@@ -622,14 +616,15 @@
DeclarationMirror get owner {
if (_owner == null) {
- _owner = _library(_reflectee);
+ var uri = _LocalClassMirror._libraryUri(_reflectee);
+ _owner = currentMirrorSystem().libraries[Uri.parse(uri)];
}
return _owner;
}
bool get isPrivate => _n(simpleName).startsWith('_');
- final bool isTopLevel = true;
+ bool get isTopLevel => true;
SourceLocation get location {
return _location(_reflectee);
@@ -757,36 +752,31 @@
Map<Symbol, DeclarationMirror> _declarations;
Map<Symbol, DeclarationMirror> get declarations {
if (_declarations != null) return _declarations;
+
var decls = new Map<Symbol, DeclarationMirror>();
- decls.addAll(_members);
- decls.addAll(_constructors);
- typeVariables.forEach((tv) => decls[tv.simpleName] = tv);
+
+ var whoseMembers = _isMixinAlias ? _trueSuperclass : this;
+ var members = mixin._computeMembers(_instantiator,
+ whoseMembers.mixin._reflectee);
+ for (var member in members) {
+ decls[member.simpleName] = member;
+ }
+
+ var constructors = _computeConstructors(_instantiator, _reflectee);
+ var stringName = _n(simpleName);
+ for (var constructor in constructors) {
+ constructor._patchConstructorName(stringName);
+ decls[constructor.simpleName] = constructor;
+ }
+
+ for (var typeVariable in typeVariables) {
+ decls[typeVariable.simpleName] = typeVariable;
+ }
+
return _declarations =
new UnmodifiableMapView<Symbol, DeclarationMirror>(decls);
}
- Map<Symbol, Mirror> _cachedMembers;
- Map<Symbol, Mirror> get _members {
- if (_cachedMembers == null) {
- var whoseMembers = _isMixinAlias ? _trueSuperclass : this;
- _cachedMembers = _makeMemberMap(mixin._computeMembers(
- _instantiator, whoseMembers.mixin._reflectee));
- }
- return _cachedMembers;
- }
-
- Map<Symbol, MethodMirror> _cachedConstructors;
- Map<Symbol, MethodMirror> get _constructors {
- if (_cachedConstructors == null) {
- var constructorsList = _computeConstructors(_instantiator, _reflectee);
- var stringName = _n(simpleName);
- constructorsList.forEach((c) => c._patchConstructorName(stringName));
- _cachedConstructors =
- new Map.fromIterable(constructorsList, key: (e) => e.simpleName);
- }
- return _cachedConstructors;
- }
-
bool get _isAnonymousMixinApplication {
if (_isMixinAlias) return false; // Named mixin application.
if (mixin == this) return false; // Not a mixin application.
@@ -904,8 +894,8 @@
return false;
}
- static _library(reflectee)
- native "ClassMirror_library";
+ static _libraryUri(reflectee)
+ native "ClassMirror_libraryUri";
static _supertype(reflectedType)
native "ClassMirror_supertype";
@@ -1134,7 +1124,8 @@
DeclarationMirror _owner;
DeclarationMirror get owner {
if (_owner == null) {
- _owner = _LocalClassMirror._library(_reflectee);
+ var uri = _LocalClassMirror._libraryUri(_reflectee);
+ _owner = currentMirrorSystem().libraries[Uri.parse(uri)];
}
return _owner;
}
@@ -1247,16 +1238,15 @@
Map<Symbol, DeclarationMirror> _declarations;
Map<Symbol, DeclarationMirror> get declarations {
if (_declarations != null) return _declarations;
- return _declarations =
- new UnmodifiableMapView<Symbol, DeclarationMirror>(_members);
- }
- Map<Symbol, Mirror> _cachedMembers;
- Map<Symbol, Mirror> get _members {
- if (_cachedMembers == null) {
- _cachedMembers = _makeMemberMap(_computeMembers(_reflectee));
+ var decls = new Map<Symbol, DeclarationMirror>();
+ var members = _computeMembers(_reflectee);
+ for (var member in members) {
+ decls[member.simpleName] = member;
}
- return _cachedMembers;
+
+ return _declarations =
+ new UnmodifiableMapView<Symbol, DeclarationMirror>(decls);
}
SourceLocation get location {
@@ -1305,7 +1295,7 @@
class _LocalLibraryDependencyMirror
extends _LocalMirror implements LibraryDependencyMirror {
final LibraryMirror sourceLibrary;
- final LibraryMirror targetLibrary;
+ var _targetMirrorOrPrefix;
final List<CombinatorMirror> combinators;
final Symbol prefix;
final bool isImport;
@@ -1313,7 +1303,7 @@
final List<InstanceMirror> metadata;
_LocalLibraryDependencyMirror(this.sourceLibrary,
- this.targetLibrary,
+ this._targetMirrorOrPrefix,
this.combinators,
prefixString,
this.isImport,
@@ -1323,6 +1313,29 @@
metadata = new UnmodifiableListView(unwrappedMetadata.map(reflect));
bool get isExport => !isImport;
+
+ LibraryMirror get targetLibrary {
+ if (_targetMirrorOrPrefix is _LocalLibraryMirror) {
+ return _targetMirrorOrPrefix;
+ }
+ var mirrorOrNull = _tryUpgradePrefix(_targetMirrorOrPrefix);
+ if (mirrorOrNull != null) {
+ _targetMirrorOrPrefix = mirrorOrNull;
+ }
+ return mirrorOrNull;
+ }
+
+ Future<LibraryMirror> loadLibrary() {
+ if (_targetMirrorOrPrefix is _LocalLibraryMirror) {
+ return new Future.value(_targetMirrorOrPrefix);
+ }
+ var savedPrefix = _targetMirrorOrPrefix;
+ return savedPrefix.loadLibrary().then((_) {
+ return _tryUpgradePrefix(savedPrefix);
+ });
+ }
+
+ static _tryUpgradePrefix(libraryPrefix) native "LibraryMirror_fromPrefix";
}
class _LocalCombinatorMirror extends _LocalMirror implements CombinatorMirror {
@@ -1339,34 +1352,38 @@
implements MethodMirror {
final Type _instantiator;
final bool isStatic;
- final bool isAbstract;
- final bool isGetter;
- final bool isSetter;
- final bool isConstructor;
- final bool isConstConstructor;
- final bool isGenerativeConstructor;
- final bool isRedirectingConstructor;
- final bool isFactoryConstructor;
- final bool isOperator;
-
- static const _operators = const ["%", "&", "*", "+", "-", "/", "<", "<<",
- "<=", "==", ">", ">=", ">>", "[]", "[]=", "^", "|", "~", "unary-", "~/"];
+ final int _kindFlags;
_LocalMethodMirror(reflectee,
String simpleName,
this._owner,
this._instantiator,
this.isStatic,
- this.isAbstract,
- this.isGetter,
- this.isSetter,
- this.isConstructor,
- this.isConstConstructor,
- this.isGenerativeConstructor,
- this.isRedirectingConstructor,
- this.isFactoryConstructor)
- : this.isOperator = _operators.contains(simpleName),
- super(reflectee, _s(simpleName));
+ this._kindFlags)
+ : super(reflectee, _s(simpleName));
+
+ static const kAbstract = 0;
+ static const kGetter = 1;
+ static const kSetter = 2;
+ static const kConstructor = 3;
+ static const kConstCtor = 4;
+ static const kGenerativeCtor = 5;
+ static const kRedirectingCtor = 6;
+ static const kFactoryCtor = 7;
+
+ // These offsets much be kept in sync with those in mirrors.h.
+ bool get isAbstract => 0 != (_kindFlags & (1 << kAbstract));
+ bool get isGetter => 0 != (_kindFlags & (1 << kGetter));
+ bool get isSetter => 0 != (_kindFlags & (1 << kSetter));
+ bool get isConstructor => 0 != (_kindFlags & (1 << kConstructor));
+ bool get isConstConstructor => 0 != (_kindFlags & (1 << kConstCtor));
+ bool get isGenerativeConstructor => 0 != (_kindFlags & (1 << kGenerativeCtor));
+ bool get isRedirectingConstructor => 0 != (_kindFlags & (1 << kRedirectingCtor));
+ bool get isFactoryConstructor => 0 != (_kindFlags & (1 << kFactoryCtor));
+
+ static const _operators = const ["%", "&", "*", "+", "-", "/", "<", "<<",
+ "<=", "==", ">", ">=", ">>", "[]", "[]=", "^", "|", "~", "unary-", "~/"];
+ bool get isOperator => _operators.contains(_n(simpleName));
DeclarationMirror _owner;
DeclarationMirror get owner {
@@ -1430,17 +1447,11 @@
return _constructorName;
}
- String _source = null;
- String get source {
- if (_source == null) {
- _source = _MethodMirror_source(_reflectee);
- }
- return _source;
- }
+ String get source => _MethodMirror_source(_reflectee);
void _patchConstructorName(ownerName) {
var cn = _n(constructorName);
- if(cn == ''){
+ if (cn == '') {
_simpleName = _s(ownerName);
} else {
_simpleName = _s(ownerName + "." + cn);
@@ -1593,8 +1604,6 @@
Symbol get qualifiedName => simpleName;
- // TODO(11955): Remove once dynamicType and voidType are canonical objects in
- // the object store.
bool operator ==(other) {
if (other is! _SpecialTypeMirror) {
return false;
@@ -1616,17 +1625,8 @@
}
class _Mirrors {
- static MirrorSystem _currentMirrorSystem = null;
-
- // Creates a new local MirrorSystem.
- static MirrorSystem makeLocalMirrorSystem()
- native 'Mirrors_makeLocalMirrorSystem';
-
- // The MirrorSystem for the current isolate.
+ static MirrorSystem _currentMirrorSystem = new _LocalMirrorSystem();
static MirrorSystem currentMirrorSystem() {
- if (_currentMirrorSystem == null) {
- _currentMirrorSystem = makeLocalMirrorSystem();
- }
return _currentMirrorSystem;
}
diff --git a/runtime/lib/mirrors_patch.dart b/runtime/lib/mirrors_patch.dart
index 962a1c7..e80dd47 100644
--- a/runtime/lib/mirrors_patch.dart
+++ b/runtime/lib/mirrors_patch.dart
@@ -2,7 +2,7 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-import "dart:_internal" as _symbol_dev;
+import "dart:_internal" as internal;
/**
* Returns a [MirrorSystem] for the current isolate.
@@ -51,42 +51,7 @@
}
/* patch */ static String getName(Symbol symbol) {
- String string = _symbol_dev.Symbol.getName(symbol);
-
- // get:foo -> foo
- // set:foo -> foo=
- // get:_foo@xxx -> _foo
- // set:_foo@xxx -> _foo=
- // Class._constructor@xxx -> Class._constructor
- // _Class@xxx._constructor@xxx -> _Class._constructor
- // lib._S@xxx with lib._M1@xxx, lib._M2@xxx -> lib._S with lib._M1, lib._M2
- StringBuffer result = new StringBuffer();
- bool add_setter_suffix = false;
- var pos = 0;
- if (string.length >= 4 && string[3] == ':') {
- // Drop 'get:' or 'set:' prefix.
- pos = 4;
- if (string[0] == 's') {
- add_setter_suffix = true;
- }
- }
- // Skip everything between AT and PERIOD, SPACE, COMMA or END
- bool skip = false;
- for (; pos < string.length; pos++) {
- var char = string[pos];
- if (char == '@') {
- skip = true;
- } else if (char == '.' || char == ' ' || char == ',') {
- skip = false;
- }
- if (!skip) {
- result.write(char);
- }
- }
- if (add_setter_suffix) {
- result.write('=');
- }
- return result.toString();
+ return internal.Symbol.getUnmangledName(symbol);
}
/* patch */ static Symbol getSymbol(String name, [LibraryMirror library]) {
@@ -95,7 +60,7 @@
throw new ArgumentError(library);
}
if (library != null) name = _mangleName(name, library._reflectee);
- return new _symbol_dev.Symbol.unvalidated(name);
+ return new internal.Symbol.unvalidated(name);
}
static _mangleName(String name, _MirrorReference lib)
diff --git a/runtime/lib/object.cc b/runtime/lib/object.cc
index 221dd5f..56a3872 100644
--- a/runtime/lib/object.cc
+++ b/runtime/lib/object.cc
@@ -319,4 +319,12 @@
}
+DEFINE_NATIVE_ENTRY(Internal_inquireIs64Bit, 0) {
+#if defined(ARCH_IS_64_BIT)
+ return Bool::True().raw();
+#else
+ return Bool::False().raw();
+#endif // defined(ARCH_IS_64_BIT)
+}
+
} // namespace dart
diff --git a/runtime/lib/string_buffer_patch.dart b/runtime/lib/string_buffer_patch.dart
index a952f8a..6991ead 100644
--- a/runtime/lib/string_buffer_patch.dart
+++ b/runtime/lib/string_buffer_patch.dart
@@ -91,6 +91,27 @@
}
}
+ /* patch */ void writeAll(Iterable objects, [String separator = ""]) {
+ Iterator iterator = objects.iterator;
+ if (!iterator.moveNext()) return;
+ if (separator.isEmpty) {
+ do {
+ write(iterator.current);
+ } while (iterator.moveNext());
+ } else {
+ write(iterator.current);
+ while (iterator.moveNext()) {
+ write(separator);
+ write(iterator.current);
+ }
+ }
+ }
+
+ /* patch */ void writeln([Object obj = ""]) {
+ write(obj);
+ write("\n");
+ }
+
/** Makes the buffer empty. */
/* patch */ void clear() {
_parts = null;
diff --git a/runtime/lib/symbol_patch.dart b/runtime/lib/symbol_patch.dart
index 35a0d88..16a3ebb 100644
--- a/runtime/lib/symbol_patch.dart
+++ b/runtime/lib/symbol_patch.dart
@@ -2,11 +2,48 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-import 'dart:mirrors';
-
patch class Symbol {
/* patch */ const Symbol(String name)
: this._name = name;
- /* patch */ toString() => 'Symbol("${MirrorSystem.getName(this)}")';
+ /* patch */ toString() => 'Symbol("${getUnmangledName(this)}")';
+
+ static getUnmangledName(Symbol symbol) {
+ String string = Symbol.getName(symbol);
+
+ // get:foo -> foo
+ // set:foo -> foo=
+ // get:_foo@xxx -> _foo
+ // set:_foo@xxx -> _foo=
+ // Class._constructor@xxx -> Class._constructor
+ // _Class@xxx._constructor@xxx -> _Class._constructor
+ // lib._S@xxx with lib._M1@xxx, lib._M2@xxx -> lib._S with lib._M1, lib._M2
+ StringBuffer result = new StringBuffer();
+ bool add_setter_suffix = false;
+ var pos = 0;
+ if (string.length >= 4 && string[3] == ':') {
+ // Drop 'get:' or 'set:' prefix.
+ pos = 4;
+ if (string[0] == 's') {
+ add_setter_suffix = true;
+ }
+ }
+ // Skip everything between AT and PERIOD, SPACE, COMMA or END
+ bool skip = false;
+ for (; pos < string.length; pos++) {
+ var char = string[pos];
+ if (char == '@') {
+ skip = true;
+ } else if (char == '.' || char == ' ' || char == ',') {
+ skip = false;
+ }
+ if (!skip) {
+ result.write(char);
+ }
+ }
+ if (add_setter_suffix) {
+ result.write('=');
+ }
+ return result.toString();
+ }
}
diff --git a/runtime/lib/timer_impl.dart b/runtime/lib/timer_impl.dart
index 2f50bae..d4a8160 100644
--- a/runtime/lib/timer_impl.dart
+++ b/runtime/lib/timer_impl.dart
@@ -389,7 +389,10 @@
timer._enqueue();
}
// Execute pending micro tasks.
- _runPendingImmediateCallback();
+ var immediateCallback = _removePendingImmediateCallback();
+ if (immediateCallback != null) {
+ immediateCallback();
+ }
}
}
} finally {
diff --git a/runtime/observatory/lib/elements.dart b/runtime/observatory/lib/elements.dart
index c4eec73..b6f61b4 100644
--- a/runtime/observatory/lib/elements.dart
+++ b/runtime/observatory/lib/elements.dart
@@ -26,6 +26,7 @@
export 'package:observatory/src/elements/instance_ref.dart';
export 'package:observatory/src/elements/instance_view.dart';
export 'package:observatory/src/elements/io_view.dart';
+export 'package:observatory/src/elements/isolate_reconnect.dart';
export 'package:observatory/src/elements/isolate_ref.dart';
export 'package:observatory/src/elements/isolate_summary.dart';
export 'package:observatory/src/elements/isolate_view.dart';
@@ -41,11 +42,12 @@
export 'package:observatory/src/elements/script_inset.dart';
export 'package:observatory/src/elements/script_ref.dart';
export 'package:observatory/src/elements/script_view.dart';
-export 'package:observatory/src/elements/service_ref.dart';
export 'package:observatory/src/elements/service_error_view.dart';
export 'package:observatory/src/elements/service_exception_view.dart';
+export 'package:observatory/src/elements/service_ref.dart';
export 'package:observatory/src/elements/service_view.dart';
export 'package:observatory/src/elements/sliding_checkbox.dart';
+export 'package:observatory/src/elements/view_footer.dart';
export 'package:observatory/src/elements/vm_connect.dart';
export 'package:observatory/src/elements/vm_ref.dart';
export 'package:observatory/src/elements/vm_view.dart';
diff --git a/runtime/observatory/lib/elements.html b/runtime/observatory/lib/elements.html
index 4cc405c..db59d57 100644
--- a/runtime/observatory/lib/elements.html
+++ b/runtime/observatory/lib/elements.html
@@ -17,12 +17,13 @@
<link rel="import" href="src/elements/function_view.html">
<link rel="import" href="src/elements/general_error.html">
<link rel="import" href="src/elements/heap_map.html">
+<link rel="import" href="src/elements/instance_ref.html">
+<link rel="import" href="src/elements/instance_view.html">
<link rel="import" href="src/elements/io_view.html">
+<link rel="import" href="src/elements/isolate_reconnect.html">
<link rel="import" href="src/elements/isolate_ref.html">
<link rel="import" href="src/elements/isolate_summary.html">
<link rel="import" href="src/elements/isolate_view.html">
-<link rel="import" href="src/elements/instance_ref.html">
-<link rel="import" href="src/elements/instance_view.html">
<link rel="import" href="src/elements/json_view.html">
<link rel="import" href="src/elements/library_ref.html">
<link rel="import" href="src/elements/library_view.html">
@@ -35,10 +36,11 @@
<link rel="import" href="src/elements/script_inset.html">
<link rel="import" href="src/elements/script_ref.html">
<link rel="import" href="src/elements/script_view.html">
-<link rel="import" href="src/elements/service_ref.html">
-<link rel="import" href="src/elements/service_exception_view.html">
<link rel="import" href="src/elements/service_error_view.html">
+<link rel="import" href="src/elements/service_exception_view.html">
+<link rel="import" href="src/elements/service_ref.html">
<link rel="import" href="src/elements/sliding_checkbox.html">
+<link rel="import" href="src/elements/view_footer.html">
<link rel="import" href="src/elements/vm_connect.html">
<link rel="import" href="src/elements/vm_ref.html">
<link rel="import" href="src/elements/vm_view.html">
diff --git a/runtime/observatory/lib/service.dart b/runtime/observatory/lib/service.dart
index 51765bc..c1af206 100644
--- a/runtime/observatory/lib/service.dart
+++ b/runtime/observatory/lib/service.dart
@@ -5,7 +5,6 @@
library service;
import 'dart:async';
-import 'dart:convert';
import 'dart:typed_data';
import 'package:logging/logging.dart';
diff --git a/runtime/observatory/lib/service_common.dart b/runtime/observatory/lib/service_common.dart
index c47d2b3..fe84b20 100644
--- a/runtime/observatory/lib/service_common.dart
+++ b/runtime/observatory/lib/service_common.dart
@@ -56,10 +56,10 @@
class _WebSocketRequest {
final String method;
final Map params;
- final Completer<String> completer;
+ final Completer<Map> completer;
_WebSocketRequest(this.method, this.params)
- : completer = new Completer<String>();
+ : completer = new Completer<Map>();
}
/// Minimal common interface for 'WebSocket' in [dart:io] and [dart:html].
@@ -81,7 +81,7 @@
/// Protocol.
abstract class CommonWebSocketVM extends VM {
final Completer _connected = new Completer();
- final Completer _disconnected = new Completer();
+ final Completer _disconnected = new Completer<String>();
final WebSocketVMTarget target;
final Map<String, _WebSocketRequest> _delayedRequests =
new Map<String, _WebSocketRequest>();
@@ -106,26 +106,30 @@
}
}
Future get onConnect => _connected.future;
- void _notifyDisconnect() {
+ void _notifyDisconnect(String reason) {
if (!_hasFinishedConnect) {
return;
}
if (!_disconnected.isCompleted) {
Logger.root.info('WebSocketVM connection error: ${target.networkAddress}');
- _disconnected.complete(this);
+ _disconnected.complete(reason);
}
}
Future get onDisconnect => _disconnected.future;
- void disconnect() {
+ void disconnect({String reason : 'WebSocket closed'}) {
if (_hasInitiatedConnect) {
_webSocket.close();
}
- _cancelAllRequests();
- _notifyDisconnect();
+ // We don't need to cancel requests and notify here. These
+ // functions will be called again when the onClose callback
+ // fires. However, we may have a better 'reason' string now, so
+ // let's take care of business.
+ _cancelAllRequests(reason);
+ _notifyDisconnect(reason);
}
- Future<String> invokeRpcRaw(String method, Map params) {
+ Future<Map> invokeRpcRaw(String method, Map params) {
if (!_hasInitiatedConnect) {
_hasInitiatedConnect = true;
_webSocket.connect(
@@ -144,14 +148,16 @@
}
void _onClose() {
- _cancelAllRequests();
- _notifyDisconnect();
+ _cancelAllRequests('WebSocket closed');
+ _notifyDisconnect('WebSocket closed');
}
// WebSocket error event handler.
void _onError() {
- _cancelAllRequests();
- _notifyDisconnect();
+ // TODO(turnidge): The implementors of CommonWebSocket have more
+ // error information available. Consider providing that here.
+ _cancelAllRequests('WebSocket closed due to error');
+ _notifyDisconnect('WebSocket closed due to error');
}
// WebSocket open event handler.
@@ -161,6 +167,23 @@
_notifyConnect();
}
+ Map _parseJSON(String message) {
+ var map;
+ try {
+ map = JSON.decode(message);
+ } catch (e, st) {
+ Logger.root.severe('Disconnecting: Error decoding message: $e\n$st');
+ disconnect(reason:'Error decoding JSON message: $e');
+ return null;
+ }
+ if (map == null) {
+ Logger.root.severe("Disconnecting: Unable to decode 'null' message");
+ disconnect(reason:"Unable to decode 'null' message");
+ return null;
+ }
+ return map;
+ }
+
void _onBinaryMessage(dynamic data) {
_webSocket.nonStringToByteData(data).then((ByteData bytes) {
// See format spec. in VMs Service::SendEvent.
@@ -176,27 +199,30 @@
bytes.buffer,
bytes.offsetInBytes + offset,
bytes.lengthInBytes - offset);
- postServiceEvent(meta, data);
+ var map = _parseJSON(meta);
+ if (map == null) {
+ return;
+ }
+ var event = map['event'];
+ postServiceEvent(event, data);
});
}
void _onStringMessage(String data) {
- var map = JSON.decode(data);
+ var map = _parseJSON(data);
if (map == null) {
- Logger.root.severe('WebSocketVM got empty message');
return;
}
+ var event = map['event'];
+ if (event != null) {
+ postServiceEvent(event, null);
+ return;
+ }
+
// Extract serial and result.
- var serial;
- var result;
- serial = map['id'];
- result = map['result'];
- if (serial == null) {
- // Messages without serial numbers are asynchronous events
- // from the vm.
- postServiceEvent(result, null);
- return;
- }
+ var serial = map['id'];
+ var result = map['result'];
+
// Complete request.
var request = _pendingRequests.remove(serial);
if (request == null) {
@@ -221,32 +247,33 @@
}
}
- String _generateNetworkError(String userMessage) {
- return JSON.encode({
+ Map _generateNetworkError(String userMessage) {
+ var response = {
'type': 'ServiceException',
- 'id': '',
- 'kind': 'NetworkException',
- 'message': userMessage
- });
+ 'kind': 'ConnectionClosed',
+ 'message': userMessage,
+ };
+ return response;
}
- void _cancelRequests(Map<String, _WebSocketRequest> requests) {
- requests.forEach((String serial, _WebSocketRequest request) {
+ void _cancelRequests(Map<String,_WebSocketRequest> requests,
+ String reason) {
+ requests.forEach((_, _WebSocketRequest request) {
request.completer.complete(
- _generateNetworkError('WebSocket disconnected'));
+ _generateNetworkError(reason));
});
requests.clear();
}
/// Cancel all pending and delayed requests by completing them with an error.
- void _cancelAllRequests() {
+ void _cancelAllRequests(String reason) {
if (_pendingRequests.length > 0) {
Logger.root.info('Cancelling all pending requests.');
- _cancelRequests(_pendingRequests);
+ _cancelRequests(_pendingRequests, reason);
}
if (_delayedRequests.length > 0) {
Logger.root.info('Cancelling all delayed requests.');
- _cancelRequests(_delayedRequests);
+ _cancelRequests(_delayedRequests, reason);
}
}
@@ -289,7 +316,7 @@
request.method != 'getIsolateMetric' &&
request.method != 'getVMMetric') {
Logger.root.info(
- 'GET [${serial}] ${request.method} from ${target.networkAddress}');
+ 'GET [${serial}] ${request.method}(${request.params}) from ${target.networkAddress}');
}
// Send message.
_webSocket.send(message);
diff --git a/runtime/observatory/lib/src/app/analytics.dart b/runtime/observatory/lib/src/app/analytics.dart
index fd04156..74efc7f 100644
--- a/runtime/observatory/lib/src/app/analytics.dart
+++ b/runtime/observatory/lib/src/app/analytics.dart
@@ -7,7 +7,7 @@
class Analytics {
static final _UA = 'UA-26406144-17';
static final _name = 'Observatory';
- static final _version = '1.10';
+ static final _version = '1.11';
static final _googleAnalytics = new AnalyticsHtml(_UA, _name, _version);
static initialize() {
diff --git a/runtime/observatory/lib/src/app/application.dart b/runtime/observatory/lib/src/app/application.dart
index d87d6fb..3aad424 100644
--- a/runtime/observatory/lib/src/app/application.dart
+++ b/runtime/observatory/lib/src/app/application.dart
@@ -9,8 +9,9 @@
class ObservatoryApplication extends Observable {
static ObservatoryApplication app;
final _pageRegistry = new List<Page>();
+ LocationManager _locationManager;
+ LocationManager get locationManager => _locationManager;
@observable Page currentPage;
- @observable final LocationManager locationManager;
VM _vm;
VM get vm => _vm;
set vm(VM vm) {
@@ -25,8 +26,22 @@
}
if (vm != null) {
Logger.root.info('Registering new VM callbacks');
- vm.onConnect.then(_vmConnected);
- vm.onDisconnect.then(_vmDisconnected);
+
+ vm.onConnect.then((_) {
+ if (vm is WebSocketVM) {
+ targets.add(vm.target);
+ }
+ _removeDisconnectEvents();
+ });
+
+ vm.onDisconnect.then((String reason) {
+ if (this.vm != vm) {
+ // This disconnect event occured *after* a new VM was installed.
+ return;
+ }
+ notifications.add(new ServiceEvent.connectionClosed(reason));
+ });
+
vm.errors.stream.listen(_onError);
vm.events.stream.listen(_onEvent);
vm.exceptions.stream.listen(_onException);
@@ -42,12 +57,13 @@
@observable ObservableList<ServiceEvent> notifications =
new ObservableList<ServiceEvent>();
- void _initOnce(bool chromium) {
+ void _initOnce() {
assert(app == null);
app = this;
_registerPages();
Analytics.initialize();
- locationManager._init(this);
+ // Visit the current page.
+ locationManager._visit();
}
void removePauseEvents(Isolate isolate) {
@@ -105,9 +121,11 @@
_pageRegistry.add(new ClassTreePage(this));
_pageRegistry.add(new DebuggerPage(this));
_pageRegistry.add(new CpuProfilerPage(this));
+ _pageRegistry.add(new TableCpuProfilerPage(this));
_pageRegistry.add(new AllocationProfilerPage(this));
_pageRegistry.add(new HeapMapPage(this));
_pageRegistry.add(new VMConnectPage(this));
+ _pageRegistry.add(new IsolateReconnectPage(this));
_pageRegistry.add(new ErrorViewPage(this));
_pageRegistry.add(new MetricsPage(this));
// Note that ErrorPage must be the last entry in the list as it is
@@ -117,7 +135,7 @@
void _onError(ServiceError error) {
lastErrorOrException = error;
- _visit('error/', null);
+ _visit(Uri.parse('error/'), null);
}
void _onException(ServiceException exception) {
@@ -125,21 +143,15 @@
if (exception.kind == 'NetworkException') {
// Got a network exception, visit the vm-connect page.
this.vm = null;
- locationManager.go(locationManager.makeLink('/vm-connect/'));
+ locationManager.go(locationManager.makeLink('/vm-connect'));
} else {
- _visit('error/', null);
+ _visit(Uri.parse('error/'), {});
}
}
- void _visit(String url, String args) {
- var argsMap;
- if (args == null) {
- argsMap = {};
- } else {
- argsMap = Uri.splitQueryString(args);
- }
- if (argsMap['trace'] != null) {
- var traceArg = argsMap['trace'];
+ void _visit(Uri uri, Map internalArguments) {
+ if (internalArguments['trace'] != null) {
+ var traceArg = internalArguments['trace'];
if (traceArg == 'on') {
Tracer.start();
} else if (traceArg == 'off') {
@@ -152,12 +164,11 @@
if (_traceView != null) {
_traceView.tracer = Tracer.current;
}
- Uri uri = Uri.parse(url);
for (var i = 0; i < _pageRegistry.length; i++) {
var page = _pageRegistry[i];
if (page.canVisit(uri)) {
_installPage(page);
- page.visit(uri, argsMap);
+ page.visit(uri, internalArguments);
return;
}
}
@@ -196,31 +207,20 @@
}
ObservatoryApplication(this.rootElement) :
- locationManager = new HashLocationManager(),
targets = new TargetManager() {
+ _locationManager = new LocationManager(this);
vm = new WebSocketVM(targets.defaultTarget);
- _initOnce(false);
+ _initOnce();
}
void _removeDisconnectEvents() {
notifications.removeWhere((oldEvent) {
- return (oldEvent.eventType == ServiceEvent.kVMDisconnected);
+ return (oldEvent.eventType == ServiceEvent.kConnectionClosed);
});
}
- _vmConnected(VM vm) {
- if (vm is WebSocketVM) {
- targets.add(vm.target);
- }
- _removeDisconnectEvents();
- }
-
- _vmDisconnected(VM vm) {
- if (this.vm != vm) {
- // This disconnect event occured *after* a new VM was installed.
- return;
- }
- this.vm = null;
- notifications.add(new ServiceEvent.vmDisconencted());
+ loadCrashDump(Map crashDump) {
+ this.vm = new FakeVM(crashDump['result']);
+ app.locationManager.go('#/vm');
}
}
diff --git a/runtime/observatory/lib/src/app/location_manager.dart b/runtime/observatory/lib/src/app/location_manager.dart
index 86e71e5..17b6c8c 100644
--- a/runtime/observatory/lib/src/app/location_manager.dart
+++ b/runtime/observatory/lib/src/app/location_manager.dart
@@ -4,46 +4,49 @@
part of app;
-abstract class LocationManager extends Observable {
- final _initialPath = '/vm';
- ObservatoryApplication _app;
+class LocationManager extends Observable {
+ final _defaultPath = '/vm';
- String _lastUrl;
+ final ObservatoryApplication _app;
- void _init(ObservatoryApplication app) {
- // Called once.
- assert(_app == null);
- _app = app;
- // Register for history events.
- window.onPopState.listen(_onLocationChange);
- _onStartup();
- }
+ /// [internalArguments] are parameters specified after a '---' in the
+ /// application URL.
+ final Map<String, String> internalArguments = new Map<String, String>();
- void _onStartup();
- void _onLocationChange(PopStateEvent event);
+ Uri _uri;
+ /// [uri] is the application uri. Application uris consist of a path and
+ /// the queryParameters map.
+ Uri get uri => _uri;
- void _pushUrl(String url) {
- if (_lastUrl != url) {
- Logger.root.info('Navigated to ${url}');
- window.history.pushState(url, document.title, url);
- _lastUrl = url;
+ LocationManager(this._app) {
+ window.onPopState.listen(_onBrowserNavigation);
+ // Determine initial application path.
+ var applicationPath = '${window.location.hash}';
+ if ((window.location.hash == '') || (window.location.hash == '#')) {
+ // Observatory has loaded but no application path has been specified,
+ // use the default.
+ applicationPath = makeLink(_defaultPath);
}
+ // Update current application path.
+ window.history.replaceState(applicationPath,
+ document.title,
+ applicationPath);
+ _updateApplicationLocation(applicationPath);
}
- /// Go to a specific url.
- void go(String url) {
- if ((url != makeLink('/vm-connect/')) && _app.vm == null) {
- if (!window.confirm('Connection with VM has been lost. '
- 'Proceeding will lose current page.')) {
- return;
- }
- url = makeLink('/vm-connect/');
- }
- _pushUrl(url);
- _go(url);
+ /// Called whenever the browser changes the location bar (e.g. forward or
+ /// back button press).
+ void _onBrowserNavigation(PopStateEvent event) {
+ _updateApplicationLocation(window.location.hash);
+ _visit();
}
- void _go(String url) {
+ /// Given an application url, generate an href link.
+ String makeLink(String url) => '#$url';
+
+ /// Update the application location. After this function returns,
+ /// [uri] and [debugArguments] will be updated.
+ _updateApplicationLocation(String url) {
// Chop off leading '#'.
if (url.startsWith('#')) {
url = url.substring(1);
@@ -53,86 +56,105 @@
if (url.startsWith('/')) {
url = url.substring(1);
}
- var args;
- // Parse out arguments.
+ // Parse out debug arguments.
if (url.contains('---')) {
var chunks = url.split('---');
url = chunks[0];
if ((chunks.length > 1) && (chunks[1] != '')) {
- args = chunks[1];
+ internalArguments.clear();
+ try {
+ internalArguments.addAll(Uri.splitQueryString(chunks[1]));
+ } catch (e) {
+ Logger.root.warning('Could not parse debug arguments ${e}');
+ }
}
}
- _app._visit(url, args);
+ _uri = Uri.parse(url);
}
- /// Go back.
- void back() {
- window.history.go(-1);
+ /// Add [url] to the browser history.
+ _addToBrowserHistory(String url) {
+ window.history.pushState(url, document.title, url);
}
- /// Go forward.
- void forward() {
- window.history.go(1);
+ /// Notify the current page that something has changed.
+ _visit() {
+ runZoned(() => _app._visit(_uri, internalArguments),
+ onError: (e, st) {
+ if (e is IsolateNotFound) {
+ var newPath = _app.vm == null ? '/vm-connect' : '/isolate-reconnect';
+ var parameters = {};
+ parameters.addAll(_uri.queryParameters);
+ parameters['originalPath'] = _uri.path;
+ parameters['originalIsolateId'] = parameters['isolateId'];
+ var generatedUri = new Uri(path: newPath, queryParameters: parameters);
+ go(makeLink(generatedUri.toString()), true);
+ return;
+ }
+ throw e;
+ });
}
- /// Handle clicking on an application url link.
+ /// Navigate to [url].
+ void go(String url, [bool addToBrowserHistory = true]) {
+ if ((url != makeLink('/vm-connect')) && _app.vm == null) {
+ if (!window.confirm('Connection with VM has been lost. '
+ 'Proceeding will lose current page.')) {
+ return;
+ }
+ url = makeLink('/vm-connect/');
+ }
+ if (addToBrowserHistory) {
+ _addToBrowserHistory(url);
+ }
+ _updateApplicationLocation(url);
+ _visit();
+ }
+
+ /// Starting with the current uri path and queryParameters, update
+ /// queryParameters present in [updateParameters], then generate a new uri
+ /// and navigate to that.
+ goReplacingParameters(Map updatedParameters, [bool addToBrowserHistory = true]) {
+ go(makeLinkReplacingParameters(updatedParameters), addToBrowserHistory);
+ }
+
+ makeLinkReplacingParameters(Map updatedParameters) {
+ var parameters = new Map.from(_uri.queryParameters);
+ updatedParameters.forEach((k, v) {
+ parameters[k] = v;
+ });
+ // Ensure path starts with a slash.
+ var path = uri.path.startsWith('/') ? uri.path : '/${uri.path}';
+ var generatedUri = new Uri(path: path, queryParameters: parameters);
+ return makeLink(generatedUri.toString());
+ }
+
+ goForwardingParameters(String newPath, [bool addToBrowserHistory = true]) {
+ go(makeLinkForwardingParameters(newPath), addToBrowserHistory);
+ }
+
+ makeLinkForwardingParameters(String newPath) {
+ var parameters = _uri.queryParameters;
+ var generatedUri = new Uri(path: newPath, queryParameters: parameters);
+ return makeLink(generatedUri.toString());
+ }
+
+ /// Utility event handler when clicking on application url link.
void onGoto(MouseEvent event) {
- var target = event.target;
- var href = target.attributes['href'];
- if (event.button > 0 || event.metaKey || event.ctrlKey ||
- event.shiftKey || event.altKey) {
- // Not a left-click or a left-click with a modifier key:
- // Let browser handle.
+ if ((event.button > 0) ||
+ event.metaKey ||
+ event.ctrlKey ||
+ event.shiftKey ||
+ event.altKey) {
+ // Mouse event is not a left-click OR
+ // mouse event is a left-click with a modifier key:
+ // let browser handle.
return;
}
- go(href);
event.preventDefault();
+ // 'currentTarget' is the dom element that would process the event.
+ // If we use 'target' we might get an <em> element or somesuch.
+ var target = event.currentTarget;
+ go(target.attributes['href']);
}
-
- /// Given an application url, generate a link.
- String makeLink(String url);
-}
-
-/// Uses location.hash to encode application urls.
-class HashLocationManager extends LocationManager {
- void _onStartup() {
- String initialPath = '${window.location.hash}';
- if ((window.location.hash == '') || (window.location.hash == '#')) {
- initialPath = '#${_initialPath}';
- }
- window.history.pushState(initialPath, document.title, initialPath);
- _go(window.location.hash);
- }
-
- void _onLocationChange(PopStateEvent _) {
- _go(window.location.hash);
- }
-
- /// Given an application url, generate a link for an anchor tag.
- String makeLink(String url) {
- return '#$url';
- }
-}
-
-/// Uses location.pathname to encode application urls. Requires server side
-/// rewriting to support copy and paste linking. pub serve makes this hard.
-/// STATUS: Work in progress.
-class LinkLocationManager extends LocationManager {
- void _onStartup() {
- Logger.root.warning('Using untested LinkLocationManager');
- String initialPath = window.location.pathname;
- if ((window.location.pathname == '/index.html') ||
- (window.location.pathname == '/')) {
- initialPath = '/vm';
- }
- window.history.replaceState(initialPath, document.title, initialPath);
- _go(window.location.pathname);
- }
-
- void _onLocationChange(PopStateEvent _) {
- _go(window.location.pathname);
- }
-
- /// Given an application url, generate a link for an anchor tag.
- String makeLink(String url) => url;
}
diff --git a/runtime/observatory/lib/src/app/page.dart b/runtime/observatory/lib/src/app/page.dart
index 858e75f..275ecb0 100644
--- a/runtime/observatory/lib/src/app/page.dart
+++ b/runtime/observatory/lib/src/app/page.dart
@@ -4,15 +4,21 @@
part of app;
+class IsolateNotFound implements Exception {
+ String isolateId;
+ IsolateNotFound(this.isolateId);
+ String toString() => "IsolateNotFound: $isolateId";
+}
+
/// A [Page] controls the user interface of Observatory. At any given time
/// one page will be the current page. Pages are registered at startup.
/// When the user navigates within the application, each page is asked if it
/// can handle the current location, the first page to say yes, wins.
abstract class Page extends Observable {
final ObservatoryApplication app;
-
+ final ObservableMap<String, String> internalArguments =
+ new ObservableMap<String, String>();
@observable ObservatoryElement element;
- @observable ObservableMap args;
Page(this.app);
@@ -27,8 +33,9 @@
}
/// Called when the page should update its state based on [uri].
- void visit(Uri uri, Map argsMap) {
- args = toObservable(argsMap);
+ void visit(Uri uri, Map internalArguments) {
+ this.internalArguments.clear();
+ this.internalArguments.addAll(internalArguments);
Analytics.reportPageView(uri);
_visit(uri);
}
@@ -58,11 +65,13 @@
}
Future<Isolate> getIsolate(Uri uri) {
- return app.vm.getIsolate(uri.queryParameters['isolateId'])
- .catchError((e, stack) {
- Logger.root.severe('$path visit error: $e\n$stack');
- return e;
- });
+ var isolateId = uri.queryParameters['isolateId'];
+ return app.vm.getIsolate(isolateId).then((isolate) {
+ if (isolate == null) {
+ throw new IsolateNotFound(isolateId);
+ }
+ return isolate;
+ });
}
bool canVisit(Uri uri) => uri.path == path;
@@ -112,7 +121,7 @@
serviceElement.object = vm;
}
}).catchError((e, stack) {
- Logger.root.severe('VMPage visit error: $e\n$stack');
+ Logger.root.severe('VMPage visit error: $e');
});
}
}
@@ -204,6 +213,27 @@
}
}
+class TableCpuProfilerPage extends SimplePage {
+ TableCpuProfilerPage(app)
+ : super('profiler-table', 'cpu-profile-table', app);
+
+ void _visit(Uri uri) {
+ super._visit(uri);
+ getIsolate(uri).then((isolate) {
+ if (element != null) {
+ /// Update the page.
+ CpuProfileTableElement page = element;
+ page.isolate = isolate;
+ // TODO(johnmccutchan): Provide a more general mechanism to notify
+ // elements of URI parameter changes. Possibly via a stream off of
+ // LocationManager. With a stream individual elements (not just pages)
+ // could be notified.
+ page.checkParameters();
+ }
+ });
+ }
+}
+
class AllocationProfilerPage extends SimplePage {
AllocationProfilerPage(app)
: super('allocation-profiler', 'heap-profile', app);
@@ -252,7 +282,7 @@
}
// TODO(turnidge): How to test this page?
- bool canVisit(Uri uri) => uri.path.startsWith('error/');
+ bool canVisit(Uri uri) => uri.path == 'error';
}
class VMConnectPage extends Page {
@@ -270,8 +300,26 @@
assert(canVisit(uri));
}
- // TODO(turnidge): Update this to not have the trailing slash.
- bool canVisit(Uri uri) => uri.path.startsWith('vm-connect/');
+ bool canVisit(Uri uri) => uri.path == 'vm-connect';
+}
+
+class IsolateReconnectPage extends Page {
+ IsolateReconnectPage(app) : super(app);
+
+ void onInstall() {
+ if (element == null) {
+ element = new Element.tag('isolate-reconnect');
+ }
+ assert(element != null);
+ }
+
+ void _visit(Uri uri) {
+ app.vm.reload();
+ assert(element != null);
+ assert(canVisit(uri));
+ }
+
+ bool canVisit(Uri uri) => uri.path == 'isolate-reconnect';
}
class MetricsPage extends Page {
diff --git a/runtime/observatory/lib/src/cpu_profile/cpu_profile.dart b/runtime/observatory/lib/src/cpu_profile/cpu_profile.dart
index 3591171..7be5a01 100644
--- a/runtime/observatory/lib/src/cpu_profile/cpu_profile.dart
+++ b/runtime/observatory/lib/src/cpu_profile/cpu_profile.dart
@@ -41,6 +41,24 @@
_setCodePercentage(node, child);
}
}
+
+ _recordCallerAndCalleesInner(CodeCallTreeNode caller,
+ CodeCallTreeNode callee) {
+ if (caller != null) {
+ caller.profileCode._recordCallee(callee.profileCode, callee.count);
+ callee.profileCode._recordCaller(caller.profileCode, callee.count);
+ }
+
+ for (var child in callee.children) {
+ _recordCallerAndCalleesInner(callee, child);
+ }
+ }
+
+ _recordCallerAndCallees() {
+ for (var child in root.children) {
+ _recordCallerAndCalleesInner(null, child);
+ }
+ }
}
class FunctionCallTreeNodeCode {
@@ -129,6 +147,124 @@
}
}
+/// Predicate filter function. Returns true if path from root to [node] and all
+/// of [node]'s children should be added to the filtered tree.
+typedef bool FunctionCallTreeNodeFilter(FunctionCallTreeNode node);
+
+/// Build a filter version of a FunctionCallTree.
+class _FilteredFunctionCallTreeBuilder {
+ /// The filter.
+ final FunctionCallTreeNodeFilter filter;
+ /// The unfiltered tree.
+ final FunctionCallTree _unfilteredTree;
+ /// The filtered tree (construct by [build]).
+ final FunctionCallTree filtered;
+ final List _currentPath = [];
+
+ /// Construct a filtered tree builder using [filter] and [tree].
+ _FilteredFunctionCallTreeBuilder(this.filter, FunctionCallTree tree)
+ : _unfilteredTree = tree,
+ filtered =
+ new FunctionCallTree(
+ tree.inclusive,
+ new FunctionCallTreeNode(
+ tree.root.profileFunction,
+ tree.root.count));
+
+ /// Build the filtered tree.
+ build() {
+ assert(filtered != null);
+ assert(filter != null);
+ assert(_unfilteredTree != null);
+ _descend(_unfilteredTree.root);
+ }
+
+ FunctionCallTreeNode _findFunctionInChildren(FunctionCallTreeNode current,
+ FunctionCallTreeNode needle) {
+ for (var child in current.children) {
+ if (child.profileFunction == needle.profileFunction) {
+ return child;
+ }
+ }
+ return null;
+ }
+
+ /// Add all nodes in [_currentPath].
+ FunctionCallTreeNode _addCurrentPath() {
+ FunctionCallTreeNode current = filtered.root;
+ // Tree root is always the first element of the current path.
+ assert(_unfilteredTree.root == _currentPath[0]);
+ // Assert that unfiltered tree's root and filtered tree's root are different.
+ assert(_unfilteredTree.root != current);
+ for (var i = 1; i < _currentPath.length; i++) {
+ // toAdd is from the unfiltered tree.
+ var toAdd = _currentPath[i];
+ // See if we already have a node for toAdd in the filtered tree.
+ var child = _findFunctionInChildren(current, toAdd);
+ if (child == null) {
+ // New node.
+ child = new FunctionCallTreeNode(toAdd.profileFunction, toAdd.count);
+ current.children.add(child);
+ }
+ current = child;
+ assert(current.count == toAdd.count);
+ }
+ return current;
+ }
+
+ /// Starting at [current] append [next] and all of [next]'s sub-trees
+ _appendTree(FunctionCallTreeNode current, FunctionCallTreeNode next) {
+ if (next == null) {
+ return;
+ }
+ var child = _findFunctionInChildren(current, next);
+ if (child == null) {
+ child = new FunctionCallTreeNode(next.profileFunction, next.count);
+ current.children.add(child);
+ }
+ current = child;
+ for (var nextChild in next.children) {
+ _appendTree(current, nextChild);
+ }
+ }
+
+ /// Add path from root to [child], [child], and all of [child]'s sub-trees
+ /// to filtered tree.
+ _addTree(FunctionCallTreeNode child) {
+ var current = _addCurrentPath();
+ _appendTree(current, child);
+ }
+
+ /// Descend further into the tree. [current] is from the unfiltered tree.
+ _descend(FunctionCallTreeNode current) {
+ if (current == null) {
+ return;
+ }
+ _currentPath.add(current);
+
+ if (filter(current)) {
+ // Filter matched.
+ if (current.children.length == 0) {
+ // Have no children. Add this path.
+ _addTree(null);
+ } else {
+ // Add all child trees.
+ for (var child in current.children) {
+ _addTree(child);
+ }
+ }
+ } else {
+ // Did not match, descend to each child.
+ for (var child in current.children) {
+ _descend(child);
+ }
+ }
+
+ var last = _currentPath.removeLast();
+ assert(current == last);
+ }
+}
+
class FunctionCallTree {
final bool inclusive;
final FunctionCallTreeNode root;
@@ -136,6 +272,13 @@
_setFunctionPercentage(null, root);
}
+ FunctionCallTree filtered(FunctionCallTreeNodeFilter filter) {
+ var treeFilter = new _FilteredFunctionCallTreeBuilder(filter, this);
+ treeFilter.build();
+ _setFunctionPercentage(null, treeFilter.filtered.root);
+ return treeFilter.filtered;
+ }
+
void _setFunctionPercentage(FunctionCallTreeNode parent,
FunctionCallTreeNode node) {
assert(node != null);
@@ -154,6 +297,23 @@
_setFunctionPercentage(node, child);
}
}
+
+ _markFunctionCallsInner(FunctionCallTreeNode caller,
+ FunctionCallTreeNode callee) {
+ if (caller != null) {
+ caller.profileFunction._recordCallee(callee.profileFunction, callee.count);
+ callee.profileFunction._recordCaller(caller.profileFunction, callee.count);
+ }
+ for (var child in callee.children) {
+ _markFunctionCallsInner(callee, child);
+ }
+ }
+
+ _markFunctionCalls() {
+ for (var child in root.children) {
+ _markFunctionCallsInner(null, child);
+ }
+ }
}
class CodeTick {
@@ -186,6 +346,8 @@
String formattedCpuTime = '';
String formattedOnStackTime = '';
final Set<String> attributes = new Set<String>();
+ final Map<ProfileCode, int> callers = new Map<ProfileCode, int>();
+ final Map<ProfileCode, int> callees = new Map<ProfileCode, int>();
void _processTicks(List<String> profileTicks) {
assert(profileTicks != null);
@@ -262,6 +424,22 @@
'${Utils.formatPercent(exclusiveTicks, profile.sampleCount)} '
'($exclusiveTicks)';
}
+
+ _recordCaller(ProfileCode caller, int count) {
+ var r = callers[caller];
+ if (r == null) {
+ r = 0;
+ }
+ callers[caller] = r + count;
+ }
+
+ _recordCallee(ProfileCode callee, int count) {
+ var r = callees[callee];
+ if (r == null) {
+ r = 0;
+ }
+ callees[callee] = r + count;
+ }
}
class ProfileFunction {
@@ -269,6 +447,9 @@
final ServiceFunction function;
// List of compiled code objects containing this function.
final List<ProfileCode> profileCodes = new List<ProfileCode>();
+ final Map<ProfileFunction, int> callers = new Map<ProfileFunction, int>();
+ final Map<ProfileFunction, int> callees = new Map<ProfileFunction, int>();
+
// Absolute ticks:
int exclusiveTicks = 0;
int inclusiveTicks = 0;
@@ -356,6 +537,7 @@
}
ProfileFunction.fromMap(this.profile, this.function, Map data) {
+ function.profile = this;
for (var codeIndex in data['codes']) {
var profileCode = profile.codes[codeIndex];
profileCodes.add(profileCode);
@@ -397,6 +579,22 @@
'${Utils.formatPercent(exclusiveTicks, profile.sampleCount)} '
'($exclusiveTicks)';
}
+
+ _recordCaller(ProfileFunction caller, int count) {
+ var r = callers[caller];
+ if (r == null) {
+ r = 0;
+ }
+ callers[caller] = r + count;
+ }
+
+ _recordCallee(ProfileFunction callee, int count) {
+ var r = callees[callee];
+ if (r == null) {
+ r = 0;
+ }
+ callees[callee] = r + count;
+ }
}
@@ -416,7 +614,9 @@
final Map<String, List> tries = <String, List>{};
final List<ProfileCode> codes = new List<ProfileCode>();
+ bool _builtCodeCalls = false;
final List<ProfileFunction> functions = new List<ProfileFunction>();
+ bool _builtFunctionCalls = false;
CodeCallTree loadCodeTree(String name) {
if (name == 'inclusive') {
@@ -434,7 +634,25 @@
}
}
- void clear() {
+ buildCodeCallerAndCallees() {
+ if (_builtCodeCalls) {
+ return;
+ }
+ _builtCodeCalls = true;
+ var tree = loadCodeTree('inclusive');
+ tree._recordCallerAndCallees();
+ }
+
+ buildFunctionCallerAndCallees() {
+ if (_builtFunctionCalls) {
+ return;
+ }
+ _builtFunctionCalls = true;
+ var tree = loadFunctionTree('inclusive');
+ tree._markFunctionCalls();
+ }
+
+ clear() {
sampleCount = 0;
samplePeriod = 0;
sampleRate = 0.0;
@@ -443,9 +661,11 @@
codes.clear();
functions.clear();
tries.clear();
+ _builtCodeCalls = false;
+ _builtFunctionCalls = false;
}
- void load(Isolate isolate, ServiceMap profile) {
+ load(Isolate isolate, ServiceMap profile) {
clear();
if ((isolate == null) || (profile == null)) {
return;
diff --git a/runtime/observatory/lib/src/elements/class_tree.html b/runtime/observatory/lib/src/elements/class_tree.html
index 45a8dc3..5217e61 100644
--- a/runtime/observatory/lib/src/elements/class_tree.html
+++ b/runtime/observatory/lib/src/elements/class_tree.html
@@ -24,7 +24,6 @@
</style>
<nav-bar>
<top-nav-menu last="{{ true }}"></top-nav-menu>
- <nav-control></nav-control>
</nav-bar>
<div class="content-centered">
<h1>Class Hierarchy</h1>
diff --git a/runtime/observatory/lib/src/elements/class_view.html b/runtime/observatory/lib/src/elements/class_view.html
index 3a3253c..eadd09b 100644
--- a/runtime/observatory/lib/src/elements/class_view.html
+++ b/runtime/observatory/lib/src/elements/class_view.html
@@ -10,18 +10,19 @@
<link rel="import" href="observatory_element.html">
<link rel="import" href="script_inset.html">
<link rel="import" href="script_ref.html">
+<link rel="import" href="view_footer.html">
<polymer-element name="class-view" extends="observatory-element">
<template>
<link rel="stylesheet" href="css/shared.css">
<nav-bar>
<top-nav-menu></top-nav-menu>
+ <vm-nav-menu vm="{{ cls.isolate.vm }}"></vm-nav-menu>
<isolate-nav-menu isolate="{{ cls.isolate }}"></isolate-nav-menu>
<library-nav-menu library="{{ cls.library }}"></library-nav-menu>
<class-nav-menu cls="{{ cls }}" last="{{ true }}"></class-nav-menu>
<nav-refresh callback="{{ refreshCoverage }}" label="Refresh Coverage"></nav-refresh>
<nav-refresh callback="{{ refresh }}"></nav-refresh>
- <nav-control></nav-control>
</nav-bar>
<div class="content">
@@ -133,7 +134,7 @@
</div>
</curly-block><br><br>
</template>
-
+
<template if="{{ !cls.hasNoAllocations }}">
instances
<div class="memberItem">
@@ -153,12 +154,14 @@
</eval-link>
</template>
<template if="{{ instances != null }}">
- sample
- <any-service-ref ref="{{ instances['sample'] }}"></any-service-ref>
- <template if="{{ instances['totalCount'] > instances['sampleCount'] }}">
+ <template repeat="{{ sample in instances['samples'] }}">
+ <any-service-ref ref="{{ sample }}">
+ </any-service-ref><br>
+ </template>
+ <template if="{{ instances['totalCount'] > instances['samples'].length }}">
<eval-link callback="{{ reachable }}"
label="[more]"
- expr="{{ instances['sampleCount'] * 2 }}">
+ expr="{{ instances['samples'].length * 2 }}">
</eval-link>
</template>
of total {{ instances['totalCount'] }}
@@ -208,8 +211,7 @@
endPos="{{ cls.endTokenPos }}">
</script-inset>
- <br><br><br><br>
- <br><br><br><br>
+ <view-footer></view-footer>
</template>
</polymer-element>
diff --git a/runtime/observatory/lib/src/elements/code_view.dart b/runtime/observatory/lib/src/elements/code_view.dart
index 743febc..f6ba194 100644
--- a/runtime/observatory/lib/src/elements/code_view.dart
+++ b/runtime/observatory/lib/src/elements/code_view.dart
@@ -55,9 +55,9 @@
}
code.load().then((Code c) {
c.loadScript();
+ _updateDisassembly();
+ _updateInline();
});
- _updateDisassembly();
- _updateInline();
}
void refresh(var done) {
@@ -234,7 +234,6 @@
}
void _updateDisassembly() {
- notifyPropertyChange(#code, true, false);
_updateDiasssemblyTable();
_updateDisassemblyDOMTable();
}
diff --git a/runtime/observatory/lib/src/elements/code_view.html b/runtime/observatory/lib/src/elements/code_view.html
index 44316f8..ddb3d98 100644
--- a/runtime/observatory/lib/src/elements/code_view.html
+++ b/runtime/observatory/lib/src/elements/code_view.html
@@ -4,6 +4,7 @@
<link rel="import" href="observatory_element.html">
<link rel="import" href="nav_bar.html">
<link rel="import" href="script_ref.html">
+<link rel="import" href="view_footer.html">
<polymer-element name="code-view" extends="observatory-element">
<template>
@@ -41,11 +42,11 @@
</style>
<nav-bar>
<top-nav-menu></top-nav-menu>
+ <vm-nav-menu vm="{{ code.isolate.vm }}"></vm-nav-menu>
<isolate-nav-menu isolate="{{ code.isolate }}"></isolate-nav-menu>
<nav-menu link="{{ makeLink('/inspect', code) }}" anchor="{{ code.name }}" last="{{ true }}"></nav-menu>
<nav-refresh callback="{{ refresh }}"></nav-refresh>
<nav-refresh callback="{{ refreshTicks }}" label="Refresh Ticks"></nav-refresh>
- <nav-control></nav-control>
</nav-bar>
<div class="content">
<template if="{{ code.isDartCode && code.isOptimized }}">
@@ -132,8 +133,7 @@
<tbody class="monospace" id="disassemblyTableBody">
</tbody>
</table>
- <br><br><br>
- <br><br><br>
+ <view-footer></view-footer>
</template>
</polymer-element>
diff --git a/runtime/observatory/lib/src/elements/context_view.html b/runtime/observatory/lib/src/elements/context_view.html
index 0879f5f..bf61815 100644
--- a/runtime/observatory/lib/src/elements/context_view.html
+++ b/runtime/observatory/lib/src/elements/context_view.html
@@ -7,18 +7,19 @@
<link rel="import" href="nav_bar.html">
<link rel="import" href="object_common.html">
<link rel="import" href="context_ref.html">
+<link rel="import" href="view_footer.html">
<polymer-element name="context-view" extends="observatory-element">
<template>
<link rel="stylesheet" href="css/shared.css">
<nav-bar>
<top-nav-menu></top-nav-menu>
+ <vm-nav-menu vm="{{ context.isolate.vm }}"></vm-nav-menu>
<isolate-nav-menu isolate="{{ context.isolate }}"></isolate-nav-menu>
<!-- TODO(turnidge): Add library nav menu here. -->
<class-nav-menu cls="{{ context.clazz }}"></class-nav-menu>
<nav-menu link="." anchor="instance" last="{{ true }}"></nav-menu>
<nav-refresh callback="{{ refresh }}"></nav-refresh>
- <nav-control></nav-control>
</nav-bar>
<template if="{{ !context.isError }}">
@@ -58,11 +59,8 @@
</curly-block><br><br>
</template>
</div>
-
- <br><br><br><br>
- <br><br><br><br>
-
</template>
+ <view-footer></view-footer>
</template>
</polymer-element>
diff --git a/runtime/observatory/lib/src/elements/cpu_profile.dart b/runtime/observatory/lib/src/elements/cpu_profile.dart
index b4406ac..0da1ee5 100644
--- a/runtime/observatory/lib/src/elements/cpu_profile.dart
+++ b/runtime/observatory/lib/src/elements/cpu_profile.dart
@@ -224,7 +224,7 @@
percentNode.text = percent;
percentNode.style.minWidth = '5em';
percentNode.style.textAlign = 'right';
- percentNode.title = 'Self: $selfPercent';
+ percentNode.title = 'Executing: $selfPercent';
methodColumn.children.add(percentNode);
// Gap.
@@ -319,7 +319,7 @@
parentPercent.style.minWidth = '4em';
parentPercent.style.alignSelf = 'center';
parentPercent.style.textAlign = 'right';
- parentPercent.title = 'Self: $selfPercent';
+ parentPercent.title = 'Executing: $selfPercent';
functionRow.children.add(parentPercent);
// Gap.
@@ -346,7 +346,7 @@
functionRow.children.add(infoBox);
if (node.profileFunction.function.kind.hasDartCode()) {
- infoBox.children.add(div('Hot code for current node'));
+ infoBox.children.add(div('Code for current node'));
infoBox.children.add(br());
var totalTicks = node.totalCodesTicks;
var numCodes = node.codes.length;
@@ -392,7 +392,7 @@
});
if (node.profileFunction.function.kind.hasDartCode()) {
- infoBox.children.add(div('Hot code containing function'));
+ infoBox.children.add(div('Code containing function'));
infoBox.children.add(br());
var totalTicks = profile.sampleCount;
var codes = node.profileFunction.profileCodes;
@@ -510,10 +510,11 @@
fetchTime = formatTimeMilliseconds(_sw.elapsedMilliseconds);
}
- _onLoadStarted() {
+ Future _onLoadStarted() {
_sw.reset();
_sw.start();
state = 'Loading';
+ return window.animationFrame;
}
_onLoadFinished() {
@@ -537,9 +538,9 @@
}
_onFetchStarted();
return isolate.invokeRpc('getCpuProfile', { 'tags': tagSelector })
- .then((response) {
+ .then((response) async {
_onFetchFinished();
- _onLoadStarted();
+ await _onLoadStarted();
try {
profile.load(isolate, response);
_onLoadFinished();
@@ -610,3 +611,516 @@
codeTree.initialize(rootRow);
}
}
+
+class NameSortedTable extends SortedTable {
+ NameSortedTable(columns) : super(columns);
+ @override
+ dynamic getSortKeyFor(int row, int col) {
+ if (col == FUNCTION_COLUMN) {
+ // Use name as sort key.
+ return rows[row].values[col].name;
+ }
+ return super.getSortKeyFor(row, col);
+ }
+
+ SortedTableRow rowFromIndex(int tableIndex) {
+ final modelIndex = sortedRows[tableIndex];
+ return rows[modelIndex];
+ }
+
+ static const FUNCTION_SPACER_COLUMNS = const [];
+ static const FUNCTION_COLUMN = 2;
+ TableRowElement _makeFunctionRow() {
+ var tr = new TableRowElement();
+ var cell;
+
+ // Add percentage.
+ cell = tr.insertCell(-1);
+ cell = tr.insertCell(-1);
+
+ // Add function ref.
+ cell = tr.insertCell(-1);
+ var functionRef = new Element.tag('function-ref');
+ cell.children.add(functionRef);
+
+ return tr;
+ }
+
+ static const CALL_SPACER_COLUMNS = const [];
+ static const CALL_FUNCTION_COLUMN = 1;
+ TableRowElement _makeCallRow() {
+ var tr = new TableRowElement();
+ var cell;
+
+ // Add percentage.
+ cell = tr.insertCell(-1);
+ // Add function ref.
+ cell = tr.insertCell(-1);
+ var functionRef = new Element.tag('function-ref');
+ cell.children.add(functionRef);
+ return tr;
+ }
+
+ _updateRow(TableRowElement tr,
+ int rowIndex,
+ List spacerColumns,
+ int refColumn) {
+ var row = rows[rowIndex];
+ // Set reference
+ var ref = tr.children[refColumn].children[0];
+ ref.ref = row.values[refColumn];
+
+ for (var i = 0; i < row.values.length; i++) {
+ if (spacerColumns.contains(i) || (i == refColumn)) {
+ // Skip spacer columns.
+ continue;
+ }
+ var cell = tr.children[i];
+ cell.title = row.values[i].toString();
+ cell.text = getFormattedValue(rowIndex, i);
+ }
+ }
+
+ _updateTableView(HtmlElement table,
+ HtmlElement makeEmptyRow(),
+ void onRowClick(TableRowElement tr),
+ List spacerColumns,
+ int refColumn) {
+ assert(table != null);
+
+ // Resize DOM table.
+ if (table.children.length > sortedRows.length) {
+ // Shrink the table.
+ var deadRows = table.children.length - sortedRows.length;
+ for (var i = 0; i < deadRows; i++) {
+ table.children.removeLast();
+ }
+ } else if (table.children.length < sortedRows.length) {
+ // Grow table.
+ var newRows = sortedRows.length - table.children.length;
+ for (var i = 0; i < newRows; i++) {
+ var row = makeEmptyRow();
+ row.onClick.listen((e) {
+ e.stopPropagation();
+ e.preventDefault();
+ onRowClick(row);
+ });
+ table.children.add(row);
+ }
+ }
+
+ assert(table.children.length == sortedRows.length);
+
+ // Fill table.
+ for (var i = 0; i < sortedRows.length; i++) {
+ var rowIndex = sortedRows[i];
+ var tr = table.children[i];
+ _updateRow(tr, rowIndex, spacerColumns, refColumn);
+ }
+ }
+}
+
+@CustomTag('cpu-profile-table')
+class CpuProfileTableElement extends ObservatoryElement {
+ final Stopwatch _sw = new Stopwatch();
+ final CpuProfile profile = new CpuProfile();
+ StreamSubscription _resizeSubscription;
+ @observable NameSortedTable profileTable;
+ @observable NameSortedTable profileCallersTable;
+ @observable NameSortedTable profileCalleesTable;
+ @observable ServiceFunction focusedFunction;
+ @observable int focusedRow;
+ @observable String fetchTime = '';
+ @observable String loadTime = '';
+ @observable String state = 'Requested';
+ @observable var exception;
+ @observable var stackTrace;
+ @observable Isolate isolate;
+ @observable String sampleCount = '';
+ @observable String refreshTime = '';
+ @observable String sampleRate = '';
+ @observable String stackDepth = '';
+ @observable String timeSpan = '';
+ @observable String directionSelector = 'Up';
+
+ CpuProfileTableElement.created() : super.created() {
+ var columns = [
+ new SortedTableColumn.withFormatter('Executing (%)',
+ Utils.formatPercentNormalized),
+ new SortedTableColumn.withFormatter('In stack (%)',
+ Utils.formatPercentNormalized),
+ new SortedTableColumn('Method'),
+ ];
+ profileTable = new NameSortedTable(columns);
+ profileTable.sortColumnIndex = 0;
+
+ columns = [
+ new SortedTableColumn.withFormatter('Callees (%)',
+ Utils.formatPercentNormalized),
+ new SortedTableColumn('Method')
+ ];
+ profileCalleesTable = new NameSortedTable(columns);
+ profileCalleesTable.sortColumnIndex = 0;
+
+ columns = [
+ new SortedTableColumn.withFormatter('Callers (%)',
+ Utils.formatPercentNormalized),
+ new SortedTableColumn('Method')
+ ];
+ profileCallersTable = new NameSortedTable(columns);
+ profileCallersTable.sortColumnIndex = 0;
+ }
+
+ attached() {
+ super.attached();
+ _resizeSubscription = window.onResize.listen((_) => _updateSize());
+ _updateSize();
+ }
+
+ detached() {
+ super.detached();
+ if (_resizeSubscription != null) {
+ _resizeSubscription.cancel();
+ }
+ }
+
+ _updateSize() {
+ HtmlElement e = $['main'];
+ final totalHeight = window.innerHeight;
+ final top = e.offset.top;
+ final bottomMargin = 32;
+ final mainHeight = totalHeight - top - bottomMargin;
+ e.style.setProperty('height', '${mainHeight}px');
+ }
+
+ isolateChanged() {
+ _getCpuProfile().whenComplete(checkParameters);
+ }
+
+ checkParameters() {
+ var functionId = app.locationManager.uri.queryParameters['functionId'];
+ if (functionId == null) {
+ _focusOnFunction(null);
+ return;
+ }
+ if (isolate == null) {
+ return;
+ }
+ isolate.getObject(functionId).then((func) => _focusOnFunction(func));
+ }
+
+ void directionSelectorChanged(oldValue) {
+ _updateFunctionTreeView();
+ }
+
+ void refresh(var done) {
+ _getCpuProfile().whenComplete(done);
+ }
+
+ void clear(var done) {
+ _clearCpuProfile().whenComplete(done);
+ }
+
+ _onFetchStarted() {
+ _sw.reset();
+ _sw.start();
+ state = 'Requested';
+ }
+
+ _onFetchFinished() {
+ _sw.stop();
+ fetchTime = formatTimeMilliseconds(_sw.elapsedMilliseconds);
+ }
+
+ _onLoadStarted() {
+ _sw.reset();
+ _sw.start();
+ state = 'Loading';
+ }
+
+ _onLoadFinished() {
+ _sw.stop();
+ loadTime = formatTimeMilliseconds(_sw.elapsedMilliseconds);
+ state = 'Loaded';
+ }
+
+ Future _clearCpuProfile() {
+ profile.clear();
+ _clearView();
+ if (isolate == null) {
+ return new Future.value(null);
+ }
+ return isolate.invokeRpc('clearCpuProfile', { })
+ .then((ServiceMap response) {
+ _updateView();
+ });
+ }
+
+ Future _getCpuProfile() {
+ profile.clear();
+ _clearView();
+ if (isolate == null) {
+ return new Future.value(null);
+ }
+ _onFetchStarted();
+ return isolate.invokeRpc('getCpuProfile', { 'tags': 'None' })
+ .then((response) {
+ _onFetchFinished();
+ _onLoadStarted();
+ try {
+ profile.load(isolate, response);
+ profile.buildFunctionCallerAndCallees();
+ _onLoadFinished();
+ _updateView();
+ } catch (e, st) {
+ state = 'Exception';
+ exception = e;
+ stackTrace = st;
+ }
+ }).catchError((e, st) {
+ state = 'Exception';
+ exception = e;
+ stackTrace = st;
+ });
+ }
+
+ _clearView() {
+ profileTable.clearRows();
+ _renderTable();
+ }
+
+ _updateView() {
+ sampleCount = profile.sampleCount.toString();
+ refreshTime = new DateTime.now().toString();
+ stackDepth = profile.stackDepth.toString();
+ sampleRate = profile.sampleRate.toStringAsFixed(0);
+ timeSpan = formatTime(profile.timeSpan);
+ _buildFunctionTable();
+ _renderTable();
+ _updateFunctionTreeView();
+ }
+
+ int _findFunctionRow(ServiceFunction function) {
+ for (var i = 0; i < profileTable.sortedRows.length; i++) {
+ var rowIndex = profileTable.sortedRows[i];
+ var row = profileTable.rows[rowIndex];
+ if (row.values[NameSortedTable.FUNCTION_COLUMN] == function) {
+ return i;
+ }
+ }
+ return -1;
+ }
+
+ _scrollToFunction(ServiceFunction function) {
+ TableSectionElement tableBody = $['profile-table'];
+ var row = _findFunctionRow(function);
+ if (row == -1) {
+ return;
+ }
+ tableBody.children[row].classes.remove('shake');
+ // trigger reflow.
+ tableBody.children[row].offsetHeight;
+ tableBody.children[row].scrollIntoView(ScrollAlignment.CENTER);
+ tableBody.children[row].classes.add('shake');
+ }
+
+ _clearFocusedFunction() {
+ TableSectionElement tableBody = $['profile-table'];
+ // Clear current focus.
+ if (focusedRow != null) {
+ tableBody.children[focusedRow].classes.remove('focused');
+ }
+ focusedRow = null;
+ focusedFunction = null;
+ }
+
+ _focusOnFunction(ServiceFunction function) {
+ if (focusedFunction == function) {
+ // Do nothing.
+ return;
+ }
+
+ _clearFocusedFunction();
+
+ if (function == null) {
+ _updateFunctionTreeView();
+ _clearCallTables();
+ return;
+ }
+
+ var row = _findFunctionRow(function);
+ if (row == -1) {
+ _updateFunctionTreeView();
+ _clearCallTables();
+ return;
+ }
+
+ focusedRow = row;
+ focusedFunction = function;
+
+ TableSectionElement tableBody = $['profile-table'];
+ tableBody.children[focusedRow].classes.add('focused');
+ _updateFunctionTreeView();
+ _buildCallersTable(focusedFunction);
+ _buildCalleesTable(focusedFunction);
+ }
+
+ _onRowClick(TableRowElement tr) {
+ var tableBody = $['profile-table'];
+ var row = profileTable.rowFromIndex(tableBody.children.indexOf(tr));
+ var function = row.values[NameSortedTable.FUNCTION_COLUMN];
+ app.locationManager.goReplacingParameters(
+ {
+ 'functionId': function.id
+ }
+ );
+ }
+
+ _renderTable() {
+ profileTable._updateTableView($['profile-table'],
+ profileTable._makeFunctionRow,
+ _onRowClick,
+ NameSortedTable.FUNCTION_SPACER_COLUMNS,
+ NameSortedTable.FUNCTION_COLUMN);
+ }
+
+ _buildFunctionTable() {
+ for (var func in profile.functions) {
+ if ((func.exclusiveTicks == 0) && (func.inclusiveTicks == 0)) {
+ // Skip.
+ continue;
+ }
+ var row = [
+ func.normalizedExclusiveTicks,
+ func.normalizedInclusiveTicks,
+ func.function,
+ ];
+ profileTable.addRow(new SortedTableRow(row));
+ }
+ profileTable.sort();
+ }
+
+ _renderCallTable(TableSectionElement view,
+ NameSortedTable model,
+ void onRowClick(TableRowElement tr)) {
+ model._updateTableView(view,
+ model._makeCallRow,
+ onRowClick,
+ NameSortedTable.CALL_SPACER_COLUMNS,
+ NameSortedTable.CALL_FUNCTION_COLUMN);
+ }
+
+ _buildCallTable(Map<ProfileFunction, int> calls,
+ NameSortedTable model) {
+ model.clearRows();
+ if (calls == null) {
+ return;
+ }
+ var sum = 0;
+ calls.values.forEach((i) => sum += i);
+ calls.forEach((func, count) {
+ var row = [
+ count / sum,
+ func.function,
+ ];
+ model.addRow(new SortedTableRow(row));
+ });
+ model.sort();
+ }
+
+ _clearCallTables() {
+ _buildCallersTable(null);
+ _buildCalleesTable(null);
+ }
+
+ _onCallersClick(TableRowElement tr) {
+ var table = $['callers-table'];
+ final row = profileCallersTable.rowFromIndex(table.children.indexOf(tr));
+ var function = row.values[NameSortedTable.CALL_FUNCTION_COLUMN];
+ _scrollToFunction(function);
+ }
+
+ _buildCallersTable(ServiceFunction function) {
+ var calls = (function != null) ? function.profile.callers : null;
+ var table = $['callers-table'];
+ _buildCallTable(calls, profileCallersTable);
+ _renderCallTable(table, profileCallersTable, _onCallersClick);
+ }
+
+ _onCalleesClick(TableRowElement tr) {
+ var table = $['callees-table'];
+ final row = profileCalleesTable.rowFromIndex(table.children.indexOf(tr));
+ var function = row.values[NameSortedTable.CALL_FUNCTION_COLUMN];
+ _scrollToFunction(function);
+ }
+
+ _buildCalleesTable(ServiceFunction function) {
+ var calls = (function != null) ? function.profile.callees : null;
+ var table = $['callees-table'];
+ _buildCallTable(calls, profileCalleesTable);
+ _renderCallTable(table, profileCalleesTable, _onCalleesClick);
+ }
+
+ _changeSort(Element target, NameSortedTable table) {
+ if (target is TableCellElement) {
+ if (table.sortColumnIndex != target.cellIndex) {
+ table.sortColumnIndex = target.cellIndex;
+ table.sortDescending = true;
+ } else {
+ table.sortDescending = !profileTable.sortDescending;
+ }
+ table.sort();
+ }
+ }
+
+ changeSortProfile(Event e, var detail, Element target) {
+ _changeSort(target, profileTable);
+ _renderTable();
+ }
+
+ changeSortCallers(Event e, var detail, Element target) {
+ _changeSort(target, profileCallersTable);
+ _renderCallTable($['callers-table'], profileCallersTable, _onCallersClick);
+ }
+
+ changeSortCallees(Event e, var detail, Element target) {
+ _changeSort(target, profileCalleesTable);
+ _renderCallTable($['callees-table'], profileCalleesTable, _onCalleesClick);
+ }
+
+ //////
+ ///
+ /// Function tree.
+ ///
+ TableTree functionTree;
+ _updateFunctionTreeView() {
+ if (functionTree != null) {
+ functionTree.clear();
+ functionTree = null;
+ }
+ _buildFunctionTree();
+ }
+
+ void _buildFunctionTree() {
+ if (functionTree == null) {
+ var tableBody = shadowRoot.querySelector('#treeBody');
+ assert(tableBody != null);
+ functionTree = new TableTree(tableBody, 2);
+ }
+ if (focusedFunction == null) {
+ return;
+ }
+ bool exclusive = directionSelector == 'Up';
+ var tree = profile.loadFunctionTree(exclusive ? 'exclusive' : 'inclusive');
+ if (tree == null) {
+ return;
+ }
+ var filter = (FunctionCallTreeNode node) {
+ return node.profileFunction.function == focusedFunction;
+ };
+ tree = tree.filtered(filter);
+ var rootRow =
+ new FunctionProfileTreeRow(functionTree, null, profile, tree.root);
+ functionTree.initialize(rootRow);
+ }
+}
diff --git a/runtime/observatory/lib/src/elements/cpu_profile.html b/runtime/observatory/lib/src/elements/cpu_profile.html
index 4893f99..ab27127 100644
--- a/runtime/observatory/lib/src/elements/cpu_profile.html
+++ b/runtime/observatory/lib/src/elements/cpu_profile.html
@@ -4,17 +4,284 @@
<link rel="import" href="nav_bar.html">
<link rel="import" href="observatory_element.html">
<link rel="import" href="sliding_checkbox.html">
+<link rel="import" href="view_footer.html">
+
+<polymer-element name="cpu-profile-table" extends="observatory-element">
+ <template>
+ <link rel="stylesheet" href="css/shared.css">
+ <nav-bar>
+ <top-nav-menu></top-nav-menu>
+ <vm-nav-menu vm="{{ isolate.vm }}"></vm-nav-menu>
+ <isolate-nav-menu isolate="{{ isolate }}"></isolate-nav-menu>
+ <nav-menu link="{{ makeLink('/profiler-table', isolate) }}" anchor="cpu profile (table)" last="{{ true }}"></nav-menu>
+ <nav-refresh callback="{{ refresh }}"></nav-refresh>
+ <nav-refresh callback="{{ clear }}" label="Clear"></nav-refresh>
+ </nav-bar>
+ <style>
+ /* general */
+ .well {
+ background-color: #ECECEC;
+ padding: 0.2em;
+ }
+ .center {
+ align-items: center;
+ justify-content: center;
+ }
+
+ /* status messages */
+ .statusMessage {
+ font-size: 150%;
+ font-weight: bold;
+ }
+ .statusBox {
+ height: 100%;
+ padding: 1em;
+ }
+
+ /* tables */
+ .table {
+ border-collapse: collapse!important;
+ table-layout: fixed;
+ height: 100%;
+ }
+ .th, .td {
+ padding: 8px;
+ vertical-align: top;
+ }
+ .table thead > tr > th {
+ vertical-align: bottom;
+ text-align: left;
+ border-bottom:2px solid #ddd;
+ }
+ .spacer {
+ width: 16px;
+ }
+ .left-border-spacer {
+ width: 16px;
+ border-left: 1px solid;
+ }
+ .clickable {
+ color: #0489c3;
+ text-decoration: none;
+ cursor: pointer;
+ min-width: 8em;
+ }
+ .clickable:hover {
+ text-decoration: underline;
+ cursor: pointer;
+ }
+ tr:hover:not(.focused) > td {
+ background-color: #FAFAFA;
+ }
+ .focused {
+ background-color: #F4C7C3;
+ }
+ .scroll {
+ overflow: scroll;
+ }
+ .outlined {
+ -webkit-box-shadow: 0px 0px 2px 1px rgba(0,0,0,0.75);
+ -moz-box-shadow: 0px 0px 2px 1px rgba(0,0,0,0.75);
+ box-shadow: 0px 0px 2px 1px rgba(0,0,0,0.75);
+ margin: 4px;
+ }
+ .centered {
+ margin-left: auto;
+ margin-right: auto;
+ justify-content: center;
+ }
+ .full-height {
+ height: 100%;
+ }
+ .mostly-full-height {
+ height: 80%;
+ }
+ .full-width {
+ width: 100%;
+ }
+ .focused-function-label {
+ flex: 0 1 auto;
+ margin-left: auto;
+ margin-right: auto;
+ justify-content: center;
+ }
+ .call-table {
+ flex: 1 1 auto;
+ }
+
+ .tree {
+ border-spacing: 0px;
+ width: 100%;
+ margin-bottom: 20px
+ vertical-align: middle;
+ }
+
+ .tree tbody tr {
+ animation: fadeIn 0.5s;
+ -moz-animation: fadeIn 0.5s;
+ -webkit-animation: fadeIn 0.5s;
+ }
+
+ .tree tbody tr:hover {
+ background-color: #FAFAFA;
+ }
+
+ .tree tr td:first-child,
+ .tree tr th:first-child {
+ width: 100%;
+ }
+
+ .tree thead > tr > th {
+ padding: 8px;
+ vertical-align: bottom;
+ text-align: left;
+ border-bottom: 1px solid #ddd;
+ }
+
+ </style>
+ <div class="content-centered-big">
+ <template if="{{ state == 'Requested' }}">
+ <div class="statusBox shadow center">
+ <div class="statusMessage">Fetching profile from VM...</div>
+ </div>
+ </template>
+ <template if="{{ state == 'Loading' }}">
+ <div class="statusBox shadow center">
+ <div class="statusMessage">Loading profile...</div>
+ </div>
+ </template>
+ <template if="{{ state == 'Exception' }}">
+ <div class="statusBox shadow center">
+ <div class="statusMessage">
+ <h1>Exception:</h1>
+ <br>
+ <pre>{{ exception.toString() }}</pre>
+ <br>
+ <h1>Stack trace:</h1>
+ <br>
+ <pre>{{ stackTrace.toString() }}</pre>
+ </div>
+ </div>
+ </template>
+ <template if="{{ state == 'Loaded' }}">
+ <div class="memberList">
+ <div class="memberItem">
+ <div class="memberName">Refreshed at </div>
+ <div class="memberValue">{{ refreshTime }} (fetched in {{ fetchTime }}) (loaded in {{ loadTime }})</div>
+ </div>
+ <div class="memberItem">
+ <div class="memberName">Profile contains</div>
+ <div class="memberValue">{{ sampleCount }} samples (spanning {{ timeSpan }})</div>
+ </div>
+ <div class="memberItem">
+ <div class="memberName">Sampling</div>
+ <div class="memberValue">{{ stackDepth }} stack frames @ {{ sampleRate }} Hz</div>
+ </div>
+ <div class="memberItem">
+ <div class="memberName">Call Tree Direction</div>
+ <div class="memberValue">
+ <select value="{{directionSelector}}">
+ <option value="Down">Top down</option>
+ <option value="Up">Bottom up</option>
+ </select>
+ </div>
+ </div>
+ </div>
+ </template>
+ </div>
+ <hr>
+ <div id="main" class="flex-row centered">
+ <div class="flex-item-45-percent full-height outlined scroll">
+ <table id="main-table" class="flex-item-100-percent table">
+ <thead>
+ <tr>
+ <th on-click="{{changeSortProfile}}" class="clickable" title="Executing (%)">{{ profileTable.getColumnLabel(0) }}</th>
+ <th on-click="{{changeSortProfile}}" class="clickable" title="In stack (%)">{{ profileTable.getColumnLabel(1) }}</th>
+ <th on-click="{{changeSortProfile}}" class="clickable" title="Method">{{ profileTable.getColumnLabel(2) }}</th>
+ </tr>
+ </thead>
+ <tbody id="profile-table">
+ </tbody>
+ </table>
+ </div>
+ <div class="flex-item-45-percent full-height outlined">
+ <div class="flex-column full-height">
+ <div class="focused-function-label">
+ <template if="{{ focusedFunction != null }}">
+ <span>Focused on: </span>
+ <function-ref ref="{{ focusedFunction }}"></function-ref>
+ </template>
+ <template if="{{ focusedFunction == null }}">
+ <span>No focused function</span>
+ </template>
+ </div>
+ <hr>
+ <div class="call-table scroll">
+ <table class="full-width table">
+ <thead>
+ <tr>
+ <th on-click="{{changeSortCallers}}" class="clickable" title="Callers (%)">{{ profileCallersTable.getColumnLabel(0) }}</th>
+ <th on-click="{{changeSortCallers}}" class="clickable" title="Method">{{ profileCallersTable.getColumnLabel(1) }}</th>
+ </tr>
+ </thead>
+ <tbody id="callers-table">
+ </tbody>
+ </table>
+ </div>
+ <hr>
+ <div class="call-table scroll">
+ <table class="full-width table">
+ <thead>
+ <tr>
+ <th on-click="{{changeSortCallees}}" class="clickable" title="Callees (%)">{{ profileCalleesTable.getColumnLabel(0) }}</th>
+ <th on-click="{{changeSortCallees}}" class="clickable" title="Method">{{ profileCalleesTable.getColumnLabel(1) }}</th>
+ </tr>
+ </thead>
+ <tbody id="callees-table">
+ </tbody>
+ </table>
+ </div>
+ </div>
+ </div>
+ </div>
+ <br>
+ <br>
+ <div class="focused-function-label">
+ <template if="{{ focusedFunction != null }}">
+ <span>Filtered tree: </span>
+ <function-ref ref="{{ focusedFunction }}"></function-ref>
+ </template>
+ <template if="{{ focusedFunction == null }}">
+ <span>No focused function</span>
+ </template>
+ </div>
+ <div class="flex-row centered">
+ <div class="flex-item-90-percent outlined" style="margin: 16px; margin-left: 8px; margin-right: 8px">
+ <table class="full-width tree">
+ <thead id="treeHeader">
+ <tr>
+ <th>Method</th>
+ <th>Executing</th>
+ </tr>
+ </thead>
+ <tbody id="treeBody">
+ </tbody>
+ </table>
+ </div>
+ </div>
+ </template>
+</polymer-element>
<polymer-element name="cpu-profile" extends="observatory-element">
<template>
<link rel="stylesheet" href="css/shared.css">
<nav-bar>
<top-nav-menu></top-nav-menu>
+ <vm-nav-menu vm="{{ isolate.vm }}"></vm-nav-menu>
<isolate-nav-menu isolate="{{ isolate }}"></isolate-nav-menu>
<nav-menu link="{{ makeLink('/profiler', isolate) }}" anchor="cpu profile" last="{{ true }}"></nav-menu>
<nav-refresh callback="{{ refresh }}"></nav-refresh>
<nav-refresh callback="{{ clear }}" label="Clear"></nav-refresh>
- <nav-control></nav-control>
</nav-bar>
<style>
.tableWell {
@@ -192,7 +459,7 @@
<thead id="treeHeader">
<tr>
<th>Method</th>
- <th>Self</th>
+ <th>Executing</th>
</tr>
</thead>
<tbody id="treeBody">
@@ -200,6 +467,7 @@
</table>
</div>
</div>
+ <view-footer></view-footer>
</template>
</polymer-element>
diff --git a/runtime/observatory/lib/src/elements/css/shared.css b/runtime/observatory/lib/src/elements/css/shared.css
index 1659ce9..6fe3b508 100644
--- a/runtime/observatory/lib/src/elements/css/shared.css
+++ b/runtime/observatory/lib/src/elements/css/shared.css
@@ -219,6 +219,12 @@
flex-basis: 40%;
}
+.flex-item-45-percent {
+ flex-grow: 0;
+ flex-shrink: 0;
+ flex-basis: 45%;
+}
+
.flex-item-50-percent {
flex-grow: 0;
flex-shrink: 0;
@@ -243,6 +249,12 @@
flex-basis: 80%;
}
+.flex-item-90-percent {
+ flex-grow: 0;
+ flex-shrink: 0;
+ flex-basis: 90%;
+}
+
.well {
min-height: 20px;
padding: 19px;
@@ -267,7 +279,7 @@
.shadow {
box-shadow: 0 2px 10px 0 rgba(0, 0, 0, 0.16),
- 0 2px 5px 0 rgba(0, 0, 0, 0.26);
+ 0 2px 5px 0 rgba(0, 0, 0, 0.26);
}
@-webkit-keyframes fadeIn {
@@ -284,3 +296,45 @@
0% { opacity: 0; }
100% { opacity: 1; }
}
+
+@-webkit-keyframes shake {
+ 0%, 100% {
+ -webkit-transform: translate3d(0, 0, 0);
+ transform: translate3d(0, 0, 0);
+ }
+
+ 10%, 30%, 50%, 70%, 90% {
+ -webkit-transform: translate3d(-10px, 0, 0);
+ transform: translate3d(-10px, 0, 0);
+ }
+
+ 20%, 40%, 60%, 80% {
+ -webkit-transform: translate3d(10px, 0, 0);
+ transform: translate3d(10px, 0, 0);
+ }
+}
+
+@keyframes shake {
+ 0%, 100% {
+ -webkit-transform: translate3d(0, 0, 0);
+ -ms-transform: translate3d(0, 0, 0);
+ transform: translate3d(0, 0, 0);
+ }
+
+ 10%, 30%, 50%, 70%, 90% {
+ -webkit-transform: translate3d(-10px, 0, 0);
+ -ms-transform: translate3d(-10px, 0, 0);
+ transform: translate3d(-10px, 0, 0);
+ }
+
+ 20%, 40%, 60%, 80% {
+ -webkit-transform: translate3d(10px, 0, 0);
+ -ms-transform: translate3d(10px, 0, 0);
+ transform: translate3d(10px, 0, 0);
+ }
+}
+
+.shake {
+ animation: shake 0.5s;
+ -webkit-animation: shake 0.5s;
+}
diff --git a/runtime/observatory/lib/src/elements/debugger.dart b/runtime/observatory/lib/src/elements/debugger.dart
index 662ebb8..7b8364b 100644
--- a/runtime/observatory/lib/src/elements/debugger.dart
+++ b/runtime/observatory/lib/src/elements/debugger.dart
@@ -883,6 +883,11 @@
_refreshStack(isolate.pauseEvent).then((_) {
reportStatus();
});
+ }).catchError((_) {
+ // Error loading libraries, try and display stack.
+ _refreshStack(isolate.pauseEvent).then((_) {
+ reportStatus();
+ });
});
});
} else {
@@ -890,7 +895,7 @@
}
}
- void set isolate(Isolate iso) {
+ set isolate(Isolate iso) {
// Setting the page's isolate will trigger updateIsolate to be called.
//
// TODO(turnidge): Rework ownership of the ObservatoryDebugger in another
@@ -1202,6 +1207,7 @@
class DebuggerStackElement extends ObservatoryElement {
@published Isolate isolate;
@observable bool hasStack = false;
+ @observable bool hasMessages = false;
@observable bool isSampled = false;
@observable int currentFrame;
ObservatoryDebugger debugger;
@@ -1223,7 +1229,18 @@
frameList.insert(0, li);
}
- void updateStack(ServiceMap newStack, ServiceEvent pauseEvent) {
+ _addMessage(List messageList, ServiceMap messageInfo) {
+ DebuggerMessageElement messageElement = new Element.tag('debugger-message');
+ messageElement.message = messageInfo;
+
+ var li = new LIElement();
+ li.classes.add('list-group-item');
+ li.children.insert(0, messageElement);
+
+ messageList.add(li);
+ }
+
+ void updateStackFrames(ServiceMap newStack) {
List frameElements = $['frameList'].children;
List newFrames = newStack['frames'];
@@ -1270,10 +1287,47 @@
}
}
- isSampled = pauseEvent == null;
hasStack = frameElements.isNotEmpty;
}
+ void updateStackMessages(ServiceMap newStack) {
+ List messageElements = $['messageList'].children;
+ List newMessages = newStack['messages'];
+
+ // Remove any extra message elements.
+ if (messageElements.length > newMessages.length) {
+ // Remove old messages from the front of the queue.
+ int removeCount = messageElements.length - newMessages.length;
+ for (int i = 0; i < removeCount; i++) {
+ messageElements.removeAt(0);
+ }
+ }
+
+ // Add any new messages to the tail of the queue.
+ int newStartingIndex = messageElements.length;
+ if (messageElements.length < newMessages.length) {
+ for (int i = newStartingIndex; i < newMessages.length; i++) {
+ _addMessage(messageElements, newMessages[i]);
+ }
+ }
+ assert(messageElements.length == newMessages.length);
+
+ if (messageElements.isNotEmpty) {
+ // Update old messages.
+ for (int i = 0; i < newStartingIndex; i++) {
+ messageElements[i].children[0].updateMessage(newMessages[i]);
+ }
+ }
+
+ hasMessages = messageElements.isNotEmpty;
+ }
+
+ void updateStack(ServiceMap newStack, ServiceEvent pauseEvent) {
+ updateStackFrames(newStack);
+ updateStackMessages(newStack);
+ isSampled = pauseEvent == null;
+ }
+
void setCurrentFrame(int value) {
currentFrame = value;
List frameElements = $['frameList'].children;
@@ -1395,6 +1449,100 @@
}
}
+@CustomTag('debugger-message')
+class DebuggerMessageElement extends ObservatoryElement {
+ @published ServiceMap message;
+ @observable ServiceObject preview;
+
+ // Is this the current message?
+ bool _current = false;
+
+ // Has this message been pinned open?
+ bool _pinned = false;
+
+ void setCurrent(bool value) {
+ _current = value;
+ var messageOuter = $['messageOuter'];
+ if (_current) {
+ messageOuter.classes.add('current');
+ expanded = true;
+ messageOuter.classes.add('shadow');
+ scrollIntoView();
+ } else {
+ messageOuter.classes.remove('current');
+ if (_pinned) {
+ expanded = true;
+ messageOuter.classes.add('shadow');
+ } else {
+ expanded = false;
+ messageOuter.classes.remove('shadow');
+ }
+ }
+ }
+
+ @observable String scriptHeight;
+ @observable bool expanded = false;
+ @observable bool busy = false;
+
+ DebuggerMessageElement.created() : super.created();
+
+ void updateMessage(ServiceMap newMessage) {
+ bool messageChanged =
+ (message['messageObjectId'] != newMessage['messageObjectId']);
+ message['depth'] = newMessage['depth'];
+ message['handlerFunction'] = newMessage['handlerFunction'];
+ message['messageObjectId'] = newMessage['messageObjectId'];
+ if (messageChanged) {
+ // Message object id has changed: clear preview and collapse.
+ preview = null;
+ if (expanded) {
+ toggleExpand(null, null, null);
+ }
+ }
+ }
+
+ @override
+ void attached() {
+ super.attached();
+ int windowHeight = window.innerHeight;
+ scriptHeight = '${windowHeight ~/ 1.6}px';
+ }
+
+ void toggleExpand(var a, var b, var c) {
+ if (busy) {
+ return;
+ }
+ busy = true;
+ var function = message['handlerFunction'];
+ var loadedFunction;
+ if (function == null) {
+ // Complete immediately.
+ loadedFunction = new Future.value(null);
+ } else {
+ loadedFunction = function.load();
+ }
+ loadedFunction.then((_) {
+ _pinned = !_pinned;
+ var messageOuter = $['messageOuter'];
+ if (_pinned) {
+ expanded = true;
+ messageOuter.classes.add('shadow');
+ } else {
+ expanded = false;
+ messageOuter.classes.remove('shadow');
+ }
+ busy = false;
+ });
+ }
+
+ Future<ServiceObject> previewMessage(_) {
+ return message.isolate.getObject(message['messageObjectId']).then((result) {
+ preview = result;
+ return result;
+ });
+ }
+}
+
@CustomTag('debugger-console')
class DebuggerConsoleElement extends ObservatoryElement {
@published Isolate isolate;
diff --git a/runtime/observatory/lib/src/elements/debugger.html b/runtime/observatory/lib/src/elements/debugger.html
index 59ccda8..b2a2b65 100644
--- a/runtime/observatory/lib/src/elements/debugger.html
+++ b/runtime/observatory/lib/src/elements/debugger.html
@@ -1,6 +1,7 @@
<link rel="import" href="../../../../packages/polymer/polymer.html">
<link rel="import" href="function_ref.html">
<link rel="import" href="nav_bar.html">
+<link rel="import" href="eval_link.html">
<link rel="import" href="observatory_element.html">
<link rel="import" href="script_inset.html">
<link rel="import" href="script_ref.html">
@@ -109,10 +110,9 @@
<div class="container">
<nav-bar id="navbarDiv" showNotify="{{ false }}">
<top-nav-menu></top-nav-menu>
- <isolate-nav-menu isolate="{{ isolate }}">
- </isolate-nav-menu>
+ <vm-nav-menu vm="{{ isolate.vm }}"></vm-nav-menu>
+ <isolate-nav-menu isolate="{{ isolate }}"></isolate-nav-menu>
<nav-menu link="{{ makeLink('/debugger', isolate) }}" anchor="debugger" last="{{ true }}"></nav-menu>
- <nav-control></nav-control>
</nav-bar>
<div id="stackDiv" class="stack">
<debugger-stack id="stackElement" isolate="{{ isolate }}"></debugger-stack>
@@ -146,7 +146,7 @@
font-size: 1px;
border-bottom: 1px dashed #888;
}
- .noStack {
+ .noMessages .noStack {
margin: 0px 20px 10px 20px;
font: normal 14px consolas, courier, monospace;
line-height: 125%;
@@ -171,6 +171,13 @@
<ul id="frameList" class="list-group">
<!-- debugger-frame elements are added programmatically -->
</ul>
+ <hr>
+ <template if="{{ !hasMessages }}">
+ <div class="noMessages">No messages</div>
+ </template>
+ <ul id="messageList" class="list-group">
+ <!-- debugger-message elements are added programmatically -->
+ </ul>
</template>
</polymer-element>
@@ -246,7 +253,8 @@
script="{{ frame['function'].script }}"
startPos="{{ frame['function'].tokenPos }}"
endPos="{{ frame['function'].endTokenPos }}"
- currentPos="{{ frame['tokenPos'] }}">
+ currentPos="{{ frame['tokenPos'] }}"
+ inDebuggerContext="{{ true }}">
</script-inset>
</div>
<div class="flex-item-40-percent">
@@ -277,6 +285,104 @@
</template>
</polymer-element>
+<polymer-element name="debugger-message" extends="observatory-element">
+ <template>
+ <link rel="stylesheet" href="css/shared.css">
+ <style>
+ .messageOuter {
+ position: relative;
+ padding: 5px;
+ border: 1px solid white;
+ }
+ .messageOuter:hover {
+ border: 1px solid #e0e0e0;
+ }
+ .shadow {
+ box-shadow: 0 2px 10px 0 rgba(0, 0, 0, 0.16),
+ 0 2px 5px 0 rgba(0, 0, 0, 0.26);
+ }
+ .current {
+ box-shadow: 0 2px 10px 0 rgba(0, 0, 0, 0.26),
+ 0 2px 5px 0 rgba(0, 0, 0, 0.46);
+ border: 1px solid #444;
+ }
+ .messageSummaryText {
+ display: inline-block;
+ padding: 5px;
+ }
+ .messageId {
+ display: inline-block;
+ width: 100px;
+ }
+ .messageOuter .messageExpander {
+ position: absolute;
+ right: 5px;
+ top: 5px;
+ display: none;
+ }
+ .messageOuter:hover .messageExpander {
+ display: inline-block;
+ }
+ .messageContractor {
+ position: absolute;
+ right: 5px;
+ bottom: 5px;
+ display: inline-block;
+ }
+ </style>
+ <div id="messageOuter" class="messageOuter">
+ <a on-click="{{ toggleExpand }}">
+ <div class="messageSummary">
+ <div class="messageSummaryText">
+ <div class="messageId"><b>message {{ message['depth'] }}</b></div>
+ <function-ref ref="{{ message['handlerFunction'] }}"></function-ref>
+ ( <script-ref ref="{{ message['handlerScript'] }}"
+ pos="{{ message['handlerTokenPos'] }}">
+ </script-ref> )
+ </div>
+ <template if="{{ !expanded }}">
+ <div class="messageExpander">
+ <icon-expand-more></icon-expand-more>
+ </div>
+ </template>
+ </div>
+ </a>
+
+ <template if="{{expanded}}">
+ <div class="messageDetails">
+ <div class="flex-row">
+ <div class="flex-item-60-percent">
+ <template if="{{ message['handlerFunction'] != null }}">
+ <script-inset height="{{ scriptHeight }}"
+ script="{{ message['handlerFunction'].script }}"
+ startPos="{{ message['handlerFunction'].tokenPos }}"
+ endPos="{{ message['handlerFunction'].endTokenPos }}"
+ inDebuggerContext="{{ true }}">
+ </script-inset>
+ </template>
+ </div>
+ <div class="flex-item-40-percent">
+ <div class="memberItem">
+ <div class="memberName"></div>
+ <div class="memberValue">
+ <eval-link callback="{{ previewMessage }}" label="[preview]" result="{{ preview }}"></eval-link>
+ </div>
+ </div>
+ </div>
+ </div>
+ <div class="messageContractor">
+ <template if="{{expanded}}">
+ <a on-click="{{ toggleExpand }}">
+ <icon-expand-less></icon-expand-less>
+ </a>
+ </template>
+ </div>
+ </div>
+ </template>
+ </div>
+ </template>
+</polymer-element>
+
<polymer-element name="debugger-console" extends="observatory-element">
<template>
<link rel="stylesheet" href="css/shared.css">
diff --git a/runtime/observatory/lib/src/elements/error_view.html b/runtime/observatory/lib/src/elements/error_view.html
index 1c4ea8d..818ba1e 100644
--- a/runtime/observatory/lib/src/elements/error_view.html
+++ b/runtime/observatory/lib/src/elements/error_view.html
@@ -1,19 +1,20 @@
<link rel="import" href="../../../../packages/polymer/polymer.html">
<link rel="import" href="nav_bar.html">
<link rel="import" href="observatory_element.html">
+<link rel="import" href="view_footer.html">
<polymer-element name="error-view" extends="observatory-element">
<template>
<link rel="stylesheet" href="css/shared.css">
<nav-bar>
<top-nav-menu last="{{ true }}"></top-nav-menu>
- <nav-control></nav-control>
</nav-bar>
<div class="content-centered">
<h1>{{ error.kind }}</h1>
<br>
<div class="well">{{ error.message }}</div>
</div>
+ <view-footer></view-footer>
</template>
</polymer-element>
diff --git a/runtime/observatory/lib/src/elements/field_view.html b/runtime/observatory/lib/src/elements/field_view.html
index cad31aa..60c773c 100644
--- a/runtime/observatory/lib/src/elements/field_view.html
+++ b/runtime/observatory/lib/src/elements/field_view.html
@@ -5,12 +5,14 @@
<link rel="import" href="nav_bar.html">
<link rel="import" href="script_ref.html">
<link rel="import" href="observatory_element.html">
+<link rel="import" href="view_footer.html">
<polymer-element name="field-view" extends="observatory-element">
<template>
<link rel="stylesheet" href="css/shared.css">
<nav-bar>
<top-nav-menu></top-nav-menu>
+ <vm-nav-menu vm="{{ field.isolate.vm }}"></vm-nav-menu>
<isolate-nav-menu isolate="{{ field.isolate }}"></isolate-nav-menu>
<library-nav-menu library="{{ field.library }}"></library-nav-menu>
<template if="{{ field.dartOwner is ServiceClass }}">
@@ -18,7 +20,6 @@
</template>
<nav-menu link="{{ makeLink('/inspect', field) }}" anchor="{{ field.name }}" last="{{ true }}"></nav-menu>
<nav-refresh callback="{{ refresh }}"></nav-refresh>
- <nav-control></nav-control>
</nav-bar>
<div class="content">
@@ -82,6 +83,7 @@
</template>
</div>
</div>
+ <view-footer></view-footer>
</template>
</polymer-element>
diff --git a/runtime/observatory/lib/src/elements/flag_list.html b/runtime/observatory/lib/src/elements/flag_list.html
index 94a2bdb..58bd8fe 100644
--- a/runtime/observatory/lib/src/elements/flag_list.html
+++ b/runtime/observatory/lib/src/elements/flag_list.html
@@ -1,6 +1,7 @@
<link rel="import" href="../../../../packages/polymer/polymer.html">
<link rel="import" href="nav_bar.html">
<link rel="import" href="observatory_element.html">
+<link rel="import" href="view_footer.html">
<polymer-element name="flag-list" extends="observatory-element">
<template>
@@ -9,7 +10,6 @@
<top-nav-menu></top-nav-menu>
<nav-menu link="{{ makeLink('/flags') }}" anchor="flags" last="{{ true }}"></nav-menu>
<nav-refresh callback="{{ refresh }}"></nav-refresh>
- <nav-control></nav-control>
</nav-bar>
<div class="content-centered">
@@ -35,7 +35,7 @@
</template>
</template>
</div>
-
+ <view-footer></view-footer>
</template>
</polymer-element>
diff --git a/runtime/observatory/lib/src/elements/function_view.html b/runtime/observatory/lib/src/elements/function_view.html
index 4b75c5c..8f4eab3 100644
--- a/runtime/observatory/lib/src/elements/function_view.html
+++ b/runtime/observatory/lib/src/elements/function_view.html
@@ -7,12 +7,14 @@
<link rel="import" href="nav_bar.html">
<link rel="import" href="script_inset.html">
<link rel="import" href="script_ref.html">
+<link rel="import" href="view_footer.html">
<polymer-element name="function-view" extends="observatory-element">
<template>
<link rel="stylesheet" href="css/shared.css">
<nav-bar>
<top-nav-menu></top-nav-menu>
+ <vm-nav-menu vm="{{ function.isolate.vm }}"></vm-nav-menu>
<isolate-nav-menu isolate="{{ function.isolate }}"></isolate-nav-menu>
<library-nav-menu library="{{ function.library }}"></library-nav-menu>
<template if="{{ function.dartOwner is ServiceClass }}">
@@ -21,7 +23,6 @@
<nav-menu link="{{ makeLink('/inspect', function) }}" anchor="{{ function.name }}" last="{{ true }}"></nav-menu>
<nav-refresh callback="{{ refreshCoverage }}" label="Refresh Coverage"></nav-refresh>
<nav-refresh callback="{{ refresh }}"></nav-refresh>
- <nav-control></nav-control>
</nav-bar>
<div class="content">
@@ -101,7 +102,7 @@
endPos="{{ function.endTokenPos }}">
</script-inset>
- <br>
+ <view-footer></view-footer>
</template>
</polymer-element>
diff --git a/runtime/observatory/lib/src/elements/general_error.html b/runtime/observatory/lib/src/elements/general_error.html
index ac32b03..ef1e004 100644
--- a/runtime/observatory/lib/src/elements/general_error.html
+++ b/runtime/observatory/lib/src/elements/general_error.html
@@ -7,7 +7,6 @@
<link rel="stylesheet" href="css/shared.css">
<nav-bar>
<top-nav-menu last="{{ true }}"></top-nav-menu>
- <nav-control></nav-control>
</nav-bar>
<div class="content-centered">
<h1>Error</h1>
diff --git a/runtime/observatory/lib/src/elements/heap_map.dart b/runtime/observatory/lib/src/elements/heap_map.dart
index 05ed60a..fc33a5c 100644
--- a/runtime/observatory/lib/src/elements/heap_map.dart
+++ b/runtime/observatory/lib/src/elements/heap_map.dart
@@ -146,9 +146,9 @@
break;
}
}
- return new ObjectInfo(int.parse(page['object_start']) +
- pageOffset * fragmentation['unit_size_bytes'],
- size * fragmentation['unit_size_bytes']);
+ return new ObjectInfo(int.parse(page['objectStart']) +
+ pageOffset * fragmentation['unitSizeBytes'],
+ size * fragmentation['unitSizeBytes']);
}
void _handleMouseMove(MouseEvent event) {
@@ -163,7 +163,7 @@
isolate.getObjectByAddress(address).then((result) {
if (result is DartError) {
Logger.root.severe(result.message);
- } else {
+ } else if (result.type != 'Sentinel') {
app.locationManager.go(gotoLink('/inspect', result));
}
});
@@ -174,12 +174,12 @@
return;
}
_updateClassList(
- fragmentation['class_list'], fragmentation['free_class_id']);
+ fragmentation['classList'], fragmentation['freeClassId']);
var pages = fragmentation['pages'];
var width = _fragmentationCanvas.parent.client.width;
_pageHeight = _PAGE_SEPARATION_HEIGHT +
- fragmentation['page_size_bytes'] ~/
- fragmentation['unit_size_bytes'] ~/ width;
+ fragmentation['pageSizeBytes'] ~/
+ fragmentation['unitSizeBytes'] ~/ width;
var height = min(_pageHeight * pages.length, _MAX_CANVAS_HEIGHT);
_fragmentationData =
_fragmentationCanvas.context2D.createImageData(width, height);
diff --git a/runtime/observatory/lib/src/elements/heap_map.html b/runtime/observatory/lib/src/elements/heap_map.html
index 66bd845..1fb9aa0 100644
--- a/runtime/observatory/lib/src/elements/heap_map.html
+++ b/runtime/observatory/lib/src/elements/heap_map.html
@@ -2,6 +2,7 @@
<link rel="import" href="class_ref.html">
<link rel="import" href="observatory_element.html">
<link rel="import" href="nav_bar.html">
+<link rel="import" href="view_footer.html">
<polymer-element name="heap-map" extends="observatory-element">
<template>
@@ -21,10 +22,10 @@
</style>
<nav-bar pad="{{ false }}">
<top-nav-menu></top-nav-menu>
+ <vm-nav-menu vm="{{ fragmentation.isolate.vm }}"></vm-nav-menu>
<isolate-nav-menu isolate="{{ fragmentation.isolate }}"></isolate-nav-menu>
<nav-menu link="{{ makeLink('/heap-map', fragmentation.isolate) }}" anchor="heap map" last="{{ true }}"></nav-menu>
<nav-refresh callback="{{ refresh }}"></nav-refresh>
- <nav-control></nav-control>
</nav-bar>
<div class="hover">
<p style="text-align:center">{{ status }}</p>
@@ -35,6 +36,7 @@
<div class="flex-row">
<canvas id="fragmentation" width="1px" height="1px"></canvas>
</div>
+ <view-footer></view-footer>
</template>
</polymer-element>
diff --git a/runtime/observatory/lib/src/elements/heap_profile.dart b/runtime/observatory/lib/src/elements/heap_profile.dart
index d826a48..bac6ba7 100644
--- a/runtime/observatory/lib/src/elements/heap_profile.dart
+++ b/runtime/observatory/lib/src/elements/heap_profile.dart
@@ -284,14 +284,14 @@
profile = null;
return;
}
- isolate.invokeRpc('getAllocationProfile', {}).then(_update);
+ isolate.invokeRpc('_getAllocationProfile', {}).then(_update);
}
void refresh(var done) {
if (isolate == null) {
return;
}
- isolate.invokeRpc('getAllocationProfile', {})
+ isolate.invokeRpc('_getAllocationProfile', {})
.then(_update).whenComplete(done);
}
@@ -299,7 +299,7 @@
if (isolate == null) {
return;
}
- isolate.invokeRpc('getAllocationProfile', { 'gc': 'full' })
+ isolate.invokeRpc('_getAllocationProfile', { 'gc': 'full' })
.then(_update).whenComplete(done);
}
@@ -307,7 +307,7 @@
if (isolate == null) {
return;
}
- isolate.invokeRpc('getAllocationProfile', { 'reset': 'true' })
+ isolate.invokeRpc('_getAllocationProfile', { 'reset': 'true' })
.then(_update).whenComplete(done);
}
diff --git a/runtime/observatory/lib/src/elements/heap_profile.html b/runtime/observatory/lib/src/elements/heap_profile.html
index 3d0bfec..6cece87 100644
--- a/runtime/observatory/lib/src/elements/heap_profile.html
+++ b/runtime/observatory/lib/src/elements/heap_profile.html
@@ -2,6 +2,7 @@
<link rel="import" href="class_ref.html">
<link rel="import" href="observatory_element.html">
<link rel="import" href="nav_bar.html">
+<link rel="import" href="view_footer.html">
<polymer-element name="heap-profile" extends="observatory-element">
<template>
@@ -52,6 +53,7 @@
</style>
<nav-bar>
<top-nav-menu></top-nav-menu>
+ <vm-nav-menu vm="{{ profile.isolate.vm }}"></vm-nav-menu>
<isolate-nav-menu isolate="{{ profile.isolate }}"></isolate-nav-menu>
<nav-menu link="{{ makeLink('/allocation-profiler', profile.isolate) }}" anchor="allocation profile" last="{{ true }}"></nav-menu>
<nav-refresh callback="{{ resetAccumulator }}" label="Reset Accumulator"></nav-refresh>
@@ -60,7 +62,6 @@
<div class="nav-option">
<input type="checkbox" checked="{{ autoRefresh }}">Auto-refresh on GC
</div>
- <nav-control></nav-control>
</nav-bar>
<div class="content">
<h1>Allocation Profile</h1>
@@ -177,8 +178,7 @@
<tbody id="classTableBody">
</tbody>
</table>
- <br><br><br>
- <br><br><br>
+ <view-footer></view-footer>
</div>
</template>
</polymer-element>
diff --git a/runtime/observatory/lib/src/elements/instance_view.html b/runtime/observatory/lib/src/elements/instance_view.html
index 91fa806..be1d289 100644
--- a/runtime/observatory/lib/src/elements/instance_view.html
+++ b/runtime/observatory/lib/src/elements/instance_view.html
@@ -11,18 +11,19 @@
<link rel="import" href="nav_bar.html">
<link rel="import" href="object_common.html">
<link rel="import" href="context_ref.html">
+<link rel="import" href="view_footer.html">
<polymer-element name="instance-view" extends="observatory-element">
<template>
<link rel="stylesheet" href="css/shared.css">
<nav-bar>
<top-nav-menu></top-nav-menu>
+ <vm-nav-menu vm="{{ instance.isolate.vm }}"></vm-nav-menu>
<isolate-nav-menu isolate="{{ instance.isolate }}"></isolate-nav-menu>
<!-- TODO(turnidge): Add library nav menu here. -->
<class-nav-menu cls="{{ instance.clazz }}"></class-nav-menu>
<nav-menu link="." anchor="instance" last="{{ true }}"></nav-menu>
<nav-refresh callback="{{ refresh }}"></nav-refresh>
- <nav-control></nav-control>
</nav-bar>
<template if="{{ instance.isError }}">
@@ -151,7 +152,7 @@
<field-ref ref="{{ field['decl'] }}"></field-ref>
</div>
<div class="memberValue">
- <any-service-ref ref="{{ field.value }}"></any-service-ref>
+ <any-service-ref ref="{{ field['value'] }}"></any-service-ref>
</div>
</div>
</template>
@@ -181,11 +182,8 @@
<div class="content">
<eval-box callback="{{ eval }}"></eval-box>
</div>
-
- <br><br><br><br>
- <br><br><br><br>
-
</template>
+ <view-footer></view-footer>
</template>
</polymer-element>
diff --git a/runtime/observatory/lib/src/elements/io_view.html b/runtime/observatory/lib/src/elements/io_view.html
index a63f010..fcc8399 100644
--- a/runtime/observatory/lib/src/elements/io_view.html
+++ b/runtime/observatory/lib/src/elements/io_view.html
@@ -10,7 +10,6 @@
<nav-bar>
<top-nav-menu last="{{ true }}"></top-nav-menu>
<nav-refresh callback="{{ refresh }}"></nav-refresh>
- <nav-control></nav-control>
</nav-bar>
<div class="content">
diff --git a/runtime/observatory/lib/src/elements/isolate_reconnect.dart b/runtime/observatory/lib/src/elements/isolate_reconnect.dart
new file mode 100644
index 0000000..3de1078
--- /dev/null
+++ b/runtime/observatory/lib/src/elements/isolate_reconnect.dart
@@ -0,0 +1,30 @@
+// Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+library isolate_reconnect_element;
+
+import 'dart:html';
+import 'package:polymer/polymer.dart';
+import 'observatory_element.dart';
+import 'package:observatory/app.dart';
+import 'package:observatory/service_html.dart';
+
+@CustomTag('isolate-reconnect')
+class IsolateReconnectElement extends ObservatoryElement {
+ IsolateReconnectElement.created() : super.created();
+
+ get missingIsolateId {
+ return app.locationManager.uri.queryParameters['originalIsolateId'];
+ }
+
+ linkToContinueIn(isolate) {
+ var parameters = new Map.from(app.locationManager.uri.queryParameters);
+ parameters['isolateId'] = isolate.id;
+ parameters.remove('originalIsolateId');
+ var path = parameters.remove('originalPath');
+ path = "/$path";
+ var generatedUri = new Uri(path: path, queryParameters: parameters);
+ return app.locationManager.makeLink(generatedUri.toString());
+ }
+}
diff --git a/runtime/observatory/lib/src/elements/isolate_reconnect.html b/runtime/observatory/lib/src/elements/isolate_reconnect.html
new file mode 100644
index 0000000..9674038
--- /dev/null
+++ b/runtime/observatory/lib/src/elements/isolate_reconnect.html
@@ -0,0 +1,34 @@
+<link rel="import" href="../../../../packages/polymer/polymer.html">
+<link rel="import" href="nav_bar.html">
+<link rel="import" href="observatory_element.html">
+
+<polymer-element name="isolate-reconnect" extends="observatory-element">
+ <template>
+ <link rel="stylesheet" href="css/shared.css">
+ <style>
+ .doubleSpaced {
+ line-height: 2em;
+ }
+ </style>
+
+ <nav-bar>
+ <top-nav-menu last="{{ true }}"></top-nav-menu>
+ </nav-bar>
+
+ <div class="content-centered">
+ <h1 class="doubleSpaced">Isolate {{ missingIsolateId }} no longer exists</h1>
+ <div class="memberList">
+ <template repeat="{{ i in app.vm.isolates }}">
+ <div class="memberItem doubleSpaced">
+ Continue in <a _href="{{ linkToContinueIn(i) }}">{{ i.id }} ({{ i.name }})</a>
+ </div>
+ </template>
+ <div class="memberItem doubleSpaced">
+ Go to <a _href="{{ gotoLink('/vm') }}">isolates summary</a>
+ </div>
+ </div>
+ </div>
+ </template>
+</polymer-element>
+
+<script type="application/dart" src="isolate_reconnect.dart"></script>
diff --git a/runtime/observatory/lib/src/elements/isolate_summary.html b/runtime/observatory/lib/src/elements/isolate_summary.html
index 2af908d..054d3f6 100644
--- a/runtime/observatory/lib/src/elements/isolate_summary.html
+++ b/runtime/observatory/lib/src/elements/isolate_summary.html
@@ -164,6 +164,11 @@
</div>
<div class="memberItem">
<div class="memberValue">
+ See <a on-click="{{ goto }}" _href="{{ gotoLink('/profiler-table', isolate) }}">cpu profile (table)</a>
+ </div>
+ </div>
+ <div class="memberItem">
+ <div class="memberValue">
See <a on-click="{{ goto }}" _href="{{ gotoLink('/allocation-profiler', isolate) }}">allocation profile</a>
</div>
</div>
diff --git a/runtime/observatory/lib/src/elements/isolate_view.html b/runtime/observatory/lib/src/elements/isolate_view.html
index 3bd7845..55516c7 100644
--- a/runtime/observatory/lib/src/elements/isolate_view.html
+++ b/runtime/observatory/lib/src/elements/isolate_view.html
@@ -9,6 +9,7 @@
<link rel="import" href="observatory_element.html">
<link rel="import" href="script_inset.html">
<link rel="import" href="script_ref.html">
+<link rel="import" href="view_footer.html">
<polymer-element name="isolate-view" extends="observatory-element">
<template>
@@ -25,11 +26,10 @@
<nav-bar>
<top-nav-menu></top-nav-menu>
- <isolate-nav-menu isolate="{{ isolate }}" last="{{ true }}">
- </isolate-nav-menu>
+ <vm-nav-menu vm="{{ isolate.vm }}"></vm-nav-menu>
+ <isolate-nav-menu isolate="{{ isolate }}" last="{{ true }}"></isolate-nav-menu>
<nav-refresh callback="{{ refreshCoverage }}" label="Refresh Coverage"></nav-refresh>
<nav-refresh callback="{{ refresh }}"></nav-refresh>
- <nav-control></nav-control>
</nav-bar>
<div class="content">
@@ -138,8 +138,7 @@
<div class="content">
<eval-box callback="{{ eval }}"></eval-box>
</div>
- <br><br><br><br>
- <br><br><br><br>
+ <view-footer></view-footer>
</template>
</polymer-element>
diff --git a/runtime/observatory/lib/src/elements/library_view.html b/runtime/observatory/lib/src/elements/library_view.html
index 750e93e..a50b064 100644
--- a/runtime/observatory/lib/src/elements/library_view.html
+++ b/runtime/observatory/lib/src/elements/library_view.html
@@ -9,6 +9,7 @@
<link rel="import" href="library_ref.html">
<link rel="import" href="nav_bar.html">
<link rel="import" href="script_ref.html">
+<link rel="import" href="view_footer.html">
<polymer-element name="library-view" extends="observatory-element">
<template>
@@ -16,11 +17,11 @@
<nav-bar>
<top-nav-menu></top-nav-menu>
+ <vm-nav-menu vm="{{ library.isolate.vm }}"></vm-nav-menu>
<isolate-nav-menu isolate="{{ library.isolate }}"></isolate-nav-menu>
<library-nav-menu library="{{ library }}" last="{{ true }}"></library-nav-menu>
<nav-refresh callback="{{ refreshCoverage }}" label="Refresh Coverage"></nav-refresh>
<nav-refresh callback="{{ refresh }}"></nav-refresh>
- <nav-control></nav-control>
</nav-bar>
<div class="content">
@@ -136,9 +137,8 @@
<div class="content">
<eval-box callback="{{ eval }}"></eval-box>
</div>
- <br><br><br><br>
- <br><br><br><br>
- </template>
+ <view-footer></view-footer>
+ </template>
</polymer-element>
<script type="application/dart" src="library_view.dart"></script>
diff --git a/runtime/observatory/lib/src/elements/metrics.html b/runtime/observatory/lib/src/elements/metrics.html
index 3eb940a..899292a 100644
--- a/runtime/observatory/lib/src/elements/metrics.html
+++ b/runtime/observatory/lib/src/elements/metrics.html
@@ -17,9 +17,12 @@
}
</style>
<nav-bar>
- <top-nav-menu last="{{ true }}"></top-nav-menu>
+ <top-nav-menu></top-nav-menu>
+ <vm-nav-menu vm="{{ isolate.vm }}"></vm-nav-menu>
+ <isolate-nav-menu isolate="{{ isolate }}"></isolate-nav-menu>
+ <nav-menu link="{{ makeLink('/metrics', isolate) }}" anchor="metrics" last="{{ true }}"></nav-menu>
+
<nav-refresh callback="{{ refresh }}"></nav-refresh>
- <nav-control></nav-control>
</nav-bar>
<div class="flex-row">
<div class="flex-item-20-percent">
diff --git a/runtime/observatory/lib/src/elements/nav_bar.dart b/runtime/observatory/lib/src/elements/nav_bar.dart
index 0820eb8..411346f 100644
--- a/runtime/observatory/lib/src/elements/nav_bar.dart
+++ b/runtime/observatory/lib/src/elements/nav_bar.dart
@@ -59,19 +59,6 @@
}
}
-@CustomTag('nav-control')
-class NavControlElement extends ObservatoryElement {
- NavControlElement.created() : super.created();
-
- void forward(Event e, var detail, Element target) {
- app.locationManager.forward();
- }
-
- void back(Event e, var detail, Element target) {
- app.locationManager.back();
- }
-}
-
@CustomTag('top-nav-menu')
class TopNavMenuElement extends ObservatoryElement {
@published bool last = false;
@@ -79,6 +66,14 @@
TopNavMenuElement.created() : super.created();
}
+@CustomTag('vm-nav-menu')
+class VMNavMenuElement extends ObservatoryElement {
+ @published bool last = false;
+ @published VM vm;
+
+ VMNavMenuElement.created() : super.created();
+}
+
@CustomTag('isolate-nav-menu')
class IsolateNavMenuElement extends ObservatoryElement {
@published bool last = false;
@@ -106,7 +101,7 @@
@CustomTag('nav-notify')
class NavNotifyElement extends ObservatoryElement {
@published ObservableList<ServiceEvent> events;
-
+
NavNotifyElement.created() : super.created();
}
@@ -114,7 +109,7 @@
class NavNotifyItemElement extends ObservatoryElement {
@published ObservableList<ServiceEvent> events;
@published ServiceEvent event;
-
+
Future resume(_) {
app.removePauseEvents(event.isolate);
return event.isolate.resume();
diff --git a/runtime/observatory/lib/src/elements/nav_bar.html b/runtime/observatory/lib/src/elements/nav_bar.html
index a1e40fc..218b75d 100644
--- a/runtime/observatory/lib/src/elements/nav_bar.html
+++ b/runtime/observatory/lib/src/elements/nav_bar.html
@@ -168,34 +168,22 @@
</template>
</polymer-element>
-<polymer-element name="nav-control" extends="observatory-element">
- <template>
- <style>
- .black {
- color: #000;
- }
- li {
- float: right;
- margin: 0;
- }
- button {
- margin: 3px;
- padding: 8px;
- }
- </style>
- <!-- Disable until issues with history in Dartium are fixed
- <li>
- <button class="black" on-click="{{ back }}">◀</button>
- <button class="black" on-click="{{ forward }}">▶</button>
- </li>
- -->
- </template>
-</polymer-element>
-
<polymer-element name="top-nav-menu">
<template>
<nav-menu link="/vm" anchor="Observatory" last="{{ last }}">
- <nav-menu-item link="/vm-connect/" anchor="Connect to a different VM"></nav-menu-item>
+ <nav-menu-item link="/vm-connect" anchor="Connect to a different VM"></nav-menu-item>
+ <content></content>
+ </nav-menu>
+ </template>
+</polymer-element>
+
+<polymer-element name="vm-nav-menu">
+ <template>
+ <nav-menu link="/vm" anchor="{{ vm.target.name }}" last="{{ last }}">
+ <template repeat="{{ isolate in vm.isolates }}">
+ <nav-menu-item link="{{ makeLink('/inspect', isolate) }}"
+ anchor="{{ isolate.name }}"></nav-menu-item>
+ </template>
<content></content>
</nav-menu>
</template>
diff --git a/runtime/observatory/lib/src/elements/object_common.html b/runtime/observatory/lib/src/elements/object_common.html
index ea2fb87..63c78a1 100644
--- a/runtime/observatory/lib/src/elements/object_common.html
+++ b/runtime/observatory/lib/src/elements/object_common.html
@@ -21,19 +21,10 @@
</div>
</div>
- <template if="{{ object.size != null }}">
- <div class="memberItem" title="Space for this object in memory">
- <div class="memberName">size</div>
- <div class="memberValue">{{ object.size | formatSize }}</div>
- </div>
- </template>
-
- <template if="{{ object.size == null }}">
- <div class="memberItem" title="Space for this object in memory">
- <div class="memberName">size</div>
- <div class="memberValue">0</div>
- </div>
- </template>
+ <div class="memberItem" title="Space for this object in memory">
+ <div class="memberName">size</div>
+ <div class="memberValue">{{ object.size | formatSize }}</div>
+ </div>
<div class="memberItem" title="Space that would be reclaimed if references to this object were replaced with null">
<div class="memberName">retained size</div>
diff --git a/runtime/observatory/lib/src/elements/object_view.dart b/runtime/observatory/lib/src/elements/object_view.dart
index f0fda05..c4a2696 100644
--- a/runtime/observatory/lib/src/elements/object_view.dart
+++ b/runtime/observatory/lib/src/elements/object_view.dart
@@ -13,4 +13,8 @@
@published ServiceObject object;
ObjectViewElement.created() : super.created();
+
+ void refresh(Function onDone) {
+ object.reload().whenComplete(onDone);
+ }
}
diff --git a/runtime/observatory/lib/src/elements/object_view.html b/runtime/observatory/lib/src/elements/object_view.html
index bec4a53..eff9e49 100644
--- a/runtime/observatory/lib/src/elements/object_view.html
+++ b/runtime/observatory/lib/src/elements/object_view.html
@@ -15,10 +15,10 @@
<link rel="stylesheet" href="css/shared.css">
<nav-bar>
<top-nav-menu></top-nav-menu>
+ <vm-nav-menu vm="{{ object.isolate.vm }}"></vm-nav-menu>
<isolate-nav-menu isolate="{{ object.isolate }}"></isolate-nav-menu>
<nav-menu link="." anchor="object" last="{{ true }}"></nav-menu>
<nav-refresh callback="{{ refresh }}"></nav-refresh>
- <nav-control></nav-control>
</nav-bar>
<div class="content">
@@ -26,6 +26,7 @@
</div>
<hr>
+ <view-footer></view-footer>
</template>
</polymer-element>
diff --git a/runtime/observatory/lib/src/elements/observatory_application.dart b/runtime/observatory/lib/src/elements/observatory_application.dart
index 442f4b0..4acdc65 100644
--- a/runtime/observatory/lib/src/elements/observatory_application.dart
+++ b/runtime/observatory/lib/src/elements/observatory_application.dart
@@ -13,13 +13,13 @@
/// elements.
@CustomTag('observatory-application')
class ObservatoryApplicationElement extends ObservatoryElement {
- @reflectable ObservatoryApplication app;
+ ObservatoryApplication app;
ObservatoryApplicationElement.created() : super.created();
@override
- void attached() {
- super.attached();
+ void domReady() {
+ super.domReady();
app = new ObservatoryApplication(this);
}
}
diff --git a/runtime/observatory/lib/src/elements/observatory_element.dart b/runtime/observatory/lib/src/elements/observatory_element.dart
index da2735e..f516bac 100644
--- a/runtime/observatory/lib/src/elements/observatory_element.dart
+++ b/runtime/observatory/lib/src/elements/observatory_element.dart
@@ -17,7 +17,6 @@
ObservatoryApplication get app => ObservatoryApplication.app;
Page get page => app.currentPage;
- ObservableMap get args => page.args;
@override
void attached() {
@@ -117,6 +116,9 @@
String gotoLink(String url, [ServiceObject obj]) {
return app.locationManager.makeLink(makeLink(url, obj));
}
+ String gotoLinkForwardingParameters(String url, [ServiceObject obj]) {
+ return app.locationManager.makeLinkForwardingParameters(makeLink(url, obj));
+ }
String formatTimePrecise(double time) => Utils.formatTimePrecise(time);
String formatTimeMilliseconds(int millis) =>
diff --git a/runtime/observatory/lib/src/elements/script_inset.dart b/runtime/observatory/lib/src/elements/script_inset.dart
index 1f57b2a..1c158c0 100644
--- a/runtime/observatory/lib/src/elements/script_inset.dart
+++ b/runtime/observatory/lib/src/elements/script_inset.dart
@@ -13,53 +13,59 @@
const nbsp = "\u00A0";
-void addInfoBox(content, infoBox) {
- infoBox.style.position = 'absolute';
- infoBox.style.padding = '1em';
- infoBox.style.border = 'solid black 2px';
- infoBox.style.zIndex = '10';
- infoBox.style.backgroundColor = 'white';
- infoBox.style.cursor = 'auto';
- infoBox.style.display = 'none'; // Initially hidden.
-
+void addInfoBox(Element content, Function infoBoxGenerator) {
+ var infoBox;
var show = false;
+ var originalBackground = content.style.backgroundColor;
+ buildInfoBox() {
+ infoBox = infoBoxGenerator();
+ infoBox.style.position = 'absolute';
+ infoBox.style.padding = '1em';
+ infoBox.style.border = 'solid black 2px';
+ infoBox.style.zIndex = '10';
+ infoBox.style.backgroundColor = 'white';
+ infoBox.style.cursor = 'auto';
+ content.append(infoBox);
+ }
content.onClick.listen((event) {
show = !show;
+ if (infoBox == null) buildInfoBox(); // Created lazily on the first click.
infoBox.style.display = show ? 'block' : 'none';
- content.style.backgroundColor = show ? 'white' : '';
+ content.style.backgroundColor = show ? 'white' : originalBackground;
});
// Causes infoBox to be positioned relative to the bottom-left of content.
content.style.display = 'inline-block';
content.style.cursor = 'pointer';
- content.append(infoBox);
}
-abstract class Annotation {
+abstract class Annotation implements Comparable<Annotation> {
int line;
int columnStart;
int columnStop;
void applyStyleTo(element);
-}
-class CurrentExecutionAnnotation extends Annotation {
- void applyStyleTo(element) {
- if (element == null) {
- return; // TODO(rmacnak): Handling overlapping annotations.
+ int compareTo(Annotation other) {
+ if (line == other.line) {
+ return columnStart.compareTo(other.columnStart);
}
- element.classes.add("currentCol");
- element.title = "Current execution";
+ return line.compareTo(other.line);
}
-}
-class CallSiteAnnotation extends Annotation {
- CallSite callSite;
+ Element table() {
+ var e = new DivElement();
+ e.style.display = "table";
+ e.style.color = "#333";
+ e.style.font = "400 14px 'Montserrat', sans-serif";
+ return e;
+ }
Element row([content]) {
var e = new DivElement();
e.style.display = "table-row";
if (content is String) e.text = content;
+ if (content is Element) e.children.add(content);
return e;
}
@@ -77,32 +83,28 @@
e.ref = object;
return e;
}
+}
- Element entriesTable() {
- var e = new DivElement();
- e.style.display = "table";
- e.style.color = "#333";
- e.style.font = "400 14px 'Montserrat', sans-serif";
-
- if (callSite.entries.isEmpty) {
- e.append(row('Did not execute'));
- } else {
- var r = row();
- r.append(cell("Container"));
- r.append(cell("Count"));
- r.append(cell("Target"));
- e.append(r);
-
- for (var entry in callSite.entries) {
- var r = row();
- r.append(cell(serviceRef(entry.receiverContainer)));
- r.append(cell(entry.count.toString()));
- r.append(cell(serviceRef(entry.target)));
- e.append(r);
- }
+class CurrentExecutionAnnotation extends Annotation {
+ void applyStyleTo(element) {
+ if (element == null) {
+ return; // TODO(rmacnak): Handling overlapping annotations.
}
+ element.classes.add("currentCol");
+ element.title = "Current execution";
+ }
+}
- return e;
+class CallSiteAnnotation extends Annotation {
+ CallSite callSite;
+
+ CallSiteAnnotation(this.callSite) {
+ line = callSite.line;
+ columnStart = callSite.column - 1; // Call site is 1-origin.
+ var tokenLength = callSite.name.length; // Approximate.
+ if (callSite.name.startsWith("get:") ||
+ callSite.name.startsWith("set:")) tokenLength -= 4;
+ columnStop = columnStart + tokenLength;
}
void applyStyleTo(element) {
@@ -112,7 +114,95 @@
element.style.fontWeight = "bold";
element.title = "Call site: ${callSite.name}";
- addInfoBox(element, entriesTable());
+ addInfoBox(element, () {
+ var details = table();
+ if (callSite.entries.isEmpty) {
+ details.append(row('Did not execute'));
+ } else {
+ var r = row();
+ r.append(cell("Container"));
+ r.append(cell("Count"));
+ r.append(cell("Target"));
+ details.append(r);
+
+ for (var entry in callSite.entries) {
+ var r = row();
+ r.append(cell(serviceRef(entry.receiverContainer)));
+ r.append(cell(entry.count.toString()));
+ r.append(cell(serviceRef(entry.target)));
+ details.append(r);
+ }
+ }
+ return details;
+ });
+ }
+}
+
+
+class FunctionDeclarationAnnotation extends Annotation {
+ ServiceFunction function;
+
+ FunctionDeclarationAnnotation(this.function) {
+ assert(function.loaded);
+ var script = function.script;
+ line = script.tokenToLine(function.tokenPos);
+ columnStart = script.tokenToCol(function.tokenPos);
+ if ((line == null) || (columnStart == null)) {
+ line = 0;
+ columnStart = 0;
+ columnStop = 0;
+ } else {
+ columnStart--; // 1-origin -> 0-origin.
+
+ // The method's token position is at the beginning of the method
+ // declaration, which may be a return type annotation, metadata, static
+ // modifier, etc. Try to scan forward to position this annotation on the
+ // function's name instead.
+ var lineSource = script.getLine(line).text;
+ var betterStart = lineSource.indexOf(function.name, columnStart);
+ if (betterStart != -1) {
+ columnStart = betterStart;
+ }
+ columnStop = columnStart + function.name.length;
+ }
+ }
+
+ void applyStyleTo(element) {
+ if (element == null) {
+ return; // TODO(rmacnak): Handling overlapping annotations.
+ }
+ element.style.fontWeight = "bold";
+ element.title = "Function declaration: ${function.name}";
+
+ if (function.isOptimizable == false ||
+ function.isInlinable == false ||
+ function.deoptimizations >0) {
+ element.style.backgroundColor = "red";
+ }
+
+ addInfoBox(element, () {
+ var details = table();
+ var r = row();
+ r.append(cell("Function"));
+ r.append(cell(serviceRef(function)));
+ details.append(r);
+
+ r = row();
+ r.append(cell("Usage Count"));
+ r.append(cell("${function.usageCounter}"));
+ details.append(r);
+
+ if (function.isOptimizable == false) {
+ details.append(row(cell("Unoptimizable!")));
+ }
+ if (function.isInlinable == false) {
+ details.append(row(cell("Not inlinable!")));
+ }
+ if (function.deoptimizations > 0) {
+ details.append(row("Deoptimized ${function.deoptimizations} times!"));
+ }
+ return details;
+ });
}
}
@@ -128,11 +218,12 @@
@published int currentPos;
@published int startPos;
@published int endPos;
+ @published bool inDebuggerContext = false;
- @observable int currentLine;
- @observable int currentCol;
- @observable int startLine;
- @observable int endLine;
+ int _currentLine;
+ int _currentCol;
+ int _startLine;
+ int _endLine;
var annotations = [];
var annotationsCursor;
@@ -144,7 +235,7 @@
}
void _scrollToCurrentPos() {
- var line = querySelector('#${makeLineId(currentLine)}');
+ var line = querySelector('#${makeLineId(_currentLine)}');
if (line != null) {
line.scrollIntoView();
}
@@ -226,45 +317,66 @@
container.children.add(table);
}
+ void loadFunctionsOf(Library lib) {
+ lib.load().then((lib) {
+ for (var func in lib.functions) {
+ func.load();
+ }
+ for (var cls in lib.classes) {
+ cls.load().then((cls) {
+ for (var func in cls.functions) {
+ func.load();
+ }
+ });
+ }
+ });
+ }
+
void computeAnnotations() {
- startLine = (startPos != null
- ? script.tokenToLine(startPos)
- : 1);
- currentLine = (currentPos != null
- ? script.tokenToLine(currentPos)
+ _startLine = (startPos != null
+ ? script.tokenToLine(startPos)
+ : 1 + script.lineOffset);
+ _currentLine = (currentPos != null
+ ? script.tokenToLine(currentPos)
+ : null);
+ _currentCol = (currentPos != null
+ ? (script.tokenToCol(currentPos) - 1) // make this 0-based.
: null);
- currentCol = (currentPos != null
- ? (script.tokenToCol(currentPos) - 1) // make this 0-based.
- : null);
- endLine = (endPos != null
- ? script.tokenToLine(endPos)
- : script.lines.length);
+ _endLine = (endPos != null
+ ? script.tokenToLine(endPos)
+ : script.lines.length + script.lineOffset);
annotations.clear();
- if (currentLine != null) {
+ if (_currentLine != null) {
var a = new CurrentExecutionAnnotation();
- a.line = currentLine;
- a.columnStart = currentCol;
- a.columnStop = currentCol + 1;
+ a.line = _currentLine;
+ a.columnStart = _currentCol;
+ a.columnStop = _currentCol + 1;
annotations.add(a);
}
- for (var callSite in script.callSites) {
- var a = new CallSiteAnnotation();
- a.line = callSite.line;
- a.columnStart = callSite.column - 1; // Call site is 1-origin.
- var tokenLength = callSite.name.length; // Approximate.
- a.columnStop = a.columnStart + tokenLength;
- a.callSite = callSite;
- annotations.add(a);
- }
+ if (!inDebuggerContext) {
+ loadFunctionsOf(script.library);
- annotations.sort((a, b) {
- if (a.line == b.line) {
- return a.columnStart.compareTo(b.columnStart);
+ for (var func in script.library.functions) {
+ if (func.script == script) {
+ annotations.add(new FunctionDeclarationAnnotation(func));
+ }
}
- return a.line.compareTo(b.line);
- });
+ for (var cls in script.library.classes) {
+ for (var func in cls.functions) {
+ if (func.script == script) {
+ annotations.add(new FunctionDeclarationAnnotation(func));
+ }
+ }
+ }
+
+ for (var callSite in script.callSites) {
+ annotations.add(new CallSiteAnnotation(callSite));
+ }
+ }
+
+ annotations.sort();
}
Element linesTable() {
@@ -274,8 +386,9 @@
annotationsCursor = 0;
int blankLineCount = 0;
- for (int i = (startLine - 1); i <= (endLine - 1); i++) {
- if (script.lines[i].isBlank) {
+ for (int i = _startLine; i <= _endLine; i++) {
+ var line = script.getLine(i);
+ if (line.isBlank) {
// Try to introduce elipses if there are 4 or more contiguous
// blank lines.
blankLineCount++;
@@ -286,17 +399,17 @@
if (blankLineCount < 4) {
// Too few blank lines for an elipsis.
for (int j = firstBlank; j <= lastBlank; j++) {
- table.append(lineElement(script.lines[j]));
+ table.append(lineElement(script.getLine(j)));
}
} else {
// Add an elipsis for the skipped region.
- table.append(lineElement(script.lines[firstBlank]));
+ table.append(lineElement(script.getLine(firstBlank)));
table.append(lineElement(null));
- table.append(lineElement(script.lines[lastBlank]));
+ table.append(lineElement(script.getLine(lastBlank)));
}
blankLineCount = 0;
}
- table.append(lineElement(script.lines[i]));
+ table.append(lineElement(line));
}
}
@@ -307,6 +420,16 @@
Annotation nextAnnotationOnLine(int line) {
if (annotationsCursor >= annotations.length) return null;
var annotation = annotations[annotationsCursor];
+
+ // Fast-forward past any annotations before the first line that
+ // we are displaying.
+ while (annotation.line < line) {
+ annotationsCursor++;
+ if (annotationsCursor >= annotations.length) return null;
+ annotation = annotations[annotationsCursor];
+ }
+
+ // Next annotation is for a later line, don't advance past it.
if (annotation.line != line) return null;
annotationsCursor++;
return annotation;
@@ -322,8 +445,59 @@
}
Element lineBreakpointElement(ScriptLine line) {
- BreakpointToggleElement e = new Element.tag("breakpoint-toggle");
- e.line = line;
+ var e = new DivElement();
+ var busy = false;
+ if (line == null || !line.possibleBpt) {
+ e.classes.add("emptyBreakpoint");
+ e.text = nbsp;
+ return e;
+ }
+ e.text = 'B';
+ update() {
+ if (busy) {
+ e.classes.clear();
+ e.classes.add("busyBreakpoint");
+ } else {
+ if (line.breakpoints != null) {
+ if (line.breakpointResolved) {
+ e.classes.clear();
+ e.classes.add("resolvedBreakpoint");
+ } else {
+ e.classes.clear();
+ e.classes.add("unresolvedBreakpoint");
+ }
+ } else {
+ e.classes.clear();
+ e.classes.add("possibleBreakpoint");
+ }
+ }
+ }
+ line.changes.listen((_) => update());
+ e.onClick.listen((event) {
+ if (busy) {
+ return;
+ }
+ busy = true;
+ if (line.breakpoints == null) {
+ // No breakpoint. Add it.
+ line.script.isolate.addBreakpoint(line.script, line.line).then((_) {
+ busy = false;
+ update();
+ });
+ } else {
+ // Existing breakpoint. Remove it.
+ List pending = [];
+ for (var bpt in line.breakpoints) {
+ pending.add(line.script.isolate.removeBreakpoint(bpt));
+ }
+ Future.wait(pending).then((_) {
+ busy = false;
+ update();
+ });
+ }
+ update();
+ });
+ update();
return e;
}
@@ -347,7 +521,7 @@
e.classes.add("sourceItem");
if (line != null) {
- if (line.line == currentLine) {
+ if (line.line == _currentLine) {
e.classes.add("currentLine");
}
@@ -384,33 +558,3 @@
ScriptInsetElement.created() : super.created();
}
-
-@CustomTag('breakpoint-toggle')
-class BreakpointToggleElement extends ObservatoryElement {
- @published ScriptLine line;
- @observable bool busy = false;
-
- void toggleBreakpoint(var a, var b, var c) {
- if (busy) {
- return;
- }
- busy = true;
- if (line.breakpoints == null) {
- // No breakpoint. Add it.
- line.script.isolate.addBreakpoint(line.script, line.line).then((_) {
- busy = false;
- });
- } else {
- // Existing breakpoint. Remove it.
- List pending = [];
- for (var bpt in line.breakpoints) {
- pending.add(line.script.isolate.removeBreakpoint(bpt));
- }
- Future.wait(pending).then((_) {
- busy = false;
- });
- }
- }
-
- BreakpointToggleElement.created() : super.created();
-}
diff --git a/runtime/observatory/lib/src/elements/script_inset.html b/runtime/observatory/lib/src/elements/script_inset.html
index ac7262c..313a84f 100644
--- a/runtime/observatory/lib/src/elements/script_inset.html
+++ b/runtime/observatory/lib/src/elements/script_inset.html
@@ -13,6 +13,7 @@
padding: 10px;
overflow-y: auto;
width: 100%;
+ box-sizing: border-box;
}
.sourceRow {
display: table-row;
@@ -39,18 +40,12 @@
color: #a8a8a8;
}
.hitsNotExecuted {
- background-color: #e66;
+ background-color: #EEA7A7;
}
.hitsExecuted {
- background-color: #6d6;
+ background-color: #9BDD9B;
}
- </style>
- </template>
-</polymer-element>
-<polymer-element name="breakpoint-toggle" extends="observatory-element">
- <template>
- <style>
.emptyBreakpoint, .possibleBreakpoint, .busyBreakpoint, .unresolvedBreakpoint, .resolvedBreakpoint {
display: table-cell;
vertical-align: top;
@@ -80,39 +75,6 @@
background-color: #e66;
}
</style>
-
- <template if="{{ line == null }}">
- <div class="emptyBreakpoint"> </div>
- </template>
-
- <template if="{{ line != null }}">
- <template if="{{ line.possibleBpt && busy}}">
- <div class="busyBreakpoint">B</div>
- </template>
-
- <template if="{{ line.breakpoints == null && !line.possibleBpt }}">
- <div class="emptyBreakpoint"> </div>
- </template>
-
- <template if="{{ line.breakpoints == null && line.possibleBpt && !busy}}">
- <div class="possibleBreakpoint">
- <a on-click="{{ toggleBreakpoint }}">B</a>
- </div>
- </template>
-
- <template if="{{ line.breakpoints != null && !line.breakpointResolved && !busy}}">
- <div class="unresolvedBreakpoint">
- <a on-click="{{ toggleBreakpoint }}">B</a>
- </div>
- </template>
-
- <template if="{{ line.breakpoints != null && line.breakpointResolved && !busy}}">
- <div class="resolvedBreakpoint">
- <a on-click="{{ toggleBreakpoint }}">B</a>
- </div>
- </template>
- </template> <!-- line != null -->
-
</template>
</polymer-element>
diff --git a/runtime/observatory/lib/src/elements/script_ref.dart b/runtime/observatory/lib/src/elements/script_ref.dart
index 2f30e26..1058e32 100644
--- a/runtime/observatory/lib/src/elements/script_ref.dart
+++ b/runtime/observatory/lib/src/elements/script_ref.dart
@@ -10,7 +10,7 @@
@CustomTag('script-ref')
class ScriptRefElement extends ServiceRefElement {
- @published int pos = -1;
+ @published int pos;
String get hoverText {
if (ref == null) {
@@ -34,7 +34,7 @@
if (ref == null) {
return super.name;
}
- if (pos >= 0) {
+ if ((pos != null) && (pos >= 0)) {
if (ref.loaded) {
// Script is loaded, get the line number.
Script script = ref;
@@ -51,7 +51,7 @@
if (ref == null) {
return super.url;
}
- if (pos >= 0) {
+ if ((pos != null) && (pos >= 0)) {
if (ref.loaded) {
return '${super.url}---pos=${pos}';
} else {
diff --git a/runtime/observatory/lib/src/elements/script_view.html b/runtime/observatory/lib/src/elements/script_view.html
index 13802d3..a4aa02d 100644
--- a/runtime/observatory/lib/src/elements/script_view.html
+++ b/runtime/observatory/lib/src/elements/script_view.html
@@ -2,34 +2,35 @@
<link rel="import" href="nav_bar.html">
<link rel="import" href="observatory_element.html">
<link rel="import" href="script_inset.html">
+<link rel="import" href="view_footer.html">
<polymer-element name="script-view" extends="observatory-element">
<template>
<link rel="stylesheet" href="css/shared.css">
<nav-bar>
<top-nav-menu></top-nav-menu>
- <isolate-nav-menu isolate="{{ script.isolate }}">
- </isolate-nav-menu>
+ <vm-nav-menu vm="{{ script.isolate.vm }}"></vm-nav-menu>
+ <isolate-nav-menu isolate="{{ script.isolate }}"></isolate-nav-menu>
<library-nav-menu library="{{ script.library }}"></library-nav-menu>
<nav-menu link="{{ makeLink('/inspect', script) }}" anchor="{{ script.name }}" last="{{ true }}"></nav-menu>
<nav-refresh callback="{{ refreshCoverage }}" label="Refresh Coverage"></nav-refresh>
<nav-refresh callback="{{ refresh }}"></nav-refresh>
- <nav-control></nav-control>
</nav-bar>
- <template if="{{ args['pos'] == null }}">
+ <template if="{{ app.locationManager.internalArguments['pos'] == null }}">
<script-inset id="scriptInset" script="{{ script }}">
<h1>script {{ script.name }}</h1>
</script-inset>
</template>
- <template if="{{ args['pos'] != null }}">
+ <template if="{{ app.locationManager.internalArguments['pos'] != null }}">
<script-inset id="scriptInset" script="{{ script }}"
- currentPos="{{ args['pos'] | parseInt }}">
+ currentPos="{{ app.locationManager.internalArguments['pos'] | parseInt }}">
<h1>script {{ script.name }}</h1>
</script-inset>
</template>
+ <view-footer></view-footer>
</template>
</polymer-element>
diff --git a/runtime/observatory/lib/src/elements/service_error_view.html b/runtime/observatory/lib/src/elements/service_error_view.html
index b074d5a..092051b 100644
--- a/runtime/observatory/lib/src/elements/service_error_view.html
+++ b/runtime/observatory/lib/src/elements/service_error_view.html
@@ -1,20 +1,21 @@
<link rel="import" href="../../../../packages/polymer/polymer.html">
<link rel="import" href="nav_bar.html">
<link rel="import" href="observatory_element.html">
+<link rel="import" href="view_footer.html">
<polymer-element name="service-error-view" extends="observatory-element">
<template>
<link rel="stylesheet" href="css/shared.css">
<nav-bar>
<top-nav-menu last="{{ true }}"></top-nav-menu>
- <nav-control></nav-control>
</nav-bar>
<div class="content-centered">
<h1>{{ error.kind }}</h1>
<br>
<div class="well">{{ error.message }}</div>
</div>
+ <view-footer></view-footer>
</template>
</polymer-element>
-<script type="application/dart" src="service_error_view.dart"></script>
\ No newline at end of file
+<script type="application/dart" src="service_error_view.dart"></script>
diff --git a/runtime/observatory/lib/src/elements/service_exception_view.html b/runtime/observatory/lib/src/elements/service_exception_view.html
index d758e13..f52e3a1 100644
--- a/runtime/observatory/lib/src/elements/service_exception_view.html
+++ b/runtime/observatory/lib/src/elements/service_exception_view.html
@@ -7,7 +7,6 @@
<link rel="stylesheet" href="css/shared.css">
<nav-bar>
<top-nav-menu last="{{ true }}"></top-nav-menu>
- <nav-control></nav-control>
</nav-bar>
<div class="content-centered">
<h1>{{ exception.kind }}</h1>
diff --git a/runtime/observatory/lib/src/elements/service_view.html b/runtime/observatory/lib/src/elements/service_view.html
index b3254c0..2c4213b 100644
--- a/runtime/observatory/lib/src/elements/service_view.html
+++ b/runtime/observatory/lib/src/elements/service_view.html
@@ -13,6 +13,7 @@
<link rel="import" href="observatory_element.html">
<link rel="import" href="script_view.html">
<link rel="import" href="vm_view.html">
+<link rel="import" href="view_footer.html">
<polymer-element name="service-view" extends="observatory-element">
<!-- This element explicitly manages the child elements to avoid setting
an observable property on the old element to an invalid type. -->
diff --git a/runtime/observatory/lib/src/elements/view_footer.dart b/runtime/observatory/lib/src/elements/view_footer.dart
new file mode 100644
index 0000000..a182511
--- /dev/null
+++ b/runtime/observatory/lib/src/elements/view_footer.dart
@@ -0,0 +1,13 @@
+// Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+library view_footer_element;
+
+import 'package:polymer/polymer.dart';
+import 'observatory_element.dart';
+
+@CustomTag('view-footer')
+class ViewFooterElement extends ObservatoryElement {
+ ViewFooterElement.created() : super.created();
+}
diff --git a/runtime/observatory/lib/src/elements/view_footer.html b/runtime/observatory/lib/src/elements/view_footer.html
new file mode 100644
index 0000000..f5816d5
--- /dev/null
+++ b/runtime/observatory/lib/src/elements/view_footer.html
@@ -0,0 +1,21 @@
+<link rel="import" href="../../../../packages/polymer/polymer.html">
+<link rel="import" href="observatory_element.html">
+
+<polymer-element name="view-footer" extends="observatory-element">
+ <template><link rel="stylesheet" href="css/shared.css">
+ <br><br><br><br>
+ <br><br><br><br>
+ <p align="right">
+ <a href="https://www.dartlang.org/tools/observatory/">
+ View documentation
+ </a>
+ </p>
+ <p align="right">
+ <a href="https://code.google.com/p/dart/issues/entry?template=Observatory">
+ File a bug report
+ </a>
+ </p>
+ </template>
+</polymer-element>
+
+<script type="application/dart" src="view_footer.dart"></script>
diff --git a/runtime/observatory/lib/src/elements/vm_connect.dart b/runtime/observatory/lib/src/elements/vm_connect.dart
index 7323d68..e9b8f55 100644
--- a/runtime/observatory/lib/src/elements/vm_connect.dart
+++ b/runtime/observatory/lib/src/elements/vm_connect.dart
@@ -4,11 +4,14 @@
library vm_connect_element;
+import 'dart:convert';
import 'dart:html';
-import 'package:polymer/polymer.dart';
+
import 'observatory_element.dart';
import 'package:observatory/app.dart';
+import 'package:observatory/elements.dart';
import 'package:observatory/service_html.dart';
+import 'package:polymer/polymer.dart';
void _connectToVM(ObservatoryApplication app, WebSocketVMTarget target) {
app.vm = new WebSocketVM(target);
@@ -20,13 +23,6 @@
VMConnectTargetElement.created() : super.created();
- bool get isChromeTarget {
- if (target == null) {
- return false;
- }
- return target.chrome;
- }
-
bool get isCurrentTarget {
if (app.vm == null) {
return false;
@@ -58,21 +54,20 @@
@CustomTag('vm-connect')
class VMConnectElement extends ObservatoryElement {
@published String standaloneVmAddress = '';
- @published String chromiumAddress = 'localhost:9222';
- @observable ObservableList<WebSocketVMTarget> chromeTargets =
- new ObservableList<WebSocketVMTarget>();
VMConnectElement.created() : super.created() {
- pollPeriod = new Duration(seconds: 1);
}
void _connect(WebSocketVMTarget target) {
_connectToVM(app, target);
- app.locationManager.go('#/vm');
+ app.locationManager.goForwardingParameters('/vm');
}
- void onPoll() {
- _refreshTabs();
+ @override
+ void attached() {
+ super.attached();
+ var fileInput = shadowRoot.querySelector('#crashDumpFile');
+ fileInput.onChange.listen(_onCrashDumpFileChange);
}
String _normalizeStandaloneAddress(String networkAddress) {
@@ -85,33 +80,24 @@
void connectStandalone(Event e, var detail, Node target) {
// Prevent any form action.
e.preventDefault();
+ if (standaloneVmAddress == null) {
+ return;
+ }
+ if (standaloneVmAddress.isEmpty) {
+ return;
+ }
var targetAddress = _normalizeStandaloneAddress(standaloneVmAddress);
var target = app.targets.findOrMake(targetAddress);
_connect(target);
}
- void getTabs(Event e, var detail, Node target) {
- // Prevent any form action.
- e.preventDefault();
- _refreshTabs();
- }
-
- void _refreshTabs() {
- ChromiumTargetLister.fetch(chromiumAddress).then((targets) {
- chromeTargets.clear();
- if (targets == null) {
- return;
- }
- for (var i = 0; i < targets.length; i++) {
- if (targets[i].networkAddress == null) {
- // Don't add targets that don't have a network address.
- // This happens when a tab has devtools open!
- continue;
- }
- chromeTargets.add(targets[i]);
- }
- }).catchError((e) {
- chromeTargets.clear();
+ _onCrashDumpFileChange(e) {
+ var fileInput = shadowRoot.querySelector('#crashDumpFile');
+ var reader = new FileReader();
+ reader.readAsText(fileInput.files[0]);
+ reader.onLoad.listen((_) {
+ var crashDump = JSON.decode(reader.result);
+ app.loadCrashDump(crashDump);
});
}
}
diff --git a/runtime/observatory/lib/src/elements/vm_connect.html b/runtime/observatory/lib/src/elements/vm_connect.html
index 03adb8a..0bae096 100644
--- a/runtime/observatory/lib/src/elements/vm_connect.html
+++ b/runtime/observatory/lib/src/elements/vm_connect.html
@@ -1,6 +1,7 @@
<link rel="import" href="../../../../packages/polymer/polymer.html">
<link rel="import" href="nav_bar.html">
<link rel="import" href="observatory_element.html">
+<link rel="import" href="view_footer.html">
<polymer-element name="vm-connect-target" extends="observatory-element">
<template>
@@ -17,14 +18,12 @@
<link rel="stylesheet" href="css/shared.css">
<span>
<template if="{{ isCurrentTarget }}">
- <a on-click="{{ connectToVm }}" _href="{{ gotoLink('/vm') }}">{{ target.name }} (Connected)</a>
+ <a on-click="{{ connectToVm }}" _href="{{ gotoLinkForwardingParameters('/vm') }}">{{ target.name }} (Connected)</a>
</template>
<template if="{{ !isCurrentTarget }}">
- <a on-click="{{ connectToVm }}" _href="{{ gotoLink('/vm') }}">{{ target.name }}</a>
+ <a on-click="{{ connectToVm }}" _href="{{ gotoLinkForwardingParameters('/vm') }}">{{ target.name }}</a>
</template>
- <template if="{{ !isChromeTarget }}">
- <button class="delete-button" on-click="{{ deleteVm }}">✖ Remove</button>
- </template>
+ <button class="delete-button" on-click="{{ deleteVm }}">✖ Remove</button>
</span>
</template>
</polymer-element>
@@ -41,7 +40,6 @@
<nav-bar>
<top-nav-menu last="{{ true }}"></top-nav-menu>
- <nav-control></nav-control>
</nav-bar>
<div class="content-centered">
@@ -50,7 +48,7 @@
<hr>
<div class="flex-row">
<div class="flex-item-40-percent">
- <h2><img style="height: 48px" src="img/dart_icon.png">Standalone</h2>
+ <h2>WebSocket</h2>
<br>
<ul>
<template repeat="{{ target in app.targets.history }}">
@@ -71,25 +69,18 @@
<div class="flex-item-20-percent"></div>
<div class="flex-item-40-percent">
- <h2><img style="height: 48px" src="img/chromium_icon.png">Chromium</h2>
+ <h2>Crash dump</h2>
<br>
- <ul>
- <template repeat="{{ target in chromeTargets }}">
- <li><vm-connect-target target="{{ target }}"></vm-connect-target></li>
- </template>
- </ul>
- <hr>
- <form autocomplete="on">
- <input class="textbox" placeholder="localhost:9222" type="text" value="{{ chromiumAddress }}">
- <input class="button" type="submit" value="Get Tabs" on-click="{{ getTabs }}">
- </form>
+ <input type="file" id="crashDumpFile">
<br>
- <pre class="well">Run Chromium with:
-'--remote-debugging-port=9222'</pre>
+ <br>
+ <pre class="well">Request a crash dump with:
+'curl localhost:8181/_getCrashDump > dump.json'</pre>
<hr>
</div>
</div>
</div>
+ <view-footer></view-footer>
</template>
</polymer-element>
diff --git a/runtime/observatory/lib/src/elements/vm_view.html b/runtime/observatory/lib/src/elements/vm_view.html
index f1485d8..3ea8909 100644
--- a/runtime/observatory/lib/src/elements/vm_view.html
+++ b/runtime/observatory/lib/src/elements/vm_view.html
@@ -7,15 +7,16 @@
<link rel="import" href="nav_bar.html">
<link rel="import" href="observatory_element.html">
<link rel="import" href="script_ref.html">
+<link rel="import" href="view_footer.html">
<polymer-element name="vm-view" extends="observatory-element">
<template>
<link rel="stylesheet" href="css/shared.css">
<nav-bar>
- <top-nav-menu last="{{ true }}"></top-nav-menu>
+ <top-nav-menu last="{{ false }}"></top-nav-menu>
+ <vm-nav-menu vm="{{ vm }}" last="{{ true }}"></vm-nav-menu>
<nav-refresh callback="{{ refresh }}"></nav-refresh>
- <nav-control></nav-control>
</nav-bar>
<div class="content">
@@ -57,10 +58,8 @@
</div>
</div>
</div>
-
<br>
<hr>
-
<ul class="list-group">
<template repeat="{{ isolate in vm.isolates }}">
<li class="list-group-item">
@@ -69,6 +68,7 @@
<hr>
</template>
</ul>
+ <view-footer></view-footer>
</template>
</polymer-element>
diff --git a/runtime/observatory/lib/src/service/object.dart b/runtime/observatory/lib/src/service/object.dart
index cc233f9..44d7d65 100644
--- a/runtime/observatory/lib/src/service/object.dart
+++ b/runtime/observatory/lib/src/service/object.dart
@@ -79,6 +79,7 @@
bool get isNull => type == 'null';
bool get isSentinel => type == 'Sentinel';
bool get isString => type == 'String';
+ bool get isMessage => type == 'Message';
// Kinds of Instance.
bool get isMirrorReference => vmType == 'MirrorReference';
@@ -369,17 +370,11 @@
final StreamController<ServiceEvent> events =
new StreamController.broadcast();
- void postServiceEvent(String response, ByteData data) {
- var map;
- try {
- map = _parseJSON(response);
- assert(!map.containsKey('_data'));
- if (data != null) {
- map['_data'] = data;
- }
- } catch (_) {
- Logger.root.severe('Ignoring malformed event response: ${response}');
- return;
+ void postServiceEvent(Map response, ByteData data) {
+ var map = toObservable(response);
+ assert(!map.containsKey('_data'));
+ if (data != null) {
+ map['_data'] = data;
}
if (map['type'] != 'ServiceEvent') {
Logger.root.severe(
@@ -465,26 +460,6 @@
return new Future.value(_isolateCache[isolateId]);
}
- dynamic _reviver(dynamic key, dynamic value) {
- return value;
- }
-
- ObservableMap _parseJSON(String response) {
- var map;
- try {
- var decoder = new JsonDecoder(_reviver);
- map = decoder.convert(response);
- } catch (e) {
- return toObservable({
- 'type': 'ServiceException',
- 'kind': 'JSONDecodeException',
- 'response': map,
- 'message': 'Could not decode JSON: $e',
- });
- }
- return toObservable(map);
- }
-
Future<ObservableMap> _processMap(ObservableMap map) {
// Verify that the top level response is a service map.
if (!_isServiceMap(map)) {
@@ -493,7 +468,7 @@
'type': 'ServiceException',
'kind': 'ResponseFormatException',
'response': map,
- 'message': 'Top level service responses must be service maps: ${map}.',
+ 'message': "Response is missing the 'type' field.",
})));
}
// Preemptively capture ServiceError and ServiceExceptions.
@@ -507,11 +482,11 @@
}
// Implemented in subclass.
- Future<String> invokeRpcRaw(String method, Map params);
+ Future<Map> invokeRpcRaw(String method, Map params);
Future<ObservableMap> invokeRpcNoUpgrade(String method, Map params) {
- return invokeRpcRaw(method, params).then((String response) {
- var map = _parseJSON(response);
+ return invokeRpcRaw(method, params).then((Map response) {
+ var map = toObservable(response);
if (Tracer.current != null) {
Tracer.current.trace("Received response for ${method}/${params}}",
map:map);
@@ -593,6 +568,77 @@
}
}
+class FakeVM extends VM {
+ final Map _responses = {};
+ FakeVM(Map responses) {
+ if (responses == null) {
+ return;
+ }
+ responses.forEach((uri, response) {
+ // Encode as string.
+ _responses[_canonicalizeUri(Uri.parse(uri))] = response;
+ });
+ }
+
+ String _canonicalizeUri(Uri uri) {
+ // We use the uri as the key to the response map. Uri parameters can be
+ // serialized in any order, this function canonicalizes the uri parameters
+ // so they are serialized in sorted-by-parameter-name order.
+ var method = uri.path;
+ // Create a map sorted on insertion order.
+ var parameters = new Map();
+ // Sort keys.
+ var sortedKeys = uri.queryParameters.keys.toList();
+ sortedKeys.sort();
+ // Filter keys.
+ if (method == 'getStack') {
+ // Remove the 'full' parameter.
+ sortedKeys.remove('full');
+ }
+ // Insert parameters in sorted order.
+ for (var key in sortedKeys) {
+ parameters[key] = uri.queryParameters[key];
+ }
+ // Return canonical uri.
+ return new Uri(path: method, queryParameters: parameters).toString();
+ }
+
+ /// Force the VM to disconnect.
+ void disconnect() {
+ _onDisconnect.complete(this);
+ }
+
+ // Always connected.
+ Future _onConnect;
+ Future get onConnect {
+ if (_onConnect != null) {
+ return _onConnect;
+ }
+ _onConnect = new Future.value(this);
+ return _onConnect;
+ }
+ // Only complete when requested.
+ Completer _onDisconnect = new Completer();
+ Future get onDisconnect => _onDisconnect.future;
+
+ Future<Map> invokeRpcRaw(String method, Map params) {
+ if (params.isEmpty) {
+ params = null;
+ }
+ var key = _canonicalizeUri(new Uri(path: method, queryParameters: params));
+ var response = _responses[key];
+ if (response == null) {
+ return new Future.error({
+ 'type': 'ServiceException',
+ 'kind': 'NotContainedInResponses',
+ 'key': key
+ });
+ }
+ return new Future.value(response);
+ }
+}
+
+
/// Snapshot in time of tag counters.
class TagProfileSnapshot {
final double seconds;
@@ -1182,7 +1228,7 @@
Map params = {
'targetId': target.id,
};
- return invokeRpc('getRetainedSize', params);
+ return invokeRpc('_getRetainedSize', params);
}
Future<ServiceObject> getRetainingPath(ServiceObject target, var limit) {
@@ -1190,7 +1236,7 @@
'targetId': target.id,
'limit': limit.toString(),
};
- return invokeRpc('getRetainingPath', params);
+ return invokeRpc('_getRetainingPath', params);
}
Future<ServiceObject> getInboundReferences(ServiceObject target, var limit) {
@@ -1198,7 +1244,7 @@
'targetId': target.id,
'limit': limit.toString(),
};
- return invokeRpc('getInboundReferences', params);
+ return invokeRpc('_getInboundReferences', params);
}
Future<ServiceObject> getTypeArgumentsList(bool onlyWithInstantiations) {
@@ -1213,7 +1259,7 @@
'classId': cls.id,
'limit': limit.toString(),
};
- return invokeRpc('getInstances', params);
+ return invokeRpc('_getInstances', params);
}
Future<ServiceObject> getObjectByAddress(String address, [bool ref=true]) {
@@ -1295,6 +1341,11 @@
vmName = (_map.containsKey('vmName') ? _map['vmName'] : name);
}
+ // TODO(turnidge): These are temporary until we have a proper root
+ // object for all dart heap objects.
+ int get size => _map['size'];
+ int get clazz => _map['class'];
+
// Forward Map interface calls.
void addAll(Map other) => _map.addAll(other);
void clear() => _map.clear();
@@ -1404,12 +1455,12 @@
static const kBreakpointRemoved = 'BreakpointRemoved';
static const kGraph = '_Graph';
static const kGC = 'GC';
- static const kVMDisconnected = 'VMDisconnected';
+ static const kConnectionClosed = 'ConnectionClosed';
ServiceEvent._empty(ServiceObjectOwner owner) : super._empty(owner);
- ServiceEvent.vmDisconencted() : super._empty(null) {
- eventType = kVMDisconnected;
+ ServiceEvent.connectionClosed(this.reason) : super._empty(null) {
+ eventType = kConnectionClosed;
}
@observable String eventType;
@@ -1418,6 +1469,7 @@
@observable ServiceMap exception;
@observable ByteData data;
@observable int count;
+ @observable String reason;
void _update(ObservableMap map, bool mapIsRef) {
_loaded = true;
@@ -2124,6 +2176,8 @@
@observable String kind;
@observable int firstTokenPos;
@observable int lastTokenPos;
+ @observable int lineOffset;
+ @observable int columnOffset;
@observable Library library;
bool get canCache => true;
bool get immutable => true;
@@ -2135,7 +2189,7 @@
ScriptLine getLine(int line) {
assert(line >= 1);
- return lines[line - 1];
+ return lines[line - lineOffset - 1];
}
/// This function maps a token position to a line number.
@@ -2156,6 +2210,9 @@
if (mapIsRef) {
return;
}
+ _loaded = true;
+ lineOffset = map['lineOffset'];
+ columnOffset = map['columnOffset'];
_parseTokenPosTable(map['tokenPosTable']);
_processSource(map['source']);
library = map['library'];
@@ -2227,8 +2284,6 @@
}
void _processSource(String source) {
- // Preemptyively mark that this is not loaded.
- _loaded = false;
if (source == null) {
return;
}
@@ -2236,12 +2291,10 @@
if (sourceLines.length == 0) {
return;
}
- // We have the source to the script. This is now loaded.
- _loaded = true;
lines.clear();
Logger.root.info('Adding ${sourceLines.length} source lines for ${_url}');
for (var i = 0; i < sourceLines.length; i++) {
- lines.add(new ScriptLine(this, i + 1, sourceLines[i]));
+ lines.add(new ScriptLine(this, i + lineOffset + 1, sourceLines[i]));
}
for (var bpt in isolate.breakpoints.values) {
if (bpt.script == this) {
@@ -2559,7 +2612,7 @@
/// a [ServiceError].
Future<ServiceObject> reload() {
assert(kind != null);
- if (kind == CodeKind.Dart) {
+ if (isDartCode) {
// We only reload Dart code.
return super.reload();
}
@@ -2698,6 +2751,8 @@
@reflectable bool get isDartCode => (kind == CodeKind.Dart) ||
(kind == CodeKind.Stub);
+
+ String toString() => 'Code($kind, $name)';
}
diff --git a/runtime/observatory/observatory_sources.gypi b/runtime/observatory/observatory_sources.gypi
index fadca29..686f2cb 100644
--- a/runtime/observatory/observatory_sources.gypi
+++ b/runtime/observatory/observatory_sources.gypi
@@ -83,6 +83,8 @@
'lib/src/elements/instance_view.html',
'lib/src/elements/io_view.dart',
'lib/src/elements/io_view.html',
+ 'lib/src/elements/isolate_reconnect.dart',
+ 'lib/src/elements/isolate_reconnect.html',
'lib/src/elements/isolate_ref.dart',
'lib/src/elements/isolate_ref.html',
'lib/src/elements/isolate_summary.dart',
@@ -123,6 +125,8 @@
'lib/src/elements/service_view.html',
'lib/src/elements/sliding_checkbox.dart',
'lib/src/elements/sliding_checkbox.html',
+ 'lib/src/elements/view_footer.dart',
+ 'lib/src/elements/view_footer.html',
'lib/src/elements/vm_connect.dart',
'lib/src/elements/vm_connect.html',
'lib/src/elements/vm_ref.dart',
@@ -140,4 +144,4 @@
'web/main.dart',
'web/favicon.ico',
],
-}
\ No newline at end of file
+}
diff --git a/runtime/observatory/tests/service/allocations_test.dart b/runtime/observatory/tests/service/allocations_test.dart
index 4242afc..8f1bd9e 100644
--- a/runtime/observatory/tests/service/allocations_test.dart
+++ b/runtime/observatory/tests/service/allocations_test.dart
@@ -1,7 +1,7 @@
// Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// VMOptions=--compile-all --error_on_bad_type --error_on_bad_override --checked
+// VMOptions=--compile-all --error_on_bad_type --error_on_bad_override
library allocations_test;
diff --git a/runtime/observatory/tests/service/async_generator_breakpoint_test.dart b/runtime/observatory/tests/service/async_generator_breakpoint_test.dart
index 91141fa..dbdd045 100644
--- a/runtime/observatory/tests/service/async_generator_breakpoint_test.dart
+++ b/runtime/observatory/tests/service/async_generator_breakpoint_test.dart
@@ -1,7 +1,7 @@
// Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// VMOptions=--compile-all --error_on_bad_type --error_on_bad_override --checked --verbose-debug
+// VMOptions=--compile-all --error_on_bad_type --error_on_bad_override --verbose-debug
import 'package:observatory/service_io.dart';
import 'package:unittest/unittest.dart';
diff --git a/runtime/observatory/tests/service/bad_web_socket_address_test.dart b/runtime/observatory/tests/service/bad_web_socket_address_test.dart
index 06ba878..fd259b4 100644
--- a/runtime/observatory/tests/service/bad_web_socket_address_test.dart
+++ b/runtime/observatory/tests/service/bad_web_socket_address_test.dart
@@ -1,7 +1,7 @@
// Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// VMOptions=--compile-all --error_on_bad_type --error_on_bad_override --checked
+// VMOptions=--compile-all --error_on_bad_type --error_on_bad_override
import "package:observatory/service_io.dart";
import 'package:unittest/unittest.dart';
diff --git a/runtime/observatory/tests/service/caching_test.dart b/runtime/observatory/tests/service/caching_test.dart
index 68cb158..34ed81f 100644
--- a/runtime/observatory/tests/service/caching_test.dart
+++ b/runtime/observatory/tests/service/caching_test.dart
@@ -1,7 +1,7 @@
// Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// VMOptions=--compile-all --error_on_bad_type --error_on_bad_override --checked
+// VMOptions=--compile-all --error_on_bad_type --error_on_bad_override
// If caching is working properly, the coverage data will go into the same
// Script object from which we requested coverage data, instead of a new
diff --git a/runtime/observatory/tests/service/call_site_data_test.dart b/runtime/observatory/tests/service/call_site_data_test.dart
index 017bf98..d6eea45 100644
--- a/runtime/observatory/tests/service/call_site_data_test.dart
+++ b/runtime/observatory/tests/service/call_site_data_test.dart
@@ -1,7 +1,8 @@
// Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// VMOptions=--compile-all --error_on_bad_type --error_on_bad_override --checked
+// VMOptions=--optimization_filter=doesNotExist
+// ^Force code to be unoptimized so the invocation counts are accurate.
library call_site_data_test;
diff --git a/runtime/observatory/tests/service/classes_test.dart b/runtime/observatory/tests/service/classes_test.dart
deleted file mode 100644
index 9e8e286..0000000
--- a/runtime/observatory/tests/service/classes_test.dart
+++ /dev/null
@@ -1,26 +0,0 @@
-// Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-// VMOptions=--compile-all --error_on_bad_type --error_on_bad_override --checked
-
-import 'package:observatory/service_io.dart';
-import 'package:unittest/unittest.dart';
-import 'test_helper.dart';
-
-var tests = [
-
-(Isolate isolate) =>
- isolate.getClassHierarchy().then((Class o) {
- expect(o.name, equals('Object'));
-}),
-
-(Isolate isolate) =>
- isolate.getObject('classes/62').then((Class c) {
- expect(c.name, equals('_ImmutableList'));
- expect(c.vmCid, equals(62));
-}),
-
-
-];
-
-main(args) => runIsolateTests(args, tests);
diff --git a/runtime/observatory/tests/service/code_test.dart b/runtime/observatory/tests/service/code_test.dart
index b91972c..5090eb5 100644
--- a/runtime/observatory/tests/service/code_test.dart
+++ b/runtime/observatory/tests/service/code_test.dart
@@ -1,7 +1,7 @@
// Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// VMOptions=--compile-all --error_on_bad_type --error_on_bad_override --checked
+// VMOptions=--compile-all --error_on_bad_type --error_on_bad_override
import 'package:observatory/service_io.dart';
import 'package:unittest/unittest.dart';
diff --git a/runtime/observatory/tests/service/command_test.dart b/runtime/observatory/tests/service/command_test.dart
index a52f1a1..8e57723 100644
--- a/runtime/observatory/tests/service/command_test.dart
+++ b/runtime/observatory/tests/service/command_test.dart
@@ -1,7 +1,7 @@
// Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// VMOptions=--compile-all --error_on_bad_type --error_on_bad_override --checked
+// VMOptions=--compile-all --error_on_bad_type --error_on_bad_override
import 'dart:async';
diff --git a/runtime/observatory/tests/service/contexts_test.dart b/runtime/observatory/tests/service/contexts_test.dart
index 7928a74..ffbbb79 100644
--- a/runtime/observatory/tests/service/contexts_test.dart
+++ b/runtime/observatory/tests/service/contexts_test.dart
@@ -1,7 +1,7 @@
// Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// VMOptions=--compile-all --error_on_bad_type --error_on_bad_override --checked
+// VMOptions=--compile-all --error_on_bad_type --error_on_bad_override
library inbound_references_test;
diff --git a/runtime/observatory/tests/service/coverage_test.dart b/runtime/observatory/tests/service/coverage_test.dart
index db9db76..ee70bd0 100644
--- a/runtime/observatory/tests/service/coverage_test.dart
+++ b/runtime/observatory/tests/service/coverage_test.dart
@@ -1,7 +1,7 @@
// Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// VMOptions=--compile-all --error_on_bad_type --error_on_bad_override --checked
+// VMOptions=--compile-all --error_on_bad_type --error_on_bad_override
import 'package:observatory/service_io.dart';
import 'package:unittest/unittest.dart';
diff --git a/runtime/observatory/tests/service/debugging_test.dart b/runtime/observatory/tests/service/debugging_test.dart
index c60b145..a987021 100644
--- a/runtime/observatory/tests/service/debugging_test.dart
+++ b/runtime/observatory/tests/service/debugging_test.dart
@@ -1,30 +1,32 @@
// Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// VMOptions=--compile-all --error_on_bad_type --error_on_bad_override --checked
+// VMOptions=--compile-all --error_on_bad_type --error_on_bad_override
import 'package:observatory/service_io.dart';
import 'package:unittest/unittest.dart';
import 'test_helper.dart';
import 'dart:async';
-void helper(i) {
- print(i);
+int counter = 0;
+
+void periodicTask(_) {
+ counter++;
+ counter++; // Line 15. We set our breakpoint here.
+ counter++;
+ if (counter % 300 == 0) {
+ print('counter = $counter');
+ }
}
-void testFunction() {
- int i = 0;
- while (true) {
- if (++i % 100000000 == 0) {
- helper(i); // line 18
- }
- }
+void startTimer() {
+ new Timer.periodic(const Duration(milliseconds:10), periodicTask);
}
var tests = [
// Pause
-(Isolate isolate) {
+(Isolate isolate) async {
Completer completer = new Completer();
var subscription;
subscription = isolate.vm.events.stream.listen((ServiceEvent event) {
@@ -34,11 +36,11 @@
}
});
isolate.pause();
- return completer.future;
+ await completer.future;
},
// Resume
-(Isolate isolate) {
+(Isolate isolate) async {
Completer completer = new Completer();
var subscription;
subscription = isolate.vm.events.stream.listen((ServiceEvent event) {
@@ -48,49 +50,13 @@
}
});
isolate.resume();
- return completer.future;
+ await completer.future;
},
// Add breakpoint
-(Isolate isolate) {
- return isolate.rootLib.load().then((_) {
- // Set up a listener to wait for breakpoint events.
- Completer completer = new Completer();
- var subscription;
- subscription = isolate.vm.events.stream.listen((ServiceEvent event) {
- if (event.eventType == ServiceEvent.kPauseBreakpoint) {
- print('Breakpoint reached');
- subscription.cancel();
- completer.complete();
- }
- });
+(Isolate isolate) async {
+ await isolate.rootLib.load();
- // Add the breakpoint.
- var script = isolate.rootLib.scripts[0];
- return isolate.addBreakpoint(script, 18).then((result) {
- expect(result is Breakpoint, isTrue);
- Breakpoint bpt = result;
- expect(bpt.type, equals('Breakpoint'));
- expect(bpt.script.id, equals(script.id));
- expect(bpt.tokenPos, equals(58));
- expect(isolate.breakpoints.length, equals(1));
- return completer.future; // Wait for breakpoint events.
- });
- });
-},
-
-// Get the stack trace
-(Isolate isolate) {
- return isolate.getStack().then((ServiceMap stack) {
- expect(stack.type, equals('Stack'));
- expect(stack['frames'].length, greaterThanOrEqualTo(1));
- expect(stack['frames'][0]['function'].name, equals('testFunction'));
- expect(stack['frames'][0]['tokenPos'], equals(58));
- });
-},
-
-// Stepping
-(Isolate isolate) {
// Set up a listener to wait for breakpoint events.
Completer completer = new Completer();
var subscription;
@@ -102,23 +68,62 @@
}
});
- return isolate.stepInto().then((isolate) {
- return completer.future; // Wait for breakpoint events.
- });
+ var script = isolate.rootLib.scripts[0];
+ await script.load();
+
+ // Add the breakpoint.
+ var result = await isolate.addBreakpoint(script, 15);
+ expect(result is Breakpoint, isTrue);
+ Breakpoint bpt = result;
+ expect(bpt.type, equals('Breakpoint'));
+ expect(bpt.script.id, equals(script.id));
+ expect(bpt.script.tokenToLine(bpt.tokenPos), equals(15));
+ expect(isolate.breakpoints.length, equals(1));
+
+ await completer.future; // Wait for breakpoint events.
},
-// Get the stack trace again. Our position has updated.
-(Isolate isolate) {
- return isolate.getStack().then((ServiceMap stack) {
- expect(stack.type, equals('Stack'));
- expect(stack['frames'].length, greaterThanOrEqualTo(2));
- expect(stack['frames'][0]['function'].name, equals('testFunction'));
- expect(stack['frames'][0]['tokenPos'], equals(60));
+// We are at the breakpoint on line 15.
+(Isolate isolate) async {
+ ServiceMap stack = await isolate.getStack();
+ expect(stack.type, equals('Stack'));
+ expect(stack['frames'].length, greaterThanOrEqualTo(1));
+
+ Script script = stack['frames'][0]['script'];
+ expect(script.name,endsWith('debugging_test.dart'));
+ expect(script.tokenToLine(stack['frames'][0]['tokenPos']), equals(15));
+},
+
+// Stepping
+(Isolate isolate) async {
+ // Set up a listener to wait for breakpoint events.
+ Completer completer = new Completer();
+ var subscription;
+ subscription = isolate.vm.events.stream.listen((ServiceEvent event) {
+ if (event.eventType == ServiceEvent.kPauseBreakpoint) {
+ print('Breakpoint reached');
+ subscription.cancel();
+ completer.complete();
+ }
});
+
+ await isolate.stepOver();
+ await completer.future; // Wait for breakpoint events.
+},
+
+// We are now at line 16.
+(Isolate isolate) async {
+ ServiceMap stack = await isolate.getStack();
+ expect(stack.type, equals('Stack'));
+ expect(stack['frames'].length, greaterThanOrEqualTo(1));
+
+ Script script = stack['frames'][0]['script'];
+ expect(script.name,endsWith('debugging_test.dart'));
+ expect(script.tokenToLine(stack['frames'][0]['tokenPos']), equals(16));
},
// Remove breakpoint
-(Isolate isolate) {
+(Isolate isolate) async {
// Set up a listener to wait for breakpoint events.
Completer completer = new Completer();
var subscription;
@@ -133,13 +138,12 @@
expect(isolate.breakpoints.length, equals(1));
var bpt = isolate.breakpoints.values.first;
- return isolate.removeBreakpoint(bpt).then((_) {
- return completer.future;
- });
+ await isolate.removeBreakpoint(bpt);
+ await completer.future;
},
// Resume
-(Isolate isolate) {
+(Isolate isolate) async {
Completer completer = new Completer();
var subscription;
subscription = isolate.vm.events.stream.listen((ServiceEvent event) {
@@ -149,11 +153,11 @@
}
});
isolate.resume();
- return completer.future;
+ await completer.future;
},
// Add breakpoint at function entry
-(Isolate isolate) {
+(Isolate isolate) async {
// Set up a listener to wait for breakpoint events.
Completer completer = new Completer();
var subscription;
@@ -167,21 +171,32 @@
// Find a specific function.
ServiceFunction function = isolate.rootLib.functions.firstWhere(
- (f) => f.name == 'helper');
+ (f) => f.name == 'periodicTask');
expect(function, isNotNull);
// Add the breakpoint at function entry
- return isolate.addBreakpointAtEntry(function).then((result) {
- expect(result is Breakpoint, isTrue);
- Breakpoint bpt = result;
- expect(bpt.type, equals('Breakpoint'));
- expect(bpt.script.name, equals('debugging_test.dart'));
- expect(bpt.tokenPos, equals(29));
- expect(isolate.breakpoints.length, equals(1));
- return completer.future; // Wait for breakpoint events.
- });
+ var result = await isolate.addBreakpointAtEntry(function);
+ expect(result is Breakpoint, isTrue);
+ Breakpoint bpt = result;
+ expect(bpt.type, equals('Breakpoint'));
+ expect(bpt.script.name, equals('debugging_test.dart'));
+ expect(bpt.script.tokenToLine(bpt.tokenPos), equals(14));
+ expect(isolate.breakpoints.length, equals(1));
+
+ await completer.future; // Wait for breakpoint events.
+},
+
+// We are now at line 14.
+(Isolate isolate) async {
+ ServiceMap stack = await isolate.getStack();
+ expect(stack.type, equals('Stack'));
+ expect(stack['frames'].length, greaterThanOrEqualTo(1));
+
+ Script script = stack['frames'][0]['script'];
+ expect(script.name,endsWith('debugging_test.dart'));
+ expect(script.tokenToLine(stack['frames'][0]['tokenPos']), equals(14));
},
];
-main(args) => runIsolateTests(args, tests, testeeConcurrent: testFunction);
+main(args) => runIsolateTests(args, tests, testeeBefore: startTimer);
diff --git a/runtime/observatory/tests/service/dominator_tree_test.dart b/runtime/observatory/tests/service/dominator_tree_test.dart
index 6db7b3c..35bce6a 100644
--- a/runtime/observatory/tests/service/dominator_tree_test.dart
+++ b/runtime/observatory/tests/service/dominator_tree_test.dart
@@ -1,7 +1,7 @@
// Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// VMOptions=--compile-all --error_on_bad_type --error_on_bad_override --checked
+// VMOptions=--compile-all --error_on_bad_type --error_on_bad_override
import 'package:observatory/dominator_tree.dart';
import 'package:unittest/unittest.dart';
@@ -52,4 +52,4 @@
var d = new Dominator();
d.addEdges('A', ['B']);
expect(() => d.computeDominatorTree('B'), throwsStateError);
-}
\ No newline at end of file
+}
diff --git a/runtime/observatory/tests/service/echo_test.dart b/runtime/observatory/tests/service/echo_test.dart
index 1e68a2b..8d31f2f 100644
--- a/runtime/observatory/tests/service/echo_test.dart
+++ b/runtime/observatory/tests/service/echo_test.dart
@@ -1,7 +1,7 @@
// Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// VMOptions=--compile-all --error_on_bad_type --error_on_bad_override --checked
+// VMOptions=--compile-all --error_on_bad_type --error_on_bad_override
import 'dart:async';
import 'package:observatory/service_io.dart';
@@ -39,4 +39,4 @@
];
-main(args) => runIsolateTests(args, tests);
\ No newline at end of file
+main(args) => runIsolateTests(args, tests);
diff --git a/runtime/observatory/tests/service/eval_test.dart b/runtime/observatory/tests/service/eval_test.dart
index 89afdfa..3d4f63c 100644
--- a/runtime/observatory/tests/service/eval_test.dart
+++ b/runtime/observatory/tests/service/eval_test.dart
@@ -1,7 +1,7 @@
// Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// VMOptions=--compile-all --error_on_bad_type --error_on_bad_override --checked
+// VMOptions=--compile-all --error_on_bad_type --error_on_bad_override
import 'package:observatory/service_io.dart';
import 'package:unittest/unittest.dart';
diff --git a/runtime/observatory/tests/service/evaluate_activation_test.dart b/runtime/observatory/tests/service/evaluate_activation_test.dart
new file mode 100644
index 0000000..23d551a
--- /dev/null
+++ b/runtime/observatory/tests/service/evaluate_activation_test.dart
@@ -0,0 +1,265 @@
+// Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+// VMOptions=--compile-all --error_on_bad_type --error_on_bad_override
+
+import 'package:observatory/service_io.dart';
+import 'package:unittest/unittest.dart';
+import 'test_helper.dart';
+
+import 'dart:math' as math;
+
+breakHere() {}
+
+use(dynamic v) => v;
+
+class C {
+ var instVar = 1;
+ static var classVar = 2;
+
+ method(methodParam) {
+ var methodTemp = 4;
+ use(methodTemp);
+ [5].forEach((outerParam) {
+ var outerTemp = 6;
+ use(outerTemp);
+ [7].forEach((innerParam) {
+ var innerTemp = 8;
+ use(innerTemp);
+ breakHere();
+ });
+ });
+ }
+
+ static method2(methodParam) {
+ var methodTemp = 4;
+ use(methodTemp);
+ [5].forEach((outerParam) {
+ var outerTemp = 6;
+ use(outerTemp);
+ [7].forEach((innerParam) {
+ var innerTemp = 8;
+ use(innerTemp);
+ breakHere();
+ });
+ });
+ }
+
+ method3(methodParam) {
+ var methodTemp = 4;
+ use(methodTemp);
+ breakHere();
+ }
+
+ static var closureWithReturnedHome;
+ method4(methodParam) {
+ var methodTemp = 4;
+ use(methodTemp);
+ [5].forEach((outerParam) {
+ var outerTemp = 6;
+ use(outerTemp);
+ closureWithReturnedHome = (innerParam) {
+ var innerTemp = 8;
+ use(innerTemp);
+ breakHere();
+ };
+ });
+ }
+}
+
+testMethod(Isolate isolate) async {
+ // silence analyzer.
+ expect(math.sqrt(4), equals(2));
+ Library rootLib = await isolate.rootLib.load();
+ ServiceFunction function =
+ rootLib.functions.singleWhere((f) => f.name == 'breakHere');
+ Breakpoint bpt = await isolate.addBreakpointAtEntry(function);
+ print("Breakpoint: $bpt");
+ expect(bpt is Breakpoint, isTrue); // I.e, not null.
+
+ bool hitBreakpoint = false;
+ var sub;
+ sub = isolate.vm.events.stream.listen((ServiceEvent event) async {
+ print("Event $event");
+ if (event.eventType == ServiceEvent.kPauseBreakpoint) {
+ var frameNumber = 1, r;
+ r = await isolate.evalFrame(frameNumber, '123'); /// instance: ok
+ expect(r.valueAsString, equals('123')); /// instance: continued
+ r = await isolate.evalFrame(frameNumber, 'this'); /// scope: ok
+ expect(r.clazz.name, equals('C')); /// scope: continued
+ r = await isolate.evalFrame(frameNumber, 'instVar'); /// instance: continued
+ expect(r.valueAsString, equals('1')); /// instance: continued
+ r = await isolate.evalFrame(frameNumber, 'classVar'); /// instance: continued
+ expect(r.valueAsString, equals('2')); /// instance: continued
+ r = await isolate.evalFrame(frameNumber, 'methodParam'); /// scope: continued
+ expect(r.valueAsString, equals('3')); /// scope: continued
+ r = await isolate.evalFrame(frameNumber, 'methodTemp'); /// scope: continued
+ expect(r.valueAsString, equals('4')); /// scope: continued
+ r = await isolate.evalFrame(frameNumber, 'outerParam'); /// scope: continued
+ expect(r.valueAsString, equals('5')); /// scope: continued
+ r = await isolate.evalFrame(frameNumber, 'outerTemp'); /// scope: continued
+ expect(r.valueAsString, equals('6')); /// scope: continued
+ r = await isolate.evalFrame(frameNumber, 'innerParam'); /// instance: continued
+ expect(r.valueAsString, equals('7')); /// instance: continued
+ r = await isolate.evalFrame(frameNumber, 'innerTemp'); /// instance: continued
+ expect(r.valueAsString, equals('8')); /// instance: continued
+ r = await isolate.evalFrame(frameNumber, 'math.sqrt'); /// instance: continued
+ expect(r.isClosure, isTrue); /// instance: continued
+
+ hitBreakpoint = true;
+ sub.cancel(); // Do not handle events for the other tests.
+ isolate.resume();
+ }
+ });
+
+ var result = await isolate.eval(rootLib, 'new C().method(3);');
+ print("Result $result");
+ expect(hitBreakpoint, isTrue);
+}
+
+testMethod2(Isolate isolate) async {
+ Library rootLib = await isolate.rootLib.load();
+ ServiceFunction function =
+ rootLib.functions.singleWhere((f) => f.name == 'breakHere');
+ Breakpoint bpt = await isolate.addBreakpointAtEntry(function);
+ print("Breakpoint: $bpt");
+ expect(bpt is Breakpoint, isTrue); // I.e, not null.
+
+ bool hitBreakpoint = false;
+ var sub;
+ sub = isolate.vm.events.stream.listen((ServiceEvent event) async {
+ print("Event $event");
+ if (event.eventType == ServiceEvent.kPauseBreakpoint) {
+ var frameNumber = 1, r;
+ r = await isolate.evalFrame(frameNumber, '123');
+ expect(r.valueAsString, equals('123'));
+ r = await isolate.evalFrame(frameNumber, 'this');
+ expect(r is DartError, isTrue);
+ r = await isolate.evalFrame(frameNumber, 'instVar');
+ expect(r is DartError, isTrue);
+ r = await isolate.evalFrame(frameNumber, 'classVar');
+ expect(r.valueAsString, equals('2'));
+ r = await isolate.evalFrame(frameNumber, 'methodParam');
+ expect(r.valueAsString, equals('3')); /// scope: continued
+ r = await isolate.evalFrame(frameNumber, 'methodTemp');
+ expect(r.valueAsString, equals('4')); /// scope: continued
+ r = await isolate.evalFrame(frameNumber, 'outerParam');
+ expect(r.valueAsString, equals('5')); /// scope: continued
+ r = await isolate.evalFrame(frameNumber, 'outerTemp');
+ expect(r.valueAsString, equals('6')); /// scope: continued
+ r = await isolate.evalFrame(frameNumber, 'innerParam');
+ expect(r.valueAsString, equals('7'));
+ r = await isolate.evalFrame(frameNumber, 'innerTemp');
+ expect(r.valueAsString, equals('8'));
+ r = await isolate.evalFrame(frameNumber, 'math.sqrt');
+ expect(r.isClosure, isTrue);
+
+ hitBreakpoint = true;
+ sub.cancel(); // Do not handle events for the other tests.
+ isolate.resume();
+ }
+ });
+
+ var result = await isolate.eval(rootLib, 'C.method2(3);');
+ print("Result $result");
+ expect(hitBreakpoint, isTrue);
+}
+
+testMethod3(Isolate isolate) async {
+ Library rootLib = await isolate.rootLib.load();
+ ServiceFunction function =
+ rootLib.functions.singleWhere((f) => f.name == 'breakHere');
+ Breakpoint bpt = await isolate.addBreakpointAtEntry(function);
+ print("Breakpoint: $bpt");
+ expect(bpt is Breakpoint, isTrue); // I.e, not null.
+
+ bool hitBreakpoint = false;
+ var sub;
+ sub = isolate.vm.events.stream.listen((ServiceEvent event) async {
+ print("Event $event");
+ if (event.eventType == ServiceEvent.kPauseBreakpoint) {
+ var frameNumber = 1, r;
+ r = await isolate.evalFrame(frameNumber, '123');
+ expect(r.valueAsString, equals('123'));
+ r = await isolate.evalFrame(frameNumber, 'this');
+ expect(r.clazz.name, equals('C'));
+ r = await isolate.evalFrame(frameNumber, 'instVar');
+ expect(r.valueAsString, equals('1'));
+ r = await isolate.evalFrame(frameNumber, 'classVar');
+ expect(r.valueAsString, equals('2'));
+ r = await isolate.evalFrame(frameNumber, 'methodParam');
+ expect(r.valueAsString, equals('3'));
+ r = await isolate.evalFrame(frameNumber, 'methodTemp');
+ expect(r.valueAsString, equals('4'));
+ r = await isolate.evalFrame(frameNumber, 'math.sqrt');
+ expect(r.isClosure, isTrue);
+
+ hitBreakpoint = true;
+ sub.cancel(); // Do not handle events for the other tests.
+ isolate.resume();
+ }
+ });
+
+ var result = await isolate.eval(rootLib, 'new C().method3(3);');
+ print("Result $result");
+ expect(hitBreakpoint, isTrue);
+}
+
+
+testMethod4(Isolate isolate) async {
+ Library rootLib = await isolate.rootLib.load();
+ ServiceFunction function =
+ rootLib.functions.singleWhere((f) => f.name == 'breakHere');
+ Breakpoint bpt = await isolate.addBreakpointAtEntry(function);
+ print("Breakpoint: $bpt");
+ expect(bpt is Breakpoint, isTrue); // I.e, not null.
+
+ bool hitBreakpoint = false;
+ var sub;
+ sub = isolate.vm.events.stream.listen((ServiceEvent event) async {
+ print("Event $event");
+ if (event.eventType == ServiceEvent.kPauseBreakpoint) {
+ var frameNumber = 1, r;
+ r = await isolate.evalFrame(frameNumber, '123'); /// instance: continued
+ expect(r.valueAsString, equals('123')); /// instance: continued
+ r = await isolate.evalFrame(frameNumber, 'this'); /// scope: continued
+ expect(r.clazz.name, equals('C')); /// scope: continued
+ r = await isolate.evalFrame(frameNumber, 'instVar'); /// instance: continued
+ expect(r.valueAsString, equals('1')); /// instance: continued
+ r = await isolate.evalFrame(frameNumber, 'classVar'); /// instance: continued
+ expect(r.valueAsString, equals('2')); /// instance: continued
+ r = await isolate.evalFrame(frameNumber, 'methodParam'); /// scope: continued
+ expect(r.valueAsString, equals('3')); /// scope: continued
+ r = await isolate.evalFrame(frameNumber, 'methodTemp'); /// scope: continued
+ expect(r.valueAsString, equals('4')); /// scope: continued
+ r = await isolate.evalFrame(frameNumber, 'outerParam'); /// scope: continued
+ expect(r.valueAsString, equals('5')); /// scope: continued
+ r = await isolate.evalFrame(frameNumber, 'outerTemp'); /// scope: continued
+ expect(r.valueAsString, equals('6')); /// scope: continued
+ r = await isolate.evalFrame(frameNumber, 'innerParam'); /// instance: continued
+ expect(r.valueAsString, equals('7')); /// instance: continued
+ r = await isolate.evalFrame(frameNumber, 'innerTemp'); /// instance: continued
+ expect(r.valueAsString, equals('8')); /// instance: continued
+ r = await isolate.evalFrame(frameNumber, 'math.sqrt'); /// instance: continued
+ expect(r.isClosure, isTrue); /// instance: continued
+
+ hitBreakpoint = true;
+ sub.cancel(); // Do not handle events for the other tests.
+ isolate.resume();
+ }
+ });
+
+ var result = await isolate.eval(rootLib,
+ '(){ new C().method4(3); C.closureWithReturnedHome(7); }()');
+ print("Result $result");
+ expect(hitBreakpoint, isTrue);
+}
+
+var tests = [
+ testMethod,
+ testMethod2,
+ testMethod3,
+ testMethod4,
+];
+
+main(args) => runIsolateTests(args, tests);
diff --git a/runtime/observatory/tests/service/functions_test.dart b/runtime/observatory/tests/service/functions_test.dart
deleted file mode 100644
index 844de8c..0000000
--- a/runtime/observatory/tests/service/functions_test.dart
+++ /dev/null
@@ -1,37 +0,0 @@
-// Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-// VMOptions=--compile-all --error_on_bad_type --error_on_bad_override --checked
-
-library functions_test;
-
-import 'package:observatory/service_io.dart';
-import 'package:unittest/unittest.dart';
-import 'test_helper.dart';
-
-class Foo {
- int a;
-}
-
-void script() {
- new Foo().a = 42;
-}
-
-var tests = [
-
-(Isolate isolate) =>
- isolate.rootLib.load().then((Library lib) {
- expect(lib.classes.length, equals(1));
- return lib.classes.first.load().then((Class fooClass) {
- expect(fooClass.name, equals('Foo'));
- return isolate.getObject('${fooClass.id}/functions/get%3Aa')
- .then((ServiceFunction func) {
- expect(func.name, equals('a'));
- expect(func.kind, equals(FunctionKind.kImplicitGetterFunction));
- });
- });
-}),
-
-];
-
-main(args) => runIsolateTests(args, tests, testeeBefore: script);
diff --git a/runtime/observatory/tests/service/gc_test.dart b/runtime/observatory/tests/service/gc_test.dart
index f6d6293..e5adaed 100644
--- a/runtime/observatory/tests/service/gc_test.dart
+++ b/runtime/observatory/tests/service/gc_test.dart
@@ -1,7 +1,7 @@
// Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// VMOptions=--compile-all --error_on_bad_type --error_on_bad_override --checked
+// VMOptions=--compile-all --error_on_bad_type --error_on_bad_override
import 'package:observatory/service_io.dart';
import 'test_helper.dart';
@@ -9,13 +9,12 @@
import 'dart:async';
void script() {
- List<int> data;
var grow;
grow = (int iterations, int size, Duration duration) {
if (iterations <= 0) {
return;
}
- data = new List<int>(size);
+ new List<int>(size);
new Timer(duration, () => grow(iterations - 1, size, duration));
};
grow(100, 1 << 24, new Duration(seconds: 1));
@@ -28,8 +27,11 @@
// Expect at least this many GC events.
int gcCountdown = 3;
isolate.vm.events.stream.listen((ServiceEvent event) {
- if (event.eventType == ServiceEvent.kGC && --gcCountdown == 0) {
- completer.complete();
+ if (event.eventType == ServiceEvent.kGC) {
+ print('Received GC event');
+ if (--gcCountdown == 0) {
+ completer.complete();
+ }
}
});
return completer.future;
diff --git a/runtime/observatory/tests/service/get_allocation_profile_rpc_test.dart b/runtime/observatory/tests/service/get_allocation_profile_rpc_test.dart
new file mode 100644
index 0000000..4dab52c
--- /dev/null
+++ b/runtime/observatory/tests/service/get_allocation_profile_rpc_test.dart
@@ -0,0 +1,80 @@
+// Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+// VMOptions=--compile-all --error_on_bad_type --error_on_bad_override
+
+import 'package:observatory/service_io.dart';
+import 'package:unittest/unittest.dart';
+
+import 'test_helper.dart';
+
+var tests = [
+ (Isolate isolate) async {
+ var params = {
+ };
+ var result = await isolate.invokeRpcNoUpgrade(
+ '_getAllocationProfile', params);
+ expect(result['type'], equals('AllocationProfile'));
+ var lastReset = result['dateLastAccumulatorReset'];
+ expect(lastReset, new isInstanceOf<String>());
+ var lastGC = result['dateLastServiceGC'];
+ expect(lastGC, new isInstanceOf<String>());
+ expect(result['heaps'].length, isPositive);
+ expect(result['heaps']['new']['type'], equals('HeapSpace'));
+ expect(result['heaps']['old']['type'], equals('HeapSpace'));
+ expect(result['members'].length, isPositive);
+ expect(result['members'][0]['type'], equals('ClassHeapStats'));
+
+ // reset.
+ params = {
+ 'reset' : 'true',
+ };
+ result = await isolate.invokeRpcNoUpgrade('_getAllocationProfile', params);
+ expect(result['type'], equals('AllocationProfile'));
+ var newReset = result['dateLastAccumulatorReset'];
+ expect(newReset, isNot(equals(lastReset)));
+ expect(result['dateLastServiceGC'], equals(lastGC));
+ expect(result['heaps'].length, isPositive);
+ expect(result['heaps']['new']['type'], equals('HeapSpace'));
+ expect(result['heaps']['old']['type'], equals('HeapSpace'));
+ expect(result['members'].length, isPositive);
+ expect(result['members'][0]['type'], equals('ClassHeapStats'));
+
+ // gc.
+ params = {
+ 'gc' : 'full',
+ };
+ result = await isolate.invokeRpcNoUpgrade('_getAllocationProfile', params);
+ expect(result['type'], equals('AllocationProfile'));
+ expect(result['dateLastAccumulatorReset'], equals(newReset));
+ var newGC = result['dateLastServiceGCt'];
+ expect(newGC, isNot(equals(lastGC)));
+ expect(result['heaps'].length, isPositive);
+ expect(result['heaps']['new']['type'], equals('HeapSpace'));
+ expect(result['heaps']['old']['type'], equals('HeapSpace'));
+ expect(result['members'].length, isPositive);
+ expect(result['members'][0]['type'], equals('ClassHeapStats'));
+ },
+
+ (Isolate isolate) async {
+ var params = {
+ 'reset' : 'banana',
+ };
+ var result = await isolate.invokeRpcNoUpgrade(
+ '_getAllocationProfile', params);
+ expect(result['type'], equals('Error'));
+ expect(result['message'], contains("invalid 'reset' parameter"));
+ },
+
+ (Isolate isolate) async {
+ var params = {
+ 'gc' : 'banana',
+ };
+ var result = await isolate.invokeRpcNoUpgrade(
+ '_getAllocationProfile', params);
+ expect(result['type'], equals('Error'));
+ expect(result['message'], contains("invalid 'gc' parameter"));
+ },
+];
+
+main(args) async => runIsolateTests(args, tests);
diff --git a/runtime/observatory/tests/service/get_flag_list_rpc_test.dart b/runtime/observatory/tests/service/get_flag_list_rpc_test.dart
new file mode 100644
index 0000000..d726c2b
--- /dev/null
+++ b/runtime/observatory/tests/service/get_flag_list_rpc_test.dart
@@ -0,0 +1,43 @@
+// Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+// VMOptions=--compile-all --error_on_bad_type --error_on_bad_override
+
+import 'package:observatory/service_io.dart';
+import 'package:unittest/unittest.dart';
+
+import 'test_helper.dart';
+
+var tests = [
+ (VM vm) async {
+ var result = await vm.invokeRpcNoUpgrade('getFlagList', {});
+ expect(result['type'], equals('FlagList'));
+ // TODO(turnidge): Make this test a bit beefier.
+ },
+
+ // Modify a flag which does not exist.
+ (VM vm) async {
+ // Modify a flag.
+ var params = {
+ 'name' : 'does_not_really_exist',
+ 'value' : 'true',
+ };
+ var result = await vm.invokeRpcNoUpgrade('setFlag', params);
+ expect(result['type'], equals('Error'));
+ expect(result['message'], equals('Cannot set flag: flag not found'));
+ },
+
+ // Modify a flag with the wrong value type.
+ (VM vm) async {
+ // Modify a flag.
+ var params = {
+ 'name' : 'trace_isolates',
+ 'value' : '123',
+ };
+ var result = await vm.invokeRpcNoUpgrade('setFlag', params);
+ expect(result['type'], equals('Error'));
+ expect(result['message'], equals('Cannot set flag: invalid value'));
+ },
+];
+
+main(args) async => runVMTests(args, tests);
diff --git a/runtime/observatory/tests/service/get_heap_map_rpc_test.dart b/runtime/observatory/tests/service/get_heap_map_rpc_test.dart
new file mode 100644
index 0000000..3fda617
--- /dev/null
+++ b/runtime/observatory/tests/service/get_heap_map_rpc_test.dart
@@ -0,0 +1,28 @@
+// Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+// VMOptions=--compile-all --error_on_bad_type --error_on_bad_override
+
+import 'package:observatory/service_io.dart';
+import 'package:unittest/unittest.dart';
+
+import 'test_helper.dart';
+
+var tests = [
+ (Isolate isolate) async {
+ var params = {
+ };
+ var result = await isolate.invokeRpcNoUpgrade('getHeapMap', params);
+ expect(result['type'], equals('HeapMap'));
+ expect(result['freeClassId'], isPositive);
+ expect(result['unitSizeBytes'], isPositive);
+ expect(result['pageSizeBytes'], isPositive);
+ expect(result['classList'], isNotNull);
+ expect(result['pages'].length, isPositive);
+ expect(result['pages'][0]['objectStart'], new isInstanceOf<String>());
+ expect(result['pages'][0]['objects'].length, isPositive);
+ expect(result['pages'][0]['objects'][0], isPositive);
+ },
+];
+
+main(args) async => runIsolateTests(args, tests);
diff --git a/runtime/observatory/tests/service/get_instances_rpc_test.dart b/runtime/observatory/tests/service/get_instances_rpc_test.dart
new file mode 100644
index 0000000..01270fc
--- /dev/null
+++ b/runtime/observatory/tests/service/get_instances_rpc_test.dart
@@ -0,0 +1,57 @@
+// Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+// VMOptions=--compile-all --error_on_bad_type --error_on_bad_override
+
+import 'package:observatory/service_io.dart';
+import 'package:unittest/unittest.dart';
+
+import 'test_helper.dart';
+
+class _TestClass {
+ _TestClass(this.x, this.y);
+ var x;
+ var y;
+}
+
+var global;
+
+void warmup() {
+ global = new _TestClass(new _TestClass(1, 2), null);
+}
+
+eval(Isolate isolate, String expression) async {
+ Map params = {
+ 'targetId': isolate.rootLib.id,
+ 'expression': expression,
+ };
+ return await isolate.invokeRpcNoUpgrade('eval', params);
+}
+
+var tests = [
+ (Isolate isolate) async {
+ var obj = await eval(isolate, 'global');
+ var params = {
+ 'classId': obj['class']['id'],
+ 'limit': 4,
+ };
+ var result = await isolate.invokeRpcNoUpgrade('_getInstances', params);
+ expect(result['type'], equals('InstanceSet'));
+ expect(result['totalCount'], equals(2));
+ expect(result['samples'].length, equals(2));
+ expect(result['samples'][0]['type'], equals('@Instance'));
+
+ // Limit is respected.
+ params = {
+ 'classId': obj['class']['id'],
+ 'limit': 1,
+ };
+ result = await isolate.invokeRpcNoUpgrade('_getInstances', params);
+ expect(result['type'], equals('InstanceSet'));
+ expect(result['totalCount'], equals(2));
+ expect(result['samples'].length, equals(1));
+ expect(result['samples'][0]['type'], equals('@Instance'));
+ },
+];
+
+main(args) async => runIsolateTests(args, tests, testeeBefore:warmup);
diff --git a/runtime/observatory/tests/service/get_isolate_rpc_test.dart b/runtime/observatory/tests/service/get_isolate_rpc_test.dart
new file mode 100644
index 0000000..146ff5f
--- /dev/null
+++ b/runtime/observatory/tests/service/get_isolate_rpc_test.dart
@@ -0,0 +1,36 @@
+// Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+// VMOptions=--compile-all --error_on_bad_type --error_on_bad_override
+
+import 'package:observatory/service_io.dart';
+import 'package:unittest/unittest.dart';
+
+import 'test_helper.dart';
+
+var tests = [
+ (VM vm) async {
+ var params = {
+ 'isolateId': vm.isolates.first.id,
+ };
+ var result = await vm.invokeRpcNoUpgrade('getIsolate', params);
+ expect(result['type'], equals('Isolate'));
+ expect(result['id'], startsWith('isolates/'));
+ expect(result['number'], new isInstanceOf<String>());
+ expect(result['startTime'], isPositive);
+ expect(result['livePorts'], isPositive);
+ expect(result['pauseOnExit'], isFalse);
+ expect(result['pauseEvent']['type'], equals('ServiceEvent'));
+ expect(result['error'], isNull);
+ expect(result['rootLib']['type'], equals('@Library'));
+ expect(result['libraries'].length, isPositive);
+ expect(result['libraries'][0]['type'], equals('@Library'));
+ expect(result['breakpoints'].length, isZero);
+ expect(result['features'].length, isPositive);
+ expect(result['features'][0], new isInstanceOf<String>());
+ expect(result['heaps']['new']['type'], equals('HeapSpace'));
+ expect(result['heaps']['old']['type'], equals('HeapSpace'));
+ },
+];
+
+main(args) async => runVMTests(args, tests);
diff --git a/runtime/observatory/tests/service/get_object_rpc_test.dart b/runtime/observatory/tests/service/get_object_rpc_test.dart
new file mode 100644
index 0000000..d581f4c
--- /dev/null
+++ b/runtime/observatory/tests/service/get_object_rpc_test.dart
@@ -0,0 +1,369 @@
+// Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+// VMOptions=--compile-all --error_on_bad_type --error_on_bad_override
+
+library get_object_rpc_test;
+
+import 'package:observatory/service_io.dart';
+import 'package:unittest/unittest.dart';
+
+import 'test_helper.dart';
+
+class _DummyClass {
+ static var dummyVar = 11;
+ void dummyFunction() {
+ }
+}
+
+class _DummySubClass extends _DummyClass {
+}
+
+void warmup() {
+ // Silence analyzer.
+ new _DummySubClass();
+ new _DummyClass().dummyFunction();
+}
+
+eval(Isolate isolate, String expression) async {
+ Map params = {
+ 'targetId': isolate.rootLib.id,
+ 'expression': expression,
+ };
+ return await isolate.invokeRpcNoUpgrade('eval', params);
+}
+
+var tests = [
+ // null object.
+ (Isolate isolate) async {
+ var params = {
+ 'objectId': 'objects/null',
+ };
+ var result = await isolate.invokeRpcNoUpgrade('getObject', params);
+ expect(result['type'], equals('null'));
+ expect(result['id'], equals('objects/null'));
+ expect(result['valueAsString'], equals('null'));
+ expect(result['class']['type'], equals('@Class'));
+ expect(result['class']['name'], equals('Null'));
+ expect(result['size'], isPositive);
+ },
+
+ // bool object.
+ (Isolate isolate) async {
+ var params = {
+ 'objectId': 'objects/bool-true',
+ };
+ var result = await isolate.invokeRpcNoUpgrade('getObject', params);
+ expect(result['type'], equals('bool'));
+ expect(result['id'], equals('objects/bool-true'));
+ expect(result['valueAsString'], equals('true'));
+ expect(result['class']['type'], equals('@Class'));
+ expect(result['class']['name'], equals('bool'));
+ expect(result['size'], isPositive);
+ expect(result['fields'], isEmpty);
+ },
+
+ // int object.
+ (Isolate isolate) async {
+ var params = {
+ 'objectId': 'objects/int-123',
+ };
+ var result = await isolate.invokeRpcNoUpgrade('getObject', params);
+ expect(result['type'], equals('int'));
+ expect(result['_vmType'], equals('Smi'));
+ expect(result['id'], equals('objects/int-123'));
+ expect(result['valueAsString'], equals('123'));
+ expect(result['class']['type'], equals('@Class'));
+ expect(result['class']['name'], equals('_Smi'));
+ expect(result['size'], isZero);
+ expect(result['fields'], isEmpty);
+ },
+
+ // A general Dart object.
+ (Isolate isolate) async {
+ // Call eval to get a Dart list.
+ var evalResult = await eval(isolate, '[3, 2, 1]');
+ var params = {
+ 'objectId': evalResult['id'],
+ };
+ var result = await isolate.invokeRpcNoUpgrade('getObject', params);
+ expect(result['type'], equals('List'));
+ expect(result['_vmType'], equals('GrowableObjectArray'));
+ expect(result['id'], startsWith('objects/'));
+ expect(result['valueAsString'], isNull);
+ expect(result['class']['type'], equals('@Class'));
+ expect(result['class']['name'], equals('_GrowableList'));
+ expect(result['size'], isPositive);
+ expect(result['fields'], isEmpty);
+ expect(result['elements'].length, equals(3));
+ expect(result['elements'][0]['index'], equals(0));
+ expect(result['elements'][0]['value']['type'], equals('@int'));
+ expect(result['elements'][0]['value']['valueAsString'], equals('3'));
+ },
+
+ // An expired object.
+ (Isolate isolate) async {
+ var params = {
+ 'objectId': 'objects/99999999',
+ };
+ var result = await isolate.invokeRpcNoUpgrade('getObject', params);
+ expect(result['type'], equals('Sentinel'));
+ expect(result['id'], startsWith('objects/expired'));
+ expect(result['valueAsString'], equals('<expired>'));
+ expect(result['class'], isNull);
+ expect(result['size'], isNull);
+ },
+
+ // library.
+ (Isolate isolate) async {
+ var params = {
+ 'objectId': isolate.rootLib.id,
+ };
+ var result = await isolate.invokeRpcNoUpgrade('getObject', params);
+ expect(result['type'], equals('Library'));
+ expect(result['id'], startsWith('libraries/'));
+ expect(result['name'], equals('get_object_rpc_test'));
+ expect(result['url'], startsWith('file:'));
+ expect(result['url'], endsWith('get_object_rpc_test.dart'));
+ expect(result['imports'].length, isPositive);
+ expect(result['imports'][0]['type'], equals('@Library'));
+ expect(result['scripts'].length, isPositive);
+ expect(result['scripts'][0]['type'], equals('@Script'));
+ expect(result['variables'].length, isPositive);
+ expect(result['variables'][0]['type'], equals('@Field'));
+ expect(result['functions'].length, isPositive);
+ expect(result['functions'][0]['type'], equals('@Function'));
+ expect(result['classes'].length, isPositive);
+ expect(result['classes'][0]['type'], equals('@Class'));
+ },
+
+ // invalid library.
+ (Isolate isolate) async {
+ var params = {
+ 'objectId': 'libraries/9999999',
+ };
+ var result = await isolate.invokeRpcNoUpgrade('getObject', params);
+ expect(result['type'], equals('Error'));
+ expect(result['message'], startsWith('Unrecognized object id'));
+ },
+
+ // script.
+ (Isolate isolate) async {
+ // Get the library first.
+ var params = {
+ 'objectId': isolate.rootLib.id,
+ };
+ var libResult = await isolate.invokeRpcNoUpgrade('getObject', params);
+ // Get the first script.
+ params = {
+ 'objectId': libResult['scripts'][0]['id'],
+ };
+ var result = await isolate.invokeRpcNoUpgrade('getObject', params);
+ expect(result['type'], equals('Script'));
+ expect(result['id'], startsWith('libraries/'));
+ expect(result['name'], startsWith('file:'));
+ expect(result['name'], endsWith('get_object_rpc_test.dart'));
+ expect(result['kind'], equals('script'));
+ expect(result['library']['type'], equals('@Library'));
+ expect(result['source'], startsWith('// Copyright (c)'));
+ expect(result['tokenPosTable'].length, isPositive);
+ expect(result['tokenPosTable'][0], new isInstanceOf<List>());
+ expect(result['tokenPosTable'][0].length, isPositive);
+ expect(result['tokenPosTable'][0][0], new isInstanceOf<int>());
+ },
+
+ // invalid script.
+ (Isolate isolate) async {
+ var params = {
+ 'objectId': 'scripts/9999999',
+ };
+ var result = await isolate.invokeRpcNoUpgrade('getObject', params);
+ expect(result['type'], equals('Error'));
+ expect(result['message'], startsWith('Unrecognized object id'));
+ },
+
+ // class
+ (Isolate isolate) async {
+ // Call eval to get a class id.
+ var evalResult = await eval(isolate, 'new _DummyClass()');
+ var params = {
+ 'objectId': evalResult['class']['id'],
+ };
+ var result = await isolate.invokeRpcNoUpgrade('getObject', params);
+ expect(result['type'], equals('Class'));
+ expect(result['id'], startsWith('classes/'));
+ expect(result['name'], equals('_DummyClass'));
+ expect(result['_vmName'], startsWith('_DummyClass@'));
+ expect(result['abstract'], equals(false));
+ expect(result['const'], equals(false));
+ expect(result['finalized'], equals(true));
+ expect(result['implemented'], equals(false));
+ expect(result['patch'], equals(false));
+ expect(result['library']['type'], equals('@Library'));
+ expect(result['script']['type'], equals('@Script'));
+ expect(result['super']['type'], equals('@Class'));
+ expect(result['interfaces'].length, isZero);
+ expect(result['fields'].length, isPositive);
+ expect(result['fields'][0]['type'], equals('@Field'));
+ expect(result['functions'].length, isPositive);
+ expect(result['functions'][0]['type'], equals('@Function'));
+ expect(result['subclasses'].length, isPositive);
+ expect(result['subclasses'][0]['type'], equals('@Class'));
+ },
+
+ // invalid class.
+ (Isolate isolate) async {
+ var params = {
+ 'objectId': 'classes/9999999',
+ };
+ var result = await isolate.invokeRpcNoUpgrade('getObject', params);
+ expect(result['type'], equals('Error'));
+ expect(result['message'], startsWith('Unrecognized object id'));
+ },
+
+ // type.
+ (Isolate isolate) async {
+ // Call eval to get a class id.
+ var evalResult = await eval(isolate, 'new _DummyClass()');
+ var id = "${evalResult['class']['id']}/types/0";
+ var params = {
+ 'objectId': id,
+ };
+ var result = await isolate.invokeRpcNoUpgrade('getObject', params);
+ expect(result['type'], equals('Type'));
+ expect(result['id'], equals(id));
+ expect(result['class']['type'], equals('@Class'));
+ expect(result['class']['name'], equals('_Type'));
+ expect(result['size'], isPositive);
+ expect(result['fields'], isEmpty);
+ expect(result['typeClass']['type'], equals('@Class'));
+ expect(result['typeClass']['name'], equals('_DummyClass'));
+ },
+
+ // invalid type.
+ (Isolate isolate) async {
+ var evalResult = await eval(isolate, 'new _DummyClass()');
+ var id = "${evalResult['class']['id']}/types/9999999";
+ var params = {
+ 'objectId': id,
+ };
+ var result = await isolate.invokeRpcNoUpgrade('getObject', params);
+ expect(result['type'], equals('Error'));
+ expect(result['message'], startsWith('Unrecognized object id'));
+ },
+
+ // function.
+ (Isolate isolate) async {
+ // Call eval to get a class id.
+ var evalResult = await eval(isolate, 'new _DummyClass()');
+ var id = "${evalResult['class']['id']}/functions/dummyFunction";
+ var params = {
+ 'objectId': id,
+ };
+ var result = await isolate.invokeRpcNoUpgrade('getObject', params);
+ expect(result['type'], equals('Function'));
+ expect(result['id'], equals(id));
+ expect(result['name'], equals('dummyFunction'));
+ expect(result['kind'], equals('RegularFunction'));
+ expect(result['static'], equals(false));
+ expect(result['const'], equals(false));
+ expect(result['script']['type'], equals('@Script'));
+ expect(result['tokenPos'], isPositive);
+ expect(result['code']['type'], equals('@Code'));
+ expect(result['_optimizable'], equals(true));
+ expect(result['_inlinable'], equals(true));
+ expect(result['_usageCounter'], isPositive);
+ expect(result['_optimizedCallSiteCount'], isZero);
+ expect(result['_deoptimizations'], isZero);
+ },
+
+ // invalid function.
+ (Isolate isolate) async {
+ // Call eval to get a class id.
+ var evalResult = await eval(isolate, 'new _DummyClass()');
+ var id = "${evalResult['class']['id']}/functions/invalid";
+ var params = {
+ 'objectId': id,
+ };
+ var result = await isolate.invokeRpcNoUpgrade('getObject', params);
+ expect(result['type'], equals('Error'));
+ expect(result['message'], startsWith('Unrecognized object id'));
+ },
+
+ // field
+ (Isolate isolate) async {
+ // Call eval to get a class id.
+ var evalResult = await eval(isolate, 'new _DummyClass()');
+ var id = "${evalResult['class']['id']}/fields/0";
+ var params = {
+ 'objectId': id,
+ };
+ var result = await isolate.invokeRpcNoUpgrade('getObject', params);
+ expect(result['type'], equals('Field'));
+ expect(result['id'], equals(id));
+ expect(result['name'], equals('dummyVar'));
+ expect(result['value']['valueAsString'], equals('11'));
+ expect(result['const'], equals(false));
+ expect(result['static'], equals(true));
+ expect(result['final'], equals(false));
+ expect(result['script']['type'], equals('@Script'));
+ expect(result['tokenPos'], isPositive);
+ expect(result['_guardNullable'], isNotNull);
+ expect(result['_guardClass'], isNotNull);
+ expect(result['_guardLength'], isNotNull);
+ },
+
+ // invalid field.
+ (Isolate isolate) async {
+ // Call eval to get a class id.
+ var evalResult = await eval(isolate, 'new _DummyClass()');
+ var id = "${evalResult['class']['id']}/fields/9999";
+ var params = {
+ 'objectId': id,
+ };
+ var result = await isolate.invokeRpcNoUpgrade('getObject', params);
+ expect(result['type'], equals('Error'));
+ expect(result['message'], startsWith('Unrecognized object id'));
+ },
+
+ // code.
+ (Isolate isolate) async {
+ // Call eval to get a class id.
+ var evalResult = await eval(isolate, 'new _DummyClass()');
+ var funcId = "${evalResult['class']['id']}/functions/dummyFunction";
+ var params = {
+ 'objectId': funcId,
+ };
+ var funcResult = await isolate.invokeRpcNoUpgrade('getObject', params);
+ params = {
+ 'objectId': funcResult['code']['id'],
+ };
+ var result = await isolate.invokeRpcNoUpgrade('getObject', params);
+ expect(result['type'], equals('Code'));
+ expect(result['name'], equals('_DummyClass.dummyFunction'));
+ expect(result['_vmName'], equals('dummyFunction'));
+ expect(result['kind'], equals('Dart'));
+ expect(result['_optimized'], new isInstanceOf<bool>());
+ expect(result['function']['type'], equals('@Function'));
+ expect(result['_startAddress'], new isInstanceOf<String>());
+ expect(result['_endAddress'], new isInstanceOf<String>());
+ expect(result['_objectPool'], isNotNull);
+ expect(result['_disassembly'], isNotNull);
+ expect(result['_descriptors'], isNotNull);
+ expect(result['_inlinedFunctions'], anyOf([isNull, new isInstanceOf<List>()]));
+ expect(result['_inlinedIntervals'], anyOf([isNull, new isInstanceOf<List>()]));
+ },
+
+ // invalid code.
+ (Isolate isolate) async {
+ // Call eval to get a class id.
+ var params = {
+ 'objectId': 'code/0',
+ };
+ var result = await isolate.invokeRpcNoUpgrade('getObject', params);
+ expect(result['type'], equals('Error'));
+ expect(result['message'], startsWith('Unrecognized object id'));
+ },
+];
+
+main(args) async => runIsolateTests(args, tests, testeeBefore:warmup);
diff --git a/runtime/observatory/tests/service/get_retained_size_rpc_test.dart b/runtime/observatory/tests/service/get_retained_size_rpc_test.dart
new file mode 100644
index 0000000..e71acb6
--- /dev/null
+++ b/runtime/observatory/tests/service/get_retained_size_rpc_test.dart
@@ -0,0 +1,68 @@
+// Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+// VMOptions=--compile-all --error_on_bad_type --error_on_bad_override
+
+import 'package:observatory/service_io.dart';
+import 'package:unittest/unittest.dart';
+
+import 'test_helper.dart';
+
+class _TestClass {
+ _TestClass(this.x, this.y);
+ var x;
+ var y;
+}
+
+var myVar;
+
+eval(Isolate isolate, String expression) async {
+ // Silence analyzer.
+ new _TestClass(null, null);
+ Map params = {
+ 'targetId': isolate.rootLib.id,
+ 'expression': expression,
+ };
+ return await isolate.invokeRpcNoUpgrade('eval', params);
+}
+
+var tests = [
+ (Isolate isolate) async {
+ // One instance of _TestClass retained.
+ var evalResult = await eval(
+ isolate, 'myVar = new _TestClass(null, null)');
+ var params = {
+ 'targetId': evalResult['id'],
+ };
+ var result = await isolate.invokeRpcNoUpgrade('_getRetainedSize', params);
+ expect(result['type'], equals('@int'));
+ int value1 = int.parse(result['valueAsString']);
+ expect(value1, isPositive);
+
+ // Two instances of _TestClass retained.
+ evalResult = await eval(
+ isolate, 'myVar = new _TestClass(new _TestClass(null, null), null)');
+ params = {
+ 'targetId': evalResult['id'],
+ };
+ result = await isolate.invokeRpcNoUpgrade('_getRetainedSize', params);
+ expect(result['type'], equals('@int'));
+ int value2 = int.parse(result['valueAsString']);
+ expect(value2, isPositive);
+
+ // Size has doubled.
+ expect(value2, equals(2 * value1));
+
+ // Get the retained size for class _TestClass.
+ params = {
+ 'targetId': evalResult['class']['id'],
+ };
+ result = await isolate.invokeRpcNoUpgrade('_getRetainedSize', params);
+ expect(result['type'], equals('@int'));
+ int value3 = int.parse(result['valueAsString']);
+ expect(value3, isPositive);
+ expect(value3, equals(value2));
+ },
+];
+
+main(args) async => runIsolateTests(args, tests);
diff --git a/runtime/observatory/tests/service/get_retaining_path_rpc_test.dart b/runtime/observatory/tests/service/get_retaining_path_rpc_test.dart
new file mode 100644
index 0000000..c27301b
--- /dev/null
+++ b/runtime/observatory/tests/service/get_retaining_path_rpc_test.dart
@@ -0,0 +1,103 @@
+// Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+// VMOptions=--compile-all --error_on_bad_type --error_on_bad_override
+
+import 'package:observatory/service_io.dart';
+import 'package:unittest/unittest.dart';
+
+import 'test_helper.dart';
+
+class _TestClass {
+ _TestClass(this.x, this.y);
+ var x;
+ var y;
+}
+
+var target1;
+var target2;
+var target3;
+var globalObject;
+var globalList;
+
+void warmup() {
+ target1 = new _TestClass(null, null);
+ target2 = new _TestClass(null, null);
+ globalObject = new _TestClass(target1, target2);
+
+ target3 = new _TestClass(null, null);
+ globalList = new List(100);
+ globalList[12] = target3;
+}
+
+eval(Isolate isolate, String expression) async {
+ Map params = {
+ 'targetId': isolate.rootLib.id,
+ 'expression': expression,
+ };
+ return await isolate.invokeRpcNoUpgrade('eval', params);
+}
+
+var tests = [
+ // simple path
+ (Isolate isolate) async {
+ var obj = await eval(isolate, 'globalObject');
+ var params = {
+ 'targetId': obj['id'],
+ 'limit': 4,
+ };
+ var result = await isolate.invokeRpcNoUpgrade('_getRetainingPath', params);
+ expect(result['elements'][1]['value']['name'], equals('globalObject'));
+ },
+
+ // missing limit.
+ (Isolate isolate) async {
+ var obj = await eval(isolate, 'globalObject');
+ var params = {
+ 'targetId': obj['id'],
+ };
+ var result = await isolate.invokeRpcNoUpgrade('_getRetainingPath', params);
+ expect(result['message'], contains("invalid 'limit' parameter"));
+ },
+
+ (Isolate isolate) async {
+ var target1 = await eval(
+ isolate, '() { var tmp = target1; target1 = null; return tmp;} ()');
+ var params = {
+ 'targetId': target1['id'],
+ 'limit': 4,
+ };
+ var result = await isolate.invokeRpcNoUpgrade('_getRetainingPath', params);
+ expect(result['type'], equals('RetainingPath'));
+ expect(result['elements'][0]['parentField']['name'], equals('x'));
+ expect(result['elements'][2]['value']['name'], equals('globalObject'));
+ },
+
+ (Isolate isolate) async {
+ var target2 = await eval(
+ isolate, '() { var tmp = target2; target2 = null; return tmp;} ()');
+ var params = {
+ 'targetId': target2['id'],
+ 'limit': 4,
+ };
+ var result = await isolate.invokeRpcNoUpgrade('_getRetainingPath', params);
+ expect(result['type'], equals('RetainingPath'));
+ expect(result['elements'][0]['parentField']['name'], equals('y'));
+ expect(result['elements'][2]['value']['name'], equals('globalObject'));
+ },
+
+ (Isolate isolate) async {
+ var target3 = await eval(
+ isolate, '() { var tmp = target3; target3 = null; return tmp;} ()');
+ var params = {
+ 'targetId': target3['id'],
+ 'limit': 4,
+ };
+ var result = await isolate.invokeRpcNoUpgrade('_getRetainingPath', params);
+ expect(result['type'], equals('RetainingPath'));
+ expect(result['elements'][0]['parentListIndex'], equals(12));
+ expect(result['elements'][2]['value']['name'], equals('globalList'));
+ },
+];
+
+main(args) async => runIsolateTests(args, tests, testeeBefore:warmup);
diff --git a/runtime/observatory/tests/service/get_stack_rpc_test.dart b/runtime/observatory/tests/service/get_stack_rpc_test.dart
new file mode 100644
index 0000000..e503527
--- /dev/null
+++ b/runtime/observatory/tests/service/get_stack_rpc_test.dart
@@ -0,0 +1,118 @@
+// Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+// VMOptions=--compile-all --error_on_bad_type --error_on_bad_override
+
+import 'package:observatory/service_io.dart';
+import 'package:unittest/unittest.dart';
+import 'test_helper.dart';
+import 'dart:async';
+import 'dart:isolate' as isolate;
+
+int counter = 0;
+const stoppedAtLine = 23;
+var port = new isolate.RawReceivePort(msgHandler);
+
+// This name is used in a test below.
+void msgHandler(_) {
+}
+
+void periodicTask(_) {
+ counter++;
+ port.sendPort.send(34);
+ counter++; // Line 23. We set our breakpoint here.
+ counter++;
+ if (counter % 300 == 0) {
+ print('counter = $counter');
+ }
+}
+
+void startTimer() {
+ new Timer.periodic(const Duration(milliseconds:10), periodicTask);
+}
+
+var tests = [
+
+// Add breakpoint
+(Isolate isolate) async {
+ await isolate.rootLib.load();
+
+ // Set up a listener to wait for breakpoint events.
+ Completer completer = new Completer();
+ var subscription;
+ subscription = isolate.vm.events.stream.listen((ServiceEvent event) {
+ if (event.eventType == ServiceEvent.kPauseBreakpoint) {
+ print('Breakpoint reached');
+ subscription.cancel();
+ completer.complete();
+ }
+ });
+
+ var script = isolate.rootLib.scripts[0];
+ await script.load();
+
+ // Add the breakpoint.
+ var result = await isolate.addBreakpoint(script, stoppedAtLine);
+ expect(result is Breakpoint, isTrue);
+ Breakpoint bpt = result;
+ expect(bpt.type, equals('Breakpoint'));
+ expect(bpt.script.id, equals(script.id));
+ expect(bpt.script.tokenToLine(bpt.tokenPos), equals(stoppedAtLine));
+ expect(isolate.breakpoints.length, equals(1));
+
+ await completer.future; // Wait for breakpoint events.
+},
+
+// Get stack
+(Isolate isolate) async {
+ var stack = await isolate.getStack();
+ expect(stack.type, equals('Stack'));
+
+ // Sanity check.
+ expect(stack['frames'].length, greaterThanOrEqualTo(1));
+ Script script = stack['frames'][0]['script'];
+ expect(script.tokenToLine(stack['frames'][0]['tokenPos']),
+ equals(stoppedAtLine));
+
+ // Iterate over frames.
+ var frameDepth = 0;
+ for (var frame in stack['frames']) {
+ print('checking frame $frameDepth');
+ expect(frame.type, equals('Frame'));
+ expect(frame['depth'], equals(frameDepth++));
+ expect(frame['code'].type, equals('Code'));
+ expect(frame['function'].type, equals('Function'));
+ expect(frame['script'].type, equals('Script'));
+ expect(frame['tokenPos'], isNotNull);
+ }
+
+ // Sanity check.
+ expect(stack['messages'].length, greaterThanOrEqualTo(1));
+
+ // Iterate over messages.
+ var messageDepth = 0;
+ // objectId of message to be handled by msgHandler.
+ var msgHandlerObjectId;
+ for (var message in stack['messages']) {
+ print('checking message $messageDepth');
+ expect(message.type, equals('Message'));
+ expect(message['_destinationPort'], isNotNull);
+ expect(message['depth'], equals(messageDepth++));
+ expect(message['name'], isNotNull);
+ expect(message['size'], greaterThanOrEqualTo(1));
+ expect(message['priority'], isNotNull);
+ expect(message['handlerFunction'].type, equals('Function'));
+ if (message['handlerFunction'].name.contains('msgHandler')) {
+ msgHandlerObjectId = message['messageObjectId'];
+ }
+ }
+ expect(msgHandlerObjectId, isNotNull);
+
+ // Get object.
+ var object = await isolate.getObject(msgHandlerObjectId);
+ expect(object.valueAsString, equals('34'));
+}
+
+];
+
+main(args) => runIsolateTests(args, tests, testeeBefore: startTimer);
diff --git a/runtime/observatory/tests/service/get_vm_rpc_test.dart b/runtime/observatory/tests/service/get_vm_rpc_test.dart
new file mode 100644
index 0000000..5b03dde
--- /dev/null
+++ b/runtime/observatory/tests/service/get_vm_rpc_test.dart
@@ -0,0 +1,28 @@
+// Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+// VMOptions=--compile-all --error_on_bad_type --error_on_bad_override
+
+import 'package:observatory/service_io.dart';
+import 'package:unittest/unittest.dart';
+
+import 'test_helper.dart';
+
+var tests = [
+ (VM vm) async {
+ var result = await vm.invokeRpcNoUpgrade('getVM', {});
+ expect(result['type'], equals('VM'));
+ expect(result['architectureBits'], isPositive);
+ expect(result['targetCPU'], new isInstanceOf<String>());
+ expect(result['hostCPU'], new isInstanceOf<String>());
+ expect(result['version'], new isInstanceOf<String>());
+ expect(result['pid'], new isInstanceOf<String>());
+ expect(result['startTime'], isPositive);
+ expect(result['isolates'].length, isPositive);
+ expect(result['isolates'][0]['type'], equals('@Isolate'));
+ expect(result['_assertsEnabled'], new isInstanceOf<bool>());
+ expect(result['_typeChecksEnabled'], new isInstanceOf<bool>());
+ },
+];
+
+main(args) async => runVMTests(args, tests);
diff --git a/runtime/observatory/tests/service/graph_test.dart b/runtime/observatory/tests/service/graph_test.dart
index 2b2d07a..9115ed0 100644
--- a/runtime/observatory/tests/service/graph_test.dart
+++ b/runtime/observatory/tests/service/graph_test.dart
@@ -1,7 +1,7 @@
// Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// VMOptions=--compile-all --error_on_bad_type --error_on_bad_override --checked
+// VMOptions=--compile-all --error_on_bad_type --error_on_bad_override
import 'dart:async';
import 'package:observatory/object_graph.dart';
diff --git a/runtime/observatory/tests/service/inbound_references_test.dart b/runtime/observatory/tests/service/inbound_references_test.dart
index a9805e8..8da9d2c 100644
--- a/runtime/observatory/tests/service/inbound_references_test.dart
+++ b/runtime/observatory/tests/service/inbound_references_test.dart
@@ -1,7 +1,7 @@
// Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// VMOptions=--compile-all --error_on_bad_type --error_on_bad_override --checked
+// VMOptions=--compile-all --error_on_bad_type --error_on_bad_override
library inbound_references_test;
diff --git a/runtime/observatory/tests/service/isolate_lifecycle_test.dart b/runtime/observatory/tests/service/isolate_lifecycle_test.dart
index 08a2a1b..be878a2 100644
--- a/runtime/observatory/tests/service/isolate_lifecycle_test.dart
+++ b/runtime/observatory/tests/service/isolate_lifecycle_test.dart
@@ -1,7 +1,7 @@
// Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// VMOptions=--compile-all --error_on_bad_type --error_on_bad_override --checked
+// VMOptions=--compile-all --error_on_bad_type --error_on_bad_override
import 'dart:async';
import 'dart:isolate' as I;
@@ -30,29 +30,66 @@
Future during() async {
}
+int numPaused(vm) {
+ int paused = 0;
+ for (var isolate in vm.isolates) {
+ if (isolate.paused) {
+ paused++;
+ }
+ }
+ return paused;
+}
+
+int numRunning(vm) {
+ int running = 0;
+ for (var isolate in vm.isolates) {
+ if (!isolate.paused) {
+ running++;
+ }
+ }
+ return running;
+}
+
var tests = [
(VM vm) async {
+ // Wait for the testee to start all of the isolates.
+ if (vm.isolates.length != spawnCount + 1) {
+ await processServiceEvents(vm, (event, sub, completer) {
+ if (event.eventType == ServiceEvent.kIsolateStart) {
+ if (vm.isolates.length == spawnCount + 1) {
+ sub.cancel();
+ completer.complete(null);
+ }
+ }
+ });
+ }
expect(vm.isolates.length, spawnCount + 1);
},
+
(VM vm) async {
// Load each isolate.
for (var isolate in vm.isolates) {
await isolate.load();
}
},
+
(VM vm) async {
- var pausedCount = 0;
- var runningCount = 0;
- for (var isolate in vm.isolates) {
- if (isolate.paused) {
- pausedCount++;
- } else {
- runningCount++;
- }
+ // Wait for all spawned isolates to hit pause-at-exit.
+ if (numPaused(vm) != spawnCount) {
+ await processServiceEvents(vm, (event, sub, completer) {
+ if (event.eventType == ServiceEvent.kPauseExit) {
+ if (numPaused(vm) == spawnCount) {
+ sub.cancel();
+ completer.complete(null);
+ }
+ }
+ });
}
- expect(pausedCount, spawnCount);
- expect(runningCount, 1);
+ expect(numPaused(vm), spawnCount);
+ expect(numRunning(vm), 1);
},
+
+
(VM vm) async {
var resumedReceived = 0;
var eventsDone = processServiceEvents(vm, (event, sub, completer) {
@@ -80,18 +117,10 @@
}
return eventsDone;
},
+
(VM vm) async {
- var pausedCount = 0;
- var runningCount = 0;
- for (var isolate in vm.isolates) {
- if (isolate.paused) {
- pausedCount++;
- } else {
- runningCount++;
- }
- }
- expect(pausedCount, spawnCount - resumeCount);
- expect(runningCount, 1);
+ expect(numPaused(vm), spawnCount - resumeCount);
+ expect(numRunning(vm), 1);
},
];
diff --git a/runtime/observatory/tests/service/malformed_test.dart b/runtime/observatory/tests/service/malformed_test.dart
index 989457d..b5f86dd 100644
--- a/runtime/observatory/tests/service/malformed_test.dart
+++ b/runtime/observatory/tests/service/malformed_test.dart
@@ -1,29 +1,32 @@
// Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// VMOptions=--compile-all --error_on_bad_type --error_on_bad_override --checked
+// VMOptions=--compile-all --error_on_bad_type --error_on_bad_override
import 'package:observatory/service_io.dart';
import 'package:unittest/unittest.dart';
import 'test_helper.dart';
var tests = [
+ (Isolate isolate) async {
+ await isolate.invokeRpc('_respondWithMalformedObject', {}).then((result) {
+ expect(false, isTrue, reason:'Unreachable');
+ }).catchError((ServiceException exception) {
+ expect(exception.kind, equals('ResponseFormatException'));
+ expect(exception.message,
+ startsWith("Response is missing the 'type' field"));
+ });
+ },
-(Isolate isolate) =>
- isolate.invokeRpc('_respondWithMalformedJson', { }).then((result) {
- // Should not execute.
- expect(true, false);
- }).catchError((ServiceException exception) {
- expect(exception.kind, equals('JSONDecodeException'));
- }),
-
-(Isolate isolate) =>
- isolate.invokeRpc('_respondWithMalformedObject', { }).then((result) {
- // Should not execute.
- expect(true, false);
- }).catchError((ServiceException exception) {
- expect(exception.kind, equals('ResponseFormatException'));
- }),
+ // Do this test last... it kills the vm connection.
+ (Isolate isolate) async {
+ await isolate.invokeRpc('_respondWithMalformedJson', {}).then((result) {
+ expect(false, isTrue, reason:'Unreachable');
+ }).catchError((ServiceException exception) {
+ expect(exception.kind, equals('ConnectionClosed'));
+ expect(exception.message, startsWith('Error decoding JSON message'));
+ });
+ },
];
-main(args) => runIsolateTests(args, tests);
\ No newline at end of file
+main(args) => runIsolateTests(args, tests);
diff --git a/runtime/observatory/tests/service/metrics_test.dart b/runtime/observatory/tests/service/metrics_test.dart
index 996e1c1..8630c19 100644
--- a/runtime/observatory/tests/service/metrics_test.dart
+++ b/runtime/observatory/tests/service/metrics_test.dart
@@ -1,7 +1,7 @@
// Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// VMOptions=--compile-all --error_on_bad_type --error_on_bad_override --checked
+// VMOptions=--compile-all --error_on_bad_type --error_on_bad_override
import 'package:observatory/service_io.dart';
import 'package:unittest/unittest.dart';
diff --git a/runtime/observatory/tests/service/mirror_references_test.dart b/runtime/observatory/tests/service/mirror_references_test.dart
index 0433f28..36fa0b6 100644
--- a/runtime/observatory/tests/service/mirror_references_test.dart
+++ b/runtime/observatory/tests/service/mirror_references_test.dart
@@ -1,7 +1,7 @@
// Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// VMOptions=--compile-all --error_on_bad_type --error_on_bad_override --checked
+// VMOptions=--compile-all --error_on_bad_type --error_on_bad_override
library vm_references_test;
diff --git a/runtime/observatory/tests/service/native_metrics_test.dart b/runtime/observatory/tests/service/native_metrics_test.dart
index 5467823..8a8e11a 100644
--- a/runtime/observatory/tests/service/native_metrics_test.dart
+++ b/runtime/observatory/tests/service/native_metrics_test.dart
@@ -1,7 +1,7 @@
// Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// VMOptions=--compile-all --error_on_bad_type --error_on_bad_override --checked
+// VMOptions=--compile-all --error_on_bad_type --error_on_bad_override
import 'package:observatory/service_io.dart';
import 'package:unittest/unittest.dart';
diff --git a/runtime/observatory/tests/service/service.status b/runtime/observatory/tests/service/service.status
index ff8de84..415f062 100644
--- a/runtime/observatory/tests/service/service.status
+++ b/runtime/observatory/tests/service/service.status
@@ -2,13 +2,18 @@
# for details. All rights reserved. Use of this source code is governed by a
# BSD-style license that can be found in the LICENSE file.
-[ $system == linux ]
-call_site_data_test: Pass, Fail # Issue 23160
+[ $compiler == none && $runtime == vm ]
+evaluate_activation_test/instance: RuntimeError # http://dartbug.com/20047
+evaluate_activation_test/scope: RuntimeError # http://dartbug.com/20047
# Unexpected number format
[ $system == windows ]
code_test: Skip
+# Null code assertion http://dartbug.com/23290
+[ $system == windows ]
+coverage_test: Skip
+
# Issue 23201
[ $system == windows ]
debugging_test: Skip
@@ -19,7 +24,7 @@
# Disable on simulators.
[ $arch == simarm || $arch == simmips || $arch == simarm64]
-*: Skip # Slow
+*: SkipSlow
# The transformations of dart2dart are not guaranteed to preserve the
# state/properties of the VM that the Observatory tests are inspecting.
diff --git a/runtime/observatory/tests/service/source_location_test.dart b/runtime/observatory/tests/service/source_location_test.dart
index d658b2a..99146e0 100644
--- a/runtime/observatory/tests/service/source_location_test.dart
+++ b/runtime/observatory/tests/service/source_location_test.dart
@@ -1,7 +1,7 @@
// Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// VMOptions=--compile-all --error_on_bad_type --error_on_bad_override --checked
+// VMOptions=--compile-all --error_on_bad_type --error_on_bad_override
import 'package:observatory/service_io.dart';
import 'package:observatory/debugger.dart';
diff --git a/runtime/observatory/tests/service/steal_breakpoint_test.dart b/runtime/observatory/tests/service/steal_breakpoint_test.dart
new file mode 100644
index 0000000..1a2920a
--- /dev/null
+++ b/runtime/observatory/tests/service/steal_breakpoint_test.dart
@@ -0,0 +1,78 @@
+// Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+// VMOptions=--compile-all --error_on_bad_type --error_on_bad_override --steal-breakpoints
+
+import 'package:observatory/service_io.dart';
+import 'package:unittest/unittest.dart';
+import 'test_helper.dart';
+import 'dart:async';
+
+int counter = 0;
+
+void periodicTask(_) {
+ counter++; // Line 14. We set our breakpoint here.
+ if (counter % 1000 == 0) {
+ print('counter = $counter');
+ }
+}
+
+void startTimer() {
+ new Timer.periodic(const Duration(milliseconds:10), periodicTask);
+}
+
+var tests = [
+
+// Add a breakpoint and wait for it to be reached.
+(Isolate isolate) async {
+ await isolate.rootLib.load();
+
+ // Set up a listener to wait for breakpoint events.
+ Completer completer = new Completer();
+ var subscription;
+ subscription = isolate.vm.events.stream.listen((ServiceEvent event) {
+ if (event.eventType == ServiceEvent.kPauseBreakpoint) {
+ print('Isolate paused at breakpoint');
+ subscription.cancel();
+ completer.complete();
+ }
+ });
+
+ // Add the breakpoint.
+ var script = isolate.rootLib.scripts[0];
+ var result = await isolate.addBreakpoint(script, 14);
+ expect(result is Breakpoint, isTrue);
+
+ await completer.future; // Wait for breakpoint event to fire.
+},
+
+// We are at the breakpoint on line 14.
+(Isolate isolate) async {
+ ServiceMap stack = await isolate.getStack();
+ expect(stack.type, equals('Stack'));
+ expect(stack['frames'].length, greaterThanOrEqualTo(1));
+
+ Script script = stack['frames'][0]['script'];
+ await script.load();
+ expect(script.name,endsWith('steal_breakpoint_test.dart'));
+ expect(script.tokenToLine(stack['frames'][0]['tokenPos']), equals(14));
+},
+
+// Resume
+(Isolate isolate) async {
+ Completer completer = new Completer();
+ var subscription;
+ subscription = isolate.vm.events.stream.listen((ServiceEvent event) {
+ if (event.eventType == ServiceEvent.kResume) {
+ print('Isolate resumed');
+ subscription.cancel();
+ completer.complete();
+ }
+ });
+ isolate.resume();
+ await completer.future;
+},
+
+];
+
+main(args) => runIsolateTests(args, tests, testeeBefore: startTimer);
diff --git a/runtime/observatory/tests/service/string_escaping_test.dart b/runtime/observatory/tests/service/string_escaping_test.dart
index 050b3ce..29b48e6 100644
--- a/runtime/observatory/tests/service/string_escaping_test.dart
+++ b/runtime/observatory/tests/service/string_escaping_test.dart
@@ -1,7 +1,7 @@
// Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// VMOptions=--compile-all --error_on_bad_type --error_on_bad_override --checked
+// VMOptions=--compile-all --error_on_bad_type --error_on_bad_override
library string_escaping_test;
diff --git a/runtime/observatory/tests/service/test_helper.dart b/runtime/observatory/tests/service/test_helper.dart
index 3dddedd..5fd2344 100644
--- a/runtime/observatory/tests/service/test_helper.dart
+++ b/runtime/observatory/tests/service/test_helper.dart
@@ -14,7 +14,7 @@
if (e is! ServiceException) {
return false;
}
- return (e as ServiceException).message == 'WebSocket disconnected';
+ return (e as ServiceException).message == 'WebSocket closed';
}
// This invocation should set up the state being tested.
@@ -23,6 +23,7 @@
class _TestLauncher {
Process process;
final List<String> args;
+ bool killedByTester = false;
_TestLauncher() : args = ['--enable-vm-service:0',
Platform.script.toFilePath(),
@@ -68,6 +69,9 @@
print(line);
});
process.exitCode.then((exitCode) {
+ if ((exitCode != 0) && !killedByTester) {
+ throw "Testee exited with $exitCode";
+ }
print("** Process exited");
});
return completer.future;
@@ -76,7 +80,9 @@
void requestExit() {
print('** Killing script');
- process.kill();
+ if (process.kill()) {
+ killedByTester = true;
+ }
}
}
@@ -106,8 +112,8 @@
var process = new _TestLauncher();
process.launch(pause_on_exit).then((port) {
String addr = 'ws://localhost:$port/ws';
- var testIndex = 0;
- var totalTests = tests.length - 1;
+ var testIndex = 1;
+ var totalTests = tests.length;
var name = Platform.script.pathSegments.last;
runZoned(() {
new WebSocketVM(new WebSocketVMTarget(addr)).load()
@@ -118,6 +124,7 @@
return test(isolate);
})).then((_) => process.requestExit());
}, onError: (e, st) {
+ process.requestExit();
if (!_isWebSocketDisconnect(e)) {
print('Unexpected exception in service tests: $e $st');
throw e;
@@ -167,8 +174,8 @@
var process = new _TestLauncher();
process.launch(pause_on_exit).then((port) async {
String addr = 'ws://localhost:$port/ws';
- var testIndex = 0;
- var totalTests = tests.length - 1;
+ var testIndex = 1;
+ var totalTests = tests.length;
var name = Platform.script.pathSegments.last;
runZoned(() {
new WebSocketVM(new WebSocketVMTarget(addr)).load()
@@ -178,6 +185,7 @@
return test(vm);
})).then((_) => process.requestExit());
}, onError: (e, st) {
+ process.requestExit();
if (!_isWebSocketDisconnect(e)) {
print('Unexpected exception in service tests: $e $st');
throw e;
diff --git a/runtime/observatory/tests/service/type_arguments_test.dart b/runtime/observatory/tests/service/type_arguments_test.dart
index aaa85c7..aa06ade 100644
--- a/runtime/observatory/tests/service/type_arguments_test.dart
+++ b/runtime/observatory/tests/service/type_arguments_test.dart
@@ -1,7 +1,7 @@
// Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// VMOptions=--compile-all --error_on_bad_type --error_on_bad_override --checked
+// VMOptions=--compile-all --error_on_bad_type --error_on_bad_override
import 'package:observatory/service_io.dart';
import 'package:unittest/unittest.dart';
diff --git a/runtime/observatory/tests/service/vm_test.dart b/runtime/observatory/tests/service/vm_test.dart
index aea81ca..1e58d9b 100644
--- a/runtime/observatory/tests/service/vm_test.dart
+++ b/runtime/observatory/tests/service/vm_test.dart
@@ -1,7 +1,7 @@
// Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// VMOptions=--compile-all --error_on_bad_type --error_on_bad_override --checked
+// VMOptions=--compile-all --error_on_bad_type --error_on_bad_override
import 'package:observatory/service_io.dart';
import 'package:unittest/unittest.dart';
diff --git a/runtime/observatory/tests/service/weak_properties_test.dart b/runtime/observatory/tests/service/weak_properties_test.dart
index c37c38f..a7be444 100644
--- a/runtime/observatory/tests/service/weak_properties_test.dart
+++ b/runtime/observatory/tests/service/weak_properties_test.dart
@@ -1,7 +1,7 @@
// Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// VMOptions=--compile-all --error_on_bad_type --error_on_bad_override --checked
+// VMOptions=--compile-all --error_on_bad_type --error_on_bad_override
library vm_references_test;
diff --git a/runtime/observatory/web/main.dart b/runtime/observatory/web/main.dart
index 5880006..09ad356 100644
--- a/runtime/observatory/web/main.dart
+++ b/runtime/observatory/web/main.dart
@@ -21,11 +21,13 @@
Logger.root.info('Starting Observatory');
GoogleChart.initOnce().then((_) {
// Charts loaded, initialize polymer.
- Logger.root.info('Initializing Polymer');
- try {
- initPolymer();
- } catch (e) {
- Logger.root.severe('Error initializing polymer: $e');
- }
+ initPolymer().run(() {
+ Logger.root.info('Polymer initialized');
+ // Code here is in the polymer Zone, which ensures that
+ // @observable properties work correctly.
+ Polymer.onReady.then((_) {
+ Logger.root.info('Polymer elements have been upgraded');
+ });
+ });
});
}
diff --git a/runtime/platform/assert.h b/runtime/platform/assert.h
index 54eb652..a60d85d5 100644
--- a/runtime/platform/assert.h
+++ b/runtime/platform/assert.h
@@ -297,12 +297,14 @@
};
// Macro to concatenate two tokens. The helper is need to proper expansion
// in case an argument is a macro itself.
+#if !defined(COMPILE_ASSERT)
#define COMPILE_ASSERT_JOIN(a, b) COMPILE_ASSERT_JOIN_HELPER(a, b)
#define COMPILE_ASSERT_JOIN_HELPER(a, b) a##b
#define COMPILE_ASSERT(expr) \
DART_UNUSED typedef CompileAssert<(static_cast<bool>(expr))> \
COMPILE_ASSERT_JOIN(CompileAssertTypeDef, __LINE__)[static_cast<bool>(expr) \
? 1 : -1]
+#endif // !defined(COMPILE_ASSERT)
#if defined(TESTING)
diff --git a/runtime/platform/globals.h b/runtime/platform/globals.h
index 1e8b786..6837265 100644
--- a/runtime/platform/globals.h
+++ b/runtime/platform/globals.h
@@ -96,6 +96,8 @@
#error Automatic target os detection failed.
#endif
+namespace dart {
+
struct simd128_value_t {
union {
int32_t int_storage[4];
@@ -377,27 +379,30 @@
// A macro to disallow the copy constructor and operator= functions.
// This should be used in the private: declarations for a class.
+#if !defined(DISALLOW_COPY_AND_ASSIGN)
#define DISALLOW_COPY_AND_ASSIGN(TypeName) \
private: \
TypeName(const TypeName&); \
void operator=(const TypeName&)
-
+#endif // !defined(DISALLOW_COPY_AND_ASSIGN)
// A macro to disallow all the implicit constructors, namely the default
// constructor, copy constructor and operator= functions. This should be
// used in the private: declarations for a class that wants to prevent
// anyone from instantiating it. This is especially useful for classes
// containing only static methods.
+#if !defined(DISALLOW_IMPLICIT_CONSTRUCTORS)
#define DISALLOW_IMPLICIT_CONSTRUCTORS(TypeName) \
private: \
TypeName(); \
DISALLOW_COPY_AND_ASSIGN(TypeName)
-
+#endif // !defined(DISALLOW_IMPLICIT_CONSTRUCTORS)
// Macro to disallow allocation in the C++ heap. This should be used
// in the private section for a class. Don't use UNREACHABLE here to
// avoid circular dependencies between platform/globals.h and
// platform/assert.h.
+#if !defined(DISALLOW_ALLOCATION)
#define DISALLOW_ALLOCATION() \
public: \
void operator delete(void* pointer) { \
@@ -406,7 +411,7 @@
} \
private: \
void* operator new(size_t size);
-
+#endif // !defined(DISALLOW_ALLOCATION)
// The USE(x) template is used to silence C++ compiler warnings issued
// for unused variables.
@@ -543,4 +548,6 @@
#define PRINTF_ATTRIBUTE(string_index, first_to_check)
#endif
+} // namespace dart
+
#endif // PLATFORM_GLOBALS_H_
diff --git a/runtime/tests/vm/vm.status b/runtime/tests/vm/vm.status
index 01622e6..e04f9c2 100644
--- a/runtime/tests/vm/vm.status
+++ b/runtime/tests/vm/vm.status
@@ -40,12 +40,16 @@
cc/ThreadInterrupterMedium: Skip
cc/ThreadInterrupterLow: Skip
-[ $arch == simarm || $arch == simmips ]
+[ $arch == simarm || $arch == simarmv5te || $arch == simarm64 || $arch == simmips ]
cc/ThreadInterrupterHigh: Skip
cc/ThreadInterrupterMedium: Skip
cc/ThreadInterrupterLow: Skip
cc/Service_Profile: Skip
+[ $arch == arm ]
+cc/Int8ListLengthMaxElements: Skip # Issue 23314
+cc/ArrayLengthMaxElements: Skip # Issue 23314
+
[ $compiler == dart2js ]
dart/redirection_type_shuffling_test: Skip # Depends on lazy enforcement of type bounds
dart/byte_array_test: Skip # compilers not aware of byte arrays
@@ -65,6 +69,11 @@
# Data uri's not supported by dart2js or the analyzer.
dart/data_uri*test: Skip
+[ $compiler == dart2js && $cps_ir ]
+dart/error_stacktrace_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+dart/inline_stack_frame_test: Crash # (throw new ExpectException(message)): Unhandled node
+dart/optimized_stacktrace_test: Crash # (throw new ExpectException(message)): Unhandled node
+
[ $runtime == vm ]
dart/data_uri_failures_test/wrongmime: RuntimeError, OK # VM is more restrictive than the browser
dart/data_uri_failures_test/nomime: RuntimeError, OK
@@ -77,6 +86,7 @@
[ $arch == mips ]
cc/StaticNonNullSumCallCodegen: Crash, Pass # Issue 17440
+cc/ArrayLengthMaxElements: Crash # Issue 23275
[ $arch == mips && $mode == debug ]
cc/FindCodeObject: Skip # Takes more than 8 minutes. Issue 17440
diff --git a/runtime/vm/assembler_arm.cc b/runtime/vm/assembler_arm.cc
index ff60bdf..3f50ba8 100644
--- a/runtime/vm/assembler_arm.cc
+++ b/runtime/vm/assembler_arm.cc
@@ -1470,14 +1470,6 @@
}
-void Assembler::svc(uint32_t imm24, Condition cond) {
- ASSERT(cond != kNoCondition);
- ASSERT(imm24 < (1 << 24));
- int32_t encoding = (cond << kConditionShift) | B27 | B26 | B25 | B24 | imm24;
- Emit(encoding);
-}
-
-
void Assembler::bkpt(uint16_t imm16) {
// bkpt requires that the cond field is AL.
int32_t encoding = (AL << kConditionShift) | B24 | B21 |
@@ -3387,7 +3379,8 @@
const uword top_address = heap->TopAddress(space);
LoadImmediate(temp_reg, top_address);
ldr(instance_reg, Address(temp_reg));
- AddImmediate(instance_reg, instance_size);
+ // TODO(koda): Protect against unsigned overflow here.
+ AddImmediateSetFlags(instance_reg, instance_reg, instance_size);
// instance_reg: potential next object start.
const uword end_address = heap->EndAddress(space);
@@ -3434,8 +3427,8 @@
Heap::Space space = heap->SpaceForAllocation(cid);
LoadImmediate(temp1, heap->TopAddress(space));
ldr(instance, Address(temp1, 0)); // Potential new object start.
- AddImmediate(end_address, instance, instance_size);
- b(failure, VS);
+ AddImmediateSetFlags(end_address, instance, instance_size);
+ b(failure, CS); // Branch if unsigned overflow.
// Check if the allocation fits into the remaining space.
// instance: potential new object start.
@@ -3484,7 +3477,7 @@
b(&stop);
Emit(reinterpret_cast<int32_t>(message));
Bind(&stop);
- svc(kStopMessageSvcCode);
+ bkpt(Instr::kStopMessageCode);
}
diff --git a/runtime/vm/assembler_arm.h b/runtime/vm/assembler_arm.h
index 76317d2..e8b72d9 100644
--- a/runtime/vm/assembler_arm.h
+++ b/runtime/vm/assembler_arm.h
@@ -340,7 +340,12 @@
ASSERT(buffer_.pointer_offsets().length() == 0); // No pointers in code.
return buffer_.pointer_offsets();
}
- const GrowableObjectArray& object_pool() const { return object_pool_.data(); }
+
+ const GrowableObjectArray& object_pool_data() const {
+ return object_pool_.data();
+ }
+
+ ObjectPool& object_pool() { return object_pool_; }
bool use_far_branches() const {
return FLAG_use_far_branches || use_far_branches_;
@@ -481,7 +486,6 @@
// Note that gdb sets breakpoints using the undefined instruction 0xe7f001f0.
void bkpt(uint16_t imm16);
- void svc(uint32_t imm24, Condition cond = AL);
// Floating point instructions (VFPv3-D16 and VFPv3-D32 profiles).
void vmovsr(SRegister sn, Register rt, Condition cond = AL);
diff --git a/runtime/vm/assembler_arm64.cc b/runtime/vm/assembler_arm64.cc
index 0045fbd..ef4007f 100644
--- a/runtime/vm/assembler_arm64.cc
+++ b/runtime/vm/assembler_arm64.cc
@@ -221,7 +221,7 @@
Emit(Utils::Low32Bits(reinterpret_cast<int64_t>(message)));
Emit(Utils::High32Bits(reinterpret_cast<int64_t>(message)));
Bind(&stop);
- hlt(Instr::kStopMessageCode);
+ brk(Instr::kStopMessageCode);
}
@@ -1373,7 +1373,8 @@
const uword top_address = heap->TopAddress(space);
LoadImmediate(temp_reg, top_address, pp);
ldr(instance_reg, Address(temp_reg));
- AddImmediate(instance_reg, instance_reg, instance_size, pp);
+ // TODO(koda): Protect against unsigned overflow here.
+ AddImmediateSetFlags(instance_reg, instance_reg, instance_size, pp);
// instance_reg: potential next object start.
const uword end_address = heap->EndAddress(space);
@@ -1418,8 +1419,8 @@
Heap::Space space = heap->SpaceForAllocation(cid);
LoadImmediate(temp1, heap->TopAddress(space), PP);
ldr(instance, Address(temp1, 0)); // Potential new object start.
- AddImmediate(end_address, instance, instance_size, PP);
- b(failure, VS);
+ AddImmediateSetFlags(end_address, instance, instance_size, PP);
+ b(failure, CS); // Fail on unsigned overflow.
// Check if the allocation fits into the remaining space.
// instance: potential new object start.
diff --git a/runtime/vm/assembler_arm64.h b/runtime/vm/assembler_arm64.h
index 30c61d4..90334b9 100644
--- a/runtime/vm/assembler_arm64.h
+++ b/runtime/vm/assembler_arm64.h
@@ -475,7 +475,12 @@
ASSERT(buffer_.pointer_offsets().length() == 0); // No pointers in code.
return buffer_.pointer_offsets();
}
- const GrowableObjectArray& object_pool() const { return object_pool_.data(); }
+
+ const GrowableObjectArray& object_pool_data() const {
+ return object_pool_.data();
+ }
+
+ ObjectPool& object_pool() { return object_pool_; }
bool use_far_branches() const {
return FLAG_use_far_branches || use_far_branches_;
@@ -822,10 +827,7 @@
EmitUnconditionalBranchRegOp(RET, rn);
}
- // Exceptions.
- void hlt(uint16_t imm) {
- EmitExceptionGenOp(HLT, imm);
- }
+ // Breakpoint.
void brk(uint16_t imm) {
EmitExceptionGenOp(BRK, imm);
}
diff --git a/runtime/vm/assembler_arm_test.cc b/runtime/vm/assembler_arm_test.cc
index dc1b56d..a529214 100644
--- a/runtime/vm/assembler_arm_test.cc
+++ b/runtime/vm/assembler_arm_test.cc
@@ -1807,12 +1807,14 @@
ASSEMBLER_TEST_GENERATE(IntDiv_unsupported, assembler) {
#if defined(USING_SIMULATOR)
- bool orig = TargetCPUFeatures::integer_division_supported();
- HostCPUFeatures::set_integer_division_supported(false);
- __ mov(R0, Operand(27));
- __ mov(R1, Operand(9));
- __ IntegerDivide(R0, R0, R1, D0, D1);
- HostCPUFeatures::set_integer_division_supported(orig);
+ if (TargetCPUFeatures::can_divide()) {
+ bool orig = TargetCPUFeatures::integer_division_supported();
+ HostCPUFeatures::set_integer_division_supported(false);
+ __ mov(R0, Operand(27));
+ __ mov(R1, Operand(9));
+ __ IntegerDivide(R0, R0, R1, D0, D1);
+ HostCPUFeatures::set_integer_division_supported(orig);
+ }
__ bx(LR);
#else
if (TargetCPUFeatures::can_divide()) {
diff --git a/runtime/vm/assembler_ia32.h b/runtime/vm/assembler_ia32.h
index edf7634..e00528a 100644
--- a/runtime/vm/assembler_ia32.h
+++ b/runtime/vm/assembler_ia32.h
@@ -302,7 +302,6 @@
public:
explicit Assembler(bool use_far_branches = false)
: buffer_(),
- object_pool_(GrowableObjectArray::Handle()),
prologue_offset_(-1),
jit_cookie_(0),
comments_() {
@@ -801,7 +800,12 @@
const ZoneGrowableArray<intptr_t>& GetPointerOffsets() const {
return buffer_.pointer_offsets();
}
- const GrowableObjectArray& object_pool() const { return object_pool_; }
+
+ const GrowableObjectArray& object_pool_data() const {
+ return object_pool_.data();
+ }
+
+ ObjectPool& object_pool() { return object_pool_; }
void FinalizeInstructions(const MemoryRegion& region) {
buffer_.FinalizeInstructions(region);
@@ -982,7 +986,7 @@
int32_t jit_cookie();
AssemblerBuffer buffer_;
- GrowableObjectArray& object_pool_; // Object pool is not used on ia32.
+ ObjectPool object_pool_;
intptr_t prologue_offset_;
int32_t jit_cookie_;
GrowableArray<CodeComment*> comments_;
diff --git a/runtime/vm/assembler_mips.cc b/runtime/vm/assembler_mips.cc
index 4295cb1..292e140 100644
--- a/runtime/vm/assembler_mips.cc
+++ b/runtime/vm/assembler_mips.cc
@@ -872,6 +872,7 @@
const uword top_address = heap->TopAddress(space);
LoadImmediate(temp_reg, top_address);
lw(instance_reg, Address(temp_reg));
+ // TODO(koda): Protect against unsigned overflow here.
AddImmediate(instance_reg, instance_size);
// instance_reg: potential next object start.
@@ -914,8 +915,9 @@
LoadImmediate(temp1, heap->TopAddress(space));
lw(instance, Address(temp1, 0)); // Potential new object start.
// Potential next object start.
- AddImmediateDetectOverflow(end_address, instance, instance_size, CMPRES1);
- bltz(CMPRES1, failure); // CMPRES1 < 0 on overflow.
+ AddImmediate(end_address, instance, instance_size);
+ // Branch on unsigned overflow.
+ BranchUnsignedLess(end_address, instance, failure);
// Check if the allocation fits into the remaining space.
// instance: potential new object start.
diff --git a/runtime/vm/assembler_mips.h b/runtime/vm/assembler_mips.h
index 62dd303..0ccfb86 100644
--- a/runtime/vm/assembler_mips.h
+++ b/runtime/vm/assembler_mips.h
@@ -262,7 +262,13 @@
const ZoneGrowableArray<intptr_t>& GetPointerOffsets() const {
return buffer_.pointer_offsets();
}
- const GrowableObjectArray& object_pool() const { return object_pool_.data(); }
+
+ const GrowableObjectArray& object_pool_data() const {
+ return object_pool_.data();
+ }
+
+ ObjectPool& object_pool() { return object_pool_; }
+
void FinalizeInstructions(const MemoryRegion& region) {
buffer_.FinalizeInstructions(region);
}
diff --git a/runtime/vm/assembler_x64.cc b/runtime/vm/assembler_x64.cc
index 410d43b..40cb2cf 100644
--- a/runtime/vm/assembler_x64.cc
+++ b/runtime/vm/assembler_x64.cc
@@ -2555,7 +2555,8 @@
void Assembler::j(Condition condition, const ExternalLabel* label) {
Label no_jump;
- j(static_cast<Condition>(condition ^ 1), &no_jump); // Negate condition.
+ // Negate condition.
+ j(static_cast<Condition>(condition ^ 1), &no_jump, Assembler::kNearJump);
jmp(label);
Bind(&no_jump);
}
@@ -2564,7 +2565,8 @@
void Assembler::J(Condition condition, const ExternalLabel* label,
Register pp) {
Label no_jump;
- j(static_cast<Condition>(condition ^ 1), &no_jump); // Negate condition.
+ // Negate condition.
+ j(static_cast<Condition>(condition ^ 1), &no_jump, Assembler::kNearJump);
Jmp(label, pp);
Bind(&no_jump);
}
diff --git a/runtime/vm/assembler_x64.h b/runtime/vm/assembler_x64.h
index 861ccc5..007cc2e 100644
--- a/runtime/vm/assembler_x64.h
+++ b/runtime/vm/assembler_x64.h
@@ -897,7 +897,11 @@
const ZoneGrowableArray<intptr_t>& GetPointerOffsets() const {
return buffer_.pointer_offsets();
}
- const GrowableObjectArray& object_pool() const { return object_pool_.data(); }
+ const GrowableObjectArray& object_pool_data() const {
+ return object_pool_.data();
+ }
+
+ ObjectPool& object_pool() { return object_pool_; }
void FinalizeInstructions(const MemoryRegion& region) {
buffer_.FinalizeInstructions(region);
diff --git a/runtime/vm/ast.cc b/runtime/vm/ast.cc
index 1dd6a8c..b66ad44 100644
--- a/runtime/vm/ast.cc
+++ b/runtime/vm/ast.cc
@@ -559,37 +559,118 @@
AstNode* StaticGetterNode::MakeAssignmentNode(AstNode* rhs) {
- const String& setter_name = String::Handle(Field::SetterName(field_name()));
-
- if (is_super_getter_) {
+ if (is_super_getter()) {
ASSERT(receiver() != NULL);
- // If the static setter is not found in the superclass, noSuchMethod will be
- // called at runtime.
+ const String& setter_name =
+ String::ZoneHandle(Field::SetterSymbol(field_name_));
+ Function& setter = Function::ZoneHandle(
+ Resolver::ResolveDynamicAnyArgs(cls(), setter_name));
+ if (setter.IsNull() || setter.is_abstract()) {
+ // No instance setter found in super class chain,
+ // noSuchMethod will be called at runtime.
+ return new StaticSetterNode(token_pos(),
+ receiver(),
+ cls(),
+ field_name_,
+ rhs);
+ }
return new StaticSetterNode(token_pos(),
receiver(),
- cls(),
- field_name(),
+ field_name_,
+ setter,
rhs);
}
+
+ if (owner().IsLibraryPrefix()) {
+ const LibraryPrefix& prefix = LibraryPrefix::Cast(owner_);
+ // The parser has already dealt with the pathological case where a
+ // library imports itself. See Parser::ResolveIdentInPrefixScope()
+ ASSERT(field_name_.CharAt(0) != Library::kPrivateIdentifierStart);
+
+ // If the prefix is not yet loaded, the getter doesn't exist. Return a
+ // setter that will throw a NSME at runtime.
+ if (!prefix.is_loaded()) {
+ return new StaticSetterNode(token_pos(), NULL, cls(), field_name_, rhs);
+ }
+
+ Object& obj = Object::Handle(prefix.LookupObject(field_name_));
+ if (obj.IsField()) {
+ const Field& field = Field::ZoneHandle(Field::Cast(obj).raw());
+ if (!field.is_final()) {
+ if (Isolate::Current()->TypeChecksEnabled()) {
+ rhs = new AssignableNode(field.token_pos(),
+ rhs,
+ AbstractType::ZoneHandle(field.type()),
+ field_name_);
+ }
+ return new StoreStaticFieldNode(token_pos(), field, rhs);
+ }
+ }
+
+ // No field found in prefix. Look for a setter function.
+ const String& setter_name = String::Handle(Field::SetterName(field_name_));
+ obj = prefix.LookupObject(setter_name);
+ if (obj.IsFunction()) {
+ const Function& setter = Function::ZoneHandle(Function::Cast(obj).raw());
+ ASSERT(setter.is_static() && setter.IsSetterFunction());
+ return new StaticSetterNode(
+ token_pos(), NULL, field_name_, setter, rhs);
+ }
+
+ // No writeable field and no setter found in the prefix. Return a
+ // non-existing setter that will throw an NSM error.
+ return new StaticSetterNode(token_pos(), NULL, cls(), field_name_, rhs);
+ }
+
+ if (owner().IsLibrary()) {
+ const Library& library = Library::Cast(owner());
+ Object& obj = Object::Handle(library.ResolveName(field_name_));
+ if (obj.IsField()) {
+ const Field& field = Field::ZoneHandle(Field::Cast(obj).raw());
+ if (!field.is_final()) {
+ if (Isolate::Current()->TypeChecksEnabled()) {
+ rhs = new AssignableNode(field.token_pos(),
+ rhs,
+ AbstractType::ZoneHandle(field.type()),
+ field_name_);
+ }
+ return new StoreStaticFieldNode(token_pos(), field, rhs);
+ }
+ }
+
+ // No field found in library. Look for a setter function.
+ const String& setter_name = String::Handle(Field::SetterName(field_name_));
+ obj = library.ResolveName(setter_name);
+ if (obj.IsFunction()) {
+ const Function& setter = Function::ZoneHandle(Function::Cast(obj).raw());
+ ASSERT(setter.is_static() && setter.IsSetterFunction());
+ return new StaticSetterNode(token_pos(), NULL, field_name_, setter, rhs);
+ }
+
+ // No writeable field and no setter found in the library. Return a
+ // non-existing setter that will throw an NSM error.
+ return new StaticSetterNode(token_pos(), NULL, cls(), field_name_, rhs);
+ }
+
const Function& setter =
- Function::ZoneHandle(cls().LookupStaticFunction(setter_name));
- if (!setter.IsNull()) {
- return new StaticSetterNode(token_pos(), NULL, cls(), field_name(), rhs);
+ Function::ZoneHandle(cls().LookupSetterFunction(field_name_));
+ if (!setter.IsNull() && setter.IsStaticFunction()) {
+ return new StaticSetterNode(token_pos(), NULL, field_name_, setter, rhs);
}
// Could not find a static setter. Look for a field.
// Access to a lazily initialized static field that has not yet been
// initialized is compiled to a static implicit getter.
// A setter may not exist for such a field.
- const Field& field = Field::ZoneHandle(cls().LookupStaticField(field_name()));
+ const Field& field = Field::ZoneHandle(cls().LookupStaticField(field_name_));
if (!field.IsNull()) {
if (field.is_final()) {
// Attempting to assign to a final variable will cause a NoSuchMethodError
// to be thrown. Change static getter to non-existent static setter in
// order to trigger the throw at runtime.
- return new StaticSetterNode(token_pos(), NULL, cls(), field_name(), rhs);
+ return new StaticSetterNode(token_pos(), NULL, cls(), field_name_, rhs);
}
#if defined(DEBUG)
- const String& getter_name = String::Handle(Field::GetterName(field_name()));
+ const String& getter_name = String::Handle(Field::GetterName(field_name_));
const Function& getter =
Function::Handle(cls().LookupStaticFunction(getter_name));
ASSERT(!getter.IsNull() &&
@@ -604,15 +685,9 @@
}
return new StoreStaticFieldNode(token_pos(), field, rhs);
}
- // Didn't find a static setter or a static field.
- // If this static getter is in an instance function where
- // a receiver is available, we turn this static getter
- // into an instance setter (and will get an error at runtime if an
- // instance setter cannot be found either).
- if (receiver() != NULL) {
- return new InstanceSetterNode(token_pos(), receiver(), field_name(), rhs);
- }
- return new StaticSetterNode(token_pos(), NULL, cls(), field_name(), rhs);
+ // Didn't find a static setter or a static field. Make a call to
+ // the non-existent setter to trigger a NoSuchMethodError at runtime.
+ return new StaticSetterNode(token_pos(), NULL, cls(), field_name_, rhs);
}
diff --git a/runtime/vm/ast.h b/runtime/vm/ast.h
index 6cf6ad1..6da90a5 100644
--- a/runtime/vm/ast.h
+++ b/runtime/vm/ast.h
@@ -34,6 +34,7 @@
V(DoWhile) \
V(For) \
V(Jump) \
+ V(Stop) \
V(ArgumentList) \
V(Array) \
V(Closure) \
@@ -161,35 +162,37 @@
public:
AwaitNode(intptr_t token_pos,
AstNode* expr,
- LocalScope* try_scope,
- int16_t try_index,
- LocalScope* outer_try_scope,
- intptr_t outer_try_index)
+ LocalVariable* saved_try_ctx,
+ LocalVariable* async_saved_try_ctx,
+ LocalVariable* outer_saved_try_ctx,
+ LocalVariable* outer_async_saved_try_ctx)
: AstNode(token_pos),
expr_(expr),
- try_scope_(try_scope),
- try_index_(try_index),
- outer_try_scope_(outer_try_scope),
- outer_try_index_(outer_try_index) { }
+ saved_try_ctx_(saved_try_ctx),
+ async_saved_try_ctx_(async_saved_try_ctx),
+ outer_saved_try_ctx_(outer_saved_try_ctx),
+ outer_async_saved_try_ctx_(outer_async_saved_try_ctx) { }
void VisitChildren(AstNodeVisitor* visitor) const {
expr_->Visit(visitor);
}
AstNode* expr() const { return expr_; }
- LocalScope* try_scope() const { return try_scope_; }
- int16_t try_index() const { return try_index_; }
- LocalScope* outer_try_scope() const { return outer_try_scope_; }
- int16_t outer_try_index() const { return outer_try_index_; }
+ LocalVariable* saved_try_ctx() const { return saved_try_ctx_; }
+ LocalVariable* async_saved_try_ctx() const { return async_saved_try_ctx_; }
+ LocalVariable* outer_saved_try_ctx() const { return outer_saved_try_ctx_; }
+ LocalVariable* outer_async_saved_try_ctx() const {
+ return outer_async_saved_try_ctx_;
+ }
DECLARE_COMMON_NODE_FUNCTIONS(AwaitNode);
private:
AstNode* expr_;
- LocalScope* try_scope_;
- int16_t try_index_;
- LocalScope* outer_try_scope_;
- int16_t outer_try_index_;
+ LocalVariable* saved_try_ctx_;
+ LocalVariable* async_saved_try_ctx_;
+ LocalVariable* outer_saved_try_ctx_;
+ LocalVariable* outer_async_saved_try_ctx_;
DISALLOW_COPY_AND_ASSIGN(AwaitNode);
};
@@ -1141,6 +1144,27 @@
};
+class StopNode : public AstNode {
+ public:
+ StopNode(intptr_t token_pos, const char* message)
+ : AstNode(token_pos),
+ message_(message) {
+ ASSERT(message != NULL);
+ }
+
+ const char* message() const { return message_; }
+
+ virtual void VisitChildren(AstNodeVisitor* visitor) const { }
+
+ DECLARE_COMMON_NODE_FUNCTIONS(StopNode);
+
+ private:
+ const char* message_;
+
+ DISALLOW_IMPLICIT_CONSTRUCTORS(StopNode);
+};
+
+
class LoadLocalNode : public AstNode {
public:
LoadLocalNode(intptr_t token_pos, const LocalVariable* local)
@@ -1262,6 +1286,7 @@
const Field& field() const { return field_; }
void set_is_deferred(bool value) { is_deferred_reference_ = value; }
+ bool is_deferred_reference() const { return is_deferred_reference_; }
virtual void VisitChildren(AstNodeVisitor* visitor) const { }
@@ -1522,30 +1547,36 @@
public:
StaticGetterNode(intptr_t token_pos,
AstNode* receiver,
- bool is_super_getter,
const Class& cls,
const String& field_name)
: AstNode(token_pos),
receiver_(receiver),
+ owner_(Object::ZoneHandle(cls.raw())),
cls_(cls),
field_name_(field_name),
- is_super_getter_(is_super_getter),
is_deferred_reference_(false) {
ASSERT(cls_.IsZoneHandle());
ASSERT(field_name_.IsZoneHandle());
ASSERT(field_name_.IsSymbol());
}
- // The receiver is required
- // 1) for a super getter (an instance method that is resolved at compile
- // time rather than at runtime).
- // 2) when transforming this StaticGetterNode issued in a non-static
- // context to an InstanceSetterNode. This may occurs when we find a
- // static getter, but no field and no static setter are declared.
+ // The receiver is required for a super getter (an instance method that
+ // is resolved at compile time rather than at runtime).
AstNode* receiver() const { return receiver_; }
+
+ // The getter node needs to remmeber how the getter was referenced
+ // so that it can resolve a corresponding setter if necessary.
+ // The owner of this getter is either a class, the top-level library scope,
+ // or a prefix (if the getter has been referenced throug a library prefix).
+ void set_owner(const Object& value) {
+ ASSERT(value.IsLibraryPrefix() || value.IsLibrary() || value.IsClass());
+ owner_ = value.raw();
+ }
+ const Object& owner() const { return owner_; }
+
const Class& cls() const { return cls_; }
const String& field_name() const { return field_name_; }
- bool is_super_getter() const { return is_super_getter_; }
+ bool is_super_getter() const { return receiver_ != NULL; }
void set_is_deferred(bool value) { is_deferred_reference_ = value; }
virtual void VisitChildren(AstNodeVisitor* visitor) const { }
@@ -1559,9 +1590,9 @@
private:
AstNode* receiver_;
+ Object& owner_;
const Class& cls_;
const String& field_name_;
- const bool is_super_getter_;
bool is_deferred_reference_;
DISALLOW_IMPLICIT_CONSTRUCTORS(StaticGetterNode);
@@ -1570,16 +1601,36 @@
class StaticSetterNode : public AstNode {
public:
+ // Static setter with resolved setter function.
+ StaticSetterNode(intptr_t token_pos,
+ AstNode* receiver,
+ const String& field_name,
+ const Function& function,
+ AstNode* value)
+ : AstNode(token_pos),
+ receiver_(receiver),
+ cls_(Class::ZoneHandle(function.Owner())),
+ field_name_(field_name),
+ function_(function),
+ value_(value) {
+ ASSERT(function_.IsZoneHandle());
+ ASSERT(function.is_static() || receiver != NULL);
+ ASSERT(field_name_.IsZoneHandle());
+ ASSERT(value_ != NULL);
+ }
+
+ // For unresolved setters.
StaticSetterNode(intptr_t token_pos,
AstNode* receiver,
const Class& cls,
const String& field_name,
AstNode* value)
- : AstNode(token_pos),
- receiver_(receiver),
- cls_(cls),
- field_name_(field_name),
- value_(value) {
+ : AstNode(token_pos),
+ receiver_(receiver),
+ cls_(cls),
+ field_name_(field_name),
+ function_(Function::ZoneHandle()),
+ value_(value) {
ASSERT(cls_.IsZoneHandle());
ASSERT(field_name_.IsZoneHandle());
ASSERT(value_ != NULL);
@@ -1590,6 +1641,8 @@
AstNode* receiver() const { return receiver_; }
const Class& cls() const { return cls_; }
const String& field_name() const { return field_name_; }
+ // function() returns null for unresolved setters.
+ const Function& function() const { return function_; }
AstNode* value() const { return value_; }
virtual void VisitChildren(AstNodeVisitor* visitor) const {
@@ -1602,6 +1655,7 @@
AstNode* receiver_;
const Class& cls_;
const String& field_name_;
+ const Function& function_;
AstNode* value_;
DISALLOW_IMPLICIT_CONSTRUCTORS(StaticSetterNode);
diff --git a/runtime/vm/ast_printer.cc b/runtime/vm/ast_printer.cc
index 4d89c9b8..8197dd9 100644
--- a/runtime/vm/ast_printer.cc
+++ b/runtime/vm/ast_printer.cc
@@ -427,6 +427,11 @@
}
+void AstPrinter::VisitStopNode(StopNode* node) {
+ ISL_Print("(%s %s)", node->PrettyName(), node->message());
+}
+
+
void AstPrinter::VisitInlinedFinallyNode(InlinedFinallyNode* node) {
VisitGenericAstNode(node);
}
diff --git a/runtime/vm/ast_transformer.cc b/runtime/vm/ast_transformer.cc
index 8284a64..b6d20c1 100644
--- a/runtime/vm/ast_transformer.cc
+++ b/runtime/vm/ast_transformer.cc
@@ -26,6 +26,7 @@
V(InlinedFinally) \
V(For) \
V(Jump) \
+ V(Stop) \
V(LoadInstanceField) \
V(NativeBody) \
V(Primary) \
@@ -107,30 +108,6 @@
}
-// Restore the currently relevant :saved_try_context_var on the stack
-// from the captured :async_saved_try_ctx_var_<try_index>.
-AstNode* AwaitTransformer::RestoreSavedTryContext(Zone* zone,
- LocalScope* scope,
- int16_t try_index) {
- LocalVariable* saved_try_ctx =
- scope->LocalLookupVariable(Symbols::SavedTryContextVar());
- ASSERT((saved_try_ctx != NULL) && !saved_try_ctx->is_captured());
- const String& async_saved_try_ctx_name = String::ZoneHandle(zone,
- Symbols::New(String::Handle(zone,
- String::NewFormatted("%s%d",
- Symbols::AsyncSavedTryCtxVarPrefix().ToCString(),
- try_index))));
- LocalVariable* async_saved_try_ctx =
- scope->LocalLookupVariable(async_saved_try_ctx_name);
- ASSERT(async_saved_try_ctx != NULL);
- ASSERT(async_saved_try_ctx->is_captured());
- return new (zone) StoreLocalNode(
- Scanner::kNoSourcePos,
- saved_try_ctx,
- new (zone) LoadLocalNode(Scanner::kNoSourcePos, async_saved_try_ctx));
-}
-
-
void AwaitTransformer::VisitAwaitNode(AwaitNode* node) {
// Await transformation:
//
@@ -236,17 +213,21 @@
// If this expression is part of a try block, also append the code for
// restoring the saved try context that lives on the stack and possibly the
// saved try context of the outer try block.
- if (node->try_scope() != NULL) {
- preamble_->Add(RestoreSavedTryContext(Z,
- node->try_scope(),
- node->try_index()));
- if (node->outer_try_scope() != NULL) {
- preamble_->Add(RestoreSavedTryContext(Z,
- node->outer_try_scope(),
- node->outer_try_index()));
+ if (node->saved_try_ctx() != NULL) {
+ preamble_->Add(new (Z) StoreLocalNode(
+ Scanner::kNoSourcePos,
+ node->saved_try_ctx(),
+ new (Z) LoadLocalNode(Scanner::kNoSourcePos,
+ node->async_saved_try_ctx())));
+ if (node->outer_saved_try_ctx() != NULL) {
+ preamble_->Add(new (Z) StoreLocalNode(
+ Scanner::kNoSourcePos,
+ node->outer_saved_try_ctx(),
+ new (Z) LoadLocalNode(Scanner::kNoSourcePos,
+ node->outer_async_saved_try_ctx())));
}
} else {
- ASSERT(node->outer_try_scope() == NULL);
+ ASSERT(node->outer_saved_try_ctx() == NULL);
}
LoadLocalNode* load_error_param = new (Z) LoadLocalNode(
@@ -513,12 +494,13 @@
if (new_receiver != NULL) {
new_receiver = Transform(new_receiver);
}
- LocalVariable* result = AddToPreambleNewTempVar(
+ StaticGetterNode* new_getter =
new(Z) StaticGetterNode(node->token_pos(),
new_receiver,
- node->is_super_getter(),
node->cls(),
- node->field_name()));
+ node->field_name());
+ new_getter->set_owner(node->owner());
+ LocalVariable* result = AddToPreambleNewTempVar(new_getter);
result_ = new(Z) LoadLocalNode(Scanner::kNoSourcePos, result);
}
@@ -529,12 +511,20 @@
new_receiver = Transform(new_receiver);
}
AstNode* new_value = Transform(node->value());
- LocalVariable* result = AddToPreambleNewTempVar(
- new(Z) StaticSetterNode(node->token_pos(),
- new_receiver,
- node->cls(),
- node->field_name(),
- new_value));
+ StaticSetterNode* new_setter =
+ node->function().IsNull()
+ ? new(Z) StaticSetterNode(node->token_pos(),
+ new_receiver,
+ node->cls(),
+ node->field_name(),
+ new_value)
+ : new(Z) StaticSetterNode(node->token_pos(),
+ new_receiver,
+ node->field_name(),
+ node->function(),
+ new_value);
+
+ LocalVariable* result = AddToPreambleNewTempVar(new_setter);
result_ = new(Z) LoadLocalNode(Scanner::kNoSourcePos, result);
}
diff --git a/runtime/vm/ast_transformer.h b/runtime/vm/ast_transformer.h
index 9291c13..807f7cf 100644
--- a/runtime/vm/ast_transformer.h
+++ b/runtime/vm/ast_transformer.h
@@ -49,10 +49,6 @@
AstNode* Transform(AstNode* expr);
- static AstNode* RestoreSavedTryContext(Zone* zone,
- LocalScope* scope,
- int16_t try_index);
-
private:
LocalVariable* EnsureCurrentTempVar();
LocalVariable* AddToPreambleNewTempVar(AstNode* node);
diff --git a/runtime/vm/bootstrap_natives.h b/runtime/vm/bootstrap_natives.h
index f0ff462..33d401e 100644
--- a/runtime/vm/bootstrap_natives.h
+++ b/runtime/vm/bootstrap_natives.h
@@ -297,9 +297,10 @@
V(Mirrors_evalInLibraryWithPrivateKey, 2) \
V(Mirrors_makeLocalClassMirror, 1) \
V(Mirrors_makeLocalTypeMirror, 1) \
- V(Mirrors_makeLocalMirrorSystem, 0) \
V(Mirrors_mangleName, 2) \
V(MirrorReference_equals, 2) \
+ V(MirrorSystem_libraries, 0) \
+ V(MirrorSystem_isolate, 0) \
V(InstanceMirror_invoke, 5) \
V(InstanceMirror_invokeGetter, 3) \
V(InstanceMirror_invokeSetter, 4) \
@@ -307,7 +308,7 @@
V(ClosureMirror_function, 1) \
V(TypeMirror_subtypeTest, 2) \
V(TypeMirror_moreSpecificTest, 2) \
- V(ClassMirror_library, 1) \
+ V(ClassMirror_libraryUri, 1) \
V(ClassMirror_supertype, 1) \
V(ClassMirror_supertype_instantiated, 1) \
V(ClassMirror_interfaces, 1) \
@@ -324,6 +325,7 @@
V(ClassMirror_invokeConstructor, 5) \
V(ClassMirror_type_variables, 1) \
V(ClassMirror_type_arguments, 1) \
+ V(LibraryMirror_fromPrefix, 1) \
V(LibraryMirror_invoke, 5) \
V(LibraryMirror_invokeGetter, 3) \
V(LibraryMirror_invokeSetter, 4) \
@@ -350,6 +352,8 @@
V(GrowableList_setLength, 2) \
V(GrowableList_setData, 2) \
V(Internal_makeListFixedLength, 1) \
+ V(Internal_makeFixedListUnmodifiable, 1) \
+ V(Internal_inquireIs64Bit, 0) \
V(LinkedHashMap_allocate, 1) \
V(LinkedHashMap_getLength, 1) \
V(LinkedHashMap_insertOrUpdate, 3) \
diff --git a/runtime/vm/class_finalizer.cc b/runtime/vm/class_finalizer.cc
index 1ea33f3..5c59b2e 100644
--- a/runtime/vm/class_finalizer.cc
+++ b/runtime/vm/class_finalizer.cc
@@ -2320,7 +2320,7 @@
if (cls.is_finalized()) {
return;
}
- if (false && cls.is_patch()) {
+ if (cls.is_patch()) {
// The fields and functions of a patch class are copied to the
// patched class after parsing. There is nothing to finalize.
ASSERT(Array::Handle(cls.functions()).Length() == 0);
diff --git a/runtime/vm/class_table.cc b/runtime/vm/class_table.cc
index d9dfd76..8ec699b 100644
--- a/runtime/vm/class_table.cc
+++ b/runtime/vm/class_table.cc
@@ -304,7 +304,6 @@
void ClassHeapStats::PrintToJSONObject(const Class& cls,
JSONObject* obj) const {
obj->AddProperty("type", "ClassHeapStats");
- obj->AddPropertyF("id", "allocationprofile/%" Pd "", cls.id());
obj->AddProperty("class", cls);
{
JSONArray new_stats(obj, "new");
@@ -423,7 +422,6 @@
ASSERT(heap != NULL);
JSONObject obj(stream);
obj.AddProperty("type", "AllocationProfile");
- obj.AddProperty("id", "allocationprofile");
obj.AddPropertyF(
"dateLastAccumulatorReset",
"%" Pd64 "",
diff --git a/runtime/vm/code_generator.cc b/runtime/vm/code_generator.cc
index 755cc40..1cd7e14 100644
--- a/runtime/vm/code_generator.cc
+++ b/runtime/vm/code_generator.cc
@@ -1242,8 +1242,13 @@
if (!CanOptimizeFunction(function, isolate) || function.is_intrinsic()) {
return;
}
+
+ // The unoptimized code is on the stack and should never be detached from
+ // the function at this point.
+ ASSERT(function.unoptimized_code() != Object::null());
intptr_t osr_id =
Code::Handle(function.unoptimized_code()).GetDeoptIdForOsr(frame->pc());
+ ASSERT(osr_id != Isolate::kNoDeoptId);
if (FLAG_trace_osr) {
OS::Print("Attempting OSR for %s at id=%" Pd ", count=%" Pd "\n",
function.ToFullyQualifiedCString(),
@@ -1434,14 +1439,21 @@
void DeoptimizeAt(const Code& optimized_code, uword pc) {
ASSERT(optimized_code.is_optimized());
+ Thread* thread = Thread::Current();
+ Zone* zone = thread->zone();
ICData::DeoptReasonId deopt_reason = ICData::kDeoptUnknown;
uint32_t deopt_flags = 0;
- const TypedData& deopt_info = TypedData::Handle(
+ const TypedData& deopt_info = TypedData::Handle(zone,
optimized_code.GetDeoptInfoAtPc(pc, &deopt_reason, &deopt_flags));
ASSERT(!deopt_info.IsNull());
- const Function& function = Function::Handle(optimized_code.function());
- Compiler::EnsureUnoptimizedCode(Thread::Current(), function);
- const Code& unoptimized_code = Code::Handle(function.unoptimized_code());
+ const Function& function = Function::Handle(zone, optimized_code.function());
+ const Error& error =
+ Error::Handle(zone, Compiler::EnsureUnoptimizedCode(thread, function));
+ if (!error.IsNull()) {
+ Exceptions::PropagateError(error);
+ }
+ const Code& unoptimized_code =
+ Code::Handle(zone, function.unoptimized_code());
ASSERT(!unoptimized_code.IsNull());
// The switch to unoptimized code may have already occurred.
if (function.HasOptimizedCode()) {
@@ -1452,7 +1464,7 @@
uword lazy_deopt_jump = optimized_code.GetLazyDeoptPc();
ASSERT(lazy_deopt_jump != 0);
const Instructions& instrs =
- Instructions::Handle(optimized_code.instructions());
+ Instructions::Handle(zone, optimized_code.instructions());
{
WritableInstructionsScope writable(instrs.EntryPoint(), instrs.size());
CodePatcher::InsertCallAt(pc, lazy_deopt_jump);
@@ -1573,7 +1585,7 @@
// The code will be the same as before.
ASSERT(code.raw() == optimized_code.raw());
- // Some sanity checking of the optimized/unoptimized code.
+ // Some sanity checking of the optimized code.
ASSERT(!optimized_code.IsNull() && optimized_code.is_optimized());
}
#endif
diff --git a/runtime/vm/code_patcher.cc b/runtime/vm/code_patcher.cc
index 9ecc06c..d579577 100644
--- a/runtime/vm/code_patcher.cc
+++ b/runtime/vm/code_patcher.cc
@@ -52,6 +52,7 @@
// The patch code buffer contains the jmp code which will be inserted at
// entry point.
void CodePatcher::PatchEntry(const Code& code) {
+ ASSERT(!IsEntryPatched(code));
const uword patch_addr = code.GetEntryPatchPc();
ASSERT(patch_addr != 0);
JumpPattern jmp_entry(patch_addr, code);
@@ -76,6 +77,7 @@
// The entry point is a jmp instruction, the patch code buffer contains
// original code, the entry point contains the jump instruction.
void CodePatcher::RestoreEntry(const Code& code) {
+ if (!IsEntryPatched(code)) return;
const uword patch_addr = code.GetEntryPatchPc();
ASSERT(patch_addr != 0);
JumpPattern jmp_entry(patch_addr, code);
diff --git a/runtime/vm/compiler.cc b/runtime/vm/compiler.cc
index 47bd2ba..88f20af 100644
--- a/runtime/vm/compiler.cc
+++ b/runtime/vm/compiler.cc
@@ -169,8 +169,8 @@
DEFINE_RUNTIME_ENTRY(CompileFunction, 1) {
const Function& function = Function::CheckedHandle(arguments.ArgAt(0));
ASSERT(!function.HasCode());
- const Error& error = Error::Handle(Compiler::CompileFunction(thread,
- function));
+ const Error& error =
+ Error::Handle(Compiler::CompileFunction(thread, function));
if (!error.IsNull()) {
Exceptions::PropagateError(error);
}
@@ -470,13 +470,13 @@
GrowableArray<const Function*> inline_id_to_function;
// For a given inlining-id(index) specifies the caller's inlining-id.
GrowableArray<intptr_t> caller_inline_id;
- inline_id_to_function.Add(&function);
- // Top scope function has no caller (-1).
- caller_inline_id.Add(-1);
// Collect all instance fields that are loaded in the graph and
// have non-generic type feedback attached to them that can
// potentially affect optimizations.
if (optimized) {
+ inline_id_to_function.Add(&function);
+ // Top scope function has no caller (-1).
+ caller_inline_id.Add(-1);
TimerScope timer(FLAG_compiler_stats,
&CompilerStats::graphoptimizer_timer,
isolate);
@@ -719,6 +719,10 @@
TimerScope timer(FLAG_compiler_stats,
&CompilerStats::codefinalizer_timer,
isolate);
+ // CreateDeoptInfo uses the object pool and needs to be done before
+ // FinalizeCode.
+ const Array& deopt_info_array = Array::Handle(
+ graph_compiler.CreateDeoptInfo(&assembler));
const Code& code = Code::Handle(
Code::FinalizeCode(function, &assembler, optimized));
code.set_is_optimized(optimized);
@@ -726,7 +730,7 @@
code.set_inlined_id_to_function(
Array::Handle(graph_compiler.InliningIdToFunction()));
graph_compiler.FinalizePcDescriptors(code);
- graph_compiler.FinalizeDeoptInfo(code);
+ code.set_deopt_info_array(deopt_info_array);
graph_compiler.FinalizeStackmaps(code);
graph_compiler.FinalizeVarDescriptors(code);
graph_compiler.FinalizeExceptionHandlers(code);
@@ -862,18 +866,7 @@
ISL_Print("}\n");
}
- const Array& object_table = Array::Handle(code.object_table());
- if (object_table.Length() > 0) {
- ISL_Print("Object Table: {\n");
- for (intptr_t i = 0; i < object_table.Length(); i++) {
- ISL_Print(" %" Pd ": %s\n", i,
- Object::Handle(object_table.At(i)).ToCString());
- }
- ISL_Print("}\n");
- }
-
- const Array& object_pool = Array::Handle(
- Instructions::Handle(code.instructions()).object_pool());
+ const Array& object_pool = Array::Handle(code.ObjectPool());
if (object_pool.Length() > 0) {
ISL_Print("Object Pool: {\n");
for (intptr_t i = 0; i < object_pool.Length(); i++) {
@@ -976,6 +969,16 @@
TIMERSCOPE(isolate, time_compilation);
Timer per_compile_timer(FLAG_trace_compiler, "Compilation time");
per_compile_timer.Start();
+
+ // Restore unoptimized code if needed.
+ if (optimized) {
+ const Error& error = Error::Handle(
+ zone, Compiler::EnsureUnoptimizedCode(Thread::Current(), function));
+ if (!error.IsNull()) {
+ return error.raw();
+ }
+ }
+
ParsedFunction* parsed_function = new(zone) ParsedFunction(
thread, Function::ZoneHandle(zone, function.raw()));
if (FLAG_trace_compiler) {
@@ -1058,10 +1061,10 @@
}
-void Compiler::EnsureUnoptimizedCode(Thread* thread,
+RawError* Compiler::EnsureUnoptimizedCode(Thread* thread,
const Function& function) {
if (function.unoptimized_code() != Object::null()) {
- return;
+ return Error::null();
}
Code& original_code = Code::ZoneHandle(thread->zone());
if (function.HasCode()) {
@@ -1072,7 +1075,7 @@
const Error& error = Error::Handle(
CompileFunctionHelper(pipeline, function, false, Isolate::kNoDeoptId));
if (!error.IsNull()) {
- Exceptions::PropagateError(error);
+ return error.raw();
}
// Since CompileFunctionHelper replaces the current code, re-attach the
// the original code if the function was already compiled.
@@ -1084,6 +1087,7 @@
if (FLAG_trace_compiler) {
ISL_Print("Ensure unoptimized code for %s\n", function.ToCString());
}
+ return Error::null();
}
diff --git a/runtime/vm/compiler.h b/runtime/vm/compiler.h
index 0e1f144..e319956 100644
--- a/runtime/vm/compiler.h
+++ b/runtime/vm/compiler.h
@@ -42,7 +42,8 @@
static RawError* CompileFunction(Thread* thread, const Function& function);
// Generates unoptimized code if not present, current code is unchanged.
- static void EnsureUnoptimizedCode(Thread* thread, const Function& function);
+ static RawError* EnsureUnoptimizedCode(Thread* thread,
+ const Function& function);
// Generates optimized code for function.
//
diff --git a/runtime/vm/compiler_test.cc b/runtime/vm/compiler_test.cc
index 43649e33c..1351fbc 100644
--- a/runtime/vm/compiler_test.cc
+++ b/runtime/vm/compiler_test.cc
@@ -54,7 +54,7 @@
Function::Handle(cls.LookupStaticFunction(function_foo_name));
EXPECT(!function_foo.IsNull());
String& function_source = String::Handle(function_foo.GetSource());
- EXPECT_STREQ("static foo() { return 42; }\n ", function_source.ToCString());
+ EXPECT_STREQ("static foo() { return 42; }", function_source.ToCString());
EXPECT(CompilerTest::TestCompileFunction(function_foo));
EXPECT(function_foo.HasCode());
@@ -66,7 +66,7 @@
EXPECT(CompilerTest::TestCompileFunction(function_moo));
EXPECT(function_moo.HasCode());
function_source = function_moo.GetSource();
- EXPECT_STREQ("static moo() {\n // A.foo();\n }\n",
+ EXPECT_STREQ("static moo() {\n // A.foo();\n }",
function_source.ToCString());
}
diff --git a/runtime/vm/constant_propagator.cc b/runtime/vm/constant_propagator.cc
index 8cf0295..35ee3cc 100644
--- a/runtime/vm/constant_propagator.cc
+++ b/runtime/vm/constant_propagator.cc
@@ -182,6 +182,11 @@
}
+void ConstantPropagator::VisitStop(StopInstr* instr) {
+ // Nothing to do.
+}
+
+
void ConstantPropagator::VisitGoto(GotoInstr* instr) {
SetReachable(instr->successor());
diff --git a/runtime/vm/constants_arm.h b/runtime/vm/constants_arm.h
index 15a1a4f..322676c 100644
--- a/runtime/vm/constants_arm.h
+++ b/runtime/vm/constants_arm.h
@@ -235,6 +235,7 @@
const Register PP = R10; // Caches object pool pointer in generated code.
const Register SPREG = SP; // Stack pointer register.
const Register FPREG = FP; // Frame pointer register.
+const Register LRREG = LR; // Link register.
const Register ICREG = R5; // IC data register.
const Register ARGS_DESC_REG = R4;
@@ -339,13 +340,6 @@
};
-// Special Supervisor Call 24-bit codes used in the presence of the ARM
-// simulator for redirection, breakpoints, and stop messages.
-// See /usr/include/asm/unistd.h
-const uint32_t kRedirectionSvcCode = 0x90001f; // unused syscall, was sys_stty
-const uint32_t kBreakpointSvcCode = 0x900020; // unused syscall, was sys_gtty
-const uint32_t kStopMessageSvcCode = 0x9f0001; // __ARM_NR_breakpoint
-
// Constants used for the decoding or encoding of the individual fields of
// instructions. Based on the "Figure 3-1 ARM instruction set summary".
enum InstructionFields {
@@ -447,6 +441,11 @@
static const int32_t kNopInstruction = // nop
((AL << kConditionShift) | (0x32 << 20) | (0xf << 12));
+ static const int32_t kBreakPointCode = 0xdeb0; // For breakpoint.
+ static const int32_t kStopMessageCode = 0xdeb1; // For Stop(message).
+ static const int32_t kSimulatorBreakCode = 0xdeb2; // For breakpoint in sim.
+ static const int32_t kSimulatorRedirectCode = 0xca11; // For redirection.
+
// Breakpoint instruction filling assembler code buffers in debug mode.
static const int32_t kBreakPointInstruction = // bkpt(0xdeb0)
((AL << kConditionShift) | (0x12 << 20) | (0xdeb << 8) | (0x7 << 4));
@@ -456,11 +455,11 @@
// breakpoint inserted in generated code for debugging, e.g. bkpt(0).
static const int32_t kSimulatorBreakpointInstruction =
// svc #kBreakpointSvcCode
- ((AL << kConditionShift) | (0xf << 24) | kBreakpointSvcCode);
+ ((AL << kConditionShift) | (0xf << 24) | kSimulatorBreakCode);
// Runtime call redirection instruction used by the simulator.
static const int32_t kSimulatorRedirectInstruction =
- ((AL << kConditionShift) | (0xf << 24) | kRedirectionSvcCode);
+ ((AL << kConditionShift) | (0xf << 24) | kSimulatorRedirectCode);
// Get the raw instruction bits.
inline int32_t InstructionBits() const {
diff --git a/runtime/vm/constants_arm64.h b/runtime/vm/constants_arm64.h
index 61d9431..85f98d0 100644
--- a/runtime/vm/constants_arm64.h
+++ b/runtime/vm/constants_arm64.h
@@ -114,6 +114,7 @@
const Register kNoPP = kNoRegister;
const Register FPREG = FP; // Frame pointer register.
const Register SPREG = R18; // Stack pointer register.
+const Register LRREG = LR; // Link register.
const Register ICREG = R5; // IC data register.
const Register ARGS_DESC_REG = R4; // Arguments descriptor register.
@@ -799,8 +800,7 @@
// Reserved brk and hlt instruction codes.
static const int32_t kBreakPointCode = 0xdeb0; // For breakpoint.
static const int32_t kStopMessageCode = 0xdeb1; // For Stop(message).
- static const int32_t kSimulatorMessageCode = 0xdeb2; // For trace msg in sim.
- static const int32_t kSimulatorBreakCode = 0xdeb3; // For breakpoint in sim.
+ static const int32_t kSimulatorBreakCode = 0xdeb2; // For breakpoint in sim.
static const int32_t kSimulatorRedirectCode = 0xca11; // For redirection.
// Breakpoint instruction filling assembler code buffers in debug mode.
@@ -814,7 +814,7 @@
HLT | (kSimulatorBreakCode << kImm16Shift);
// Runtime call redirection instruction used by the simulator.
- static const int32_t kRedirectInstruction =
+ static const int32_t kSimulatorRedirectInstruction =
HLT | (kSimulatorRedirectCode << kImm16Shift);
// Read one particular bit out of the instruction bits.
diff --git a/runtime/vm/constants_mips.h b/runtime/vm/constants_mips.h
index 067d69c..e9a76a4 100644
--- a/runtime/vm/constants_mips.h
+++ b/runtime/vm/constants_mips.h
@@ -182,6 +182,7 @@
const Register PP = S7; // Caches object pool pointer in generated code.
const Register SPREG = SP; // Stack pointer register.
const Register FPREG = FP; // Frame pointer register.
+const Register LRREG = RA; // Link register.
const Register ICREG = S5; // IC data register.
const Register ARGS_DESC_REG = S4;
@@ -467,8 +468,7 @@
// Reserved break instruction codes.
static const int32_t kBreakPointCode = 0xdeb0; // For breakpoint.
static const int32_t kStopMessageCode = 0xdeb1; // For Stop(message).
- static const int32_t kSimulatorMessageCode = 0xdeb2; // For trace msg in sim.
- static const int32_t kSimulatorBreakCode = 0xdeb3; // For breakpoint in sim.
+ static const int32_t kSimulatorBreakCode = 0xdeb2; // For breakpoint in sim.
static const int32_t kSimulatorRedirectCode = 0xca11; // For redirection.
static const int32_t kBreakPointZeroInstruction =
diff --git a/runtime/vm/coverage.cc b/runtime/vm/coverage.cc
index d756fd9..ee74763 100644
--- a/runtime/vm/coverage.cc
+++ b/runtime/vm/coverage.cc
@@ -9,6 +9,7 @@
#include "vm/compiler.h"
#include "vm/isolate.h"
#include "vm/json_stream.h"
+#include "vm/longjump.h"
#include "vm/object.h"
#include "vm/object_store.h"
@@ -56,38 +57,36 @@
const JSONArray& hits_or_sites,
const GrowableArray<intptr_t>& pos_to_line,
bool as_call_sites) {
+ // If the function should not be compiled for coverage analysis, then just
+ // skip this method.
+ // TODO(iposva): Maybe we should skip synthesized methods in general too.
+ if (function.is_abstract() || function.IsRedirectingFactory()) {
+ return;
+ }
+ if (function.IsNonImplicitClosureFunction() &&
+ (function.context_scope() == ContextScope::null())) {
+ // TODO(iposva): This can arise if we attempt to compile an inner function
+ // before we have compiled its enclosing function or if the enclosing
+ // function failed to compile.
+ return;
+ }
Thread* thread = Thread::Current();
Zone* zone = thread->zone();
Isolate* isolate = thread->isolate();
- if (!function.HasCode()) {
- // If the function should not be compiled or if the compilation failed,
- // then just skip this method.
- // TODO(iposva): Maybe we should skip synthesized methods in general too.
- if (function.is_abstract() || function.IsRedirectingFactory()) {
- return;
- }
- if (function.IsNonImplicitClosureFunction() &&
- (function.context_scope() == ContextScope::null())) {
- // TODO(iposva): This can arise if we attempt to compile an inner function
- // before we have compiled its enclosing function or if the enclosing
- // function failed to compile.
- return;
- }
- const Error& err = Error::Handle(
- zone, Compiler::CompileFunction(thread, function));
- if (!err.IsNull()) {
- return;
- }
+ // Make sure we have the unoptimized code for this function available.
+ if (Compiler::EnsureUnoptimizedCode(thread, function) != Error::null()) {
+ // Ignore the error and this function entirely.
+ return;
}
- ASSERT(function.HasCode());
+ const Code& code = Code::Handle(zone, function.unoptimized_code());
+ ASSERT(!code.IsNull());
// Print the hit counts for all IC datas.
ZoneGrowableArray<const ICData*>* ic_data_array =
new(zone) ZoneGrowableArray<const ICData*>();
function.RestoreICDataMap(ic_data_array);
- const Code& code = Code::Handle(function.unoptimized_code());
const PcDescriptors& descriptors = PcDescriptors::Handle(
- code.pc_descriptors());
+ zone, code.pc_descriptors());
const intptr_t begin_pos = function.token_pos();
const intptr_t end_pos = function.end_token_pos();
@@ -107,7 +106,7 @@
}
intptr_t line = pos_to_line[token_pos];
#if defined(DEBUG)
- const Script& script = Script::Handle(function.script());
+ const Script& script = Script::Handle(zone, function.script());
intptr_t test_line = -1;
script.GetTokenLocation(token_pos, &test_line, NULL);
ASSERT(test_line == line);
diff --git a/runtime/vm/cpu_arm.cc b/runtime/vm/cpu_arm.cc
index 49af1e6..fca5308 100644
--- a/runtime/vm/cpu_arm.cc
+++ b/runtime/vm/cpu_arm.cc
@@ -18,15 +18,63 @@
#include <unistd.h> /* NOLINT */
#endif
+// ARM version differences.
+// We support three major 32-bit ARM ISA versions: ARMv5TE, ARMv6 and variants,
+// and ARMv7 and variants. For each of these we detect the presence of vfp,
+// neon, and integer division instructions. Considering ARMv5TE as the baseline,
+// later versions add the following features/instructions that we use:
+//
+// ARMv6:
+// - PC read offset in store instructions is 8 rather than 12, matching the
+// offset in read instructions,
+// - strex, ldrex, and clrex load/store/clear exclusive instructions,
+// - umaal multiplication instruction,
+// ARMv7:
+// - movw, movt 16-bit immediate load instructions,
+// - mls multiplication instruction,
+// - vmovs, vmovd floating point immediate load instructions.
+//
+// If an aarch64 CPU is detected, we generate ARMv7 code.
+//
+// If an instruction is missing on ARMv5TE or ARMv6, we emulate it, if possible.
+// Where we are missing vfp, we do not unbox doubles, or generate intrinsics for
+// floating point operations. Where we are missing neon, we do not unbox SIMD
+// values, or inline operations on SIMD values. Where we are missing integer
+// division, we do not inline division operations, and we do not generate
+// intrinsics that do division. See the feature tests in flow_graph_optimizer.cc
+// for details.
+//
+// Alignment:
+//
+// Before ARMv6, that is only for ARMv5TE, unaligned accesses will cause a
+// crash. This includes the ldrd and strd instructions, which must use addresses
+// that are 8-byte aligned. Since we don't always guarantee that for our uses
+// of ldrd and strd, these instructions are emulated with two load or store
+// instructions on ARMv5TE. On ARMv6 and on, we assume that the kernel is
+// set up to fixup unaligned accesses. This can be verified by checking
+// /proc/cpu/alignment on modern Linux systems.
+
namespace dart {
+// TODO(zra): Add a target for ARMv6.
+#if defined(TARGET_ARCH_ARM_5TE)
+DEFINE_FLAG(bool, use_vfp, false, "Use vfp instructions if supported");
+DEFINE_FLAG(bool, use_neon, false, "Use neon instructions if supported");
+DEFINE_FLAG(bool, use_integer_division, false,
+ "Use integer division instruction if supported");
+#else
DEFINE_FLAG(bool, use_vfp, true, "Use vfp instructions if supported");
DEFINE_FLAG(bool, use_neon, true, "Use neon instructions if supported");
+DEFINE_FLAG(bool, use_integer_division, true,
+ "Use integer division instruction if supported");
+#endif
+
#if !defined(HOST_ARCH_ARM)
-DEFINE_FLAG(bool, sim_use_armv7, true, "Use all ARMv7 instructions");
-DEFINE_FLAG(bool, sim_use_armv5te, false, "Restrict to ARMv5TE instructions");
-DEFINE_FLAG(bool, sim_use_armv6, false, "Restrict to ARMv6 instructions");
+#if defined(TARGET_ARCH_ARM_5TE)
DEFINE_FLAG(bool, sim_use_hardfp, false, "Use the softfp ABI.");
+#else
+DEFINE_FLAG(bool, sim_use_hardfp, true, "Use the softfp ABI.");
+#endif
#endif
void CPU::FlushICache(uword start, uword size) {
@@ -121,10 +169,11 @@
bool is_krait = CpuInfo::FieldContains(kCpuInfoHardware, "QCT APQ8064");
if (is_krait) {
// Special case for Qualcomm Krait CPUs in Nexus 4 and 7.
- integer_division_supported_ = true;
+ integer_division_supported_ = FLAG_use_integer_division;
} else {
integer_division_supported_ =
- CpuInfo::FieldContains(kCpuInfoFeatures, "idiva") || is_arm64;
+ (CpuInfo::FieldContains(kCpuInfoFeatures, "idiva") || is_arm64) &&
+ FLAG_use_integer_division;
}
neon_supported_ =
(CpuInfo::FieldContains(kCpuInfoFeatures, "neon") || is_arm64) &&
@@ -160,19 +209,17 @@
void HostCPUFeatures::InitOnce() {
CpuInfo::InitOnce();
hardware_ = CpuInfo::GetCpuModel();
+
+#if defined(TARGET_ARCH_ARM_5TE)
+ arm_version_ = ARMv5TE;
+#else
+ arm_version_ = ARMv7;
+#endif
+
+ integer_division_supported_ = FLAG_use_integer_division;
vfp_supported_ = FLAG_use_vfp;
neon_supported_ = FLAG_use_vfp && FLAG_use_neon;
hardfp_supported_ = FLAG_sim_use_hardfp;
- if (FLAG_sim_use_armv5te) {
- arm_version_ = ARMv5TE;
- integer_division_supported_ = false;
- } else if (FLAG_sim_use_armv6) {
- arm_version_ = ARMv6;
- integer_division_supported_ = true;
- } else if (FLAG_sim_use_armv7) {
- arm_version_ = ARMv7;
- integer_division_supported_ = true;
- }
#if defined(DEBUG)
initialized_ = true;
#endif
diff --git a/runtime/vm/dart_api_impl.cc b/runtime/vm/dart_api_impl.cc
index f30f365..1f2dfc3 100644
--- a/runtime/vm/dart_api_impl.cc
+++ b/runtime/vm/dart_api_impl.cc
@@ -1501,6 +1501,10 @@
}
// TODO(16615): Validate isolate parameter.
Isolate* iso = reinterpret_cast<Isolate*>(isolate);
+ if (iso->object_store()->root_library() == Library::null()) {
+ // The embedder should have called Dart_LoadScript by now.
+ return false;
+ }
return iso->MakeRunnable();
}
@@ -2031,6 +2035,14 @@
}
+DART_EXPORT Dart_Handle Dart_NewIntegerFromUint64(uint64_t value) {
+ Isolate* isolate = Isolate::Current();
+ DARTSCOPE(isolate);
+ CHECK_CALLBACK_STATE(isolate);
+ return Api::NewHandle(isolate, Integer::NewFromUint64(value));
+}
+
+
DART_EXPORT Dart_Handle Dart_NewIntegerFromHexCString(const char* str) {
Isolate* isolate = Isolate::Current();
DARTSCOPE(isolate);
@@ -2089,8 +2101,9 @@
if (int_obj.IsNull()) {
RETURN_TYPE_ERROR(isolate, integer, Integer);
}
- ASSERT(!int_obj.IsSmi());
- if (int_obj.IsMint() && !int_obj.IsNegative()) {
+ if (int_obj.IsSmi()) {
+ ASSERT(int_obj.IsNegative());
+ } else if (int_obj.IsMint() && !int_obj.IsNegative()) {
*value = int_obj.AsInt64Value();
return Api::Success();
} else {
@@ -5441,6 +5454,14 @@
// newly loaded code and trigger one of these breakpoints.
isolate->debugger()->NotifyDoneLoading();
+ // Notify mirrors that MirrorSystem.libraries needs to be recomputed.
+ const Library& libmirrors =
+ Library::Handle(isolate, Library::MirrorsLibrary());
+ const Field& dirty_bit = Field::Handle(isolate,
+ libmirrors.LookupLocalField(String::Handle(String::New("dirty"))));
+ ASSERT(!dirty_bit.IsNull() && dirty_bit.is_static());
+ dirty_bit.set_value(Bool::True());
+
if (complete_futures) {
const Library& corelib = Library::Handle(isolate, Library::CoreLibrary());
const String& function_name =
diff --git a/runtime/vm/dart_api_impl_test.cc b/runtime/vm/dart_api_impl_test.cc
index 7233ef2..e9b7fec 100644
--- a/runtime/vm/dart_api_impl_test.cc
+++ b/runtime/vm/dart_api_impl_test.cc
@@ -796,6 +796,7 @@
const int64_t kIntegerVal1 = 100;
const int64_t kIntegerVal2 = 0xffffffff;
const char* kIntegerVal3 = "0x123456789123456789123456789";
+ const uint64_t kIntegerVal4 = 0xffffffffffffffff;
Dart_Handle val1 = Dart_NewInteger(kIntegerVal1);
EXPECT(Dart_IsInteger(val1));
@@ -829,6 +830,19 @@
result = Dart_IntegerToHexCString(val3, &chars);
EXPECT_VALID(result);
EXPECT(!strcmp(kIntegerVal3, chars));
+
+ Dart_Handle val4 = Dart_NewIntegerFromUint64(kIntegerVal4);
+ EXPECT_VALID(val4);
+ uint64_t out4 = 0;
+ result = Dart_IntegerToUint64(val4, &out4);
+ EXPECT_VALID(result);
+ EXPECT_EQ(kIntegerVal4, out4);
+
+ Dart_Handle val5 = Dart_NewInteger(-1);
+ EXPECT_VALID(val5);
+ uint64_t out5 = 0;
+ result = Dart_IntegerToUint64(val5, &out5);
+ EXPECT(Dart_IsError(result));
}
@@ -847,7 +861,7 @@
EXPECT_VALID(result);
EXPECT(!fits);
- Dart_Handle min = Dart_NewInteger(kMaxInt64);
+ Dart_Handle min = Dart_NewInteger(kMinInt64);
EXPECT(Dart_IsInteger(min));
fits = false;
result = Dart_IntegerFitsIntoInt64(min, &fits);
@@ -864,7 +878,7 @@
TEST_CASE(IntegerFitsIntoUint64) {
- Dart_Handle max = Dart_NewIntegerFromHexCString("0xFFFFFFFFFFFFFFFF");
+ Dart_Handle max = Dart_NewIntegerFromUint64(kMaxUint64);
EXPECT(Dart_IsInteger(max));
bool fits = false;
Dart_Handle result = Dart_IntegerFitsIntoUint64(max, &fits);
diff --git a/runtime/vm/debugger.cc b/runtime/vm/debugger.cc
index 75a2b1c..05ecbcb 100644
--- a/runtime/vm/debugger.cc
+++ b/runtime/vm/debugger.cc
@@ -35,6 +35,11 @@
DEFINE_FLAG(bool, trace_debugger_stacktrace, false,
"Trace debugger stacktrace collection");
DEFINE_FLAG(bool, verbose_debug, false, "Verbose debugger messages");
+DEFINE_FLAG(bool, steal_breakpoints, false,
+ "Intercept breakpoints and other pause events before they "
+ "are sent to the embedder and use a generic VM breakpoint "
+ "handler instead. This handler dispatches breakpoints to "
+ "the VM service.");
Debugger::EventHandler* Debugger::event_handler_ = NULL;
@@ -239,7 +244,10 @@
Service::HandleEvent(&service_event);
}
- if (event_handler_ != NULL) {
+ if (FLAG_steal_breakpoints && event->IsPauseEvent()) {
+ // We allow the embedder's default breakpoint handler to be overridden.
+ isolate_->PauseEventHandler();
+ } else if (event_handler_ != NULL) {
(*event_handler_)(event);
}
@@ -460,7 +468,17 @@
void ActivationFrame::GetVarDescriptors() {
if (var_descriptors_.IsNull()) {
- var_descriptors_ = code().var_descriptors();
+ if (code().is_optimized()) {
+ Thread* thread = Thread::Current();
+ Zone* zone = thread->zone();
+ const Error& error = Error::Handle(zone,
+ Compiler::EnsureUnoptimizedCode(thread, function()));
+ if (!error.IsNull()) {
+ Exceptions::PropagateError(error);
+ }
+ }
+ var_descriptors_ =
+ Code::Handle(function().unoptimized_code()).var_descriptors();
ASSERT(!var_descriptors_.IsNull());
}
}
@@ -473,7 +491,8 @@
// Calculate the context level at the current token index of the frame.
intptr_t ActivationFrame::ContextLevel() {
- if (context_level_ < 0 && !ctx_.IsNull()) {
+ const Context& ctx = GetSavedCurrentContext();
+ if (context_level_ < 0 && !ctx.IsNull()) {
ASSERT(!code_.is_optimized());
context_level_ = 0;
// TODO(hausner): What to do if there is no descriptor entry
@@ -513,7 +532,8 @@
// Get the saved current context of this activation.
-RawContext* ActivationFrame::GetSavedCurrentContext() {
+const Context& ActivationFrame::GetSavedCurrentContext() {
+ if (!ctx_.IsNull()) return ctx_;
GetVarDescriptors();
intptr_t var_desc_len = var_descriptors_.Length();
for (intptr_t i = 0; i < var_desc_len; i++) {
@@ -525,12 +545,12 @@
OS::PrintErr("\tFound saved current ctx at index %d\n",
var_info.index());
}
- ASSERT(Object::Handle(GetLocalVar(var_info.index())).IsContext());
- return Context::RawCast(GetLocalVar(var_info.index()));
+ ctx_ ^= GetLocalVar(var_info.index());
+ return ctx_;
}
}
UNREACHABLE();
- return Context::null();
+ return Context::ZoneHandle(Context::null());
}
@@ -654,7 +674,7 @@
return desc_indices_.length();
}
-// TODO(hausner): Handle captured variables.
+
RawObject* ActivationFrame::GetLocalVar(intptr_t slot_index) {
if (deopt_frame_.IsNull()) {
uword var_address = fp() + slot_index * kWordSize;
@@ -695,7 +715,8 @@
OS::PrintErr("-------------------------\n"
"Context contents:\n");
- ctx_.Dump(8);
+ const Context& ctx = GetSavedCurrentContext();
+ ctx.Dump(8);
OS::PrintErr("-------------------------\n"
"Debugger stack trace...\n\n");
@@ -744,7 +765,8 @@
*value = GetLocalInstanceVar(var_info.index());
} else {
ASSERT(kind == RawLocalVarDescriptors::kContextVar);
- ASSERT(!ctx_.IsNull());
+ const Context& ctx = GetSavedCurrentContext();
+ ASSERT(!ctx.IsNull());
// The context level at the PC/token index of this activation frame.
intptr_t frame_ctx_level = ContextLevel();
@@ -755,15 +777,15 @@
intptr_t ctx_slot = var_info.index();
if (level_diff == 0) {
if ((ctx_slot < 0) ||
- (ctx_slot >= ctx_.num_variables())) {
+ (ctx_slot >= ctx.num_variables())) {
PrintContextMismatchError(*name, ctx_slot,
frame_ctx_level, var_ctx_level);
}
- ASSERT((ctx_slot >= 0) && (ctx_slot < ctx_.num_variables()));
- *value = ctx_.At(ctx_slot);
+ ASSERT((ctx_slot >= 0) && (ctx_slot < ctx.num_variables()));
+ *value = ctx.At(ctx_slot);
} else {
ASSERT(level_diff > 0);
- Context& var_ctx = Context::Handle(ctx_.raw());
+ Context& var_ctx = Context::Handle(ctx.raw());
while (level_diff > 0 && !var_ctx.IsNull()) {
level_diff--;
var_ctx = var_ctx.parent();
@@ -873,12 +895,13 @@
}
-void ActivationFrame::PrintToJSONObject(JSONObject* jsobj) {
+void ActivationFrame::PrintToJSONObject(JSONObject* jsobj,
+ bool full) {
const Script& script = Script::Handle(SourceScript());
jsobj->AddProperty("type", "Frame");
- jsobj->AddProperty("script", script);
+ jsobj->AddProperty("script", script, !full);
jsobj->AddProperty("tokenPos", TokenPos());
- jsobj->AddProperty("function", function());
+ jsobj->AddProperty("function", function(), !full);
jsobj->AddProperty("code", code());
{
JSONArray jsvars(jsobj, "vars");
@@ -890,7 +913,7 @@
intptr_t unused;
VariableAt(v, &var_name, &unused, &unused, &var_value);
jsvar.AddProperty("name", var_name.ToCString());
- jsvar.AddProperty("value", var_value);
+ jsvar.AddProperty("value", var_value, !full);
}
}
}
@@ -1058,7 +1081,7 @@
delete bpt;
}
// Signal isolate shutdown event.
- if (!ServiceIsolate::IsServiceIsolate(isolate_)) {
+ if (!ServiceIsolate::IsServiceIsolateDescendant(isolate_)) {
SignalIsolateEvent(DebuggerEvent::kIsolateShutdown);
}
}
@@ -1185,13 +1208,8 @@
ActivationFrame* activation =
new ActivationFrame(pc, frame->fp(), frame->sp(), code,
deopt_frame, deopt_frame_offset);
-
- // Recover the context for this frame.
- const Context& ctx =
- Context::Handle(isolate, activation->GetSavedCurrentContext());
- ASSERT(!ctx.IsNull());
- activation->SetContext(ctx);
if (FLAG_trace_debugger_stacktrace) {
+ const Context& ctx = activation->GetSavedCurrentContext();
OS::PrintErr("\tUsing saved context: %s\n", ctx.ToCString());
}
if (FLAG_trace_debugger_stacktrace) {
@@ -1620,6 +1638,7 @@
GrowableObjectArray& closures = GrowableObjectArray::Handle(isolate_);
Function& function = Function::Handle(isolate_);
Function& best_fit = Function::Handle(isolate_);
+ Error& error = Error::Handle(isolate_);
const ClassTable& class_table = *isolate_->class_table();
const intptr_t num_classes = class_table.NumCids();
@@ -1636,7 +1655,14 @@
continue;
}
// Parse class definition if not done yet.
- cls.EnsureIsFinalized(isolate_);
+ error = cls.EnsureIsFinalized(isolate_);
+ if (!error.IsNull()) {
+ // Ignore functions in this class.
+ // TODO(hausner): Should we propagate this error? How?
+ // EnsureIsFinalized only returns an error object if there
+ // is no longjump base on the stack.
+ continue;
+ }
functions = cls.functions();
if (!functions.IsNull()) {
const intptr_t num_functions = functions.Length();
@@ -1763,11 +1789,16 @@
RawError* Debugger::OneTimeBreakAtEntry(const Function& target_function) {
- SourceBreakpoint* bpt = SetBreakpointAtEntry(target_function);
- if (bpt != NULL) {
- bpt->SetIsOneShot();
+ LongJumpScope jump;
+ if (setjmp(*jump.Set()) == 0) {
+ SourceBreakpoint* bpt = SetBreakpointAtEntry(target_function);
+ if (bpt != NULL) {
+ bpt->SetIsOneShot();
+ }
+ return Error::null();
+ } else {
+ return isolate_->object_store()->sticky_error();
}
- return Error::null();
}
@@ -2260,7 +2291,7 @@
void Debugger::NotifyIsolateCreated() {
// Signal isolate creation event.
- if (!ServiceIsolate::IsServiceIsolate(isolate_)) {
+ if (!ServiceIsolate::IsServiceIsolateDescendant(isolate_)) {
SignalIsolateEvent(DebuggerEvent::kIsolateCreated);
}
}
diff --git a/runtime/vm/debugger.h b/runtime/vm/debugger.h
index 69b03d1..3796297 100644
--- a/runtime/vm/debugger.h
+++ b/runtime/vm/debugger.h
@@ -12,7 +12,6 @@
namespace dart {
-class ActiveVariables;
class CodeBreakpoint;
class Isolate;
class JSONArray;
@@ -174,7 +173,6 @@
intptr_t TokenPos();
intptr_t LineNumber();
intptr_t ColumnNumber();
- void SetContext(const Context& ctx) { ctx_ = ctx.raw(); }
// Returns true if this frame is for a function that is visible
// to the user and can be debugged.
@@ -198,11 +196,14 @@
RawArray* GetLocalVariables();
RawObject* GetReceiver();
- RawContext* GetSavedCurrentContext();
+ const Context& GetSavedCurrentContext();
RawObject* Evaluate(const String& expr);
- void PrintToJSONObject(JSONObject* jsobj);
+ // Print the activation frame into |jsobj|. if |full| is false, script
+ // and local variable objects are only references. if |full| is true,
+ // the complete script, function, and, local variable objects are included.
+ void PrintToJSONObject(JSONObject* jsobj, bool full = false);
private:
void PrintContextMismatchError(const String& var_name,
@@ -460,7 +461,7 @@
};
static bool HasEventHandler();
- static void InvokeEventHandler(DebuggerEvent* event);
+ void InvokeEventHandler(DebuggerEvent* event);
void FindCompiledFunctions(const Script& script,
intptr_t start_pos,
diff --git a/runtime/vm/debugger_api_impl_test.cc b/runtime/vm/debugger_api_impl_test.cc
index e8df088..4bbc7e8 100644
--- a/runtime/vm/debugger_api_impl_test.cc
+++ b/runtime/vm/debugger_api_impl_test.cc
@@ -2147,7 +2147,7 @@
Dart_Handle object_name = Dart_NewStringFromCString("Object");
Dart_Handle int_name = Dart_NewStringFromCString("int");
Dart_Handle set_name = Dart_NewStringFromCString("Set");
- Dart_Handle iterable_name = Dart_NewStringFromCString("IterableBase");
+ Dart_Handle iterable_name = Dart_NewStringFromCString("Iterable");
Dart_Handle list_name = Dart_NewStringFromCString("List");
Dart_Handle object_type = Dart_GetType(core_lib, object_name, 0, NULL);
diff --git a/runtime/vm/deferred_objects.cc b/runtime/vm/deferred_objects.cc
index 2727f10..f3cb4d8 100644
--- a/runtime/vm/deferred_objects.cc
+++ b/runtime/vm/deferred_objects.cc
@@ -101,11 +101,16 @@
void DeferredRetAddr::Materialize(DeoptContext* deopt_context) {
- Function& function = Function::Handle(deopt_context->zone());
+ Thread* thread = deopt_context->thread();
+ Zone* zone = deopt_context->zone();
+ Function& function = Function::Handle(zone);
function ^= deopt_context->ObjectAt(index_);
- Compiler::EnsureUnoptimizedCode(deopt_context->thread(), function);
- const Code& code =
- Code::Handle(deopt_context->zone(), function.unoptimized_code());
+ const Error& error = Error::Handle(zone,
+ Compiler::EnsureUnoptimizedCode(thread, function));
+ if (!error.IsNull()) {
+ Exceptions::PropagateError(error);
+ }
+ const Code& code = Code::Handle(zone, function.unoptimized_code());
// Check that deopt_id exists.
// TODO(vegorov): verify after deoptimization targets as well.
#ifdef DEBUG
@@ -128,7 +133,7 @@
if (pc != 0) {
// If the deoptimization happened at an IC call, update the IC data
// to avoid repeated deoptimization at the same site next time around.
- ICData& ic_data = ICData::Handle();
+ ICData& ic_data = ICData::Handle(zone);
CodePatcher::GetInstanceCallAt(pc, code, &ic_data);
if (!ic_data.IsNull()) {
ic_data.AddDeoptReason(deopt_context->deopt_reason());
@@ -147,17 +152,22 @@
void DeferredPcMarker::Materialize(DeoptContext* deopt_context) {
+ Thread* thread = deopt_context->thread();
+ Zone* zone = deopt_context->zone();
uword* dest_addr = reinterpret_cast<uword*>(slot());
- Function& function = Function::Handle(deopt_context->zone());
+ Function& function = Function::Handle(zone);
function ^= deopt_context->ObjectAt(index_);
if (function.IsNull()) {
// Callee's PC marker is not used (pc of Deoptimize stub). Set to 0.
*dest_addr = 0;
return;
}
- Compiler::EnsureUnoptimizedCode(deopt_context->thread(), function);
- const Code& code =
- Code::Handle(deopt_context->zone(), function.unoptimized_code());
+ const Error& error = Error::Handle(zone,
+ Compiler::EnsureUnoptimizedCode(thread, function));
+ if (!error.IsNull()) {
+ Exceptions::PropagateError(error);
+ }
+ const Code& code = Code::Handle(zone, function.unoptimized_code());
ASSERT(!code.IsNull());
ASSERT(function.HasCode());
const intptr_t pc_marker =
@@ -188,12 +198,17 @@
void DeferredPp::Materialize(DeoptContext* deopt_context) {
- Function& function = Function::Handle(deopt_context->zone());
+ Thread* thread = deopt_context->thread();
+ Zone* zone = deopt_context->zone();
+ Function& function = Function::Handle(zone);
function ^= deopt_context->ObjectAt(index_);
ASSERT(!function.IsNull());
- Compiler::EnsureUnoptimizedCode(deopt_context->thread(), function);
- const Code& code =
- Code::Handle(deopt_context->zone(), function.unoptimized_code());
+ const Error& error = Error::Handle(zone,
+ Compiler::EnsureUnoptimizedCode(thread, function));
+ if (!error.IsNull()) {
+ Exceptions::PropagateError(error);
+ }
+ const Code& code = Code::Handle(zone, function.unoptimized_code());
ASSERT(!code.IsNull());
ASSERT(code.ObjectPool() != Object::null());
*slot() = code.ObjectPool();
diff --git a/runtime/vm/deopt_instructions.cc b/runtime/vm/deopt_instructions.cc
index 401f2ba..22ecaf5 100644
--- a/runtime/vm/deopt_instructions.cc
+++ b/runtime/vm/deopt_instructions.cc
@@ -27,7 +27,7 @@
fpu_register_t* fpu_registers,
intptr_t* cpu_registers)
: code_(code.raw()),
- object_table_(code.object_table()),
+ object_pool_(code.ObjectPool()),
deopt_info_(TypedData::null()),
dest_frame_is_allocated_(false),
dest_frame_(NULL),
@@ -130,7 +130,7 @@
void DeoptContext::VisitObjectPointers(ObjectPointerVisitor* visitor) {
- visitor->VisitPointer(reinterpret_cast<RawObject**>(&object_table_));
+ visitor->VisitPointer(reinterpret_cast<RawObject**>(&object_pool_));
visitor->VisitPointer(reinterpret_cast<RawObject**>(&deopt_info_));
// Visit any object pointers on the destination stack.
@@ -783,10 +783,16 @@
// from the simulator.
ASSERT(Isolate::IsDeoptAfter(ret_address_instr->deopt_id()));
ASSERT(!object_table.IsNull());
- Function& function = Function::Handle();
+ Thread* thread = Thread::Current();
+ Zone* zone = thread->zone();
+ Function& function = Function::Handle(zone);
function ^= object_table.At(ret_address_instr->object_table_index());
ASSERT(code != NULL);
- Compiler::EnsureUnoptimizedCode(Thread::Current(), function);
+ const Error& error = Error::Handle(zone,
+ Compiler::EnsureUnoptimizedCode(thread, function));
+ if (!error.IsNull()) {
+ Exceptions::PropagateError(error);
+ }
*code ^= function.unoptimized_code();
ASSERT(!code->IsNull());
uword res = code->GetPcForDeoptId(ret_address_instr->deopt_id(),
@@ -916,12 +922,13 @@
};
-DeoptInfoBuilder::DeoptInfoBuilder(Zone* zone, const intptr_t num_args)
+DeoptInfoBuilder::DeoptInfoBuilder(Zone* zone,
+ const intptr_t num_args,
+ Assembler* assembler)
: zone_(zone),
instructions_(),
- object_table_(GrowableObjectArray::Handle(
- GrowableObjectArray::New(Heap::kOld))),
num_args_(num_args),
+ assembler_(assembler),
trie_root_(new(zone) TrieNode()),
current_info_number_(0),
frame_start_(-1),
@@ -930,15 +937,7 @@
intptr_t DeoptInfoBuilder::FindOrAddObjectInTable(const Object& obj) const {
- for (intptr_t i = 0; i < object_table_.Length(); i++) {
- if (object_table_.At(i) == obj.raw()) {
- return i;
- }
- }
- // Add object.
- const intptr_t result = object_table_.Length();
- object_table_.Add(obj, Heap::kOld);
- return result;
+ return assembler_->object_pool().FindObject(obj, kNotPatchable);
}
diff --git a/runtime/vm/deopt_instructions.h b/runtime/vm/deopt_instructions.h
index f2927f5..68e92df 100644
--- a/runtime/vm/deopt_instructions.h
+++ b/runtime/vm/deopt_instructions.h
@@ -54,8 +54,8 @@
void SetCallerFp(intptr_t callers_fp);
RawObject* ObjectAt(intptr_t index) const {
- const Array& object_table = Array::Handle(object_table_);
- return object_table.At(index);
+ const Array& object_pool = Array::Handle(object_pool_);
+ return object_pool.At(index);
}
intptr_t RegisterValue(Register reg) const {
@@ -205,7 +205,7 @@
}
RawCode* code_;
- RawArray* object_table_;
+ RawArray* object_pool_;
RawTypedData* deopt_info_;
bool dest_frame_is_allocated_;
intptr_t* dest_frame_;
@@ -287,7 +287,7 @@
// Get the code and return address which is encoded in this
// kRetAfterAddress deopt instruction.
static uword GetRetAddress(DeoptInstr* instr,
- const Array& object_table,
+ const Array& object_pool,
Code* code);
// Return number of initialized fields in the object that will be
@@ -419,11 +419,7 @@
// the heap and reset the builder's internal state for the next DeoptInfo.
class DeoptInfoBuilder : public ValueObject {
public:
- DeoptInfoBuilder(Zone* zone, const intptr_t num_args);
-
- // 'object_table' holds all objects referred to by DeoptInstr in
- // all DeoptInfo instances for a single Code object.
- const GrowableObjectArray& object_table() { return object_table_; }
+ DeoptInfoBuilder(Zone* zone, const intptr_t num_args, Assembler* assembler);
// Return address before instruction.
void AddReturnAddress(const Function& function,
@@ -485,8 +481,8 @@
Zone* zone_;
GrowableArray<DeoptInstr*> instructions_;
- const GrowableObjectArray& object_table_;
const intptr_t num_args_;
+ Assembler* assembler_;
// Used to compress entries by sharing suffixes.
TrieNode* trie_root_;
diff --git a/runtime/vm/disassembler_arm.cc b/runtime/vm/disassembler_arm.cc
index 7ab11d4..63f759b 100644
--- a/runtime/vm/disassembler_arm.cc
+++ b/runtime/vm/disassembler_arm.cc
@@ -683,6 +683,14 @@
case 7: {
if ((instr->Bits(21, 2) == 0x1) && (instr->ConditionField() == AL)) {
Format(instr, "bkpt #'imm12_4");
+ if (instr->BkptField() == Instr::kStopMessageCode) {
+ const char* message = *reinterpret_cast<const char**>(
+ reinterpret_cast<intptr_t>(instr) - Instr::kInstrSize);
+ buffer_pos_ += OS::SNPrint(current_position_in_buffer(),
+ remaining_size_in_buffer(),
+ " ; \"%s\"",
+ message);
+ }
} else {
// Format(instr, "smc'cond");
Unknown(instr); // Not used.
@@ -1100,14 +1108,6 @@
void ARMDecoder::DecodeType7(Instr* instr) {
if (instr->Bit(24) == 1) {
Format(instr, "svc'cond #'svc");
- if (instr->SvcField() == kStopMessageSvcCode) {
- const char* message = *reinterpret_cast<const char**>(
- reinterpret_cast<intptr_t>(instr) - Instr::kInstrSize);
- buffer_pos_ += OS::SNPrint(current_position_in_buffer(),
- remaining_size_in_buffer(),
- " ; \"%s\"",
- message);
- }
} else if (instr->IsVFPDataProcessingOrSingleTransfer()) {
if (instr->Bit(4) == 0) {
// VFP Data Processing
diff --git a/runtime/vm/disassembler_arm64.cc b/runtime/vm/disassembler_arm64.cc
index 783379c..c6d6087 100644
--- a/runtime/vm/disassembler_arm64.cc
+++ b/runtime/vm/disassembler_arm64.cc
@@ -829,6 +829,14 @@
} else if ((instr->Bits(0, 2) == 0) && (instr->Bits(2, 3) == 0) &&
(instr->Bits(21, 3) == 1)) {
Format(instr, "brk 'imm16");
+ if (instr->Imm16Field() == Instr::kStopMessageCode) {
+ const char* message = *reinterpret_cast<const char**>(
+ reinterpret_cast<intptr_t>(instr) - 2 * Instr::kInstrSize);
+ buffer_pos_ += OS::SNPrint(current_position_in_buffer(),
+ remaining_size_in_buffer(),
+ " ; \"%s\"",
+ message);
+ }
} else if ((instr->Bits(0, 2) == 0) && (instr->Bits(2, 3) == 0) &&
(instr->Bits(21, 3) == 2)) {
Format(instr, "hlt 'imm16");
diff --git a/runtime/vm/disassembler_mips.cc b/runtime/vm/disassembler_mips.cc
index 22f46b1..af84199 100644
--- a/runtime/vm/disassembler_mips.cc
+++ b/runtime/vm/disassembler_mips.cc
@@ -304,6 +304,14 @@
}
case BREAK: {
Format(instr, "break 'code");
+ if (instr->BreakCodeField() == Instr::kStopMessageCode) {
+ const char* message = *reinterpret_cast<const char**>(
+ reinterpret_cast<intptr_t>(instr) - Instr::kInstrSize);
+ buffer_pos_ += OS::SNPrint(current_position_in_buffer(),
+ remaining_size_in_buffer(),
+ " ; \"%s\"",
+ message);
+ }
break;
}
case DIV: {
diff --git a/runtime/vm/flow_graph_builder.cc b/runtime/vm/flow_graph_builder.cc
index 616807c..551e372 100644
--- a/runtime/vm/flow_graph_builder.cc
+++ b/runtime/vm/flow_graph_builder.cc
@@ -42,6 +42,7 @@
DECLARE_FLAG(bool, enable_type_checks);
DECLARE_FLAG(int, optimization_counter_threshold);
DECLARE_FLAG(bool, warn_on_javascript_compatibility);
+DECLARE_FLAG(bool, use_field_guards);
// Quick access to the locally defined zone() method.
#define Z (zone())
@@ -3166,10 +3167,7 @@
// resolved at compile time (in the caller instance getter's super class).
// Unlike a static getter, a super getter has a receiver parameter.
const bool is_super_setter = (node->receiver() != NULL);
- Function& setter_function =
- Function::ZoneHandle(Z, is_super_setter
- ? Resolver::ResolveDynamicAnyArgs(node->cls(), setter_name)
- : node->cls().LookupStaticFunction(setter_name));
+ const Function& setter_function = node->function();
StaticCallInstr* call;
if (setter_function.IsNull()) {
if (is_super_setter) {
@@ -3505,21 +3503,21 @@
dst_name);
}
- store_value = Bind(BuildStoreExprTemp(store_value));
- GuardFieldClassInstr* guard_field_class =
- new(Z) GuardFieldClassInstr(store_value,
- node->field(),
- isolate()->GetNextDeoptId());
- AddInstruction(guard_field_class);
-
- store_value = Bind(BuildLoadExprTemp());
- GuardFieldLengthInstr* guard_field_length =
- new(Z) GuardFieldLengthInstr(store_value,
- node->field(),
- isolate()->GetNextDeoptId());
- AddInstruction(guard_field_length);
-
- store_value = Bind(BuildLoadExprTemp());
+ if (FLAG_use_field_guards) {
+ store_value = Bind(BuildStoreExprTemp(store_value));
+ GuardFieldClassInstr* guard_field_class =
+ new(Z) GuardFieldClassInstr(store_value,
+ node->field(),
+ isolate()->GetNextDeoptId());
+ AddInstruction(guard_field_class);
+ store_value = Bind(BuildLoadExprTemp());
+ GuardFieldLengthInstr* guard_field_length =
+ new(Z) GuardFieldLengthInstr(store_value,
+ node->field(),
+ isolate()->GetNextDeoptId());
+ AddInstruction(guard_field_length);
+ store_value = Bind(BuildLoadExprTemp());
+ }
StoreInstanceFieldInstr* store =
new(Z) StoreInstanceFieldInstr(node->field(),
for_instance.value(),
@@ -4328,6 +4326,11 @@
}
+void EffectGraphVisitor::VisitStopNode(StopNode* node) {
+ AddInstruction(new(Z) StopInstr(node->message()));
+}
+
+
FlowGraph* FlowGraphBuilder::BuildGraph() {
if (FLAG_print_ast) {
// Print the function ast before IL generation.
diff --git a/runtime/vm/flow_graph_compiler.cc b/runtime/vm/flow_graph_compiler.cc
index 04141c1..e1ce9bb 100644
--- a/runtime/vm/flow_graph_compiler.cc
+++ b/runtime/vm/flow_graph_compiler.cc
@@ -27,6 +27,8 @@
namespace dart {
+DEFINE_FLAG(bool, always_megamorphic_calls, false,
+ "Instance call always as megamorphic.");
DEFINE_FLAG(bool, trace_inlining_intervals, false,
"Inlining interval diagnostics");
DEFINE_FLAG(bool, enable_simd_inline, true,
@@ -52,9 +54,28 @@
DECLARE_FLAG(int, stacktrace_every);
DECLARE_FLAG(charp, stacktrace_filter);
DECLARE_FLAG(bool, use_cha);
+DECLARE_FLAG(bool, use_field_guards);
DECLARE_FLAG(bool, use_osr);
DECLARE_FLAG(bool, warn_on_javascript_compatibility);
+static void NooptModeHandler(bool value) {
+ if (value) {
+ FLAG_always_megamorphic_calls = value;
+ FLAG_optimization_counter_threshold = -1;
+ FLAG_use_field_guards = false;
+ FLAG_use_osr = false;
+ FLAG_emit_edge_counters = false;
+ }
+}
+
+
+// --noopt disables optimizer and tunes unoptimized code to run as fast
+// as possible.
+DEFINE_FLAG_HANDLER(NooptModeHandler,
+ noopt,
+ "Run fast unoptimized code only.");
+
+
// Assign locations to incoming arguments, i.e., values pushed above spill slots
// with PushArgument. Recursively allocates from outermost to innermost
// environment.
@@ -128,7 +149,7 @@
patch_code_pc_offset_(Code::kInvalidPc),
lazy_deopt_pc_offset_(Code::kInvalidPc),
deopt_id_to_ic_data_(NULL),
- inlined_code_intervals_(NULL),
+ inlined_code_intervals_(Array::ZoneHandle(Object::empty_array().raw())),
inline_id_to_function_(inline_id_to_function),
caller_inline_id_(caller_inline_id) {
ASSERT(flow_graph->parsed_function().function().raw() ==
@@ -448,43 +469,46 @@
// truncate 'inline_id_to_function_'.
}
- intervals.Add(IntervalStruct(prev_offset, prev_inlining_id));
- inlined_code_intervals_ = &Array::ZoneHandle(Array::New(
- intervals.length() * Code::kInlIntNumEntries, Heap::kOld));
- Smi& start_h = Smi::Handle();
- Smi& caller_inline_id = Smi::Handle();
- Smi& inline_id = Smi::Handle();
- for (intptr_t i = 0; i < intervals.length(); i++) {
- if (FLAG_trace_inlining_intervals && is_optimizing()) {
- const Function* function =
- inline_id_to_function_.At(intervals[i].inlining_id);
- intervals[i].Dump();
- OS::Print(" %s parent %" Pd "\n",
- function->ToQualifiedCString(),
- caller_inline_id_[intervals[i].inlining_id]);
- }
- const intptr_t id = intervals[i].inlining_id;
- start_h = Smi::New(intervals[i].start);
- inline_id = Smi::New(id);
- caller_inline_id = Smi::New(caller_inline_id_[intervals[i].inlining_id]);
+ if (is_optimizing()) {
+ intervals.Add(IntervalStruct(prev_offset, prev_inlining_id));
+ inlined_code_intervals_ =
+ Array::New(intervals.length() * Code::kInlIntNumEntries, Heap::kOld);
+ Smi& start_h = Smi::Handle();
+ Smi& caller_inline_id = Smi::Handle();
+ Smi& inline_id = Smi::Handle();
+ for (intptr_t i = 0; i < intervals.length(); i++) {
+ if (FLAG_trace_inlining_intervals && is_optimizing()) {
+ const Function* function =
+ inline_id_to_function_.At(intervals[i].inlining_id);
+ intervals[i].Dump();
+ OS::Print(" %s parent %" Pd "\n",
+ function->ToQualifiedCString(),
+ caller_inline_id_[intervals[i].inlining_id]);
+ }
+ const intptr_t id = intervals[i].inlining_id;
+ start_h = Smi::New(intervals[i].start);
+ inline_id = Smi::New(id);
+ caller_inline_id = Smi::New(caller_inline_id_[intervals[i].inlining_id]);
- const intptr_t p = i * Code::kInlIntNumEntries;
- inlined_code_intervals_->SetAt(p + Code::kInlIntStart, start_h);
- inlined_code_intervals_->SetAt(p + Code::kInlIntInliningId, inline_id);
- inlined_code_intervals_->SetAt(p + Code::kInlIntCallerId, caller_inline_id);
+ const intptr_t p = i * Code::kInlIntNumEntries;
+ inlined_code_intervals_.SetAt(p + Code::kInlIntStart, start_h);
+ inlined_code_intervals_.SetAt(p + Code::kInlIntInliningId, inline_id);
+ inlined_code_intervals_.SetAt(
+ p + Code::kInlIntCallerId, caller_inline_id);
+ }
}
set_current_block(NULL);
if (FLAG_trace_inlining_intervals && is_optimizing()) {
OS::Print("Intervals:\n");
Smi& temp = Smi::Handle();
- for (intptr_t i = 0; i < inlined_code_intervals_->Length();
+ for (intptr_t i = 0; i < inlined_code_intervals_.Length();
i += Code::kInlIntNumEntries) {
- temp ^= inlined_code_intervals_->At(i + Code::kInlIntStart);
+ temp ^= inlined_code_intervals_.At(i + Code::kInlIntStart);
ASSERT(!temp.IsNull());
OS::Print("% " Pd " start: %" Px " ", i, temp.Value());
- temp ^= inlined_code_intervals_->At(i + Code::kInlIntInliningId);
+ temp ^= inlined_code_intervals_.At(i + Code::kInlIntInliningId);
OS::Print("inl-id: %" Pd " ", temp.Value());
- temp ^= inlined_code_intervals_->At(i + Code::kInlIntCallerId);
+ temp ^= inlined_code_intervals_.At(i + Code::kInlIntCallerId);
OS::Print("caller-id: %" Pd " \n", temp.Value());
}
}
@@ -846,18 +870,17 @@
}
-void FlowGraphCompiler::FinalizeDeoptInfo(const Code& code) {
+RawArray* FlowGraphCompiler::CreateDeoptInfo(Assembler* assembler) {
// For functions with optional arguments, all incoming arguments are copied
// to spill slots. The deoptimization environment does not track them.
const Function& function = parsed_function().function();
const intptr_t incoming_arg_count =
function.HasOptionalParameters() ? 0 : function.num_fixed_parameters();
- DeoptInfoBuilder builder(zone(), incoming_arg_count);
+ DeoptInfoBuilder builder(zone(), incoming_arg_count, assembler);
intptr_t deopt_info_table_size = DeoptTable::SizeFor(deopt_infos_.length());
if (deopt_info_table_size == 0) {
- code.set_deopt_info_array(Object::empty_array());
- code.set_object_table(Object::empty_array());
+ return Object::empty_array().raw();
} else {
const Array& array =
Array::Handle(Array::New(deopt_info_table_size, Heap::kOld));
@@ -872,18 +895,13 @@
deopt_infos_[i]->flags());
DeoptTable::SetEntry(array, i, offset, info, reason_and_flags);
}
- code.set_deopt_info_array(array);
- const Array& object_array =
- Array::Handle(Array::MakeArray(builder.object_table()));
- ASSERT(code.object_table() == Array::null());
- code.set_object_table(object_array);
+ return array.raw();
}
}
void FlowGraphCompiler::FinalizeStackmaps(const Code& code) {
if (stackmap_table_builder_ == NULL) {
- // The unoptimizing compiler has no stack maps.
code.set_stackmaps(Object::null_array());
} else {
// Finalize the stack map array and add it to the code object.
@@ -894,6 +912,12 @@
void FlowGraphCompiler::FinalizeVarDescriptors(const Code& code) {
+ if (code.is_optimized()) {
+ // Optimized code does not need variable descriptors. They are
+ // only stored in the unoptimized version.
+ code.set_var_descriptors(Object::empty_var_descriptors());
+ return;
+ }
LocalVarDescriptors& var_descs = LocalVarDescriptors::Handle();
if (parsed_function().node_sequence() == NULL) {
ASSERT(flow_graph().IsIrregexpFunction());
@@ -980,8 +1004,12 @@
intptr_t argument_count,
LocationSummary* locs,
const ICData& ic_data) {
+ if (FLAG_always_megamorphic_calls) {
+ EmitMegamorphicInstanceCall(ic_data, argument_count,
+ deopt_id, token_pos, locs);
+ return;
+ }
ASSERT(!ic_data.IsNull());
- ASSERT(FLAG_propagate_ic_data || (ic_data.NumberOfUsedChecks() == 0));
uword label_address = 0;
StubCode* stub_code = isolate()->stub_code();
if (is_optimizing() && (ic_data.NumberOfUsedChecks() == 0)) {
@@ -1537,7 +1565,9 @@
const ICData& ic_data = ICData::ZoneHandle(zone(), ICData::New(
parsed_function().function(), target_name,
arguments_descriptor, deopt_id, num_args_tested));
- (*deopt_id_to_ic_data_)[deopt_id] = &ic_data;
+ if (deopt_id_to_ic_data_ != NULL) {
+ (*deopt_id_to_ic_data_)[deopt_id] = &ic_data;
+ }
return &ic_data;
}
@@ -1559,7 +1589,9 @@
parsed_function().function(), String::Handle(zone(), target.name()),
arguments_descriptor, deopt_id, num_args_tested));
ic_data.AddTarget(target);
- (*deopt_id_to_ic_data_)[deopt_id] = &ic_data;
+ if (deopt_id_to_ic_data_ != NULL) {
+ (*deopt_id_to_ic_data_)[deopt_id] = &ic_data;
+ }
return &ic_data;
}
@@ -1603,6 +1635,9 @@
RawArray* FlowGraphCompiler::InliningIdToFunction() const {
+ if (inline_id_to_function_.length() == 0) {
+ return Object::empty_array().raw();
+ }
const Array& res = Array::Handle(
Array::New(inline_id_to_function_.length(), Heap::kOld));
for (intptr_t i = 0; i < inline_id_to_function_.length(); i++) {
diff --git a/runtime/vm/flow_graph_compiler.h b/runtime/vm/flow_graph_compiler.h
index 9fa51ad..d69cb1e 100644
--- a/runtime/vm/flow_graph_compiler.h
+++ b/runtime/vm/flow_graph_compiler.h
@@ -471,7 +471,7 @@
void FinalizeExceptionHandlers(const Code& code);
void FinalizePcDescriptors(const Code& code);
- void FinalizeDeoptInfo(const Code& code);
+ RawArray* CreateDeoptInfo(Assembler* assembler);
void FinalizeStackmaps(const Code& code);
void FinalizeVarDescriptors(const Code& code);
void FinalizeStaticCallTargetsTable(const Code& code);
@@ -527,8 +527,7 @@
void AddStubCallTarget(const Code& code);
const Array& inlined_code_intervals() const {
- ASSERT(inlined_code_intervals_ != NULL);
- return *inlined_code_intervals_;
+ return inlined_code_intervals_;
}
RawArray* InliningIdToFunction() const;
@@ -708,7 +707,7 @@
ZoneGrowableArray<const ICData*>* deopt_id_to_ic_data_;
- const Array* inlined_code_intervals_;
+ Array& inlined_code_intervals_;
const GrowableArray<const Function*>& inline_id_to_function_;
const GrowableArray<intptr_t>& caller_inline_id_;
diff --git a/runtime/vm/flow_graph_compiler_arm.cc b/runtime/vm/flow_graph_compiler_arm.cc
index 5ea34ba..8334bb0 100644
--- a/runtime/vm/flow_graph_compiler_arm.cc
+++ b/runtime/vm/flow_graph_compiler_arm.cc
@@ -1332,7 +1332,15 @@
AddCurrentDescriptor(RawPcDescriptors::kOther,
Isolate::kNoDeoptId, token_pos);
RecordSafepoint(locs);
- AddDeoptIndexAtCall(Isolate::ToDeoptAfter(deopt_id), token_pos);
+ const intptr_t deopt_id_after = Isolate::ToDeoptAfter(deopt_id);
+ if (is_optimizing()) {
+ AddDeoptIndexAtCall(deopt_id_after, token_pos);
+ } else {
+ // Add deoptimization continuation point after the call and before the
+ // arguments are removed.
+ AddCurrentDescriptor(RawPcDescriptors::kDeopt,
+ deopt_id_after, token_pos);
+ }
__ Drop(argument_count);
}
diff --git a/runtime/vm/flow_graph_compiler_arm64.cc b/runtime/vm/flow_graph_compiler_arm64.cc
index 1d684f6..3a7f574 100644
--- a/runtime/vm/flow_graph_compiler_arm64.cc
+++ b/runtime/vm/flow_graph_compiler_arm64.cc
@@ -1313,7 +1313,14 @@
AddCurrentDescriptor(RawPcDescriptors::kOther,
Isolate::kNoDeoptId, token_pos);
RecordSafepoint(locs);
- AddDeoptIndexAtCall(Isolate::ToDeoptAfter(deopt_id), token_pos);
+ const intptr_t deopt_id_after = Isolate::ToDeoptAfter(deopt_id);
+ if (is_optimizing()) {
+ AddDeoptIndexAtCall(deopt_id_after, token_pos);
+ } else {
+ // Add deoptimization continuation point after the call and before the
+ // arguments are removed.
+ AddCurrentDescriptor(RawPcDescriptors::kDeopt, deopt_id_after, token_pos);
+ }
__ Drop(argument_count);
}
diff --git a/runtime/vm/flow_graph_compiler_ia32.cc b/runtime/vm/flow_graph_compiler_ia32.cc
index 1193e78..e99ebd6 100644
--- a/runtime/vm/flow_graph_compiler_ia32.cc
+++ b/runtime/vm/flow_graph_compiler_ia32.cc
@@ -1354,7 +1354,14 @@
AddCurrentDescriptor(RawPcDescriptors::kOther,
Isolate::kNoDeoptId, token_pos);
RecordSafepoint(locs);
- AddDeoptIndexAtCall(Isolate::ToDeoptAfter(deopt_id), token_pos);
+ const intptr_t deopt_id_after = Isolate::ToDeoptAfter(deopt_id);
+ if (is_optimizing()) {
+ AddDeoptIndexAtCall(deopt_id_after, token_pos);
+ } else {
+ // Add deoptimization continuation point after the call and before the
+ // arguments are removed.
+ AddCurrentDescriptor(RawPcDescriptors::kDeopt, deopt_id_after, token_pos);
+ }
__ Drop(argument_count);
}
diff --git a/runtime/vm/flow_graph_compiler_mips.cc b/runtime/vm/flow_graph_compiler_mips.cc
index c7ebddf..847048e 100644
--- a/runtime/vm/flow_graph_compiler_mips.cc
+++ b/runtime/vm/flow_graph_compiler_mips.cc
@@ -1337,7 +1337,14 @@
AddCurrentDescriptor(RawPcDescriptors::kOther,
Isolate::kNoDeoptId, token_pos);
RecordSafepoint(locs);
- AddDeoptIndexAtCall(Isolate::ToDeoptAfter(deopt_id), token_pos);
+ const intptr_t deopt_id_after = Isolate::ToDeoptAfter(deopt_id);
+ if (is_optimizing()) {
+ AddDeoptIndexAtCall(deopt_id_after, token_pos);
+ } else {
+ // Add deoptimization continuation point after the call and before the
+ // arguments are removed.
+ AddCurrentDescriptor(RawPcDescriptors::kDeopt, deopt_id_after, token_pos);
+ }
__ Drop(argument_count);
}
diff --git a/runtime/vm/flow_graph_compiler_x64.cc b/runtime/vm/flow_graph_compiler_x64.cc
index 562f0c3..b0cc219 100644
--- a/runtime/vm/flow_graph_compiler_x64.cc
+++ b/runtime/vm/flow_graph_compiler_x64.cc
@@ -1361,7 +1361,14 @@
AddCurrentDescriptor(RawPcDescriptors::kOther,
Isolate::kNoDeoptId, token_pos);
RecordSafepoint(locs);
- AddDeoptIndexAtCall(Isolate::ToDeoptAfter(deopt_id), token_pos);
+ const intptr_t deopt_id_after = Isolate::ToDeoptAfter(deopt_id);
+ if (is_optimizing()) {
+ AddDeoptIndexAtCall(deopt_id_after, token_pos);
+ } else {
+ // Add deoptimization continuation point after the call and before the
+ // arguments are removed.
+ AddCurrentDescriptor(RawPcDescriptors::kDeopt, deopt_id_after, token_pos);
+ }
__ Drop(argument_count, RCX);
}
diff --git a/runtime/vm/flow_graph_inliner.cc b/runtime/vm/flow_graph_inliner.cc
index de8fabd..567e18c 100644
--- a/runtime/vm/flow_graph_inliner.cc
+++ b/runtime/vm/flow_graph_inliner.cc
@@ -685,6 +685,11 @@
TimerScope timer(FLAG_compiler_stats,
&CompilerStats::graphinliner_parse_timer,
isolate());
+ const Error& error = Error::Handle(Z,
+ Compiler::EnsureUnoptimizedCode(Thread::Current(), function));
+ if (!error.IsNull()) {
+ Exceptions::PropagateError(error);
+ }
parsed_function = GetParsedFunction(function, &in_cache);
}
diff --git a/runtime/vm/freelist.h b/runtime/vm/freelist.h
index 38cad7f..2c47512 100644
--- a/runtime/vm/freelist.h
+++ b/runtime/vm/freelist.h
@@ -20,6 +20,7 @@
// the element at the address following the next_ field. All words written by
// the freelist are guaranteed to look like smis, as required by
// TryAllocateSmiInitializedLocked.
+// A FreeListElement never has its header mark bit set.
class FreeListElement {
public:
FreeListElement* next() const {
diff --git a/runtime/vm/gc_marker.cc b/runtime/vm/gc_marker.cc
index b68fdee..34811cb 100644
--- a/runtime/vm/gc_marker.cc
+++ b/runtime/vm/gc_marker.cc
@@ -11,6 +11,7 @@
#include "vm/allocation.h"
#include "vm/dart_api_state.h"
#include "vm/isolate.h"
+#include "vm/log.h"
#include "vm/pages.h"
#include "vm/raw_object.h"
#include "vm/stack_frame.h"
@@ -147,7 +148,7 @@
bool visit_function_code() const { return visit_function_code_; }
- GrowableArray<RawFunction*>* skipped_code_functions() {
+ virtual GrowableArray<RawFunction*>* skipped_code_functions() {
return &skipped_code_functions_;
}
@@ -239,6 +240,8 @@
}
void DetachCode() {
+ intptr_t unoptimized_code_count = 0;
+ intptr_t current_code_count = 0;
for (int i = 0; i < skipped_code_functions_.length(); i++) {
RawFunction* func = skipped_code_functions_[i];
RawCode* code = func->ptr()->instructions_->ptr()->code_;
@@ -250,7 +253,6 @@
func->StorePointer(
&(func->ptr()->instructions_),
stub_code->LazyCompile_entry()->code()->ptr()->instructions_);
- func->StorePointer(&(func->ptr()->unoptimized_code_), Code::null());
if (FLAG_log_code_drop) {
// NOTE: This code runs while GC is in progress and runs within
// a NoHandleScope block. Hence it is not okay to use a regular Zone
@@ -260,9 +262,26 @@
// helper functions to the raw object interface.
String name;
name = func->ptr()->name_;
- OS::Print("Detaching code: %s\n", name.ToCString());
+ ISL_Print("Detaching code: %s\n", name.ToCString());
+ current_code_count++;
}
}
+
+ code = func->ptr()->unoptimized_code_;
+ if (!code->IsMarked()) {
+ // If the code wasn't strongly visited through other references
+ // after skipping the function's code pointer, then we disconnect the
+ // code from the function.
+ func->StorePointer(&(func->ptr()->unoptimized_code_), Code::null());
+ if (FLAG_log_code_drop) {
+ unoptimized_code_count++;
+ }
+ }
+ }
+ if (FLAG_log_code_drop) {
+ ISL_Print(" total detached current: %" Pd "\n", current_code_count);
+ ISL_Print(" total detached unoptimized: %" Pd "\n",
+ unoptimized_code_count);
}
}
@@ -337,7 +356,7 @@
isolate->VisitObjectPointers(visitor,
visit_prologue_weak_persistent_handles,
StackFrameIterator::kDontValidateFrames);
- heap_->IterateNewPointers(visitor);
+ heap_->new_space()->VisitObjectPointers(visitor);
}
diff --git a/runtime/vm/heap.cc b/runtime/vm/heap.cc
index 2443369..4ff0080 100644
--- a/runtime/vm/heap.cc
+++ b/runtime/vm/heap.cc
@@ -16,6 +16,7 @@
#include "vm/raw_object.h"
#include "vm/scavenger.h"
#include "vm/service.h"
+#include "vm/service_event.h"
#include "vm/stack_frame.h"
#include "vm/tags.h"
#include "vm/verifier.h"
@@ -211,38 +212,18 @@
}
-void Heap::IterateObjects(ObjectVisitor* visitor) const {
+void Heap::VisitObjects(ObjectVisitor* visitor) const {
new_space_->VisitObjects(visitor);
old_space_->VisitObjects(visitor);
}
-void Heap::IteratePointers(ObjectPointerVisitor* visitor) const {
+void Heap::VisitObjectPointers(ObjectPointerVisitor* visitor) const {
new_space_->VisitObjectPointers(visitor);
old_space_->VisitObjectPointers(visitor);
}
-void Heap::IterateNewPointers(ObjectPointerVisitor* visitor) const {
- new_space_->VisitObjectPointers(visitor);
-}
-
-
-void Heap::IterateOldPointers(ObjectPointerVisitor* visitor) const {
- old_space_->VisitObjectPointers(visitor);
-}
-
-
-void Heap::IterateNewObjects(ObjectVisitor* visitor) const {
- new_space_->VisitObjects(visitor);
-}
-
-
-void Heap::IterateOldObjects(ObjectVisitor* visitor) const {
- old_space_->VisitObjects(visitor);
-}
-
-
RawInstructions* Heap::FindObjectInCodeSpace(FindObjectVisitor* visitor) const {
// Only executable pages can have RawInstructions objects.
RawObject* raw_obj = old_space_->FindObject(visitor, HeapPage::kExecutable);
@@ -482,13 +463,13 @@
{
VerifyObjectVisitor object_visitor(
isolate(), allocated_set, mark_expectation);
- this->IterateObjects(&object_visitor);
+ this->VisitObjects(&object_visitor);
}
{
// VM isolate heap is premarked.
VerifyObjectVisitor vm_object_visitor(
isolate(), allocated_set, kRequireMarked);
- vm_isolate->heap()->IterateObjects(&vm_object_visitor);
+ vm_isolate->heap()->VisitObjects(&vm_object_visitor);
}
return allocated_set;
}
@@ -497,7 +478,7 @@
bool Heap::Verify(MarkExpectation mark_expectation) const {
ObjectSet* allocated_set = CreateAllocatedObjectSet(mark_expectation);
VerifyPointersVisitor visitor(isolate(), allocated_set);
- IteratePointers(&visitor);
+ VisitObjectPointers(&visitor);
delete allocated_set;
// Only returning a value so that Heap::Validate can be called from an ASSERT.
return true;
@@ -640,8 +621,9 @@
ASSERT(gc_in_progress_);
gc_in_progress_ = false;
if (Service::NeedsEvents()) {
- GCEvent event(stats_);
- Service::HandleGCEvent(&event);
+ ServiceEvent event(Isolate::Current(), ServiceEvent::kGC);
+ event.set_gc_stats(&stats_);
+ Service::HandleEvent(&event);
}
}
@@ -700,21 +682,6 @@
}
-void GCEvent::PrintJSON(JSONStream* js) const {
- Isolate* isolate = Isolate::Current();
- {
- JSONObject jsobj(js);
- jsobj.AddProperty("type", "ServiceEvent");
- jsobj.AddPropertyF("id", "gc/%" Pd, stats_.num_);
- jsobj.AddProperty("eventType", "GC"); // TODO(koda): "GarbageCollected"
- jsobj.AddProperty("isolate", isolate);
- jsobj.AddProperty("reason", Heap::GCReasonToString(stats_.reason_));
- isolate->heap()->PrintToJSONObject(Heap::kNew, &jsobj);
- isolate->heap()->PrintToJSONObject(Heap::kOld, &jsobj);
- }
-}
-
-
#if defined(DEBUG)
NoSafepointScope::NoSafepointScope() : StackResource(Isolate::Current()) {
isolate()->IncrementNoSafepointScopeDepth();
diff --git a/runtime/vm/heap.h b/runtime/vm/heap.h
index f1085f7..928e7c5 100644
--- a/runtime/vm/heap.h
+++ b/runtime/vm/heap.h
@@ -21,6 +21,7 @@
class Isolate;
class ObjectPointerVisitor;
class ObjectSet;
+class ServiceEvent;
class VirtualMemory;
DECLARE_FLAG(bool, verbose_gc);
@@ -105,18 +106,10 @@
bool StubCodeContains(uword addr) const;
// Visit all pointers.
- void IteratePointers(ObjectPointerVisitor* visitor) const;
-
- // Visit all pointers in the space.
- void IterateNewPointers(ObjectPointerVisitor* visitor) const;
- void IterateOldPointers(ObjectPointerVisitor* visitor) const;
+ void VisitObjectPointers(ObjectPointerVisitor* visitor) const;
// Visit all objects.
- void IterateObjects(ObjectVisitor* visitor) const;
-
- // Visit all object in the space.
- void IterateNewObjects(ObjectVisitor* visitor) const;
- void IterateOldObjects(ObjectVisitor* visitor) const;
+ void VisitObjects(ObjectVisitor* visitor) const;
// Find an object by visiting all pointers in the specified heap space,
// the 'visitor' is used to determine if an object is found or not.
@@ -320,22 +313,12 @@
int pretenure_policy_;
- friend class GCEvent;
+ friend class ServiceEvent;
friend class GCTestHelper;
DISALLOW_COPY_AND_ASSIGN(Heap);
};
-class GCEvent {
- public:
- explicit GCEvent(const Heap::GCStats& stats)
- : stats_(stats) {}
- void PrintJSON(JSONStream* js) const;
- private:
- const Heap::GCStats& stats_;
-};
-
-
// Within a NoSafepointScope, the thread must not reach any safepoint. Used
// around code that manipulates raw object pointers directly without handles.
#if defined(DEBUG)
diff --git a/runtime/vm/heap_test.cc b/runtime/vm/heap_test.cc
index 32ec871..11f2d4f 100644
--- a/runtime/vm/heap_test.cc
+++ b/runtime/vm/heap_test.cc
@@ -252,4 +252,15 @@
}
}
+
+TEST_CASE(IterateReadOnly) {
+ const String& obj = String::Handle(String::New("x", Heap::kOld));
+ Heap* heap = Thread::Current()->isolate()->heap();
+ EXPECT(heap->Contains(RawObject::ToAddr(obj.raw())));
+ heap->WriteProtect(true);
+ EXPECT(heap->Contains(RawObject::ToAddr(obj.raw())));
+ heap->WriteProtect(false);
+ EXPECT(heap->Contains(RawObject::ToAddr(obj.raw())));
+}
+
} // namespace dart.
diff --git a/runtime/vm/intermediate_language.h b/runtime/vm/intermediate_language.h
index 72ebed1..6290b00 100644
--- a/runtime/vm/intermediate_language.h
+++ b/runtime/vm/intermediate_language.h
@@ -440,6 +440,7 @@
M(Return) \
M(Throw) \
M(ReThrow) \
+ M(Stop) \
M(Goto) \
M(IndirectGoto) \
M(Branch) \
@@ -2125,6 +2126,32 @@
};
+class StopInstr : public TemplateInstruction<0, NoThrow> {
+ public:
+ explicit StopInstr(const char* message)
+ : message_(message) {
+ ASSERT(message != NULL);
+ }
+
+ const char* message() const { return message_; }
+
+ DECLARE_INSTRUCTION(Stop);
+
+ virtual intptr_t ArgumentCount() const { return 0; }
+
+ virtual bool CanDeoptimize() const { return false; }
+
+ virtual EffectSet Effects() const { return EffectSet::None(); }
+
+ virtual EffectSet Dependencies() const { return EffectSet::None(); }
+
+ private:
+ const char* message_;
+
+ DISALLOW_COPY_AND_ASSIGN(StopInstr);
+};
+
+
class GotoInstr : public TemplateInstruction<0, NoThrow> {
public:
explicit GotoInstr(JoinEntryInstr* entry)
diff --git a/runtime/vm/intermediate_language_arm.cc b/runtime/vm/intermediate_language_arm.cc
index f576dc8..bc38b17 100644
--- a/runtime/vm/intermediate_language_arm.cc
+++ b/runtime/vm/intermediate_language_arm.cc
@@ -28,7 +28,6 @@
DECLARE_FLAG(bool, enable_asserts);
DECLARE_FLAG(bool, enable_type_checks);
DECLARE_FLAG(int, optimization_counter_threshold);
-DECLARE_FLAG(bool, propagate_ic_data);
DECLARE_FLAG(bool, use_osr);
// Generic summary for call instructions that have all arguments pushed
@@ -2869,7 +2868,7 @@
: instruction_(instruction) { }
virtual void EmitNativeCode(FlowGraphCompiler* compiler) {
- if (FLAG_use_osr) {
+ if (FLAG_use_osr && osr_entry_label()->IsLinked()) {
uword flags_address = Isolate::Current()->stack_overflow_flags_address();
const Register value = instruction_->locs()->temp(0).reg();
__ Comment("CheckStackOverflowSlowPathOsr");
@@ -6637,6 +6636,17 @@
}
+LocationSummary* StopInstr::MakeLocationSummary(Zone* zone,
+ bool opt) const {
+ return new(zone) LocationSummary(zone, 0, 0, LocationSummary::kNoCall);
+}
+
+
+void StopInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
+ __ Stop(message());
+}
+
+
void GraphEntryInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
if (!compiler->CanFallThroughTo(normal_entry())) {
__ b(compiler->GetJumpLabel(normal_entry()));
diff --git a/runtime/vm/intermediate_language_arm64.cc b/runtime/vm/intermediate_language_arm64.cc
index 3956689..5eecb10 100644
--- a/runtime/vm/intermediate_language_arm64.cc
+++ b/runtime/vm/intermediate_language_arm64.cc
@@ -2593,7 +2593,7 @@
: instruction_(instruction) { }
virtual void EmitNativeCode(FlowGraphCompiler* compiler) {
- if (FLAG_use_osr) {
+ if (FLAG_use_osr && osr_entry_label()->IsLinked()) {
uword flags_address = Isolate::Current()->stack_overflow_flags_address();
const Register value = instruction_->locs()->temp(0).reg();
__ Comment("CheckStackOverflowSlowPathOsr");
@@ -5405,6 +5405,17 @@
}
+LocationSummary* StopInstr::MakeLocationSummary(Zone* zone,
+ bool opt) const {
+ return new(zone) LocationSummary(zone, 0, 0, LocationSummary::kNoCall);
+}
+
+
+void StopInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
+ __ Stop(message());
+}
+
+
void GraphEntryInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
if (!compiler->CanFallThroughTo(normal_entry())) {
__ b(compiler->GetJumpLabel(normal_entry()));
diff --git a/runtime/vm/intermediate_language_ia32.cc b/runtime/vm/intermediate_language_ia32.cc
index 5ea1fa2..8505364 100644
--- a/runtime/vm/intermediate_language_ia32.cc
+++ b/runtime/vm/intermediate_language_ia32.cc
@@ -26,7 +26,6 @@
DECLARE_FLAG(bool, enable_asserts);
DECLARE_FLAG(bool, enable_type_checks);
DECLARE_FLAG(int, optimization_counter_threshold);
-DECLARE_FLAG(bool, propagate_ic_data);
DECLARE_FLAG(bool, use_osr);
DECLARE_FLAG(bool, throw_on_javascript_int_overflow);
@@ -2585,7 +2584,7 @@
: instruction_(instruction) { }
virtual void EmitNativeCode(FlowGraphCompiler* compiler) {
- if (FLAG_use_osr) {
+ if (FLAG_use_osr && osr_entry_label()->IsLinked()) {
uword flags_address = Isolate::Current()->stack_overflow_flags_address();
__ Comment("CheckStackOverflowSlowPathOsr");
__ Bind(osr_entry_label());
@@ -6526,6 +6525,17 @@
}
+LocationSummary* StopInstr::MakeLocationSummary(Zone* zone,
+ bool opt) const {
+ return new(zone) LocationSummary(zone, 0, 0, LocationSummary::kNoCall);
+}
+
+
+void StopInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
+ __ Stop(message());
+}
+
+
void GraphEntryInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
if (!compiler->CanFallThroughTo(normal_entry())) {
__ jmp(compiler->GetJumpLabel(normal_entry()));
diff --git a/runtime/vm/intermediate_language_mips.cc b/runtime/vm/intermediate_language_mips.cc
index 2274bf8..602a4e2 100644
--- a/runtime/vm/intermediate_language_mips.cc
+++ b/runtime/vm/intermediate_language_mips.cc
@@ -27,7 +27,6 @@
DECLARE_FLAG(bool, enable_asserts);
DECLARE_FLAG(bool, enable_type_checks);
DECLARE_FLAG(int, optimization_counter_threshold);
-DECLARE_FLAG(bool, propagate_ic_data);
DECLARE_FLAG(bool, use_osr);
// Generic summary for call instructions that have all arguments pushed
@@ -2703,7 +2702,7 @@
: instruction_(instruction) { }
virtual void EmitNativeCode(FlowGraphCompiler* compiler) {
- if (FLAG_use_osr) {
+ if (FLAG_use_osr && osr_entry_label()->IsLinked()) {
uword flags_address = Isolate::Current()->stack_overflow_flags_address();
Register value = instruction_->locs()->temp(0).reg();
__ Comment("CheckStackOverflowSlowPathOsr");
@@ -5381,6 +5380,17 @@
}
+LocationSummary* StopInstr::MakeLocationSummary(Zone* zone,
+ bool opt) const {
+ return new(zone) LocationSummary(zone, 0, 0, LocationSummary::kNoCall);
+}
+
+
+void StopInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
+ __ Stop(message());
+}
+
+
void GraphEntryInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
if (!compiler->CanFallThroughTo(normal_entry())) {
__ b(compiler->GetJumpLabel(normal_entry()));
diff --git a/runtime/vm/intermediate_language_x64.cc b/runtime/vm/intermediate_language_x64.cc
index 9e81b43..433d67d 100644
--- a/runtime/vm/intermediate_language_x64.cc
+++ b/runtime/vm/intermediate_language_x64.cc
@@ -26,7 +26,6 @@
DECLARE_FLAG(bool, enable_asserts);
DECLARE_FLAG(bool, enable_type_checks);
DECLARE_FLAG(int, optimization_counter_threshold);
-DECLARE_FLAG(bool, propagate_ic_data);
DECLARE_FLAG(bool, throw_on_javascript_int_overflow);
DECLARE_FLAG(bool, use_osr);
@@ -2586,7 +2585,7 @@
: instruction_(instruction) { }
virtual void EmitNativeCode(FlowGraphCompiler* compiler) {
- if (FLAG_use_osr) {
+ if (FLAG_use_osr && osr_entry_label()->IsLinked()) {
uword flags_address = Isolate::Current()->stack_overflow_flags_address();
Register temp = instruction_->locs()->temp(0).reg();
__ Comment("CheckStackOverflowSlowPathOsr");
@@ -6157,6 +6156,17 @@
}
+LocationSummary* StopInstr::MakeLocationSummary(Zone* zone,
+ bool opt) const {
+ return new(zone) LocationSummary(zone, 0, 0, LocationSummary::kNoCall);
+}
+
+
+void StopInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
+ __ Stop(message());
+}
+
+
void GraphEntryInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
if (!compiler->CanFallThroughTo(normal_entry())) {
__ jmp(compiler->GetJumpLabel(normal_entry()));
diff --git a/runtime/vm/intrinsifier_arm.cc b/runtime/vm/intrinsifier_arm.cc
index ffd6655..f81581b 100644
--- a/runtime/vm/intrinsifier_arm.cc
+++ b/runtime/vm/intrinsifier_arm.cc
@@ -210,8 +210,8 @@
__ ldr(R0, Address(R0, 0)); \
\
/* R2: allocation size. */ \
- __ add(R1, R0, Operand(R2)); \
- __ b(&fall_through, VS); \
+ __ adds(R1, R0, Operand(R2)); \
+ __ b(&fall_through, CS); /* Fail on unsigned overflow. */ \
\
/* Check if the allocation fits into the remaining space. */ \
/* R0: potential new object start. */ \
@@ -798,12 +798,86 @@
void Intrinsifier::Bigint_lsh(Assembler* assembler) {
- // TODO(regis): Implement.
+ // static void _lsh(Uint32List x_digits, int x_used, int n,
+ // Uint32List r_digits)
+
+ // R2 = x_used, R3 = x_digits, x_used > 0, x_used is Smi.
+ __ ldrd(R2, SP, 2 * kWordSize);
+ // R4 = r_digits, R5 = n, n is Smi, n % _DIGIT_BITS != 0.
+ __ ldrd(R4, SP, 0 * kWordSize);
+ __ SmiUntag(R5);
+ // R0 = n ~/ _DIGIT_BITS
+ __ Asr(R0, R5, Operand(5));
+ // R6 = &x_digits[0]
+ __ add(R6, R3, Operand(TypedData::data_offset() - kHeapObjectTag));
+ // R7 = &x_digits[x_used]
+ __ add(R7, R6, Operand(R2, LSL, 1));
+ // R8 = &r_digits[1]
+ __ add(R8, R4, Operand(TypedData::data_offset() - kHeapObjectTag +
+ Bigint::kBytesPerDigit));
+ // R8 = &r_digits[x_used + n ~/ _DIGIT_BITS + 1]
+ __ add(R0, R0, Operand(R2, ASR, 1));
+ __ add(R8, R8, Operand(R0, LSL, 2));
+ // R3 = n % _DIGIT_BITS
+ __ and_(R3, R5, Operand(31));
+ // R2 = 32 - R3
+ __ rsb(R2, R3, Operand(32));
+ __ mov(R1, Operand(0));
+ Label loop;
+ __ Bind(&loop);
+ __ ldr(R0, Address(R7, -Bigint::kBytesPerDigit, Address::PreIndex));
+ __ orr(R1, R1, Operand(R0, LSR, R2));
+ __ str(R1, Address(R8, -Bigint::kBytesPerDigit, Address::PreIndex));
+ __ mov(R1, Operand(R0, LSL, R3));
+ __ teq(R7, Operand(R6));
+ __ b(&loop, NE);
+ __ str(R1, Address(R8, -Bigint::kBytesPerDigit, Address::PreIndex));
+ // Returning Object::null() is not required, since this method is private.
+ __ Ret();
}
void Intrinsifier::Bigint_rsh(Assembler* assembler) {
- // TODO(regis): Implement.
+ // static void _lsh(Uint32List x_digits, int x_used, int n,
+ // Uint32List r_digits)
+
+ // R2 = x_used, R3 = x_digits, x_used > 0, x_used is Smi.
+ __ ldrd(R2, SP, 2 * kWordSize);
+ // R4 = r_digits, R5 = n, n is Smi, n % _DIGIT_BITS != 0.
+ __ ldrd(R4, SP, 0 * kWordSize);
+ __ SmiUntag(R5);
+ // R0 = n ~/ _DIGIT_BITS
+ __ Asr(R0, R5, Operand(5));
+ // R8 = &r_digits[0]
+ __ add(R8, R4, Operand(TypedData::data_offset() - kHeapObjectTag));
+ // R7 = &x_digits[n ~/ _DIGIT_BITS]
+ __ add(R7, R3, Operand(TypedData::data_offset() - kHeapObjectTag));
+ __ add(R7, R7, Operand(R0, LSL, 2));
+ // R6 = &r_digits[x_used - n ~/ _DIGIT_BITS - 1]
+ __ add(R0, R0, Operand(1));
+ __ rsb(R0, R0, Operand(R2, ASR, 1));
+ __ add(R6, R8, Operand(R0, LSL, 2));
+ // R3 = n % _DIGIT_BITS
+ __ and_(R3, R5, Operand(31));
+ // R2 = 32 - R3
+ __ rsb(R2, R3, Operand(32));
+ // R1 = x_digits[n ~/ _DIGIT_BITS] >> (n % _DIGIT_BITS)
+ __ ldr(R1, Address(R7, Bigint::kBytesPerDigit, Address::PostIndex));
+ __ mov(R1, Operand(R1, LSR, R3));
+ Label loop_entry;
+ __ b(&loop_entry);
+ Label loop;
+ __ Bind(&loop);
+ __ ldr(R0, Address(R7, Bigint::kBytesPerDigit, Address::PostIndex));
+ __ orr(R1, R1, Operand(R0, LSL, R2));
+ __ str(R1, Address(R8, Bigint::kBytesPerDigit, Address::PostIndex));
+ __ mov(R1, Operand(R0, LSR, R3));
+ __ Bind(&loop_entry);
+ __ teq(R8, Operand(R6));
+ __ b(&loop, NE);
+ __ str(R1, Address(R8, Bigint::kBytesPerDigit, Address::PostIndex));
+ // Returning Object::null() is not required, since this method is private.
+ __ Ret();
}
@@ -1653,6 +1727,7 @@
Label fail;
__ mov(R6, Operand(length_reg)); // Save the length register.
+ // TODO(koda): Protect against negative length and overflow here.
__ SmiUntag(length_reg);
const intptr_t fixed_size = sizeof(RawString) + kObjectAlignment - 1;
__ AddImmediate(length_reg, fixed_size);
@@ -1667,7 +1742,7 @@
// length_reg: allocation size.
__ adds(R1, R0, Operand(length_reg));
- __ b(&fail, VS); // Fail on overflow.
+ __ b(&fail, CS); // Fail on unsigned overflow.
// Check if the allocation fits into the remaining space.
// R0: potential new object start.
diff --git a/runtime/vm/intrinsifier_arm64.cc b/runtime/vm/intrinsifier_arm64.cc
index 402c262..a877dc9 100644
--- a/runtime/vm/intrinsifier_arm64.cc
+++ b/runtime/vm/intrinsifier_arm64.cc
@@ -220,8 +220,8 @@
__ ldr(R0, Address(R0, 0)); \
\
/* R2: allocation size. */ \
- __ add(R1, R0, Operand(R2)); \
- __ b(&fall_through, VS); \
+ __ adds(R1, R0, Operand(R2)); \
+ __ b(&fall_through, CS); /* Fail on unsigned overflow. */ \
\
/* Check if the allocation fits into the remaining space. */ \
/* R0: potential new object start. */ \
@@ -1730,6 +1730,7 @@
Label fail;
__ mov(R6, length_reg); // Save the length register.
+ // TODO(koda): Protect against negative length and overflow here.
__ SmiUntag(length_reg);
const intptr_t fixed_size = sizeof(RawString) + kObjectAlignment - 1;
__ AddImmediate(length_reg, length_reg, fixed_size, kNoPP);
@@ -1744,7 +1745,7 @@
// length_reg: allocation size.
__ adds(R1, R0, Operand(length_reg));
- __ b(&fail, VS); // Fail on overflow.
+ __ b(&fail, CS); // Fail on unsigned overflow.
// Check if the allocation fits into the remaining space.
// R0: potential new object start.
diff --git a/runtime/vm/intrinsifier_mips.cc b/runtime/vm/intrinsifier_mips.cc
index 54a63c0..330c589 100644
--- a/runtime/vm/intrinsifier_mips.cc
+++ b/runtime/vm/intrinsifier_mips.cc
@@ -200,8 +200,9 @@
__ lw(V0, Address(V0, 0)); \
\
/* T2: allocation size. */ \
- __ AdduDetectOverflow(T1, V0, T2, CMPRES1); \
- __ bltz(CMPRES1, &fall_through); \
+ __ addu(T1, V0, T2); \
+ /* Branch on unsigned overflow. */ \
+ __ BranchUnsignedLess(T1, V0, &fall_through); \
\
/* Check if the allocation fits into the remaining space. */ \
/* V0: potential new object start. */ \
@@ -1763,6 +1764,7 @@
const Register length_reg = T2;
__ mov(T6, length_reg); // Save the length register.
+ // TODO(koda): Protect against negative length and overflow here.
__ SmiUntag(length_reg);
const intptr_t fixed_size = sizeof(RawString) + kObjectAlignment - 1;
__ AddImmediate(length_reg, fixed_size);
@@ -1777,8 +1779,8 @@
__ lw(V0, Address(T3, 0));
// length_reg: allocation size.
- __ AdduDetectOverflow(T1, V0, length_reg, CMPRES1);
- __ bltz(CMPRES1, failure); // Fail on overflow.
+ __ addu(T1, V0, length_reg);
+ __ BranchUnsignedLess(T1, V0, failure); // Fail on unsigned overflow.
// Check if the allocation fits into the remaining space.
// V0: potential new object start.
diff --git a/runtime/vm/isolate.cc b/runtime/vm/isolate.cc
index 645e8d4..9f503b1 100644
--- a/runtime/vm/isolate.cc
+++ b/runtime/vm/isolate.cc
@@ -202,18 +202,22 @@
break;
}
case kPingMsg: {
- // [ OOB, kPingMsg, responsePort, priority ]
- if (message.Length() != 4) return true;
+ // [ OOB, kPingMsg, responsePort, priority, response ]
+ if (message.Length() != 5) return true;
const Object& obj2 = Object::Handle(I, message.At(2));
if (!obj2.IsSendPort()) return true;
const SendPort& send_port = SendPort::Cast(obj2);
const Object& obj3 = Object::Handle(I, message.At(3));
if (!obj3.IsSmi()) return true;
const intptr_t priority = Smi::Cast(obj3).Value();
+ const Object& obj4 = Object::Handle(I, message.At(4));
+ if (!obj4.IsInstance() && !obj4.IsNull()) return true;
+ const Instance& response =
+ obj4.IsNull() ? Instance::null_instance() : Instance::Cast(obj4);
if (priority == kImmediateAction) {
uint8_t* data = NULL;
intptr_t len = 0;
- SerializeObject(Object::null_instance(), &data, &len, false);
+ SerializeObject(response, &data, &len, false);
PortMap::PostMessage(new Message(send_port.Id(),
data, len,
Message::kNormalPriority));
@@ -268,21 +272,31 @@
case kAddErrorMsg:
case kDelErrorMsg: {
// [ OOB, msg, listener port ]
- if (message.Length() != 3) return true;
+ if (message.Length() < 3) return true;
const Object& obj = Object::Handle(I, message.At(2));
if (!obj.IsSendPort()) return true;
const SendPort& listener = SendPort::Cast(obj);
switch (msg_type) {
- case kAddExitMsg:
- I->AddExitListener(listener);
+ case kAddExitMsg: {
+ if (message.Length() != 4) return true;
+ // [ OOB, msg, listener port, response object ]
+ const Object& response = Object::Handle(I, message.At(3));
+ if (!response.IsInstance() && !response.IsNull()) return true;
+ I->AddExitListener(listener,
+ response.IsNull() ? Instance::null_instance()
+ : Instance::Cast(response));
break;
+ }
case kDelExitMsg:
+ if (message.Length() != 3) return true;
I->RemoveExitListener(listener);
break;
case kAddErrorMsg:
+ if (message.Length() != 3) return true;
I->AddErrorListener(listener);
break;
case kDelErrorMsg:
+ if (message.Length() != 3) return true;
I->RemoveErrorListener(listener);
break;
default:
@@ -597,10 +611,11 @@
metrics_list_head_(NULL),
cha_(NULL),
next_(NULL),
+ pause_loop_monitor_(NULL),
REUSABLE_HANDLE_LIST(REUSABLE_HANDLE_INITIALIZERS)
REUSABLE_HANDLE_LIST(REUSABLE_HANDLE_SCOPE_INIT)
reusable_handles_() {
- set_vm_tag(VMTag::kIdleTagId);
+ set_vm_tag(VMTag::kEmbedderTagId);
set_user_tag(UserTags::kDefaultUserTag);
}
@@ -661,6 +676,7 @@
metrics_list_head_(NULL),
cha_(NULL),
next_(NULL),
+ pause_loop_monitor_(NULL),
REUSABLE_HANDLE_LIST(REUSABLE_HANDLE_INITIALIZERS)
REUSABLE_HANDLE_LIST(REUSABLE_HANDLE_SCOPE_INIT)
reusable_handles_() {
@@ -687,6 +703,8 @@
delete spawn_state_;
delete log_;
log_ = NULL;
+ delete pause_loop_monitor_;
+ pause_loop_monitor_ = NULL;
}
@@ -924,6 +942,7 @@
}
// Set the isolate as runnable and if we are being spawned schedule
// isolate on thread pool for execution.
+ ASSERT(object_store()->root_library() != Library::null());
is_runnable_ = true;
if (!ServiceIsolate::IsServiceIsolate(this)) {
message_handler()->set_pause_on_start(FLAG_pause_isolates_on_start);
@@ -1004,21 +1023,23 @@
// TODO(iposva): Remove duplicated code and start using some hash based
// structure instead of these linear lookups.
-void Isolate::AddExitListener(const SendPort& listener) {
+void Isolate::AddExitListener(const SendPort& listener,
+ const Instance& response) {
// Ensure a limit for the number of listeners remembered.
- static const intptr_t kMaxListeners = kSmiMax / (6 * kWordSize);
+ static const intptr_t kMaxListeners = kSmiMax / (12 * kWordSize);
const GrowableObjectArray& listeners = GrowableObjectArray::Handle(
this, object_store()->exit_listeners());
SendPort& current = SendPort::Handle(this);
intptr_t insertion_index = -1;
- for (intptr_t i = 0; i < listeners.Length(); i++) {
+ for (intptr_t i = 0; i < listeners.Length(); i += 2) {
current ^= listeners.At(i);
if (current.IsNull()) {
if (insertion_index < 0) {
insertion_index = i;
}
} else if (current.Id() == listener.Id()) {
+ listeners.SetAt(i + 1, response);
return;
}
}
@@ -1030,8 +1051,10 @@
return;
}
listeners.Add(listener);
+ listeners.Add(response);
} else {
listeners.SetAt(insertion_index, listener);
+ listeners.SetAt(insertion_index + 1, response);
}
}
@@ -1040,12 +1063,13 @@
const GrowableObjectArray& listeners = GrowableObjectArray::Handle(
this, object_store()->exit_listeners());
SendPort& current = SendPort::Handle(this);
- for (intptr_t i = 0; i < listeners.Length(); i++) {
+ for (intptr_t i = 0; i < listeners.Length(); i += 2) {
current ^= listeners.At(i);
if (!current.IsNull() && (current.Id() == listener.Id())) {
// Remove the matching listener from the list.
current = SendPort::null();
listeners.SetAt(i, current);
+ listeners.SetAt(i + 1, Object::null_instance());
return;
}
}
@@ -1058,13 +1082,15 @@
if (listeners.IsNull()) return;
SendPort& listener = SendPort::Handle(this);
- for (intptr_t i = 0; i < listeners.Length(); i++) {
+ Instance& response = Instance::Handle(this);
+ for (intptr_t i = 0; i < listeners.Length(); i += 2) {
listener ^= listeners.At(i);
if (!listener.IsNull()) {
Dart_Port port_id = listener.Id();
uint8_t* data = NULL;
intptr_t len = 0;
- SerializeObject(Object::null_instance(), &data, &len, false);
+ response ^= listeners.At(i + 1);
+ SerializeObject(response, &data, &len, false);
Message* msg = new Message(port_id, data, len, Message::kNormalPriority);
PortMap::PostMessage(msg);
}
@@ -1695,6 +1721,51 @@
}
+void Isolate::WakePauseEventHandler(Dart_Isolate isolate) {
+ Isolate* iso = reinterpret_cast<Isolate*>(isolate);
+ MonitorLocker ml(iso->pause_loop_monitor_);
+ ml.Notify();
+}
+
+
+void Isolate::PauseEventHandler() {
+ // We are stealing a pause event (like a breakpoint) from the
+ // embedder. We don't know what kind of thread we are on -- it
+ // could be from our thread pool or it could be a thread from the
+ // embedder. Sit on the current thread handling service events
+ // until we are told to resume.
+ if (pause_loop_monitor_ == NULL) {
+ pause_loop_monitor_ = new Monitor();
+ }
+ Dart_EnterScope();
+ MonitorLocker ml(pause_loop_monitor_);
+
+ Dart_MessageNotifyCallback saved_notify_callback =
+ message_notify_callback();
+ set_message_notify_callback(Isolate::WakePauseEventHandler);
+
+ bool resume = false;
+ while (true) {
+ // Handle all available vm service messages, up to a resume
+ // request.
+ while (!resume && Dart_HasServiceMessages()) {
+ pause_loop_monitor_->Exit();
+ resume = Dart_HandleServiceMessages();
+ pause_loop_monitor_->Enter();
+ }
+ if (resume) {
+ break;
+ }
+
+ // Wait for more service messages.
+ Monitor::WaitResult res = ml.Wait();
+ ASSERT(res == Monitor::kNotified);
+ }
+ set_message_notify_callback(saved_notify_callback);
+ Dart_ExitScope();
+}
+
+
void Isolate::VisitIsolates(IsolateVisitor* visitor) {
if (visitor == NULL) {
return;
diff --git a/runtime/vm/isolate.h b/runtime/vm/isolate.h
index efb3486..dbf4b51 100644
--- a/runtime/vm/isolate.h
+++ b/runtime/vm/isolate.h
@@ -421,7 +421,7 @@
bool AddResumeCapability(const Capability& capability);
bool RemoveResumeCapability(const Capability& capability);
- void AddExitListener(const SendPort& listener);
+ void AddExitListener(const SendPort& listener, const Instance& response);
void RemoveExitListener(const SendPort& listener);
void NotifyExitListeners();
@@ -669,6 +669,9 @@
Counters* counters() { return &counters_; }
+ // Handle service messages until we are told to resume execution.
+ void PauseEventHandler();
+
private:
Isolate();
explicit Isolate(Isolate* original);
@@ -774,6 +777,9 @@
// Isolate list next pointer.
Isolate* next_;
+ // Used to wake the isolate when it is in the pause event loop.
+ Monitor* pause_loop_monitor_;
+
// Reusable handles support.
#define REUSABLE_HANDLE_FIELDS(object) \
object* object##_handle_;
@@ -805,6 +811,8 @@
static Dart_EntropySource entropy_source_callback_;
static Dart_IsolateInterruptCallback vmstats_callback_;
+ static void WakePauseEventHandler(Dart_Isolate isolate);
+
// Manage list of existing isolates.
static void AddIsolateTolist(Isolate* isolate);
static void RemoveIsolateFromList(Isolate* isolate);
diff --git a/runtime/vm/json_stream.cc b/runtime/vm/json_stream.cc
index 06c13fc..c122bb7 100644
--- a/runtime/vm/json_stream.cc
+++ b/runtime/vm/json_stream.cc
@@ -22,6 +22,7 @@
: open_objects_(0),
buffer_(buf_size),
reply_port_(ILLEGAL_PORT),
+ seq_(""),
method_(""),
param_keys_(NULL),
param_values_(NULL),
@@ -35,10 +36,12 @@
void JSONStream::Setup(Zone* zone,
Dart_Port reply_port,
+ const String& seq,
const String& method,
const Array& param_keys,
const Array& param_values) {
set_reply_port(reply_port);
+ seq_ = seq.ToCString();
method_ = method.ToCString();
String& string_iterator = String::Handle();
@@ -66,6 +69,13 @@
isolate_name, method_);
setup_time_micros_ = OS::GetCurrentTimeMicros();
}
+ buffer_.Printf("{\"result\":");
+}
+
+
+void JSONStream::SetupError() {
+ buffer_.Clear();
+ buffer_.Printf("{\"error\":");
}
@@ -83,6 +93,8 @@
if (FLAG_trace_service) {
process_delta_micros = OS::GetCurrentTimeMicros() - setup_time_micros_;
}
+ // TODO(turnidge): Handle non-string sequence numbers.
+ buffer_.Printf(", \"id\":\"%s\"}", seq());
const String& reply = String::Handle(String::New(ToCString()));
ASSERT(!reply.IsNull());
@@ -261,6 +273,12 @@
}
+void JSONStream::PrintValue(MessageQueue* queue) {
+ PrintCommaIfNeeded();
+ queue->PrintJSON(this);
+}
+
+
void JSONStream::PrintValue(Isolate* isolate, bool ref) {
PrintCommaIfNeeded();
isolate->PrintJSON(this, ref);
@@ -330,6 +348,13 @@
PrintValue(metric);
}
+
+void JSONStream::PrintProperty(const char* name, MessageQueue* queue) {
+ PrintPropertyName(name);
+ PrintValue(queue);
+}
+
+
void JSONStream::PrintProperty(const char* name, Isolate* isolate) {
PrintPropertyName(name);
PrintValue(isolate);
diff --git a/runtime/vm/json_stream.h b/runtime/vm/json_stream.h
index 17792cc..12bd798 100644
--- a/runtime/vm/json_stream.h
+++ b/runtime/vm/json_stream.h
@@ -17,6 +17,7 @@
class Instance;
class JSONArray;
class JSONObject;
+class MessageQueue;
class Metric;
class Object;
class ServiceEvent;
@@ -31,9 +32,11 @@
void Setup(Zone* zone,
Dart_Port reply_port,
+ const String& seq,
const String& method,
const Array& param_keys,
const Array& param_values);
+ void SetupError();
void PostReply();
@@ -63,6 +66,7 @@
// otherwise.
bool ParamIs(const char* key, const char* value) const;
+ const char* seq() const { return seq_; }
const char* method() const { return method_; }
const char** param_keys() const { return param_keys_; }
const char** param_values() const { return param_values_; }
@@ -88,6 +92,7 @@
void PrintValue(SourceBreakpoint* bpt);
void PrintValue(const ServiceEvent* event);
void PrintValue(Metric* metric);
+ void PrintValue(MessageQueue* queue);
void PrintValue(Isolate* isolate, bool ref = true);
bool PrintValueStr(const String& s, intptr_t limit);
@@ -105,6 +110,7 @@
void PrintProperty(const char* name, const ServiceEvent* event);
void PrintProperty(const char* name, SourceBreakpoint* bpt);
void PrintProperty(const char* name, Metric* metric);
+ void PrintProperty(const char* name, MessageQueue* queue);
void PrintProperty(const char* name, Isolate* isolate);
void PrintPropertyName(const char* name);
void PrintCommaIfNeeded();
@@ -119,6 +125,7 @@
intptr_t open_objects_;
TextBuffer buffer_;
Dart_Port reply_port_;
+ const char* seq_;
const char* method_;
const char** param_keys_;
const char** param_values_;
@@ -179,6 +186,9 @@
void AddProperty(const char* name, Metric* metric) const {
stream_->PrintProperty(name, metric);
}
+ void AddProperty(const char* name, MessageQueue* queue) const {
+ stream_->PrintProperty(name, queue);
+ }
void AddProperty(const char* name, Isolate* isolate) const {
stream_->PrintProperty(name, isolate);
}
@@ -230,6 +240,9 @@
void AddValue(Metric* metric) const {
stream_->PrintValue(metric);
}
+ void AddValue(MessageQueue* queue) const {
+ stream_->PrintValue(queue);
+ }
void AddValueF(const char* format, ...) const PRINTF_ATTRIBUTE(2, 3);
private:
diff --git a/runtime/vm/locations.h b/runtime/vm/locations.h
index a2e8be3..48fbd6f 100644
--- a/runtime/vm/locations.h
+++ b/runtime/vm/locations.h
@@ -459,7 +459,7 @@
void Remove(T value) { data_ &= ~ToMask(value); }
- bool IsEmpty() const { return data_ != 0; }
+ bool IsEmpty() const { return data_ == 0; }
intptr_t data() const { return data_; }
diff --git a/runtime/vm/message.cc b/runtime/vm/message.cc
index ea9b986..e5bc7ed 100644
--- a/runtime/vm/message.cc
+++ b/runtime/vm/message.cc
@@ -4,6 +4,9 @@
#include "vm/message.h"
+#include "vm/dart_entry.h"
+#include "vm/json_stream.h"
+#include "vm/object.h"
#include "vm/port.h"
namespace dart {
@@ -18,6 +21,26 @@
}
+intptr_t Message::Id() const {
+ // Messages are allocated on the C heap. Use the raw address as the id.
+ return reinterpret_cast<intptr_t>(this);
+}
+
+const char* Message::PriorityAsString(Priority priority) {
+ switch (priority) {
+ case kNormalPriority:
+ return "Normal";
+ break;
+ case kOOBPriority:
+ return "OOB";
+ break;
+ default:
+ UNIMPLEMENTED();
+ return NULL;
+ }
+}
+
+
MessageQueue::MessageQueue() {
head_ = NULL;
tail_ = NULL;
@@ -106,4 +129,95 @@
}
+MessageQueue::Iterator::Iterator(const MessageQueue* queue)
+ : next_(NULL) {
+ Reset(queue);
+}
+
+
+MessageQueue::Iterator::~Iterator() {
+}
+
+void MessageQueue::Iterator::Reset(const MessageQueue* queue) {
+ ASSERT(queue != NULL);
+ next_ = queue->head_;
+}
+
+// returns false when there are no more messages left.
+bool MessageQueue::Iterator::HasNext() {
+ return next_ != NULL;
+}
+
+// Returns the current message and moves forward.
+Message* MessageQueue::Iterator::Next() {
+ Message* current = next_;
+ next_ = next_->next_;
+ return current;
+}
+
+
+intptr_t MessageQueue::Length() const {
+ MessageQueue::Iterator it(this);
+ intptr_t length = 0;
+ while (it.HasNext()) {
+ it.Next();
+ length++;
+ }
+ return length;
+}
+
+
+Message* MessageQueue::FindMessageById(intptr_t id) {
+ MessageQueue::Iterator it(this);
+ while (it.HasNext()) {
+ Message* current = it.Next();
+ ASSERT(current != NULL);
+ if (current->Id() == id) {
+ return current;
+ }
+ }
+ return NULL;
+}
+
+
+void MessageQueue::PrintJSON(JSONStream* stream) {
+ Isolate* isolate = Isolate::Current();
+ JSONArray messages(stream);
+
+ Object& msg_handler = Object::Handle(isolate);
+
+ MessageQueue::Iterator it(this);
+ intptr_t depth = 0;
+ while (it.HasNext()) {
+ Message* current = it.Next();
+ JSONObject message(&messages);
+ message.AddProperty("type", "Message");
+ message.AddPropertyF("name", "Isolate Message (%" Px ")", current->Id());
+ message.AddPropertyF("messageObjectId", "messages/%" Px "",
+ current->Id());
+ message.AddProperty("size", current->len());
+ message.AddProperty("depth", depth++);
+ message.AddProperty("_destinationPort",
+ static_cast<intptr_t>(current->dest_port()));
+ message.AddProperty("priority",
+ Message::PriorityAsString(current->priority()));
+ // TODO(johnmccutchan): Move port -> handler map out of Dart and into the
+ // VM, that way we can lookup the handler without invoking Dart code.
+ msg_handler = DartLibraryCalls::LookupHandler(current->dest_port());
+ if (msg_handler.IsInstance() && Instance::Cast(msg_handler).IsClosure()) {
+ // Grab function from closure.
+ msg_handler = Closure::function(Instance::Cast(msg_handler));
+ }
+ if (!msg_handler.IsFunction()) {
+ // No handler function.
+ continue;
+ }
+ const Function& function = Function::Cast(msg_handler);
+ const Script& script = Script::Handle(function.script());
+ message.AddProperty("handlerFunction", function);
+ message.AddProperty("handlerScript", script);
+ message.AddProperty("handlerTokenPos", function.token_pos());
+ }
+}
+
} // namespace dart
diff --git a/runtime/vm/message.h b/runtime/vm/message.h
index 3c08ae9..42a1eb1 100644
--- a/runtime/vm/message.h
+++ b/runtime/vm/message.h
@@ -6,6 +6,7 @@
#define VM_MESSAGE_H_
#include "platform/assert.h"
+#include "vm/allocation.h"
#include "vm/globals.h"
// Duplicated from dart_api.h to avoid including the whole header.
@@ -13,6 +14,8 @@
namespace dart {
+class JSONStream;
+
class Message {
public:
typedef enum {
@@ -68,6 +71,10 @@
bool RedirectToDeliveryFailurePort();
+ intptr_t Id() const;
+
+ static const char* PriorityAsString(Priority priority);
+
private:
friend class MessageQueue;
@@ -98,6 +105,31 @@
// Clear all messages from the message queue.
void Clear();
+ // Iterator class.
+ class Iterator : public ValueObject {
+ public:
+ explicit Iterator(const MessageQueue* queue);
+ virtual ~Iterator();
+
+ void Reset(const MessageQueue* queue);
+
+ // Returns false when there are no more messages left.
+ bool HasNext();
+
+ // Returns the current message and moves forward.
+ Message* Next();
+
+ private:
+ Message* next_;
+ };
+
+ intptr_t Length() const;
+
+ // Returns the message with id or NULL.
+ Message* FindMessageById(intptr_t id);
+
+ void PrintJSON(JSONStream* stream);
+
private:
Message* head_;
Message* tail_;
diff --git a/runtime/vm/message_handler.cc b/runtime/vm/message_handler.cc
index 68344cb..34e3b40 100644
--- a/runtime/vm/message_handler.cc
+++ b/runtime/vm/message_handler.cc
@@ -34,6 +34,7 @@
MessageHandler::MessageHandler()
: queue_(new MessageQueue()),
oob_queue_(new MessageQueue()),
+ oob_message_handling_allowed_(true),
live_ports_(0),
paused_(0),
pause_on_start_(false),
@@ -208,6 +209,9 @@
bool MessageHandler::HandleOOBMessages() {
+ if (!oob_message_handling_allowed_) {
+ return true;
+ }
MonitorLocker ml(&monitor_);
#if defined(DEBUG)
CheckAccess();
@@ -333,4 +337,39 @@
live_ports_--;
}
+
+MessageHandler::AcquiredQueues::AcquiredQueues()
+ : handler_(NULL) {
+}
+
+
+MessageHandler::AcquiredQueues::~AcquiredQueues() {
+ Reset(NULL);
+}
+
+
+void MessageHandler::AcquiredQueues::Reset(MessageHandler* handler) {
+ if (handler_ != NULL) {
+ // Release ownership. The OOB flag is set without holding the monitor.
+ handler_->monitor_.Exit();
+ handler_->oob_message_handling_allowed_ = true;
+ }
+ handler_ = handler;
+ if (handler_ == NULL) {
+ return;
+ }
+ ASSERT(handler_ != NULL);
+ // Take ownership. The OOB flag is set without holding the monitor.
+ handler_->oob_message_handling_allowed_ = false;
+ handler_->monitor_.Enter();
+}
+
+
+void MessageHandler::AcquireQueues(AcquiredQueues* acquired_queues) {
+ ASSERT(acquired_queues != NULL);
+ // No double dipping.
+ ASSERT(acquired_queues->handler_ == NULL);
+ acquired_queues->Reset(this);
+}
+
} // namespace dart
diff --git a/runtime/vm/message_handler.h b/runtime/vm/message_handler.h
index a2a07bf..07fa5ab 100644
--- a/runtime/vm/message_handler.h
+++ b/runtime/vm/message_handler.h
@@ -96,6 +96,38 @@
return paused_on_exit_;
}
+ class AcquiredQueues : public ValueObject {
+ public:
+ AcquiredQueues();
+
+ ~AcquiredQueues();
+
+ MessageQueue* queue() {
+ if (handler_ == NULL) {
+ return NULL;
+ }
+ return handler_->queue_;
+ }
+
+ MessageQueue* oob_queue() {
+ if (handler_ == NULL) {
+ return NULL;
+ }
+ return handler_->oob_queue_;
+ }
+
+ private:
+ void Reset(MessageHandler* handler);
+
+ MessageHandler* handler_;
+
+ friend class MessageHandler;
+ };
+
+ // Gives temporary ownership of |queue| and |oob_queue|. Calling this
+ // has the side effect that no OOB messages will be handled if a stack
+ // overflow interrupt is delivered.
+ void AcquireQueues(AcquiredQueues* acquired_queue);
#if defined(DEBUG)
// Check that it is safe to access this message handler.
@@ -166,6 +198,9 @@
Monitor monitor_; // Protects all fields in MessageHandler.
MessageQueue* queue_;
MessageQueue* oob_queue_;
+ // This flag is not thread safe and can only reliably be accessed on a single
+ // thread.
+ bool oob_message_handling_allowed_;
intptr_t live_ports_; // The number of open ports, including control ports.
intptr_t paused_; // The number of pause messages received.
bool pause_on_start_;
diff --git a/runtime/vm/message_handler_test.cc b/runtime/vm/message_handler_test.cc
index 8132511..7bfcb9a 100644
--- a/runtime/vm/message_handler_test.cc
+++ b/runtime/vm/message_handler_test.cc
@@ -158,11 +158,25 @@
Message* message = new Message(1, NULL, 0, Message::kNormalPriority);
handler_peer.PostMessage(message);
EXPECT(!handler.HasOOBMessages());
+ {
+ // Acquire ownership of message handler queues, verify one regular message.
+ MessageHandler::AcquiredQueues aq;
+ handler.AcquireQueues(&aq);
+ EXPECT(aq.queue()->Length() == 1);
+ }
// Post an oob message.
message = new Message(1, NULL, 0, Message::kOOBPriority);
handler_peer.PostMessage(message);
EXPECT(handler.HasOOBMessages());
+ {
+ // Acquire ownership of message handler queues, verify one regular and one
+ // OOB message.
+ MessageHandler::AcquiredQueues aq;
+ handler.AcquireQueues(&aq);
+ EXPECT(aq.queue()->Length() == 1);
+ EXPECT(aq.oob_queue()->Length() == 1);
+ }
// Delete all pending messages.
handler_peer.CloseAllPorts();
diff --git a/runtime/vm/message_test.cc b/runtime/vm/message_test.cc
index b02df47..5250a77 100644
--- a/runtime/vm/message_test.cc
+++ b/runtime/vm/message_test.cc
@@ -17,6 +17,9 @@
TEST_CASE(MessageQueue_BasicOperations) {
MessageQueue queue;
EXPECT(queue.IsEmpty());
+ MessageQueue::Iterator it(&queue);
+ // Queue is empty.
+ EXPECT(!it.HasNext());
Dart_Port port = 1;
@@ -31,19 +34,43 @@
Message* msg1 = new Message(
port, AllocMsg(str1), strlen(str1) + 1, Message::kNormalPriority);
queue.Enqueue(msg1, false);
+ EXPECT(queue.Length() == 1);
EXPECT(!queue.IsEmpty());
+ it.Reset(&queue);
+ EXPECT(it.HasNext());
+ EXPECT(it.Next() == msg1);
+ EXPECT(!it.HasNext());
Message* msg2 = new Message(
port, AllocMsg(str2), strlen(str2) + 1, Message::kNormalPriority);
queue.Enqueue(msg2, false);
+ EXPECT(queue.Length() == 2);
EXPECT(!queue.IsEmpty());
+ it.Reset(&queue);
+ EXPECT(it.HasNext());
+ EXPECT(it.Next() == msg1);
+ EXPECT(it.HasNext());
+ EXPECT(it.Next() == msg2);
+ EXPECT(!it.HasNext());
- // Remove two messages.
+ // Lookup messages by id.
+ EXPECT(queue.FindMessageById(reinterpret_cast<intptr_t>(msg1)) == msg1);
+ EXPECT(queue.FindMessageById(reinterpret_cast<intptr_t>(msg2)) == msg2);
+
+ // Lookup bad id.
+ EXPECT(queue.FindMessageById(0x1) == NULL);
+
+ // Remove message 1
Message* msg = queue.Dequeue();
EXPECT(msg != NULL);
EXPECT_STREQ(str1, reinterpret_cast<char*>(msg->data()));
EXPECT(!queue.IsEmpty());
+ it.Reset(&queue);
+ EXPECT(it.HasNext());
+ EXPECT(it.Next() == msg2);
+
+ // Remove message 2
msg = queue.Dequeue();
EXPECT(msg != NULL);
EXPECT_STREQ(str2, reinterpret_cast<char*>(msg->data()));
diff --git a/runtime/vm/object.cc b/runtime/vm/object.cc
index f80f10b..401a2e4 100644
--- a/runtime/vm/object.cc
+++ b/runtime/vm/object.cc
@@ -59,8 +59,6 @@
DEFINE_FLAG(bool, show_internal_names, false,
"Show names of internal classes (e.g. \"OneByteString\") in error messages "
"instead of showing the corresponding interface names (e.g. \"String\")");
-DEFINE_FLAG(bool, trace_disabling_optimized_code, false,
- "Trace disabling optimized code.");
DEFINE_FLAG(bool, throw_on_javascript_int_overflow, false,
"Throw an exception when the result of an integer calculation will not "
"fit into a javascript integer.");
@@ -760,8 +758,9 @@
explicit PremarkingVisitor(Isolate* isolate) : ObjectVisitor(isolate) {}
void VisitObject(RawObject* obj) {
- // RawInstruction objects are premarked on allocation.
- if (!obj->IsMarked()) {
+ ASSERT(!obj->IsMarked());
+ // Free list elements should never be marked.
+ if (!obj->IsFreeListElement()) {
obj->SetMarkBitUnsynchronized();
}
}
@@ -833,7 +832,7 @@
PremarkingVisitor premarker(isolate);
isolate->heap()->WriteProtect(false);
ASSERT(isolate->heap()->UsedInWords(Heap::kNew) == 0);
- isolate->heap()->IterateOldObjects(&premarker);
+ isolate->heap()->old_space()->VisitObjects(&premarker);
isolate->heap()->WriteProtect(true);
}
@@ -1602,6 +1601,12 @@
ObjectIdRing* ring = Isolate::Current()->object_id_ring();
const intptr_t id = ring->GetIdForObject(raw());
jsobj.AddPropertyF("id", "objects/%" Pd "", id);
+ if (ref) {
+ return;
+ }
+ Class& cls = Class::Handle(this->clazz());
+ jsobj.AddProperty("class", cls);
+ jsobj.AddProperty("size", raw()->Size());
}
@@ -3525,7 +3530,7 @@
}
}
Object& types = Object::Handle(canonical_types());
- if (types.IsNull()) {
+ if (types.IsNull() || !types.IsArray()) {
return Type::null();
}
if ((idx < 0) || (idx >= Array::Cast(types).Length())) {
@@ -5091,25 +5096,31 @@
void Function::SwitchToUnoptimizedCode() const {
ASSERT(HasOptimizedCode());
- Isolate* isolate = Isolate::Current();
- const Code& current_code = Code::Handle(isolate, CurrentCode());
+ Thread* thread = Thread::Current();
+ Isolate* isolate = thread->isolate();
+ Zone* zone = thread->zone();
+ const Code& current_code = Code::Handle(zone, CurrentCode());
- if (FLAG_trace_deoptimization) {
+ if (FLAG_trace_deoptimization_verbose) {
OS::Print("Disabling optimized code: '%s' entry: %#" Px "\n",
ToFullyQualifiedCString(),
current_code.EntryPoint());
}
// Patch entry of the optimized code.
CodePatcher::PatchEntry(current_code);
- // Use previously compiled unoptimized code.
- AttachCode(Code::Handle(isolate, unoptimized_code()));
- CodePatcher::RestoreEntry(Code::Handle(isolate, unoptimized_code()));
+ const Error& error = Error::Handle(zone,
+ Compiler::EnsureUnoptimizedCode(thread, *this));
+ if (!error.IsNull()) {
+ Exceptions::PropagateError(error);
+ }
+ AttachCode(Code::Handle(zone, unoptimized_code()));
+ CodePatcher::RestoreEntry(Code::Handle(zone, unoptimized_code()));
isolate->TrackDeoptimizedCode(current_code);
}
void Function::set_unoptimized_code(const Code& value) const {
- ASSERT(!value.is_optimized());
+ ASSERT(value.IsNull() || !value.is_optimized());
StorePointer(&raw_ptr()->unoptimized_code_, value.raw());
}
@@ -5551,13 +5562,9 @@
if (is_optimizable() && (script() != Script::null()) &&
((end_token_pos() - token_pos()) < FLAG_huge_method_cutoff_in_tokens)) {
// Additional check needed for implicit getters.
- if (HasCode() &&
- (Code::Handle(unoptimized_code()).Size() >=
- FLAG_huge_method_cutoff_in_code_size)) {
- return false;
- } else {
- return true;
- }
+ return (unoptimized_code() == Object::null()) ||
+ (Code::Handle(unoptimized_code()).Size() <
+ FLAG_huge_method_cutoff_in_code_size);
}
return false;
}
@@ -6591,10 +6598,46 @@
}
-RawString* Function::GetSource() {
+RawString* Function::GetSource() const {
+ if (IsImplicitConstructor() || IsSignatureFunction()) {
+ // We may need to handle more cases when the restrictions on mixins are
+ // relaxed. In particular we might start associating some source with the
+ // forwarding constructors when it becomes possible to specify a particular
+ // constructor from the mixin to use.
+ return String::null();
+ }
const Script& func_script = Script::Handle(script());
- // Without the + 1 the final "}" is not included.
- return func_script.GetSnippet(token_pos(), end_token_pos() + 1);
+ const TokenStream& stream = TokenStream::Handle(func_script.tokens());
+ if (!func_script.HasSource()) {
+ // When source is not available, avoid printing the whole token stream and
+ // doing expensive position calculations.
+ return stream.GenerateSource(token_pos(), end_token_pos() + 1);
+ }
+
+ const TokenStream::Iterator tkit(stream, end_token_pos());
+ intptr_t from_line;
+ intptr_t from_col;
+ intptr_t to_line;
+ intptr_t to_col;
+ func_script.GetTokenLocation(token_pos(), &from_line, &from_col);
+ func_script.GetTokenLocation(end_token_pos(), &to_line, &to_col);
+ intptr_t last_tok_len = String::Handle(tkit.CurrentLiteral()).Length();
+ // Handle special cases for end tokens of closures (where we exclude the last
+ // token):
+ // (1) "foo(() => null, bar);": End token is `,', but we don't print it.
+ // (2) "foo(() => null);": End token is ')`, but we don't print it.
+ // (3) "var foo = () => null;": End token is `;', but in this case the token
+ // semicolon belongs to the assignment so we skip it.
+ if ((tkit.CurrentTokenKind() == Token::kCOMMA) || // Case 1.
+ (tkit.CurrentTokenKind() == Token::kRPAREN) || // Case 2.
+ (tkit.CurrentTokenKind() == Token::kSEMICOLON &&
+ String::Handle(name()).Equals("<anonymous closure>"))) { // Case 3.
+ last_tok_len = 0;
+ }
+ const String& result = String::Handle(func_script.GetSnippet(
+ from_line, from_col, to_line, to_col + last_tok_len));
+ ASSERT(!result.IsNull());
+ return result.raw();
}
@@ -6833,7 +6876,7 @@
jsobj.AddProperty("code", code);
}
jsobj.AddProperty("_optimizable", is_optimizable());
- jsobj.AddProperty("_inlinable", CanBeInlined());
+ jsobj.AddProperty("_inlinable", is_inlinable());
code = unoptimized_code();
if (!code.IsNull()) {
jsobj.AddProperty("_unoptimizedCode", code);
@@ -8394,16 +8437,6 @@
}
-RawString* Script::GetSnippet(intptr_t from_token_pos,
- intptr_t to_token_pos) const {
- intptr_t from_line, from_column;
- intptr_t to_line, to_column;
- GetTokenLocation(from_token_pos, &from_line, &from_column);
- GetTokenLocation(to_token_pos, &to_line, &to_column);
- return GetSnippet(from_line, from_column, to_line, to_column);
-}
-
-
RawString* Script::GetSnippet(intptr_t from_line,
intptr_t from_column,
intptr_t to_line,
@@ -8519,6 +8552,8 @@
}
jsobj.AddProperty("library", lib);
const String& source = String::Handle(Source());
+ jsobj.AddProperty("lineOffset", line_offset());
+ jsobj.AddProperty("columnOffset", col_offset());
jsobj.AddPropertyStr("source", source);
// Print the line number table
@@ -9316,6 +9351,7 @@
String& import_lib_url = String::Handle();
String& first_import_lib_url = String::Handle();
Object& found_obj = Object::Handle();
+ String& found_obj_name = String::Handle();
for (intptr_t i = 0; i < num_imports(); i++) {
import ^= ImportAt(i);
obj = import.Lookup(name);
@@ -9331,13 +9367,28 @@
// from the Dart library.
first_import_lib_url = import_lib.url();
found_obj = obj.raw();
+ found_obj_name = obj.DictionaryName();
} else if (import_lib_url.StartsWith(Symbols::DartScheme())) {
// The newly found object is exported from a Dart system
// library. It is hidden by the previously found object.
// We continue to search.
} else {
// We found two different objects with the same name.
- return Object::null();
+ // Note that we need to compare the names again because
+ // looking up an unmangled name can return a getter or a
+ // setter. A getter name is the same as the unmangled name,
+ // but a setter name is different from an unmangled name or a
+ // getter name.
+ if (Field::IsGetterName(found_obj_name)) {
+ found_obj_name = Field::NameFromGetter(found_obj_name);
+ }
+ String& second_obj_name = String::Handle(obj.DictionaryName());
+ if (Field::IsGetterName(second_obj_name)) {
+ second_obj_name = Field::NameFromGetter(second_obj_name);
+ }
+ if (found_obj_name.Equals(second_obj_name)) {
+ return Object::null();
+ }
}
}
}
@@ -10310,7 +10361,7 @@
if (Field::IsGetterName(name)) {
filter_name = &String::Handle(Field::NameFromGetter(name));
} else if (Field::IsSetterName(name)) {
- filter_name = &String::Handle(Field::NameFromGetter(name));
+ filter_name = &String::Handle(Field::NameFromSetter(name));
} else {
if (obj.IsNull() || obj.IsLibraryPrefix()) {
obj = lib.LookupEntry(String::Handle(Field::GetterName(name)), &ignore);
@@ -12026,12 +12077,6 @@
}
-void Code::set_object_table(const Array& array) const {
- ASSERT(array.IsOld());
- StorePointer(&raw_ptr()->object_table_, array.raw());
-}
-
-
void Code::set_static_calls_target_table(const Array& value) const {
StorePointer(&raw_ptr()->static_calls_target_table_, value.raw());
#if defined(DEBUG)
@@ -12281,7 +12326,7 @@
code.set_is_alive(true);
// Set object pool in Instructions object.
- const GrowableObjectArray& object_pool = assembler->object_pool();
+ const GrowableObjectArray& object_pool = assembler->object_pool_data();
if (object_pool.IsNull()) {
instrs.set_object_pool(Object::empty_array().raw());
} else {
@@ -12530,7 +12575,8 @@
descriptors.PrintToJSONObject(&desc, false);
}
const Array& inlined_function_table = Array::Handle(inlined_id_to_function());
- if (!inlined_function_table.IsNull()) {
+ if (!inlined_function_table.IsNull() &&
+ (inlined_function_table.Length() > 0)) {
JSONArray inlined_functions(&jsobj, "_inlinedFunctions");
Function& function = Function::Handle();
for (intptr_t i = 0; i < inlined_function_table.Length(); i++) {
@@ -12540,7 +12586,7 @@
}
}
const Array& intervals = Array::Handle(inlined_intervals());
- if (!intervals.IsNull()) {
+ if (!intervals.IsNull() && (intervals.Length() > 0)) {
Smi& start = Smi::Handle();
Smi& end = Smi::Handle();
Smi& temp_smi = Smi::Handle();
@@ -12620,6 +12666,7 @@
intptr_t Code::GetCallerId(intptr_t inlined_id) const {
if (inlined_id < 0) return -1;
const Array& intervals = Array::Handle(inlined_intervals());
+ if (intervals.IsNull() || (intervals.Length() == 0)) return -1;
Smi& temp_smi = Smi::Handle();
for (intptr_t i = 0; i < intervals.Length() - Code::kInlIntNumEntries;
i += Code::kInlIntNumEntries) {
@@ -12637,7 +12684,7 @@
intptr_t offset, GrowableArray<Function*>* fs) const {
fs->Clear();
const Array& intervals = Array::Handle(inlined_intervals());
- if (intervals.IsNull()) {
+ if (intervals.IsNull() || (intervals.Length() == 0)) {
// E.g., for code stubs.
return;
}
@@ -12679,6 +12726,7 @@
void Code::DumpInlinedIntervals() const {
OS::Print("Inlined intervals:\n");
const Array& intervals = Array::Handle(inlined_intervals());
+ if (intervals.IsNull() || (intervals.Length() == 0)) return;
Smi& start = Smi::Handle();
Smi& inlining_id = Smi::Handle();
Smi& caller_id = Smi::Handle();
@@ -13928,6 +13976,8 @@
if (raw()->IsHeapObject()) {
jsobj->AddProperty("size", raw()->Size());
+ } else {
+ jsobj->AddProperty("size", (intptr_t)0);
}
// Walk the superclass chain, adding all instance fields.
@@ -15104,7 +15154,10 @@
if (ref) {
return;
}
- jsobj.AddProperty("typeArguments", TypeArguments::Handle(arguments()));
+ const TypeArguments& typeArgs = TypeArguments::Handle(arguments());
+ if (!typeArgs.IsNull()) {
+ jsobj.AddProperty("typeArguments", typeArgs);
+ }
}
diff --git a/runtime/vm/object.h b/runtime/vm/object.h
index 289cceb..4233887 100644
--- a/runtime/vm/object.h
+++ b/runtime/vm/object.h
@@ -1709,7 +1709,7 @@
RawString* QualifiedUserVisibleName() const;
virtual RawString* DictionaryName() const { return name(); }
- RawString* GetSource();
+ RawString* GetSource() const;
// Build a string of the form 'C<T, R>(T, {b: B, c: C}) => R' representing the
// internal signature of the given function. In this example, T and R are
@@ -2790,8 +2790,6 @@
RawLibrary* FindLibrary() const;
RawString* GetLine(intptr_t line_number) const;
- RawString* GetSnippet(intptr_t from_token_pos,
- intptr_t to_token_pos) const;
RawString* GetSnippet(intptr_t from_line,
intptr_t from_column,
intptr_t to_line,
@@ -3945,11 +3943,6 @@
}
void set_deopt_info_array(const Array& array) const;
- RawArray* object_table() const {
- return raw_ptr()->object_table_;
- }
- void set_object_table(const Array& array) const;
-
RawArray* stackmaps() const {
return raw_ptr()->stackmaps_;
}
diff --git a/runtime/vm/object_graph.cc b/runtime/vm/object_graph.cc
index 50e0792..7ad50ed 100644
--- a/runtime/vm/object_graph.cc
+++ b/runtime/vm/object_graph.cc
@@ -148,7 +148,7 @@
static void UnmarkAll(Isolate* isolate) {
Unmarker unmarker(isolate);
- isolate->heap()->IterateObjects(&unmarker);
+ isolate->heap()->VisitObjects(&unmarker);
}
private:
@@ -367,7 +367,7 @@
Object& scratch = Object::Handle();
NoSafepointScope no_safepoint_scope_;
InboundReferencesVisitor visitor(isolate(), obj->raw(), references, &scratch);
- isolate()->heap()->IterateObjects(&visitor);
+ isolate()->heap()->VisitObjects(&visitor);
return visitor.length();
}
diff --git a/runtime/vm/object_test.cc b/runtime/vm/object_test.cc
index 4da8d3c..e76ce3a 100644
--- a/runtime/vm/object_test.cc
+++ b/runtime/vm/object_test.cc
@@ -1951,15 +1951,13 @@
}
-TEST_CASE(ArrayLength) {
- const intptr_t kLength = Array::kMaxElements + 1;
- ASSERT(kLength >= 0);
+static void TestIllegalArrayLength(intptr_t length) {
char buffer[1024];
OS::SNPrint(buffer, sizeof(buffer),
"main() {\n"
" new List(%" Pd ");\n"
"}\n",
- kLength);
+ length);
Dart_Handle lib = TestCase::LoadTestScript(buffer, NULL);
EXPECT_VALID(lib);
Dart_Handle result = Dart_Invoke(lib, NewString("main"), 0, NULL);
@@ -1967,11 +1965,95 @@
"Unhandled exception:\n"
"Invalid argument(s): Length (%" Pd ") must be an integer "
"in the range [0..%" Pd "].",
- kLength, Array::kMaxElements);
+ length, Array::kMaxElements);
EXPECT_ERROR(result, buffer);
}
+TEST_CASE(ArrayLengthNegativeOne) { TestIllegalArrayLength(-1); }
+TEST_CASE(ArrayLengthSmiMin) { TestIllegalArrayLength(kSmiMin); }
+TEST_CASE(ArrayLengthOneTooMany) {
+ const intptr_t kOneTooMany = Array::kMaxElements + 1;
+ ASSERT(kOneTooMany >= 0);
+ TestIllegalArrayLength(kOneTooMany);
+}
+
+
+TEST_CASE(ArrayLengthMaxElements) {
+ char buffer[1024];
+ OS::SNPrint(buffer, sizeof(buffer),
+ "main() {\n"
+ " return new List(%" Pd ");\n"
+ "}\n",
+ Array::kMaxElements);
+ Dart_Handle lib = TestCase::LoadTestScript(buffer, NULL);
+ EXPECT_VALID(lib);
+ Dart_Handle result = Dart_Invoke(lib, NewString("main"), 0, NULL);
+ if (Dart_IsError(result)) {
+ EXPECT_ERROR(result, "Out of Memory");
+ } else {
+ const intptr_t kExpected = Array::kMaxElements;
+ intptr_t actual = 0;
+ EXPECT_VALID(Dart_ListLength(result, &actual));
+ EXPECT_EQ(kExpected, actual);
+ }
+}
+
+
+static void TestIllegalTypedDataLength(const char* class_name,
+ intptr_t length) {
+ char buffer[1024];
+ OS::SNPrint(buffer, sizeof(buffer),
+ "import 'dart:typed_data';\n"
+ "main() {\n"
+ " new %s(%" Pd ");\n"
+ "}\n",
+ class_name, length);
+ Dart_Handle lib = TestCase::LoadTestScript(buffer, NULL);
+ EXPECT_VALID(lib);
+ Dart_Handle result = Dart_Invoke(lib, NewString("main"), 0, NULL);
+ OS::SNPrint(buffer, sizeof(buffer), "%" Pd, length);
+ EXPECT_ERROR(result, "Invalid argument(s)");
+ EXPECT_ERROR(result, buffer);
+}
+
+
+TEST_CASE(Int8ListLengthNegativeOne) {
+ TestIllegalTypedDataLength("Int8List", -1);
+}
+TEST_CASE(Int8ListLengthSmiMin) {
+ TestIllegalTypedDataLength("Int8List", kSmiMin);
+}
+TEST_CASE(Int8ListLengthOneTooMany) {
+ const intptr_t kOneTooMany =
+ TypedData::MaxElements(kTypedDataInt8ArrayCid) + 1;
+ ASSERT(kOneTooMany >= 0);
+ TestIllegalTypedDataLength("Int8List", kOneTooMany);
+}
+
+
+TEST_CASE(Int8ListLengthMaxElements) {
+ const intptr_t max_elements = TypedData::MaxElements(kTypedDataInt8ArrayCid);
+ char buffer[1024];
+ OS::SNPrint(buffer, sizeof(buffer),
+ "import 'dart:typed_data';\n"
+ "main() {\n"
+ " return new Int8List(%" Pd ");\n"
+ "}\n",
+ max_elements);
+ Dart_Handle lib = TestCase::LoadTestScript(buffer, NULL);
+ EXPECT_VALID(lib);
+ Dart_Handle result = Dart_Invoke(lib, NewString("main"), 0, NULL);
+ if (Dart_IsError(result)) {
+ EXPECT_ERROR(result, "Out of Memory");
+ } else {
+ intptr_t actual = 0;
+ EXPECT_VALID(Dart_ListLength(result, &actual));
+ EXPECT_EQ(max_elements, actual);
+ }
+}
+
+
TEST_CASE(StringCodePointIterator) {
const String& str0 = String::Handle(String::New(""));
String::CodePointIterator it0(str0);
@@ -4163,7 +4245,7 @@
}
GrowableArray<Object*> objects;
ObjectAccumulator acc(&objects);
- heap->IterateObjects(&acc);
+ heap->VisitObjects(&acc);
for (intptr_t i = 0; i < objects.length(); ++i) {
JSONStream js;
objects[i]->PrintJSON(&js, false);
diff --git a/runtime/vm/pages.cc b/runtime/vm/pages.cc
index 19da567..e50d01d 100644
--- a/runtime/vm/pages.cc
+++ b/runtime/vm/pages.cc
@@ -46,11 +46,14 @@
DEFINE_FLAG(bool, log_growth, false, "Log PageSpace growth policy decisions.");
HeapPage* HeapPage::Initialize(VirtualMemory* memory, PageType type) {
+ ASSERT(memory != NULL);
ASSERT(memory->size() > VirtualMemory::PageSize());
bool is_executable = (type == kExecutable);
- memory->Commit(is_executable);
-
+ if (!memory->Commit(is_executable)) {
+ return NULL;
+ }
HeapPage* result = reinterpret_cast<HeapPage*>(memory->address());
+ ASSERT(result != NULL);
result->memory_ = memory;
result->next_ = NULL;
result->executable_ = is_executable;
@@ -64,7 +67,12 @@
if (memory == NULL) {
return NULL;
}
- return Initialize(memory, type);
+ HeapPage* result = Initialize(memory, type);
+ if (result == NULL) {
+ delete memory; // Release reservation to OS.
+ return NULL;
+ }
+ return result;
}
@@ -125,6 +133,7 @@
prot = VirtualMemory::kReadOnly;
}
} else {
+ // TODO(23217): Should this really make all pages non-executable?
prot = VirtualMemory::kReadWrite;
}
bool status = memory_->Protect(prot);
@@ -508,6 +517,15 @@
}
+void PageSpace::AbandonBumpAllocation() {
+ if (bump_top_ < bump_end_) {
+ freelist_[HeapPage::kData].Free(bump_top_, bump_end_ - bump_top_);
+ bump_top_ = 0;
+ bump_end_ = 0;
+ }
+}
+
+
bool PageSpace::Contains(uword addr) const {
for (ExclusivePageIterator it(this); !it.Done(); it.Advance()) {
if (it.page()->Contains(addr)) {
@@ -605,6 +623,10 @@
void PageSpace::WriteProtect(bool read_only) {
+ if (read_only) {
+ // Avoid MakeIterable trying to write to the heap.
+ AbandonBumpAllocation();
+ }
for (ExclusivePageIterator it(this); !it.Done(); it.Advance()) {
it.page()->WriteProtect(read_only);
}
@@ -654,14 +676,13 @@
void PageSpace::PrintHeapMapToJSONStream(Isolate* isolate, JSONStream* stream) {
JSONObject heap_map(stream);
heap_map.AddProperty("type", "HeapMap");
- heap_map.AddProperty("id", "heapmap");
- heap_map.AddProperty("free_class_id",
+ heap_map.AddProperty("freeClassId",
static_cast<intptr_t>(kFreeListElement));
- heap_map.AddProperty("unit_size_bytes",
+ heap_map.AddProperty("unitSizeBytes",
static_cast<intptr_t>(kObjectAlignment));
- heap_map.AddProperty("page_size_bytes", kPageSizeInWords * kWordSize);
+ heap_map.AddProperty("pageSizeBytes", kPageSizeInWords * kWordSize);
{
- JSONObject class_list(&heap_map, "class_list");
+ JSONObject class_list(&heap_map, "classList");
isolate->class_table()->PrintToJSONObject(&class_list);
}
{
@@ -674,7 +695,7 @@
JSONArray all_pages(&heap_map, "pages");
for (HeapPage* page = pages_; page != NULL; page = page->next()) {
JSONObject page_container(&all_pages);
- page_container.AddPropertyF("object_start",
+ page_container.AddPropertyF("objectStart",
"0x%" Px "", page->object_start());
JSONArray page_map(&page_container, "objects");
HeapMapAsJSONVisitor printer(&page_map);
@@ -682,7 +703,7 @@
}
for (HeapPage* page = exec_pages_; page != NULL; page = page->next()) {
JSONObject page_container(&all_pages);
- page_container.AddPropertyF("object_start",
+ page_container.AddPropertyF("objectStart",
"0x%" Px "", page->object_start());
JSONArray page_map(&page_container, "objects");
HeapMapAsJSONVisitor printer(&page_map);
@@ -780,9 +801,7 @@
int64_t mid1 = OS::GetCurrentTimeMicros();
// Abandon the remainder of the bump allocation block.
- MakeIterable();
- bump_top_ = 0;
- bump_end_ = 0;
+ AbandonBumpAllocation();
// Reset the freelists and setup sweeping.
freelist_[HeapPage::kData].Reset();
freelist_[HeapPage::kExecutable].Reset();
diff --git a/runtime/vm/pages.h b/runtime/vm/pages.h
index c6b4f38..0d0d4dd 100644
--- a/runtime/vm/pages.h
+++ b/runtime/vm/pages.h
@@ -69,6 +69,7 @@
object_end_ = val;
}
+ // These return NULL on OOM.
static HeapPage* Initialize(VirtualMemory* memory, PageType type);
static HeapPage* Allocate(intptr_t size_in_words, PageType type);
@@ -368,6 +369,8 @@
bool is_locked);
// Makes bump block walkable; do not call concurrently with mutator.
void MakeIterable() const;
+ // Return any bump allocation block to the freelist.
+ void AbandonBumpAllocation();
HeapPage* AllocatePage(HeapPage::PageType type);
void FreePage(HeapPage* page, HeapPage* previous_page);
HeapPage* AllocateLargePage(intptr_t size, HeapPage::PageType type);
diff --git a/runtime/vm/parser.cc b/runtime/vm/parser.cc
index 6bfd9c8..25e7fa9 100644
--- a/runtime/vm/parser.cc
+++ b/runtime/vm/parser.cc
@@ -38,6 +38,7 @@
namespace dart {
DEFINE_FLAG(bool, enable_asserts, false, "Enable assert statements.");
+DEFINE_FLAG(bool, enable_debug_break, false, "Allow use of break \"message\".");
DEFINE_FLAG(bool, enable_type_checks, false, "Enable type checks.");
DEFINE_FLAG(bool, trace_parser, false, "Trace parser operations.");
DEFINE_FLAG(bool, warn_mixin_typedef, true, "Warning on legacy mixin typedef.");
@@ -284,13 +285,17 @@
inlined_finally_nodes_(),
outer_try_(outer_try),
try_index_(try_index),
- inside_catch_(false) { }
+ inside_catch_(false),
+ inside_finally_(false) { }
TryStack* outer_try() const { return outer_try_; }
Block* try_block() const { return try_block_; }
intptr_t try_index() const { return try_index_; }
bool inside_catch() const { return inside_catch_; }
void enter_catch() { inside_catch_ = true; }
+ bool inside_finally() const { return inside_finally_; }
+ void enter_finally() { inside_finally_ = true; }
+ void exit_finally() { inside_finally_ = false; }
void AddNodeForFinallyInlining(AstNode* node);
AstNode* GetNodeToInlineFinally(int index) {
@@ -305,7 +310,9 @@
GrowableArray<AstNode*> inlined_finally_nodes_;
TryStack* outer_try_;
const intptr_t try_index_;
- bool inside_catch_;
+ bool inside_catch_; // True when parsing a catch clause of this try.
+ bool inside_finally_; // True when parsing a finally clause of an inner try
+ // of this try.
DISALLOW_COPY_AND_ASSIGN(TryStack);
};
@@ -2041,7 +2048,6 @@
Class::ZoneHandle(Z, current_class().SuperClass());
AstNode* closure = new StaticGetterNode(supercall_pos,
LoadReceiver(supercall_pos),
- /* is_super_getter */ true,
super_class,
function_name);
// 'this' is not passed as parameter to the closure.
@@ -2214,8 +2220,8 @@
// Emit a StaticGetterNode anyway, so that noSuchMethod gets called.
}
}
- return new StaticGetterNode(
- field_pos, implicit_argument, true, super_class, field_name);
+ return new(Z) StaticGetterNode(
+ field_pos, implicit_argument, super_class, field_name);
}
@@ -3906,8 +3912,8 @@
if (field->has_static && has_initializer) {
class_field.set_value(init_value);
if (!has_simple_literal) {
- String& getter_name = String::Handle(Z,
- Field::GetterSymbol(*field->name));
+ String& getter_name =
+ String::Handle(Z, Field::GetterSymbol(*field->name));
getter = Function::New(getter_name,
RawFunction::kImplicitStaticFinalGetter,
field->has_static,
@@ -3928,8 +3934,8 @@
// For instance fields, we create implicit getter and setter methods.
if (!field->has_static) {
- String& getter_name = String::Handle(Z,
- Field::GetterSymbol(*field->name));
+ String& getter_name =
+ String::Handle(Z, Field::GetterSymbol(*field->name));
getter = Function::New(getter_name, RawFunction::kImplicitGetter,
field->has_static,
field->has_final,
@@ -3947,8 +3953,8 @@
members->AddFunction(getter);
if (!field->has_final) {
// Build a setter accessor for non-const fields.
- String& setter_name = String::Handle(Z,
- Field::SetterSymbol(*field->name));
+ String& setter_name =
+ String::Handle(Z, Field::SetterSymbol(*field->name));
setter = Function::New(setter_name, RawFunction::kImplicitSetter,
field->has_static,
field->has_final,
@@ -6153,6 +6159,9 @@
// We need to inline this code in all recorded exit points.
intptr_t node_index = 0;
SequenceNode* finally_clause = NULL;
+ if (try_stack_ != NULL) {
+ try_stack_->enter_finally();
+ }
do {
OpenBlock();
ArgumentListNode* no_args =
@@ -6186,6 +6195,10 @@
}
} while (finally_clause == NULL);
+ if (try_stack_ != NULL) {
+ try_stack_->exit_finally();
+ }
+
const GrowableObjectArray& handler_types =
GrowableObjectArray::Handle(Z, GrowableObjectArray::New());
handler_types.Add(dynamic_type); // Catch block handles all exceptions.
@@ -8255,6 +8268,28 @@
}
+static LocalVariable* LookupSavedTryContextVar(LocalScope* scope) {
+ LocalVariable* var =
+ scope->LocalLookupVariable(Symbols::SavedTryContextVar());
+ ASSERT((var != NULL) && !var->is_captured());
+ return var;
+}
+
+
+static LocalVariable* LookupAsyncSavedTryContextVar(LocalScope* scope,
+ uint16_t try_index) {
+ const String& async_saved_try_ctx_name =
+ String::ZoneHandle(Symbols::New(String::Handle(
+ String::NewFormatted(
+ "%s%d",
+ Symbols::AsyncSavedTryCtxVarPrefix().ToCString(),
+ try_index))));
+ LocalVariable* var = scope->LocalLookupVariable(async_saved_try_ctx_name);
+ ASSERT((var != NULL) && var->is_captured());\
+ return var;
+}
+
+
// If the await or yield being parsed is in a try block, the continuation code
// needs to restore the corresponding stack-based variable :saved_try_ctx_var,
// and the stack-based variable :saved_try_ctx_var of the outer try block.
@@ -8269,32 +8304,33 @@
// Set the context variable for the outer try block. Note that the try
// declaring the finally is popped before parsing the finally clause, so the
// outer try block is at the top of the try block list.
-//
-// TODO(regis): Could we return the variables instead of their containing
-// scopes? Check if they are already setup at this point.
-void Parser::CheckAsyncOpInTryBlock(LocalScope** try_scope,
- int16_t* try_index,
- LocalScope** outer_try_scope,
- int16_t* outer_try_index) const {
- *try_scope = NULL;
- *try_index = CatchClauseNode::kInvalidTryIndex;
- *outer_try_scope = NULL;
- *outer_try_index = CatchClauseNode::kInvalidTryIndex;
+void Parser::CheckAsyncOpInTryBlock(
+ LocalVariable** saved_try_ctx,
+ LocalVariable** async_saved_try_ctx,
+ LocalVariable** outer_saved_try_ctx,
+ LocalVariable** outer_async_saved_try_ctx) const {
+ *saved_try_ctx = NULL;
+ *async_saved_try_ctx = NULL;
+ *outer_saved_try_ctx = NULL;
+ *outer_async_saved_try_ctx = NULL;
if (try_stack_ != NULL) {
LocalScope* scope = try_stack_->try_block()->scope;
+ uint16_t try_index = try_stack_->try_index();
const int current_function_level = current_block_->scope->function_level();
if (scope->function_level() == current_function_level) {
// The block declaring :saved_try_ctx_var variable is the parent of the
// pushed try block.
- *try_scope = scope->parent();
- *try_index = try_stack_->try_index();
- if (try_stack_->outer_try() != NULL) {
- // TODO(regis): Collecting the outer try scope is not necessary if we
- // are in a finally block. Add support for try_stack_->inside_finally().
+ *saved_try_ctx = LookupSavedTryContextVar(scope->parent());
+ *async_saved_try_ctx = LookupAsyncSavedTryContextVar(scope, try_index);
+ if ((try_stack_->outer_try() != NULL) && !try_stack_->inside_finally()) {
+ // Collecting the outer try scope is not necessary if we
+ // are in a finally block.
scope = try_stack_->outer_try()->try_block()->scope;
+ try_index = try_stack_->outer_try()->try_index();
if (scope->function_level() == current_function_level) {
- *outer_try_scope = scope->parent();
- *outer_try_index = try_stack_->outer_try()->try_index();
+ *outer_saved_try_ctx = LookupSavedTryContextVar(scope->parent());
+ *outer_async_saved_try_ctx =
+ LookupAsyncSavedTryContextVar(scope, try_index);
}
}
}
@@ -8302,7 +8338,7 @@
// An async or async* has an implicitly created try-catch around the
// function body, so the await or yield inside the async closure should always
// be created with a try scope.
- ASSERT((*try_scope != NULL) ||
+ ASSERT((*saved_try_ctx != NULL) ||
innermost_function().IsAsyncFunction() ||
innermost_function().IsAsyncGenerator() ||
innermost_function().IsSyncGenClosure() ||
@@ -8426,13 +8462,14 @@
// Build while loop condition.
// while (await :for-in-iter.moveNext())
- LocalScope* try_scope;
- int16_t try_index;
- LocalScope* outer_try_scope;
- int16_t outer_try_index;
- CheckAsyncOpInTryBlock(&try_scope, &try_index,
- &outer_try_scope, &outer_try_index);
-
+ LocalVariable* saved_try_ctx;
+ LocalVariable* async_saved_try_ctx;
+ LocalVariable* outer_saved_try_ctx;
+ LocalVariable* outer_async_saved_try_ctx;
+ CheckAsyncOpInTryBlock(&saved_try_ctx,
+ &async_saved_try_ctx,
+ &outer_saved_try_ctx,
+ &outer_async_saved_try_ctx);
ArgumentListNode* no_args = new(Z) ArgumentListNode(stream_pos);
AstNode* iterator_moveNext = new(Z) InstanceCallNode(
stream_pos,
@@ -8442,10 +8479,10 @@
AstNode* await_moveNext =
new(Z) AwaitNode(stream_pos,
iterator_moveNext,
- try_scope,
- try_index,
- outer_try_scope,
- outer_try_index);
+ saved_try_ctx,
+ async_saved_try_ctx,
+ outer_saved_try_ctx,
+ outer_async_saved_try_ctx);
OpenBlock();
AwaitTransformer at(current_block_->statements, async_temp_scope_);
await_moveNext = at.Transform(await_moveNext);
@@ -8523,9 +8560,12 @@
try_stack_->enter_catch();
SequenceNode* catch_block = new(Z) SequenceNode(await_for_pos, NULL);
- if (outer_try_scope != NULL) {
- catch_block->Add(AwaitTransformer::RestoreSavedTryContext(
- Z, outer_try_scope, outer_try_index));
+ if (outer_saved_try_ctx != NULL) {
+ catch_block->Add(new (Z) StoreLocalNode(
+ Scanner::kNoSourcePos,
+ outer_saved_try_ctx,
+ new (Z) LoadLocalNode(Scanner::kNoSourcePos,
+ outer_async_saved_try_ctx)));
}
// We don't need to copy the current exception and stack trace variables
@@ -8539,7 +8579,10 @@
new(Z) LoadLocalNode(await_for_pos, stack_trace_var)));
TryStack* try_statement = PopTry();
- ASSERT(try_index == try_statement->try_index());
+ const intptr_t try_index = try_statement->try_index();
+ TryStack* outer_try = try_stack_;
+ const intptr_t outer_try_index = (outer_try != NULL) ?
+ outer_try->try_index() : CatchClauseNode::kInvalidTryIndex;
// The finally block contains a call to cancel the stream.
// :for-in-iter.cancel()
@@ -8547,6 +8590,9 @@
// Inline the finally block to the exit points in the try block.
intptr_t node_index = 0;
SequenceNode* finally_clause = NULL;
+ if (try_stack_ != NULL) {
+ try_stack_->enter_finally();
+ }
do {
OpenBlock();
ArgumentListNode* no_args =
@@ -8570,6 +8616,10 @@
}
} while (finally_clause == NULL);
+ if (try_stack_ != NULL) {
+ try_stack_->exit_finally();
+ }
+
// Create the try-statement and add to the current sequence, which is
// the block around the loop statement.
@@ -8935,6 +8985,9 @@
OpenBlock();
ExpectToken(Token::kLBRACE);
+ if (try_stack_ != NULL) {
+ try_stack_->enter_finally();
+ }
// In case of async closures we need to restore the saved try index of an
// outer try block (if it exists). The current try block has already been
// removed from the stack of try blocks.
@@ -8942,9 +8995,17 @@
if (try_stack_ != NULL) {
LocalScope* scope = try_stack_->try_block()->scope;
if (scope->function_level() == current_block_->scope->function_level()) {
+ LocalVariable* saved_try_ctx =
+ LookupSavedTryContextVar(scope->parent());
+ LocalVariable* async_saved_try_ctx =
+ LookupAsyncSavedTryContextVar(scope->parent(),
+ try_stack_->try_index());
current_block_->statements->Add(
- AwaitTransformer::RestoreSavedTryContext(
- Z, scope->parent(), try_stack_->try_index()));
+ new (Z) StoreLocalNode(
+ Scanner::kNoSourcePos,
+ saved_try_ctx,
+ new (Z) LoadLocalNode(Scanner::kNoSourcePos,
+ async_saved_try_ctx)));
}
}
// We need to save the exception variables as in catch clauses, whether
@@ -8961,6 +9022,9 @@
ParseStatementSequence();
ExpectToken(Token::kRBRACE);
SequenceNode* finally_block = CloseBlock();
+ if (try_stack_ != NULL) {
+ try_stack_->exit_finally();
+ }
return finally_block;
}
@@ -9202,11 +9266,18 @@
const TryStack* try_block = try_stack_->outer_try();
if (try_block != NULL) {
LocalScope* scope = try_block->try_block()->scope;
- if (scope->function_level() ==
- current_block_->scope->function_level()) {
- async_code->Add(
- AwaitTransformer::RestoreSavedTryContext(
- Z, scope->parent(), try_block->try_index()));
+ if (scope->function_level() == current_block_->scope->function_level()) {
+ LocalVariable* saved_try_ctx =
+ LookupSavedTryContextVar(scope->parent());
+ LocalVariable* async_saved_try_ctx =
+ LookupAsyncSavedTryContextVar(scope->parent(),
+ try_block->try_index());
+ current_block_->statements->Add(
+ new (Z) StoreLocalNode(
+ Scanner::kNoSourcePos,
+ saved_try_ctx,
+ new (Z) LoadLocalNode(Scanner::kNoSourcePos,
+ async_saved_try_ctx)));
}
}
SaveExceptionAndStacktrace(async_code,
@@ -9494,6 +9565,10 @@
if (target == NULL) {
ReportError(jump_pos, "label '%s' not found", target_name.ToCString());
}
+ } else if (FLAG_enable_debug_break && (CurrentToken() == Token::kSTRING)) {
+ const char* message = strdup(CurrentLiteral()->ToCString());
+ ConsumeToken();
+ return new(Z) StopNode(jump_pos, message);
} else {
target = current_block_->scope->LookupInnermostLabel(jump_kind);
if (target == NULL) {
@@ -9572,25 +9647,29 @@
// If this expression is part of a try block, also append the code for
// restoring the saved try context that lives on the stack and possibly the
// saved try context of the outer try block.
- LocalScope* try_scope;
- int16_t try_index;
- LocalScope* outer_try_scope;
- int16_t outer_try_index;
- CheckAsyncOpInTryBlock(&try_scope, &try_index,
- &outer_try_scope, &outer_try_index);
- if (try_scope != NULL) {
- yield->AddNode(
- AwaitTransformer::RestoreSavedTryContext(Z,
- try_scope,
- try_index));
- if (outer_try_scope != NULL) {
- yield->AddNode(
- AwaitTransformer::RestoreSavedTryContext(Z,
- outer_try_scope,
- outer_try_index));
+ LocalVariable* saved_try_ctx;
+ LocalVariable* async_saved_try_ctx;
+ LocalVariable* outer_saved_try_ctx;
+ LocalVariable* outer_async_saved_try_ctx;
+ CheckAsyncOpInTryBlock(&saved_try_ctx,
+ &async_saved_try_ctx,
+ &outer_saved_try_ctx,
+ &outer_async_saved_try_ctx);
+ if (saved_try_ctx != NULL) {
+ yield->AddNode(new (Z) StoreLocalNode(
+ Scanner::kNoSourcePos,
+ saved_try_ctx,
+ new (Z) LoadLocalNode(Scanner::kNoSourcePos,
+ async_saved_try_ctx)));
+ if (outer_saved_try_ctx != NULL) {
+ yield->AddNode(new (Z) StoreLocalNode(
+ Scanner::kNoSourcePos,
+ outer_saved_try_ctx,
+ new (Z) LoadLocalNode(Scanner::kNoSourcePos,
+ outer_async_saved_try_ctx)));
}
} else {
- ASSERT(outer_try_scope == NULL);
+ ASSERT(outer_saved_try_ctx == NULL);
}
} else {
// yield statement in async* function.
@@ -9608,7 +9687,6 @@
is_yield_each ? Symbols::AddStream() : Symbols::add(),
add_args);
-
// if (:controller.add[Stream](expr)) {
// return;
// }
@@ -9635,25 +9713,29 @@
// If this expression is part of a try block, also append the code for
// restoring the saved try context that lives on the stack and possibly the
// saved try context of the outer try block.
- LocalScope* try_scope;
- int16_t try_index;
- LocalScope* outer_try_scope;
- int16_t outer_try_index;
- CheckAsyncOpInTryBlock(&try_scope, &try_index,
- &outer_try_scope, &outer_try_index);
- if (try_scope != NULL) {
- yield->AddNode(
- AwaitTransformer::RestoreSavedTryContext(Z,
- try_scope,
- try_index));
- if (outer_try_scope != NULL) {
- yield->AddNode(
- AwaitTransformer::RestoreSavedTryContext(Z,
- outer_try_scope,
- outer_try_index));
+ LocalVariable* saved_try_ctx;
+ LocalVariable* async_saved_try_ctx;
+ LocalVariable* outer_saved_try_ctx;
+ LocalVariable* outer_async_saved_try_ctx;
+ CheckAsyncOpInTryBlock(&saved_try_ctx,
+ &async_saved_try_ctx,
+ &outer_saved_try_ctx,
+ &outer_async_saved_try_ctx);
+ if (saved_try_ctx != NULL) {
+ yield->AddNode(new (Z) StoreLocalNode(
+ Scanner::kNoSourcePos,
+ saved_try_ctx,
+ new (Z) LoadLocalNode(Scanner::kNoSourcePos,
+ async_saved_try_ctx)));
+ if (outer_saved_try_ctx != NULL) {
+ yield->AddNode(new (Z) StoreLocalNode(
+ Scanner::kNoSourcePos,
+ outer_saved_try_ctx,
+ new (Z) LoadLocalNode(Scanner::kNoSourcePos,
+ outer_async_saved_try_ctx)));
}
} else {
- ASSERT(outer_try_scope == NULL);
+ ASSERT(outer_saved_try_ctx == NULL);
}
}
return yield;
@@ -9748,7 +9830,9 @@
ExpectToken(Token::kRBRACE);
} else if (token == Token::kBREAK) {
statement = ParseJump(label_name);
- AddNodeForFinallyInlining(statement);
+ if ((statement != NULL) && !statement->IsStopNode()) {
+ AddNodeForFinallyInlining(statement);
+ }
ExpectSemicolon();
} else if (token == Token::kCONTINUE) {
statement = ParseJump(label_name);
@@ -10445,7 +10529,8 @@
static AstNode* LiteralIfStaticConst(Zone* zone, AstNode* expr) {
if (expr->IsLoadStaticFieldNode()) {
const Field& field = expr->AsLoadStaticFieldNode()->field();
- if (field.is_const()) {
+ if (field.is_const() &&
+ !expr->AsLoadStaticFieldNode()->is_deferred_reference()) {
ASSERT(field.value() != Object::sentinel().raw());
ASSERT(field.value() != Object::transition_sentinel().raw());
return new(zone) LiteralNode(expr->token_pos(),
@@ -10587,19 +10672,20 @@
ConsumeToken();
parsed_function()->record_await();
- LocalScope* try_scope;
- int16_t try_index;
- LocalScope* outer_try_scope;
- int16_t outer_try_index;
- CheckAsyncOpInTryBlock(&try_scope, &try_index,
- &outer_try_scope, &outer_try_index);
-
+ LocalVariable* saved_try_ctx;
+ LocalVariable* async_saved_try_ctx;
+ LocalVariable* outer_saved_try_ctx;
+ LocalVariable* outer_async_saved_try_ctx;
+ CheckAsyncOpInTryBlock(&saved_try_ctx,
+ &async_saved_try_ctx,
+ &outer_saved_try_ctx,
+ &outer_async_saved_try_ctx);
expr = new (Z) AwaitNode(op_pos,
ParseUnaryExpr(),
- try_scope,
- try_index,
- outer_try_scope,
- outer_try_index);
+ saved_try_ctx,
+ async_saved_try_ctx,
+ outer_saved_try_ctx,
+ outer_async_saved_try_ctx);
} else if (IsPrefixOperator(CurrentToken())) {
Token::Kind unary_op = CurrentToken();
if (unary_op == Token::kSUB) {
@@ -10728,7 +10814,6 @@
closure = new(Z) StaticGetterNode(
call_pos,
NULL,
- false,
Class::ZoneHandle(Z, cls.raw()),
func_name);
return BuildClosureCall(call_pos, closure, arguments);
@@ -10808,31 +10893,23 @@
ASSERT(getter.kind() == RawFunction::kImplicitStaticFinalGetter);
return new(Z) StaticGetterNode(ident_pos,
NULL, // Receiver.
- false, // is_super_getter.
field_owner,
field_name);
}
}
-AstNode* Parser::ParseStaticFieldAccess(const Class& cls,
- const String& field_name,
- intptr_t ident_pos,
- bool consume_cascades) {
- TRACE_PARSER("ParseStaticFieldAccess");
+// Reference to 'field_name' with explicit class as primary.
+AstNode* Parser::GenerateStaticFieldAccess(const Class& cls,
+ const String& field_name,
+ intptr_t ident_pos) {
AstNode* access = NULL;
const Field& field = Field::ZoneHandle(Z, cls.LookupStaticField(field_name));
Function& func = Function::ZoneHandle(Z);
if (field.IsNull()) {
// No field, check if we have an explicit getter function.
- const String& getter_name =
- String::ZoneHandle(Z, Field::GetterName(field_name));
- const int kNumArguments = 0; // no arguments.
- func = Resolver::ResolveStatic(cls,
- getter_name,
- kNumArguments,
- Object::empty_array());
- if (func.IsNull()) {
+ func = cls.LookupGetterFunction(field_name);
+ if (func.IsNull() || func.IsDynamicFunction()) {
// We might be referring to an implicit closure, check to see if
// there is a function of the same name.
func = cls.LookupStaticFunction(field_name);
@@ -10846,14 +10923,13 @@
// a throw NoSuchMethodError().
access = new(Z) StaticGetterNode(ident_pos,
NULL,
- false,
Class::ZoneHandle(Z, cls.raw()),
field_name);
}
} else {
ASSERT(func.kind() != RawFunction::kImplicitStaticFinalGetter);
access = new(Z) StaticGetterNode(
- ident_pos, NULL, false, Class::ZoneHandle(Z, cls.raw()), field_name);
+ ident_pos, NULL, Class::ZoneHandle(Z, cls.raw()), field_name);
}
} else {
access = GenerateStaticFieldLookup(field, ident_pos);
@@ -10881,7 +10957,6 @@
StaticGetterNode* getter = new(Z) StaticGetterNode(
primary->token_pos(),
NULL, // No receiver.
- false, // Not a super getter.
Class::ZoneHandle(Z, current_class().raw()),
name);
getter->set_is_deferred(primary->is_deferred_reference());
@@ -10975,12 +11050,14 @@
} else {
// Field access.
Class& cls = Class::Handle(Z);
+ bool is_deferred = false;
if (left->IsPrimaryNode()) {
PrimaryNode* primary_node = left->AsPrimaryNode();
if (primary_node->primary().IsClass()) {
// If the primary node referred to a class we are loading a
// qualified static field.
cls ^= primary_node->primary().raw();
+ is_deferred = primary_node->is_deferred_reference();
}
}
if (cls.IsNull()) {
@@ -10988,8 +11065,13 @@
selector = CallGetter(ident_pos, left, *ident);
} else {
// Static field access.
- selector =
- ParseStaticFieldAccess(cls, *ident, ident_pos, !is_cascade);
+ selector = GenerateStaticFieldAccess(cls, *ident, ident_pos);
+ ASSERT(selector != NULL);
+ if (selector->IsLoadStaticFieldNode()) {
+ selector->AsLoadStaticFieldNode()->set_is_deferred(is_deferred);
+ } else if (selector->IsStaticGetterNode()) {
+ selector->AsStaticGetterNode()->set_is_deferred(is_deferred);
+ }
}
}
} else if (CurrentToken() == Token::kLBRACK) {
@@ -11264,18 +11346,16 @@
}
}
// The referenced class may not have been parsed yet. It would be wrong
- // to resolve it too early to an imported class of the same name.
+ // to resolve it too early to an imported class of the same name. Only
+ // resolve the class when a finalized type is requested.
if (finalization > ClassFinalizer::kResolveTypeParameters) {
- // Resolve classname in the scope of the current library.
- resolved_type_class = ResolveClassInCurrentLibraryScope(
- unresolved_class_name);
+ resolved_type_class = library_.LookupClass(unresolved_class_name);
}
} else {
- LibraryPrefix& lib_prefix =
- LibraryPrefix::Handle(Z, unresolved_class.library_prefix());
// Resolve class name in the scope of the library prefix.
- resolved_type_class =
- ResolveClassInPrefixScope(lib_prefix, unresolved_class_name);
+ const LibraryPrefix& lib_prefix =
+ LibraryPrefix::Handle(Z, unresolved_class.library_prefix());
+ resolved_type_class = lib_prefix.LookupClass(unresolved_class_name);
}
// At this point, we can only have a parameterized_type.
const Type& parameterized_type = Type::Cast(*type);
@@ -11385,8 +11465,8 @@
// If the field is already initialized, return no ast (NULL).
// Otherwise, if the field is constant, initialize the field and return no ast.
// If the field is not initialized and not const, return the ast for the getter.
-AstNode* Parser::RunStaticFieldInitializer(const Field& field,
- intptr_t field_ref_pos) {
+StaticGetterNode* Parser::RunStaticFieldInitializer(const Field& field,
+ intptr_t field_ref_pos) {
ASSERT(field.is_static());
const Class& field_owner = Class::ZoneHandle(Z, field.owner());
const String& field_name = String::ZoneHandle(Z, field.name());
@@ -11401,7 +11481,7 @@
} else {
// The implicit static getter will throw the exception if necessary.
return new(Z) StaticGetterNode(
- field_ref_pos, NULL, false, field_owner, field_name);
+ field_ref_pos, NULL, field_owner, field_name);
}
} else if (value.raw() == Object::sentinel().raw()) {
// This field has not been referenced yet and thus the value has
@@ -11450,7 +11530,7 @@
return NULL; // Constant
} else {
return new(Z) StaticGetterNode(
- field_ref_pos, NULL, false, field_owner, field_name);
+ field_ref_pos, NULL, field_owner, field_name);
}
}
if (getter.IsNull() ||
@@ -11459,7 +11539,7 @@
}
ASSERT(getter.kind() == RawFunction::kImplicitGetter);
return new(Z) StaticGetterNode(
- field_ref_pos, NULL, false, field_owner, field_name);
+ field_ref_pos, NULL, field_owner, field_name);
}
@@ -11545,6 +11625,16 @@
return true;
}
+ // If we are compiling top-level code, we don't need to look for
+ // the identifier in the current (top-level) class. The class scope
+ // of the top-level class is part of the library scope.
+ if (current_class().IsTopLevel()) {
+ if (node != NULL) {
+ *node = NULL;
+ }
+ return false;
+ }
+
// Try to find the identifier in the class scope of the current class.
// If the current class is the result of a mixin application, we must
// use the class scope of the class from which the function originates.
@@ -11586,7 +11676,14 @@
// Now check if a getter/setter method exists for it in which case
// it is still a field.
+ // A setter without a corresponding getter binds to the non-existing
+ // getter. (The getter could be followed by an assignment which will
+ // convert it to a setter node. If there is no assignment the non-existing
+ // getter will throw a NoSuchMethodError.)
func = cls.LookupGetterFunction(ident);
+ if (func.IsNull()) {
+ func = cls.LookupSetterFunction(ident);
+ }
if (!func.IsNull()) {
if (func.IsDynamicFunction() || func.is_abstract()) {
if (node != NULL) {
@@ -11597,70 +11694,20 @@
return true;
} else if (func.IsStaticFunction()) {
if (node != NULL) {
- ASSERT(AbstractType::Handle(Z, func.result_type()).IsResolved());
- // The static getter may later be changed into a dynamically
- // resolved instance setter if no static setter can
- // be found.
- AstNode* receiver = NULL;
- const bool kTestOnly = true;
- if (!current_function().is_static() &&
- (LookupReceiver(current_block_->scope, kTestOnly) != NULL)) {
- receiver = LoadReceiver(ident_pos);
- }
*node = new(Z) StaticGetterNode(ident_pos,
- receiver,
- false,
+ NULL,
Class::ZoneHandle(Z, cls.raw()),
ident);
}
return true;
}
}
- func = cls.LookupSetterFunction(ident);
- if (!func.IsNull()) {
- if (func.IsDynamicFunction() || func.is_abstract()) {
- if (node != NULL) {
- // We create a getter node even though a getter doesn't exist as
- // it could be followed by an assignment which will convert it to
- // a setter node. If there is no assignment we will get an error
- // when we try to invoke the getter.
- CheckInstanceFieldAccess(ident_pos, ident);
- ASSERT(AbstractType::Handle(Z, func.result_type()).IsResolved());
- *node = CallGetter(ident_pos, LoadReceiver(ident_pos), ident);
- }
- return true;
- } else if (func.IsStaticFunction()) {
- if (node != NULL) {
- // We create a getter node even though a getter doesn't exist as
- // it could be followed by an assignment which will convert it to
- // a setter node. If there is no assignment we will get an error
- // when we try to invoke the getter.
- *node = new(Z) StaticGetterNode(
- ident_pos,
- NULL,
- false,
- Class::ZoneHandle(Z, cls.raw()),
- ident);
- }
- return true;
- }
- }
// Nothing found in scope of current class.
if (node != NULL) {
*node = NULL;
}
- return false; // Not an unqualified identifier.
-}
-
-
-RawClass* Parser::ResolveClassInCurrentLibraryScope(const String& name) {
- HANDLESCOPE(I);
- const Object& obj = Object::Handle(Z, library_.ResolveName(name));
- if (obj.IsClass()) {
- return Class::Cast(obj).raw();
- }
- return Class::null();
+ return false;
}
@@ -11678,17 +11725,22 @@
} else if (obj.IsField()) {
const Field& field = Field::Cast(obj);
ASSERT(field.is_static());
- return GenerateStaticFieldLookup(field, ident_pos);
+ AstNode* get_field = GenerateStaticFieldLookup(field, ident_pos);
+ if (get_field->IsStaticGetterNode()) {
+ get_field->AsStaticGetterNode()->set_owner(library_);
+ }
+ return get_field;
} else if (obj.IsFunction()) {
const Function& func = Function::Cast(obj);
ASSERT(func.is_static());
if (func.IsGetterFunction() || func.IsSetterFunction()) {
- return new(Z) StaticGetterNode(ident_pos,
- /* receiver */ NULL,
- /* is_super_getter */ false,
- Class::ZoneHandle(Z, func.Owner()),
- ident);
-
+ StaticGetterNode* getter =
+ new(Z) StaticGetterNode(ident_pos,
+ /* receiver */ NULL,
+ Class::ZoneHandle(Z, func.Owner()),
+ ident);
+ getter->set_owner(library_);
+ return getter;
} else {
return new(Z) PrimaryNode(ident_pos, Function::ZoneHandle(Z, func.raw()));
}
@@ -11700,17 +11752,6 @@
}
-RawClass* Parser::ResolveClassInPrefixScope(const LibraryPrefix& prefix,
- const String& name) {
- HANDLESCOPE(I);
- const Object& obj = Object::Handle(Z, prefix.LookupObject(name));
- if (obj.IsClass()) {
- return Class::Cast(obj).raw();
- }
- return Class::null();
-}
-
-
// Do a lookup for the identifier in the scope of the specified
// library prefix. This means trying to resolve it locally in all of the
// libraries present in the library prefix.
@@ -11723,7 +11764,7 @@
// Private names are not exported by libraries. The name mangling
// of private names with a library-specific suffix usually ensures
// that _x in library A is not found when looked up from library B.
- // In the pathological case where a library includes itself with
+ // In the pathological case where a library imports itself with
// a prefix, the name mangling would not help in hiding the private
// name, so we need to explicitly reject private names here.
return NULL;
@@ -11760,6 +11801,7 @@
get_field->AsLoadStaticFieldNode()->set_is_deferred(is_deferred);
} else if (get_field->IsStaticGetterNode()) {
get_field->AsStaticGetterNode()->set_is_deferred(is_deferred);
+ get_field->AsStaticGetterNode()->set_owner(prefix);
}
return get_field;
} else if (obj.IsFunction()) {
@@ -11767,12 +11809,12 @@
ASSERT(func.is_static());
if (func.IsGetterFunction() || func.IsSetterFunction()) {
StaticGetterNode* getter = new(Z) StaticGetterNode(
- ident_pos,
- /* receiver */ NULL,
- /* is_super_getter */ false,
- Class::ZoneHandle(Z, func.Owner()),
- ident);
+ ident_pos,
+ /* receiver */ NULL,
+ Class::ZoneHandle(Z, func.Owner()),
+ ident);
getter->set_is_deferred(is_deferred);
+ getter->set_owner(prefix);
return getter;
} else {
PrimaryNode* primary = new(Z) PrimaryNode(
diff --git a/runtime/vm/parser.h b/runtime/vm/parser.h
index 3b81d0b..0df6f14 100644
--- a/runtime/vm/parser.h
+++ b/runtime/vm/parser.h
@@ -381,8 +381,8 @@
void CheckRecursiveInvocation();
const Instance& EvaluateConstExpr(intptr_t expr_pos, AstNode* expr);
- AstNode* RunStaticFieldInitializer(const Field& field,
- intptr_t field_ref_pos);
+ StaticGetterNode* RunStaticFieldInitializer(const Field& field,
+ intptr_t field_ref_pos);
RawObject* EvaluateConstConstructorCall(const Class& type_class,
const TypeArguments& type_arguments,
const Function& constructor,
@@ -628,11 +628,12 @@
void PushTry(Block* try_block);
// Pop the inner most try block from the stack.
TryStack* PopTry();
- // Collect try block scopes and indices if await or yield is in try block.
- void CheckAsyncOpInTryBlock(LocalScope** try_scope,
- int16_t* try_index,
- LocalScope** outer_try_scope,
- int16_t* outer_try_index) const;
+ // Collect saved try context variables if await or yield is in try block.
+ void CheckAsyncOpInTryBlock(
+ LocalVariable** saved_try_ctx,
+ LocalVariable** async_saved_try_ctx,
+ LocalVariable** outer_saved_try_ctx,
+ LocalVariable** outer_async_saved_try_ctx) const;
// Add specified node to try block list so that it can be patched with
// inlined finally code if needed.
void AddNodeForFinallyInlining(AstNode* node);
@@ -710,10 +711,9 @@
AstNode* ParseClosureCall(AstNode* closure);
AstNode* GenerateStaticFieldLookup(const Field& field,
intptr_t ident_pos);
- AstNode* ParseStaticFieldAccess(const Class& cls,
- const String& field_name,
- intptr_t ident_pos,
- bool consume_cascades);
+ AstNode* GenerateStaticFieldAccess(const Class& cls,
+ const String& field_name,
+ intptr_t ident_pos);
LocalVariable* LookupLocalScope(const String& ident);
void CheckInstanceFieldAccess(intptr_t field_pos, const String& field_name);
@@ -734,11 +734,6 @@
const LibraryPrefix& prefix,
const String& ident);
- // Find class with the given name in the library or prefix scope.
- RawClass* ResolveClassInCurrentLibraryScope(const String& name);
- RawClass* ResolveClassInPrefixScope(const LibraryPrefix& prefix,
- const String& name);
-
AstNode* ResolveIdent(intptr_t ident_pos,
const String& ident,
bool allow_closure_names);
diff --git a/runtime/vm/profiler.cc b/runtime/vm/profiler.cc
index e262c60..29eb1e1 100644
--- a/runtime/vm/profiler.cc
+++ b/runtime/vm/profiler.cc
@@ -25,14 +25,16 @@
namespace dart {
-#if defined(TARGET_OS_ANDROID) || defined(HOST_ARCH_ARM64)
- DEFINE_FLAG(bool, profile, false, "Enable Sampling Profiler");
-#else
- DEFINE_FLAG(bool, profile, true, "Enable Sampling Profiler");
-#endif
+DEFINE_FLAG(bool, profile, true, "Enable Sampling Profiler");
DEFINE_FLAG(bool, trace_profiled_isolates, false, "Trace profiled isolates.");
-DEFINE_FLAG(int, profile_period, 1000,
- "Time between profiler samples in microseconds. Minimum 50.");
+#if defined(TARGET_OS_ANDROID) || defined(TARGET_ARCH_ARM64) || \
+ defined(TARGET_ARCH_ARM) || defined(TARGET_ARCH_MIPS)
+ DEFINE_FLAG(int, profile_period, 10000,
+ "Time between profiler samples in microseconds. Minimum 50.");
+#else
+ DEFINE_FLAG(int, profile_period, 1000,
+ "Time between profiler samples in microseconds. Minimum 50.");
+#endif
DEFINE_FLAG(int, profile_depth, 8,
"Maximum number stack frames walked. Minimum 1. Maximum 255.");
#if defined(PROFILE_NATIVE_CODE) || defined(USING_SIMULATOR)
@@ -954,10 +956,24 @@
(isolate->vm_tag() == VMTag::kDartTagId);
uintptr_t sp = 0;
+ uintptr_t fp = state.fp;
+ uintptr_t pc = state.pc;
+ uintptr_t lr = state.lr;
+#if defined(USING_SIMULATOR)
+ Simulator* simulator = NULL;
+#endif
if (in_dart_code) {
// If we're in Dart code, use the Dart stack pointer.
+#if defined(USING_SIMULATOR)
+ simulator = isolate->simulator();
+ sp = simulator->get_register(SPREG);
+ fp = simulator->get_register(FPREG);
+ pc = simulator->get_pc();
+ lr = simulator->get_register(LRREG);
+#else
sp = state.dsp;
+#endif
} else {
// If we're in runtime code, use the C stack pointer.
sp = state.csp;
@@ -975,18 +991,18 @@
return;
}
- if ((sp == 0) || (state.fp == 0) || (state.pc == 0)) {
+ if ((sp == 0) || (fp == 0) || (pc == 0)) {
// None of these registers should be zero.
return;
}
- if (sp > state.fp) {
+ if (sp > fp) {
// Assuming the stack grows down, we should never have a stack pointer above
// the frame pointer.
return;
}
- if (StubCode::InJumpToExceptionHandlerStub(state.pc)) {
+ if (StubCode::InJumpToExceptionHandlerStub(pc)) {
// The JumpToExceptionHandler stub manually adjusts the stack pointer,
// frame pointer, and some isolate state before jumping to a catch entry.
// It is not safe to walk the stack when executing this stub.
@@ -995,11 +1011,24 @@
uword stack_lower = 0;
uword stack_upper = 0;
+#if defined(USING_SIMULATOR)
+ if (in_dart_code) {
+ stack_lower = simulator->StackBase();
+ stack_upper = simulator->StackTop();
+ } else if (!isolate->GetProfilerStackBounds(&stack_lower, &stack_upper)) {
+ // Could not get stack boundary.
+ return;
+ }
+ if ((stack_lower == 0) || (stack_upper == 0)) {
+ return;
+ }
+#else
if (!isolate->GetProfilerStackBounds(&stack_lower, &stack_upper) ||
(stack_lower == 0) || (stack_upper == 0)) {
// Could not get stack boundary.
return;
}
+#endif
if (sp > stack_lower) {
// The stack pointer gives us a tighter lower bound.
@@ -1016,7 +1045,7 @@
return;
}
- if ((state.fp < stack_lower) || (state.fp >= stack_upper)) {
+ if ((fp < stack_lower) || (fp >= stack_upper)) {
// Frame pointer is outside isolate stack boundary.
return;
}
@@ -1044,8 +1073,8 @@
sample->set_vm_tag(vm_tag);
sample->set_user_tag(isolate->user_tag());
sample->set_sp(sp);
- sample->set_fp(state.fp);
- sample->set_lr(state.lr);
+ sample->set_fp(fp);
+ sample->set_lr(lr);
CopyStackBuffer(sample);
CopyPCMarkerIfSafe(sample);
@@ -1054,8 +1083,8 @@
ProfilerNativeStackWalker stackWalker(sample,
stack_lower,
stack_upper,
- state.pc,
- state.fp,
+ pc,
+ fp,
sp);
stackWalker.walk();
} else if (exited_dart_code) {
@@ -1068,13 +1097,13 @@
sample,
stack_lower,
stack_upper,
- state.pc,
- state.fp,
+ pc,
+ fp,
sp);
stackWalker.walk();
} else {
sample->set_vm_tag(VMTag::kEmbedderTagId);
- sample->SetAt(0, state.pc);
+ sample->SetAt(0, pc);
}
}
diff --git a/runtime/vm/profiler_service.cc b/runtime/vm/profiler_service.cc
index 6e3637f..e073ab5 100644
--- a/runtime/vm/profiler_service.cc
+++ b/runtime/vm/profiler_service.cc
@@ -595,6 +595,7 @@
obj.AddProperty("type", "@Code");
obj.AddProperty("kind", "Native");
obj.AddProperty("name", name());
+ obj.AddProperty("_optimized", false);
obj.AddPropertyF("start", "%" Px "", start());
obj.AddPropertyF("end", "%" Px "", end());
{
@@ -610,6 +611,7 @@
obj.AddProperty("type", "@Code");
obj.AddProperty("kind", "Collected");
obj.AddProperty("name", name());
+ obj.AddProperty("_optimized", false);
obj.AddPropertyF("start", "%" Px "", start());
obj.AddPropertyF("end", "%" Px "", end());
{
@@ -625,6 +627,7 @@
obj.AddProperty("type", "@Code");
obj.AddProperty("kind", "Collected");
obj.AddProperty("name", name());
+ obj.AddProperty("_optimized", false);
obj.AddPropertyF("start", "%" Px "", start());
obj.AddPropertyF("end", "%" Px "", end());
{
@@ -643,6 +646,7 @@
obj.AddProperty("name", name());
obj.AddPropertyF("start", "%" Px "", start());
obj.AddPropertyF("end", "%" Px "", end());
+ obj.AddProperty("_optimized", false);
{
// Generate a fake function entry.
JSONObject func(&obj, "function");
@@ -1764,7 +1768,6 @@
function->Tick(exclusive, exclusive ? -1 : inclusive_serial);
}
function->AddCodeObjectIndex(code_index);
-
current = current->GetChild(function->index());
current->AddCodeObjectIndex(code_index);
if (top_frame) {
diff --git a/runtime/vm/raw_object.cc b/runtime/vm/raw_object.cc
index d0b327e..2d83e8f 100644
--- a/runtime/vm/raw_object.cc
+++ b/runtime/vm/raw_object.cc
@@ -399,7 +399,7 @@
}
-bool RawFunction::SkipCode(RawFunction* raw_fun) {
+bool RawFunction::CheckUsageCounter(RawFunction* raw_fun) {
// NOTE: This code runs while GC is in progress and runs within
// a NoHandleScope block. Hence it is not okay to use regular Zone or
// Scope handles. We use direct stack handles, and so the raw pointers in
@@ -409,34 +409,54 @@
Function fn;
fn = raw_fun;
- Code code;
- code = fn.CurrentCode();
+ // The function may not have code.
+ if (!fn.HasCode()) return false;
+ // These may not increment the usage counter.
+ if (fn.is_intrinsic()) return false;
- if (fn.HasCode() && // The function may not have code.
- !fn.is_intrinsic() && // These may not increment the usage counter.
- !code.is_optimized() &&
- (fn.CurrentCode() == fn.unoptimized_code()) &&
- !code.HasBreakpoint() &&
- (fn.usage_counter() >= 0)) {
+ if (fn.usage_counter() >= 0) {
fn.set_usage_counter(fn.usage_counter() / 2);
- if (FLAG_always_drop_code || (fn.usage_counter() == 0)) {
- return true;
- }
}
+ return FLAG_always_drop_code || (fn.usage_counter() == 0);
+}
+
+
+bool RawFunction::ShouldVisitCode(RawCode* raw_code) {
+ // NOTE: This code runs while GC is in progress and runs within
+ // a NoHandleScope block. Hence it is not okay to use regular Zone or
+ // Scope handles. We use direct stack handles, and so the raw pointers in
+ // these handles are not traversed. The use of handles is mainly to
+ // be able to reuse the handle based code and avoid having to add
+ // helper functions to the raw object interface.
+ Code code;
+ code = raw_code;
+ if (code.IsNull()) return true;
+ if (code.is_optimized()) return true;
+ if (code.HasBreakpoint()) return true;
return false;
}
intptr_t RawFunction::VisitFunctionPointers(RawFunction* raw_obj,
ObjectPointerVisitor* visitor) {
- if (visitor->visit_function_code() ||
- !RawFunction::SkipCode(raw_obj)) {
+ if (visitor->visit_function_code() || !CheckUsageCounter(raw_obj)) {
visitor->VisitPointers(raw_obj->from(), raw_obj->to());
+ return Function::InstanceSize();
+ }
+ visitor->VisitPointers(raw_obj->from(), raw_obj->to_no_code());
+
+ if (ShouldVisitCode(raw_obj->ptr()->instructions_->ptr()->code_)) {
+ visitor->VisitPointer(
+ reinterpret_cast<RawObject**>(&raw_obj->ptr()->instructions_));
} else {
- GrowableArray<RawFunction*>* sfga = visitor->skipped_code_functions();
- ASSERT(sfga != NULL);
- sfga->Add(raw_obj);
- visitor->VisitPointers(raw_obj->from(), raw_obj->to_no_code());
+ visitor->skipped_code_functions()->Add(raw_obj);
+ }
+
+ if (ShouldVisitCode(raw_obj->ptr()->unoptimized_code_)) {
+ visitor->VisitPointer(
+ reinterpret_cast<RawObject**>(&raw_obj->ptr()->unoptimized_code_));
+ } else {
+ visitor->skipped_code_functions()->Add(raw_obj);
}
return Function::InstanceSize();
}
diff --git a/runtime/vm/raw_object.h b/runtime/vm/raw_object.h
index b0ace7c..ceed53d 100644
--- a/runtime/vm/raw_object.h
+++ b/runtime/vm/raw_object.h
@@ -721,7 +721,8 @@
friend class MarkingVisitor;
friend class Class;
RAW_HEAP_OBJECT_IMPLEMENTATION(Function);
- static bool SkipCode(RawFunction* raw_fun);
+ static bool ShouldVisitCode(RawCode* raw_code);
+ static bool CheckUsageCounter(RawFunction* raw_fun);
RawObject** from() { return reinterpret_cast<RawObject**>(&ptr()->name_); }
RawString* name_;
@@ -955,7 +956,6 @@
RawExceptionHandlers* exception_handlers_;
RawPcDescriptors* pc_descriptors_;
RawArray* deopt_info_array_;
- RawArray* object_table_;
RawArray* static_calls_target_table_; // (code-offset, function, code).
RawArray* stackmaps_;
RawLocalVarDescriptors* var_descriptors_;
@@ -1012,6 +1012,7 @@
static bool ContainsPC(RawObject* raw_obj, uword pc);
friend class RawCode;
+ friend class RawFunction;
friend class Code;
friend class StackFrame;
friend class MarkingVisitor;
diff --git a/runtime/vm/scavenger.cc b/runtime/vm/scavenger.cc
index 5ad62ad..c41be4f 100644
--- a/runtime/vm/scavenger.cc
+++ b/runtime/vm/scavenger.cc
@@ -499,7 +499,7 @@
MonitorLocker ml(page_space->tasks_lock());
if (page_space->tasks() == 0) {
VerifyStoreBufferPointerVisitor verify_store_buffer_visitor(isolate, to_);
- heap_->IterateOldPointers(&verify_store_buffer_visitor);
+ heap_->old_space()->VisitObjectPointers(&verify_store_buffer_visitor);
}
}
#endif // defined(DEBUG)
diff --git a/runtime/vm/service.cc b/runtime/vm/service.cc
index e120572..2acbfe4 100644
--- a/runtime/vm/service.cc
+++ b/runtime/vm/service.cc
@@ -56,15 +56,9 @@
JSONObject jsobj(&obj, "request");
jsobj.AddProperty("method", js->method());
{
- JSONArray jsarr(&jsobj, "param_keys");
+ JSONObject params(&jsobj, "params");
for (intptr_t i = 0; i < js->num_params(); i++) {
- jsarr.AddValue(js->GetParamKey(i));
- }
- }
- {
- JSONArray jsarr(&jsobj, "param_values");
- for (intptr_t i = 0; i < js->num_params(); i++) {
- jsarr.AddValue(js->GetParamValue(i));
+ params.AddProperty(js->GetParamKey(i), js->GetParamValue(i));
}
}
}
@@ -298,7 +292,10 @@
return (strcmp("true", value) == 0) || (strcmp("false", value) == 0);
}
- static bool Parse(const char* value) {
+ static bool Parse(const char* value, bool default_value = false) {
+ if (value == NULL) {
+ return default_value;
+ }
return strcmp("true", value) == 0;
}
};
@@ -412,7 +409,7 @@
PrintMissingParamError(js, name);
return false;
}
- if (!parameter->Validate(value)) {
+ if (has_parameter && !parameter->Validate(value)) {
PrintInvalidParamError(js, name);
return false;
}
@@ -424,22 +421,25 @@
void Service::InvokeMethod(Isolate* isolate, const Array& msg) {
ASSERT(isolate != NULL);
ASSERT(!msg.IsNull());
- ASSERT(msg.Length() == 5);
+ ASSERT(msg.Length() == 6);
{
StackZone zone(isolate);
HANDLESCOPE(isolate);
Instance& reply_port = Instance::Handle(isolate);
+ String& seq = String::Handle(isolate);
String& method_name = String::Handle(isolate);
Array& param_keys = Array::Handle(isolate);
Array& param_values = Array::Handle(isolate);
reply_port ^= msg.At(1);
- method_name ^= msg.At(2);
- param_keys ^= msg.At(3);
- param_values ^= msg.At(4);
+ seq ^= msg.At(2);
+ method_name ^= msg.At(3);
+ param_keys ^= msg.At(4);
+ param_values ^= msg.At(5);
ASSERT(!method_name.IsNull());
+ ASSERT(!seq.IsNull());
ASSERT(!param_keys.IsNull());
ASSERT(!param_values.IsNull());
ASSERT(param_keys.Length() == param_values.Length());
@@ -450,7 +450,7 @@
JSONStream js;
js.Setup(zone.GetZone(), SendPort::Cast(reply_port).Id(),
- method_name, param_keys, param_values);
+ seq, method_name, param_keys, param_values);
const char* c_method_name = method_name.ToCString();
@@ -560,21 +560,15 @@
}
-void Service::HandleGCEvent(GCEvent* event) {
- if (ServiceIsolate::IsServiceIsolateDescendant(Isolate::Current())) {
+void Service::HandleEvent(ServiceEvent* event) {
+ if (ServiceIsolate::IsServiceIsolateDescendant(event->isolate())) {
return;
}
JSONStream js;
- event->PrintJSON(&js);
- const String& message = String::Handle(String::New(js.ToCString()));
- // TODO(turnidge): Pass the real eventType here.
- SendEvent(0, message);
-}
-
-
-void Service::HandleEvent(ServiceEvent* event) {
- JSONStream js;
- event->PrintJSON(&js);
+ {
+ JSONObject jsobj(&js);
+ jsobj.AddProperty("event", event);
+ }
const String& message = String::Handle(String::New(js.ToCString()));
SendEvent(event->type(), message);
}
@@ -727,24 +721,38 @@
static const MethodParameter* get_stack_params[] = {
ISOLATE_PARAMETER,
+ new BoolParameter("full", false),
NULL,
};
static bool GetStack(Isolate* isolate, JSONStream* js) {
DebuggerStackTrace* stack = isolate->debugger()->StackTrace();
+ // Do we want the complete script object and complete local variable objects?
+ // This is true for dump requests.
+ const bool full = BoolParameter::Parse(js->LookupParam("full"), false);
JSONObject jsobj(js);
jsobj.AddProperty("type", "Stack");
- JSONArray jsarr(&jsobj, "frames");
- intptr_t num_frames = stack->Length();
- for (intptr_t i = 0; i < num_frames; i++) {
- ActivationFrame* frame = stack->FrameAt(i);
- JSONObject jsobj(&jsarr);
- frame->PrintToJSONObject(&jsobj);
- // TODO(turnidge): Implement depth differently -- differentiate
- // inlined frames.
- jsobj.AddProperty("depth", i);
+ {
+ JSONArray jsarr(&jsobj, "frames");
+
+ intptr_t num_frames = stack->Length();
+ for (intptr_t i = 0; i < num_frames; i++) {
+ ActivationFrame* frame = stack->FrameAt(i);
+ JSONObject jsobj(&jsarr);
+ frame->PrintToJSONObject(&jsobj, full);
+ // TODO(turnidge): Implement depth differently -- differentiate
+ // inlined frames.
+ jsobj.AddProperty("depth", i);
+ }
}
+
+ {
+ MessageHandler::AcquiredQueues aq;
+ isolate->message_handler()->AcquireQueues(&aq);
+ jsobj.AddProperty("messages", aq.queue());
+ }
+
return true;
}
@@ -762,11 +770,14 @@
JSONStream js;
{
JSONObject jsobj(&js);
- jsobj.AddProperty("type", "ServiceEvent");
- jsobj.AddProperty("eventType", "_Echo");
- jsobj.AddProperty("isolate", isolate);
- if (text != NULL) {
- jsobj.AddProperty("text", text);
+ {
+ JSONObject event(&jsobj, "event");
+ event.AddProperty("type", "ServiceEvent");
+ event.AddProperty("eventType", "_Echo");
+ event.AddProperty("isolate", isolate);
+ if (text != NULL) {
+ event.AddProperty("text", text);
+ }
}
}
const String& message = String::Handle(String::New(js.ToCString()));
@@ -1161,14 +1172,11 @@
static SourceBreakpoint* LookupBreakpoint(Isolate* isolate, const char* id) {
size_t end_pos = strcspn(id, "/");
- const char* rest = NULL;
- if (end_pos < strlen(id)) {
- rest = id + end_pos + 1; // +1 for '/'.
+ if (end_pos == strlen(id)) {
+ return NULL;
}
+ const char* rest = id + end_pos + 1; // +1 for '/'.
if (strncmp("breakpoints", id, end_pos) == 0) {
- if (rest == NULL) {
- return NULL;
- }
intptr_t bpt_id = 0;
SourceBreakpoint* bpt = NULL;
if (GetIntegerId(rest, &bpt_id)) {
@@ -1180,6 +1188,40 @@
}
+// Scans |isolate|'s message queue looking for a message with |id|.
+// If found, the message is printed to |js| and true is returned.
+// If not found, false is returned.
+static bool PrintMessage(JSONStream* js, Isolate* isolate, const char* id) {
+ size_t end_pos = strcspn(id, "/");
+ if (end_pos == strlen(id)) {
+ return false;
+ }
+ const char* rest = id + end_pos + 1; // +1 for '/'.
+ if (strncmp("messages", id, end_pos) == 0) {
+ uword message_id = 0;
+ if (GetUnsignedIntegerId(rest, &message_id, 16)) {
+ MessageHandler::AcquiredQueues aq;
+ isolate->message_handler()->AcquireQueues(&aq);
+ Message* message = aq.queue()->FindMessageById(message_id);
+ if (message == NULL) {
+ printf("Could not find message %" Px "\n", message_id);
+ // Not found.
+ return false;
+ }
+ SnapshotReader reader(message->data(),
+ message->len(),
+ Snapshot::kMessage,
+ isolate,
+ isolate->current_zone());
+ const Object& msg_obj = Object::Handle(reader.ReadObject());
+ msg_obj.PrintJSON(js);
+ return true;
+ } else {
+ printf("Could not get id from %s\n", rest);
+ }
+ }
+ return false;
+}
static bool PrintInboundReferences(Isolate* isolate,
@@ -1603,10 +1645,14 @@
}
JSONObject jsobj(js);
jsobj.AddProperty("type", "InstanceSet");
- jsobj.AddProperty("id", "instance_set");
jsobj.AddProperty("totalCount", count);
- jsobj.AddProperty("sampleCount", storage.Length());
- jsobj.AddProperty("sample", storage);
+ {
+ JSONArray samples(&jsobj, "samples");
+ for (int i = 0; i < storage.Length(); i++) {
+ const Object& sample = Object::Handle(storage.At(i));
+ samples.AddValue(Instance::Cast(sample));
+ }
+ }
return true;
}
@@ -1811,7 +1857,6 @@
// TODO(turnidge): Consider whether the 'Success' type is proper.
JSONObject jsobj(js);
jsobj.AddProperty("type", "Success");
- jsobj.AddProperty("id", "");
return true;
}
@@ -2009,7 +2054,6 @@
isolate->message_handler()->set_pause_on_start(false);
JSONObject jsobj(js);
jsobj.AddProperty("type", "Success");
- jsobj.AddProperty("id", "");
{
ServiceEvent event(isolate, ServiceEvent::kResume);
Service::HandleEvent(&event);
@@ -2020,7 +2064,6 @@
isolate->message_handler()->set_pause_on_exit(false);
JSONObject jsobj(js);
jsobj.AddProperty("type", "Success");
- jsobj.AddProperty("id", "");
// We don't send a resume event because we will be exiting.
return true;
}
@@ -2040,7 +2083,6 @@
isolate->Resume();
JSONObject jsobj(js);
jsobj.AddProperty("type", "Success");
- jsobj.AddProperty("id", "");
return true;
}
@@ -2060,7 +2102,6 @@
isolate->ScheduleInterrupts(Isolate::kApiInterrupt);
JSONObject jsobj(js);
jsobj.AddProperty("type", "Success");
- jsobj.AddProperty("id", "");
return true;
}
@@ -2203,9 +2244,12 @@
JSONStream js;
{
JSONObject jsobj(&js);
- jsobj.AddProperty("type", "ServiceEvent");
- jsobj.AddProperty("eventType", "_Graph");
- jsobj.AddProperty("isolate", isolate);
+ {
+ JSONObject event(&jsobj, "event");
+ event.AddProperty("type", "ServiceEvent");
+ event.AddProperty("eventType", "_Graph");
+ event.AddProperty("isolate", isolate);
+ }
}
const String& message = String::Handle(String::New(js.ToCString()));
SendEvent(message, buffer, stream.bytes_written());
@@ -2260,7 +2304,11 @@
ContainsAddressVisitor visitor(isolate, addr);
object = isolate->heap()->FindObject(&visitor);
}
- object.PrintJSON(js, ref);
+ if (object.IsNull()) {
+ PrintSentinel(js, "objects/free", "<free>");
+ } else {
+ object.PrintJSON(js, ref);
+ }
return true;
}
@@ -2323,6 +2371,10 @@
return true;
}
+ if (PrintMessage(js, isolate, id)) {
+ return true;
+ }
+
PrintError(js, "Unrecognized object id: %s\n", id);
return true;
}
@@ -2461,11 +2513,9 @@
const char* error = NULL;
if (Flags::SetFlag(flag_name, flag_value, &error)) {
jsobj.AddProperty("type", "Success");
- jsobj.AddProperty("id", "");
return true;
} else {
- jsobj.AddProperty("type", "Failure");
- jsobj.AddProperty("id", "");
+ jsobj.AddProperty("type", "Error");
jsobj.AddProperty("message", error);
return true;
}
@@ -2510,7 +2560,7 @@
eval_params },
{ "evalFrame", EvalFrame,
eval_frame_params },
- { "getAllocationProfile", GetAllocationProfile,
+ { "_getAllocationProfile", GetAllocationProfile,
get_allocation_profile_params },
{ "_getCallSiteData", GetCallSiteData,
get_call_site_data_params },
@@ -2524,9 +2574,9 @@
get_flag_list_params },
{ "getHeapMap", GetHeapMap,
get_heap_map_params },
- { "getInboundReferences", GetInboundReferences,
+ { "_getInboundReferences", GetInboundReferences,
get_inbound_references_params },
- { "getInstances", GetInstances,
+ { "_getInstances", GetInstances,
get_instances_params },
{ "getIsolate", GetIsolate,
get_isolate_params },
@@ -2538,9 +2588,9 @@
get_object_params },
{ "getObjectByAddress", GetObjectByAddress,
get_object_by_address_params },
- { "getRetainedSize", GetRetainedSize,
+ { "_getRetainedSize", GetRetainedSize,
get_retained_size_params },
- { "getRetainingPath", GetRetainingPath,
+ { "_getRetainingPath", GetRetainingPath,
get_retaining_path_params },
{ "getStack", GetStack,
get_stack_params },
diff --git a/runtime/vm/service.h b/runtime/vm/service.h
index 28e02a6..dfc6a21 100644
--- a/runtime/vm/service.h
+++ b/runtime/vm/service.h
@@ -34,7 +34,6 @@
static bool NeedsEvents();
static void HandleEvent(ServiceEvent* event);
- static void HandleGCEvent(GCEvent* event);
static void RegisterIsolateEmbedderCallback(
const char* name,
diff --git a/runtime/vm/service/client.dart b/runtime/vm/service/client.dart
index 0d0b253..56051f8 100644
--- a/runtime/vm/service/client.dart
+++ b/runtime/vm/service/client.dart
@@ -25,16 +25,16 @@
// Send message to service.
service.route(message).then((response) {
// Call post when the response arrives.
- post(seq, response);
+ post(response);
});
} catch (e, st) {
message.setErrorResponse('Internal error: $e');
- post(seq, message.response);
+ post(message.response);
}
}
// Sends a result to the client. Implemented in subclasses.
- void post(var seq, dynamic result);
+ void post(dynamic result);
dynamic toJson() {
return {
diff --git a/runtime/vm/service/message.dart b/runtime/vm/service/message.dart
index b465499..3afbd0d 100644
--- a/runtime/vm/service/message.dart
+++ b/runtime/vm/service/message.dart
@@ -33,7 +33,8 @@
});
}
- Message.fromJsonRpc(Map map) : serial = map['id'], method = map['method'] {
+ Message.fromJsonRpc(Map map)
+ : serial = map['id'], method = map['method'] {
params.addAll(map['params']);
}
@@ -47,10 +48,21 @@
return uri.pathSegments[0];
}
- Message.fromUri(Uri uri) : method = _methodNameFromUri(uri) {
+ Message.fromUri(Uri uri)
+ : method = _methodNameFromUri(uri) {
params.addAll(uri.queryParameters);
}
+ Message.forIsolate(Uri uri, RunningIsolate isolate)
+ : method = _methodNameFromUri(uri) {
+ params.addAll(uri.queryParameters);
+ params['isolateId'] = isolate.serviceId;
+ }
+
+ Uri toUri() {
+ return new Uri(path: method, queryParameters: params);
+ }
+
dynamic toJson() {
return {
'path': path,
@@ -84,12 +96,13 @@
};
var keys = _makeAllString(params.keys.toList(growable:false));
var values = _makeAllString(params.values.toList(growable:false));
- var request = new List(5)
+ var request = new List(6)
..[0] = 0 // Make room for OOB message type.
..[1] = receivePort.sendPort
- ..[2] = method
- ..[3] = keys
- ..[4] = values;
+ ..[2] = serial.toString()
+ ..[3] = method
+ ..[4] = keys
+ ..[5] = values;
if (!sendIsolateServiceMessage(sendPort, request)) {
_completer.complete(JSON.encode({
'type': 'ServiceError',
@@ -110,12 +123,13 @@
};
var keys = _makeAllString(params.keys.toList(growable:false));
var values = _makeAllString(params.values.toList(growable:false));
- var request = new List(5)
+ var request = new List(6)
..[0] = 0 // Make room for OOB message type.
..[1] = receivePort.sendPort
- ..[2] = method
- ..[3] = keys
- ..[4] = values;
+ ..[2] = serial.toString()
+ ..[3] = method
+ ..[4] = keys
+ ..[5] = values;
sendRootServiceMessage(request);
return _completer.future;
}
@@ -124,15 +138,19 @@
_completer.complete(response);
}
- void setErrorResponse(String error) {
- _completer.complete(JSON.encode({
- 'type': 'ServiceError',
- 'id': '',
- 'kind': 'RequestError',
- 'message': error,
- 'path': path,
- 'params': params
- }));
+ void setErrorResponse(String message) {
+ var response = {
+ 'id': serial,
+ 'result' : {
+ 'type': 'Error',
+ 'message': message,
+ 'request': {
+ 'method': method,
+ 'params': params
+ }
+ }
+ };
+ _completer.complete(JSON.encode(response));
}
}
diff --git a/runtime/vm/service/running_isolate.dart b/runtime/vm/service/running_isolate.dart
index 3dd4839..48eec0d 100644
--- a/runtime/vm/service/running_isolate.dart
+++ b/runtime/vm/service/running_isolate.dart
@@ -11,6 +11,8 @@
RunningIsolate(this.portId, this.sendPort, this.name);
+ String get serviceId => 'isolates/$portId';
+
Future<String> route(Message message) {
// Send message to isolate.
return message.send(sendPort);
diff --git a/runtime/vm/service/service.idl b/runtime/vm/service/service.idl
index 4850a1c..6aed64d 100644
--- a/runtime/vm/service/service.idl
+++ b/runtime/vm/service/service.idl
@@ -151,29 +151,33 @@
// accumulators should be reset.
//
// <code>gc</code> is optional and indicates whether a full
- getAllocationProfile(isolateId string,
- reset bool,
- gc GCOption) AllocationProfile
+ _getAllocationProfile(isolateId string,
+ reset bool,
+ gc GCOption) AllocationProfile
// Returns the heap map for an isolate.
getHeapMap(isolateId string) HeapMap
// Returns how many bytes are retained by some target Class or Instance.
- getRetainedSize(isolateId string, targetId string) InstanceRef
+ _getRetainedSize(isolateId string, targetId string) InstanceRef
// Returns a path demonstrating why an object is retained in memory.
//
// TODO(turnidge): Make limit an int instead of a string.
- getRetainingPath(isolateId string,
- targetId string,
- limit int) RetainingPath
+ _getRetainingPath(isolateId string,
+ targetId string,
+ limit int) RetainingPath
// Returns a collection of inbound references to some object.
//
// TODO(turnidge): Make limit an int instead of a string.
- getInboundReferences(isolateId string,
- targetId string,
- limit int) InboundReferences
+ _getInboundReferences(isolateId string,
+ targetId string,
+ limit int) InboundReferences
+
+ _getInstances(isolateId string,
+ classId string,
+ limit int) InstanceSet
getClassList(isolateId string) ClassList
@@ -1052,6 +1056,11 @@
}
+struct InstanceSet {
+ placeholder int
+}
+
+
struct ClassList extends Response {
classes []ClassRef
}
diff --git a/runtime/vm/service/vmservice.dart b/runtime/vm/service/vmservice.dart
index 95254a3..2a6bbc2 100644
--- a/runtime/vm/service/vmservice.dart
+++ b/runtime/vm/service/vmservice.dart
@@ -46,7 +46,7 @@
void _eventMessageHandler(dynamic eventMessage) {
for (var client in clients) {
if (client.sendEvents) {
- client.post(null, eventMessage);
+ client.post(eventMessage);
}
}
}
@@ -66,14 +66,17 @@
}
void _exit() {
- if (onShutdown != null) {
- onShutdown();
- }
isolateLifecyclePort.close();
scriptLoadPort.close();
- for (var client in clients) {
+ // Create a copy of the set as a list because client.close() alters the set.
+ var clientsList = clients.toList();
+ for (var client in clientsList) {
client.close();
}
+ // Call embedder shutdown hook after the internal shutdown.
+ if (onShutdown != null) {
+ onShutdown();
+ }
_onExit();
}
@@ -139,6 +142,51 @@
message.setResponse(JSON.encode(result));
}
+ Future<String> _getCrashDump() async {
+ final perIsolateRequests = [
+ // ?isolateId=<isolate id> will be appended to each of these requests.
+ Uri.parse('getIsolate'), // Isolate information.
+ Uri.parse('_getAllocationProfile'), // State of heap.
+ Uri.parse('getStack?full=true'), // Call stack + local variables.
+ ];
+
+ // Snapshot of running isolates.
+ var isolates = runningIsolates.isolates.values.toList();
+
+ // Collect the mapping from request uris to responses.
+ var responses = {
+ };
+
+ // Request VM.
+ var getVM = Uri.parse('getVM');
+ var getVmResponse = JSON.decode(
+ await new Message.fromUri(getVM).sendToVM());
+ responses[getVM.toString()] = getVmResponse['result'];
+
+ // Request command line flags.
+ var getFlagList = Uri.parse('getFlagList');
+ var getFlagListResponse = JSON.decode(
+ await new Message.fromUri(getFlagList).sendToVM());
+ responses[getFlagList.toString()] = getFlagListResponse['result'];
+
+ // Make requests to each isolate.
+ for (var isolate in isolates) {
+ for (var request in perIsolateRequests) {
+ var message = new Message.forIsolate(request, isolate);
+ // Decode the JSON and and insert it into the map. The map key
+ // is the request Uri.
+ var response = JSON.decode(await isolate.route(message));
+ responses[message.toUri().toString()] = response['result'];
+ }
+ }
+
+ // Encode the entire crash dump.
+ return JSON.encode({
+ 'id' : null,
+ 'result' : responses,
+ });
+ }
+
Future<String> route(Message message) {
if (message.completed) {
return message.response;
@@ -148,6 +196,9 @@
_clientCollection(message);
return message.response;
}
+ if (message.method == '_getCrashDump') {
+ return _getCrashDump();
+ }
if (message.params['isolateId'] != null) {
return runningIsolates.route(message);
}
diff --git a/runtime/vm/service_event.cc b/runtime/vm/service_event.cc
index 3dfe66b..c1be690 100644
--- a/runtime/vm/service_event.cc
+++ b/runtime/vm/service_event.cc
@@ -36,7 +36,8 @@
type_(TranslateEventType(debugger_event->type())),
breakpoint_(NULL),
top_frame_(NULL),
- exception_(NULL) {
+ exception_(NULL),
+ gc_stats_(NULL) {
DebuggerEvent::EventType type = debugger_event->type();
if (type == DebuggerEvent::kBreakpointReached) {
set_breakpoint(debugger_event->breakpoint());
@@ -78,6 +79,8 @@
return "BreakpointResolved";
case kBreakpointRemoved:
return "BreakpointRemoved";
+ case kGC:
+ return "GC"; // TODO(koda): Change to GarbageCollected.
default:
UNREACHABLE();
return "Unknown";
@@ -100,6 +103,11 @@
if (exception() != NULL) {
jsobj.AddProperty("exception", *(exception()));
}
+ if (gc_stats() != NULL) {
+ jsobj.AddProperty("reason", Heap::GCReasonToString(gc_stats()->reason_));
+ isolate()->heap()->PrintToJSONObject(Heap::kNew, &jsobj);
+ isolate()->heap()->PrintToJSONObject(Heap::kOld, &jsobj);
+ }
}
} // namespace dart
diff --git a/runtime/vm/service_event.h b/runtime/vm/service_event.h
index c7f41e8..4de7aa4 100644
--- a/runtime/vm/service_event.h
+++ b/runtime/vm/service_event.h
@@ -29,6 +29,8 @@
kBreakpointResolved,
kBreakpointRemoved,
+ kGC,
+
kIllegal,
};
@@ -37,7 +39,8 @@
type_(event_type),
breakpoint_(NULL),
top_frame_(NULL),
- exception_(NULL) {}
+ exception_(NULL),
+ gc_stats_(NULL) {}
explicit ServiceEvent(const DebuggerEvent* debugger_event);
@@ -75,6 +78,14 @@
exception_ = exception;
}
+ const Heap::GCStats* gc_stats() const {
+ return gc_stats_;
+ }
+
+ void set_gc_stats(const Heap::GCStats* gc_stats) {
+ gc_stats_ = gc_stats;
+ }
+
void PrintJSON(JSONStream* js) const;
static const char* EventTypeToCString(EventType type);
@@ -85,6 +96,7 @@
SourceBreakpoint* breakpoint_;
ActivationFrame* top_frame_;
const Object* exception_;
+ const Heap::GCStats* gc_stats_;
};
} // namespace dart
diff --git a/runtime/vm/service_test.cc b/runtime/vm/service_test.cc
index b3a70f4..d177304 100644
--- a/runtime/vm/service_test.cc
+++ b/runtime/vm/service_test.cc
@@ -44,44 +44,6 @@
return true;
}
- // Removes a given json key:value from _msg.
- void filterMsg(const char* key) {
- int key_len = strlen(key);
- int old_len = strlen(_msg);
- char* new_msg = reinterpret_cast<char*>(malloc(old_len + 1));
- int old_pos = 0;
- int new_pos = 0;
- while (_msg[old_pos] != '\0') {
- if (_msg[old_pos] == '\"') {
- old_pos++;
- if ((old_len - old_pos) > key_len &&
- strncmp(&_msg[old_pos], key, key_len) == 0 &&
- _msg[old_pos + key_len] == '\"') {
- old_pos += (key_len + 2);
- // Skip until next , or }.
- while (_msg[old_pos] != '\0' &&
- _msg[old_pos] != ',' &&
- _msg[old_pos] != '}') {
- old_pos++;
- }
- if (_msg[old_pos] == ',') {
- old_pos++;
- }
- } else {
- new_msg[new_pos] = '\"';;
- new_pos++;
- }
- } else {
- new_msg[new_pos] = _msg[old_pos];
- new_pos++;
- old_pos++;
- }
- }
- new_msg[new_pos] = '\0';
- free(_msg);
- _msg = new_msg;
- }
-
const char* msg() const { return _msg; }
private:
@@ -89,24 +51,6 @@
};
-static RawArray* EvalVM(Dart_Handle lib, const char* expr) {
- Dart_Handle expr_val = Dart_EvaluateExpr(lib, NewString(expr));
- EXPECT_VALID(expr_val);
- Isolate* isolate = Isolate::Current();
- const GrowableObjectArray& value =
- Api::UnwrapGrowableObjectArrayHandle(isolate, expr_val);
- const Array& result = Array::Handle(Array::MakeArray(value));
- GrowableObjectArray& growable = GrowableObjectArray::Handle();
- growable ^= result.At(3);
- Array& array = Array::Handle(Array::MakeArray(growable));
- result.SetAt(3, array);
- growable ^= result.At(4);
- array = Array::MakeArray(growable);
- result.SetAt(4, array);
- return result.raw();
-}
-
-
static RawArray* Eval(Dart_Handle lib, const char* expr) {
const String& dummy_isolate_id = String::Handle(String::New("isolateId"));
Dart_Handle expr_val = Dart_EvaluateExpr(lib, NewString(expr));
@@ -116,16 +60,16 @@
Api::UnwrapGrowableObjectArrayHandle(isolate, expr_val);
const Array& result = Array::Handle(Array::MakeArray(value));
GrowableObjectArray& growable = GrowableObjectArray::Handle();
- growable ^= result.At(3);
- // Append dummy isolate id to parameter values.
- growable.Add(dummy_isolate_id);
- Array& array = Array::Handle(Array::MakeArray(growable));
- result.SetAt(3, array);
growable ^= result.At(4);
// Append dummy isolate id to parameter values.
growable.Add(dummy_isolate_id);
- array = Array::MakeArray(growable);
+ Array& array = Array::Handle(Array::MakeArray(growable));
result.SetAt(4, array);
+ growable ^= result.At(5);
+ // Append dummy isolate id to parameter values.
+ growable.Add(dummy_isolate_id);
+ array = Array::MakeArray(growable);
+ result.SetAt(5, array);
return result.raw();
}
@@ -148,28 +92,6 @@
}
-// Search for the formatted string in buffer.
-//
-// TODO(turnidge): This function obscures the line number of failing
-// EXPECTs. Rework this.
-static void ExpectSubstringF(const char* buff, const char* fmt, ...) {
- Isolate* isolate = Isolate::Current();
-
- va_list args;
- va_start(args, fmt);
- intptr_t len = OS::VSNPrint(NULL, 0, fmt, args);
- va_end(args);
-
- char* buffer = isolate->current_zone()->Alloc<char>(len + 1);
- va_list args2;
- va_start(args2, fmt);
- OS::VSNPrint(buffer, (len + 1), fmt, args2);
- va_end(args2);
-
- EXPECT_SUBSTRING(buffer, buff);
-}
-
-
static RawFunction* GetFunction(const Class& cls, const char* name) {
const Function& result = Function::Handle(cls.LookupDynamicFunction(
String::Handle(String::New(name))));
@@ -186,591 +108,6 @@
}
-TEST_CASE(Service_Isolate) {
- const char* kScript =
- "var port;\n" // Set to our mock port by C++.
- "\n"
- "main() {\n"
- "}";
-
- Isolate* isolate = Isolate::Current();
- Dart_Handle lib = TestCase::LoadTestScript(kScript, NULL);
- EXPECT_VALID(lib);
-
- // Build a mock message handler and wrap it in a dart port.
- ServiceTestMessageHandler handler;
- Dart_Port port_id = PortMap::CreatePort(&handler);
- Dart_Handle port = Api::NewHandle(isolate, SendPort::New(port_id));
- EXPECT_VALID(port);
- EXPECT_VALID(Dart_SetField(lib, NewString("port"), port));
-
- Array& service_msg = Array::Handle();
-
- // Get the isolate summary.
- service_msg = Eval(lib, "[0, port, 'getIsolate', [], []]");
- Service::HandleIsolateMessage(isolate, service_msg);
- handler.HandleNextMessage();
-
- JSONReader reader(handler.msg());
-
- const int kBufferSize = 128;
- char buffer[kBufferSize];
-
- // Check that the response string is somewhat sane.
-
- // type
- EXPECT(reader.Seek("type"));
- EXPECT_EQ(reader.Type(), JSONReader::kString);
- reader.GetDecodedValueChars(buffer, kBufferSize);
- EXPECT_STREQ("Isolate", buffer);
-
- // id
- EXPECT(reader.Seek("id"));
- EXPECT_EQ(reader.Type(), JSONReader::kString);
- reader.GetDecodedValueChars(buffer, kBufferSize);
- EXPECT_SUBSTRING("isolates/", buffer);
-
- // heap
- EXPECT(reader.Seek("heaps"));
- EXPECT_EQ(reader.Type(), JSONReader::kObject);
-}
-
-
-TEST_CASE(Service_Objects) {
- // TODO(turnidge): Extend this test to cover a non-trivial stack trace.
- const char* kScript =
- "var port;\n" // Set to our mock port by C++.
- "var validId;\n" // Set to a valid object id by C++.
- "\n"
- "main() {\n"
- "}";
-
- Isolate* isolate = Isolate::Current();
- Dart_Handle lib = TestCase::LoadTestScript(kScript, NULL);
- EXPECT_VALID(lib);
-
- // Build a mock message handler and wrap it in a dart port.
- ServiceTestMessageHandler handler;
- Dart_Port port_id = PortMap::CreatePort(&handler);
- Dart_Handle port = Api::NewHandle(isolate, SendPort::New(port_id));
- EXPECT_VALID(port);
- EXPECT_VALID(Dart_SetField(lib, NewString("port"), port));
-
- ObjectIdRing* ring = isolate->object_id_ring();
- const Array& arr = Array::Handle(Array::New(1, Heap::kOld));
- {
- HANDLESCOPE(isolate);
- const String& str = String::Handle(String::New("value", Heap::kOld));
- arr.SetAt(0, str);
- }
- intptr_t arr_id = ring->GetIdForObject(arr.raw());
- Dart_Handle valid_id = Dart_NewInteger(arr_id);
- EXPECT_VALID(valid_id);
- EXPECT_VALID(Dart_SetField(lib, NewString("validId"), valid_id));
-
- Array& service_msg = Array::Handle();
-
- // null
- service_msg = Eval(lib, "[0, port, 'getObject', "
- "['objectId'], ['objects/null']]");
- Service::HandleIsolateMessage(isolate, service_msg);
- handler.HandleNextMessage();
- handler.filterMsg("_vmName");
- EXPECT_SUBSTRING(
- "{\"type\":\"null\",\"id\":\"objects\\/null\","
- "\"valueAsString\":\"null\",\"class\":",
- handler.msg());
-
- // bool
- service_msg = Eval(lib, "[0, port, 'getObject', "
- "['objectId'], ['objects/bool-true']]");
- Service::HandleIsolateMessage(isolate, service_msg);
- handler.HandleNextMessage();
- handler.filterMsg("_vmName");
- handler.filterMsg("size");
- EXPECT_STREQ(
- "{\"type\":\"bool\","
- "\"class\":{\"type\":\"@Class\",\"id\":\"classes\\/45\","
- "\"name\":\"bool\"},"
- "\"fields\":[],\"id\":\"objects\\/bool-true\","
- "\"valueAsString\":\"true\"}",
- handler.msg());
-
- // int
- service_msg = Eval(lib, "[0, port, 'getObject', "
- "['objectId'], ['objects/int-123']]");
- Service::HandleIsolateMessage(isolate, service_msg);
- handler.HandleNextMessage();
- handler.filterMsg("_vmName");
- EXPECT_STREQ(
- "{\"type\":\"int\",\"_vmType\":\"Smi\","
- "\"class\":{\"type\":\"@Class\",\"id\":\"classes\\/41\","
- "\"name\":\"_Smi\",},"
- "\"fields\":[],"
- "\"id\":\"objects\\/int-123\","
- "\"valueAsString\":\"123\"}",
- handler.msg());
-
- // object id ring / valid
- service_msg = Eval(lib, "[0, port, 'getObject', "
- "['objectId'], ['objects/$validId']]");
- Service::HandleIsolateMessage(isolate, service_msg);
- handler.HandleNextMessage();
- handler.filterMsg("_vmName");
- handler.filterMsg("size");
- handler.filterMsg("id");
- EXPECT_STREQ(
- "{\"type\":\"List\",\"_vmType\":\"Array\","
- "\"class\":{\"type\":\"@Class\",\"name\":\"_List\",},"
- "\"fields\":[],"
- "\"length\":1,"
- "\"elements\":[{"
- "\"index\":0,"
- "\"value\":{\"type\":\"@String\","
- "\"class\":{\"type\":\"@Class\",\"name\":\"_OneByteString\",},"
- "\"valueAsString\":\"value\"}}]}",
- handler.msg());
-
- // object id ring / invalid => expired
- service_msg = Eval(lib, "[0, port, 'getObject', "
- "['objectId'], ['objects/99999999']]");
- Service::HandleIsolateMessage(isolate, service_msg);
- handler.HandleNextMessage();
- handler.filterMsg("_vmName");
- EXPECT_STREQ(
- "{\"type\":\"Sentinel\",\"id\":\"objects\\/expired\","
- "\"valueAsString\":\"<expired>\"}",
- handler.msg());
-
- // Retained by single instance.
- service_msg = Eval(
- lib,
- "[0, port, 'getRetainedSize', "
- "['targetId'], ['objects/$validId']]");
- Service::HandleIsolateMessage(isolate, service_msg);
- handler.HandleNextMessage();
- handler.filterMsg("_vmName");
- ExpectSubstringF(handler.msg(),
- "\"id\":\"objects\\/int-%" Pd "\"",
- arr.raw()->Size() + arr.At(0)->Size());
-
- // Retaining path to 'arr', limit 1.
- service_msg = Eval(
- lib,
- "[0, port, 'getRetainingPath', "
- "['targetId', 'limit'], ['objects/$validId', '1']]");
- Service::HandleIsolateMessage(isolate, service_msg);
- handler.HandleNextMessage();
- ExpectSubstringF(
- handler.msg(),
- "{\"type\":\"RetainingPath\",\"length\":1,"
- "\"elements\":[{\"index\":0,\"value\":{\"type\":\"@List\"");
-
- // Retaining path missing limit.
- service_msg = Eval(
- lib,
- "[0, port, 'getRetainingPath', "
- "['targetId'], ['objects/$validId']]");
- Service::HandleIsolateMessage(isolate, service_msg);
- handler.HandleNextMessage();
- ExpectSubstringF(handler.msg(), "{\"type\":\"Error\"");
-}
-
-
-TEST_CASE(Service_RetainingPath) {
- const char* kScript =
- "var port;\n" // Set to our mock port by C++.
- "var id0;\n" // Set to an object id by C++.
- "var id1;\n" // Ditto.
- "var idElem;\n" // Ditto.
- "class Foo {\n"
- " String f0;\n"
- " String f1;\n"
- "}\n"
- "Foo foo;\n"
- "List<String> lst;\n"
- "main() {\n"
- " foo = new Foo();\n"
- " lst = new List<String>(100);\n"
- "}\n";
- Isolate* isolate = Isolate::Current();
- Dart_Handle lib = TestCase::LoadTestScript(kScript, NULL);
- EXPECT_VALID(lib);
- Dart_Handle result = Dart_Invoke(lib, NewString("main"), 0, NULL);
- EXPECT_VALID(result);
- Library& vmlib = Library::Handle();
- vmlib ^= Api::UnwrapHandle(lib);
- EXPECT(!vmlib.IsNull());
- const Class& class_foo = Class::Handle(GetClass(vmlib, "Foo"));
- EXPECT(!class_foo.IsNull());
- Dart_Handle foo = Dart_GetField(lib, NewString("foo"));
- Dart_Handle lst = Dart_GetField(lib, NewString("lst"));
- const intptr_t kElemIndex = 42;
- {
- Dart_EnterScope();
- ObjectIdRing* ring = isolate->object_id_ring();
- {
- const String& foo0 = String::Handle(String::New("foo0", Heap::kOld));
- Dart_Handle h_foo0 = Api::NewHandle(isolate, foo0.raw());
- EXPECT_VALID(Dart_SetField(foo, NewString("f0"), h_foo0));
- Dart_Handle id0 = Dart_NewInteger(ring->GetIdForObject(foo0.raw()));
- EXPECT_VALID(id0);
- EXPECT_VALID(Dart_SetField(lib, NewString("id0"), id0));
- }
- {
- const String& foo1 = String::Handle(String::New("foo1", Heap::kOld));
- Dart_Handle h_foo1 = Api::NewHandle(isolate, foo1.raw());
- EXPECT_VALID(Dart_SetField(foo, NewString("f1"), h_foo1));
- Dart_Handle id1 = Dart_NewInteger(ring->GetIdForObject(foo1.raw()));
- EXPECT_VALID(id1);
- EXPECT_VALID(Dart_SetField(lib, NewString("id1"), id1));
- }
- {
- const String& elem = String::Handle(String::New("elem", Heap::kOld));
- Dart_Handle h_elem = Api::NewHandle(isolate, elem.raw());
- EXPECT_VALID(Dart_ListSetAt(lst, kElemIndex, h_elem));
- Dart_Handle idElem = Dart_NewInteger(ring->GetIdForObject(elem.raw()));
- EXPECT_VALID(idElem);
- EXPECT_VALID(Dart_SetField(lib, NewString("idElem"), idElem));
- }
- Dart_ExitScope();
- }
-
- // Build a mock message handler and wrap it in a dart port.
- ServiceTestMessageHandler handler;
- Dart_Port port_id = PortMap::CreatePort(&handler);
- Dart_Handle port = Api::NewHandle(isolate, SendPort::New(port_id));
- EXPECT_VALID(port);
- EXPECT_VALID(Dart_SetField(lib, NewString("port"), port));
- Array& service_msg = Array::Handle();
-
- // Retaining path to 'foo0', limit 2.
- service_msg = Eval(
- lib,
- "[0, port, 'getRetainingPath', "
- "['targetId', 'limit'], ['objects/$id0', '2']]");
- Service::HandleIsolateMessage(isolate, service_msg);
- handler.HandleNextMessage();
- ExpectSubstringF(
- handler.msg(),
- "{\"type\":\"RetainingPath\",\"length\":2,"
- "\"elements\":[{\"index\":0,\"value\":{\"type\":\"@String\"");
- ExpectSubstringF(handler.msg(), "\"parentField\":{\"type\":\"@Field\"");
- ExpectSubstringF(handler.msg(), "\"name\":\"f0\"");
- ExpectSubstringF(handler.msg(),
- "{\"index\":1,\"value\":{\"type\":\"@Instance\"");
-
- // Retaining path to 'foo1', limit 2.
- service_msg = Eval(
- lib,
- "[0, port, 'getRetainingPath', "
- "['targetId', 'limit'], ['objects/$id1', '2']]");
- Service::HandleIsolateMessage(isolate, service_msg);
- handler.HandleNextMessage();
- ExpectSubstringF(
- handler.msg(),
- "{\"type\":\"RetainingPath\",\"length\":2,"
- "\"elements\":[{\"index\":0,\"value\":{\"type\":\"@String\"");
- ExpectSubstringF(handler.msg(), "\"parentField\":{\"type\":\"@Field\"");
- ExpectSubstringF(handler.msg(), "\"name\":\"f1\"");
- ExpectSubstringF(handler.msg(),
- "{\"index\":1,\"value\":{\"type\":\"@Instance\"");
-
- // Retaining path to 'elem', limit 2.
- service_msg = Eval(
- lib,
- "[0, port, 'getRetainingPath', "
- "['targetId', 'limit'], ['objects/$idElem', '2']]");
- Service::HandleIsolateMessage(isolate, service_msg);
- handler.HandleNextMessage();
- ExpectSubstringF(
- handler.msg(),
- "{\"type\":\"RetainingPath\",\"length\":2,"
- "\"elements\":[{\"index\":0,\"value\":{\"type\":\"@String\"");
- ExpectSubstringF(handler.msg(), "\"parentListIndex\":%" Pd, kElemIndex);
- ExpectSubstringF(handler.msg(),
- "{\"index\":1,\"value\":{\"type\":\"@List\"");
-}
-
-
-TEST_CASE(Service_Libraries) {
- const char* kScript =
- "var port;\n" // Set to our mock port by C++.
- "var libVar = 54321;\n"
- "\n"
- "main() {\n"
- "}";
-
- Isolate* isolate = Isolate::Current();
- Dart_Handle lib = TestCase::LoadTestScript(kScript, NULL);
- EXPECT_VALID(lib);
- Library& vmlib = Library::Handle();
- vmlib ^= Api::UnwrapHandle(lib);
- EXPECT(!vmlib.IsNull());
-
- // Build a mock message handler and wrap it in a dart port.
- ServiceTestMessageHandler handler;
- Dart_Port port_id = PortMap::CreatePort(&handler);
- Dart_Handle port = Api::NewHandle(isolate, SendPort::New(port_id));
- EXPECT_VALID(port);
- EXPECT_VALID(Dart_SetField(lib, NewString("port"), port));
-
- Array& service_msg = Array::Handle();
-
- // Request library.
- service_msg =
- EvalF(lib,
- "[0, port, 'getObject', ['objectId'], ['libraries/%" Pd "']]",
- vmlib.index());
- Service::HandleIsolateMessage(isolate, service_msg);
- handler.HandleNextMessage();
- EXPECT_SUBSTRING("\"type\":\"Library\"", handler.msg());
- EXPECT_SUBSTRING("\"url\":\"test-lib\"", handler.msg());
-}
-
-
-TEST_CASE(Service_Classes) {
- const char* kScript =
- "var port;\n" // Set to our mock port by C++.
- "\n"
- "class A {\n"
- " var a;\n"
- " static var cobra = 11235;\n"
- " dynamic b() {}\n"
- " dynamic c() {\n"
- " var d = () { b(); };\n"
- " return d;\n"
- " }\n"
- "}\n"
- "class B { static int i = 42; }\n"
- "main() {\n"
- " var z = new A();\n"
- " var x = z.c();\n"
- " x();\n"
- " ++B.i;\n"
- "}";
-
- Isolate* isolate = Isolate::Current();
- Dart_Handle lib = TestCase::LoadTestScript(kScript, NULL);
- EXPECT_VALID(lib);
- Library& vmlib = Library::Handle();
- vmlib ^= Api::UnwrapHandle(lib);
- EXPECT(!vmlib.IsNull());
- Dart_Handle result = Dart_Invoke(lib, NewString("main"), 0, NULL);
- EXPECT_VALID(result);
- const Class& class_a = Class::Handle(GetClass(vmlib, "A"));
- EXPECT(!class_a.IsNull());
- intptr_t cid = class_a.id();
-
- // Build a mock message handler and wrap it in a dart port.
- ServiceTestMessageHandler handler;
- Dart_Port port_id = PortMap::CreatePort(&handler);
- Dart_Handle port = Api::NewHandle(isolate, SendPort::New(port_id));
- EXPECT_VALID(port);
- EXPECT_VALID(Dart_SetField(lib, NewString("port"), port));
-
- Array& service_msg = Array::Handle();
-
- // Request an invalid class id.
- service_msg = Eval(lib, "[0, port, 'getObject', "
- "['objectId'], ['classes/999999']]");
- Service::HandleIsolateMessage(isolate, service_msg);
- handler.HandleNextMessage();
- EXPECT_SUBSTRING("\"type\":\"Error\"", handler.msg());
-
- // Request the class A over the service.
- service_msg = EvalF(lib, "[0, port, 'getObject', "
- "['objectId'], ['classes/%" Pd "']]", cid);
- Service::HandleIsolateMessage(isolate, service_msg);
- handler.HandleNextMessage();
- EXPECT_SUBSTRING("\"type\":\"Class\"", handler.msg());
- ExpectSubstringF(handler.msg(),
- "\"id\":\"classes\\/%" Pd "\",\"name\":\"A\",", cid);
- ExpectSubstringF(handler.msg(), "\"allocationStats\":");
- ExpectSubstringF(handler.msg(), "\"tokenPos\":");
- ExpectSubstringF(handler.msg(), "\"endTokenPos\":");
-
- // Request function 'b' from class A.
- service_msg = EvalF(lib,
- "[0, port, 'getObject', "
- "['objectId'], ['classes/%" Pd "/functions/b']]", cid);
- Service::HandleIsolateMessage(isolate, service_msg);
- handler.HandleNextMessage();
- EXPECT_SUBSTRING("\"type\":\"Function\"", handler.msg());
- ExpectSubstringF(handler.msg(),
- "\"id\":\"classes\\/%" Pd "\\/functions\\/b\","
- "\"name\":\"b\",", cid);
-
- // Request field 0 from class A.
- service_msg = EvalF(lib, "[0, port, 'getObject', "
- "['objectId'], ['classes/%" Pd "/fields/0']]", cid);
- Service::HandleIsolateMessage(isolate, service_msg);
- handler.HandleNextMessage();
- EXPECT_SUBSTRING("\"type\":\"Field\"", handler.msg());
- ExpectSubstringF(handler.msg(),
- "\"id\":\"classes\\/%" Pd "\\/fields\\/0\","
- "\"name\":\"a\",", cid);
-
- // Invalid sub command.
- service_msg = EvalF(lib, "[0, port, 'getObject', "
- "['objectId'], ['classes/%" Pd "/huh']]", cid);
- Service::HandleIsolateMessage(isolate, service_msg);
- handler.HandleNextMessage();
- EXPECT_SUBSTRING("\"type\":\"Error\"", handler.msg());
-
- // Invalid field request.
- service_msg = EvalF(lib, "[0, port, 'getObject', "
- "['objectId'], ['classes/%" Pd "/fields/9']]", cid);
- Service::HandleIsolateMessage(isolate, service_msg);
- handler.HandleNextMessage();
- EXPECT_SUBSTRING("\"type\":\"Error\"", handler.msg());
-
- // Invalid function request.
- service_msg = EvalF(lib,
- "[0, port, 'getObject', "
- "['objectId'], ['classes/%" Pd "/functions/9']]", cid);
- Service::HandleIsolateMessage(isolate, service_msg);
- handler.HandleNextMessage();
- EXPECT_SUBSTRING("\"type\":\"Error\"", handler.msg());
-
- // Invalid field subcommand.
- service_msg = EvalF(lib,
- "[0, port, 'getObject', "
- "['objectId'], ['classes/%" Pd "/fields/9']]", cid);
- Service::HandleIsolateMessage(isolate, service_msg);
- handler.HandleNextMessage();
- EXPECT_SUBSTRING("\"type\":\"Error\"", handler.msg());
-
- // Invalid function command.
- service_msg = EvalF(lib,
- "[0, port, 'getObject', "
- "['objectId'], ['classes/%" Pd "/functions/0/x/y']]",
- cid);
- Service::HandleIsolateMessage(isolate, service_msg);
- handler.HandleNextMessage();
- EXPECT_SUBSTRING("\"type\":\"Error\"", handler.msg());
-
- // Invalid function subcommand with valid function id.
- service_msg = EvalF(lib,
- "[0, port, 'getObject', "
- "['objectId'], ['classes/%" Pd "/functions/b/x']]", cid);
- Service::HandleIsolateMessage(isolate, service_msg);
- handler.HandleNextMessage();
- EXPECT_SUBSTRING("\"type\":\"Error\"", handler.msg());
-
- // Retained size of all instances of class B.
- const Class& class_b = Class::Handle(GetClass(vmlib, "B"));
- EXPECT(!class_b.IsNull());
- const Instance& b0 = Instance::Handle(Instance::New(class_b));
- const Instance& b1 = Instance::Handle(Instance::New(class_b));
- service_msg = EvalF(lib, "[0, port, 'getRetainedSize', "
- "['targetId'], ['classes/%" Pd "']]", class_b.id());
- Service::HandleIsolateMessage(isolate, service_msg);
- handler.HandleNextMessage();
- ExpectSubstringF(handler.msg(),
- "\"id\":\"objects\\/int-%" Pd "\"",
- b0.raw()->Size() + b1.raw()->Size());
- // ... and list the instances of class B.
- service_msg = EvalF(lib, "[0, port, 'getInstances', "
- "['classId', 'limit'], ['classes/%" Pd "', '3']]",
- class_b.id());
- Service::HandleIsolateMessage(isolate, service_msg);
- handler.HandleNextMessage();
- ExpectSubstringF(handler.msg(), "\"type\":\"InstanceSet\"");
- ExpectSubstringF(handler.msg(), "\"totalCount\":2");
- ExpectSubstringF(handler.msg(), "\"sampleCount\":2");
- // TODO(koda): Actually parse the response.
- static const intptr_t kInstanceListId = 0;
- ExpectSubstringF(handler.msg(), "\"id\":\"objects\\/%" Pd "\",\"length\":2",
- kInstanceListId);
- Array& list = Array::Handle();
- ObjectIdRing::LookupResult kind;
- list ^= isolate->object_id_ring()->GetObjectForId(kInstanceListId, &kind);
- EXPECT_EQ(2, list.Length());
- // The list should contain {b0, b1}.
- EXPECT((list.At(0) == b0.raw() && list.At(1) == b1.raw()) ||
- (list.At(0) == b1.raw() && list.At(1) == b0.raw()));
- // ... and if limit is 1, we one get one of them.
- service_msg = EvalF(lib, "[0, port, 'getInstances', "
- "['classId', 'limit'], ['classes/%" Pd "', '1']]",
- class_b.id());
- Service::HandleIsolateMessage(isolate, service_msg);
- handler.HandleNextMessage();
- ExpectSubstringF(handler.msg(), "\"totalCount\":2");
- ExpectSubstringF(handler.msg(), "\"sampleCount\":1");
-}
-
-
-TEST_CASE(Service_Types) {
- const char* kScript =
- "var port;\n" // Set to our mock port by C++.
- "\n"
- "class A<T> { }\n"
- "\n"
- "main() {\n"
- " new A<A<bool>>();\n"
- "}";
-
- Isolate* isolate = Isolate::Current();
- Dart_Handle lib = TestCase::LoadTestScript(kScript, NULL);
- EXPECT_VALID(lib);
- Library& vmlib = Library::Handle();
- vmlib ^= Api::UnwrapHandle(lib);
- EXPECT(!vmlib.IsNull());
- Dart_Handle result = Dart_Invoke(lib, NewString("main"), 0, NULL);
- EXPECT_VALID(result);
- const Class& class_a = Class::Handle(GetClass(vmlib, "A"));
- EXPECT(!class_a.IsNull());
- intptr_t cid = class_a.id();
-
- // Build a mock message handler and wrap it in a dart port.
- ServiceTestMessageHandler handler;
- Dart_Port port_id = PortMap::CreatePort(&handler);
- Dart_Handle port = Api::NewHandle(isolate, SendPort::New(port_id));
- EXPECT_VALID(port);
- EXPECT_VALID(Dart_SetField(lib, NewString("port"), port));
-
- Array& service_msg = Array::Handle();
-
- // Request the class A over the service.
- service_msg = EvalF(lib, "[0, port, 'getObject', "
- "['objectId'], ['classes/%" Pd "']]]", cid);
- Service::HandleIsolateMessage(isolate, service_msg);
- handler.HandleNextMessage();
- EXPECT_SUBSTRING("\"type\":\"Class\"", handler.msg());
- EXPECT_SUBSTRING("\"name\":\"A\"", handler.msg());
- ExpectSubstringF(handler.msg(),
- "\"id\":\"classes\\/%" Pd "\"", cid);
-
- // Request canonical type 0 from class A.
- service_msg = EvalF(lib, "[0, port, 'getObject', "
- "['objectId'], ['classes/%" Pd "/types/0']]", cid);
- Service::HandleIsolateMessage(isolate, service_msg);
- handler.HandleNextMessage();
- EXPECT_SUBSTRING("\"type\":\"Type\"", handler.msg());
- EXPECT_SUBSTRING("\"name\":\"A<bool>\"", handler.msg());
- ExpectSubstringF(handler.msg(),
- "\"id\":\"classes\\/%" Pd "\\/types\\/0\"", cid);
-
- // Request canonical type 1 from class A.
- service_msg = EvalF(lib, "[0, port, 'getObject', "
- "['objectId'], ['classes/%" Pd "/types/1']]", cid);
- Service::HandleIsolateMessage(isolate, service_msg);
- handler.HandleNextMessage();
- EXPECT_SUBSTRING("\"type\":\"Type\"", handler.msg());
- EXPECT_SUBSTRING("\"name\":\"A<A<bool>>\"", handler.msg());
- ExpectSubstringF(handler.msg(),
- "\"id\":\"classes\\/%" Pd "\\/types\\/1\"", cid);
-
- // Request for non-existent canonical type from class A.
- service_msg = EvalF(lib, "[0, port, 'getObject', "
- "['objectId'], ['classes/%" Pd "/types/42']]", cid);
- Service::HandleIsolateMessage(isolate, service_msg);
- handler.HandleNextMessage();
- EXPECT_SUBSTRING("\"type\":\"Error\"", handler.msg());
-}
-
-
TEST_CASE(Service_Code) {
const char* kScript =
"var port;\n" // Set to our mock port by C++.
@@ -819,14 +156,15 @@
Array& service_msg = Array::Handle();
// Request an invalid code object.
- service_msg = Eval(lib, "[0, port, 'getObject', ['objectId'], ['code/0']]");
+ service_msg =
+ Eval(lib, "[0, port, '0', 'getObject', ['objectId'], ['code/0']]");
Service::HandleIsolateMessage(isolate, service_msg);
handler.HandleNextMessage();
EXPECT_SUBSTRING("\"type\":\"Error\"", handler.msg());
// The following test checks that a code object can be found only
// at compile_timestamp()-code.EntryPoint().
- service_msg = EvalF(lib, "[0, port, 'getObject', "
+ service_msg = EvalF(lib, "[0, port, '0', 'getObject', "
"['objectId'], ['code/%" Px64"-%" Px "']]",
compile_timestamp,
entry);
@@ -846,7 +184,7 @@
// Request code object at compile_timestamp-code.EntryPoint() + 16
// Expect this to fail because the address is not the entry point.
uintptr_t address = entry + 16;
- service_msg = EvalF(lib, "[0, port, 'getObject', "
+ service_msg = EvalF(lib, "[0, port, '0', 'getObject', "
"['objectId'], ['code/%" Px64"-%" Px "']]",
compile_timestamp,
address);
@@ -857,7 +195,7 @@
// Request code object at (compile_timestamp - 1)-code.EntryPoint()
// Expect this to fail because the timestamp is wrong.
address = entry;
- service_msg = EvalF(lib, "[0, port, 'getObject', "
+ service_msg = EvalF(lib, "[0, port, '0', 'getObject', "
"['objectId'], ['code/%" Px64"-%" Px "']]",
compile_timestamp - 1,
address);
@@ -867,7 +205,7 @@
// Request native code at address. Expect the null code object back.
address = last;
- service_msg = EvalF(lib, "[0, port, 'getObject', "
+ service_msg = EvalF(lib, "[0, port, '0', 'getObject', "
"['objectId'], ['code/native-%" Px "']]",
address);
Service::HandleIsolateMessage(isolate, service_msg);
@@ -877,7 +215,7 @@
handler.msg());
// Request malformed native code.
- service_msg = EvalF(lib, "[0, port, 'getObject', ['objectId'], "
+ service_msg = EvalF(lib, "[0, port, '0', 'getObject', ['objectId'], "
"['code/native%" Px "']]",
address);
Service::HandleIsolateMessage(isolate, service_msg);
@@ -921,7 +259,7 @@
Array& service_msg = Array::Handle();
// Fetch object.
- service_msg = EvalF(lib, "[0, port, 'getObject', "
+ service_msg = EvalF(lib, "[0, port, '0', 'getObject', "
"['objectId'], ['objects/%" Pd "']]", id);
Service::HandleIsolateMessage(isolate, service_msg);
handler.HandleNextMessage();
@@ -983,7 +321,7 @@
Array& service_msg = Array::Handle();
// Fetch object.
- service_msg = EvalF(lib, "[0, port, 'getObject', "
+ service_msg = EvalF(lib, "[0, port, '0', 'getObject', "
"['objectId'], ['objects/%" Pd "']]", id);
Service::HandleIsolateMessage(isolate, service_msg);
handler.HandleNextMessage();
@@ -1044,7 +382,7 @@
Array& service_msg = Array::Handle();
// Fetch object.
- service_msg = EvalF(lib, "[0, port, 'getObject', "
+ service_msg = EvalF(lib, "[0, port, '0', 'getObject', "
"['objectId'], ['objects/%" Pd "']]", id);
Service::HandleIsolateMessage(isolate, service_msg);
handler.HandleNextMessage();
@@ -1056,228 +394,6 @@
}
-TEST_CASE(Service_VM) {
- const char* kScript =
- "var port;\n" // Set to our mock port by C++.
- "\n"
- "main() {\n"
- "}";
-
- Isolate* isolate = Isolate::Current();
- Dart_Handle lib = TestCase::LoadTestScript(kScript, NULL);
- EXPECT_VALID(lib);
-
- // Build a mock message handler and wrap it in a dart port.
- ServiceTestMessageHandler handler;
- Dart_Port port_id = PortMap::CreatePort(&handler);
- Dart_Handle port = Api::NewHandle(isolate, SendPort::New(port_id));
- EXPECT_VALID(port);
- EXPECT_VALID(Dart_SetField(lib, NewString("port"), port));
-
- Array& service_msg = Array::Handle();
- service_msg = EvalVM(lib, "[0, port, 'getVM', [], []]");
-
- Service::HandleRootMessage(service_msg);
- handler.HandleNextMessage();
- EXPECT_SUBSTRING("\"type\":\"VM\"", handler.msg());
- EXPECT_SUBSTRING("\"targetCPU\"", handler.msg());
- EXPECT_SUBSTRING("\"hostCPU\"", handler.msg());
- EXPECT_SUBSTRING("\"version\"", handler.msg());
- EXPECT_SUBSTRING("\"startTime\"", handler.msg());
- EXPECT_SUBSTRING("\"isolates\"", handler.msg());
-}
-
-
-TEST_CASE(Service_Flags) {
- const char* kScript =
- "var port;\n" // Set to our mock port by C++.
- "\n"
- "main() {\n"
- "}";
-
- Isolate* isolate = Isolate::Current();
- Dart_Handle lib = TestCase::LoadTestScript(kScript, NULL);
- EXPECT_VALID(lib);
-
- // Build a mock message handler and wrap it in a dart port.
- ServiceTestMessageHandler handler;
- Dart_Port port_id = PortMap::CreatePort(&handler);
- Dart_Handle port = Api::NewHandle(isolate, SendPort::New(port_id));
- EXPECT_VALID(port);
- EXPECT_VALID(Dart_SetField(lib, NewString("port"), port));
-
- Array& service_msg = Array::Handle();
- service_msg = EvalVM(lib, "[0, port, 'getFlagList', [], []]");
-
- // Make sure we can get the FlagList.
- Service::HandleRootMessage(service_msg);
- handler.HandleNextMessage();
- EXPECT_SUBSTRING("\"type\":\"FlagList\"", handler.msg());
- EXPECT_SUBSTRING(
- "\"name\":\"service_testing_flag\",\"comment\":\"Comment\","
- "\"flagType\":\"bool\",\"valueAsString\":\"false\"",
- handler.msg());
-
- // Modify a flag through the vm service.
- service_msg = EvalVM(lib,
- "[0, port, 'setFlag', "
- "['name', 'value'], ['service_testing_flag', 'true']]");
- Service::HandleRootMessage(service_msg);
- handler.HandleNextMessage();
- EXPECT_SUBSTRING("Success", handler.msg());
-
- // Make sure that the flag changed.
- service_msg = EvalVM(lib, "[0, port, 'getFlagList', [], []]");
- Service::HandleRootMessage(service_msg);
- handler.HandleNextMessage();
- EXPECT_SUBSTRING(
- "\"name\":\"service_testing_flag\",\"comment\":\"Comment\","
- "\"flagType\":\"bool\",\"valueAsString\":\"true\"",
- handler.msg());
-}
-
-
-TEST_CASE(Service_Scripts) {
- const char* kScript =
- "var port;\n" // Set to our mock port by C++.
- "\n"
- "main() {\n"
- "}";
-
- Isolate* isolate = Isolate::Current();
- Dart_Handle lib = TestCase::LoadTestScript(kScript, NULL);
- EXPECT_VALID(lib);
- Library& vmlib = Library::Handle();
- vmlib ^= Api::UnwrapHandle(lib);
- EXPECT(!vmlib.IsNull());
-
- // Build a mock message handler and wrap it in a dart port.
- ServiceTestMessageHandler handler;
- Dart_Port port_id = PortMap::CreatePort(&handler);
- Dart_Handle port = Api::NewHandle(isolate, SendPort::New(port_id));
- EXPECT_VALID(port);
- EXPECT_VALID(Dart_SetField(lib, NewString("port"), port));
-
- Array& service_msg = Array::Handle();
- char buf[1024];
- OS::SNPrint(buf, sizeof(buf),
- "[0, port, 'getObject', "
- "['objectId'], ['libraries/%" Pd "/scripts/test-lib']]",
- vmlib.index());
-
- service_msg = Eval(lib, buf);
- Service::HandleIsolateMessage(isolate, service_msg);
- handler.HandleNextMessage();
- OS::SNPrint(buf, sizeof(buf),
- "{\"type\":\"Script\","
- "\"id\":\"libraries\\/%" Pd "\\/scripts\\/test-lib\","
- "\"name\":\"test-lib\","
- "\"kind\":\"script\","
- "\"library\":{\"type\":\"@Library\","
- "\"id\":\"libraries\\/%" Pd "\",\"name\":\"\","
- "\"url\":\"test-lib\"},"
- "\"source\":\"var port;\\n\\nmain() {\\n}\","
- "\"tokenPosTable\":[[1,0,1,1,5,2,9],[3,5,1,6,5,7,6,8,8],[4,10,1]]}",
- vmlib.index(), vmlib.index());
- EXPECT_STREQ(buf, handler.msg());
-}
-
-
-TEST_CASE(Service_AllocationProfile) {
- const char* kScript =
- "var port;\n" // Set to our mock port by C++.
- "\n"
- "var x = 7;\n"
- "main() {\n"
- " x = x * x;\n"
- " x = x / 13;\n"
- "}";
-
- Isolate* isolate = Isolate::Current();
- Dart_Handle lib = TestCase::LoadTestScript(kScript, NULL);
- EXPECT_VALID(lib);
- Dart_Handle result = Dart_Invoke(lib, NewString("main"), 0, NULL);
- EXPECT_VALID(result);
-
- // Build a mock message handler and wrap it in a dart port.
- ServiceTestMessageHandler handler;
- Dart_Port port_id = PortMap::CreatePort(&handler);
- Dart_Handle port = Api::NewHandle(isolate, SendPort::New(port_id));
- EXPECT_VALID(port);
- EXPECT_VALID(Dart_SetField(lib, NewString("port"), port));
-
- Array& service_msg = Array::Handle();
- service_msg = Eval(lib, "[0, port, 'getAllocationProfile', [], []]");
- Service::HandleIsolateMessage(isolate, service_msg);
- handler.HandleNextMessage();
- EXPECT_SUBSTRING("\"type\":\"AllocationProfile\"", handler.msg());
-
- // Bad gc option.
- service_msg = Eval(lib,
- "[0, port, 'getAllocationProfile', "
- "['gc'], ['cat']]");
- Service::HandleIsolateMessage(isolate, service_msg);
- handler.HandleNextMessage();
- EXPECT_SUBSTRING("\"type\":\"Error\"", handler.msg());
-
- // Bad reset option.
- service_msg = Eval(lib, "[0, port, 'getAllocationProfile', "
- "['reset'], ['ff']]");
- Service::HandleIsolateMessage(isolate, service_msg);
- handler.HandleNextMessage();
- EXPECT_SUBSTRING("\"type\":\"Error\"", handler.msg());
-
- // Good reset.
- service_msg =
- Eval(lib,
- "[0, port, 'getAllocationProfile', ['reset'], ['true']]");
- Service::HandleIsolateMessage(isolate, service_msg);
- handler.HandleNextMessage();
- EXPECT_SUBSTRING("\"type\":\"AllocationProfile\"", handler.msg());
-
- // Good GC.
- service_msg =
- Eval(lib, "[0, port, 'getAllocationProfile', ['gc'], ['full']]");
- Service::HandleIsolateMessage(isolate, service_msg);
- handler.HandleNextMessage();
- EXPECT_SUBSTRING("\"type\":\"AllocationProfile\"", handler.msg());
-
- // Good GC and reset.
- service_msg = Eval(lib, "[0, port, 'getAllocationProfile', "
- "['gc', 'reset'], ['full', 'true']]");
- Service::HandleIsolateMessage(isolate, service_msg);
- handler.HandleNextMessage();
- EXPECT_SUBSTRING("\"type\":\"AllocationProfile\"", handler.msg());
-}
-
-
-TEST_CASE(Service_HeapMap) {
- const char* kScript =
- "var port;\n" // Set to our mock port by C++.
- "\n"
- "main() {\n"
- "}";
-
- Isolate* isolate = Isolate::Current();
- Dart_Handle lib = TestCase::LoadTestScript(kScript, NULL);
- EXPECT_VALID(lib);
-
- // Build a mock message handler and wrap it in a dart port.
- ServiceTestMessageHandler handler;
- Dart_Port port_id = PortMap::CreatePort(&handler);
- Dart_Handle port = Api::NewHandle(isolate, SendPort::New(port_id));
- EXPECT_VALID(port);
- EXPECT_VALID(Dart_SetField(lib, NewString("port"), port));
-
- Array& service_msg = Array::Handle();
- service_msg = Eval(lib, "[0, port, 'getHeapMap', [], []]");
- Service::HandleIsolateMessage(isolate, service_msg);
- handler.HandleNextMessage();
- EXPECT_SUBSTRING("\"type\":\"HeapMap\"", handler.msg());
- EXPECT_SUBSTRING("\"pages\":[", handler.msg());
-}
-
-
TEST_CASE(Service_Address) {
const char* kScript =
"var port;\n" // Set to our mock port by C++.
@@ -1307,9 +423,9 @@
bool ref = offset % 2 == 0;
OS::SNPrint(buf, sizeof(buf),
(ref
- ? "[0, port, 'getObjectByAddress', "
+ ? "[0, port, '0', 'getObjectByAddress', "
"['address', 'ref'], ['%" Px "', 'true']]"
- : "[0, port, 'getObjectByAddress', "
+ : "[0, port, '0', 'getObjectByAddress', "
"['address'], ['%" Px "']]"),
addr);
service_msg = Eval(lib, buf);
@@ -1321,13 +437,13 @@
EXPECT_SUBSTRING("foobar", handler.msg());
}
// Expect null when no object is found.
- service_msg = Eval(lib, "[0, port, 'getObjectByAddress', "
+ service_msg = Eval(lib, "[0, port, '0', 'getObjectByAddress', "
"['address'], ['7']]");
Service::HandleIsolateMessage(isolate, service_msg);
handler.HandleNextMessage();
// TODO(turnidge): Should this be a ServiceException instead?
- EXPECT_SUBSTRING("{\"type\":\"null\",\"id\":\"objects\\/null\","
- "\"valueAsString\":\"null\"",
+ EXPECT_SUBSTRING("{\"type\":\"Sentinel\",\"id\":\"objects\\/free\","
+ "\"valueAsString\":\"<free>\"",
handler.msg());
}
@@ -1380,16 +496,17 @@
Array& service_msg = Array::Handle();
- service_msg = Eval(lib, "[0, port, 'alpha', [], []]");
+ service_msg = Eval(lib, "[0, port, '0', 'alpha', [], []]");
Service::HandleRootMessage(service_msg);
handler.HandleNextMessage();
- EXPECT_STREQ("alpha", handler.msg());
- service_msg = Eval(lib, "[0, port, 'beta', [], []]");
+ EXPECT_STREQ("{\"result\":alpha, \"id\":\"0\"}", handler.msg());
+ service_msg = Eval(lib, "[0, port, '0', 'beta', [], []]");
Service::HandleRootMessage(service_msg);
handler.HandleNextMessage();
- EXPECT_STREQ("beta", handler.msg());
+ EXPECT_STREQ("{\"result\":beta, \"id\":\"0\"}", handler.msg());
}
+
TEST_CASE(Service_EmbedderIsolateHandler) {
const char* kScript =
"var port;\n" // Set to our mock port by C++.
@@ -1417,17 +534,16 @@
EXPECT_VALID(Dart_SetField(lib, NewString("port"), port));
Array& service_msg = Array::Handle();
- service_msg = Eval(lib, "[0, port, 'alpha', [], []]");
+ service_msg = Eval(lib, "[0, port, '0', 'alpha', [], []]");
Service::HandleIsolateMessage(isolate, service_msg);
handler.HandleNextMessage();
- EXPECT_STREQ("alpha", handler.msg());
- service_msg = Eval(lib, "[0, port, 'beta', [], []]");
+ EXPECT_STREQ("{\"result\":alpha, \"id\":\"0\"}", handler.msg());
+ service_msg = Eval(lib, "[0, port, '0', 'beta', [], []]");
Service::HandleIsolateMessage(isolate, service_msg);
handler.HandleNextMessage();
- EXPECT_STREQ("beta", handler.msg());
+ EXPECT_STREQ("{\"result\":beta, \"id\":\"0\"}", handler.msg());
}
-
// TODO(zra): Remove when tests are ready to enable.
#if !defined(TARGET_ARCH_ARM64)
@@ -1455,21 +571,21 @@
EXPECT_VALID(Dart_SetField(lib, NewString("port"), port));
Array& service_msg = Array::Handle();
- service_msg = Eval(lib, "[0, port, 'getCpuProfile', [], []]");
+ service_msg = Eval(lib, "[0, port, '0', 'getCpuProfile', [], []]");
Service::HandleIsolateMessage(isolate, service_msg);
handler.HandleNextMessage();
// Expect error (tags required).
EXPECT_SUBSTRING("\"type\":\"Error\"", handler.msg());
service_msg =
- Eval(lib, "[0, port, 'getCpuProfile', ['tags'], ['None']]");
+ Eval(lib, "[0, port, '0', 'getCpuProfile', ['tags'], ['None']]");
Service::HandleIsolateMessage(isolate, service_msg);
handler.HandleNextMessage();
// Expect profile
EXPECT_SUBSTRING("\"type\":\"_CpuProfile\"", handler.msg());
service_msg =
- Eval(lib, "[0, port, 'getCpuProfile', ['tags'], ['Bogus']]");
+ Eval(lib, "[0, port, '0', 'getCpuProfile', ['tags'], ['Bogus']]");
Service::HandleIsolateMessage(isolate, service_msg);
handler.HandleNextMessage();
// Expect error.
diff --git a/runtime/vm/signal_handler_android.cc b/runtime/vm/signal_handler_android.cc
index 1ac0b8c..bbde84d 100644
--- a/runtime/vm/signal_handler_android.cc
+++ b/runtime/vm/signal_handler_android.cc
@@ -72,7 +72,6 @@
lr = static_cast<uintptr_t>(mcontext.arm_lr);
#elif defined(TARGET_ARCH_ARM64)
lr = static_cast<uintptr_t>(mcontext.regs[30]);
- UNIMPLEMENTED();
#else
UNIMPLEMENTED();
#endif // TARGET_ARCH_...
diff --git a/runtime/vm/signal_handler_linux.cc b/runtime/vm/signal_handler_linux.cc
index 960b417..2d7b74d 100644
--- a/runtime/vm/signal_handler_linux.cc
+++ b/runtime/vm/signal_handler_linux.cc
@@ -113,7 +113,7 @@
#elif defined(TARGET_ARCH_ARM)
lr = static_cast<uintptr_t>(mcontext.arm_lr);
#elif defined(TARGET_ARCH_ARM64)
- lr = static_cast<uintptr_t>(mcontext.lr);
+ lr = static_cast<uintptr_t>(mcontext.regs[30]);
#elif defined(TARGET_ARCH_MIPS)
lr = static_cast<uintptr_t>(mcontext.gregs[31]);
#else
diff --git a/runtime/vm/simulator_arm.cc b/runtime/vm/simulator_arm.cc
index 30e70f8..d329434 100644
--- a/runtime/vm/simulator_arm.cc
+++ b/runtime/vm/simulator_arm.cc
@@ -1176,7 +1176,7 @@
uword Simulator::StackTop() const {
// To be safe in potential stack underflows we leave some buffer above and
// set the stack top.
- return reinterpret_cast<uword>(stack_) +
+ return StackBase() +
(Isolate::GetSpecifiedStackSize() + Isolate::kStackSizeBuffer);
}
@@ -1506,7 +1506,7 @@
void Simulator::SupervisorCall(Instr* instr) {
int svc = instr->SvcField();
switch (svc) {
- case kRedirectionSvcCode: {
+ case Instr::kSimulatorRedirectCode: {
SimulatorSetjmpBuffer buffer(this);
if (!setjmp(buffer.buffer_)) {
@@ -1627,19 +1627,11 @@
break;
}
- case kBreakpointSvcCode: {
+ case Instr::kSimulatorBreakCode: {
SimulatorDebugger dbg(this);
dbg.Stop(instr, "breakpoint");
break;
}
- case kStopMessageSvcCode: {
- SimulatorDebugger dbg(this);
- const char* message = *reinterpret_cast<const char**>(
- reinterpret_cast<intptr_t>(instr) - Instr::kInstrSize);
- set_pc(get_pc() + Instr::kInstrSize);
- dbg.Stop(instr, message);
- break;
- }
default: {
UNREACHABLE();
break;
@@ -1696,10 +1688,18 @@
if ((instr->Bits(21, 2) == 0x1) && (instr->ConditionField() == AL)) {
// Format(instr, "bkpt #'imm12_4");
SimulatorDebugger dbg(this);
- set_pc(get_pc() + Instr::kInstrSize);
- char buffer[32];
- snprintf(buffer, sizeof(buffer), "bkpt #0x%x", instr->BkptField());
- dbg.Stop(instr, buffer);
+ int32_t imm = instr->BkptField();
+ if (imm == Instr::kStopMessageCode) {
+ const char* message = *reinterpret_cast<const char**>(
+ reinterpret_cast<intptr_t>(instr) - Instr::kInstrSize);
+ set_pc(get_pc() + Instr::kInstrSize);
+ dbg.Stop(instr, message);
+ } else {
+ char buffer[32];
+ snprintf(buffer, sizeof(buffer), "bkpt #0x%x", imm);
+ set_pc(get_pc() + Instr::kInstrSize);
+ dbg.Stop(instr, buffer);
+ }
} else {
// Format(instr, "smc'cond");
UnimplementedInstruction(instr);
@@ -1728,10 +1728,6 @@
case 3: {
// Registers rd, rn, rm, ra are encoded as rn, rm, rs, rd.
// Format(instr, "mls'cond's 'rn, 'rm, 'rs, 'rd");
- if (TargetCPUFeatures::arm_version() != ARMv7) {
- UnimplementedInstruction(instr);
- break;
- }
rd_val = get_register(rd);
// fall through
}
@@ -1740,6 +1736,10 @@
// Format(instr, "mul'cond's 'rn, 'rm, 'rs");
int32_t alu_out = rm_val * rs_val;
if (instr->Bits(21, 3) == 3) { // mls
+ if (TargetCPUFeatures::arm_version() != ARMv7) {
+ UnimplementedInstruction(instr);
+ break;
+ }
alu_out = -alu_out;
}
alu_out += rd_val;
diff --git a/runtime/vm/simulator_arm.h b/runtime/vm/simulator_arm.h
index 250ac5d..3e660b6 100644
--- a/runtime/vm/simulator_arm.h
+++ b/runtime/vm/simulator_arm.h
@@ -70,7 +70,8 @@
void set_dregister_bits(DRegister reg, int64_t value);
int64_t get_dregister_bits(DRegister reg) const;
- // Accessor to the internal simulator stack top.
+ // Accessors to the internal simulator stack base and top.
+ uword StackBase() const { return reinterpret_cast<uword>(stack_); }
uword StackTop() const;
// Accessor to the instruction counter.
diff --git a/runtime/vm/simulator_arm64.cc b/runtime/vm/simulator_arm64.cc
index 4acdce0..992b3c0 100644
--- a/runtime/vm/simulator_arm64.cc
+++ b/runtime/vm/simulator_arm64.cc
@@ -837,14 +837,13 @@
}
private:
- static const int32_t kRedirectInstruction = Instr::kRedirectInstruction;
Redirection(uword external_function,
Simulator::CallKind call_kind,
int argument_count)
: external_function_(external_function),
call_kind_(call_kind),
argument_count_(argument_count),
- hlt_instruction_(kRedirectInstruction),
+ hlt_instruction_(Instr::kSimulatorRedirectInstruction),
next_(list_) {
// Atomically prepend this element to the front of the global list.
// Note: Since elements are never removed, there is no ABA issue.
@@ -1054,7 +1053,7 @@
uword Simulator::StackTop() const {
// To be safe in potential stack underflows we leave some buffer above and
// set the stack top.
- return reinterpret_cast<uword>(stack_) +
+ return StackBase() +
(Isolate::GetSpecifiedStackSize() + Isolate::kStackSizeBuffer);
}
@@ -1689,22 +1688,23 @@
(instr->Bits(21, 3) == 1)) {
// Format(instr, "brk 'imm16");
SimulatorDebugger dbg(this);
- uint16_t imm = static_cast<uint16_t>(instr->Imm16Field());
- char buffer[32];
- snprintf(buffer, sizeof(buffer), "brk #0x%x", imm);
- set_pc(get_pc() + Instr::kInstrSize);
- dbg.Stop(instr, buffer);
- } else if ((instr->Bits(0, 2) == 0) && (instr->Bits(2, 3) == 0) &&
- (instr->Bits(21, 3) == 2)) {
- // Format(instr, "hlt 'imm16");
- uint16_t imm = static_cast<uint16_t>(instr->Imm16Field());
- if (imm == Instr::kSimulatorMessageCode) {
- SimulatorDebugger dbg(this);
+ int32_t imm = instr->Imm16Field();
+ if (imm == Instr::kStopMessageCode) {
const char* message = *reinterpret_cast<const char**>(
reinterpret_cast<intptr_t>(instr) - 2 * Instr::kInstrSize);
set_pc(get_pc() + Instr::kInstrSize);
dbg.Stop(instr, message);
- } else if (imm == Instr::kSimulatorBreakCode) {
+ } else {
+ char buffer[32];
+ snprintf(buffer, sizeof(buffer), "brk #0x%x", imm);
+ set_pc(get_pc() + Instr::kInstrSize);
+ dbg.Stop(instr, buffer);
+ }
+ } else if ((instr->Bits(0, 2) == 0) && (instr->Bits(2, 3) == 0) &&
+ (instr->Bits(21, 3) == 2)) {
+ // Format(instr, "hlt 'imm16");
+ uint16_t imm = static_cast<uint16_t>(instr->Imm16Field());
+ if (imm == Instr::kSimulatorBreakCode) {
SimulatorDebugger dbg(this);
dbg.Stop(instr, "breakpoint");
} else if (imm == Instr::kSimulatorRedirectCode) {
diff --git a/runtime/vm/simulator_arm64.h b/runtime/vm/simulator_arm64.h
index 97e40c4..6a1bd8b 100644
--- a/runtime/vm/simulator_arm64.h
+++ b/runtime/vm/simulator_arm64.h
@@ -69,7 +69,8 @@
int64_t get_last_pc() const;
void set_pc(int64_t pc);
- // Accessor to the internal simulator stack top.
+ // Accessors to the internal simulator stack base and top.
+ uword StackBase() const { return reinterpret_cast<uword>(stack_); }
uword StackTop() const;
// Accessor to the instruction counter.
diff --git a/runtime/vm/simulator_mips.cc b/runtime/vm/simulator_mips.cc
index 1cc6487..cd351a7 100644
--- a/runtime/vm/simulator_mips.cc
+++ b/runtime/vm/simulator_mips.cc
@@ -996,7 +996,7 @@
uword Simulator::StackTop() const {
// To be safe in potential stack underflows we leave some buffer above and
// set the stack top.
- return reinterpret_cast<uword>(stack_) +
+ return StackBase() +
(Isolate::GetSpecifiedStackSize() + Isolate::kStackSizeBuffer);
}
@@ -1217,12 +1217,6 @@
dbg.Stop(instr, message);
// Adjust for extra pc increment.
set_pc(get_pc() - Instr::kInstrSize);
- } else if (instr->BreakCodeField() == Instr::kSimulatorMessageCode) {
- const char* message = *reinterpret_cast<const char**>(
- reinterpret_cast<intptr_t>(instr) - Instr::kInstrSize);
- if (IsTracingExecution()) {
- OS::Print("Message: %s\n", message);
- }
} else if (instr->BreakCodeField() == Instr::kSimulatorRedirectCode) {
SimulatorSetjmpBuffer buffer(this);
diff --git a/runtime/vm/simulator_mips.h b/runtime/vm/simulator_mips.h
index 16e4728..23972fe 100644
--- a/runtime/vm/simulator_mips.h
+++ b/runtime/vm/simulator_mips.h
@@ -88,7 +88,8 @@
return fcsr_ & (1 << cc);
}
- // Accessor to the internal simulator stack top.
+ // Accessors to the internal simulator stack base and top.
+ uword StackBase() const { return reinterpret_cast<uword>(stack_); }
uword StackTop() const;
// Accessor to the instruction counter.
diff --git a/runtime/vm/stack_frame.cc b/runtime/vm/stack_frame.cc
index 8e3806c..2f3480a 100644
--- a/runtime/vm/stack_frame.cc
+++ b/runtime/vm/stack_frame.cc
@@ -452,7 +452,7 @@
ASSERT(!deopt_table.IsNull());
DeoptInfo::Unpack(deopt_table, deopt_info_, &deopt_instructions_);
num_materializations_ = DeoptInfo::NumMaterializations(deopt_instructions_);
- object_table_ = code_.object_table();
+ object_table_ = code_.ObjectPool();
Advance();
}
}
diff --git a/runtime/vm/stub_code.cc b/runtime/vm/stub_code.cc
index 8e41237..0c17653 100644
--- a/runtime/vm/stub_code.cc
+++ b/runtime/vm/stub_code.cc
@@ -151,10 +151,10 @@
stub.set_owner(cls);
cls.set_allocation_stub(stub);
if (FLAG_disassemble_stubs) {
- OS::Print("Code for allocation stub '%s': {\n", name);
+ ISL_Print("Code for allocation stub '%s': {\n", name);
DisassembleToStdout formatter;
stub.Disassemble(&formatter);
- OS::Print("}\n");
+ ISL_Print("}\n");
}
stub.set_entry_patch_pc_offset(entry_patch_offset);
stub.set_patch_code_pc_offset(patch_code_offset);
@@ -184,10 +184,10 @@
GenerateStub(&assembler);
const Code& code = Code::Handle(Code::FinalizeCode(name, &assembler));
if (FLAG_disassemble_stubs) {
- OS::Print("Code for stub '%s': {\n", name);
+ ISL_Print("Code for stub '%s': {\n", name);
DisassembleToStdout formatter;
code.Disassemble(&formatter);
- OS::Print("}\n");
+ ISL_Print("}\n");
}
return code.raw();
}
diff --git a/runtime/vm/stub_code_arm.cc b/runtime/vm/stub_code_arm.cc
index 01a07c7..84f251e 100644
--- a/runtime/vm/stub_code_arm.cc
+++ b/runtime/vm/stub_code_arm.cc
@@ -641,7 +641,7 @@
__ LoadImmediate(R6, heap->TopAddress(space));
__ ldr(R0, Address(R6, 0)); // Potential new object start.
__ adds(R7, R0, Operand(R8)); // Potential next object start.
- __ b(&slow_case, VS);
+ __ b(&slow_case, CS); // Branch if unsigned overflow.
// Check if the allocation fits into the remaining space.
// R0: potential new object start.
@@ -984,7 +984,9 @@
// R2: Header word.
if (TargetCPUFeatures::arm_version() == ARMv5TE) {
// TODO(21263): Implement 'swp' and use it below.
+#if !defined(USING_SIMULATOR)
ASSERT(OS::NumberOfAvailableProcessors() <= 1);
+#endif
__ orr(R2, R2, Operand(1 << RawObject::kRememberedBit));
__ str(R2, FieldAddress(R0, Object::tags_offset()));
} else {
diff --git a/runtime/vm/stub_code_arm64.cc b/runtime/vm/stub_code_arm64.cc
index 033ef48..e2ae703 100644
--- a/runtime/vm/stub_code_arm64.cc
+++ b/runtime/vm/stub_code_arm64.cc
@@ -659,8 +659,10 @@
__ add(R3, R3, Operand(R2, LSL, 2)); // R2 is Smi.
ASSERT(kSmiTagShift == 1);
__ andi(R3, R3, Immediate(~(kObjectAlignment - 1)));
+ // R0: potential new object start.
+ // R3: object size in bytes.
__ adds(R7, R3, Operand(R0));
- __ b(&slow_case, VS);
+ __ b(&slow_case, CS); // Branch if unsigned overflow.
// Check if the allocation fits into the remaining space.
// R0: potential new object start.
diff --git a/runtime/vm/stub_code_mips.cc b/runtime/vm/stub_code_mips.cc
index bab5cdf..91abd0a 100644
--- a/runtime/vm/stub_code_mips.cc
+++ b/runtime/vm/stub_code_mips.cc
@@ -706,8 +706,8 @@
__ LoadImmediate(T3, heap->TopAddress(space));
__ lw(T0, Address(T3, 0)); // Potential new object start.
- __ AdduDetectOverflow(T1, T0, T2, CMPRES1); // Potential next object start.
- __ bltz(CMPRES1, &slow_case); // CMPRES1 < 0 on overflow.
+ __ addu(T1, T0, T2); // Potential next object start.
+ __ BranchUnsignedLess(T1, T0, &slow_case); // Branch on unsigned overflow.
// Check if the allocation fits into the remaining space.
// T0: potential new object start.
diff --git a/runtime/vm/stub_code_x64.cc b/runtime/vm/stub_code_x64.cc
index 4be0ca2..0961ef7 100644
--- a/runtime/vm/stub_code_x64.cc
+++ b/runtime/vm/stub_code_x64.cc
@@ -1490,7 +1490,7 @@
__ movq(RBX, Address(RBP, kFirstLocalSlotFromFp * kWordSize));
__ UpdateRangeFeedback(RDX, 2, RBX, RCX, &done);
__ Bind(&done);
- __ LeaveFrame();
+ __ LeaveStubFrame();
__ ret();
} else {
__ jmp(RCX);
diff --git a/runtime/vm/tags.h b/runtime/vm/tags.h
index 8226991..b88045f 100644
--- a/runtime/vm/tags.h
+++ b/runtime/vm/tags.h
@@ -14,8 +14,9 @@
class RuntimeEntry;
#define VM_TAG_LIST(V) \
- V(Idle) \
- V(VM) /* Catch all */ \
+ V(Idle) /* isolate is idle and is_runnable() */ \
+ V(LoadWait) /* isolate is idle and !is_runnable() */ \
+ V(VM) /* Catch all */ \
V(CompileOptimized) \
V(CompileUnoptimized) \
V(CompileTopLevel) \
diff --git a/runtime/vm/thread.cc b/runtime/vm/thread.cc
index 2140078..573c11b 100644
--- a/runtime/vm/thread.cc
+++ b/runtime/vm/thread.cc
@@ -77,7 +77,11 @@
if (thread == NULL) return;
Isolate* isolate = thread->isolate();
ASSERT(isolate != NULL);
- isolate->set_vm_tag(VMTag::kIdleTagId);
+ if (isolate->is_runnable()) {
+ isolate->set_vm_tag(VMTag::kIdleTagId);
+ } else {
+ isolate->set_vm_tag(VMTag::kLoadWaitTagId);
+ }
isolate->set_thread_state(NULL);
Profiler::EndExecution(isolate);
isolate->set_mutator_thread(NULL);
diff --git a/runtime/vm/verifier.cc b/runtime/vm/verifier.cc
index 85b56c8..3c9fa66 100644
--- a/runtime/vm/verifier.cc
+++ b/runtime/vm/verifier.cc
@@ -22,21 +22,26 @@
void VerifyObjectVisitor::VisitObject(RawObject* raw_obj) {
if (raw_obj->IsHeapObject()) {
- switch (mark_expectation_) {
- case kForbidMarked:
+ uword raw_addr = RawObject::ToAddr(raw_obj);
+ if (raw_obj->IsFreeListElement()) {
if (raw_obj->IsMarked()) {
- uword raw_addr = RawObject::ToAddr(raw_obj);
- FATAL1("Marked object encountered %#" Px "\n", raw_addr);
+ FATAL1("Marked free list element encountered %#" Px "\n", raw_addr);
}
- break;
- case kAllowMarked:
- break;
- case kRequireMarked:
- if (!raw_obj->IsMarked()) {
- uword raw_addr = RawObject::ToAddr(raw_obj);
- FATAL1("Unmarked object encountered %#" Px "\n", raw_addr);
+ } else {
+ switch (mark_expectation_) {
+ case kForbidMarked:
+ if (raw_obj->IsMarked()) {
+ FATAL1("Marked object encountered %#" Px "\n", raw_addr);
+ }
+ break;
+ case kAllowMarked:
+ break;
+ case kRequireMarked:
+ if (!raw_obj->IsMarked()) {
+ FATAL1("Unmarked object encountered %#" Px "\n", raw_addr);
+ }
+ break;
}
- break;
}
}
allocated_set_->Add(raw_obj);
diff --git a/runtime/vm/virtual_memory.h b/runtime/vm/virtual_memory.h
index 844ff5e..607e6b2 100644
--- a/runtime/vm/virtual_memory.h
+++ b/runtime/vm/virtual_memory.h
@@ -35,7 +35,8 @@
return region_.Contains(addr);
}
- // Commits the virtual memory area, which is guaranteed to be zeroed.
+ // Commits the virtual memory area, which is guaranteed to be zeroed. Returns
+ // true on success and false on failure (e.g., out-of-memory).
bool Commit(bool is_executable) {
return Commit(start(), size(), is_executable);
}
diff --git a/runtime/vm/visitor.h b/runtime/vm/visitor.h
index a0b7efd..8667383 100644
--- a/runtime/vm/visitor.h
+++ b/runtime/vm/visitor.h
@@ -29,7 +29,6 @@
virtual GrowableArray<RawFunction*>* skipped_code_functions() {
return NULL;
}
-
// len argument is the number of pointers to visit starting from 'p'.
void VisitPointers(RawObject** p, intptr_t len) {
VisitPointers(p, (p + len - 1));
diff --git a/sdk/bin/dartanalyzer b/sdk/bin/dartanalyzer
index 9bd54a6..fec7d1c 100755
--- a/sdk/bin/dartanalyzer
+++ b/sdk/bin/dartanalyzer
@@ -43,7 +43,7 @@
DART_ROOT="$(cd "${SDK_DIR}/.." ; pwd -P)"
-ANALYZER="$DART_ROOT/pkg/analyzer/bin/analyzer.dart"
+ANALYZER="$DART_ROOT/third_party/pkg_tested/analyzer_cli/bin/analyzer.dart"
if [ -z "$DART_CONFIGURATION" ];
then
diff --git a/sdk/bin/dartanalyzer.bat b/sdk/bin/dartanalyzer.bat
index 8305c8a..a296b32 100644
--- a/sdk/bin/dartanalyzer.bat
+++ b/sdk/bin/dartanalyzer.bat
@@ -38,7 +38,7 @@
rem Remove trailing backslash if there is one
if %DART_ROOT:~-1%==\ set DART_ROOT=%DART_ROOT:~0,-1%
-set ANALYZER=%DART_ROOT%\pkg\analyzer\bin\analyzer.dart
+set ANALYZER=%DART_ROOT%\third_party\pkg_tested\analyzer_cli\bin\analyzer.dart
rem DART_CONFIGURATION defaults to ReleaseIA32
if "%DART_CONFIGURATION%"=="" set DART_CONFIGURATION=ReleaseIA32
diff --git a/sdk/lib/_internal/compiler/js_lib/annotations.dart b/sdk/lib/_internal/compiler/js_lib/annotations.dart
index c200980..0ade221 100644
--- a/sdk/lib/_internal/compiler/js_lib/annotations.dart
+++ b/sdk/lib/_internal/compiler/js_lib/annotations.dart
@@ -5,7 +5,9 @@
part of _js_helper;
/// Tells the optimizing compiler that the annotated method has no
-/// side-effects.
+/// side-effects. Allocations don't count as side-effects, since they can be
+/// dropped without changing the semantics of the program.
+///
/// Requires @NoInline() to function correctly.
class NoSideEffects {
const NoSideEffects();
diff --git a/sdk/lib/_internal/compiler/js_lib/collection_patch.dart b/sdk/lib/_internal/compiler/js_lib/collection_patch.dart
index 67e54bc..9df7c99 100644
--- a/sdk/lib/_internal/compiler/js_lib/collection_patch.dart
+++ b/sdk/lib/_internal/compiler/js_lib/collection_patch.dart
@@ -5,8 +5,9 @@
// Patch file for dart:collection classes.
import 'dart:_foreign_helper' show JS;
import 'dart:_js_helper' show
- fillLiteralMap, InternalMap, NoInline, NoThrows, patch, JsLinkedHashMap,
- LinkedHashMapCell, LinkedHashMapKeyIterable, LinkedHashMapKeyIterator;
+ fillLiteralMap, InternalMap, NoInline, NoSideEffects, NoThrows, patch,
+ JsLinkedHashMap, LinkedHashMapCell, LinkedHashMapKeyIterable,
+ LinkedHashMapKeyIterator;
@patch
class HashMap<K, V> {
@@ -386,6 +387,7 @@
final _Equality<K> _equals;
final _Hasher<K> _hashCode;
final _Predicate _validKey;
+
_CustomHashMap(this._equals, this._hashCode, bool validKey(potentialKey))
: _validKey = (validKey != null) ? validKey : ((v) => v is K);
@@ -427,7 +429,7 @@
String toString() => Maps.mapToString(this);
}
-class HashMapKeyIterable<E> extends IterableBase<E>
+class HashMapKeyIterable<E> extends Iterable<E>
implements EfficientLength {
final _map;
HashMapKeyIterable(this._map);
@@ -492,7 +494,7 @@
if (isValidKey == null) {
if (hashCode == null) {
if (equals == null) {
- return new JsLinkedHashMap<K, V>();
+ return new JsLinkedHashMap<K, V>.es6();
}
hashCode = _defaultHashCode;
} else {
@@ -521,16 +523,28 @@
// Private factory constructor called by generated code for map literals.
@NoInline()
factory LinkedHashMap._literal(List keyValuePairs) {
- return fillLiteralMap(keyValuePairs, new JsLinkedHashMap<K, V>());
+ return fillLiteralMap(keyValuePairs, new JsLinkedHashMap<K, V>.es6());
}
// Private factory constructor called by generated code for map literals.
- @NoThrows() @NoInline()
+ @NoThrows() @NoInline() @NoSideEffects()
factory LinkedHashMap._empty() {
- return new JsLinkedHashMap<K, V>();
+ return new JsLinkedHashMap<K, V>.es6();
}
+
+ // Private factory static function called by generated code for map literals.
+ // This version is for map literals without type parameters.
+ @NoInline()
+ static _makeEmpty() => new JsLinkedHashMap();
+
+ // Private factory static function called by generated code for map literals.
+ // This version is for map literals without type parameters.
+ @NoInline()
+ static _makeLiteral(keyValuePairs) =>
+ fillLiteralMap(keyValuePairs, new JsLinkedHashMap());
}
+// TODO(floitsch): use ES6 Maps when available.
class _LinkedIdentityHashMap<K, V> extends JsLinkedHashMap<K, V> {
int internalComputeHashCode(var key) {
// We force the hash codes to be unsigned 30-bit integers to avoid
@@ -550,10 +564,12 @@
}
}
+// TODO(floitsch): use ES6 maps when available.
class _LinkedCustomHashMap<K, V> extends JsLinkedHashMap<K, V> {
final _Equality<K> _equals;
final _Hasher<K> _hashCode;
final _Predicate _validKey;
+
_LinkedCustomHashMap(this._equals, this._hashCode,
bool validKey(potentialKey))
: _validKey = (validKey != null) ? validKey : ((v) => v is K);
diff --git a/sdk/lib/_internal/compiler/js_lib/constant_map.dart b/sdk/lib/_internal/compiler/js_lib/constant_map.dart
index ae3e379..e716cf1 100644
--- a/sdk/lib/_internal/compiler/js_lib/constant_map.dart
+++ b/sdk/lib/_internal/compiler/js_lib/constant_map.dart
@@ -92,7 +92,7 @@
'__proto__' == key ? _protoValue : jsPropertyAccess(_jsObject, key);
}
-class _ConstantMapKeyIterable<K> extends IterableBase<K> {
+class _ConstantMapKeyIterable<K> extends Iterable<K> {
ConstantStringMap<K, dynamic> _map;
_ConstantMapKeyIterable(this._map);
diff --git a/sdk/lib/_internal/compiler/js_lib/core_patch.dart b/sdk/lib/_internal/compiler/js_lib/core_patch.dart
index 21be5ac..4f472c5 100644
--- a/sdk/lib/_internal/compiler/js_lib/core_patch.dart
+++ b/sdk/lib/_internal/compiler/js_lib/core_patch.dart
@@ -279,8 +279,13 @@
if (growable) return list;
return makeListFixedLength(list);
}
-}
+ @patch
+ factory List.unmodifiable(Iterable elements) {
+ List result = new List<E>.from(elements, growable: false);
+ return makeFixedListUnmodifiable(result);
+ }
+}
@patch
class String {
@@ -310,7 +315,7 @@
static String _stringFromJSArray(List list, int start, int endOrNull) {
int len = list.length;
- int end = _checkBounds(len, start, endOrNull);
+ int end = RangeError.checkValidRange(start, endOrNull, len);
if (start > 0 || end < len) {
list = list.sublist(start, end);
}
@@ -320,22 +325,10 @@
static String _stringFromUint8List(
NativeUint8List charCodes, int start, int endOrNull) {
int len = charCodes.length;
- int end = _checkBounds(len, start, endOrNull);
+ int end = RangeError.checkValidRange(start, endOrNull, len);
return Primitives.stringFromNativeUint8List(charCodes, start, end);
}
- static int _checkBounds(int len, int start, int end) {
- if (start < 0 || start > len) {
- throw new RangeError.range(start, 0, len);
- }
- if (end == null) {
- end = len;
- } else if (end < start || end > len) {
- throw new RangeError.range(end, start, len);
- }
- return end;
- }
-
static String _stringFromIterable(Iterable<int> charCodes,
int start, int end) {
if (start < 0) throw new RangeError.range(start, 0, charCodes.length);
@@ -409,8 +402,14 @@
_writeString(new String.fromCharCode(charCode));
}
- void _writeString(str) {
- _contents = Primitives.stringConcatUnchecked(_contents, str);
+ @patch
+ void writeAll(Iterable objects, [String separator = ""]) {
+ _contents = _writeAll(_contents, objects, separator);
+ }
+
+ @patch
+ void writeln([Object obj = ""]) {
+ _writeString('$obj\n');
}
@patch
@@ -420,6 +419,31 @@
@patch
String toString() => Primitives.flattenString(_contents);
+
+ void _writeString(str) {
+ _contents = Primitives.stringConcatUnchecked(_contents, str);
+ }
+
+ static String _writeAll(String string, Iterable objects, String separator) {
+ Iterator iterator = objects.iterator;
+ if (!iterator.moveNext()) return string;
+ if (separator.isEmpty) {
+ do {
+ string = _writeOne(string, iterator.current);
+ } while (iterator.moveNext());
+ } else {
+ string = _writeOne(string, iterator.current);
+ while (iterator.moveNext()) {
+ string = _writeOne(string, separator);
+ string = _writeOne(string, iterator.current);
+ }
+ }
+ return string;
+ }
+
+ static String _writeOne(String string, Object obj) {
+ return Primitives.stringConcatUnchecked(string, '$obj');
+ }
}
@patch
diff --git a/sdk/lib/_internal/compiler/js_lib/foreign_helper.dart b/sdk/lib/_internal/compiler/js_lib/foreign_helper.dart
index 8d83d5c..6b58793 100644
--- a/sdk/lib/_internal/compiler/js_lib/foreign_helper.dart
+++ b/sdk/lib/_internal/compiler/js_lib/foreign_helper.dart
@@ -4,7 +4,7 @@
library _foreign_helper;
-import 'dart:_js_embedded_names' show JsGetName;
+import 'dart:_js_embedded_names' show JsGetName, JsBuiltin;
/**
* Emits a JavaScript code fragment parameterized by arguments.
@@ -190,15 +190,6 @@
void JS_SET_CURRENT_ISOLATE(isolate) {}
/**
- * Returns the JavaScript constructor function for Dart's Object class.
- * This can be used for type tests, as in
- *
- * if (JS('bool', '# instanceof #', obj, JS_DART_OBJECT_CONSTRUCTOR()))
- * ...
- */
-JS_DART_OBJECT_CONSTRUCTOR() {}
-
-/**
* Returns the interceptor for class [type]. The interceptor is the type's
* constructor's `prototype` property. [type] will typically be the class, not
* an interface, e.g. `JS_INTERCEPTOR_CONSTANT(JSInt)`, not
@@ -222,9 +213,6 @@
/// Returns the name of the class `Null` in the generated code.
String JS_NULL_CLASS_NAME() {}
-/// Returns the name of the class `Function` in the generated code.
-String JS_FUNCTION_CLASS_NAME() {}
-
/**
* Returns the field name used for determining if an object or its
* interceptor has JavaScript indexing behavior.
@@ -242,9 +230,6 @@
/// Returns the name used to tag typedefs.
String JS_TYPEDEF_TAG() {}
-/// Returns the name used to tag function type representations in JavaScript.
-String JS_FUNCTION_TYPE_TAG() {}
-
/**
* Returns the name used to tag void return in function type representations
* in JavaScript.
@@ -283,6 +268,16 @@
/// The [name] should be a constant defined in the `_embedded_names` library.
JS_EMBEDDED_GLOBAL(String typeDescription, String name) {}
+/// Instructs the compiler to execute the [builtinName] action at the call-site.
+///
+/// The [builtin] should be a constant defined in the `_embedded_names`
+/// library.
+// Add additional optional arguments if needed. The method is treated internally
+// as a variable argument method.
+JS_BUILTIN(String typeDescription, JsBuiltin builtin,
+ [arg0, arg1, arg2, arg3, arg4, arg5, arg6,
+ arg7, arg8, arg9, arg10, arg11]) {}
+
/// Returns the state of a flag that is determined by the state of the compiler
/// when the program has been analyzed.
bool JS_GET_FLAG(String name) {}
diff --git a/sdk/lib/_internal/compiler/js_lib/internal_patch.dart b/sdk/lib/_internal/compiler/js_lib/internal_patch.dart
index 16afd5f..6c39c4a 100644
--- a/sdk/lib/_internal/compiler/js_lib/internal_patch.dart
+++ b/sdk/lib/_internal/compiler/js_lib/internal_patch.dart
@@ -20,6 +20,10 @@
@patch
List makeListFixedLength(List growableList) {
- JSArray.markFixedList(growableList);
- return growableList;
+ return JSArray.markFixedList(growableList);
+}
+
+@patch
+List makeFixedListUnmodifiable(List fixedLengthList) {
+ return JSArray.markUnmodifiableList(fixedLengthList);
}
diff --git a/sdk/lib/_internal/compiler/js_lib/isolate_helper.dart b/sdk/lib/_internal/compiler/js_lib/isolate_helper.dart
index 9d36be5..2619c35 100644
--- a/sdk/lib/_internal/compiler/js_lib/isolate_helper.dart
+++ b/sdk/lib/_internal/compiler/js_lib/isolate_helper.dart
@@ -14,7 +14,7 @@
INSTANCE_FROM_CLASS_ID;
import 'dart:async';
-import 'dart:collection' show Queue, HashMap;
+import 'dart:collection' show Queue;
import 'dart:isolate';
import 'dart:_native_typed_data' show NativeByteBuffer, NativeTypedData;
@@ -311,7 +311,7 @@
List<_IsolateEvent> delayedEvents = [];
Set<Capability> pauseTokens = new Set();
- // Container with the "on exit" handler send-ports.
+ // Container with the "on exit" handler send-ports and responses.
var doneHandlers;
/**
@@ -355,19 +355,28 @@
_updateGlobalState();
}
- void addDoneListener(SendPort responsePort) {
+ void addDoneListener(SendPort responsePort, Object response) {
if (doneHandlers == null) {
doneHandlers = [];
}
- // If necessary, we can switch doneHandlers to a Set if it gets larger.
- // That is not expected to happen in practice.
- if (doneHandlers.contains(responsePort)) return;
+ for (int i = 0; i < doneHandlers.length; i += 2) {
+ if (responsePort == doneHandlers[i]) {
+ doneHandlers[i + 1] = response;
+ return;
+ }
+ }
doneHandlers.add(responsePort);
+ doneHandlers.add(response);
}
void removeDoneListener(SendPort responsePort) {
if (doneHandlers == null) return;
- doneHandlers.remove(responsePort);
+ for (int i = 0; i < doneHandlers.length; i += 2) {
+ if (responsePort == doneHandlers[i]) {
+ doneHandlers.removeRange(i, i + 2);
+ return;
+ }
+ }
}
void setErrorsFatal(Capability authentification, bool errorsAreFatal) {
@@ -375,18 +384,14 @@
this.errorsAreFatal = errorsAreFatal;
}
- void handlePing(SendPort responsePort, int pingType) {
+ void handlePing(SendPort responsePort, int pingType, Object response) {
if (pingType == Isolate.IMMEDIATE ||
(pingType == Isolate.BEFORE_NEXT_EVENT &&
!_isExecutingEvent)) {
- responsePort.send(null);
+ responsePort.send(response);
return;
}
- void respond() { responsePort.send(null); }
- if (pingType == Isolate.AS_EVENT) {
- _globalState.topEventLoop.enqueue(this, respond, "ping");
- return;
- }
+ void respond() { responsePort.send(response); }
assert(pingType == Isolate.BEFORE_NEXT_EVENT);
if (_scheduledControlEvents == null) {
_scheduledControlEvents = new Queue();
@@ -402,10 +407,6 @@
kill();
return;
}
- if (priority == Isolate.AS_EVENT) {
- _globalState.topEventLoop.enqueue(this, kill, "kill");
- return;
- }
assert(priority == Isolate.BEFORE_NEXT_EVENT);
if (_scheduledControlEvents == null) {
_scheduledControlEvents = new Queue();
@@ -499,7 +500,7 @@
removePause(message[1]);
break;
case 'add-ondone':
- addDoneListener(message[1]);
+ addDoneListener(message[1], message[2]);
break;
case 'remove-ondone':
removeDoneListener(message[1]);
@@ -508,7 +509,7 @@
setErrorsFatal(message[1], message[2]);
break;
case "ping":
- handlePing(message[1], message[2]);
+ handlePing(message[1], message[2], message[3]);
break;
case "kill":
handleKill(message[1], message[2]);
@@ -574,8 +575,10 @@
_globalState.isolates.remove(id); // indicate this isolate is not active
errorPorts.clear();
if (doneHandlers != null) {
- for (SendPort port in doneHandlers) {
- port.send(null);
+ for (int i = 0; i < doneHandlers.length; i += 2) {
+ SendPort responsePort = doneHandlers[i];
+ Object response = doneHandlers[i + 1];
+ responsePort.send(response);
}
doneHandlers = null;
}
diff --git a/sdk/lib/_internal/compiler/js_lib/isolate_patch.dart b/sdk/lib/_internal/compiler/js_lib/isolate_patch.dart
index b612cce..b01318c 100644
--- a/sdk/lib/_internal/compiler/js_lib/isolate_patch.dart
+++ b/sdk/lib/_internal/compiler/js_lib/isolate_patch.dart
@@ -76,12 +76,13 @@
}
@patch
- void addOnExitListener(SendPort responsePort) {
+ void addOnExitListener(SendPort responsePort, {Object response}) {
// TODO(lrn): Can we have an internal method that checks if the receiving
// isolate of a SendPort is still alive?
- var message = new List(2)
+ var message = new List(3)
..[0] = "add-ondone"
- ..[1] = responsePort;
+ ..[1] = responsePort
+ ..[2] = response;
controlPort.send(message);
}
@@ -103,16 +104,18 @@
}
@patch
- void kill([int priority = BEFORE_NEXT_EVENT]) {
+ void kill({int priority: BEFORE_NEXT_EVENT}) {
controlPort.send(["kill", terminateCapability, priority]);
}
@patch
- void ping(SendPort responsePort, [int pingType = IMMEDIATE]) {
- var message = new List(3)
+ void ping(SendPort responsePort, {Object response,
+ int priority: IMMEDIATE}) {
+ var message = new List(4)
..[0] = "ping"
..[1] = responsePort
- ..[2] = pingType;
+ ..[2] = priority
+ ..[3] = response;
controlPort.send(message);
}
diff --git a/sdk/lib/_internal/compiler/js_lib/js_array.dart b/sdk/lib/_internal/compiler/js_lib/js_array.dart
index 5763242..2afabdd 100644
--- a/sdk/lib/_internal/compiler/js_lib/js_array.dart
+++ b/sdk/lib/_internal/compiler/js_lib/js_array.dart
@@ -77,6 +77,16 @@
return JS('JSFixedArray', '#', list);
}
+ static List markUnmodifiableList(List list) {
+ // Functions are stored in the hidden class and not as properties in
+ // the object. We never actually look at the value, but only want
+ // to know if the property exists.
+ JS('void', r'#.fixed$length = Array', list);
+ JS('void', r'#.immutable$list = Array', list);
+ // TODO(23309): Make it detectable that the list has fixed length.
+ return JS('JSArray', '#', list);
+ }
+
checkMutable(reason) {
if (this is !JSMutableArray) {
throw new UnsupportedError(reason);
@@ -95,20 +105,20 @@
}
E removeAt(int index) {
+ checkGrowable('removeAt');
if (index is !int) throw new ArgumentError(index);
if (index < 0 || index >= length) {
throw new RangeError.value(index);
}
- checkGrowable('removeAt');
return JS('var', r'#.splice(#, 1)[0]', this, index);
}
void insert(int index, E value) {
+ checkGrowable('insert');
if (index is !int) throw new ArgumentError(index);
if (index < 0 || index > length) {
throw new RangeError.value(index);
}
- checkGrowable('insert');
JS('void', r'#.splice(#, 0, #)', this, index, value);
}
@@ -199,8 +209,9 @@
}
void addAll(Iterable<E> collection) {
+ checkGrowable('addAll');
for (E e in collection) {
- this.add(e);
+ JS('void', r'#.push(#)', this, e);
}
}
@@ -564,9 +575,9 @@
int get length => JS('JSUInt32', r'#.length', this);
void set length(int newLength) {
+ checkGrowable('set length');
if (newLength is !int) throw new ArgumentError(newLength);
if (newLength < 0) throw new RangeError.value(newLength);
- checkGrowable('set length');
JS('void', r'#.length = #', this, newLength);
}
diff --git a/sdk/lib/_internal/compiler/js_lib/js_helper.dart b/sdk/lib/_internal/compiler/js_lib/js_helper.dart
index da78c86..58ead91 100644
--- a/sdk/lib/_internal/compiler/js_lib/js_helper.dart
+++ b/sdk/lib/_internal/compiler/js_lib/js_helper.dart
@@ -16,6 +16,7 @@
INTERCEPTORS_BY_TAG,
IS_HUNK_LOADED,
IS_HUNK_INITIALIZED,
+ JsBuiltin,
JsGetName,
LEAF_TAGS,
METADATA,
@@ -42,22 +43,20 @@
import 'dart:_foreign_helper' show
DART_CLOSURE_TO_JS,
JS,
+ JS_BUILTIN,
JS_CALL_IN_ISOLATE,
JS_CONST,
JS_CURRENT_ISOLATE,
JS_CURRENT_ISOLATE_CONTEXT,
- JS_DART_OBJECT_CONSTRUCTOR,
JS_EFFECT,
JS_EMBEDDED_GLOBAL,
- JS_FUNCTION_CLASS_NAME,
JS_FUNCTION_TYPE_NAMED_PARAMETERS_TAG,
JS_FUNCTION_TYPE_OPTIONAL_PARAMETERS_TAG,
JS_FUNCTION_TYPE_REQUIRED_PARAMETERS_TAG,
JS_FUNCTION_TYPE_RETURN_TYPE_TAG,
- JS_FUNCTION_TYPE_TAG,
JS_FUNCTION_TYPE_VOID_RETURN_TAG,
- JS_GET_NAME,
JS_GET_FLAG,
+ JS_GET_NAME,
JS_HAS_EQUALS,
JS_IS_INDEXABLE_FIELD_NAME,
JS_NULL_CLASS_NAME,
@@ -93,6 +92,52 @@
abstract class InternalMap {
}
+/// Returns true if the given [type] is a function type object.
+// TODO(floitsch): move this to foreign_helper.dart or similar.
+@ForceInline()
+bool isDartFunctionType(Object type) {
+ return JS_BUILTIN('returns:bool;effects:none;depends:none',
+ JsBuiltin.isFunctionType, type);
+}
+
+
+/// Creates a function type object.
+// TODO(floitsch): move this to foreign_helper.dart or similar.
+@ForceInline()
+createDartFunctionType() {
+ return JS_BUILTIN('returns:=Object;effects:none;depends:none',
+ JsBuiltin.createFunctionType);
+}
+
+/// Returns true if the given [type] is _the_ `Function` type.
+// TODO(floitsch): move this to foreign_helper.dart or similar.
+@ForceInline()
+bool isDartFunctionTypeLiteral(Object type) {
+ return JS_BUILTIN('returns:bool;effects:none;depends:none',
+ JsBuiltin.isFunctionTypeLiteral, type);
+}
+
+/// Retrieves the class name from type information stored on the constructor of
+/// [type].
+// TODO(floitsch): move this to foreign_helper.dart or similar.
+@ForceInline()
+String getDartTypeName(Object type) {
+ return JS_BUILTIN('String', JsBuiltin.typeName, type);
+}
+
+/// Returns the raw runtime type of the given object [o].
+///
+/// The argument [o] must be the interceptor for primitive types. If
+/// necessary run it through [getInterceptor] first.
+// TODO(floitsch): move this to foreign_helper.dart or similar.
+// TODO(floitsch): we should call getInterceptor ourselves, but currently
+// getInterceptor is not GVNed.
+@ForceInline()
+Object getRawRuntimeType(Object o) {
+ return JS_BUILTIN('', JsBuiltin.rawRuntimeType, o);
+}
+
+
/// No-op method that is called to inform the compiler that preambles might
/// be needed when executing the resulting JS file in a command-line
/// JS engine.
@@ -726,7 +771,7 @@
// the name out of that. If the decompiled name is a string containing an
// identifier, we use that instead of the very generic 'Object'.
var decompiled =
- JS('var', r'#.match(/^\s*function\s*(\S*)\s*\(/)[1]',
+ JS('var', r'#.match(/^\s*function\s*([\w$]*)\s*\(/)[1]',
JS('var', r'String(#.constructor)', object));
if (decompiled is String)
if (JS('bool', r'/^\w+$/.test(#)', decompiled))
@@ -1435,6 +1480,30 @@
throw new AbstractClassInstantiationError(className);
}
+// This is used in open coded for-in loops on arrays.
+//
+// checkConcurrentModificationError(a.length == startLength, a)
+//
+// is replaced in codegen by:
+//
+// a.length == startLength || throwConcurrentModificationError(a)
+//
+// TODO(sra): We would like to annotate this as @NoSideEffects() so that loops
+// with no other effects can recognize that the array length does not
+// change. However, in the usual case where the loop does have other effects,
+// that causes the length in the loop condition to be phi(startLength,a.length),
+// which causes confusion in range analysis and the insertion of a bounds check.
+@NoInline()
+checkConcurrentModificationError(sameLength, collection) {
+ if (true != sameLength) {
+ throwConcurrentModificationError(collection);
+ }
+}
+
+@NoInline()
+throwConcurrentModificationError(collection) {
+ throw new ConcurrentModificationError(collection);
+}
/**
* Helper class for building patterns recognizing native type errors.
@@ -3115,7 +3184,7 @@
}
toRti() {
- var result = JS('=Object', '{ #: "dynafunc" }', JS_FUNCTION_TYPE_TAG());
+ var result = createDartFunctionType();
if (isVoid) {
JS('', '#[#] = true', result, JS_FUNCTION_TYPE_VOID_RETURN_TAG());
} else {
@@ -3972,7 +4041,7 @@
/// An Iterable corresponding to a sync* method.
///
/// Each invocation of a sync* method will return a new instance of this class.
-class SyncStarIterable extends IterableBase {
+class SyncStarIterable extends Iterable {
// This is a function that will return a helper function that does the
// iteration of the sync*.
//
diff --git a/sdk/lib/_internal/compiler/js_lib/js_mirrors.dart b/sdk/lib/_internal/compiler/js_lib/js_mirrors.dart
index c69e159..ff7e9c5 100644
--- a/sdk/lib/_internal/compiler/js_lib/js_mirrors.dart
+++ b/sdk/lib/_internal/compiler/js_lib/js_mirrors.dart
@@ -28,7 +28,6 @@
JS_EMBEDDED_GLOBAL,
JS_GET_NAME,
JS_TYPEDEF_TAG,
- JS_FUNCTION_TYPE_TAG,
JS_FUNCTION_TYPE_RETURN_TYPE_TAG,
JS_FUNCTION_TYPE_VOID_RETURN_TAG,
JS_FUNCTION_TYPE_REQUIRED_PARAMETERS_TAG,
@@ -57,6 +56,7 @@
getMetadata,
getType,
getRuntimeType,
+ isDartFunctionType,
runtimeTypeToString,
setRuntimeTypeInfo,
throwInvalidReflectionError,
@@ -2855,12 +2855,10 @@
getMangledTypeName(createRuntimeType(representation)));
}
String typedefPropertyName = JS_TYPEDEF_TAG();
- String functionTagPropertyName = JS_FUNCTION_TYPE_TAG();
if (type != null && JS('', '#[#]', type, typedefPropertyName) != null) {
return typeMirrorFromRuntimeTypeRepresentation(
owner, JS('', '#[#]', type, typedefPropertyName));
- } else if (type != null &&
- JS('', '#[#]', type, functionTagPropertyName) != null) {
+ } else if (type != null && isDartFunctionType(type)) {
return new JsFunctionTypeMirror(type, owner);
}
return reflectClass(Function);
diff --git a/sdk/lib/_internal/compiler/js_lib/js_number.dart b/sdk/lib/_internal/compiler/js_lib/js_number.dart
index c1357e0..8ea8a03 100644
--- a/sdk/lib/_internal/compiler/js_lib/js_number.dart
+++ b/sdk/lib/_internal/compiler/js_lib/js_number.dart
@@ -57,7 +57,8 @@
return JS('num', r'# % #', this, b);
}
- num abs() => JS('num', r'Math.abs(#)', this);
+ num abs() => JS('returns:num;effects:none;depends:none;throws:never',
+ r'Math.abs(#)', this);
num get sign => this > 0 ? 1 : this < 0 ? -1 : this;
diff --git a/sdk/lib/_internal/compiler/js_lib/js_rti.dart b/sdk/lib/_internal/compiler/js_lib/js_rti.dart
index 7246aa4..ed75bc8 100644
--- a/sdk/lib/_internal/compiler/js_lib/js_rti.dart
+++ b/sdk/lib/_internal/compiler/js_lib/js_rti.dart
@@ -134,7 +134,7 @@
* of [object].
*/
String getClassName(var object) {
- return JS('String', r'#.constructor.builtin$cls', getInterceptor(object));
+ return getDartTypeName(getRawRuntimeType(getInterceptor(object)));
}
/**
@@ -144,18 +144,12 @@
*/
String getRuntimeTypeAsString(var runtimeType, {String onTypeVariable(int i)}) {
assert(isJsArray(runtimeType));
- String className = getConstructorName(getIndex(runtimeType, 0));
+ String className = getDartTypeName(getIndex(runtimeType, 0));
return '$className'
'${joinArguments(runtimeType, 1, onTypeVariable: onTypeVariable)}';
}
/**
- * Retrieves the class name from type information stored on the constructor
- * [type].
- */
-String getConstructorName(var type) => JS('String', r'#.builtin$cls', type);
-
-/**
* Returns a human-readable representation of the type representation [type].
*/
String runtimeTypeToString(var type, {String onTypeVariable(int i)}) {
@@ -166,7 +160,7 @@
return getRuntimeTypeAsString(type, onTypeVariable: onTypeVariable);
} else if (isJsFunction(type)) {
// A reference to the constructor.
- return getConstructorName(type);
+ return getDartTypeName(type);
} else if (type is int) {
if (onTypeVariable == null) {
return type.toString();
@@ -279,6 +273,10 @@
String computeTypeName(String isField, List arguments) {
// Shorten the field name to the class name and append the textual
// representation of the type arguments.
+ // TODO(floitsch): change this to:
+ // String className = JS_BUILTIN('depends:none;effects:none;returns:String',
+ // JsBuiltin.classNameFroIsCheckProperty,
+ // isField);
int prefixLength = JS_OPERATOR_IS_PREFIX().length;
return Primitives.formatType(isField.substring(prefixLength, isField.length),
arguments);
@@ -371,8 +369,8 @@
*/
bool isSupertypeOfNull(var type) {
// `null` means `dynamic`.
- return type == null || getConstructorName(type) == JS_OBJECT_CLASS_NAME()
- || getConstructorName(type) == JS_NULL_CLASS_NAME();
+ return type == null || getDartTypeName(type) == JS_OBJECT_CLASS_NAME()
+ || getDartTypeName(type) == JS_NULL_CLASS_NAME();
}
/**
@@ -389,7 +387,7 @@
// overwrite o with the interceptor below.
var rti = getRuntimeTypeInfo(o);
o = getInterceptor(o);
- var type = JS('', '#.constructor', o);
+ var type = getRawRuntimeType(o);
if (rti != null) {
// If the type has type variables (that is, `rti != null`), make a copy of
// the type arguments and insert [o] in the first position to create a
@@ -397,12 +395,9 @@
rti = JS('JSExtendableArray', '#.slice()', rti); // Make a copy.
JS('', '#.splice(0, 0, #)', rti, type); // Insert type at position 0.
type = rti;
- } else if (hasField(t, '${JS_FUNCTION_TYPE_TAG()}')) {
+ } else if (isDartFunctionType(t)) {
// Functions are treated specially and have their type information stored
// directly in the instance.
- var signatureName =
- '${JS_OPERATOR_IS_PREFIX()}_${getField(t, JS_FUNCTION_TYPE_TAG())}';
- if (hasField(o, signatureName)) return true;
var targetSignatureFunction = getField(o, '${JS_SIGNATURE_NAME()}');
if (targetSignatureFunction == null) return false;
type = invokeOn(targetSignatureFunction, o, null);
@@ -449,12 +444,12 @@
if (isIdentical(s, t)) return true;
// If either type is dynamic, [s] is a subtype of [t].
if (s == null || t == null) return true;
- if (hasField(t, '${JS_FUNCTION_TYPE_TAG()}')) {
+ if (isDartFunctionType(t)) {
return isFunctionSubtype(s, t);
}
// Check function types against the Function class.
- if (hasField(s, '${JS_FUNCTION_TYPE_TAG()}')) {
- return getConstructorName(t) == JS_FUNCTION_CLASS_NAME();
+ if (isDartFunctionType(s)) {
+ return isDartFunctionTypeLiteral(t);
}
// Get the object describing the class and check for the subtyping flag
@@ -466,6 +461,12 @@
// Get the necessary substitution of the type arguments, if there is one.
var substitution;
if (isNotIdentical(typeOfT, typeOfS)) {
+ // TODO(floitsch): change this to:
+ // if (!JS_BUILTIN('depends:none;effects:none;returns:bool',
+ // JsBuiltin.implementsType,
+ // typeOfSPrototype, name)) {
+ // return false;
+ // }
var test = '${JS_OPERATOR_IS_PREFIX()}${name}';
var typeOfSPrototype = JS('', '#.prototype', typeOfS);
if (hasNoField(typeOfSPrototype, test)) return false;
@@ -539,8 +540,8 @@
}
bool isFunctionSubtype(var s, var t) {
- assert(hasField(t, '${JS_FUNCTION_TYPE_TAG()}'));
- if (hasNoField(s, '${JS_FUNCTION_TYPE_TAG()}')) return false;
+ assert(isDartFunctionType(t));
+ if (!isDartFunctionType(s)) return false;
if (hasField(s, '${JS_FUNCTION_TYPE_VOID_RETURN_TAG()}')) {
if (hasNoField(t, '${JS_FUNCTION_TYPE_VOID_RETURN_TAG()}') &&
hasField(t, '${JS_FUNCTION_TYPE_RETURN_TYPE_TAG()}')) {
diff --git a/sdk/lib/_internal/compiler/js_lib/js_string.dart b/sdk/lib/_internal/compiler/js_lib/js_string.dart
index 84e0ac0..43f9380 100644
--- a/sdk/lib/_internal/compiler/js_lib/js_string.dart
+++ b/sdk/lib/_internal/compiler/js_lib/js_string.dart
@@ -159,11 +159,15 @@
}
String toLowerCase() {
- return JS('String', r'#.toLowerCase()', this);
+ return JS(
+ 'returns:String;effects:none;depends:none;throws:null(1)',
+ r'#.toLowerCase()', this);
}
String toUpperCase() {
- return JS('String', r'#.toUpperCase()', this);
+ return JS(
+ 'returns:String;effects:none;depends:none;throws:null(1)',
+ r'#.toUpperCase()', this);
}
// Characters with Whitespace property (Unicode 6.2).
@@ -434,7 +438,7 @@
int compareTo(String other) {
if (other is !String) throw new ArgumentError(other);
return this == other ? 0
- : JS('bool', r'# < #', this, other) ? -1 : 1;
+ : JS('bool', r'# < #', this, other) ? -1 : 1;
}
// Note: if you change this, also change the function [S].
diff --git a/sdk/lib/_internal/compiler/js_lib/linked_hash_map.dart b/sdk/lib/_internal/compiler/js_lib/linked_hash_map.dart
index f543e74..bbf76d3 100644
--- a/sdk/lib/_internal/compiler/js_lib/linked_hash_map.dart
+++ b/sdk/lib/_internal/compiler/js_lib/linked_hash_map.dart
@@ -7,6 +7,8 @@
part of _js_helper;
+const _USE_ES6_MAPS = const bool.fromEnvironment("dart2js.use.es6.maps");
+
class JsLinkedHashMap<K, V> implements LinkedHashMap<K, V>, InternalMap {
int _length = 0;
@@ -32,8 +34,20 @@
// iterated over.
int _modifications = 0;
+ static bool get _supportsEs6Maps {
+ return JS('returns:bool;depends:none;effects:none;throws:never;gvn:true',
+ 'typeof Map != "undefined"');
+ }
+
JsLinkedHashMap();
+ /// If ES6 Maps are available returns a linked hash-map backed by an ES6 Map.
+ @ForceInline()
+ factory JsLinkedHashMap.es6() {
+ return (_USE_ES6_MAPS && JsLinkedHashMap._supportsEs6Maps)
+ ? new Es6LinkedHashMap<K, V>()
+ : new JsLinkedHashMap<K, V>();
+ }
int get length => _length;
bool get isEmpty => _length == 0;
@@ -51,13 +65,11 @@
if (_isStringKey(key)) {
var strings = _strings;
if (strings == null) return false;
- LinkedHashMapCell cell = _getTableEntry(strings, key);
- return cell != null;
+ return _containsTableEntry(strings, key);
} else if (_isNumericKey(key)) {
var nums = _nums;
if (nums == null) return false;
- LinkedHashMapCell cell = _getTableEntry(nums, key);
- return cell != null;
+ return _containsTableEntry(nums, key);
} else {
return internalContainsKey(key);
}
@@ -124,7 +136,7 @@
var rest = _rest;
if (rest == null) _rest = rest = _newHashTable();
var hash = internalComputeHashCode(key);
- var bucket = JS('var', '#[#]', rest, hash);
+ var bucket = _getTableEntry(rest, hash);
if (bucket == null) {
LinkedHashMapCell cell = _newLinkedCell(key, value);
_setTableEntry(rest, hash, JS('var', '[#]', cell));
@@ -253,7 +265,7 @@
}
static bool _isStringKey(var key) {
- return key is String && key != '__proto__';
+ return key is String;
}
static bool _isNumericKey(var key) {
@@ -270,22 +282,9 @@
return JS('int', '# & 0x3ffffff', key.hashCode);
}
- static _getTableEntry(var table, var key) {
- return JS('var', '#[#]', table, key);
- }
-
- static void _setTableEntry(var table, var key, var value) {
- assert(value != null);
- JS('void', '#[#] = #', table, key, value);
- }
-
- static void _deleteTableEntry(var table, var key) {
- JS('void', 'delete #[#]', table, key);
- }
-
List _getBucket(var table, var key) {
var hash = internalComputeHashCode(key);
- return JS('var', '#[#]', table, hash);
+ return _getTableEntry(table, hash);
}
int internalFindBucketIndex(var bucket, var key) {
@@ -298,7 +297,27 @@
return -1;
}
- static _newHashTable() {
+ String toString() => Maps.mapToString(this);
+
+ _getTableEntry(var table, var key) {
+ return JS('var', '#[#]', table, key);
+ }
+
+ void _setTableEntry(var table, var key, var value) {
+ assert(value != null);
+ JS('void', '#[#] = #', table, key, value);
+ }
+
+ void _deleteTableEntry(var table, var key) {
+ JS('void', 'delete #[#]', table, key);
+ }
+
+ bool _containsTableEntry(var table, var key) {
+ LinkedHashMapCell cell = _getTableEntry(table, key);
+ return cell != null;
+ }
+
+ _newHashTable() {
// Create a new JavaScript object to be used as a hash table. Use
// Object.create to avoid the properties on Object.prototype
// showing up as entries.
@@ -310,8 +329,34 @@
_deleteTableEntry(table, temporaryKey);
return table;
}
+}
- String toString() => Maps.mapToString(this);
+class Es6LinkedHashMap<K, V> extends JsLinkedHashMap<K, V> {
+
+ @override
+ _getTableEntry(var table, var key) {
+ return JS('var', '#.get(#)', table, key);
+ }
+
+ @override
+ void _setTableEntry(var table, var key, var value) {
+ JS('void', '#.set(#, #)', table, key, value);
+ }
+
+ @override
+ void _deleteTableEntry(var table, var key) {
+ JS('void', '#.delete(#)', table, key);
+ }
+
+ @override
+ bool _containsTableEntry(var table, var key) {
+ return JS('bool', '#.has(#)', table, key);
+ }
+
+ @override
+ _newHashTable() {
+ return JS('var', 'new Map()');
+ }
}
class LinkedHashMapCell {
@@ -324,7 +369,7 @@
LinkedHashMapCell(this.hashMapCellKey, this.hashMapCellValue);
}
-class LinkedHashMapKeyIterable<E> extends IterableBase<E>
+class LinkedHashMapKeyIterable<E> extends Iterable<E>
implements EfficientLength {
final _map;
LinkedHashMapKeyIterable(this._map);
diff --git a/sdk/lib/_internal/compiler/js_lib/native_helper.dart b/sdk/lib/_internal/compiler/js_lib/native_helper.dart
index bec5bba..82f97f5 100644
--- a/sdk/lib/_internal/compiler/js_lib/native_helper.dart
+++ b/sdk/lib/_internal/compiler/js_lib/native_helper.dart
@@ -91,7 +91,10 @@
// Is [obj] an instance of a Dart-defined class?
bool isDartObject(obj) {
// Some of the extra parens here are necessary.
- return JS('bool', '((#) instanceof (#))', obj, JS_DART_OBJECT_CONSTRUCTOR());
+ return JS('bool', '((#) instanceof (#))',
+ obj,
+ JS_BUILTIN('depends:none;effects:none;',
+ JsBuiltin.dartObjectConstructor));
}
/**
diff --git a/sdk/lib/_internal/compiler/js_lib/shared/embedded_names.dart b/sdk/lib/_internal/compiler/js_lib/shared/embedded_names.dart
index dff276d..8976873 100644
--- a/sdk/lib/_internal/compiler/js_lib/shared/embedded_names.dart
+++ b/sdk/lib/_internal/compiler/js_lib/shared/embedded_names.dart
@@ -87,3 +87,41 @@
CALL_NAME_PROPERTY,
DEFERRED_ACTION_PROPERTY
}
+
+enum JsBuiltin {
+ /// Returns the JavaScript constructor function for Dart's Object class.
+ /// This can be used for type tests, as in
+ ///
+ /// var constructor = JS_BUILTIN('', JsBuiltin.dartObjectContructor);
+ /// if (JS('bool', '# instanceof #', obj, constructor))
+ /// ...
+ dartObjectConstructor,
+
+ /// Returns true if the given type is a function type. Returns false for
+ /// the one `Function` type singleton. (See [isFunctionTypeSingleton]).
+ ///
+ /// JS_BUILTIN('bool', JsBuiltin.isFunctionType, o)
+ isFunctionType,
+
+ /// Returns true if the given type is the `Function` type literal.
+ ///
+ /// JS_BUILTIN('returns:bool;effects:none;depends:none',
+ /// JsBuiltin.isFunctionTypeLiteral, type);
+ isFunctionTypeLiteral,
+
+ /// Returns a new function type object.
+ ///
+ /// JS_BUILTIN('=Object', JsBuiltin.createFunctionType)
+ createFunctionType,
+
+ /// Returns the class name of the given type.
+ ///
+ /// JS_BUILTIN('String', JsBuiltin.typeName, type)
+ typeName,
+
+ /// Returns the raw runtime type of the given object. The given argument
+ /// [o] should be the interceptor (for non-Dart objects).
+ ///
+ /// JS_BUILTIN('', JsBuiltin.rawRuntimeType, o)
+ rawRuntimeType,
+}
diff --git a/sdk/lib/_internal/pub/lib/src/ascii_tree.dart b/sdk/lib/_internal/pub/lib/src/ascii_tree.dart
index d197df1..015a6e2 100644
--- a/sdk/lib/_internal/pub/lib/src/ascii_tree.dart
+++ b/sdk/lib/_internal/pub/lib/src/ascii_tree.dart
@@ -65,7 +65,6 @@
var root = {};
for (var file in files) {
if (baseDir != null) file = path.relative(file, from: baseDir);
- var parts = path.split(file);
var directory = root;
for (var part in path.split(file)) {
directory = directory.putIfAbsent(part, () => {});
diff --git a/sdk/lib/_internal/pub/lib/src/barback/asset_environment.dart b/sdk/lib/_internal/pub/lib/src/barback/asset_environment.dart
index c07d860..bfd97b3 100644
--- a/sdk/lib/_internal/pub/lib/src/barback/asset_environment.dart
+++ b/sdk/lib/_internal/pub/lib/src/barback/asset_environment.dart
@@ -18,7 +18,6 @@
import '../log.dart' as log;
import '../package.dart';
import '../package_graph.dart';
-import '../sdk.dart' as sdk;
import '../source/cached.dart';
import '../utils.dart';
import 'admin_server.dart';
@@ -60,15 +59,19 @@
/// entrypoints are loaded. Each entrypoint is expected to refer to a Dart
/// library.
///
+ /// If [environmentConstants] is passed, the constants it defines are passed
+ /// on to the built-in dart2js transformer.
+ ///
/// Returns a [Future] that completes to the environment once the inputs,
/// transformers, and server are loaded and ready.
static Future<AssetEnvironment> create(Entrypoint entrypoint,
BarbackMode mode, {WatcherType watcherType, String hostname, int basePort,
Iterable<String> packages, Iterable<AssetId> entrypoints,
- bool useDart2JS: true}) {
+ Map<String, String> environmentConstants, bool useDart2JS: true}) {
if (watcherType == null) watcherType = WatcherType.NONE;
if (hostname == null) hostname = "localhost";
if (basePort == null) basePort = 0;
+ if (environmentConstants == null) environmentConstants = {};
return log.progress("Loading asset environment", () async {
var graph = await entrypoint.loadPackageGraph();
@@ -77,7 +80,7 @@
barback.log.listen(_log);
var environment = new AssetEnvironment._(graph, barback, mode,
- watcherType, hostname, basePort);
+ watcherType, hostname, basePort, environmentConstants);
await environment._load(entrypoints: entrypoints, useDart2JS: useDart2JS);
return environment;
@@ -125,6 +128,9 @@
/// The mode to run the transformers in.
final BarbackMode mode;
+ /// Constants to passed to the built-in dart2js transformer.
+ final Map<String, String> environmentConstants;
+
/// The [Transformer]s that should be appended by default to the root
/// package's transformer cascade. Will be empty if there are none.
final _builtInTransformers = <Transformer>[];
@@ -158,7 +164,8 @@
Set<AssetId> _modifiedSources;
AssetEnvironment._(this.graph, this.barback, this.mode,
- this._watcherType, this._hostname, this._basePort);
+ this._watcherType, this._hostname, this._basePort,
+ this.environmentConstants);
/// Gets the built-in [Transformer]s that should be added to [package].
///
@@ -268,7 +275,6 @@
log.fine("Executables for $packageName: $executableIds");
if (executableIds.isEmpty) return {};
- var package = graph.packages[packageName];
var server = await servePackageBinDirectory(packageName);
try {
var precompiled = {};
@@ -469,7 +475,7 @@
if (!containsDart2JS && useDart2JS) {
_builtInTransformers.addAll([
new Dart2JSTransformer(this, mode),
- new DartForwardingTransformer(mode)
+ new DartForwardingTransformer()
]);
}
diff --git a/sdk/lib/_internal/pub/lib/src/barback/dart2js_transformer.dart b/sdk/lib/_internal/pub/lib/src/barback/dart2js_transformer.dart
index 8c7ff14..8bb1527 100644
--- a/sdk/lib/_internal/pub/lib/src/barback/dart2js_transformer.dart
+++ b/sdk/lib/_internal/pub/lib/src/barback/dart2js_transformer.dart
@@ -106,7 +106,7 @@
var parsed = parseCompilationUnit(code, name: name);
return dart.isEntrypoint(parsed);
- } on AnalyzerErrorGroup catch (e) {
+ } on AnalyzerErrorGroup {
// If we get a parse error, consider the asset primary so we report
// dart2js's more detailed error message instead.
return true;
@@ -166,13 +166,15 @@
/// Parses and returns the "environment" configuration option.
Map<String, String> get _configEnvironment {
- if (!_settings.configuration.containsKey('environment')) return null;
+ if (!_settings.configuration.containsKey('environment')) {
+ return _environment.environmentConstants;
+ }
var environment = _settings.configuration['environment'];
if (environment is Map &&
environment.keys.every((key) => key is String) &&
environment.values.every((key) => key is String)) {
- return environment;
+ return mergeMaps(environment, _environment.environmentConstants);
}
throw new FormatException('Invalid value for \$dart2js.environment: '
diff --git a/sdk/lib/_internal/pub/lib/src/barback/dart_forwarding_transformer.dart b/sdk/lib/_internal/pub/lib/src/barback/dart_forwarding_transformer.dart
index d112924..210f882 100644
--- a/sdk/lib/_internal/pub/lib/src/barback/dart_forwarding_transformer.dart
+++ b/sdk/lib/_internal/pub/lib/src/barback/dart_forwarding_transformer.dart
@@ -17,10 +17,7 @@
/// parallel to make sure the original Dart file is still available for use by
/// Dartium.
class DartForwardingTransformer extends Transformer {
- /// The mode that the transformer is running in.
- final BarbackMode _mode;
-
- DartForwardingTransformer(this._mode);
+ DartForwardingTransformer();
String get allowedExtensions => ".dart";
diff --git a/sdk/lib/_internal/pub/lib/src/barback/dependency_computer.dart b/sdk/lib/_internal/pub/lib/src/barback/dependency_computer.dart
index dfca127..9e46b46 100644
--- a/sdk/lib/_internal/pub/lib/src/barback/dependency_computer.dart
+++ b/sdk/lib/_internal/pub/lib/src/barback/dependency_computer.dart
@@ -11,6 +11,7 @@
import '../io.dart';
import '../package.dart';
import '../package_graph.dart';
+import '../pubspec.dart';
import '../utils.dart';
import 'cycle_exception.dart';
import 'transformer_config.dart';
@@ -104,6 +105,17 @@
/// loaded.
Set<TransformerId> _transformersNeededByTransformer(TransformerId id) {
if (id.isBuiltInTransformer) return new Set();
+
+ if (!_graph.packages.containsKey(id.package)) {
+ // Throw this here rather than during pubspec parsing because by the time
+ // we're here, we're sure that the package is actually transforming public
+ // assets and that being unable to load it will be a problem.
+ throw new PubspecException(
+ 'Error loading transformer "$id": package "${id.package}" is not '
+ 'a dependency.',
+ id.span);
+ }
+
_loadPackageComputer(id.package);
return _packageComputers[id.package]._transformersNeededByTransformer(id);
}
diff --git a/sdk/lib/_internal/pub/lib/src/command/build.dart b/sdk/lib/_internal/pub/lib/src/command/build.dart
index 1a88922..b07cd95 100644
--- a/sdk/lib/_internal/pub/lib/src/command/build.dart
+++ b/sdk/lib/_internal/pub/lib/src/command/build.dart
@@ -35,6 +35,10 @@
int builtFiles = 0;
BuildCommand() {
+ argParser.addOption("define", abbr: "D",
+ help: "Defines an environment constant for dart2js.",
+ allowMultiple: true, splitCommas: false);
+
argParser.addOption("format",
help: "How output should be displayed.",
allowed: ["text", "json"], defaultsTo: "text");
@@ -50,10 +54,16 @@
var errorsJson = [];
var logJson = [];
+ var environmentConstants = new Map.fromIterable(argResults["define"],
+ key: (pair) => pair.split("=").first,
+ value: (pair) => pair.split("=").last);
+
// Since this server will only be hit by the transformer loader and isn't
// user-facing, just use an IPv4 address to avoid a weird bug on the
// OS X buildbots.
- return AssetEnvironment.create(entrypoint, mode, useDart2JS: true)
+ return AssetEnvironment.create(entrypoint, mode,
+ environmentConstants: environmentConstants,
+ useDart2JS: true)
.then((environment) {
// Show in-progress errors, but not results. Those get handled
// implicitly by getAllAssets().
diff --git a/sdk/lib/_internal/pub/lib/src/command/global_deactivate.dart b/sdk/lib/_internal/pub/lib/src/command/global_deactivate.dart
index 595f6ff..e64f722 100644
--- a/sdk/lib/_internal/pub/lib/src/command/global_deactivate.dart
+++ b/sdk/lib/_internal/pub/lib/src/command/global_deactivate.dart
@@ -4,8 +4,6 @@
library pub.command.global_deactivate;
-import 'dart:async';
-
import '../command.dart';
import '../log.dart' as log;
import '../utils.dart';
diff --git a/sdk/lib/_internal/pub/lib/src/command/global_list.dart b/sdk/lib/_internal/pub/lib/src/command/global_list.dart
index 1de1073..7a05bb0 100644
--- a/sdk/lib/_internal/pub/lib/src/command/global_list.dart
+++ b/sdk/lib/_internal/pub/lib/src/command/global_list.dart
@@ -4,8 +4,6 @@
library pub.command.global_list;
-import 'dart:async';
-
import '../command.dart';
/// Handles the `global list` pub command.
diff --git a/sdk/lib/_internal/pub/lib/src/command/serve.dart b/sdk/lib/_internal/pub/lib/src/command/serve.dart
index 32074fc..d7e9de5 100644
--- a/sdk/lib/_internal/pub/lib/src/command/serve.dart
+++ b/sdk/lib/_internal/pub/lib/src/command/serve.dart
@@ -10,7 +10,6 @@
import 'package:barback/barback.dart';
import '../barback/asset_environment.dart';
-import '../barback/pub_package_provider.dart';
import '../log.dart' as log;
import '../utils.dart';
import 'barback.dart';
@@ -27,8 +26,6 @@
String get invocation => "pub serve [directories...]";
String get docUrl => "http://dartlang.org/tools/pub/cmd/pub-serve.html";
- PubPackageProvider _provider;
-
String get hostname => argResults['hostname'];
/// The base port for the servers.
@@ -59,6 +56,9 @@
final _completer = new Completer();
ServeCommand() {
+ argParser.addOption("define", abbr: "D",
+ help: "Defines an environment constant for dart2js.",
+ allowMultiple: true, splitCommas: false);
argParser.addOption('hostname', defaultsTo: 'localhost',
help: 'The hostname to listen on.');
argParser.addOption('port', defaultsTo: '8080',
@@ -88,9 +88,13 @@
var watcherType = argResults['force-poll'] ?
WatcherType.POLLING : WatcherType.AUTO;
+ var environmentConstants = new Map.fromIterable(argResults["define"],
+ key: (pair) => pair.split("=").first,
+ value: (pair) => pair.split("=").last);
+
var environment = await AssetEnvironment.create(entrypoint, mode,
watcherType: watcherType, hostname: hostname, basePort: port,
- useDart2JS: useDart2JS);
+ useDart2JS: useDart2JS, environmentConstants: environmentConstants);
var directoryLength = sourceDirectories.map((dir) => dir.length)
.reduce(math.max);
diff --git a/sdk/lib/_internal/pub/lib/src/command_runner.dart b/sdk/lib/_internal/pub/lib/src/command_runner.dart
index 287a469..96382da 100644
--- a/sdk/lib/_internal/pub/lib/src/command_runner.dart
+++ b/sdk/lib/_internal/pub/lib/src/command_runner.dart
@@ -10,7 +10,6 @@
import 'package:args/args.dart';
import 'package:args/command_runner.dart';
import 'package:http/http.dart' as http;
-import 'package:stack_trace/stack_trace.dart';
import 'command/build.dart';
import 'command/cache.dart';
diff --git a/sdk/lib/_internal/pub/lib/src/entrypoint.dart b/sdk/lib/_internal/pub/lib/src/entrypoint.dart
index d207147..e97f688 100644
--- a/sdk/lib/_internal/pub/lib/src/entrypoint.dart
+++ b/sdk/lib/_internal/pub/lib/src/entrypoint.dart
@@ -255,6 +255,20 @@
if (!sdkMatches) changed = null;
var graph = await loadPackageGraph();
+
+ // Clean out any outdated snapshots.
+ if (dirExists(binDir)) {
+ for (var entry in listDir(binDir)) {
+ if (!dirExists(entry)) continue;
+
+ var package = path.basename(entry);
+ if (!graph.packages.containsKey(package) ||
+ graph.isPackageMutable(package)) {
+ deleteEntry(entry);
+ }
+ }
+ }
+
var executables = new Map.fromIterable(root.immediateDependencies,
key: (dep) => dep.name,
value: (dep) => _executablesForPackage(graph, dep.name, changed));
@@ -319,7 +333,7 @@
return executables;
}
- // If any executables doesn't exist, precompile them regardless of what
+ // If any executables don't exist, precompile them regardless of what
// changed. Since we delete the bin directory before recompiling, we need to
// recompile all executables.
var executablesExist = executables.every((executable) =>
diff --git a/sdk/lib/_internal/pub/lib/src/global_packages.dart b/sdk/lib/_internal/pub/lib/src/global_packages.dart
index d8c7250..335cf8e 100644
--- a/sdk/lib/_internal/pub/lib/src/global_packages.dart
+++ b/sdk/lib/_internal/pub/lib/src/global_packages.dart
@@ -151,8 +151,6 @@
/// Installs the package [dep] and its dependencies into the system cache.
Future _installInCache(PackageDep dep, List<String> executables,
{bool overwriteBinStubs}) async {
- var source = cache.sources[dep.source];
-
// Create a dummy package with just [dep] so we can do resolution on it.
var root = new Package.inMemory(new Pubspec("pub global activate",
dependencies: [dep], sources: cache.sources));
@@ -255,7 +253,7 @@
log.message('Package ${log.bold(name)} is currently active at version '
'${log.bold(id.version)}.');
}
- } on IOException catch (error) {
+ } on IOException {
// If we couldn't read the lock file, it's not activated.
return null;
}
@@ -287,14 +285,14 @@
var lockFile;
try {
lockFile = new LockFile.load(lockFilePath, cache.sources);
- } on IOException catch (error) {
+ } on IOException {
var oldLockFilePath = p.join(_directory, '$name.lock');
try {
// TODO(nweiz): This looks for Dart 1.6's old lockfile location.
// Remove it when Dart 1.6 is old enough that we don't think anyone
// will have these lockfiles anymore (issue 20703).
lockFile = new LockFile.load(oldLockFilePath, cache.sources);
- } on IOException catch (error) {
+ } on IOException {
// If we couldn't read the lock file, it's not activated.
dataError("No active package ${log.bold(name)}.");
}
@@ -478,7 +476,6 @@
}
if (executables.isNotEmpty) {
- var packages = pluralize("package", executables.length);
var message = new StringBuffer("Binstubs exist for non-activated "
"packages:\n");
executables.forEach((package, executableNames) {
diff --git a/sdk/lib/_internal/pub/lib/src/http.dart b/sdk/lib/_internal/pub/lib/src/http.dart
index 3d0453a..27e90a0 100644
--- a/sdk/lib/_internal/pub/lib/src/http.dart
+++ b/sdk/lib/_internal/pub/lib/src/http.dart
@@ -53,14 +53,6 @@
request.headers[HttpHeaders.USER_AGENT] = "Dart pub ${sdk.version}";
_logRequest(request);
- // TODO(nweiz): remove this when issue 4061 is fixed.
- var stackTrace;
- try {
- throw null;
- } catch (_, localStackTrace) {
- stackTrace = localStackTrace;
- }
-
var timeoutLength = HTTP_TIMEOUT;
var timeoutString = request.headers.remove('Pub-Request-Timeout');
if (timeoutString == 'None') {
@@ -244,7 +236,7 @@
var value;
try {
value = JSON.decode(response.body);
- } on FormatException catch (e) {
+ } on FormatException {
invalidServerResponse(response);
}
if (value is! Map) invalidServerResponse(response);
diff --git a/sdk/lib/_internal/pub/lib/src/io.dart b/sdk/lib/_internal/pub/lib/src/io.dart
index d3c779b..687157a 100644
--- a/sdk/lib/_internal/pub/lib/src/io.dart
+++ b/sdk/lib/_internal/pub/lib/src/io.dart
@@ -418,7 +418,7 @@
log.io("Renaming directory $from to $to.");
try {
new Directory(from).renameSync(to);
- } on IOException catch (error) {
+ } on IOException {
// Ensure that [to] isn't left in an inconsistent state. See issue 12436.
if (entryExists(to)) deleteEntry(to);
rethrow;
@@ -1017,9 +1017,3 @@
bool get success => exitCode == exit_codes.SUCCESS;
}
-
-/// Gets a [Uri] for [uri], which can either already be one, or be a [String].
-Uri _getUri(uri) {
- if (uri is Uri) return uri;
- return Uri.parse(uri);
-}
diff --git a/sdk/lib/_internal/pub/lib/src/oauth2.dart b/sdk/lib/_internal/pub/lib/src/oauth2.dart
index 8de110c..d9f068f 100644
--- a/sdk/lib/_internal/pub/lib/src/oauth2.dart
+++ b/sdk/lib/_internal/pub/lib/src/oauth2.dart
@@ -83,7 +83,6 @@
/// re-run [fn] if a recoverable authorization error is detected.
Future withClient(SystemCache cache, Future fn(Client client)) {
return _getClient(cache).then((client) {
- var completer = new Completer();
return fn(client).whenComplete(() {
client.close();
// Be sure to save the credentials even when an error happens.
diff --git a/sdk/lib/_internal/pub/lib/src/pubspec.dart b/sdk/lib/_internal/pub/lib/src/pubspec.dart
index c772402..13cce16 100644
--- a/sdk/lib/_internal/pub/lib/src/pubspec.dart
+++ b/sdk/lib/_internal/pub/lib/src/pubspec.dart
@@ -137,7 +137,6 @@
fields.nodes['transformers'].span);
}
- var i = 0;
_transformers = transformers.nodes.map((phase) {
var phaseNodes = phase is YamlList ? phase.nodes : [phase];
return phaseNodes.map((transformerNode) {
@@ -265,10 +264,6 @@
}
yaml.nodes.forEach((key, value) {
- // Don't allow path separators or other stuff meaningful to the shell.
- validateName(name, description) {
- }
-
if (key.value is! String) {
_error('"executables" keys must be strings.', key.span);
}
@@ -556,13 +551,6 @@
/// Throws a [PubspecException] with the given message.
void _error(String message, SourceSpan span) {
- var name;
- try {
- name = this.name;
- } on PubspecException catch (_) {
- // [name] is null.
- }
-
throw new PubspecException(message, span);
}
}
diff --git a/sdk/lib/_internal/pub/lib/src/solver/backtracking_solver.dart b/sdk/lib/_internal/pub/lib/src/solver/backtracking_solver.dart
index a9b84e3..73dfd5c 100644
--- a/sdk/lib/_internal/pub/lib/src/solver/backtracking_solver.dart
+++ b/sdk/lib/_internal/pub/lib/src/solver/backtracking_solver.dart
@@ -395,7 +395,7 @@
// Don't get stuck in cycles.
if (visited.contains(package)) return;
visited.add(package);
- var depender = dependers[package].forEach(walk);
+ dependers[package].forEach(walk);
}
walk(dependency);
diff --git a/sdk/lib/_internal/pub/lib/src/solver/version_solver.dart b/sdk/lib/_internal/pub/lib/src/solver/version_solver.dart
index bc2dfb1..0a71f00 100644
--- a/sdk/lib/_internal/pub/lib/src/solver/version_solver.dart
+++ b/sdk/lib/_internal/pub/lib/src/solver/version_solver.dart
@@ -259,35 +259,6 @@
return results;
}
-
- /// This dumps the set of packages that were looked at by the solver to a
- /// JSON map whose format matches the map passed to [testResolve] in the
- /// version solver unit tests.
- ///
- /// If a real-world version solve is failing, this can be used to mirror that
- /// data to build a regression test using mock packages.
- String _debugDescribePackageGraph() {
- var packages = {};
- _pubspecs.forEach((id, pubspec) {
- var deps = {};
- packages["${id.name} ${id.version}"] = deps;
-
- for (var dep in pubspec.dependencies) {
- deps[dep.name] = dep.constraint.toString();
- }
- });
-
- // Add in the packages that we know of but didn't need their pubspecs.
- _versions.forEach((ref, versions) {
- for (var id in versions) {
- packages.putIfAbsent("${id.name} ${id.version}", () => {});
- }
- });
-
- // TODO(rnystrom): Include dev dependencies and dependency overrides.
-
- return JSON.encode(packages);
- }
}
/// A reference from a depending package to a package that it depends on.
diff --git a/sdk/lib/_internal/pub/lib/src/utils.dart b/sdk/lib/_internal/pub/lib/src/utils.dart
index 14d81a6..d0eb936 100644
--- a/sdk/lib/_internal/pub/lib/src/utils.dart
+++ b/sdk/lib/_internal/pub/lib/src/utils.dart
@@ -371,6 +371,16 @@
})).then((_) => map);
}
+/// Returns a new map with all entries in both [map1] and [map2].
+///
+/// If there are overlapping keys, [map2]'s value wins.
+Map mergeMaps(Map map1, Map map2) {
+ var result = {};
+ result.addAll(map1);
+ result.addAll(map2);
+ return result;
+}
+
/// Returns the transitive closure of [graph].
///
/// This assumes [graph] represents a graph with a vertex for each key and an
diff --git a/sdk/lib/_internal/pub/lib/src/validator/dependency.dart b/sdk/lib/_internal/pub/lib/src/validator/dependency.dart
index 88282fb..fe30ac5 100644
--- a/sdk/lib/_internal/pub/lib/src/validator/dependency.dart
+++ b/sdk/lib/_internal/pub/lib/src/validator/dependency.dart
@@ -11,7 +11,6 @@
import '../entrypoint.dart';
import '../log.dart' as log;
import '../package.dart';
-import '../utils.dart';
import '../validator.dart';
/// The range of all pub versions that don't support `^` version constraints.
diff --git a/sdk/lib/_internal/pub/lib/src/validator/license.dart b/sdk/lib/_internal/pub/lib/src/validator/license.dart
index 46ca112c..067765b 100644
--- a/sdk/lib/_internal/pub/lib/src/validator/license.dart
+++ b/sdk/lib/_internal/pub/lib/src/validator/license.dart
@@ -9,7 +9,6 @@
import 'package:path/path.dart' as path;
import '../entrypoint.dart';
-import '../utils.dart';
import '../validator.dart';
/// A validator that checks that a LICENSE-like file exists.
diff --git a/sdk/lib/_internal/pub/lib/src/validator/name.dart b/sdk/lib/_internal/pub/lib/src/validator/name.dart
index cdee078..94e2024 100644
--- a/sdk/lib/_internal/pub/lib/src/validator/name.dart
+++ b/sdk/lib/_internal/pub/lib/src/validator/name.dart
@@ -9,7 +9,6 @@
import 'package:path/path.dart' as path;
import '../entrypoint.dart';
-import '../utils.dart';
import '../validator.dart';
/// Dart reserved words, from the Dart spec.
diff --git a/sdk/lib/_internal/pub/lib/src/validator/sdk_constraint.dart b/sdk/lib/_internal/pub/lib/src/validator/sdk_constraint.dart
index e409f52..b192b05 100644
--- a/sdk/lib/_internal/pub/lib/src/validator/sdk_constraint.dart
+++ b/sdk/lib/_internal/pub/lib/src/validator/sdk_constraint.dart
@@ -6,11 +6,7 @@
import 'dart:async';
-import 'package:pub_semver/pub_semver.dart';
-
import '../entrypoint.dart';
-import '../log.dart' as log;
-import '../package.dart';
import '../validator.dart';
/// A validator that validates that a package's SDK constraint doesn't use the
diff --git a/sdk/lib/_internal/pub/test/dart2js/environment_constant_test.dart b/sdk/lib/_internal/pub/test/dart2js/environment_constant_test.dart
new file mode 100644
index 0000000..dab1260
--- /dev/null
+++ b/sdk/lib/_internal/pub/test/dart2js/environment_constant_test.dart
@@ -0,0 +1,65 @@
+// Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+import 'package:scheduled_test/scheduled_test.dart';
+
+import '../descriptor.dart' as d;
+import '../serve/utils.dart';
+import '../test_pub.dart';
+
+main() {
+ initConfig();
+ group("passes environment constants to dart2js", () {
+ setUp(() {
+ // Dart2js can take a long time to compile dart code, so we increase the
+ // timeout to cope with that.
+ currentSchedule.timeout *= 3;
+
+ d.dir(appPath, [
+ d.appPubspec(),
+ d.dir('web', [
+ d.file('file.dart',
+ 'void main() => print(const String.fromEnvironment("name"));')
+ ])
+ ]).create();
+ });
+
+ integration('from "pub build"', () {
+ schedulePub(args: ["build", "--define", "name=fblthp"],
+ output: new RegExp(r'Built 1 file to "build".'));
+
+ d.dir(appPath, [
+ d.dir('build', [
+ d.dir('web', [
+ d.matcherFile('file.dart.js', contains('fblthp')),
+ ])
+ ])
+ ]).validate();
+ });
+
+ integration('from "pub serve"', () {
+ pubServe(args: ["--define", "name=fblthp"]);
+ requestShouldSucceed("file.dart.js", contains("fblthp"));
+ endPubServe();
+ });
+
+ integration('which takes precedence over the pubspec', () {
+ d.dir(appPath, [
+ d.pubspec({
+ "name": "myapp",
+ "transformers": [
+ {"\$dart2js": {"environment": {"name": "slartibartfast"}}}
+ ]
+ })
+ ]).create();
+
+ pubServe(args: ["--define", "name=fblthp"]);
+ requestShouldSucceed("file.dart.js", allOf([
+ contains("fblthp"),
+ isNot(contains("slartibartfast"))
+ ]));
+ endPubServe();
+ });
+ });
+}
diff --git a/sdk/lib/_internal/pub/test/dart2js/source_maps_include_core_libs_in_subdirectory_test.dart b/sdk/lib/_internal/pub/test/dart2js/source_maps_include_core_libs_in_subdirectory_test.dart
index b48c99e..cedb073 100644
--- a/sdk/lib/_internal/pub/test/dart2js/source_maps_include_core_libs_in_subdirectory_test.dart
+++ b/sdk/lib/_internal/pub/test/dart2js/source_maps_include_core_libs_in_subdirectory_test.dart
@@ -15,14 +15,14 @@
// This test is a bit shaky. Since dart2js is free to inline things, it's
// not precise as to which source libraries will actually be referenced in
// the source map. But this tries to use a type in the core library
- // (StringBuffer) and validate that its source ends up in the source map.
+ // (Duration) and validate that its source ends up in the source map.
integration("Dart core libraries are available to source maps when the "
"build directory is a subdirectory", () {
d.dir(appPath, [
d.appPubspec(),
d.dir("web", [
d.dir("sub", [
- d.file("main.dart", "main() => new StringBuffer().writeAll(['s']);")
+ d.file("main.dart", "main() => new Duration().toString();")
])
])
]).create();
@@ -31,10 +31,10 @@
pubServe(args: [webSub]);
requestShouldSucceed("main.dart.js.map",
- contains(r"packages/$sdk/lib/core/string_buffer.dart"),
+ contains(r"packages/$sdk/lib/core/duration.dart"),
root: webSub);
- requestShouldSucceed(r"packages/$sdk/lib/core/string_buffer.dart",
- contains("class StringBuffer"),
+ requestShouldSucceed(r"packages/$sdk/lib/core/duration.dart",
+ contains("class Duration"),
root: webSub);
endPubServe();
diff --git a/sdk/lib/_internal/pub/test/dart2js/source_maps_include_core_libs_test.dart b/sdk/lib/_internal/pub/test/dart2js/source_maps_include_core_libs_test.dart
index b8efddd..6af59c6 100644
--- a/sdk/lib/_internal/pub/test/dart2js/source_maps_include_core_libs_test.dart
+++ b/sdk/lib/_internal/pub/test/dart2js/source_maps_include_core_libs_test.dart
@@ -13,14 +13,14 @@
// This test is a bit shaky. Since dart2js is free to inline things, it's
// not precise as to which source libraries will actually be referenced in
// the source map. But this tries to use a type in the core library
- // (StringBuffer) and validate that its source ends up in the source map.
+ // (Duration) and validate that its source ends up in the source map.
integration("Dart core libraries are available to source maps", () {
d.dir(appPath, [
d.appPubspec(),
d.dir("web", [
- d.file("main.dart", "main() => new StringBuffer().writeAll(['s']);"),
+ d.file("main.dart", "main() => new Duration().toString();"),
d.dir("sub", [
- d.file("main.dart", "main() => new StringBuffer().writeAll(['s']);")
+ d.file("main.dart", "main() => new Duration().toString();")
])
])
]).create();
@@ -33,17 +33,17 @@
d.dir("build", [
d.dir("web", [
d.matcherFile("main.dart.js.map",
- contains(r"packages/$sdk/lib/core/string_buffer.dart")),
+ contains(r"packages/$sdk/lib/core/duration.dart")),
d.dir("sub", [
d.matcherFile("main.dart.js.map",
- contains(r"../packages/$sdk/lib/core/string_buffer.dart"))
+ contains(r"../packages/$sdk/lib/core/duration.dart"))
]),
d.dir("packages", [
d.dir(r"$sdk", [
d.dir("lib", [
d.dir(r"core", [
- d.matcherFile("string_buffer.dart",
- contains("class StringBuffer"))
+ d.matcherFile("duration.dart",
+ contains("class Duration"))
])
])
])
diff --git a/sdk/lib/_internal/pub/test/run/runs_from_a_dependency_override_after_dependency_test.dart b/sdk/lib/_internal/pub/test/run/runs_from_a_dependency_override_after_dependency_test.dart
new file mode 100644
index 0000000..d30e6f4
--- /dev/null
+++ b/sdk/lib/_internal/pub/test/run/runs_from_a_dependency_override_after_dependency_test.dart
@@ -0,0 +1,54 @@
+// Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+import '../descriptor.dart' as d;
+import '../test_pub.dart';
+import '../serve/utils.dart';
+
+main() {
+ initConfig();
+ // Regression test for issue 23113
+ integration('runs a named Dart application in a dependency', () {
+ servePackages((builder) {
+ builder.serve('foo', '1.0.0', pubspec: {
+ 'name': 'foo',
+ 'version': '1.0.0'
+ }, contents: [
+ d.dir("bin", [
+ d.file("bar.dart", "main() => print('foobar');")
+ ])
+ ]);
+ });
+
+ d.dir(appPath, [
+ d.appPubspec({"foo": null})
+ ]).create();
+
+ pubGet();
+
+ var pub = pubRun(args: ["foo:bar"]);
+ pub.stdout.expect("foobar");
+ pub.shouldExit();
+
+ d.dir("foo", [
+ d.libPubspec("foo", "2.0.0"),
+ d.dir("bin", [
+ d.file("bar.dart", "main() => print('different');")
+ ])
+ ]).create();
+
+ d.dir(appPath, [
+ d.pubspec({
+ "name": "myapp",
+ "dependencies": {"foo": {"path": "../foo"}}
+ })
+ ]).create();
+
+ pubGet();
+
+ pub = pubRun(args: ["foo:bar"]);
+ pub.stdout.expect("different");
+ pub.shouldExit();
+ });
+}
diff --git a/sdk/lib/_internal/pub/test/transformer/fails_to_load_a_transform_from_a_deps_dev_dependency_test.dart b/sdk/lib/_internal/pub/test/transformer/fails_to_load_a_transform_from_a_deps_dev_dependency_test.dart
new file mode 100644
index 0000000..3008835
--- /dev/null
+++ b/sdk/lib/_internal/pub/test/transformer/fails_to_load_a_transform_from_a_deps_dev_dependency_test.dart
@@ -0,0 +1,50 @@
+// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS d.file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+library pub_tests;
+
+import 'package:scheduled_test/scheduled_test.dart';
+
+import '../../lib/src/exit_codes.dart' as exit_codes;
+import '../descriptor.dart' as d;
+import '../test_pub.dart';
+import '../serve/utils.dart';
+
+main() {
+ initConfig();
+ withBarbackVersions("any", () {
+ integration("fails to load a transform from a non-dependency", () {
+ d.dir("bar", [
+ d.pubspec({
+ "name": "bar",
+ "version": "1.0.0",
+ }),
+ d.dir("lib", [
+ d.file("transformer.dart", dartTransformer('bar')),
+ ])
+ ]).create();
+
+ d.dir("foo", [
+ d.pubspec({
+ "name": "foo",
+ "version": "1.0.0",
+ "dev_dependencies": {"bar": {"path": "../bar"}},
+ "transformers": ["bar"]
+ })
+ ]).create();
+
+ d.dir(appPath, [
+ d.pubspec({
+ "name": "myapp",
+ "dependencies": {"foo": {"path": "../foo"}}
+ })
+ ]).create();
+
+ var pub = startPubServe();
+ pub.stderr.expect(contains('Error loading transformer "bar": package '
+ '"bar" is not a dependency.'));
+ pub.shouldExit(exit_codes.DATA);
+ });
+ });
+}
diff --git a/sdk/lib/async/async_error.dart b/sdk/lib/async/async_error.dart
index 9a64085..650d503 100644
--- a/sdk/lib/async/async_error.dart
+++ b/sdk/lib/async/async_error.dart
@@ -9,7 +9,8 @@
if (errorHandler is ZoneBinaryCallback) {
return errorHandler(error, stackTrace);
} else {
- return errorHandler(error);
+ ZoneUnaryCallback unaryErrorHandler = errorHandler;
+ return unaryErrorHandler(error);
}
}
diff --git a/sdk/lib/async/future.dart b/sdk/lib/async/future.dart
index 7f4050c..5d6a650 100644
--- a/sdk/lib/async/future.dart
+++ b/sdk/lib/async/future.dart
@@ -625,7 +625,7 @@
* behavior, but using a synchronous completer incorrectly can cause
* otherwise correct programs to break.
*
- * An asynchronous completer is only intended for optimizing event
+ * A synchronous completer is only intended for optimizing event
* propagation when one asynchronous event immediately triggers another.
* It should not be used unless the calls to [complete] and [completeError]
* are guaranteed to occur in places where it won't break `Future` invariants.
diff --git a/sdk/lib/async/schedule_microtask.dart b/sdk/lib/async/schedule_microtask.dart
index cc0931d..acc4036 100644
--- a/sdk/lib/async/schedule_microtask.dart
+++ b/sdk/lib/async/schedule_microtask.dart
@@ -8,8 +8,9 @@
class _AsyncCallbackEntry {
final _AsyncCallback callback;
+ final Zone zone;
_AsyncCallbackEntry next;
- _AsyncCallbackEntry(this.callback);
+ _AsyncCallbackEntry(this.callback, this.zone);
}
/** Head of single linked list of pending callbacks. */
@@ -32,24 +33,30 @@
*/
bool _isInCallbackLoop = false;
-void _asyncRunCallbackLoop() {
+void _microtaskLoop() {
while (_nextCallback != null) {
_lastPriorityCallback = null;
_AsyncCallbackEntry entry = _nextCallback;
_nextCallback = entry.next;
if (_nextCallback == null) _lastCallback = null;
+ Zone._current = entry.zone;
entry.callback();
}
}
-void _asyncRunCallback() {
+void _microtaskLoopEntry() {
_isInCallbackLoop = true;
try {
- _asyncRunCallbackLoop();
+ // Moved to separate function because try-finally prevents
+ // good optimization.
+ _microtaskLoop();
} finally {
+ Zone._current = _ROOT_ZONE;
_lastPriorityCallback = null;
_isInCallbackLoop = false;
- if (_nextCallback != null) _AsyncRun._scheduleImmediate(_asyncRunCallback);
+ if (_nextCallback != null) {
+ _AsyncRun._scheduleImmediate(_microtaskLoopEntry);
+ }
}
}
@@ -59,16 +66,13 @@
* The microtask is called after all other currently scheduled
* microtasks, but as part of the current system event.
*/
-void _scheduleAsyncCallback(callback) {
- // Optimizing a group of Timer.run callbacks to be executed in the
- // same Timer callback.
+void _scheduleAsyncCallback(_AsyncCallbackEntry newEntry) {
if (_nextCallback == null) {
- _nextCallback = _lastCallback = new _AsyncCallbackEntry(callback);
+ _nextCallback = _lastCallback = newEntry;
if (!_isInCallbackLoop) {
- _AsyncRun._scheduleImmediate(_asyncRunCallback);
+ _AsyncRun._scheduleImmediate(_microtaskLoopEntry);
}
} else {
- _AsyncCallbackEntry newEntry = new _AsyncCallbackEntry(callback);
_lastCallback.next = newEntry;
_lastCallback = newEntry;
}
@@ -79,11 +83,14 @@
*
* This callback takes priority over existing scheduled callbacks.
* It is only used internally to give higher priority to error reporting.
+ *
+ * Is always run in the root zone.
*/
void _schedulePriorityAsyncCallback(callback) {
- _AsyncCallbackEntry entry = new _AsyncCallbackEntry(callback);
+ _AsyncCallbackEntry entry =
+ new _AsyncCallbackEntry(callback, _ROOT_ZONE);
if (_nextCallback == null) {
- _scheduleAsyncCallback(callback);
+ _scheduleAsyncCallback(entry);
_lastPriorityCallback = _lastCallback;
} else if (_lastPriorityCallback == null) {
entry.next = _nextCallback;
@@ -124,12 +131,20 @@
* better asynchronous code with fewer surprises.
*/
void scheduleMicrotask(void callback()) {
- if (identical(_ROOT_ZONE, Zone.current)) {
+ _Zone currentZone = Zone.current;
+ if (identical(_ROOT_ZONE, currentZone)) {
// No need to bind the callback. We know that the root's scheduleMicrotask
// will be invoked in the root zone.
_rootScheduleMicrotask(null, null, _ROOT_ZONE, callback);
return;
}
+ _ZoneFunction implementation = currentZone._scheduleMicrotask;
+ if (identical(_ROOT_ZONE, implementation.zone) &&
+ _ROOT_ZONE.inSameErrorZone(currentZone)) {
+ _rootScheduleMicrotask(null, null, currentZone,
+ currentZone.registerCallback(callback));
+ return;
+ }
Zone.current.scheduleMicrotask(
Zone.current.bindCallback(callback, runGuarded: true));
}
diff --git a/sdk/lib/async/stream.dart b/sdk/lib/async/stream.dart
index 3e5d09e..044638d 100644
--- a/sdk/lib/async/stream.dart
+++ b/sdk/lib/async/stream.dart
@@ -935,8 +935,7 @@
_Future<T> future = new _Future<T>();
T result = null;
bool foundResult = false;
- StreamSubscription subscription;
- subscription = this.listen(
+ listen(
(T value) {
foundResult = true;
result = value;
@@ -1403,7 +1402,7 @@
/** [Stream] wrapper that only exposes the [Stream] interface. */
class StreamView<T> extends Stream<T> {
- Stream<T> _stream;
+ final Stream<T> _stream;
StreamView(this._stream);
diff --git a/sdk/lib/async/zone.dart b/sdk/lib/async/zone.dart
index de9af01..fba3dc9 100644
--- a/sdk/lib/async/zone.dart
+++ b/sdk/lib/async/zone.dart
@@ -491,93 +491,98 @@
dynamic handleUncaughtError(Zone zone, error, StackTrace stackTrace) {
_ZoneFunction implementation = _delegationTarget._handleUncaughtError;
_Zone implZone = implementation.zone;
- return (implementation.function)(
+ HandleUncaughtErrorHandler handler = implementation.function;
+ return handler(
implZone, _parentDelegate(implZone), zone, error, stackTrace);
}
dynamic run(Zone zone, f()) {
_ZoneFunction implementation = _delegationTarget._run;
_Zone implZone = implementation.zone;
- return (implementation.function)(
- implZone, _parentDelegate(implZone), zone, f);
+ RunHandler handler = implementation.function;
+ return handler(implZone, _parentDelegate(implZone), zone, f);
}
dynamic runUnary(Zone zone, f(arg), arg) {
_ZoneFunction implementation = _delegationTarget._runUnary;
_Zone implZone = implementation.zone;
- return (implementation.function)(
+ RunUnaryHandler handler = implementation.function;
+ return handler(
implZone, _parentDelegate(implZone), zone, f, arg);
}
dynamic runBinary(Zone zone, f(arg1, arg2), arg1, arg2) {
_ZoneFunction implementation = _delegationTarget._runBinary;
_Zone implZone = implementation.zone;
- return (implementation.function)(
+ RunBinaryHandler handler = implementation.function;
+ return handler(
implZone, _parentDelegate(implZone), zone, f, arg1, arg2);
}
ZoneCallback registerCallback(Zone zone, f()) {
_ZoneFunction implementation = _delegationTarget._registerCallback;
_Zone implZone = implementation.zone;
- return (implementation.function)(
- implZone, _parentDelegate(implZone), zone, f);
+ RegisterCallbackHandler handler = implementation.function;
+ return handler(implZone, _parentDelegate(implZone), zone, f);
}
ZoneUnaryCallback registerUnaryCallback(Zone zone, f(arg)) {
_ZoneFunction implementation = _delegationTarget._registerUnaryCallback;
_Zone implZone = implementation.zone;
- return (implementation.function)(
- implZone, _parentDelegate(implZone), zone, f);
+ RegisterUnaryCallbackHandler handler = implementation.function;
+ return handler(implZone, _parentDelegate(implZone), zone, f);
}
ZoneBinaryCallback registerBinaryCallback(Zone zone, f(arg1, arg2)) {
_ZoneFunction implementation = _delegationTarget._registerBinaryCallback;
_Zone implZone = implementation.zone;
- return (implementation.function)(
- implZone, _parentDelegate(implZone), zone, f);
+ RegisterBinaryCallbackHandler handler = implementation.function;
+ return handler(implZone, _parentDelegate(implZone), zone, f);
}
AsyncError errorCallback(Zone zone, Object error, StackTrace stackTrace) {
_ZoneFunction implementation = _delegationTarget._errorCallback;
_Zone implZone = implementation.zone;
if (identical(implZone, _ROOT_ZONE)) return null;
- return (implementation.function)(implZone, _parentDelegate(implZone), zone,
- error, stackTrace);
+ ErrorCallbackHandler handler = implementation.function;
+ return handler(implZone, _parentDelegate(implZone), zone,
+ error, stackTrace);
}
void scheduleMicrotask(Zone zone, f()) {
_ZoneFunction implementation = _delegationTarget._scheduleMicrotask;
_Zone implZone = implementation.zone;
- (implementation.function)(
- implZone, _parentDelegate(implZone), zone, f);
+ ScheduleMicrotaskHandler handler = implementation.function;
+ handler(implZone, _parentDelegate(implZone), zone, f);
}
Timer createTimer(Zone zone, Duration duration, void f()) {
_ZoneFunction implementation = _delegationTarget._createTimer;
_Zone implZone = implementation.zone;
- return (implementation.function)(
- implZone, _parentDelegate(implZone), zone, duration, f);
+ CreateTimerHandler handler = implementation.function;
+ return handler(implZone, _parentDelegate(implZone), zone, duration, f);
}
Timer createPeriodicTimer(Zone zone, Duration period, void f(Timer timer)) {
_ZoneFunction implementation = _delegationTarget._createPeriodicTimer;
_Zone implZone = implementation.zone;
- return (implementation.function)(
- implZone, _parentDelegate(implZone), zone, period, f);
+ CreatePeriodicTimerHandler handler = implementation.function;
+ return handler(implZone, _parentDelegate(implZone), zone, period, f);
}
void print(Zone zone, String line) {
_ZoneFunction implementation = _delegationTarget._print;
_Zone implZone = implementation.zone;
- (implementation.function)(
- implZone, _parentDelegate(implZone), zone, line);
+ PrintHandler handler = implementation.function;
+ handler(implZone, _parentDelegate(implZone), zone, line);
}
Zone fork(Zone zone, ZoneSpecification specification,
Map zoneValues) {
_ZoneFunction implementation = _delegationTarget._fork;
_Zone implZone = implementation.zone;
- return (implementation.function)(
+ ForkHandler handler = implementation.function;
+ return handler(
implZone, _parentDelegate(implZone), zone, specification, zoneValues);
}
}
@@ -776,7 +781,8 @@
_ZoneFunction implementation = this._handleUncaughtError;
assert(implementation != null);
ZoneDelegate parentDelegate = _parentDelegate(implementation.zone);
- return (implementation.function)(
+ HandleUncaughtErrorHandler handler = implementation.function;
+ return handler(
implementation.zone, parentDelegate, this, error, stackTrace);
}
@@ -784,32 +790,33 @@
_ZoneFunction implementation = this._fork;
assert(implementation != null);
ZoneDelegate parentDelegate = _parentDelegate(implementation.zone);
- return (implementation.function)(
- implementation.zone, parentDelegate, this,
- specification, zoneValues);
+ ForkHandler handler = implementation.function;
+ return handler(implementation.zone, parentDelegate, this,
+ specification, zoneValues);
}
dynamic run(f()) {
_ZoneFunction implementation = this._run;
assert(implementation != null);
ZoneDelegate parentDelegate = _parentDelegate(implementation.zone);
- return (implementation.function)(
- implementation.zone, parentDelegate, this, f);
+ RunHandler handler = implementation.function;
+ return handler(implementation.zone, parentDelegate, this, f);
}
dynamic runUnary(f(arg), arg) {
_ZoneFunction implementation = this._runUnary;
assert(implementation != null);
ZoneDelegate parentDelegate = _parentDelegate(implementation.zone);
- return (implementation.function)(
- implementation.zone, parentDelegate, this, f, arg);
+ RunUnaryHandler handler = implementation.function;
+ return handler(implementation.zone, parentDelegate, this, f, arg);
}
dynamic runBinary(f(arg1, arg2), arg1, arg2) {
_ZoneFunction implementation = this._runBinary;
assert(implementation != null);
ZoneDelegate parentDelegate = _parentDelegate(implementation.zone);
- return (implementation.function)(
+ RunBinaryHandler handler = implementation.function;
+ return handler(
implementation.zone, parentDelegate, this, f, arg1, arg2);
}
@@ -817,24 +824,24 @@
_ZoneFunction implementation = this._registerCallback;
assert(implementation != null);
ZoneDelegate parentDelegate = _parentDelegate(implementation.zone);
- return (implementation.function)(
- implementation.zone, parentDelegate, this, f);
+ RegisterCallbackHandler handler = implementation.function;
+ return handler(implementation.zone, parentDelegate, this, f);
}
ZoneUnaryCallback registerUnaryCallback(f(arg)) {
_ZoneFunction implementation = this._registerUnaryCallback;
assert(implementation != null);
ZoneDelegate parentDelegate = _parentDelegate(implementation.zone);
- return (implementation.function)(
- implementation.zone, parentDelegate, this, f);
+ RegisterUnaryCallbackHandler handler = implementation.function;
+ return handler(implementation.zone, parentDelegate, this, f);
}
ZoneBinaryCallback registerBinaryCallback(f(arg1, arg2)) {
_ZoneFunction implementation = this._registerBinaryCallback;
assert(implementation != null);
ZoneDelegate parentDelegate = _parentDelegate(implementation.zone);
- return (implementation.function)(
- implementation.zone, parentDelegate, this, f);
+ RegisterBinaryCallbackHandler handler = implementation.function;
+ return handler(implementation.zone, parentDelegate, this, f);
}
AsyncError errorCallback(Object error, StackTrace stackTrace) {
@@ -843,7 +850,8 @@
final Zone implementationZone = implementation.zone;
if (identical(implementationZone, _ROOT_ZONE)) return null;
final ZoneDelegate parentDelegate = _parentDelegate(implementationZone);
- return (implementation.function)(
+ ErrorCallbackHandler handler = implementation.function;
+ return handler(
implementationZone, parentDelegate, this, error, stackTrace);
}
@@ -851,23 +859,24 @@
_ZoneFunction implementation = this._scheduleMicrotask;
assert(implementation != null);
ZoneDelegate parentDelegate = _parentDelegate(implementation.zone);
- return (implementation.function)(
- implementation.zone, parentDelegate, this, f);
+ ScheduleMicrotaskHandler handler = implementation.function;
+ return handler(implementation.zone, parentDelegate, this, f);
}
Timer createTimer(Duration duration, void f()) {
_ZoneFunction implementation = this._createTimer;
assert(implementation != null);
ZoneDelegate parentDelegate = _parentDelegate(implementation.zone);
- return (implementation.function)(
- implementation.zone, parentDelegate, this, duration, f);
+ CreateTimerHandler handler = implementation.function;
+ return handler(implementation.zone, parentDelegate, this, duration, f);
}
Timer createPeriodicTimer(Duration duration, void f(Timer timer)) {
_ZoneFunction implementation = this._createPeriodicTimer;
assert(implementation != null);
ZoneDelegate parentDelegate = _parentDelegate(implementation.zone);
- return (implementation.function)(
+ CreatePeriodicTimerHandler handler = implementation.function;
+ return handler(
implementation.zone, parentDelegate, this, duration, f);
}
@@ -875,8 +884,8 @@
_ZoneFunction implementation = this._print;
assert(implementation != null);
ZoneDelegate parentDelegate = _parentDelegate(implementation.zone);
- return (implementation.function)(
- implementation.zone, parentDelegate, this, line);
+ PrintHandler handler = implementation.function;
+ return handler(implementation.zone, parentDelegate, this, line);
}
}
@@ -943,8 +952,10 @@
if (!identical(_ROOT_ZONE, zone)) {
bool hasErrorHandler = !_ROOT_ZONE.inSameErrorZone(zone);
f = zone.bindCallback(f, runGuarded: hasErrorHandler);
+ // Use root zone as event zone if the function is already bound.
+ zone = _ROOT_ZONE;
}
- _scheduleAsyncCallback(f);
+ _scheduleAsyncCallback(new _AsyncCallbackEntry(f, zone));
}
Timer _rootCreateTimer(Zone self, ZoneDelegate parent, Zone zone,
diff --git a/sdk/lib/collection/iterable.dart b/sdk/lib/collection/iterable.dart
index 154d19c..3290682 100644
--- a/sdk/lib/collection/iterable.dart
+++ b/sdk/lib/collection/iterable.dart
@@ -206,210 +206,9 @@
* This class implements all methods of [Iterable] except [Iterable.iterator]
* in terms of `iterator`.
*/
-abstract class IterableBase<E> implements Iterable<E> {
- // TODO(lrn): Base this on IterableMixin if there ever becomes a way
- // to combine const constructors and mixins.
+abstract class IterableBase<E> extends Iterable<E> {
const IterableBase();
- Iterable map(f(E element)) => new MappedIterable<E, dynamic>(this, f);
-
- Iterable<E> where(bool f(E element)) => new WhereIterable<E>(this, f);
-
- Iterable expand(Iterable f(E element)) =>
- new ExpandIterable<E, dynamic>(this, f);
-
- bool contains(Object element) {
- for (E e in this) {
- if (e == element) return true;
- }
- return false;
- }
-
- void forEach(void f(E element)) {
- for (E element in this) f(element);
- }
-
- E reduce(E combine(E value, E element)) {
- Iterator<E> iterator = this.iterator;
- if (!iterator.moveNext()) {
- throw IterableElementError.noElement();
- }
- E value = iterator.current;
- while (iterator.moveNext()) {
- value = combine(value, iterator.current);
- }
- return value;
- }
-
- dynamic fold(var initialValue,
- dynamic combine(var previousValue, E element)) {
- var value = initialValue;
- for (E element in this) value = combine(value, element);
- return value;
- }
-
- bool every(bool f(E element)) {
- for (E element in this) {
- if (!f(element)) return false;
- }
- return true;
- }
-
- String join([String separator = ""]) {
- Iterator<E> iterator = this.iterator;
- if (!iterator.moveNext()) return "";
- StringBuffer buffer = new StringBuffer();
- if (separator == null || separator == "") {
- do {
- buffer.write("${iterator.current}");
- } while (iterator.moveNext());
- } else {
- buffer.write("${iterator.current}");
- while (iterator.moveNext()) {
- buffer.write(separator);
- buffer.write("${iterator.current}");
- }
- }
- return buffer.toString();
- }
-
- bool any(bool f(E element)) {
- for (E element in this) {
- if (f(element)) return true;
- }
- return false;
- }
-
- List<E> toList({ bool growable: true }) =>
- new List<E>.from(this, growable: growable);
-
- Set<E> toSet() => new Set<E>.from(this);
-
- int get length {
- assert(this is! EfficientLength);
- int count = 0;
- Iterator it = iterator;
- while (it.moveNext()) {
- count++;
- }
- return count;
- }
-
- bool get isEmpty => !iterator.moveNext();
-
- bool get isNotEmpty => !isEmpty;
-
- Iterable<E> take(int n) {
- return new TakeIterable<E>(this, n);
- }
-
- Iterable<E> takeWhile(bool test(E value)) {
- return new TakeWhileIterable<E>(this, test);
- }
-
- Iterable<E> skip(int n) {
- return new SkipIterable<E>(this, n);
- }
-
- Iterable<E> skipWhile(bool test(E value)) {
- return new SkipWhileIterable<E>(this, test);
- }
-
- E get first {
- Iterator it = iterator;
- if (!it.moveNext()) {
- throw IterableElementError.noElement();
- }
- return it.current;
- }
-
- E get last {
- Iterator it = iterator;
- if (!it.moveNext()) {
- throw IterableElementError.noElement();
- }
- E result;
- do {
- result = it.current;
- } while(it.moveNext());
- return result;
- }
-
- E get single {
- Iterator it = iterator;
- if (!it.moveNext()) throw IterableElementError.noElement();
- E result = it.current;
- if (it.moveNext()) throw IterableElementError.tooMany();
- return result;
- }
-
- E firstWhere(bool test(E value), { E orElse() }) {
- for (E element in this) {
- if (test(element)) return element;
- }
- if (orElse != null) return orElse();
- throw IterableElementError.noElement();
- }
-
- E lastWhere(bool test(E value), { E orElse() }) {
- E result = null;
- bool foundMatching = false;
- for (E element in this) {
- if (test(element)) {
- result = element;
- foundMatching = true;
- }
- }
- if (foundMatching) return result;
- if (orElse != null) return orElse();
- throw IterableElementError.noElement();
- }
-
- E singleWhere(bool test(E value)) {
- E result = null;
- bool foundMatching = false;
- for (E element in this) {
- if (test(element)) {
- if (foundMatching) {
- throw IterableElementError.tooMany();
- }
- result = element;
- foundMatching = true;
- }
- }
- if (foundMatching) return result;
- throw IterableElementError.noElement();
- }
-
- E elementAt(int index) {
- if (index is! int) throw new ArgumentError.notNull("index");
- RangeError.checkNotNegative(index, "index");
- int elementIndex = 0;
- for (E element in this) {
- if (index == elementIndex) return element;
- elementIndex++;
- }
- throw new RangeError.index(index, this, "index", null, elementIndex);
- }
-
- /**
- * Returns a string representation of (some of) the elements of `this`.
- *
- * Elements are represented by their own `toString` results.
- *
- * The representation always contains the first three elements.
- * If there are less than a hundred elements in the iterable, it also
- * contains the last two elements.
- *
- * If the resulting string isn't above 80 characters, more elements are
- * included from the start of the iterable.
- *
- * The conversion may omit calling `toString` on some elements if they
- * are known to not occur in the output, and it may stop iterating after
- * a hundred elements.
- */
- String toString() => iterableToShortString(this, '(', ')');
-
/**
* Convert an `Iterable` to a string like [IterableBase.toString].
*
@@ -470,131 +269,131 @@
buffer.write(rightDelimiter);
return buffer.toString();
}
+}
- /** A set used to identify cyclic lists during toString() calls. */
- static final List _toStringVisiting = [];
+/** A set used to identify cyclic lists during toString() calls. */
+final List _toStringVisiting = [];
- /** Check if we are currently visiting `o` in a toString call. */
- static bool _isToStringVisiting(Object o) {
- for (int i = 0; i < _toStringVisiting.length; i++) {
- if (identical(o, _toStringVisiting[i])) return true;
- }
- return false;
+/** Check if we are currently visiting `o` in a toString call. */
+bool _isToStringVisiting(Object o) {
+ for (int i = 0; i < _toStringVisiting.length; i++) {
+ if (identical(o, _toStringVisiting[i])) return true;
+ }
+ return false;
+}
+
+/**
+ * Convert elments of [iterable] to strings and store them in [parts].
+ */
+void _iterablePartsToStrings(Iterable iterable, List parts) {
+ /*
+ * This is the complicated part of [iterableToShortString].
+ * It is extracted as a separate function to avoid having too much code
+ * inside the try/finally.
+ */
+ /// Try to stay below this many characters.
+ const int LENGTH_LIMIT = 80;
+ /// Always at least this many elements at the start.
+ const int HEAD_COUNT = 3;
+ /// Always at least this many elements at the end.
+ const int TAIL_COUNT = 2;
+ /// Stop iterating after this many elements. Iterables can be infinite.
+ const int MAX_COUNT = 100;
+ // Per entry length overhead. It's for ", " for all after the first entry,
+ // and for "(" and ")" for the initial entry. By pure luck, that's the same
+ // number.
+ const int OVERHEAD = 2;
+ const int ELLIPSIS_SIZE = 3; // "...".length.
+
+ int length = 0;
+ int count = 0;
+ Iterator it = iterable.iterator;
+ // Initial run of elements, at least HEAD_COUNT, and then continue until
+ // passing at most LENGTH_LIMIT characters.
+ while (length < LENGTH_LIMIT || count < HEAD_COUNT) {
+ if (!it.moveNext()) return;
+ String next = "${it.current}";
+ parts.add(next);
+ length += next.length + OVERHEAD;
+ count++;
}
- /**
- * Convert elments of [iterable] to strings and store them in [parts].
- */
- static void _iterablePartsToStrings(Iterable iterable, List parts) {
- /*
- * This is the complicated part of [iterableToShortString].
- * It is extracted as a separate function to avoid having too much code
- * inside the try/finally.
- */
- /// Try to stay below this many characters.
- const int LENGTH_LIMIT = 80;
- /// Always at least this many elements at the start.
- const int HEAD_COUNT = 3;
- /// Always at least this many elements at the end.
- const int TAIL_COUNT = 2;
- /// Stop iterating after this many elements. Iterables can be infinite.
- const int MAX_COUNT = 100;
- // Per entry length overhead. It's for ", " for all after the first entry,
- // and for "(" and ")" for the initial entry. By pure luck, that's the same
- // number.
- const int OVERHEAD = 2;
- const int ELLIPSIS_SIZE = 3; // "...".length.
+ String penultimateString;
+ String ultimateString;
- int length = 0;
- int count = 0;
- Iterator it = iterable.iterator;
- // Initial run of elements, at least HEAD_COUNT, and then continue until
- // passing at most LENGTH_LIMIT characters.
- while (length < LENGTH_LIMIT || count < HEAD_COUNT) {
- if (!it.moveNext()) return;
- String next = "${it.current}";
- parts.add(next);
- length += next.length + OVERHEAD;
- count++;
- }
-
- String penultimateString;
- String ultimateString;
-
- // Find last two elements. One or more of them may already be in the
- // parts array. Include their length in `length`.
- var penultimate = null;
- var ultimate = null;
+ // Find last two elements. One or more of them may already be in the
+ // parts array. Include their length in `length`.
+ var penultimate = null;
+ var ultimate = null;
+ if (!it.moveNext()) {
+ if (count <= HEAD_COUNT + TAIL_COUNT) return;
+ ultimateString = parts.removeLast();
+ penultimateString = parts.removeLast();
+ } else {
+ penultimate = it.current;
+ count++;
if (!it.moveNext()) {
- if (count <= HEAD_COUNT + TAIL_COUNT) return;
- ultimateString = parts.removeLast();
+ if (count <= HEAD_COUNT + 1) {
+ parts.add("$penultimate");
+ return;
+ }
+ ultimateString = "$penultimate";
penultimateString = parts.removeLast();
+ length += ultimateString.length + OVERHEAD;
} else {
- penultimate = it.current;
+ ultimate = it.current;
count++;
- if (!it.moveNext()) {
- if (count <= HEAD_COUNT + 1) {
- parts.add("$penultimate");
- return;
- }
- ultimateString = "$penultimate";
- penultimateString = parts.removeLast();
- length += ultimateString.length + OVERHEAD;
- } else {
+ // Then keep looping, keeping the last two elements in variables.
+ assert(count < MAX_COUNT);
+ while (it.moveNext()) {
+ penultimate = ultimate;
ultimate = it.current;
count++;
- // Then keep looping, keeping the last two elements in variables.
- assert(count < MAX_COUNT);
- while (it.moveNext()) {
- penultimate = ultimate;
- ultimate = it.current;
- count++;
- if (count > MAX_COUNT) {
- // If we haven't found the end before MAX_COUNT, give up.
- // This cannot happen in the code above because each entry
- // increases length by at least two, so there is no way to
- // visit more than ~40 elements before this loop.
+ if (count > MAX_COUNT) {
+ // If we haven't found the end before MAX_COUNT, give up.
+ // This cannot happen in the code above because each entry
+ // increases length by at least two, so there is no way to
+ // visit more than ~40 elements before this loop.
- // Remove any surplus elements until length, including ", ...)",
- // is at most LENGTH_LIMIT.
- while (length > LENGTH_LIMIT - ELLIPSIS_SIZE - OVERHEAD &&
- count > HEAD_COUNT) {
- length -= parts.removeLast().length + OVERHEAD;
- count--;
- }
- parts.add("...");
- return;
+ // Remove any surplus elements until length, including ", ...)",
+ // is at most LENGTH_LIMIT.
+ while (length > LENGTH_LIMIT - ELLIPSIS_SIZE - OVERHEAD &&
+ count > HEAD_COUNT) {
+ length -= parts.removeLast().length + OVERHEAD;
+ count--;
}
+ parts.add("...");
+ return;
}
- penultimateString = "$penultimate";
- ultimateString = "$ultimate";
- length +=
- ultimateString.length + penultimateString.length + 2 * OVERHEAD;
}
+ penultimateString = "$penultimate";
+ ultimateString = "$ultimate";
+ length +=
+ ultimateString.length + penultimateString.length + 2 * OVERHEAD;
}
+ }
- // If there is a gap between the initial run and the last two,
- // prepare to add an ellipsis.
- String elision = null;
- if (count > parts.length + TAIL_COUNT) {
+ // If there is a gap between the initial run and the last two,
+ // prepare to add an ellipsis.
+ String elision = null;
+ if (count > parts.length + TAIL_COUNT) {
+ elision = "...";
+ length += ELLIPSIS_SIZE + OVERHEAD;
+ }
+
+ // If the last two elements were very long, and we have more than
+ // HEAD_COUNT elements in the initial run, drop some to make room for
+ // the last two.
+ while (length > LENGTH_LIMIT && parts.length > HEAD_COUNT) {
+ length -= parts.removeLast().length + OVERHEAD;
+ if (elision == null) {
elision = "...";
length += ELLIPSIS_SIZE + OVERHEAD;
}
-
- // If the last two elements were very long, and we have more than
- // HEAD_COUNT elements in the initial run, drop some to make room for
- // the last two.
- while (length > LENGTH_LIMIT && parts.length > HEAD_COUNT) {
- length -= parts.removeLast().length + OVERHEAD;
- if (elision == null) {
- elision = "...";
- length += ELLIPSIS_SIZE + OVERHEAD;
- }
- }
- if (elision != null) {
- parts.add(elision);
- }
- parts.add(penultimateString);
- parts.add(ultimateString);
}
+ if (elision != null) {
+ parts.add(elision);
+ }
+ parts.add(penultimateString);
+ parts.add(ultimateString);
}
diff --git a/sdk/lib/collection/linked_list.dart b/sdk/lib/collection/linked_list.dart
index 5bff429..e2139c0 100644
--- a/sdk/lib/collection/linked_list.dart
+++ b/sdk/lib/collection/linked_list.dart
@@ -29,7 +29,7 @@
* and a constant time length getter.
*/
class LinkedList<E extends LinkedListEntry<E>>
- extends IterableBase<E>
+ extends Iterable<E>
implements _LinkedListLink {
int _modificationCount = 0;
diff --git a/sdk/lib/collection/maps.dart b/sdk/lib/collection/maps.dart
index c0a411d..7945e7e 100644
--- a/sdk/lib/collection/maps.dart
+++ b/sdk/lib/collection/maps.dart
@@ -111,7 +111,7 @@
* It accesses the values by iterating over the keys of the map, and using the
* map's `operator[]` to lookup the keys.
*/
-class _MapBaseValueIterable<V> extends IterableBase<V>
+class _MapBaseValueIterable<V> extends Iterable<V>
implements EfficientLength {
final Map _map;
_MapBaseValueIterable(this._map);
@@ -285,11 +285,11 @@
*/
static String mapToString(Map m) {
// Reuse the list in IterableBase for detecting toString cycles.
- if (IterableBase._isToStringVisiting(m)) { return '{...}'; }
+ if (_isToStringVisiting(m)) { return '{...}'; }
var result = new StringBuffer();
try {
- IterableBase._toStringVisiting.add(m);
+ _toStringVisiting.add(m);
result.write('{');
bool first = true;
m.forEach((k, v) {
@@ -303,8 +303,8 @@
});
result.write('}');
} finally {
- assert(identical(IterableBase._toStringVisiting.last, m));
- IterableBase._toStringVisiting.removeLast();
+ assert(identical(_toStringVisiting.last, m));
+ _toStringVisiting.removeLast();
}
return result.toString();
diff --git a/sdk/lib/collection/queue.dart b/sdk/lib/collection/queue.dart
index c2f4bd5..af8e07a 100644
--- a/sdk/lib/collection/queue.dart
+++ b/sdk/lib/collection/queue.dart
@@ -67,7 +67,7 @@
* Returns `true` if a value was removed, or `false` if the queue
* contained no element equal to [value].
*/
- bool remove(Object object);
+ bool remove(Object value);
/**
* Adds all elements of [iterable] at the end of the queue. The
@@ -256,7 +256,7 @@
*
* Allows constant time add, remove-at-ends and peek operations.
*/
-class DoubleLinkedQueue<E> extends IterableBase<E> implements Queue<E> {
+class DoubleLinkedQueue<E> extends Iterable<E> implements Queue<E> {
_DoubleLinkedQueueSentinel<E> _sentinel;
int _elementCount = 0;
@@ -440,7 +440,7 @@
*
* The structure is efficient for any queue or stack usage.
*/
-class ListQueue<E> extends IterableBase<E> implements Queue<E> {
+class ListQueue<E> extends Iterable<E> implements Queue<E> {
static const int _INITIAL_CAPACITY = 8;
List<E> _table;
int _head;
@@ -543,8 +543,8 @@
// Collection interface.
- void add(E element) {
- _add(element);
+ void add(E value) {
+ _add(value);
}
void addAll(Iterable<E> elements) {
@@ -576,10 +576,10 @@
}
}
- bool remove(Object object) {
+ bool remove(Object value) {
for (int i = _head; i != _tail; i = (i + 1) & (_table.length - 1)) {
E element = _table[i];
- if (element == object) {
+ if (element == value) {
_remove(i);
_modificationCount++;
return true;
@@ -589,7 +589,6 @@
}
void _filterWhere(bool test(E element), bool removeMatching) {
- int index = _head;
int modificationCount = _modificationCount;
int i = _head;
while (i != _tail) {
@@ -639,11 +638,11 @@
// Queue interface.
- void addLast(E element) { _add(element); }
+ void addLast(E value) { _add(value); }
- void addFirst(E element) {
+ void addFirst(E value) {
_head = (_head - 1) & (_table.length - 1);
- _table[_head] = element;
+ _table[_head] = value;
if (_head == _tail) _grow();
_modificationCount++;
}
diff --git a/sdk/lib/collection/splay_tree.dart b/sdk/lib/collection/splay_tree.dart
index b9c1994..b5fcb93 100644
--- a/sdk/lib/collection/splay_tree.dart
+++ b/sdk/lib/collection/splay_tree.dart
@@ -599,8 +599,8 @@
T _getValue(_SplayTreeNode node);
}
-class _SplayTreeKeyIterable<K> extends IterableBase<K>
- implements EfficientLength {
+class _SplayTreeKeyIterable<K> extends Iterable<K>
+ implements EfficientLength {
_SplayTree<K> _tree;
_SplayTreeKeyIterable(this._tree);
int get length => _tree._count;
@@ -617,7 +617,7 @@
}
}
-class _SplayTreeValueIterable<K, V> extends IterableBase<V>
+class _SplayTreeValueIterable<K, V> extends Iterable<V>
implements EfficientLength {
SplayTreeMap<K, V> _map;
_SplayTreeValueIterable(this._map);
diff --git a/sdk/lib/convert/ascii.dart b/sdk/lib/convert/ascii.dart
index 1caffe0..c8b5903 100644
--- a/sdk/lib/convert/ascii.dart
+++ b/sdk/lib/convert/ascii.dart
@@ -185,7 +185,6 @@
int byteCount = bytes.length;
RangeError.checkValidRange(start, end, byteCount);
if (end == null) end = byteCount;
- int length = end - start;
for (int i = start; i < end; i++) {
int byte = bytes[i];
diff --git a/sdk/lib/convert/chunked_conversion.dart b/sdk/lib/convert/chunked_conversion.dart
index c9a874c..4c962eb 100644
--- a/sdk/lib/convert/chunked_conversion.dart
+++ b/sdk/lib/convert/chunked_conversion.dart
@@ -54,15 +54,6 @@
void close() { _callback(_accumulated); }
}
-class _EventSinkAdapter<T> implements ChunkedConversionSink<T> {
- final EventSink<T> _sink;
-
- _EventSinkAdapter(this._sink);
-
- void add(T data) => _sink.add(data);
- void close() => _sink.close();
-}
-
/**
* This class converts implements the logic for a chunked conversion as a
* stream transformer.
diff --git a/sdk/lib/convert/converter.dart b/sdk/lib/convert/converter.dart
index 562f861..627e417 100644
--- a/sdk/lib/convert/converter.dart
+++ b/sdk/lib/convert/converter.dart
@@ -37,9 +37,9 @@
}
// Subclasses are encouraged to provide better types.
- Stream bind(Stream source) {
+ Stream bind(Stream stream) {
return new Stream.eventTransformed(
- source,
+ stream,
(EventSink sink) => new _ConverterStreamEventSink(this, sink));
}
}
diff --git a/sdk/lib/convert/html_escape.dart b/sdk/lib/convert/html_escape.dart
index ef4b02e..6b0a3fa 100644
--- a/sdk/lib/convert/html_escape.dart
+++ b/sdk/lib/convert/html_escape.dart
@@ -38,6 +38,9 @@
*
* All modes require escaping of `&` (ampersand) characters, and may
* enable escaping of more characters.
+ *
+ * Custom escape modes can be created using the [HtmlEscapeMode.HtmlEscapeMode]
+ * constructor.
*/
class HtmlEscapeMode {
final String _name;
@@ -74,10 +77,12 @@
* The result should not be used as the content of an unquoted
* or single-quoted attribute value.
*
- * Escapes only double quotes (`"`) but not single quotes (`'`).
+ * Escapes double quotes (`"`) but not single quotes (`'`),
+ * and escapes `<` and `>` characters because they are not allowed
+ * in strict XHTML attributes
*/
static const HtmlEscapeMode ATTRIBUTE =
- const HtmlEscapeMode._('attribute', false, true, false, false);
+ const HtmlEscapeMode._('attribute', true, true, false, false);
/**
* Escaping mode for text going into single-quoted HTML attribute values.
@@ -85,10 +90,12 @@
* The result should not be used as the content of an unquoted
* or double-quoted attribute value.
*
- * Escapes only single quotes (`'`) but not double quotes (`"`).
+ * Escapes single quotes (`'`) but not double quotes (`"`),
+ * and escapes `<` and `>` characters because they are not allowed
+ * in strict XHTML attributes
*/
static const HtmlEscapeMode SQ_ATTRIBUTE =
- const HtmlEscapeMode._('attribute', false, false, true, false);
+ const HtmlEscapeMode._('attribute', true, false, true, false);
/**
* Escaping mode for text going into HTML element content.
diff --git a/sdk/lib/convert/latin1.dart b/sdk/lib/convert/latin1.dart
index 7f7fef8..98d7ba5 100644
--- a/sdk/lib/convert/latin1.dart
+++ b/sdk/lib/convert/latin1.dart
@@ -116,6 +116,7 @@
void close() {
_sink.close();
+ _sink = null;
}
void add(List<int> source) {
@@ -132,19 +133,40 @@
}
void addSlice(List<int> source, int start, int end, bool isLast) {
- RangeError.checkValidRange(start, end, source.length);
+ end = RangeError.checkValidRange(start, end, source.length);
+ if (start == end) return;
+ if (source is! Uint8List) {
+ // List may contain value outside of the 0..255 range. If so, throw.
+ // Technically, we could excuse Uint8ClampedList as well, but it unlikely
+ // to be relevant.
+ _checkValidLatin1(source, start, end);
+ }
+ _addSliceToSink(source, start, end, isLast);
+ }
+
+ static void _checkValidLatin1(List<int> source, int start, int end) {
+ int mask = 0;
+ for (int i = start; i < end; i++) {
+ mask |= source[i];
+ }
+ if (mask >= 0 && mask <= _LATIN1_MASK) {
+ return;
+ }
+ _reportInvalidLatin1(source, start, end); // Always throws.
+ }
+
+
+ static void _reportInvalidLatin1(List<int> source, int start, int end) {
+ // Find the index of the first non-Latin-1 character code.
for (int i = start; i < end; i++) {
int char = source[i];
- if (char > _LATIN1_MASK || char < 0) {
- throw new FormatException("Source contains non-Latin-1 characters.");
+ if (char < 0 || char > _LATIN1_MASK) {
+ throw new FormatException("Source contains non-Latin-1 characters.",
+ source, i);
}
}
- if (start < end) {
- _addSliceToSink(source, start, end, isLast);
- }
- if (isLast) {
- close();
- }
+ // Unreachable - we only call the function if the loop above throws.
+ assert(false);
}
}
diff --git a/sdk/lib/convert/utf.dart b/sdk/lib/convert/utf.dart
index a58fb74..9128e61 100644
--- a/sdk/lib/convert/utf.dart
+++ b/sdk/lib/convert/utf.dart
@@ -386,8 +386,6 @@
const int _LEAD_SURROGATE_MIN = 0xD800;
const int _TAIL_SURROGATE_MIN = 0xDC00;
-bool _isSurrogate(int codeUnit) =>
- (codeUnit & _SURROGATE_MASK) == _LEAD_SURROGATE_MIN;
bool _isLeadSurrogate(int codeUnit) =>
(codeUnit & _SURROGATE_TAG_MASK) == _LEAD_SURROGATE_MIN;
bool _isTailSurrogate(int codeUnit) =>
@@ -396,7 +394,6 @@
0x10000 + ((lead & _SURROGATE_VALUE_MASK) << 10)
| (tail & _SURROGATE_VALUE_MASK);
-
/**
* Decodes UTF-8.
*
diff --git a/sdk/lib/core/date_time.dart b/sdk/lib/core/date_time.dart
index 02f7cda..1e89080 100644
--- a/sdk/lib/core/date_time.dart
+++ b/sdk/lib/core/date_time.dart
@@ -215,7 +215,8 @@
* * An optional time-zone offset part,
* possibly separated from the previous by a space.
* The time zone is either 'z' or 'Z', or it is a signed two digit hour
- * part and an optional two digit minute part.
+ * part and an optional two digit minute part. The sign must be either
+ * "+" or "-", and can not be omitted.
* The minutes may be separted from the hours by a ':'.
* Examples: "Z", "-10", "01:30", "1130".
*
@@ -262,9 +263,9 @@
* timezonemins_opt ::= <empty> | colon_opt digit{2}
*/
final RegExp re = new RegExp(
- r'^([+-]?\d{4,6})-?(\d\d)-?(\d\d)' // The day part.
- r'(?:[ T](\d\d)(?::?(\d\d)(?::?(\d\d)(.\d{1,6})?)?)?' // The time part
- r'( ?[zZ]| ?([-+])(\d\d)(?::?(\d\d))?)?)?$'); // The timezone part
+ r'^([+-]?\d{4,6})-?(\d\d)-?(\d\d)' // Day part.
+ r'(?:[ T](\d\d)(?::?(\d\d)(?::?(\d\d)(?:\.(\d{1,6}))?)?)?' // Time part.
+ r'( ?[zZ]| ?([-+])(\d\d)(?::?(\d\d))?)?)?$'); // Timezone part.
Match match = re.firstMatch(formattedString);
if (match != null) {
@@ -273,9 +274,37 @@
return int.parse(matched);
}
- double parseDoubleOrZero(String matched) {
- if (matched == null) return 0.0;
- return double.parse(matched);
+ // Parses fractional second digits of '.(\d{1,6})' into milliseconds.
+ // Uses first three digits (assumed to be zero if not there), and
+ // rounds up if fourth digit is 5 or greater.
+ // Should be equivalent to `(double.parse(".$matchd")*1000).round()`.
+ int parseMilliseconds(String matched) {
+ if (matched == null) return 0;
+ int length = matched.length;
+ assert(length >= 1);
+ assert(length <= 6);
+
+ int result = (matched.codeUnitAt(0) ^ 0x30);
+ if (length <= 3) {
+ int i = 1;
+ while (i < length) {
+ result *= 10;
+ result += matched.codeUnitAt(i) ^ 0x30;
+ i++;
+ }
+ while (i < 3) {
+ result *= 10;
+ i++;
+ }
+ return result;
+ }
+ // Parse the prefix from 0..3 without creating a new substring.
+ result = result * 10 + (matched.codeUnitAt(1) ^ 0x30);
+ result = result * 10 + (matched.codeUnitAt(2) ^ 0x30);
+ if (matched.codeUnitAt(3) >= 0x35) {
+ result += 1;
+ }
+ return result;
}
int years = int.parse(match[1]);
@@ -285,7 +314,7 @@
int minute = parseIntOrZero(match[5]);
int second = parseIntOrZero(match[6]);
bool addOneMillisecond = false;
- int millisecond = (parseDoubleOrZero(match[7]) * 1000).round();
+ int millisecond = parseMilliseconds(match[7]);
if (millisecond == 1000) {
addOneMillisecond = true;
millisecond = 999;
diff --git a/sdk/lib/core/iterable.dart b/sdk/lib/core/iterable.dart
index 00d0821..dbc8c55 100644
--- a/sdk/lib/core/iterable.dart
+++ b/sdk/lib/core/iterable.dart
@@ -145,7 +145,7 @@
* on any element where the result isn't needed.
* For example, [elementAt] may call `f` only once.
*/
- Iterable map(f(E element));
+ Iterable map(f(E element)) => new MappedIterable<E, dynamic>(this, f);
/**
* Returns a new lazy [Iterable] with all elements that satisfy the
@@ -160,7 +160,7 @@
* multiple times over the returned [Iterable] will invoke the supplied
* function [test] multiple times on the same element.
*/
- Iterable<E> where(bool test(E element));
+ Iterable<E> where(bool f(E element)) => new WhereIterable<E>(this, f);
/**
* Expands each element of this [Iterable]into zero or more elements.
@@ -171,7 +171,8 @@
* The returned [Iterable] is lazy, and calls [f] for each element
* of this every time it's iterated.
*/
- Iterable expand(Iterable f(E element));
+ Iterable expand(Iterable f(E element)) =>
+ new ExpandIterable<E, dynamic>(this, f);
/**
* Returns true if the collection contains an element equal to [element].
@@ -189,13 +190,21 @@
* Likewise the `Iterable` returned by a [Map.keys] call
* should use the same equality that the `Map` uses for keys.
*/
- bool contains(Object element);
+ bool contains(Object element) {
+ for (E e in this) {
+ if (e == element) return true;
+ }
+ return false;
+ }
+
/**
* Applies the function [f] to each element of this collection in iteration
* order.
*/
- void forEach(void f(E element));
+ void forEach(void f(E element)) {
+ for (E element in this) f(element);
+ }
/**
* Reduces a collection to a single value by iteratively combining elements
@@ -219,7 +228,17 @@
* iterable.reduce((value, element) => value + element);
*
*/
- E reduce(E combine(E value, E element));
+ E reduce(E combine(E value, E element)) {
+ Iterator<E> iterator = this.iterator;
+ if (!iterator.moveNext()) {
+ throw IterableElementError.noElement();
+ }
+ E value = iterator.current;
+ while (iterator.moveNext()) {
+ value = combine(value, iterator.current);
+ }
+ return value;
+ }
/**
* Reduces a collection to a single value by iteratively combining each
@@ -241,7 +260,11 @@
*
*/
dynamic fold(var initialValue,
- dynamic combine(var previousValue, E element));
+ dynamic combine(var previousValue, E element)) {
+ var value = initialValue;
+ for (E element in this) value = combine(value, element);
+ return value;
+ }
/**
* Checks whether every element of this iterable satisfies [test].
@@ -249,7 +272,12 @@
* Checks every element in iteration order, and returns `false` if
* any of them make [test] return `false`, otherwise returns `true`.
*/
- bool every(bool test(E element));
+ bool every(bool f(E element)) {
+ for (E element in this) {
+ if (!f(element)) return false;
+ }
+ return true;
+ }
/**
* Converts each element to a [String] and concatenates the strings.
@@ -260,18 +288,36 @@
* [separator] string interleaved between the elements.
*/
String join([String separator = ""]) {
+ Iterator<E> iterator = this.iterator;
+ if (!iterator.moveNext()) return "";
StringBuffer buffer = new StringBuffer();
- buffer.writeAll(this, separator);
+ if (separator == null || separator == "") {
+ do {
+ buffer.write("${iterator.current}");
+ } while (iterator.moveNext());
+ } else {
+ buffer.write("${iterator.current}");
+ while (iterator.moveNext()) {
+ buffer.write(separator);
+ buffer.write("${iterator.current}");
+ }
+ }
return buffer.toString();
}
+
/**
* Checks whether any element of this iterable satisfies [test].
*
* Checks every element in iteration order, and returns `true` if
* any of them make [test] return `true`, otherwise returns false.
*/
- bool any(bool test(E element));
+ bool any(bool f(E element)) {
+ for (E element in this) {
+ if (f(element)) return true;
+ }
+ return false;
+ }
/**
* Creates a [List] containing the elements of this [Iterable].
@@ -279,7 +325,8 @@
* The elements are in iteration order.
* The list is fixed-length if [growable] is false.
*/
- List<E> toList({ bool growable: true });
+ List<E> toList({ bool growable: true }) =>
+ new List<E>.from(this, growable: growable);
/**
* Creates a [Set] containing the same elements as this iterable.
@@ -290,7 +337,7 @@
* The order of the elements in the set is not guaranteed to be the same
* as for the iterable.
*/
- Set<E> toSet();
+ Set<E> toSet() => new Set<E>.from(this);
/**
* Returns the number of elements in [this].
@@ -299,23 +346,31 @@
* therefore be slow.
* Some iterables have a more efficient way to find the number of elements.
*/
- int get length;
+ int get length {
+ assert(this is! EfficientLength);
+ int count = 0;
+ Iterator it = iterator;
+ while (it.moveNext()) {
+ count++;
+ }
+ return count;
+ }
/**
* Returns `true` if there are no elements in this collection.
*
* May be computed by checking if `iterator.moveNext()` returns `false`.
*/
- bool get isEmpty;
+ bool get isEmpty => !iterator.moveNext();
/**
* Returns true if there is at least one element in this collection.
*
* May be computed by checking if `iterator.moveNext()` returns `true`.
*/
- bool get isNotEmpty;
+ bool get isNotEmpty => !isEmpty;
- /**
+ /**
* Returns a lazy iterable of the [count] first elements of this iterable.
*
* The returned `Iterable` may contain fewer than `count` elements, if `this`
@@ -326,7 +381,9 @@
*
* The `count` must not be negative.
*/
- Iterable<E> take(int count);
+ Iterable<E> take(int n) {
+ return new TakeIterable<E>(this, n);
+ }
/**
* Returns a lazy iterable of the leading elements satisfying [test].
@@ -338,7 +395,9 @@
* element is found where `test(element)` is false. At that point,
* the returned iterable stops (its `moveNext()` returns false).
*/
- Iterable<E> takeWhile(bool test(E value));
+ Iterable<E> takeWhile(bool test(E value)) {
+ return new TakeWhileIterable<E>(this, test);
+ }
/**
* Returns an Iterable that provides all but the first [count] elements.
@@ -352,7 +411,9 @@
*
* The `count` must not be negative.
*/
- Iterable<E> skip(int count);
+ Iterable<E> skip(int n) {
+ return new SkipIterable<E>(this, n);
+ }
/**
* Returns an Iterable that skips leading elements while [test] is satisfied.
@@ -366,7 +427,9 @@
* otherwise it iterates the remaining elements in their original order,
* starting with the first element for which `test(element)` returns false,
*/
- Iterable<E> skipWhile(bool test(E value));
+ Iterable<E> skipWhile(bool test(E value)) {
+ return new SkipWhileIterable<E>(this, test);
+ }
/**
* Returns the first element.
@@ -375,7 +438,13 @@
* Otherwise returs the first element in the iteration order,
* equivalent to `(iterator..moveNext())..current`.
*/
- E get first;
+ E get first {
+ Iterator it = iterator;
+ if (!it.moveNext()) {
+ throw IterableElementError.noElement();
+ }
+ return it.current;
+ }
/**
* Returns the last element.
@@ -387,14 +456,30 @@
* (for example a list can directly access the last element,
* without iterating through the previous ones).
*/
- E get last;
+ E get last {
+ Iterator it = iterator;
+ if (!it.moveNext()) {
+ throw IterableElementError.noElement();
+ }
+ E result;
+ do {
+ result = it.current;
+ } while(it.moveNext());
+ return result;
+ }
/**
* Checks that this iterable has only one element, and returns that element.
*
* Throws a [StateError] if `this` is empty or has more than one element.
*/
- E get single;
+ E get single {
+ Iterator it = iterator;
+ if (!it.moveNext()) throw IterableElementError.noElement();
+ E result = it.current;
+ if (it.moveNext()) throw IterableElementError.tooMany();
+ return result;
+ }
/**
* Returns the first element that satisfies the given predicate [test].
@@ -405,7 +490,13 @@
* function is returned.
* If [orElse] is omitted, it defaults to throwing a [StateError].
*/
- E firstWhere(bool test(E element), { E orElse() });
+ E firstWhere(bool test(E element), { E orElse() }) {
+ for (E element in this) {
+ if (test(element)) return element;
+ }
+ if (orElse != null) return orElse();
+ throw IterableElementError.noElement();
+ }
/**
* Returns the last element that satisfies the given predicate [test].
@@ -421,7 +512,19 @@
* function is returned.
* If [orElse] is omitted, it defaults to throwing a [StateError].
*/
- E lastWhere(bool test(E element), {E orElse()});
+ E lastWhere(bool test(E element), {E orElse()}) {
+ E result = null;
+ bool foundMatching = false;
+ for (E element in this) {
+ if (test(element)) {
+ result = element;
+ foundMatching = true;
+ }
+ }
+ if (foundMatching) return result;
+ if (orElse != null) return orElse();
+ throw IterableElementError.noElement();
+ }
/**
* Returns the single element that satisfies [test].
@@ -431,7 +534,21 @@
* Otherwise, if there are no matching elements, or if there is more than
* one matching element, a [StateError] is thrown.
*/
- E singleWhere(bool test(E element));
+ E singleWhere(bool test(E element)) {
+ E result = null;
+ bool foundMatching = false;
+ for (E element in this) {
+ if (test(element)) {
+ if (foundMatching) {
+ throw IterableElementError.tooMany();
+ }
+ result = element;
+ foundMatching = true;
+ }
+ }
+ if (foundMatching) return result;
+ throw IterableElementError.noElement();
+ }
/**
* Returns the [index]th element.
@@ -444,12 +561,39 @@
* first `index` elements and returning the next.
* Some iterable may have more efficient ways to find the element.
*/
- E elementAt(int index);
+ E elementAt(int index) {
+ if (index is! int) throw new ArgumentError.notNull("index");
+ RangeError.checkNotNegative(index, "index");
+ int elementIndex = 0;
+ for (E element in this) {
+ if (index == elementIndex) return element;
+ elementIndex++;
+ }
+ throw new RangeError.index(index, this, "index", null, elementIndex);
+ }
+
+ /**
+ * Returns a string representation of (some of) the elements of `this`.
+ *
+ * Elements are represented by their own `toString` results.
+ *
+ * The default representation always contains the first three elements.
+ * If there are less than a hundred elements in the iterable, it also
+ * contains the last two elements.
+ *
+ * If the resulting string isn't above 80 characters, more elements are
+ * included from the start of the iterable.
+ *
+ * The conversion may omit calling `toString` on some elements if they
+ * are known to not occur in the output, and it may stop iterating after
+ * a hundred elements.
+ */
+ String toString() => IterableBase.iterableToShortString(this, '(', ')');
}
typedef E _Generator<E>(int index);
-class _GeneratorIterable<E> extends IterableBase<E>
+class _GeneratorIterable<E> extends Iterable<E>
implements EfficientLength {
final int _start;
final int _end;
diff --git a/sdk/lib/core/list.dart b/sdk/lib/core/list.dart
index 05c4c2e..9d9a093 100644
--- a/sdk/lib/core/list.dart
+++ b/sdk/lib/core/list.dart
@@ -122,6 +122,17 @@
}
/**
+ * Creates an unmodifiable list containing all [elements].
+ *
+ * The [Iterator] of [elements] provides the order of the elements.
+ *
+ * An unmodifiable list cannot have its length or elements changed.
+ * If the elements are themselves immutable, then the resulting list
+ * is also immutable.
+ */
+ external factory List.unmodifiable(Iterable elements);
+
+ /**
* Returns the object at the given [index] in the list
* or throws a [RangeError] if [index] is out of bounds.
*/
diff --git a/sdk/lib/core/set.dart b/sdk/lib/core/set.dart
index a52fa53..2c6b524 100644
--- a/sdk/lib/core/set.dart
+++ b/sdk/lib/core/set.dart
@@ -31,7 +31,7 @@
* iterating either the set itself or any [Iterable] that is backed by the set,
* such as the ones returned by methods like [where] and [map].
*/
-abstract class Set<E> extends IterableBase<E> implements EfficientLength {
+abstract class Set<E> extends Iterable<E> implements EfficientLength {
/**
* Creates an empty [Set].
*
diff --git a/sdk/lib/core/stacktrace.dart b/sdk/lib/core/stacktrace.dart
index ef8cc4d..c8540dc 100644
--- a/sdk/lib/core/stacktrace.dart
+++ b/sdk/lib/core/stacktrace.dart
@@ -14,6 +14,22 @@
* them programmatically.
*/
abstract class StackTrace {
+ StackTrace(); // In case existing classes extend StackTrace.
+
+ /**
+ * Create a `StackTrace` object from [stackTraceString].
+ *
+ * The created stack trace will have a `toString` method returning
+ * `stackTraceString`.
+ *
+ * The `stackTraceString` can be a string returned by some other
+ * stack trace, or it can be any string at all.
+ * If the string doesn't look like a stack trace, code that interprets
+ * stack traces is likely to fail, so fake stack traces should be used
+ * with care.
+ */
+ factory StackTrace.fromString(String stackTraceString) = _StringStackTrace;
+
/**
* Returns a [String] representation of the stack trace.
*
@@ -25,3 +41,8 @@
String toString();
}
+class _StringStackTrace implements StackTrace {
+ final String _stackTrace;
+ _StringStackTrace(this._stackTrace);
+ String toString() => _stackTrace;
+}
diff --git a/sdk/lib/core/string.dart b/sdk/lib/core/string.dart
index c92ca9f..599ad0f 100644
--- a/sdk/lib/core/string.dart
+++ b/sdk/lib/core/string.dart
@@ -603,7 +603,7 @@
/**
* The runes (integer Unicode code points) of a [String].
*/
-class Runes extends IterableBase<int> {
+class Runes extends Iterable<int> {
final String string;
Runes(this.string);
diff --git a/sdk/lib/core/string_buffer.dart b/sdk/lib/core/string_buffer.dart
index e8bc72d..31b8780 100644
--- a/sdk/lib/core/string_buffer.dart
+++ b/sdk/lib/core/string_buffer.dart
@@ -37,26 +37,9 @@
/// Adds the string representation of [charCode] to the buffer.
external void writeCharCode(int charCode);
- void writeAll(Iterable objects, [String separator = ""]) {
- Iterator iterator = objects.iterator;
- if (!iterator.moveNext()) return;
- if (separator.isEmpty) {
- do {
- write(iterator.current);
- } while (iterator.moveNext());
- } else {
- write(iterator.current);
- while (iterator.moveNext()) {
- write(separator);
- write(iterator.current);
- }
- }
- }
+ external void writeAll(Iterable objects, [String separator = ""]);
- void writeln([Object obj = ""]) {
- write(obj);
- write("\n");
- }
+ external void writeln([Object obj = ""]);
/**
* Clears the string buffer.
diff --git a/sdk/lib/core/uri.dart b/sdk/lib/core/uri.dart
index 14e2d80..fee73b2 100644
--- a/sdk/lib/core/uri.dart
+++ b/sdk/lib/core/uri.dart
@@ -30,6 +30,9 @@
* Returns the scheme component.
*
* Returns the empty string if there is no scheme component.
+ *
+ * A URI scheme is case insensitive.
+ * The returned scheme is canonicalized to lowercase letters.
*/
// We represent the missing scheme as an empty string.
// A valid scheme cannot be empty.
@@ -74,6 +77,10 @@
*
* If the host is an IP version 6 address, the surrounding `[` and `]` is
* removed.
+ *
+ * The host string is case-insensitive.
+ * The returned host name is canonicalized to lower-case
+ * with upper-case percent-escapes.
*/
String get host {
if (_host == null) return "";
@@ -704,8 +711,22 @@
* If the path passed is not a legal file path [ArgumentError] is thrown.
*/
factory Uri.file(String path, {bool windows}) {
- windows = windows == null ? Uri._isWindows : windows;
- return windows ? _makeWindowsFileUrl(path) : _makeFileUri(path);
+ windows = (windows == null) ? Uri._isWindows : windows;
+ return windows ? _makeWindowsFileUrl(path, false)
+ : _makeFileUri(path, false);
+ }
+
+ /**
+ * Like [Uri.file] except that a non-empty URI path ends in a slash.
+ *
+ * If [path] is not empty, and it doesn't end in a directory separator,
+ * then a slash is added to the returned URI's path.
+ * In all other cases, the result is the same as returned by `Uri.file`.
+ */
+ factory Uri.directory(String path, {bool windows}) {
+ windows = (windows == null) ? Uri._isWindows : windows;
+ return windows ? _makeWindowsFileUrl(path, true)
+ : _makeFileUri(path, true);
}
/**
@@ -737,7 +758,7 @@
static _checkWindowsPathReservedCharacters(List<String> segments,
bool argumentError,
[int firstSegment = 0]) {
- segments.skip(firstSegment).forEach((segment) {
+ for (var segment in segments.skip(firstSegment)) {
if (segment.contains(new RegExp(r'["*/:<>?\\|]'))) {
if (argumentError) {
throw new ArgumentError("Illegal character in path");
@@ -745,7 +766,7 @@
throw new UnsupportedError("Illegal character in path");
}
}
- });
+ }
}
static _checkWindowsDriveLetter(int charCode, bool argumentError) {
@@ -762,18 +783,24 @@
}
}
- static _makeFileUri(String path) {
+ static _makeFileUri(String path, bool slashTerminated) {
const String sep = "/";
+ var segments = path.split(sep);
+ if (slashTerminated &&
+ segments.isNotEmpty &&
+ segments.last.isNotEmpty) {
+ segments.add(""); // Extra separator at end.
+ }
if (path.startsWith(sep)) {
// Absolute file:// URI.
- return new Uri(scheme: "file", pathSegments: path.split(sep));
+ return new Uri(scheme: "file", pathSegments: segments);
} else {
// Relative URI.
- return new Uri(pathSegments: path.split(sep));
+ return new Uri(pathSegments: segments);
}
}
- static _makeWindowsFileUrl(String path) {
+ static _makeWindowsFileUrl(String path, bool slashTerminated) {
if (path.startsWith(r"\\?\")) {
if (path.startsWith(r"UNC\", 4)) {
path = path.replaceRange(0, 7, r'\');
@@ -798,6 +825,10 @@
}
// Absolute file://C:/ URI.
var pathSegments = path.split(sep);
+ if (slashTerminated &&
+ pathSegments.last.isNotEmpty) {
+ pathSegments.add(""); // Extra separator at end.
+ }
_checkWindowsPathReservedCharacters(pathSegments, true, 1);
return new Uri(scheme: "file", pathSegments: pathSegments);
}
@@ -812,11 +843,19 @@
(pathStart < 0) ? "" : path.substring(pathStart + 1);
var pathSegments = pathPart.split(sep);
_checkWindowsPathReservedCharacters(pathSegments, true);
+ if (slashTerminated &&
+ pathSegments.last.isNotEmpty) {
+ pathSegments.add(""); // Extra separator at end.
+ }
return new Uri(
scheme: "file", host: hostPart, pathSegments: pathSegments);
} else {
// Absolute file:// URI.
var pathSegments = path.split(sep);
+ if (slashTerminated &&
+ pathSegments.last.isNotEmpty) {
+ pathSegments.add(""); // Extra separator at end.
+ }
_checkWindowsPathReservedCharacters(pathSegments, true);
return new Uri(scheme: "file", pathSegments: pathSegments);
}
@@ -824,6 +863,11 @@
// Relative URI.
var pathSegments = path.split(sep);
_checkWindowsPathReservedCharacters(pathSegments, true);
+ if (slashTerminated &&
+ pathSegments.isNotEmpty &&
+ pathSegments.last.isNotEmpty) {
+ pathSegments.add(""); // Extra separator at end.
+ }
return new Uri(pathSegments: pathSegments);
}
}
@@ -981,6 +1025,25 @@
return _queryParameters;
}
+ /**
+ * Returns an URI where the path has been normalized.
+ *
+ * A normalized path does not contain `.` segments or non-leading `..`
+ * segments.
+ * Only a relative path may contain leading `..` segments,
+ * a path that starts with `/` will also drop any leading `..` segments.
+ *
+ * This uses the same normalization strategy as [resolveUri], as specified by
+ * RFC 3986.
+ *
+ * Does not change any part of the URI except the path.
+ */
+ Uri normalizePath() {
+ String path = _removeDotSegments(_path);
+ if (identical(path, _path)) return this;
+ return this.replace(path: path);
+ }
+
static int _makePort(int port, String scheme) {
// Perform scheme specific normalization.
if (port != null && port == _defaultPort(scheme)) return null;
@@ -988,7 +1051,7 @@
}
/**
- * Check and normalize a most name.
+ * Check and normalize a host name.
*
* If the host name starts and ends with '[' and ']', it is considered an
* IPv6 address. If [strictIPv6] is false, the address is also considered
diff --git a/sdk/lib/html/dart2js/html_dart2js.dart b/sdk/lib/html/dart2js/html_dart2js.dart
index b767c0b..898af6c 100644
--- a/sdk/lib/html/dart2js/html_dart2js.dart
+++ b/sdk/lib/html/dart2js/html_dart2js.dart
@@ -9300,8 +9300,8 @@
@DomName('Document.getElementsByName')
@DocsEditable()
- @Returns('NodeList')
- @Creates('NodeList')
+ @Creates('NodeList|HtmlCollection')
+ @Returns('NodeList|HtmlCollection')
List<Node> getElementsByName(String elementName) native;
@DomName('Document.getElementsByTagName')
@@ -36878,16 +36878,15 @@
static bool _add(Element _element, String value) {
DomTokenList list = _classListOf(_element);
- // Compute returned result independently of action upon the set. One day we
- // will be able to optimize it way if unused.
- bool added = !_classListContains(list, value);
+ // Compute returned result independently of action upon the set.
+ bool added = !_classListContainsBeforeAddOrRemove(list, value);
_classListAdd(list, value);
return added;
}
static bool _remove(Element _element, String value) {
DomTokenList list = _classListOf(_element);
- bool removed = _classListContains(list, value);
+ bool removed = _classListContainsBeforeAddOrRemove(list, value);
_classListRemove(list, value);
return removed;
}
@@ -36961,7 +36960,17 @@
JS('returns:JSUInt31;effects:none;depends:all;', '#.length', list);
static bool _classListContains(DomTokenList list, String value) =>
- JS('returns:bool;effects:none;depends:all;',
+ JS('returns:bool;effects:none;depends:all',
+ '#.contains(#)', list, value);
+
+ static bool _classListContainsBeforeAddOrRemove(
+ DomTokenList list, String value) =>
+ // 'throws:never' is a lie, since 'contains' will throw on an illegal
+ // token. However, we always call this function immediately prior to
+ // add/remove/toggle with the same token. Often the result of 'contains'
+ // is unused and the lie makes it possible for the 'contains' instruction
+ // to be removed.
+ JS('returns:bool;effects:none;depends:all;throws:null(1)',
'#.contains(#)', list, value);
static void _classListAdd(DomTokenList list, String value) {
diff --git a/sdk/lib/internal/iterable.dart b/sdk/lib/internal/iterable.dart
index bc80b88..47c94f8 100644
--- a/sdk/lib/internal/iterable.dart
+++ b/sdk/lib/internal/iterable.dart
@@ -24,7 +24,7 @@
* All other methods are implemented in terms of [length] and [elementAt],
* including [iterator].
*/
-abstract class ListIterable<E> extends IterableBase<E>
+abstract class ListIterable<E> extends Iterable<E>
implements EfficientLength {
int get length;
E elementAt(int i);
@@ -346,7 +346,7 @@
typedef T _Transformation<S, T>(S value);
-class MappedIterable<S, T> extends IterableBase<T> {
+class MappedIterable<S, T> extends Iterable<T> {
final Iterable<S> _iterable;
final _Transformation<S, T> _f;
@@ -416,7 +416,7 @@
typedef bool _ElementPredicate<E>(E element);
-class WhereIterable<E> extends IterableBase<E> {
+class WhereIterable<E> extends Iterable<E> {
final Iterable<E> _iterable;
final _ElementPredicate _f;
@@ -445,7 +445,7 @@
typedef Iterable<T> _ExpandFunction<S, T>(S sourceElement);
-class ExpandIterable<S, T> extends IterableBase<T> {
+class ExpandIterable<S, T> extends Iterable<T> {
final Iterable<S> _iterable;
final _ExpandFunction _f;
@@ -488,7 +488,7 @@
}
}
-class TakeIterable<E> extends IterableBase<E> {
+class TakeIterable<E> extends Iterable<E> {
final Iterable<E> _iterable;
final int _takeCount;
@@ -545,7 +545,7 @@
}
}
-class TakeWhileIterable<E> extends IterableBase<E> {
+class TakeWhileIterable<E> extends Iterable<E> {
final Iterable<E> _iterable;
final _ElementPredicate _f;
@@ -578,7 +578,7 @@
}
}
-class SkipIterable<E> extends IterableBase<E> {
+class SkipIterable<E> extends Iterable<E> {
final Iterable<E> _iterable;
final int _skipCount;
@@ -638,7 +638,7 @@
E get current => _iterator.current;
}
-class SkipWhileIterable<E> extends IterableBase<E> {
+class SkipWhileIterable<E> extends Iterable<E> {
final Iterable<E> _iterable;
final _ElementPredicate _f;
@@ -672,7 +672,7 @@
/**
* The always empty [Iterable].
*/
-class EmptyIterable<E> extends IterableBase<E> implements EfficientLength {
+class EmptyIterable<E> extends Iterable<E> implements EfficientLength {
const EmptyIterable();
Iterator<E> get iterator => const EmptyIterator();
diff --git a/sdk/lib/internal/list.dart b/sdk/lib/internal/list.dart
index 6b94c6c..e642fb7 100644
--- a/sdk/lib/internal/list.dart
+++ b/sdk/lib/internal/list.dart
@@ -361,7 +361,7 @@
* That means that it is a destructive conversion.
* The original list should not be used afterwards.
*
- * The returned list may be the same list as the orginal,
+ * The returned list may be the same list as the original,
* or it may be a different list (according to [identical]).
* The original list may have changed type to be a fixed list,
* or become empty or been otherwise modified.
@@ -374,3 +374,19 @@
* state.
*/
external List makeListFixedLength(List growableList);
+
+/**
+ * Converts a fixed-length list to an unmodifiable list.
+ *
+ * For internal use only.
+ * Only works for core fixed-length lists as created by `new List(length)`,
+ * or as returned by [makeListFixedLength].
+ *
+ * The operation is efficient. It doesn't copy the elements, but converts
+ * the existing list directly to a fixed length list.
+ * That means that it is a destructive conversion.
+ * The original list should not be used afterwards.
+ *
+ * The unmodifiable list type is similar to the one used by const lists.
+ */
+external List makeFixedListUnmodifiable(List fixedLengthList);
diff --git a/sdk/lib/io/directory.dart b/sdk/lib/io/directory.dart
index eecaa68..8005726 100644
--- a/sdk/lib/io/directory.dart
+++ b/sdk/lib/io/directory.dart
@@ -44,7 +44,7 @@
* print(directory.path);
* });
* }
- *
+ *
* ## List a directory
*
* Use the [list] or [listSync] methods to get the files and directories
@@ -100,7 +100,7 @@
* ## Other resources
*
* * [Dart by Example](https://www.dartlang.org/dart-by-example/#files-directories-and-symlinks)
- * provides additional task-oriented code samples that show how to use
+ * provides additional task-oriented code samples that show how to use
* various API from the Directory class and the related [File] class.
*
* * [I/O for Command-Line Apps](https://www.dartlang.org/docs/dart-up-and-running/contents/ch03.html#ch03-dartio---file-and-socket-io-for-command-line-apps)
@@ -111,7 +111,7 @@
* a tutorial about writing command-line apps, includes information
* about files and directories.
*/
-abstract class Directory extends FileSystemEntity {
+abstract class Directory implements FileSystemEntity {
/**
* Gets the path of this directory.
*/
@@ -142,6 +142,15 @@
static Directory get current => _Directory.current;
/**
+ * Returns a [Uri] representing the directory's location.
+ *
+ * The returned URI's scheme is always "file" if the entity's [path] is
+ * absolute, otherwise the scheme will be empty.
+ * The returned URI's path always ends in a slash ('/').
+ */
+ Uri get uri;
+
+ /**
* Sets the current working directory of the Dart process including
* all running isolates. The new value set can be either a [Directory]
* or a [String].
diff --git a/sdk/lib/io/directory_impl.dart b/sdk/lib/io/directory_impl.dart
index f450cb6..620437c 100644
--- a/sdk/lib/io/directory_impl.dart
+++ b/sdk/lib/io/directory_impl.dart
@@ -43,6 +43,10 @@
}
}
+ Uri get uri {
+ return new Uri.directory(path);
+ }
+
Future<bool> exists() {
return _IOService._dispatch(_DIRECTORY_EXISTS, [path]).then((response) {
if (_isErrorResponse(response)) {
diff --git a/sdk/lib/io/file.dart b/sdk/lib/io/file.dart
index ce7fa1b..df35660 100644
--- a/sdk/lib/io/file.dart
+++ b/sdk/lib/io/file.dart
@@ -98,7 +98,7 @@
* You might want to use a stream to read large files,
* to manipulate the data with tranformers,
* or for compatibility with another API, such as [WebSocket]s.
- *
+ *
* import 'dart:io';
* import 'dart:convert';
* import 'dart:async';
@@ -136,7 +136,7 @@
* Be sure to close the file with the [close] method.
*
* import 'dart:io';
- *
+ *
* void main() {
* var file = new File('file.txt');
* var sink = file.openWrite();
@@ -158,7 +158,7 @@
*
* main() {
* final file = new File('file.txt');
- *
+ *
* file.length().then((len) {
* print(len);
* });
@@ -170,7 +170,7 @@
* ## Other resources
*
* * [Dart by Example](https://www.dartlang.org/dart-by-example/#files-directories-and-symlinks)
- * provides additional task-oriented code samples that show how to use
+ * provides additional task-oriented code samples that show how to use
* various API from the Directory class and the related [File] class.
*
* * [I/O for Command-Line Apps](https://www.dartlang.org/docs/dart-up-and-running/contents/ch03.html#ch03-dartio---file-and-socket-io-for-command-line-apps)
@@ -182,7 +182,7 @@
* about files and directories.
*/
-abstract class File extends FileSystemEntity {
+abstract class File implements FileSystemEntity {
/**
* Creates a [File] object.
*
diff --git a/sdk/lib/io/file_system_entity.dart b/sdk/lib/io/file_system_entity.dart
index 642a063..7e8b0dd 100644
--- a/sdk/lib/io/file_system_entity.dart
+++ b/sdk/lib/io/file_system_entity.dart
@@ -198,7 +198,7 @@
* ## Other resources
*
* [Dart by Example](https://www.dartlang.org/dart-by-example/#files-directories-and-symlinks)
- * provides additional task-oriented code samples that show how to use
+ * provides additional task-oriented code samples that show how to use
* various API from the [Directory] class and the [File] class,
* both subclasses of FileSystemEntity.
*
@@ -215,6 +215,14 @@
String get path;
/**
+ * Returns a [Uri] representing the file system entity's location.
+ *
+ * The returned URI's scheme is always "file" if the entity's [path] is
+ * absolute, otherwise the scheme will be empty.
+ */
+ Uri get uri => new Uri.file(path);
+
+ /**
* Checks whether the file system entity with this path exists. Returns
* a [:Future<bool>:] that completes with the result.
*
diff --git a/sdk/lib/io/http.dart b/sdk/lib/io/http.dart
index 101a2d6..4bc5448 100644
--- a/sdk/lib/io/http.dart
+++ b/sdk/lib/io/http.dart
@@ -1797,7 +1797,7 @@
/**
* HTTP response for a client connection.
-
+ *
* The body of a [HttpClientResponse] object is a
* [Stream] of data from the server. Listen to the body to handle
* the data and be notified when the entire body is received.
diff --git a/sdk/lib/io/link.dart b/sdk/lib/io/link.dart
index 042ef36..25be38c 100644
--- a/sdk/lib/io/link.dart
+++ b/sdk/lib/io/link.dart
@@ -8,7 +8,7 @@
* [Link] objects are references to filesystem links.
*
*/
-abstract class Link extends FileSystemEntity {
+abstract class Link implements FileSystemEntity {
/**
* Creates a Link object.
*/
diff --git a/sdk/lib/isolate/isolate.dart b/sdk/lib/isolate/isolate.dart
index 35d2a8b..cbea21b 100644
--- a/sdk/lib/isolate/isolate.dart
+++ b/sdk/lib/isolate/isolate.dart
@@ -63,8 +63,6 @@
static const int IMMEDIATE = 0;
/** Argument to `ping` and `kill`: Ask for action before the next event. */
static const int BEFORE_NEXT_EVENT = 1;
- /** Argument to `ping` and `kill`: Ask for action after normal events. */
- static const int AS_EVENT = 2;
/**
* Control port used to send control messages to the isolate.
@@ -259,20 +257,26 @@
external void resume(Capability resumeCapability);
/**
- * Asks the isolate to send a message on [responsePort] when it terminates.
+ * Asks the isolate to send [response] on [responsePort] when it terminates.
*
* WARNING: This method is experimental and not handled on every platform yet.
*
- * The isolate will send a `null` message on [responsePort] as the last
+ * The isolate will send a `response` message on `responsePort` as the last
* thing before it terminates. It will run no further code after the message
* has been sent.
*
+ * Adding the same port more than once will only cause it to receive one
+ * message, using the last response value that was added.
+ *
* If the isolate is already dead, no message will be sent.
+ * If `response` cannot be sent to the isolate, then the request is ignored.
+ * It is recommended to only use simple values that can be sent to all
+ * isolates, like `null`, booleans, numbers or strings.
*/
/* TODO(lrn): Can we do better? Can the system recognize this message and
* send a reply if the receiving isolate is dead?
*/
- external void addOnExitListener(SendPort responsePort);
+ external void addOnExitListener(SendPort responsePort, {Object response});
/**
* Stop listening on exit messages from the isolate.
@@ -308,8 +312,7 @@
* The isolate is requested to terminate itself.
* The [priority] argument specifies when this must happen.
*
- * The [priority] must be one of [IMMEDIATE], [BEFORE_NEXT_EVENT] or
- * [AS_EVENT].
+ * The [priority] must be one of [IMMEDIATE] or [BEFORE_NEXT_EVENT].
* The shutdown is performed at different times depending on the priority:
*
* * `IMMEDIATE`: The the isolate shuts down as soon as possible.
@@ -323,44 +326,35 @@
* control returns to the event loop of the receiving isolate,
* after the current event, and any already scheduled control events,
* are completed.
- * * `AS_EVENT`: The shutdown does not happen until all prevously sent
- * non-control messages from the current isolate to the receiving isolate
- * have been processed.
- * The kill operation effectively puts the shutdown into the normal event
- * queue after previously sent messages, and it is affected by any control
- * messages that affect normal events, including `pause`.
- * This can be used to wait for a another event to be processed.
*/
- external void kill([int priority = BEFORE_NEXT_EVENT]);
+ external void kill({int priority: BEFORE_NEXT_EVENT});
/**
- * Request that the isolate send a response on the [responsePort].
+ * Request that the isolate send [response] on the [responsePort].
*
* WARNING: This method is experimental and not handled on every platform yet.
*
- * If the isolate is alive, it will eventually send a `null` response on
- * the response port.
+ * If the isolate is alive, it will eventually send `response`
+ * (defaulting to `null`) on the response port.
*
- * The [pingType] must be one of [IMMEDIATE], [BEFORE_NEXT_EVENT] or
- * [AS_EVENT].
+ * The [priority] must be one of [IMMEDIATE] or [BEFORE_NEXT_EVENT].
* The response is sent at different times depending on the ping type:
*
* * `IMMEDIATE`: The the isolate responds as soon as it receives the
* control message. This is after any previous control message
- * from the same isolate has been received.
+ * from the same isolate has been received, but may be during
+ * execution of another event.
* * `BEFORE_NEXT_EVENT`: The response is scheduled for the next time
* control returns to the event loop of the receiving isolate,
* after the current event, and any already scheduled control events,
* are completed.
- * * `AS_EVENT`: The response is not sent until all prevously sent
- * non-control messages from the current isolate to the receiving isolate
- * have been processed.
- * The ping effectively puts the response into the normal event queue
- * after previously sent messages, and it is affected by any control
- * messages that affect normal events, including `pause`.
- * This can be used to wait for a another event to be processed.
+ *
+ * If `response` cannot be sent to the isolate, then the request is ignored.
+ * It is recommended to only use simple values that can be sent to all
+ * isolates, like `null`, booleans, numbers or strings.
*/
- external void ping(SendPort responsePort, [int pingType = IMMEDIATE]);
+ external void ping(SendPort responsePort, {Object response,
+ int priority: IMMEDIATE});
/**
* Requests that uncaught errors of the isolate are sent back to [port].
@@ -372,6 +366,7 @@
* created by calling `toString` on the error.
* The second element is a `String` representation of an accompanying
* stack trace, or `null` if no stack trace was provided.
+ * To convert this back to a [StackTrace] object, use [StackTrace.fromString].
*
* Listening using the same port more than once does nothing. It will only
* get each error once.
@@ -607,12 +602,6 @@
final StackTrace stackTrace;
RemoteError(String description, String stackDescription)
: _description = description,
- stackTrace = new _RemoteStackTrace(stackDescription);
+ stackTrace = new StackTrace.fromString(stackDescription);
String toString() => _description;
}
-
-class _RemoteStackTrace implements StackTrace {
- String _trace;
- _RemoteStackTrace(this._trace);
- String toString() => _trace;
-}
diff --git a/sdk/lib/mirrors/mirrors.dart b/sdk/lib/mirrors/mirrors.dart
index db7594d..7153424 100644
--- a/sdk/lib/mirrors/mirrors.dart
+++ b/sdk/lib/mirrors/mirrors.dart
@@ -55,6 +55,8 @@
*/
library dart.mirrors;
+import 'dart:async' show Future;
+
/**
* A [MirrorSystem] is the main interface used to reflect on a set of
* associated libraries.
@@ -69,8 +71,10 @@
*/
abstract class MirrorSystem {
/**
- * Returns an immutable map from URIs to mirrors for all
- * libraries known to this mirror system.
+ * Returns an immutable map from URIs to mirrors for all libraries known
+ * to this mirror system. For a runtime mirror system, only libraries which
+ * are currently loaded are included, and repeated calls of this method may
+ * return different maps as libraries are loaded.
*/
Map<Uri, LibraryMirror> get libraries;
@@ -612,7 +616,8 @@
/// [targetLibrary].
LibraryMirror get sourceLibrary;
- /// Returns the library mirror of the library that is imported or exported.
+ /// Returns the library mirror of the library that is imported or exported,
+ /// or null if the library is not loaded.
LibraryMirror get targetLibrary;
/// Returns the prefix if this is a prefixed import and `null` otherwise.
@@ -626,6 +631,11 @@
SourceLocation get location;
List<InstanceMirror> get metadata;
+
+ /// Returns a future that completes with a library mirror on the library being
+ /// imported or exported when it is loaded, and initiates a load of that
+ /// library if it is not loaded.
+ Future<LibraryMirror> loadLibrary();
}
/// A mirror on a show/hide combinator declared on a library dependency.
diff --git a/sdk/lib/profiler/profiler.dart b/sdk/lib/profiler/profiler.dart
index 0081ecf..470638b 100644
--- a/sdk/lib/profiler/profiler.dart
+++ b/sdk/lib/profiler/profiler.dart
@@ -2,6 +2,7 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
+/// Instrument your code with counters, gauges, and more.
library dart.profiler;
import 'dart:convert';
diff --git a/sdk/lib/typed_data/typed_data.dart b/sdk/lib/typed_data/typed_data.dart
index 665de4b..628cb2d 100644
--- a/sdk/lib/typed_data/typed_data.dart
+++ b/sdk/lib/typed_data/typed_data.dart
@@ -2,6 +2,8 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
+/// Lists that efficiently handle fixed sized data
+/// (for example, unsigned 8 byte integers) and SIMD numeric types.
library dart.typed_data;
import 'dart:collection';
@@ -18,63 +20,336 @@
int get lengthInBytes;
/**
- * Creates a new [Uint8List] view of this buffer.
+ * Creates a [Uint8List] _view_ of a region of this byte buffer.
+ *
+ * The view is backed by the bytes of this byte buffer.
+ * Any changes made to the `Uint8List` will also change the buffer,
+ * and vice versa.
+ *
+ * The viewed region start at [offsetInBytes] and contains [length] bytes.
+ * If [length] is omitted, the range extends to the end of the buffer.
+ *
+ * The start index and length must describe a valid range of the buffer:
+ *
+ * * `offsetInBytes` must not be negative,
+ * * `length` must not be negative, and
+ * * `offsetInBytes + length` must not be greater than [lengthInBytes].
*/
Uint8List asUint8List([int offsetInBytes = 0, int length]);
+
/**
- * Creates a new [Int8List] view of this buffer.
+ * Creates a [Int8List] _view_ of a region of this byte buffer.
+ *
+ * The view is backed by the bytes of this byte buffer.
+ * Any changes made to the `Int8List` will also change the buffer,
+ * and vice versa.
+ *
+ * The viewed region start at [offsetInBytes] and contains [length] bytes.
+ * If [length] is omitted, the range extends to the end of the buffer.
+ *
+ * The start index and length must describe a valid range of the buffer:
+ *
+ * * `offsetInBytes` must not be negative,
+ * * `length` must not be negative, and
+ * * `offsetInBytes + length` must not be greater than [lengthInBytes].
*/
Int8List asInt8List([int offsetInBytes = 0, int length]);
+
/**
- * Creates a new [Uint8Clamped] view of this buffer.
+ * Creates a [Uint8ClampedList] _view_ of a region of this byte buffer.
+ *
+ * The view is backed by the bytes of this byte buffer.
+ * Any changes made to the `Uint8ClampedList` will also change the buffer,
+ * and vice versa.
+ *
+ * The viewed region start at [offsetInBytes] and contains [length] bytes.
+ * If [length] is omitted, the range extends to the end of the buffer.
+ *
+ * The start index and length must describe a valid range of the buffer:
+ *
+ * * `offsetInBytes` must not be negative,
+ * * `length` must not be negative, and
+ * * `offsetInBytes + length` must not be greater than [lengthInBytes].
*/
Uint8ClampedList asUint8ClampedList([int offsetInBytes = 0, int length]);
+
/**
- * Creates a new [Uint16List] view of this buffer.
+ * Creates a [Uint16List] _view_ of a region of this byte buffer.
+ *
+ * The view is backed by the bytes of this byte buffer.
+ * Any changes made to the `Uint16List` will also change the buffer,
+ * and vice versa.
+ *
+ * The viewed region start at [offsetInBytes], which must be 16-bit aligned,
+ * and contains [length] 16-bit integers.
+ * If [length] is omitted, the range extends as far towards the end of
+ * the buffer as possible -
+ * if [lengthInBytes] is not even, the last byte can't be part of the view.
+ *
+ * The start index and length must describe a valid 16-bit aligned range
+ * of the buffer:
+ *
+ * * `offsetInBytes` must not be negative,
+ * * `offsetInBytes` must be divisible by two,
+ * * `length` must not be negative, and
+ * * `offsetInBytes + length * 2` must not be greater than [lengthInBytes].
*/
Uint16List asUint16List([int offsetInBytes = 0, int length]);
+
/**
- * Creates a new [Int16List] view of this buffer.
+ * Creates a [Int16List] _view_ of a region of this byte buffer.
+ *
+ * The view is backed by the bytes of this byte buffer.
+ * Any changes made to the `Int16List` will also change the buffer,
+ * and vice versa.
+ *
+ * The viewed region start at [offsetInBytes], which must be 16-bit aligned,
+ * and contains [length] 16-bit integers.
+ * If [length] is omitted, the range extends as far towards the end of
+ * the buffer as possible -
+ * if [lengthInBytes] is not even, the last byte can't be part of the view.
+ *
+ * The start index and length must describe a valid 16-bit aligned range
+ * of the buffer:
+ *
+ * * `offsetInBytes` must not be negative,
+ * * `offsetInBytes` must be divisible by two,
+ * * `length` must not be negative, and
+ * * `offsetInBytes + length * 2` must not be greater than [lengthInBytes].
*/
Int16List asInt16List([int offsetInBytes = 0, int length]);
+
/**
- * Creates a new [Uint32List] view of this buffer.
+ * Creates a [Uint32List] _view_ of a region of this byte buffer.
+ *
+ * The view is backed by the bytes of this byte buffer.
+ * Any changes made to the `Uint32List` will also change the buffer,
+ * and vice versa.
+ *
+ * The viewed region start at [offsetInBytes], which must be 32-bit aligned,
+ * and contains [length] 32-bit integers.
+ * If [length] is omitted, the range extends as far towards the end of
+ * the buffer as possible -
+ * if [lengthInBytes] is not divisible by four, the last bytes can't be part
+ * of the view.
+ *
+ * The start index and length must describe a valid 32-bit aligned range
+ * of the buffer:
+ *
+ * * `offsetInBytes` must not be negative,
+ * * `offsetInBytes` must be divisible by four,
+ * * `length` must not be negative, and
+ * * `offsetInBytes + length * 4` must not be greater than [lengthInBytes].
*/
Uint32List asUint32List([int offsetInBytes = 0, int length]);
+
/**
- * Creates a new [Int32List] view of this buffer.
+ * Creates a [Int32List] _view_ of a region of this byte buffer.
+ *
+ * The view is backed by the bytes of this byte buffer.
+ * Any changes made to the `Int32List` will also change the buffer,
+ * and vice versa.
+ *
+ * The viewed region start at [offsetInBytes], which must be 32-bit aligned,
+ * and contains [length] 32-bit integers.
+ * If [length] is omitted, the range extends as far towards the end of
+ * the buffer as possible -
+ * if [lengthInBytes] is not divisible by four, the last bytes can't be part
+ * of the view.
+ *
+ * The start index and length must describe a valid 32-bit aligned range
+ * of the buffer:
+ *
+ * * `offsetInBytes` must not be negative,
+ * * `offsetInBytes` must be divisible by four,
+ * * `length` must not be negative, and
+ * * `offsetInBytes + length * 4` must not be greater than [lengthInBytes].
*/
Int32List asInt32List([int offsetInBytes = 0, int length]);
+
/**
- * Creates a new [Uint64List] view of this buffer.
+ * Creates a [Uint64List] _view_ of a region of this byte buffer.
+ *
+ * The view is backed by the bytes of this byte buffer.
+ * Any changes made to the `Uint64List` will also change the buffer,
+ * and vice versa.
+ *
+ * The viewed region start at [offsetInBytes], which must be 64-bit aligned,
+ * and contains [length] 64-bit integers.
+ * If [length] is omitted, the range extends as far towards the end of
+ * the buffer as possible -
+ * if [lengthInBytes] is not divisible by eight, the last bytes can't be part
+ * of the view.
+ *
+ * The start index and length must describe a valid 64-bit aligned range
+ * of the buffer:
+ *
+ * * `offsetInBytes` must not be negative,
+ * * `offsetInBytes` must be divisible by eight,
+ * * `length` must not be negative, and
+ * * `offsetInBytes + length * 8` must not be greater than [lengthInBytes].
*/
Uint64List asUint64List([int offsetInBytes = 0, int length]);
+
/**
- * Creates a new [Int64List] view of this buffer.
+ * Creates a [Int64List] _view_ of a region of this byte buffer.
+ *
+ * The view is backed by the bytes of this byte buffer.
+ * Any changes made to the `Int64List` will also change the buffer,
+ * and vice versa.
+ *
+ * The viewed region start at [offsetInBytes], which must be 64-bit aligned,
+ * and contains [length] 64-bit integers.
+ * If [length] is omitted, the range extends as far towards the end of
+ * the buffer as possible -
+ * if [lengthInBytes] is not divisible by eight, the last bytes can't be part
+ * of the view.
+ *
+ * The start index and length must describe a valid 64-bit aligned range
+ * of the buffer:
+ *
+ * * `offsetInBytes` must not be negative,
+ * * `offsetInBytes` must be divisible by eight,
+ * * `length` must not be negative, and
+ * * `offsetInBytes + length * 8` must not be greater than [lengthInBytes].
*/
Int64List asInt64List([int offsetInBytes = 0, int length]);
+
/**
- * Creates a new [Int32x4List] view of this buffer.
+ * Creates a [Int32x4List] _view_ of a region of this byte buffer.
+ *
+ * The view is backed by the bytes of this byte buffer.
+ * Any changes made to the `Int32x4List` will also change the buffer,
+ * and vice versa.
+ *
+ * The viewed region start at [offsetInBytes], which must be 128-bit aligned,
+ * and contains [length] 128-bit integers.
+ * If [length] is omitted, the range extends as far towards the end of
+ * the buffer as possible -
+ * if [lengthInBytes] is not divisible by 16, the last bytes can't be part
+ * of the view.
+ *
+ * The start index and length must describe a valid 128-bit aligned range
+ * of the buffer:
+ *
+ * * `offsetInBytes` must not be negative,
+ * * `offsetInBytes` must be divisible by sixteen,
+ * * `length` must not be negative, and
+ * * `offsetInBytes + length * 16` must not be greater than [lengthInBytes].
*/
Int32x4List asInt32x4List([int offsetInBytes = 0, int length]);
+
/**
- * Creates a new [Float32List] view of this buffer.
+ * Creates a [Float32List] _view_ of a region of this byte buffer.
+ *
+ * The view is backed by the bytes of this byte buffer.
+ * Any changes made to the `Float32List` will also change the buffer,
+ * and vice versa.
+ *
+ * The viewed region start at [offsetInBytes], which must be 32-bit aligned,
+ * and contains [length] 32-bit integers.
+ * If [length] is omitted, the range extends as far towards the end of
+ * the buffer as possible -
+ * if [lengthInBytes] is not divisible by four, the last bytes can't be part
+ * of the view.
+ *
+ * The start index and length must describe a valid 32-bit aligned range
+ * of the buffer:
+ *
+ * * `offsetInBytes` must not be negative,
+ * * `offsetInBytes` must be divisible by four,
+ * * `length` must not be negative, and
+ * * `offsetInBytes + length * 4` must not be greater than [lengthInBytes].
*/
Float32List asFloat32List([int offsetInBytes = 0, int length]);
+
/**
- * Creates a new [Float64List] view of this buffer.
+ * Creates a [Float64List] _view_ of a region of this byte buffer.
+ *
+ * The view is backed by the bytes of this byte buffer.
+ * Any changes made to the `Float64List` will also change the buffer,
+ * and vice versa.
+ *
+ * The viewed region start at [offsetInBytes], which must be 64-bit aligned,
+ * and contains [length] 64-bit integers.
+ * If [length] is omitted, the range extends as far towards the end of
+ * the buffer as possible -
+ * if [lengthInBytes] is not divisible by eight, the last bytes can't be part
+ * of the view.
+ *
+ * The start index and length must describe a valid 64-bit aligned range
+ * of the buffer:
+ *
+ * * `offsetInBytes` must not be negative,
+ * * `offsetInBytes` must be divisible by eight,
+ * * `length` must not be negative, and
+ * * `offsetInBytes + length * 8` must not be greater than [lengthInBytes].
*/
Float64List asFloat64List([int offsetInBytes = 0, int length]);
+
/**
- * Creates a new [Float32x4List] view of this buffer.
+ * Creates a [Float32x4List] _view_ of a region of this byte buffer.
+ *
+ * The view is backed by the bytes of this byte buffer.
+ * Any changes made to the `Float32x4List` will also change the buffer,
+ * and vice versa.
+ *
+ * The viewed region start at [offsetInBytes], which must be 128-bit aligned,
+ * and contains [length] 128-bit integers.
+ * If [length] is omitted, the range extends as far towards the end of
+ * the buffer as possible -
+ * if [lengthInBytes] is not divisible by 16, the last bytes can't be part
+ * of the view.
+ *
+ * The start index and length must describe a valid 128-bit aligned range
+ * of the buffer:
+ *
+ * * `offsetInBytes` must not be negative,
+ * * `offsetInBytes` must be divisible by sixteen,
+ * * `length` must not be negative, and
+ * * `offsetInBytes + length * 16` must not be greater than [lengthInBytes].
*/
Float32x4List asFloat32x4List([int offsetInBytes = 0, int length]);
+
/**
- * Creates a new [Float64x2List] view of this buffer.
+ * Creates a [Float64x2List] _view_ of a region of this byte buffer.
+ *
+ * The view is backed by the bytes of this byte buffer.
+ * Any changes made to the `Float64x2List` will also change the buffer,
+ * and vice versa.
+ *
+ * The viewed region start at [offsetInBytes], which must be 128-bit aligned,
+ * and contains [length] 128-bit integers.
+ * If [length] is omitted, the range extends as far towards the end of
+ * the buffer as possible -
+ * if [lengthInBytes] is not divisible by 16, the last bytes can't be part
+ * of the view.
+ *
+ * The start index and length must describe a valid 128-bit aligned range
+ * of the buffer:
+ *
+ * * `offsetInBytes` must not be negative,
+ * * `offsetInBytes` must be divisible by sixteen,
+ * * `length` must not be negative, and
+ * * `offsetInBytes + length * 16` must not be greater than [lengthInBytes].
*/
Float64x2List asFloat64x2List([int offsetInBytes = 0, int length]);
+
/**
- * Creates a new [ByteData] view of this buffer.
+ * Creates a [ByteData] _view_ of a region of this byte buffer.
+ *
+ * The view is backed by the bytes of this byte buffer.
+ * Any changes made to the `ByteData` will also change the buffer,
+ * and vice versa.
+ *
+ * The viewed region start at [offsetInBytes] and contains [length] bytes.
+ * If [length] is omitted, the range extends to the end of the buffer.
+ *
+ * The start index and length must describe a valid range of the buffer:
+ *
+ * * `offsetInBytes` must not be negative,
+ * * `length` must not be negative, and
+ * * `offsetInBytes + length` must not be greater than [lengthInBytes].
*/
ByteData asByteData([int offsetInBytes = 0, int length]);
}
@@ -128,13 +403,14 @@
* A fixed-length, random-access sequence of bytes that also provides random
* and unaligned access to the fixed-width integers and floating point
* numbers represented by those bytes.
- * ByteData may be used to pack and unpack data from external sources
+ * `ByteData` may be used to pack and unpack data from external sources
* (such as networks or files systems), and to process large quantities
* of numerical data more efficiently than would be possible
- * with ordinary [List] implementations. ByteData can save space, by
- * eliminating the need for object headers, and time, by eliminating the
- * need for data copies. Finally, ByteData may be used to intentionally
- * reinterpret the bytes representing one arithmetic type as another.
+ * with ordinary [List] implementations.
+ * `ByteData` can save space, by eliminating the need for object headers,
+ * and time, by eliminating the need for data copies.
+ * Finally, `ByteData` may be used to intentionally reinterpret the bytes
+ * representing one arithmetic type as another.
* For example this code fragment determine what 32-bit signed integer
* is represented by the bytes of a 32-bit floating point number:
*
@@ -146,17 +422,19 @@
abstract class ByteData implements TypedData {
/**
* Creates a [ByteData] of the specified length (in elements), all of
- * whose elements are initially zero.
+ * whose bytes are initially zero.
*/
external factory ByteData(int length);
/**
- * Creates an [ByteData] _view_ of the specified region in the specified
- * byte buffer. Changes in the [ByteData] will be visible in the byte
- * buffer and vice versa. If the [offsetInBytes] index of the region is not
- * specified, it defaults to zero (the first byte in the byte buffer).
- * If the length is not specified, it defaults to null, which indicates
- * that the view extends to the end of the byte buffer.
+ * Creates an [ByteData] _view_ of the specified region in [buffer].
+ *
+ * Changes in the [ByteData] will be visible in the byte
+ * buffer and vice versa.
+ * If the [offsetInBytes] index of the region is not specified,
+ * it defaults to zero (the first byte in the byte buffer).
+ * If the length is not specified, it defaults to `null`,
+ * which indicates that the view extends to the end of the byte buffer.
*
* Throws [RangeError] if [offsetInBytes] or [length] are negative, or
* if [offsetInBytes] + ([length] * elementSizeInBytes) is greater than
@@ -432,12 +710,14 @@
external factory Int8List.fromList(List<int> elements);
/**
- * Creates an [Int8List] _view_ of the specified region in the specified
- * byte buffer. Changes in the [Int8List] will be visible in the byte
- * buffer and vice versa. If the [offsetInBytes] index of the region is not
- * specified, it defaults to zero (the first byte in the byte buffer).
- * If the length is not specified, it defaults to null, which indicates
- * that the view extends to the end of the byte buffer.
+ * Creates an [Int8List] _view_ of the specified region in [buffer].
+ *
+ * Changes in the [Int8List] will be visible in the byte
+ * buffer and vice versa.
+ * If the [offsetInBytes] index of the region is not specified,
+ * it defaults to zero (the first byte in the byte buffer).
+ * If the length is not specified, it defaults to `null`,
+ * which indicates that the view extends to the end of the byte buffer.
*
* Throws [RangeError] if [offsetInBytes] or [length] are negative, or
* if [offsetInBytes] + ([length] * elementSizeInBytes) is greater than
@@ -471,12 +751,14 @@
external factory Uint8List.fromList(List<int> elements);
/**
- * Creates a [Uint8List] _view_ of the specified region in the specified
- * byte buffer. Changes in the [Uint8List] will be visible in the byte
- * buffer and vice versa. If the [offsetInBytes] index of the region is not
- * specified, it defaults to zero (the first byte in the byte buffer).
- * If the length is not specified, it defaults to null, which indicates
- * that the view extends to the end of the byte buffer.
+ * Creates a [Uint8List] _view_ of the specified region in [buffer].
+ *
+ * Changes in the [Uint8List] will be visible in the byte
+ * buffer and vice versa.
+ * If the [offsetInBytes] index of the region is not specified,
+ * it defaults to zero (the first byte in the byte buffer).
+ * If the length is not specified, it defaults to `null`,
+ * which indicates that the view extends to the end of the byte buffer.
*
* Throws [RangeError] if [offsetInBytes] or [length] are negative, or
* if [offsetInBytes] + ([length] * elementSizeInBytes) is greater than
@@ -512,11 +794,14 @@
/**
* Creates a [Uint8ClampedList] _view_ of the specified region in the
- * specified byte [buffer]. Changes in the [Uint8List] will be visible in the
- * byte buffer and vice versa. If the [offsetInBytes] index of the region is
- * not specified, it defaults to zero (the first byte in the byte buffer).
- * If the length is not specified, it defaults to null, which indicates that
- * the view extends to the end of the byte buffer.
+ * specified byte [buffer].
+ *
+ * Changes in the [Uint8List] will be visible in the byte buffer
+ * and vice versa.
+ * If the [offsetInBytes] index of the region is not specified,
+ * it defaults to zero (the first byte in the byte buffer).
+ * If the length is not specified, it defaults to `null`,
+ * which indicates that the view extends to the end of the byte buffer.
*
* Throws [RangeError] if [offsetInBytes] or [length] are negative, or
* if [offsetInBytes] + ([length] * elementSizeInBytes) is greater than
@@ -550,12 +835,14 @@
external factory Int16List.fromList(List<int> elements);
/**
- * Creates an [Int16List] _view_ of the specified region in the specified
- * byte buffer. Changes in the [Int16List] will be visible in the byte
- * buffer and vice versa. If the [offsetInBytes] index of the region is not
- * specified, it defaults to zero (the first byte in the byte buffer).
- * If the length is not specified, it defaults to null, which indicates
- * that the view extends to the end of the byte buffer.
+ * Creates an [Int16List] _view_ of the specified region in [buffer].
+ *
+ * Changes in the [Int16List] will be visible in the byte
+ * buffer and vice versa.
+ * If the [offsetInBytes] index of the region is not specified,
+ * it defaults to zero (the first byte in the byte buffer).
+ * If the length is not specified, it defaults to `null`,
+ * which indicates that the view extends to the end of the byte buffer.
*
* Throws [RangeError] if [offsetInBytes] or [length] are negative, or
* if [offsetInBytes] + ([length] * elementSizeInBytes) is greater than
@@ -593,10 +880,13 @@
/**
* Creates a [Uint16List] _view_ of the specified region in
- * the specified byte buffer. Changes in the [Uint16List] will be
- * visible in the byte buffer and vice versa. If the [offsetInBytes] index
- * of the region is not specified, it defaults to zero (the first byte in
- * the byte buffer). If the length is not specified, it defaults to null,
+ * the specified byte buffer.
+ *
+ * Changes in the [Uint16List] will be visible in the byte buffer
+ * and vice versa.
+ * If the [offsetInBytes] index of the region is not specified,
+ * it defaults to zero (the first byte in the byte buffer).
+ * If the length is not specified, it defaults to `null`,
* which indicates that the view extends to the end of the byte buffer.
*
* Throws [RangeError] if [offsetInBytes] or [length] are negative, or
@@ -634,12 +924,14 @@
external factory Int32List.fromList(List<int> elements);
/**
- * Creates an [Int32List] _view_ of the specified region in the specified
- * byte buffer. Changes in the [Int32List] will be visible in the byte
- * buffer and vice versa. If the [offsetInBytes] index of the region is not
- * specified, it defaults to zero (the first byte in the byte buffer).
- * If the length is not specified, it defaults to null, which indicates
- * that the view extends to the end of the byte buffer.
+ * Creates an [Int32List] _view_ of the specified region in [buffer].
+ *
+ * Changes in the [Int32List] will be visible in the byte
+ * buffer and vice versa.
+ * If the [offsetInBytes] index of the region is not specified,
+ * it defaults to zero (the first byte in the byte buffer).
+ * If the length is not specified, it defaults to `null`,
+ * which indicates that the view extends to the end of the byte buffer.
*
* Throws [RangeError] if [offsetInBytes] or [length] are negative, or
* if [offsetInBytes] + ([length] * elementSizeInBytes) is greater than
@@ -677,10 +969,13 @@
/**
* Creates a [Uint32List] _view_ of the specified region in
- * the specified byte buffer. Changes in the [Uint32] will be
- * visible in the byte buffer and vice versa. If the [offsetInBytes] index
- * of the region is not specified, it defaults to zero (the first byte in
- * the byte buffer). If the length is not specified, it defaults to null,
+ * the specified byte buffer.
+ *
+ * Changes in the [Uint32List] will be visible in the byte buffer
+ * and vice versa.
+ * If the [offsetInBytes] index of the region is not specified,
+ * it defaults to zero (the first byte in the byte buffer).
+ * If the length is not specified, it defaults to `null`,
* which indicates that the view extends to the end of the byte buffer.
*
* Throws [RangeError] if [offsetInBytes] or [length] are negative, or
@@ -718,12 +1013,14 @@
external factory Int64List.fromList(List<int> elements);
/**
- * Creates an [Int64List] _view_ of the specified region in the specified
- * byte buffer. Changes in the [Int64List] will be visible in the byte buffer
- * and vice versa. If the [offsetInBytes] index of the region is not
- * specified, it defaults to zero (the first byte in the byte buffer).
- * If the length is not specified, it defaults to null, which indicates that
- * the view extends to the end of the byte buffer.
+ * Creates an [Int64List] _view_ of the specified region in [buffer].
+ *
+ * Changes in the [Int64List] will be visible in the byte buffer
+ * and vice versa.
+ * If the [offsetInBytes] index of the region is not specified,
+ * it defaults to zero (the first byte in the byte buffer).
+ * If the length is not specified, it defaults to `null`,
+ * which indicates that the view extends to the end of the byte buffer.
*
* Throws [RangeError] if [offsetInBytes] or [length] are negative, or
* if [offsetInBytes] + ([length] * elementSizeInBytes) is greater than
@@ -761,12 +1058,14 @@
/**
* Creates an [Uint64List] _view_ of the specified region in
- * the specified byte buffer. Changes in the [Uint64List] will be
- * visible in the byte buffer and vice versa. If the [offsetInBytes]
- * index of the region is not specified, it defaults to zero (the first
- * byte in the byte buffer). If the length is not specified, it defaults
- * to null, which indicates that the view extends to the end of the byte
- * buffer.
+ * the specified byte buffer.
+ *
+ * Changes in the [Uint64List] will be visible in the byte buffer
+ * and vice versa.
+ * If the [offsetInBytes] index of the region is not specified,
+ * it defaults to zero (the first byte in the byte buffer).
+ * If the length is not specified, it defaults to `null`,
+ * which indicates that the view extends to the end of the byte buffer.
*
* Throws [RangeError] if [offsetInBytes] or [length] are negative, or
* if [offsetInBytes] + ([length] * elementSizeInBytes) is greater than
@@ -804,12 +1103,14 @@
external factory Float32List.fromList(List<double> elements);
/**
- * Creates a [Float32List] _view_ of the specified region in the specified
- * byte buffer. Changes in the [Float32List] will be visible in the byte
- * buffer and vice versa. If the [offsetInBytes] index of the region is not
- * specified, it defaults to zero (the first byte in the byte buffer).
- * If the length is not specified, it defaults to null, which indicates
- * that the view extends to the end of the byte buffer.
+ * Creates a [Float32List] _view_ of the specified region in [buffer].
+ *
+ * Changes in the [Float32List] will be visible in the byte
+ * buffer and vice versa.
+ * If the [offsetInBytes] index of the region is not specified,
+ * it defaults to zero (the first byte in the byte buffer).
+ * If the length is not specified, it defaults to `null`,
+ * which indicates that the view extends to the end of the byte buffer.
*
* Throws [RangeError] if [offsetInBytes] or [length] are negative, or
* if [offsetInBytes] + ([length] * elementSizeInBytes) is greater than
@@ -847,12 +1148,14 @@
external factory Float64List.fromList(List<double> elements);
/**
- * Creates a [Float64List] _view_ of the specified region in the specified
- * byte buffer. Changes in the [Float64List] will be visible in the byte
- * buffer and vice versa. If the [offsetInBytes] index of the region is not
- * specified, it defaults to zero (the first byte in the byte buffer).
- * If the length is not specified, it defaults to null, which indicates
- * that the view extends to the end of the byte buffer.
+ * Creates a [Float64List] _view_ of the specified region in [buffer].
+ *
+ * Changes in the [Float64List] will be visible in the byte
+ * buffer and vice versa.
+ * If the [offsetInBytes] index of the region is not specified,
+ * it defaults to zero (the first byte in the byte buffer).
+ * If the length is not specified, it defaults to `null`,
+ * which indicates that the view extends to the end of the byte buffer.
*
* Throws [RangeError] if [offsetInBytes] or [length] are negative, or
* if [offsetInBytes] + ([length] * elementSizeInBytes) is greater than
@@ -889,12 +1192,14 @@
external factory Float32x4List.fromList(List<Float32x4> elements);
/**
- * Creates a [Float32x4List] _view_ of the specified region in the specified
- * byte buffer. Changes in the [Float32x4List] will be visible in the byte
- * buffer and vice versa. If the [offsetInBytes] index of the region is not
- * specified, it defaults to zero (the first byte in the byte buffer).
- * If the length is not specified, it defaults to null, which indicates
- * that the view extends to the end of the byte buffer.
+ * Creates a [Float32x4List] _view_ of the specified region in [buffer].
+ *
+ * Changes in the [Float32x4List] will be visible in the byte
+ * buffer and vice versa.
+ * If the [offsetInBytes] index of the region is not specified,
+ * it defaults to zero (the first byte in the byte buffer).
+ * If the length is not specified, it defaults to `null`,
+ * which indicates that the view extends to the end of the byte buffer.
*
* Throws [RangeError] if [offsetInBytes] or [length] are negative, or
* if [offsetInBytes] + ([length] * elementSizeInBytes) is greater than
@@ -931,12 +1236,14 @@
external factory Int32x4List.fromList(List<Int32x4> elements);
/**
- * Creates a [Int32x4List] _view_ of the specified region in the specified
- * byte buffer. Changes in the [Int32x4List] will be visible in the byte
- * buffer and vice versa. If the [offsetInBytes] index of the region is not
- * specified, it defaults to zero (the first byte in the byte buffer).
- * If the length is not specified, it defaults to null, which indicates
- * that the view extends to the end of the byte buffer.
+ * Creates a [Int32x4List] _view_ of the specified region in [buffer].
+ *
+ * Changes in the [Int32x4List] will be visible in the byte
+ * buffer and vice versa.
+ * If the [offsetInBytes] index of the region is not specified,
+ * it defaults to zero (the first byte in the byte buffer).
+ * If the length is not specified, it defaults to `null`,
+ * which indicates that the view extends to the end of the byte buffer.
*
* Throws [RangeError] if [offsetInBytes] or [length] are negative, or
* if [offsetInBytes] + ([length] * elementSizeInBytes) is greater than
@@ -973,12 +1280,14 @@
external factory Float64x2List.fromList(List<Float64x2> elements);
/**
- * Creates a [Float64x2List] _view_ of the specified region in the specified
- * byte buffer. Changes in the [Float64x2List] will be visible in the byte
- * buffer and vice versa. If the [offsetInBytes] index of the region is not
- * specified, it defaults to zero (the first byte in the byte buffer).
- * If the length is not specified, it defaults to null, which indicates
- * that the view extends to the end of the byte buffer.
+ * Creates a [Float64x2List] _view_ of the specified region in [buffer].
+ *
+ * Changes in the [Float64x2List] will be visible in the byte
+ * buffer and vice versa.
+ * If the [offsetInBytes] index of the region is not specified,
+ * it defaults to zero (the first byte in the byte buffer).
+ * If the length is not specified, it defaults to `null`,
+ * which indicates that the view extends to the end of the byte buffer.
*
* Throws [RangeError] if [offsetInBytes] or [length] are negative, or
* if [offsetInBytes] + ([length] * elementSizeInBytes) is greater than
diff --git a/site/try/poi/poi.dart b/site/try/poi/poi.dart
index 7c023d0..e86bfc5 100644
--- a/site/try/poi/poi.dart
+++ b/site/try/poi/poi.dart
@@ -34,7 +34,7 @@
WorkItem;
import 'package:compiler/src/elements/visitor.dart' show
- ElementVisitor;
+ BaseElementVisitor;
import 'package:compiler/src/elements/elements.dart' show
AbstractFieldElement,
@@ -492,24 +492,24 @@
Element findPosition(int position, Element element) {
FindPositionVisitor visitor = new FindPositionVisitor(position, element);
- element.accept(visitor);
+ element.accept(visitor, null);
return visitor.element;
}
String scopeInformation(Element element, int position) {
ScopeInformationVisitor visitor =
new ScopeInformationVisitor(cachedCompiler, element, position);
- element.accept(visitor);
+ element.accept(visitor, null);
return '${visitor.buffer}';
}
-class FindPositionVisitor extends ElementVisitor {
+class FindPositionVisitor extends BaseElementVisitor {
final int position;
Element element;
FindPositionVisitor(this.position, this.element);
- visitElement(modelx.ElementX e) {
+ visitElement(modelx.ElementX e, _) {
DeclarationSite site = e.declarationSite;
if (site is PartialElement) {
if (site.beginToken.charOffset <= position &&
@@ -519,18 +519,18 @@
}
}
- visitClassElement(ClassElement e) {
+ visitClassElement(ClassElement e, _) {
if (e is PartialClassElement) {
if (e.beginToken.charOffset <= position &&
position < e.endToken.next.charOffset) {
element = e;
- visitScopeContainerElement(e);
+ visitScopeContainerElement(e, _);
}
}
}
- visitScopeContainerElement(ScopeContainerElement e) {
- e.forEachLocalMember((Element element) => element.accept(this));
+ visitScopeContainerElement(ScopeContainerElement e, _) {
+ e.forEachLocalMember((Element element) => element.accept(this, _));
}
}
diff --git a/site/try/poi/scope_information_visitor.dart b/site/try/poi/scope_information_visitor.dart
index 9db8969..fa4572d 100644
--- a/site/try/poi/scope_information_visitor.dart
+++ b/site/try/poi/scope_information_visitor.dart
@@ -11,7 +11,7 @@
FieldElementX;
import 'package:compiler/src/elements/visitor.dart' show
- ElementVisitor;
+ BaseElementVisitor;
import 'package:compiler/src/dart2jslib.dart' show
Compiler;
@@ -34,7 +34,7 @@
* calling the [serialize] method on each element. Some elements need special
* treatment, as their enclosing scope must also be serialized.
*/
-class ScopeInformationVisitor extends ElementVisitor/* <void> */ {
+class ScopeInformationVisitor extends BaseElementVisitor/* <void> */ {
// TODO(ahe): Include function parameters and local variables.
final Compiler compiler;
@@ -54,11 +54,11 @@
StringBuffer get indented => buffer..write(indentation);
- void visitElement(Element e) {
+ void visitElement(Element e, _) {
serialize(e, omitEnclosing: false);
}
- void visitLibraryElement(LibraryElement e) {
+ void visitLibraryElement(LibraryElement e, _) {
bool isFirst = true;
forEach(Element member) {
if (!isFirst) {
@@ -103,7 +103,7 @@
});
}
- void visitClassElement(ClassElement e) {
+ void visitClassElement(ClassElement e, _) {
currentClass = e;
serializeClassSide(e, isStatic: true);
}
@@ -168,7 +168,7 @@
});
}
- void visitScopeContainerElement(ScopeContainerElement e) {
+ void visitScopeContainerElement(ScopeContainerElement e, _) {
bool isFirst = true;
serialize(e, omitEnclosing: false, serializeMembers: () {
localMembersSorted(e).forEach((Element member) {
@@ -183,11 +183,11 @@
});
}
- void visitCompilationUnitElement(CompilationUnitElement e) {
- e.enclosingElement.accept(this);
+ void visitCompilationUnitElement(CompilationUnitElement e, _) {
+ e.enclosingElement.accept(this, _);
}
- void visitAbstractFieldElement(AbstractFieldElement e) {
+ void visitAbstractFieldElement(AbstractFieldElement e, _) {
throw new UnsupportedError('AbstractFieldElement cannot be serialized.');
}
@@ -273,7 +273,7 @@
if (serializeEnclosing != null) {
serializeEnclosing();
} else {
- element.enclosingElement.accept(this);
+ element.enclosingElement.accept(this, null);
}
}
indentationLevel--;
diff --git a/site/try/src/interaction_manager.dart b/site/try/src/interaction_manager.dart
index 6106df0..2c566e3 100644
--- a/site/try/src/interaction_manager.dart
+++ b/site/try/src/interaction_manager.dart
@@ -762,9 +762,10 @@
if (context.isFirstCompile) {
outputDiv.append(context.compilerConsole);
}
+ var diagnostics = mainEditorPane.querySelectorAll('a.diagnostic');
context.oldDiagnostics
..clear()
- ..addAll(mainEditorPane.querySelectorAll('a.diagnostic'));
+ ..addAll(diagnostics);
}
void aboutToRun() {
diff --git a/tests/benchmark_smoke/benchmark_smoke.status b/tests/benchmark_smoke/benchmark_smoke.status
index ed281f3..0e012ef 100644
--- a/tests/benchmark_smoke/benchmark_smoke.status
+++ b/tests/benchmark_smoke/benchmark_smoke.status
@@ -7,3 +7,6 @@
[ $compiler == dart2js && $runtime == none ]
*: Fail, Pass # TODO(ahe): Triage these tests.
+
+[ $compiler == dart2js && $cps_ir ]
+benchmark_smoke_test: Crash # cannot compile methods that need interceptor calling convention.
diff --git a/tests/co19/co19-analyzer2.status b/tests/co19/co19-analyzer2.status
index b0072cf..41a2db2 100644
--- a/tests/co19/co19-analyzer2.status
+++ b/tests/co19/co19-analyzer2.status
@@ -8,9 +8,6 @@
LayoutTests/fast/forms/checkValidity-001_t01: fail
Language/12_Expressions/29_Assignable_Expressions_A01_t08: StaticWarning
-# TBF: infinite look: class A {const A();final m = const A();}
-Language/12_Expressions/01_Constants_A17_t03: fail
-
# TBF: Static members should not be accessible via subclasses.
Language/07_Classes/9_Superclasses/1_Inheritance_and_Overriding_A01_t05: MissingStaticWarning
diff --git a/tests/co19/co19-dart2dart.status b/tests/co19/co19-dart2dart.status
index 0e54aec..eb20aa4 100644
--- a/tests/co19/co19-dart2dart.status
+++ b/tests/co19/co19-dart2dart.status
@@ -4,13 +4,9 @@
[ $compiler == dart2dart && $builder_tag == new_backend ]
Language/12_Expressions/18_Assignment_A04_t09: RuntimeError # Issue 23015
-LibTest/collection/ListBase/ListBase_class_A01_t02: Crash # issue 19953
-LibTest/collection/ListMixin/ListMixin_class_A01_t02: Crash # issue 19953
-LibTest/core/List/List_class_A01_t02: Crash # issue 19953
[ $compiler == dart2dart && $builder_tag != new_backend ]
Language/12_Expressions/18_Assignment_A04_t09: RuntimeError # co19-roll r667: Please triage this failure
-Language/13_Statements/12_Labels_A01_t03: fail # co19-roll r546: Please triage this failure
[ $compiler == dart2dart ]
Language/03_Overview/1_Scoping_A02_t05: Fail # Inherited from dart2js
@@ -54,8 +50,6 @@
Language/12_Expressions/12_Instance_Creation/1_New_A06_t15: CompileTimeError # Issue 21092
Language/12_Expressions/12_Instance_Creation/2_Const_A11_t01: MissingCompileTimeError # Issue 21134
Language/12_Expressions/12_Instance_Creation/2_Const_A11_t03: MissingCompileTimeError # Issue 21134
-Language/12_Expressions/14_Function_Invocation/3_Unqualified_Invocation_A01_t17: MissingCompileTimeError # Issue 21210
-Language/12_Expressions/14_Function_Invocation/3_Unqualified_Invocation_A01_t18: MissingCompileTimeError # Issue 21210
Language/12_Expressions/15_Method_Invocation/3_Static_Invocation_A04_t09: RuntimeError # co19-roll r623: Please triage this failure
Language/12_Expressions/17_Getter_Invocation_A07_t02: Pass, RuntimeError # co19-roll r607: Please triage this failure
Language/12_Expressions/22_Equality_A01_t01: fail # co19-roll r546: Please triage this failure
@@ -64,6 +58,7 @@
Language/13_Statements/04_Local_Function_Declaration_A04_t01: Fail, MissingCompileTimeError # co19-roll r607: Please triage this failure
Language/13_Statements/04_Local_Function_Declaration_A04_t03: MissingCompileTimeError # co19-roll r667: Please triage this failure
Language/13_Statements/09_Switch_A01_t02: fail # co19-roll r546: Please triage this failure
+Language/13_Statements/12_Labels_A01_t03: fail # co19-roll r546: Please triage this failure
Language/14_Libraries_and_Scripts/1_Imports_A03_t08: fail # co19-roll r546: Please triage this failure
Language/14_Libraries_and_Scripts/1_Imports_A03_t09: fail # co19-roll r546: Please triage this failure
Language/14_Libraries_and_Scripts/1_Imports_A03_t10: fail # co19-roll r546: Please triage this failure
@@ -79,7 +74,6 @@
LibTest/async/DeferredLibrary/DeferredLibrary_A01_t01: RuntimeError # Issue 22032
LibTest/core/DateTime/parse_A03_t01: fail # co19-roll r546: Please triage this failure
LibTest/core/Function/Function_class_A01_t01: RuntimeError # co19-roll r623: Please triage this failure
-LibTest/core/Function/apply_A01_t01: RuntimeError # Issue 21673
LibTest/core/Invocation/memberName_A01_t01: Pass, RuntimeError # co18-roll r607: Please triage this failure
LibTest/core/RegExp/Pattern_semantics/firstMatch_NonEmptyClassRanges_A01_t01: Fail # inherited from VM. Issue 22200
LibTest/core/RegExp/Pattern_semantics/firstMatch_NonEmptyClassRanges_A01_t05: Fail # inherited from VM. Issue 22200
diff --git a/tests/co19/co19-dart2js.status b/tests/co19/co19-dart2js.status
index e68755a..d9c2e62 100644
--- a/tests/co19/co19-dart2js.status
+++ b/tests/co19/co19-dart2js.status
@@ -2,8 +2,6 @@
# for details. All rights reserved. Use of this source code is governed by a
# BSD-style license that can be found in the LICENSE file.
-LayoutTests/fast/innerHTML/innerHTML-svg-write_t01: Skip # Temporary suppression, WIP alanknight
-
[ $compiler == dart2js ]
Language/03_Overview/1_Scoping_A02_t05: CompileTimeError # Issue 21072
Language/03_Overview/1_Scoping_A02_t06: CompileTimeError # Issue 21072
@@ -44,8 +42,6 @@
Language/12_Expressions/12_Instance_Creation/1_New_A06_t15: CompileTimeError # Issue 21092
Language/12_Expressions/12_Instance_Creation/2_Const_A11_t01: fail # Issue 21134 and co19 issue 714
Language/12_Expressions/12_Instance_Creation/2_Const_A11_t03: fail # Issue 21134 and co19 issue 714
-Language/12_Expressions/14_Function_Invocation/3_Unqualified_Invocation_A01_t17: MissingCompileTimeError # Issue 21210
-Language/12_Expressions/14_Function_Invocation/3_Unqualified_Invocation_A01_t18: MissingCompileTimeError # Issue 21210
Language/12_Expressions/22_Equality_A01_t01: fail # Issue 21137
Language/12_Expressions/22_Equality_A05_t01: fail # Issue 21137
Language/12_Expressions/30_Identifier_Reference_A02_t01: fail # Issue 21154
@@ -95,11 +91,11 @@
LibTest/core/int/toDouble_A01_t01: RuntimeError, OK # co19 issue 200
LibTest/html/HttpRequest/responseType_A01_t03: CompileTimeError # co19-roll r706: Please triage this failure
LibTest/html/IFrameElement/enteredView_A01_t01: CompileTimeError # co19-roll r706: Please triage this failure
-LibTest/isolate/Isolate/spawnUri_A01_t01: Fail # co19-roll r672: Please triage this failure
-LibTest/isolate/Isolate/spawnUri_A01_t02: Fail # co19-roll r672: Please triage this failure
-LibTest/isolate/Isolate/spawnUri_A01_t03: Fail # co19-roll r672: Please triage this failure
-LibTest/isolate/Isolate/spawnUri_A01_t04: Fail # co19-roll r672: Please triage this failure
-LibTest/isolate/Isolate/spawnUri_A01_t05: Fail # co19-roll r672: Please triage this failure
+LibTest/isolate/Isolate/spawnUri_A01_t01: Fail # Dart issue 15974
+LibTest/isolate/Isolate/spawnUri_A01_t02: Fail # Dart issue 15974
+LibTest/isolate/Isolate/spawnUri_A01_t03: Fail # Dart issue 15974
+LibTest/isolate/Isolate/spawnUri_A01_t04: Fail # Dart issue 15974
+LibTest/isolate/Isolate/spawnUri_A01_t05: Fail # Dart issue 15974
LibTest/isolate/Isolate/spawnUri_A02_t01: RuntimeError, Pass # Dart issue 15617
LibTest/isolate/Isolate/spawn_A02_t02: RuntimeError, Pass # Dart issue 15617
LibTest/isolate/IsolateStream/any_A02_t01: fail # co19-roll r546: Please triage this failure
@@ -396,6 +392,7 @@
LayoutTests/fast/forms/submit-form-with-dirname-attribute-with-nonhtml-ancestor_t01: Skip # Test reloads itself. Issue 18558.
LayoutTests/fast/forms/submit-nil-value-field-assert_t01: Skip # Test reloads itself. Issue 18558.
LayoutTests/fast/forms/textarea-submit-crash_t01: Skip # Test reloads itself. Issue 18558.
+LayoutTests/fast/innerHTML/innerHTML-svg-write_t01: Fail # Test uses foreignObject tag, which sanitizer removes. co19 issue #746
[ $compiler == dart2js && $runtime == chromeOnAndroid ]
Language/12_Expressions/00_Object_Identity/1_Object_Identity_A05_t02: RuntimeError # Please triage this failure.
@@ -1302,14 +1299,26 @@
WebPlatformTest/html/semantics/forms/textfieldselection/selection_t01: RuntimeError # Please triage this failure
WebPlatformTest/shadow-dom/shadow-trees/upper-boundary-encapsulation/ownerdocument-001_t01: RuntimeError # Please triage this failure
+[ $compiler == dart2js && $runtime == chrome && ($system == windows || $system == macos) ]
+# New failures on Chrome 42, linux bots are not yet at that version.
+LayoutTests/fast/css/getComputedStyle/counterIncrement-without-counter_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css/image-set-setting_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css/parsing-text-rendering_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/background-shorthand-csstext_t01: RuntimeError # Please triage this failure
+WebPlatformTest/html/semantics/embedded-content/media-elements/interfaces/HTMLElement/HTMLMediaElement/addTextTrack_t01: RuntimeError # Please triage this failure
+WebPlatformTest/html/semantics/forms/textfieldselection/selection_t01: RuntimeError # Please triage this failure
+WebPlatformTest/html/semantics/forms/the-input-element/url_t01: RuntimeError # Please triage this failure
+WebPlatformTest/shadow-dom/elements-and-dom-objects/extensions-to-event-interface/event-path-001_t01: RuntimeError # Please triage this failure
+
[ $compiler == dart2js && $runtime == chrome && $system == macos ]
LayoutTests/fast/canvas/webgl/canvas-test_t01: Skip # Times out. Please triage this failure
-LayoutTests/fast/css/vertical-align-length-copy-bug_t01: RuntimeError # Please triage this failure
-LayoutTests/fast/flexbox/repaint-scrollbar_t01: RuntimeError # Please triage this failure
-LayoutTests/fast/multicol/orphans-relayout_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/webgl/draw-webgl-to-canvas-2d_t01: Pass, RuntimeError # Please triage this failure
+LayoutTests/fast/multicol/newmulticol/balance_t04: RuntimeError # Please triage this failure
+LayoutTests/fast/shapes/shape-outside-floats/shape-outside-floats-inset-rounded-different-writing-modes-left_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/shapes/shape-outside-floats/shape-outside-rounded-boxes_t02: RuntimeError # Please triage this failure
LayoutTests/fast/text/glyph-reordering_t01: RuntimeError # Please triage this failure
-LayoutTests/fast/text/zero-width-characters_t01: RuntimeError # Please triage this failure
-
+LayoutTests/fast/text/line-break-after-question-mark_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/text/text-combine-shrink-to-fit_t01: RuntimeError # Please triage this failure
[ $compiler == dart2js && $runtime == chrome && $system != macos ]
LayoutTests/fast/canvas/webgl/WebGLContextEvent_t01: RuntimeError # Please triage this failure
@@ -6465,11 +6474,8 @@
LayoutTests/fast/events/init-message-event_t01: RuntimeError # Please triage this failure
LayoutTests/fast/events/initkeyboardevent-crash_t01: RuntimeError # Please triage this failure
LayoutTests/fast/events/input-focus-no-duplicate-events_t01: RuntimeError # Please triage this failure
-LayoutTests/fast/events/invalid-001_t01: RuntimeError # Please triage this failure
-LayoutTests/fast/events/invalid-002_t01: RuntimeError # Please triage this failure
LayoutTests/fast/events/invalid-003_t01: RuntimeError # Please triage this failure
LayoutTests/fast/events/invalid-004_t01: RuntimeError # Please triage this failure
-LayoutTests/fast/events/invalid-005_t01: RuntimeError # Please triage this failure
LayoutTests/fast/events/label-focus_t01: RuntimeError # Please triage this failure
LayoutTests/fast/events/mutation-during-append-child_t01: RuntimeError # Please triage this failure
LayoutTests/fast/events/mutation-during-insert-before_t01: RuntimeError # Please triage this failure
@@ -8461,11 +8467,8 @@
LayoutTests/fast/events/init-message-event_t01: RuntimeError # Please triage this failure
LayoutTests/fast/events/initkeyboardevent-crash_t01: RuntimeError # Please triage this failure
LayoutTests/fast/events/input-focus-no-duplicate-events_t01: RuntimeError # Please triage this failure
-LayoutTests/fast/events/invalid-001_t01: RuntimeError # Please triage this failure
-LayoutTests/fast/events/invalid-002_t01: RuntimeError # Please triage this failure
LayoutTests/fast/events/invalid-003_t01: RuntimeError # Please triage this failure
LayoutTests/fast/events/invalid-004_t01: RuntimeError # Please triage this failure
-LayoutTests/fast/events/invalid-005_t01: RuntimeError # Please triage this failure
LayoutTests/fast/events/label-focus_t01: RuntimeError # Please triage this failure
LayoutTests/fast/events/mutation-during-append-child_t01: RuntimeError # Please triage this failure
LayoutTests/fast/events/mutation-during-insert-before_t01: RuntimeError # Please triage this failure
@@ -9442,3 +9445,7857 @@
WebPlatformTest/webstorage/storage_local_setitem_quotaexceedederr_t01: Skip # Times out. Please triage this failure
WebPlatformTest/webstorage/storage_local_setitem_t01: RuntimeError # Please triage this failure
WebPlatformTest/webstorage/storage_session_setitem_t01: RuntimeError # Please triage this failure
+
+[ $compiler == dart2js && $cps_ir ]
+Language/03_Overview/03_Overview_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/03_Overview/03_Overview_A01_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/03_Overview/1_Scoping_A01_t28: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/03_Overview/1_Scoping_A01_t29: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/03_Overview/1_Scoping_A01_t34: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/03_Overview/1_Scoping_A01_t39: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/03_Overview/1_Scoping_A02_t04: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/03_Overview/1_Scoping_A02_t05: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/03_Overview/1_Scoping_A02_t06: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/03_Overview/1_Scoping_A02_t07: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/03_Overview/1_Scoping_A02_t11: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/03_Overview/1_Scoping_A02_t12: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/03_Overview/1_Scoping_A02_t13: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/03_Overview/1_Scoping_A02_t14: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/03_Overview/1_Scoping_A02_t15: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/03_Overview/1_Scoping_A02_t16: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/03_Overview/1_Scoping_A02_t19: Crash # (switch (1){case 1:var x;break;case 2:var x;break;}): Unhandled node
+Language/03_Overview/1_Scoping_A02_t29: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/03_Overview/1_Scoping_A04_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/03_Overview/2_Privacy_A01_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/03_Overview/2_Privacy_A01_t04: Crash # "on T" catch block
+Language/03_Overview/2_Privacy_A01_t05: Crash # "on T" catch block
+Language/03_Overview/2_Privacy_A01_t06: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/03_Overview/2_Privacy_A01_t07: Crash # (try {a._setter=1;}on int catch (ok){}): "on T" catch block
+Language/03_Overview/2_Privacy_A01_t08: Crash # "on T" catch block
+Language/03_Overview/2_Privacy_A01_t09: Crash # "on T" catch block
+Language/03_Overview/2_Privacy_A01_t10: Crash # "on T" catch block
+Language/03_Overview/2_Privacy_A01_t11: Crash # "on T" catch block
+Language/03_Overview/2_Privacy_A01_t13: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/03_Overview/2_Privacy_A01_t14: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/03_Overview/2_Privacy_A01_t16: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/03_Overview/2_Privacy_A01_t18: Crash # "on T" catch block
+Language/03_Overview/2_Privacy_A01_t19: Crash # "on T" catch block
+Language/03_Overview/2_Privacy_A01_t20: Crash # "on T" catch block
+Language/03_Overview/2_Privacy_A01_t21: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/05_Variables/05_Variables_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/05_Variables/05_Variables_A03_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/05_Variables/05_Variables_A03_t02: Crash # (Expect): Error expression `Expect` unhandled.
+Language/05_Variables/05_Variables_A04_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/05_Variables/05_Variables_A07_t01: Crash # "on T" catch block
+Language/05_Variables/05_Variables_A07_t02: Crash # "on T" catch block
+Language/05_Variables/05_Variables_A07_t03: Crash # "on T" catch block
+Language/05_Variables/05_Variables_A07_t04: Crash # "on T" catch block
+Language/05_Variables/05_Variables_A07_t09: Crash # Please triage this failure.
+Language/05_Variables/05_Variables_A07_t10: Crash # "on T" catch block
+Language/05_Variables/05_Variables_A08_t01: Crash # (throw new ExpectException(message)): Unhandled node
+Language/05_Variables/05_Variables_A08_t02: Crash # (throw new ExpectException(message)): Unhandled node
+Language/05_Variables/05_Variables_A08_t03: Crash # Please triage this failure.
+Language/05_Variables/05_Variables_A09_t01: Crash # "on T" catch block
+Language/05_Variables/05_Variables_A11_t01: Crash # (w): Error expression `w` unhandled.
+Language/05_Variables/05_Variables_A11_t03: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/05_Variables/05_Variables_A12_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/05_Variables/05_Variables_A12_t09: Crash # "on T" catch block
+Language/05_Variables/05_Variables_A12_t10: Crash # "on T" catch block
+Language/05_Variables/05_Variables_A12_t11: Crash # "on T" catch block
+Language/05_Variables/05_Variables_A12_t12: Crash # unsupported element kind: z5:field
+Language/05_Variables/05_Variables_A13_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/05_Variables/05_Variables_A13_t02: Crash # "on T" catch block
+Language/05_Variables/05_Variables_A13_t03: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/05_Variables/05_Variables_A14_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/05_Variables/05_Variables_A14_t02: Crash # "on T" catch block
+Language/05_Variables/05_Variables_A14_t03: Crash # "on T" catch block
+Language/05_Variables/05_Variables_A14_t04: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/05_Variables/05_Variables_A14_t05: Crash # "on T" catch block
+Language/05_Variables/05_Variables_A14_t06: Crash # "on T" catch block
+Language/05_Variables/05_Variables_A14_t07: Crash # (throw new ExpectException(message)): Unhandled node
+Language/05_Variables/05_Variables_A15_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/05_Variables/05_Variables_A15_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/05_Variables/05_Variables_A15_t03: Crash # (throw new ExpectException(message)): Unhandled node
+Language/05_Variables/1_Evaluation_of_Implicit_Variable_Getters_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/05_Variables/1_Evaluation_of_Implicit_Variable_Getters_A01_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/05_Variables/1_Evaluation_of_Implicit_Variable_Getters_A01_t03: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/05_Variables/1_Evaluation_of_Implicit_Variable_Getters_A01_t04: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/05_Variables/1_Evaluation_of_Implicit_Variable_Getters_A01_t05: Crash # "on T" catch block
+Language/06_Functions/06_Functions_A01_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/06_Functions/06_Functions_A01_t06: Crash # (function()): Error expression `function()` unhandled.
+Language/06_Functions/06_Functions_A01_t07: Crash # (function()): Error expression `function()` unhandled.
+Language/06_Functions/06_Functions_A01_t08: Crash # (f()): Error expression `f()` unhandled.
+Language/06_Functions/06_Functions_A01_t09: Crash # (f()): Error expression `f()` unhandled.
+Language/06_Functions/06_Functions_A01_t10: Crash # (f()): Error expression `f()` unhandled.
+Language/06_Functions/06_Functions_A01_t12: Crash # (f()): Error expression `f()` unhandled.
+Language/06_Functions/06_Functions_A01_t14: Crash # (f()): Error expression `f()` unhandled.
+Language/06_Functions/06_Functions_A01_t15: Crash # (f()): Error expression `f()` unhandled.
+Language/06_Functions/06_Functions_A01_t16: Crash # (f()): Error expression `f()` unhandled.
+Language/06_Functions/06_Functions_A01_t17: Crash # (f()): Error expression `f()` unhandled.
+Language/06_Functions/06_Functions_A01_t18: Crash # (f()): Error expression `f()` unhandled.
+Language/06_Functions/06_Functions_A01_t19: Crash # (f()): Error expression `f()` unhandled.
+Language/06_Functions/06_Functions_A01_t20: Crash # (f()): Error expression `f()` unhandled.
+Language/06_Functions/06_Functions_A01_t21: Crash # (f()): Error expression `f()` unhandled.
+Language/06_Functions/06_Functions_A01_t23: Crash # (f()): Error expression `f()` unhandled.
+Language/06_Functions/06_Functions_A01_t24: Crash # (f()): Error expression `f()` unhandled.
+Language/06_Functions/06_Functions_A01_t25: Crash # (f()): Error expression `f()` unhandled.
+Language/06_Functions/06_Functions_A01_t33: Crash # (f2()): Error expression `f2()` unhandled.
+Language/06_Functions/06_Functions_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/06_Functions/06_Functions_A03_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/06_Functions/06_Functions_A04_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/06_Functions/1_Function_Declaration_A01_t01: Crash # (f()): Error expression `f()` unhandled.
+Language/06_Functions/1_Function_Declaration_A01_t03: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/06_Functions/2_Formal_Parameters/1_Required_Formals_A02_t05: Crash # "on T" catch block
+Language/06_Functions/2_Formal_Parameters/2_Optional_Formals_A01_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/06_Functions/2_Formal_Parameters/2_Optional_Formals_A01_t03: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/06_Functions/2_Formal_Parameters/2_Optional_Formals_A01_t04: Crash # (f()): Error expression `f()` unhandled.
+Language/06_Functions/2_Formal_Parameters/2_Optional_Formals_A01_t05: Crash # (f()): Error expression `f()` unhandled.
+Language/06_Functions/2_Formal_Parameters/2_Optional_Formals_A01_t06: Crash # "on T" catch block
+Language/06_Functions/2_Formal_Parameters/2_Optional_Formals_A01_t08: Crash # (f()): Error expression `f()` unhandled.
+Language/06_Functions/2_Formal_Parameters/2_Optional_Formals_A01_t09: Crash # (f()): Error expression `f()` unhandled.
+Language/06_Functions/2_Formal_Parameters/2_Optional_Formals_A01_t10: Crash # "on T" catch block
+Language/06_Functions/2_Formal_Parameters/2_Optional_Formals_A04_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/06_Functions/2_Formal_Parameters_A01_t02: Crash # (f(1,1)): Error expression `f(1,1)` unhandled.
+Language/06_Functions/2_Formal_Parameters_A01_t03: Crash # (f(1)): Error expression `f(1)` unhandled.
+Language/06_Functions/2_Formal_Parameters_A01_t04: Crash # (f(1)): Error expression `f(1)` unhandled.
+Language/06_Functions/2_Formal_Parameters_A01_t05: Crash # (f(1)): Error expression `f(1)` unhandled.
+Language/06_Functions/2_Formal_Parameters_A01_t06: Crash # (f()): Error expression `f()` unhandled.
+Language/06_Functions/2_Formal_Parameters_A01_t07: Crash # (f()): Error expression `f()` unhandled.
+Language/06_Functions/2_Formal_Parameters_A01_t09: Crash # (f(1,1)): Error expression `f(1,1)` unhandled.
+Language/06_Functions/2_Formal_Parameters_A01_t10: Crash # (f(1)): Error expression `f(1)` unhandled.
+Language/06_Functions/2_Formal_Parameters_A01_t12: Crash # (f(1)): Error expression `f(1)` unhandled.
+Language/06_Functions/2_Formal_Parameters_A01_t13: Crash # (f()): Error expression `f()` unhandled.
+Language/06_Functions/2_Formal_Parameters_A01_t14: Crash # (f()): Error expression `f()` unhandled.
+Language/06_Functions/2_Formal_Parameters_A01_t16: Crash # (f(1)): Error expression `f(1)` unhandled.
+Language/06_Functions/2_Formal_Parameters_A01_t17: Crash # (f(1)): Error expression `f(1)` unhandled.
+Language/06_Functions/2_Formal_Parameters_A01_t20: Crash # (f(1,2,3)): Error expression `f(1,2,3)` unhandled.
+Language/06_Functions/2_Formal_Parameters_A01_t21: Crash # (f(1,2,3)): Error expression `f(1,2,3)` unhandled.
+Language/06_Functions/2_Formal_Parameters_A02_t01: Crash # "on T" catch block
+Language/06_Functions/2_Formal_Parameters_A02_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/06_Functions/2_Formal_Parameters_A03_t03: Crash # (f(1)): handleStaticFunctionIncompatibleInvoke
+Language/06_Functions/2_Formal_Parameters_A03_t04: Crash # (f(1)): handleStaticFunctionIncompatibleInvoke
+Language/06_Functions/2_Formal_Parameters_A03_t06: Crash # (f(1)): handleStaticFunctionIncompatibleInvoke
+Language/06_Functions/3_Type_of_a_Function_A01_t01: Crash # "on T" catch block
+Language/06_Functions/4_External_Functions_A01_t01: Crash # "on T" catch block
+Language/07_Classes/07_Classes_A02_t12: Crash # (A): Error expression `A` unhandled.
+Language/07_Classes/07_Classes_A02_t13: Crash # (const A()): Error expression `const A()` unhandled.
+Language/07_Classes/07_Classes_A02_t16: Crash # (new A()): Error expression `new A()` unhandled.
+Language/07_Classes/07_Classes_A02_t17: Crash # (new A()): Error expression `new A()` unhandled.
+Language/07_Classes/07_Classes_A02_t18: Crash # (new A()): Error expression `new A()` unhandled.
+Language/07_Classes/07_Classes_A02_t19: Crash # (new A.B()): Error expression `new A.B()` unhandled.
+Language/07_Classes/07_Classes_A02_t21: Crash # (new A()): Error expression `new A()` unhandled.
+Language/07_Classes/07_Classes_A02_t22: Crash # (new A()): Error expression `new A()` unhandled.
+Language/07_Classes/07_Classes_A02_t23: Crash # (new A()): Error expression `new A()` unhandled.
+Language/07_Classes/07_Classes_A04_t01: Crash # (new A()): Error expression `new A()` unhandled.
+Language/07_Classes/07_Classes_A04_t02: Crash # (new A()): Error expression `new A()` unhandled.
+Language/07_Classes/07_Classes_A04_t04: Crash # (new A()): Error expression `new A()` unhandled.
+Language/07_Classes/07_Classes_A04_t05: Crash # (new A()): Error expression `new A()` unhandled.
+Language/07_Classes/07_Classes_A04_t13: Crash # (new A()): Error expression `new A()` unhandled.
+Language/07_Classes/07_Classes_A04_t17: Crash # (new A()): Error expression `new A()` unhandled.
+Language/07_Classes/07_Classes_A06_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/07_Classes/07_Classes_A06_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/07_Classes/07_Classes_A10_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/07_Classes/07_Classes_A11_t02: Crash # (new A()): Error expression `new A()` unhandled.
+Language/07_Classes/07_Classes_A11_t04: Crash # (new A()): Error expression `new A()` unhandled.
+Language/07_Classes/10_Superinterfaces_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/07_Classes/10_Superinterfaces_A07_t04: Crash # cannot compile methods that need interceptor calling convention.
+Language/07_Classes/1_Instance_Methods/2_Operators_A01_t01: Crash # cannot compile methods that need interceptor calling convention.
+Language/07_Classes/1_Instance_Methods/2_Operators_A01_t02: Crash # (new C()): Error expression `new C()` unhandled.
+Language/07_Classes/1_Instance_Methods/2_Operators_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/07_Classes/1_Instance_Methods/2_Operators_A02_t02: Crash # (new C()): Error expression `new C()` unhandled.
+Language/07_Classes/1_Instance_Methods/2_Operators_A02_t06: Crash # Please triage this failure.
+Language/07_Classes/1_Instance_Methods/2_Operators_A02_t20: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/07_Classes/1_Instance_Methods/2_Operators_A05_t01: Crash # (throw new ExpectException(message)): Unhandled node
+Language/07_Classes/1_Instance_Methods/2_Operators_A06_t01: Crash # (throw new ExpectException(message)): Unhandled node
+Language/07_Classes/1_Instance_Methods/2_Operators_A08_t01: Crash # cannot compile methods that need interceptor calling convention.
+Language/07_Classes/2_Getters_A01_t03: Crash # (try {var x=new C().getter;}on C catch (ok){}): "on T" catch block
+Language/07_Classes/2_Getters_A01_t05: Crash # (try {var x=C.getter;}on C catch (ok){}): "on T" catch block
+Language/07_Classes/2_Getters_A02_t01: Crash # "on T" catch block
+Language/07_Classes/2_Getters_A04_t08: Crash # (C.foo()): Error expression `C.foo()` unhandled.
+Language/07_Classes/2_Getters_A04_t09: Crash # (C.foo()): Error expression `C.foo()` unhandled.
+Language/07_Classes/3_Setters_A04_t01: Crash # "on T" catch block
+Language/07_Classes/3_Setters_A04_t05: Crash # "on T" catch block
+Language/07_Classes/3_Setters_A04_t07: Crash # (C.foo(1)): Error expression `C.foo(1)` unhandled.
+Language/07_Classes/3_Setters_A08_t01: Crash # (C.foo="foo"): Error expression `C.foo="foo"` unhandled.
+Language/07_Classes/3_Setters_A08_t02: Crash # (C.foo="foo"): Error expression `C.foo="foo"` unhandled.
+Language/07_Classes/3_Setters_A08_t04: Crash # (C.foo="foo"): Error expression `C.foo="foo"` unhandled.
+Language/07_Classes/3_Setters_A08_t05: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/07_Classes/4_Abstract_Instance_Members_A02_t01: Crash # "on T" catch block
+Language/07_Classes/4_Abstract_Instance_Members_A02_t02: Crash # "on T" catch block
+Language/07_Classes/4_Abstract_Instance_Members_A02_t03: Crash # "on T" catch block
+Language/07_Classes/4_Abstract_Instance_Members_A02_t04: Crash # "on T" catch block
+Language/07_Classes/4_Abstract_Instance_Members_A03_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/07_Classes/4_Abstract_Instance_Members_A03_t03: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/07_Classes/4_Abstract_Instance_Members_A03_t04: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/07_Classes/4_Abstract_Instance_Members_A04_t04: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/07_Classes/4_Abstract_Instance_Members_A04_t05: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/07_Classes/4_Abstract_Instance_Members_A04_t06: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/07_Classes/4_Abstract_Instance_Members_A07_t06: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/07_Classes/6_Constructors/1_Generative_Constructors_A01_t06: Crash # (new C.c3()): Error expression `new C.c3()` unhandled.
+Language/07_Classes/6_Constructors/1_Generative_Constructors_A02_t01: Crash # (throw new ExpectException(message)): Unhandled node
+Language/07_Classes/6_Constructors/1_Generative_Constructors_A03_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/07_Classes/6_Constructors/1_Generative_Constructors_A04_t01: Crash # handleStaticFunctionGet: function(foo)
+Language/07_Classes/6_Constructors/1_Generative_Constructors_A04_t02: Crash # (new C()): Error expression `new C()` unhandled.
+Language/07_Classes/6_Constructors/1_Generative_Constructors_A04_t03: Crash # (new C()): Error expression `new C()` unhandled.
+Language/07_Classes/6_Constructors/1_Generative_Constructors_A04_t05: Crash # (new C()): Error expression `new C()` unhandled.
+Language/07_Classes/6_Constructors/1_Generative_Constructors_A04_t07: Crash # (new C()): Error expression `new C()` unhandled.
+Language/07_Classes/6_Constructors/1_Generative_Constructors_A04_t09: Crash # (new C()): Error expression `new C()` unhandled.
+Language/07_Classes/6_Constructors/1_Generative_Constructors_A04_t10: Crash # (new C()): Error expression `new C()` unhandled.
+Language/07_Classes/6_Constructors/1_Generative_Constructors_A04_t11: Crash # (new C()): Error expression `new C()` unhandled.
+Language/07_Classes/6_Constructors/1_Generative_Constructors_A04_t15: Crash # "on T" catch block
+Language/07_Classes/6_Constructors/1_Generative_Constructors_A04_t16: Crash # (new C()): Error expression `new C()` unhandled.
+Language/07_Classes/6_Constructors/1_Generative_Constructors_A06_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/07_Classes/6_Constructors/1_Generative_Constructors_A06_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/07_Classes/6_Constructors/1_Generative_Constructors_A11_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/07_Classes/6_Constructors/1_Generative_Constructors_A11_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/07_Classes/6_Constructors/1_Generative_Constructors_A11_t03: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/07_Classes/6_Constructors/1_Generative_Constructors_A11_t10: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/07_Classes/6_Constructors/1_Generative_Constructors_A12_t01: Crash # (throw new ExpectException(message)): Unhandled node
+Language/07_Classes/6_Constructors/1_Generative_Constructors_A12_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/07_Classes/6_Constructors/1_Generative_Constructors_A12_t03: Crash # "on T" catch block
+Language/07_Classes/6_Constructors/1_Generative_Constructors_A12_t04: Crash # "on T" catch block
+Language/07_Classes/6_Constructors/1_Generative_Constructors_A13_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/07_Classes/6_Constructors/1_Generative_Constructors_A17_t01: Crash # "on T" catch block
+Language/07_Classes/6_Constructors/1_Generative_Constructors_A17_t02: Crash # "on T" catch block
+Language/07_Classes/6_Constructors/1_Generative_Constructors_A18_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/07_Classes/6_Constructors/1_Generative_Constructors_A18_t03: Crash # "on T" catch block
+Language/07_Classes/6_Constructors/1_Generative_Constructors_A20_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/07_Classes/6_Constructors/1_Generative_Constructors_A20_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/07_Classes/6_Constructors/2_Factories_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/07_Classes/6_Constructors/2_Factories_A03_t07: Crash # "on T" catch block
+Language/07_Classes/6_Constructors/2_Factories_A06_t01: Crash # "on T" catch block
+Language/07_Classes/6_Constructors/2_Factories_A06_t02: Crash # "on T" catch block
+Language/07_Classes/6_Constructors/2_Factories_A06_t03: Crash # "on T" catch block
+Language/07_Classes/6_Constructors/2_Factories_A06_t04: Crash # "on T" catch block
+Language/07_Classes/6_Constructors/2_Factories_A07_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/07_Classes/6_Constructors/2_Factories_A07_t02: Crash # (new A.foo()): Error expression `new A.foo()` unhandled.
+Language/07_Classes/6_Constructors/2_Factories_A08_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/07_Classes/6_Constructors/2_Factories_A08_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/07_Classes/6_Constructors/2_Factories_A09_t01: Crash # (new F()): Error expression `new F()` unhandled.
+Language/07_Classes/6_Constructors/2_Factories_A09_t02: Crash # (new F.id()): Error expression `new F.id()` unhandled.
+Language/07_Classes/6_Constructors/2_Factories_A09_t03: Crash # (new F()): Error expression `new F()` unhandled.
+Language/07_Classes/6_Constructors/2_Factories_A09_t04: Crash # (new F1()): Error expression `new F1()` unhandled.
+Language/07_Classes/6_Constructors/2_Factories_A10_t01: Crash # (new F()): Error expression `new F()` unhandled.
+Language/07_Classes/6_Constructors/2_Factories_A10_t02: Crash # (new F()): Error expression `new F()` unhandled.
+Language/07_Classes/6_Constructors/2_Factories_A10_t03: Crash # (new F()): Error expression `new F()` unhandled.
+Language/07_Classes/6_Constructors/2_Factories_A10_t04: Crash # (new F.foo()): Error expression `new F.foo()` unhandled.
+Language/07_Classes/6_Constructors/2_Factories_A12_t02: Crash # "on T" catch block
+Language/07_Classes/6_Constructors/2_Factories_A14_t03: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/07_Classes/6_Constructors_A01_t01: Crash # (new C.foo()): Error expression `new C.foo()` unhandled.
+Language/07_Classes/6_Constructors_A01_t02: Crash # (new C.foo()): Error expression `new C.foo()` unhandled.
+Language/07_Classes/6_Constructors_A01_t03: Crash # (new C.foo()): Error expression `new C.foo()` unhandled.
+Language/07_Classes/6_Constructors_A01_t06: Crash # (new C.foo()): Error expression `new C.foo()` unhandled.
+Language/07_Classes/6_Constructors_A03_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/07_Classes/6_Constructors_A03_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/07_Classes/6_Constructors_A03_t03: Crash # "on T" catch block
+Language/07_Classes/7_Static_Methods_A01_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/07_Classes/7_Static_Methods_A01_t03: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/07_Classes/8_Static_Variables_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/07_Classes/9_Superclasses/1_Inheritance_and_Overriding_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/07_Classes/9_Superclasses/1_Inheritance_and_Overriding_A01_t03: Crash # "on T" catch block
+Language/07_Classes/9_Superclasses/1_Inheritance_and_Overriding_A01_t05: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/07_Classes/9_Superclasses/1_Inheritance_and_Overriding_A01_t06: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/07_Classes/9_Superclasses/1_Inheritance_and_Overriding_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/07_Classes/9_Superclasses/1_Inheritance_and_Overriding_A02_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/07_Classes/9_Superclasses/1_Inheritance_and_Overriding_A02_t03: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/07_Classes/9_Superclasses/1_Inheritance_and_Overriding_A02_t04: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/07_Classes/9_Superclasses_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/07_Classes/9_Superclasses_A04_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/07_Classes/9_Superclasses_A05_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/08_Interfaces/5_Superinterfaces/1_Inheritance_and_Overriding_A01_t01: Crash # "on T" catch block
+Language/08_Interfaces/5_Superinterfaces/1_Inheritance_and_Overriding_A01_t02: Crash # "on T" catch block
+Language/08_Interfaces/5_Superinterfaces/1_Inheritance_and_Overriding_A02_t01: Crash # "on T" catch block
+Language/08_Interfaces/5_Superinterfaces/1_Inheritance_and_Overriding_A02_t02: Crash # "on T" catch block
+Language/08_Interfaces/5_Superinterfaces/1_Inheritance_and_Overriding_A02_t04: Crash # "on T" catch block
+Language/08_Interfaces/5_Superinterfaces/1_Inheritance_and_Overriding_A02_t05: Crash # "on T" catch block
+Language/08_Interfaces/5_Superinterfaces_A01_t04: Crash # (new B()): Error expression `new B()` unhandled.
+Language/10_Generics/09_Generics_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/10_Generics/09_Generics_A01_t16: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/10_Generics/09_Generics_A03_t01: Crash # "on T" catch block
+Language/10_Generics/09_Generics_A04_t03: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/10_Generics/09_Generics_A04_t06: Crash # "on T" catch block
+Language/10_Generics/10_Generics_A05_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/10_Generics/10_Generics_A05_t02: Crash # "on T" catch block
+Language/10_Generics/10_Generics_A05_t03: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/00_Object_Identity/1_Object_Identity_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+Language/12_Expressions/00_Object_Identity/1_Object_Identity_A01_t02: Crash # (throw new ExpectException(message)): Unhandled node
+Language/12_Expressions/00_Object_Identity/1_Object_Identity_A02_t01: Crash # (throw new ExpectException(message)): Unhandled node
+Language/12_Expressions/00_Object_Identity/1_Object_Identity_A02_t02: Crash # (throw new ExpectException(message)): Unhandled node
+Language/12_Expressions/00_Object_Identity/1_Object_Identity_A03_t01: Crash # (throw new ExpectException(message)): Unhandled node
+Language/12_Expressions/00_Object_Identity/1_Object_Identity_A03_t02: Crash # (throw new ExpectException(message)): Unhandled node
+Language/12_Expressions/00_Object_Identity/1_Object_Identity_A04_t01: Crash # (throw new ExpectException(message)): Unhandled node
+Language/12_Expressions/00_Object_Identity/1_Object_Identity_A04_t02: Crash # Please triage this failure.
+Language/12_Expressions/00_Object_Identity/1_Object_Identity_A05_t01: Crash # (throw new ExpectException(message)): Unhandled node
+Language/12_Expressions/00_Object_Identity/1_Object_Identity_A05_t02: Crash # (throw new ExpectException(message)): Unhandled node
+Language/12_Expressions/00_Object_Identity/1_Object_Identity_A06_t01: Crash # (throw new ExpectException(message)): Unhandled node
+Language/12_Expressions/00_Object_Identity/1_Object_Identity_A07_t01: Crash # (throw new ExpectException(message)): Unhandled node
+Language/12_Expressions/00_Object_Identity/1_Object_Identity_A07_t02: Crash # (throw new ExpectException(message)): Unhandled node
+Language/12_Expressions/00_Object_Identity/1_Object_Identity_A08_t01: Crash # (throw new ExpectException(message)): Unhandled node
+Language/12_Expressions/01_Constants_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/01_Constants_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/01_Constants_A03_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/01_Constants_A04_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/01_Constants_A05_t01: Crash # (throw new ExpectException(message)): Unhandled node
+Language/12_Expressions/01_Constants_A06_t01: Crash # (throw new ExpectException(message)): Unhandled node
+Language/12_Expressions/01_Constants_A07_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/01_Constants_A08_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/01_Constants_A09_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/01_Constants_A10_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/01_Constants_A10_t03: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/01_Constants_A11_t04: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/01_Constants_A12_t03: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/01_Constants_A12_t04: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/01_Constants_A12_t05: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/01_Constants_A12_t06: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/01_Constants_A13_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/01_Constants_A13_t05: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/01_Constants_A14_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/01_Constants_A14_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/02_Null_A03_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/02_Null_A05_t02: Crash # "on T" catch block
+Language/12_Expressions/03_Numbers_A01_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/03_Numbers_A01_t03: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/03_Numbers_A01_t04: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/03_Numbers_A01_t05: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/03_Numbers_A01_t06: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/03_Numbers_A01_t09: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/03_Numbers_A01_t10: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/03_Numbers_A05_t02: Crash # "on T" catch block
+Language/12_Expressions/03_Numbers_A06_t02: Crash # "on T" catch block
+Language/12_Expressions/04_Booleans/1_Boolean_Conversion_A01_t01: Crash # (try {if(null){}fail=true;}on AssertionError catch (ok){}): "on T" catch block
+Language/12_Expressions/04_Booleans/1_Boolean_Conversion_A01_t02: Crash # (throw new ExpectException(message)): Unhandled node
+Language/12_Expressions/04_Booleans/1_Boolean_Conversion_A01_t03: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/04_Booleans/1_Boolean_Conversion_A02_t01: Crash # "on T" catch block
+Language/12_Expressions/04_Booleans_A02_t01: Crash # (throw new ExpectException(message)): Unhandled node
+Language/12_Expressions/04_Booleans_A04_t02: Crash # "on T" catch block
+Language/12_Expressions/05_Strings/1_String_Interpolation_A01_t06: Crash # (try {"${T}";}on NoSuchMethodError catch (ok){print(ok);}): "on T" catch block
+Language/12_Expressions/05_Strings/1_String_Interpolation_A01_t07: Crash # "on T" catch block
+Language/12_Expressions/05_Strings/1_String_Interpolation_A01_t12: Crash # handleStaticFunctionGet: function(foo)
+Language/12_Expressions/05_Strings/1_String_Interpolation_A01_t13: Crash # "on T" catch block
+Language/12_Expressions/05_Strings/1_String_Interpolation_A01_t17: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/05_Strings/1_String_Interpolation_A02_t01: Crash # (throw new ExpectException(message)): Unhandled node
+Language/12_Expressions/05_Strings/1_String_Interpolation_A02_t02: Crash # (throw new ExpectException(message)): Unhandled node
+Language/12_Expressions/05_Strings/1_String_Interpolation_A03_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/05_Strings/1_String_Interpolation_A03_t02: Crash # "on T" catch block
+Language/12_Expressions/05_Strings/1_String_Interpolation_A03_t03: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/05_Strings/1_String_Interpolation_A04_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/05_Strings/1_String_Interpolation_A04_t02: Crash # "on T" catch block
+Language/12_Expressions/05_Strings/1_String_Interpolation_A04_t03: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/05_Strings/1_String_Interpolation_A04_t04: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/05_Strings_A03_t01: Crash # (throw new ExpectException(message)): Unhandled node
+Language/12_Expressions/05_Strings_A04_t01: Crash # (throw new ExpectException(message)): Unhandled node
+Language/12_Expressions/05_Strings_A05_t01: Crash # (throw new ExpectException(message)): Unhandled node
+Language/12_Expressions/05_Strings_A06_t01: Crash # (throw new ExpectException(message)): Unhandled node
+Language/12_Expressions/05_Strings_A07_t01: Crash # (throw new ExpectException(message)): Unhandled node
+Language/12_Expressions/05_Strings_A08_t01: Crash # (throw new ExpectException(message)): Unhandled node
+Language/12_Expressions/05_Strings_A09_t01: Crash # (throw new ExpectException(message)): Unhandled node
+Language/12_Expressions/05_Strings_A10_t01: Crash # (throw new ExpectException(message)): Unhandled node
+Language/12_Expressions/05_Strings_A11_t01: Crash # (throw new ExpectException(message)): Unhandled node
+Language/12_Expressions/05_Strings_A12_t01: Crash # (throw new ExpectException(message)): Unhandled node
+Language/12_Expressions/05_Strings_A13_t04: Crash # (throw new ExpectException(message)): Unhandled node
+Language/12_Expressions/05_Strings_A14_t05: Crash # (throw new ExpectException(message)): Unhandled node
+Language/12_Expressions/05_Strings_A15_t01: Crash # (throw new ExpectException(message)): Unhandled node
+Language/12_Expressions/05_Strings_A15_t02: Crash # (throw new ExpectException(message)): Unhandled node
+Language/12_Expressions/05_Strings_A16_t01: Crash # (throw new ExpectException(message)): Unhandled node
+Language/12_Expressions/05_Strings_A18_t02: Crash # "on T" catch block
+Language/12_Expressions/05_Strings_A18_t03: Crash # "on T" catch block
+Language/12_Expressions/05_Strings_A18_t04: Crash # "on T" catch block
+Language/12_Expressions/05_Strings_A18_t05: Crash # "on T" catch block
+Language/12_Expressions/05_Strings_A18_t06: Crash # "on T" catch block
+Language/12_Expressions/05_Strings_A18_t07: Crash # "on T" catch block
+Language/12_Expressions/05_Strings_A18_t08: Crash # "on T" catch block
+Language/12_Expressions/05_Strings_A18_t09: Crash # "on T" catch block
+Language/12_Expressions/05_Strings_A20_t01: Crash # (throw new ExpectException(message)): Unhandled node
+Language/12_Expressions/05_Strings_A21_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/05_Strings_A21_t02: Crash # (throw new ExpectException(message)): Unhandled node
+Language/12_Expressions/05_Strings_A21_t03: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/05_Strings_A21_t05: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/06_Lists_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/06_Lists_A05_t01: Crash # (throw new ExpectException(message)): Unhandled node
+Language/12_Expressions/06_Lists_A05_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/06_Lists_A06_t01: Crash # Please triage this failure.
+Language/12_Expressions/06_Lists_A07_t01: Crash # (throw new ExpectException(message)): Unhandled node
+Language/12_Expressions/06_Lists_A07_t02: Crash # (throw new ExpectException(message)): Unhandled node
+Language/12_Expressions/06_Lists_A08_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/06_Lists_A08_t02: Crash # (throw new ExpectException(message)): Unhandled node
+Language/12_Expressions/06_Lists_A08_t03: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/06_Lists_A08_t04: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/06_Lists_A09_t01: Crash # "on T" catch block
+Language/12_Expressions/06_Lists_A09_t02: Crash # "on T" catch block
+Language/12_Expressions/06_Lists_A09_t03: Crash # "on T" catch block
+Language/12_Expressions/06_Lists_A09_t04: Crash # "on T" catch block
+Language/12_Expressions/06_Lists_A09_t05: Crash # "on T" catch block
+Language/12_Expressions/06_Symbols_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+Language/12_Expressions/06_Symbols_A01_t02: Crash # (throw new ExpectException(message)): Unhandled node
+Language/12_Expressions/07_Maps_A04_t01: Crash # (throw new ExpectException(message)): Unhandled node
+Language/12_Expressions/07_Maps_A04_t02: Crash # Please triage this failure.
+Language/12_Expressions/07_Maps_A05_t01: Crash # Please triage this failure.
+Language/12_Expressions/07_Maps_A06_t01: Crash # Please triage this failure.
+Language/12_Expressions/07_Maps_A06_t02: Crash # Please triage this failure.
+Language/12_Expressions/07_Maps_A07_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/07_Maps_A07_t02: Crash # (throw new ExpectException(message)): Unhandled node
+Language/12_Expressions/07_Maps_A07_t03: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/07_Maps_A07_t04: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/07_Maps_A09_t01: Crash # Please triage this failure.
+Language/12_Expressions/07_Maps_A10_t02: Crash # "on T" catch block
+Language/12_Expressions/07_Maps_A10_t03: Crash # "on T" catch block
+Language/12_Expressions/07_Maps_A10_t04: Crash # "on T" catch block
+Language/12_Expressions/07_Maps_A10_t05: Crash # "on T" catch block
+Language/12_Expressions/08_Throw_A02_t01: Crash # (throw "fail1"): Unhandled node
+Language/12_Expressions/08_Throw_A03_t02: Crash # "on T" catch block
+Language/12_Expressions/08_Throw_A03_t03: Crash # "on T" catch block
+Language/12_Expressions/08_Throw_A03_t04: Crash # "on T" catch block
+Language/12_Expressions/08_Throw_A04_t01: Crash # (throw last): Unhandled node
+Language/12_Expressions/08_Throw_A08_t01: Crash # (try {bar(new Error());}on Error catch (e){Expect.isNotNull(e.stackTrace);}): "on T" catch block
+Language/12_Expressions/09_Function_Expressions_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/09_Function_Expressions_A03_t03: Crash # "on T" catch block
+Language/12_Expressions/09_Function_Expressions_A03_t04: Crash # "on T" catch block
+Language/12_Expressions/09_Function_Expressions_A04_t03: Crash # "on T" catch block
+Language/12_Expressions/09_Function_Expressions_A04_t04: Crash # "on T" catch block
+Language/12_Expressions/09_Function_Expressions_A05_t02: Crash # "on T" catch block
+Language/12_Expressions/09_Function_Expressions_A05_t03: Crash # "on T" catch block
+Language/12_Expressions/09_Function_Expressions_A05_t04: Crash # "on T" catch block
+Language/12_Expressions/09_Function_Expressions_A05_t05: Crash # "on T" catch block
+Language/12_Expressions/09_Function_Expressions_A06_t02: Crash # "on T" catch block
+Language/12_Expressions/09_Function_Expressions_A06_t03: Crash # "on T" catch block
+Language/12_Expressions/09_Function_Expressions_A06_t04: Crash # "on T" catch block
+Language/12_Expressions/10_Expressions_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/10_This_A01_t06: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/10_This_A02_t01: Crash # "on T" catch block
+Language/12_Expressions/10_This_A03_t02: Crash # (func(1,2)): Error expression `func(1,2)` unhandled.
+Language/12_Expressions/12_Instance_Creation/1_New_A01_t04: Crash # (try {A();}on NoSuchMethodError catch (e){}): "on T" catch block
+Language/12_Expressions/12_Instance_Creation/1_New_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/12_Instance_Creation/1_New_A02_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/12_Instance_Creation/1_New_A02_t07: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/12_Instance_Creation/1_New_A03_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/12_Instance_Creation/1_New_A03_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/12_Instance_Creation/1_New_A04_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/12_Instance_Creation/1_New_A04_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/12_Instance_Creation/1_New_A06_t01: Crash # "on T" catch block
+Language/12_Expressions/12_Instance_Creation/1_New_A06_t02: Crash # "on T" catch block
+Language/12_Expressions/12_Instance_Creation/1_New_A06_t03: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/12_Instance_Creation/1_New_A06_t04: Crash # "on T" catch block
+Language/12_Expressions/12_Instance_Creation/1_New_A06_t05: Crash # "on T" catch block
+Language/12_Expressions/12_Instance_Creation/1_New_A06_t06: Crash # "on T" catch block
+Language/12_Expressions/12_Instance_Creation/1_New_A06_t07: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/12_Instance_Creation/1_New_A06_t08: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/12_Instance_Creation/1_New_A06_t09: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/12_Instance_Creation/1_New_A06_t12: Crash # "on T" catch block
+Language/12_Expressions/12_Instance_Creation/1_New_A06_t13: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/12_Instance_Creation/1_New_A06_t14: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/12_Instance_Creation/1_New_A06_t15: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/12_Instance_Creation/1_New_A06_t16: Crash # "on T" catch block
+Language/12_Expressions/12_Instance_Creation/1_New_A06_t17: Crash # "on T" catch block
+Language/12_Expressions/12_Instance_Creation/1_New_A06_t18: Crash # "on T" catch block
+Language/12_Expressions/12_Instance_Creation/1_New_A07_t01: Crash # "on T" catch block
+Language/12_Expressions/12_Instance_Creation/1_New_A08_t01: Crash # (throw new ExpectException(message)): Unhandled node
+Language/12_Expressions/12_Instance_Creation/1_New_A08_t02: Crash # (throw new ExpectException(message)): Unhandled node
+Language/12_Expressions/12_Instance_Creation/1_New_A08_t03: Crash # (throw new ExpectException(message)): Unhandled node
+Language/12_Expressions/12_Instance_Creation/1_New_A09_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/12_Instance_Creation/1_New_A09_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/12_Instance_Creation/1_New_A09_t03: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/12_Instance_Creation/1_New_A09_t04: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/12_Instance_Creation/1_New_A09_t05: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/12_Instance_Creation/1_New_A09_t06: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/12_Instance_Creation/1_New_A09_t07: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/12_Instance_Creation/1_New_A09_t08: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/12_Instance_Creation/1_New_A09_t09: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/12_Instance_Creation/1_New_A09_t10: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/12_Instance_Creation/1_New_A09_t11: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/12_Instance_Creation/1_New_A09_t12: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/12_Instance_Creation/1_New_A09_t13: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/12_Instance_Creation/1_New_A09_t14: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/12_Instance_Creation/1_New_A12_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/12_Instance_Creation/1_New_A12_t02: Crash # "on T" catch block
+Language/12_Expressions/12_Instance_Creation/1_New_A13_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/12_Instance_Creation/1_New_A13_t03: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/12_Instance_Creation/1_New_A13_t04: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/12_Instance_Creation/1_New_A15_t01: Crash # "on T" catch block
+Language/12_Expressions/12_Instance_Creation/1_New_A15_t02: Crash # "on T" catch block
+Language/12_Expressions/12_Instance_Creation/1_New_A16_t01: Crash # (new C()): Error expression `new C()` unhandled.
+Language/12_Expressions/12_Instance_Creation/1_New_A16_t02: Crash # (new C.id()): Error expression `new C.id()` unhandled.
+Language/12_Expressions/12_Instance_Creation/2_Const_A08_t01: Crash # (throw new ExpectException(message)): Unhandled node
+Language/12_Expressions/12_Instance_Creation/2_Const_A08_t02: Crash # (throw new ExpectException(message)): Unhandled node
+Language/12_Expressions/12_Instance_Creation/2_Const_A08_t03: Crash # (throw new ExpectException(message)): Unhandled node
+Language/12_Expressions/12_Instance_Creation/2_Const_A08_t04: Crash # (throw new ExpectException(message)): Unhandled node
+Language/12_Expressions/12_Instance_Creation/2_Const_A08_t05: Crash # (throw new ExpectException(message)): Unhandled node
+Language/12_Expressions/12_Instance_Creation_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/12_Instance_Creation_A01_t03: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/12_Instance_Creation_A01_t07: Crash # "on T" catch block
+Language/12_Expressions/13_Property_Extraction_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/13_Property_Extraction_A01_t02: Crash # (throw new ExpectException(message)): Unhandled node
+Language/12_Expressions/13_Property_Extraction_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/13_Property_Extraction_A02_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/13_Property_Extraction_A03_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/13_Property_Extraction_A03_t02: Crash # (throw new ExpectException(message)): Unhandled node
+Language/12_Expressions/13_Property_Extraction_A03_t03: RuntimeError # Please triage this failure.
+Language/12_Expressions/13_Property_Extraction_A04_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/13_Property_Extraction_A04_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/13_Property_Extraction_A04_t03: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/13_Spawning_an_Isolate_A01_t01: Crash # unsupported element kind: _completer:field
+Language/12_Expressions/14_Function_Invocation/1_Actual_Argument_List_Evaluation_A01_t01: Crash # Please triage this failure.
+Language/12_Expressions/14_Function_Invocation/1_Actual_Argument_List_Evaluation_A02_t01: Crash # (throw new ExpectException(message)): Unhandled node
+Language/12_Expressions/14_Function_Invocation/2_Binding_Actuals_to_Formals_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/14_Function_Invocation/2_Binding_Actuals_to_Formals_A01_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/14_Function_Invocation/2_Binding_Actuals_to_Formals_A01_t03: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/14_Function_Invocation/2_Binding_Actuals_to_Formals_A01_t04: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/14_Function_Invocation/2_Binding_Actuals_to_Formals_A01_t05: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/14_Function_Invocation/2_Binding_Actuals_to_Formals_A02_t01: Crash # "on T" catch block
+Language/12_Expressions/14_Function_Invocation/2_Binding_Actuals_to_Formals_A03_t01: Crash # "on T" catch block
+Language/12_Expressions/14_Function_Invocation/2_Binding_Actuals_to_Formals_A05_t01: Crash # "on T" catch block
+Language/12_Expressions/14_Function_Invocation/2_Binding_Actuals_to_Formals_A05_t02: Crash # "on T" catch block
+Language/12_Expressions/14_Function_Invocation/2_Binding_Actuals_to_Formals_A05_t03: Crash # "on T" catch block
+Language/12_Expressions/14_Function_Invocation/2_Binding_Actuals_to_Formals_A05_t04: Crash # "on T" catch block
+Language/12_Expressions/14_Function_Invocation/2_Binding_Actuals_to_Formals_A06_t01: Crash # Please triage this failure.
+Language/12_Expressions/14_Function_Invocation/2_Binding_Actuals_to_Formals_A06_t04: Crash # Please triage this failure.
+Language/12_Expressions/14_Function_Invocation/2_Binding_Actuals_to_Formals_A06_t05: Crash # (func(1,2,3,4)): handleStaticFunctionIncompatibleInvoke
+Language/12_Expressions/14_Function_Invocation/2_Binding_Actuals_to_Formals_A06_t08: Crash # (C.func(1,2,3,4)): handleStaticFunctionIncompatibleInvoke
+Language/12_Expressions/14_Function_Invocation/2_Binding_Actuals_to_Formals_A07_t01: Crash # (func(1,2,p:3)): handleStaticFunctionIncompatibleInvoke
+Language/12_Expressions/14_Function_Invocation/2_Binding_Actuals_to_Formals_A07_t04: Crash # (C.func(1,2,p:3)): handleStaticFunctionIncompatibleInvoke
+Language/12_Expressions/14_Function_Invocation/2_Binding_Actuals_to_Formals_A08_t01: Crash # "on T" catch block
+Language/12_Expressions/14_Function_Invocation/2_Binding_Actuals_to_Formals_A08_t02: Crash # "on T" catch block
+Language/12_Expressions/14_Function_Invocation/2_Binding_Actuals_to_Formals_A08_t03: Crash # "on T" catch block
+Language/12_Expressions/14_Function_Invocation/2_Binding_Actuals_to_Formals_A08_t04: Crash # "on T" catch block
+Language/12_Expressions/14_Function_Invocation/3_Unqualified_Invocation_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/14_Function_Invocation/3_Unqualified_Invocation_A01_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/14_Function_Invocation/3_Unqualified_Invocation_A01_t03: Crash # "on T" catch block
+Language/12_Expressions/14_Function_Invocation/3_Unqualified_Invocation_A01_t04: Crash # "on T" catch block
+Language/12_Expressions/14_Function_Invocation/3_Unqualified_Invocation_A01_t05: Crash # "on T" catch block
+Language/12_Expressions/14_Function_Invocation/3_Unqualified_Invocation_A01_t06: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/14_Function_Invocation/3_Unqualified_Invocation_A01_t07: Crash # "on T" catch block
+Language/12_Expressions/14_Function_Invocation/3_Unqualified_Invocation_A01_t08: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/14_Function_Invocation/3_Unqualified_Invocation_A01_t09: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/14_Function_Invocation/3_Unqualified_Invocation_A01_t10: Crash # (try {undeclared();}on NoSuchMethodError catch (ok){}): "on T" catch block
+Language/12_Expressions/14_Function_Invocation/3_Unqualified_Invocation_A01_t11: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/14_Function_Invocation/3_Unqualified_Invocation_A01_t13: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/14_Function_Invocation/3_Unqualified_Invocation_A01_t14: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/14_Function_Invocation/3_Unqualified_Invocation_A01_t15: Crash # (throw new ExpectException(message)): Unhandled node
+Language/12_Expressions/14_Function_Invocation/3_Unqualified_Invocation_A01_t16: Crash # (throw new ExpectException(message)): Unhandled node
+Language/12_Expressions/14_Function_Invocation/3_Unqualified_Invocation_A01_t17: Crash # unable to build cps definition of generative_constructor(C#)
+Language/12_Expressions/14_Function_Invocation/4_Function_Expression_Invocation_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/14_Function_Invocation/4_Function_Expression_Invocation_A01_t02: Crash # "on T" catch block
+Language/12_Expressions/14_Function_Invocation/4_Function_Expression_Invocation_A02_t01: Crash # "on T" catch block
+Language/12_Expressions/14_Function_Invocation/4_Function_Expression_Invocation_A03_t01: Crash # "on T" catch block
+Language/12_Expressions/14_Function_Invocation/4_Function_Expression_Invocation_A03_t02: Crash # "on T" catch block
+Language/12_Expressions/14_Function_Invocation/4_Function_Expression_Invocation_A04_t02: Crash # "on T" catch block
+Language/12_Expressions/14_Function_Invocation/4_Function_Expression_Invocation_A05_t02: Crash # "on T" catch block
+Language/12_Expressions/14_Function_Invocation_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+Language/12_Expressions/14_Function_Invocation_A01_t02: Crash # (throw new ExpectException(message)): Unhandled node
+Language/12_Expressions/14_Function_Invocation_A01_t03: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/14_Function_Invocation_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/15_Method_Invocation/1_Ordinary_Invocation_A02_t01: Crash # "on T" catch block
+Language/12_Expressions/15_Method_Invocation/1_Ordinary_Invocation_A03_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/15_Method_Invocation/1_Ordinary_Invocation_A03_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/15_Method_Invocation/1_Ordinary_Invocation_A03_t03: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/15_Method_Invocation/1_Ordinary_Invocation_A03_t04: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/15_Method_Invocation/1_Ordinary_Invocation_A04_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/15_Method_Invocation/1_Ordinary_Invocation_A04_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/15_Method_Invocation/1_Ordinary_Invocation_A04_t03: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/15_Method_Invocation/1_Ordinary_Invocation_A04_t04: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/15_Method_Invocation/1_Ordinary_Invocation_A05_t01: Crash # "on T" catch block
+Language/12_Expressions/15_Method_Invocation/1_Ordinary_Invocation_A05_t02: Crash # "on T" catch block
+Language/12_Expressions/15_Method_Invocation/1_Ordinary_Invocation_A05_t03: Crash # "on T" catch block
+Language/12_Expressions/15_Method_Invocation/1_Ordinary_Invocation_A05_t04: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/15_Method_Invocation/1_Ordinary_Invocation_A05_t05: Crash # "on T" catch block
+Language/12_Expressions/15_Method_Invocation/1_Ordinary_Invocation_A05_t06: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/15_Method_Invocation/1_Ordinary_Invocation_A05_t07: Crash # "on T" catch block
+Language/12_Expressions/15_Method_Invocation/1_Ordinary_Invocation_A06_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/15_Method_Invocation/1_Ordinary_Invocation_A06_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/15_Method_Invocation/1_Ordinary_Invocation_A06_t03: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/15_Method_Invocation/1_Ordinary_Invocation_A06_t04: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/15_Method_Invocation/1_Ordinary_Invocation_A07_t01: Crash # "on T" catch block
+Language/12_Expressions/15_Method_Invocation/1_Ordinary_Invocation_A08_t01: Crash # "on T" catch block
+Language/12_Expressions/15_Method_Invocation/2_Cascaded_Invocation_A01_t01: Crash # cannot compile methods that need interceptor calling convention.
+Language/12_Expressions/15_Method_Invocation/2_Cascaded_Invocation_A01_t19: Crash # "on T" catch block
+Language/12_Expressions/15_Method_Invocation/2_Cascaded_Invocation_A02_t01: Crash # (throw new ExpectException(message)): Unhandled node
+Language/12_Expressions/15_Method_Invocation/2_Cascaded_Invocation_A02_t02: Crash # "on T" catch block
+Language/12_Expressions/15_Method_Invocation/3_Static_Invocation_A02_t01: Crash # (C): Error expression `C` unhandled.
+Language/12_Expressions/15_Method_Invocation/3_Static_Invocation_A03_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/15_Method_Invocation/3_Static_Invocation_A03_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/15_Method_Invocation/3_Static_Invocation_A03_t03: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/15_Method_Invocation/3_Static_Invocation_A03_t04: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/15_Method_Invocation/3_Static_Invocation_A03_t05: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/15_Method_Invocation/3_Static_Invocation_A03_t06: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/15_Method_Invocation/3_Static_Invocation_A03_t07: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/15_Method_Invocation/3_Static_Invocation_A04_t01: Crash # "on T" catch block
+Language/12_Expressions/15_Method_Invocation/3_Static_Invocation_A04_t02: Crash # "on T" catch block
+Language/12_Expressions/15_Method_Invocation/3_Static_Invocation_A04_t03: Crash # "on T" catch block
+Language/12_Expressions/15_Method_Invocation/3_Static_Invocation_A04_t04: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/15_Method_Invocation/3_Static_Invocation_A04_t05: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/15_Method_Invocation/3_Static_Invocation_A04_t06: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/15_Method_Invocation/3_Static_Invocation_A04_t07: Crash # "on T" catch block
+Language/12_Expressions/15_Method_Invocation/3_Static_Invocation_A04_t08: Crash # "on T" catch block
+Language/12_Expressions/15_Method_Invocation/3_Static_Invocation_A04_t09: Crash # "on T" catch block
+Language/12_Expressions/15_Method_Invocation/3_Static_Invocation_A05_t01: Crash # "on T" catch block
+Language/12_Expressions/15_Method_Invocation/3_Static_Invocation_A06_t02: Crash # "on T" catch block
+Language/12_Expressions/15_Method_Invocation/4_Super_Invocation_A01_t01: RuntimeError # Please triage this failure.
+Language/12_Expressions/15_Method_Invocation/4_Super_Invocation_A02_t01: Crash # "on T" catch block
+Language/12_Expressions/15_Method_Invocation/4_Super_Invocation_A02_t02: Crash # "on T" catch block
+Language/12_Expressions/15_Method_Invocation/4_Super_Invocation_A02_t03: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/15_Method_Invocation/4_Super_Invocation_A02_t04: Crash # "on T" catch block
+Language/12_Expressions/15_Method_Invocation/4_Super_Invocation_A02_t05: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/15_Method_Invocation/4_Super_Invocation_A03_t01: Crash # "on T" catch block
+Language/12_Expressions/15_Method_Invocation/4_Super_Invocation_A03_t02: Crash # "on T" catch block
+Language/12_Expressions/15_Method_Invocation/4_Super_Invocation_A03_t03: Crash # "on T" catch block
+Language/12_Expressions/15_Method_Invocation/4_Super_Invocation_A03_t04: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/15_Method_Invocation/4_Super_Invocation_A04_t01: Crash # (throw new TestException()): Unhandled node
+Language/12_Expressions/15_Method_Invocation/4_Super_Invocation_A04_t02: Crash # cannot compile methods that need interceptor calling convention.
+Language/12_Expressions/15_Method_Invocation/4_Super_Invocation_A04_t03: Crash # (throw new TestException()): Unhandled node
+Language/12_Expressions/15_Method_Invocation/4_Super_Invocation_A04_t04: Crash # (throw new TestException()): Unhandled node
+Language/12_Expressions/15_Method_Invocation/4_Super_Invocation_A06_t01: Crash # "on T" catch block
+Language/12_Expressions/15_Method_Invocation/4_Super_Invocation_A06_t02: Crash # "on T" catch block
+Language/12_Expressions/15_Method_Invocation/4_Super_Invocation_A06_t03: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/15_Method_Invocation/4_Super_Invocation_A06_t04: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/15_Method_Invocation/4_Super_Invocation_A06_t05: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/15_Method_Invocation/4_Super_Invocation_A07_t01: Crash # "on T" catch block
+Language/12_Expressions/15_Method_Invocation/4_Super_Invocation_A08_t02: Crash # "on T" catch block
+Language/12_Expressions/16_Getter_Lookup_A02_t05: Crash # (throw new ExpectException(message)): Unhandled node
+Language/12_Expressions/16_Getter_Lookup_A02_t06: Crash # (throw new ExpectException(message)): Unhandled node
+Language/12_Expressions/17_Getter_Invocation_A01_t01: Crash # "on T" catch block
+Language/12_Expressions/17_Getter_Invocation_A01_t02: Crash # "on T" catch block
+Language/12_Expressions/17_Getter_Invocation_A01_t03: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/17_Getter_Invocation_A01_t04: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/17_Getter_Invocation_A02_t01: Crash # "on T" catch block
+Language/12_Expressions/17_Getter_Invocation_A02_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/17_Getter_Invocation_A04_t02: Crash # "on T" catch block
+Language/12_Expressions/17_Getter_Invocation_A05_t01: Crash # "on T" catch block
+Language/12_Expressions/17_Getter_Invocation_A05_t02: Crash # "on T" catch block
+Language/12_Expressions/17_Getter_Invocation_A05_t03: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/17_Getter_Invocation_A05_t04: Crash # "on T" catch block
+Language/12_Expressions/17_Getter_Invocation_A05_t05: Crash # "on T" catch block
+Language/12_Expressions/17_Getter_Invocation_A06_t01: Crash # (try {v;Expect.fail("TestException is expected");}on TestException catch (e){}): "on T" catch block
+Language/12_Expressions/17_Getter_Invocation_A06_t02: Crash # "on T" catch block
+Language/12_Expressions/17_Getter_Invocation_A06_t03: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/17_Getter_Invocation_A07_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/17_Getter_Invocation_A07_t02: Crash # cannot compile methods that need interceptor calling convention.
+Language/12_Expressions/17_Getter_Invocation_A08_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/17_Getter_Invocation_A08_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/17_Getter_Invocation_A08_t03: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/18_Assignment/1_Compound_Assignment_A01_t01: Crash # cannot compile methods that need interceptor calling convention.
+Language/12_Expressions/18_Assignment/1_Compound_Assignment_A01_t02: Crash # cannot compile methods that need interceptor calling convention.
+Language/12_Expressions/18_Assignment/1_Compound_Assignment_A01_t03: Crash # cannot compile methods that need interceptor calling convention.
+Language/12_Expressions/18_Assignment/1_Compound_Assignment_A01_t04: Crash # cannot compile methods that need interceptor calling convention.
+Language/12_Expressions/18_Assignment/1_Compound_Assignment_A01_t05: Crash # cannot compile methods that need interceptor calling convention.
+Language/12_Expressions/18_Assignment/1_Compound_Assignment_A01_t06: Crash # cannot compile methods that need interceptor calling convention.
+Language/12_Expressions/18_Assignment/1_Compound_Assignment_A01_t07: Crash # cannot compile methods that need interceptor calling convention.
+Language/12_Expressions/18_Assignment/1_Compound_Assignment_A01_t08: Crash # cannot compile methods that need interceptor calling convention.
+Language/12_Expressions/18_Assignment/1_Compound_Assignment_A01_t09: Crash # cannot compile methods that need interceptor calling convention.
+Language/12_Expressions/18_Assignment/1_Compound_Assignment_A01_t10: Crash # cannot compile methods that need interceptor calling convention.
+Language/12_Expressions/18_Assignment/1_Compound_Assignment_A01_t11: Crash # cannot compile methods that need interceptor calling convention.
+Language/12_Expressions/18_Assignment/1_Compound_Assignment_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/18_Assignment/1_Compound_Assignment_A02_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/18_Assignment/1_Compound_Assignment_A02_t03: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/18_Assignment/1_Compound_Assignment_A02_t04: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/18_Assignment/1_Compound_Assignment_A02_t05: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/18_Assignment/1_Compound_Assignment_A02_t06: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/18_Assignment/1_Compound_Assignment_A02_t07: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/18_Assignment/1_Compound_Assignment_A02_t08: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/18_Assignment/1_Compound_Assignment_A02_t09: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/18_Assignment/1_Compound_Assignment_A02_t10: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/18_Assignment/1_Compound_Assignment_A02_t11: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/18_Assignment/1_Compound_Assignment_A03_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/18_Assignment/1_Compound_Assignment_A03_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/18_Assignment/1_Compound_Assignment_A03_t03: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/18_Assignment/1_Compound_Assignment_A03_t04: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/18_Assignment/1_Compound_Assignment_A03_t05: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/18_Assignment/1_Compound_Assignment_A03_t06: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/18_Assignment/1_Compound_Assignment_A03_t07: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/18_Assignment/1_Compound_Assignment_A03_t08: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/18_Assignment/1_Compound_Assignment_A03_t09: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/18_Assignment/1_Compound_Assignment_A03_t10: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/18_Assignment/1_Compound_Assignment_A03_t11: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/18_Assignment/1_Compound_Assignment_A04_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/18_Assignment/1_Compound_Assignment_A04_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/18_Assignment/1_Compound_Assignment_A04_t03: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/18_Assignment/1_Compound_Assignment_A04_t04: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/18_Assignment/1_Compound_Assignment_A04_t05: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/18_Assignment/1_Compound_Assignment_A04_t06: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/18_Assignment/1_Compound_Assignment_A04_t07: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/18_Assignment/1_Compound_Assignment_A04_t08: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/18_Assignment/1_Compound_Assignment_A04_t09: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/18_Assignment/1_Compound_Assignment_A04_t10: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/18_Assignment/1_Compound_Assignment_A04_t11: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/18_Assignment_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/18_Assignment_A01_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/18_Assignment_A01_t03: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/18_Assignment_A01_t04: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/18_Assignment_A01_t05: Crash # "on T" catch block
+Language/12_Expressions/18_Assignment_A01_t06: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/18_Assignment_A01_t07: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/18_Assignment_A02_t01: Crash # "on T" catch block
+Language/12_Expressions/18_Assignment_A03_t01: Crash # "on T" catch block
+Language/12_Expressions/18_Assignment_A04_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/18_Assignment_A04_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/18_Assignment_A04_t03: Crash # "on T" catch block
+Language/12_Expressions/18_Assignment_A04_t04: Crash # "on T" catch block
+Language/12_Expressions/18_Assignment_A04_t05: Crash # "on T" catch block
+Language/12_Expressions/18_Assignment_A04_t06: Crash # "on T" catch block
+Language/12_Expressions/18_Assignment_A04_t07: Crash # "on T" catch block
+Language/12_Expressions/18_Assignment_A04_t08: Crash # "on T" catch block
+Language/12_Expressions/18_Assignment_A04_t09: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/18_Assignment_A05_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/18_Assignment_A05_t02: Crash # "on T" catch block
+Language/12_Expressions/18_Assignment_A05_t03: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/18_Assignment_A05_t04: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/18_Assignment_A05_t05: Crash # "on T" catch block
+Language/12_Expressions/18_Assignment_A06_t01: Crash # "on T" catch block
+Language/12_Expressions/18_Assignment_A07_t01: Crash # "on T" catch block
+Language/12_Expressions/18_Assignment_A08_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/18_Assignment_A08_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/18_Assignment_A08_t03: Crash # "on T" catch block
+Language/12_Expressions/18_Assignment_A08_t04: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/18_Assignment_A08_t05: Crash # cannot compile methods that need interceptor calling convention.
+Language/12_Expressions/18_Assignment_A09_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/18_Assignment_A09_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/18_Assignment_A09_t03: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/19_Conditional_A02_t01: Crash # "on T" catch block
+Language/12_Expressions/19_Conditional_A02_t02: Crash # (throw new ExpectException(message)): Unhandled node
+Language/12_Expressions/19_Conditional_A02_t03: Crash # "on T" catch block
+Language/12_Expressions/19_Conditional_A02_t04: Crash # (throw new ExpectException(message)): Unhandled node
+Language/12_Expressions/19_Conditional_A03_t01: Crash # "on T" catch block
+Language/12_Expressions/19_Conditional_A04_t02: Crash # "on T" catch block
+Language/12_Expressions/19_Conditional_A04_t03: Crash # "on T" catch block
+Language/12_Expressions/19_Conditional_A05_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/19_Conditional_A06_t07: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/19_Conditional_A06_t08: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/19_Conditional_A06_t09: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/20_Logical_Boolean_Expressions_A01_t01: Crash # "on T" catch block
+Language/12_Expressions/20_Logical_Boolean_Expressions_A02_t01: Crash # (throw new ExpectException(message)): Unhandled node
+Language/12_Expressions/20_Logical_Boolean_Expressions_A03_t01: Crash # "on T" catch block
+Language/12_Expressions/20_Logical_Boolean_Expressions_A04_t02: Crash # "on T" catch block
+Language/12_Expressions/20_Logical_Boolean_Expressions_A06_t09: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/20_Logical_Boolean_Expressions_A06_t10: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/20_Logical_Boolean_Expressions_A06_t12: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/20_Logical_Boolean_Expressions_A06_t13: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/20_Logical_Boolean_Expressions_A06_t14: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/20_Logical_Boolean_Expressions_A06_t15: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/20_Logical_Boolean_Expressions_A06_t16: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/20_Logical_Boolean_Expressions_A06_t17: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/20_Logical_Boolean_Expressions_A06_t18: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/20_Logical_Boolean_Expressions_A06_t19: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/20_Logical_Boolean_Expressions_A06_t20: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/20_Logical_Boolean_Expressions_A06_t21: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/20_Logical_Boolean_Expressions_A06_t27: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/20_Logical_Boolean_Expressions_A06_t28: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/20_Logical_Boolean_Expressions_A06_t29: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/20_Logical_Boolean_Expressions_A06_t30: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/20_Logical_Boolean_Expressions_A06_t31: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/20_Logical_Boolean_Expressions_A06_t32: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/21_Bitwise_Expressions_A01_t01: Crash # Please triage this failure.
+Language/12_Expressions/21_Bitwise_Expressions_A01_t14: Crash # (try {fun|1;}on NoSuchMethodError catch (e){}): "on T" catch block
+Language/12_Expressions/21_Bitwise_Expressions_A02_t01: Crash # (throw new ExpectException(message)): Unhandled node
+Language/12_Expressions/21_Bitwise_Expressions_A02_t02: Crash # (throw new ExpectException(message)): Unhandled node
+Language/12_Expressions/21_Bitwise_Expressions_A02_t03: Crash # (throw new ExpectException(message)): Unhandled node
+Language/12_Expressions/21_Bitwise_Expressions_A03_t01: Crash # (throw new ExpectException(message)): Unhandled node
+Language/12_Expressions/21_Bitwise_Expressions_A03_t02: Crash # (throw new ExpectException(message)): Unhandled node
+Language/12_Expressions/21_Bitwise_Expressions_A03_t03: Crash # (throw new ExpectException(message)): Unhandled node
+Language/12_Expressions/22_Equality_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/22_Equality_A02_t03: Crash # Please triage this failure.
+Language/12_Expressions/22_Equality_A02_t04: Crash # "on T" catch block
+Language/12_Expressions/22_Equality_A03_t01: Crash # (throw new ExpectException(message)): Unhandled node
+Language/12_Expressions/22_Equality_A03_t02: Crash # (throw new ExpectException(message)): Unhandled node
+Language/12_Expressions/22_Equality_A03_t03: Crash # "on T" catch block
+Language/12_Expressions/22_Equality_A04_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/22_Equality_A10_t02: Crash # "on T" catch block
+Language/12_Expressions/23_Relational_Expressions_A01_t01: Crash # Please triage this failure.
+Language/12_Expressions/23_Relational_Expressions_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/23_Relational_Expressions_A03_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/24_Shift_A01_t01: Crash # cannot compile methods that need interceptor calling convention.
+Language/12_Expressions/24_Shift_A01_t15: Crash # cannot compile methods that need interceptor calling convention.
+Language/12_Expressions/24_Shift_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/24_Shift_A03_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/25_Additive_Expressions_A01_t01: Crash # cannot compile methods that need interceptor calling convention.
+Language/12_Expressions/25_Additive_Expressions_A01_t17: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/25_Additive_Expressions_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/25_Additive_Expressions_A03_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/25_Additive_Expressions_A04_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/26_Multiplicative_Expressions_A01_t01: Crash # Please triage this failure.
+Language/12_Expressions/26_Multiplicative_Expressions_A01_t27: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/26_Multiplicative_Expressions_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/26_Multiplicative_Expressions_A03_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/27_Unary_Expressions_A01_t01: Crash # cannot compile methods that need interceptor calling convention.
+Language/12_Expressions/27_Unary_Expressions_A01_t02: Crash # ( --A): Error expression ` --A` unhandled.
+Language/12_Expressions/27_Unary_Expressions_A01_t04: Crash # ( --f): Error expression ` --f` unhandled.
+Language/12_Expressions/27_Unary_Expressions_A01_t05: Crash # ( ++T): Error expression ` ++T` unhandled.
+Language/12_Expressions/27_Unary_Expressions_A01_t10: Crash # Please triage this failure.
+Language/12_Expressions/27_Unary_Expressions_A01_t27: Crash # cannot compile methods that need interceptor calling convention.
+Language/12_Expressions/27_Unary_Expressions_A02_t01: Crash # (throw new ExpectException(message)): Unhandled node
+Language/12_Expressions/27_Unary_Expressions_A02_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/27_Unary_Expressions_A02_t03: Crash # "on T" catch block
+Language/12_Expressions/27_Unary_Expressions_A03_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/27_Unary_Expressions_A03_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/27_Unary_Expressions_A04_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/27_Unary_Expressions_A04_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/27_Unary_Expressions_A07_t01: Crash # (try {~a;Expect.fail("Operator ~ was not called");}on TestException catch (e){}): "on T" catch block
+Language/12_Expressions/27_Unary_Expressions_A08_t01: Crash # "on T" catch block
+Language/12_Expressions/28_Postfix_Expressions_A01_t01: Crash # Please triage this failure.
+Language/12_Expressions/28_Postfix_Expressions_A01_t02: Crash # (f++ ): Error expression `f++ ` unhandled.
+Language/12_Expressions/28_Postfix_Expressions_A01_t03: Crash # (A++ ): Error expression `A++ ` unhandled.
+Language/12_Expressions/28_Postfix_Expressions_A01_t05: Crash # (T++ ): Error expression `T++ ` unhandled.
+Language/12_Expressions/28_Postfix_Expressions_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/28_Postfix_Expressions_A02_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/28_Postfix_Expressions_A03_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/28_Postfix_Expressions_A03_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/28_Postfix_Expressions_A04_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/28_Postfix_Expressions_A04_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/28_Postfix_Expressions_A05_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/28_Postfix_Expressions_A05_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/28_Postfix_Expressions_A06_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/28_Postfix_Expressions_A06_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/28_Postfix_Expressions_A07_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/28_Postfix_Expressions_A07_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/28_Postfix_Expressions_A08_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/28_Postfix_Expressions_A08_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/28_Postfix_Expressions_A09_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/28_Postfix_Expressions_A09_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/29_Assignable_Expressions_A01_t02: Crash # cannot compile methods that need interceptor calling convention.
+Language/12_Expressions/29_Assignable_Expressions_A01_t06: Crash # (A=1): Error expression `A=1` unhandled.
+Language/12_Expressions/29_Assignable_Expressions_A01_t08: Crash # (T=null): Error expression `T=null` unhandled.
+Language/12_Expressions/29_Assignable_Expressions_A01_t09: Crash # (f=null): Error expression `f=null` unhandled.
+Language/12_Expressions/29_Assignable_Expressions_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/29_Assignable_Expressions_A03_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/29_Assignable_Expressions_A04_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/29_Assignable_Expressions_A05_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/29_Assignable_Expressions_A06_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/30_Identifier_Reference_A01_t02: Crash # (throw new ExpectException(message)): Unhandled node
+Language/12_Expressions/30_Identifier_Reference_A01_t03: Crash # (throw new ExpectException(message)): Unhandled node
+Language/12_Expressions/30_Identifier_Reference_A01_t04: Crash # (throw new ExpectException(message)): Unhandled node
+Language/12_Expressions/30_Identifier_Reference_A01_t05: Crash # (throw new ExpectException(message)): Unhandled node
+Language/12_Expressions/30_Identifier_Reference_A01_t06: Crash # (throw new ExpectException(message)): Unhandled node
+Language/12_Expressions/30_Identifier_Reference_A01_t08: Crash # (throw new ExpectException(message)): Unhandled node
+Language/12_Expressions/30_Identifier_Reference_A03_t01: Crash # (throw new ExpectException(message)): Unhandled node
+Language/12_Expressions/30_Identifier_Reference_A04_t02: Crash # "on T" catch block
+Language/12_Expressions/30_Identifier_Reference_A07_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/30_Identifier_Reference_A08_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/30_Identifier_Reference_A08_t02: Crash # "on T" catch block
+Language/12_Expressions/30_Identifier_Reference_A08_t03: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/30_Identifier_Reference_A08_t04: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/30_Identifier_Reference_A09_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/30_Identifier_Reference_A09_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/30_Identifier_Reference_A09_t03: Crash # (i=0): For-loop variable captured in loop header
+Language/12_Expressions/30_Identifier_Reference_A09_t04: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/30_Identifier_Reference_A10_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/30_Identifier_Reference_A10_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/30_Identifier_Reference_A10_t03: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/30_Identifier_Reference_A11_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/30_Identifier_Reference_A12_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/30_Identifier_Reference_A13_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/30_Identifier_Reference_A14_t01: Crash # "on T" catch block
+Language/12_Expressions/30_Identifier_Reference_A14_t02: Crash # (throw new ExpectException(message)): Unhandled node
+Language/12_Expressions/30_Identifier_Reference_A14_t03: Crash # "on T" catch block
+Language/12_Expressions/30_Identifier_Reference_A14_t04: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/30_Identifier_Reference_A15_t01: Crash # (throw new ExpectException(message)): Unhandled node
+Language/12_Expressions/30_Identifier_Reference_A15_t02: Crash # (throw new ExpectException(message)): Unhandled node
+Language/12_Expressions/30_Identifier_Reference_A15_t03: Crash # (throw new ExpectException(message)): Unhandled node
+Language/12_Expressions/30_Identifier_Reference_A15_t04: Crash # "on T" catch block
+Language/12_Expressions/30_Identifier_Reference_A15_t05: Crash # unsupported element kind: x:field
+Language/12_Expressions/30_Identifier_Reference_A15_t06: Crash # unsupported element kind: x:field
+Language/12_Expressions/30_Identifier_Reference_A15_t07: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/30_Identifier_Reference_A15_t08: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/30_Identifier_Reference_A16_t04: Crash # handleStaticFunctionGet: function(libraryFunc)
+Language/12_Expressions/32_Type_Test_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/32_Type_Test_A02_t02: Crash # (throw new ExpectException(message)): Unhandled node
+Language/12_Expressions/32_Type_Test_A02_t03: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/32_Type_Test_A02_t04: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/32_Type_Test_A02_t05: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/32_Type_Test_A02_t06: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/32_Type_Test_A02_t07: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/32_Type_Test_A02_t08: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/32_Type_Test_A02_t09: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/32_Type_Test_A03_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/32_Type_Test_A03_t02: Crash # (throw new ExpectException(message)): Unhandled node
+Language/12_Expressions/32_Type_Test_A07_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/32_Type_Test_A07_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/32_Type_Test_A07_t03: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/33_Type_Cast_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/33_Type_Cast_A01_t04: Crash # (try {int as num;Expect.fail("CastError expected");}on CastError catch (e){}): "on T" catch block
+Language/12_Expressions/33_Type_Cast_A02_t01: Crash # (try {c=1 as I;Expect.fail("CastError expected");}on CastError catch (e){}): "on T" catch block
+Language/12_Expressions/33_Type_Cast_A02_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/33_Type_Cast_A02_t03: Crash # (try {1 as func;Expect.fail("CastError expected");}on CastError catch (ok){}): "on T" catch block
+Language/12_Expressions/33_Type_Cast_A02_t04: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/33_Type_Cast_A02_t05: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/33_Type_Cast_A02_t06: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/33_Type_Cast_A02_t07: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/33_Type_Cast_A02_t08: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/33_Type_Cast_A02_t09: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/33_Type_Cast_A04_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/33_Type_Cast_A04_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/Expressions_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/12_Expressions/Expressions_A01_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/13_Statements/01_Blocks_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/13_Statements/01_Blocks_A01_t02: Crash # (throw 1): Unhandled node
+Language/13_Statements/01_Blocks_A01_t03: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/13_Statements/01_Blocks_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/13_Statements/02_Expression_Statements_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/13_Statements/02_Expression_Statements_A01_t06: Crash # cannot compile methods that need interceptor calling convention.
+Language/13_Statements/03_Variable_Declaration_A01_t01: Crash # "on T" catch block
+Language/13_Statements/03_Variable_Declaration_A01_t02: Crash # "on T" catch block
+Language/13_Statements/03_Variable_Declaration_A01_t05: Crash # "on T" catch block
+Language/13_Statements/03_Variable_Declaration_A01_t06: Crash # "on T" catch block
+Language/13_Statements/03_Variable_Declaration_A01_t08: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/13_Statements/03_Variable_Declaration_A01_t14: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/13_Statements/03_Variable_Declaration_A01_t15: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/13_Statements/03_Variable_Declaration_A01_t18: Crash # "on T" catch block
+Language/13_Statements/03_Variable_Declaration_A01_t19: Crash # "on T" catch block
+Language/13_Statements/03_Variable_Declaration_A02_t01: Crash # (throw new ExpectException(message)): Unhandled node
+Language/13_Statements/03_Variable_Declaration_A02_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/13_Statements/03_Variable_Declaration_A03_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/13_Statements/04_Local_Function_Declaration_A02_t01: Crash # "on T" catch block
+Language/13_Statements/04_Local_Function_Declaration_A03_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/13_Statements/04_Local_Function_Declaration_A03_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/13_Statements/04_Local_Function_Declaration_A04_t01: Crash # (func()): Error expression `func()` unhandled.
+Language/13_Statements/04_Local_Function_Declaration_A04_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/13_Statements/04_Local_Function_Declaration_A04_t03: Crash # (oddHandler(x)): Error expression `oddHandler(x)` unhandled.
+Language/13_Statements/05_If_A01_t09: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/13_Statements/05_If_A01_t10: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/13_Statements/05_If_A01_t11: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/13_Statements/05_If_A01_t12: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/13_Statements/05_If_A02_t01: Crash # (throw new ExpectException(message)): Unhandled node
+Language/13_Statements/05_If_A02_t02: Crash # (try {if(i){i="hello";}}on AssertionError catch (e){err=true;}): "on T" catch block
+Language/13_Statements/05_If_A03_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/13_Statements/05_If_A03_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/13_Statements/05_If_A03_t03: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/13_Statements/05_If_A04_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/13_Statements/05_If_A05_t01: Crash # (throw new ExpectException(message)): Unhandled node
+Language/13_Statements/05_If_A05_t02: Crash # (throw new ExpectException(message)): Unhandled node
+Language/13_Statements/05_If_A06_t07: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/13_Statements/05_If_A06_t08: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/13_Statements/05_If_A06_t09: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/13_Statements/06_For/1_For_Loop_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/13_Statements/06_For/1_For_Loop_A01_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/13_Statements/06_For/1_For_Loop_A01_t03: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/13_Statements/06_For/1_For_Loop_A01_t04: Crash # (throw new ExpectException(message)): Unhandled node
+Language/13_Statements/06_For/1_For_Loop_A01_t05: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/13_Statements/06_For/1_For_Loop_A01_t06: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/13_Statements/06_For/1_For_Loop_A01_t07: Crash # "on T" catch block
+Language/13_Statements/06_For/1_For_Loop_A01_t08: Crash # "on T" catch block
+Language/13_Statements/06_For/1_For_Loop_A01_t09: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/13_Statements/06_For/1_For_Loop_A01_t10: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/13_Statements/06_For/2_For_in_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/13_Statements/06_For/2_For_in_A01_t02: Crash # "on T" catch block
+Language/13_Statements/06_For/2_For_in_A01_t03: Crash # (throw new ExpectException(message)): Unhandled node
+Language/13_Statements/06_For/2_For_in_A01_t04: Crash # "on T" catch block
+Language/13_Statements/06_For/2_For_in_A01_t05: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/13_Statements/06_For_A01_t07: Crash # "on T" catch block
+Language/13_Statements/07_While_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/13_Statements/07_While_A02_t02: Crash # (try {while(null){break;}fail=true;}on AssertionError catch (ok){}): "on T" catch block
+Language/13_Statements/07_While_A02_t03: Crash # (throw new ExpectException(message)): Unhandled node
+Language/13_Statements/07_While_A03_t01: Crash # "on T" catch block
+Language/13_Statements/07_While_A03_t02: Crash # "on T" catch block
+Language/13_Statements/07_While_A03_t03: Crash # "on T" catch block
+Language/13_Statements/08_Do_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/13_Statements/08_Do_A02_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/13_Statements/08_Do_A02_t03: Crash # "on T" catch block
+Language/13_Statements/08_Do_A02_t04: Crash # (throw new ExpectException(message)): Unhandled node
+Language/13_Statements/09_Switch_A01_t01: Crash # (switch (1){case 0:case 1:}): Unhandled node
+Language/13_Statements/09_Switch_A01_t02: Crash # (switch (1){l1:l2:l3:case (1):}): Unhandled node
+Language/13_Statements/09_Switch_A01_t03: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/13_Statements/09_Switch_A01_t05: Crash # (switchTest(0)): Error expression `switchTest(0)` unhandled.
+Language/13_Statements/09_Switch_A01_t06: Crash # (switchTest(1)): Error expression `switchTest(1)` unhandled.
+Language/13_Statements/09_Switch_A01_t09: Crash # (switchTest(0)): Error expression `switchTest(0)` unhandled.
+Language/13_Statements/09_Switch_A01_t10: Crash # (switchTest(0)): Error expression `switchTest(0)` unhandled.
+Language/13_Statements/09_Switch_A01_t12: Crash # (switchTest(0)): Error expression `switchTest(0)` unhandled.
+Language/13_Statements/09_Switch_A01_t14: Crash # (switchTest(0)): Error expression `switchTest(0)` unhandled.
+Language/13_Statements/09_Switch_A01_t18: Crash # (foo(1)): Error expression `foo(1)` unhandled.
+Language/13_Statements/09_Switch_A01_t19: Crash # (switch (1){case 0:break;label:print("hello");}): Unhandled node
+Language/13_Statements/09_Switch_A02_t03: Crash # (switch (null){case null:}): Unhandled node
+Language/13_Statements/09_Switch_A05_t01: Crash # "on T" catch block
+Language/13_Statements/09_Switch_A05_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/13_Statements/09_Switch_A06_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/13_Statements/09_Switch_A06_t02: Crash # "on T" catch block
+Language/13_Statements/09_Switch_A07_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/13_Statements/09_Switch_A07_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/13_Statements/09_Switch_A08_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/13_Statements/09_Switch_A08_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/13_Statements/09_Switch_A09_t01: Crash # "on T" catch block
+Language/13_Statements/09_Switch_A10_t01: Crash # (switch (1){case 0:false;case 1:true;break;}): Unhandled node
+Language/13_Statements/09_Switch_A10_t02: Crash # (switch (1){case 0:false;break;case 1:true;}): Unhandled node
+Language/13_Statements/09_Switch_A10_t03: Crash # (switch (1){case 0:false;break;default:true;}): Unhandled node
+Language/13_Statements/10_Rethrow_A01_t01: Crash # "on T" catch block
+Language/13_Statements/10_Rethrow_A01_t02: Crash # (try {f2();}on String catch (bad){Expect.fail("wrong handler");}): "on T" catch block
+Language/13_Statements/10_Rethrow_A01_t03: Crash # "on T" catch block
+Language/13_Statements/10_Rethrow_A01_t04: Crash # "on T" catch block
+Language/13_Statements/10_Rethrow_A01_t05: Crash # "on T" catch block
+Language/13_Statements/11_Return_A01_t05: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/13_Statements/11_Return_A02_t01: Crash # "on T" catch block
+Language/13_Statements/11_Return_A02_t02: Crash # (throw new ExpectException(message)): Unhandled node
+Language/13_Statements/11_Return_A02_t03: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/13_Statements/11_Return_A03_t01: Crash # "on T" catch block
+Language/13_Statements/11_Return_A03_t02: Crash # "on T" catch block
+Language/13_Statements/11_Return_A04_t01: Crash # "on T" catch block
+Language/13_Statements/11_Return_A07_t01: Crash # (throw new ExpectException(message)): Unhandled node
+Language/13_Statements/11_Return_A07_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/13_Statements/11_Try_A01_t01: Crash # (try {throw "";}on int catch (ok){}catch (ok){}finally {}): "on T" catch block
+Language/13_Statements/11_Try_A01_t14: Crash # (throw "foo"): Unhandled node
+Language/13_Statements/11_Try_A02_t01: Crash # "on T" catch block
+Language/13_Statements/11_Try_A02_t03: Crash # (try {throw new T2();}on T1 catch (p1,st){success=true;}): "on T" catch block
+Language/13_Statements/11_Try_A02_t04: Crash # "on T" catch block
+Language/13_Statements/11_Try_A03_t01: Crash # "on T" catch block
+Language/13_Statements/11_Try_A03_t02: Crash # "on T" catch block
+Language/13_Statements/11_Try_A03_t03: Crash # "on T" catch block
+Language/13_Statements/11_Try_A03_t04: Crash # "on T" catch block
+Language/13_Statements/11_Try_A04_t01: Crash # "on T" catch block
+Language/13_Statements/11_Try_A04_t03: Crash # (try {throw new T2();}on T1 catch (p1){success=true;}): "on T" catch block
+Language/13_Statements/11_Try_A04_t04: Crash # "on T" catch block
+Language/13_Statements/11_Try_A05_t01: Crash # (throw new T2()): Unhandled node
+Language/13_Statements/11_Try_A06_t01: Crash # (throw new ExpectException(message)): Unhandled node
+Language/13_Statements/11_Try_A07_t01: Crash # "on T" catch block
+Language/13_Statements/11_Try_A07_t02: Crash # "on T" catch block
+Language/13_Statements/11_Try_A07_t03: Crash # "on T" catch block
+Language/13_Statements/11_Try_A08_t01: Crash # "on T" catch block
+Language/13_Statements/11_Try_A09_t01: Crash # not exactly one catch block
+Language/13_Statements/11_Try_A10_t01: Crash # "on T" catch block
+Language/13_Statements/11_Try_A11_t01: Crash # "on T" catch block
+Language/13_Statements/11_Try_A11_t02: Crash # "on T" catch block
+Language/13_Statements/11_Try_A11_t03: Crash # "on T" catch block
+Language/13_Statements/11_Try_A11_t04: Crash # "on T" catch block
+Language/13_Statements/11_Try_A12_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/13_Statements/12_Labels_A01_t01: Crash # (switch (1){K:case 2:L:case 1:break;case 0:M:default:N:var x=0;}): Unhandled node
+Language/13_Statements/12_Labels_A03_t04: Crash # (switch (i){L:case 0:flag=true;break;case 2:continue L;}): Unhandled node
+Language/13_Statements/12_Labels_A03_t06: Crash # (switch (1){Label:case 1:break;default:break;}): Unhandled node
+Language/13_Statements/13_Break_A03_t01: Crash # not exactly one catch block
+Language/13_Statements/13_Break_A03_t02: Crash # "on T" catch block
+Language/13_Statements/13_Break_A03_t03: Crash # not exactly one catch block
+Language/13_Statements/13_Break_A03_t04: Crash # not exactly one catch block
+Language/13_Statements/13_Break_A03_t05: Crash # (switch (1){case 0:break;case 1:break L;}): Unhandled node
+Language/13_Statements/13_Break_A03_t06: Crash # not exactly one catch block
+Language/13_Statements/13_Break_A03_t07: Crash # Unhandled node
+Language/13_Statements/13_Break_A03_t08: Crash # (try {try {break;}finally {order.add(2);}}finally {order.add(1);}): not exactly one catch block
+Language/13_Statements/13_Break_A03_t09: Crash # not exactly one catch block
+Language/13_Statements/14_Continue_A02_t12: Crash # (switch (2){L:case 1:flag=true;break;case 2:continue L;}): Unhandled node
+Language/13_Statements/14_Continue_A02_t13: Crash # (switch (2){case 2:continue L;L:case 1:flag=true;}): Unhandled node
+Language/13_Statements/14_Continue_A03_t01: Crash # not exactly one catch block
+Language/13_Statements/14_Continue_A03_t02: Crash # not exactly one catch block
+Language/13_Statements/14_Continue_A03_t03: Crash # not exactly one catch block
+Language/13_Statements/14_Continue_A03_t04: Crash # not exactly one catch block
+Language/13_Statements/14_Continue_A03_t05: Crash # Unhandled node
+Language/13_Statements/14_Continue_A03_t06: Crash # "on T" catch block
+Language/13_Statements/14_Continue_A03_t07: Crash # "on T" catch block
+Language/13_Statements/15_Assert_A02_t01: Crash # (try {var i=1;String s=i;return false;}on TypeError catch (e){return true;}): "on T" catch block
+Language/13_Statements/15_Assert_A03_t01: Crash # "on T" catch block
+Language/13_Statements/15_Assert_A03_t02: Crash # "on T" catch block
+Language/13_Statements/15_Assert_A03_t03: Crash # "on T" catch block
+Language/13_Statements/15_Assert_A03_t04: Crash # "on T" catch block
+Language/13_Statements/15_Assert_A03_t05: Crash # "on T" catch block
+Language/13_Statements/15_Assert_A03_t06: Crash # "on T" catch block
+Language/13_Statements/15_Assert_A03_t08: Crash # (throw new ExpectException(message)): Unhandled node
+Language/13_Statements/15_Assert_A03_t09: Crash # "on T" catch block
+Language/13_Statements/15_Assert_A04_t02: Crash # "on T" catch block
+Language/13_Statements/15_Assert_A04_t03: Crash # "on T" catch block
+Language/13_Statements/15_Assert_A04_t04: Crash # "on T" catch block
+Language/13_Statements/15_Assert_A04_t05: Crash # "on T" catch block
+Language/13_Statements/15_Assert_A04_t06: Crash # "on T" catch block
+Language/14_Libraries_and_Scripts/13_Libraries_and_Scripts_A05_t01: Crash # "on T" catch block
+Language/14_Libraries_and_Scripts/13_Libraries_and_Scripts_A05_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/14_Libraries_and_Scripts/13_Libraries_and_Scripts_A05_t03: Crash # "on T" catch block
+Language/14_Libraries_and_Scripts/13_Libraries_and_Scripts_A05_t04: Crash # "on T" catch block
+Language/14_Libraries_and_Scripts/13_Libraries_and_Scripts_A06_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/14_Libraries_and_Scripts/1_Imports_A01_t09: Crash # (someVar=0): Error expression `someVar=0` unhandled.
+Language/14_Libraries_and_Scripts/1_Imports_A01_t18: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/14_Libraries_and_Scripts/1_Imports_A01_t19: Crash # (someVar=0): Error expression `someVar=0` unhandled.
+Language/14_Libraries_and_Scripts/1_Imports_A01_t32: Crash # (someVar=0): Error expression `someVar=0` unhandled.
+Language/14_Libraries_and_Scripts/1_Imports_A01_t39: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/14_Libraries_and_Scripts/1_Imports_A01_t40: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/14_Libraries_and_Scripts/1_Imports_A01_t41: Crash # (someVar=0): Error expression `someVar=0` unhandled.
+Language/14_Libraries_and_Scripts/1_Imports_A01_t43: Crash # (someVar=0): Error expression `someVar=0` unhandled.
+Language/14_Libraries_and_Scripts/1_Imports_A01_t49: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/14_Libraries_and_Scripts/1_Imports_A01_t51: Crash # "on T" catch block
+Language/14_Libraries_and_Scripts/1_Imports_A01_t52: Crash # "on T" catch block
+Language/14_Libraries_and_Scripts/1_Imports_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/14_Libraries_and_Scripts/1_Imports_A02_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/14_Libraries_and_Scripts/1_Imports_A02_t03: Crash # "on T" catch block
+Language/14_Libraries_and_Scripts/1_Imports_A02_t04: Crash # "on T" catch block
+Language/14_Libraries_and_Scripts/1_Imports_A02_t05: Crash # "on T" catch block
+Language/14_Libraries_and_Scripts/1_Imports_A02_t06: Crash # cannot compile methods that need interceptor calling convention.
+Language/14_Libraries_and_Scripts/1_Imports_A02_t09: Crash # (throw new ExpectException(message)): Unhandled node
+Language/14_Libraries_and_Scripts/1_Imports_A02_t11: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/14_Libraries_and_Scripts/1_Imports_A02_t12: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/14_Libraries_and_Scripts/1_Imports_A02_t13: Crash # "on T" catch block
+Language/14_Libraries_and_Scripts/1_Imports_A02_t14: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/14_Libraries_and_Scripts/1_Imports_A02_t15: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/14_Libraries_and_Scripts/1_Imports_A02_t16: Crash # "on T" catch block
+Language/14_Libraries_and_Scripts/1_Imports_A02_t17: Crash # "on T" catch block
+Language/14_Libraries_and_Scripts/1_Imports_A02_t18: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/14_Libraries_and_Scripts/1_Imports_A02_t19: Crash # (try {new F();Expect.fail("runtime error expected");}on Error catch (ok){}): "on T" catch block
+Language/14_Libraries_and_Scripts/1_Imports_A02_t20: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/14_Libraries_and_Scripts/1_Imports_A02_t21: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/14_Libraries_and_Scripts/1_Imports_A02_t22: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/14_Libraries_and_Scripts/1_Imports_A02_t23: Crash # (prefix.foo): Error expression `prefix.foo` unhandled.
+Language/14_Libraries_and_Scripts/1_Imports_A02_t24: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/14_Libraries_and_Scripts/1_Imports_A02_t25: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/14_Libraries_and_Scripts/1_Imports_A02_t26: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/14_Libraries_and_Scripts/1_Imports_A02_t27: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/14_Libraries_and_Scripts/1_Imports_A02_t28: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/14_Libraries_and_Scripts/1_Imports_A03_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/14_Libraries_and_Scripts/1_Imports_A03_t04: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/14_Libraries_and_Scripts/1_Imports_A03_t05: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/14_Libraries_and_Scripts/1_Imports_A03_t22: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/14_Libraries_and_Scripts/1_Imports_A03_t24: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/14_Libraries_and_Scripts/1_Imports_A03_t25: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/14_Libraries_and_Scripts/1_Imports_A03_t31: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/14_Libraries_and_Scripts/1_Imports_A03_t44: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/14_Libraries_and_Scripts/1_Imports_A03_t45: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/14_Libraries_and_Scripts/1_Imports_A03_t64: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/14_Libraries_and_Scripts/1_Imports_A03_t65: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/14_Libraries_and_Scripts/1_Imports_A06_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/14_Libraries_and_Scripts/1_Imports_A06_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/14_Libraries_and_Scripts/1_Imports_A07_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/14_Libraries_and_Scripts/1_Imports_A07_t03: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/14_Libraries_and_Scripts/1_Imports_A07_t04: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/14_Libraries_and_Scripts/2_Exports_A01_t01: Crash # (foo): Error expression `foo` unhandled.
+Language/14_Libraries_and_Scripts/2_Exports_A01_t02: Crash # "on T" catch block
+Language/14_Libraries_and_Scripts/2_Exports_A01_t03: Crash # "on T" catch block
+Language/14_Libraries_and_Scripts/2_Exports_A01_t04: Crash # (foo): Error expression `foo` unhandled.
+Language/14_Libraries_and_Scripts/2_Exports_A01_t05: Crash # (foo): Error expression `foo` unhandled.
+Language/14_Libraries_and_Scripts/2_Exports_A01_t08: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/14_Libraries_and_Scripts/2_Exports_A01_t09: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/14_Libraries_and_Scripts/2_Exports_A01_t10: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/14_Libraries_and_Scripts/2_Exports_A01_t11: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/14_Libraries_and_Scripts/2_Exports_A01_t12: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/14_Libraries_and_Scripts/2_Exports_A01_t13: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/14_Libraries_and_Scripts/2_Exports_A01_t14: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/14_Libraries_and_Scripts/2_Exports_A01_t17: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/14_Libraries_and_Scripts/2_Exports_A03_t01: Crash # "on T" catch block
+Language/14_Libraries_and_Scripts/2_Exports_A03_t02: Crash # "on T" catch block
+Language/14_Libraries_and_Scripts/2_Exports_A04_t03: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/14_Libraries_and_Scripts/2_Exports_A05_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/14_Libraries_and_Scripts/2_Exports_A06_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/14_Libraries_and_Scripts/2_Exports_A08_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/14_Libraries_and_Scripts/3_Parts_A02_t03: Crash # Please triage this failure.
+Language/14_Libraries_and_Scripts/3_Parts_A02_t04: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/14_Libraries_and_Scripts/3_Parts_A03_t01: Crash # Please triage this failure.
+Language/14_Libraries_and_Scripts/3_Parts_A03_t03: Crash # (foo): Error expression `foo` unhandled.
+Language/14_Libraries_and_Scripts/3_Parts_A03_t11: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/14_Libraries_and_Scripts/3_Parts_A04_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/14_Libraries_and_Scripts/4_Scripts_A01_t17: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/14_Libraries_and_Scripts/4_Scripts_A02_t16: Crash # (g()): Error expression `g()` unhandled.
+Language/15_Types/1_Static_Types_A03_t01: Crash # "on T" catch block
+Language/15_Types/1_Static_Types_A03_t02: Crash # "on T" catch block
+Language/15_Types/1_Static_Types_A03_t03: Crash # "on T" catch block
+Language/15_Types/1_Static_Types_A03_t04: Crash # "on T" catch block
+Language/15_Types/2_Dynamic_Type_System_A01_t01: Crash # "on T" catch block
+Language/15_Types/2_Dynamic_Type_System_A01_t02: Crash # "on T" catch block
+Language/15_Types/3_Type_Declarations/1_Typedef_A01_t03: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/15_Types/3_Type_Declarations/1_Typedef_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/15_Types/3_Type_Declarations/1_Typedef_A02_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/15_Types/3_Type_Declarations/1_Typedef_A02_t03: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/15_Types/3_Type_Declarations/1_Typedef_A03_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/15_Types/3_Type_Declarations/1_Typedef_A04_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/15_Types/3_Type_Declarations/1_Typedef_A04_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/15_Types/3_Type_Declarations/1_Typedef_A07_t05: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/15_Types/3_Type_Declarations/1_Typedef_A07_t06: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/15_Types/3_Type_Declarations/1_Typedef_A07_t07: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/15_Types/4_Interface_Types_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/15_Types/4_Interface_Types_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/15_Types/4_Interface_Types_A03_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/15_Types/4_Interface_Types_A04_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/15_Types/4_Interface_Types_A04_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/15_Types/4_Interface_Types_A05_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/15_Types/4_Interface_Types_A05_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/15_Types/4_Interface_Types_A05_t03: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/15_Types/4_Interface_Types_A05_t04: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/15_Types/4_Interface_Types_A06_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/15_Types/4_Interface_Types_A07_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/15_Types/4_Interface_Types_A07_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/15_Types/4_Interface_Types_A08_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/15_Types/4_Interface_Types_A08_t03: Crash # "on T" catch block
+Language/15_Types/4_Interface_Types_A08_t04: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/15_Types/4_Interface_Types_A08_t05: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/15_Types/4_Interface_Types_A08_t06: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/15_Types/4_Interface_Types_A09_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/15_Types/4_Interface_Types_A10_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/15_Types/4_Interface_Types_A10_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/15_Types/4_Interface_Types_A10_t03: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/15_Types/4_Interface_Types_A10_t04: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/15_Types/4_Interface_Types_A10_t06: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/15_Types/4_Interface_Types_A10_t07: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/15_Types/4_Interface_Types_A10_t08: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/15_Types/4_Interface_Types_A10_t09: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/15_Types/4_Interface_Types_A11_t02: Timeout # Please triage this failure.
+Language/15_Types/4_Interface_Types_A11_t03: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/15_Types/4_Interface_Types_A11_t04: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/15_Types/4_Interface_Types_A12_t09: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/15_Types/4_Interface_Types_A12_t10: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/15_Types/4_Interface_Types_A12_t11: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/15_Types/4_Interface_Types_A12_t12: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/15_Types/4_Interface_Types_A12_t13: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/15_Types/4_Interface_Types_A12_t14: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/15_Types/4_Interface_Types_A12_t16: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/15_Types/4_Interface_Types_A12_t18: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/15_Types/4_Interface_Types_A12_t19: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/15_Types/5_Function_Types_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/15_Types/5_Function_Types_A01_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/15_Types/5_Function_Types_A01_t03: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/15_Types/5_Function_Types_A01_t04: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/15_Types/5_Function_Types_A01_t05: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/15_Types/5_Function_Types_A01_t06: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/15_Types/5_Function_Types_A01_t07: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/15_Types/5_Function_Types_A01_t08: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/15_Types/5_Function_Types_A01_t09: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/15_Types/5_Function_Types_A01_t11: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/15_Types/5_Function_Types_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/15_Types/5_Function_Types_A02_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/15_Types/5_Function_Types_A02_t03: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/15_Types/5_Function_Types_A02_t04: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/15_Types/5_Function_Types_A02_t05: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/15_Types/5_Function_Types_A02_t06: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/15_Types/5_Function_Types_A02_t07: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/15_Types/5_Function_Types_A02_t08: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/15_Types/5_Function_Types_A02_t09: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/15_Types/5_Function_Types_A02_t10: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/15_Types/5_Function_Types_A02_t11: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/15_Types/5_Function_Types_A02_t12: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/15_Types/5_Function_Types_A03_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/15_Types/5_Function_Types_A03_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/15_Types/5_Function_Types_A03_t03: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/15_Types/5_Function_Types_A03_t04: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/15_Types/5_Function_Types_A03_t06: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/15_Types/5_Function_Types_A03_t07: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/15_Types/5_Function_Types_A03_t08: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/15_Types/5_Function_Types_A03_t09: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/15_Types/5_Function_Types_A03_t10: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/15_Types/5_Function_Types_A03_t11: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/15_Types/5_Function_Types_A03_t12: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/15_Types/5_Function_Types_A03_t13: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/15_Types/5_Function_Types_A05_t01: Crash # (throw new ExpectException(message)): Unhandled node
+Language/15_Types/5_Function_Types_A05_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/15_Types/5_Function_Types_A05_t03: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/15_Types/5_Function_Types_A05_t04: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/15_Types/5_Function_Types_A05_t05: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/15_Types/5_Function_Types_A06_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/15_Types/6_Type_dynamic_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/15_Types/6_Type_dynamic_A03_t01: Crash # "on T" catch block
+Language/15_Types/6_Type_dynamic_A04_t01: Crash # "on T" catch block
+Language/15_Types/6_Type_dynamic_A05_t01: Crash # (throw new ExpectException(message)): Unhandled node
+Language/15_Types/7_Type_Void_A01_t15: Crash # (foo(1)): Error expression `foo(1)` unhandled.
+Language/15_Types/7_Type_Void_A04_t02: Crash # "on T" catch block
+Language/15_Types/7_Type_Void_A04_t03: Crash # "on T" catch block
+Language/15_Types/7_Type_Void_A04_t04: Crash # "on T" catch block
+Language/15_Types/7_Type_Void_A04_t05: Crash # "on T" catch block
+Language/15_Types/8_Parameterized_Types_A03_t06: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/15_Types/8_Parameterized_Types_A03_t07: Crash # "on T" catch block
+Language/16_Reference/1_Lexical_Rules/1_Reserved_Words_A01_t08: Crash # Please triage this failure.
+Language/16_Reference/1_Lexical_Rules/1_Reserved_Words_A02_t08: Crash # Please triage this failure.
+Language/16_Reference/1_Lexical_Rules/1_Reserved_Words_A03_t08: Crash # Please triage this failure.
+Language/16_Reference/1_Lexical_Rules/1_Reserved_Words_A04_t08: Crash # Please triage this failure.
+Language/16_Reference/1_Lexical_Rules/1_Reserved_Words_A05_t08: Crash # (f()): Error expression `f()` unhandled.
+Language/16_Reference/1_Lexical_Rules/1_Reserved_Words_A06_t08: Crash # Please triage this failure.
+Language/16_Reference/1_Lexical_Rules/1_Reserved_Words_A07_t08: Crash # Please triage this failure.
+Language/16_Reference/1_Lexical_Rules/1_Reserved_Words_A08_t08: Crash # Please triage this failure.
+Language/16_Reference/1_Lexical_Rules/1_Reserved_Words_A09_t08: Crash # Please triage this failure.
+Language/16_Reference/1_Lexical_Rules/1_Reserved_Words_A10_t08: Crash # Please triage this failure.
+Language/16_Reference/1_Lexical_Rules/1_Reserved_Words_A11_t08: Crash # Please triage this failure.
+Language/16_Reference/1_Lexical_Rules/1_Reserved_Words_A12_t08: Crash # (f()): Error expression `f()` unhandled.
+Language/16_Reference/1_Lexical_Rules/1_Reserved_Words_A13_t08: Crash # Please triage this failure.
+Language/16_Reference/1_Lexical_Rules/1_Reserved_Words_A14_t08: Crash # Please triage this failure.
+Language/16_Reference/1_Lexical_Rules/1_Reserved_Words_A15_t08: Crash # Please triage this failure.
+Language/16_Reference/1_Lexical_Rules/1_Reserved_Words_A16_t08: Crash # Please triage this failure.
+Language/16_Reference/1_Lexical_Rules/1_Reserved_Words_A17_t08: Crash # Please triage this failure.
+Language/16_Reference/1_Lexical_Rules/1_Reserved_Words_A18_t08: Crash # Please triage this failure.
+Language/16_Reference/1_Lexical_Rules/1_Reserved_Words_A19_t08: Crash # Please triage this failure.
+Language/16_Reference/1_Lexical_Rules/1_Reserved_Words_A20_t08: Crash # Please triage this failure.
+Language/16_Reference/1_Lexical_Rules/1_Reserved_Words_A21_t08: Crash # Please triage this failure.
+Language/16_Reference/1_Lexical_Rules/1_Reserved_Words_A22_t08: Crash # Please triage this failure.
+Language/16_Reference/1_Lexical_Rules/1_Reserved_Words_A23_t08: Crash # (f()): Error expression `f()` unhandled.
+Language/16_Reference/1_Lexical_Rules/1_Reserved_Words_A24_t08: Crash # Please triage this failure.
+Language/16_Reference/1_Lexical_Rules/1_Reserved_Words_A25_t08: Crash # Please triage this failure.
+Language/16_Reference/1_Lexical_Rules/1_Reserved_Words_A26_t08: Crash # Please triage this failure.
+Language/16_Reference/1_Lexical_Rules/1_Reserved_Words_A27_t08: Crash # (f()): Error expression `f()` unhandled.
+Language/16_Reference/1_Lexical_Rules/1_Reserved_Words_A28_t08: Crash # (f()): Error expression `f()` unhandled.
+Language/16_Reference/1_Lexical_Rules/1_Reserved_Words_A29_t08: Crash # Please triage this failure.
+Language/16_Reference/1_Lexical_Rules/1_Reserved_Words_A30_t08: Crash # Please triage this failure.
+Language/16_Reference/1_Lexical_Rules/1_Reserved_Words_A31_t08: Crash # Please triage this failure.
+Language/16_Reference/1_Lexical_Rules/1_Reserved_Words_A32_t08: Crash # Please triage this failure.
+Language/16_Reference/1_Lexical_Rules/1_Reserved_Words_A40_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/16_Reference/1_Lexical_Rules/2_Comments_A01_t05: Crash # (throw new ExpectException(message)): Unhandled node
+Language/16_Reference/1_Lexical_Rules/2_Comments_A01_t06: Crash # (try {foo(1,0);Expect.fail("");}on Exception catch (e){}): "on T" catch block
+Language/16_Reference/1_Lexical_Rules/2_Comments_A01_t07: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/16_Reference/1_Lexical_Rules/2_Comments_A01_t09: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/16_Reference/1_Lexical_Rules/2_Comments_A01_t10: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/16_Reference/1_Lexical_Rules/2_Comments_A01_t11: Crash # (try {foo(1,0);Expect.fail("");}on Exception catch (e){}): "on T" catch block
+Language/16_Reference/1_Lexical_Rules/2_Comments_A02_t08: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/16_Reference/1_Lexical_Rules/2_Comments_A02_t09: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/16_Reference/1_Lexical_Rules/2_Comments_A02_t10: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/16_Reference/1_Lexical_Rules/2_Comments_A03_t07: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/16_Reference/1_Lexical_Rules/2_Comments_A03_t08: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/16_Reference/1_Lexical_Rules/2_Comments_A04_t03: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/16_Reference/1_Lexical_Rules_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/16_Reference/1_Lexical_Rules_A01_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/16_Reference/1_Lexical_Rules_A01_t03: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/16_Reference/1_Lexical_Rules_A01_t04: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/16_Reference/1_Lexical_Rules_A01_t05: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/16_Reference/1_Lexical_Rules_A01_t06: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/16_Reference/1_Lexical_Rules_A01_t10: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/16_Reference/2_Operator_Precedence_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/16_Reference/2_Operator_Precedence_A01_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/16_Reference/2_Operator_Precedence_A01_t03: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/16_Reference/2_Operator_Precedence_A01_t04: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/16_Reference/2_Operator_Precedence_A01_t05: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Language/16_Reference/2_Operator_Precedence_A01_t06: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/alignment/parse-align-items_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/alignment/parse-align-self_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/alignment/parse-justify-self_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/animation/request-animation-frame-callback-id_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/animation/request-animation-frame-cancel2_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/animation/request-animation-frame-cancel_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/animation/request-animation-frame-missing-arguments_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/animation/request-animation-frame-prefix_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/animation/request-animation-frame-timestamps-advance_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/animation/request-animation-frame-timestamps_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/animation/request-animation-frame-within-callback_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/backgrounds/001_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/backgrounds/animated-gif-as-background_t01: Crash # unsupported element kind: _asyncCounter:field
+LayoutTests/fast/backgrounds/background-position-parsing-2_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/backgrounds/background-repeat-computed-style_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/backgrounds/background-shorthand-with-backgroundSize-style_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/backgrounds/composite-highlight-is-invalid_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/backgrounds/mask-box-image-width_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/backgrounds/multiple-backgrounds-assert_t01: Crash # unsupported element kind: _asyncCounter:field
+LayoutTests/fast/backgrounds/multiple-backgrounds-computed-style_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/backgrounds/multiple-backgrounds-initial-values_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/backgrounds/repeat/parsing-background-repeat_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/borders/border-color-visited_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/borders/border-image-width-negative_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/borders/border-image-width-numbers-computed-style_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/borders/border-radius-child_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/borders/border-width-percent_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/box-shadow/box-shadow-parsing-invalid_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/box-sizing/css-table-with-box-sizing_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/box-sizing/table-cell_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/canvas/2d.composite.globalAlpha.fillPath_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/canvas/2d.fillText.gradient_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/canvas/2d.text.draw.fill.maxWidth.gradient_t01: Crash # unsupported element kind: _asyncCounter:field
+LayoutTests/fast/canvas/2d.text.draw.fill.maxWidth.negative_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/canvas/2d.text.draw.fill.maxWidth.veryLarge_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/canvas/2d.text.draw.fill.maxWidth.verySmall_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/canvas/alpha_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/canvas/canvas-2d-imageData-create-nonfinite_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/canvas/canvas-alphaImageData-behavior_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/canvas/canvas-arc-360-winding_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/canvas/canvas-arc-connecting-line_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/canvas/canvas_arc_largeangles_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/canvas/canvas-arc-negative-radius_t01: Crash # (new Path()): Error expression `new Path()` unhandled.
+LayoutTests/fast/canvas/canvas-arc-zero-lineto_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/canvas/canvas-as-image-incremental-repaint_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/canvas/canvas-before-css_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/canvas/canvas-bezier-same-endpoint_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/canvas/canvas-blend-image_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/canvas/canvas-blending-clipping_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/canvas/canvas-blending-color-over-color_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/canvas/canvas-blending-color-over-gradient_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/canvas/canvas-blending-color-over-image_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/canvas/canvas-blending-color-over-pattern_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/canvas/canvas-blending-fill-style_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/canvas/canvas-blending-global-alpha_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/canvas/canvas-blending-gradient-over-color_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/canvas/canvas-blending-gradient-over-gradient_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/canvas/canvas-blending-gradient-over-image_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/canvas/canvas-blending-gradient-over-pattern_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/canvas/canvas-blending-image-over-color_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/canvas/canvas-blending-image-over-gradient_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/canvas/canvas-blending-image-over-image_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/canvas/canvas-blending-image-over-pattern_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/canvas/canvas-blending-pattern-over-color_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/canvas/canvas-blending-pattern-over-gradient_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/canvas/canvas-blending-pattern-over-image_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/canvas/canvas-blending-pattern-over-pattern_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/canvas/canvas-blending-shadow_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/canvas/canvas-blending-text_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/canvas/canvas-blending-transforms_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/canvas/canvas-blend-solid_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/canvas/canvas-clearRect_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/canvas/canvas-clip-rule_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/canvas/canvas-closePath-single-point_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/canvas/canvas-color-clamping_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/canvas/canvas-composite-alpha_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/canvas/canvas-composite-canvas_t01: Crash # unsupported element kind: compositeTypes:field
+LayoutTests/fast/canvas/canvas-composite-image_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/canvas/canvas-composite-stroke-alpha_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/canvas/canvas-composite-text-alpha_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/canvas/canvas-copyPixels_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/canvas/canvas-css-crazy_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/canvas/canvas-currentColor_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/canvas/canvas-currentTransform_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/canvas/canvas-drawImage-incomplete_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/canvas/canvas-drawImage-scaled-copy-to-self_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/canvas/canvas-ellipse-360-winding_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/canvas/canvas-ellipse-negative-radius_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/canvas/canvas-ellipse_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/canvas/canvas-ellipse-zero-lineto_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/canvas/canvas-empty-image-pattern_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/canvas/canvas-fillRect_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/canvas/canvas-fillRect-zeroSizeGradient_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/canvas/canvas-fill-rule_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/canvas/canvas-fillStyle-no-quirks-parsing_t01: Crash # (throw '${testName}: ${e}'): Unhandled node
+LayoutTests/fast/canvas/canvas-fillText-invalid-maxWidth_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/canvas/canvas-fillText-zeroSizeGradient_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/canvas/canvas-fill-zeroSizeGradient_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/canvas/canvas-font-consistency_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/canvas/canvas-font-ex-units-crash_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/canvas/canvas-getContext-invalid_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/canvas/canvas-getImageData-invalid_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/canvas/canvas-getImageData-negative-source_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/canvas/canvas-getImageData-rounding_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/canvas/canvas-getImageData_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/canvas/canvas-gradient-without-path_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/canvas/canvas-imageSmoothingEnabled-repaint_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/canvas/canvas-imageSmoothingEnabled_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/canvas/canvas-invalid-fillstyle_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/canvas/canvas-invalid-strokestyle_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/canvas/canvas-large-dimensions_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/canvas/canvas-lineDash-input-sequence_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/canvas/canvas-lineDash-invalid_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/canvas/canvas-lineDash_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/canvas/canvas-lineWidth-intact-after-strokeRect_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/canvas/canvas-lineWidth_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/canvas/canvas-longlived-context_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/canvas/canvas-lose-restore-googol-size_t01: Crash # unsupported element kind: _asyncCounter:field
+LayoutTests/fast/canvas/canvas-lose-restore-max-int-size_t01: Crash # unsupported element kind: _asyncCounter:field
+LayoutTests/fast/canvas/canvas-modify-emptyPath_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/canvas/canvas-pattern-behaviour_t01: Crash # Please triage this failure.
+LayoutTests/fast/canvas/canvas-pattern-modify_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/canvas/canvas-pattern-transform_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/canvas/canvas-putImageData_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/canvas/canvas-quadratic-same-endpoint_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/canvas/canvas-radial-gradient-spreadMethod_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/canvas/canvas-resetTransform_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/canvas/canvas-resize-after-paint_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/canvas/canvas-save-restore_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/canvas/canvas-save-restore-with-path_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/canvas/canvas-scale-drawImage-shadow_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/canvas/canvas-scale-fillPath-shadow_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/canvas/canvas-scale-fillRect-shadow_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/canvas/canvas-scale-shadowBlur_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/canvas/canvas-scale-strokePath-shadow_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/canvas/canvas-set-properties-with-non-invertible-ctm_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/canvas/canvas-setTransform_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/canvas/canvas-shadow_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/canvas/canvas-skia-excessive-size_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/canvas/canvas-state-intact-after-putImageData_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/canvas/canvas-stroke-empty-fill_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/canvas/canvas-strokePath-alpha-shadow_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/canvas/canvas-strokePath-cap-join_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/canvas/canvas-strokePath-gradient-shadow_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/canvas/canvas-strokePath-shadow_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/canvas/canvas-strokeRect-alpha-shadow_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/canvas/canvas-strokeRect-gradient-shadow_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/canvas/canvas-strokeRect_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/canvas/canvas-strokeRect-zeroSizeGradient_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/canvas/canvas-strokeText-invalid-maxWidth_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/canvas/canvas-strokeText-strokes-shadow_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/canvas/canvas-strokeText-zeroSizeGradient_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/canvas/canvas-stroke-zeroSizeGradient_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/canvas/canvas-style-intact-after-text_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/canvas/canvas-to-canvas_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/canvas/canvas-toDataURL-case-insensitive-mimetype_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/canvas/canvas-transforms-fillRect-shadow_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/canvas/canvas-transparency-and-composite_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/canvas/canvas-with-illegal-args_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/canvas/canvas-with-incorrect-args_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/canvas/draw-custom-focus-ring_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/canvas/DrawImageSinglePixelStretch_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/canvas/drawImage-with-broken-image_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/canvas/drawImage-with-negative-source-destination_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/canvas/drawImage-with-valid-image_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/canvas/fallback-content_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/canvas/fillText-shadow_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/canvas/gradient-addColorStop-with-invalid-color_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/canvas/gradient-with-clip_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/canvas/linearGradient-infinite-values_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/canvas/pattern-with-transform_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/canvas/pointInPath_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/canvas/radialGradient-infinite-values_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/canvas/rgba-parsing_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/canvas/set-colors_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/canvas/setWidthResetAfterForcedRender_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/canvas/text-globalAlpha_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/canvas/toDataURL-noData_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/canvas/translate-text_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/canvas/webgl/array-bounds-clamping_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/canvas/webgl/attrib-location-length-limits_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/canvas/webgl/bad-arguments-test_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/canvas/webgl/buffer-bind-test_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/canvas/webgl/buffer-data-array-buffer_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/canvas/webgl/canvas-2d-webgl-texture_t01: Crash # unsupported element kind: _asyncCounter:field
+LayoutTests/fast/canvas/webgl/canvas-resize-crash_t01: Crash # unsupported element kind: _asyncCounter:field
+LayoutTests/fast/canvas/webgl/canvas-test_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/canvas/webgl/canvas-zero-size_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/canvas/webgl/compressed-tex-image_t01: Crash # Please triage this failure.
+LayoutTests/fast/canvas/webgl/context-attributes-alpha-depth-stencil-antialias-t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/canvas/webgl/context-destroyed-crash_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/canvas/webgl/context-lost-restored_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/canvas/webgl/context-lost_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/canvas/webgl/copy-tex-image-and-sub-image-2d_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/canvas/webgl/css-webkit-canvas-repaint_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/canvas/webgl/draw-arrays-out-of-bounds_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/canvas/webgl/draw-elements-out-of-bounds_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/canvas/webgl/drawingbuffer-test_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/canvas/webgl/draw-webgl-to-canvas-2d_t01: Crash # unsupported element kind: _asyncCounter:field
+LayoutTests/fast/canvas/webgl/error-reporting_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/canvas/webgl/framebuffer-bindings-unaffected-on-resize_t01: Crash # unsupported element kind: requestAnimFrame:field
+LayoutTests/fast/canvas/webgl/framebuffer-object-attachment_t01: Crash # Please triage this failure.
+LayoutTests/fast/canvas/webgl/framebuffer-test_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/canvas/webgl/functions-returning-strings_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/canvas/webgl/get-active-test_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/canvas/webgl/gl-bind-attrib-location-test_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/canvas/webgl/gl-enable-enum-test_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/canvas/webgl/gl-enum-tests_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/canvas/webgl/gl-get-calls_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/canvas/webgl/gl-getshadersource_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/canvas/webgl/gl-getstring_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/canvas/webgl/gl-object-get-calls_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/canvas/webgl/gl-pixelstorei_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/canvas/webgl/glsl-conformance_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/canvas/webgl/gl-teximage_t01: Crash # unsupported element kind: _asyncCounter:field
+LayoutTests/fast/canvas/webgl/gl-uniformmatrix4fv_t01: Crash # Unhandled node
+LayoutTests/fast/canvas/webgl/gl-vertexattribpointer_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/canvas/webgl/gl-vertex-attrib_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/canvas/webgl/gl-vertex-attrib-zero-issues_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/canvas/webgl/incorrect-context-object-behaviour_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/canvas/webgl/index-validation-copies-indices_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/canvas/webgl/index-validation_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/canvas/webgl/index-validation-verifies-too-many-indices_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/canvas/webgl/index-validation-with-resized-buffer_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/canvas/webgl/invalid-passed-params_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/canvas/webgl/is-object_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/canvas/webgl/null-object-behaviour_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/canvas/webgl/null-uniform-location_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/canvas/webgl/object-deletion-behaviour_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/canvas/webgl/oes-element-index-uint_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/canvas/webgl/oes-vertex-array-object_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/canvas/webgl/point-size_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/canvas/webgl/premultiplyalpha-test_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/canvas/webgl/program-test_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/canvas/webgl/read-pixels-pack-alignment_t01: Crash # Unhandled node
+LayoutTests/fast/canvas/webgl/read-pixels-test_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/canvas/webgl/renderbuffer-initialization_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/canvas/webgl/renderer-and-vendor-strings_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/canvas/webgl/shader-precision-format_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/canvas/webgl/texImage2DImageDataTest_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/canvas/webgl/tex-image-and-sub-image-2d-with-array-buffer-view_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/canvas/webgl/tex-image-and-sub-image-2d-with-canvas-rgb565_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/canvas/webgl/tex-image-and-sub-image-2d-with-canvas-rgba4444_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/canvas/webgl/tex-image-and-sub-image-2d-with-canvas-rgba5551_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/canvas/webgl/tex-image-and-sub-image-2d-with-canvas_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/canvas/webgl/tex-image-and-sub-image-2d-with-image-data-rgb565_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/canvas/webgl/tex-image-and-sub-image-2d-with-image-data-rgba4444_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/canvas/webgl/tex-image-and-sub-image-2d-with-image-data-rgba5551_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/canvas/webgl/tex-image-and-sub-image-2d-with-image-data_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/canvas/webgl/tex-image-and-sub-image-2d-with-image-rgb565_t01: Crash # unsupported element kind: _asyncCounter:field
+LayoutTests/fast/canvas/webgl/tex-image-and-sub-image-2d-with-image-rgba4444_t01: Crash # unsupported element kind: _asyncCounter:field
+LayoutTests/fast/canvas/webgl/tex-image-and-sub-image-2d-with-image-rgba5551_t01: Crash # unsupported element kind: _asyncCounter:field
+LayoutTests/fast/canvas/webgl/tex-image-and-sub-image-2d-with-image_t01: Crash # unsupported element kind: _asyncCounter:field
+LayoutTests/fast/canvas/webgl/tex-image-and-sub-image-2d-with-video-rgb565_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/canvas/webgl/tex-image-and-sub-image-2d-with-video-rgba4444_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/canvas/webgl/tex-image-and-sub-image-2d-with-video-rgba5551_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/canvas/webgl/tex-image-and-sub-image-2d-with-video_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/canvas/webgl/tex-image-and-uniform-binding-bugs_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/canvas/webgl/texImageTest_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/canvas/webgl/tex-image-webgl_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/canvas/webgl/tex-input-validation_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/canvas/webgl/tex-sub-image-2d-bad-args_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/canvas/webgl/tex-sub-image-2d_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/canvas/webgl/tex-sub-image-cube-maps_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/canvas/webgl/texture-active-bind_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/canvas/webgl/texture-bindings-uneffected-on-resize_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/canvas/webgl/texture-color-profile_t01: Crash # unsupported element kind: _asyncCounter:field
+LayoutTests/fast/canvas/webgl/texture-complete_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/canvas/webgl/texture-npot_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/canvas/webgl/texture-transparent-pixels-initialized_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/canvas/webgl/triangle_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/canvas/webgl/uniform-location-length-limits_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/canvas/webgl/uniform-location_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/canvas/webgl/uninitialized-test_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/canvas/webgl/viewport-unchanged-upon-resize_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/canvas/webgl/webgl-composite-modes-repaint_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/canvas/webgl/webgl-composite-modes_t01: Crash # (throw ("*** Error: unknown script element"+scriptId)): Unhandled node
+LayoutTests/fast/canvas/webgl/WebGLContextEvent_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/canvas/webgl/webgl-depth-texture_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/canvas/webgl/webgl-exceptions_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/canvas/webgl/webgl-large-texture_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/canvas/webgl/webgl-layer-update_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/canvas/webgl/webgl-specific_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/canvas/webgl/webgl-texture-binding-preserved_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/canvas/webgl/webgl-unprefixed-context-id_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/canvas/webgl/webgl-viewport-parameters-preserved_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/canvas/winding-enumeration_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/cookies/local-file-can-set-cookies_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/css3-text/css3-text-align-last/getComputedStyle/getComputedStyle-text-align-last-inherited_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/css3-text/css3-text-align-last/getComputedStyle/getComputedStyle-text-align-last_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/css3-text/css3-text-decoration/getComputedStyle/getComputedStyle-text-decoration-color_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/css3-text/css3-text-decoration/getComputedStyle/getComputedStyle-text-decoration-line_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/css3-text/css3-text-decoration/getComputedStyle/getComputedStyle-text-decoration-style_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/css3-text/css3-text-decoration/getComputedStyle/getComputedStyle-text-underline-position_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/css3-text/css3-text-indent/getComputedStyle/getComputedStyle-text-indent-inherited_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/css3-text/css3-text-indent/getComputedStyle/getComputedStyle-text-indent_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/css3-text/css3-text-justify/getComputedStyle/getComputedStyle-text-justify_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/css/add-remove-stylesheets-at-once-minimal-recalc-style_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/css/appearance-caps-lock-indicator_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/css/aspect-ratio-inheritance_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/css/aspect-ratio-parsing-tests_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/css/attribute-selector-begin-dynamic-no-elementstyle_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/css/attribute-selector-recursive-update-on-setAttribute_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/css/auto-min-size_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/css/background-clip-text_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/css/background-currentcolor_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/css/background-position-inherit_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/css/background-position-serialize_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/css/background-serialize_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/css/border-image-null-image-crash_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/css/border-image-style-length_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/css/border-radius-property-value_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/css/border-shorthand-initialize-longhands_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/css/border-spacing-without-vertical-value_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/css/border-start-end_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/css/border-width-large_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/css/box-sizing-backwards-compat-prefix_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/css/box-sizing-border-box-dynamic-padding-border-update_t01: Crash # (throw "You must provide a CSS selector of nodes to check."): Unhandled node
+LayoutTests/fast/css/button-height_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/css/cached-sheet-restore-crash_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/css/case-sensitive-attr_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/css/checked-pseudo-selector_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/css/child-selector-implicit-tbody_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/css/collapsed-whitespace-reattach-in-style-recalc_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/css/comment-before-charset-external_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/css/comment-before-charset_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/css/computed-offset-with-zoom_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/css/content/content-none_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/css/content/content-normal_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/css/content/content-quotes-01_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/css/content/content-quotes-02_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/css/content/content-quotes-03_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/css/content/content-quotes-04_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/css/content/content-quotes-05_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/css/content/content-quotes-06_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/css/content-language-case-insensitivity_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/css/content-language-dynamically-added_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/css/content-language-dynamically-removed_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/css/content-language-mapped-to-webkit-locale_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/css/content-language-multiple_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/css/content-language-no-content_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/css/counters/asterisk-counter-update-after-layout-crash_t01: Crash # unsupported element kind: _asyncCounter:field
+LayoutTests/fast/css/counters/complex-before_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/css/counters/counter-before-selector-crash_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/css/counters/counter-cssText_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/css/counters/counter-reparent-table-children-crash_t01: Crash # unsupported element kind: _asyncCounter:field
+LayoutTests/fast/css/counters/counter-reset-subtree-insert-crash_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/css/counters/counter-ruby-text-cleared_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/css/counters/counter-traverse-object-crash_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/css/crash-on-incomplete-not_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/css/css3-nth-space_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/css/css3-nth-tokens-script_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/css/css3-nth-tokens-style_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/css/css-escaped-identifier_t01: Crash # (throw '${testName}: ${e}'): Unhandled node
+LayoutTests/fast/css/css-keyframe-style-crash_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/css/css-keyframe-unexpected-end_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/css/cssom-remove-shorthand-property_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/css/css-properties-case-insensitive_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/css/css-selector-text_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/css/cssText-cache_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/css/csstext-of-content-string_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/css/cssText-shorthand_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/css/cursor-parsing-image-set_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/css/cursor-parsing-quirks_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/css/cursor-parsing_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/css/deprecated-flexbox-auto-min-size_t01: Crash # (throw "You must provide a CSS selector of nodes to check."): Unhandled node
+LayoutTests/fast/css/deprecated-flex-box-zero-width-intrinsic-max-width_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/css/device-aspect-ratio_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/css/dfn-default-font-style_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/css/display-inline-block-scrollbar_t01: Crash # (throw "You must provide a CSS selector of nodes to check."): Unhandled node
+LayoutTests/fast/css/div_plus_nav_bug47971_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/css/draggable-region-parser_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/css/duplicate-property-in-rule-important_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/css/duplicate-property-in-rule_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/css/dynamic-class-backdrop-pseudo_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/css/dynamic-class-pseudo-elements_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/css/dynamic-pseudo-class_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/css/dynamic-style-attribute-query_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/css/empty-display-none_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/css/emptyStyleTag_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/css/ex-unit-with-no-x-height_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/css/first-letter-inline-flow-split-crash_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/css/first-letter-inline-flow-split-table-crash_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/css/first-letter-nested_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/css/first-line-parent-style-different_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/css/fixed-width-intrinsic-width-excludes-scrollbars_t01: Crash # (throw "You must provide a CSS selector of nodes to check."): Unhandled node
+LayoutTests/fast/css/focus-display-block-inline_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/css/font-face-cache-bug_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/css/font-face-descending-unicode-range_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/css/font-face-font-family-descriptor_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/css/font-face-insert-link_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/css/font-face-multiple-ranges-for-unicode-range_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/css/fontface-properties_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/css/fontfaceset-download-error_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/css/fontfaceset-events_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/css/fontfaceset-loadingdone_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/css/font-face-svg-decoding-error_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/css/font-face-unicode-range-load_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/css/font-face-unicode-range-monospace_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/css/font-face-unicode-range-overlap-load_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/css/font-face-used-after-retired_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/css/font-family-builtins_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/css/font-family-initial-shorthand_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/css/font-family-trailing-bracket-gunk_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/css/font-property-priority_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/css/font-shorthand-from-longhands_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/css/font-shorthand-mix-inherit_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/css-generated-content/block-after_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/css-generated-content/bug91547_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/css-generated-content/details-before-after-content_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/css-generated-content/float-first-letter-siblings-convert-to-inline_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/css-generated-content/hit-test-generated-content_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/css-generated-content/inline-splitting-with-after-float-crash_t01: Crash # unsupported element kind: _asyncCounter:field
+LayoutTests/fast/css-generated-content/pseudo-animation-before-onload_t01: Crash # unsupported element kind: _asyncCounter:field
+LayoutTests/fast/css-generated-content/pseudo-animation-display_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/css-generated-content/pseudo-animation_t01: Crash # unsupported element kind: _asyncCounter:field
+LayoutTests/fast/css-generated-content/pseudo-element-events_t01: Crash # unsupported element kind: _asyncCounter:field
+LayoutTests/fast/css-generated-content/pseudo-transition-event_t01: Crash # unsupported element kind: _asyncCounter:field
+LayoutTests/fast/css-generated-content/pseudo-transition_t01: Crash # unsupported element kind: _asyncCounter:field
+LayoutTests/fast/css-generated-content/summary-before-after-content_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/css/getComputedStyle/computed-style-border-image_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/css/getComputedStyle/computed-style-cross-fade_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/css/getComputedStyle/computed-style-display-none_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/css/getComputedStyle/computed-style-font_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/css/getComputedStyle/computed-style-negative-top_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/css/getComputedStyle/computed-style-page-break-inside_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/css/getComputedStyle/computed-style-properties_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/css/getComputedStyle/computed-style-select-overflow_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/css/getComputedStyle/computed-style-with-zoom_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/css/getComputedStyle/counterIncrement-without-counter_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/css/getComputedStyle/font-family-fallback-reset_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/css/getComputedStyle/getComputedStyle-border-box_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/css/getComputedStyle/getComputedStyle-border-image-slice_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/css/getComputedStyle/getComputedStyle-borderRadius-2_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/css/getComputedStyle/getComputedStyle-border-radius-shorthand_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/css/getComputedStyle/getComputedStyle-border-style-shorthand_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/css/getComputedStyle/getComputedStyle-column-rule_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/css/getComputedStyle/getComputedStyle-height_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/css/getComputedStyle/getComputedStyle-length-unit_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/css/getComputedStyle/getComputedStyle-outline-offset_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/css/getComputedStyle/getComputedStyle-zIndex-auto_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/css/getPropertyValue-border_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/css/getPropertyValue-clip_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/css/getPropertyValue-column-rule_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/css/getPropertyValue-columns_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/css/getPropertyValue-webkit-margin-collapse_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/css/getPropertyValue-webkit-text-stroke_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/css-grid-layout/auto-content-resolution-rows_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/css-grid-layout/breadth-size-resolution-grid_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/css-grid-layout/calc-resolution-grid-item_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/css-grid-layout/display-grid-set-get_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/css-grid-layout/flex-and-minmax-content-resolution-rows_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/css-grid-layout/flex-content-resolution-columns_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/css-grid-layout/flex-content-resolution-rows_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/css-grid-layout/grid-auto-columns-rows-get-set_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/css-grid-layout/grid-auto-flow-get-set_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/css-grid-layout/grid-auto-flow-update_t01: Crash # (throw "You must provide a CSS selector of nodes to check."): Unhandled node
+LayoutTests/fast/css-grid-layout/grid-container-change-explicit-grid-recompute-child_t01: Crash # unsupported element kind: _asyncCounter:field
+LayoutTests/fast/css-grid-layout/grid-element-bad-cast-addchild_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/css-grid-layout/grid-element-border-grid-item_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/css-grid-layout/grid-element-border-padding-grid-item_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/css-grid-layout/grid-element-empty-row-column_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/css-grid-layout/grid-element-min-max-height_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/css-grid-layout/grid-element-padding-grid-item_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/css-grid-layout/grid-element-padding-margin_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/css-grid-layout/grid-element-remove-svg-child_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/css-grid-layout/grid-element-shrink-to-fit_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/css-grid-layout/grid-item-area-get-set_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/css-grid-layout/grid-item-bad-named-area-auto-placement_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/css-grid-layout/grid-item-bad-resolution-double-span_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/css-grid-layout/grid-item-change-order-auto-flow_t01: Crash # (throw "You must provide a CSS selector of nodes to check."): Unhandled node
+LayoutTests/fast/css-grid-layout/grid-item-display_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/css-grid-layout/grid-item-margin-auto-columns-rows-horiz-bt_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/css-grid-layout/grid-item-margin-auto-columns-rows_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/css-grid-layout/grid-item-margin-auto-columns-rows-vert-lr_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/css-grid-layout/grid-item-margin-auto-columns-rows-vert-rl_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/css-grid-layout/grid-item-margin-resolution_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/css-grid-layout/grid-item-order-auto-flow-resolution_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/css-grid-layout/grid-strict-ordering-crash_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/css-grid-layout/grid-template-areas-get-set_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/css-grid-layout/implicit-rows-auto-resolution_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/css-grid-layout/justify-self-cell_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/css-grid-layout/minmax-fixed-logical-height-only_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/css-grid-layout/minmax-fixed-logical-width-only_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/css-grid-layout/percent-grid-item-in-percent-grid-track-in-percent-grid_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/css-grid-layout/percent-grid-item-in-percent-grid-track_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/css-grid-layout/percent-grid-item-in-percent-grid-track-update_t01: Crash # unsupported element kind: _asyncCounter:field
+LayoutTests/fast/css-grid-layout/percent-padding-margin-resolution-grid-item_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/css-grid-layout/percent-padding-margin-resolution-grid-item-update_t01: Crash # unsupported element kind: _asyncCounter:field
+LayoutTests/fast/css-grid-layout/percent-resolution-grid-item_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/css-grid-layout/place-cell-by-index_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/css/html-attr-case-sensitivity_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/css/id-or-class-before-stylesheet-strict_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/css/id-or-class-before-stylesheet_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/css/image-set-parsing-invalid_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/css/image-set-setting_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/css/implicit-attach-marking_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/css/important-js-override_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/css/inherited-properties-explicit_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/css/inherited-properties-rare-text_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/css/inherit-initial-shorthand-values_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/css/insertRule-font-face_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/css/insertRule-media_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/css-intrinsic-dimensions/css-tables_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/css-intrinsic-dimensions/height-property-value_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/css-intrinsic-dimensions/intrinsic-sized-absolutes_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/css-intrinsic-dimensions/intrinsic-sized-blocks_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/css-intrinsic-dimensions/intrinsic-sized-column-flex-items_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/css-intrinsic-dimensions/intrinsic-sized-flex-items_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/css-intrinsic-dimensions/intrinsic-sized-replaced-absolutes_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/css-intrinsic-dimensions/multicol_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/css-intrinsic-dimensions/tables_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/css-intrinsic-dimensions/width-property-value_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/css-intrinsic-dimensions/width-shrinks-avoid-floats_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/css/invalidation/clears-invalidation-whole-tree_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/css/invalidation/detach-reattach-shadow_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/css/invalidation/detach-reattach_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/css/invalidation/dynamic-selector-list-pseudo_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/css/invalidation/invalidation-set-with-adjacent-combinators_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/css/invalidation/no-invalidation-set-local-style_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/css/invalidation/shadow-host-toggle_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/css/invalidation/style-update-with-added-stylesheet_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/css/invalidation/targeted-attribute-style-invalidation_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/css/invalidation/targeted-class-any-pseudo_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/css/invalidation/targeted-class-host-pseudo_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/css/invalidation/targeted-class-id_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/css/invalidation/targeted-class-shadow-combinator_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/css/invalidation/targeted-class-style-invalidation_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/css/invalidation/targeted-class-type-selectors_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/css/invalidation/targeted-id-style-invalidation_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/css/invalidation/toggle-style-inside-shadow-root_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/css/invalid-hex-color_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/css/invalid-not-with-pseudo-element_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/css/invalid-not-with-simple-selector-sequence_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/css/invalid-predefined-color_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/css/invalid-rule-value_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/css/large-number-round-trip_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/css/last-child-innerhtml_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/css/legacy-opacity-styles_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/css/link-alternate-stylesheet-1_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/css/link-alternate-stylesheet-2_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/css/link-alternate-stylesheet-3_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/css/link-alternate-stylesheet-4_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/css/link-alternate-stylesheet-5_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/css/link-disabled-attr-parser_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/css/list-item-text-align_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/css/many-spaces-before-charset_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/css/margin-start-end_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/css/MarqueeLayoutTest_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/css/max-device-aspect-ratio_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/css/max-height-and-max-width_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/css/max-width-none_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/css/media-rule-dyn_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/css/media-rule-no-whitespace_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/css/media-rule-screenDepthPerComponent_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/css/min-device-aspect-ratio_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/css/min-max-width_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/css/misplaced-charset_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/css/named-colors_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/css/nested-at-rules_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/css/nested-rule-parent-sheet_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/css/next-sibling-changed_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/css/nth-child-implied-step_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/css/nth-child-no-mutations_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/css/nth-child-n_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/css/nth-child-odd-case-insensitive_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/css/nth-child-unary-prefix_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/css/outline-currentcolor_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/css/outline-hidden-illegal-value_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/css/overflow-property_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/css/padding-no-renderer_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/css/padding-start-end_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/css/parse-color-int-or-percent-crash_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/css/parsing-css-allowed-string-characters_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/css/parsing-css-comment_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/css/parsing-css-escapes_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/css/parsing-css-nonascii_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/css/parsing-css-nth-child_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/css/parsing-css-surrogate-pairs_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/css/parsing-expr-error-recovery_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/css/parsing-font-variant-ligatures_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/css/parsing-not-after-supports_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/css/parsing-object-fit_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/css/parsing-object-position_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/css/parsing-text-rendering_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/css/parsing-unexpected-eof_t01: Crash # (throw '${testName}: ${e}'): Unhandled node
+LayoutTests/fast/css/parsing-webkit-font-smoothing_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/css/percent-min-width-img-src-change_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/css/percent-width-img-src-change_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/css/position-absolute-float_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/css/positioned-in-relative-position-inline-crash_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/css/positioned-overflow-scroll_t01: Crash # (throw "You must provide a CSS selector of nodes to check."): Unhandled node
+LayoutTests/fast/css/pseudo-any_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/css/pseudo-default-001_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/css/pseudo-default-002_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/css/pseudo-default-003_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/css/pseudo-default-004_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/css/pseudo-empty-display-none_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/css/pseudo-empty-dynamic-empty_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/css/pseudo-escaped-parenthesis_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/css/pseudo-in-range-invalid-value_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/css/pseudo-in-range_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/css/pseudo-invalid-001_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/css/pseudo-invalid-002_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/css/pseudo-invalid-novalidate-001_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/css/pseudo-not_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/css/pseudo-out-of-range_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/css/pseudo-required-optional-001_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/css/pseudo-required-optional-002_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/css/pseudo-required-optional-003_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/css/pseudo-required-optional-004_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/css/pseudo-required-optional-005_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/css/pseudo-required-optional-006_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/css/pseudo-required-optional-unapplied_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/css/pseudo-target-indirect-sibling-001_t01: Crash # unsupported element kind: _asyncCounter:field
+LayoutTests/fast/css/pseudo-target-indirect-sibling-002_t01: Crash # unsupported element kind: _asyncCounter:field
+LayoutTests/fast/css/pseudo-valid-001_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/css/pseudo-valid-002_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/css/pseudo-valid-004_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/css/pseudo-valid-007_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/css/pseudo-valid-dynamic_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/css/pseudo-valid-unapplied_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/css/readonly-pseudoclass-opera-001_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/css/readonly-pseudoclass-opera-002_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/css/readonly-pseudoclass-opera-003_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/css/readonly-pseudoclass-opera-004_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/css/readonly-pseudoclass-opera-005_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/css/readwrite-contenteditable-recalc_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/css/recalc-direct-adjacent-001_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/css/recalc-optgroup-inherit_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/css/relative-positioned-block-crash_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/css/relative-position-replaced-in-table-display-crash_t01: Crash # unsupported element kind: _asyncCounter:field
+LayoutTests/fast/css/remove-attribute-style_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/css/remove-class-name_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/css/remove-fixed-resizer-crash_t01: Crash # unsupported element kind: _asyncCounter:field
+LayoutTests/fast/css/rem-units-body_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/css/resize-value-compared_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/css/rgba-custom-text_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/css/selector-text-escape_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/css/shadow-current-color_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/css/shadow-dom-scope_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/css/sheet-collection-link_t01: Crash # unsupported element kind: _asyncCounter:field
+LayoutTests/fast/css/sheet-title_t01: Crash # unsupported element kind: _asyncCounter:field
+LayoutTests/fast/css/shorthand-priority_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/css/shorthand-setProperty-important_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/css/shorthands-four-values_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/css/sibling-selectors-dynamic_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/css/sibling-selectors_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/css/space-before-charset-external_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/css/space-before-charset_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/css/sticky/parsing-position-sticky_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/css/sticky/remove-inline-sticky-crash_t01: Crash # unsupported element kind: _asyncCounter:field
+LayoutTests/fast/css/sticky/remove-sticky-crash_t01: Crash # unsupported element kind: _asyncCounter:field
+LayoutTests/fast/css/sticky/sticky-table-col-crash_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/css/string-quote-binary_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/css/style-element-process-crash_t01: Crash # unsupported element kind: _asyncCounter:field
+LayoutTests/fast/css/style-scoped/style-scoped-in-shadow_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/css/style-scoped/style-scoped-nested_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/css/style-scoped/style-scoped-scoping-nodes-different-order_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/css/style-scoped/style-scoped-shadow-crash_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/css/style-scoped/style-scoped-with-dom-operation_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/css/style-scoped/style-scoped-with-important-rule_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/css/style-sharing-grand-parent-invalidate_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/css/style-sharing-inline-stylesheet_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/css/style-sharing-type-and-readonly_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/css/stylesheet-enable-first-alternate-link_t01: Crash # unsupported element kind: _asyncCounter:field
+LayoutTests/fast/css/stylesheet-enable-first-alternate-on-load-link_t01: Crash # unsupported element kind: _asyncCounter:field
+LayoutTests/fast/css/stylesheet-enable-first-alternate-on-load-sheet_t01: Crash # unsupported element kind: _asyncCounter:field
+LayoutTests/fast/css/stylesheet-enable-second-alternate-link_t01: Crash # unsupported element kind: _asyncCounter:field
+LayoutTests/fast/css/stylesheet-parentStyleSheet_t01: Crash # unsupported element kind: _asyncCounter:field
+LayoutTests/fast/css/test-setting-canvas-color_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/css/text-align-initial_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/css/text-align-webkit-match-parent-parse_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/css/text-align-webkit-match-parent_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/css/transform-origin-parsing_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/css/unicode-bidi-computed-value_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/css/url-with-multi-byte-unicode-escape_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/css/vertical-align-length-copy-bug_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/css/visibility-collapse-form-buttons_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/css/visited-link-hang_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/css/webkit-color-adjust_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/css/webkit-keyframes-crash_t01: Crash # unsupported element kind: _asyncCounter:field
+LayoutTests/fast/css/webkit-marquee-speed-unit-in-quirksmode_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/css/word-break-user-modify-allowed-values_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/css/zoom-in-length-round-trip_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/css/zoom-property-parsing_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/52776_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/allowed-children_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/anchor-origin_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/anchor-text_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/anchor-toString_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/anchor-without-content_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/dom/Attr/access-after-element-destruction_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/Attr/change-id-via-attr-node-value_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/Attr/direction-attribute-set-and-cleared_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/attribute-namespaces-get-set_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/background-shorthand-csstext_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/blur-contenteditable_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/dom/boolean-attribute-reflection_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/capturing-event-listeners_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/dom/characterdata-api-arguments_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/click-method-on-html-element_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/dom/clone-contents-0-end-offset_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/dom/clone-node-default-argument_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/Comment/comment-constructor_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/comment-dom-node_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/dom/comment-not-documentElement_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/Comment/remove_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/computed-style-set-property_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/containerNode_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/createDocument_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/createDocumentType2_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/createDocumentType-ownerDocument_t01: Crash # (throw "${reason}: ${e}"): Unhandled node
+LayoutTests/fast/dom/createDocumentType_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/dom/createElementNS-empty-namespace_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/createElementNS-namespace-errors_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/createElementNS_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/createElement_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/createElement-with-column_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/createElement-with-column_xml_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/css-cached-import-rule_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/dom/css-delete-doc_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/dom/css-inline-style-important_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/css-innerHTML_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/css-insert-import-rule_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/dom/css-insert-import-rule-twice_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/dom/css-mediarule-deleteRule-update_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/dom/css-mediarule-functions_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/css-mediarule-insertRule-update_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/dom/css-mediarule-parentRule_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/css-rule-functions_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/css-selectorText_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/css-set-property-exception_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/css-shorthand-common-value_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/css-shortHands_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/cssTarget-crash_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/dom/custom/attribute-changed-callback_t01: Crash # (throw '${testName}: ${e}'): Unhandled node
+LayoutTests/fast/dom/custom/constructor-calls-created-synchronously_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/custom/created-callback_t01: Crash # (throw '${testName}: ${e}'): Unhandled node
+LayoutTests/fast/dom/custom/document-register-basic_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/custom/document-register-namespace_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/custom/document-register-on-create-callback_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/dom/custom/document-register-svg-extends_t01: Crash # (throw '${testName}: ${e}'): Unhandled node
+LayoutTests/fast/dom/custom/document-register-type-extensions_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/custom/element-names_t01: Crash # (throw '${testName}: ${e}'): Unhandled node
+LayoutTests/fast/dom/custom/element-type_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/custom/element-upgrade_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/custom/invalid-type-extension-crash_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/custom/type-extensions_t01: Crash # (throw '${testName}: ${e}'): Unhandled node
+LayoutTests/fast/dom/custom/unresolved-pseudoclass_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/custom/upgrade-candidate-remove-crash_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/dom/dataset_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/dom/dataset-xhtml_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/dom/Document/CaretRangeFromPoint/basic_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/dom/Document/CaretRangeFromPoint/caretRangeFromPoint-in-strict-mode-wtih-checkbox_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/Document/CaretRangeFromPoint/caretRangeFromPoint-in-user-select-none_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/dom/Document/CaretRangeFromPoint/caretRangeFromPoint-in-zoom-and-scroll_t01: Crash # unsupported element kind: _asyncCounter:field
+LayoutTests/fast/dom/Document/CaretRangeFromPoint/caretRangeFromPoint-with-first-letter-style_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/Document/CaretRangeFromPoint/hittest-relative-to-viewport_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/dom/Document/CaretRangeFromPoint/replace-element_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/dom/Document/clone-node_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/Document/createElement-invalid-names_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/Document/createElementNS-namespace-err_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/dom/Document/createElement-valid-names_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/dom/Document/document-title-get_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/DocumentFragment/document-fragment-constructor_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/document-importNode-arguments_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/document-set-title-mutations_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/dom/document-set-title-no-child-on-empty_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/document-set-title-no-reuse_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/dom/document-stylesheets-empty-style_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/Document/title-property-creates-title-element_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/Document/title-property-set-multiple-times_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/Document/title-with-multiple-children_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/document-width-height-force-layout_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/dom/DOMException/dispatch-event-exception_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/DOMException/prototype-object_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/DOMException/XPathException_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/DOMImplementation/createDocument-namespace-err_t01: Crash # (impl): Error expression `impl` unhandled.
+LayoutTests/fast/dom/DOMImplementation/createDocumentType-err_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/DOMImplementation/createHTMLDocument-title_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/dom-instanceof_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/dom-method-document-change_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/dom/domparser-parsefromstring-mimetype-support_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/dom-parse-serialize-display_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/dom-parse-serialize_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/dom-parse-serialize-xmldecl_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/domtimestamp-is-number_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/duplicate-ids-document-order_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/duplicate-ids_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/dom/Element/attribute-uppercase_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/Element/class-name_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/Element/client-rect-list-argument_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/dom/Element/dimension-properties-unrendered_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/Element/fixed-position-offset-parent_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/elementFromPoint-scaled-scrolled_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/Element/getBoundingClientRect-getClientRects-relative-to-viewport_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/Element/getClientRects_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/Element/hostname-host_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/Element/id-in-frame_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/dom/Element/id-in-getelement01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/dom/Element/id-in-insert-hr_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/dom/Element/id-in-map_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/dom/Element/id-in-param_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/dom/Element/node-list-identity_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/dom/Element/offsetTop-table-cell_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/Element/remove_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/Element/scrollWidth_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/Element/setAttribute-case-insensitivity_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/Element/setAttributeNS-namespace-err_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/dom/Element/setAttribute-with-colon_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/empty-hash-and-search_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/dom/focus-contenteditable_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/dom/fragment-activation-focuses-target_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/gc-image-element-2_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/dom/gc-image-element_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/dom/getElementById-consistency2_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/dom/getElementById-consistency3_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/dom/getElementById-consistency4_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/dom/getElementById-consistency5_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/dom/getElementById-consistency_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/dom/getelementbyname-invalidation_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/getElementsByClassName/001_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/getElementsByClassName/002_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/getElementsByClassName/003_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/getElementsByClassName/004_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/getElementsByClassName/005_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/getElementsByClassName/006_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/getElementsByClassName/007_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/getElementsByClassName/008_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/getElementsByClassName/009_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/getElementsByClassName/010_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/getElementsByClassName/011_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/getElementsByClassName/012_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/getElementsByClassName/013_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/getElementsByClassName/014_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/getElementsByClassName/015_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/getElementsByClassName/dumpNodeList_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/getelementsbyname-invalidation-cache_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/horizontal-scrollbar-in-rtl-doesnt-fire-onscroll_t01: Crash # unsupported element kind: _asyncCounter:field
+LayoutTests/fast/dom/horizontal-scrollbar-in-rtl_t01: Crash # unsupported element kind: _asyncCounter:field
+LayoutTests/fast/dom/horizontal-scrollbar-when-dir-change_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/HTMLAnchorElement/get-href-attribute-port_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/HTMLAnchorElement/remove-href-from-focused-anchor_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/dom/HTMLAnchorElement/set-href-attribute-hash_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/HTMLAnchorElement/set-href-attribute-hostname_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/HTMLAnchorElement/set-href-attribute-host_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/HTMLAnchorElement/set-href-attribute-pathname_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/HTMLAnchorElement/set-href-attribute-port_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/HTMLAnchorElement/set-href-attribute-prevents-rebase_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/HTMLAnchorElement/set-href-attribute-protocol_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/HTMLAnchorElement/set-href-attribute-rebase_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/HTMLAnchorElement/set-href-attribute-search_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/HTMLAnchorElement/set-href-attribute-whitespace_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/HTMLBaseElement/href-attribute-resolves-with-respect-to-document_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/HTMLBaseElement/multiple-base-elements_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/HTMLButtonElement/change-type_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/HTMLButtonElement/value/getset_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/htmlcollection-length-after-item_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/html-collections-named-getter-mandatory-arg_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/HTMLDialogElement/dialog-autofocus_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/HTMLDialogElement/dialog-close-event_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/HTMLDialogElement/dialog-enabled_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/HTMLDialogElement/dialog-open_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/HTMLDialogElement/dialog-return-value_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/HTMLDialogElement/dialog-scrolled-viewport_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/HTMLDialogElement/dialog-show-modal_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/dom/HTMLDialogElement/inert-does-not-match-disabled-selector_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/HTMLDialogElement/inert-node-is-unfocusable_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/HTMLDialogElement/inert-node-is-unselectable_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/HTMLDialogElement/multiple-centered-dialogs_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/HTMLDialogElement/non-anchored-dialog-positioning_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/HTMLDialogElement/show-modal-focusing-steps_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/HTMLDialogElement/submit-dialog-close-event_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/dom/HTMLDialogElement/synthetic-click-inert_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/HTMLDialogElement/top-layer-position-relative_t01: Crash # (throw "You must provide a CSS selector of nodes to check."): Unhandled node
+LayoutTests/fast/dom/HTMLDialogElement/top-layer-position-static_t01: Crash # (throw "You must provide a CSS selector of nodes to check."): Unhandled node
+LayoutTests/fast/dom/HTMLDocument/active-element-gets-unforcusable_t01: Crash # unsupported element kind: _asyncCounter:field
+LayoutTests/fast/dom/HTMLDocument/activeElement_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/HTMLDocument/clone-node_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/HTMLDocument/set-focus-on-valid-element_t01: Crash # unsupported element kind: _asyncCounter:field
+LayoutTests/fast/dom/HTMLDocument/title-get_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/HTMLDocument/title-set_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/HTMLElement/attr-dir-auto-change-before-text-node_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/HTMLElement/attr-dir-auto-change-child-node_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/HTMLElement/attr-dir-auto-change-text-form-control_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/HTMLElement/attr-dir-auto-change-text_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/HTMLElement/attr-dir-auto-children_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/HTMLElement/attr-dir-auto-remove-add-children_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/HTMLElement/attr-dir-auto_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/HTMLElement/attr-dir-auto-text-form-control-child_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/HTMLElement/attr-dir-auto-text-form-control_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/HTMLElement/attr-dir-value-change_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/HTMLElement/attr-empty-string_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/HTMLElement/attr-false-string_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/HTMLElement/attr-invalid-string_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/HTMLElement/attr-missing-ancestor-false_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/HTMLElement/attr-missing-ancestor-true_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/HTMLElement/attr-missing-parent-ancestor-missing_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/HTMLElement/attr-missing-parent-false_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/HTMLElement/attr-missing-parent-true_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/HTMLElement/attr-true-string_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/HTMLElement/insertAdjacentHTML-errors_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/HTMLElement/set-false_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/HTMLElement/set-inherit-parent-false_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/HTMLElement/set-inherit-parent-true_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/HTMLElement/set-inner-outer-optimization_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/HTMLElement/set-invalid-value_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/HTMLElement/set-true_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/HTMLElement/set-value-caseinsensitive_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/HTMLElement/spellcheck_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/HTMLElement/translate_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/HTMLFontElement/size-attribute_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/HTMLFormElement/elements-not-in-document_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/HTMLFormElement/move-option-between-documents_t01: Crash # unsupported element kind: _asyncCounter:field
+LayoutTests/fast/dom/HTMLImageElement/image-loading-gc_t01: Crash # unsupported element kind: _asyncCounter:field
+LayoutTests/fast/dom/HTMLImageElement/image-natural-width-height_t01: Crash # unsupported element kind: _asyncCounter:field
+LayoutTests/fast/dom/HTMLImageElement/image-src-absolute-url_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/dom/HTMLImageElement/parse-src_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/HTMLInputElement/checked-pseudo-selector_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/dom/HTMLInputElement/cloned-input-checked-state_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/dom/HTMLInputElement/clone-input-checked_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/HTMLInputElement/duplicate-element-names_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/HTMLInputElement/input-checked-reset_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/dom/HTMLInputElement/input-hidden-value_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/HTMLInputElement/input-size-attribute_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/HTMLInputElement/input-text-reset_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/dom/HTMLInputElement/size-as-number_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/HTMLInputElement/size-attribute_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/HTMLLabelElement/click-label_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/HTMLLabelElement/focus-label_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/HTMLLabelElement/form/test1_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/dom/HTMLLabelElement/label-control_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/HTMLLinkElement/link-and-subresource-test-nonexistent_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/dom/HTMLLinkElement/link-and-subresource-test_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/dom/HTMLLinkElement/link-beforeload-recursive_t01: Crash # unsupported element kind: _asyncCounter:field
+LayoutTests/fast/dom/HTMLLinkElement/link-onerror-stylesheet-with-existent-and-non-existent-import_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/dom/HTMLLinkElement/link-onerror-stylesheet-with-non-existent-import_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/dom/HTMLLinkElement/link-onerror_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/dom/HTMLLinkElement/link-onload2_t01: Crash # unsupported element kind: _asyncCounter:field
+LayoutTests/fast/dom/HTMLLinkElement/link-onload-before-page-load_t01: Crash # unsupported element kind: _asyncCounter:field
+LayoutTests/fast/dom/HTMLLinkElement/link-onload-stylesheet-with-import_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/dom/HTMLLinkElement/link-onload_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/dom/HTMLLinkElement/link-sheet-out-of-tree_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/dom/HTMLLinkElement/onload-completion-test_t01: Crash # unsupported element kind: _asyncCounter:field
+LayoutTests/fast/dom/HTMLLinkElement/prefetch-beforeload_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/dom/HTMLLinkElement/prefetch-onerror_t01: Crash # unsupported element kind: _asyncCounter:field
+LayoutTests/fast/dom/HTMLLinkElement/prefetch-onload_t01: Crash # unsupported element kind: _asyncCounter:field
+LayoutTests/fast/dom/HTMLLinkElement/prefetch_t01: Crash # unsupported element kind: _asyncCounter:field
+LayoutTests/fast/dom/HTMLLinkElement/resolve-url-on-insertion_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/HTMLLinkElement/subresource_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/dom/HTMLMetaElement/meta-attributes_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/HTMLMeterElement/set-meter-properties_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/HTMLObjectElement/beforeload-set-text-crash_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/dom/HTMLObjectElement/children-changed_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/dom/HTMLObjectElement/form/test1_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/dom/HTMLObjectElement/set-type-to-null-crash_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/dom/HTMLOutputElement/dom-settable-token-list_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/HTMLOutputElement/htmloutputelement-children-removed_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/dom/HTMLOutputElement/htmloutputelement-reset-event_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/HTMLOutputElement/htmloutputelement_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/HTMLOutputElement/htmloutputelement-validity_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/HTMLOutputElement/htmloutputelement-value_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/HTMLProgressElement/indeterminate-progress-002_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/HTMLProgressElement/progress-element-with-style-crash_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/dom/HTMLProgressElement/set-progress-properties_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/HTMLScriptElement/async-false-inside-async-false-load_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/dom/HTMLScriptElement/async-onbeforeload_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/dom/HTMLScriptElement/defer-onbeforeload_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/dom/HTMLScriptElement/defer-script-invalid-url_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/dom/HTMLScriptElement/dont-load-unknown-type_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/dom/HTMLScriptElement/isURLAttribute_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/dom/HTMLScriptElement/remove-in-beforeload_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/dom/HTMLScriptElement/remove-source_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/dom/HTMLScriptElement/script-async-attr_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/dom/HTMLScriptElement/script-for-attribute-unexpected-execution_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/dom/HTMLScriptElement/script-load-events_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/dom/HTMLScriptElement/script-reexecution_t01: Crash # unsupported element kind: _asyncCounter:field
+LayoutTests/fast/dom/HTMLScriptElement/script-set-src_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/dom/HTMLSelectElement/change-multiple-preserve-selection_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/HTMLSelectElement/listbox-select-reset_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/HTMLSelectElement/named-options_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/HTMLSelectElement/selected-false_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/HTMLSelectElement/selected-index-preserved-when-option-text-changes_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/HTMLSelectElement/select-element-item-argument_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/HTMLSelectElement/select-selectedOptions_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/HTMLStyleElement/insert-parser-generated_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/HTMLStyleElement/programmatically-add-style-with-onerror-handler_t01: Crash # unsupported element kind: _asyncCounter:field
+LayoutTests/fast/dom/HTMLStyleElement/programmatically-add-style-with-onload-handler_t01: Crash # unsupported element kind: _asyncCounter:field
+LayoutTests/fast/dom/HTMLStyleElement/style-onerror_t01: Crash # unsupported element kind: _asyncCounter:field
+LayoutTests/fast/dom/HTMLStyleElement/style-onerror-with-existent-and-non-existent-import_t01: Crash # unsupported element kind: _asyncCounter:field
+LayoutTests/fast/dom/HTMLStyleElement/style-onload2_t01: Crash # unsupported element kind: _asyncCounter:field
+LayoutTests/fast/dom/HTMLStyleElement/style-onload-before-page-load_t01: Crash # unsupported element kind: _asyncCounter:field
+LayoutTests/fast/dom/HTMLStyleElement/style-onload_t01: Crash # unsupported element kind: _asyncCounter:field
+LayoutTests/fast/dom/HTMLTableElement/cellpadding-attribute_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/HTMLTableElement/createCaption_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/HTMLTableElement/early-acid3-65-excerpt_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/HTMLTableElement/early-acid3-66-excerpt_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/HTMLTableElement/exceptions_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/HTMLTableElement/insert-row_t01: Crash # Please triage this failure.
+LayoutTests/fast/dom/HTMLTableElement/rows_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/HTMLTableElement/table-with-invalid-border_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/HTMLTableElement/tBodies_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/HTMLTableRowElement/cells_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/HTMLTableRowElement/exceptions_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/HTMLTableRowElement/insertCell_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/HTMLTableSectionElement/rows_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/HTMLTemplateElement/cloneNode_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/dom/HTMLTemplateElement/contentWrappers_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/HTMLTemplateElement/custom-element-wrapper-gc_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/HTMLTemplateElement/cycles-in-shadow_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/HTMLTemplateElement/cycles_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/HTMLTemplateElement/inertContents_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/dom/HTMLTemplateElement/innerHTML-inert_t01: Crash # unsupported element kind: _asyncCounter:field
+LayoutTests/fast/dom/HTMLTemplateElement/innerHTML_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/HTMLTemplateElement/no-form-association_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/dom/HTMLTemplateElement/ownerDocument_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/HTMLTemplateElement/ownerDocumentXHTML_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/HTMLTemplateElement/xhtml-parsing-and-serialization_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/HTMLTextAreaElement/reset-textarea_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/icon-size-property_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/icon-url-change_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/dom/icon-url-list_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/dom/id-attribute-with-namespace-crash_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/dom/image-object_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/dom/implementation-api-args_t01: Crash # (throw "${reason}: ${e}"): Unhandled node
+LayoutTests/fast/dom/implementation-createHTMLDocument_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/import-document-fragment_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/importNode-confusing-localName_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/importNodeHTML_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/importNode-null_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/importNode-prefix_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/importNode-unsupported-node-type_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/importNodeXML_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/innerHTML-detached-element_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/innerHTML-escaping-attribute_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/dom/innerHTML-nbsp_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/dom/inner-text-first-letter_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/inner-text_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/dom/inner-width-height_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/javascript-backslash_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/jsDevicePixelRatio_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/left-overflow-in-ltr_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/length-attribute-mapping_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/location-hash_t01: Crash # unsupported element kind: _asyncCounter:field
+LayoutTests/fast/dom/location-missing-arguments_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/multiple-ids_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/MutationObserver/added-out-of-order_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/MutationObserver/callback-arguments_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/dom/MutationObserver/clear-transient-without-delivery_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/dom/MutationObserver/create-during-delivery_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/dom/MutationObserver/cross-document_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/dom/MutationObserver/database-callback-delivery_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/dom/MutationObserver/delivery-order_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/dom/MutationObserver/disconnect-cancel-pending_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/dom/MutationObserver/document-fragment-insertion_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/dom/MutationObserver/mutate-during-delivery_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/dom/MutationObserver/mutation-record-constructor_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/MutationObserver/mutation-record-nullity_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/MutationObserver/observe-attributes_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/dom/MutationObserver/observe-characterdata_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/dom/MutationObserver/observe-childList_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/dom/MutationObserver/observe-exceptions_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/MutationObserver/observe-options-attributes_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/dom/MutationObserver/observe-options-character-data_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/dom/MutationObserver/observer-wrapper-dropoff_t01: Crash # unsupported element kind: _asyncCounter:field
+LayoutTests/fast/dom/MutationObserver/observer-wrapper-dropoff-transient_t01: Crash # unsupported element kind: _asyncCounter:field
+LayoutTests/fast/dom/MutationObserver/observe-subtree_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/dom/MutationObserver/removed-out-of-order_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/MutationObserver/takeRecords_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/dom/MutationObserver/transient-gc-crash_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/dom/MutationObserver/weak-callback-gc-crash_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/dom/navigatorcontentutils/is-protocol-handler-registered_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/navigatorcontentutils/register-protocol-handler_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/navigatorcontentutils/unregister-protocol-handler_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/navigator-userAgent_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/dom/navigator-vendorSub_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/dom/node-childNodes-idempotence_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/dom/Node/contains-method_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/dom/Node/DOMNodeRemovedEvent_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/Node/fragment-mutation_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/Node/initial-values_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/NodeIterator/NodeIterator-basic_t01: Crash # (throw '${testName}: ${e}'): Unhandled node
+LayoutTests/fast/dom/node-iterator-reference-node-removed_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/node-iterator-with-doctype-root_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/NodeList/childNodes-reset-cache_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/NodeList/childNodes-reverse-iteration_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/NodeList/invalidate-node-lists-when-parsing_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/NodeList/nodelist-reachable_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/no-elements_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/non-styled-element-id-crash_t01: Crash # unsupported element kind: _asyncCounter:field
+LayoutTests/fast/dom/noscript-style_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/object-plugin-hides-properties_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/offset-parent-positioned-and-inline_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/dom/offset-position-writing-modes_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/onerror-img_t01: Crash # unsupported element kind: _asyncCounter:field
+LayoutTests/fast/dom/option-properties_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/partial-layout-block_t01: Crash # (throw '${testName}: ${e}'): Unhandled node
+LayoutTests/fast/dom/partial-layout-non-overlay-scrollbars_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/dom/partial-layout-overlay-scrollbars_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/dom/Range/13000_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/Range/31684_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/Range/bug-19527_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/Range/create-contextual-fragment-script-not-ran_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/dom/Range/create-contextual-fragment-script-unmark-already-started_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/Range/create-contextual-fragment_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/dom/Range/deleted-range-endpoints_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/Range/getClientRects-character_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/dom/Range/insertNode-empty-fragment-crash_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/Range/missing-arguments_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/Range/mutation_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/Range/range-clone-contents_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/Range/range-clone-empty_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/dom/Range/range-comparePoint_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/Range/range-constructor_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/Range/range-created-during-remove-children_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/Range/range-detached-exceptions_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/Range/range-exceptions_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/Range/range-extract-contents_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/Range/range-insertNode-separate-endContainer_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/Range/range-insertNode-splittext_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/Range/range-isPointInRange_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/Range/range-modifycontents_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/Range/range-on-detached-node_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/Range/range-processing-instructions_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/Range/select-node-different-document_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/Range/surroundContents-1_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/Range/surroundContents-check-boundary-points_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/Range/surroundContents-for-detached-node_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/remove-body-during-body-replacement_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/dom/replace-child-siblings_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/replace-first-child_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/Selection/collapseToX-empty-selection_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/Selection/getRangeAt_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/dom/SelectorAPI/bug-17313_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/dom/SelectorAPI/caseID-almost-strict_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/dom/SelectorAPI/caseID-strict_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/dom/SelectorAPI/caseID_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/dom/SelectorAPI/caseTag_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/dom/SelectorAPI/caseTagX_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/dom/SelectorAPI/detached-element_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/dom/SelectorAPI/dumpNodeList-2_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/SelectorAPI/dumpNodeList-almost-strict_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/SelectorAPI/dumpNodeList_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/SelectorAPI/duplicate-id-scope_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/SelectorAPI/elementRoot_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/SelectorAPI/id-fastpath-almost-strict_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/SelectorAPI/id-fastpath-strict_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/SelectorAPI/id-fastpath_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/SelectorAPI/not-supported-namespace-in-selector_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/SelectorAPI/unknown-pseudo_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/SelectorAPI/viewless-document_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/dom/serialize-attribute_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/dom/setAttributeNS-namespace-errors_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/setAttribute-using-initial-input-value_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/set-custom-validity-with-too-few-arguments_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/set-innerHTML_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/setter-type-enforcement_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/shadow/base-in-shadow-tree_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/shadow/content-element-api_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/shadow/content-element-includer_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/shadow/content-element-outside-shadow-style_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/shadow/content-pseudo-element-css-text_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/shadow/content-pseudo-element-dynamic-attribute-change_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/dom/shadow/content-pseudo-element-overridden_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/shadow/content-pseudo-element-relative-selector-css-text_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/shadow/content-pseudo-element-with-host-pseudo-class_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/shadow/content-reprojection-fallback-crash_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/shadow/custom-pseudo-in-selector-api_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/shadow/distribution-for-event-path_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/shadow/distribution-update-recalcs-style_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/shadow/elementfrompoint_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/shadow/elements-in-frameless-document_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/shadow/event-path-not-in-document_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/shadow/event-path_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/shadow/form-in-shadow_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/shadow/getComputedStyle-composed-parent-dirty_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/shadow/get-distributed-nodes-orphan_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/shadow/getelementbyid-in-orphan_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/shadow/get-element-by-id-in-shadow-mutation_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/shadow/getelementbyid-shadow_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/shadow/host-context-pseudo-class-css-text_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/shadow/host-pseudo-class-css-text_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/shadow/insertion-point-list-menu-crash_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/dom/shadow/insertion-point-video-crash_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/dom/shadow/link-in-shadow-tree_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/dom/shadow/nested-reprojection-inconsistent_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/dom/shadow/no-renderers-for-light-children_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/dom/shadow/offsetWidth-host-style-change_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/shadow/olderShadowRoot_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/dom/shadow/pseudoclass-update-checked-option_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/dom/shadow/pseudoclass-update-disabled-optgroup_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/dom/shadow/pseudoclass-update-disabled-option_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/dom/shadow/pseudoclass-update-enabled-optgroup_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/dom/shadow/pseudoclass-update-enabled-option_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/dom/shadow/reinsert-insertion-point_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/dom/shadow/remove-and-insert-style_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/shadow/shadow-aware-shadow-root_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/dom/shadow/shadow-disable_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/shadow/shadowdom-dynamic-styling_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/shadow/shadowdom-for-input-type-change_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/shadow/shadow-element-inactive_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/shadow/shadow-element_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/shadow/shadow-hierarchy-exception_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/shadow/shadowhost-keyframes_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/dom/shadow/shadow-removechild-and-blur-event_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/shadow/shadow-root-append_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/dom/shadow/shadowroot-clonenode_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/shadow/shadowroot-host_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/shadow/shadow-root-js-api_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/shadow/shadowroot-keyframes_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/dom/shadow/sibling-rules-dynamic-changes_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/shadow/style-of-distributed-node_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/shadow/style-sharing-sibling-shadow_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/shadow/style-sharing-styles-in-older-shadow-roots_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/shadow/suppress-mutation-events-in-shadow-characterdata_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/shadow/title-element-in-shadow_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/shared-inline-style-after-node-removal_t01: Crash # unsupported element kind: _asyncCounter:field
+LayoutTests/fast/dom/stripNullFromTextNodes_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/StyleSheet/css-medialist-item_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/StyleSheet/detached-parent-rule-without-wrapper_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/StyleSheet/detached-shadow-style_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/StyleSheet/detached-style-2_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/dom/StyleSheet/detached-stylesheet-without-wrapper_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/StyleSheet/detached-style_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/dom/StyleSheet/discarded-sheet-owner-null_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/dom/StyleSheet/empty-shadow-style_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/subtree-modified-attributes_t01: Crash # unsupported element kind: _asyncCounter:field
+LayoutTests/fast/dom/text-api-arguments_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/Text/next-element-sibling_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/text-node-attach-crash_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/dom/Text/previous-element-sibling_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/Text/remove_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/Text/replaceWholeText_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/Text/text-constructor_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/title-content-set-innerText-get_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/TreeWalker/TreeWalker-basic_t01: Crash # (throw '${testName}: ${e}'): Unhandled node
+LayoutTests/fast/dom/TreeWalker/TreeWalker-currentNode_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/vertical-scrollbar-in-rtl-doesnt-fire-onscroll_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/dom/vertical-scrollbar-when-dir-change_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/dom/Window/atob-btoa_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/Window/dispatchEvent_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/dom/Window/getMatchedCSSRules-nested-rules_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/dom/Window/getMatchedCSSRules-parent-stylesheets_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/dom/Window/getMatchedCSSRules-with-invalid-pseudo-elements_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/Window/getMatchedCSSRules-with-pseudo-elements-complex_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/Window/getMatchedCSSRules-with-pseudo-elements_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/dom/Window/invalid-protocol_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/Window/querySelectorAll-with-pseudo-elements_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/Window/replaceable_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/Window/window-remove-event-listener_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/Window/window-resize-contents_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/Window/window-resize_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/Window/window-screen-properties_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/dom/Window/window-scroll-arguments_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/xhtml-fragment-parsing-exceptions_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/xhtml-fragment-whitespace_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/XMLHttpRequest-constants_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/XMLSerializer-attribute-entities_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/XMLSerializer-attribute-namespaces_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/XMLSerializer-doctype2_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/XMLSerializer-doctype_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/XMLSerializer-double-xmlns_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/XMLSerializer-element-ns-no-reemit_t01: Crash # (throw '${testName}: ${e}'): Unhandled node
+LayoutTests/fast/dom/xmlserializer-serialize-to-string-exception_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dom/XMLSerializer_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dynamic/continuation-detach-crash_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/dynamic/inline-to-block-crash_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/dynamic/insertAdjacentHTML-allowed-parents_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/dynamic/jQuery-animation-crash_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/dynamic/style-access-late-stylesheet-load_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/encoding/bom-in-content_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/encoding/css-charset-dom_t01: Crash # unsupported element kind: _asyncCounter:field
+LayoutTests/fast/events/add-event-without-document_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/events/change-overflow-on-overflow-change_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/events/clipboard-clearData_t01: Crash # unsupported element kind: _asyncCounter:field
+LayoutTests/fast/events/clipboard-dataTransferItemList-remove_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/events/clipboard-dataTransferItemList_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/events/defaultprevented_t01: Crash # unsupported element kind: _asyncCounter:field
+LayoutTests/fast/events/dispatch-event-being-dispatched_t01: Crash # unsupported element kind: _asyncCounter:field
+LayoutTests/fast/events/dispatch-event-no-document_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/events/dispatch-synthetic-mouseevent_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/events/div-focus_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/events/document-elementFromPoint_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/events/domnodeinsertedintodocument-dispatched-post-rendering_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/events/event-attributes-after-exception_t01: Crash # try/finally
+LayoutTests/fast/events/event-creation_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/events/event-fired-after-removal_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/events/event-fire-order_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/events/event-listener-list-mutation_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/events/event-listener-moving-documents_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/events/event-listener-sharing_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/events/event-on-created-document_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/events/event-on-xhr-document_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/events/event-trace_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/events/fire-scroll-event-element_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/events/fire-scroll-event_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/events/form-onchange_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/events/init-message-event_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/events/input-focus-no-duplicate-events_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/events/invalid-001_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/events/invalid-002_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/events/invalid-003_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/events/invalid-004_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/events/invalid-005_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/events/keyboardevent-location-constants_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/events/mutation-during-append-child_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/events/mutation-during-insert-before_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/events/mutation-during-replace-child-2_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/events/mutation-during-replace-child_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/events/nested-event-remove-node-crash_t01: Crash # unsupported element kind: _asyncCounter:field
+LayoutTests/fast/events/no-window-load_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/events/onerror-bubbling_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/events/onerror-img-after-gc_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/eventsource/eventsource-attribute-listeners_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/eventsource/eventsource-constructor_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/events/overflowchanged-event-raf-timing_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/events/page-visibility-null-view_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/events/programmatic-check-no-change-event_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/events/scoped/editing-commands_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/events/scroll-during-zoom-change_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/events/scroll-event-does-not-bubble_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/events/scroll-event-phase_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/events/selectstart-on-selectall_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/events/selectstart-prevent-selectall_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/events/stop-immediate-propagation_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/events/stopPropagation-checkbox_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/events/submit-reset-nested-bubble_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/events/tabindex-removal-from-focused-element_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/events/wheelevent-constructor_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/events/window-load-capture_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/events/xhr-onclick-crash_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/exclusions/parsing/parsing-wrap-flow_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/exclusions/parsing/parsing-wrap-through_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/files/blob-close-read_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/files/blob-close-revoke_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/files/blob-close_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/files/blob-constructor_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/files/blob-parts-slice-test_t01: Crash # unsupported element kind: _asyncCounter:field
+LayoutTests/fast/files/blob-slice-overflow_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/files/blob-slice-test_t01: Crash # unsupported element kind: _asyncCounter:field
+LayoutTests/fast/files/create-blob-url-crash_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/files/file-reader-abort-in-last-progress_t01: Crash # unsupported element kind: _asyncCounter:field
+LayoutTests/fast/files/file-reader-done-reading-abort_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/files/file-reader-fffd_t01: Crash # unsupported element kind: _asyncCounter:field
+LayoutTests/fast/files/file-reader-immediate-abort_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/files/file-reader-methods-illegal-arguments_t01: Crash # Unhandled node
+LayoutTests/fast/files/file-reader-readystate_t01: Crash # unsupported element kind: _asyncCounter:field
+LayoutTests/fast/files/file-reader-result-twice_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/files/not-enough-arguments_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/files/read-blob-as-array-buffer_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/files/revoke-blob-url_t01: Crash # Please triage this failure.
+LayoutTests/fast/files/url-null_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/files/url-required-arguments_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/files/workers/inline-worker-via-blob-url_t01: Crash # unsupported element kind: _asyncCounter:field
+LayoutTests/fast/files/xhr-response-blob_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/filesystem/async-operations_t01: Crash # cannot compile methods that need interceptor calling convention.
+LayoutTests/fast/filesystem/directory-entry-to-uri_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/filesystem/file-after-reload-crash_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/filesystem/file-entry-to-uri_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/filesystem/file-from-file-entry_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/filesystem/file-metadata-after-write_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/filesystem/filesystem-reference_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/filesystem/filesystem-unserializable_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/filesystem/filesystem-uri-origin_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/filesystem/file-writer-abort-continue_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/filesystem/file-writer-abort-depth_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/filesystem/file-writer-abort_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/filesystem/file-writer-empty-blob_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/filesystem/file-writer-events_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/filesystem/file-writer-gc-blob_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/filesystem/file-writer-truncate-extend_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/filesystem/file-writer-write-overlapped_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/filesystem/input-access-entries_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/filesystem/op-copy_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/filesystem/op-get-entry_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/filesystem/op-get-metadata_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/filesystem/op-get-parent_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/filesystem/op-move_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/filesystem/op-read-directory_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/filesystem/op-remove_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/filesystem/op-restricted-chars_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/filesystem/op-restricted-names_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/filesystem/op-restricted-unicode_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/filesystem/read-directory-many_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/filesystem/read-directory_t01: Crash # cannot compile methods that need interceptor calling convention.
+LayoutTests/fast/filesystem/simple-readonly-file-object_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/filesystem/simple-readonly_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/filesystem/simple-required-arguments-getdirectory_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/filesystem/simple-required-arguments-getfile_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/filesystem/simple-temporary_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/filesystem/snapshot-file-with-gc_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/flexbox/box-orient-button_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/flexbox/child-flexing_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/flexbox/crash-flexbox-no-layout-child_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/flexbox/flexing-overflow-scroll-item_t01: Crash # (throw "You must provide a CSS selector of nodes to check."): Unhandled node
+LayoutTests/fast/flexbox/intrinsic-min-width-applies-with-fixed-width_t01: Crash # (throw "You must provide a CSS selector of nodes to check."): Unhandled node
+LayoutTests/fast/flexbox/layoutHorizontalBox-crash_t01: Crash # unsupported element kind: _asyncCounter:field
+LayoutTests/fast/flexbox/overhanging-floats-not-removed-crash_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/flexbox/repaint-scrollbar_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/flexbox/vertical-box-form-controls_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/forms/11423_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/forms/8250_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/forms/activate-and-disabled-elements_t01: Crash # unsupported element kind: _asyncCounter:field
+LayoutTests/fast/forms/autocomplete_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/forms/autofocus-attribute_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/forms/autofocus-focus-only-once_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/forms/autofocus-input-css-style-change_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/forms/autofocus-opera-004_t01: Crash # unsupported element kind: _asyncCounter:field
+LayoutTests/fast/forms/autofocus-opera-005_t01: Crash # unsupported element kind: _asyncCounter:field
+LayoutTests/fast/forms/autofocus-opera-007_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/forms/autofocus-opera-008_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/forms/autofocus-readonly-attribute_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/forms/button-baseline-and-collapsing_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/forms/button/button-disabled-blur_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/forms/button-click-DOM_t01: Crash # unsupported element kind: _asyncCounter:field
+LayoutTests/fast/forms/checkbox-click-indeterminate_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/forms/checkbox-default-value_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/forms/checkbox-onchange_t01: Crash # unsupported element kind: _asyncCounter:field
+LayoutTests/fast/forms/checkValidity-001_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/forms/checkValidity-002_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/forms/checkValidity-003_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/forms/checkValidity-004_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/forms/checkValidity-cancel_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/forms/checkValidity-handler-updates-dom_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/forms/clone-input-with-dirty-value_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/forms/color/color-setrangetext_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/forms/color/input-value-sanitization-color_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/forms/cursor-position_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/forms/dangling-form-element-crash_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/forms/datalist/datalist-child-validation_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/forms/datalist/datalist-nonoption-child_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/forms/datalist/datalist_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/forms/datalist/input-list_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/forms/date/date-click-on-label_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/forms/date/date-input-type_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/forms/date/date-interactive-validation-required_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/forms/date/date-pseudo-classes_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/forms/date/date-setrangetext_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/forms/date/input-date-validation-message_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/forms/date/input-valueasdate-date_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/forms/date/input-valueasnumber-date_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/forms/date-multiple-fields/date-multiple-fields-change-layout-by-value_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/forms/date-multiple-fields/date-multiple-fields-onblur-setvalue-onfocusremoved_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/forms/datetimelocal/datetimelocal-input-type_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/forms/datetimelocal/datetimelocal-interactive-validation-required_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/forms/datetimelocal/datetimelocal-pseudo-classes_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/forms/datetimelocal/datetimelocal-setrangetext_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/forms/datetimelocal/input-valueasdate-datetimelocal_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/forms/datetimelocal/input-valueasnumber-datetimelocal_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/forms/datetimelocal-multiple-fields/datetimelocal-multiple-fields-change-layout-by-value_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/forms/datetimelocal/ValidityState-rangeOverflow-datetimelocal_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/forms/datetimelocal/ValidityState-rangeUnderflow-datetimelocal_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/forms/datetimelocal/ValidityState-stepMismatch-datetimelocal_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/forms/datetimelocal/ValidityState-typeMismatch-datetimelocal_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/forms/date/ValidityState-rangeOverflow-date_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/forms/date/ValidityState-rangeUnderflow-date_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/forms/date/ValidityState-stepMismatch-date_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/forms/date/ValidityState-typeMismatch-date_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/forms/delete-text-with-invisible-br_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/forms/disabled-attr-checkvalidity_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/forms/double-focus_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/forms/enctype-attribute_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/forms/fieldset/fieldset-disabled_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/forms/fieldset/fieldset-elements_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/forms/fieldset/fieldset-name_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/forms/fieldset/fieldset-type_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/forms/fieldset/focus-in-fieldset-disabled_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/forms/fieldset/validation-in-fieldset_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/forms/file/file-input-capture_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/forms/file/file-setrangetext_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/forms/focus-style-pending_t01: Crash # unsupported element kind: _asyncCounter:field
+LayoutTests/fast/forms/focus_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/forms/form-added-to-table_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/forms/form-associated-element-crash_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/forms/form-attribute-nonexistence-form-id_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/forms/form-attribute-not-in-document_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/forms/form-attribute_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/forms/form-dirname-attribute_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/forms/form-input-named-arguments_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/forms/formmethod-attribute-button-html_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/forms/formmethod-attribute-input-2_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/forms/formmethod-attribute-input-html_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/forms/formmethod-attribute-test_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/forms/formnovalidate-attribute_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/forms/form-submission-create-crash_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/forms/hidden/hidden-setrangetext_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/forms/hidden-input-enabled_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/forms/HTMLOptionElement_selected2_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/forms/HTMLOptionElement_selected_t01: Crash # unsupported element kind: _asyncCounter:field
+LayoutTests/fast/forms/image/image-error-event-crash_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/forms/image/image-error-event-modifies-type-crash_t01: Crash # unsupported element kind: _asyncCounter:field
+LayoutTests/fast/forms/image/image-setrangetext_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/forms/image/width-and-height-of-detached-input_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/forms/incremental-dom-property_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/forms/indeterminate-input-types_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/forms/input-appearance-elementFromPoint_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/forms/input-appearance-maxlength_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/forms/input-changing-value_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/forms/input-file-set-value_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/forms/input-hit-test-border_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/forms/input-implicit-length-limit_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/forms/input-inputmode_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/forms/input-maxlength_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/forms/input-maxlength-unsupported_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/forms/input-minmax_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/forms/input-multiple_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/forms/input-pattern_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/forms/input-selection-hidden_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/forms/input-select-webkit-user-select-none_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/forms/input-setvalue-selection_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/forms/input-stepup-stepdown_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/forms/input-text-maxlength_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/forms/input-text-paste-maxlength_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/forms/input-type-change3_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/forms/input-type-change-focusout_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/forms/input-type-change_t01: Crash # unsupported element kind: _asyncCounter:field
+LayoutTests/fast/forms/input-valueasnumber-unsupported_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/forms/input-value-sanitization_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/forms/input-width-height-attributes_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/forms/input-width-height-attributes-without-renderer-loaded-image_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/forms/input-width-height-attributes-without-renderer_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/forms/input-widths_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/forms/interactive-validation-assertion-by-validate-twice_t01: Crash # unsupported element kind: _asyncCounter:field
+LayoutTests/fast/forms/interactive-validation-attach-assertion_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/forms/interactive-validation-select-crash_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/forms/legend-absolute-position-auto-width_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/forms/legend-display-none_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/forms/listbox-scroll-after-options-removed_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/forms/listbox-select-all_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/forms/listbox-selection-2_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/forms/menulist-disabled-selected-option_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/forms/menulist-selection-reset_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/forms/menulist-submit-without-selection_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/forms/method-attribute_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/forms/min-content-form-controls_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/forms/missing-action_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/forms/multiple-selected-options-innerHTML_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/forms/novalidate-attribute_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/forms/onchange-change-type_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/forms/option-change-single-selected_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/forms/option-index_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/forms/option-label-trim-html-spaces_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/forms/option-strip-unicode-spaces_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/forms/option-value-and-label-changed-by-js_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/forms/option-value-and-label_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/forms/option-value-trim-html-spaces_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/forms/parser-associated-form-removal_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/forms/paste-into-textarea_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/forms/paste-multiline-text-input_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/forms/pattern-attribute-001_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/forms/pattern-attribute-002_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/forms/pattern-attribute-003_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/forms/percent-height-auto-width-form-controls_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/forms/placeholder-dom-property_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/forms/plaintext-mode-1_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/forms/radio-checkbox-restore-indeterminate_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/forms/required-attribute-001_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/forms/required-attribute-002_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/forms/search-placeholder-value-changed_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/forms/search-popup-crasher_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/forms/select-change-listbox-to-popup-roundtrip_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/forms/select-change-popup-to-listbox-in-event-handler_t01: Crash # unsupported element kind: _asyncCounter:field
+LayoutTests/fast/forms/select-change-popup-to-listbox-roundtrip_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/forms/select-clientheight-large-size_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/forms/select-clientheight-with-multiple-attr_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/forms/select-generated-content_t01: Crash # unsupported element kind: _asyncCounter:field
+LayoutTests/fast/forms/selection-direction_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/forms/selection-start-end-readonly_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/forms/selection-wrongtype_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/forms/select-max-length_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/forms/select-namedItem_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/forms/select-remove-option_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/forms/select-reset-multiple-selections-4-single-selection_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/forms/select-reset_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/forms/select-set-length_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/forms/select-set-length-with-mutation-remove_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/forms/select-set-length-with-mutation-reorder_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/forms/select-set-length-with-mutation-reparent_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/forms/select-set-length-with-mutation_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/forms/select-width-font-change_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/forms/setCustomValidity-arguments_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/forms/setCustomValidity-existence_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/forms/setCustomValidity_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/forms/setrangetext_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/forms/shadow-tree-exposure_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/forms/slow-click_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/forms/submit-form-attributes_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/forms/submit-form-with-dirname-attribute_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/forms/submit-form-with-dirname-attribute-with-ancestor-dir-attribute_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/forms/submit-form-with-dirname-attribute-with-nonhtml-ancestor_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/forms/textarea-crlf_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/forms/textarea-default-value-leading-newline_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/forms/textarea-initial-caret-position_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/forms/textarea-maxlength_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/forms/textarea-newline_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/forms/textarea-no-scroll-on-blur_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/forms/textarea-paste-newline_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/forms/textarea-placeholder-dom-property_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/forms/textarea-placeholder-relayout-assertion_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/forms/textarea-rows-cols_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/forms/textarea-scrollbar-height_t01: Crash # unsupported element kind: _asyncCounter:field
+LayoutTests/fast/forms/textarea-selection-preservation_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/forms/textarea-set-defaultvalue-after-value_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/forms/textarea-setvalue-without-renderer_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/forms/textarea-submit-crash_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/forms/textarea-trailing-newline_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/forms/textarea-wrap-attribute_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/forms/text-control-select-blurred_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/forms/textfield-clone_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/forms/textfield-focus-out_t01: Crash # unsupported element kind: _asyncCounter:field
+LayoutTests/fast/forms/validationMessage_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/forms/validity-property_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/forms/ValidityState-customError_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/forms/ValidityState-patternMismatch_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/forms/ValidityState-patternMismatch-unsupported_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/forms/ValidityState-rangeOverflow_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/forms/ValidityState-rangeUnderflow_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/forms/ValidityState-stepMismatch_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/forms/ValidityState-tooLong-input_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/forms/ValidityState-tooLong-textarea_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/forms/ValidityState-typeMismatch-email_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/forms/ValidityState-typeMismatch-url_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/forms/ValidityState-valueMissing-001_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/forms/ValidityState-valueMissing-002_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/forms/ValidityState-valueMissing-003_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/forms/ValidityState-valueMissing-004_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/forms/ValidityState-valueMissing-005_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/forms/ValidityState-valueMissing-006_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/forms/ValidityState-valueMissing-008_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/forms/ValidityState-valueMissing-009_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/forms/willvalidate_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/html/adjacent-html-context-element_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/html/article-element_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/html/aside-element_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/html/body-offset-properties_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/html/clone-range_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/html/details-add-child-1_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/html/details-add-child-2_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/html/details-add-details-child-1_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/html/details-add-details-child-2_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/html/details-click-controls_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/html/details-mouse-click_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/html/disable-style-element_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/html/draggable_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/html/empty-fragment-id-goto-top_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/html/eventhandler-attribute-non-callable_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/html/figcaption-element_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/html/figure-element_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/html/footer-element_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/html/header-element_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/html/hgroup-element_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/html/hidden-attr-dom_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/html/hidden-attr_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/html/imports/import-element-removed-flag_t01: Crash # unsupported element kind: _asyncCounter:field
+LayoutTests/fast/html/imports/import-events_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/html/input-type-change-crash_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/html/layout-with-pending-stylesheet_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/html/main-element_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/html/mark-element_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/html/numbered-header-element_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/html/object-border_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/html/range-point-in-range-for-different-documents_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/html/section-element_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/html/select-dropdown-consistent-background-color_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/html/tabindex-removal_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/html/text-field-input-types_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/html/unknown-tag_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/html/xhtml-serialize_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/inline-block/inline-block-vertical-align-t02: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/inline/boundingBox-with-continuation_t01: Crash # (internals): Error expression `internals` unhandled.
+LayoutTests/fast/inline/continuation-inlines-inserted-in-reverse-after-block_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/inline/empty-inline-before-collapsed-space_t01: Crash # (throw "You must provide a CSS selector of nodes to check."): Unhandled node
+LayoutTests/fast/inline/fixed-pos-moves-with-abspos-inline-parent_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/inline/fixed-pos-moves-with-abspos-parent-relative-ancestor_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/inline/fixed-pos-moves-with-abspos-parent_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/inline/fixed-pos-with-transform-container-moves-with-abspos-parent_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/inline/inline-position-top-align_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/inline/inline-relative-offset-boundingbox_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/inline/inline-with-empty-inline-children_t01: Crash # (throw "You must provide a CSS selector of nodes to check."): Unhandled node
+LayoutTests/fast/inline/out-of-flow-objects-and-whitespace-after-empty-inline_t01: Crash # (throw "You must provide a CSS selector of nodes to check."): Unhandled node
+LayoutTests/fast/inline/parent-inline-element-padding-contributes-width_t01: Crash # (throw "You must provide a CSS selector of nodes to check."): Unhandled node
+LayoutTests/fast/inline/positioned-element-padding-contributes-width_t01: Crash # (throw "You must provide a CSS selector of nodes to check."): Unhandled node
+LayoutTests/fast/inline/reattach-inlines-in-anonymous-blocks-with-out-of-flow-siblings_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/inline/skipped-whitespace-client-rect_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/innerHTML/001_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/innerHTML/002_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/innerHTML/003_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/innerHTML/005_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/innerHTML/additional-inline-style_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/innerHTML/innerHTML-case_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/innerHTML/innerHTML-custom-tag_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/innerHTML/innerHTML-iframe_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/innerHTML/innerHTML-nbsp_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/innerHTML/innerHTML-special-elements_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/innerHTML/innerHTML-svg-read_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/innerHTML/innerHTML-svg-write_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/innerHTML/innerHTML-uri-resolution_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/innerHTML/javascript-url_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/layers/negative-scroll-positions_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/layers/normal-flow-hit-test_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/layers/zindex-hit-test_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/lists/calc-width-with-space_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/lists/item-not-in-list-line-wrapping_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/lists/list-style-position-inside_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/lists/marker-preferred-margins_t01: Crash # (throw "You must provide a CSS selector of nodes to check."): Unhandled node
+LayoutTests/fast/loader/about-blank-hash-change_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/loader/about-blank-hash-kept_t01: Crash # (new_hash): Error expression `new_hash` unhandled.
+LayoutTests/fast/loader/hashchange-event-async_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/loader/hashchange-event-properties_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/loader/loadInProgress_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/loader/local-css-allowed-in-strict-mode_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/loader/onhashchange-attribute-listeners_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/loader/onload-policy-ignore-for-frame_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/loader/scroll-position-restored-on-back_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/loader/scroll-position-restored-on-reload-at-load-event_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/loader/stateobjects/pushstate-updates-location_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/loader/stateobjects/replacestate-in-onunload_t01: Crash # (history): Error expression `history` unhandled.
+LayoutTests/fast/loader/stateobjects/replacestate-updates-location_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/masking/parsing-clip-path-iri_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/masking/parsing-clip-path-shape_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/masking/parsing-mask-source-type_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/masking/parsing-mask_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/media/color-does-not-include-alpha_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/media/invalid-lengths_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/media/matchmedium-query-api_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/media/media-query-list-syntax_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/media/media-query-list_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/media/media-query-serialization_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/media/mq-append-delete_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/media/mq-color-index_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/media/mq-color-index_t02: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/media/mq-js-media-except_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/media/mq-js-media-except_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/media/mq-js-update-media_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/media/mq-parsing_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/mediastream/getusermedia_t01: Crash # (gotStream1): Error expression `gotStream1` unhandled.
+LayoutTests/fast/mediastream/RTCIceCandidate_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/mediastream/RTCPeerConnection-AddRemoveStream_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/multicol/balance-short-trailing-empty-block_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/multicol/balance-trailing-border_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/multicol/balance-trailing-border_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/multicol/balance-unbreakable_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/multicol/break-after-always-bottom-margin_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/multicol/break-properties_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/multicol/columns-shorthand-parsing_t02: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/multicol/column-width-zero_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/multicol/cssom-view_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/multicol/fixed-column-percent-logical-height-orthogonal-writing-mode_t01: Crash # (throw "You must provide a CSS selector of nodes to check."): Unhandled node
+LayoutTests/fast/multicol/flipped-blocks-hit-test_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/multicol/float-truncation_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/multicol/gap-non-negative_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/multicol/hit-test-above-or-below_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/multicol/hit-test-end-of-column_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/multicol/hit-test-end-of-column-with-line-height_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/multicol/hit-test-float_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/multicol/hit-test-gap-between-pages-flipped_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/multicol/hit-test-gap-between-pages_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/multicol/image-inside-nested-blocks-with-border_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/multicol/inherit-column-values_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/multicol/initial-column-values_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/multicol/inline-getclientrects_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/multicol/newmulticol/balance-images_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/multicol/newmulticol/balance-maxheight_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/multicol/newmulticol/balance-maxheight_t02: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/multicol/newmulticol/balance_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/multicol/newmulticol/balance_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/multicol/newmulticol/balance_t03: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/multicol/newmulticol/balance_t04: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/multicol/newmulticol/balance_t05: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/multicol/newmulticol/balance_t06: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/multicol/newmulticol/balance_t07: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/multicol/newmulticol/balance_t08: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/multicol/newmulticol/balance_t09: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/multicol/newmulticol/balance_t10: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/multicol/orphans-relayout_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/multicol/vertical-lr/break-properties_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/multicol/vertical-lr/float-truncation_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/multicol/vertical-lr/gap-non-negative_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/multicol/vertical-lr/image-inside-nested-blocks-with-border_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/multicol/vertical-rl/break-properties_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/multicol/vertical-rl/float-truncation_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/multicol/vertical-rl/gap-non-negative_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/multicol/vertical-rl/image-inside-nested-blocks-with-border_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/multicol/widows-and-orphans_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/multicol/widows_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/multicol/widows_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/multicol/zeroColumnCount_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/overflow/child-100percent-height-inside-fixed-container-with-overflow-auto_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/overflow/height-during-simplified-layout_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/overflow/overflow-rtl-vertical-origin_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/overflow/replaced-child-100percent-height-inside-fixed-container-with-overflow-auto_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/overflow/scrollbar-restored_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/overflow/scroll-vertical-not-horizontal_t01: Crash # unsupported element kind: _asyncCounter:field
+LayoutTests/fast/parser/block-nesting-cap_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/parser/foster-parent-adopted_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/parser/foster-parent-adopted_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/parser/foster-parent_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/parser/fragment-parser-doctype_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/parser/href-whitespace_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/parser/image-tag-parses-to-HTMLImageElement_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/parser/innerhtml-with-prefixed-elements_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/parser/parse-wbr_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/parser/pop-all-after-after-body_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/parser/pre-first-line-break_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/parser/residual-style-close-across-n-blocks_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/parser/stray-end-tags-with-attributes-001_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/parser/stray-end-tags-with-attributes-002-alt_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/parser/stray-end-tags-with-attributes-002_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/parser/stray-param_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/parser/strict-img-in-map_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/replaced/available-height-for-content_t01: Crash # (throw "You must provide a CSS selector of nodes to check."): Unhandled node
+LayoutTests/fast/replaced/computed-image-width-with-percent-height-and-fixed-ancestor_t01: Crash # (throw "You must provide a CSS selector of nodes to check."): Unhandled node
+LayoutTests/fast/replaced/computed-image-width-with-percent-height-and-fixed-ancestor-vertical-lr_t01: Crash # (throw "You must provide a CSS selector of nodes to check."): Unhandled node
+LayoutTests/fast/replaced/computed-image-width-with-percent-height-inside-table-cell-and-fixed-ancestor_t01: Crash # (throw "You must provide a CSS selector of nodes to check."): Unhandled node
+LayoutTests/fast/replaced/computed-image-width-with-percent-height-inside-table-cell-and-fixed-ancestor-vertical-lr_t01: Crash # (throw "You must provide a CSS selector of nodes to check."): Unhandled node
+LayoutTests/fast/replaced/container-width-zero_t01: Crash # (throw "You must provide a CSS selector of nodes to check."): Unhandled node
+LayoutTests/fast/replaced/iframe-with-percentage-height-within-table-with-anonymous-table-cell_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/replaced/iframe-with-percentage-height-within-table-with-table-cell-ignore-height_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/replaced/preferred-widths_t01: Crash # (throw "You must provide a CSS selector of nodes to check."): Unhandled node
+LayoutTests/fast/replaced/table-percent-height_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/replaced/table-percent-height-text-controls_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/replaced/table-percent-width_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/replaced/table-replaced-element_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/ruby/modify-positioned-ruby-text-crash_t01: Crash # handleStaticFunctionGet: function(doTest)
+LayoutTests/fast/ruby/parse-rp_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/ruby/ruby-line-height_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/scrolling/scroll-element-into-view_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/scrolling/scroll-max-value_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/selectors/querySelector-leftmost-selector-matches-ancestor_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/selectors/querySelector-leftmost-selector-matches-rootNode_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/selectors/querySelector-scope_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/selectors/specificity-overflow_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/selectors/style-sharing-adjacent-selector_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/selectors/style-sharing-last-child_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/shapes/parsing/parsing-shape-image-threshold_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/shapes/parsing/parsing-shape-lengths_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/shapes/parsing/parsing-shape-margin_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/shapes/parsing/parsing-shape-outside-none_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/shapes/parsing/parsing-shape-outside_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/shapes/parsing/parsing-shape-property-aliases_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/shapes/shape-outside-floats/shape-outside-big-box-border-radius_t01: Crash # Error expression `shouldBeCloseTo(elementRect('b').right,borderXIntercept(20),1)` unhandled.
+LayoutTests/fast/shapes/shape-outside-floats/shape-outside-floats-diamond-margin-polygon_t01: Crash # Error expression `shouldBeCloseTo(elementRect('l1').left,marginLeftXIntercept(1),1)` unhandled.
+LayoutTests/fast/shapes/shape-outside-floats/shape-outside-floats-ellipse-margin-left_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/shapes/shape-outside-floats/shape-outside-floats-ellipse-margin-right_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/shapes/shape-outside-floats/shape-outside-floats-image-margin_t01: Crash # Error expression `shouldBeCloseTo(imageShapeRect('a').left,292,1)` unhandled.
+LayoutTests/fast/shapes/shape-outside-floats/shape-outside-floats-image-margin_t02: Crash # Error expression `shouldBeCloseTo(imageShapeRect('a').right,292,1)` unhandled.
+LayoutTests/fast/shapes/shape-outside-floats/shape-outside-floats-inset-rounded-different-writing-modes-left_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/shapes/shape-outside-floats/shape-outside-floats-inset-rounded-different-writing-modes-right_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/shapes/shape-outside-floats/shape-outside-rounded-boxes_t01: Crash # Error expression `shouldBeCloseTo(elementRect('b').left,cornerEllipseRightXIntercept(40,0,100,30),SubPixelLayout.resolution())` unhandled.
+LayoutTests/fast/shapes/shape-outside-floats/shape-outside-rounded-boxes_t02: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/speechsynthesis/speech-synthesis-boundary-events_t01: Crash # unsupported element kind: _asyncCounter:field
+LayoutTests/fast/speechsynthesis/speech-synthesis-cancel_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/speechsynthesis/speech-synthesis-pause-resume_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/speechsynthesis/speech-synthesis-speak_t01: Crash # unsupported element kind: _asyncCounter:field
+LayoutTests/fast/speechsynthesis/speech-synthesis-utterance-uses-voice_t01: Crash # unsupported element kind: _asyncCounter:field
+LayoutTests/fast/speechsynthesis/speech-synthesis-voices_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/storage/disallowed-storage_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/storage/storage-disallowed-in-data-url_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/sub-pixel/auto-table-layout-should-avoid-text-wrapping_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/sub-pixel/block-preferred-widths-with-sub-pixel-floats_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/sub-pixel/boundingclientrect-subpixel-margin_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/sub-pixel/client-and-offset-width_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/sub-pixel/computedstylemargin_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/sub-pixel/cssom-subpixel-precision_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/sub-pixel/float-containing-block-with-margin_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/sub-pixel/float-list-inside_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/sub-pixel/float-percentage-widths_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/sub-pixel/float-with-margin-in-container_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/sub-pixel/float-with-right-margin-zoom_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/sub-pixel/inline-block-with-padding_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/sub-pixel/layout-boxes-with-zoom_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/sub-pixel/replaced-element-baseline_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/sub-pixel/shadows-computed-style_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/sub-pixel/size-of-span-with-different-positions_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/sub-pixel/table-cells-have-stable-width_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/sub-pixel/table-cells-with-padding-do-not-wrap_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/sub-pixel/table-rows-have-stable-height_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/sub-pixel/tiled-canvas-elements_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/sub-pixel/vertical-align-middle-overflow_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/svg/getbbox_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/svg/tabindex-focus_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/svg/whitespace-angle_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/svg/whitespace-integer_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/svg/whitespace-length-invalid_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/svg/whitespace-length_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/svg/whitespace-number_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/table/absolute-table-percent-lengths_t01: Crash # (throw "You must provide a CSS selector of nodes to check."): Unhandled node
+LayoutTests/fast/table/anonymous-table-section-removed_t01: Crash # (throw "You must provide a CSS selector of nodes to check."): Unhandled node
+LayoutTests/fast/table/before-child-non-table-section-add-table-crash_t01: Crash # handleStaticFunctionGet: function(runTest)
+LayoutTests/fast/table/border-changes_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/table/caption-orthogonal-writing-mode-sizing_t01: Crash # (throw "You must provide a CSS selector of nodes to check."): Unhandled node
+LayoutTests/fast/table/col-width-span-expand_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/table/css-table-max-height_t01: Crash # (throw "You must provide a CSS selector of nodes to check."): Unhandled node
+LayoutTests/fast/table/css-table-max-width_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/table/css-table-width_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/table/css-table-width-with-border-padding_t01: Crash # (throw "You must provide a CSS selector of nodes to check."): Unhandled node
+LayoutTests/fast/table/fixed-table-layout-toggle-colwidth_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/table/fixed-table-layout-width-change_t01: Crash # (throw "You must provide a CSS selector of nodes to check."): Unhandled node
+LayoutTests/fast/table/fixed-table-with-percent-width-inside-extra-large-div_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/table/form-with-non-table-display-inside-table-elements_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/table/hittest-tablecell-bottom-edge_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/table/hittest-tablecell-right-edge_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/table/hittest-tablecell-with-borders-bottom-edge_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/table/hittest-tablecell-with-borders-right-edge_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/table/html-table-width-max-width-constrained_t01: Crash # (throw "You must provide a CSS selector of nodes to check."): Unhandled node
+LayoutTests/fast/table/incorrect-colgroup-span-values_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/table/large-shrink-wrapped-width_t01: Crash # (throw "You must provide a CSS selector of nodes to check."): Unhandled node
+LayoutTests/fast/table/margins-flipped-text-direction_t01: Crash # (throw "You must provide a CSS selector of nodes to check."): Unhandled node
+LayoutTests/fast/table/margins-perpendicular-containing-block_t01: Crash # (throw "You must provide a CSS selector of nodes to check."): Unhandled node
+LayoutTests/fast/table/min-max-width-preferred-size_t01: Crash # (throw "You must provide a CSS selector of nodes to check."): Unhandled node
+LayoutTests/fast/table/min-width-css-block-table_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/table/min-width-css-inline-table_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/table/min-width-html-block-table_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/table/min-width-html-inline-table_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/table/nested-tables-with-div-offset_t01: Crash # (throw "You must provide a CSS selector of nodes to check."): Unhandled node
+LayoutTests/fast/table/padding-height-and-override-height_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/table/prepend-in-anonymous-table_t01: Crash # unsupported element kind: childTypes:field
+LayoutTests/fast/table/resize-table-binding-cell_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/table/resize-table-cell_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/table/resize-table-row_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/table/rowindex-comment-nodes_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/table/switch-table-layout-dynamic-cells_t01: Crash # (throw "You must provide a CSS selector of nodes to check."): Unhandled node
+LayoutTests/fast/table/switch-table-layout-multiple-section_t01: Crash # (throw "You must provide a CSS selector of nodes to check."): Unhandled node
+LayoutTests/fast/table/switch-table-layout_t01: Crash # (throw "You must provide a CSS selector of nodes to check."): Unhandled node
+LayoutTests/fast/table/table-all-rowspans-height-distribution-in-rows-except-overlapped_t01: Crash # (throw "You must provide a CSS selector of nodes to check."): Unhandled node
+LayoutTests/fast/table/table-all-rowspans-height-distribution-in-rows_t01: Crash # (throw "You must provide a CSS selector of nodes to check."): Unhandled node
+LayoutTests/fast/table/table-cell-offset-width_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/table/table-colgroup-present-after-table-row_t01: Crash # (throw "You must provide a CSS selector of nodes to check."): Unhandled node
+LayoutTests/fast/table/table-rowspan-cell-with-empty-cell_t01: Crash # (throw "You must provide a CSS selector of nodes to check."): Unhandled node
+LayoutTests/fast/table/table-rowspan-height-distribution-in-rows_t01: Crash # (throw "You must provide a CSS selector of nodes to check."): Unhandled node
+LayoutTests/fast/table/table-rowspan-height-distribution-in-rows_t02: Crash # (throw "You must provide a CSS selector of nodes to check."): Unhandled node
+LayoutTests/fast/table/table-sections-border-spacing_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/table/table-size-integer-overflow_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/table/table-width-exceeding-max-width_t01: Crash # (throw "You must provide a CSS selector of nodes to check."): Unhandled node
+LayoutTests/fast/table/table-with-borderattr-null_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/table/table-with-borderattr-set-to-null_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/table/table-with-content-width-exceeding-max-width_t01: Crash # (throw "You must provide a CSS selector of nodes to check."): Unhandled node
+LayoutTests/fast/table/td-bordercolor-attribute_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/text-autosizing/display-type-change-lineHeight_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/text-autosizing/inline-width_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/text-autosizing/table-inline-width_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/text-autosizing/text-removal_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/text-autosizing/vertical-writing-mode_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/text/container-align-with-inlines_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/text/decomposed-after-stacked-diacritics_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/text/find-backwards_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/text/find-case-folding_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/text/find-hidden-text_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/text/find-kana_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/text/find-quotes_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/text/find-russian_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/text/find-soft-hyphen_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/text/find-spaces_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/text/font-fallback-synthetic-italics_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/text/font-ligature-letter-spacing_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/text/font-ligatures-linebreak_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/text/font-ligatures-linebreak-word_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/text/font-linux-normalize_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/text/font-size-zero_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/text/glyph-reordering_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/text/international/cjk-segmentation_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/text/international/combining-marks-position_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/text/international/complex-text-rectangle_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/text/international/iso-8859-8_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/text/international/listbox-width-rtl_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/text/international/rtl-text-wrapping_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/text/international/thai-offsetForPosition-inside-character_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/text/ipa-tone-letters_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/text/justification-padding-mid-word_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/text/line-break-after-empty-inline-hebrew_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/text/line-break-after-inline-latin1_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/text/line-break-after-question-mark_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/text/line-breaks-after-closing-punctuations_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/text/line-breaks-after-hyphen-before-number_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/text/line-breaks-after-ideographic-comma-or-full-stop_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/text/line-breaks-after-ideographic-comma-or-full-stop_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/text/multiglyph-characters_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/text/offsetForPosition-cluster-at-zero_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/text/pre-wrap-trailing-tab_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/text/regional-indicator-symobls_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/text/remove-zero-length-run_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/text/selection-exceptions_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/text/soft-hyphen-5_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/text/split-text-crash_t01: Crash # handleStaticFunctionGet: function(crash)
+LayoutTests/fast/text/sub-pixel/text-scaling-ltr_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/text/sub-pixel/text-scaling-pixel_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/text/sub-pixel/text-scaling-rtl_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/text/sub-pixel/text-scaling-vertical_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/text/sub-pixel/text-scaling-webfont_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/text/text-between-two-brs-in-nowrap-overflow_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/text/text-combine-shrink-to-fit_t01: Crash # (throw "You must provide a CSS selector of nodes to check."): Unhandled node
+LayoutTests/fast/text/whitespace/nowrap-line-break-after-white-space_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/text/window-find_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/text/zero-width-characters-complex-script_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/text/zero-width-characters_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/tokenizer/doctype-search-reset_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/tokenizer/entities_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/tokenizer/entities_t02: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/tokenizer/entities_t03: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/transforms/bounding-rect-zoom_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/transforms/hit-test-large-scale_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/transforms/scrollIntoView-transformed_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/transforms/topmost-becomes-bottomost-for-scrolling_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/transforms/transform-hit-test-flipped_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/transforms/transform-inside-overflow-scroll_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/url/anchor_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/url/file-http-base_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/url/file_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/url/host-lowercase-per-scheme_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/url/host_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/url/idna2003_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/url/idna2008_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/url/invalid-urls-utf8_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/url/ipv4_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/url/ipv6_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/url/mailto_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/url/path_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/url/path-url_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/url/port_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/url/query_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/url/relative_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/url/relative-unix_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/url/relative-win_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/url/safari-extension_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/url/scheme_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/url/segments-from-data-url_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/url/segments_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/url/standard-url_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/url/trivial-segments_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/url/trivial_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/writing-mode/auto-margins-across-boundaries_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/writing-mode/auto-sizing-orthogonal-flows_t01: Crash # (throw "You must provide a CSS selector of nodes to check."): Unhandled node
+LayoutTests/fast/writing-mode/block-formatting-context_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/writing-mode/broken-ideographic-font_t01: Crash # unsupported element kind: _asyncCounter:field
+LayoutTests/fast/writing-mode/display-mutation_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/writing-mode/flipped-blocks-hit-test-overflow-scroll_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/writing-mode/flipped-blocks-hit-test-overflow_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/writing-mode/flipped-blocks-text-map-local-to-container_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/writing-mode/overhanging-float-legend-crash_t01: Crash # handleStaticFunctionGet: function(crash)
+LayoutTests/fast/writing-mode/percentage-margins-absolute-replaced_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/writing-mode/percentage-margins-absolute_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/writing-mode/percentage-padding_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/writing-mode/positionForPoint_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/writing-mode/relative-positioning-percentages_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/writing-mode/table-hit-test_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/writing-mode/vertical-font-vmtx-units-per-em_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/writing-mode/vertical-inline-block-hittest_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/xmlhttprequest/null-document-xmlhttprequest-open_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/xmlhttprequest/xmlhttprequest-default-attributes_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/xmlhttprequest/xmlhttprequest-get_t01: Crash # unsupported element kind: _asyncCounter:field
+LayoutTests/fast/xmlhttprequest/xmlhttprequest-html-response-encoding_t01: Crash # unsupported element kind: _asyncCounter:field
+LayoutTests/fast/xmlhttprequest/xmlhttprequest-invalid-values_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/xmlhttprequest/xmlhttprequest-responsetype-abort_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/xmlhttprequest/xmlhttprequest-responsetype-arraybuffer_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/xmlhttprequest/xmlhttprequest-responsetype-before-open-sync-request_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/xmlhttprequest/xmlhttprequest-responsetype-before-open_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/xmlhttprequest/xmlhttprequest-responsetype-document_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/xmlhttprequest/xmlhttprequest-responsetype-set-at-headers-received_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/xmlhttprequest/xmlhttprequest-responsetype-sync-request_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/xmlhttprequest/xmlhttprequest-responsetype-text_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/xmlhttprequest/xmlhttprequest-responseXML-html-document-responsetype-quirks_t01: Crash # unsupported element kind: _asyncCounter:field
+LayoutTests/fast/xmlhttprequest/xmlhttprequest-responseXML-html-no-responsetype_t01: Crash # unsupported element kind: _asyncCounter:field
+LayoutTests/fast/xmlhttprequest/xmlhttprequest-responseXML-invalid-xml_t01: Crash # unsupported element kind: _asyncCounter:field
+LayoutTests/fast/xmlhttprequest/xmlhttprequest-responseXML-xml-document-responsetype_t01: Crash # unsupported element kind: _asyncCounter:field
+LayoutTests/fast/xmlhttprequest/xmlhttprequest-responseXML-xml-text-responsetype_t01: Crash # unsupported element kind: _asyncCounter:field
+LayoutTests/fast/xmlhttprequest/xmlhttprequest-set-responsetype_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/xmlhttprequest/xmlhttprequest-withcredentials-before-open_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/xpath/4XPath/Borrowed/cz_20030217_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/xpath/4XPath/Borrowed/kd_20010423_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/xpath/4XPath/Borrowed/namespace-nodes_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/xpath/4XPath/Borrowed/od_20000608_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/xpath/4XPath/Borrowed/rs_20010831_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/xpath/4XPath/Borrowed/sr_20021217_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/xpath/4XPath/Core/test_boolean_expr_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/xpath/4XPath/Core/test_core_functions_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/xpath/4XPath/Core/test_core_functions_t02: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/xpath/4XPath/Core/test_literal_expr_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/xpath/4XPath/Core/test_location_path_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/xpath/4XPath/Core/test_nodeset_expr_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/xpath/4XPath/Core/test_node_test_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/xpath/4XPath/Core/test_node_test_t02: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/xpath/4XPath/Core/test_numeric_expr_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/xpath/4XPath/Core/test_parser_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/xpath/4XPath/Core/test_predicate_list_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/xpath/4XPath/Core/test_step_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/xpath/ambiguous-operators_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/xpath/ancestor-axis_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/xpath/attribute-node-predicate_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/xpath/attr-namespace_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/xpath/attr-namespace_t02: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/xpath/complex-id_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/xpath/detached-subtree-invalidate-iterator_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/xpath/empty-string-substring_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/xpath/ensure-null-namespace_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/xpath/evaluator-exceptions_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/xpath/id-path_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/xpath/id-simple_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/xpath/implicit-node-args_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/xpath/invalid-resolver_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/xpath/name-null-namespace_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/xpath/nan-to-boolean_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/xpath/node-name-case-sensitivity_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/xpath/node-name-case-sensitivity_t02: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/xpath/nodeset-duplicates_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/xpath/position_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/xpath/py-dom-xpath/abbreviations_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/xpath/py-dom-xpath/axes_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/xpath/py-dom-xpath/data_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/xpath/py-dom-xpath/expressions_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/xpath/py-dom-xpath/paths_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/xpath/reverse-axes_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/xpath/substring-after_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/xpath/substring-nan-position_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/xpath/substring-non-positive-postion_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/xpath/xpath-detached-nodes_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/xpath/xpath-template-element_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/xsl/default-html_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/xsl/extra-lf-at-end_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/xsl/nbsp-in-stylesheet_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LayoutTests/fast/xsl/transformToFragment-XML-declaration_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests/fast/xsl/xslt-bad-import-uri_t01: Crash # unsupported element kind: _completer:field
+LayoutTests/fast/xsl/xslt-string-parameters_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/async/Completer/complete_A01_t01: Crash # Please triage this failure.
+LibTest/async/Completer/complete_A01_t02: Crash # unsupported element kind: _completer:field
+LibTest/async/Completer/complete_A01_t03: Crash # unsupported element kind: _asyncCounter:field
+LibTest/async/Completer/complete_A01_t04: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/async/Completer/complete_A01_t05: Crash # unsupported element kind: _completer:field
+LibTest/async/Completer/complete_A01_t06: Crash # unsupported element kind: _completer:field
+LibTest/async/Completer/complete_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/async/Completer/complete_A02_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/async/Completer/completeError_A01_t01: Crash # Please triage this failure.
+LibTest/async/Completer/completeError_A01_t02: Crash # (throw error): Unhandled node
+LibTest/async/Completer/completeError_A01_t03: Crash # unsupported element kind: _completer:field
+LibTest/async/Completer/completeError_A01_t04: Crash # unsupported element kind: _completer:field
+LibTest/async/Completer/completeError_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/async/Completer/completeError_A03_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/async/Completer/completeError_A03_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/async/Completer/Completer_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/async/Completer/Completer.sync_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/async/Completer/future_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/async/Completer/isCompleted_A01_t01: Crash # Please triage this failure.
+LibTest/async/DeferredLibrary/DeferredLibrary_A01_t01: Crash # (try {lazy.method();}on NoSuchMethodError catch (ok){}): "on T" catch block
+LibTest/async/Future/asStream_A01_t01: Crash # Please triage this failure.
+LibTest/async/Future/asStream_A01_t02: Crash # unsupported element kind: _completer:field
+LibTest/async/Future/asStream_A02_t01: Crash # unsupported element kind: _completer:field
+LibTest/async/Future/asStream_A02_t02: Crash # unsupported element kind: _completer:field
+LibTest/async/Future/catchError_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/async/Future/catchError_A01_t02: Crash # unsupported element kind: _asyncCounter:field
+LibTest/async/Future/catchError_A02_t01: Crash # unsupported element kind: _completer:field
+LibTest/async/Future/catchError_A03_t01: Crash # unsupported element kind: _asyncCounter:field
+LibTest/async/Future/catchError_A03_t02: Crash # unsupported element kind: _completer:field
+LibTest/async/Future/catchError_A03_t03: Crash # unsupported element kind: _asyncCounter:field
+LibTest/async/Future/catchError_A03_t04: Crash # (throw error): Unhandled node
+LibTest/async/Future/catchError_A03_t05: Crash # unsupported element kind: _completer:field
+LibTest/async/Future/forEach_A01_t01: Crash # unsupported element kind: _completer:field
+LibTest/async/Future/forEach_A02_t01: Crash # unsupported element kind: N:field
+LibTest/async/Future/forEach_A03_t01: Crash # unsupported element kind: _completer:field
+LibTest/async/Future/Future_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/async/Future/Future_A01_t02: Crash # unsupported element kind: _completer:field
+LibTest/async/Future/Future_A01_t03: Crash # unsupported element kind: _completer:field
+LibTest/async/Future/Future_A01_t04: Crash # unsupported element kind: _completer:field
+LibTest/async/Future/Future.delayed_A01_t01: Crash # Please triage this failure.
+LibTest/async/Future/Future.delayed_A01_t02: Crash # unsupported element kind: _completer:field
+LibTest/async/Future/Future.delayed_A02_t01: Crash # unsupported element kind: _completer:field
+LibTest/async/Future/Future.delayed_A03_t01: Crash # (throw value): Unhandled node
+LibTest/async/Future/Future.error_A01_t01: Crash # Please triage this failure.
+LibTest/async/Future/Future.error_A01_t02: Crash # (throw error): Unhandled node
+LibTest/async/Future/Future.microtask_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/async/Future/Future.microtask_A01_t02: Crash # unsupported element kind: _completer:field
+LibTest/async/Future/Future.microtask_A01_t03: Crash # unsupported element kind: _completer:field
+LibTest/async/Future/Future.microtask_A01_t04: Crash # unsupported element kind: _completer:field
+LibTest/async/Future/Future.sync_A01_t01: Crash # Please triage this failure.
+LibTest/async/Future/Future.sync_A01_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/async/Future/Future.sync_A01_t03: Crash # Please triage this failure.
+LibTest/async/Future/Future.sync_A01_t04: Crash # unsupported element kind: _completer:field
+LibTest/async/Future/Future.value_A01_t01: Crash # Please triage this failure.
+LibTest/async/Future/Future.value_A01_t02: Crash # unsupported element kind: _completer:field
+LibTest/async/Future/then_A01_t01: Crash # unsupported element kind: _completer:field
+LibTest/async/Future/then_A01_t02: Crash # unsupported element kind: _asyncCounter:field
+LibTest/async/Future/then_A01_t03: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/async/Future/then_A01_t04: Crash # unsupported element kind: _completer:field
+LibTest/async/Future/then_A02_t01: Crash # unsupported element kind: _completer:field
+LibTest/async/Future/then_A03_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/async/Future/then_A03_t02: Crash # unsupported element kind: _completer:field
+LibTest/async/Future/then_A04_t01: Crash # unsupported element kind: _completer:field
+LibTest/async/Future/then_A05_t01: Crash # unsupported element kind: _completer:field
+LibTest/async/Future/then_A05_t02: Crash # (throw error): Unhandled node
+LibTest/async/Future/then_A05_t03: Crash # unsupported element kind: _completer:field
+LibTest/async/Future/wait_A01_t01: Crash # unsupported element kind: _completer:field
+LibTest/async/Future/wait_A01_t03: Crash # unsupported element kind: _completer:field
+LibTest/async/Future/wait_A01_t04: Crash # unsupported element kind: _completer:field
+LibTest/async/Future/wait_A01_t05: Crash # unsupported element kind: _completer:field
+LibTest/async/Future/wait_A01_t06: Crash # unsupported element kind: _completer:field
+LibTest/async/Future/wait_A01_t07: Crash # unsupported element kind: _completer:field
+LibTest/async/Future/wait_A02_t01: Crash # unsupported element kind: _completer:field
+LibTest/async/Future/wait_A02_t02: Crash # unsupported element kind: _completer:field
+LibTest/async/Future/whenComplete_A01_t01: Crash # unsupported element kind: _completer:field
+LibTest/async/Future/whenComplete_A02_t01: Crash # unsupported element kind: _completer:field
+LibTest/async/Future/whenComplete_A03_t01: Crash # (throw value): Unhandled node
+LibTest/async/Future/whenComplete_A04_t01: Crash # unsupported element kind: _completer:field
+LibTest/async/Future/whenComplete_A04_t02: Crash # unsupported element kind: _completer:field
+LibTest/async/Stream/any_A01_t01: Crash # unsupported element kind: _completer:field
+LibTest/async/Stream/any_A01_t02: Crash # unsupported element kind: _completer:field
+LibTest/async/Stream/any_A02_t01: Crash # unsupported element kind: _completer:field
+LibTest/async/Stream/asBroadcastStream_A01_t01: Crash # unsupported element kind: _completer:field
+LibTest/async/Stream/asBroadcastStream_A01_t02: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/async/Stream/asBroadcastStream_A01_t03: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/async/Stream/asBroadcastStream_A01_t04: Crash # unsupported element kind: _completer:field
+LibTest/async/Stream/asBroadcastStream_A02_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/async/Stream/asBroadcastStream_A03_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/async/Stream/asBroadcastStream_A03_t02: Crash # unsupported element kind: _completer:field
+LibTest/async/Stream/asBroadcastStream_A03_t03: Crash # unsupported element kind: _completer:field
+LibTest/async/Stream/asBroadcastStream_A04_t01: Crash # unsupported element kind: _completer:field
+LibTest/async/Stream/asBroadcastStream_A04_t02: Crash # unsupported element kind: _completer:field
+LibTest/async/Stream/asBroadcastStream_A04_t03: Crash # unsupported element kind: _completer:field
+LibTest/async/Stream/contains_A01_t01: Crash # unsupported element kind: _completer:field
+LibTest/async/Stream/contains_A02_t01: Crash # unsupported element kind: _completer:field
+LibTest/async/Stream/contains_A03_t01: Crash # unsupported element kind: _completer:field
+LibTest/async/StreamController/add_A01_t01: Crash # unsupported element kind: _completer:field
+LibTest/async/StreamController/addError_A01_t01: Crash # unsupported element kind: _completer:field
+LibTest/async/StreamController/addError_A01_t02: Crash # (throw error0): Unhandled node
+LibTest/async/StreamController/addStream_A01_t01: Crash # unsupported element kind: _completer:field
+LibTest/async/StreamController/addStream_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/async/StreamController/addStream_A02_t02: Crash # unsupported element kind: _completer:field
+LibTest/async/StreamController/addStream_A03_t01: Crash # unsupported element kind: _completer:field
+LibTest/async/StreamController/addStream_A03_t02: Crash # unsupported element kind: _completer:field
+LibTest/async/StreamController/close_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/async/StreamController/close_A01_t02: Crash # unsupported element kind: _completer:field
+LibTest/async/StreamController/done_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/async/StreamController/done_A01_t02: Crash # unsupported element kind: _completer:field
+LibTest/async/StreamController/hasListener_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/async/StreamController/hasListener_A01_t02: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/async/StreamController/isClosed_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/async/StreamController/isClosed_A01_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/async/StreamController/isPaused_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/async/StreamController/isPaused_A01_t02: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/async/StreamController/isPaused_A01_t03: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/async/StreamController/sink_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/async/StreamController/stream_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/async/StreamController/StreamController_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/async/StreamController/StreamController_A02_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/async/StreamController/StreamController_A03_t01: Crash # unsupported element kind: _completer:field
+LibTest/async/StreamController/StreamController_A04_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/async/StreamController/StreamController_A05_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/async/StreamController/StreamController_A06_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/async/StreamController/StreamController_A06_t02: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/async/StreamController/StreamController.broadcast_A01_t01: Crash # unsupported element kind: _completer:field
+LibTest/async/StreamController/StreamController.broadcast_A03_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/async/StreamController/StreamController.broadcast_A04_t01: Crash # unsupported element kind: _completer:field
+LibTest/async/StreamController/StreamController.broadcast_A05_t01: Crash # unsupported element kind: _completer:field
+LibTest/async/StreamController/StreamController.broadcast_A06_t01: Crash # unsupported element kind: _completer:field
+LibTest/async/StreamController/StreamController.broadcast_A07_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/async/StreamController/StreamController.broadcast_A07_t02: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/async/StreamController/StreamController.broadcast_A08_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/async/Stream/distinct_A01_t01: Crash # unsupported element kind: _completer:field
+LibTest/async/Stream/distinct_A01_t02: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/async/Stream/drain_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/async/Stream/drain_A02_t01: Crash # Please triage this failure.
+LibTest/async/Stream/drain_A02_t02: Crash # unsupported element kind: _completer:field
+LibTest/async/Stream/elementAt_A01_t01: Crash # unsupported element kind: _completer:field
+LibTest/async/Stream/elementAt_A01_t02: Crash # unsupported element kind: _asyncCounter:field
+LibTest/async/Stream/elementAt_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/async/Stream/elementAt_A03_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/async/Stream/every_A01_t01: Crash # unsupported element kind: _completer:field
+LibTest/async/Stream/every_A02_t01: Crash # unsupported element kind: _completer:field
+LibTest/async/Stream/expand_A01_t01: Crash # unsupported element kind: _completer:field
+LibTest/async/Stream/first_A01_t01: Crash # unsupported element kind: _completer:field
+LibTest/async/Stream/first_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/async/Stream/first_A02_t02: Crash # unsupported element kind: _completer:field
+LibTest/async/Stream/first_A03_t01: Crash # unsupported element kind: _completer:field
+LibTest/async/Stream/firstWhere_A01_t01: Crash # unsupported element kind: _completer:field
+LibTest/async/Stream/firstWhere_A02_t01: Crash # unsupported element kind: _completer:field
+LibTest/async/Stream/firstWhere_A03_t01: Crash # unsupported element kind: _completer:field
+LibTest/async/Stream/firstWhere_A03_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/async/Stream/fold_A01_t01: Crash # unsupported element kind: _completer:field
+LibTest/async/Stream/fold_A01_t02: Crash # unsupported element kind: _completer:field
+LibTest/async/Stream/forEach_A01_t01: Crash # unsupported element kind: _completer:field
+LibTest/async/Stream/forEach_A02_t01: Crash # unsupported element kind: _completer:field
+LibTest/async/Stream/forEach_A02_t02: Crash # unsupported element kind: _completer:field
+LibTest/async/Stream/handleError_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/async/Stream/handleError_A02_t01: Crash # unsupported element kind: _completer:field
+LibTest/async/Stream/handleError_A03_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/async/Stream/handleError_A04_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/async/Stream/handleError_A04_t02: Crash # (throw error): Unhandled node
+LibTest/async/Stream/handleError_A04_t03: Crash # unsupported element kind: _completer:field
+LibTest/async/Stream/isBroadcast_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/async/Stream/isBroadcast_A01_t02: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/async/Stream/isEmpty_A01_t01: Crash # unsupported element kind: _completer:field
+LibTest/async/StreamIterator/cancel_A01_t01: Crash # unsupported element kind: _completer:field
+LibTest/async/StreamIterator/current_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/async/StreamIterator/moveNext_A01_t01: Crash # unsupported element kind: _completer:field
+LibTest/async/StreamIterator/moveNext_A01_t02: Crash # unsupported element kind: _completer:field
+LibTest/async/StreamIterator/StreamIterator_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/async/Stream/join_A01_t01: Crash # unsupported element kind: _completer:field
+LibTest/async/Stream/join_A01_t02: Crash # unsupported element kind: _completer:field
+LibTest/async/Stream/join_A02_t01: Crash # unsupported element kind: _completer:field
+LibTest/async/Stream/join_A02_t02: Crash # unsupported element kind: _completer:field
+LibTest/async/Stream/last_A01_t01: Crash # unsupported element kind: _completer:field
+LibTest/async/Stream/last_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/async/Stream/last_A03_t01: Crash # unsupported element kind: _completer:field
+LibTest/async/Stream/lastWhere_A01_t01: Crash # unsupported element kind: _completer:field
+LibTest/async/Stream/lastWhere_A02_t01: Crash # unsupported element kind: _completer:field
+LibTest/async/Stream/lastWhere_A03_t01: Crash # unsupported element kind: _completer:field
+LibTest/async/Stream/lastWhere_A04_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/async/Stream/length_A01_t01: Crash # unsupported element kind: _completer:field
+LibTest/async/Stream/listen_A01_t01: Crash # unsupported element kind: _completer:field
+LibTest/async/Stream/listen_A02_t01: Crash # unsupported element kind: _completer:field
+LibTest/async/Stream/listen_A03_t01: Crash # unsupported element kind: _completer:field
+LibTest/async/Stream/listen_A04_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/async/Stream/listen_A05_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/async/Stream/listen_A05_t02: Crash # (throw error): Unhandled node
+LibTest/async/Stream/listen_A05_t03: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/async/Stream/listen_A06_t01: Crash # unsupported element kind: _completer:field
+LibTest/async/Stream/map_A01_t01: Crash # unsupported element kind: _completer:field
+LibTest/async/Stream/pipe_A01_t01: Crash # unsupported element kind: _completer:field
+LibTest/async/Stream/reduce_A01_t01: Crash # unsupported element kind: _completer:field
+LibTest/async/Stream/reduce_A01_t02: Crash # unsupported element kind: _completer:field
+LibTest/async/Stream/reduce_A01_t03: Crash # unsupported element kind: _completer:field
+LibTest/async/Stream/single_A01_t01: Crash # unsupported element kind: _completer:field
+LibTest/async/Stream/single_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/async/Stream/singleWhere_A01_t01: Crash # unsupported element kind: _completer:field
+LibTest/async/Stream/singleWhere_A02_t01: Crash # unsupported element kind: _completer:field
+LibTest/async/StreamSink/add_A01_t01: Crash # unsupported element kind: _completer:field
+LibTest/async/StreamSink/addError_A01_t01: Crash # (throw 2): Unhandled node
+LibTest/async/StreamSink/addStream_A01_t01: Crash # unsupported element kind: _completer:field
+LibTest/async/StreamSink/addStream_A01_t02: Crash # unsupported element kind: _completer:field
+LibTest/async/StreamSink/addStream_A01_t03: Crash # unsupported element kind: _completer:field
+LibTest/async/StreamSink/addStream_A01_t04: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/async/StreamSink/addStream_A01_t05: Crash # unsupported element kind: _completer:field
+LibTest/async/StreamSink/close_A01_t01: Crash # unsupported element kind: _completer:field
+LibTest/async/StreamSink/done_A01_t01: Crash # unsupported element kind: _completer:field
+LibTest/async/Stream/skip_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/async/Stream/skipWhile_A01_t01: Crash # unsupported element kind: _completer:field
+LibTest/async/Stream/Stream.eventTransformed_A01_t01: Crash # unsupported element kind: _completer:field
+LibTest/async/Stream/Stream.eventTransformed_A01_t02: Crash # unsupported element kind: _completer:field
+LibTest/async/Stream/Stream.fromFuture_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/async/Stream/Stream.fromFuture_A02_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/async/Stream/Stream.fromFuture_A02_t02: Crash # unsupported element kind: error:field
+LibTest/async/Stream/Stream.fromIterable_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/async/Stream/Stream.fromIterable_A01_t02: Crash # unsupported element kind: _completer:field
+LibTest/async/Stream/Stream.fromIterable_A02_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/async/Stream/Stream.periodic_A01_t01: Crash # Please triage this failure.
+LibTest/async/Stream/Stream.periodic_A02_t01: Crash # unsupported element kind: _completer:field
+LibTest/async/Stream/Stream.periodic_A03_t01: Crash # unsupported element kind: _completer:field
+LibTest/async/Stream/take_A01_t01: Crash # unsupported element kind: _completer:field
+LibTest/async/Stream/take_A01_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/async/Stream/take_A01_t03: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/async/Stream/takeWhile_A01_t01: Crash # unsupported element kind: _completer:field
+LibTest/async/Stream/toList_A01_t01: Crash # unsupported element kind: _completer:field
+LibTest/async/Stream/toSet_A01_t01: Crash # unsupported element kind: _completer:field
+LibTest/async/Stream/transform_A01_t01: Crash # unsupported element kind: _completer:field
+LibTest/async/Stream/transform_A01_t02: Crash # unsupported element kind: _completer:field
+LibTest/async/StreamTransformer/bind_A01_t01: Crash # unsupported element kind: _completer:field
+LibTest/async/StreamTransformer/StreamTransformer_A01_t02: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/async/StreamTransformer/StreamTransformer_A01_t03: Crash # unsupported element kind: _completer:field
+LibTest/async/StreamTransformer/StreamTransformer_A02_t01: Crash # unsupported element kind: _completer:field
+LibTest/async/StreamTransformer/StreamTransformer_A02_t02: Crash # unsupported element kind: _completer:field
+LibTest/async/StreamTransformer/StreamTransformer_A03_t01: Crash # unsupported element kind: _completer:field
+LibTest/async/StreamTransformer/StreamTransformer_A03_t02: Crash # unsupported element kind: _completer:field
+LibTest/async/StreamTransformer/StreamTransformer.fromHandlers_A01_t01: Crash # unsupported element kind: _completer:field
+LibTest/async/StreamTransformer/StreamTransformer.fromHandlers_A01_t02: Crash # unsupported element kind: _completer:field
+LibTest/async/StreamTransformer/StreamTransformer.fromHandlers_A01_t03: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/async/StreamTransformer/StreamTransformer.fromHandlers_A01_t04: Crash # unsupported element kind: _completer:field
+LibTest/async/Stream/where_A01_t01: Crash # unsupported element kind: _completer:field
+LibTest/async/Stream/where_A01_t02: Crash # unsupported element kind: _completer:field
+LibTest/async/Timer/cancel_A01_t01: Crash # unsupported element kind: _completer:field
+LibTest/async/Timer/isActive_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/async/Timer/isActive_A01_t02: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/async/Timer/run_A01_t01: Crash # unsupported element kind: _completer:field
+LibTest/async/Timer/run_A01_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/async/Timer/Timer_A01_t01: Crash # unsupported element kind: _completer:field
+LibTest/async/Timer/Timer_A02_t01: Crash # unsupported element kind: _completer:field
+LibTest/async/Timer/Timer.periodic_A01_t01: Crash # unsupported element kind: _completer:field
+LibTest/async/Timer/Timer.periodic_A02_t01: Crash # unsupported element kind: _completer:field
+LibTest/async/Zone/bindBinaryCallback_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/async/Zone/bindBinaryCallback_A01_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/async/Zone/bindCallback_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/async/Zone/bindCallback_A01_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/async/Zone/bindUnaryCallback_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/async/Zone/bindUnaryCallback_A01_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/async/Zone/createPeriodicTimer_A01_t01: Crash # unsupported element kind: _completer:field
+LibTest/async/Zone/createTimer_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/async/Zone/current_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/async/Zone/current_A01_t02: Crash # unsupported element kind: _completer:field
+LibTest/async/Zone/fork_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/async/Zone/handleUncaughtError_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/async/Zone/handleUncaughtError_A01_t02: Crash # (throw error): Unhandled node
+LibTest/async/Zone/handleUncaughtError_A01_t03: Crash # (throw count): Unhandled node
+LibTest/async/Zone/handleUncaughtError_A01_t04: Crash # (throw count): Unhandled node
+LibTest/async/Zone/inSameErrorZone_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/async/Zone/inSameErrorZone_A01_t02: Crash # unsupported element kind: _asyncCounter:field
+LibTest/async/Zone/inSameErrorZone_A01_t03: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/async/Zone/inSameErrorZone_A01_t04: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/async/Zone/inSameErrorZone_A01_t05: Crash # unsupported element kind: _completer:field
+LibTest/async/Zone/operator_subscript_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/async/Zone/parent_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/async/Zone/registerBinaryCallback_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/async/Zone/registerCallback_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/async/Zone/registerUnaryCallback_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/async/Zone/ROOT_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/async/Zone/run_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/async/Zone/runBinary_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/async/Zone/runBinaryGuarded_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/async/Zone/runGuarded_A01_t01: Crash # (throw 0): Unhandled node
+LibTest/async/Zone/runUnary_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/async/Zone/runUnaryGuarded_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/async/Zone/scheduleMicrotask_A01_t01: Crash # unsupported element kind: _completer:field
+LibTest/async/Zone/scheduleMicrotask_A01_t02: Crash # unsupported element kind: _completer:field
+LibTest/collection/DoubleLinkedQueue/add_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/collection/DoubleLinkedQueue/add_A01_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/collection/DoubleLinkedQueue/addAll_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/collection/DoubleLinkedQueue/addAll_A01_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/collection/DoubleLinkedQueue/addFirst_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/collection/DoubleLinkedQueue/addFirst_A01_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/collection/DoubleLinkedQueue/addLast_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/collection/DoubleLinkedQueue/addLast_A01_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/collection/DoubleLinkedQueue/any_A01_t02: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/collection/DoubleLinkedQueue/clear_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/collection/DoubleLinkedQueue/contains_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/collection/DoubleLinkedQueue/DoubleLinkedQueue_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/collection/DoubleLinkedQueue/DoubleLinkedQueue_class_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/collection/DoubleLinkedQueue/DoubleLinkedQueue.from_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/collection/DoubleLinkedQueue/DoubleLinkedQueue.from_A01_t02: Crash # cannot compile methods that need interceptor calling convention.
+LibTest/collection/DoubleLinkedQueue/elementAt_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/collection/DoubleLinkedQueue/elementAt_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/collection/DoubleLinkedQueue/every_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/collection/DoubleLinkedQueue/every_A01_t02: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/collection/DoubleLinkedQueue/every_A01_t04: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/collection/DoubleLinkedQueue/expand_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/collection/DoubleLinkedQueue/expand_A01_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/collection/DoubleLinkedQueue/expand_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/collection/DoubleLinkedQueue/first_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/collection/DoubleLinkedQueue/first_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/collection/DoubleLinkedQueue/firstEntry_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/collection/DoubleLinkedQueue/firstEntry_A02_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/collection/DoubleLinkedQueue/firstWhere_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/collection/DoubleLinkedQueue/firstWhere_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/collection/DoubleLinkedQueue/firstWhere_A03_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/collection/DoubleLinkedQueue/fold_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/collection/DoubleLinkedQueue/forEach_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/collection/DoubleLinkedQueue/forEach_A01_t02: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/collection/DoubleLinkedQueue/forEach_A01_t03: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/collection/DoubleLinkedQueue/forEach_A01_t04: Crash # "on T" catch block
+LibTest/collection/DoubleLinkedQueue/forEachEntry_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/collection/DoubleLinkedQueue/forEachEntry_A01_t02: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/collection/DoubleLinkedQueue/forEachEntry_A01_t03: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/collection/DoubleLinkedQueue/forEachEntry_A01_t04: Crash # "on T" catch block
+LibTest/collection/DoubleLinkedQueue/isEmpty_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/collection/DoubleLinkedQueue/isNotEmpty_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/collection/DoubleLinkedQueue/iterator_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/collection/DoubleLinkedQueue/iterator_A01_t02: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/collection/DoubleLinkedQueue/iterator_current_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/collection/DoubleLinkedQueue/iterator_moveNext_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/collection/DoubleLinkedQueue/iterator_moveNext_A01_t02: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/collection/DoubleLinkedQueue/join_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/collection/DoubleLinkedQueue/last_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/collection/DoubleLinkedQueue/last_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/collection/DoubleLinkedQueue/lastEntry_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/collection/DoubleLinkedQueue/lastEntry_A02_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/collection/DoubleLinkedQueue/lastWhere_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/collection/DoubleLinkedQueue/lastWhere_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/collection/DoubleLinkedQueue/lastWhere_A03_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/collection/DoubleLinkedQueue/length_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/collection/DoubleLinkedQueue/map_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/collection/DoubleLinkedQueue/map_A02_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/collection/DoubleLinkedQueue/map_A03_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/collection/DoubleLinkedQueue/reduce_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/collection/DoubleLinkedQueue/remove_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/collection/DoubleLinkedQueue/removeFirst_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/collection/DoubleLinkedQueue/removeFirst_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/collection/DoubleLinkedQueue/removeLast_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/collection/DoubleLinkedQueue/removeLast_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/collection/DoubleLinkedQueue/removeWhere_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/collection/DoubleLinkedQueue/retainWhere_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/collection/DoubleLinkedQueue/single_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/collection/DoubleLinkedQueue/singleWhere_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/collection/DoubleLinkedQueue/singleWhere_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/collection/DoubleLinkedQueue/singleWhere_A02_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/collection/DoubleLinkedQueue/skip_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/collection/DoubleLinkedQueue/skip_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/collection/DoubleLinkedQueue/skip_A03_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/collection/DoubleLinkedQueue/skipWhile_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/collection/DoubleLinkedQueue/skipWhile_A02_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/collection/DoubleLinkedQueue/skipWhile_A03_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/collection/DoubleLinkedQueue/skipWhile_A04_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/collection/DoubleLinkedQueue/take_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/collection/DoubleLinkedQueue/take_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/collection/DoubleLinkedQueue/takeWhile_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/collection/DoubleLinkedQueue/takeWhile_A02_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/collection/DoubleLinkedQueue/takeWhile_A03_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/collection/DoubleLinkedQueue/takeWhile_A04_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/collection/DoubleLinkedQueue/toList_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/collection/DoubleLinkedQueue/toList_A01_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/collection/DoubleLinkedQueue/toList_A01_t03: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/collection/DoubleLinkedQueue/toSet_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/collection/DoubleLinkedQueue/toString_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/collection/DoubleLinkedQueue/where_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/collection/HashMap/allTests_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/collection/HashMap/allTests_A01_t02: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/collection/HashMap/HashMap_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/collection/HashMap/HashMap.from_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/collection/HashMap/HashMap.from_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/collection/HashSet/HashSet_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/collection/HashSet/HashSet_class_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/collection/HashSet/HashSet.from_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/collection/HashSet/HashSet.from_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/collection/HasNextIterator/HasNextIterator_class_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/collection/IterableBase/IterableBase_class_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/collection/IterableBase/IterableBase_class_A01_t02: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/collection/IterableMixin/IterableMixin_class_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/collection/IterableMixin/IterableMixin_class_A01_t02: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/collection/LinkedHashMap/LinkedHashMap_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/collection/LinkedHashMap/LinkedHashMap_class_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/collection/LinkedHashMap/LinkedHashMap_class_A01_t02: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/collection/LinkedHashMap/LinkedHashMap_class_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/collection/LinkedHashMap/LinkedHashMap.from_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/collection/LinkedHashMap/LinkedHashMap.from_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/collection/LinkedHashSet/LinkedHashSet_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/collection/LinkedHashSet/LinkedHashSet_class_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/collection/LinkedHashSet/LinkedHashSet_class_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/collection/LinkedHashSet/LinkedHashSet.from_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/collection/LinkedHashSet/LinkedHashSet.from_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/collection/LinkedList/add_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/collection/LinkedList/add_A01_t02: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/collection/LinkedList/addAll_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/collection/LinkedList/addAll_A01_t02: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/collection/LinkedList/addAll_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/collection/LinkedList/addFirst_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/collection/LinkedList/addFirst_A01_t02: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/collection/LinkedList/any_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/collection/LinkedList/clear_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/collection/LinkedList/contains_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/collection/LinkedList/elementAt_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/collection/LinkedList/elementAt_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/collection/LinkedList/every_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/collection/LinkedList/every_A01_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/collection/LinkedList/every_A02_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/collection/LinkedList/every_A02_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/collection/LinkedList/expand_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/collection/LinkedList/expand_A02_t01: Crash # (throw new Exception("should not be called")): Unhandled node
+LibTest/collection/LinkedList/first_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/collection/LinkedList/first_A01_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/collection/LinkedList/firstWhere_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/collection/LinkedList/firstWhere_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/collection/LinkedList/firstWhere_A03_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/collection/LinkedList/fold_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/collection/LinkedList/forEach_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/collection/LinkedList/forEach_A01_t02: Crash # (try {var i=1;String s=i;return false;}on TypeError catch (e){return true;}): "on T" catch block
+LibTest/collection/LinkedList/forEach_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/collection/LinkedList/isEmpty_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/collection/LinkedList/isNotEmpty_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/collection/LinkedList/iterator_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/collection/LinkedList/iterator_current_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/collection/LinkedList/iterator_moveNext_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/collection/LinkedList/join_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/collection/LinkedList/last_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/collection/LinkedList/last_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/collection/LinkedList/lastWhere_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/collection/LinkedList/lastWhere_A02_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/collection/LinkedList/lastWhere_A03_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/collection/LinkedList/length_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/collection/LinkedList/LinkedList_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/collection/LinkedList/ListQueue.from_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/collection/LinkedList/map_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/collection/LinkedList/map_A02_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/collection/LinkedList/map_A03_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/collection/LinkedList/reduce_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/collection/LinkedList/remove_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/collection/LinkedList/single_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/collection/LinkedList/singleWhere_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/collection/LinkedList/singleWhere_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/collection/LinkedList/singleWhere_A02_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/collection/LinkedList/skip_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/collection/LinkedList/skip_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/collection/LinkedList/skip_A03_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/collection/LinkedList/skipWhile_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/collection/LinkedList/skipWhile_A02_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/collection/LinkedList/skipWhile_A03_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/collection/LinkedList/skipWhile_A04_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/collection/LinkedList/take_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/collection/LinkedList/take_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/collection/LinkedList/takeWhile_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/collection/LinkedList/takeWhile_A02_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/collection/LinkedList/takeWhile_A03_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/collection/LinkedList/takeWhile_A04_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/collection/LinkedList/toList_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/collection/LinkedList/toList_A01_t02: Crash # cannot compile methods that need interceptor calling convention.
+LibTest/collection/LinkedList/toList_A01_t03: Crash # (try {l.clear();failures.add("clear");}on UnsupportedError catch (ok){}): "on T" catch block
+LibTest/collection/LinkedList/toSet_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/collection/LinkedList/where_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/collection/LinkedList/where_A02_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/collection/ListBase/ListBase_class_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/collection/ListBase/ListBase_class_A01_t02: Crash # Please triage this failure.
+LibTest/collection/ListMixin/ListMixin_class_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/collection/ListMixin/ListMixin_class_A01_t02: Crash # Please triage this failure.
+LibTest/collection/ListQueue/ListQueue_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/collection/ListQueue/ListQueue_class_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/collection/ListQueue/ListQueue.from_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/collection/ListQueue/ListQueue.from_A01_t02: Crash # cannot compile methods that need interceptor calling convention.
+LibTest/collection/ListQueue/ListQueue.from_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/collection/Maps/containsValue_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/collection/Maps/forEach_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/collection/Maps/forEach_A01_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/collection/Maps/forEach_A01_t04: Crash # "on T" catch block
+LibTest/collection/Maps/forEach_A01_t06: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/collection/Maps/forEach_A01_t08: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/collection/Maps/forEach_A02_t01: Crash # "on T" catch block
+LibTest/collection/Maps/getValues_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/collection/Maps/isEmpty_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/collection/Maps/isNotEmpty_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/collection/Maps/length_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/collection/Maps/mapToString_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/collection/Maps/mapToString_A01_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/collection/Maps/putIfAbsent_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/collection/Maps/putIfAbsent_A01_t02: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/collection/Maps/putIfAbsent_A01_t04: Crash # "on T" catch block
+LibTest/collection/Maps/putIfAbsent_A01_t06: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/collection/Maps/putIfAbsent_A01_t07: Crash # "on T" catch block
+LibTest/collection/Maps/putIfAbsent_A01_t08: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/collection/Maps/putIfAbsent_A01_t09: Crash # handleStaticFunctionGet: function(A#f)
+LibTest/collection/Maps/putIfAbsent_A01_t10: Crash # "on T" catch block
+LibTest/collection/Maps/putIfAbsent_A02_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/collection/Queue/Queue_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/collection/Queue/Queue_class_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/collection/Queue/Queue.from_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/collection/Queue/Queue.from_A01_t02: Crash # cannot compile methods that need interceptor calling convention.
+LibTest/collection/Queue/Queue.from_A02_t01: Crash # "on T" catch block
+LibTest/collection/SplayTreeMap/allTests_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/convert/JsonCodec/decode_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/convert/JsonCodec/decode_A02_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/convert/JsonCodec/decode_A03_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/convert/JsonCodec/encode_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/convert/JsonCodec/encode_A01_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/convert/JsonCodec/encode_A02_t01: Crash # "on T" catch block
+LibTest/convert/JsonCodec/encode_A02_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/convert/JsonCodec/encode_A02_t03: Crash # "on T" catch block
+LibTest/convert/JsonCodec/encode_A03_t01: Crash # "on T" catch block
+LibTest/convert/JsonCodec/JsonCodec_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/convert/JsonCodec/JsonCodec.withReviver_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/convert/JsonDecoder/convert_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/convert/JsonDecoder/convert_A02_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/convert/JsonDecoder/convert_A03_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/convert/JsonDecoder/fuse_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/convert/JsonEncoder/convert_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/convert/JsonEncoder/convert_A02_t01: Crash # "on T" catch block
+LibTest/convert/JsonEncoder/fuse_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/core/AbstractClassInstantiationError/toString_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/ArgumentError/ArgumentError_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/core/ArgumentError/toString_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/AssertionError/AssertionError_A01_t01: Crash # "on T" catch block
+LibTest/core/AssertionError/toString_A01_t01: Crash # "on T" catch block
+LibTest/core/bool/toString_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/core/bool/toString_A01_t02: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/core/DateTime/add_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/DateTime/add_A01_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/DateTime/add_A01_t03: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/DateTime/add_A02_t01: Crash # "on T" catch block
+LibTest/core/DateTime/compareTo_A01_t02: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/core/DateTime/DateTime_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/DateTime/DateTime_A01_t02: Crash # "on T" catch block
+LibTest/core/DateTime/DateTime_A01_t03: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/DateTime/DateTime_A01_t04: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/core/DateTime/DateTime.fromMillisecondsSinceEpoch_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/core/DateTime/DateTime.fromMillisecondsSinceEpoch_A01_t02: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/core/DateTime/DateTime.fromMillisecondsSinceEpoch_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/DateTime/DateTime.now_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/DateTime/DateTime.now_A01_t02: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/core/DateTime/DateTime.now_A01_t03: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/core/DateTime/DateTime.utc_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/core/DateTime/day_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/DateTime/difference_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/DateTime/difference_A01_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/DateTime/difference_A02_t01: Crash # "on T" catch block
+LibTest/core/DateTime/hashCode_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/DateTime/hashCode_A01_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/DateTime/hour_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/DateTime/isAfter_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/core/DateTime/isAtSameMomentAs_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/core/DateTime/isBefore_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/core/DateTime/isUtc_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/core/DateTime/millisecond_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/DateTime/millisecondsSinceEpoch_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/DateTime/minute_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/DateTime/month_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/DateTime/operator_equality_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/core/DateTime/parse_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/DateTime/parse_A01_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/DateTime/parse_A03_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/core/DateTime/second_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/DateTime/subtract_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/DateTime/subtract_A01_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/DateTime/subtract_A01_t03: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/DateTime/subtract_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/DateTime/timeZoneName_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/DateTime/timeZoneOffset_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/core/DateTime/toLocal_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/DateTime/toString_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/DateTime/toString_A01_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/DateTime/toString_A01_t03: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/core/DateTime/toUtc_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/DateTime/weekday_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/DateTime/year_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/double/abs_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/double/abs_A01_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/double/abs_A01_t03: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/double/abs_A01_t04: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/core/double/abs_A01_t05: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/double/ceil_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/double/ceil_A01_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/double/ceil_A01_t03: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/double/ceil_A01_t04: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/double/ceil_A01_t05: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/double/ceil_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/double/ceil_A02_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/double/ceilToDouble_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/double/ceilToDouble_A01_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/double/ceilToDouble_A01_t03: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/double/ceilToDouble_A01_t04: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/double/ceilToDouble_A01_t05: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/double/ceilToDouble_A02_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/core/double/ceilToDouble_A02_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/double/compareTo_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/double/compareTo_A01_t02: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/core/double/compareTo_A01_t03: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/double/double_class_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/double/floor_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/double/floor_A01_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/double/floor_A01_t03: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/double/floor_A01_t04: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/double/floor_A02_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/double/floorToDouble_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/double/floorToDouble_A01_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/double/floorToDouble_A01_t03: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/double/floorToDouble_A01_t04: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/double/floorToDouble_A02_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/core/double/floorToDouble_A02_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/double/INFINITY_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/core/double/INFINITY_A01_t02: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/core/double/INFINITY_A01_t03: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/core/double/INFINITY_A01_t04: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/core/double/isInfinite_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/core/double/isInfinite_A01_t02: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/core/double/isInfinite_A01_t03: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/core/double/isNaN_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/core/double/isNaN_A01_t02: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/core/double/isNaN_A01_t03: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/core/double/isNegative_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/core/double/isNegative_A01_t02: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/core/double/NAN_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/core/double/NAN_A01_t02: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/core/double/NAN_A01_t03: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/core/double/NAN_A01_t04: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/core/double/NEGATIVE_INFINITY_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/core/double/NEGATIVE_INFINITY_A01_t02: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/core/double/NEGATIVE_INFINITY_A01_t03: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/core/double/NEGATIVE_INFINITY_A01_t04: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/core/double/operator_addition_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/core/double/operator_addition_A01_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/double/operator_addition_A01_t03: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/double/operator_addition_A01_t04: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/core/double/operator_addition_A01_t05: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/double/operator_addition_A01_t06: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/double/operator_addition_A01_t07: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/double/operator_addition_A01_t08: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/double/operator_addition_A02_t01: Crash # (try {d+null;Expect.fail("Error is expected");}on Error catch (e){}): "on T" catch block
+LibTest/core/double/operator_division_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/core/double/operator_division_A01_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/double/operator_division_A01_t03: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/double/operator_division_A01_t04: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/core/double/operator_division_A01_t05: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/double/operator_division_A01_t06: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/core/double/operator_division_A01_t07: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/double/operator_division_A01_t08: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/double/operator_division_A01_t09: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/double/operator_division_A01_t10: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/double/operator_division_A01_t11: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/double/operator_division_A01_t12: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/double/operator_division_A02_t01: Crash # (try {d/null;Expect.fail("Error is expected");}on Error catch (e){}): "on T" catch block
+LibTest/core/double/operator_GE_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/core/double/operator_GE_A01_t02: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/core/double/operator_GE_A01_t03: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/core/double/operator_GE_A02_t01: Crash # (try {d>=null;Expect.fail("Error is expected");}on Error catch (e){}): "on T" catch block
+LibTest/core/double/operator_GT_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/core/double/operator_GT_A01_t02: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/core/double/operator_GT_A01_t03: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/core/double/operator_GT_A01_t04: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/core/double/operator_GT_A02_t01: Crash # (try {d>null;Expect.fail("Error is expected");}on Error catch (e){}): "on T" catch block
+LibTest/core/double/operator_LE_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/core/double/operator_LE_A01_t02: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/core/double/operator_LE_A01_t03: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/core/double/operator_LE_A02_t01: Crash # (try {d<=null;Expect.fail("Error is expected");}on Error catch (e){}): "on T" catch block
+LibTest/core/double/operator_LT_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/core/double/operator_LT_A01_t02: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/core/double/operator_LT_A01_t03: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/core/double/operator_LT_A01_t04: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/core/double/operator_LT_A02_t01: Crash # (try {d<null;Expect.fail("Error is expected");}on Error catch (e){}): "on T" catch block
+LibTest/core/double/operator_multiplication_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/core/double/operator_multiplication_A01_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/double/operator_multiplication_A01_t03: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/core/double/operator_multiplication_A01_t04: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/double/operator_multiplication_A01_t05: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/double/operator_multiplication_A01_t06: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/double/operator_multiplication_A01_t07: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/double/operator_multiplication_A01_t08: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/double/operator_multiplication_A01_t09: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/double/operator_multiplication_A02_t01: Crash # (try {d*null;Expect.fail("Error is expected");}on Error catch (e){}): "on T" catch block
+LibTest/core/double/operator_remainder_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/double/operator_remainder_A01_t02: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/core/double/operator_remainder_A01_t03: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/core/double/operator_remainder_A01_t04: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/double/operator_remainder_A01_t05: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/core/double/operator_remainder_A01_t06: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/double/operator_remainder_A01_t07: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/double/operator_remainder_A02_t01: Crash # (try {val%null;Expect.fail("Error is expected");}on Error catch (e){}): "on T" catch block
+LibTest/core/double/operator_subtraction_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/core/double/operator_subtraction_A01_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/double/operator_subtraction_A01_t03: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/core/double/operator_subtraction_A01_t04: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/double/operator_subtraction_A01_t05: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/double/operator_subtraction_A01_t06: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/double/operator_subtraction_A01_t07: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/double/operator_subtraction_A01_t08: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/double/operator_subtraction_A01_t09: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/double/operator_subtraction_A02_t01: Crash # (try {d-null;Expect.fail("Error is expected");}on Error catch (e){}): "on T" catch block
+LibTest/core/double/operator_truncating_division_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/double/operator_truncating_division_A01_t02: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/core/double/operator_truncating_division_A01_t03: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/double/operator_truncating_division_A01_t04: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/double/operator_truncating_division_A01_t05: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/double/operator_truncating_division_A01_t06: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/double/operator_truncating_division_A01_t07: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/core/double/operator_truncating_division_A01_t08: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/core/double/operator_truncating_division_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/double/operator_unary_minus_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/double/operator_unary_minus_A01_t02: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/core/double/operator_unary_minus_A01_t03: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/double/operator_unary_minus_A01_t04: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/double/parse_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/core/double/parse_A02_t01: Crash # "on T" catch block
+LibTest/core/double/remainder_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/double/remainder_A01_t02: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/core/double/remainder_A01_t03: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/core/double/remainder_A01_t04: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/double/remainder_A01_t05: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/core/double/remainder_A01_t06: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/double/remainder_A01_t07: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/double/remainder_A02_t01: Crash # "on T" catch block
+LibTest/core/double/round_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/double/round_A01_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/double/round_A01_t03: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/double/round_A01_t04: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/double/round_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/double/round_A02_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/double/roundToDouble_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/double/roundToDouble_A01_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/double/roundToDouble_A01_t03: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/double/roundToDouble_A01_t04: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/double/roundToDouble_A02_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/core/double/roundToDouble_A02_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/double/toDouble_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/double/toDouble_A01_t02: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/core/double/toDouble_A01_t03: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/double/toInt_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/double/toInt_A01_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/double/toInt_A01_t03: Crash # Please triage this failure.
+LibTest/core/double/toInt_A01_t04: Crash # Please triage this failure.
+LibTest/core/double/toInt_A01_t05: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/double/toInt_A01_t06: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/double/toStringAsExponential_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/double/toStringAsExponential_A01_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/double/toStringAsExponential_A01_t03: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/double/toStringAsExponential_A01_t04: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/double/toStringAsExponential_A01_t05: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/double/toStringAsExponential_A01_t06: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/double/toStringAsExponential_A02_t01: Crash # Please triage this failure.
+LibTest/core/double/toStringAsFixed_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/double/toStringAsFixed_A01_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/double/toStringAsFixed_A01_t03: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/double/toStringAsFixed_A01_t04: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/double/toStringAsFixed_A01_t05: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/double/toStringAsFixed_A02_t01: Crash # Please triage this failure.
+LibTest/core/double/toStringAsFixed_A02_t02: Crash # Please triage this failure.
+LibTest/core/double/toStringAsFixed_A02_t03: Crash # Please triage this failure.
+LibTest/core/double/toStringAsPrecision_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/double/toStringAsPrecision_A01_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/double/toStringAsPrecision_A01_t03: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/double/toStringAsPrecision_A01_t04: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/double/toStringAsPrecision_A01_t05: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/double/toStringAsPrecision_A01_t06: Crash # Please triage this failure.
+LibTest/core/double/toStringAsPrecision_A01_t07: Crash # Please triage this failure.
+LibTest/core/double/toStringAsPrecision_A01_t08: Crash # Please triage this failure.
+LibTest/core/double/toStringAsPrecision_A02_t01: Crash # "on T" catch block
+LibTest/core/double/truncate_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/double/truncate_A01_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/double/truncate_A01_t05: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/double/truncate_A01_t06: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/double/truncate_A02_t01: Crash # "on T" catch block
+LibTest/core/double/truncate_A02_t02: Crash # "on T" catch block
+LibTest/core/double/truncateToDouble_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/double/truncateToDouble_A01_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/double/truncateToDouble_A01_t03: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/core/double/truncateToDouble_A01_t04: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/double/truncateToDouble_A01_t05: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/double/truncateToDouble_A01_t06: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/Duration/compareTo_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/Duration/compareTo_A01_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/Duration/Duration_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/Duration/Duration_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/Duration/Duration_A03_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/Duration/HOURS_PER_DAY_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/Duration/inDays_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/Duration/inHours_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/Duration/inMilliseconds_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/Duration/inMinutes_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/Duration/inSeconds_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/Duration/MILLISECONDS_PER_DAY_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/Duration/MILLISECONDS_PER_HOUR_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/Duration/MILLISECONDS_PER_MINUTE_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/Duration/MILLISECONDS_PER_SECOND_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/Duration/MINUTES_PER_DAY_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/Duration/MINUTES_PER_HOUR_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/Duration/operator_div_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/Duration/operator_eq_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/Duration/operator_gt_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/Duration/operator_gte_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/Duration/operator_lt_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/Duration/operator_lte_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/Duration/operator_minus_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/Duration/operator_mult_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/Duration/operator_plus_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/Duration/SECONDS_PER_DAY_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/Duration/SECONDS_PER_HOUR_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/Duration/SECONDS_PER_MINUTE_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/Expando/Expando_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/core/Expando/Expando_A01_t02: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/core/Expando/Expando_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/Expando/Expando_A03_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/core/Expando/Expando_A03_t02: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/core/Expando/Expando_A03_t03: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/core/Expando/Expando_A03_t04: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/core/Expando/Expando_A03_t05: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/core/Expando/Expando_A03_t06: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/Expando/Expando_A04_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/Expando/Expando_A05_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/FallThroughError/toString_A01_t01: Crash # "on T" catch block
+LibTest/core/FallThroughError/toString_A01_t02: Crash # "on T" catch block
+LibTest/core/FormatException/toString_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/Function/apply_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/Function/Function_class_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/int/abs_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/int/ceil_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/int/ceilToDouble_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/int/compareTo_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/int/compareTo_A01_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/IntegerDivisionByZeroException/toString_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/int/floor_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/int/floorToDouble_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/int/hashCode_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/core/int/isEven_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/core/int/isInfinite_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/core/int/isNaN_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/core/int/isNegative_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/core/int/isOdd_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/core/int/operator_addition_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/core/int/operator_AND_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/int/operator_division_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/core/int/operator_division_A01_t02: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/core/int/operator_division_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/int/operator_GE_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/core/int/operator_GT_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/core/int/operator_LE_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/core/int/operator_left_shift_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/int/operator_left_shift_A01_t03: Crash # "on T" catch block
+LibTest/core/int/operator_LT_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/core/int/operator_multiplication_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/int/operator_NOT_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/int/operator_OR_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/int/operator_remainder_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/int/operator_remainder_A01_t02: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/core/int/operator_remainder_A01_t03: Crash # "on T" catch block
+LibTest/core/int/operator_right_shift_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/int/operator_right_shift_A01_t03: Crash # "on T" catch block
+LibTest/core/int/operator_subtraction_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/core/int/operator_truncating_division_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/int/operator_truncating_division_A01_t02: Crash # "on T" catch block
+LibTest/core/int/operator_unary_minus_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/int/operator_XOR_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/int/parse_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/core/int/parse_A02_t01: Crash # "on T" catch block
+LibTest/core/int/remainder_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/int/remainder_A01_t02: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/core/int/remainder_A01_t03: Crash # "on T" catch block
+LibTest/core/int/round_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/int/roundToDouble_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/int/toDouble_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/int/toInt_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/int/toRadixString_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/core/int/toRadixString_A01_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/int/toStringAsExponential_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/int/toStringAsExponential_A02_t01: Crash # Please triage this failure.
+LibTest/core/int/toStringAsExponential_A03_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/int/toStringAsFixed_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/int/toStringAsFixed_A02_t01: Crash # Please triage this failure.
+LibTest/core/int/toStringAsPrecision_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/int/toStringAsPrecision_A01_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/int/truncate_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/int/truncateToDouble_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/Invocation/isAccessor_A01_t01: Crash # (super.foo): Error expression `super.foo` unhandled.
+LibTest/core/Invocation/isAccessor_A01_t02: Crash # (super.foo()): Error expression `super.foo()` unhandled.
+LibTest/core/Invocation/isGetter_A01_t01: Crash # (super.foo): Error expression `super.foo` unhandled.
+LibTest/core/Invocation/isGetter_A01_t02: Crash # (super.foo()): Error expression `super.foo()` unhandled.
+LibTest/core/Invocation/isMethod_A01_t01: Crash # (super.foo()): Error expression `super.foo()` unhandled.
+LibTest/core/Invocation/isMethod_A01_t02: Crash # (super.foo): Error expression `super.foo` unhandled.
+LibTest/core/Invocation/isSetter_A01_t01: Crash # (super.bar=1): Error expression `super.bar=1` unhandled.
+LibTest/core/Invocation/isSetter_A01_t02: Crash # (super.foo()): Error expression `super.foo()` unhandled.
+LibTest/core/Invocation/memberName_A01_t01: Crash # (super.foo): Error expression `super.foo` unhandled.
+LibTest/core/Invocation/namedArguments_A01_t01: Crash # (super.foo): Error expression `super.foo` unhandled.
+LibTest/core/Invocation/positionalArguments_A01_t01: Crash # (super.foo): Error expression `super.foo` unhandled.
+LibTest/core/Iterable/Iterable.generate_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/List/List_A01_t01: Crash # (try {a[0]=1;Expect.fail("expected RangeError");}on RangeError catch (ok){}): "on T" catch block
+LibTest/core/List/List_A01_t03: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/core/List/List_A02_t01: Crash # "on T" catch block
+LibTest/core/List/List_A03_t01: Crash # "on T" catch block
+LibTest/core/List/List_class_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/core/List/List_class_A01_t02: Crash # Please triage this failure.
+LibTest/core/List/List.filled_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/core/List/List.from_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/core/List/List.from_A01_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/List/List.from_A01_t03: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/core/List/List.generate_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/core/List/List.generate_A01_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/List/List.generate_A01_t03: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/core/List/removeAt_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/Map/allTests_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/core/Map/Map_A01_t01: Crash # unimplemented translation of type expression SomeFunction
+LibTest/core/Map/Map_class_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/core/Map/Map_class_A01_t02: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/core/Map/Map_class_A01_t03: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/core/Map/Map_class_A01_t04: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/core/Map/Map_class_A02_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/core/Match/end_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/Match/group_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/Match/group_A02_t01: Crash # "on T" catch block
+LibTest/core/Match/groupCount_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/Match/groups_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/core/Match/groups_A02_t01: Crash # "on T" catch block
+LibTest/core/Match/operator_subscript_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/core/Match/operator_subscript_A02_t01: Crash # (try {m[index];Expect.fail("RangeError is expected");}on RangeError catch (e){}): "on T" catch block
+LibTest/core/Match/pattern_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/core/Match/start_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/Match/str_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/core/NoSuchMethodError/toString_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/Null/Null_class_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/core/Null/toString_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/Object/operator_equality_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/Object/toString_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/OutOfMemoryError/toString_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/RangeError/toString_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/RegExp/allMatches_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/RegExp/allMatches_A02_t01: Crash # "on T" catch block
+LibTest/core/RegExp/firstMatch_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/core/RegExp/firstMatch_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/RegExp/firstMatch_A03_t01: Crash # "on T" catch block
+LibTest/core/RegExp/hasMatch_A01_t02: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/core/RegExp/hasMatch_A02_t01: Crash # (try {re.hasMatch(null);Expect.fail("Error is expected");}on Error catch (e){}): "on T" catch block
+LibTest/core/RegExp/isCaseSensitive_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/RegExp/isMultiLine_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/RegExp/pattern_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/core/RegExp/Pattern_semantics/firstMatch_Assertion_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/core/RegExp/Pattern_semantics/firstMatch_Assertion_A02_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/core/RegExp/Pattern_semantics/firstMatch_Assertion_A03_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/core/RegExp/Pattern_semantics/firstMatch_Assertion_A04_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/RegExp/Pattern_semantics/firstMatch_Assertion_A05_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/RegExp/Pattern_semantics/firstMatch_Atom_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/core/RegExp/Pattern_semantics/firstMatch_Atom_A02_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/core/RegExp/Pattern_semantics/firstMatch_Atom_A03_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/core/RegExp/Pattern_semantics/firstMatch_Atom_A03_t02: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/core/RegExp/Pattern_semantics/firstMatch_Atom_A03_t03: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/core/RegExp/Pattern_semantics/firstMatch_Atom_A04_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/core/RegExp/Pattern_semantics/firstMatch_Atom_A05_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/core/RegExp/Pattern_semantics/firstMatch_Atom_A06_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/core/RegExp/Pattern_semantics/firstMatch_AtomEscape_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/core/RegExp/Pattern_semantics/firstMatch_CharacterClass_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/core/RegExp/Pattern_semantics/firstMatch_CharacterClass_A02_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/core/RegExp/Pattern_semantics/firstMatch_CharacterClassEscape_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/core/RegExp/Pattern_semantics/firstMatch_CharacterClassEscape_A02_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/core/RegExp/Pattern_semantics/firstMatch_CharacterClassEscape_A03_t01: Crash # Unhandled node
+LibTest/core/RegExp/Pattern_semantics/firstMatch_CharacterClassEscape_A05_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/core/RegExp/Pattern_semantics/firstMatch_CharacterClassEscape_A06_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/core/RegExp/Pattern_semantics/firstMatch_CharacterEscape_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/core/RegExp/Pattern_semantics/firstMatch_CharacterEscape_A02_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/core/RegExp/Pattern_semantics/firstMatch_CharacterEscape_A03_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/core/RegExp/Pattern_semantics/firstMatch_CharacterEscape_A04_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/core/RegExp/Pattern_semantics/firstMatch_CharacterEscape_A05_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/core/RegExp/Pattern_semantics/firstMatch_CharacterEscape_A06_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/core/RegExp/Pattern_semantics/firstMatch_CharacterEscape_A06_t02: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/core/RegExp/Pattern_semantics/firstMatch_CharacterEscape_A07_t01: Crash # Please triage this failure.
+LibTest/core/RegExp/Pattern_semantics/firstMatch_CharacterEscape_A08_t01: Crash # Please triage this failure.
+LibTest/core/RegExp/Pattern_semantics/firstMatch_CharacterEscape_A08_t02: Crash # Please triage this failure.
+LibTest/core/RegExp/Pattern_semantics/firstMatch_CharacterEscape_A09_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/core/RegExp/Pattern_semantics/firstMatch_DecimalEscape_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/core/RegExp/Pattern_semantics/firstMatch_DecimalEscape_A01_t02: Crash # Please triage this failure.
+LibTest/core/RegExp/Pattern_semantics/firstMatch_DecimalEscape_A01_t03: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/RegExp/Pattern_semantics/firstMatch_DecimalEscape_A01_t04: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/core/RegExp/Pattern_semantics/firstMatch_Disjunction_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/core/RegExp/Pattern_semantics/firstMatch_NonEmptyClassRanges_A01_t01: Crash # "on T" catch block
+LibTest/core/RegExp/Pattern_semantics/firstMatch_NonEmptyClassRanges_A01_t02: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/core/RegExp/Pattern_semantics/firstMatch_NonEmptyClassRanges_A01_t03: Crash # "on T" catch block
+LibTest/core/RegExp/Pattern_semantics/firstMatch_NonEmptyClassRanges_A01_t04: Crash # Please triage this failure.
+LibTest/core/RegExp/Pattern_semantics/firstMatch_NonEmptyClassRanges_A01_t05: Crash # Please triage this failure.
+LibTest/core/RegExp/Pattern_semantics/firstMatch_NonEmptyClassRanges_A01_t06: Crash # Please triage this failure.
+LibTest/core/RegExp/Pattern_semantics/firstMatch_Quantifier_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/core/RegExp/Pattern_semantics/firstMatch_Quantifier_A02_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/core/RegExp/Pattern_semantics/firstMatch_Quantifier_A03_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/core/RegExp/Pattern_semantics/firstMatch_Quantifier_A04_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/core/RegExp/Pattern_semantics/firstMatch_Quantifier_A05_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/core/RegExp/Pattern_semantics/firstMatch_Quantifier_A06_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/core/RegExp/Pattern_semantics/firstMatch_Term_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/core/RegExp/Pattern_semantics/firstMatch_Term_A02_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/core/RegExp/Pattern_semantics/firstMatch_Term_A03_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/core/RegExp/Pattern_semantics/firstMatch_Term_A04_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/core/RegExp/Pattern_semantics/splitQueryString_A02_t01: Crash # Unhandled node
+LibTest/core/RegExp/RegExp_A01_t02: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/core/RegExp/RegExp_A01_t03: Crash # "on T" catch block
+LibTest/core/RegExp/RegExp_A01_t04: Crash # "on T" catch block
+LibTest/core/RegExp/stringMatch_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/RegExp/stringMatch_A02_t01: Crash # "on T" catch block
+LibTest/core/RuneIterator/current_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/RuneIterator/current_A01_t02: Crash # "on T" catch block
+LibTest/core/RuneIterator/currentAsString_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/RuneIterator/currentAsString_A01_t02: Crash # "on T" catch block
+LibTest/core/RuneIterator/currentAsString_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/RuneIterator/currentAsString_A03_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/core/RuneIterator/currentSize_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/RuneIterator/currentSize_A01_t02: Crash # "on T" catch block
+LibTest/core/RuneIterator/currentSize_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/RuneIterator/moveNext_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/core/RuneIterator/moveNext_A02_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/core/RuneIterator/movePrevious_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/core/RuneIterator/movePrevious_A02_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/core/RuneIterator/movePrevious_A02_t02: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/core/RuneIterator/rawIndex_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/RuneIterator/rawIndex_A02_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/core/RuneIterator/rawIndex_A03_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/RuneIterator/rawIndex_A04_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/RuneIterator/rawIndex_A04_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/RuneIterator/rawIndex_A05_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/RuneIterator/reset_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/core/RuneIterator/reset_A01_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/RuneIterator/reset_A01_t03: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/RuneIterator/reset_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/RuneIterator/reset_A02_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/RuneIterator/reset_A03_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/RuneIterator/RuneIterator_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/RuneIterator/RuneIterator.at_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/RuneIterator/RuneIterator.at_A02_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/core/RuneIterator/RuneIterator.at_A03_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/RuneIterator/RuneIterator.at_A04_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/RuneIterator/RuneIterator.at_A05_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/RuneIterator/string_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/RuneIterator/string_A01_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/Runes/any_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/core/Runes/contains_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/core/Runes/elementAt_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/Runes/elementAt_A02_t01: Crash # "on T" catch block
+LibTest/core/Runes/every_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/core/Runes/expand_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/Runes/first_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/Runes/first_A01_t02: Crash # "on T" catch block
+LibTest/core/Runes/first_A02_t01: Crash # "on T" catch block
+LibTest/core/Runes/first_A03_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/Runes/firstWhere_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/Runes/firstWhere_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/Runes/firstWhere_A03_t01: Crash # "on T" catch block
+LibTest/core/Runes/fold_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/Runes/forEach_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/Runes/isEmpty_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/core/Runes/isEmpty_A01_t02: Crash # "on T" catch block
+LibTest/core/Runes/isNotEmpty_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/core/Runes/isNotEmpty_A01_t02: Crash # "on T" catch block
+LibTest/core/Runes/iterator_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/Runes/iterator_A01_t02: Crash # "on T" catch block
+LibTest/core/Runes/join_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/core/Runes/join_A01_t02: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/core/Runes/last_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/Runes/last_A01_t02: Crash # "on T" catch block
+LibTest/core/Runes/last_A02_t01: Crash # "on T" catch block
+LibTest/core/Runes/lastWhere_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/Runes/lastWhere_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/Runes/lastWhere_A03_t01: Crash # "on T" catch block
+LibTest/core/Runes/length_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/Runes/length_A01_t02: Crash # "on T" catch block
+LibTest/core/Runes/map_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/Runes/map_A02_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/core/Runes/map_A03_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/Runes/reduce_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/Runes/reduce_A02_t01: Crash # "on T" catch block
+LibTest/core/Runes/Runes_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/Runes/single_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/Runes/single_A01_t02: Crash # "on T" catch block
+LibTest/core/Runes/single_A02_t01: Crash # "on T" catch block
+LibTest/core/Runes/single_A02_t02: Crash # "on T" catch block
+LibTest/core/Runes/singleWhere_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/Runes/singleWhere_A02_t01: Crash # "on T" catch block
+LibTest/core/Runes/singleWhere_A02_t02: Crash # "on T" catch block
+LibTest/core/Runes/skip_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/Runes/skip_A02_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/core/Runes/skip_A03_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/Runes/skipWhile_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/Runes/skipWhile_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/Runes/skipWhile_A03_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/Runes/skipWhile_A04_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/Runes/string_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/Runes/string_A01_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/Runes/take_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/Runes/take_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/Runes/take_A03_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/Runes/takeWhile_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/Runes/takeWhile_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/Runes/takeWhile_A03_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/Runes/takeWhile_A04_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/Runes/toList_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/Runes/toList_A02_t01: Crash # "on T" catch block
+LibTest/core/Runes/toList_A02_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/Runes/toSet_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/core/Runes/where_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/Runes/where_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/Runes/where_A03_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/Set/add_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/core/Set/add_A01_t03: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/core/Set/add_A01_t06: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/core/Set/addAll_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/core/Set/addAll_A01_t03: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/core/Set/clear_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/core/Set/contains_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/core/Set/contains_A01_t02: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/core/Set/containsAll_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/core/Set/containsAll_A01_t02: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/core/Set/every_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/core/Set/every_A01_t02: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/core/Set/every_A01_t03: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/core/Set/forEach_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/core/Set/forEach_A01_t02: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/core/Set/forEach_A01_t03: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/core/Set/forEach_A01_t04: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/core/Set/forEach_A01_t05: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/core/Set/intersection_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/core/Set/intersection_A01_t03: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/core/Set/intersection_A02_t01: Crash # (try {res=s.intersection(null);}on Error catch (e){return;}): "on T" catch block
+LibTest/core/Set/isEmpty_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/core/Set/IterableBase_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/core/Set/length_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/core/Set/remove_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/core/Set/remove_A01_t03: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/core/Set/remove_A01_t05: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/core/Set/removeAll_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/core/Set/removeAll_A01_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/Set/Set_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/Set/Set.from_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/core/Set/Set.from_A01_t02: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/core/Set/Set.from_A02_t01: Crash # (try {new Set.from(null);Expect.fail("Error is expected");}on Error catch (e){}): "on T" catch block
+LibTest/core/StackOverflowError/toString_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/StateError/toString_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/Stopwatch/elapsed_A01_t01: Crash # unsupported element kind: _completer:field
+LibTest/core/Stopwatch/elapsed_A01_t02: Crash # unsupported element kind: _completer:field
+LibTest/core/Stopwatch/elapsed_A01_t03: Crash # unsupported element kind: _completer:field
+LibTest/core/Stopwatch/elapsedInMs_A01_t01: Crash # unsupported element kind: delay:field
+LibTest/core/Stopwatch/elapsedInUs_A01_t01: Crash # unsupported element kind: delay:field
+LibTest/core/Stopwatch/elapsedTicks_A01_t01: Crash # unsupported element kind: delay:field
+LibTest/core/Stopwatch/elapsedTicks_A01_t02: Crash # unsupported element kind: delay:field
+LibTest/core/Stopwatch/elapsedTicks_A01_t03: Crash # unsupported element kind: delay:field
+LibTest/core/Stopwatch/frequency_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/Stopwatch/start_A01_t01: Crash # unsupported element kind: _completer:field
+LibTest/core/Stopwatch/start_A01_t02: Crash # unsupported element kind: _completer:field
+LibTest/core/Stopwatch/start_A01_t03: Crash # unsupported element kind: _completer:field
+LibTest/core/Stopwatch/stop_A01_t01: Crash # unsupported element kind: delay:field
+LibTest/core/Stopwatch/Stopwatch_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/StringBuffer/clear_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/StringBuffer/isEmpty_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/core/StringBuffer/length_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/StringBuffer/StringBuffer_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/StringBuffer/StringBuffer_A01_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/StringBuffer/toString_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/StringBuffer/write_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/StringBuffer/write_A01_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/StringBuffer/writeAll_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/StringBuffer/writeAll_A01_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/StringBuffer/writeAll_A03_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/String/codeUnitAt_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/core/String/codeUnitAt_A02_t01: Crash # "on T" catch block
+LibTest/core/String/codeUnitAt_A03_t01: Crash # "on T" catch block
+LibTest/core/String/codeUnits_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/String/compareTo_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/String/contains_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/core/String/contains_A01_t02: Crash # "on T" catch block
+LibTest/core/String/contains_A01_t03: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/core/String/contains_A02_t01: Crash # "on T" catch block
+LibTest/core/String/endsWith_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/core/String/endsWith_A01_t02: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/core/String/endsWith_A01_t03: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/core/String/endsWith_A02_t01: Crash # (try {"".endsWith(null);Expect.fail("Error is expected");}on Error catch (e){}): "on T" catch block
+LibTest/core/String/hashCode_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/String/indexOf_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/core/String/indexOf_A02_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/core/String/indexOf_A03_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/String/isEmpty_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/core/String/lastIndexOf_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/core/String/lastIndexOf_A02_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/core/String/lastIndexOf_A03_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/String/length_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/core/String/operator_equality_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/core/String/operator_equality_A02_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/core/String/operator_subscript_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/core/String/operator_subscript_A02_t01: Crash # "on T" catch block
+LibTest/core/String/replaceAll_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/core/String/replaceAll_A02_t01: Crash # "on T" catch block
+LibTest/core/String/replaceFirst_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/core/String/replaceFirst_A02_t01: Crash # "on T" catch block
+LibTest/core/String/split_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/String/split_A01_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/String/split_A02_t01: Crash # (try {"1111".split(null);Expect.fail("Error is expected");}on Error catch (e){}): "on T" catch block
+LibTest/core/String/startsWith_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/core/String/startsWith_A01_t02: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/core/String/startsWith_A01_t03: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/core/String/startsWith_A02_t01: Crash # "on T" catch block
+LibTest/core/String/String_class_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/core/String/String_class_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/String/String_class_A03_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/String/String.fromCharCodes_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/core/String/String.fromCharCodes_A02_t01: Crash # "on T" catch block
+LibTest/core/String/String.fromCharCodes_A03_t01: Crash # "on T" catch block
+LibTest/core/String/substring_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/core/String/substring_A02_t01: Crash # "on T" catch block
+LibTest/core/String/toLowerCase_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/String/toLowerCase_A01_t02: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/core/String/toLowerCase_A01_t03: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/String/toLowerCase_A01_t04: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/String/toUpperCase_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/String/toUpperCase_A01_t02: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/core/String/toUpperCase_A01_t03: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/String/toUpperCase_A01_t04: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/String/trim_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/String/trim_A01_t02: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/core/Symbol/Symbol_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/Symbol/Symbol_A01_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/Symbol/Symbol_A01_t03: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/Symbol/Symbol_A01_t04: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/Symbol/Symbol_A01_t05: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/TypeError/toString_A01_t01: Crash # "on T" catch block
+LibTest/core/UnimplementedError/toString_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/Uri/authority_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/Uri/decodeComponent_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/Uri/decodeFull_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/Uri/decodeQueryComponent_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/Uri/decodeQueryComponent_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/Uri/encodeComponent_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/Uri/encodeComponent_A01_t02: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/core/Uri/encodeFull_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/Uri/encodeFull_A01_t02: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/core/Uri/encodeQueryComponent_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/Uri/encodeQueryComponent_A01_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/Uri/fragment_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/Uri/hasAuthority_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/core/Uri/hashCode_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/Uri/host_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/Uri/isAbsolute_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/core/Uri/operator_eq_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/core/Uri/origin_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/Uri/parse_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/Uri/parse_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/Uri/parse_A03_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/Uri/path_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/Uri/path_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/Uri/pathSegments_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/Uri/pathSegments_A01_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/Uri/pathSegments_A01_t03: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/Uri/pathSegments_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/Uri/port_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/Uri/query_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/Uri/query_A01_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/Uri/queryParameters_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/Uri/queryParameters_A01_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/Uri/queryParameters_A01_t03: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/Uri/resolve_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/Uri/resolveUri_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/Uri/scheme_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/Uri/splitQueryString_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/Uri/splitQueryString_A01_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/Uri/toFilePath_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/Uri/toFilePath_A01_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/Uri/toFilePath_A01_t03: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/Uri/toFilePath_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/Uri/toFilePath_A03_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/Uri/toFilePath_A04_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/Uri/Uri_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/Uri/Uri_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/Uri/Uri_A03_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/core/Uri/Uri_A04_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/Uri/Uri_A05_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/Uri/Uri_A05_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/Uri/Uri_A06_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/Uri/Uri_A06_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/Uri/Uri_A06_t03: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/Uri/Uri_A07_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/Uri/Uri.file_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/core/Uri/Uri.file_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/Uri/Uri.file_A02_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/Uri/Uri.file_A03_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/core/Uri/Uri.file_A04_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/Uri/Uri.http_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/Uri/Uri.http_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/Uri/Uri.http_A03_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/Uri/Uri.http_A04_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/Uri/Uri.https_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/Uri/Uri.https_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/Uri/Uri.https_A03_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/Uri/Uri.https_A04_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/core/Uri/userInfo_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/html/CanvasRenderingContext2D/addEventListener_A01_t01: Crash # unsupported element kind: _completer:field
+LibTest/html/CanvasRenderingContext2D/addEventListener_A01_t02: Crash # unsupported element kind: _completer:field
+LibTest/html/CanvasRenderingContext2D/addEventListener_A01_t03: Crash # unsupported element kind: _completer:field
+LibTest/html/CanvasRenderingContext2D/addEventListener_A01_t04: Crash # unsupported element kind: _completer:field
+LibTest/html/CanvasRenderingContext2D/addEventListener_A01_t05: Crash # unsupported element kind: _completer:field
+LibTest/html/CanvasRenderingContext2D/addEventListener_A01_t06: Crash # unsupported element kind: _completer:field
+LibTest/html/Document/addEventListener_A01_t01: Crash # unsupported element kind: _completer:field
+LibTest/html/Document/adoptNode_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/html/Document/append_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/html/Document/append_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/html/Document/append_A02_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/html/Document/childNodes_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/html/Document/childNodes_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/html/Document/clone_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/html/Document/clone_A01_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/html/Document/contains_A01_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/html/Document/createDocumentFragment_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/html/Document/createElement_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/html/Document/dispatchEvent_A01_t01: Crash # unsupported element kind: _completer:field
+LibTest/html/Document/documentElement_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/html/Document/firstChild_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/html/Document/getElementById_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/html/Document/getElementsByClassName_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/html/Document/getElementsByName_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/html/Document/getElementsByTagName_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/html/Document/hasChildNodes_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/html/Document/importNode_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/html/Document/insertAllBefore_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/html/Document/insertAllBefore_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/html/Document/insertBefore_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/html/Document/insertBefore_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/html/Document/lastChild_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/html/Document/nextNode_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/html/Document/nodeName_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/html/Document/nodes_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/html/Document/nodeType_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/html/Document/nodeValue_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/html/Document/on_A01_t01: Crash # unsupported element kind: _completer:field
+LibTest/html/Document/on_A01_t02: Crash # unsupported element kind: _completer:field
+LibTest/html/Document/ownerDocument_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/html/Document/parent_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/html/Document/parentNode_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/html/Document/previousNode_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/html/Document/querySelector_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/html/Document/querySelectorAll_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/html/Document/readyState_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/html/Document/removeEventListener_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/html/Document/securityPolicy_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/html/Document/text_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/html/Document/window_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/html/Element/abortEvent_A01_t01: Crash # unsupported element kind: _completer:field
+LibTest/html/Element/addEventListener_A01_t01: Crash # unsupported element kind: _completer:field
+LibTest/html/Element/addEventListener_A01_t02: Crash # unsupported element kind: _completer:field
+LibTest/html/Element/addEventListener_A01_t03: Crash # unsupported element kind: _completer:field
+LibTest/html/Element/addEventListener_A01_t04: Crash # unsupported element kind: _completer:field
+LibTest/html/Element/addEventListener_A01_t05: Crash # unsupported element kind: _completer:field
+LibTest/html/Element/addEventListener_A01_t06: Crash # unsupported element kind: _completer:field
+LibTest/html/Element/append_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/html/Element/append_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/html/Element/append_A02_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/html/Element/appendHtml_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/html/Element/appendText_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/html/Element/attributeChanged_A01_t01: Crash # unsupported element kind: _asyncCounter:field
+LibTest/html/Element/attributes_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/html/Element/attributes_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/html/Element/beforeCopyEvent_A01_t01: Crash # unsupported element kind: _completer:field
+LibTest/html/Element/beforeCutEvent_A01_t01: Crash # unsupported element kind: _completer:field
+LibTest/html/Element/beforePasteEvent_A01_t01: Crash # unsupported element kind: _completer:field
+LibTest/html/Element/blur_A01_t01: Crash # unsupported element kind: _completer:field
+LibTest/html/Element/blurEvent_A01_t01: Crash # unsupported element kind: _completer:field
+LibTest/html/Element/borderEdge_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/html/Element/changeEvent_A01_t01: Crash # unsupported element kind: _completer:field
+LibTest/html/Element/childNodes_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/html/Element/childNodes_A01_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/html/Element/children_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/html/Element/children_A01_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/html/Element/classes_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/html/Element/className_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/html/Element/click_A01_t01: Crash # unsupported element kind: _completer:field
+LibTest/html/Element/clickEvent_A01_t01: Crash # unsupported element kind: _completer:field
+LibTest/html/Element/clone_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/html/Element/clone_A01_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/html/Element/clone_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/html/Element/clone_A03_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/html/Element/contains_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/html/Element/contains_A01_t02: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/html/Element/contains_A01_t03: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/html/Element/contentEdge_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/html/Element/contentEditable_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/html/Element/contentEditable_A01_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/html/Element/contextMenuEvent_A01_t01: Crash # unsupported element kind: _completer:field
+LibTest/html/Element/copyEvent_A01_t01: Crash # unsupported element kind: _completer:field
+LibTest/html/Element/createFragment_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/html/Element/createFragment_A01_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/html/Element/createFragment_A01_t03: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/html/Element/cutEvent_A01_t01: Crash # unsupported element kind: _completer:field
+LibTest/html/Element/dataset_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/html/Element/dataset_A01_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/html/Element/dataset_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/html/Element/dir_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/html/Element/dir_A01_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/html/Element/documentOffset_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/html/Element/doubleClickEvent_A01_t01: Crash # unsupported element kind: _completer:field
+LibTest/html/Element/dragEndEvent_A01_t01: Crash # unsupported element kind: _completer:field
+LibTest/html/Element/dragEnterEvent_A01_t01: Crash # unsupported element kind: _completer:field
+LibTest/html/Element/dragEvent_A01_t01: Crash # unsupported element kind: _completer:field
+LibTest/html/Element/draggable_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/html/Element/draggable_A01_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/html/Element/dragLeaveEvent_A01_t01: Crash # unsupported element kind: _completer:field
+LibTest/html/Element/dragOverEvent_A01_t01: Crash # unsupported element kind: _completer:field
+LibTest/html/Element/dragStartEvent_A01_t01: Crash # unsupported element kind: _completer:field
+LibTest/html/Element/dropEvent_A01_t01: Crash # unsupported element kind: _completer:field
+LibTest/html/Element/Element_element_ctors_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/html/Element/Element.html_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/html/Element/Element.html_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/html/Element/Element.html_A03_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/html/Element/Element.html_A04_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/html/Element/Element.html_A04_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/html/Element/Element.tag_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/html/Element/Element.tag_A01_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/html/Element/enteredView_A01_t01: Crash # unsupported element kind: _asyncCounter:field
+LibTest/html/Element/errorEvent_A01_t01: Crash # unsupported element kind: _completer:field
+LibTest/html/Element/firstChild_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/html/Element/focus_A01_t01: Crash # unsupported element kind: _completer:field
+LibTest/html/Element/focusEvent_A01_t01: Crash # unsupported element kind: _completer:field
+LibTest/html/Element/fullscreenChangeEvent_A01_t01: Crash # unsupported element kind: _completer:field
+LibTest/html/Element/fullscreenErrorEvent_A01_t01: Crash # unsupported element kind: _completer:field
+LibTest/html/Element/getAttribute_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/html/Element/getAttributeNS_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/html/Element/getAttributeNS_A02_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/html/Element/getBoundingClientRect_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/html/Element/getBoundingClientRect_A01_t02: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/html/Element/getClientRects_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/html/Element/getClientRects_A01_t02: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/html/Element/getElementsByClassName_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/html/Element/getElementsByClassName_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/html/Element/getNamespacedAttributes_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/html/Element/hasChildNodes_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/html/Element/hidden_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/html/Element/id_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/html/Element/innerHtml_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/html/Element/innerHtml_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/html/Element/inputEvent_A01_t01: Crash # unsupported element kind: _completer:field
+LibTest/html/Element/insertAdjacentElement_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/html/Element/insertAdjacentHtml_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/html/Element/insertAdjacentText_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/html/Element/insertAllBefore_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/html/Element/insertAllBefore_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/html/Element/insertBefore_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/html/Element/insertBefore_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/html/Element/invalidEvent_A01_t01: Crash # unsupported element kind: _completer:field
+LibTest/html/Element/isContentEditable_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/html/Element/isContentEditable_A02_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/html/Element/isTagSupported_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/html/Element/isTagSupported_A01_t02: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/html/Element/isTagSupported_A01_t03: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/html/Element/keyDownEvent_A01_t01: Crash # unsupported element kind: _completer:field
+LibTest/html/Element/keyPressEvent_A01_t01: Crash # unsupported element kind: _completer:field
+LibTest/html/Element/keyUpEvent_A01_t01: Crash # unsupported element kind: _completer:field
+LibTest/html/Element/lang_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/html/Element/lang_A01_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/html/Element/lastChild_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/html/Element/leftView_A01_t01: Crash # unsupported element kind: _asyncCounter:field
+LibTest/html/Element/loadEvent_A01_t01: Crash # unsupported element kind: _completer:field
+LibTest/html/Element/marginEdge_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/html/Element/matches_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/html/Element/matchesWithAncestors_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/html/Element/mouseDownEvent_A01_t01: Crash # unsupported element kind: _completer:field
+LibTest/html/Element/mouseEnterEvent_A01_t01: Crash # unsupported element kind: _completer:field
+LibTest/html/Element/mouseLeaveEvent_A01_t01: Crash # unsupported element kind: _completer:field
+LibTest/html/Element/mouseMoveEvent_A01_t01: Crash # unsupported element kind: _completer:field
+LibTest/html/Element/mouseOutEvent_A01_t01: Crash # unsupported element kind: _completer:field
+LibTest/html/Element/mouseOverEvent_A01_t01: Crash # unsupported element kind: _completer:field
+LibTest/html/Element/mouseUpEvent_A01_t01: Crash # unsupported element kind: _completer:field
+LibTest/html/Element/mouseWheelEvent_A01_t01: Crash # unsupported element kind: _completer:field
+LibTest/html/Element/namespaceUri_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/html/Element/nextElementSibling_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/html/Element/nextNode_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/html/Element/nodeName_A03_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/html/Element/nodeName_A04_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/html/Element/nodeName_A05_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/html/Element/nodeName_A06_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/html/Element/nodeName_A07_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/html/Element/nodeName_A12_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/html/Element/nodes_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/html/Element/nodes_A01_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/html/Element/offset_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/html/Element/offsetHeight_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/html/Element/offsetLeft_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/html/Element/offsetParent_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/html/Element/offsetTo_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/html/Element/offsetTo_A01_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/html/Element/offsetTop_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/html/Element/offsetWidth_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/html/Element/on_A01_t01: Crash # unsupported element kind: _completer:field
+LibTest/html/Element/onAbort_A01_t01: Crash # unsupported element kind: _completer:field
+LibTest/html/Element/onBeforeCopy_A01_t01: Crash # unsupported element kind: _completer:field
+LibTest/html/Element/onBeforeCut_A01_t01: Crash # unsupported element kind: _completer:field
+LibTest/html/Element/onBeforePaste_A01_t01: Crash # unsupported element kind: _completer:field
+LibTest/html/Element/onBlur_A01_t01: Crash # unsupported element kind: _completer:field
+LibTest/html/Element/onChange_A01_t01: Crash # unsupported element kind: _completer:field
+LibTest/html/Element/onClick_A01_t01: Crash # unsupported element kind: _completer:field
+LibTest/html/Element/onContextMenu_A01_t01: Crash # unsupported element kind: _completer:field
+LibTest/html/Element/onCopy_A01_t01: Crash # unsupported element kind: _completer:field
+LibTest/html/Element/onCut_A01_t01: Crash # unsupported element kind: _completer:field
+LibTest/html/Element/onDoubleClick_A01_t01: Crash # unsupported element kind: _completer:field
+LibTest/html/Element/onDrag_A01_t01: Crash # unsupported element kind: _completer:field
+LibTest/html/Element/onDragEnd_A01_t01: Crash # unsupported element kind: _completer:field
+LibTest/html/Element/onDragEnter_A01_t01: Crash # unsupported element kind: _completer:field
+LibTest/html/Element/onDragLeave_A01_t01: Crash # unsupported element kind: _completer:field
+LibTest/html/Element/onDragOver_A01_t01: Crash # unsupported element kind: _completer:field
+LibTest/html/Element/onDragStart_A01_t01: Crash # unsupported element kind: _completer:field
+LibTest/html/Element/onDrop_A01_t01: Crash # unsupported element kind: _completer:field
+LibTest/html/Element/onError_A01_t01: Crash # unsupported element kind: _completer:field
+LibTest/html/Element/onFocus_A01_t01: Crash # unsupported element kind: _completer:field
+LibTest/html/Element/onFullscreenChange_A01_t01: Crash # unsupported element kind: _completer:field
+LibTest/html/Element/onFullscreenError_A01_t01: Crash # unsupported element kind: _completer:field
+LibTest/html/Element/onInput_A01_t01: Crash # unsupported element kind: _completer:field
+LibTest/html/Element/onInvalid_A01_t01: Crash # unsupported element kind: _completer:field
+LibTest/html/Element/onKeyDown_A01_t01: Crash # unsupported element kind: _completer:field
+LibTest/html/Element/onKeyPress_A01_t01: Crash # unsupported element kind: _completer:field
+LibTest/html/Element/onKeyUp_A01_t01: Crash # unsupported element kind: _completer:field
+LibTest/html/Element/onLoad_A01_t01: Crash # unsupported element kind: _completer:field
+LibTest/html/Element/onMouseDown_A01_t01: Crash # unsupported element kind: _completer:field
+LibTest/html/Element/onMouseEnter_A01_t01: Crash # unsupported element kind: _completer:field
+LibTest/html/Element/onMouseLeave_A01_t01: Crash # unsupported element kind: _completer:field
+LibTest/html/Element/onMouseMove_A01_t01: Crash # unsupported element kind: _completer:field
+LibTest/html/Element/onMouseOut_A01_t01: Crash # unsupported element kind: _completer:field
+LibTest/html/Element/onMouseOver_A01_t01: Crash # unsupported element kind: _completer:field
+LibTest/html/Element/onMouseUp_A01_t01: Crash # unsupported element kind: _completer:field
+LibTest/html/Element/onMouseWheel_A01_t01: Crash # unsupported element kind: _completer:field
+LibTest/html/Element/onPaste_A01_t01: Crash # unsupported element kind: _completer:field
+LibTest/html/Element/onReset_A01_t01: Crash # unsupported element kind: _completer:field
+LibTest/html/Element/onScroll_A01_t01: Crash # unsupported element kind: _completer:field
+LibTest/html/Element/onSearch_A01_t01: Crash # unsupported element kind: _completer:field
+LibTest/html/Element/onSelect_A01_t01: Crash # unsupported element kind: _completer:field
+LibTest/html/Element/onSelectStart_A01_t01: Crash # unsupported element kind: _completer:field
+LibTest/html/Element/onSubmit_A01_t01: Crash # unsupported element kind: _completer:field
+LibTest/html/Element/onTouchCancel_A01_t01: Crash # unsupported element kind: _completer:field
+LibTest/html/Element/onTouchEnd_A01_t01: Crash # unsupported element kind: _completer:field
+LibTest/html/Element/onTouchEnter_A01_t01: Crash # unsupported element kind: _completer:field
+LibTest/html/Element/onTouchLeave_A01_t01: Crash # unsupported element kind: _completer:field
+LibTest/html/Element/onTouchMove_A01_t01: Crash # unsupported element kind: _completer:field
+LibTest/html/Element/onTouchStart_A01_t01: Crash # unsupported element kind: _completer:field
+LibTest/html/Element/onTransitionEnd_A01_t01: Crash # unsupported element kind: _completer:field
+LibTest/html/Element/outerHtml_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/html/Element/ownerDocument_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/html/Element/ownerDocument_A01_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/html/Element/ownerDocument_A01_t03: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/html/Element/ownerDocument_A01_t04: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/html/Element/ownerDocument_A01_t05: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/html/Element/paddingEdge_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/html/Element/parent_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/html/Element/parent_A01_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/html/Element/parent_A01_t03: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/html/Element/parentNode_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/html/Element/parentNode_A01_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/html/Element/parentNode_A01_t03: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/html/Element/pasteEvent_A01_t01: Crash # unsupported element kind: _completer:field
+LibTest/html/Element/previousElementSibling_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/html/Element/previousNode_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/html/Element/query_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/html/Element/queryAll_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/html/Element/querySelector_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/html/Element/querySelectorAll_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/html/Element/querySelectorAll_A01_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/html/Element/remove_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/html/Element/removeEventListener_A01_t01: Crash # unsupported element kind: _asyncCounter:field
+LibTest/html/Element/removeEventListener_A01_t02: Crash # unsupported element kind: _asyncCounter:field
+LibTest/html/Element/replaceWith_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/html/Element/replaceWith_A01_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/html/Element/resetEvent_A01_t01: Crash # unsupported element kind: _completer:field
+LibTest/html/Element/scrollEvent_A01_t01: Crash # unsupported element kind: _completer:field
+LibTest/html/Element/searchEvent_A01_t01: Crash # unsupported element kind: _completer:field
+LibTest/html/Element/selectEvent_A01_t01: Crash # unsupported element kind: _completer:field
+LibTest/html/Element/selectStartEvent_A01_t01: Crash # unsupported element kind: _completer:field
+LibTest/html/Element/setAttribute_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/html/Element/setAttributeNS_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/html/Element/setInnerHtml_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/html/Element/setInnerHtml_A01_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/html/Element/setInnerHtml_A01_t03: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/html/Element/spellcheck_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/html/Element/spellcheck_A01_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/html/Element/style_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/html/Element/style_A01_t02: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/html/Element/submitEvent_A01_t01: Crash # unsupported element kind: _completer:field
+LibTest/html/Element/tabIndex_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/html/Element/tagName_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/html/Element/tagName_A01_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/html/Element/tagName_A01_t03: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/html/Element/text_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/html/Element/text_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/html/Element/text_A03_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/html/Element/text_A04_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/html/Element/title_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/html/Element/touchCancelEvent_A01_t01: Crash # unsupported element kind: _completer:field
+LibTest/html/Element/touchEndEvent_A01_t01: Crash # unsupported element kind: _completer:field
+LibTest/html/Element/touchEnterEvent_A01_t01: Crash # unsupported element kind: _completer:field
+LibTest/html/Element/touchLeaveEvent_A01_t01: Crash # unsupported element kind: _completer:field
+LibTest/html/Element/touchMoveEvent_A01_t01: Crash # unsupported element kind: _completer:field
+LibTest/html/Element/touchStartEvent_A01_t01: Crash # unsupported element kind: _completer:field
+LibTest/html/Element/transitionEndEvent_A01_t01: Crash # unsupported element kind: _completer:field
+LibTest/html/Element/translate_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/html/Event/bubbles_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/html/Event/cancelable_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/html/Event/currentTarget_A01_t01: Crash # unsupported element kind: _asyncCounter:field
+LibTest/html/Event/defaultPrevented_A01_t01: Crash # unsupported element kind: _asyncCounter:field
+LibTest/html/Event/Event_A01_t01: Crash # unsupported element kind: _completer:field
+LibTest/html/Event/Event_A01_t02: Crash # unsupported element kind: _completer:field
+LibTest/html/Event/Event_A01_t03: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/html/Event/Event_A01_t04: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/html/Event/Event.eventType_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/html/Event/eventPhase_A01_t01: Crash # unsupported element kind: _asyncCounter:field
+LibTest/html/Event/matchingTarget_A01_t01: Crash # unsupported element kind: _asyncCounter:field
+LibTest/html/Event/matchingTarget_A01_t02: Crash # unsupported element kind: _asyncCounter:field
+LibTest/html/Event/preventDefault_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/html/Event/stopImmediatePropagation_A01_t01: Crash # unsupported element kind: _completer:field
+LibTest/html/Event/stopImmediatePropagation_A01_t02: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/html/Event/stopPropagation_A01_t01: Crash # unsupported element kind: _completer:field
+LibTest/html/Event/target_A01_t01: Crash # unsupported element kind: _asyncCounter:field
+LibTest/html/Event/type_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/html/HttpRequest/abort_A01_t01: Crash # Unhandled node
+LibTest/html/HttpRequest/addEventListener_A01_t01: Crash # unsupported element kind: _completer:field
+LibTest/html/HttpRequest/dispatchEvent_A01_t01: Crash # unsupported element kind: _completer:field
+LibTest/html/HttpRequest/getAllResponseHeaders_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/html/HttpRequest/getResponseHeader_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/html/HttpRequest/getString_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/html/HttpRequest/HttpRequest_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/html/HttpRequest/onAbort_A01_t01: Crash # unsupported element kind: _asyncCounter:field
+LibTest/html/HttpRequest/onError_A01_t02: Crash # unsupported element kind: _completer:field
+LibTest/html/HttpRequest/onLoad_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/html/HttpRequest/onLoadEnd_A01_t01: Crash # unsupported element kind: _completer:field
+LibTest/html/HttpRequest/onLoadStart_A01_t01: Crash # unsupported element kind: _completer:field
+LibTest/html/HttpRequest/onReadyStateChange_A01_t01: Crash # unsupported element kind: _completer:field
+LibTest/html/HttpRequest/open_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/html/HttpRequest/overrideMimeType_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/html/HttpRequest/readyStateChangeEvent_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/html/HttpRequest/removeEventListener_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/html/HttpRequest/request_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/html/HttpRequest/responseText_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/html/HttpRequest/responseText_A01_t02: Crash # (r): Error expression `r` unhandled.
+LibTest/html/HttpRequest/responseType_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/html/HttpRequest/responseType_A01_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/html/HttpRequest/setRequestHeader_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/html/HttpRequest/status_A01_t01: Crash # unsupported element kind: _completer:field
+LibTest/html/HttpRequest/statusText_A01_t01: Crash # unsupported element kind: _completer:field
+LibTest/html/HttpRequestUpload/onAbort_A01_t01: Crash # unsupported element kind: _asyncCounter:field
+LibTest/html/HttpRequestUpload/onError_A01_t02: Crash # unsupported element kind: _completer:field
+LibTest/html/HttpRequestUpload/onLoad_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/html/HttpRequestUpload/onLoadEnd_A01_t01: Crash # unsupported element kind: _completer:field
+LibTest/html/HttpRequestUpload/onLoadStart_A01_t01: Crash # unsupported element kind: _completer:field
+LibTest/html/IFrameElement/addEventListener_A01_t01: Crash # unsupported element kind: _completer:field
+LibTest/html/IFrameElement/addEventListener_A01_t02: Crash # unsupported element kind: _completer:field
+LibTest/html/IFrameElement/addEventListener_A01_t03: Crash # unsupported element kind: _completer:field
+LibTest/html/IFrameElement/addEventListener_A01_t04: Crash # unsupported element kind: _completer:field
+LibTest/html/IFrameElement/addEventListener_A01_t05: Crash # unsupported element kind: _completer:field
+LibTest/html/IFrameElement/addEventListener_A01_t06: Crash # unsupported element kind: _completer:field
+LibTest/html/IFrameElement/append_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/html/IFrameElement/append_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/html/IFrameElement/append_A02_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/html/IFrameElement/appendHtml_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/html/IFrameElement/appendHtml_A01_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/html/IFrameElement/appendText_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/html/IFrameElement/attributeChanged_A01_t01: Crash # unsupported element kind: _asyncCounter:field
+LibTest/html/IFrameElement/attributes_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/html/IFrameElement/attributes_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/html/IFrameElement/attributes_setter_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/html/IFrameElement/blur_A01_t01: Crash # unsupported element kind: _completer:field
+LibTest/html/IFrameElement/borderEdge_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/html/IFrameElement/childNodes_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/html/IFrameElement/childNodes_A01_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/html/IFrameElement/children_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/html/IFrameElement/children_A01_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/html/IFrameElement/children_setter_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/html/IFrameElement/classes_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/html/IFrameElement/classes_setter_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/html/IFrameElement/className_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/html/IFrameElement/click_A01_t01: Crash # unsupported element kind: _completer:field
+LibTest/html/IFrameElement/clone_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/html/IFrameElement/clone_A01_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/html/IFrameElement/clone_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/html/IFrameElement/clone_A03_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/html/IFrameElement/contains_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/html/IFrameElement/contains_A01_t02: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/html/IFrameElement/contentEdge_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/html/IFrameElement/contentWindow_A01_t01: Crash # unsupported element kind: _completer:field
+LibTest/html/IFrameElement/createFragment_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/html/IFrameElement/createFragment_A01_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/html/IFrameElement/createFragment_A01_t03: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/html/IFrameElement/createShadowRoot_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/html/IFrameElement/dataset_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/html/IFrameElement/dataset_A01_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/html/IFrameElement/dataset_setter_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/html/IFrameElement/dispatchEvent_A01_t01: Crash # unsupported element kind: _completer:field
+LibTest/html/IFrameElement/documentOffset_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/html/IFrameElement/draggable_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/html/IFrameElement/draggable_A01_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/html/IFrameElement/enteredView_A01_t01: Crash # unsupported element kind: _asyncCounter:field
+LibTest/html/IFrameElement/firstChild_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/html/IFrameElement/focus_A01_t01: Crash # unsupported element kind: _completer:field
+LibTest/html/IFrameElement/getAttribute_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/html/IFrameElement/getAttributeNS_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/html/IFrameElement/getBoundingClientRect_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/html/IFrameElement/getClientRects_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/html/IFrameElement/getClientRects_A01_t02: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/html/IFrameElement/getElementsByClassName_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/html/IFrameElement/getElementsByClassName_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/html/IFrameElement/getNamespacedAttributes_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/html/IFrameElement/hasChildNodes_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/html/IFrameElement/hasChildNodes_A01_t02: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/html/IFrameElement/hidden_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/html/IFrameElement/id_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/html/IFrameElement/IFrameElement.created_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/html/IFrameElement/innerHtml_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/html/IFrameElement/insertAdjacentElement_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/html/IFrameElement/insertAdjacentHtml_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/html/IFrameElement/insertAdjacentText_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/html/IFrameElement/insertAllBefore_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/html/IFrameElement/insertAllBefore_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/html/IFrameElement/insertBefore_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/html/IFrameElement/insertBefore_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/html/IFrameElement/isContentEditable_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/html/IFrameElement/lang_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/html/IFrameElement/lang_A01_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/html/IFrameElement/lastChild_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/html/IFrameElement/leftView_A01_t01: Crash # unsupported element kind: _asyncCounter:field
+LibTest/html/IFrameElement/marginEdge_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/html/IFrameElement/matches_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/html/IFrameElement/matchesWithAncestors_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/html/IFrameElement/namespaceUri_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/html/IFrameElement/nextElementSibling_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/html/IFrameElement/nextNode_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/html/IFrameElement/nodeName_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/html/IFrameElement/nodes_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/html/IFrameElement/nodes_A01_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/html/IFrameElement/nodes_setter_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/html/IFrameElement/nodeType_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/html/IFrameElement/nodeValue_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/html/IFrameElement/offsetTo_A01_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/html/IFrameElement/on_A01_t01: Crash # unsupported element kind: _completer:field
+LibTest/html/IFrameElement/onAbort_A01_t01: Crash # unsupported element kind: _completer:field
+LibTest/html/IFrameElement/onBeforeCopy_A01_t01: Crash # unsupported element kind: _completer:field
+LibTest/html/IFrameElement/onBeforeCut_A01_t01: Crash # unsupported element kind: _completer:field
+LibTest/html/IFrameElement/onBeforePaste_A01_t01: Crash # unsupported element kind: _completer:field
+LibTest/html/IFrameElement/onBlur_A01_t01: Crash # unsupported element kind: _completer:field
+LibTest/html/IFrameElement/onChange_A01_t01: Crash # unsupported element kind: _completer:field
+LibTest/html/IFrameElement/onClick_A01_t01: Crash # unsupported element kind: _completer:field
+LibTest/html/IFrameElement/onContextMenu_A01_t01: Crash # unsupported element kind: _completer:field
+LibTest/html/IFrameElement/onCopy_A01_t01: Crash # unsupported element kind: _completer:field
+LibTest/html/IFrameElement/onCut_A01_t01: Crash # unsupported element kind: _completer:field
+LibTest/html/IFrameElement/onDoubleClick_A01_t01: Crash # unsupported element kind: _completer:field
+LibTest/html/IFrameElement/onDrag_A01_t01: Crash # unsupported element kind: _completer:field
+LibTest/html/IFrameElement/onDragEnd_A01_t01: Crash # unsupported element kind: _completer:field
+LibTest/html/IFrameElement/onDragEnter_A01_t01: Crash # unsupported element kind: _completer:field
+LibTest/html/IFrameElement/onDragLeave_A01_t01: Crash # unsupported element kind: _completer:field
+LibTest/html/IFrameElement/onDragOver_A01_t01: Crash # unsupported element kind: _completer:field
+LibTest/html/IFrameElement/onDragStart_A01_t01: Crash # unsupported element kind: _completer:field
+LibTest/html/IFrameElement/onDrop_A01_t01: Crash # unsupported element kind: _completer:field
+LibTest/html/IFrameElement/onError_A01_t01: Crash # unsupported element kind: _completer:field
+LibTest/html/IFrameElement/onFocus_A01_t01: Crash # unsupported element kind: _completer:field
+LibTest/html/IFrameElement/onFullscreenChange_A01_t01: Crash # unsupported element kind: _completer:field
+LibTest/html/IFrameElement/onFullscreenError_A01_t01: Crash # unsupported element kind: _completer:field
+LibTest/html/IFrameElement/onInput_A01_t01: Crash # unsupported element kind: _completer:field
+LibTest/html/IFrameElement/onInvalid_A01_t01: Crash # unsupported element kind: _completer:field
+LibTest/html/IFrameElement/onKeyDown_A01_t01: Crash # unsupported element kind: _completer:field
+LibTest/html/IFrameElement/onKeyPress_A01_t01: Crash # unsupported element kind: _completer:field
+LibTest/html/IFrameElement/onKeyUp_A01_t01: Crash # unsupported element kind: _completer:field
+LibTest/html/IFrameElement/onLoad_A01_t01: Crash # unsupported element kind: _completer:field
+LibTest/html/IFrameElement/onMouseDown_A01_t01: Crash # unsupported element kind: _completer:field
+LibTest/html/IFrameElement/onMouseEnter_A01_t01: Crash # unsupported element kind: _completer:field
+LibTest/html/IFrameElement/onMouseLeave_A01_t01: Crash # unsupported element kind: _completer:field
+LibTest/html/IFrameElement/onMouseMove_A01_t01: Crash # unsupported element kind: _completer:field
+LibTest/html/IFrameElement/onMouseOut_A01_t01: Crash # unsupported element kind: _completer:field
+LibTest/html/IFrameElement/onMouseOver_A01_t01: Crash # unsupported element kind: _completer:field
+LibTest/html/IFrameElement/onMouseUp_A01_t01: Crash # unsupported element kind: _completer:field
+LibTest/html/IFrameElement/onMouseWheel_A01_t01: Crash # unsupported element kind: _completer:field
+LibTest/html/IFrameElement/onPaste_A01_t01: Crash # unsupported element kind: _completer:field
+LibTest/html/IFrameElement/onReset_A01_t01: Crash # unsupported element kind: _completer:field
+LibTest/html/IFrameElement/onScroll_A01_t01: Crash # unsupported element kind: _completer:field
+LibTest/html/IFrameElement/onSearch_A01_t01: Crash # unsupported element kind: _completer:field
+LibTest/html/IFrameElement/onSelect_A01_t01: Crash # unsupported element kind: _completer:field
+LibTest/html/IFrameElement/onSelectStart_A01_t01: Crash # unsupported element kind: _completer:field
+LibTest/html/IFrameElement/onSubmit_A01_t01: Crash # unsupported element kind: _completer:field
+LibTest/html/IFrameElement/onTouchCancel_A01_t01: Crash # unsupported element kind: _completer:field
+LibTest/html/IFrameElement/onTouchEnd_A01_t01: Crash # unsupported element kind: _completer:field
+LibTest/html/IFrameElement/onTouchEnter_A01_t01: Crash # unsupported element kind: _completer:field
+LibTest/html/IFrameElement/onTouchLeave_A01_t01: Crash # unsupported element kind: _completer:field
+LibTest/html/IFrameElement/onTouchMove_A01_t01: Crash # unsupported element kind: _completer:field
+LibTest/html/IFrameElement/onTouchStart_A01_t01: Crash # unsupported element kind: _completer:field
+LibTest/html/IFrameElement/onTransitionEnd_A01_t01: Crash # unsupported element kind: _completer:field
+LibTest/html/IFrameElement/outerHtml_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/html/IFrameElement/ownerDocument_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/html/IFrameElement/ownerDocument_A01_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/html/IFrameElement/ownerDocument_A01_t03: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/html/IFrameElement/ownerDocument_A01_t04: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/html/IFrameElement/ownerDocument_A01_t05: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/html/IFrameElement/paddingEdge_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/html/IFrameElement/parent_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/html/IFrameElement/parent_A01_t02: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/html/IFrameElement/parentNode_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/html/IFrameElement/previousElementSibling_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/html/IFrameElement/previousNode_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/html/IFrameElement/querySelector_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/html/IFrameElement/remove_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/html/IFrameElement/removeEventListener_A01_t01: Crash # unsupported element kind: _asyncCounter:field
+LibTest/html/IFrameElement/removeEventListener_A01_t02: Crash # unsupported element kind: _asyncCounter:field
+LibTest/html/IFrameElement/replaceWith_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/html/IFrameElement/resetEvent_A01_t01: Crash # unsupported element kind: _completer:field
+LibTest/html/IFrameElement/scrollEvent_A01_t01: Crash # unsupported element kind: _completer:field
+LibTest/html/IFrameElement/searchEvent_A01_t01: Crash # unsupported element kind: _completer:field
+LibTest/html/IFrameElement/selectEvent_A01_t01: Crash # unsupported element kind: _completer:field
+LibTest/html/IFrameElement/selectStartEvent_A01_t01: Crash # unsupported element kind: _completer:field
+LibTest/html/IFrameElement/setAttribute_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/html/IFrameElement/setAttributeNS_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/html/IFrameElement/setInnerHtml_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/html/IFrameElement/spellcheck_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/html/IFrameElement/spellcheck_A01_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/html/IFrameElement/style_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/html/IFrameElement/style_A01_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/html/IFrameElement/tabIndex_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/html/IFrameElement/tagName_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/html/IFrameElement/tagName_A01_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/html/IFrameElement/tagName_A01_t03: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/html/IFrameElement/text_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/html/IFrameElement/text_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/html/IFrameElement/text_A03_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/html/IFrameElement/text_A04_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/html/IFrameElement/text_setter_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/html/IFrameElement/title_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/html/IFrameElement/translate_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/html/Node/addEventListener_A01_t01: Crash # unsupported element kind: _completer:field
+LibTest/html/Node/addEventListener_A01_t02: Crash # unsupported element kind: _completer:field
+LibTest/html/Node/addEventListener_A01_t03: Crash # unsupported element kind: _completer:field
+LibTest/html/Node/addEventListener_A01_t04: Crash # unsupported element kind: _completer:field
+LibTest/html/Node/addEventListener_A01_t05: Crash # unsupported element kind: _completer:field
+LibTest/html/Node/append_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/html/Node/append_A01_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/html/Node/append_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/html/Node/childNodes_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/html/Node/childNodes_A01_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/html/Node/clone_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/html/Node/clone_A01_t02: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/html/Node/contains_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/html/Node/contains_A01_t02: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/html/Node/dispatchEvent_A01_t01: Crash # unsupported element kind: _completer:field
+LibTest/html/Node/firstChild_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/html/Node/hasChildNodes_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/html/Node/lastChild_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/html/Node/nextNode_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/html/Node/nodes_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/html/Node/nodes_A01_t02: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/html/Node/nodeType_A03_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/html/Node/nodeType_A04_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/html/Node/nodeType_A05_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/html/Node/nodeType_A06_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/html/Node/nodeType_A07_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/html/Node/nodeType_A12_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/html/Node/nodeValue_A03_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/html/Node/nodeValue_A04_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/html/Node/nodeValue_A05_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/html/Node/nodeValue_A06_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/html/Node/nodeValue_A07_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/html/Node/nodeValue_A12_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/html/Node/on_A01_t01: Crash # unsupported element kind: _completer:field
+LibTest/html/Node/ownerDocument_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/html/Node/parent_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/html/Node/parentNode_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/html/Node/previousNode_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/html/Node/remove_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/html/Node/removeEventListener_A01_t01: Crash # unsupported element kind: _completer:field
+LibTest/html/Node/removeEventListener_A01_t02: Crash # unsupported element kind: _completer:field
+LibTest/html/Node/replaceWith_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/html/Window/addEventListener_A01_t01: Crash # unsupported element kind: _completer:field
+LibTest/html/Window/animationFrame_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/html/Window/close_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/html/Window/dispatchEvent_A01_t01: Crash # unsupported element kind: _completer:field
+LibTest/html/Window/document_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/html/Window/find_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/html/Window/find_A01_t02: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/html/Window/find_A02_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/html/Window/find_A03_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/html/Window/find_A03_t02: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/html/Window/find_A04_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/html/Window/find_A05_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/html/Window/find_A06_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/html/Window/find_A07_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/html/Window/moveBy_A01_t01: Crash # not exactly one catch block
+LibTest/html/Window/moveTo_A01_t01: Crash # not exactly one catch block
+LibTest/html/Window/moveTo_A02_t01: Crash # not exactly one catch block
+LibTest/html/Window/open_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/html/Window/postMessage_A01_t01: Crash # unsupported element kind: _completer:field
+LibTest/html/Window/postMessage_A01_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/html/Window/removeEventListener_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/html/Window/requestFileSystem_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/html/Window/requestFileSystem_A01_t02: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/html/Window/requestFileSystem_A02_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/html/Window/resizeBy_A01_t01: Crash # not exactly one catch block
+LibTest/html/Window/resizeTo_A01_t01: Crash # not exactly one catch block
+LibTest/isolate/Isolate/spawn_A01_t01: Crash # unsupported element kind: _completer:field
+LibTest/isolate/Isolate/spawn_A01_t02: Crash # unsupported element kind: _completer:field
+LibTest/isolate/Isolate/spawn_A01_t03: Crash # unsupported element kind: _completer:field
+LibTest/isolate/Isolate/spawn_A01_t04: Crash # unsupported element kind: _completer:field
+LibTest/isolate/Isolate/spawn_A01_t05: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/isolate/Isolate/spawn_A02_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/isolate/Isolate/spawn_A02_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/isolate/Isolate/spawnUri_A01_t01: Crash # unsupported element kind: _completer:field
+LibTest/isolate/Isolate/spawnUri_A01_t02: Crash # unsupported element kind: _completer:field
+LibTest/isolate/Isolate/spawnUri_A01_t03: Crash # unsupported element kind: _completer:field
+LibTest/isolate/Isolate/spawnUri_A01_t04: Crash # unsupported element kind: _completer:field
+LibTest/isolate/Isolate/spawnUri_A01_t05: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/isolate/Isolate/spawnUri_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/isolate/Isolate/spawnUri_A02_t02: Crash # unsupported element kind: _completer:field
+LibTest/isolate/Isolate/spawnUri_A02_t03: Crash # unsupported element kind: _completer:field
+LibTest/isolate/Isolate/spawnUri_A02_t04: Crash # unsupported element kind: _completer:field
+LibTest/isolate/RawReceivePort/close_A01_t01: Crash # unsupported element kind: receivePort:field
+LibTest/isolate/RawReceivePort/handler_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/isolate/RawReceivePort/RawReceivePort_A01_t01: Crash # unsupported element kind: _completer:field
+LibTest/isolate/RawReceivePort/RawReceivePort_A01_t02: Crash # unsupported element kind: receivePort:field
+LibTest/isolate/RawReceivePort/sendPort_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/isolate/ReceivePort/any_A01_t01: Crash # unsupported element kind: _completer:field
+LibTest/isolate/ReceivePort/any_A01_t02: Crash # unsupported element kind: _completer:field
+LibTest/isolate/ReceivePort/asBroadcastStream_A01_t01: Crash # unsupported element kind: _completer:field
+LibTest/isolate/ReceivePort/asBroadcastStream_A01_t02: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/isolate/ReceivePort/asBroadcastStream_A01_t03: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/isolate/ReceivePort/asBroadcastStream_A01_t04: Crash # unsupported element kind: _completer:field
+LibTest/isolate/ReceivePort/asBroadcastStream_A03_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/isolate/ReceivePort/asBroadcastStream_A03_t02: Crash # unsupported element kind: _completer:field
+LibTest/isolate/ReceivePort/asBroadcastStream_A03_t03: Crash # unsupported element kind: _completer:field
+LibTest/isolate/ReceivePort/asBroadcastStream_A04_t01: Crash # unsupported element kind: _completer:field
+LibTest/isolate/ReceivePort/asBroadcastStream_A04_t02: Crash # unsupported element kind: _completer:field
+LibTest/isolate/ReceivePort/asBroadcastStream_A04_t03: Crash # unsupported element kind: _completer:field
+LibTest/isolate/ReceivePort/close_A01_t01: Crash # unsupported element kind: receivePort:field
+LibTest/isolate/ReceivePort/close_A02_t01: Crash # unsupported element kind: receivePort:field
+LibTest/isolate/ReceivePort/contains_A01_t01: Crash # unsupported element kind: _completer:field
+LibTest/isolate/ReceivePort/distinct_A01_t01: Crash # unsupported element kind: _completer:field
+LibTest/isolate/ReceivePort/distinct_A01_t02: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/isolate/ReceivePort/drain_A02_t01: Crash # Please triage this failure.
+LibTest/isolate/ReceivePort/drain_A02_t02: Crash # unsupported element kind: _completer:field
+LibTest/isolate/ReceivePort/elementAt_A01_t01: Crash # unsupported element kind: _completer:field
+LibTest/isolate/ReceivePort/elementAt_A03_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/isolate/ReceivePort/every_A01_t01: Crash # unsupported element kind: _completer:field
+LibTest/isolate/ReceivePort/expand_A01_t01: Crash # unsupported element kind: _completer:field
+LibTest/isolate/ReceivePort/first_A01_t01: Crash # unsupported element kind: _completer:field
+LibTest/isolate/ReceivePort/first_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/isolate/ReceivePort/first_A02_t02: Crash # unsupported element kind: _completer:field
+LibTest/isolate/ReceivePort/firstWhere_A01_t01: Crash # unsupported element kind: _completer:field
+LibTest/isolate/ReceivePort/firstWhere_A02_t01: Crash # unsupported element kind: _completer:field
+LibTest/isolate/ReceivePort/firstWhere_A03_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/isolate/ReceivePort/fold_A01_t01: Crash # unsupported element kind: _completer:field
+LibTest/isolate/ReceivePort/fold_A01_t02: Crash # unsupported element kind: _completer:field
+LibTest/isolate/ReceivePort/forEach_A01_t01: Crash # unsupported element kind: _completer:field
+LibTest/isolate/ReceivePort/isBroadcast_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/isolate/ReceivePort/isBroadcast_A01_t02: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/isolate/ReceivePort/isEmpty_A01_t01: Crash # unsupported element kind: _completer:field
+LibTest/isolate/ReceivePort/join_A01_t01: Crash # unsupported element kind: _completer:field
+LibTest/isolate/ReceivePort/join_A01_t02: Crash # unsupported element kind: _completer:field
+LibTest/isolate/ReceivePort/last_A01_t01: Crash # unsupported element kind: _completer:field
+LibTest/isolate/ReceivePort/last_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/isolate/ReceivePort/lastWhere_A01_t01: Crash # unsupported element kind: _completer:field
+LibTest/isolate/ReceivePort/lastWhere_A02_t01: Crash # unsupported element kind: _completer:field
+LibTest/isolate/ReceivePort/lastWhere_A04_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/isolate/ReceivePort/length_A01_t01: Crash # unsupported element kind: _completer:field
+LibTest/isolate/ReceivePort/listen_A01_t01: Crash # unsupported element kind: _completer:field
+LibTest/isolate/ReceivePort/map_A01_t01: Crash # unsupported element kind: _completer:field
+LibTest/isolate/ReceivePort/pipe_A01_t01: Crash # unsupported element kind: _completer:field
+LibTest/isolate/ReceivePort/ReceivePort_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/isolate/ReceivePort/ReceivePort.fromRawReceivePort_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/isolate/ReceivePort/ReceivePort.fromRawReceivePort_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/isolate/ReceivePort/reduce_A01_t01: Crash # unsupported element kind: _completer:field
+LibTest/isolate/ReceivePort/reduce_A01_t02: Crash # unsupported element kind: _completer:field
+LibTest/isolate/ReceivePort/reduce_A01_t03: Crash # unsupported element kind: _completer:field
+LibTest/isolate/ReceivePort/sendPort_A01_t01: Crash # (Expect): Error expression `Expect` unhandled.
+LibTest/isolate/ReceivePort/single_A01_t01: Crash # unsupported element kind: _completer:field
+LibTest/isolate/ReceivePort/single_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/isolate/ReceivePort/singleWhere_A01_t01: Crash # unsupported element kind: _completer:field
+LibTest/isolate/ReceivePort/singleWhere_A02_t01: Crash # unsupported element kind: _completer:field
+LibTest/isolate/ReceivePort/skip_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/isolate/ReceivePort/skipWhile_A01_t01: Crash # unsupported element kind: _completer:field
+LibTest/isolate/ReceivePort/take_A01_t01: Crash # unsupported element kind: _completer:field
+LibTest/isolate/ReceivePort/take_A01_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/isolate/ReceivePort/take_A01_t03: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/isolate/ReceivePort/takeWhile_A01_t01: Crash # unsupported element kind: _completer:field
+LibTest/isolate/ReceivePort/toList_A01_t01: Crash # unsupported element kind: _completer:field
+LibTest/isolate/ReceivePort/toSet_A01_t01: Crash # unsupported element kind: _completer:field
+LibTest/isolate/ReceivePort/transform_A01_t01: Crash # unsupported element kind: _completer:field
+LibTest/isolate/ReceivePort/transform_A01_t02: Crash # unsupported element kind: _completer:field
+LibTest/isolate/ReceivePort/where_A01_t01: Crash # unsupported element kind: _completer:field
+LibTest/isolate/ReceivePort/where_A01_t02: Crash # unsupported element kind: _completer:field
+LibTest/isolate/SendPort/hashCode_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/isolate/SendPort/operator_equality_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/isolate/SendPort/send_A01_t01: Crash # unsupported element kind: _completer:field
+LibTest/isolate/SendPort/send_A01_t02: Crash # unsupported element kind: _completer:field
+LibTest/isolate/SendPort/send_A01_t03: Crash # unsupported element kind: _completer:field
+LibTest/isolate/SendPort/send_A01_t04: Crash # unsupported element kind: _completer:field
+LibTest/isolate/SendPort/send_A02_t01: Crash # unsupported element kind: _completer:field
+LibTest/math/acos_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/math/acos_A02_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/math/acos_A03_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/math/asin_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/math/asin_A02_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/math/asin_A03_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/math/atan2_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/math/atan2_A01_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/math/atan2_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/math/atan2_A03_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/math/atan2_A04_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/math/atan2_A05_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/math/atan_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/math/atan_A01_t02: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/math/atan_A02_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/math/atan_A03_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/math/cos_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/math/cos_A02_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/math/cos_A03_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/math/exp_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/math/exp_A01_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/math/exp_A02_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/math/exp_A03_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/math/log_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/math/log_A02_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/math/log_A03_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/math/log_A04_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/math/max_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/math/max_A02_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/math/max_A03_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/math/min_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/math/min_A02_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/math/min_A03_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/math/MutableRectangle/boundingBox_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/math/MutableRectangle/boundingBox_A01_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/math/MutableRectangle/containsPoint_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/math/MutableRectangle/containsRectangle_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/math/MutableRectangle/intersection_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/math/MutableRectangle/intersects_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/math/MutableRectangle/MutableRectangle_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/math/MutableRectangle/MutableRectangle.fromPoints_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/math/MutableRectangle/operator_equality_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/math/MutableRectangle/operator_equality_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/math/MutableRectangle/operator_equality_A03_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/math/MutableRectangle/operator_equality_A04_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/math/Point/distanceTo_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/math/Point/magnitude_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/math/Point/operator_addition_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/math/Point/operator_addition_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/math/Point/operator_equality_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/math/Point/operator_equality_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/math/Point/operator_equality_A03_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/math/Point/operator_equality_A04_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/math/Point/operator_mult_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/math/Point/operator_mult_A02_t01: Crash # "on T" catch block
+LibTest/math/Point/operator_mult_A03_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/math/Point/operator_subtraction_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/math/Point/operator_subtraction_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/math/Point/Point_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/math/Point/squaredDistanceTo_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/math/Point/toString_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/math/pow_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/math/pow_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/math/pow_A02_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/math/pow_A03_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/math/pow_A04_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/math/pow_A05_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/math/pow_A06_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/math/pow_A07_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/math/pow_A08_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/math/pow_A09_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/math/pow_A10_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/math/pow_A11_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/math/pow_A12_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/math/pow_A13_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/math/pow_A14_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/math/pow_A15_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/math/pow_A16_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/math/pow_A17_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/math/Random/nextBool_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/math/Random/nextDouble_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/math/Random/nextInt_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/math/Random/Random_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/math/Rectangle/boundingBox_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/math/Rectangle/boundingBox_A01_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/math/Rectangle/containsPoint_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/math/Rectangle/containsRectangle_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/math/Rectangle/intersection_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/math/Rectangle/intersects_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/math/Rectangle/operator_equality_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/math/Rectangle/operator_equality_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/math/Rectangle/operator_equality_A03_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/math/Rectangle/operator_equality_A04_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/math/Rectangle/Rectangle_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/math/Rectangle/Rectangle.fromPoints_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/math/sin_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/math/sin_A01_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/math/sin_A02_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/math/sin_A03_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/math/sqrt_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/math/sqrt_A01_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/math/sqrt_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/math/sqrt_A02_t02: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/math/sqrt_A02_t03: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/math/sqrt_A03_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/math/tan_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/math/tan_A02_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/math/tan_A03_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/ByteBuffer/hashCode_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/typed_data/ByteBuffer/hashCode_A01_t02: Crash # "on T" catch block
+LibTest/typed_data/ByteBuffer/lengthInBytes_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/ByteBuffer/lengthInBytes_A01_t02: Crash # "on T" catch block
+LibTest/typed_data/ByteBuffer/operator_equality_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/typed_data/ByteBuffer/runtimeType_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/ByteBuffer/runtimeType_A01_t02: Crash # "on T" catch block
+LibTest/typed_data/ByteBuffer/toString_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/ByteData/buffer_A01_t01: Crash # (Expect.equal(byteBuffer,l.buffer)): Error expression `Expect.equal(byteBuffer,l.buffer)` unhandled.
+LibTest/typed_data/ByteData/buffer_A01_t02: Crash # "on T" catch block
+LibTest/typed_data/ByteData/ByteData_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/ByteData/ByteData_A01_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/ByteData/ByteData_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/ByteData/ByteData.view_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/ByteData/ByteData.view_A01_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/ByteData/ByteData.view_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/ByteData/ByteData.view_A03_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/ByteData/ByteData.view_A04_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/ByteData/ByteData.view_A05_t01: Crash # "on T" catch block
+LibTest/typed_data/ByteData/ByteData.view_A05_t02: Crash # "on T" catch block
+LibTest/typed_data/ByteData/ByteData.view_A05_t03: Crash # "on T" catch block
+LibTest/typed_data/ByteData/elementSizeInBytes_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/ByteData/elementSizeInBytes_A01_t02: Crash # "on T" catch block
+LibTest/typed_data/ByteData/getFloat32_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/typed_data/ByteData/getFloat32_A02_t01: Crash # "on T" catch block
+LibTest/typed_data/ByteData/getFloat32_A02_t02: Crash # "on T" catch block
+LibTest/typed_data/ByteData/getFloat64_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/typed_data/ByteData/getFloat64_A02_t01: Crash # "on T" catch block
+LibTest/typed_data/ByteData/getFloat64_A02_t02: Crash # "on T" catch block
+LibTest/typed_data/ByteData/getInt16_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/ByteData/getInt16_A02_t01: Crash # "on T" catch block
+LibTest/typed_data/ByteData/getInt16_A02_t02: Crash # "on T" catch block
+LibTest/typed_data/ByteData/getInt32_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/ByteData/getInt32_A02_t01: Crash # "on T" catch block
+LibTest/typed_data/ByteData/getInt32_A02_t02: Crash # "on T" catch block
+LibTest/typed_data/ByteData/getInt64_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/ByteData/getInt64_A02_t01: Crash # "on T" catch block
+LibTest/typed_data/ByteData/getInt64_A02_t02: Crash # "on T" catch block
+LibTest/typed_data/ByteData/getInt8_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/ByteData/getInt8_A02_t01: Crash # "on T" catch block
+LibTest/typed_data/ByteData/getInt8_A02_t02: Crash # "on T" catch block
+LibTest/typed_data/ByteData/getUint16_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/ByteData/getUint16_A02_t01: Crash # "on T" catch block
+LibTest/typed_data/ByteData/getUint16_A02_t02: Crash # "on T" catch block
+LibTest/typed_data/ByteData/getUint32_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/ByteData/getUint32_A02_t01: Crash # "on T" catch block
+LibTest/typed_data/ByteData/getUint32_A02_t02: Crash # "on T" catch block
+LibTest/typed_data/ByteData/getUint64_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/ByteData/getUint64_A02_t01: Crash # "on T" catch block
+LibTest/typed_data/ByteData/getUint64_A02_t02: Crash # "on T" catch block
+LibTest/typed_data/ByteData/getUint8_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/ByteData/getUint8_A02_t01: Crash # "on T" catch block
+LibTest/typed_data/ByteData/getUint8_A02_t02: Crash # "on T" catch block
+LibTest/typed_data/ByteData/hashCode_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/typed_data/ByteData/hashCode_A01_t02: Crash # "on T" catch block
+LibTest/typed_data/ByteData/lengthInBytes_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/ByteData/lengthInBytes_A01_t02: Crash # "on T" catch block
+LibTest/typed_data/ByteData/offsetInBytes_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/ByteData/offsetInBytes_A01_t02: Crash # "on T" catch block
+LibTest/typed_data/ByteData/operator_equality_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/typed_data/ByteData/runtimeType_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/ByteData/runtimeType_A01_t02: Crash # "on T" catch block
+LibTest/typed_data/ByteData/setFloat32_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/typed_data/ByteData/setFloat32_A02_t01: Crash # "on T" catch block
+LibTest/typed_data/ByteData/setFloat32_A02_t02: Crash # "on T" catch block
+LibTest/typed_data/ByteData/setFloat64_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/typed_data/ByteData/setFloat64_A02_t01: Crash # "on T" catch block
+LibTest/typed_data/ByteData/setFloat64_A02_t02: Crash # "on T" catch block
+LibTest/typed_data/ByteData/setInt16_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/ByteData/setInt16_A02_t01: Crash # "on T" catch block
+LibTest/typed_data/ByteData/setInt16_A02_t02: Crash # "on T" catch block
+LibTest/typed_data/ByteData/setInt32_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/ByteData/setInt32_A02_t01: Crash # "on T" catch block
+LibTest/typed_data/ByteData/setInt32_A02_t02: Crash # "on T" catch block
+LibTest/typed_data/ByteData/setInt64_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/ByteData/setInt64_A02_t01: Crash # "on T" catch block
+LibTest/typed_data/ByteData/setInt64_A02_t02: Crash # "on T" catch block
+LibTest/typed_data/ByteData/setInt8_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/ByteData/setInt8_A02_t01: Crash # "on T" catch block
+LibTest/typed_data/ByteData/setInt8_A02_t02: Crash # "on T" catch block
+LibTest/typed_data/ByteData/setUint16_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/ByteData/setUint16_A02_t01: Crash # "on T" catch block
+LibTest/typed_data/ByteData/setUint16_A02_t02: Crash # "on T" catch block
+LibTest/typed_data/ByteData/setUint32_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/ByteData/setUint32_A02_t01: Crash # "on T" catch block
+LibTest/typed_data/ByteData/setUint32_A02_t02: Crash # "on T" catch block
+LibTest/typed_data/ByteData/setUint64_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/ByteData/setUint64_A02_t01: Crash # "on T" catch block
+LibTest/typed_data/ByteData/setUint64_A02_t02: Crash # "on T" catch block
+LibTest/typed_data/ByteData/setUint8_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/ByteData/setUint8_A02_t01: Crash # "on T" catch block
+LibTest/typed_data/ByteData/setUint8_A02_t02: Crash # "on T" catch block
+LibTest/typed_data/ByteData/toString_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Float32List/add_A01_t01: Crash # "on T" catch block
+LibTest/typed_data/Float32List/addAll_A01_t01: Crash # "on T" catch block
+LibTest/typed_data/Float32List/any_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/typed_data/Float32List/asMap_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/typed_data/Float32List/asMap_A01_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Float32List/asMap_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Float32List/buffer_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Float32List/buffer_A01_t02: Crash # "on T" catch block
+LibTest/typed_data/Float32List/clear_A01_t01: Crash # "on T" catch block
+LibTest/typed_data/Float32List/contains_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/typed_data/Float32List/elementAt_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Float32List/elementAt_A02_t01: Crash # "on T" catch block
+LibTest/typed_data/Float32List/elementSizeInBytes_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Float32List/elementSizeInBytes_A01_t02: Crash # "on T" catch block
+LibTest/typed_data/Float32List/every_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/typed_data/Float32List/expand_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Float32List/fillRange_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Float32List/fillRange_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Float32List/first_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Float32List/first_A01_t02: Crash # "on T" catch block
+LibTest/typed_data/Float32List/first_A02_t01: Crash # (try {l.first;Expect.fail("StateError is expected");}on StateError catch (ok){}): "on T" catch block
+LibTest/typed_data/Float32List/first_A03_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Float32List/firstWhere_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Float32List/firstWhere_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Float32List/firstWhere_A03_t01: Crash # "on T" catch block
+LibTest/typed_data/Float32List/Float32List_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Float32List/Float32List_A01_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Float32List/Float32List_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Float32List/Float32List.fromList_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Float32List/Float32List.fromList_A01_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Float32List/Float32List.view_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Float32List/Float32List.view_A01_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Float32List/Float32List.view_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Float32List/Float32List.view_A03_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Float32List/Float32List.view_A04_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Float32List/Float32List.view_A05_t01: Crash # "on T" catch block
+LibTest/typed_data/Float32List/Float32List.view_A05_t02: Crash # "on T" catch block
+LibTest/typed_data/Float32List/Float32List.view_A05_t03: Crash # "on T" catch block
+LibTest/typed_data/Float32List/Float32List.view_A06_t01: Crash # "on T" catch block
+LibTest/typed_data/Float32List/fold_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Float32List/forEach_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Float32List/getRange_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Float32List/getRange_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Float32List/getRange_A03_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Float32List/getRange_A04_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Float32List/hashCode_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/typed_data/Float32List/hashCode_A01_t02: Crash # "on T" catch block
+LibTest/typed_data/Float32List/indexOf_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Float32List/indexOf_A01_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Float32List/indexOf_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Float32List/indexOf_A03_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Float32List/insert_A01_t01: Crash # "on T" catch block
+LibTest/typed_data/Float32List/insertAll_A01_t01: Crash # "on T" catch block
+LibTest/typed_data/Float32List/isEmpty_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/typed_data/Float32List/isEmpty_A01_t02: Crash # "on T" catch block
+LibTest/typed_data/Float32List/isNotEmpty_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/typed_data/Float32List/isNotEmpty_A01_t02: Crash # "on T" catch block
+LibTest/typed_data/Float32List/iterator_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Float32List/iterator_A01_t02: Crash # "on T" catch block
+LibTest/typed_data/Float32List/iterator_current_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Float32List/iterator_moveNext_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/typed_data/Float32List/join_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/typed_data/Float32List/join_A01_t02: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/typed_data/Float32List/last_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Float32List/last_A01_t02: Crash # "on T" catch block
+LibTest/typed_data/Float32List/last_A02_t01: Crash # (try {l.last;Expect.fail("StateError is expected");}on StateError catch (ok){}): "on T" catch block
+LibTest/typed_data/Float32List/lastIndexOf_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Float32List/lastIndexOf_A01_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Float32List/lastIndexOf_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Float32List/lastIndexOf_A03_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Float32List/lastWhere_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Float32List/lastWhere_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Float32List/lastWhere_A03_t01: Crash # "on T" catch block
+LibTest/typed_data/Float32List/length_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Float32List/length_A02_t01: Crash # "on T" catch block
+LibTest/typed_data/Float32List/lengthInBytes_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Float32List/lengthInBytes_A01_t02: Crash # "on T" catch block
+LibTest/typed_data/Float32List/map_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Float32List/map_A02_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/typed_data/Float32List/map_A03_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Float32List/offsetInBytes_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Float32List/offsetInBytes_A01_t02: Crash # "on T" catch block
+LibTest/typed_data/Float32List/operator_equality_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/typed_data/Float32List/operator_subscript_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/typed_data/Float32List/operator_subscript_A02_t01: Crash # (try {l[-1];Expect.fail("RangeError is expected");}on RangeError catch (ok){}): "on T" catch block
+LibTest/typed_data/Float32List/operator_subscripted_assignment_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/typed_data/Float32List/operator_subscripted_assignment_A02_t01: Crash # "on T" catch block
+LibTest/typed_data/Float32List/reduce_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Float32List/reduce_A02_t01: Crash # "on T" catch block
+LibTest/typed_data/Float32List/remove_A01_t01: Crash # "on T" catch block
+LibTest/typed_data/Float32List/removeAt_A01_t01: Crash # "on T" catch block
+LibTest/typed_data/Float32List/removeLast_A01_t01: Crash # "on T" catch block
+LibTest/typed_data/Float32List/removeRange_A01_t01: Crash # "on T" catch block
+LibTest/typed_data/Float32List/removeWhere_A01_t01: Crash # "on T" catch block
+LibTest/typed_data/Float32List/replaceRange_A01_t01: Crash # "on T" catch block
+LibTest/typed_data/Float32List/retainWhere_A01_t01: Crash # "on T" catch block
+LibTest/typed_data/Float32List/reversed_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Float32List/reversed_A01_t02: Crash # "on T" catch block
+LibTest/typed_data/Float32List/runtimeType_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Float32List/runtimeType_A01_t02: Crash # "on T" catch block
+LibTest/typed_data/Float32List/setAll_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Float32List/setAll_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Float32List/setAll_A03_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Float32List/setRange_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Float32List/setRange_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Float32List/setRange_A03_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Float32List/setRange_A04_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Float32List/single_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Float32List/single_A01_t02: Crash # "on T" catch block
+LibTest/typed_data/Float32List/single_A02_t01: Crash # "on T" catch block
+LibTest/typed_data/Float32List/single_A02_t02: Crash # "on T" catch block
+LibTest/typed_data/Float32List/singleWhere_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Float32List/singleWhere_A02_t01: Crash # "on T" catch block
+LibTest/typed_data/Float32List/singleWhere_A02_t02: Crash # "on T" catch block
+LibTest/typed_data/Float32List/skip_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Float32List/skip_A02_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/typed_data/Float32List/skip_A03_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Float32List/skipWhile_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Float32List/skipWhile_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Float32List/skipWhile_A03_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Float32List/skipWhile_A04_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Float32List/sort_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Float32List/sublist_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Float32List/sublist_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Float32List/sublist_A03_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Float32List/sublist_A03_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Float32List/take_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Float32List/take_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Float32List/take_A03_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Float32List/takeWhile_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Float32List/takeWhile_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Float32List/takeWhile_A03_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Float32List/takeWhile_A04_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Float32List/toList_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Float32List/toList_A02_t01: Crash # "on T" catch block
+LibTest/typed_data/Float32List/toList_A02_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Float32List/toSet_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/typed_data/Float32List/toString_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Float32List/where_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Float32List/where_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Float32List/where_A03_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Float32x4/abs_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/typed_data/Float32x4/clamp_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Float32x4/clamp_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Float32x4/Float32x4_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Float32x4/Float32x4_A01_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Float32x4/Float32x4.fromInt32x4Bits_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Float32x4/Float32x4.fromInt32x4Bits_A01_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Float32x4/Float32x4.splat_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Float32x4/Float32x4.splat_A01_t02: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/typed_data/Float32x4/Float32x4.zero_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Float32x4List/add_A01_t01: Crash # "on T" catch block
+LibTest/typed_data/Float32x4List/addAll_A01_t01: Crash # "on T" catch block
+LibTest/typed_data/Float32x4List/any_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/typed_data/Float32x4List/asMap_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Float32x4List/asMap_A01_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Float32x4List/asMap_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Float32x4List/buffer_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Float32x4List/buffer_A01_t02: Crash # "on T" catch block
+LibTest/typed_data/Float32x4List/clear_A01_t01: Crash # "on T" catch block
+LibTest/typed_data/Float32x4List/contains_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/typed_data/Float32x4List/elementAt_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Float32x4List/elementAt_A02_t01: Crash # "on T" catch block
+LibTest/typed_data/Float32x4List/elementSizeInBytes_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Float32x4List/elementSizeInBytes_A01_t02: Crash # "on T" catch block
+LibTest/typed_data/Float32x4List/every_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/typed_data/Float32x4List/expand_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Float32x4List/fillRange_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/typed_data/Float32x4List/fillRange_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Float32x4List/first_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/typed_data/Float32x4List/first_A01_t02: Crash # "on T" catch block
+LibTest/typed_data/Float32x4List/first_A02_t01: Crash # (try {l.first;Expect.fail("StateError is expected");}on StateError catch (ok){}): "on T" catch block
+LibTest/typed_data/Float32x4List/first_A03_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/typed_data/Float32x4List/firstWhere_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/typed_data/Float32x4List/firstWhere_A02_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/typed_data/Float32x4List/firstWhere_A03_t01: Crash # "on T" catch block
+LibTest/typed_data/Float32x4List/Float32x4List_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Float32x4List/Float32x4List_A01_t02: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/typed_data/Float32x4List/Float32x4List_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Float32x4List/Float32x4List.fromList_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Float32x4List/Float32x4List.fromList_A01_t02: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/typed_data/Float32x4List/Float32x4List.view_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Float32x4List/Float32x4List.view_A01_t02: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/typed_data/Float32x4List/Float32x4List.view_A02_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/typed_data/Float32x4List/Float32x4List.view_A03_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/typed_data/Float32x4List/Float32x4List.view_A04_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/typed_data/Float32x4List/Float32x4List.view_A05_t01: Crash # "on T" catch block
+LibTest/typed_data/Float32x4List/Float32x4List.view_A05_t02: Crash # "on T" catch block
+LibTest/typed_data/Float32x4List/Float32x4List.view_A05_t03: Crash # "on T" catch block
+LibTest/typed_data/Float32x4List/Float32x4List.view_A06_t01: Crash # "on T" catch block
+LibTest/typed_data/Float32x4List/fold_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Float32x4List/forEach_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/typed_data/Float32x4List/getRange_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/typed_data/Float32x4List/getRange_A02_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/typed_data/Float32x4List/getRange_A03_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Float32x4List/getRange_A04_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Float32x4List/hashCode_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/typed_data/Float32x4List/hashCode_A01_t02: Crash # "on T" catch block
+LibTest/typed_data/Float32x4List/indexOf_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Float32x4List/indexOf_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Float32x4List/insert_A01_t01: Crash # "on T" catch block
+LibTest/typed_data/Float32x4List/insertAll_A01_t01: Crash # "on T" catch block
+LibTest/typed_data/Float32x4List/isEmpty_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/typed_data/Float32x4List/isEmpty_A01_t02: Crash # "on T" catch block
+LibTest/typed_data/Float32x4List/isNotEmpty_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/typed_data/Float32x4List/isNotEmpty_A01_t02: Crash # "on T" catch block
+LibTest/typed_data/Float32x4List/iterator_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Float32x4List/iterator_A01_t02: Crash # "on T" catch block
+LibTest/typed_data/Float32x4List/iterator_current_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/typed_data/Float32x4List/iterator_moveNext_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/typed_data/Float32x4List/join_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/typed_data/Float32x4List/join_A01_t02: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/typed_data/Float32x4List/last_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/typed_data/Float32x4List/last_A01_t02: Crash # "on T" catch block
+LibTest/typed_data/Float32x4List/last_A02_t01: Crash # (try {l.last;Expect.fail("StateError is expected");}on StateError catch (ok){}): "on T" catch block
+LibTest/typed_data/Float32x4List/lastIndexOf_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Float32x4List/lastIndexOf_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Float32x4List/lastWhere_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/typed_data/Float32x4List/lastWhere_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Float32x4List/lastWhere_A03_t01: Crash # "on T" catch block
+LibTest/typed_data/Float32x4List/length_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Float32x4List/length_A02_t01: Crash # "on T" catch block
+LibTest/typed_data/Float32x4List/lengthInBytes_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Float32x4List/lengthInBytes_A01_t02: Crash # "on T" catch block
+LibTest/typed_data/Float32x4List/map_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Float32x4List/map_A02_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/typed_data/Float32x4List/map_A03_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Float32x4List/offsetInBytes_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Float32x4List/offsetInBytes_A01_t02: Crash # "on T" catch block
+LibTest/typed_data/Float32x4List/operator_equality_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/typed_data/Float32x4List/operator_subscript_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/typed_data/Float32x4List/operator_subscript_A02_t01: Crash # (try {l[-1];Expect.fail("RangeError is expected");}on RangeError catch (ok){}): "on T" catch block
+LibTest/typed_data/Float32x4List/operator_subscripted_assignment_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/typed_data/Float32x4List/operator_subscripted_assignment_A02_t01: Crash # "on T" catch block
+LibTest/typed_data/Float32x4List/reduce_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Float32x4List/reduce_A02_t01: Crash # "on T" catch block
+LibTest/typed_data/Float32x4List/remove_A01_t01: Crash # "on T" catch block
+LibTest/typed_data/Float32x4List/removeAt_A01_t01: Crash # "on T" catch block
+LibTest/typed_data/Float32x4List/removeLast_A01_t01: Crash # "on T" catch block
+LibTest/typed_data/Float32x4List/removeRange_A01_t01: Crash # "on T" catch block
+LibTest/typed_data/Float32x4List/removeWhere_A01_t01: Crash # "on T" catch block
+LibTest/typed_data/Float32x4List/replaceRange_A01_t01: Crash # "on T" catch block
+LibTest/typed_data/Float32x4List/retainWhere_A01_t01: Crash # "on T" catch block
+LibTest/typed_data/Float32x4List/reversed_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/typed_data/Float32x4List/reversed_A01_t02: Crash # "on T" catch block
+LibTest/typed_data/Float32x4List/runtimeType_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Float32x4List/runtimeType_A01_t02: Crash # "on T" catch block
+LibTest/typed_data/Float32x4List/setAll_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/typed_data/Float32x4List/setAll_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Float32x4List/setAll_A03_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Float32x4List/setRange_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/typed_data/Float32x4List/setRange_A02_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/typed_data/Float32x4List/setRange_A03_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Float32x4List/setRange_A04_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Float32x4List/single_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/typed_data/Float32x4List/single_A01_t02: Crash # "on T" catch block
+LibTest/typed_data/Float32x4List/single_A02_t01: Crash # "on T" catch block
+LibTest/typed_data/Float32x4List/single_A02_t02: Crash # "on T" catch block
+LibTest/typed_data/Float32x4List/singleWhere_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/typed_data/Float32x4List/singleWhere_A02_t01: Crash # "on T" catch block
+LibTest/typed_data/Float32x4List/singleWhere_A02_t02: Crash # "on T" catch block
+LibTest/typed_data/Float32x4List/skip_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/typed_data/Float32x4List/skip_A02_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/typed_data/Float32x4List/skip_A03_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Float32x4List/skipWhile_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/typed_data/Float32x4List/skipWhile_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Float32x4List/skipWhile_A03_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Float32x4List/skipWhile_A04_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/typed_data/Float32x4List/sort_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/typed_data/Float32x4List/sublist_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/typed_data/Float32x4List/sublist_A02_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/typed_data/Float32x4List/sublist_A03_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Float32x4List/sublist_A03_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Float32x4List/take_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/typed_data/Float32x4List/take_A02_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/typed_data/Float32x4List/take_A03_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Float32x4List/takeWhile_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Float32x4List/takeWhile_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Float32x4List/takeWhile_A03_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Float32x4List/takeWhile_A04_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/typed_data/Float32x4List/toList_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/typed_data/Float32x4List/toList_A02_t01: Crash # "on T" catch block
+LibTest/typed_data/Float32x4List/toList_A02_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Float32x4List/toSet_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/typed_data/Float32x4List/toString_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Float32x4List/where_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Float32x4List/where_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Float32x4List/where_A03_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Float32x4/max_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Float32x4/min_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Float32x4/operator_addition_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/typed_data/Float32x4/operator_division_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/typed_data/Float32x4/operator_division_A01_t02: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/typed_data/Float32x4/operator_multiplication_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/typed_data/Float32x4/operator_subtraction_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/typed_data/Float32x4/operator_unary_minus_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/typed_data/Float32x4/reciprocal_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/typed_data/Float32x4/reciprocalSqrt_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/typed_data/Float32x4/scale_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/typed_data/Float32x4/shuffle_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Float32x4/shuffleMix_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Float32x4/sqrt_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/typed_data/Float32x4/w_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/typed_data/Float32x4/w_A01_t02: Crash # "on T" catch block
+LibTest/typed_data/Float32x4/withW_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/typed_data/Float32x4/withX_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/typed_data/Float32x4/withY_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/typed_data/Float32x4/withZ_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/typed_data/Float32x4/x_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/typed_data/Float32x4/x_A01_t02: Crash # "on T" catch block
+LibTest/typed_data/Float32x4/y_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/typed_data/Float32x4/y_A01_t02: Crash # "on T" catch block
+LibTest/typed_data/Float32x4/z_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/typed_data/Float32x4/z_A01_t02: Crash # "on T" catch block
+LibTest/typed_data/Float64List/add_A01_t01: Crash # "on T" catch block
+LibTest/typed_data/Float64List/addAll_A01_t01: Crash # "on T" catch block
+LibTest/typed_data/Float64List/any_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/typed_data/Float64List/asMap_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/typed_data/Float64List/asMap_A01_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Float64List/asMap_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Float64List/buffer_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Float64List/buffer_A01_t02: Crash # "on T" catch block
+LibTest/typed_data/Float64List/clear_A01_t01: Crash # "on T" catch block
+LibTest/typed_data/Float64List/contains_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/typed_data/Float64List/elementAt_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Float64List/elementAt_A02_t01: Crash # "on T" catch block
+LibTest/typed_data/Float64List/elementSizeInBytes_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Float64List/elementSizeInBytes_A01_t02: Crash # "on T" catch block
+LibTest/typed_data/Float64List/every_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/typed_data/Float64List/expand_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Float64List/fillRange_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Float64List/fillRange_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Float64List/first_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Float64List/first_A01_t02: Crash # "on T" catch block
+LibTest/typed_data/Float64List/first_A02_t01: Crash # (try {l.first;Expect.fail("StateError is expected");}on StateError catch (ok){}): "on T" catch block
+LibTest/typed_data/Float64List/first_A03_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Float64List/firstWhere_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Float64List/firstWhere_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Float64List/firstWhere_A03_t01: Crash # "on T" catch block
+LibTest/typed_data/Float64List/Float64List_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Float64List/Float64List_A01_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Float64List/Float64List_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Float64List/Float64List.fromList_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Float64List/Float64List.fromList_A01_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Float64List/Float64List.view_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Float64List/Float64List.view_A01_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Float64List/Float64List.view_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Float64List/Float64List.view_A03_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Float64List/Float64List.view_A04_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Float64List/Float64List.view_A05_t01: Crash # "on T" catch block
+LibTest/typed_data/Float64List/Float64List.view_A05_t02: Crash # "on T" catch block
+LibTest/typed_data/Float64List/Float64List.view_A05_t03: Crash # "on T" catch block
+LibTest/typed_data/Float64List/Float64List.view_A06_t01: Crash # "on T" catch block
+LibTest/typed_data/Float64List/fold_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Float64List/forEach_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Float64List/getRange_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Float64List/getRange_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Float64List/getRange_A03_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Float64List/getRange_A04_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Float64List/hashCode_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/typed_data/Float64List/hashCode_A01_t02: Crash # "on T" catch block
+LibTest/typed_data/Float64List/indexOf_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Float64List/indexOf_A01_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Float64List/indexOf_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Float64List/indexOf_A03_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Float64List/insert_A01_t01: Crash # "on T" catch block
+LibTest/typed_data/Float64List/insertAll_A01_t01: Crash # "on T" catch block
+LibTest/typed_data/Float64List/isEmpty_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/typed_data/Float64List/isEmpty_A01_t02: Crash # "on T" catch block
+LibTest/typed_data/Float64List/isNotEmpty_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/typed_data/Float64List/isNotEmpty_A01_t02: Crash # "on T" catch block
+LibTest/typed_data/Float64List/iterator_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Float64List/iterator_A01_t02: Crash # "on T" catch block
+LibTest/typed_data/Float64List/iterator_current_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Float64List/iterator_moveNext_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/typed_data/Float64List/join_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/typed_data/Float64List/join_A01_t02: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/typed_data/Float64List/last_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Float64List/last_A01_t02: Crash # "on T" catch block
+LibTest/typed_data/Float64List/last_A02_t01: Crash # (try {l.last;Expect.fail("StateError is expected");}on StateError catch (ok){}): "on T" catch block
+LibTest/typed_data/Float64List/lastIndexOf_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Float64List/lastIndexOf_A01_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Float64List/lastIndexOf_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Float64List/lastIndexOf_A03_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Float64List/lastWhere_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Float64List/lastWhere_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Float64List/lastWhere_A03_t01: Crash # "on T" catch block
+LibTest/typed_data/Float64List/length_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Float64List/length_A02_t01: Crash # "on T" catch block
+LibTest/typed_data/Float64List/lengthInBytes_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Float64List/lengthInBytes_A01_t02: Crash # "on T" catch block
+LibTest/typed_data/Float64List/map_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Float64List/map_A02_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/typed_data/Float64List/map_A03_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Float64List/offsetInBytes_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Float64List/offsetInBytes_A01_t02: Crash # "on T" catch block
+LibTest/typed_data/Float64List/operator_equality_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/typed_data/Float64List/operator_subscript_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/typed_data/Float64List/operator_subscript_A02_t01: Crash # (try {l[-1];Expect.fail("RangeError is expected");}on RangeError catch (ok){}): "on T" catch block
+LibTest/typed_data/Float64List/operator_subscripted_assignment_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/typed_data/Float64List/operator_subscripted_assignment_A02_t01: Crash # "on T" catch block
+LibTest/typed_data/Float64List/reduce_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Float64List/reduce_A02_t01: Crash # "on T" catch block
+LibTest/typed_data/Float64List/remove_A01_t01: Crash # "on T" catch block
+LibTest/typed_data/Float64List/removeAt_A01_t01: Crash # "on T" catch block
+LibTest/typed_data/Float64List/removeLast_A01_t01: Crash # "on T" catch block
+LibTest/typed_data/Float64List/removeRange_A01_t01: Crash # "on T" catch block
+LibTest/typed_data/Float64List/removeWhere_A01_t01: Crash # "on T" catch block
+LibTest/typed_data/Float64List/replaceRange_A01_t01: Crash # "on T" catch block
+LibTest/typed_data/Float64List/retainWhere_A01_t01: Crash # "on T" catch block
+LibTest/typed_data/Float64List/reversed_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Float64List/reversed_A01_t02: Crash # "on T" catch block
+LibTest/typed_data/Float64List/runtimeType_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Float64List/runtimeType_A01_t02: Crash # "on T" catch block
+LibTest/typed_data/Float64List/setAll_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Float64List/setAll_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Float64List/setAll_A03_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Float64List/setRange_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Float64List/setRange_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Float64List/setRange_A03_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Float64List/setRange_A04_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Float64List/single_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Float64List/single_A01_t02: Crash # "on T" catch block
+LibTest/typed_data/Float64List/single_A02_t01: Crash # "on T" catch block
+LibTest/typed_data/Float64List/single_A02_t02: Crash # "on T" catch block
+LibTest/typed_data/Float64List/singleWhere_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Float64List/singleWhere_A02_t01: Crash # "on T" catch block
+LibTest/typed_data/Float64List/singleWhere_A02_t02: Crash # "on T" catch block
+LibTest/typed_data/Float64List/skip_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Float64List/skip_A02_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/typed_data/Float64List/skip_A03_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Float64List/skipWhile_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Float64List/skipWhile_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Float64List/skipWhile_A03_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Float64List/skipWhile_A04_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Float64List/sort_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Float64List/sublist_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Float64List/sublist_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Float64List/sublist_A03_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Float64List/sublist_A03_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Float64List/take_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Float64List/take_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Float64List/take_A03_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Float64List/takeWhile_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Float64List/takeWhile_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Float64List/takeWhile_A03_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Float64List/takeWhile_A04_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Float64List/toList_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Float64List/toList_A02_t01: Crash # "on T" catch block
+LibTest/typed_data/Float64List/toList_A02_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Float64List/toSet_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/typed_data/Float64List/toString_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Float64List/where_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Float64List/where_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Float64List/where_A03_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int16List/add_A01_t01: Crash # "on T" catch block
+LibTest/typed_data/Int16List/addAll_A01_t01: Crash # "on T" catch block
+LibTest/typed_data/Int16List/any_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/typed_data/Int16List/asMap_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/typed_data/Int16List/asMap_A01_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int16List/asMap_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int16List/buffer_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int16List/buffer_A01_t02: Crash # "on T" catch block
+LibTest/typed_data/Int16List/clear_A01_t01: Crash # "on T" catch block
+LibTest/typed_data/Int16List/contains_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/typed_data/Int16List/elementAt_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int16List/elementAt_A02_t01: Crash # "on T" catch block
+LibTest/typed_data/Int16List/elementSizeInBytes_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int16List/elementSizeInBytes_A01_t02: Crash # "on T" catch block
+LibTest/typed_data/Int16List/every_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/typed_data/Int16List/expand_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int16List/fillRange_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int16List/fillRange_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int16List/first_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int16List/first_A01_t02: Crash # "on T" catch block
+LibTest/typed_data/Int16List/first_A02_t01: Crash # (try {l.first;Expect.fail("StateError is expected");}on StateError catch (ok){}): "on T" catch block
+LibTest/typed_data/Int16List/first_A03_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int16List/firstWhere_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int16List/firstWhere_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int16List/firstWhere_A03_t01: Crash # "on T" catch block
+LibTest/typed_data/Int16List/fold_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int16List/forEach_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int16List/getRange_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int16List/getRange_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int16List/getRange_A03_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int16List/getRange_A04_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int16List/hashCode_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/typed_data/Int16List/hashCode_A01_t02: Crash # "on T" catch block
+LibTest/typed_data/Int16List/indexOf_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int16List/indexOf_A01_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int16List/indexOf_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int16List/indexOf_A03_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int16List/insert_A01_t01: Crash # "on T" catch block
+LibTest/typed_data/Int16List/insertAll_A01_t01: Crash # "on T" catch block
+LibTest/typed_data/Int16List/Int16List_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int16List/Int16List_A01_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int16List/Int16List_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int16List/Int16List.fromList_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int16List/Int16List.fromList_A01_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int16List/Int16List.view_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int16List/Int16List.view_A01_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int16List/Int16List.view_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int16List/Int16List.view_A03_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int16List/Int16List.view_A04_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int16List/Int16List.view_A05_t01: Crash # "on T" catch block
+LibTest/typed_data/Int16List/Int16List.view_A05_t02: Crash # "on T" catch block
+LibTest/typed_data/Int16List/Int16List.view_A05_t03: Crash # "on T" catch block
+LibTest/typed_data/Int16List/Int16List.view_A06_t01: Crash # "on T" catch block
+LibTest/typed_data/Int16List/isEmpty_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/typed_data/Int16List/isEmpty_A01_t02: Crash # "on T" catch block
+LibTest/typed_data/Int16List/isNotEmpty_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/typed_data/Int16List/isNotEmpty_A01_t02: Crash # "on T" catch block
+LibTest/typed_data/Int16List/iterator_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int16List/iterator_A01_t02: Crash # "on T" catch block
+LibTest/typed_data/Int16List/iterator_current_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int16List/iterator_moveNext_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/typed_data/Int16List/join_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/typed_data/Int16List/join_A01_t02: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/typed_data/Int16List/last_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int16List/last_A01_t02: Crash # "on T" catch block
+LibTest/typed_data/Int16List/last_A02_t01: Crash # (try {l.last;Expect.fail("StateError is expected");}on StateError catch (ok){}): "on T" catch block
+LibTest/typed_data/Int16List/lastIndexOf_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int16List/lastIndexOf_A01_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int16List/lastIndexOf_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int16List/lastIndexOf_A03_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int16List/lastWhere_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int16List/lastWhere_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int16List/lastWhere_A03_t01: Crash # "on T" catch block
+LibTest/typed_data/Int16List/length_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int16List/length_A02_t01: Crash # "on T" catch block
+LibTest/typed_data/Int16List/lengthInBytes_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int16List/lengthInBytes_A01_t02: Crash # "on T" catch block
+LibTest/typed_data/Int16List/map_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int16List/map_A02_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/typed_data/Int16List/map_A03_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int16List/offsetInBytes_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int16List/offsetInBytes_A01_t02: Crash # "on T" catch block
+LibTest/typed_data/Int16List/operator_equality_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/typed_data/Int16List/operator_subscript_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/typed_data/Int16List/operator_subscript_A02_t01: Crash # (try {l[-1];Expect.fail("RangeError is expected");}on RangeError catch (ok){}): "on T" catch block
+LibTest/typed_data/Int16List/operator_subscripted_assignment_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/typed_data/Int16List/operator_subscripted_assignment_A02_t01: Crash # (try {l[-1]=1;Expect.fail("RangeError is expected");}on RangeError catch (ok){}): "on T" catch block
+LibTest/typed_data/Int16List/reduce_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int16List/reduce_A02_t01: Crash # "on T" catch block
+LibTest/typed_data/Int16List/remove_A01_t01: Crash # "on T" catch block
+LibTest/typed_data/Int16List/removeAt_A01_t01: Crash # "on T" catch block
+LibTest/typed_data/Int16List/removeLast_A01_t01: Crash # "on T" catch block
+LibTest/typed_data/Int16List/removeRange_A01_t01: Crash # "on T" catch block
+LibTest/typed_data/Int16List/removeWhere_A01_t01: Crash # "on T" catch block
+LibTest/typed_data/Int16List/replaceRange_A01_t01: Crash # "on T" catch block
+LibTest/typed_data/Int16List/retainWhere_A01_t01: Crash # "on T" catch block
+LibTest/typed_data/Int16List/reversed_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int16List/reversed_A01_t02: Crash # "on T" catch block
+LibTest/typed_data/Int16List/runtimeType_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int16List/runtimeType_A01_t02: Crash # "on T" catch block
+LibTest/typed_data/Int16List/setAll_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int16List/setAll_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int16List/setAll_A03_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int16List/setRange_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int16List/setRange_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int16List/setRange_A03_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int16List/setRange_A04_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int16List/single_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int16List/single_A01_t02: Crash # "on T" catch block
+LibTest/typed_data/Int16List/single_A02_t01: Crash # "on T" catch block
+LibTest/typed_data/Int16List/single_A02_t02: Crash # "on T" catch block
+LibTest/typed_data/Int16List/singleWhere_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int16List/singleWhere_A02_t01: Crash # "on T" catch block
+LibTest/typed_data/Int16List/singleWhere_A02_t02: Crash # "on T" catch block
+LibTest/typed_data/Int16List/skip_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int16List/skip_A02_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/typed_data/Int16List/skip_A03_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int16List/skipWhile_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int16List/skipWhile_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int16List/skipWhile_A03_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int16List/skipWhile_A04_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int16List/sort_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int16List/sublist_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int16List/sublist_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int16List/sublist_A03_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int16List/sublist_A03_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int16List/take_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int16List/take_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int16List/take_A03_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int16List/takeWhile_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int16List/takeWhile_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int16List/takeWhile_A03_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int16List/takeWhile_A04_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int16List/toList_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int16List/toList_A02_t01: Crash # "on T" catch block
+LibTest/typed_data/Int16List/toList_A02_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int16List/toSet_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/typed_data/Int16List/toString_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int16List/where_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int16List/where_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int16List/where_A03_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int32List/add_A01_t01: Crash # "on T" catch block
+LibTest/typed_data/Int32List/addAll_A01_t01: Crash # "on T" catch block
+LibTest/typed_data/Int32List/any_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/typed_data/Int32List/asMap_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/typed_data/Int32List/asMap_A01_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int32List/asMap_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int32List/buffer_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int32List/buffer_A01_t02: Crash # "on T" catch block
+LibTest/typed_data/Int32List/clear_A01_t01: Crash # "on T" catch block
+LibTest/typed_data/Int32List/contains_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/typed_data/Int32List/elementAt_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int32List/elementAt_A02_t01: Crash # "on T" catch block
+LibTest/typed_data/Int32List/elementSizeInBytes_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int32List/elementSizeInBytes_A01_t02: Crash # "on T" catch block
+LibTest/typed_data/Int32List/every_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/typed_data/Int32List/expand_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int32List/fillRange_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int32List/fillRange_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int32List/first_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int32List/first_A01_t02: Crash # "on T" catch block
+LibTest/typed_data/Int32List/first_A02_t01: Crash # (try {l.first;Expect.fail("StateError is expected");}on StateError catch (ok){}): "on T" catch block
+LibTest/typed_data/Int32List/first_A03_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int32List/firstWhere_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int32List/firstWhere_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int32List/firstWhere_A03_t01: Crash # "on T" catch block
+LibTest/typed_data/Int32List/fold_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int32List/forEach_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int32List/getRange_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int32List/getRange_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int32List/getRange_A03_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int32List/getRange_A04_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int32List/hashCode_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/typed_data/Int32List/hashCode_A01_t02: Crash # "on T" catch block
+LibTest/typed_data/Int32List/indexOf_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int32List/indexOf_A01_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int32List/indexOf_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int32List/indexOf_A03_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int32List/insert_A01_t01: Crash # "on T" catch block
+LibTest/typed_data/Int32List/insertAll_A01_t01: Crash # "on T" catch block
+LibTest/typed_data/Int32List/Int32List_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int32List/Int32List_A01_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int32List/Int32List_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int32List/Int32List.fromList_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int32List/Int32List.fromList_A01_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int32List/Int32List.view_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int32List/Int32List.view_A01_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int32List/Int32List.view_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int32List/Int32List.view_A03_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int32List/Int32List.view_A04_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int32List/Int32List.view_A05_t01: Crash # "on T" catch block
+LibTest/typed_data/Int32List/Int32List.view_A05_t02: Crash # "on T" catch block
+LibTest/typed_data/Int32List/Int32List.view_A05_t03: Crash # "on T" catch block
+LibTest/typed_data/Int32List/Int32List.view_A06_t01: Crash # "on T" catch block
+LibTest/typed_data/Int32List/isEmpty_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/typed_data/Int32List/isEmpty_A01_t02: Crash # "on T" catch block
+LibTest/typed_data/Int32List/isNotEmpty_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/typed_data/Int32List/isNotEmpty_A01_t02: Crash # "on T" catch block
+LibTest/typed_data/Int32List/iterator_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int32List/iterator_A01_t02: Crash # "on T" catch block
+LibTest/typed_data/Int32List/iterator_current_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int32List/iterator_moveNext_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/typed_data/Int32List/join_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/typed_data/Int32List/join_A01_t02: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/typed_data/Int32List/last_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int32List/last_A01_t02: Crash # "on T" catch block
+LibTest/typed_data/Int32List/last_A02_t01: Crash # (try {l.last;Expect.fail("StateError is expected");}on StateError catch (ok){}): "on T" catch block
+LibTest/typed_data/Int32List/lastIndexOf_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int32List/lastIndexOf_A01_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int32List/lastIndexOf_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int32List/lastIndexOf_A03_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int32List/lastWhere_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int32List/lastWhere_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int32List/lastWhere_A03_t01: Crash # "on T" catch block
+LibTest/typed_data/Int32List/length_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int32List/length_A02_t01: Crash # "on T" catch block
+LibTest/typed_data/Int32List/lengthInBytes_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int32List/lengthInBytes_A01_t02: Crash # "on T" catch block
+LibTest/typed_data/Int32List/map_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int32List/map_A02_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/typed_data/Int32List/map_A03_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int32List/offsetInBytes_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int32List/offsetInBytes_A01_t02: Crash # "on T" catch block
+LibTest/typed_data/Int32List/operator_equality_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/typed_data/Int32List/operator_subscript_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/typed_data/Int32List/operator_subscript_A02_t01: Crash # (try {l[-1];Expect.fail("RangeError is expected");}on RangeError catch (ok){}): "on T" catch block
+LibTest/typed_data/Int32List/operator_subscripted_assignment_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/typed_data/Int32List/operator_subscripted_assignment_A02_t01: Crash # (try {l[-1]=1;Expect.fail("RangeError is expected");}on RangeError catch (ok){}): "on T" catch block
+LibTest/typed_data/Int32List/reduce_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int32List/reduce_A02_t01: Crash # "on T" catch block
+LibTest/typed_data/Int32List/remove_A01_t01: Crash # "on T" catch block
+LibTest/typed_data/Int32List/removeAt_A01_t01: Crash # "on T" catch block
+LibTest/typed_data/Int32List/removeLast_A01_t01: Crash # "on T" catch block
+LibTest/typed_data/Int32List/removeRange_A01_t01: Crash # "on T" catch block
+LibTest/typed_data/Int32List/removeWhere_A01_t01: Crash # "on T" catch block
+LibTest/typed_data/Int32List/replaceRange_A01_t01: Crash # "on T" catch block
+LibTest/typed_data/Int32List/retainWhere_A01_t01: Crash # "on T" catch block
+LibTest/typed_data/Int32List/reversed_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int32List/reversed_A01_t02: Crash # "on T" catch block
+LibTest/typed_data/Int32List/runtimeType_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int32List/runtimeType_A01_t02: Crash # "on T" catch block
+LibTest/typed_data/Int32List/setAll_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int32List/setAll_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int32List/setAll_A03_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int32List/setRange_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int32List/setRange_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int32List/setRange_A03_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int32List/setRange_A04_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int32List/single_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int32List/single_A01_t02: Crash # "on T" catch block
+LibTest/typed_data/Int32List/single_A02_t01: Crash # "on T" catch block
+LibTest/typed_data/Int32List/single_A02_t02: Crash # "on T" catch block
+LibTest/typed_data/Int32List/singleWhere_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int32List/singleWhere_A02_t01: Crash # "on T" catch block
+LibTest/typed_data/Int32List/singleWhere_A02_t02: Crash # "on T" catch block
+LibTest/typed_data/Int32List/skip_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int32List/skip_A02_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/typed_data/Int32List/skip_A03_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int32List/skipWhile_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int32List/skipWhile_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int32List/skipWhile_A03_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int32List/skipWhile_A04_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int32List/sort_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int32List/sublist_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int32List/sublist_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int32List/sublist_A03_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int32List/sublist_A03_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int32List/take_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int32List/take_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int32List/take_A03_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int32List/takeWhile_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int32List/takeWhile_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int32List/takeWhile_A03_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int32List/takeWhile_A04_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int32List/toList_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int32List/toList_A02_t01: Crash # "on T" catch block
+LibTest/typed_data/Int32List/toList_A02_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int32List/toSet_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/typed_data/Int32List/toString_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int32List/where_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int32List/where_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int32List/where_A03_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int32x4/flagW_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/typed_data/Int32x4/flagW_A01_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int32x4/flagW_A01_t03: Crash # "on T" catch block
+LibTest/typed_data/Int32x4/flagX_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/typed_data/Int32x4/flagX_A01_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int32x4/flagX_A01_t03: Crash # "on T" catch block
+LibTest/typed_data/Int32x4/flagY_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/typed_data/Int32x4/flagY_A01_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int32x4/flagY_A01_t03: Crash # "on T" catch block
+LibTest/typed_data/Int32x4/flagZ_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/typed_data/Int32x4/flagZ_A01_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int32x4/flagZ_A01_t03: Crash # "on T" catch block
+LibTest/typed_data/Int32x4/Int32x4_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int32x4/Int32x4.bool_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int32x4/Int32x4.fromFloat32x4Bits_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int32x4/Int32x4.fromFloat32x4Bits_A01_t02: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/typed_data/Int32x4/operator_AND_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int32x4/operator_OR_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int32x4/operator_XOR_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int32x4/select_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int32x4/w_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int32x4/w_A01_t02: Crash # "on T" catch block
+LibTest/typed_data/Int32x4/withFlagW_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int32x4/withFlagX_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int32x4/withFlagY_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int32x4/withFlagZ_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int32x4/withW_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int32x4/withX_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int32x4/withY_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int32x4/withZ_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int32x4/x_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int32x4/x_A01_t02: Crash # "on T" catch block
+LibTest/typed_data/Int32x4/y_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int32x4/y_A01_t02: Crash # "on T" catch block
+LibTest/typed_data/Int32x4/z_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int32x4/z_A01_t02: Crash # "on T" catch block
+LibTest/typed_data/Int64List/add_A01_t01: Crash # "on T" catch block
+LibTest/typed_data/Int64List/addAll_A01_t01: Crash # "on T" catch block
+LibTest/typed_data/Int64List/any_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/typed_data/Int64List/asMap_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/typed_data/Int64List/asMap_A01_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int64List/asMap_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int64List/buffer_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int64List/buffer_A01_t02: Crash # "on T" catch block
+LibTest/typed_data/Int64List/clear_A01_t01: Crash # "on T" catch block
+LibTest/typed_data/Int64List/contains_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/typed_data/Int64List/elementAt_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int64List/elementAt_A02_t01: Crash # "on T" catch block
+LibTest/typed_data/Int64List/elementSizeInBytes_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int64List/elementSizeInBytes_A01_t02: Crash # "on T" catch block
+LibTest/typed_data/Int64List/every_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/typed_data/Int64List/expand_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int64List/fillRange_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int64List/fillRange_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int64List/first_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int64List/first_A01_t02: Crash # "on T" catch block
+LibTest/typed_data/Int64List/first_A02_t01: Crash # (try {l.first;Expect.fail("StateError is expected");}on StateError catch (ok){}): "on T" catch block
+LibTest/typed_data/Int64List/first_A03_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int64List/firstWhere_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int64List/firstWhere_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int64List/firstWhere_A03_t01: Crash # "on T" catch block
+LibTest/typed_data/Int64List/fold_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int64List/forEach_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int64List/getRange_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int64List/getRange_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int64List/getRange_A03_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int64List/getRange_A04_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int64List/hashCode_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/typed_data/Int64List/hashCode_A01_t02: Crash # "on T" catch block
+LibTest/typed_data/Int64List/indexOf_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int64List/indexOf_A01_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int64List/indexOf_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int64List/indexOf_A03_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int64List/insert_A01_t01: Crash # "on T" catch block
+LibTest/typed_data/Int64List/insertAll_A01_t01: Crash # "on T" catch block
+LibTest/typed_data/Int64List/Int64List_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int64List/Int64List_A01_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int64List/Int64List_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int64List/Int64List.fromList_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int64List/Int64List.fromList_A01_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int64List/Int64List.view_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int64List/Int64List.view_A01_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int64List/Int64List.view_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int64List/Int64List.view_A03_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int64List/Int64List.view_A04_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int64List/Int64List.view_A05_t01: Crash # "on T" catch block
+LibTest/typed_data/Int64List/Int64List.view_A05_t02: Crash # "on T" catch block
+LibTest/typed_data/Int64List/Int64List.view_A05_t03: Crash # "on T" catch block
+LibTest/typed_data/Int64List/Int64List.view_A06_t01: Crash # "on T" catch block
+LibTest/typed_data/Int64List/isEmpty_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/typed_data/Int64List/isEmpty_A01_t02: Crash # "on T" catch block
+LibTest/typed_data/Int64List/isNotEmpty_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/typed_data/Int64List/isNotEmpty_A01_t02: Crash # "on T" catch block
+LibTest/typed_data/Int64List/iterator_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int64List/iterator_A01_t02: Crash # "on T" catch block
+LibTest/typed_data/Int64List/iterator_current_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int64List/iterator_moveNext_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/typed_data/Int64List/join_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/typed_data/Int64List/join_A01_t02: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/typed_data/Int64List/last_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int64List/last_A01_t02: Crash # "on T" catch block
+LibTest/typed_data/Int64List/last_A02_t01: Crash # (try {l.last;Expect.fail("StateError is expected");}on StateError catch (ok){}): "on T" catch block
+LibTest/typed_data/Int64List/lastIndexOf_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int64List/lastIndexOf_A01_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int64List/lastIndexOf_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int64List/lastIndexOf_A03_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int64List/lastWhere_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int64List/lastWhere_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int64List/lastWhere_A03_t01: Crash # "on T" catch block
+LibTest/typed_data/Int64List/length_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int64List/length_A02_t01: Crash # "on T" catch block
+LibTest/typed_data/Int64List/lengthInBytes_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int64List/lengthInBytes_A01_t02: Crash # "on T" catch block
+LibTest/typed_data/Int64List/map_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int64List/map_A02_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/typed_data/Int64List/map_A03_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int64List/offsetInBytes_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int64List/offsetInBytes_A01_t02: Crash # "on T" catch block
+LibTest/typed_data/Int64List/operator_equality_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/typed_data/Int64List/operator_subscript_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/typed_data/Int64List/operator_subscript_A02_t01: Crash # (try {l[-1];Expect.fail("RangeError is expected");}on RangeError catch (ok){}): "on T" catch block
+LibTest/typed_data/Int64List/operator_subscripted_assignment_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/typed_data/Int64List/operator_subscripted_assignment_A02_t01: Crash # (try {l[-1]=1;Expect.fail("RangeError is expected");}on RangeError catch (ok){}): "on T" catch block
+LibTest/typed_data/Int64List/reduce_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int64List/reduce_A02_t01: Crash # "on T" catch block
+LibTest/typed_data/Int64List/remove_A01_t01: Crash # "on T" catch block
+LibTest/typed_data/Int64List/removeAt_A01_t01: Crash # "on T" catch block
+LibTest/typed_data/Int64List/removeLast_A01_t01: Crash # "on T" catch block
+LibTest/typed_data/Int64List/removeRange_A01_t01: Crash # "on T" catch block
+LibTest/typed_data/Int64List/removeWhere_A01_t01: Crash # "on T" catch block
+LibTest/typed_data/Int64List/replaceRange_A01_t01: Crash # "on T" catch block
+LibTest/typed_data/Int64List/retainWhere_A01_t01: Crash # "on T" catch block
+LibTest/typed_data/Int64List/reversed_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int64List/reversed_A01_t02: Crash # "on T" catch block
+LibTest/typed_data/Int64List/runtimeType_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int64List/runtimeType_A01_t02: Crash # "on T" catch block
+LibTest/typed_data/Int64List/setAll_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int64List/setAll_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int64List/setAll_A03_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int64List/setRange_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int64List/setRange_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int64List/setRange_A03_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int64List/setRange_A04_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int64List/single_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int64List/single_A01_t02: Crash # "on T" catch block
+LibTest/typed_data/Int64List/single_A02_t01: Crash # "on T" catch block
+LibTest/typed_data/Int64List/single_A02_t02: Crash # "on T" catch block
+LibTest/typed_data/Int64List/singleWhere_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int64List/singleWhere_A02_t01: Crash # "on T" catch block
+LibTest/typed_data/Int64List/singleWhere_A02_t02: Crash # "on T" catch block
+LibTest/typed_data/Int64List/skip_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int64List/skip_A02_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/typed_data/Int64List/skip_A03_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int64List/skipWhile_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int64List/skipWhile_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int64List/skipWhile_A03_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int64List/skipWhile_A04_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int64List/sort_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int64List/sublist_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int64List/sublist_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int64List/sublist_A03_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int64List/sublist_A03_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int64List/take_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int64List/take_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int64List/take_A03_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int64List/takeWhile_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int64List/takeWhile_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int64List/takeWhile_A03_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int64List/takeWhile_A04_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int64List/toList_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int64List/toList_A02_t01: Crash # "on T" catch block
+LibTest/typed_data/Int64List/toList_A02_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int64List/toSet_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/typed_data/Int64List/toString_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int64List/where_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int64List/where_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int64List/where_A03_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int8List/add_A01_t01: Crash # "on T" catch block
+LibTest/typed_data/Int8List/addAll_A01_t01: Crash # "on T" catch block
+LibTest/typed_data/Int8List/any_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/typed_data/Int8List/asMap_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/typed_data/Int8List/asMap_A01_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int8List/asMap_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int8List/buffer_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int8List/buffer_A01_t02: Crash # "on T" catch block
+LibTest/typed_data/Int8List/clear_A01_t01: Crash # "on T" catch block
+LibTest/typed_data/Int8List/contains_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/typed_data/Int8List/elementAt_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int8List/elementAt_A02_t01: Crash # "on T" catch block
+LibTest/typed_data/Int8List/elementSizeInBytes_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int8List/elementSizeInBytes_A01_t02: Crash # "on T" catch block
+LibTest/typed_data/Int8List/every_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/typed_data/Int8List/expand_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int8List/fillRange_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int8List/fillRange_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int8List/first_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int8List/first_A01_t02: Crash # "on T" catch block
+LibTest/typed_data/Int8List/first_A02_t01: Crash # (try {l.first;Expect.fail("StateError is expected");}on StateError catch (ok){}): "on T" catch block
+LibTest/typed_data/Int8List/first_A03_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int8List/firstWhere_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int8List/firstWhere_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int8List/firstWhere_A03_t01: Crash # "on T" catch block
+LibTest/typed_data/Int8List/fold_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int8List/forEach_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int8List/getRange_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int8List/getRange_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int8List/getRange_A03_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int8List/getRange_A04_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int8List/hashCode_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/typed_data/Int8List/hashCode_A01_t02: Crash # "on T" catch block
+LibTest/typed_data/Int8List/indexOf_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int8List/indexOf_A01_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int8List/indexOf_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int8List/indexOf_A03_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int8List/insert_A01_t01: Crash # "on T" catch block
+LibTest/typed_data/Int8List/insertAll_A01_t01: Crash # "on T" catch block
+LibTest/typed_data/Int8List/Int8List_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int8List/Int8List_A01_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int8List/Int8List_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int8List/Int8List.fromList_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int8List/Int8List.fromList_A01_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int8List/Int8List.view_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int8List/Int8List.view_A01_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int8List/Int8List.view_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int8List/Int8List.view_A03_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int8List/Int8List.view_A04_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int8List/Int8List.view_A05_t01: Crash # "on T" catch block
+LibTest/typed_data/Int8List/Int8List.view_A05_t02: Crash # "on T" catch block
+LibTest/typed_data/Int8List/Int8List.view_A05_t03: Crash # "on T" catch block
+LibTest/typed_data/Int8List/isEmpty_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/typed_data/Int8List/isEmpty_A01_t02: Crash # "on T" catch block
+LibTest/typed_data/Int8List/isNotEmpty_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/typed_data/Int8List/isNotEmpty_A01_t02: Crash # "on T" catch block
+LibTest/typed_data/Int8List/iterator_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int8List/iterator_A01_t02: Crash # "on T" catch block
+LibTest/typed_data/Int8List/iterator_current_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int8List/iterator_moveNext_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/typed_data/Int8List/join_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/typed_data/Int8List/join_A01_t02: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/typed_data/Int8List/last_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int8List/last_A01_t02: Crash # "on T" catch block
+LibTest/typed_data/Int8List/last_A02_t01: Crash # (try {l.last;Expect.fail("StateError is expected");}on StateError catch (ok){}): "on T" catch block
+LibTest/typed_data/Int8List/lastIndexOf_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int8List/lastIndexOf_A01_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int8List/lastIndexOf_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int8List/lastIndexOf_A03_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int8List/lastWhere_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int8List/lastWhere_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int8List/lastWhere_A03_t01: Crash # "on T" catch block
+LibTest/typed_data/Int8List/length_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int8List/length_A02_t01: Crash # "on T" catch block
+LibTest/typed_data/Int8List/lengthInBytes_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int8List/lengthInBytes_A01_t02: Crash # "on T" catch block
+LibTest/typed_data/Int8List/map_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int8List/map_A02_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/typed_data/Int8List/map_A03_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int8List/offsetInBytes_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int8List/offsetInBytes_A01_t02: Crash # "on T" catch block
+LibTest/typed_data/Int8List/operator_equality_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/typed_data/Int8List/operator_subscript_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/typed_data/Int8List/operator_subscript_A02_t01: Crash # (try {l[-1];Expect.fail("RangeError is expected");}on RangeError catch (ok){}): "on T" catch block
+LibTest/typed_data/Int8List/operator_subscripted_assignment_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/typed_data/Int8List/operator_subscripted_assignment_A02_t01: Crash # (try {l[-1]=1;Expect.fail("RangeError is expected");}on RangeError catch (ok){}): "on T" catch block
+LibTest/typed_data/Int8List/reduce_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int8List/reduce_A02_t01: Crash # "on T" catch block
+LibTest/typed_data/Int8List/remove_A01_t01: Crash # "on T" catch block
+LibTest/typed_data/Int8List/removeAt_A01_t01: Crash # "on T" catch block
+LibTest/typed_data/Int8List/removeLast_A01_t01: Crash # "on T" catch block
+LibTest/typed_data/Int8List/removeRange_A01_t01: Crash # "on T" catch block
+LibTest/typed_data/Int8List/removeWhere_A01_t01: Crash # "on T" catch block
+LibTest/typed_data/Int8List/replaceRange_A01_t01: Crash # "on T" catch block
+LibTest/typed_data/Int8List/retainWhere_A01_t01: Crash # "on T" catch block
+LibTest/typed_data/Int8List/reversed_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int8List/reversed_A01_t02: Crash # "on T" catch block
+LibTest/typed_data/Int8List/runtimeType_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int8List/runtimeType_A01_t02: Crash # "on T" catch block
+LibTest/typed_data/Int8List/setAll_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int8List/setAll_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int8List/setAll_A03_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int8List/setRange_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int8List/setRange_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int8List/setRange_A03_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int8List/setRange_A04_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int8List/single_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int8List/single_A01_t02: Crash # "on T" catch block
+LibTest/typed_data/Int8List/single_A02_t01: Crash # "on T" catch block
+LibTest/typed_data/Int8List/single_A02_t02: Crash # "on T" catch block
+LibTest/typed_data/Int8List/singleWhere_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int8List/singleWhere_A02_t01: Crash # "on T" catch block
+LibTest/typed_data/Int8List/singleWhere_A02_t02: Crash # "on T" catch block
+LibTest/typed_data/Int8List/skip_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int8List/skip_A02_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/typed_data/Int8List/skip_A03_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int8List/skipWhile_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int8List/skipWhile_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int8List/skipWhile_A03_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int8List/skipWhile_A04_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int8List/sort_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int8List/sublist_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int8List/sublist_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int8List/sublist_A03_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int8List/sublist_A03_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int8List/take_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int8List/take_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int8List/take_A03_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int8List/takeWhile_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int8List/takeWhile_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int8List/takeWhile_A03_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int8List/takeWhile_A04_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int8List/toList_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int8List/toList_A02_t01: Crash # "on T" catch block
+LibTest/typed_data/Int8List/toList_A02_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int8List/toSet_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/typed_data/Int8List/toString_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int8List/where_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int8List/where_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Int8List/where_A03_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint16List/add_A01_t01: Crash # "on T" catch block
+LibTest/typed_data/Uint16List/addAll_A01_t01: Crash # "on T" catch block
+LibTest/typed_data/Uint16List/any_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/typed_data/Uint16List/asMap_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/typed_data/Uint16List/asMap_A01_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint16List/asMap_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint16List/buffer_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint16List/buffer_A01_t02: Crash # "on T" catch block
+LibTest/typed_data/Uint16List/clear_A01_t01: Crash # "on T" catch block
+LibTest/typed_data/Uint16List/contains_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/typed_data/Uint16List/elementAt_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint16List/elementAt_A02_t01: Crash # "on T" catch block
+LibTest/typed_data/Uint16List/elementSizeInBytes_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint16List/elementSizeInBytes_A01_t02: Crash # "on T" catch block
+LibTest/typed_data/Uint16List/every_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/typed_data/Uint16List/expand_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint16List/fillRange_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint16List/fillRange_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint16List/first_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint16List/first_A01_t02: Crash # "on T" catch block
+LibTest/typed_data/Uint16List/first_A02_t01: Crash # (try {l.first;Expect.fail("StateError is expected");}on StateError catch (ok){}): "on T" catch block
+LibTest/typed_data/Uint16List/first_A03_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint16List/firstWhere_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint16List/firstWhere_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint16List/firstWhere_A03_t01: Crash # "on T" catch block
+LibTest/typed_data/Uint16List/fold_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint16List/forEach_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint16List/getRange_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint16List/getRange_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint16List/getRange_A03_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint16List/getRange_A04_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint16List/hashCode_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/typed_data/Uint16List/hashCode_A01_t02: Crash # "on T" catch block
+LibTest/typed_data/Uint16List/indexOf_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint16List/indexOf_A01_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint16List/indexOf_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint16List/indexOf_A03_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint16List/insert_A01_t01: Crash # "on T" catch block
+LibTest/typed_data/Uint16List/insertAll_A01_t01: Crash # "on T" catch block
+LibTest/typed_data/Uint16List/isEmpty_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/typed_data/Uint16List/isEmpty_A01_t02: Crash # "on T" catch block
+LibTest/typed_data/Uint16List/isNotEmpty_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/typed_data/Uint16List/isNotEmpty_A01_t02: Crash # "on T" catch block
+LibTest/typed_data/Uint16List/iterator_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint16List/iterator_A01_t02: Crash # "on T" catch block
+LibTest/typed_data/Uint16List/iterator_current_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint16List/iterator_moveNext_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/typed_data/Uint16List/join_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/typed_data/Uint16List/join_A01_t02: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/typed_data/Uint16List/last_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint16List/last_A01_t02: Crash # "on T" catch block
+LibTest/typed_data/Uint16List/last_A02_t01: Crash # (try {l.last;Expect.fail("StateError is expected");}on StateError catch (ok){}): "on T" catch block
+LibTest/typed_data/Uint16List/lastIndexOf_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint16List/lastIndexOf_A01_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint16List/lastIndexOf_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint16List/lastIndexOf_A03_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint16List/lastWhere_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint16List/lastWhere_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint16List/lastWhere_A03_t01: Crash # "on T" catch block
+LibTest/typed_data/Uint16List/length_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint16List/length_A02_t01: Crash # "on T" catch block
+LibTest/typed_data/Uint16List/lengthInBytes_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint16List/lengthInBytes_A01_t02: Crash # "on T" catch block
+LibTest/typed_data/Uint16List/map_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint16List/map_A02_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/typed_data/Uint16List/map_A03_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint16List/offsetInBytes_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint16List/offsetInBytes_A01_t02: Crash # "on T" catch block
+LibTest/typed_data/Uint16List/operator_equality_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/typed_data/Uint16List/operator_subscript_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/typed_data/Uint16List/operator_subscript_A02_t01: Crash # (try {l[-1];Expect.fail("RangeError is expected");}on RangeError catch (ok){}): "on T" catch block
+LibTest/typed_data/Uint16List/operator_subscripted_assignment_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/typed_data/Uint16List/operator_subscripted_assignment_A02_t01: Crash # (try {l[-1]=1;Expect.fail("RangeError is expected");}on RangeError catch (ok){}): "on T" catch block
+LibTest/typed_data/Uint16List/reduce_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint16List/reduce_A02_t01: Crash # "on T" catch block
+LibTest/typed_data/Uint16List/remove_A01_t01: Crash # "on T" catch block
+LibTest/typed_data/Uint16List/removeAt_A01_t01: Crash # "on T" catch block
+LibTest/typed_data/Uint16List/removeLast_A01_t01: Crash # "on T" catch block
+LibTest/typed_data/Uint16List/removeRange_A01_t01: Crash # "on T" catch block
+LibTest/typed_data/Uint16List/removeWhere_A01_t01: Crash # "on T" catch block
+LibTest/typed_data/Uint16List/replaceRange_A01_t01: Crash # "on T" catch block
+LibTest/typed_data/Uint16List/retainWhere_A01_t01: Crash # "on T" catch block
+LibTest/typed_data/Uint16List/reversed_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint16List/reversed_A01_t02: Crash # "on T" catch block
+LibTest/typed_data/Uint16List/runtimeType_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint16List/runtimeType_A01_t02: Crash # "on T" catch block
+LibTest/typed_data/Uint16List/setAll_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint16List/setAll_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint16List/setAll_A03_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint16List/setRange_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint16List/setRange_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint16List/setRange_A03_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint16List/setRange_A04_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint16List/single_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint16List/single_A01_t02: Crash # "on T" catch block
+LibTest/typed_data/Uint16List/single_A02_t01: Crash # "on T" catch block
+LibTest/typed_data/Uint16List/single_A02_t02: Crash # "on T" catch block
+LibTest/typed_data/Uint16List/singleWhere_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint16List/singleWhere_A02_t01: Crash # "on T" catch block
+LibTest/typed_data/Uint16List/singleWhere_A02_t02: Crash # "on T" catch block
+LibTest/typed_data/Uint16List/skip_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint16List/skip_A02_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/typed_data/Uint16List/skip_A03_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint16List/skipWhile_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint16List/skipWhile_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint16List/skipWhile_A03_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint16List/skipWhile_A04_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint16List/sort_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint16List/sublist_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint16List/sublist_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint16List/sublist_A03_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint16List/sublist_A03_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint16List/take_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint16List/take_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint16List/take_A03_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint16List/takeWhile_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint16List/takeWhile_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint16List/takeWhile_A03_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint16List/takeWhile_A04_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint16List/toList_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint16List/toList_A02_t01: Crash # "on T" catch block
+LibTest/typed_data/Uint16List/toList_A02_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint16List/toSet_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/typed_data/Uint16List/toString_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint16List/Uint16List_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint16List/Uint16List_A01_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint16List/Uint16List_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint16List/Uint16List.fromList_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint16List/Uint16List.fromList_A01_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint16List/Uint16List.view_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint16List/Uint16List.view_A01_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint16List/Uint16List.view_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint16List/Uint16List.view_A03_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint16List/Uint16List.view_A04_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint16List/Uint16List.view_A05_t01: Crash # "on T" catch block
+LibTest/typed_data/Uint16List/Uint16List.view_A05_t02: Crash # "on T" catch block
+LibTest/typed_data/Uint16List/Uint16List.view_A05_t03: Crash # "on T" catch block
+LibTest/typed_data/Uint16List/Uint16List.view_A06_t01: Crash # "on T" catch block
+LibTest/typed_data/Uint16List/where_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint16List/where_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint16List/where_A03_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint32List/add_A01_t01: Crash # "on T" catch block
+LibTest/typed_data/Uint32List/addAll_A01_t01: Crash # "on T" catch block
+LibTest/typed_data/Uint32List/any_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/typed_data/Uint32List/asMap_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/typed_data/Uint32List/asMap_A01_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint32List/asMap_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint32List/buffer_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint32List/buffer_A01_t02: Crash # "on T" catch block
+LibTest/typed_data/Uint32List/clear_A01_t01: Crash # "on T" catch block
+LibTest/typed_data/Uint32List/contains_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/typed_data/Uint32List/elementAt_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint32List/elementAt_A02_t01: Crash # "on T" catch block
+LibTest/typed_data/Uint32List/elementSizeInBytes_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint32List/elementSizeInBytes_A01_t02: Crash # "on T" catch block
+LibTest/typed_data/Uint32List/every_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/typed_data/Uint32List/expand_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint32List/fillRange_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint32List/fillRange_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint32List/first_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint32List/first_A01_t02: Crash # "on T" catch block
+LibTest/typed_data/Uint32List/first_A02_t01: Crash # (try {l.first;Expect.fail("StateError is expected");}on StateError catch (ok){}): "on T" catch block
+LibTest/typed_data/Uint32List/first_A03_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint32List/firstWhere_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint32List/firstWhere_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint32List/firstWhere_A03_t01: Crash # "on T" catch block
+LibTest/typed_data/Uint32List/fold_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint32List/forEach_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint32List/getRange_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint32List/getRange_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint32List/getRange_A03_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint32List/getRange_A04_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint32List/hashCode_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/typed_data/Uint32List/hashCode_A01_t02: Crash # "on T" catch block
+LibTest/typed_data/Uint32List/indexOf_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint32List/indexOf_A01_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint32List/indexOf_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint32List/indexOf_A03_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint32List/insert_A01_t01: Crash # "on T" catch block
+LibTest/typed_data/Uint32List/insertAll_A01_t01: Crash # "on T" catch block
+LibTest/typed_data/Uint32List/isEmpty_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/typed_data/Uint32List/isEmpty_A01_t02: Crash # "on T" catch block
+LibTest/typed_data/Uint32List/isNotEmpty_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/typed_data/Uint32List/isNotEmpty_A01_t02: Crash # "on T" catch block
+LibTest/typed_data/Uint32List/iterator_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint32List/iterator_A01_t02: Crash # "on T" catch block
+LibTest/typed_data/Uint32List/iterator_current_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint32List/iterator_moveNext_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/typed_data/Uint32List/join_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/typed_data/Uint32List/join_A01_t02: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/typed_data/Uint32List/last_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint32List/last_A01_t02: Crash # "on T" catch block
+LibTest/typed_data/Uint32List/last_A02_t01: Crash # (try {l.last;Expect.fail("StateError is expected");}on StateError catch (ok){}): "on T" catch block
+LibTest/typed_data/Uint32List/lastIndexOf_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint32List/lastIndexOf_A01_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint32List/lastIndexOf_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint32List/lastIndexOf_A03_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint32List/lastWhere_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint32List/lastWhere_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint32List/lastWhere_A03_t01: Crash # "on T" catch block
+LibTest/typed_data/Uint32List/length_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint32List/length_A02_t01: Crash # "on T" catch block
+LibTest/typed_data/Uint32List/lengthInBytes_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint32List/lengthInBytes_A01_t02: Crash # "on T" catch block
+LibTest/typed_data/Uint32List/map_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint32List/map_A02_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/typed_data/Uint32List/map_A03_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint32List/offsetInBytes_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint32List/offsetInBytes_A01_t02: Crash # "on T" catch block
+LibTest/typed_data/Uint32List/operator_equality_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/typed_data/Uint32List/operator_subscript_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/typed_data/Uint32List/operator_subscript_A02_t01: Crash # (try {l[-1];Expect.fail("RangeError is expected");}on RangeError catch (ok){}): "on T" catch block
+LibTest/typed_data/Uint32List/operator_subscripted_assignment_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/typed_data/Uint32List/operator_subscripted_assignment_A02_t01: Crash # (try {l[-1]=1;Expect.fail("RangeError is expected");}on RangeError catch (ok){}): "on T" catch block
+LibTest/typed_data/Uint32List/reduce_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint32List/reduce_A02_t01: Crash # "on T" catch block
+LibTest/typed_data/Uint32List/remove_A01_t01: Crash # "on T" catch block
+LibTest/typed_data/Uint32List/removeAt_A01_t01: Crash # "on T" catch block
+LibTest/typed_data/Uint32List/removeLast_A01_t01: Crash # "on T" catch block
+LibTest/typed_data/Uint32List/removeRange_A01_t01: Crash # "on T" catch block
+LibTest/typed_data/Uint32List/removeWhere_A01_t01: Crash # "on T" catch block
+LibTest/typed_data/Uint32List/replaceRange_A01_t01: Crash # "on T" catch block
+LibTest/typed_data/Uint32List/retainWhere_A01_t01: Crash # "on T" catch block
+LibTest/typed_data/Uint32List/reversed_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint32List/reversed_A01_t02: Crash # "on T" catch block
+LibTest/typed_data/Uint32List/runtimeType_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint32List/runtimeType_A01_t02: Crash # "on T" catch block
+LibTest/typed_data/Uint32List/setAll_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint32List/setAll_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint32List/setAll_A03_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint32List/setRange_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint32List/setRange_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint32List/setRange_A03_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint32List/setRange_A04_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint32List/single_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint32List/single_A01_t02: Crash # "on T" catch block
+LibTest/typed_data/Uint32List/single_A02_t01: Crash # "on T" catch block
+LibTest/typed_data/Uint32List/single_A02_t02: Crash # "on T" catch block
+LibTest/typed_data/Uint32List/singleWhere_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint32List/singleWhere_A02_t01: Crash # "on T" catch block
+LibTest/typed_data/Uint32List/singleWhere_A02_t02: Crash # "on T" catch block
+LibTest/typed_data/Uint32List/skip_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint32List/skip_A02_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/typed_data/Uint32List/skip_A03_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint32List/skipWhile_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint32List/skipWhile_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint32List/skipWhile_A03_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint32List/skipWhile_A04_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint32List/sort_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint32List/sublist_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint32List/sublist_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint32List/sublist_A03_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint32List/sublist_A03_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint32List/take_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint32List/take_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint32List/take_A03_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint32List/takeWhile_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint32List/takeWhile_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint32List/takeWhile_A03_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint32List/takeWhile_A04_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint32List/toList_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint32List/toList_A02_t01: Crash # "on T" catch block
+LibTest/typed_data/Uint32List/toList_A02_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint32List/toSet_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/typed_data/Uint32List/toString_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint32List/Uint32List_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint32List/Uint32List_A01_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint32List/Uint32List_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint32List/Uint32List.fromList_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint32List/Uint32List.fromList_A01_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint32List/Uint32List.view_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint32List/Uint32List.view_A01_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint32List/Uint32List.view_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint32List/Uint32List.view_A03_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint32List/Uint32List.view_A04_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint32List/Uint32List.view_A05_t01: Crash # "on T" catch block
+LibTest/typed_data/Uint32List/Uint32List.view_A05_t02: Crash # "on T" catch block
+LibTest/typed_data/Uint32List/Uint32List.view_A05_t03: Crash # "on T" catch block
+LibTest/typed_data/Uint32List/Uint32List.view_A06_t01: Crash # "on T" catch block
+LibTest/typed_data/Uint32List/where_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint32List/where_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint32List/where_A03_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint64List/add_A01_t01: Crash # "on T" catch block
+LibTest/typed_data/Uint64List/addAll_A01_t01: Crash # "on T" catch block
+LibTest/typed_data/Uint64List/any_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/typed_data/Uint64List/asMap_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/typed_data/Uint64List/asMap_A01_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint64List/asMap_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint64List/buffer_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint64List/buffer_A01_t02: Crash # "on T" catch block
+LibTest/typed_data/Uint64List/clear_A01_t01: Crash # "on T" catch block
+LibTest/typed_data/Uint64List/contains_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/typed_data/Uint64List/elementAt_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint64List/elementAt_A02_t01: Crash # "on T" catch block
+LibTest/typed_data/Uint64List/elementSizeInBytes_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint64List/elementSizeInBytes_A01_t02: Crash # "on T" catch block
+LibTest/typed_data/Uint64List/every_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/typed_data/Uint64List/expand_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint64List/fillRange_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint64List/fillRange_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint64List/first_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint64List/first_A01_t02: Crash # "on T" catch block
+LibTest/typed_data/Uint64List/first_A02_t01: Crash # (try {l.first;Expect.fail("StateError is expected");}on StateError catch (ok){}): "on T" catch block
+LibTest/typed_data/Uint64List/first_A03_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint64List/firstWhere_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint64List/firstWhere_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint64List/firstWhere_A03_t01: Crash # "on T" catch block
+LibTest/typed_data/Uint64List/fold_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint64List/forEach_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint64List/getRange_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint64List/getRange_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint64List/getRange_A03_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint64List/getRange_A04_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint64List/hashCode_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/typed_data/Uint64List/hashCode_A01_t02: Crash # "on T" catch block
+LibTest/typed_data/Uint64List/indexOf_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint64List/indexOf_A01_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint64List/indexOf_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint64List/indexOf_A03_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint64List/insert_A01_t01: Crash # "on T" catch block
+LibTest/typed_data/Uint64List/insertAll_A01_t01: Crash # "on T" catch block
+LibTest/typed_data/Uint64List/isEmpty_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/typed_data/Uint64List/isEmpty_A01_t02: Crash # "on T" catch block
+LibTest/typed_data/Uint64List/isNotEmpty_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/typed_data/Uint64List/isNotEmpty_A01_t02: Crash # "on T" catch block
+LibTest/typed_data/Uint64List/iterator_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint64List/iterator_A01_t02: Crash # "on T" catch block
+LibTest/typed_data/Uint64List/iterator_current_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint64List/iterator_moveNext_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/typed_data/Uint64List/join_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/typed_data/Uint64List/join_A01_t02: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/typed_data/Uint64List/last_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint64List/last_A01_t02: Crash # "on T" catch block
+LibTest/typed_data/Uint64List/last_A02_t01: Crash # (try {l.last;Expect.fail("StateError is expected");}on StateError catch (ok){}): "on T" catch block
+LibTest/typed_data/Uint64List/lastIndexOf_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint64List/lastIndexOf_A01_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint64List/lastIndexOf_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint64List/lastIndexOf_A03_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint64List/lastWhere_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint64List/lastWhere_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint64List/lastWhere_A03_t01: Crash # "on T" catch block
+LibTest/typed_data/Uint64List/length_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint64List/length_A02_t01: Crash # "on T" catch block
+LibTest/typed_data/Uint64List/lengthInBytes_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint64List/lengthInBytes_A01_t02: Crash # "on T" catch block
+LibTest/typed_data/Uint64List/map_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint64List/map_A02_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/typed_data/Uint64List/map_A03_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint64List/offsetInBytes_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint64List/offsetInBytes_A01_t02: Crash # "on T" catch block
+LibTest/typed_data/Uint64List/operator_equality_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/typed_data/Uint64List/operator_subscript_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/typed_data/Uint64List/operator_subscript_A02_t01: Crash # (try {l[-1];Expect.fail("RangeError is expected");}on RangeError catch (ok){}): "on T" catch block
+LibTest/typed_data/Uint64List/operator_subscripted_assignment_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/typed_data/Uint64List/operator_subscripted_assignment_A02_t01: Crash # (try {l[-1]=1;Expect.fail("RangeError is expected");}on RangeError catch (ok){}): "on T" catch block
+LibTest/typed_data/Uint64List/reduce_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint64List/reduce_A02_t01: Crash # "on T" catch block
+LibTest/typed_data/Uint64List/remove_A01_t01: Crash # "on T" catch block
+LibTest/typed_data/Uint64List/removeAt_A01_t01: Crash # "on T" catch block
+LibTest/typed_data/Uint64List/removeLast_A01_t01: Crash # "on T" catch block
+LibTest/typed_data/Uint64List/removeRange_A01_t01: Crash # "on T" catch block
+LibTest/typed_data/Uint64List/removeWhere_A01_t01: Crash # "on T" catch block
+LibTest/typed_data/Uint64List/replaceRange_A01_t01: Crash # "on T" catch block
+LibTest/typed_data/Uint64List/retainWhere_A01_t01: Crash # "on T" catch block
+LibTest/typed_data/Uint64List/reversed_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint64List/reversed_A01_t02: Crash # "on T" catch block
+LibTest/typed_data/Uint64List/runtimeType_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint64List/runtimeType_A01_t02: Crash # "on T" catch block
+LibTest/typed_data/Uint64List/setAll_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint64List/setAll_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint64List/setAll_A03_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint64List/setRange_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint64List/setRange_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint64List/setRange_A03_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint64List/setRange_A04_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint64List/single_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint64List/single_A01_t02: Crash # "on T" catch block
+LibTest/typed_data/Uint64List/single_A02_t01: Crash # "on T" catch block
+LibTest/typed_data/Uint64List/single_A02_t02: Crash # "on T" catch block
+LibTest/typed_data/Uint64List/singleWhere_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint64List/singleWhere_A02_t01: Crash # "on T" catch block
+LibTest/typed_data/Uint64List/singleWhere_A02_t02: Crash # "on T" catch block
+LibTest/typed_data/Uint64List/skip_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint64List/skip_A02_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/typed_data/Uint64List/skip_A03_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint64List/skipWhile_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint64List/skipWhile_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint64List/skipWhile_A03_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint64List/skipWhile_A04_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint64List/sort_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint64List/sublist_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint64List/sublist_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint64List/sublist_A03_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint64List/sublist_A03_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint64List/take_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint64List/take_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint64List/take_A03_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint64List/takeWhile_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint64List/takeWhile_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint64List/takeWhile_A03_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint64List/takeWhile_A04_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint64List/toList_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint64List/toList_A02_t01: Crash # "on T" catch block
+LibTest/typed_data/Uint64List/toList_A02_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint64List/toSet_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/typed_data/Uint64List/toString_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint64List/Uint64List_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint64List/Uint64List_A01_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint64List/Uint64List_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint64List/Uint64List.fromList_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint64List/Uint64List.fromList_A01_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint64List/Uint64List.view_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint64List/Uint64List.view_A01_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint64List/Uint64List.view_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint64List/Uint64List.view_A03_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint64List/Uint64List.view_A04_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint64List/Uint64List.view_A05_t01: Crash # "on T" catch block
+LibTest/typed_data/Uint64List/Uint64List.view_A05_t02: Crash # "on T" catch block
+LibTest/typed_data/Uint64List/Uint64List.view_A05_t03: Crash # "on T" catch block
+LibTest/typed_data/Uint64List/Uint64List.view_A06_t01: Crash # "on T" catch block
+LibTest/typed_data/Uint64List/where_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint64List/where_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint64List/where_A03_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint8ClampedList/add_A01_t01: Crash # "on T" catch block
+LibTest/typed_data/Uint8ClampedList/addAll_A01_t01: Crash # "on T" catch block
+LibTest/typed_data/Uint8ClampedList/any_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/typed_data/Uint8ClampedList/asMap_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/typed_data/Uint8ClampedList/asMap_A01_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint8ClampedList/asMap_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint8ClampedList/buffer_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint8ClampedList/buffer_A01_t02: Crash # "on T" catch block
+LibTest/typed_data/Uint8ClampedList/clear_A01_t01: Crash # "on T" catch block
+LibTest/typed_data/Uint8ClampedList/contains_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/typed_data/Uint8ClampedList/elementAt_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint8ClampedList/elementAt_A02_t01: Crash # "on T" catch block
+LibTest/typed_data/Uint8ClampedList/elementSizeInBytes_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint8ClampedList/elementSizeInBytes_A01_t02: Crash # "on T" catch block
+LibTest/typed_data/Uint8ClampedList/every_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/typed_data/Uint8ClampedList/expand_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint8ClampedList/fillRange_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint8ClampedList/fillRange_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint8ClampedList/first_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint8ClampedList/first_A01_t02: Crash # "on T" catch block
+LibTest/typed_data/Uint8ClampedList/first_A02_t01: Crash # (try {l.first;Expect.fail("StateError is expected");}on StateError catch (ok){}): "on T" catch block
+LibTest/typed_data/Uint8ClampedList/first_A03_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint8ClampedList/firstWhere_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint8ClampedList/firstWhere_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint8ClampedList/firstWhere_A03_t01: Crash # "on T" catch block
+LibTest/typed_data/Uint8ClampedList/fold_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint8ClampedList/forEach_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint8ClampedList/getRange_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint8ClampedList/getRange_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint8ClampedList/getRange_A03_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint8ClampedList/getRange_A04_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint8ClampedList/hashCode_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/typed_data/Uint8ClampedList/hashCode_A01_t02: Crash # "on T" catch block
+LibTest/typed_data/Uint8ClampedList/indexOf_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint8ClampedList/indexOf_A01_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint8ClampedList/indexOf_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint8ClampedList/indexOf_A03_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint8ClampedList/insert_A01_t01: Crash # "on T" catch block
+LibTest/typed_data/Uint8ClampedList/insertAll_A01_t01: Crash # "on T" catch block
+LibTest/typed_data/Uint8ClampedList/isEmpty_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/typed_data/Uint8ClampedList/isEmpty_A01_t02: Crash # "on T" catch block
+LibTest/typed_data/Uint8ClampedList/isNotEmpty_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/typed_data/Uint8ClampedList/isNotEmpty_A01_t02: Crash # "on T" catch block
+LibTest/typed_data/Uint8ClampedList/iterator_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint8ClampedList/iterator_A01_t02: Crash # "on T" catch block
+LibTest/typed_data/Uint8ClampedList/iterator_current_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint8ClampedList/iterator_moveNext_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/typed_data/Uint8ClampedList/join_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/typed_data/Uint8ClampedList/join_A01_t02: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/typed_data/Uint8ClampedList/last_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint8ClampedList/last_A01_t02: Crash # "on T" catch block
+LibTest/typed_data/Uint8ClampedList/last_A02_t01: Crash # (try {l.last;Expect.fail("StateError is expected");}on StateError catch (ok){}): "on T" catch block
+LibTest/typed_data/Uint8ClampedList/lastIndexOf_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint8ClampedList/lastIndexOf_A01_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint8ClampedList/lastIndexOf_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint8ClampedList/lastIndexOf_A03_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint8ClampedList/lastWhere_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint8ClampedList/lastWhere_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint8ClampedList/lastWhere_A03_t01: Crash # "on T" catch block
+LibTest/typed_data/Uint8ClampedList/length_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint8ClampedList/length_A02_t01: Crash # "on T" catch block
+LibTest/typed_data/Uint8ClampedList/lengthInBytes_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint8ClampedList/lengthInBytes_A01_t02: Crash # "on T" catch block
+LibTest/typed_data/Uint8ClampedList/map_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint8ClampedList/map_A02_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/typed_data/Uint8ClampedList/map_A03_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint8ClampedList/offsetInBytes_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint8ClampedList/offsetInBytes_A01_t02: Crash # "on T" catch block
+LibTest/typed_data/Uint8ClampedList/operator_equality_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/typed_data/Uint8ClampedList/operator_subscript_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/typed_data/Uint8ClampedList/operator_subscript_A02_t01: Crash # (try {l[-1];Expect.fail("RangeError is expected");}on RangeError catch (ok){}): "on T" catch block
+LibTest/typed_data/Uint8ClampedList/operator_subscripted_assignment_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/typed_data/Uint8ClampedList/operator_subscripted_assignment_A02_t01: Crash # (try {l[-1]=1;Expect.fail("RangeError is expected");}on RangeError catch (ok){}): "on T" catch block
+LibTest/typed_data/Uint8ClampedList/reduce_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint8ClampedList/reduce_A02_t01: Crash # "on T" catch block
+LibTest/typed_data/Uint8ClampedList/remove_A01_t01: Crash # "on T" catch block
+LibTest/typed_data/Uint8ClampedList/removeAt_A01_t01: Crash # "on T" catch block
+LibTest/typed_data/Uint8ClampedList/removeLast_A01_t01: Crash # "on T" catch block
+LibTest/typed_data/Uint8ClampedList/removeRange_A01_t01: Crash # "on T" catch block
+LibTest/typed_data/Uint8ClampedList/removeWhere_A01_t01: Crash # "on T" catch block
+LibTest/typed_data/Uint8ClampedList/replaceRange_A01_t01: Crash # "on T" catch block
+LibTest/typed_data/Uint8ClampedList/retainWhere_A01_t01: Crash # "on T" catch block
+LibTest/typed_data/Uint8ClampedList/reversed_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint8ClampedList/reversed_A01_t02: Crash # "on T" catch block
+LibTest/typed_data/Uint8ClampedList/runtimeType_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint8ClampedList/runtimeType_A01_t02: Crash # "on T" catch block
+LibTest/typed_data/Uint8ClampedList/setAll_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint8ClampedList/setAll_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint8ClampedList/setAll_A03_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint8ClampedList/setRange_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint8ClampedList/setRange_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint8ClampedList/setRange_A03_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint8ClampedList/setRange_A04_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint8ClampedList/single_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint8ClampedList/single_A01_t02: Crash # "on T" catch block
+LibTest/typed_data/Uint8ClampedList/single_A02_t01: Crash # "on T" catch block
+LibTest/typed_data/Uint8ClampedList/single_A02_t02: Crash # "on T" catch block
+LibTest/typed_data/Uint8ClampedList/singleWhere_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint8ClampedList/singleWhere_A02_t01: Crash # "on T" catch block
+LibTest/typed_data/Uint8ClampedList/singleWhere_A02_t02: Crash # "on T" catch block
+LibTest/typed_data/Uint8ClampedList/skip_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint8ClampedList/skip_A02_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/typed_data/Uint8ClampedList/skip_A03_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint8ClampedList/skipWhile_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint8ClampedList/skipWhile_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint8ClampedList/skipWhile_A03_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint8ClampedList/skipWhile_A04_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint8ClampedList/sort_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint8ClampedList/sublist_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint8ClampedList/sublist_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint8ClampedList/sublist_A03_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint8ClampedList/sublist_A03_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint8ClampedList/take_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint8ClampedList/take_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint8ClampedList/take_A03_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint8ClampedList/takeWhile_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint8ClampedList/takeWhile_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint8ClampedList/takeWhile_A03_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint8ClampedList/takeWhile_A04_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint8ClampedList/toList_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint8ClampedList/toList_A02_t01: Crash # "on T" catch block
+LibTest/typed_data/Uint8ClampedList/toList_A02_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint8ClampedList/toSet_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/typed_data/Uint8ClampedList/toString_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint8ClampedList/Uint8ClampedList_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint8ClampedList/Uint8ClampedList_A01_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint8ClampedList/Uint8ClampedList_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint8ClampedList/Uint8ClampedList.fromList_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint8ClampedList/Uint8ClampedList.fromList_A01_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint8ClampedList/Uint8ClampedList.view_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint8ClampedList/Uint8ClampedList.view_A01_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint8ClampedList/Uint8ClampedList.view_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint8ClampedList/Uint8ClampedList.view_A03_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint8ClampedList/Uint8ClampedList.view_A04_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint8ClampedList/Uint8ClampedList.view_A05_t01: Crash # "on T" catch block
+LibTest/typed_data/Uint8ClampedList/Uint8ClampedList.view_A05_t02: Crash # "on T" catch block
+LibTest/typed_data/Uint8ClampedList/Uint8ClampedList.view_A05_t03: Crash # "on T" catch block
+LibTest/typed_data/Uint8ClampedList/where_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint8ClampedList/where_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint8ClampedList/where_A03_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint8List/add_A01_t01: Crash # "on T" catch block
+LibTest/typed_data/Uint8List/addAll_A01_t01: Crash # "on T" catch block
+LibTest/typed_data/Uint8List/any_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/typed_data/Uint8List/asMap_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/typed_data/Uint8List/asMap_A01_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint8List/asMap_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint8List/buffer_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint8List/buffer_A01_t02: Crash # "on T" catch block
+LibTest/typed_data/Uint8List/clear_A01_t01: Crash # "on T" catch block
+LibTest/typed_data/Uint8List/contains_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/typed_data/Uint8List/elementAt_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint8List/elementAt_A02_t01: Crash # "on T" catch block
+LibTest/typed_data/Uint8List/elementSizeInBytes_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint8List/elementSizeInBytes_A01_t02: Crash # "on T" catch block
+LibTest/typed_data/Uint8List/every_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/typed_data/Uint8List/expand_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint8List/fillRange_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint8List/fillRange_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint8List/first_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint8List/first_A01_t02: Crash # "on T" catch block
+LibTest/typed_data/Uint8List/first_A02_t01: Crash # (try {l.first;Expect.fail("StateError is expected");}on StateError catch (ok){}): "on T" catch block
+LibTest/typed_data/Uint8List/first_A03_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint8List/firstWhere_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint8List/firstWhere_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint8List/firstWhere_A03_t01: Crash # "on T" catch block
+LibTest/typed_data/Uint8List/fold_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint8List/forEach_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint8List/getRange_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint8List/getRange_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint8List/getRange_A03_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint8List/getRange_A04_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint8List/hashCode_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/typed_data/Uint8List/hashCode_A01_t02: Crash # "on T" catch block
+LibTest/typed_data/Uint8List/indexOf_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint8List/indexOf_A01_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint8List/indexOf_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint8List/indexOf_A03_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint8List/insert_A01_t01: Crash # "on T" catch block
+LibTest/typed_data/Uint8List/insertAll_A01_t01: Crash # "on T" catch block
+LibTest/typed_data/Uint8List/isEmpty_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/typed_data/Uint8List/isEmpty_A01_t02: Crash # "on T" catch block
+LibTest/typed_data/Uint8List/isNotEmpty_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/typed_data/Uint8List/isNotEmpty_A01_t02: Crash # "on T" catch block
+LibTest/typed_data/Uint8List/iterator_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint8List/iterator_A01_t02: Crash # "on T" catch block
+LibTest/typed_data/Uint8List/iterator_current_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint8List/iterator_moveNext_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/typed_data/Uint8List/join_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/typed_data/Uint8List/join_A01_t02: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/typed_data/Uint8List/last_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint8List/last_A01_t02: Crash # "on T" catch block
+LibTest/typed_data/Uint8List/last_A02_t01: Crash # (try {l.last;Expect.fail("StateError is expected");}on StateError catch (ok){}): "on T" catch block
+LibTest/typed_data/Uint8List/lastIndexOf_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint8List/lastIndexOf_A01_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint8List/lastIndexOf_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint8List/lastIndexOf_A03_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint8List/lastWhere_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint8List/lastWhere_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint8List/lastWhere_A03_t01: Crash # "on T" catch block
+LibTest/typed_data/Uint8List/length_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint8List/length_A02_t01: Crash # "on T" catch block
+LibTest/typed_data/Uint8List/lengthInBytes_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint8List/lengthInBytes_A01_t02: Crash # "on T" catch block
+LibTest/typed_data/Uint8List/map_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint8List/map_A02_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/typed_data/Uint8List/map_A03_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint8List/offsetInBytes_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint8List/offsetInBytes_A01_t02: Crash # "on T" catch block
+LibTest/typed_data/Uint8List/operator_equality_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/typed_data/Uint8List/operator_subscript_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/typed_data/Uint8List/operator_subscript_A02_t01: Crash # (try {l[-1];Expect.fail("RangeError is expected");}on RangeError catch (ok){}): "on T" catch block
+LibTest/typed_data/Uint8List/operator_subscripted_assignment_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/typed_data/Uint8List/operator_subscripted_assignment_A02_t01: Crash # (try {l[-1]=1;Expect.fail("RangeError is expected");}on RangeError catch (ok){}): "on T" catch block
+LibTest/typed_data/Uint8List/reduce_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint8List/reduce_A02_t01: Crash # "on T" catch block
+LibTest/typed_data/Uint8List/remove_A01_t01: Crash # "on T" catch block
+LibTest/typed_data/Uint8List/removeAt_A01_t01: Crash # "on T" catch block
+LibTest/typed_data/Uint8List/removeLast_A01_t01: Crash # "on T" catch block
+LibTest/typed_data/Uint8List/removeRange_A01_t01: Crash # "on T" catch block
+LibTest/typed_data/Uint8List/removeWhere_A01_t01: Crash # "on T" catch block
+LibTest/typed_data/Uint8List/replaceRange_A01_t01: Crash # "on T" catch block
+LibTest/typed_data/Uint8List/retainWhere_A01_t01: Crash # "on T" catch block
+LibTest/typed_data/Uint8List/reversed_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint8List/reversed_A01_t02: Crash # "on T" catch block
+LibTest/typed_data/Uint8List/runtimeType_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint8List/runtimeType_A01_t02: Crash # "on T" catch block
+LibTest/typed_data/Uint8List/setAll_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint8List/setAll_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint8List/setAll_A03_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint8List/setRange_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint8List/setRange_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint8List/setRange_A03_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint8List/setRange_A04_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint8List/single_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint8List/single_A01_t02: Crash # "on T" catch block
+LibTest/typed_data/Uint8List/single_A02_t01: Crash # "on T" catch block
+LibTest/typed_data/Uint8List/single_A02_t02: Crash # "on T" catch block
+LibTest/typed_data/Uint8List/singleWhere_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint8List/singleWhere_A02_t01: Crash # "on T" catch block
+LibTest/typed_data/Uint8List/singleWhere_A02_t02: Crash # "on T" catch block
+LibTest/typed_data/Uint8List/skip_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint8List/skip_A02_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/typed_data/Uint8List/skip_A03_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint8List/skipWhile_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint8List/skipWhile_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint8List/skipWhile_A03_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint8List/skipWhile_A04_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint8List/sort_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint8List/sublist_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint8List/sublist_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint8List/sublist_A03_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint8List/sublist_A03_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint8List/take_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint8List/take_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint8List/take_A03_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint8List/takeWhile_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint8List/takeWhile_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint8List/takeWhile_A03_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint8List/takeWhile_A04_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint8List/toList_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint8List/toList_A02_t01: Crash # "on T" catch block
+LibTest/typed_data/Uint8List/toList_A02_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint8List/toSet_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+LibTest/typed_data/Uint8List/toString_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint8List/Uint8List_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint8List/Uint8List_A01_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint8List/Uint8List_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint8List/Uint8List.fromList_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint8List/Uint8List.fromList_A01_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint8List/Uint8List.view_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint8List/Uint8List.view_A01_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint8List/Uint8List.view_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint8List/Uint8List.view_A03_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint8List/Uint8List.view_A04_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint8List/Uint8List.view_A05_t01: Crash # "on T" catch block
+LibTest/typed_data/Uint8List/Uint8List.view_A05_t02: Crash # "on T" catch block
+LibTest/typed_data/Uint8List/Uint8List.view_A05_t03: Crash # "on T" catch block
+LibTest/typed_data/Uint8List/where_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint8List/where_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LibTest/typed_data/Uint8List/where_A03_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Utils/tests/Expect/approxEquals_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+Utils/tests/Expect/approxEquals_A01_t02: Crash # "on T" catch block
+Utils/tests/Expect/approxEquals_A01_t03: Crash # "on T" catch block
+Utils/tests/Expect/approxEquals_A01_t04: Crash # (throw new ExpectException(message)): Unhandled node
+Utils/tests/Expect/approxEquals_A02_t01: Crash # (throw new ExpectException(message)): Unhandled node
+Utils/tests/Expect/approxEquals_A03_t01: Crash # "on T" catch block
+Utils/tests/Expect/approxEquals_A04_t01: Crash # "on T" catch block
+Utils/tests/Expect/equals_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Utils/tests/Expect/equals_A01_t02: Crash # "on T" catch block
+Utils/tests/Expect/equals_A01_t03: Crash # "on T" catch block
+Utils/tests/Expect/equals_A01_t04: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Utils/tests/Expect/equals_A02_t01: Crash # "on T" catch block
+Utils/tests/ExpectException/ExpectException_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+Utils/tests/ExpectException/message_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Utils/tests/ExpectException/toString_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+Utils/tests/Expect/fail_A01_t01: Crash # "on T" catch block
+Utils/tests/Expect/fail_A02_t01: Crash # "on T" catch block
+Utils/tests/Expect/identical_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+Utils/tests/Expect/identical_A01_t02: Crash # "on T" catch block
+Utils/tests/Expect/identical_A01_t03: Crash # "on T" catch block
+Utils/tests/Expect/identical_A02_t01: Crash # "on T" catch block
+Utils/tests/Expect/isFalse_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+Utils/tests/Expect/isFalse_A01_t02: Crash # "on T" catch block
+Utils/tests/Expect/isFalse_A02_t01: Crash # "on T" catch block
+Utils/tests/Expect/isNotNull_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+Utils/tests/Expect/isNotNull_A01_t02: Crash # "on T" catch block
+Utils/tests/Expect/isNotNull_A02_t01: Crash # "on T" catch block
+Utils/tests/Expect/isNull_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+Utils/tests/Expect/isNull_A01_t02: Crash # "on T" catch block
+Utils/tests/Expect/isNull_A02_t01: Crash # "on T" catch block
+Utils/tests/Expect/isTrue_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+Utils/tests/Expect/isTrue_A01_t02: Crash # "on T" catch block
+Utils/tests/Expect/isTrue_A02_t01: Crash # "on T" catch block
+Utils/tests/Expect/listEquals_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Utils/tests/Expect/listEquals_A01_t02: Crash # "on T" catch block
+Utils/tests/Expect/listEquals_A01_t03: Crash # "on T" catch block
+Utils/tests/Expect/listEquals_A02_t01: Crash # "on T" catch block
+Utils/tests/Expect/listEquals_A03_t01: Crash # "on T" catch block
+Utils/tests/Expect/notEquals_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+Utils/tests/Expect/notEquals_A01_t02: Crash # "on T" catch block
+Utils/tests/Expect/notEquals_A01_t03: Crash # "on T" catch block
+Utils/tests/Expect/notEquals_A02_t01: Crash # "on T" catch block
+Utils/tests/Expect/setEquals_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+Utils/tests/Expect/setEquals_A01_t02: Crash # "on T" catch block
+Utils/tests/Expect/setEquals_A02_t01: Crash # "on T" catch block
+Utils/tests/Expect/setEquals_A03_t01: Crash # "on T" catch block
+Utils/tests/Expect/stringEquals_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+Utils/tests/Expect/stringEquals_A01_t02: Crash # "on T" catch block
+Utils/tests/Expect/stringEquals_A02_t01: Crash # "on T" catch block
+Utils/tests/Expect/throws_A01_t01: Crash # "on T" catch block
+Utils/tests/Expect/throws_A01_t02: Crash # "on T" catch block
+Utils/tests/Expect/throws_A01_t03: Crash # "on T" catch block
+Utils/tests/Expect/throws_A01_t04: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+Utils/tests/Expect/throws_A01_t05: Crash # "on T" catch block
+Utils/tests/Expect/throws_A02_t01: Crash # "on T" catch block
+WebPlatformTest/custom-elements/concepts/type_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+WebPlatformTest/custom-elements/concepts/type_A03_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+WebPlatformTest/custom-elements/concepts/type_A04_t01: Crash # (throw new ExpectException(message)): Unhandled node
+WebPlatformTest/custom-elements/concepts/type_A05_t01: Crash # (throw new ExpectException(message)): Unhandled node
+WebPlatformTest/custom-elements/concepts/type_A06_t01: Crash # (throw new ExpectException(message)): Unhandled node
+WebPlatformTest/custom-elements/concepts/type_A07_t01: Crash # (throw new ExpectException(message)): Unhandled node
+WebPlatformTest/custom-elements/concepts/type_A08_t01: Crash # (throw new ExpectException(message)): Unhandled node
+WebPlatformTest/custom-elements/instantiating/createElement_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+WebPlatformTest/custom-elements/instantiating/createElement_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+WebPlatformTest/custom-elements/instantiating/createElement_A03_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+WebPlatformTest/custom-elements/instantiating/createElement_A04_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+WebPlatformTest/custom-elements/instantiating/createElement_A05_t01: Crash # (throw new ExpectException(message)): Unhandled node
+WebPlatformTest/custom-elements/instantiating/createElementNS_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+WebPlatformTest/custom-elements/instantiating/createElementNS_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+WebPlatformTest/custom-elements/instantiating/createElementNS_A03_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+WebPlatformTest/custom-elements/instantiating/createElementNS_A04_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+WebPlatformTest/custom-elements/instantiating/createElementNS_A05_t01: Crash # (throw new ExpectException(message)): Unhandled node
+WebPlatformTest/custom-elements/instantiating/isAttribute_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+WebPlatformTest/custom-elements/instantiating/isAttribute_A01_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+WebPlatformTest/custom-elements/instantiating/isAttribute_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+WebPlatformTest/custom-elements/instantiating/isAttribute_A03_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+WebPlatformTest/custom-elements/instantiating/localName_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+WebPlatformTest/custom-elements/instantiating/namespace_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+WebPlatformTest/dom/collections/emptyName_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+WebPlatformTest/dom/collections/emptyName_A01_t02: Crash # (throw new ExpectException(message)): Unhandled node
+WebPlatformTest/dom/collections/emptyName_A01_t05: Crash # (throw new ExpectException(message)): Unhandled node
+WebPlatformTest/dom/collections/emptyName_A01_t06: Crash # (throw new ExpectException(message)): Unhandled node
+WebPlatformTest/dom/collections/emptyName_A01_t07: Crash # (throw new ExpectException(message)): Unhandled node
+WebPlatformTest/DOMEvents/approved/addEventListener.optional.useCapture_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+WebPlatformTest/DOMEvents/approved/dispatchEvent.return.value_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+WebPlatformTest/DOMEvents/approved/DOM.event.flow_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+WebPlatformTest/DOMEvents/approved/domnodeinserted_t01: Crash # unsupported element kind: _asyncCounter:field
+WebPlatformTest/DOMEvents/approved/Event.bubbles.false_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+WebPlatformTest/DOMEvents/approved/EventListener.eventHandler_t01: Crash # unsupported element kind: _asyncCounter:field
+WebPlatformTest/DOMEvents/approved/EventObject.after.dispatchEvenr_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+WebPlatformTest/DOMEvents/approved/EventObject.multiple.dispatchEvent_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+WebPlatformTest/DOMEvents/approved/ProcessingInstruction.DOMCharacterDataModified_t01: Crash # unsupported element kind: _completer:field
+WebPlatformTest/DOMEvents/approved/Propagation.path.target.moved_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+WebPlatformTest/DOMEvents/approved/Propagation.path.target.removed_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+WebPlatformTest/DOMEvents/approved/stopImmediatePropagation.effect_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+WebPlatformTest/DOMEvents/approved/stopPropagation.deferred.effect_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+WebPlatformTest/DOMEvents/approved/stopPropagation.dispatchEvent_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+WebPlatformTest/dom/events/defaultPrevented_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+WebPlatformTest/dom/events/defaultPrevented_A01_t02: Crash # (throw new ExpectException(message)): Unhandled node
+WebPlatformTest/dom/events/defaultPrevented_A01_t03: Crash # (throw new ExpectException(message)): Unhandled node
+WebPlatformTest/dom/events/defaultPrevented_A01_t04: Crash # (throw new ExpectException(message)): Unhandled node
+WebPlatformTest/dom/events/defaultPrevented_A01_t05: Crash # (throw new ExpectException(message)): Unhandled node
+WebPlatformTest/dom/events/defaultPrevented_A01_t06: Crash # (throw new ExpectException(message)): Unhandled node
+WebPlatformTest/dom/events/event_constants/constants_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+WebPlatformTest/dom/events/event_constructors/Event_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+WebPlatformTest/dom/events/event_constructors/Event_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+WebPlatformTest/dom/events/propagation_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+WebPlatformTest/dom/events/type_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+WebPlatformTest/dom/EventTarget/dispatchEvent_A01_t01: Crash # (throw new ExpectException(message)): Unhandled node
+WebPlatformTest/dom/EventTarget/dispatchEvent_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+WebPlatformTest/dom/EventTarget/dispatchEvent_A03_t01: Crash # unsupported element kind: _asyncCounter:field
+WebPlatformTest/dom/EventTarget/dispatchEvent_A04_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+WebPlatformTest/dom/lists/DOMTokenList.toString_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+WebPlatformTest/dom/nodes/attributes/attributes_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+WebPlatformTest/dom/nodes/attributes/attributes_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+WebPlatformTest/dom/nodes/attributes/attributes_A03_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+WebPlatformTest/dom/nodes/attributes/attributes_A04_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+WebPlatformTest/dom/nodes/attributes/attributes_A05_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+WebPlatformTest/dom/nodes/attributes/attributes_A06_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+WebPlatformTest/dom/nodes/attributes/setAttribute_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+WebPlatformTest/dom/nodes/attributes/setAttribute_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+WebPlatformTest/dom/nodes/attributes/setAttribute_A02_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+WebPlatformTest/dom/nodes/attributes/setAttribute_A03_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+WebPlatformTest/dom/nodes/attributes/setAttribute_A04_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+WebPlatformTest/dom/nodes/attributes/setAttribute_A06_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+WebPlatformTest/dom/nodes/attributes/setAttribute_A07_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+WebPlatformTest/dom/nodes/attributes/setAttribute_A08_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+WebPlatformTest/dom/nodes/attributes/setAttribute_A09_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+WebPlatformTest/dom/nodes/attributes/setAttributeNS_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+WebPlatformTest/dom/nodes/attributes/setAttributeNS_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+WebPlatformTest/dom/nodes/attributes/setAttributeNS_A03_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+WebPlatformTest/dom/nodes/attributes/setAttributeNS_A04_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+WebPlatformTest/dom/nodes/attributes/setAttributeNS_A05_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+WebPlatformTest/dom/nodes/attributes/setAttributeNS_A06_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+WebPlatformTest/dom/nodes/attributes/setAttributeNS_A06_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+WebPlatformTest/dom/nodes/attributes/setAttributeNS_A06_t03: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+WebPlatformTest/dom/nodes/attributes/setAttributeNS_A07_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+WebPlatformTest/dom/nodes/attributes/setAttributeNS_A07_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+WebPlatformTest/dom/nodes/attributes/setAttributeNS_A07_t03: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+WebPlatformTest/dom/nodes/attributes/setAttributeNS_A08_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+WebPlatformTest/dom/nodes/attributes/setAttributeNS_A09_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+WebPlatformTest/dom/nodes/attributes/setAttributeNS_A09_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+WebPlatformTest/dom/nodes/attributes/setAttributeNS_A10_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+WebPlatformTest/dom/nodes/attributes/setAttributeNS_A10_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+WebPlatformTest/dom/nodes/CharacterData/appendData_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+WebPlatformTest/dom/nodes/CharacterData/deleteData_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+WebPlatformTest/dom/nodes/CharacterData/deleteData_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+WebPlatformTest/dom/nodes/CharacterData/insertData_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+WebPlatformTest/dom/nodes/CharacterData/insertData_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+WebPlatformTest/dom/nodes/CharacterData/remove_A01_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+WebPlatformTest/dom/nodes/CharacterData/remove_A01_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+WebPlatformTest/dom/nodes/CharacterData/remove_A02_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+WebPlatformTest/dom/nodes/CharacterData/remove_A02_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+WebPlatformTest/dom/nodes/Comment-constructor_t01: Crash # (throw new ExpectException(message)): Unhandled node
+WebPlatformTest/dom/nodes/Document-adoptNode_t01: Crash # (throw new ExpectException(message)): Unhandled node
+WebPlatformTest/dom/nodes/Document-createElement-namespace_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+WebPlatformTest/dom/nodes/Document-createElementNS_t01: Crash # (throw new ExpectException(message)): Unhandled node
+WebPlatformTest/dom/nodes/Document-createElementNS_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+WebPlatformTest/dom/nodes/Document-getElementById_t01: Crash # (throw new ExpectException(message)): Unhandled node
+WebPlatformTest/dom/nodes/Document-getElementsByTagName_t01: Crash # (throw new ExpectException(message)): Unhandled node
+WebPlatformTest/dom/nodes/Document-importNode_t01: Crash # (throw new ExpectException(message)): Unhandled node
+WebPlatformTest/dom/nodes/DocumentType-remove_t01: Crash # (throw new ExpectException(message)): Unhandled node
+WebPlatformTest/dom/nodes/DOMImplementation-createDocument_t01: Crash # (throw new ExpectException(message)): Unhandled node
+WebPlatformTest/dom/nodes/DOMImplementation-createDocumentType_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+WebPlatformTest/dom/nodes/DOMImplementation-hasFeature_t01: Crash # (throw new ExpectException(message)): Unhandled node
+WebPlatformTest/dom/nodes/Element-childElementCount-dynamic-add_t01: Crash # (throw new ExpectException(message)): Unhandled node
+WebPlatformTest/dom/nodes/Element-childElementCount-dynamic-remove_t01: Crash # (throw new ExpectException(message)): Unhandled node
+WebPlatformTest/dom/nodes/Element-childElementCount_t01: Crash # (throw new ExpectException(message)): Unhandled node
+WebPlatformTest/dom/nodes/Node-appendChild_t01: Crash # (throw new ExpectException(message)): Unhandled node
+WebPlatformTest/dom/nodes/Node-appendChild_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+WebPlatformTest/dom/nodes/Node-cloneNode_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+WebPlatformTest/dom/nodes/Node-contains_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+WebPlatformTest/dom/nodes/Node-insertBefore_t01: Crash # (throw new ExpectException(message)): Unhandled node
+WebPlatformTest/dom/nodes/Node-isEqualNode_t01: Crash # (throw new ExpectException(message)): Unhandled node
+WebPlatformTest/dom/nodes/Node-nodeName_t01: Crash # (throw new ExpectException(message)): Unhandled node
+WebPlatformTest/dom/nodes/Node-parentElement_t01: Crash # (throw new ExpectException(message)): Unhandled node
+WebPlatformTest/dom/nodes/Node-parentNode_t01: Crash # (throw new ExpectException(message)): Unhandled node
+WebPlatformTest/dom/nodes/Node-replaceChild_t01: Crash # (throw new ExpectException(message)): Unhandled node
+WebPlatformTest/dom/nodes/Node-textContent_t01: Crash # (throw new ExpectException(message)): Unhandled node
+WebPlatformTest/dom/ranges/Range-attributes_t01: Crash # (throw new ExpectException(message)): Unhandled node
+WebPlatformTest/dom/ranges/Range-attributes_t02: Crash # (throw new ExpectException(message)): Unhandled node
+WebPlatformTest/dom/ranges/Range-comparePoint_t02: Crash # (throw new ExpectException(message)): Unhandled node
+WebPlatformTest/dom/ranges/Range-comparePoint_t03: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+WebPlatformTest/html/browsers/browsing-the-web/read-media/pageload-image_t01: Crash # unsupported element kind: _completer:field
+WebPlatformTest/html/browsers/browsing-the-web/read-media/pageload-video_t01: Crash # unsupported element kind: _asyncCounter:field
+WebPlatformTest/html/browsers/browsing-the-web/read-text/load-text-plain_t01: Crash # unsupported element kind: _asyncCounter:field
+WebPlatformTest/html/dom/documents/dom-tree-accessors/document.body-getter_t01: Crash # (throw new ExpectException(message)): Unhandled node
+WebPlatformTest/html/dom/documents/dom-tree-accessors/document.body-setter_t01: Crash # (throw new ExpectException(message)): Unhandled node
+WebPlatformTest/html/dom/documents/dom-tree-accessors/Document.getElementsByClassName-null_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+WebPlatformTest/html/dom/documents/dom-tree-accessors/document.getElementsByName-case_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+WebPlatformTest/html/dom/documents/dom-tree-accessors/document.getElementsByName-id_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+WebPlatformTest/html/dom/documents/dom-tree-accessors/document.getElementsByName-namespace_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+WebPlatformTest/html/dom/documents/dom-tree-accessors/document.getElementsByName-newelements_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+WebPlatformTest/html/dom/documents/dom-tree-accessors/document.getElementsByName-param_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+WebPlatformTest/html/dom/documents/dom-tree-accessors/document.head_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+WebPlatformTest/html/dom/documents/dom-tree-accessors/document.head_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+WebPlatformTest/html/dom/documents/dom-tree-accessors/document.title_t01: Crash # (throw new ExpectException(message)): Unhandled node
+WebPlatformTest/html/dom/documents/dom-tree-accessors/document.title_t03: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+WebPlatformTest/html/dom/documents/dom-tree-accessors/document.title_t05: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+WebPlatformTest/html/dom/documents/dom-tree-accessors/document.title_t06: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+WebPlatformTest/html/dom/documents/dom-tree-accessors/document.title_t07: Crash # (throw new ExpectException(message)): Unhandled node
+WebPlatformTest/html/dom/documents/dom-tree-accessors/Element.getElementsByClassName-null_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+WebPlatformTest/html/dom/documents/dom-tree-accessors/nameditem_t02: Crash # (throw new ExpectException(message)): Unhandled node
+WebPlatformTest/html/dom/documents/dom-tree-accessors/nameditem_t03: Crash # (throw new ExpectException(message)): Unhandled node
+WebPlatformTest/html/dom/documents/dom-tree-accessors/nameditem_t04: Crash # (throw new ExpectException(message)): Unhandled node
+WebPlatformTest/html/dom/documents/dom-tree-accessors/nameditem_t05: Crash # (throw new ExpectException(message)): Unhandled node
+WebPlatformTest/html/dom/documents/dom-tree-accessors/nameditem_t06: Crash # (throw new ExpectException(message)): Unhandled node
+WebPlatformTest/html/dom/elements/global-attributes/classlist-nonstring_t01: Crash # (throw new ExpectException(message)): Unhandled node
+WebPlatformTest/html/dom/elements/global-attributes/dataset-delete_t01: Crash # (throw new ExpectException(message)): Unhandled node
+WebPlatformTest/html/dom/elements/global-attributes/dataset-enumeration_t01: Crash # (throw new ExpectException(message)): Unhandled node
+WebPlatformTest/html/dom/elements/global-attributes/dataset-get_t01: Crash # (throw new ExpectException(message)): Unhandled node
+WebPlatformTest/html/dom/elements/global-attributes/dataset-set_t01: Crash # (throw new ExpectException(message)): Unhandled node
+WebPlatformTest/html/dom/elements/global-attributes/id-name_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+WebPlatformTest/html-imports/link-import-null_t01: Crash # (throw new ExpectException(message)): Unhandled node
+WebPlatformTest/html-imports/link-import_t01: Crash # (throw new ExpectException(message)): Unhandled node
+WebPlatformTest/html-imports/link-import_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+WebPlatformTest/html-imports/loading-import_t01: Crash # (throw new ExpectException(message)): Unhandled node
+WebPlatformTest/html/semantics/disabled-elements/disabledElement_t01: Crash # (throw new ExpectException(message)): Unhandled node
+WebPlatformTest/html/semantics/document-metadata/styling/LinkStyle_t01: Crash # (throw new ExpectException(message)): Unhandled node
+WebPlatformTest/html/semantics/edits/the-del-element/del_effect_t01: Crash # (throw new ExpectException(message)): Unhandled node
+WebPlatformTest/html/semantics/edits/the-ins-element/ins_effect_t01: Crash # (throw new ExpectException(message)): Unhandled node
+WebPlatformTest/html/semantics/embedded-content/media-elements/error-codes/error_t01: Crash # (throw new ExpectException(message)): Unhandled node
+WebPlatformTest/html/semantics/embedded-content/media-elements/interfaces/HTMLElement/HTMLMediaElement/addTextTrack_t01: Crash # (throw new ExpectException(message)): Unhandled node
+WebPlatformTest/html/semantics/embedded-content/media-elements/interfaces/HTMLElement/HTMLMediaElement/textTracks_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+WebPlatformTest/html/semantics/embedded-content/media-elements/interfaces/HTMLElement/HTMLTrackElement/default_t01: Crash # (throw new ExpectException(message)): Unhandled node
+WebPlatformTest/html/semantics/embedded-content/media-elements/interfaces/HTMLElement/HTMLTrackElement/kind_t01: Crash # (throw new ExpectException(message)): Unhandled node
+WebPlatformTest/html/semantics/embedded-content/media-elements/interfaces/HTMLElement/HTMLTrackElement/label_t01: Crash # (throw new ExpectException(message)): Unhandled node
+WebPlatformTest/html/semantics/embedded-content/media-elements/interfaces/HTMLElement/HTMLTrackElement/readyState_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+WebPlatformTest/html/semantics/embedded-content/media-elements/interfaces/HTMLElement/HTMLTrackElement/srclang_t01: Crash # (throw new ExpectException(message)): Unhandled node
+WebPlatformTest/html/semantics/embedded-content/media-elements/interfaces/HTMLElement/HTMLTrackElement/src_t01: Crash # (throw new ExpectException(message)): Unhandled node
+WebPlatformTest/html/semantics/embedded-content/media-elements/interfaces/HTMLElement/HTMLTrackElement/track_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+WebPlatformTest/html/semantics/embedded-content/media-elements/interfaces/TextTrack/cues_t01: Crash # (throw new ExpectException(message)): Unhandled node
+WebPlatformTest/html/semantics/embedded-content/media-elements/interfaces/TextTrack/kind_t01: Crash # (throw new ExpectException(message)): Unhandled node
+WebPlatformTest/html/semantics/embedded-content/media-elements/interfaces/TextTrack/mode_t01: Crash # (throw new ExpectException(message)): Unhandled node
+WebPlatformTest/html/semantics/embedded-content/the-audio-element/audio_constructor_t01: Crash # (throw new ExpectException(message)): Unhandled node
+WebPlatformTest/html/semantics/forms/attributes-common-to-form-controls/formAction_document_address_t01: Crash # (throw new ExpectException(message)): Unhandled node
+WebPlatformTest/html/semantics/forms/attributes-common-to-form-controls/formaction_t01: Crash # (throw new ExpectException(message)): Unhandled node
+WebPlatformTest/html/semantics/forms/textfieldselection/selection-not-application-textarea_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+WebPlatformTest/html/semantics/forms/textfieldselection/selection_t01: Crash # (throw new ExpectException(message)): Unhandled node
+WebPlatformTest/html/semantics/forms/textfieldselection/textfieldselection-setRangeText_t01: Crash # (throw new ExpectException(message)): Unhandled node
+WebPlatformTest/html/semantics/forms/textfieldselection/textfieldselection-setSelectionRange_t01: Crash # (throw new ExpectException(message)): Unhandled node
+WebPlatformTest/html/semantics/forms/the-button-element/button-validation_t01: Crash # (throw new ExpectException(message)): Unhandled node
+WebPlatformTest/html/semantics/forms/the-datalist-element/datalistelement_t01: Crash # (throw new ExpectException(message)): Unhandled node
+WebPlatformTest/html/semantics/forms/the-datalist-element/datalistoptions_t01: Crash # (throw new ExpectException(message)): Unhandled node
+WebPlatformTest/html/semantics/forms/the-fieldset-element/disabled_t01: Crash # (throw new ExpectException(message)): Unhandled node
+WebPlatformTest/html/semantics/forms/the-fieldset-element/HTMLFieldSetElement_t01: Crash # (throw new ExpectException(message)): Unhandled node
+WebPlatformTest/html/semantics/forms/the-form-element/form-autocomplete_t01: Crash # (throw new ExpectException(message)): Unhandled node
+WebPlatformTest/html/semantics/forms/the-form-element/form-elements-matches_t01: Crash # (throw new ExpectException(message)): Unhandled node
+WebPlatformTest/html/semantics/forms/the-form-element/form-elements-nameditem_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+WebPlatformTest/html/semantics/forms/the-form-element/form-nameditem_t01: Crash # (throw new ExpectException(message)): Unhandled node
+WebPlatformTest/html/semantics/forms/the-input-element/color_t01: Crash # (throw new ExpectException(message)): Unhandled node
+WebPlatformTest/html/semantics/forms/the-input-element/date_t01: Crash # (throw new ExpectException(message)): Unhandled node
+WebPlatformTest/html/semantics/forms/the-input-element/datetime-local_t01: Crash # (throw new ExpectException(message)): Unhandled node
+WebPlatformTest/html/semantics/forms/the-input-element/datetime_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+WebPlatformTest/html/semantics/forms/the-input-element/datetime_t02: Crash # (throw new ExpectException(message)): Unhandled node
+WebPlatformTest/html/semantics/forms/the-input-element/email_t01: Crash # (throw new ExpectException(message)): Unhandled node
+WebPlatformTest/html/semantics/forms/the-input-element/hidden_t01: Crash # (throw new ExpectException(message)): Unhandled node
+WebPlatformTest/html/semantics/forms/the-input-element/input-textselection_t01: Crash # (throw new ExpectException(message)): Unhandled node
+WebPlatformTest/html/semantics/forms/the-input-element/input-type-button_t01: Crash # (throw new ExpectException(message)): Unhandled node
+WebPlatformTest/html/semantics/forms/the-input-element/input-type-checkbox_t01: Crash # (throw new ExpectException(message)): Unhandled node
+WebPlatformTest/html/semantics/forms/the-input-element/mobiles_t01: Crash # (throw new ExpectException(message)): Unhandled node
+WebPlatformTest/html/semantics/forms/the-input-element/month_t01: Crash # (throw new ExpectException(message)): Unhandled node
+WebPlatformTest/html/semantics/forms/the-input-element/password_t01: Crash # (throw new ExpectException(message)): Unhandled node
+WebPlatformTest/html/semantics/forms/the-input-element/pattern_attribute_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+WebPlatformTest/html/semantics/forms/the-input-element/range_t01: Crash # (throw new ExpectException(message)): Unhandled node
+WebPlatformTest/html/semantics/forms/the-input-element/range_t02: Crash # (throw new ExpectException(message)): Unhandled node
+WebPlatformTest/html/semantics/forms/the-input-element/required_attribute_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+WebPlatformTest/html/semantics/forms/the-input-element/search_input_t01: Crash # (throw new ExpectException(message)): Unhandled node
+WebPlatformTest/html/semantics/forms/the-input-element/telephone_t01: Crash # (throw new ExpectException(message)): Unhandled node
+WebPlatformTest/html/semantics/forms/the-input-element/text_t01: Crash # (throw new ExpectException(message)): Unhandled node
+WebPlatformTest/html/semantics/forms/the-input-element/time_t01: Crash # (throw new ExpectException(message)): Unhandled node
+WebPlatformTest/html/semantics/forms/the-input-element/time_t02: Crash # (throw new ExpectException(message)): Unhandled node
+WebPlatformTest/html/semantics/forms/the-input-element/type-change-state_t01: Crash # (throw new ExpectException(message)): Unhandled node
+WebPlatformTest/html/semantics/forms/the-input-element/url_t01: Crash # (throw new ExpectException(message)): Unhandled node
+WebPlatformTest/html/semantics/forms/the-input-element/valueMode_t01: Crash # (throw new ExpectException(message)): Unhandled node
+WebPlatformTest/html/semantics/forms/the-input-element/week_t01: Crash # (throw new ExpectException(message)): Unhandled node
+WebPlatformTest/html/semantics/forms/the-meter-element/meter_t01: Crash # (throw new ExpectException(message)): Unhandled node
+WebPlatformTest/html/semantics/forms/the-option-element/option-text-backslash_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+WebPlatformTest/html/semantics/forms/the-option-element/option-text-recurse_t01: Crash # (throw new ExpectException(message)): Unhandled node
+WebPlatformTest/html/semantics/forms/the-option-element/option-text-spaces_t01: Crash # (throw new ExpectException(message)): Unhandled node
+WebPlatformTest/html/semantics/forms/the-output-element/output_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+WebPlatformTest/html/semantics/forms/the-textarea-element/textarea-type_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+WebPlatformTest/html/semantics/grouping-content/the-blockquote-element/grouping-blockquote_t01: Crash # (throw new ExpectException(message)): Unhandled node
+WebPlatformTest/html/semantics/grouping-content/the-li-element/grouping-li_t01: Crash # (throw new ExpectException(message)): Unhandled node
+WebPlatformTest/html/semantics/grouping-content/the-ol-element/ol.start-reflection_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+WebPlatformTest/html/semantics/grouping-content/the-ol-element/ol.start-reflection_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+WebPlatformTest/html/semantics/interactive-elements/the-details-element/toggleEvent_t01: Crash # (throw new ExpectException(message)): Unhandled node
+WebPlatformTest/html/semantics/interactive-elements/the-dialog-element/dialog-close_t01: Crash # (throw new ExpectException(message)): Unhandled node
+WebPlatformTest/html/semantics/interactive-elements/the-dialog-element/dialog-showModal_t01: Crash # (throw new ExpectException(message)): Unhandled node
+WebPlatformTest/html/semantics/scripting-1/the-script-element/async_t01: Crash # (throw new ExpectException(message)): Unhandled node
+WebPlatformTest/html/semantics/scripting-1/the-script-element/async_t02: Crash # (throw new ExpectException(message)): Unhandled node
+WebPlatformTest/html/semantics/scripting-1/the-script-element/async_t11: Crash # (throw new ExpectException(message)): Unhandled node
+WebPlatformTest/html/semantics/scripting-1/the-script-element/script-text_t01: Crash # (throw new ExpectException(message)): Unhandled node
+WebPlatformTest/html/semantics/scripting-1/the-script-element/script-text_t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+WebPlatformTest/html/semantics/selectors/pseudo-classes/checked_t01: Crash # (throw new ExpectException(message)): Unhandled node
+WebPlatformTest/html/semantics/selectors/pseudo-classes/default_t01: Crash # (throw new ExpectException(message)): Unhandled node
+WebPlatformTest/html/semantics/selectors/pseudo-classes/dir_t01: Crash # (throw new ExpectException(message)): Unhandled node
+WebPlatformTest/html/semantics/selectors/pseudo-classes/disabled_t01: Crash # (throw new ExpectException(message)): Unhandled node
+WebPlatformTest/html/semantics/selectors/pseudo-classes/enabled_t01: Crash # (throw new ExpectException(message)): Unhandled node
+WebPlatformTest/html/semantics/selectors/pseudo-classes/focus_t01: Crash # (throw new ExpectException(message)): Unhandled node
+WebPlatformTest/html/semantics/selectors/pseudo-classes/indeterminate_t01: Crash # (throw new ExpectException(message)): Unhandled node
+WebPlatformTest/html/semantics/selectors/pseudo-classes/inrange-outofrange_t01: Crash # (throw new ExpectException(message)): Unhandled node
+WebPlatformTest/html/semantics/selectors/pseudo-classes/link_t01: Crash # (throw new ExpectException(message)): Unhandled node
+WebPlatformTest/html/semantics/selectors/pseudo-classes/required-optional_t01: Crash # (throw new ExpectException(message)): Unhandled node
+WebPlatformTest/html/semantics/selectors/pseudo-classes/valid-invalid_t01: Crash # (throw new ExpectException(message)): Unhandled node
+WebPlatformTest/html/semantics/tabular-data/attributes-common-to-td-and-th-elements/cellIndex_t01: Crash # (throw new ExpectException(message)): Unhandled node
+WebPlatformTest/html/semantics/tabular-data/the-caption-element/caption_t01: Crash # (throw new ExpectException(message)): Unhandled node
+WebPlatformTest/html/semantics/tabular-data/the-table-element/border_t01: Crash # (throw new ExpectException(message)): Unhandled node
+WebPlatformTest/html/semantics/tabular-data/the-table-element/caption-methods_t01: Crash # (throw new ExpectException(message)): Unhandled node
+WebPlatformTest/html/semantics/tabular-data/the-table-element/createTBody_t01: Crash # (throw new ExpectException(message)): Unhandled node
+WebPlatformTest/html/semantics/tabular-data/the-table-element/insertRow-method_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+WebPlatformTest/html/semantics/tabular-data/the-table-element/insertRow-method_t02: Crash # (throw new ExpectException(message)): Unhandled node
+WebPlatformTest/html/semantics/tabular-data/the-table-element/table-insertRow_t01: Crash # (throw new ExpectException(message)): Unhandled node
+WebPlatformTest/html/semantics/tabular-data/the-table-element/table-rows_t01: Crash # (throw new ExpectException(message)): Unhandled node
+WebPlatformTest/html/semantics/tabular-data/the-table-element/tBodies_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+WebPlatformTest/html/semantics/tabular-data/the-tr-element/rowIndex_t01: Crash # (throw new ExpectException(message)): Unhandled node
+WebPlatformTest/html/semantics/text-level-semantics/the-a-element/a.text-getter_t01: Crash # (throw new ExpectException(message)): Unhandled node
+WebPlatformTest/html/semantics/text-level-semantics/the-a-element/a.text-setter_t01: Crash # (throw new ExpectException(message)): Unhandled node
+WebPlatformTest/html/syntax/parsing/Document.getElementsByTagName-foreign_t01: Crash # (throw new ExpectException(message)): Unhandled node
+WebPlatformTest/html/syntax/parsing/Document.getElementsByTagName-foreign_t02: Crash # (throw new ExpectException(message)): Unhandled node
+WebPlatformTest/html/syntax/parsing/math-parse_t01: Crash # (throw new ExpectException(message)): Unhandled node
+WebPlatformTest/html/syntax/parsing/math-parse_t03: Crash # (throw new ExpectException(message)): Unhandled node
+WebPlatformTest/html/syntax/serializing-html-fragments/outerHTML_t01: Crash # (throw new ExpectException(message)): Unhandled node
+WebPlatformTest/html-templates/additions-to-the-steps-to-clone-a-node/template-clone-children_t01: Crash # (throw '${testName}: ${e}'): Unhandled node
+WebPlatformTest/html-templates/additions-to-the-steps-to-clone-a-node/templates-copy-document-owner_t01: Crash # (throw '${testName}: ${e}'): Unhandled node
+WebPlatformTest/html-templates/definitions/template-contents-owner-document-type_t01: Crash # (throw '${testName}: ${e}'): Unhandled node
+WebPlatformTest/html-templates/definitions/template-contents-owner-test-001_t01: Crash # (throw '${testName}: ${e}'): Unhandled node
+WebPlatformTest/html-templates/definitions/template-contents_t01: Crash # (throw '${testName}: ${e}'): Unhandled node
+WebPlatformTest/html-templates/innerhtml-on-templates/innerhtml_t01: Crash # (throw '${testName}: ${e}'): Unhandled node
+WebPlatformTest/html-templates/parsing-html-templates/additions-to-foster-parenting/template-is-a-foster-parent-element_t01: Crash # (throw '${testName}: ${e}'): Unhandled node
+WebPlatformTest/html-templates/parsing-html-templates/additions-to-foster-parenting/template-is-not-a-foster-parent-element_t01: Crash # (throw '${testName}: ${e}'): Unhandled node
+WebPlatformTest/html-templates/parsing-html-templates/additions-to-the-in-body-insertion-mode/generating-of-implied-end-tags_t01: Crash # (throw '${testName}: ${e}'): Unhandled node
+WebPlatformTest/html-templates/parsing-html-templates/additions-to-the-in-body-insertion-mode/ignore-body-token_t01: Crash # (throw '${testName}: ${e}'): Unhandled node
+WebPlatformTest/html-templates/parsing-html-templates/additions-to-the-in-body-insertion-mode/ignore-frameset-token_t01: Crash # (throw '${testName}: ${e}'): Unhandled node
+WebPlatformTest/html-templates/parsing-html-templates/additions-to-the-in-body-insertion-mode/ignore-head-token_t01: Crash # (throw '${testName}: ${e}'): Unhandled node
+WebPlatformTest/html-templates/parsing-html-templates/additions-to-the-in-body-insertion-mode/ignore-html-token_t01: Crash # (throw '${testName}: ${e}'): Unhandled node
+WebPlatformTest/html-templates/parsing-html-templates/additions-to-the-in-body-insertion-mode/start-tag-body_t01: Crash # (throw '${testName}: ${e}'): Unhandled node
+WebPlatformTest/html-templates/parsing-html-templates/additions-to-the-in-body-insertion-mode/template-end-tag-without-start-one_t01: Crash # (throw '${testName}: ${e}'): Unhandled node
+WebPlatformTest/html-templates/parsing-html-templates/additions-to-the-in-head-insertion-mode/generating-of-implied-end-tags_t01: Crash # (throw '${testName}: ${e}'): Unhandled node
+WebPlatformTest/html-templates/parsing-html-templates/additions-to-the-in-head-insertion-mode/template-end-tag-without-start-one_t01: Crash # (throw '${testName}: ${e}'): Unhandled node
+WebPlatformTest/html-templates/parsing-html-templates/additions-to-the-in-table-insertion-mode/end-tag-table_t01: Crash # (throw '${testName}: ${e}'): Unhandled node
+WebPlatformTest/html-templates/parsing-html-templates/appending-to-a-template/template-child-nodes_t01: Crash # (throw '${testName}: ${e}'): Unhandled node
+WebPlatformTest/html-templates/parsing-html-templates/clearing-the-stack-back-to-a-given-context/clearing-stack-back-to-a-table-body-context_t01: Crash # (throw '${testName}: ${e}'): Unhandled node
+WebPlatformTest/html-templates/parsing-html-templates/clearing-the-stack-back-to-a-given-context/clearing-stack-back-to-a-table-context_t01: Crash # (throw '${testName}: ${e}'): Unhandled node
+WebPlatformTest/html-templates/parsing-html-templates/clearing-the-stack-back-to-a-given-context/clearing-stack-back-to-a-table-row-context_t01: Crash # (throw '${testName}: ${e}'): Unhandled node
+WebPlatformTest/html-templates/parsing-html-templates/creating-an-element-for-the-token/template-owner-document_t01: Crash # (throw '${testName}: ${e}'): Unhandled node
+WebPlatformTest/html-templates/serializing-html-templates/outerhtml_t01: Crash # (throw '${testName}: ${e}'): Unhandled node
+WebPlatformTest/html-templates/template-element/content-attribute_t01: Crash # (throw '${testName}: ${e}'): Unhandled node
+WebPlatformTest/html-templates/template-element/node-document-changes_t01: Crash # (throw '${testName}: ${e}'): Unhandled node
+WebPlatformTest/html-templates/template-element/template-as-a-descendant_t01: Crash # (throw '${testName}: ${e}'): Unhandled node
+WebPlatformTest/html-templates/template-element/template-content-node-document_t01: Crash # (throw '${testName}: ${e}'): Unhandled node
+WebPlatformTest/html-templates/template-element/template-content_t01: Crash # (throw '${testName}: ${e}'): Unhandled node
+WebPlatformTest/html/webappapis/system-state-and-capabilities/the-navigator-object/protocol_t00: Crash # (throw new ExpectException(message)): Unhandled node
+WebPlatformTest/html/webappapis/system-state-and-capabilities/the-navigator-object/protocol/t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+WebPlatformTest/html/webappapis/system-state-and-capabilities/the-navigator-object/protocol/t02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+WebPlatformTest/html/webappapis/system-state-and-capabilities/the-navigator-object/protocol/t03: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+WebPlatformTest/html/webappapis/system-state-and-capabilities/the-navigator-object/protocol/t04: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+WebPlatformTest/html/webappapis/system-state-and-capabilities/the-navigator-object/protocol/t05: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+WebPlatformTest/html/webappapis/system-state-and-capabilities/the-navigator-object/protocol/t06: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+WebPlatformTest/shadow-dom/elements-and-dom-objects/extensions-to-element-interface/attributes/test-001_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+WebPlatformTest/shadow-dom/elements-and-dom-objects/extensions-to-element-interface/attributes/test-004_t01: Crash # (throw '${testName}: ${e}'): Unhandled node
+WebPlatformTest/shadow-dom/elements-and-dom-objects/extensions-to-element-interface/attributes/test-004_t02: Crash # (throw '${testName}: ${e}'): Unhandled node
+WebPlatformTest/shadow-dom/elements-and-dom-objects/extensions-to-element-interface/attributes/test-005_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+WebPlatformTest/shadow-dom/elements-and-dom-objects/extensions-to-element-interface/attributes/test-006_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+WebPlatformTest/shadow-dom/elements-and-dom-objects/extensions-to-element-interface/methods/elements-001_t01: Crash # (throw '${testName}: ${e}'): Unhandled node
+WebPlatformTest/shadow-dom/elements-and-dom-objects/extensions-to-element-interface/methods/test-001_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+WebPlatformTest/shadow-dom/elements-and-dom-objects/extensions-to-element-interface/methods/test-002_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+WebPlatformTest/shadow-dom/elements-and-dom-objects/extensions-to-element-interface/methods/test-003_t01: Crash # (throw new ExpectException(message)): Unhandled node
+WebPlatformTest/shadow-dom/elements-and-dom-objects/extensions-to-event-interface/event-path-001_t01: Crash # unsupported element kind: _completer:field
+WebPlatformTest/shadow-dom/elements-and-dom-objects/shadowroot-object/shadowroot-attributes/test-007_t01: Crash # (throw '${testName}: ${e}'): Unhandled node
+WebPlatformTest/shadow-dom/elements-and-dom-objects/shadowroot-object/shadowroot-attributes/test-008_t01: Crash # (throw '${testName}: ${e}'): Unhandled node
+WebPlatformTest/shadow-dom/elements-and-dom-objects/shadowroot-object/shadowroot-attributes/test-009_t01: Crash # (throw '${testName}: ${e}'): Unhandled node
+WebPlatformTest/shadow-dom/elements-and-dom-objects/shadowroot-object/shadowroot-attributes/test-010_t01: Crash # (throw '${testName}: ${e}'): Unhandled node
+WebPlatformTest/shadow-dom/elements-and-dom-objects/shadowroot-object/shadowroot-attributes/test-011_t01: Crash # (throw '${testName}: ${e}'): Unhandled node
+WebPlatformTest/shadow-dom/elements-and-dom-objects/shadowroot-object/shadowroot-attributes/test-012_t01: Crash # (throw '${testName}: ${e}'): Unhandled node
+WebPlatformTest/shadow-dom/elements-and-dom-objects/shadowroot-object/shadowroot-attributes/test-013_t01: Crash # (throw '${testName}: ${e}'): Unhandled node
+WebPlatformTest/shadow-dom/elements-and-dom-objects/shadowroot-object/shadowroot-methods/test-001_t01: Crash # (throw '${testName}: ${e}'): Unhandled node
+WebPlatformTest/shadow-dom/elements-and-dom-objects/shadowroot-object/shadowroot-methods/test-002_t01: Crash # (throw '${testName}: ${e}'): Unhandled node
+WebPlatformTest/shadow-dom/elements-and-dom-objects/shadowroot-object/shadowroot-methods/test-005_t01: Crash # (throw '${testName}: ${e}'): Unhandled node
+WebPlatformTest/shadow-dom/elements-and-dom-objects/shadowroot-object/shadowroot-methods/test-006_t01: Crash # (throw '${testName}: ${e}'): Unhandled node
+WebPlatformTest/shadow-dom/elements-and-dom-objects/shadowroot-object/shadowroot-methods/test-007_t01: Crash # (throw '${testName}: ${e}'): Unhandled node
+WebPlatformTest/shadow-dom/elements-and-dom-objects/shadowroot-object/shadowroot-methods/test-010_t01: Crash # (throw '${testName}: ${e}'): Unhandled node
+WebPlatformTest/shadow-dom/elements-and-dom-objects/the-content-html-element/test-001_t01: Crash # (throw '${testName}: ${e}'): Unhandled node
+WebPlatformTest/shadow-dom/elements-and-dom-objects/the-content-html-element/test-002_t01: Crash # (throw '${testName}: ${e}'): Unhandled node
+WebPlatformTest/shadow-dom/elements-and-dom-objects/the-content-html-element/test-003_t01: Crash # (throw '${testName}: ${e}'): Unhandled node
+WebPlatformTest/shadow-dom/elements-and-dom-objects/the-content-html-element/test-004_t01: Crash # (throw '${testName}: ${e}'): Unhandled node
+WebPlatformTest/shadow-dom/elements-and-dom-objects/the-content-html-element/test-004_t02: Crash # (throw '${testName}: ${e}'): Unhandled node
+WebPlatformTest/shadow-dom/elements-and-dom-objects/the-content-html-element/test-005_t01: Crash # (throw '${testName}: ${e}'): Unhandled node
+WebPlatformTest/shadow-dom/elements-and-dom-objects/the-content-html-element/test-006_t01: Crash # (throw '${testName}: ${e}'): Unhandled node
+WebPlatformTest/shadow-dom/elements-and-dom-objects/the-shadow-html-element/test-001_t01: Crash # (throw '${testName}: ${e}'): Unhandled node
+WebPlatformTest/shadow-dom/elements-and-dom-objects/the-shadow-html-element/test-002_t01: Crash # (throw '${testName}: ${e}'): Unhandled node
+WebPlatformTest/shadow-dom/elements-and-dom-objects/the-shadow-html-element/test-003_t01: Crash # (throw '${testName}: ${e}'): Unhandled node
+WebPlatformTest/shadow-dom/elements-and-dom-objects/the-shadow-html-element/test-003_t02: Crash # (throw '${testName}: ${e}'): Unhandled node
+WebPlatformTest/shadow-dom/elements-and-dom-objects/the-shadow-html-element/test-004_t01: Crash # (throw '${testName}: ${e}'): Unhandled node
+WebPlatformTest/shadow-dom/elements-and-dom-objects/the-shadow-html-element/test-005_t01: Crash # (throw '${testName}: ${e}'): Unhandled node
+WebPlatformTest/shadow-dom/events/event-dispatch/test-001_t01: Crash # (throw new ExpectException(message)): Unhandled node
+WebPlatformTest/shadow-dom/events/event-dispatch/test-002_t01: Crash # (throw new ExpectException(message)): Unhandled node
+WebPlatformTest/shadow-dom/events/event-dispatch/test-003_t01: Crash # unsupported element kind: _completer:field
+WebPlatformTest/shadow-dom/events/event-retargeting/test-001_t01: Crash # (throw '${testName}: ${e}'): Unhandled node
+WebPlatformTest/shadow-dom/events/event-retargeting/test-002_t01: Crash # unsupported element kind: _completer:field
+WebPlatformTest/shadow-dom/events/event-retargeting/test-003_t01: Crash # unsupported element kind: _completer:field
+WebPlatformTest/shadow-dom/events/event-retargeting/test-004_t01: Crash # (throw new ExpectException(message)): Unhandled node
+WebPlatformTest/shadow-dom/events/events-that-are-always-stopped/test-001_t01: Crash # (throw new ExpectException(message)): Unhandled node
+WebPlatformTest/shadow-dom/events/events-that-are-always-stopped/test-002_t01: Crash # (throw new ExpectException(message)): Unhandled node
+WebPlatformTest/shadow-dom/events/events-that-are-always-stopped/test-003_t01: Crash # (throw new ExpectException(message)): Unhandled node
+WebPlatformTest/shadow-dom/events/events-that-are-always-stopped/test-004_t01: Crash # (throw new ExpectException(message)): Unhandled node
+WebPlatformTest/shadow-dom/events/events-that-are-always-stopped/test-005_t01: Crash # (throw new ExpectException(message)): Unhandled node
+WebPlatformTest/shadow-dom/events/events-that-are-always-stopped/test-006_t01: Crash # (throw new ExpectException(message)): Unhandled node
+WebPlatformTest/shadow-dom/events/events-that-are-always-stopped/test-007_t01: Crash # (throw new ExpectException(message)): Unhandled node
+WebPlatformTest/shadow-dom/events/events-that-are-always-stopped/test-008_t01: Crash # (throw new ExpectException(message)): Unhandled node
+WebPlatformTest/shadow-dom/events/events-that-are-always-stopped/test-009_t01: Crash # (throw new ExpectException(message)): Unhandled node
+WebPlatformTest/shadow-dom/events/retargeting-focus-events/test-001_t01: Crash # (throw '${testName}: ${e}'): Unhandled node
+WebPlatformTest/shadow-dom/events/retargeting-focus-events/test-001_t02: Crash # (throw '${testName}: ${e}'): Unhandled node
+WebPlatformTest/shadow-dom/events/retargeting-focus-events/test-001_t03: Crash # (throw '${testName}: ${e}'): Unhandled node
+WebPlatformTest/shadow-dom/events/retargeting-focus-events/test-001_t04: Crash # (throw '${testName}: ${e}'): Unhandled node
+WebPlatformTest/shadow-dom/events/retargeting-focus-events/test-001_t05: Crash # (throw '${testName}: ${e}'): Unhandled node
+WebPlatformTest/shadow-dom/events/retargeting-focus-events/test-001_t06: Crash # (throw '${testName}: ${e}'): Unhandled node
+WebPlatformTest/shadow-dom/events/retargeting-focus-events/test-002_t01: Crash # (throw new ExpectException(message)): Unhandled node
+WebPlatformTest/shadow-dom/events/retargeting-focus-events/test-003_t01: Crash # (throw new ExpectException(message)): Unhandled node
+WebPlatformTest/shadow-dom/events/retargeting-relatedtarget/test-001_t01: Crash # (throw new ExpectException(message)): Unhandled node
+WebPlatformTest/shadow-dom/events/retargeting-relatedtarget/test-002_t01: Crash # unsupported element kind: _completer:field
+WebPlatformTest/shadow-dom/events/retargeting-relatedtarget/test-003_t01: Crash # (throw new ExpectException(message)): Unhandled node
+WebPlatformTest/shadow-dom/html-elements-and-their-shadow-trees/test-001_t01: Crash # (throw '${testName}: ${e}'): Unhandled node
+WebPlatformTest/shadow-dom/html-elements-and-their-shadow-trees/test-002_t01: Crash # (throw '${testName}: ${e}'): Unhandled node
+WebPlatformTest/shadow-dom/html-elements-and-their-shadow-trees/test-003_t01: Crash # (throw '${testName}: ${e}'): Unhandled node
+WebPlatformTest/shadow-dom/html-elements-and-their-shadow-trees/test-004_t01: Crash # (throw '${testName}: ${e}'): Unhandled node
+WebPlatformTest/shadow-dom/html-elements-in-shadow-trees/html-forms/test-001_t01: Crash # (throw '${testName}: ${e}'): Unhandled node
+WebPlatformTest/shadow-dom/html-elements-in-shadow-trees/html-forms/test-002_t01: Crash # (throw '${testName}: ${e}'): Unhandled node
+WebPlatformTest/shadow-dom/html-elements-in-shadow-trees/inert-html-elements/test-002_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+WebPlatformTest/shadow-dom/shadow-trees/composition/test-001_t01: Crash # (throw new ExpectException(message)): Unhandled node
+WebPlatformTest/shadow-dom/shadow-trees/custom-pseudo-elements/test-001_t01: Crash # (throw new ExpectException(message)): Unhandled node
+WebPlatformTest/shadow-dom/shadow-trees/distributed-pseudo-element/test-001_t01: Crash # (throw new ExpectException(message)): Unhandled node
+WebPlatformTest/shadow-dom/shadow-trees/distributed-pseudo-element/test-002_t01: Crash # (throw new ExpectException(message)): Unhandled node
+WebPlatformTest/shadow-dom/shadow-trees/hosting-multiple-shadow-trees/test-001_t01: Crash # (throw '${testName}: ${e}'): Unhandled node
+WebPlatformTest/shadow-dom/shadow-trees/hosting-multiple-shadow-trees/test-002_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+WebPlatformTest/shadow-dom/shadow-trees/hosting-multiple-shadow-trees/test-003_t01: Crash # (throw new ExpectException(message)): Unhandled node
+WebPlatformTest/shadow-dom/shadow-trees/lower-boundary-encapsulation/distribution-003_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+WebPlatformTest/shadow-dom/shadow-trees/lower-boundary-encapsulation/test-003_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+WebPlatformTest/shadow-dom/shadow-trees/lower-boundary-encapsulation/test-004_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+WebPlatformTest/shadow-dom/shadow-trees/lower-boundary-encapsulation/test-005_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+WebPlatformTest/shadow-dom/shadow-trees/nested-shadow-trees/test-001_t01: Crash # (throw new ExpectException(message)): Unhandled node
+WebPlatformTest/shadow-dom/shadow-trees/rendering-shadow-trees/test-001_t01: Crash # (throw new ExpectException(message)): Unhandled node
+WebPlatformTest/shadow-dom/shadow-trees/reprojection/test-001_t01: Crash # (throw '${testName}: ${e}'): Unhandled node
+WebPlatformTest/shadow-dom/shadow-trees/satisfying-matching-criteria/test-001_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+WebPlatformTest/shadow-dom/shadow-trees/satisfying-matching-criteria/test-002_t01: Crash # (throw new ExpectException(message)): Unhandled node
+WebPlatformTest/shadow-dom/shadow-trees/satisfying-matching-criteria/test-003_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+WebPlatformTest/shadow-dom/shadow-trees/satisfying-matching-criteria/test-004_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+WebPlatformTest/shadow-dom/shadow-trees/satisfying-matching-criteria/test-005_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+WebPlatformTest/shadow-dom/shadow-trees/satisfying-matching-criteria/test-006_t01: Crash # (throw new ExpectException(message)): Unhandled node
+WebPlatformTest/shadow-dom/shadow-trees/satisfying-matching-criteria/test-017_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+WebPlatformTest/shadow-dom/shadow-trees/upper-boundary-encapsulation/dom-tree-accessors-002_t01: Crash # (throw '${testName}: ${e}'): Unhandled node
+WebPlatformTest/shadow-dom/shadow-trees/upper-boundary-encapsulation/ownerdocument-001_t01: Crash # (throw '${testName}: ${e}'): Unhandled node
+WebPlatformTest/shadow-dom/shadow-trees/upper-boundary-encapsulation/ownerdocument-002_t01: Crash # (throw '${testName}: ${e}'): Unhandled node
+WebPlatformTest/shadow-dom/shadow-trees/upper-boundary-encapsulation/selectors-api-001_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+WebPlatformTest/shadow-dom/shadow-trees/upper-boundary-encapsulation/selectors-api-002_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+WebPlatformTest/shadow-dom/shadow-trees/upper-boundary-encapsulation/shadow-root-001_t01: Crash # (throw '${testName}: ${e}'): Unhandled node
+WebPlatformTest/shadow-dom/shadow-trees/upper-boundary-encapsulation/test-005_t01: Crash # (throw '${testName}: ${e}'): Unhandled node
+WebPlatformTest/shadow-dom/shadow-trees/upper-boundary-encapsulation/test-007_t01: Crash # (throw '${testName}: ${e}'): Unhandled node
+WebPlatformTest/shadow-dom/shadow-trees/upper-boundary-encapsulation/test-009_t01: Crash # (throw new ExpectException(message)): Unhandled node
+WebPlatformTest/shadow-dom/shadow-trees/upper-boundary-encapsulation/test-011_t01: Crash # (throw '${testName}: ${e}'): Unhandled node
+WebPlatformTest/Utils/test/asyncTestFail_t01: Crash # (throw new ExpectException(message)): Unhandled node
+WebPlatformTest/Utils/test/asyncTestFail_t02: Crash # (throw new ExpectException(message)): Unhandled node
+WebPlatformTest/Utils/test/asyncTestPass_t01: Crash # (throw new ExpectException(message)): Unhandled node
+WebPlatformTest/Utils/test/asyncTestTimeout_t01: Crash # (throw new ExpectException(message)): Unhandled node
+WebPlatformTest/Utils/test/testFail_t01: Crash # (throw new ExpectException(message)): Unhandled node
+WebPlatformTest/Utils/test/testPass_t01: Crash # (throw new ExpectException(message)): Unhandled node
+WebPlatformTest/webstorage/event_constructor_t01: Crash # unsupported element kind: _completer:field
+WebPlatformTest/webstorage/event_constructor_t02: Crash # unsupported element kind: _completer:field
+WebPlatformTest/webstorage/event_local_key_t01: Crash # unsupported element kind: _completer:field
+WebPlatformTest/webstorage/event_local_newvalue_t01: Crash # unsupported element kind: _completer:field
+WebPlatformTest/webstorage/event_local_oldvalue_t01: Crash # unsupported element kind: _completer:field
+WebPlatformTest/webstorage/event_local_storagearea_t01: Crash # unsupported element kind: _completer:field
+WebPlatformTest/webstorage/event_local_storageeventinit_t01: Crash # unsupported element kind: _completer:field
+WebPlatformTest/webstorage/event_local_url_t01: Crash # unsupported element kind: _completer:field
+WebPlatformTest/webstorage/event_session_key_t01: Crash # unsupported element kind: _completer:field
+WebPlatformTest/webstorage/event_session_newvalue_t01: Crash # unsupported element kind: _completer:field
+WebPlatformTest/webstorage/event_session_oldvalue_t01: Crash # unsupported element kind: _completer:field
+WebPlatformTest/webstorage/event_session_storagearea_t01: Crash # unsupported element kind: _completer:field
+WebPlatformTest/webstorage/event_session_storageeventinit_t01: Crash # unsupported element kind: _completer:field
+WebPlatformTest/webstorage/event_session_url_t01: Crash # unsupported element kind: _completer:field
+WebPlatformTest/webstorage/storage_builtins_t01: Crash # (throw new ExpectException(message)): Unhandled node
+WebPlatformTest/webstorage/storage_clear_t01: Crash # (throw new ExpectException(message)): Unhandled node
+WebPlatformTest/webstorage/storage_local_getitem_t01: Crash # (throw new ExpectException(message)): Unhandled node
+WebPlatformTest/webstorage/storage_local_key_t01: Crash # (throw new ExpectException(message)): Unhandled node
+WebPlatformTest/webstorage/storage_local_length_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+WebPlatformTest/webstorage/storage_local_remove_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+WebPlatformTest/webstorage/storage_local_setitem_quotaexceedederr_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+WebPlatformTest/webstorage/storage_local_setitem_t01: Crash # (throw new ExpectException(message)): Unhandled node
+WebPlatformTest/webstorage/storage_session_getitem_t01: Crash # (throw new ExpectException(message)): Unhandled node
+WebPlatformTest/webstorage/storage_session_getitem_t02: Crash # (throw new ExpectException(message)): Unhandled node
+WebPlatformTest/webstorage/storage_session_key_t01: Crash # (throw new ExpectException(message)): Unhandled node
+WebPlatformTest/webstorage/storage_session_length_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+WebPlatformTest/webstorage/storage_session_removeitem_t01: Crash # (throw new ExpectException(message)): Unhandled node
+WebPlatformTest/webstorage/storage_session_setitem_quotaexceedederr_t01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+WebPlatformTest/webstorage/storage_session_setitem_t01: Crash # (throw new ExpectException(message)): Unhandled node
diff --git a/tests/co19/co19-dartium.status b/tests/co19/co19-dartium.status
index ac0106b..063af97 100644
--- a/tests/co19/co19-dartium.status
+++ b/tests/co19/co19-dartium.status
@@ -26,6 +26,7 @@
LayoutTests/fast/css-generated-content/hit-test-generated-content_t01: Skip # co19 issue 732.
LayoutTests/fast/css/collapsed-whitespace-reattach-in-style-recalc_t01: Skip # co19 issue 732.
LayoutTests/fast/events/document-elementFromPoint_t01: Skip # co19 issue 732.
+LayoutTests/fast/innerHTML/innerHTML-svg-write_t01: Fail # Test uses foreignObject tag, which sanitizer removes. co19 issue #746
LayoutTests/fast/sub-pixel/float-containing-block-with-margin_t01: Skip # co19 issue 732.
LayoutTests/fast/sub-pixel/table-rows-have-stable-height_t01: Skip # co19 issue 732.
LayoutTests/fast/table/col-width-span-expand_t01: Skip # co19 issue 732.
@@ -71,13 +72,13 @@
LibTest/isolate/SendPort/send_A02_t04: Fail # Issue 13921
LibTest/isolate/SendPort/send_A02_t05: Fail # Issue 13921
LibTest/isolate/SendPort/send_A02_t06: Fail # Issue 13921
-LibTest/isolate/Isolate/spawnUri_A01_t01: RuntimeError # co19-roll r672: Please triage this failure
-LibTest/isolate/Isolate/spawnUri_A01_t02: Skip # co19-roll r672: Please triage this failure
-LibTest/isolate/Isolate/spawnUri_A01_t03: Skip # co19-roll r672: Please triage this failure
-LibTest/isolate/Isolate/spawnUri_A01_t04: RuntimeError # co19-roll r672: Please triage this failure
-LibTest/isolate/Isolate/spawnUri_A01_t05: RuntimeError # co19-roll r672: Please triage this failure
-LibTest/isolate/Isolate/spawnUri_A02_t01: RuntimeError # co19-roll r672: Please triage this failure
-LibTest/isolate/Isolate/spawnUri_A02_t04: Skip # Please triage this failure
+LibTest/isolate/Isolate/spawnUri_A01_t01: RuntimeError # Dart issue 15974
+LibTest/isolate/Isolate/spawnUri_A01_t02: Skip # Dart issue 15974
+LibTest/isolate/Isolate/spawnUri_A01_t03: Skip # Dart issue 15974
+LibTest/isolate/Isolate/spawnUri_A01_t04: RuntimeError # Dart issue 15974
+LibTest/isolate/Isolate/spawnUri_A01_t05: RuntimeError # Dart issue 15974
+LibTest/isolate/Isolate/spawnUri_A02_t01: RuntimeError # Dart issue 15974
+LibTest/isolate/Isolate/spawnUri_A02_t04: Skip # Dart issue 15974
LibTest/isolate/RawReceivePort/RawReceivePort_A01_t01: RuntimeError # Issue 13921
LibTest/isolate/RawReceivePort/RawReceivePort_A01_t02: RuntimeError # Issue 13921
@@ -1039,6 +1040,7 @@
LayoutTests/fast/filesystem/file-writer-abort-continue_t01: Skip # Times out. Please triage this failure.
LayoutTests/fast/forms/activate-and-disabled-elements_t01: Skip # Times out. Please triage this failure.
LayoutTests/fast/forms/plaintext-mode-1_t01: RuntimeError # co19-roll r801: Please triage this failure.
+LayoutTests/fast/forms/selection-direction_t01: Skip # Times out. Please triage this failure.
LayoutTests/fast/forms/text-set-value-crash_t01: Skip # Times out. Please triage this failure.
LayoutTests/fast/forms/textarea-paste-newline_t01: RuntimeError # co19-roll r801 : Please triage this failure.
LayoutTests/fast/inline/continuation-inlines-inserted-in-reverse-after-block_t01: Skip # Times out. Please triage this failure.
diff --git a/tests/co19/co19-runtime.status b/tests/co19/co19-runtime.status
index 7f50f90..b7d8699 100644
--- a/tests/co19/co19-runtime.status
+++ b/tests/co19/co19-runtime.status
@@ -70,7 +70,7 @@
LibTest/isolate/Isolate/spawnUri_A01_t04: Crash, Pass # Issue 17440
LibTest/isolate/Isolate/spawn_A01_t04: Crash, Pass # Issue 17440
-[ $compiler == none && $runtime == vm && ($arch == simarm || $arch == simmips || $arch == simarm64) ]
+[ $compiler == none && $runtime == vm && ($arch == simarm || $arch == simarmv5te || $arch == simmips || $arch == simarm64) ]
LibTest/core/Uri/Uri_A06_t03: Skip # Timeout
LibTest/collection/ListMixin/ListMixin_class_A01_t01: Skip # Timeout
LibTest/collection/ListBase/ListBase_class_A01_t01: Skip # Timeout
diff --git a/tests/compiler/dart2js/backend_dart/opt_constprop_test.dart b/tests/compiler/dart2js/backend_dart/opt_constprop_test.dart
index 149b58e..2ee3890 100644
--- a/tests/compiler/dart2js/backend_dart/opt_constprop_test.dart
+++ b/tests/compiler/dart2js/backend_dart/opt_constprop_test.dart
@@ -9,7 +9,7 @@
import "package:expect/expect.dart";
import 'package:compiler/src/cps_ir/cps_ir_nodes_sexpr.dart';
import 'package:compiler/src/cps_ir/optimizers.dart';
-import 'package:compiler/src/dart2jslib.dart' as dart2js;
+import 'package:compiler/src/constant_system_dart.dart';
// The tests in this file that ensure that sparse constant propagation on the
// CPS IR works as expected.
@@ -500,7 +500,7 @@
final stringifier = new SExpressionStringifier();
final optimizer = new TypePropagator(
compiler.types,
- dart2js.DART_CONSTANT_SYSTEM,
+ DART_CONSTANT_SYSTEM,
new UnitTypeSystem(),
compiler.internalError);
diff --git a/tests/compiler/dart2js/backend_dart/sexpr_unstringifier.dart b/tests/compiler/dart2js/backend_dart/sexpr_unstringifier.dart
index aa2c1ac..6ec2d1c 100644
--- a/tests/compiler/dart2js/backend_dart/sexpr_unstringifier.dart
+++ b/tests/compiler/dart2js/backend_dart/sexpr_unstringifier.dart
@@ -7,8 +7,7 @@
library sexpr_unstringifier;
-import 'package:compiler/src/constants/expressions.dart'
- show PrimitiveConstantExpression;
+import 'package:compiler/src/constants/expressions.dart';
import 'package:compiler/src/constants/values.dart';
import 'package:compiler/src/dart2jslib.dart' as dart2js
show MessageKind;
@@ -145,7 +144,6 @@
static const String LITERAL_LIST = "LiteralList";
static const String LITERAL_MAP = "LiteralMap";
static const String REIFY_TYPE_VAR = "ReifyTypeVar";
- static const String THIS = "This";
// Other
static const String FUNCTION_DEFINITION = "FunctionDefinition";
@@ -190,7 +188,7 @@
} else {
kind = SelectorKind.CALL;
}
- return new Selector(kind, new PublicName(name),
+ return new Selector(kind, new PublicName(name),
new CallStructure.unnamed(argumentCount));
}
@@ -356,7 +354,7 @@
assert(cont != null);
tokens.consumeEnd();
- return new ConcatenateStrings(cont, args);
+ return new ConcatenateStrings(args, cont);
}
/// (DeclareFunction name = function in body)
@@ -396,7 +394,7 @@
tokens.consumeEnd();
Selector selector = dummySelector(constructorName, args.length);
- return new InvokeConstructor(type, element, selector, cont, args);
+ return new InvokeConstructor(type, element, selector, args, cont);
}
/// (InvokeContinuation rec? name (args))
@@ -431,7 +429,7 @@
tokens.consumeEnd();
Selector selector = dummySelector(methodName, args.length);
- return new InvokeMethod(receiver, selector, cont, args);
+ return new InvokeMethod(receiver, selector, args, cont);
}
/// (InvokeStatic method (args) cont)
@@ -449,7 +447,7 @@
Selector selector = dummySelector(methodName, args.length);
tokens.consumeEnd();
- return new InvokeStatic(entity, selector, cont, args, null);
+ return new InvokeStatic(entity, selector, args, cont, null);
}
/// (InvokeMethodDirectly receiver method (args) cont)
@@ -469,7 +467,7 @@
tokens.consumeEnd();
Element element = new DummyElement(methodName);
Selector selector = dummySelector(methodName, args.length);
- return new InvokeMethodDirectly(receiver, element, selector, cont, args);
+ return new InvokeMethodDirectly(receiver, element, selector, args, cont);
}
// (rec? name (args) body)
@@ -602,8 +600,6 @@
return parseLiteralMap();
case REIFY_TYPE_VAR:
return parseReifyTypeVar();
- case THIS:
- return parseThis();
default:
assert(false);
}
@@ -620,16 +616,16 @@
switch (tag) {
case NULL:
result = new Constant(
- new PrimitiveConstantExpression(new NullConstantValue()));
+ new NullConstantExpression(new NullConstantValue()));
break;
case BOOL:
String value = tokens.read();
if (value == "true") {
result = new Constant(
- new PrimitiveConstantExpression(new TrueConstantValue()));
+ new BoolConstantExpression(true, new TrueConstantValue()));
} else if (value == "false") {
result = new Constant(
- new PrimitiveConstantExpression(new FalseConstantValue()));
+ new BoolConstantExpression(false, new FalseConstantValue()));
} else {
throw "Invalid Boolean value '$value'.";
}
@@ -641,9 +637,10 @@
} while (tokens.current != ")");
String string = strings.join(" ");
assert(string.startsWith('"') && string.endsWith('"'));
+ String text = string.substring(1, string.length - 1);
StringConstantValue value = new StringConstantValue(
- new LiteralDartString(string.substring(1, string.length - 1)));
- result = new Constant(new PrimitiveConstantExpression(value));
+ new LiteralDartString(text));
+ result = new Constant(new StringConstantExpression(text, value));
break;
case INT:
String value = tokens.read();
@@ -651,8 +648,8 @@
if (intValue == null) {
throw "Invalid int value 'value'.";
}
- result = new Constant(
- new PrimitiveConstantExpression(new IntConstantValue(intValue)));
+ result = new Constant(new IntConstantExpression(
+ intValue, new IntConstantValue(intValue)));
break;
case DOUBLE:
String value = tokens.read();
@@ -660,8 +657,8 @@
if (doubleValue == null) {
throw "Invalid double value '$value'.";
}
- result = new Constant(new PrimitiveConstantExpression(
- new DoubleConstantValue(doubleValue)));
+ result = new Constant(new DoubleConstantExpression(
+ doubleValue, new DoubleConstantValue(doubleValue)));
break;
default:
throw "Unexpected constant tag '$tag'.";
@@ -729,11 +726,4 @@
tokens.consumeEnd();
return new ReifyTypeVar(type);
}
-
- /// (This)
- This parseThis() {
- tokens.consumeStart(THIS);
- tokens.consumeEnd();
- return new This();
- }
}
diff --git a/tests/compiler/dart2js/compiler_helper.dart b/tests/compiler/dart2js/compiler_helper.dart
index 279f372..8953792 100644
--- a/tests/compiler/dart2js/compiler_helper.dart
+++ b/tests/compiler/dart2js/compiler_helper.dart
@@ -69,6 +69,7 @@
compiler.globalDependencies);
compiler.processQueue(compiler.enqueuer.resolution, element);
compiler.world.populate();
+ compiler.backend.onResolutionComplete();
var context = new js.JavaScriptItemCompilationContext();
leg.ResolutionWorkItem resolutionWork =
new leg.ResolutionWorkItem(element, context);
@@ -126,6 +127,7 @@
trustTypeAnnotations: trustTypeAnnotations,
expectedWarnings: expectedWarnings,
outputProvider: outputCollector);
+ compiler.diagnosticHandler = createHandler(compiler, code);
return compiler.runCompiler(uri).then((_) {
Expect.isFalse(compiler.compilationFailed,
'Unexpected compilation error(s): ${compiler.errors}');
diff --git a/tests/compiler/dart2js/dart2js.status b/tests/compiler/dart2js/dart2js.status
index b5cf3a6..fa4a8bb 100644
--- a/tests/compiler/dart2js/dart2js.status
+++ b/tests/compiler/dart2js/dart2js.status
@@ -42,6 +42,7 @@
check_elements_invariants_test: Slow, Pass
import_mirrors_test: Slow, Pass
http_test: Pass, Slow
+exit_code_test: Pass, Slow
[ $mode == debug ]
check_elements_invariants_test: Skip # Slow and only needs to be run in one
diff --git a/tests/compiler/dart2js/exit_code_test.dart b/tests/compiler/dart2js/exit_code_test.dart
index b70fe4a..3199c45 100644
--- a/tests/compiler/dart2js/exit_code_test.dart
+++ b/tests/compiler/dart2js/exit_code_test.dart
@@ -12,6 +12,7 @@
import 'package:expect/expect.dart';
import 'package:compiler/compiler.dart' as api;
+import 'package:compiler/src/compile_time_constants.dart';
import 'package:compiler/src/dart2js.dart' as entry;
import 'package:compiler/src/dart2jslib.dart';
import 'package:compiler/src/apiimpl.dart' as apiimpl;
@@ -137,7 +138,8 @@
int checkedResults = 0;
-Future testExitCode(String marker, String type, int expectedExitCode) {
+Future testExitCode(
+ String marker, String type, int expectedExitCode, List options) {
bool testOccurred = false;
void onTest(String testMarker, String testType) {
@@ -196,17 +198,19 @@
entry.exitFunc = exit;
entry.compileFunc = compile;
- Future result = entry.internalMain(
- ["tests/compiler/dart2js/exit_code_helper.dart"]);
+ List<String> args = new List<String>.from(options)
+ ..add("tests/compiler/dart2js/exit_code_helper.dart");
+ Future result = entry.internalMain(args);
return result.catchError((e, s) {
// Capture crashes.
}).whenComplete(checkResult);
});
}
-Future testExitCodes(String marker, Map<String,int> expectedExitCodes) {
+Future testExitCodes(
+ String marker, Map<String,int> expectedExitCodes, List<String> options) {
return Future.forEach(expectedExitCodes.keys, (String type) {
- return testExitCode(marker, type, expectedExitCodes[type]);
+ return testExitCode(marker, type, expectedExitCodes[type], options);
});
}
@@ -214,23 +218,30 @@
bool isCheckedMode = false;
assert((isCheckedMode = true));
- final beforeRun = {
- '': 0,
- 'NoSuchMethodError': 253,
- 'assert': isCheckedMode ? 253 : 0,
- 'invariant': 253
- };
+ Map _expectedExitCode({bool beforeRun: false, bool fatalWarnings: false}) {
+ if (beforeRun) {
+ return {
+ '': 0,
+ 'NoSuchMethodError': 253,
+ 'assert': isCheckedMode ? 253 : 0,
+ 'invariant': 253
+ };
+ }
- final duringRun = {
- '': 0,
- 'NoSuchMethodError': 253,
- 'assert': isCheckedMode ? 253 : 0,
- 'invariant': 253,
- 'warning': 0,
- 'error': 1,
- 'internalError': 253,
- };
+ // duringRun:
+ return {
+ '': 0,
+ 'NoSuchMethodError': 253,
+ 'assert': isCheckedMode ? 253 : 0,
+ 'invariant': 253,
+ 'warning': fatalWarnings ? 1 : 0,
+ 'error': 1,
+ 'internalError': 253,
+ };
+ }
+ const beforeRun = false;
+ const duringRun = true;
final tests = {
'Compiler': beforeRun,
'Compiler.run': beforeRun,
@@ -242,18 +253,20 @@
'Compiler.codegen': duringRun,
'ResolverTask.computeClassMembers': duringRun,
};
+ int totalExpectedErrors = 0;
- asyncStart();
- Future.forEach(tests.keys, (marker) {
- return testExitCodes(marker, tests[marker]);
- }).then((_) {
- int countResults(Map runType) {
- return runType.length *
- tests.values.where((r) => r == runType).length;
+ asyncTest(() async {
+ for (String marker in tests.keys) {
+ var expected = _expectedExitCode(beforeRun: tests[marker]);
+ totalExpectedErrors += expected.length;
+ await testExitCodes(marker, expected, []);
+
+ expected = _expectedExitCode(
+ beforeRun: tests[marker], fatalWarnings: true);
+ totalExpectedErrors += expected.length;
+ await testExitCodes(marker, expected, ['--fatal-warnings']);
}
- Expect.equals(countResults(beforeRun) + countResults(duringRun),
- checkedResults);
- asyncEnd();
+ Expect.equals(totalExpectedErrors, checkedResults);
});
}
diff --git a/tests/compiler/dart2js/js_backend_cps_ir.dart b/tests/compiler/dart2js/js_backend_cps_ir.dart
index a435110..e3fb44d 100644
--- a/tests/compiler/dart2js/js_backend_cps_ir.dart
+++ b/tests/compiler/dart2js/js_backend_cps_ir.dart
@@ -58,13 +58,10 @@
}
runTests(List<TestEntry> tests) {
- Expect.isTrue(const bool.fromEnvironment("USE_CPS_IR"),
- 'Run with USE_CPS_IR=true');
-
for (TestEntry test in tests) {
Map files = {TEST_MAIN_FILE: test.source};
asyncTest(() {
- Compiler compiler = compilerFor(files);
+ Compiler compiler = compilerFor(files, options: <String>['--use-cps-ir']);
Uri uri = Uri.parse('memory:$TEST_MAIN_FILE');
return compiler.run(uri).then((bool success) {
Expect.isTrue(success);
diff --git a/tests/compiler/dart2js/js_backend_cps_ir_basic_test.dart b/tests/compiler/dart2js/js_backend_cps_ir_basic_test.dart
index 5b0b557..2c62b87 100644
--- a/tests/compiler/dart2js/js_backend_cps_ir_basic_test.dart
+++ b/tests/compiler/dart2js/js_backend_cps_ir_basic_test.dart
@@ -1,7 +1,6 @@
// Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// VMOptions=-DUSE_CPS_IR=true
// Tests for basic functionality.
@@ -26,9 +25,7 @@
print('($m)');
}""",r"""
function() {
- var l, m;
- l = [1, 2, 3];
- m = P.LinkedHashMap_LinkedHashMap$_literal(["s", 1]);
+ var l = [1, 2, 3], m = P.LinkedHashMap_LinkedHashMap$_literal(["s", 1]);
P.print("()");
P.print("(" + true + ")");
P.print("(" + 1 + ")");
@@ -81,9 +78,7 @@
""",
"""
function() {
- var a, b;
- a = 10;
- b = 1;
+ var a = 10, b = 1;
P.print(b);
P.print(a);
P.print(a);
@@ -111,8 +106,8 @@
print(new Set.from([1, 2, 3]));
}""", r"""
function() {
- P.print(P.Set_Set(null));
- P.print(P.Set_Set$from([1, 2, 3], null));
+ P.print(P.LinkedHashSet_LinkedHashSet(null));
+ P.print(P.LinkedHashSet_LinkedHashSet$from([1, 2, 3], null));
return null;
}"""),
// Call synthetic constructor.
@@ -162,8 +157,7 @@
main() { print(foo = 42); }
""", r"""
function() {
- var v0;
- v0 = 42;
+ var v0 = 42;
$.foo = v0;
P.print(v0);
return null;
@@ -175,6 +169,19 @@
function() {
V.foo(42);
return null;
+}"""),
+ // Assert
+ const TestEntry("""
+foo() { print('X'); }
+main() {
+ assert(true);
+ assert(false);
+ assert(foo());
+ print('Done');
+}""", r"""
+function() {
+ P.print("Done");
+ return null;
}""")
];
diff --git a/tests/compiler/dart2js/js_backend_cps_ir_closures_test.dart b/tests/compiler/dart2js/js_backend_cps_ir_closures_test.dart
index cc20b1b..083e407 100644
--- a/tests/compiler/dart2js/js_backend_cps_ir_closures_test.dart
+++ b/tests/compiler/dart2js/js_backend_cps_ir_closures_test.dart
@@ -1,7 +1,6 @@
// Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// VMOptions=-DUSE_CPS_IR=true
// Tests of closures.
@@ -21,12 +20,10 @@
""",
r"""
function(x) {
- var _box_0, a;
- _box_0 = {};
+ var _box_0 = {}, a;
_box_0._captured_x_0 = x;
a = new V.main_a(_box_0);
- x = _box_0._captured_x_0;
- _box_0._captured_x_0 = J.getInterceptor$ns(x).$add(x, "1");
+ _box_0._captured_x_0 = J.getInterceptor$ns(x = _box_0._captured_x_0).$add(x, "1");
P.print(a.call$0());
return null;
}"""),
@@ -55,12 +52,10 @@
""",
r"""
function() {
- var _box_0, a, x;
- _box_0 = {};
+ var _box_0 = {}, a, x;
_box_0._captured_x_0 = 122;
a = new V.main_closure(_box_0);
- x = _box_0._captured_x_0;
- _box_0._captured_x_0 = J.getInterceptor$ns(x).$add(x, 1);
+ _box_0._captured_x_0 = J.getInterceptor$ns(x = _box_0._captured_x_0).$add(x, 1);
P.print(a.call$0());
return null;
}"""),
@@ -78,12 +73,10 @@
""",
r"""
function() {
- var _box_0, a, x;
- _box_0 = {};
+ var _box_0 = {}, a, x;
_box_0._captured_x_0 = 122;
a = new V.main_closure(_box_0);
- x = _box_0._captured_x_0;
- _box_0._captured_x_0 = J.getInterceptor$ns(x).$add(x, 1);
+ _box_0._captured_x_0 = J.getInterceptor$ns(x = _box_0._captured_x_0).$add(x, 1);
P.print(a.call$0().call$0());
return null;
}"""),
@@ -99,10 +92,8 @@
""",
r"""
function() {
- var a, i;
- a = null;
- i = 0;
- while (P.identical(J.getInterceptor$n(i).$lt(i, 10), true)) {
+ var a = null, i = 0;
+ while (J.getInterceptor$n(i).$lt(i, 10)) {
a = new V.main_closure(i);
i = J.getInterceptor$ns(i).$add(i, 1);
}
diff --git a/tests/compiler/dart2js/js_backend_cps_ir_constructor_test.dart b/tests/compiler/dart2js/js_backend_cps_ir_constructor_test.dart
index e77d5cd..93bcb7b 100644
--- a/tests/compiler/dart2js/js_backend_cps_ir_constructor_test.dart
+++ b/tests/compiler/dart2js/js_backend_cps_ir_constructor_test.dart
@@ -1,7 +1,6 @@
// Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// VMOptions=-DUSE_CPS_IR=true
// Tests of interceptors.
@@ -68,8 +67,7 @@
}""",
r"""
function(x, y) {
- var v0;
- v0 = new V.Sub(y, x);
+ var v0 = new V.Sub(y, x);
v0.Base0$0();
v0.Sub$2(x, y);
return v0;
@@ -98,11 +96,9 @@
}""",
r"""
function(x, y) {
- var _box_0, v0;
- _box_0 = {};
+ var _box_0 = {}, v0;
_box_0._captured_x1_0 = x;
- v0 = new V.Sub(y, new V.Base_closure(_box_0));
- v0.Base0$0();
+ (v0 = new V.Sub(y, new V.Base_closure(_box_0))).Base0$0();
v0.Base$1(_box_0);
v0.Sub$2(x, y);
return v0;
@@ -130,12 +126,7 @@
""",
r"""
function() {
- var v0, v1, v2, v3, v4;
- v0 = V.foo("y1");
- v1 = V.foo("y2");
- v2 = V.foo("x1");
- v3 = V.foo("x3");
- v4 = V.foo("x2");
+ var v0 = V.foo("y1"), v1 = V.foo("y2"), v2 = V.foo("x1"), v3 = V.foo("x3"), v4 = V.foo("x2");
return new V.Sub(v0, v1, V.foo("y3"), v2, v4, v3);
}"""),
@@ -159,8 +150,7 @@
""",
r"""
function() {
- var v0;
- v0 = new V.Foo();
+ var v0 = new V.Foo();
v0.Bar$5$q$w$y$z("x", null, "w", "y", "z");
return v0;
}"""),
@@ -195,8 +185,7 @@
new C<int>();
}""", r"""
function($T) {
- var v0;
- v0 = H.setRuntimeTypeInfo(new V.C(), [$T]);
+ var v0 = H.setRuntimeTypeInfo(new V.C(), [$T]);
v0.C$0();
return v0;
}"""),
@@ -214,6 +203,69 @@
function($T) {
return H.setRuntimeTypeInfo(new V.C(V.D$($T)), [$T]);
}"""),
+
+
+ const TestEntry.forMethod('generative_constructor(A#)', r"""
+class A {
+ var x;
+ A() : this.b(1);
+ A.b(this.x);
+}
+main() {
+ print(new A().x);
+}""", r"""
+function() {
+ return new V.A(1);
+}"""),
+
+
+const TestEntry.forMethod('function(Foo#make)', r"""
+class Foo {
+ factory Foo.make(x) {
+ print('Foo');
+ return new Foo.create(x);
+ }
+ var x;
+ Foo.create(this.x);
+}
+main() {
+ print(new Foo.make(5));
+}""", r"""
+function(x) {
+ P.print("Foo");
+ return V.Foo$create(x);
+}"""),
+const TestEntry(r"""
+class Foo {
+ factory Foo.make(x) = Foo.create;
+ var x;
+ Foo.create(this.x);
+}
+main() {
+ print(new Foo.make(5));
+}""", r"""
+function() {
+ P.print(V.Foo$create(5));
+ return null;
+}"""),
+const TestEntry(r"""
+class A {
+ factory A(x) = B<int>;
+ get typevar;
+}
+class B<T> implements A {
+ var x;
+ B(this.x);
+
+ get typevar => T;
+}
+main() {
+ new A(5).typevar;
+}""", r"""
+function() {
+ V.B$(5, P.$int).get$typevar();
+ return null;
+}"""),
];
void main() {
diff --git a/tests/compiler/dart2js/js_backend_cps_ir_control_flow_test.dart b/tests/compiler/dart2js/js_backend_cps_ir_control_flow_test.dart
index 9f82e28..a444de9 100644
--- a/tests/compiler/dart2js/js_backend_cps_ir_control_flow_test.dart
+++ b/tests/compiler/dart2js/js_backend_cps_ir_control_flow_test.dart
@@ -1,7 +1,6 @@
// Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// VMOptions=-DUSE_CPS_IR=true
// Tests of control flow statements.
@@ -38,8 +37,8 @@
L0:
while (true)
while (true) {
- while (P.identical(V.foo(true), true))
- if (P.identical(V.foo(false), true)) {
+ while (V.foo(true))
+ if (V.foo(false)) {
P.print(2);
continue L0;
}
@@ -57,20 +56,17 @@
print(2);
}""", """
function() {
- var i;
- i = 0;
+ var i = 0;
L1:
- while (true) {
- if (P.identical(V.foo(true), true)) {
- P.print(1);
- if (!P.identical(V.foo(false), true)) {
- i = V.foo(i);
- continue L1;
- }
- }
- P.print(2);
- return null;
+ while (P.identical(V.foo(true), true)) {
+ P.print(1);
+ if (!P.identical(V.foo(false), true))
+ i = V.foo(i);
+ else
+ break L1;
}
+ P.print(2);
+ return null;
}"""),
const TestEntry("""
foo(a) => a;
@@ -84,7 +80,7 @@
print(3);
}""", """
function() {
- P.identical(V.foo(true), true) ? P.print(1) : P.print(2);
+ V.foo(true) ? P.print(1) : P.print(2);
P.print(3);
return null;
}"""),
@@ -102,7 +98,7 @@
print(3);
}""", """
function() {
- if (P.identical(V.foo(true), true)) {
+ if (V.foo(true)) {
P.print(1);
P.print(1);
} else {
@@ -134,8 +130,7 @@
}
}""","""
function() {
- V.foo();
- P.print("good");
+ P.identical(V.foo(), true) ? P.print("bad") : P.print("good");
return null;
}"""),
];
diff --git a/tests/compiler/dart2js/js_backend_cps_ir_interceptors_test.dart b/tests/compiler/dart2js/js_backend_cps_ir_interceptors_test.dart
index 64515ce..1efa4f7 100644
--- a/tests/compiler/dart2js/js_backend_cps_ir_interceptors_test.dart
+++ b/tests/compiler/dart2js/js_backend_cps_ir_interceptors_test.dart
@@ -1,7 +1,6 @@
// Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// VMOptions=-DUSE_CPS_IR=true
// Tests of interceptors.
@@ -19,8 +18,7 @@
}""",
r"""
function() {
- var g;
- g = 1;
+ var g = 1;
P.print(J.getInterceptor$ns(g).$add(g, 3));
return null;
}"""),
@@ -37,29 +35,19 @@
}""",
r"""
function() {
- var l, i, v0, x, j;
- l = ["hest", ["h", "e", "s", "t"]];
+ var l = ["hest", ["h", "e", "s", "t"]], i, x, j;
P.print(J.getInterceptor$as(l).get$length(l));
i = 0;
- L0:
- while (true) {
- v0 = J.getInterceptor$as(l).get$length(l);
- if (P.identical(J.getInterceptor$n(i).$lt(i, v0), true)) {
- x = J.getInterceptor$as(l).$index(l, i);
- j = 0;
- while (true) {
- v0 = J.getInterceptor$as(x).get$length(x);
- if (P.identical(J.getInterceptor$n(j).$lt(j, v0), true)) {
- P.print(J.getInterceptor$as(x).$index(x, j));
- j = J.getInterceptor$ns(j).$add(j, 1);
- } else {
- i = J.getInterceptor$ns(i).$add(i, 1);
- continue L0;
- }
- }
- } else
- return null;
+ while (J.getInterceptor$n(i).$lt(i, J.getInterceptor$as(l).get$length(l))) {
+ x = J.getInterceptor$as(l).$index(l, i);
+ j = 0;
+ while (J.getInterceptor$n(j).$lt(j, J.getInterceptor$as(x).get$length(x))) {
+ P.print(J.getInterceptor$as(x).$index(x, j));
+ j = J.getInterceptor$ns(j).$add(j, 1);
}
+ i = J.getInterceptor$ns(i).$add(i, 1);
+ }
+ return null;
}"""),
];
diff --git a/tests/compiler/dart2js/js_backend_cps_ir_literals_test.dart b/tests/compiler/dart2js/js_backend_cps_ir_literals_test.dart
index ea90c77..5664553 100644
--- a/tests/compiler/dart2js/js_backend_cps_ir_literals_test.dart
+++ b/tests/compiler/dart2js/js_backend_cps_ir_literals_test.dart
@@ -1,7 +1,6 @@
// Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// VMOptions=-DUSE_CPS_IR=true
// Tests of literals.
diff --git a/tests/compiler/dart2js/js_backend_cps_ir_operators_test.dart b/tests/compiler/dart2js/js_backend_cps_ir_operators_test.dart
index 18aa0c5..bd4eec4 100644
--- a/tests/compiler/dart2js/js_backend_cps_ir_operators_test.dart
+++ b/tests/compiler/dart2js/js_backend_cps_ir_operators_test.dart
@@ -1,7 +1,6 @@
// Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// VMOptions=-DUSE_CPS_IR=true
// Tests of operators.
@@ -43,6 +42,35 @@
P.print(P.identical(V.foo(), true) || P.identical(V.foo(), true));
return null;
}"""),
+
+// Needs interceptor calling convention
+//const TestEntry("""
+//class Foo {
+// operator[]=(index, value) {
+// print(value);
+// }
+//}
+//main() {
+// var foo = new Foo();
+// foo[5] = 6;
+//}""", r"""
+//function() {
+// V.Foo$().$indexSet(5, 6);
+//}
+//"""),
+
+const TestEntry("""
+main() {
+ var list = [1, 2, 3];
+ list[1] = 6;
+ print(list);
+}""", r"""
+function() {
+ var list = [1, 2, 3];
+ J.getInterceptor$a(list).$indexSet(list, 1, 6);
+ P.print(list);
+ return null;
+}"""),
];
void main() {
diff --git a/tests/compiler/dart2js/js_backend_cps_ir_runtime_types_test.dart b/tests/compiler/dart2js/js_backend_cps_ir_runtime_types_test.dart
index debe5b0..907484f 100644
--- a/tests/compiler/dart2js/js_backend_cps_ir_runtime_types_test.dart
+++ b/tests/compiler/dart2js/js_backend_cps_ir_runtime_types_test.dart
@@ -1,7 +1,6 @@
// Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// VMOptions=-DUSE_CPS_IR=true
// Tests for the runtime type implementation.
diff --git a/tests/compiler/dart2js/js_backend_cps_ir_source_information_test.dart b/tests/compiler/dart2js/js_backend_cps_ir_source_information_test.dart
index 9ea9201..163e58d 100644
--- a/tests/compiler/dart2js/js_backend_cps_ir_source_information_test.dart
+++ b/tests/compiler/dart2js/js_backend_cps_ir_source_information_test.dart
@@ -1,7 +1,6 @@
// Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// VMOptions=-DUSE_CPS_IR=true
// Test that the CPS IR code generator generates source information.
@@ -68,13 +67,10 @@
}
runTests(List<TestEntry> tests) {
- Expect.isTrue(const bool.fromEnvironment("USE_CPS_IR"),
- 'Run with USE_CPS_IR=true');
-
for (TestEntry test in tests) {
Map files = {TEST_MAIN_FILE: test.source};
asyncTest(() {
- Compiler compiler = compilerFor(files);
+ Compiler compiler = compilerFor(files, options: <String>['--use-cps-ir']);
Uri uri = Uri.parse('memory:$TEST_MAIN_FILE');
return compiler.run(uri).then((bool success) {
Expect.isTrue(success);
@@ -133,7 +129,7 @@
main() { print('Hello World'); }
""", const ['memory:test.dart:[1,10]']),
const TestEntry("""
-main() {
+main() {
print('Hello');
print('World');
}
diff --git a/tests/compiler/dart2js/js_backend_cps_ir_supercall_test.dart b/tests/compiler/dart2js/js_backend_cps_ir_supercall_test.dart
index 18db6e0..aa72895 100644
--- a/tests/compiler/dart2js/js_backend_cps_ir_supercall_test.dart
+++ b/tests/compiler/dart2js/js_backend_cps_ir_supercall_test.dart
@@ -1,7 +1,6 @@
// Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// VMOptions=-DUSE_CPS_IR=true
// Tests of interceptors.
@@ -64,9 +63,7 @@
}""",
r"""
function(x) {
- var v0;
- v0 = this.field;
- return J.getInterceptor$ns(x).$add(x, v0);
+ return J.getInterceptor$ns(x).$add(x, this.field);
}"""),
diff --git a/tests/compiler/dart2js/js_spec_optimization_test.dart b/tests/compiler/dart2js/js_spec_optimization_test.dart
new file mode 100644
index 0000000..078104f
--- /dev/null
+++ b/tests/compiler/dart2js/js_spec_optimization_test.dart
@@ -0,0 +1,95 @@
+// Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+import 'dart:async';
+import 'package:async_helper/async_helper.dart';
+import 'package:expect/expect.dart';
+import 'compiler_helper.dart';
+
+const String TEST_1 = r"""
+ import 'dart:_foreign_helper';
+ main() {
+ // present: 'Moose'
+ JS('', 'Moose');
+
+ // absent: 'Phantom' - pure.
+ JS('returns: bool;effects:none;depends:none;throws:never', 'Phantom');
+
+ // present: 'Spider' - unused after constant folding 'is', but unpure.
+ print(JS('returns:bool;effects:none;depends:all', 'Spider') is bool);
+
+ // absent: 'Wasp' - unused after constant folding 'is', and unpure.
+ print(JS('returns:bool;effects:none;depends:all;throws:never', 'Wasp')
+ is bool);
+
+ JS('', 'Array'); // absent: "Array"
+ }
+""";
+
+const String TEST_2 = r"""
+ import 'dart:_foreign_helper';
+ main() {
+ var w1 = JS('returns:int;depends:none;effects:none;throws:never',
+ 'foo(#)', 1);
+ var w2 = JS('returns:int;depends:none;effects:none;throws:never',
+ 'foo(#)', 2);
+
+ print([w2, w1]);
+
+ // present: '[foo(2), foo(1)]' - since 'foo' is pure, we expect to generate
+ // code out-of-order.
+ }
+""";
+
+const String TEST_3 = r"""
+ import 'dart:_foreign_helper';
+ main() {
+ var s = JS('String|Null', '"Hello"');
+ var s1 = JS('returns:String;depends:none;effects:none;throws:null(1)',
+ '#.toLowerCase()', s);
+ var s2 = JS('returns:String;depends:none;effects:none;throws:null(1)',
+ '#.toUpperCase()', s);
+ print(s2);
+
+ // absent: 'toLowerCase' - removed since s.toUpperCase() generates the same
+ // noSuchMethod.
+ }
+""";
+
+
+main() {
+ RegExp directivePattern = new RegExp(
+ // \1 \2 \3
+ r'''// *(present|absent): (?:"([^"]*)"|'([^'']*)')''',
+ multiLine: true);
+
+ Future check(String test) {
+ Uri uri = new Uri(scheme: 'dart', path: 'test');
+ var compiler = compilerFor(test, uri, expectedErrors: 0);
+ return compiler.runCompiler(uri).then((_) {
+ var element = findElement(compiler, 'main');
+ var backend = compiler.backend;
+ String generated = backend.assembleCode(element);
+
+ for (Match match in directivePattern.allMatches(test)) {
+ String directive = match.group(1);
+ String pattern = match.groups([2, 3]).where((s) => s != null).single;
+ if (directive == 'present') {
+ Expect.isTrue(generated.contains(pattern),
+ "Cannot find '$pattern' in:\n$generated");
+ } else {
+ assert(directive == 'absent');
+ Expect.isFalse(generated.contains(pattern),
+ "Must not find '$pattern' in:\n$generated");
+ }
+ }
+ });
+ }
+
+ asyncTest(() => Future.wait([
+ check(TEST_1),
+ check(TEST_2),
+ check(TEST_3),
+ ]));
+}
diff --git a/tests/compiler/dart2js/js_throw_behavior_test.dart b/tests/compiler/dart2js/js_throw_behavior_test.dart
new file mode 100644
index 0000000..45d2790
--- /dev/null
+++ b/tests/compiler/dart2js/js_throw_behavior_test.dart
@@ -0,0 +1,99 @@
+// Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+import 'package:expect/expect.dart';
+import 'package:compiler/src/native/native.dart';
+import 'package:compiler/src/js/js.dart' as js;
+
+void test(String source, NativeThrowBehavior expectedThrowBehavior) {
+ js.Template template = js.js.parseForeignJS(source);
+ NativeThrowBehavior throwBehavior =
+ new ThrowBehaviorVisitor().analyze(template.ast);
+ Expect.equals(expectedThrowBehavior, throwBehavior, 'source "$source"');
+}
+
+void main() {
+ final MAY = NativeThrowBehavior.MAY;
+ final MUST = NativeThrowBehavior.MUST;
+ final NEVER = NativeThrowBehavior.NEVER;
+ final NULL_NSM = NativeThrowBehavior.MAY_THROW_ONLY_ON_FIRST_ARGUMENT_ACCESS;
+
+ test('0', NEVER);
+ test('void 0', NEVER);
+ test('#', NEVER);
+ test('void #', NEVER);
+ test('# + 1', NEVER);
+ test('!#', NEVER);
+ test('!!#', NEVER);
+ test('~#', NEVER);
+ test('~~#', NEVER);
+ test('-#', NEVER);
+ test('+#', NEVER);
+ test('-(-#)', NEVER);
+ test('+#', NEVER);
+
+ test('# * #', NEVER);
+ test('# / #', NEVER);
+ test('# % #', NEVER);
+ test('# + #', NEVER);
+ test('# - #', NEVER);
+
+ test('# << #', NEVER);
+ test('# >> #', NEVER);
+ test('# >>> #', NEVER);
+
+ test('# < #', NEVER);
+ test('# > #', NEVER);
+ test('# <= #', NEVER);
+ test('# >= #', NEVER);
+
+ test('# == #', NEVER);
+ test('# != #', NEVER);
+ test('# === #', NEVER);
+ test('# !== #', NEVER);
+
+ test('# & #', NEVER);
+ test('# ^ #', NEVER);
+ test('# | #', NEVER);
+
+ test('# , #', NEVER);
+
+ test('typeof(#) == "string"', NEVER);
+ test('"object" === typeof #', NEVER);
+
+ test('# == 1 || # == 2 || # == 3', NEVER);
+ test('# != 1 && # != 2 && # != 3', NEVER);
+
+ test('#.x', NULL_NSM);
+ test('!!#.x', NULL_NSM);
+ test('#.x + 1', NULL_NSM);
+ test('1 + #.x', NULL_NSM);
+ test('#[#] + 2', NULL_NSM);
+ test('2 + #[#]', NULL_NSM);
+
+ test('#.x == 1 || # == 1', NULL_NSM);
+ test('# == 1 || #.x == 1', MAY);
+
+ test('#[#][#]', MAY);
+ test('# + #[#]', MAY);
+ test('#()', MAY);
+ test('(function(){})()', MAY);
+
+ test('new Date(#)', MAY);
+ test('# in #', MAY);
+
+ test('console', MAY);
+ test('Array', NEVER);
+ test('Object', NEVER);
+
+ test('typeof #', NEVER);
+ test('typeof console', NEVER);
+ test('typeof foo.#', MAY);
+ test('typeof #.foo', NULL_NSM);
+
+ test('throw 123', MUST);
+ test('throw #', MUST);
+ test('throw #.x', MUST); // Could be better: is also an NSM guard.
+ test('throw #.x = 123', MUST);
+}
diff --git a/tests/compiler/dart2js/load_elimination_test.dart b/tests/compiler/dart2js/load_elimination_test.dart
index 8104757..a5d4147 100644
--- a/tests/compiler/dart2js/load_elimination_test.dart
+++ b/tests/compiler/dart2js/load_elimination_test.dart
@@ -2,6 +2,7 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
+import 'dart:async';
import "package:expect/expect.dart";
import "package:async_helper/async_helper.dart";
import 'compiler_helper.dart';
@@ -235,27 +236,31 @@
main() {
- test(String code, Function f) {
- asyncTest(() => compileAll(code, disableInlining: false).then((generated) {
- Expect.isTrue(f(generated));
- }));
+ test(String code, String expected) {
+ return () => compileAll(code, disableInlining: false).then((generated) {
+ Expect.isTrue(generated.contains(expected),
+ "Generated code didn't contain '$expected'.\n"
+ "Test:\n$code, Generated:\n$generated");
+ });
}
- test(TEST_1, (generated) => generated.contains('return 42'));
- test(TEST_2, (generated) => generated.contains('return 42'));
- test(TEST_3, (generated) => generated.contains('return 84'));
- test(TEST_4, (generated) => generated.contains('return t1 + t1'));
- test(TEST_5, (generated) => generated.contains('return 84'));
- test(TEST_6, (generated) => generated.contains('return 84'));
- test(TEST_7, (generated) => generated.contains('return 32'));
- test(TEST_8, (generated) => generated.contains('return a.a'));
- test(TEST_9, (generated) => generated.contains('return a.a'));
- test(TEST_10, (generated) => generated.contains('return 2'));
- test(TEST_11, (generated) => generated.contains('return a.a'));
- test(TEST_12, (generated) => generated.contains('return 6'));
- test(TEST_13, (generated) => generated.contains('return 6'));
- test(TEST_14, (generated) => generated.contains('return t1[0]'));
- test(TEST_15, (generated) => generated.contains('return 42'));
- test(TEST_16, (generated) => generated.contains('return \$.a'));
- test(TEST_17, (generated) => generated.contains('return t1'));
- test(TEST_18, (generated) => generated.contains('return t1'));
+ asyncTest(() => Future.forEach([
+ test(TEST_1, 'return 42'),
+ test(TEST_2, 'return 42'),
+ test(TEST_3, 'return 84'),
+ test(TEST_4, 'return t1 + t1'),
+ test(TEST_5, 'return 84'),
+ test(TEST_6, 'return 84'),
+ test(TEST_7, 'return 32'),
+ test(TEST_8, 'return a.a'),
+ test(TEST_9, 'return a.a'),
+ test(TEST_10, 'return 2'),
+ test(TEST_11, 'return a.a'),
+ test(TEST_12, 'return 6'),
+ test(TEST_13, 'return 6'),
+ test(TEST_14, 'return t1[0]'),
+ test(TEST_15, 'return 42'),
+ test(TEST_16, 'return \$.a'),
+ test(TEST_17, 'return t1'),
+ test(TEST_18, 'return t1'),
+ ], (f) => f()));
}
diff --git a/tests/compiler/dart2js/minify_many_locals_test.dart b/tests/compiler/dart2js/minify_many_locals_test.dart
index 75345a4..4a854e7 100644
--- a/tests/compiler/dart2js/minify_many_locals_test.dart
+++ b/tests/compiler/dart2js/minify_many_locals_test.dart
@@ -9,9 +9,9 @@
// TODO(johnniwinther): This value is some what arbitrary. With the old
// [ResolvedVisitor] we could handle 2000, with the new [ResolvedVisitor] build
-// upon the [SemanticVisitor] we can handle <1300. Update (increase) the value
+// upon the [SemanticVisitor] we can handle <=1000. Update (increase) the value
// when the [SssBuilder] is no longer build upon the [ResolvedVisitor] .
-const int NUMBER_OF_PARAMETERS = 1250;
+const int NUMBER_OF_PARAMETERS = 1000;
main() {
var buffer = new StringBuffer();
diff --git a/tests/compiler/dart2js/mock_libraries.dart b/tests/compiler/dart2js/mock_libraries.dart
index f329e91..54d4490 100644
--- a/tests/compiler/dart2js/mock_libraries.dart
+++ b/tests/compiler/dart2js/mock_libraries.dart
@@ -47,6 +47,8 @@
class LinkedHashMap {
factory LinkedHashMap._empty() => null;
factory LinkedHashMap._literal(elements) => null;
+ static _makeEmpty() => null;
+ static _makeLiteral(elements) => null;
}''',
'List': r'''
class List<E> {
@@ -213,6 +215,10 @@
'subtypeOfRuntimeTypeCast': 'subtypeOfRuntimeTypeCast(object, type) {}',
'throwAbstractClassInstantiationError':
'throwAbstractClassInstantiationError(className) {}',
+ 'checkConcurrentModificationError':
+ 'checkConcurrentModificationError(collection) {}',
+ 'throwConcurrentModificationError':
+ 'throwConcurrentModificationError(collection) {}',
'throwCyclicInit': 'throwCyclicInit(staticName) {}',
'throwExpression': 'throwExpression(e) {}',
'throwNoSuchMethod':
diff --git a/tests/compiler/dart2js/resolver_test.dart b/tests/compiler/dart2js/resolver_test.dart
index 488bf26..ceca9de 100644
--- a/tests/compiler/dart2js/resolver_test.dart
+++ b/tests/compiler/dart2js/resolver_test.dart
@@ -88,6 +88,9 @@
testOverrideHashCodeCheck,
testSupertypeOrder,
testConstConstructorAndNonFinalFields,
+ testCantAssignMethods,
+ testCantAssignFinalAndConsts,
+ testAwaitHint,
], (f) => f()));
}
@@ -1142,3 +1145,196 @@
MessageKind.CONST_CONSTRUCTOR_WITH_NONFINAL_FIELDS_FIELD]);
}));
}
+
+testCantAssignMethods() {
+ // Can't override local functions
+ checkWarningOn('''
+ main() {
+ mname() { mname = 2; };
+ mname();
+ }
+ ''', [MessageKind.ASSIGNING_METHOD]);
+
+ checkWarningOn('''
+ main() {
+ mname() { };
+ mname = 3;
+ }
+ ''', [MessageKind.ASSIGNING_METHOD]);
+
+ // Can't override top-level functions
+ checkWarningOn('''
+ m() {}
+ main() { m = 4; }
+ ''', [MessageKind.ASSIGNING_METHOD]);
+
+ // Can't override instance methods
+ checkWarningOn('''
+ main() { new B().bar(); }
+ class B {
+ mname() {}
+ bar() {
+ mname = () => null;
+ }
+ }
+ ''', [MessageKind.SETTER_NOT_FOUND]);
+ checkWarningOn('''
+ main() { new B().bar(); }
+ class B {
+ mname() {}
+ bar() {
+ this.mname = () => null;
+ }
+ }
+ ''', [MessageKind.SETTER_NOT_FOUND]);
+
+ // Can't override super methods
+ checkWarningOn('''
+ main() { new B().bar(); }
+ class A {
+ mname() {}
+ }
+ class B extends A {
+ bar() {
+ super.mname = () => 6;
+ }
+ }
+ ''', [MessageKind.ASSIGNING_METHOD_IN_SUPER]);
+
+ // But index operators should be OK
+ checkWarningOn('''
+ main() { new B().bar(); }
+ class B {
+ operator[]=(x, y) {}
+ bar() {
+ this[1] = 3; // This is OK
+ }
+ }
+ ''', []);
+ checkWarningOn('''
+ main() { new B().bar(); }
+ class A {
+ operator[]=(x, y) {}
+ }
+ class B extends A {
+ bar() {
+ super[1] = 3; // This is OK
+ }
+ }
+ ''', []);
+}
+
+testCantAssignFinalAndConsts() {
+ // Can't write final or const locals.
+ checkWarningOn('''
+ main() {
+ final x = 1;
+ x = 2;
+ }
+ ''', [MessageKind.CANNOT_RESOLVE_SETTER]);
+ checkWarningOn('''
+ main() {
+ const x = 1;
+ x = 2;
+ }
+ ''', [MessageKind.CANNOT_RESOLVE_SETTER]);
+ checkWarningOn('''
+ final x = 1;
+ main() { x = 3; }
+ ''', [MessageKind.CANNOT_RESOLVE_SETTER]);
+
+ checkWarningOn('''
+ const x = 1;
+ main() { x = 3; }
+ ''', [MessageKind.CANNOT_RESOLVE_SETTER]);
+
+ // Detect assignments to final fields:
+ checkWarningOn('''
+ main() => new B().m();
+ class B {
+ final x = 1;
+ m() { x = 2; }
+ }
+ ''', [MessageKind.SETTER_NOT_FOUND]);
+
+ // ... even if 'this' is explicit:
+ checkWarningOn('''
+ main() => new B().m();
+ class B {
+ final x = 1;
+ m() { this.x = 2; }
+ }
+ ''', [MessageKind.SETTER_NOT_FOUND]);
+
+ // ... and in super class:
+ checkWarningOn('''
+ main() => new B().m();
+ class A {
+ final x = 1;
+ }
+ class B extends A {
+ m() { super.x = 2; }
+ }
+ ''', [MessageKind.SETTER_NOT_FOUND_IN_SUPER]);
+
+ // But non-final fields are OK:
+ checkWarningOn('''
+ main() => new B().m();
+ class A {
+ int x = 1;
+ }
+ class B extends A {
+ m() { super.x = 2; }
+ }
+ ''', []);
+}
+
+/// Helper to test that [script] produces all the given [warnings].
+checkWarningOn(String script, List<MessageKind> warnings) {
+ Expect.isTrue(warnings.length >= 0 && warnings.length <= 2);
+ asyncTest(() => compileScript(script).then((compiler) {
+ Expect.equals(0, compiler.errors.length);
+ Expect.equals(warnings.length, compiler.warnings.length);
+ for (int i = 0; i < warnings.length; i++) {
+ Expect.equals(warnings[i], compiler.warnings[i].message.kind);
+ }
+ }));
+}
+
+testAwaitHint() {
+ check(String script, {String className, String functionName}) {
+ var prefix = className == null
+ ? "Cannot resolve 'await'"
+ : "No member named 'await' in class '$className'";
+ var where = functionName == null
+ ? 'the enclosing function' : "'$functionName'";
+ asyncTest(() => compileScript(script).then((compiler) {
+ Expect.equals(0, compiler.errors.length);
+ Expect.equals(1, compiler.warnings.length);
+ Expect.equals("$prefix.\n"
+ "Did you mean to add the 'async' marker to $where?",
+ '${compiler.warnings[0].message}');
+ }));
+ }
+ check('main() { await -3; }', functionName: 'main');
+ check('main() { () => await -3; }');
+ check('foo() => await -3; main() => foo();', functionName: 'foo');
+ check('''
+ class A {
+ m() => await - 3;
+ }
+ main() => new A().m();
+ ''', className: 'A', functionName: 'm');
+ check('''
+ class A {
+ static m() => await - 3;
+ }
+ main() => A.m();
+ ''', functionName: 'm');
+ check('''
+ class A {
+ m() => () => await - 3;
+ }
+ main() => new A().m();
+ ''', className: 'A');
+}
diff --git a/tests/compiler/dart2js/semantic_visitor_test.dart b/tests/compiler/dart2js/semantic_visitor_test.dart
index cdacd2c..c227fa8 100644
--- a/tests/compiler/dart2js/semantic_visitor_test.dart
+++ b/tests/compiler/dart2js/semantic_visitor_test.dart
@@ -175,7 +175,7 @@
const Visit(VisitKind.VISIT_PARAMETER_INVOKE,
element: 'parameter(m#o)',
arguments: '(null,42)',
- selector: 'Selector(call, call, arity=2)')),
+ selector: 'CallStructure(arity=2)')),
],
'Local variables': const [
// Local variables
@@ -190,7 +190,7 @@
const Visit(VisitKind.VISIT_LOCAL_VARIABLE_INVOKE,
element: 'variable(m#o)',
arguments: '(null,42)',
- selector: 'Selector(call, call, arity=2)')),
+ selector: 'CallStructure(arity=2)')),
],
'Local functions': const [
// Local functions
@@ -201,7 +201,7 @@
const Visit(VisitKind.VISIT_LOCAL_FUNCTION_INVOKE,
element: 'function(m#o)',
arguments: '(null,42)',
- selector: 'Selector(call, call, arity=2)')),
+ selector: 'CallStructure(arity=2)')),
],
'Static fields': const [
// Static fields
@@ -505,6 +505,14 @@
const Visit(VisitKind.VISIT_STATIC_FUNCTION_INVOKE,
element: 'function(C#o)',
arguments: '(null,42)')),
+ const Test(
+ '''
+ class C { static o(a, b) {} }
+ m() => C.o(null);
+ ''',
+ const Visit(VisitKind.VISIT_STATIC_FUNCTION_INCOMPATIBLE_INVOKE,
+ element: 'function(C#o)',
+ arguments: '(null)')),
],
'Top level fields': const [
// Top level fields
@@ -554,6 +562,12 @@
const Visit(VisitKind.VISIT_TOP_LEVEL_FIELD_INVOKE,
element: 'field(o)',
arguments: '(null,42)')),
+ const Test(
+ '''
+ m() => o;
+ ''',
+ const Visit(VisitKind.VISIT_UNRESOLVED_GET,
+ name: 'o')),
],
'Top level properties': const [
// Top level properties
@@ -623,6 +637,14 @@
const Visit(VisitKind.VISIT_TOP_LEVEL_FUNCTION_INVOKE,
element: 'function(o)',
arguments: '(null,42)')),
+ const Test(
+ '''
+ o(a, b) {}
+ m() => o(null);
+ ''',
+ const Visit(VisitKind.VISIT_TOP_LEVEL_FUNCTION_INCOMPATIBLE_INVOKE,
+ element: 'function(o)',
+ arguments: '(null)')),
const Test.prefix(
'''
o(a, b) {}
@@ -631,6 +653,13 @@
const Visit(VisitKind.VISIT_TOP_LEVEL_FUNCTION_INVOKE,
element: 'function(o)',
arguments: '(null,42)')),
+ const Test(
+ '''
+ m() => o(null, 42);
+ ''',
+ const Visit(VisitKind.VISIT_UNRESOLVED_INVOKE,
+ name: 'o',
+ arguments: '(null,42)')),
],
'Dynamic properties': const [
// Dynamic properties
@@ -814,8 +843,17 @@
}
''',
const Visit(VisitKind.VISIT_SUPER_FIELD_INVOKE,
- element: 'field(B#o)',
- arguments: '(null,42)')),
+ element: 'field(B#o)',
+ arguments: '(null,42)')),
+ const Test.clazz(
+ '''
+ class B {
+ }
+ class C extends B {
+ m() => super.o;
+ }
+ ''',
+ const Visit(VisitKind.VISIT_UNRESOLVED_SUPER_GET)),
],
'Super properties': const [
// Super properties
@@ -880,6 +918,28 @@
const Visit(VisitKind.VISIT_SUPER_METHOD_INVOKE,
element: 'function(B#o)',
arguments: '(null,42)')),
+ const Test.clazz(
+ '''
+ class B {
+ o(a, b) {}
+ }
+ class C extends B {
+ m() { super.o(null); }
+ }
+ ''',
+ const Visit(VisitKind.VISIT_SUPER_METHOD_INCOMPATIBLE_INVOKE,
+ element: 'function(B#o)',
+ arguments: '(null)')),
+ const Test.clazz(
+ '''
+ class B {
+ }
+ class C extends B {
+ m() => super.o(null, 42);
+ }
+ ''',
+ const Visit(VisitKind.VISIT_UNRESOLVED_SUPER_INVOKE,
+ arguments: '(null,42)')),
],
'Expression invoke': const [
// Expression invoke
@@ -1119,6 +1179,16 @@
element: 'function(B#+)',
operator: '+',
right: '42')),
+ const Test.clazz(
+ '''
+ class B {}
+ class C extends B {
+ m() => super + 42;
+ }
+ ''',
+ const Visit(VisitKind.VISIT_UNRESOLVED_SUPER_BINARY,
+ operator: '+',
+ right: '42')),
],
'Index': const [
// Index
@@ -1155,6 +1225,16 @@
const Test.clazz(
'''
class B {
+ }
+ class C extends B {
+ m() => super[42];
+ }
+ ''',
+ const Visit(VisitKind.VISIT_UNRESOLVED_SUPER_INDEX,
+ index: '42')),
+ const Test.clazz(
+ '''
+ class B {
operator [](_) => null;
operator []=(a, b) {}
}
@@ -1254,6 +1334,16 @@
const Test.clazz(
'''
class B {
+ }
+ class C extends B {
+ m() => -super;
+ }
+ ''',
+ const Visit(VisitKind.VISIT_UNRESOLVED_SUPER_UNARY,
+ operator: '-')),
+ const Test.clazz(
+ '''
+ class B {
operator ~() => null;
}
class C extends B {
@@ -2075,6 +2165,14 @@
const Visit(VisitKind.VISIT_SUPER_FIELD_SETTER_POSTFIX,
getter: 'field(A#a)', setter: 'setter(B#a)',
operator: '++')),
+
+ const Test(
+ '''
+ set topLevel(var value) { }
+ m() => topLevel++;
+ ''',
+ const Visit(VisitKind.ERROR_UNRESOLVED_POSTFIX,
+ operator: '++')),
],
'Constructor invocations': const [
const Test(
@@ -2095,7 +2193,7 @@
element: 'generative_constructor(Class#)',
arguments: '()',
type: 'Class',
- selector: 'Selector(call, , arity=0)')),
+ selector: 'CallStructure(arity=0)')),
const Test(
'''
class Class {
@@ -2107,7 +2205,7 @@
element: 'generative_constructor(Class#)',
arguments: '(true,42)',
type: 'Class',
- selector: 'Selector(call, , arity=2)')),
+ selector: 'CallStructure(arity=2)')),
const Test(
'''
class Class {
@@ -2119,7 +2217,7 @@
element: 'generative_constructor(Class#named)',
arguments: '(true,42)',
type: 'Class',
- selector: 'Selector(call, named, arity=2)')),
+ selector: 'CallStructure(arity=2)')),
const Test(
'''
class Class {
@@ -2132,7 +2230,7 @@
element: 'generative_constructor(Class#)',
arguments: '(true,42)',
type: 'Class',
- selector: 'Selector(call, , arity=2)')),
+ selector: 'CallStructure(arity=2)')),
const Test(
'''
class Class {
@@ -2145,7 +2243,7 @@
element: 'function(Class#)',
arguments: '(true,42)',
type: 'Class',
- selector: 'Selector(call, , arity=2)')),
+ selector: 'CallStructure(arity=2)')),
const Test(
'''
class Class<T> {
@@ -2161,7 +2259,7 @@
type: 'Class<double>',
target: 'generative_constructor(Class#b)',
targetType: 'Class<Class<int>>',
- selector: 'Selector(call, , arity=2)')),
+ selector: 'CallStructure(arity=2)')),
const Test(
'''
class Class {
@@ -2191,7 +2289,7 @@
element: 'generative_constructor(AbstractClass#)',
type: 'AbstractClass',
arguments: '()',
- selector: 'Selector(call, , arity=0)')),
+ selector: 'CallStructure(arity=0)')),
const Test(
'''
class Class {
@@ -2251,6 +2349,824 @@
],
};
+const Map<String, List<Test>> DECL_TESTS = const {
+ 'Function declarations': const [
+ const Test(
+ '''
+ m(a, b) {}
+ ''',
+ const [
+ const Visit(VisitKind.VISIT_TOP_LEVEL_FUNCTION_DECL,
+ element: 'function(m)',
+ parameters: '(a,b)',
+ body: '{}'),
+ const Visit(VisitKind.VISIT_REQUIRED_PARAMETER_DECL,
+ element: 'parameter(m#a)',
+ index: 0),
+ const Visit(VisitKind.VISIT_REQUIRED_PARAMETER_DECL,
+ element: 'parameter(m#b)',
+ index: 1),
+ ]),
+ const Test(
+ '''
+ m(a, [b]) {}
+ ''',
+ const [
+ const Visit(VisitKind.VISIT_TOP_LEVEL_FUNCTION_DECL,
+ element: 'function(m)',
+ parameters: '(a,[b])',
+ body: '{}'),
+ const Visit(VisitKind.VISIT_REQUIRED_PARAMETER_DECL,
+ element: 'parameter(m#a)',
+ index: 0),
+ const Visit(VisitKind.VISIT_OPTIONAL_PARAMETER_DECL,
+ element: 'parameter(m#b)',
+ index: 1),
+ ]),
+ const Test(
+ '''
+ m(a, [b = null]) {}
+ ''',
+ const [
+ const Visit(VisitKind.VISIT_TOP_LEVEL_FUNCTION_DECL,
+ element: 'function(m)',
+ parameters: '(a,[b=null])',
+ body: '{}'),
+ const Visit(VisitKind.VISIT_REQUIRED_PARAMETER_DECL,
+ element: 'parameter(m#a)',
+ index: 0),
+ const Visit(VisitKind.VISIT_OPTIONAL_PARAMETER_DECL,
+ element: 'parameter(m#b)',
+ constant: 'null',
+ index: 1),
+ ]),
+ const Test(
+ '''
+ m(a, [b = 42]) {}
+ ''',
+ const [
+ const Visit(VisitKind.VISIT_TOP_LEVEL_FUNCTION_DECL,
+ element: 'function(m)',
+ parameters: '(a,[b=42])',
+ body: '{}'),
+ const Visit(VisitKind.VISIT_REQUIRED_PARAMETER_DECL,
+ element: 'parameter(m#a)',
+ index: 0),
+ const Visit(VisitKind.VISIT_OPTIONAL_PARAMETER_DECL,
+ element: 'parameter(m#b)',
+ constant: 42,
+ index: 1),
+ ]),
+ const Test(
+ '''
+ m(a, {b}) {}
+ ''',
+ const [
+ const Visit(VisitKind.VISIT_TOP_LEVEL_FUNCTION_DECL,
+ element: 'function(m)',
+ parameters: '(a,{b})',
+ body: '{}'),
+ const Visit(VisitKind.VISIT_REQUIRED_PARAMETER_DECL,
+ element: 'parameter(m#a)',
+ index: 0),
+ const Visit(VisitKind.VISIT_NAMED_PARAMETER_DECL,
+ element: 'parameter(m#b)'),
+ ]),
+ const Test(
+ '''
+ m(a, {b: null}) {}
+ ''',
+ const [
+ const Visit(VisitKind.VISIT_TOP_LEVEL_FUNCTION_DECL,
+ element: 'function(m)',
+ parameters: '(a,{b: null})',
+ body: '{}'),
+ const Visit(VisitKind.VISIT_REQUIRED_PARAMETER_DECL,
+ element: 'parameter(m#a)',
+ index: 0),
+ const Visit(VisitKind.VISIT_NAMED_PARAMETER_DECL,
+ element: 'parameter(m#b)',
+ constant: 'null'),
+ ]),
+ const Test(
+ '''
+ m(a, {b:42}) {}
+ ''',
+ const [
+ const Visit(VisitKind.VISIT_TOP_LEVEL_FUNCTION_DECL,
+ element: 'function(m)',
+ parameters: '(a,{b: 42})',
+ body: '{}'),
+ const Visit(VisitKind.VISIT_REQUIRED_PARAMETER_DECL,
+ element: 'parameter(m#a)',
+ index: 0),
+ const Visit(VisitKind.VISIT_NAMED_PARAMETER_DECL,
+ element: 'parameter(m#b)',
+ constant: 42),
+ ]),
+ const Test(
+ '''
+ get m => null;
+ ''',
+ const [
+ const Visit(VisitKind.VISIT_TOP_LEVEL_GETTER_DECL,
+ element: 'getter(m)',
+ body: '=>null;'),
+ ]),
+ const Test(
+ '''
+ set m(a) {}
+ ''',
+ const [
+ const Visit(VisitKind.VISIT_TOP_LEVEL_SETTER_DECL,
+ element: 'setter(m)',
+ parameters: '(a)',
+ body: '{}'),
+ const Visit(VisitKind.VISIT_REQUIRED_PARAMETER_DECL,
+ element: 'parameter(m#a)',
+ index: 0),
+ ]),
+ const Test.clazz(
+ '''
+ class C {
+ static m(a, b) {}
+ }
+ ''',
+ const [
+ const Visit(VisitKind.VISIT_STATIC_FUNCTION_DECL,
+ element: 'function(C#m)',
+ parameters: '(a,b)',
+ body: '{}'),
+ const Visit(VisitKind.VISIT_REQUIRED_PARAMETER_DECL,
+ element: 'parameter(m#a)',
+ index: 0),
+ const Visit(VisitKind.VISIT_REQUIRED_PARAMETER_DECL,
+ element: 'parameter(m#b)',
+ index: 1),
+ ]),
+ const Test.clazz(
+ '''
+ class C {
+ static get m => null;
+ }
+ ''',
+ const [
+ const Visit(VisitKind.VISIT_STATIC_GETTER_DECL,
+ element: 'getter(C#m)',
+ body: '=>null;'),
+ ]),
+ const Test.clazz(
+ '''
+ class C {
+ static set m(a) {}
+ }
+ ''',
+ const [
+ const Visit(VisitKind.VISIT_STATIC_SETTER_DECL,
+ element: 'setter(C#m)',
+ parameters: '(a)',
+ body: '{}'),
+ const Visit(VisitKind.VISIT_REQUIRED_PARAMETER_DECL,
+ element: 'parameter(m#a)',
+ index: 0),
+ ]),
+ const Test.clazz(
+ '''
+ class C {
+ m(a, b) {}
+ }
+ ''',
+ const [
+ const Visit(VisitKind.VISIT_INSTANCE_METHOD_DECL,
+ element: 'function(C#m)',
+ parameters: '(a,b)',
+ body: '{}'),
+ const Visit(VisitKind.VISIT_REQUIRED_PARAMETER_DECL,
+ element: 'parameter(m#a)',
+ index: 0),
+ const Visit(VisitKind.VISIT_REQUIRED_PARAMETER_DECL,
+ element: 'parameter(m#b)',
+ index: 1),
+ ]),
+ const Test.clazz(
+ '''
+ class C {
+ get m => null;
+ }
+ ''',
+ const [
+ const Visit(VisitKind.VISIT_INSTANCE_GETTER_DECL,
+ element: 'getter(C#m)',
+ body: '=>null;'),
+ ]),
+ const Test.clazz(
+ '''
+ class C {
+ set m(a) {}
+ }
+ ''',
+ const [
+ const Visit(VisitKind.VISIT_INSTANCE_SETTER_DECL,
+ element: 'setter(C#m)',
+ parameters: '(a)',
+ body: '{}'),
+ const Visit(VisitKind.VISIT_REQUIRED_PARAMETER_DECL,
+ element: 'parameter(m#a)',
+ index: 0),
+ ]),
+ const Test.clazz(
+ '''
+ abstract class C {
+ m(a, b);
+ }
+ ''',
+ const [
+ const Visit(VisitKind.VISIT_ABSTRACT_METHOD_DECL,
+ element: 'function(C#m)',
+ parameters: '(a,b)'),
+ const Visit(VisitKind.VISIT_REQUIRED_PARAMETER_DECL,
+ element: 'parameter(m#a)',
+ index: 0),
+ const Visit(VisitKind.VISIT_REQUIRED_PARAMETER_DECL,
+ element: 'parameter(m#b)',
+ index: 1),
+ ]),
+ const Test.clazz(
+ '''
+ abstract class C {
+ get m;
+ }
+ ''',
+ const [
+ const Visit(VisitKind.VISIT_ABSTRACT_GETTER_DECL,
+ element: 'getter(C#m)'),
+ ]),
+ const Test.clazz(
+ '''
+ abstract class C {
+ set m(a);
+ }
+ ''',
+ const [
+ const Visit(VisitKind.VISIT_ABSTRACT_SETTER_DECL,
+ element: 'setter(C#m)',
+ parameters: '(a)'),
+ const Visit(VisitKind.VISIT_REQUIRED_PARAMETER_DECL,
+ element: 'parameter(m#a)',
+ index: 0),
+ ]),
+ const Test(
+ '''
+ m(a, b) {}
+ ''',
+ const [
+ const Visit(VisitKind.VISIT_TOP_LEVEL_FUNCTION_DECL,
+ element: 'function(m)',
+ parameters: '(a,b)',
+ body: '{}'),
+ const Visit(VisitKind.VISIT_REQUIRED_PARAMETER_DECL,
+ element: 'parameter(m#a)',
+ index: 0),
+ const Visit(VisitKind.VISIT_REQUIRED_PARAMETER_DECL,
+ element: 'parameter(m#b)',
+ index: 1),
+ ]),
+ const Test(
+ '''
+ m() {
+ local(a, b) {}
+ }
+ ''',
+ const [
+ const Visit(VisitKind.VISIT_TOP_LEVEL_FUNCTION_DECL,
+ element: 'function(m)',
+ parameters: '()',
+ body: '{local(a,b){}}'),
+ const Visit(VisitKind.VISIT_LOCAL_FUNCTION_DECL,
+ element: 'function(m#local)',
+ parameters: '(a,b)',
+ body: '{}'),
+ const Visit(VisitKind.VISIT_REQUIRED_PARAMETER_DECL,
+ element: 'parameter(local#a)',
+ index: 0),
+ const Visit(VisitKind.VISIT_REQUIRED_PARAMETER_DECL,
+ element: 'parameter(local#b)',
+ index: 1),
+ ]),
+ const Test(
+ '''
+ m() => (a, b) {};
+ ''',
+ const [
+ const Visit(VisitKind.VISIT_TOP_LEVEL_FUNCTION_DECL,
+ element: 'function(m)',
+ parameters: '()',
+ body: '=>(a,b){};'),
+ const Visit(VisitKind.VISIT_CLOSURE_DECL,
+ element: 'function(m#)',
+ parameters: '(a,b)',
+ body: '{}'),
+ const Visit(VisitKind.VISIT_REQUIRED_PARAMETER_DECL,
+ element: 'parameter(#a)',
+ index: 0),
+ const Visit(VisitKind.VISIT_REQUIRED_PARAMETER_DECL,
+ element: 'parameter(#b)',
+ index: 1),
+ ]),
+ ],
+ 'Constructor declarations': const [
+ const Test.clazz(
+ '''
+ class C {
+ C(a, b);
+ }
+ ''',
+ const [
+ const Visit(VisitKind.VISIT_GENERATIVE_CONSTRUCTOR_DECL,
+ element: 'generative_constructor(C#)',
+ parameters: '(a,b)',
+ body: ';'),
+ const Visit(VisitKind.VISIT_REQUIRED_PARAMETER_DECL,
+ element: 'parameter(#a)',
+ index: 0),
+ const Visit(VisitKind.VISIT_REQUIRED_PARAMETER_DECL,
+ element: 'parameter(#b)',
+ index: 1),
+ ],
+ method: ''),
+ const Test.clazz(
+ '''
+ class C {
+ var b;
+ C(a, this.b);
+ }
+ ''',
+ const [
+ const Visit(VisitKind.VISIT_GENERATIVE_CONSTRUCTOR_DECL,
+ element: 'generative_constructor(C#)',
+ parameters: '(a,this.b)',
+ body: ';'),
+ const Visit(VisitKind.VISIT_REQUIRED_PARAMETER_DECL,
+ element: 'parameter(#a)',
+ index: 0),
+ const Visit(VisitKind.VISIT_REQUIRED_INITIALIZING_FORMAL_DECL,
+ element: 'initializing_formal(#b)',
+ index: 1),
+ ],
+ method: ''),
+ const Test.clazz(
+ '''
+ class C {
+ var b;
+ C(a, [this.b = 42]);
+ }
+ ''',
+ const [
+ const Visit(VisitKind.VISIT_GENERATIVE_CONSTRUCTOR_DECL,
+ element: 'generative_constructor(C#)',
+ parameters: '(a,[this.b=42])',
+ body: ';'),
+ const Visit(VisitKind.VISIT_REQUIRED_PARAMETER_DECL,
+ element: 'parameter(#a)',
+ index: 0),
+ const Visit(VisitKind.VISIT_OPTIONAL_INITIALIZING_FORMAL_DECL,
+ element: 'initializing_formal(#b)',
+ constant: 42,
+ index: 1),
+ ],
+ method: ''),
+ const Test.clazz(
+ '''
+ class C {
+ var b;
+ C(a, {this.b: 42});
+ }
+ ''',
+ const [
+ const Visit(VisitKind.VISIT_GENERATIVE_CONSTRUCTOR_DECL,
+ element: 'generative_constructor(C#)',
+ parameters: '(a,{this.b: 42})',
+ body: ';'),
+ const Visit(VisitKind.VISIT_REQUIRED_PARAMETER_DECL,
+ element: 'parameter(#a)',
+ index: 0),
+ const Visit(VisitKind.VISIT_NAMED_INITIALIZING_FORMAL_DECL,
+ element: 'initializing_formal(#b)',
+ constant: 42),
+ ],
+ method: ''),
+ const Test.clazz(
+ '''
+ class C {
+ C(a, b) : super();
+ }
+ ''',
+ const [
+ const Visit(VisitKind.VISIT_GENERATIVE_CONSTRUCTOR_DECL,
+ element: 'generative_constructor(C#)',
+ parameters: '(a,b)',
+ body: ';'),
+ const Visit(VisitKind.VISIT_REQUIRED_PARAMETER_DECL,
+ element: 'parameter(#a)',
+ index: 0),
+ const Visit(VisitKind.VISIT_REQUIRED_PARAMETER_DECL,
+ element: 'parameter(#b)',
+ index: 1),
+ const Visit(VisitKind.VISIT_SUPER_CONSTRUCTOR_INVOKE,
+ element: 'generative_constructor(Object#)',
+ type: 'Object',
+ arguments: '()',
+ selector: 'Selector(call, super, arity=0)'),
+ ],
+ method: ''),
+ const Test.clazz(
+ '''
+ class C {
+ var field;
+ C(a, b) : this.field = a;
+ }
+ ''',
+ const [
+ const Visit(VisitKind.VISIT_GENERATIVE_CONSTRUCTOR_DECL,
+ element: 'generative_constructor(C#)',
+ parameters: '(a,b)',
+ body: ';'),
+ const Visit(VisitKind.VISIT_REQUIRED_PARAMETER_DECL,
+ element: 'parameter(#a)',
+ index: 0),
+ const Visit(VisitKind.VISIT_REQUIRED_PARAMETER_DECL,
+ element: 'parameter(#b)',
+ index: 1),
+ const Visit(VisitKind.VISIT_FIELD_INITIALIZER,
+ element: 'field(C#field)',
+ rhs: 'a'),
+ ],
+ method: ''),
+ const Test.clazz(
+ '''
+ class C {
+ C(a, b) : this._(a, b);
+ C._(a, b);
+ }
+ ''',
+ const [
+ const Visit(VisitKind.VISIT_REDIRECTING_GENERATIVE_CONSTRUCTOR_DECL,
+ element: 'generative_constructor(C#)',
+ parameters: '(a,b)',
+ initializers: ':this._(a,b)'),
+ const Visit(VisitKind.VISIT_REQUIRED_PARAMETER_DECL,
+ element: 'parameter(#a)',
+ index: 0),
+ const Visit(VisitKind.VISIT_REQUIRED_PARAMETER_DECL,
+ element: 'parameter(#b)',
+ index: 1),
+ const Visit(VisitKind.VISIT_THIS_CONSTRUCTOR_INVOKE,
+ element: 'generative_constructor(C#_)',
+ arguments: '(a,b)',
+ selector: 'Selector(call, _, arity=2)'),
+ ],
+ method: ''),
+ const Test.clazz(
+ '''
+ class C {
+ factory C(a, b) => null;
+ }
+ ''',
+ const [
+ const Visit(VisitKind.VISIT_FACTORY_CONSTRUCTOR_DECL,
+ element: 'function(C#)',
+ parameters: '(a,b)',
+ body: '=>null;'),
+ const Visit(VisitKind.VISIT_REQUIRED_PARAMETER_DECL,
+ element: 'parameter(#a)',
+ index: 0),
+ const Visit(VisitKind.VISIT_REQUIRED_PARAMETER_DECL,
+ element: 'parameter(#b)',
+ index: 1),
+ ],
+ method: ''),
+ const Test.clazz(
+ '''
+ class C {
+ factory C(a, b) = C._;
+ C._(a, b);
+ }
+ ''',
+ const [
+ const Visit(VisitKind.VISIT_REDIRECTING_FACTORY_CONSTRUCTOR_DECL,
+ element: 'function(C#)',
+ parameters: '(a,b)',
+ target: 'generative_constructor(C#_)',
+ type: 'C'),
+ const Visit(VisitKind.VISIT_REQUIRED_PARAMETER_DECL,
+ element: 'parameter(#a)',
+ index: 0),
+ const Visit(VisitKind.VISIT_REQUIRED_PARAMETER_DECL,
+ element: 'parameter(#b)',
+ index: 1),
+ ],
+ method: ''),
+ const Test.clazz(
+ '''
+ class C {
+ factory C(a, b) = D;
+ }
+ class D<T> {
+ D(a, b);
+ }
+ ''',
+ const [
+ const Visit(VisitKind.VISIT_REDIRECTING_FACTORY_CONSTRUCTOR_DECL,
+ element: 'function(C#)',
+ parameters: '(a,b)',
+ target: 'generative_constructor(D#)',
+ type: 'D'),
+ const Visit(VisitKind.VISIT_REQUIRED_PARAMETER_DECL,
+ element: 'parameter(#a)',
+ index: 0),
+ const Visit(VisitKind.VISIT_REQUIRED_PARAMETER_DECL,
+ element: 'parameter(#b)',
+ index: 1),
+ ],
+ method: ''),
+ const Test.clazz(
+ '''
+ class C {
+ factory C(a, b) = D<int>;
+ }
+ class D<T> {
+ D(a, b);
+ }
+ ''',
+ const [
+ const Visit(VisitKind.VISIT_REDIRECTING_FACTORY_CONSTRUCTOR_DECL,
+ element: 'function(C#)',
+ parameters: '(a,b)',
+ target: 'generative_constructor(D#)',
+ type: 'D<int>'),
+ const Visit(VisitKind.VISIT_REQUIRED_PARAMETER_DECL,
+ element: 'parameter(#a)',
+ index: 0),
+ const Visit(VisitKind.VISIT_REQUIRED_PARAMETER_DECL,
+ element: 'parameter(#b)',
+ index: 1),
+ ],
+ method: ''),
+ const Test.clazz(
+ '''
+ class C {
+ factory C(a, b) = D<int>;
+ }
+ class D<T> {
+ factory D(a, b) = E<D<T>>;
+ }
+ class E<S> {
+ E(a, b);
+ }
+ ''',
+ const [
+ const Visit(VisitKind.VISIT_REDIRECTING_FACTORY_CONSTRUCTOR_DECL,
+ element: 'function(C#)',
+ parameters: '(a,b)',
+ target: 'function(D#)',
+ type: 'D<int>'),
+ const Visit(VisitKind.VISIT_REQUIRED_PARAMETER_DECL,
+ element: 'parameter(#a)',
+ index: 0),
+ const Visit(VisitKind.VISIT_REQUIRED_PARAMETER_DECL,
+ element: 'parameter(#b)',
+ index: 1),
+ ],
+ method: ''),
+ ],
+ "Field declarations": const [
+ const Test.clazz(
+ '''
+ class C {
+ var m;
+ }
+ ''',
+ const [
+ const Visit(VisitKind.VISIT_INSTANCE_FIELD_DECL,
+ element: 'field(C#m)'),
+ ]),
+ const Test.clazz(
+ '''
+ class C {
+ var m, n;
+ }
+ ''',
+ const [
+ const Visit(VisitKind.VISIT_INSTANCE_FIELD_DECL,
+ element: 'field(C#m)'),
+ ]),
+ const Test.clazz(
+ '''
+ class C {
+ var m = 42;
+ }
+ ''',
+ const [
+ const Visit(VisitKind.VISIT_INSTANCE_FIELD_DECL,
+ element: 'field(C#m)',
+ rhs: 42),
+ ]),
+ const Test(
+ '''
+ m() {
+ var local;
+ }
+ ''',
+ const [
+ const Visit(VisitKind.VISIT_TOP_LEVEL_FUNCTION_DECL,
+ element: 'function(m)',
+ parameters: '()',
+ body: '{var local;}'),
+ const Visit(VisitKind.VISIT_LOCAL_VARIABLE_DECL,
+ element: 'variable(m#local)'),
+ ]),
+ const Test(
+ '''
+ m() {
+ var local = 42;
+ }
+ ''',
+ const [
+ const Visit(VisitKind.VISIT_TOP_LEVEL_FUNCTION_DECL,
+ element: 'function(m)',
+ parameters: '()',
+ body: '{var local=42;}'),
+ const Visit(VisitKind.VISIT_LOCAL_VARIABLE_DECL,
+ element: 'variable(m#local)',
+ rhs: 42),
+ ]),
+ const Test(
+ '''
+ m() {
+ const local = 42;
+ }
+ ''',
+ const [
+ const Visit(VisitKind.VISIT_TOP_LEVEL_FUNCTION_DECL,
+ element: 'function(m)',
+ parameters: '()',
+ body: '{const local=42;}'),
+ const Visit(VisitKind.VISIT_LOCAL_CONSTANT_DECL,
+ element: 'variable(m#local)',
+ constant: 42),
+ ]),
+ const Test(
+ '''
+ m() {
+ var local1, local2;
+ }
+ ''',
+ const [
+ const Visit(VisitKind.VISIT_TOP_LEVEL_FUNCTION_DECL,
+ element: 'function(m)',
+ parameters: '()',
+ body: '{var local1,local2;}'),
+ const Visit(VisitKind.VISIT_LOCAL_VARIABLE_DECL,
+ element: 'variable(m#local1)'),
+ const Visit(VisitKind.VISIT_LOCAL_VARIABLE_DECL,
+ element: 'variable(m#local2)'),
+ ]),
+ const Test(
+ '''
+ m() {
+ var local1 = 42, local2 = true;
+ }
+ ''',
+ const [
+ const Visit(VisitKind.VISIT_TOP_LEVEL_FUNCTION_DECL,
+ element: 'function(m)',
+ parameters: '()',
+ body: '{var local1=42,local2=true;}'),
+ const Visit(VisitKind.VISIT_LOCAL_VARIABLE_DECL,
+ element: 'variable(m#local1)',
+ rhs: 42),
+ const Visit(VisitKind.VISIT_LOCAL_VARIABLE_DECL,
+ element: 'variable(m#local2)',
+ rhs: true),
+ ]),
+ const Test(
+ '''
+ m() {
+ const local1 = 42, local2 = true;
+ }
+ ''',
+ const [
+ const Visit(VisitKind.VISIT_TOP_LEVEL_FUNCTION_DECL,
+ element: 'function(m)',
+ parameters: '()',
+ body: '{const local1=42,local2=true;}'),
+ const Visit(VisitKind.VISIT_LOCAL_CONSTANT_DECL,
+ element: 'variable(m#local1)',
+ constant: 42),
+ const Visit(VisitKind.VISIT_LOCAL_CONSTANT_DECL,
+ element: 'variable(m#local2)',
+ constant: true),
+ ]),
+ const Test.clazz(
+ '''
+ class C {
+ static var m;
+ }
+ ''',
+ const [
+ const Visit(VisitKind.VISIT_STATIC_FIELD_DECL,
+ element: 'field(C#m)'),
+ ]),
+ const Test.clazz(
+ '''
+ class C {
+ static var m, n;
+ }
+ ''',
+ const [
+ const Visit(VisitKind.VISIT_STATIC_FIELD_DECL,
+ element: 'field(C#m)'),
+ ]),
+ const Test.clazz(
+ '''
+ class C {
+ static var k, l, m, n;
+ }
+ ''',
+ const [
+ const Visit(VisitKind.VISIT_STATIC_FIELD_DECL,
+ element: 'field(C#m)'),
+ ]),
+ const Test.clazz(
+ '''
+ class C {
+ static var m = 42;
+ }
+ ''',
+ const [
+ const Visit(VisitKind.VISIT_STATIC_FIELD_DECL,
+ element: 'field(C#m)',
+ rhs: 42),
+ ]),
+ const Test.clazz(
+ '''
+ class C {
+ static var m = 42, n = true;
+ }
+ ''',
+ const [
+ const Visit(VisitKind.VISIT_STATIC_FIELD_DECL,
+ element: 'field(C#m)',
+ rhs: 42),
+ ]),
+ const Test.clazz(
+ '''
+ class C {
+ static const m = 42;
+ }
+ ''',
+ const [
+ const Visit(VisitKind.VISIT_STATIC_CONSTANT_DECL,
+ element: 'field(C#m)',
+ constant: 42),
+ ]),
+ const Test(
+ '''
+ var m;
+ ''',
+ const [
+ const Visit(VisitKind.VISIT_TOP_LEVEL_FIELD_DECL,
+ element: 'field(m)'),
+ ]),
+ const Test(
+ '''
+ var m, n;
+ ''',
+ const [
+ const Visit(VisitKind.VISIT_TOP_LEVEL_FIELD_DECL,
+ element: 'field(m)'),
+ ]),
+ const Test(
+ '''
+ var m = 42;
+ ''',
+ const [
+ const Visit(VisitKind.VISIT_TOP_LEVEL_FIELD_DECL,
+ element: 'field(m)',
+ rhs: 42),
+ ]),
+ const Test(
+ '''
+ const m = 42;
+ ''',
+ const [
+ const Visit(VisitKind.VISIT_TOP_LEVEL_CONSTANT_DECL,
+ element: 'field(m)',
+ constant: 42),
+ ]),
+ ],
+};
+
main(List<String> arguments) {
asyncTest(() => Future.forEach([
() {
@@ -2259,6 +3175,12 @@
SEND_TESTS,
(elements) => new SemanticSendTestVisitor(elements));
},
+ () {
+ return test(
+ arguments,
+ DECL_TESTS,
+ (elements) => new SemanticDeclarationTestVisitor(elements));
+ },
], (f) => f()));
}
@@ -2301,7 +3223,7 @@
if (expectedVisits is! List) {
expectedVisits = [expectedVisits];
}
- AstElement element;
+ Element element;
String cls = test.cls;
String method = test.method;
if (cls == null) {
@@ -2313,27 +3235,39 @@
"${library.compilationUnit.script.text}");
element = classElement.localLookup(method);
}
- Expect.isNotNull(element, "Element '$method' not found in:\n"
- "${library.compilationUnit.script.text}");
- ResolvedAst resolvedAst = element.resolvedAst;
- SemanticTestVisitor visitor = createVisitor(resolvedAst.elements);
- try {
- compiler.withCurrentElement(resolvedAst.element, () {
- //print(resolvedAst.node.toDebugString());
- resolvedAst.node.accept(visitor);
- });
- } catch (e, s) {
- Expect.fail("$e:\n$s\nIn test:\n"
- "${library.compilationUnit.script.text}");
+
+ void testAstElement(AstElement astElement) {
+ Expect.isNotNull(astElement, "Element '$method' not found in:\n"
+ "${library.compilationUnit.script.text}");
+ ResolvedAst resolvedAst = astElement.resolvedAst;
+ SemanticTestVisitor visitor = createVisitor(resolvedAst.elements);
+ try {
+ compiler.withCurrentElement(resolvedAst.element, () {
+ //print(resolvedAst.node.toDebugString());
+ resolvedAst.node.accept(visitor);
+ });
+ } catch (e, s) {
+ Expect.fail("$e:\n$s\nIn test:\n"
+ "${library.compilationUnit.script.text}");
+ }
+ Expect.listEquals(expectedVisits, visitor.visits,
+ "In test:\n"
+ "${library.compilationUnit.script.text}");
}
- Expect.listEquals(expectedVisits, visitor.visits,
- "In test:\n"
- "${library.compilationUnit.script.text}");
+ if (element.isAbstractField) {
+ AbstractFieldElement abstractFieldElement = element;
+ if (abstractFieldElement.getter != null) {
+ testAstElement(abstractFieldElement.getter);
+ } else if (abstractFieldElement.setter != null) {
+ testAstElement(abstractFieldElement.setter);
+ }
+ } else {
+ testAstElement(element);
+ }
});
});
}
-
abstract class SemanticTestVisitor extends TraversalVisitor {
List<Visit> visits = <Visit>[];
@@ -2417,7 +3351,7 @@
Send node,
ConstantExpression constant,
NodeList arguments,
- Selector selector,
+ CallStructure callStructure,
arg) {
visits.add(new Visit(VisitKind.VISIT_CLASS_TYPE_LITERAL_INVOKE,
constant: constant.getText(), arguments: arguments));
@@ -2525,7 +3459,7 @@
Send node,
ConstantExpression constant,
NodeList arguments,
- Selector selector,
+ CallStructure callStructure,
arg) {
visits.add(new Visit(VisitKind.VISIT_DYNAMIC_TYPE_LITERAL_INVOKE,
constant: constant.getText(), arguments: arguments));
@@ -2613,10 +3547,10 @@
Send node,
LocalFunctionElement function,
NodeList arguments,
- Selector selector,
+ CallStructure callStructure,
arg) {
visits.add(new Visit(VisitKind.VISIT_LOCAL_FUNCTION_INVOKE,
- element: function, arguments: arguments, selector: selector));
+ element: function, arguments: arguments, selector: callStructure));
apply(arguments, arg);
}
@@ -2634,10 +3568,10 @@
Send node,
LocalVariableElement variable,
NodeList arguments,
- Selector selector,
+ CallStructure callStructure,
arg) {
visits.add(new Visit(VisitKind.VISIT_LOCAL_VARIABLE_INVOKE,
- element: variable, arguments: arguments, selector: selector));
+ element: variable, arguments: arguments, selector: callStructure));
apply(arguments, arg);
}
@@ -2665,10 +3599,10 @@
Send node,
ParameterElement parameter,
NodeList arguments,
- Selector selector,
+ CallStructure callStructure,
arg) {
visits.add(new Visit(VisitKind.VISIT_PARAMETER_INVOKE,
- element: parameter, arguments: arguments, selector: selector));
+ element: parameter, arguments: arguments, selector: callStructure));
apply(arguments, arg);
}
@@ -2696,7 +3630,7 @@
Send node,
FieldElement field,
NodeList arguments,
- Selector selector,
+ CallStructure callStructure,
arg) {
visits.add(new Visit(VisitKind.VISIT_STATIC_FIELD_INVOKE,
element: field, arguments: arguments));
@@ -2728,7 +3662,7 @@
Send node,
MethodElement function,
NodeList arguments,
- Selector selector,
+ CallStructure callStructure,
arg) {
visits.add(new Visit(VisitKind.VISIT_STATIC_FUNCTION_INVOKE,
element: function, arguments: arguments));
@@ -2736,6 +3670,18 @@
}
@override
+ visitStaticFunctionIncompatibleInvoke(
+ Send node,
+ MethodElement function,
+ NodeList arguments,
+ CallStructure callStructure,
+ arg) {
+ visits.add(new Visit(VisitKind.VISIT_STATIC_FUNCTION_INCOMPATIBLE_INVOKE,
+ element: function, arguments: arguments));
+ apply(arguments, arg);
+ }
+
+ @override
visitStaticGetterGet(
Send node,
FunctionElement getter,
@@ -2749,7 +3695,7 @@
Send node,
FunctionElement getter,
NodeList arguments,
- Selector selector,
+ CallStructure callStructure,
arg) {
visits.add(new Visit(VisitKind.VISIT_STATIC_GETTER_INVOKE,
element: getter, arguments: arguments));
@@ -2775,11 +3721,24 @@
Node argument,
arg) {
visits.add(new Visit(VisitKind.VISIT_SUPER_BINARY,
- element: function, operator: operator, right: argument));
+ element: function, operator: operator, right: argument));
apply(argument, arg);
}
@override
+ visitUnresolvedSuperBinary(
+ Send node,
+ Element element,
+ BinaryOperator operator,
+ Node argument,
+ arg) {
+ visits.add(new Visit(VisitKind.VISIT_UNRESOLVED_SUPER_BINARY,
+ operator: operator, right: argument));
+ apply(argument, arg);
+ }
+
+
+ @override
visitSuperIndex(
Send node,
FunctionElement function,
@@ -2791,6 +3750,17 @@
}
@override
+ visitUnresolvedSuperIndex(
+ Send node,
+ Element element,
+ Node index,
+ arg) {
+ visits.add(new Visit(VisitKind.VISIT_UNRESOLVED_SUPER_INDEX,
+ index: index));
+ apply(index, arg);
+ }
+
+ @override
visitSuperNotEquals(
Send node,
FunctionElement function,
@@ -2810,7 +3780,7 @@
visitThisInvoke(
Send node,
NodeList arguments,
- Selector selector,
+ CallStructure callStructure,
arg) {
visits.add(new Visit(VisitKind.VISIT_THIS_INVOKE, arguments: arguments));
apply(arguments, arg);
@@ -2860,7 +3830,7 @@
Send node,
FieldElement field,
NodeList arguments,
- Selector selector,
+ CallStructure callStructure,
arg) {
visits.add(new Visit(VisitKind.VISIT_TOP_LEVEL_FIELD_INVOKE,
element: field, arguments: arguments));
@@ -2892,7 +3862,7 @@
Send node,
MethodElement function,
NodeList arguments,
- Selector selector,
+ CallStructure callStructure,
arg) {
visits.add(new Visit(VisitKind.VISIT_TOP_LEVEL_FUNCTION_INVOKE,
element: function, arguments: arguments));
@@ -2900,6 +3870,18 @@
}
@override
+ visitTopLevelFunctionIncompatibleInvoke(
+ Send node,
+ MethodElement function,
+ NodeList arguments,
+ CallStructure callStructure,
+ arg) {
+ visits.add(new Visit(VisitKind.VISIT_TOP_LEVEL_FUNCTION_INCOMPATIBLE_INVOKE,
+ element: function, arguments: arguments));
+ apply(arguments, arg);
+ }
+
+ @override
visitTopLevelGetterGet(
Send node,
FunctionElement getter,
@@ -2913,7 +3895,7 @@
Send node,
FunctionElement getter,
NodeList arguments,
- Selector selector,
+ CallStructure callStructure,
arg) {
visits.add(new Visit(VisitKind.VISIT_TOP_LEVEL_GETTER_INVOKE,
element: getter, arguments: arguments));
@@ -2945,7 +3927,7 @@
Send node,
TypeVariableElement element,
NodeList arguments,
- Selector selector,
+ CallStructure callStructure,
arg) {
visits.add(new Visit(VisitKind.VISIT_TYPE_VARIABLE_TYPE_LITERAL_INVOKE,
element: element, arguments: arguments));
@@ -2977,7 +3959,7 @@
Send node,
ConstantExpression constant,
NodeList arguments,
- Selector selector,
+ CallStructure callStructure,
arg) {
visits.add(new Visit(VisitKind.VISIT_TYPEDEF_TYPE_LITERAL_INVOKE,
constant: constant.getText(), arguments: arguments));
@@ -3024,11 +4006,19 @@
}
@override
+ visitUnresolvedSuperGet(
+ Send node,
+ Element element,
+ arg) {
+ visits.add(new Visit(VisitKind.VISIT_UNRESOLVED_SUPER_GET));
+ }
+
+ @override
visitSuperFieldInvoke(
Send node,
FieldElement field,
NodeList arguments,
- Selector selector,
+ CallStructure callStructure,
arg) {
visits.add(new Visit(VisitKind.VISIT_SUPER_FIELD_INVOKE,
element: field, arguments: arguments));
@@ -3036,6 +4026,18 @@
}
@override
+ visitUnresolvedSuperInvoke(
+ Send node,
+ Element element,
+ NodeList arguments,
+ Selector selector,
+ arg) {
+ visits.add(new Visit(VisitKind.VISIT_UNRESOLVED_SUPER_INVOKE,
+ arguments: arguments));
+ apply(arguments, arg);
+ }
+
+ @override
visitSuperFieldSet(
SendSet node,
FieldElement field,
@@ -3059,7 +4061,7 @@
Send node,
MethodElement method,
NodeList arguments,
- Selector selector,
+ CallStructure callStructure,
arg) {
visits.add(new Visit(VisitKind.VISIT_SUPER_METHOD_INVOKE,
element: method, arguments: arguments));
@@ -3067,6 +4069,18 @@
}
@override
+ visitSuperMethodIncompatibleInvoke(
+ Send node,
+ MethodElement method,
+ NodeList arguments,
+ CallStructure callStructure,
+ arg) {
+ visits.add(new Visit(VisitKind.VISIT_SUPER_METHOD_INCOMPATIBLE_INVOKE,
+ element: method, arguments: arguments));
+ apply(arguments, arg);
+ }
+
+ @override
visitSuperGetterGet(
Send node,
FunctionElement getter,
@@ -3079,7 +4093,7 @@
Send node,
FunctionElement getter,
NodeList arguments,
- Selector selector,
+ CallStructure callStructure,
arg) {
visits.add(new Visit(VisitKind.VISIT_SUPER_GETTER_INVOKE,
element: getter, arguments: arguments));
@@ -3108,6 +4122,16 @@
}
@override
+ visitUnresolvedSuperUnary(
+ Send node,
+ UnaryOperator operator,
+ Element element,
+ arg) {
+ visits.add(new Visit(VisitKind.VISIT_UNRESOLVED_SUPER_UNARY,
+ operator: operator));
+ }
+
+ @override
visitEquals(
Send node,
Node left,
@@ -3241,7 +4265,7 @@
Send node,
FunctionElement setter,
NodeList arguments,
- Selector selector,
+ CallStructure callStructure,
arg) {
// TODO: implement errorStaticSetterInvoke
}
@@ -3277,7 +4301,7 @@
Send node,
FunctionElement setter,
NodeList arguments,
- Selector selector,
+ CallStructure callStructure,
arg) {
// TODO: implement errorSuperSetterInvoke
}
@@ -3313,7 +4337,7 @@
Send node,
FunctionElement setter,
NodeList arguments,
- Selector selector,
+ CallStructure callStructure,
arg) {
// TODO: implement errorTopLevelSetterInvoke
}
@@ -4078,7 +5102,7 @@
Send node,
ConstantExpression constant,
NodeList arguments,
- Selector selector,
+ CallStructure callStructure,
arg) {
// TODO: implement visitConstantInvoke
}
@@ -4094,21 +5118,22 @@
}
@override
- errorUnresolvedGet(
+ visitUnresolvedGet(
Send node,
- ErroneousElement element,
+ Element element,
arg) {
- // TODO: implement errorUnresolvedGet
+ visits.add(new Visit(VisitKind.VISIT_UNRESOLVED_GET, name: element.name));
}
@override
- errorUnresolvedInvoke(
+ visitUnresolvedInvoke(
Send node,
- ErroneousElement element,
+ Element element,
NodeList arguments,
Selector selector,
arg) {
- // TODO: implement errorUnresolvedInvoke
+ visits.add(new Visit(VisitKind.VISIT_UNRESOLVED_INVOKE,
+ name: element.name, arguments: arguments));
}
@override
@@ -4117,7 +5142,8 @@
ErroneousElement element,
IncDecOperator operator,
arg) {
- // TODO: implement errorUnresolvedPostfix
+ visits.add(new Visit(
+ VisitKind.ERROR_UNRESOLVED_POSTFIX, operator: operator));
}
@override
@@ -4158,16 +5184,6 @@
}
@override
- errorUnresolvedSuperBinary(
- Send node,
- ErroneousElement element,
- BinaryOperator operator,
- Node argument,
- arg) {
- // TODO: implement errorUnresolvedSuperBinary
- }
-
- @override
errorUnresolvedSuperCompoundIndexSet(
Send node,
ErroneousElement element,
@@ -4189,24 +5205,6 @@
}
@override
- errorUnresolvedSuperUnary(
- Send node,
- UnaryOperator operator,
- ErroneousElement element,
- arg) {
- // TODO: implement errorUnresolvedSuperUnary
- }
-
- @override
- errorUnresolvedSuperIndex(
- Send node,
- Element element,
- Node index,
- arg) {
- // TODO: implement errorUnresolvedSuperIndex
- }
-
- @override
errorUnresolvedSuperIndexPostfix(
Send node,
Element function,
@@ -4325,14 +5323,14 @@
ConstructorElement constructor,
InterfaceType type,
NodeList arguments,
- Selector selector,
+ CallStructure callStructure,
arg) {
visits.add(new Visit(
VisitKind.VISIT_FACTORY_CONSTRUCTOR_INVOKE,
element: constructor,
type: type,
arguments: arguments,
- selector: selector));
+ selector: callStructure));
apply(arguments, arg);
}
@@ -4342,14 +5340,14 @@
ConstructorElement constructor,
InterfaceType type,
NodeList arguments,
- Selector selector,
+ CallStructure callStructure,
arg) {
visits.add(new Visit(
VisitKind.VISIT_GENERATIVE_CONSTRUCTOR_INVOKE,
element: constructor,
type: type,
arguments: arguments,
- selector: selector));
+ selector: callStructure));
apply(arguments, arg);
}
@@ -4361,7 +5359,7 @@
ConstructorElement effectiveTarget,
InterfaceType effectiveTargetType,
NodeList arguments,
- Selector selector,
+ CallStructure callStructure,
arg) {
visits.add(new Visit(
VisitKind.VISIT_REDIRECTING_FACTORY_CONSTRUCTOR_INVOKE,
@@ -4370,7 +5368,7 @@
target: effectiveTarget,
targetType: effectiveTargetType,
arguments: arguments,
- selector: selector));
+ selector: callStructure));
apply(arguments, arg);
}
@@ -4380,14 +5378,14 @@
ConstructorElement constructor,
InterfaceType type,
NodeList arguments,
- Selector selector,
+ CallStructure callStructure,
arg) {
visits.add(new Visit(
VisitKind.VISIT_REDIRECTING_GENERATIVE_CONSTRUCTOR_INVOKE,
element: constructor,
type: type,
arguments: arguments,
- selector: selector));
+ selector: callStructure));
apply(arguments, arg);
}
@@ -4397,16 +5395,639 @@
ConstructorElement constructor,
InterfaceType type,
NodeList arguments,
- Selector selector,
+ CallStructure callStructure,
arg) {
visits.add(new Visit(
VisitKind.ERROR_ABSTRACT_CLASS_CONSTRUCTOR_INVOKE,
element: constructor,
type: type,
arguments: arguments,
+ selector: callStructure));
+ apply(arguments, arg);
+ }
+
+ @override
+ errorUnresolvedRedirectingFactoryConstructorInvoke(
+ NewExpression node,
+ ConstructorElement constructor,
+ InterfaceType type,
+ NodeList arguments,
+ Selector selector,
+ arg) {
+ visits.add(new Visit(
+ VisitKind.ERROR_UNRESOLVED_REDIRECTING_FACTORY_CONSTRUCTOR_INVOKE,
+ element: constructor,
+ type: type,
+ arguments: arguments,
selector: selector));
apply(arguments, arg);
}
+}
+
+class SemanticDeclarationTestVisitor extends SemanticTestVisitor {
+
+ SemanticDeclarationTestVisitor(TreeElements elements) : super(elements);
+
+ @override
+ errorUnresolvedSuperConstructorInvoke(
+ Send node,
+ Element element,
+ NodeList arguments,
+ Selector selector,
+ arg) {
+ // TODO: implement errorUnresolvedSuperConstructorInvoke
+ }
+
+ @override
+ errorUnresolvedThisConstructorInvoke(
+ Send node,
+ Element element,
+ NodeList arguments,
+ Selector selector,
+ arg) {
+ // TODO: implement errorUnresolvedThisConstructorInvoke
+ }
+
+ @override
+ visitAbstractMethodDeclaration(
+ FunctionExpression node,
+ MethodElement method,
+ NodeList parameters,
+ arg) {
+ visits.add(new Visit(VisitKind.VISIT_ABSTRACT_METHOD_DECL,
+ element: method, parameters: parameters));
+ applyParameters(parameters, arg);
+ }
+
+ @override
+ visitClosureDeclaration(
+ FunctionExpression node,
+ LocalFunctionElement function,
+ NodeList parameters,
+ Node body,
+ arg) {
+ visits.add(new Visit(VisitKind.VISIT_CLOSURE_DECL,
+ element: function, parameters: parameters, body: body));
+ applyParameters(parameters, arg);
+ apply(body, arg);
+ }
+
+ @override
+ visitFactoryConstructorDeclaration(
+ FunctionExpression node,
+ ConstructorElement constructor,
+ NodeList parameters,
+ Node body,
+ arg) {
+ visits.add(new Visit(VisitKind.VISIT_FACTORY_CONSTRUCTOR_DECL,
+ element: constructor, parameters: parameters, body: body));
+ applyParameters(parameters, arg);
+ apply(body, arg);
+ }
+
+ @override
+ visitFieldInitializer(
+ SendSet node,
+ FieldElement field,
+ Node initializer,
+ arg) {
+ visits.add(new Visit(VisitKind.VISIT_FIELD_INITIALIZER,
+ element: field, rhs: initializer));
+ apply(initializer, arg);
+ }
+
+ @override
+ visitGenerativeConstructorDeclaration(
+ FunctionExpression node,
+ ConstructorElement constructor,
+ NodeList parameters,
+ NodeList initializers,
+ Node body,
+ arg) {
+ visits.add(new Visit(VisitKind.VISIT_GENERATIVE_CONSTRUCTOR_DECL,
+ element: constructor, parameters: parameters, body: body));
+ applyParameters(parameters, arg);
+ applyInitializers(initializers, arg);
+ apply(body, arg);
+ }
+
+ @override
+ visitInstanceMethodDeclaration(
+ FunctionExpression node,
+ MethodElement method,
+ NodeList parameters,
+ Node body,
+ arg) {
+ visits.add(new Visit(VisitKind.VISIT_INSTANCE_METHOD_DECL,
+ element: method, parameters: parameters, body: body));
+ applyParameters(parameters, arg);
+ apply(body, arg);
+ }
+
+ @override
+ visitLocalFunctionDeclaration(
+ FunctionExpression node,
+ LocalFunctionElement function,
+ NodeList parameters,
+ Node body,
+ arg) {
+ visits.add(new Visit(VisitKind.VISIT_LOCAL_FUNCTION_DECL,
+ element: function, parameters: parameters, body: body));
+ applyParameters(parameters, arg);
+ apply(body, arg);
+ }
+
+ @override
+ visitRedirectingFactoryConstructorDeclaration(
+ FunctionExpression node,
+ ConstructorElement constructor,
+ NodeList parameters,
+ InterfaceType redirectionType,
+ ConstructorElement redirectionTarget,
+ arg) {
+ visits.add(new Visit(
+ VisitKind.VISIT_REDIRECTING_FACTORY_CONSTRUCTOR_DECL,
+ element: constructor,
+ parameters: parameters,
+ target: redirectionTarget,
+ type: redirectionType));
+ applyParameters(parameters, arg);
+ }
+
+ @override
+ visitRedirectingGenerativeConstructorDeclaration(
+ FunctionExpression node,
+ ConstructorElement constructor,
+ NodeList parameters,
+ NodeList initializers,
+ arg) {
+ visits.add(new Visit(
+ VisitKind.VISIT_REDIRECTING_GENERATIVE_CONSTRUCTOR_DECL,
+ element: constructor,
+ parameters: parameters,
+ initializers: initializers));
+ applyParameters(parameters, arg);
+ applyInitializers(initializers, arg);
+ }
+
+ @override
+ visitStaticFunctionDeclaration(
+ FunctionExpression node,
+ MethodElement function,
+ NodeList parameters,
+ Node body,
+ arg) {
+ visits.add(new Visit(VisitKind.VISIT_STATIC_FUNCTION_DECL,
+ element: function, parameters: parameters, body: body));
+ applyParameters(parameters, arg);
+ apply(body, arg);
+ }
+
+ @override
+ visitSuperConstructorInvoke(
+ Send node,
+ ConstructorElement superConstructor,
+ InterfaceType type,
+ NodeList arguments,
+ Selector selector,
+ arg) {
+ visits.add(new Visit(VisitKind.VISIT_SUPER_CONSTRUCTOR_INVOKE,
+ element: superConstructor, type: type,
+ arguments: arguments, selector: selector));
+ apply(arguments, arg);
+ }
+
+ @override
+ visitThisConstructorInvoke(
+ Send node,
+ ConstructorElement thisConstructor,
+ NodeList arguments,
+ Selector selector,
+ arg) {
+ visits.add(new Visit(VisitKind.VISIT_THIS_CONSTRUCTOR_INVOKE,
+ element: thisConstructor, arguments: arguments, selector: selector));
+ apply(arguments, arg);
+ }
+
+ @override
+ visitTopLevelFunctionDeclaration(
+ FunctionExpression node,
+ MethodElement function,
+ NodeList parameters,
+ Node body,
+ arg) {
+ visits.add(new Visit(VisitKind.VISIT_TOP_LEVEL_FUNCTION_DECL,
+ element: function, parameters: parameters, body: body));
+ applyParameters(parameters, arg);
+ apply(body, arg);
+ }
+
+ @override
+ errorUnresolvedFieldInitializer(
+ SendSet node,
+ Element element,
+ Node initializer,
+ arg) {
+ // TODO: implement errorUnresolvedFieldInitializer
+ }
+
+ @override
+ visitOptionalParameterDeclaration(
+ VariableDefinitions node,
+ Node definition,
+ ParameterElement parameter,
+ ConstantExpression defaultValue,
+ int index,
+ arg) {
+ visits.add(new Visit(VisitKind.VISIT_OPTIONAL_PARAMETER_DECL,
+ element: parameter,
+ constant: defaultValue != null ? defaultValue.getText() : null,
+ index: index));
+ }
+
+ @override
+ visitParameterDeclaration(
+ VariableDefinitions node,
+ Node definition,
+ ParameterElement parameter,
+ int index,
+ arg) {
+ visits.add(new Visit(VisitKind.VISIT_REQUIRED_PARAMETER_DECL,
+ element: parameter, index: index));
+ }
+
+ @override
+ visitInitializingFormalDeclaration(
+ VariableDefinitions node,
+ Node definition,
+ InitializingFormalElement initializingFormal,
+ int index,
+ arg) {
+ visits.add(new Visit(VisitKind.VISIT_REQUIRED_INITIALIZING_FORMAL_DECL,
+ element: initializingFormal, index: index));
+ }
+
+ @override
+ visitLocalVariableDeclaration(
+ VariableDefinitions node,
+ Node definition,
+ LocalVariableElement variable,
+ Node initializer,
+ arg) {
+ visits.add(new Visit(VisitKind.VISIT_LOCAL_VARIABLE_DECL,
+ element: variable, rhs: initializer));
+ if (initializer != null) {
+ apply(initializer, arg);
+ }
+ return null;
+ }
+
+ @override
+ visitLocalConstantDeclaration(
+ VariableDefinitions node,
+ Node definition,
+ LocalVariableElement variable,
+ ConstantExpression constant,
+ arg) {
+ visits.add(new Visit(VisitKind.VISIT_LOCAL_CONSTANT_DECL,
+ element: variable, constant: constant.getText()));
+ return null;
+ }
+
+ @override
+ visitNamedInitializingFormalDeclaration(
+ VariableDefinitions node,
+ Node definition,
+ InitializingFormalElement initializingFormal,
+ ConstantExpression defaultValue,
+ arg) {
+ visits.add(new Visit(VisitKind.VISIT_NAMED_INITIALIZING_FORMAL_DECL,
+ element: initializingFormal,
+ constant: defaultValue != null ? defaultValue.getText() : null));
+ }
+
+ @override
+ visitNamedParameterDeclaration(
+ VariableDefinitions node,
+ Node definition,
+ ParameterElement parameter,
+ ConstantExpression defaultValue,
+ arg) {
+ visits.add(new Visit(VisitKind.VISIT_NAMED_PARAMETER_DECL,
+ element: parameter,
+ constant: defaultValue != null ? defaultValue.getText() : null));
+ }
+
+ @override
+ visitOptionalInitializingFormalDeclaration(
+ VariableDefinitions node,
+ Node definition,
+ InitializingFormalElement initializingFormal,
+ ConstantExpression defaultValue,
+ int index,
+ arg) {
+ visits.add(new Visit(VisitKind.VISIT_OPTIONAL_INITIALIZING_FORMAL_DECL,
+ element: initializingFormal,
+ constant: defaultValue != null ? defaultValue.getText() : null,
+ index: index));
+ }
+
+ @override
+ visitInstanceFieldDeclaration(
+ VariableDefinitions node,
+ Node definition,
+ FieldElement field,
+ Node initializer,
+ arg) {
+ visits.add(new Visit(VisitKind.VISIT_INSTANCE_FIELD_DECL,
+ element: field, rhs: initializer));
+ if (initializer != null) {
+ apply(initializer, arg);
+ }
+ return null;
+ }
+
+ @override
+ visitStaticConstantDeclaration(
+ VariableDefinitions node,
+ Node definition,
+ FieldElement field,
+ ConstantExpression constant,
+ arg) {
+ visits.add(new Visit(VisitKind.VISIT_STATIC_CONSTANT_DECL,
+ element: field, constant: constant.getText()));
+ return null;
+ }
+
+ @override
+ visitStaticFieldDeclaration(
+ VariableDefinitions node,
+ Node definition,
+ FieldElement field,
+ Node initializer,
+ arg) {
+ visits.add(new Visit(VisitKind.VISIT_STATIC_FIELD_DECL,
+ element: field, rhs: initializer));
+ if (initializer != null) {
+ apply(initializer, arg);
+ }
+ return null;
+ }
+
+ @override
+ visitTopLevelConstantDeclaration(
+ VariableDefinitions node,
+ Node definition,
+ FieldElement field,
+ ConstantExpression constant,
+ arg) {
+ visits.add(new Visit(VisitKind.VISIT_TOP_LEVEL_CONSTANT_DECL,
+ element: field, constant: constant.getText()));
+ return null;
+ }
+
+ @override
+ visitTopLevelFieldDeclaration(
+ VariableDefinitions node,
+ Node definition,
+ FieldElement field,
+ Node initializer,
+ arg) {
+ visits.add(new Visit(VisitKind.VISIT_TOP_LEVEL_FIELD_DECL,
+ element: field, rhs: initializer));
+ if (initializer != null) {
+ apply(initializer, arg);
+ }
+ return null;
+ }
+
+ @override
+ visitAbstractGetterDeclaration(
+ FunctionExpression node,
+ MethodElement getter,
+ arg) {
+ visits.add(new Visit(VisitKind.VISIT_ABSTRACT_GETTER_DECL,
+ element: getter));
+ return null;
+ }
+
+ @override
+ visitAbstractSetterDeclaration(
+ FunctionExpression node,
+ MethodElement setter,
+ NodeList parameters,
+ arg) {
+ visits.add(new Visit(VisitKind.VISIT_ABSTRACT_SETTER_DECL,
+ element: setter, parameters: parameters));
+ applyParameters(parameters, arg);
+ return null;
+ }
+
+ @override
+ visitInstanceGetterDeclaration(
+ FunctionExpression node,
+ MethodElement getter,
+ Node body,
+ arg) {
+ visits.add(new Visit(VisitKind.VISIT_INSTANCE_GETTER_DECL,
+ element: getter, body: body));
+ apply(body, arg);
+ return null;
+ }
+
+ @override
+ visitInstanceSetterDeclaration(
+ FunctionExpression node,
+ MethodElement setter,
+ NodeList parameters,
+ Node body,
+ arg) {
+ visits.add(new Visit(VisitKind.VISIT_INSTANCE_SETTER_DECL,
+ element: setter, parameters: parameters, body: body));
+ applyParameters(parameters, arg);
+ apply(body, arg);
+ return null;
+ }
+
+ @override
+ visitTopLevelGetterDeclaration(
+ FunctionExpression node,
+ MethodElement getter,
+ Node body,
+ arg) {
+ visits.add(new Visit(VisitKind.VISIT_TOP_LEVEL_GETTER_DECL,
+ element: getter, body: body));
+ apply(body, arg);
+ return null;
+ }
+
+ @override
+ visitTopLevelSetterDeclaration(
+ FunctionExpression node,
+ MethodElement setter,
+ NodeList parameters,
+ Node body,
+ arg) {
+ visits.add(new Visit(VisitKind.VISIT_TOP_LEVEL_SETTER_DECL,
+ element: setter, parameters: parameters, body: body));
+ applyParameters(parameters, arg);
+ apply(body, arg);
+ return null;
+ }
+
+ @override
+ visitStaticGetterDeclaration(
+ FunctionExpression node,
+ MethodElement getter,
+ Node body,
+ arg) {
+ visits.add(new Visit(VisitKind.VISIT_STATIC_GETTER_DECL,
+ element: getter, body: body));
+ apply(body, arg);
+ return null;
+ }
+
+ @override
+ visitStaticSetterDeclaration(
+ FunctionExpression node,
+ MethodElement setter,
+ NodeList parameters,
+ Node body,
+ arg) {
+ visits.add(new Visit(VisitKind.VISIT_STATIC_SETTER_DECL,
+ element: setter, parameters: parameters, body: body));
+ applyParameters(parameters, arg);
+ apply(body, arg);
+ return null;
+ }
+
+ @override
+ errorUnresolvedClassConstructorInvoke(
+ NewExpression node,
+ Element constructor,
+ MalformedType type,
+ NodeList arguments,
+ Selector selector,
+ arg) {
+ // TODO(johnniwinther): Test [type] and [selector].
+ visits.add(new Visit(
+ VisitKind.ERROR_UNRESOLVED_CLASS_CONSTRUCTOR_INVOKE,
+ arguments: arguments));
+ apply(arguments, arg);
+ }
+
+ @override
+ errorUnresolvedConstructorInvoke(
+ NewExpression node,
+ Element constructor,
+ DartType type,
+ NodeList arguments,
+ Selector selector,
+ arg) {
+ // TODO(johnniwinther): Test [type] and [selector].
+ visits.add(new Visit(
+ VisitKind.ERROR_UNRESOLVED_CONSTRUCTOR_INVOKE,
+ arguments: arguments));
+ apply(arguments, arg);
+ }
+
+ @override
+ visitConstConstructorInvoke(
+ NewExpression node,
+ ConstructedConstantExpression constant,
+ arg) {
+ visits.add(new Visit(VisitKind.VISIT_CONST_CONSTRUCTOR_INVOKE,
+ constant: constant.getText()));
+ }
+
+ @override
+ visitFactoryConstructorInvoke(
+ NewExpression node,
+ ConstructorElement constructor,
+ InterfaceType type,
+ NodeList arguments,
+ CallStructure callStructure,
+ arg) {
+ visits.add(new Visit(
+ VisitKind.VISIT_FACTORY_CONSTRUCTOR_INVOKE,
+ element: constructor,
+ type: type,
+ arguments: arguments,
+ selector: callStructure));
+ apply(arguments, arg);
+ }
+
+ @override
+ visitGenerativeConstructorInvoke(
+ NewExpression node,
+ ConstructorElement constructor,
+ InterfaceType type,
+ NodeList arguments,
+ CallStructure callStructure,
+ arg) {
+ visits.add(new Visit(
+ VisitKind.VISIT_GENERATIVE_CONSTRUCTOR_INVOKE,
+ element: constructor,
+ type: type,
+ arguments: arguments,
+ selector: callStructure));
+ apply(arguments, arg);
+ }
+
+ @override
+ visitRedirectingFactoryConstructorInvoke(
+ NewExpression node,
+ ConstructorElement constructor,
+ InterfaceType type,
+ ConstructorElement effectiveTarget,
+ InterfaceType effectiveTargetType,
+ NodeList arguments,
+ CallStructure callStructure,
+ arg) {
+ visits.add(new Visit(
+ VisitKind.VISIT_REDIRECTING_FACTORY_CONSTRUCTOR_INVOKE,
+ element: constructor,
+ type: type,
+ target: effectiveTarget,
+ targetType: effectiveTargetType,
+ arguments: arguments,
+ selector: callStructure));
+ apply(arguments, arg);
+ }
+
+ @override
+ visitRedirectingGenerativeConstructorInvoke(
+ NewExpression node,
+ ConstructorElement constructor,
+ InterfaceType type,
+ NodeList arguments,
+ CallStructure callStructure,
+ arg) {
+ visits.add(new Visit(
+ VisitKind.VISIT_REDIRECTING_GENERATIVE_CONSTRUCTOR_INVOKE,
+ element: constructor,
+ type: type,
+ arguments: arguments,
+ selector: callStructure));
+ apply(arguments, arg);
+ }
+
+ @override
+ errorAbstractClassConstructorInvoke(
+ NewExpression node,
+ ConstructorElement constructor,
+ InterfaceType type,
+ NodeList arguments,
+ CallStructure callStructure,
+ arg) {
+ visits.add(new Visit(
+ VisitKind.ERROR_ABSTRACT_CLASS_CONSTRUCTOR_INVOKE,
+ element: constructor,
+ type: type,
+ arguments: arguments,
+ selector: callStructure));
+ apply(arguments, arg);
+ }
@override
errorUnresolvedRedirectingFactoryConstructorInvoke(
@@ -4440,9 +6061,13 @@
VISIT_LOCAL_VARIABLE_COMPOUND,
VISIT_LOCAL_VARIABLE_PREFIX,
VISIT_LOCAL_VARIABLE_POSTFIX,
+ VISIT_LOCAL_VARIABLE_DECL,
+ VISIT_LOCAL_CONSTANT_DECL,
VISIT_LOCAL_FUNCTION_GET,
VISIT_LOCAL_FUNCTION_INVOKE,
+ VISIT_LOCAL_FUNCTION_DECL,
+ VISIT_CLOSURE_DECL,
VISIT_STATIC_FIELD_GET,
VISIT_STATIC_FIELD_SET,
@@ -4450,6 +6075,8 @@
VISIT_STATIC_FIELD_COMPOUND,
VISIT_STATIC_FIELD_PREFIX,
VISIT_STATIC_FIELD_POSTFIX,
+ VISIT_STATIC_FIELD_DECL,
+ VISIT_STATIC_CONSTANT_DECL,
VISIT_STATIC_GETTER_GET,
VISIT_STATIC_SETTER_SET,
@@ -4458,9 +6085,13 @@
VISIT_STATIC_METHOD_SETTER_COMPOUND,
VISIT_STATIC_GETTER_SETTER_PREFIX,
VISIT_STATIC_GETTER_SETTER_POSTFIX,
+ VISIT_STATIC_GETTER_DECL,
+ VISIT_STATIC_SETTER_DECL,
VISIT_STATIC_FUNCTION_GET,
VISIT_STATIC_FUNCTION_INVOKE,
+ VISIT_STATIC_FUNCTION_INCOMPATIBLE_INVOKE,
+ VISIT_STATIC_FUNCTION_DECL,
VISIT_TOP_LEVEL_FIELD_GET,
VISIT_TOP_LEVEL_FIELD_SET,
@@ -4468,6 +6099,8 @@
VISIT_TOP_LEVEL_FIELD_COMPOUND,
VISIT_TOP_LEVEL_FIELD_PREFIX,
VISIT_TOP_LEVEL_FIELD_POSTFIX,
+ VISIT_TOP_LEVEL_FIELD_DECL,
+ VISIT_TOP_LEVEL_CONSTANT_DECL,
VISIT_TOP_LEVEL_GETTER_GET,
VISIT_TOP_LEVEL_SETTER_SET,
@@ -4475,9 +6108,13 @@
VISIT_TOP_LEVEL_GETTER_SETTER_COMPOUND,
VISIT_TOP_LEVEL_GETTER_SETTER_PREFIX,
VISIT_TOP_LEVEL_GETTER_SETTER_POSTFIX,
+ VISIT_TOP_LEVEL_GETTER_DECL,
+ VISIT_TOP_LEVEL_SETTER_DECL,
VISIT_TOP_LEVEL_FUNCTION_GET,
VISIT_TOP_LEVEL_FUNCTION_INVOKE,
+ VISIT_TOP_LEVEL_FUNCTION_INCOMPATIBLE_INVOKE,
+ VISIT_TOP_LEVEL_FUNCTION_DECL,
VISIT_DYNAMIC_PROPERTY_GET,
VISIT_DYNAMIC_PROPERTY_SET,
@@ -4518,6 +6155,12 @@
VISIT_SUPER_METHOD_GET,
VISIT_SUPER_METHOD_INVOKE,
+ VISIT_SUPER_METHOD_INCOMPATIBLE_INVOKE,
+
+ VISIT_UNRESOLVED_GET,
+ VISIT_UNRESOLVED_INVOKE,
+ VISIT_UNRESOLVED_SUPER_GET,
+ VISIT_UNRESOLVED_SUPER_INVOKE,
VISIT_BINARY,
VISIT_INDEX,
@@ -4527,7 +6170,9 @@
VISIT_INDEX_POSTFIX,
VISIT_SUPER_BINARY,
+ VISIT_UNRESOLVED_SUPER_BINARY,
VISIT_SUPER_INDEX,
+ VISIT_UNRESOLVED_SUPER_INDEX,
VISIT_SUPER_EQUALS,
VISIT_SUPER_NOT_EQUALS,
VISIT_SUPER_INDEX_PREFIX,
@@ -4535,6 +6180,7 @@
VISIT_UNARY,
VISIT_SUPER_UNARY,
+ VISIT_UNRESOLVED_SUPER_UNARY,
VISIT_NOT,
VISIT_EXPRESSION_INVOKE,
@@ -4589,10 +6235,36 @@
VISIT_FACTORY_CONSTRUCTOR_INVOKE,
VISIT_REDIRECTING_FACTORY_CONSTRUCTOR_INVOKE,
+ VISIT_SUPER_CONSTRUCTOR_INVOKE,
+ VISIT_THIS_CONSTRUCTOR_INVOKE,
+ VISIT_FIELD_INITIALIZER,
+
ERROR_UNRESOLVED_CLASS_CONSTRUCTOR_INVOKE,
ERROR_UNRESOLVED_CONSTRUCTOR_INVOKE,
ERROR_ABSTRACT_CLASS_CONSTRUCTOR_INVOKE,
ERROR_UNRESOLVED_REDIRECTING_FACTORY_CONSTRUCTOR_INVOKE,
- // TODO(johnniwinther): Add tests for error cases.
+ VISIT_INSTANCE_GETTER_DECL,
+ VISIT_INSTANCE_SETTER_DECL,
+ VISIT_INSTANCE_METHOD_DECL,
+ VISIT_ABSTRACT_GETTER_DECL,
+ VISIT_ABSTRACT_SETTER_DECL,
+ VISIT_ABSTRACT_METHOD_DECL,
+ VISIT_INSTANCE_FIELD_DECL,
+
+ VISIT_GENERATIVE_CONSTRUCTOR_DECL,
+ VISIT_REDIRECTING_GENERATIVE_CONSTRUCTOR_DECL,
+ VISIT_FACTORY_CONSTRUCTOR_DECL,
+ VISIT_REDIRECTING_FACTORY_CONSTRUCTOR_DECL,
+
+ VISIT_REQUIRED_PARAMETER_DECL,
+ VISIT_OPTIONAL_PARAMETER_DECL,
+ VISIT_NAMED_PARAMETER_DECL,
+ VISIT_REQUIRED_INITIALIZING_FORMAL_DECL,
+ VISIT_OPTIONAL_INITIALIZING_FORMAL_DECL,
+ VISIT_NAMED_INITIALIZING_FORMAL_DECL,
+
+ ERROR_UNRESOLVED_POSTFIX,
+
+ // TODO(johnniwinther): Add tests for more error cases.
}
diff --git a/tests/compiler/dart2js/source_mapping_test.dart b/tests/compiler/dart2js/source_mapping_test.dart
index 77ab4d0..a54caac 100644
--- a/tests/compiler/dart2js/source_mapping_test.dart
+++ b/tests/compiler/dart2js/source_mapping_test.dart
@@ -7,6 +7,7 @@
import "package:async_helper/async_helper.dart";
import "package:compiler/src/io/code_output.dart";
import 'package:compiler/src/io/source_file.dart';
+import 'package:compiler/src/io/source_information.dart';
import "mock_compiler.dart";
import 'package:compiler/src/js_backend/js_backend.dart';
@@ -33,10 +34,10 @@
SourceFile sourceFile = new StringSourceFile.fromName('<test script>', code);
asyncTest(() => compileAll(sourceFile).then((CodeOutput output) {
Set<int> locations = new Set<int>();
- output.forEachSourceLocation((int offset, var sourcePosition) {
+ output.forEachSourceLocation((int offset, SourceLocation sourcePosition) {
if (sourcePosition != null &&
sourcePosition.sourceUri == sourceFile.uri) {
- locations.add(sourcePosition.token.charOffset);
+ locations.add(sourcePosition.offset);
}
});
diff --git a/tests/compiler/dart2js/type_representation_test.dart b/tests/compiler/dart2js/type_representation_test.dart
index 4bf4380..81c3654 100644
--- a/tests/compiler/dart2js/type_representation_test.dart
+++ b/tests/compiler/dart2js/type_representation_test.dart
@@ -142,55 +142,55 @@
expect(instantiate(List_, [int_]), '[$List_rep, $int_rep]');
// List<Typedef>
expect(instantiate(List_, [Typedef_]),
- '[$List_rep, {$func: "", $retvoid: true}]',
- '[$List_rep, {$func: "", $retvoid: true,'
+ '[$List_rep, {$func: 1, $retvoid: true}]',
+ '[$List_rep, {$func: 1, $retvoid: true,'
' $typedefTag: $Typedef_rep}]');
expect(instantiate(List_, [Typedef2_]),
- '[$List_rep, {$func: "", $ret: $int_rep}]',
- '[$List_rep, {$func: "", $ret: $int_rep,'
+ '[$List_rep, {$func: 1, $ret: $int_rep}]',
+ '[$List_rep, {$func: 1, $ret: $int_rep,'
' $typedefTag: $Typedef2_rep}]');
expect(instantiate(List_, [Typedef3_]),
- '[$List_rep, {$func: "", $ret: [$List_rep, $int_rep]}]',
- '[$List_rep, {$func: "", $ret: [$List_rep, $int_rep],'
+ '[$List_rep, {$func: 1, $ret: [$List_rep, $int_rep]}]',
+ '[$List_rep, {$func: 1, $ret: [$List_rep, $int_rep],'
' $typedefTag: $Typedef3_rep}]');
expect(instantiate(List_, [Typedef4_]),
- '[$List_rep, {$func: ""}]',
- '[$List_rep, {$func: "", $typedefTag: $Typedef4_rep}]');
+ '[$List_rep, {$func: 1}]',
+ '[$List_rep, {$func: 1, $typedefTag: $Typedef4_rep}]');
expect(instantiate(List_, [Typedef5_]),
- '[$List_rep, {$func: "",'
+ '[$List_rep, {$func: 1,'
' $args: [$int_rep, $String_rep]}]',
- '[$List_rep, {$func: "",'
+ '[$List_rep, {$func: 1,'
' $args: [$int_rep, $String_rep], $typedefTag: $Typedef5_rep}]');
expect(instantiate(List_, [Typedef6_]),
- '[$List_rep, {$func: "",'
+ '[$List_rep, {$func: 1,'
' $args: [$int_rep], $opt: [$String_rep]}]',
- '[$List_rep, {$func: "",'
+ '[$List_rep, {$func: 1,'
' $args: [$int_rep], $opt: [$String_rep],'
' $typedefTag: $Typedef6_rep}]');
expect(instantiate(List_, [Typedef7_]),
- '[$List_rep, {$func: "", $args: '
+ '[$List_rep, {$func: 1, $args: '
'[$int_rep, $String_rep], $opt: [[$List_rep, $int_rep],,]}]',
- '[$List_rep, {$func: "", $args: '
+ '[$List_rep, {$func: 1, $args: '
'[$int_rep, $String_rep], $opt: [[$List_rep, $int_rep],,], '
'$typedefTag: $Typedef7_rep}]');
expect(instantiate(List_, [Typedef8_]),
- '[$List_rep, {$func: "", $args: [$int_rep],'
+ '[$List_rep, {$func: 1, $args: [$int_rep],'
' $named: {b: $String_rep}}]',
- '[$List_rep, {$func: "", $args: [$int_rep],'
+ '[$List_rep, {$func: 1, $args: [$int_rep],'
' $named: {b: $String_rep}, $typedefTag: $Typedef8_rep}]');
expect(instantiate(List_, [Typedef9_]),
- '[$List_rep, {$func: "", '
+ '[$List_rep, {$func: 1, '
'$args: [$int_rep, $String_rep], $named: '
'{c: [$List_rep, $int_rep], d: null}}]',
- '[$List_rep, {$func: "", '
+ '[$List_rep, {$func: 1, '
'$args: [$int_rep, $String_rep], $named: {c: [$List_rep, $int_rep],'
' d: null}, $typedefTag: $Typedef9_rep}]');
expect(instantiate(List_, [Typedef10_]),
- '[$List_rep, {$func: "", '
- '$args: [{$func: "", $retvoid: true, '
+ '[$List_rep, {$func: 1, '
+ '$args: [{$func: 1, $retvoid: true, '
'$args: [$int_rep], $opt: [,]}]}]',
- '[$List_rep, {$func: "", '
- '$args: [{$func: "", $retvoid: true, '
+ '[$List_rep, {$func: 1, '
+ '$args: [{$func: 1, $retvoid: true, '
'$args: [$int_rep], $opt: [,]}], $typedefTag: $Typedef10_rep}]');
// Map<K,V>
@@ -207,50 +207,50 @@
// void m1() {}
expect(env.getElement('m1').computeType(env.compiler),
- '{$func: "", $retvoid: true}');
+ '{$func: 1, $retvoid: true}');
// int m2() => 0;
expect(env.getElement('m2').computeType(env.compiler),
- '{$func: "", $ret: $int_rep}');
+ '{$func: 1, $ret: $int_rep}');
// List<int> m3() => null;
expect(env.getElement('m3').computeType(env.compiler),
- '{$func: "", $ret: [$List_rep, $int_rep]}');
+ '{$func: 1, $ret: [$List_rep, $int_rep]}');
// m4() {}
expect(env.getElement('m4').computeType(env.compiler),
- '{$func: ""}');
+ '{$func: 1}');
// m5(int a, String b) {}
expect(env.getElement('m5').computeType(env.compiler),
- '{$func: "", $args: [$int_rep, $String_rep]}');
+ '{$func: 1, $args: [$int_rep, $String_rep]}');
// m6(int a, [String b]) {}
expect(env.getElement('m6').computeType(env.compiler),
- '{$func: "", $args: [$int_rep],'
+ '{$func: 1, $args: [$int_rep],'
' $opt: [$String_rep]}');
// m7(int a, String b, [List<int> c, d]) {}
expect(env.getElement('m7').computeType(env.compiler),
- '{$func: "",'
+ '{$func: 1,'
' $args: [$int_rep, $String_rep],'
' $opt: [[$List_rep, $int_rep],,]}');
// m8(int a, {String b}) {}
expect(env.getElement('m8').computeType(env.compiler),
- '{$func: "",'
+ '{$func: 1,'
' $args: [$int_rep], $named: {b: $String_rep}}');
// m9(int a, String b, {List<int> c, d}) {}
expect(env.getElement('m9').computeType(env.compiler),
- '{$func: "",'
+ '{$func: 1,'
' $args: [$int_rep, $String_rep],'
' $named: {c: [$List_rep, $int_rep], d: null}}');
// m10(void f(int a, [b])) {}
expect(env.getElement('m10').computeType(env.compiler),
- '{$func: "", $args:'
- ' [{$func: "",'
+ '{$func: 1, $args:'
+ ' [{$func: 1,'
' $retvoid: true, $args: [$int_rep], $opt: [,]}]}');
}));
}
diff --git a/tests/compiler/dart2js/value_range2_test.dart b/tests/compiler/dart2js/value_range2_test.dart
index dfc2fde..803ab05 100644
--- a/tests/compiler/dart2js/value_range2_test.dart
+++ b/tests/compiler/dart2js/value_range2_test.dart
@@ -4,8 +4,7 @@
import "package:expect/expect.dart";
import "package:compiler/src/ssa/ssa.dart";
-import "package:compiler/src/dart2jslib.dart";
-import "package:compiler/src/js_backend/js_backend.dart";
+import "package:compiler/src/js_backend/constant_system_javascript.dart";
ValueRangeInfo info = new ValueRangeInfo(const JavaScriptConstantSystem());
diff --git a/tests/compiler/dart2js_extra/22776.dart b/tests/compiler/dart2js_extra/22776_test.dart
similarity index 100%
rename from tests/compiler/dart2js_extra/22776.dart
rename to tests/compiler/dart2js_extra/22776_test.dart
diff --git a/tests/compiler/dart2js_extra/22895.dart b/tests/compiler/dart2js_extra/22895_test.dart
similarity index 100%
rename from tests/compiler/dart2js_extra/22895.dart
rename to tests/compiler/dart2js_extra/22895_test.dart
diff --git a/tests/compiler/dart2js_extra/23264_test.dart b/tests/compiler/dart2js_extra/23264_test.dart
new file mode 100644
index 0000000..89538be
--- /dev/null
+++ b/tests/compiler/dart2js_extra/23264_test.dart
@@ -0,0 +1,4 @@
+import 'package:expect/expect.dart';
+
+class A { A(ignore); }
+main() => Expect.throws(() => A(const [])); // oops, `new` is missing!
diff --git a/tests/compiler/dart2js_extra/dart2js_extra.status b/tests/compiler/dart2js_extra/dart2js_extra.status
index 188549f..22ae813 100644
--- a/tests/compiler/dart2js_extra/dart2js_extra.status
+++ b/tests/compiler/dart2js_extra/dart2js_extra.status
@@ -59,3 +59,197 @@
[ $compiler == dart2js && $csp ]
deferred_fail_and_retry_test: SkipByDesign # Uses eval to simulate failed loading.
deferred_fail_and_retry_worker_test: SkipByDesign # Uses eval to simulate failed loading.
+
+[ $compiler == dart2js && $cps_ir ]
+10216a_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+10216b_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+11673_test: Crash # (use): handleStaticFunctionGet: function(use)
+12320_test: Crash # (run): handleStaticFunctionGet: function(run)
+16407_test: Crash # unsupported element kind: foo:field
+16967_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+17094_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+17645_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+17856_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+18383_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+19191_test: Crash # cannot compile methods that need interceptor calling convention.
+21166_test: Crash # unsupported element kind: a:field
+21579_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+21666_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+22487_test: Crash # (divIsInt): handleStaticFunctionGet: function(divIsInt)
+22868_test: Crash # cannot handle async/sync*/async* functions
+22895_test: Crash # cannot handle async/sync*/async* functions
+22917_test: Crash # (test): handleStaticFunctionGet: function(test)
+23056_test: Crash # cannot compile methods that need interceptor calling convention.
+23264_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+async_stacktrace_test/asyncStar: Crash # (runTests): handleStaticFunctionGet: function(runTests)
+async_stacktrace_test/none: Crash # (runTests): handleStaticFunctionGet: function(runTests)
+bailout8_test: Crash # (foo): handleStaticFunctionGet: function(foo)
+bailout_aborting_if_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+bailout_on_break_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+bailout_on_continue_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+bailout_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+bound_closure_interceptor_methods_test: Crash # cannot compile methods that need interceptor calling convention.
+bound_closure_interceptor_type_test: Crash # unsupported element kind: checkers:field
+break_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+checked_accessor_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+closure2_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+closure3_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+closure4_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+closure5_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+closure6_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+closure7_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+closure_capture2_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+closure_capture3_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+closure_capture4_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+closure_capture5_test: Crash # (i=0): For-loop variable captured in loop header
+closure_capture_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+closure_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+closure_type_reflection2_test: Crash # cannot compile methods that need interceptor calling convention.
+closure_type_reflection_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+code_motion_exception_test: Crash # (call2a): handleStaticFunctionGet: function(call2a)
+compile_time_constant4_test/01: Crash # cannot compile methods that need interceptor calling convention.
+compile_time_constant4_test/02: Crash # cannot compile methods that need interceptor calling convention.
+compile_time_constant4_test/03: Crash # cannot compile methods that need interceptor calling convention.
+compile_time_constant4_test/04: Crash # cannot compile methods that need interceptor calling convention.
+compile_time_constant4_test/05: Crash # cannot compile methods that need interceptor calling convention.
+compile_time_constant4_test/06: Crash # cannot compile methods that need interceptor calling convention.
+compile_time_constant4_test/none: Crash # cannot compile methods that need interceptor calling convention.
+compound_operator_index_test: Crash # cannot compile methods that need interceptor calling convention.
+conditional_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+conflict_index_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+constant_fold_number_dart2_j_s_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+constant_javascript_semantics2_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+constant_javascript_semantics3_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+constant_javascript_semantics_test/01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+constant_javascript_semantics_test/02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+constant_javascript_semantics_test/03: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+constant_javascript_semantics_test/04: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+constant_javascript_semantics_test/none: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+deferred/deferred_class_test: Crash # (isError): handleStaticFunctionGet: function(isError)
+deferred/deferred_constant2_test: Crash # (lib.loadLibrary()): handleStaticGetterInvoke: foreign: function(loadLibrary)
+deferred/deferred_constant3_test: Crash # (lib.loadLibrary()): handleStaticGetterInvoke: foreign: function(loadLibrary)
+deferred/deferred_constant4_test: Crash # (lib.loadLibrary()): handleStaticGetterInvoke: foreign: function(loadLibrary)
+deferred/deferred_function_test: Crash # (isError): handleStaticFunctionGet: function(isError)
+deferred/deferred_mirrors1_test: Crash # (lazy.loadLibrary()): handleStaticGetterInvoke: foreign: function(loadLibrary)
+deferred/deferred_mirrors2_test: Crash # cannot compile methods that need interceptor calling convention.
+deferred/deferred_overlapping_test: Crash # (lib1.loadLibrary()): handleStaticGetterInvoke: foreign: function(loadLibrary)
+deferred_fail_and_retry_test: Crash # (lib.loadLibrary()): handleStaticGetterInvoke: foreign: function(loadLibrary)
+deferred_fail_and_retry_worker_test: Crash # (test): handleStaticFunctionGet: function(test)
+do_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+field_in_constructor_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+field_initializer_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+fields_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+first_class_types_hashcode_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+for_in_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+for_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+generics_factories_test: Crash # cannot compile methods that need interceptor calling convention.
+generics_is_check1_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+getter_element_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+getters_setters_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+hash_code_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+if_in_loop_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+if_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+index_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+inference_nsm_mirrors_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+inferrer_is_int_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+interface_type_optimization_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+invoke_dynamic_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+is_check_instanceof_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+is_operator_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+LayoutTests_fast_mediastream_getusermedia_t01_test/01: Crash # (gotStream1): Error expression `gotStream1` unhandled.
+LayoutTests_fast_mediastream_getusermedia_t01_test/none: Crash # (gotStream1): handleStaticFunctionGet: function(gotStream1)
+list_factory_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+literal_string_juxtaposition_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+logical_and_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+logical_or_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+loop_if_phi_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+many_fields_test: Crash # cannot compile methods that need interceptor calling convention.
+math_lib_prefix_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+math_lib_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+member_namespace_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+minus_zero2_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+minus_zero_test/01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+mirror_enqueuer_regression_test: Crash # unsupported element kind: foo:field
+mirror_invalid_field_access2_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+mirror_invalid_field_access3_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+mirror_invalid_field_access4_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+mirror_invalid_field_access_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+mirror_invalid_invoke2_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+mirror_invalid_invoke3_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+mirror_invalid_invoke_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+mirror_printer_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+mirrors_declarations_filtering_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+mirrors_used_closure_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+mirrors_used_metatargets_test: Crash # (try {reflect(z).invoke(#foo,[] );}on UnsupportedError catch (e){caught=true;}): "on T" catch block
+mirrors_used_native_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+mirrors_used_warning2_test: Crash # (runTests): handleStaticFunctionGet: function(runTests)
+mirrors_used_warning_test/minif: Crash # (runTests): handleStaticFunctionGet: function(runTests)
+mirrors_used_warning_test/none: Crash # (runTests): handleStaticFunctionGet: function(runTests)
+mirror_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+mirror_type_inference_field2_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+mirror_type_inference_field_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+mirror_type_inference_function_test: Crash # cannot compile methods that need interceptor calling convention.
+named_parameter_for_static_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+named_parameter_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+nan_negate_test: Crash # cannot compile methods that need interceptor calling convention.
+no_such_method_mirrors_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+no_such_method_test: Crash # cannot compile methods that need interceptor calling convention.
+not_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+null_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+operator2_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+operator3_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+operator_equals_test: Crash # cannot compile methods that need interceptor calling convention.
+operator_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+optional_parameter_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+panda_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+phi_elimination_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+phi_gvn_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+phi_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+private_symbol_literal_test/01: Pass # Please triage this failure.
+private_symbol_literal_test/02: Pass # Please triage this failure.
+private_symbol_literal_test/03: Pass # Please triage this failure.
+private_symbol_literal_test/04: Pass # Please triage this failure.
+private_symbol_literal_test/05: Pass # Please triage this failure.
+private_symbol_literal_test/06: Pass # Please triage this failure.
+reflect_native_types_test: Crash # cannot compile methods that need interceptor calling convention.
+regress/4492_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+regress/4515_1_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+regress/4515_2_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+regress/4515_3_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+regress/4639_test: Crash # cannot compile methods that need interceptor calling convention.
+regress/4740_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+regression_2913_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+return_setter_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+runtime_type_int_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+runtime_type_test: Crash # Please triage this failure.
+simple_string_constant_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+static_field2_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+static_field_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+static_method2_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+static_method_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+static_var_no_initializer_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+static_var_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+string_escape_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+string_interpolation_dynamic_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+string_interpolation_opt1_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+string_interpolation_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+super_call_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+super_constructor1_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+super_constructor2_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+switch_test/01: Crash # (badswitches(42)): Error expression `badswitches(42)` unhandled.
+switch_test/02: Crash # (badswitches(42)): Error expression `badswitches(42)` unhandled.
+switch_test/none: Crash # (switch (val){}): Unhandled node
+this_phi_elimination_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+this_redirecting_constructor_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+this_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+timer_negative_test: Crash # (test): handleStaticFunctionGet: function(test)
+timer_test: Crash # (test): handleStaticFunctionGet: function(test)
+to_string_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+type_argument_factory_crash_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+type_argument_factory_nocrash_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+type_constant_switch_test/01: Pass # Please triage this failure.
+type_constant_switch_test/none: Crash # (switch (v){}): Unhandled node
+type_error_message_test: Crash # cannot compile methods that need interceptor calling convention.
+typevariable_factory_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+typevariable_substitution_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+while_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
diff --git a/tests/compiler/dart2js_extra/if_in_loop.dart b/tests/compiler/dart2js_extra/if_in_loop_test.dart
similarity index 100%
rename from tests/compiler/dart2js_extra/if_in_loop.dart
rename to tests/compiler/dart2js_extra/if_in_loop_test.dart
diff --git a/tests/compiler/dart2js_extra/mirrors_declarations_filtering_test.dart b/tests/compiler/dart2js_extra/mirrors_declarations_filtering_test.dart
new file mode 100644
index 0000000..e77ec3b
--- /dev/null
+++ b/tests/compiler/dart2js_extra/mirrors_declarations_filtering_test.dart
@@ -0,0 +1,52 @@
+
+// Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+// Regression test for the dart2js mirrors implementation that triggers the
+// generation of the declarations of a class in the presence of call stubs
+// and non-reflectable methods. For neither of the latter an instance mirror
+// should be constructed and they should not be contained in declarations.
+@MirrorsUsed(metaTargets: "Meta")
+import "dart:mirrors";
+import "package:expect/expect.dart";
+
+class Meta {
+ const Meta();
+}
+
+class A {
+ @Meta()
+ reflectableThing(int a, [int b = 9, int c = 42]) => a + b + c;
+ nonReflectableThing(int a, [int b = 4, int c = 21]) => a + b + c;
+}
+
+tryCall(object, symbol, values, expected) {
+ var mirror = reflect(object);
+ var result = mirror.invoke(symbol, values).reflectee;
+ Expect.equals(result, expected);
+}
+
+@NoInline() @AssumeDynamic()
+hide(x) => x;
+
+main() {
+ var a = hide(new A());
+ // Make sure we statically have some calls to reflectableThing with 1, 2 and
+ // 3 arguments so that stubs are generated.
+ Expect.equals(1 + 9 + 42, a.reflectableThing(1));
+ Expect.equals(1 + 5 + 42, a.reflectableThing(1, 5));
+ Expect.equals(1 + 22 + 3, a.reflectableThing(1, 22, 3));
+ // Try calling methods through reflection.
+ tryCall(a, #reflectableThing, [1], 1 + 9 + 42);
+ tryCall(a, #reflectableThing, [1, 5], 1 + 5 + 42);
+ tryCall(a, #reflectableThing, [1, 22, 3], 1 + 22 + 3);
+ Expect.throws(() => tryCall(a, #nonReflectableThing, [1], 1 + 4 + 21));
+ Expect.throws(() => tryCall(a, #nonReflectableThing, [1, 5], 1 + 5 + 21));
+ Expect.throws(() => tryCall(a, #nonReflectableThing, [1, 13, 7], 1 + 13 + 7));
+ // Trigger generation of all declarations and check they only contain a
+ // a single entry.
+ var declarations = reflect(a).type.declarations;
+ Expect.equals(1, declarations.keys.length);
+ Expect.equals(#reflectableThing, declarations.keys.first);
+}
diff --git a/tests/compiler/dart2js_extra/runtime_type_isolate.dart b/tests/compiler/dart2js_extra/runtime_type_isolate.dart
deleted file mode 100644
index b1b9504..0000000
--- a/tests/compiler/dart2js_extra/runtime_type_isolate.dart
+++ /dev/null
@@ -1,16 +0,0 @@
-// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-import "package:expect/expect.dart";
-import 'dart:isolate';
-
-class Bar {}
-
-main() {
- final port = new ReceivePort();
- port.receive((msg, reply) {
- Expect.equals(new Bar().runtimeType.toString(), 'Bar');
- });
- port.sendPort.send(null);
-}
diff --git a/tests/compiler/dart2js_native/dart2js_native.status b/tests/compiler/dart2js_native/dart2js_native.status
index 6a949b1..9eef5ac 100644
--- a/tests/compiler/dart2js_native/dart2js_native.status
+++ b/tests/compiler/dart2js_native/dart2js_native.status
@@ -26,3 +26,116 @@
[ $compiler == dart2js && $runtime == d8 && $system == windows ]
only_pass_on_d8_test: Skip # Issue 17458
compute_this_script_test: Skip # Issue 17458
+
+[ $compiler == dart2js && $cps_ir ]
+abstract_class_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+bound_closure_super_test: Crash # (makeCC): handleStaticFunctionGet: function(makeCC)
+bound_closure_test: Crash # (makeCC): handleStaticFunctionGet: function(makeCC)
+browser_compat_1_prepatched_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+browser_compat_1_unpatched_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+browser_compat_2_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+catch_javascript_null_stack_trace_test: Crash # (JS('','(function () {throw null;})()')): handleStaticFunctionInvoke: foreign: function(JS)
+core_type_check_native_test: Crash # (checkTest): handleStaticFunctionGet: function(checkTest)
+downcast_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+event_loop_test: Crash # (asyncEnd): handleStaticFunctionGet: function(asyncEnd)
+fake_thing_2_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+fake_thing_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+field_type2_test: Crash # unsupported element kind: makeNode:function
+field_type_test: Crash # cannot compile methods that need interceptor calling convention.
+fixup_get_tag_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+foreign_test: Crash # (JS('bool','isNaN(#)',isNaN)): handleStaticFunctionInvoke: foreign: function(JS)
+hash_code_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+inference_of_helper_methods_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+internal_library_test: Crash # (startRootIsolate): handleStaticFunctionGet: function(startRootIsolate)
+is_check_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+issue9182_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+js_const_test: Crash # (JS('String',r'#.replace(#, #)',s1,re,fToUpper)): handleStaticFunctionInvoke: foreign: function(JS)
+jsobject_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+mirror_intercepted_field_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+native_call_arity1_frog_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+native_call_arity2_frog_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+native_call_arity3_frog_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+native_checked_arguments1_frog_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+native_checked_fields_frog_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+native_class_avoids_hidden_name_frog_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+native_class_fields_2_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+native_class_fields_3_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+native_class_fields_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+native_class_inheritance1_frog_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+native_class_inheritance2_frog_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+native_class_inheritance3_frog_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+native_class_inheritance4_frog_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+native_class_is_check1_frog_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+native_class_is_check3_frog_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+native_class_with_dart_methods_frog_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+native_closure_identity_frog_test: Crash # (staticMethod): handleStaticFunctionGet: function(staticMethod)
+native_constructor_name_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+native_equals_frog_test: Crash # cannot compile methods that need interceptor calling convention.
+native_exception2_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+native_exception_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+native_exceptions1_frog_test: Crash # "on T" catch block
+native_field_invocation2_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+native_field_invocation3_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+native_field_invocation4_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+native_field_invocation5_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+native_field_invocation6_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+native_field_invocation_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+native_field_name_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+native_field_optimization_test: Crash # (test1): handleStaticFunctionGet: function(test1)
+native_field_rename_1_frog_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+native_field_rename_2_frog_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+native_library_same_name_used_frog_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+native_method_inlining_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+native_method_rename1_frog_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+native_method_rename2_frog_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+native_method_rename3_frog_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+native_method_with_keyword_name_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+native_mirror_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+native_missing_method1_frog_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+native_missing_method2_frog_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+native_mixin_field_test: Crash # cannot compile methods that need interceptor calling convention.
+native_mixin_multiple2_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+native_mixin_multiple3_test: Crash # (callFoo): handleStaticFunctionGet: function(callFoo)
+native_mixin_multiple_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+native_mixin_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+native_mixin_with_plain_test: Crash # (makeA): handleStaticFunctionGet: function(makeA)
+native_named_constructors2_frog_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+native_named_constructors3_frog_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+native_no_such_method_exception2_frog_test: Crash # (try {a.foo();}on NoSuchMethodError catch (e){exception=e;}): "on T" catch block
+native_no_such_method_exception3_frog_test: Crash # (try {a.foo();}on NoSuchMethodError catch (e){exception=e;}): "on T" catch block
+native_no_such_method_exception4_frog_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+native_no_such_method_exception5_frog_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+native_no_such_method_exception_frog_test: Crash # (try {a.foo();}on NoSuchMethodError catch (e){exception=e;}): "on T" catch block
+native_novel_html_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+native_null_closure_frog_test: Crash # "on T" catch block
+native_null_frog_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+native_property_frog_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+native_to_string_frog_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+native_use_native_name_in_table_frog_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+native_window1_frog_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+native_window2_frog_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+native_wrapping_function3_frog_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+native_wrapping_function_frog_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+oddly_named_fields_test: Crash # cannot compile methods that need interceptor calling convention.
+only_pass_on_d8_test: Crash # cannot compile methods that need interceptor calling convention.
+only_pass_on_jsshell_test: Crash # cannot compile methods that need interceptor calling convention.
+optimization_hints_test: Crash # (JS('','String("in main function")')): handleStaticFunctionInvoke: foreign: function(JS)
+rti_only_native_test: Crash # (main): handleStaticFunctionGet: function(main)
+runtimetype_test: Crash # (JS('A','#',makeA())): handleStaticFunctionInvoke: foreign: function(JS)
+static_methods_test: Crash # (main): handleStaticFunctionGet: function(main)
+subclassing_1_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+subclassing_2_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+subclassing_3_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+subclassing_4_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+subclassing_5_test: Crash # (testIsB): handleStaticFunctionGet: function(testIsB)
+subclassing_constructor_1_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+subclassing_constructor_2_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+subclassing_super_call_test: Crash # (JS('','#(#)',constructor,b1)): handleStaticFunctionInvoke: foreign: function(JS)
+subclassing_super_field_1_test: Crash # (JS('','#(#)',constructor,b)): handleStaticFunctionInvoke: foreign: function(JS)
+subclassing_super_field_2_test: Crash # (JS('','#(#)',constructor,b)): handleStaticFunctionInvoke: foreign: function(JS)
+subclassing_type_test: Crash # (isA): handleStaticFunctionGet: function(isA)
+super_call_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+super_property_test: Crash # (testThing): handleStaticFunctionGet: function(testThing)
+type_error_decode_test: Crash # (isNullError): handleStaticFunctionGet: function(isNullError)
+undefined_bailout_test: Crash # (JS('','void 0')): handleStaticFunctionInvoke: foreign: function(JS)
+uninstantiated_type_parameter_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
diff --git a/tests/corelib/corelib.status b/tests/corelib/corelib.status
index 52283d6..e685618 100644
--- a/tests/corelib/corelib.status
+++ b/tests/corelib/corelib.status
@@ -17,9 +17,6 @@
string_from_environment_default_value: Skip
string_from_environment_test: Skip
-[ $compiler == dart2dart && $builder_tag == new_backend ]
-regexp/pcre_test: Crash # Issue 19953
-
[ $compiler == none && ($runtime == drt || $runtime == dartium || $runtime == ContentShellOnAndroid) ]
bool_from_environment2_test: Skip
bool_from_environment_default_value_test: Skip
@@ -232,3 +229,369 @@
[ $mode == debug ]
regexp/pcre_test: Pass, Slow # Timeout. Issue 22008
+
+[ $runtime == vm && $arch == simarmv5te ]
+int_parse_radix_test/*: Pass, Slow
+big_integer_parsed_mul_div_vm_test: Pass, Slow
+
+[ $compiler == dart2js && $cps_ir ]
+apply2_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+apply3_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+apply4_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+apply_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+bit_twiddling_bigint_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+bit_twiddling_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+bool_from_environment_default_value_test: Crash # (throw new ExpectException(message)): Unhandled node
+bool_from_environment_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+bool_hashcode_test: Crash # (throw new ExpectException(message)): Unhandled node
+collection_from_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+collection_removes_test: Crash # (throw new ExpectException(message)): Unhandled node
+collection_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+collection_to_string_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+compare_to2_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+compare_to_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+const_list_literal_test: Crash # (try {list.add(4);}on UnsupportedError catch (e){exception=e;}): "on T" catch block
+const_list_remove_range_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+const_list_set_range_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+core_runtime_types_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+date_time2_test: Crash # (throw new ExpectException(message)): Unhandled node
+date_time3_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+date_time4_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+date_time5_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+date_time6_test: Crash # (throw new ExpectException(message)): Unhandled node
+date_time7_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+date_time8_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+date_time9_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+date_time_parse_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+date_time_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+double_ceil2_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+double_ceil_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+double_ceil_to_double_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+double_compare_test: Crash # (throw new ExpectException(message)): Unhandled node
+double_floor2_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+double_floor_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+double_floor_to_double_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+double_parse_test/01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+double_parse_test/none: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+double_round2_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+double_round3_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+double_round4_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+double_round_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+double_round_to_double2_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+double_round_to_double3_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+double_round_to_double_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+double_truncate2_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+double_truncate_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+double_truncate_to_double_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+duration2_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+duration_big_num_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+duration_double_multiplication_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+duration_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+error_stack_trace1_test: Crash # (throw new ExpectException(message)): Unhandled node
+error_stack_trace2_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+error_stack_trace_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+errors_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+exception_implementation_test: Crash # "on T" catch block
+expando_test: Crash # Please triage this failure.
+expression_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+for_in_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+format_exception_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+from_environment_const_type_test/01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+from_environment_const_type_test/02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+from_environment_const_type_test/03: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+from_environment_const_type_test/04: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+from_environment_const_type_test/05: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+from_environment_const_type_test/06: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+from_environment_const_type_test/07: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+from_environment_const_type_test/08: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+from_environment_const_type_test/09: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+from_environment_const_type_test/10: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+from_environment_const_type_test/11: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+from_environment_const_type_test/12: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+from_environment_const_type_test/13: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+from_environment_const_type_test/14: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+from_environment_const_type_test/15: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+from_environment_const_type_test/16: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+from_environment_const_type_test/none: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+from_environment_const_type_undefined_test/01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+from_environment_const_type_undefined_test/02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+from_environment_const_type_undefined_test/03: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+from_environment_const_type_undefined_test/04: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+from_environment_const_type_undefined_test/05: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+from_environment_const_type_undefined_test/06: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+from_environment_const_type_undefined_test/07: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+from_environment_const_type_undefined_test/08: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+from_environment_const_type_undefined_test/09: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+from_environment_const_type_undefined_test/10: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+from_environment_const_type_undefined_test/11: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+from_environment_const_type_undefined_test/12: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+from_environment_const_type_undefined_test/13: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+from_environment_const_type_undefined_test/14: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+from_environment_const_type_undefined_test/15: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+from_environment_const_type_undefined_test/16: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+from_environment_const_type_undefined_test/none: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+growable_list_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+hashcode_boxed_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+hashcode_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+hash_map2_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+hash_map_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+hash_set_test/01: Crash # (throw new ExpectException(message)): Unhandled node
+hash_set_test/none: Crash # (throw new ExpectException(message)): Unhandled node
+hash_set_type_check_test: Crash # (throw new ExpectException(message)): Unhandled node
+has_next_iterator_test: Crash # (throw new ExpectException(message)): Unhandled node
+indexed_list_access_test: Crash # (throw new ExpectException(message)): Unhandled node
+int_ceil_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+int_ceil_to_double_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+integer_to_radix_string_test: Crash # "on T" catch block
+integer_to_string_test/01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+integer_to_string_test/none: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+int_floor_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+int_floor_to_double_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+int_from_environment2_test: Crash # (throw new ExpectException(message)): Unhandled node
+int_from_environment_default_value_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+int_from_environment_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+int_parse_radix_test/01: Crash # Please triage this failure.
+int_parse_radix_test/02: Crash # Please triage this failure.
+int_parse_radix_test/none: Crash # Please triage this failure.
+int_round_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+int_round_to_double_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+int_to_int_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+int_truncate_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+int_truncate_to_double_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+is_operator_basic_types_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+iterable_contains2_test: Crash # (throw new ExpectException(message)): Unhandled node
+iterable_contains_test: Crash # (throw new ExpectException(message)): Unhandled node
+iterable_element_at_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+iterable_expand_test: Crash # (throw new ExpectException(message)): Unhandled node
+iterable_first_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+iterable_first_where_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+iterable_fold_test: Crash # cannot compile methods that need interceptor calling convention.
+iterable_generate_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+iterable_join_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+iterable_last_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+iterable_last_where_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+iterable_length_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+iterable_mapping_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+iterable_reduce_test: Crash # cannot compile methods that need interceptor calling convention.
+iterable_return_type_test/01: Crash # Please triage this failure.
+iterable_return_type_test/02: Crash # Please triage this failure.
+iterable_return_type_test/none: Crash # Please triage this failure.
+iterable_single_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+iterable_single_where_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+iterable_skip_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+iterable_skip_while_test: Crash # (throw new ExpectException(message)): Unhandled node
+iterable_take_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+iterable_take_while_test: Crash # (throw new ExpectException(message)): Unhandled node
+iterable_test: Crash # (throw new ExpectException(message)): Unhandled node
+iterable_to_list_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+iterable_to_set_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+iterable_tostring_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+json_map_test: Crash # (throw new ExpectException(message)): Unhandled node
+linked_hash_map_from_iterables_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+linked_hash_map_from_iterable_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+linked_hash_map_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+list_as_map_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+list_contains_argument_order_test: Crash # cannot compile methods that need interceptor calling convention.
+list_filled_type_argument_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+list_fill_range_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+list_first_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+list_fixed_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+list_for_each_test: Crash # (throw new ExpectException(message)): Unhandled node
+list_get_range_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+list_growable_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+list_index_of2_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+list_index_of_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+list_insert_all_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+list_insert_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+list_iterators_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+list_last_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+list_literal_is_growable_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+list_literal_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+list_map_test: Crash # (throw new ExpectException(message)): Unhandled node
+list_removeat_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+list_remove_range_test: Crash # (throw new ExpectException(message)): Unhandled node
+list_replace_range_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+list_reversed_test: Crash # (throw new ExpectException(message)): Unhandled node
+list_set_all_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+list_set_range_test: Crash # (throw new ExpectException(message)): Unhandled node
+list_sort_test: Crash # (throw new ExpectException(message)): Unhandled node
+list_sublist_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+list_test/01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+list_test/none: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+list_to_string2_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+list_to_string_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+list_unmodifiable_test: Crash # (createConstList): handleStaticFunctionGet: function(createConstList)
+main_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+map_contains_key_test: Crash # (throw new ExpectException(message)): Unhandled node
+map_contains_value_test: Crash # (throw new ExpectException(message)): Unhandled node
+map_from_iterables_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+map_from_iterable_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+map_from_test: Crash # Please triage this failure.
+map_index_test: Crash # (throw new ExpectException(message)): Unhandled node
+map_keys2_test: Crash # Please triage this failure.
+map_keys_test: Crash # Please triage this failure.
+map_remove_test: Crash # (throw new ExpectException(message)): Unhandled node
+maps_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+map_test: Crash # Please triage this failure.
+map_to_string_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+map_values2_test: Crash # Please triage this failure.
+map_values3_test: Crash # Please triage this failure.
+map_values4_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+map_values_test: Crash # Please triage this failure.
+nan_infinity_test/01: Crash # (throw new ExpectException(message)): Unhandled node
+nan_infinity_test/none: Crash # (throw new ExpectException(message)): Unhandled node
+null_nosuchmethod_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+null_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+num_clamp_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+num_parse_test/01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+num_parse_test/none: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+num_sign_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+print_test/01: Crash # cannot compile methods that need interceptor calling convention.
+print_test/none: Crash # cannot compile methods that need interceptor calling convention.
+queue_first_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+queue_iterator_test: Crash # (throw new ExpectException(message)): Unhandled node
+queue_last_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+queue_single_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+queue_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+range_error_test: Crash # (throw new ExpectException(message)): Unhandled node
+reg_exp1_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+reg_exp4_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+reg_exp5_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+reg_exp_all_matches_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+regexp/alternative-length-miscalculation_test: Crash # (throw new ExpectException(message)): Unhandled node
+regexp/alternatives_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+regexp/assertion_test: Crash # (throw new ExpectException(message)): Unhandled node
+regexp/backreferences_test: Crash # (throw new ExpectException(message)): Unhandled node
+regexp/bol_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+regexp/bol-with-multiline_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+regexp/capture-3_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+regexp/captures_test: Crash # (throw new ExpectException(message)): Unhandled node
+regexp/capture_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+regexp/character-match-out-of-order_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+regexp/char-insensitive_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+regexp/compile-crash_test: Crash # (throw new ExpectException(message)): Unhandled node
+regexp/compile_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+regexp/constructor_test: Crash # (throw new ExpectException(message)): Unhandled node
+regexp/dotstar_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+regexp/early-acid3-86_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+regexp/ecma-regex-examples_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+regexp/extended-characters-match_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+regexp/extended-characters-more_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+regexp/find-first-asserted_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+reg_exp_first_match_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+regexp/global_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+reg_exp_groups_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+reg_exp_group_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+reg_exp_has_match_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+regexp/indexof_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+regexp/invalid-range-in-class_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+regexp/issue_19193_test: Crash # (throw new ExpectException(message)): Unhandled node
+regexp/lastindex_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+regexp/look-ahead_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+regexp/lookahead_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+regexp/loop-capture_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+regexp/malformed-escapes_test: Crash # (throw new ExpectException(message)): Unhandled node
+regexp/many-brackets_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+regexp/multiline_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+regexp/negative-special-characters_test: Crash # (throw new ExpectException(message)): Unhandled node
+regexp/no-extensions_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+regexp/non-bmp_test: Crash # (throw new ExpectException(message)): Unhandled node
+regexp/non-capturing-backtracking_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+regexp/non-capturing-groups_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+regexp/non-character_test: Crash # (throw new ExpectException(message)): Unhandled node
+regexp/non-greedy-parentheses_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+regexp/norepeat_test: Crash # (throw new ExpectException(message)): Unhandled node
+regexp/overflow_test: Crash # (throw new ExpectException(message)): Unhandled node
+regexp/parentheses_test: Crash # (throw new ExpectException(message)): Unhandled node
+reg_exp_pattern_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+regexp/pcre-test-4_test: Crash # (throw new ExpectException(message)): Unhandled node
+regexp/pcre_test: Crash # Please triage this failure.
+regexp/quantified-assertions_test: Crash # (throw new ExpectException(message)): Unhandled node
+regexp/range-bound-ffff_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+regexp/range-out-of-order_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+regexp/ranges-and-escaped-hyphens_test: Crash # (throw new ExpectException(message)): Unhandled node
+regexp/regexp_kde_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+regexp/regexp_test: Crash # (throw new ExpectException(message)): Unhandled node
+regexp/regress-6-9-regexp_test: Crash # (throw new ExpectException(message)): Unhandled node
+regexp/regress-regexp-construct-result_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+regexp/repeat-match-waldemar_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+regexp/results-cache_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+regexp/stack-overflow2_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+regexp/stack-overflow_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+regexp/standalones_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+reg_exp_start_end_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+reg_exp_string_match_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+regexp/toString_test: Crash # (throw new ExpectException(message)): Unhandled node
+regexp/UC16_test: Crash # (throw new ExpectException(message)): Unhandled node
+regexp/unicodeCaseInsensitive_test: Crash # (throw new ExpectException(message)): Unhandled node
+regexp/unicode-handling_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+regexp/zero-length-alternatives_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+regress_11099_test: Crash # (throw 'Wrong result!'): Unhandled node
+regress_r21715_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+safe_to_string_test: Crash # (throw new ExpectException(message)): Unhandled node
+set_containsAll_test: Crash # (throw new ExpectException(message)): Unhandled node
+set_contains_test: Crash # (throw new ExpectException(message)): Unhandled node
+set_intersection_test: Crash # (throw new ExpectException(message)): Unhandled node
+set_iterator_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+set_removeAll_test: Crash # (throw new ExpectException(message)): Unhandled node
+set_remove_test: Crash # (throw new ExpectException(message)): Unhandled node
+set_test: Crash # (throw new ExpectException(message)): Unhandled node
+set_to_string_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+shuffle_test: Crash # (throw new ExpectException(message)): Unhandled node
+sort_test: Crash # (throw new ExpectException(message)): Unhandled node
+splay_tree_from_iterables_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+splay_tree_from_iterable_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+splay_tree_test: Crash # (throw new ExpectException(message)): Unhandled node
+stacktrace_fromstring_test: Crash # (throw 0): Unhandled node
+stopwatch2_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+stopwatch_test: Crash # (throw new ExpectException(message)): Unhandled node
+string_base_vm_test: Crash # (try {s.substring(5,12);}on RangeError catch (ex){exception_caught=true;}): "on T" catch block
+string_buffer_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+string_case_test/01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+string_case_test/02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+string_case_test/03: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+string_case_test/none: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+string_codeunits_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+string_fromcharcodes_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+string_fromcharcode_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+string_from_environment2_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+string_from_environment_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+string_from_list_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+string_operations_with_null_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+string_pattern_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+string_replace_all_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+string_replace_dollar_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+string_replace_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+string_runes_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+string_source_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+string_split_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+strings_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+string_substring_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+string_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+string_to_lower_case_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+string_trim2_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+string_trimlr_test/01: Crash # (throw new ExpectException(message)): Unhandled node
+string_trimlr_test/none: Crash # (throw new ExpectException(message)): Unhandled node
+string_trim_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+symbol_operator_test/03: Crash # (throw "Didn't throw: ${name}"): Unhandled node
+symbol_operator_test/none: Crash # (throw "Not equal #${name}, \$${name}: ${constSymbol}, ${mirrorSymbol}"): Unhandled node
+symbol_reserved_word_test/03: Pass # Please triage this failure.
+symbol_reserved_word_test/06: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+symbol_reserved_word_test/09: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+symbol_reserved_word_test/12: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+symbol_test/none: Crash # "on T" catch block
+toInt_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+unicode2_test: Crash # (throw new ExpectException(message)): Unhandled node
+unicode_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+uri_base_test: Crash # "on T" catch block
+uri_file_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+uri_http_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+uri_ipv4_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+uri_ipv6_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+uri_normalize_path_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+uri_normalize_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+uri_parse_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+uri_path_test: Crash # (throw new ExpectException(message)): Unhandled node
+uri_query_test: Crash # (throw new ExpectException(message)): Unhandled node
+uri_scheme_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+uri_test: Crash # (throw new ExpectException(message)): Unhandled node
diff --git a/tests/corelib/date_time_parse_test.dart b/tests/corelib/date_time_parse_test.dart
index a8b9827..2f48923 100644
--- a/tests/corelib/date_time_parse_test.dart
+++ b/tests/corelib/date_time_parse_test.dart
@@ -23,4 +23,16 @@
check(new DateTime.utc(2012, 02, 27, 14), "2012-02-27T14+0000");
check(new DateTime.utc(2012, 02, 27, 14), "2012-02-27T14+00:00");
check(new DateTime.utc(2012, 02, 27, 14), "2012-02-27T14 +00:00");
+
+ check(new DateTime.utc(2015, 02, 14, 13, 0, 0, 0),
+ "2015-02-15T00:00+11");
+ check(new DateTime.utc(2015, 02, 14, 13, 0, 0, 0),
+ "2015-02-15T00:00:00+11");
+ check(new DateTime.utc(2015, 02, 14, 13, 0, 0, 0),
+ "2015-02-15T00:00:00+11:00");
+
+ check(new DateTime.utc(2015, 02, 15, 0, 0, 0, 501),
+ "2015-02-15T00:00:00.5005Z");
+ check(new DateTime.utc(2015, 02, 15, 0, 0, 0, 512),
+ "2015-02-15T00:00:00.5115Z");
}
diff --git a/tests/corelib/list_unmodifiable_test.dart b/tests/corelib/list_unmodifiable_test.dart
new file mode 100644
index 0000000..e2f82e7
--- /dev/null
+++ b/tests/corelib/list_unmodifiable_test.dart
@@ -0,0 +1,245 @@
+// Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+import "package:expect/expect.dart";
+import "dart:collection";
+import "dart:typed_data";
+
+main() {
+ var intTest = new Test<int>();
+ intTest.run("ConstList", createConstList);
+ intTest.run("FixedList", createFixedList);
+ intTest.run("GrowableList", createGrowableList);
+ intTest.run("ConstMapKeys", createConstMapKeys);
+ intTest.run("ConstMapValues", createConstMapValues);
+ intTest.run("MapKeys", createMapKeys);
+ intTest.run("MapValues", createMapValues);
+ intTest.run("SplayMapKeys", createSplayMapKeys);
+ intTest.run("SplayMapValues", createSplayMapValues);
+ intTest.run("Set", createSet);
+ intTest.run("SplaySet", createSplaySet);
+ intTest.run("Queue", createQueue);
+ intTest.run("ListMapKeys", createListMapKeys);
+ intTest.run("ListMapValues", createListMapValues);
+ intTest.run("CodeUnits", createCodeUnits);
+ intTest.run("TypedList", createTypedList);
+
+ new Test<String>().test("strings", ["a", "b", "c"]);
+
+ new Test<num>().test("superclass", <int>[1, 2, 3]);
+ new Test<int>().test("subclass", <num>[1, 2, 3]);
+}
+
+class Test<E> {
+ run(name, Iterable create(int size)) {
+ test(name, create(0));
+ test(name, create(1));
+ test(name, create(3));
+ }
+
+ test(name, iterable) {
+ testSingle(name, iterable);
+ testSingle("$name-where", iterable.where((x) => true));
+ testSingle("$name-map", iterable.map((x) => x));
+ testSingle("$name-expand", iterable.expand((x) => [x, x]));
+ testSingle("$name-skip", iterable.skip(1));
+ testSingle("$name-take", iterable.take(2));
+ testSingle("$name-skipWhile", iterable.skipWhile((x) => false));
+ testSingle("$name-takeWhile", iterable.takeWhile((x) => true));
+ }
+
+ testSingle(name, iterable) {
+ var elements = iterable.toList();
+ int length = elements.length;
+
+ var list = new List<E>.unmodifiable(iterable);
+
+ Expect.isTrue(list is List<E>, "$name-type-$E");
+ Expect.isTrue(list is! List<Test>, "$name-!type-!$E");
+
+ checkElements() {
+ Expect.equals(length, list.length);
+ for (int i = 0; i < length; i++) {
+ Expect.identical(elements[i], list[i], "$name-identical-$i");
+ }
+ }
+
+ checkElements();
+
+ throws(funcName, func) {
+ try {
+ func();
+ } catch (e, s) {
+ Expect.isTrue(e is UnsupportedError, "$name: $funcName threw $e");
+ return;
+ }
+ checkElements();
+ Expect.fail("$name: $funcName didn't throw");
+ }
+
+ throws("[]=", () { list[0] = null; });
+ throws("length=", () { list.length = length + 1; });
+ throws("length=", () { list.length = length - 1; });
+ throws("setAll", () { list.setAll(0, []); });
+ throws("add", () { list.add(null); });
+ throws("insert", () { list.insert(0, null); });
+ throws("insertAll", () { list.insertAll(0, []); });
+ throws("addAll", () { list.addAll([]); });
+ throws("remove", () { list.remove(null); });
+ throws("removeWhere", () { list.removeWhere((x) => true); });
+ throws("retainWhere", () { list.retainWhere((x) => false); });
+ throws("sort", () { list.sort(); });
+ throws("shuffle", () { list.shuffle(); });
+ throws("clear", () { list.clear(); });
+ throws("removeAt", () { list.removeAt(0); });
+ throws("removeLast", () { list.removeLast(); });
+ throws("setRange", () { list.setRange(0, 1, []); });
+ throws("removeRange", () { list.removeRange(0, 1); });
+ throws("replaceRange", () { list.replaceRange(0, 1, []); });
+ throws("fillRange", () { list.fillRange(0, 1, null); });
+
+ success(opName, op(list)) {
+ var expect;
+ try {
+ expect = op(elements);
+ } catch (e) {
+ try {
+ op(list);
+ } catch (e2) {
+ Expect.equals(e.runtimeType, e2.runtimeType);
+ return;
+ }
+ Expect.fail("$name-$opName didn't throw, expected: $e");
+ }
+ var actual = op(list);
+ checkElements();
+ if (expect is List) {
+ Expect.listEquals(expect, actual, "$name-$opName");
+ } else if (expect is Iterable) {
+ Expect.isTrue(actual is Iterable);
+ Expect.listEquals(expect.toList(), actual.toList(), "$name-$opName");
+ } else {
+ Expect.equals(expect, actual, "$name-$opName");
+ }
+ }
+
+ success("indexOf", (l) => l.indexOf(null));
+ success("lastIndexOf", (l) => l.lastIndexOf(null));
+ success("contains", (l) => l.contains(2));
+ success("elementAt", (l) => l.elementAt[1]);
+ success("reversed", (l) => l.reversed);
+ success("sublist0-1", (l) => l.sublist(0, 1));
+ success("getRange0-1", (l) => l.getRange(0, 1));
+ success("asMap-keys", (l) => l.asMap().keys);
+ success("asMap-values", (l) => l.asMap().values);
+ success("where", (l) => l.where((x) => true));
+ success("map", (l) => l.map((x) => x));
+ success("expand", (l) => l.expand((x) => [x, x]));
+ success("skip", (l) => l.skip(1));
+ success("take", (l) => l.take(1));
+ success("skipWhile", (l) => l.skipWhile((x) => false));
+ success("takeWhile", (l) => l.takeWhile((x) => true));
+ success("first", (l) => l.first);
+ success("last", (l) => l.last);
+ success("single", (l) => l.single);
+ success("firstWhere", (l) => l.firstWhere((x) => true));
+ success("lastWhere", (l) => l.lastWhere((x) => true));
+ success("singleWhere", (l) => l.singleWhere((x) => true));
+ success("isEmpty", (l) => l.isEmpty);
+ success("isNotEmpty", (l) => l.isNotEmpty);
+ success("join", (l) => l.join("/"));
+ success("fold", (l) => l.fold("--", (a, b) => "$a/$b"));
+ success("reduce", (l) => l.reduce((a, b) => a + b));
+ success("every", (l) => l.every((x) => x == 0));
+ success("any", (l) => l.any((x) => x == 2));
+ success("toList", (l) => l.toList());
+ success("toSet", (l) => l.toSet());
+ success("toString", (l) => l.toString());
+
+ var it = elements.iterator;
+ list.forEach((v) {
+ Expect.isTrue(it.moveNext());
+ Expect.equals(it.current, v);
+ });
+ Expect.isFalse(it.moveNext());
+
+ if (elements is List<int> && list is List<int>) {
+ success("String.fromCharCodes", (l) => new String.fromCharCodes(l));
+ }
+ }
+}
+
+createConstList(n) {
+ if (n == 0) return const <int>[];
+ return const<int>[1, 2, 3];
+}
+createFixedList(n) {
+ var result = new List<int>(n);
+ for (int i = 0; i < n; i++) result[i] = n;
+ return result;
+}
+createGrowableList(n) {
+ var result = new List<int>()..length = n;
+ for (int i = 0; i < n; i++) result[i] = n;
+ return result;
+}
+createIterable(n) => new Iterable.generate(n);
+createConstMapKeys(n) {
+ if (n == 0) return const <int,int>{}.keys;
+ return const <int,int>{0: 0, 1: 1, 2: 2}.keys;
+}
+createConstMapValues(n) {
+ if (n == 0) return const <int,int>{}.values;
+ return const <int,int>{0: 0, 1: 1, 2: 2}.values;
+}
+createMapKeys(n) {
+ var map = <int, int>{};
+ for (int i = 0; i < n; i++) map[i] = i;
+ return map.keys;
+}
+createMapValues(n) {
+ var map = <int, int>{};
+ for (int i = 0; i < n; i++) map[i] = i;
+ return map.values;
+}
+createSplayMapKeys(n) {
+ var map = new SplayTreeMap<int, int>();
+ for (int i = 0; i < n; i++) map[i] = i;
+ return map.keys;
+}
+createSplayMapValues(n) {
+ var map = new SplayTreeMap<int, int>();
+ for (int i = 0; i < n; i++) map[i] = i;
+ return map.values;
+}
+createSet(n) {
+ var set = new Set<int>();
+ for (int i = 0; i < n; i++) set.add(i);
+ return set;
+}
+createSplaySet(n) {
+ var set = new SplayTreeSet<int>();
+ for (int i = 0; i < n; i++) set.add(i);
+ return set;
+}
+createQueue(n) {
+ var queue = new Queue<int>();
+ for (int i = 0; i < n; i++) queue.add(i);
+ return queue;
+}
+createListMapKeys(n) {
+ return createGrowableList(n).asMap().keys;
+}
+createListMapValues(n) {
+ return createGrowableList(n).asMap().values;
+}
+createCodeUnits(n) {
+ var string = new String.fromCharCodes(new Iterable.generate(n));
+ return string.codeUnits;
+}
+createTypedList(n) {
+ var tl = new Uint8List(n);
+ for (int i = 0; i < n; i++) tl[i] = i;
+ return tl;
+}
diff --git a/tests/corelib/stacktrace_fromstring_test.dart b/tests/corelib/stacktrace_fromstring_test.dart
new file mode 100644
index 0000000..eb4d6b0
--- /dev/null
+++ b/tests/corelib/stacktrace_fromstring_test.dart
@@ -0,0 +1,41 @@
+// Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+import "package:expect/expect.dart";
+import "package:async_helper/async_helper.dart";
+import "dart:async";
+
+void main() {
+ StackTrace stack;
+ try { throw 0; } catch (e, s) { stack = s; }
+ var string = "$stack";
+ StackTrace stringTrace = new StackTrace.fromString(string);
+ Expect.isTrue(stringTrace is StackTrace);
+ Expect.equals(stack.toString(), stringTrace.toString());
+
+ string = "some random string, nothing like a StackTrace";
+ stringTrace = new StackTrace.fromString(string);
+ Expect.isTrue(stringTrace is StackTrace);
+ Expect.equals(string, stringTrace.toString());
+
+ // Use stacktrace asynchronously.
+ asyncStart();
+ var c = new Completer();
+ c.completeError(0, stringTrace);
+ c.future.then((v) {
+ throw "Unexpected value: $v";
+ }, onError: (e, s) {
+ Expect.equals(string, s.toString());
+ }).then((_) {
+ var c = new StreamController();
+ c.stream.listen((v) {
+ throw "Unexpected value: $v";
+ }, onError: (e, s) {
+ Expect.equals(string, s.toString());
+ asyncEnd();
+ });
+ c.addError(0, stringTrace);
+ c.close();
+ });
+}
diff --git a/tests/corelib/string_buffer_test.dart b/tests/corelib/string_buffer_test.dart
index 2c556f7..8a24b35 100644
--- a/tests/corelib/string_buffer_test.dart
+++ b/tests/corelib/string_buffer_test.dart
@@ -96,6 +96,49 @@
bf.writeAll(["", "", ""]);
Expect.equals("foobarabc", bf.toString());
+
+ bf.writeAll(["", "", ""], "");
+ Expect.equals("foobarabc", bf.toString());
+
+ StringBuffer bf2 = new StringBuffer("");
+ bf2.writeAll([], "s");
+ Expect.equals("", bf2.toString());
+
+ StringBuffer bf3 = new StringBuffer("");
+ bf3.writeAll(["a"], "s");
+ Expect.equals("a", bf3.toString());
+
+ StringBuffer bf4 = new StringBuffer("");
+ bf4.writeAll(["a", "b"], "s");
+ Expect.equals("asb", bf4.toString());
+}
+
+void testWriteAll2() {
+ // Passing `null` for separator is an error that is checked when the iterable
+ // is not empty. This is not specified in the documentation but we want
+ // implementations to be consistent.
+ StringBuffer bf1 = new StringBuffer("");
+ bf1.writeAll([], null);
+ Expect.equals("", bf1.toString());
+
+ StringBuffer bf2 = new StringBuffer("");
+ Expect.throws(() { bf2.writeAll([1], null); });
+}
+
+void testWriteln() {
+ StringBuffer bf1 = new StringBuffer("");
+ bf1.writeln("Hello");
+ Expect.equals("Hello\n", bf1.toString());
+
+ StringBuffer bf2 = new StringBuffer("");
+ bf2.writeln();
+ Expect.equals("\n", bf2.toString());
+
+ StringBuffer bf3 = new StringBuffer("");
+ bf3.writeln("\n");
+ bf3.writeln(null);
+ bf3.writeln(1);
+ Expect.equals("\n\nnull\n1\n", bf3.toString());
}
void testClear() {
@@ -186,6 +229,8 @@
testWrite();
testWriteCharCode();
testWriteAll();
+ testWriteAll2();
+ testWriteln();
testClear();
testChaining();
}
diff --git a/tests/corelib/uri_file_test.dart b/tests/corelib/uri_file_test.dart
index 194fd9d..79da833 100644
--- a/tests/corelib/uri_file_test.dart
+++ b/tests/corelib/uri_file_test.dart
@@ -91,10 +91,15 @@
];
for (var test in tests) {
- Uri uri;
- uri = new Uri.file(test[1], windows: true);
+ Uri uri = new Uri.file(test[1], windows: true);
Expect.equals(test[0], uri.toString());
Expect.equals(test[2], uri.toFilePath(windows: true));
+ bool couldBeDir = uri.path.isEmpty || uri.path.endsWith('\\');
+ Uri dirUri = new Uri.directory(test[1], windows: true);
+ Expect.isTrue(dirUri.path.isEmpty || dirUri.path.endsWith('/'));
+ if (couldBeDir) {
+ Expect.equals(uri, dirUri);
+ }
}
}
@@ -119,6 +124,12 @@
Expect.throws(
() => new Uri.file("\\\\?\\UNX\\server\\share\\file", windows: true),
(e) => e is ArgumentError);
+ Expect.throws(
+ () => new Uri.directory("\\\\?\\file", windows: true),
+ (e) => e is ArgumentError);
+ Expect.throws(
+ () => new Uri.directory("\\\\?\\UNX\\server\\share\\file", windows: true),
+ (e) => e is ArgumentError);
}
testFileUriDriveLetter() {
@@ -145,6 +156,12 @@
(e) => e is ArgumentError);
Expect.throws(() => new Uri.file("C:a\b", windows: true),
(e) => e is ArgumentError);
+ Expect.throws(() => new Uri.directory("C:", windows: true),
+ (e) => e is ArgumentError);
+ Expect.throws(() => new Uri.directory("C:a", windows: true),
+ (e) => e is ArgumentError);
+ Expect.throws(() => new Uri.directory("C:a\b", windows: true),
+ (e) => e is ArgumentError);
}
testFileUriResolve() {
@@ -197,19 +214,39 @@
(e) => e is ArgumentError);
Expect.throws(() => new Uri.file("\\$test", windows: true),
(e) => e is ArgumentError);
+ Expect.throws(() => new Uri.directory(test, windows: true),
+ (e) => e is ArgumentError);
+ Expect.throws(() => new Uri.directory("\\$test", windows: true),
+ (e) => e is ArgumentError);
// It is possible to create non-Windows URIs, but not Windows URIs.
Uri uri = new Uri.file(test, windows: false);
Uri absoluteUri = new Uri.file("/$test", windows: false);
- Expect.throws(() => new Uri.file(test, windows: true));
- Expect.throws(() => new Uri.file("\\$test", windows: true));
+ Uri dirUri = new Uri.directory(test, windows: false);
+ Uri dirAbsoluteUri = new Uri.directory("/$test", windows: false);
+ Expect.throws(() => new Uri.file(test, windows: true),
+ (e) => e is ArgumentError);
+ Expect.throws(() => new Uri.file("\\$test", windows: true),
+ (e) => e is ArgumentError);
+ Expect.throws(() => new Uri.directory(test, windows: true),
+ (e) => e is ArgumentError);
+ Expect.throws(() => new Uri.directory("\\$test", windows: true),
+ (e) => e is ArgumentError);
// It is possible to extract non-Windows file path, but not
// Windows file path.
Expect.equals(test, uri.toFilePath(windows: false));
Expect.equals("/$test", absoluteUri.toFilePath(windows: false));
- Expect.throws(() => uri.toFilePath(windows: true));
- Expect.throws(() => absoluteUri.toFilePath(windows: true));
+ Expect.equals("$test/", dirUri.toFilePath(windows: false));
+ Expect.equals("/$test/", dirAbsoluteUri.toFilePath(windows: false));
+ Expect.throws(() => uri.toFilePath(windows: true),
+ (e) => e is UnsupportedError);
+ Expect.throws(() => absoluteUri.toFilePath(windows: true),
+ (e) => e is UnsupportedError);
+ Expect.throws(() => dirUri.toFilePath(windows: true),
+ (e) => e is UnsupportedError);
+ Expect.throws(() => dirAbsoluteUri.toFilePath(windows: true),
+ (e) => e is UnsupportedError);
}
// Backslash
@@ -218,6 +255,8 @@
// It is possible to create both non-Windows URIs, and Windows URIs.
Uri uri = new Uri.file(test, windows: false);
Uri absoluteUri = new Uri.file("/$test", windows: false);
+ Uri dirUri = new Uri.directory(test, windows: false);
+ Uri dirAbsoluteUri = new Uri.directory("/$test", windows: false);
new Uri.file(test, windows: true);
new Uri.file("\\$test", windows: true);
@@ -226,19 +265,32 @@
// in a path segment).
Expect.equals(test, uri.toFilePath(windows: false));
Expect.equals("/$test", absoluteUri.toFilePath(windows: false));
+ Expect.equals("$test/", dirUri.toFilePath(windows: false));
+ Expect.equals("/$test/", dirAbsoluteUri.toFilePath(windows: false));
Expect.throws(() => uri.toFilePath(windows: true),
(e) => e is UnsupportedError);
- Expect.throws(() => absoluteUri.toFilePath(windows: true));
+ Expect.throws(() => absoluteUri.toFilePath(windows: true),
+ (e) => e is UnsupportedError);
+ Expect.throws(() => dirUri.toFilePath(windows: true),
+ (e) => e is UnsupportedError);
+ Expect.throws(() => dirAbsoluteUri.toFilePath(windows: true),
+ (e) => e is UnsupportedError);
}
}
testFileUriIllegalDriveLetter() {
Expect.throws(() => new Uri.file("1:\\", windows: true),
(e) => e is ArgumentError);
+ Expect.throws(() => new Uri.directory("1:\\", windows: true),
+ (e) => e is ArgumentError);
Uri uri = new Uri.file("1:\\", windows: false);
+ Uri dirUri = new Uri.directory("1:\\", windows: false);
Expect.equals("1:\\", uri.toFilePath(windows: false));
+ Expect.equals("1:\\/", dirUri.toFilePath(windows: false));
Expect.throws(() => uri.toFilePath(windows: true),
(e) => e is UnsupportedError);
+ Expect.throws(() => dirUri.toFilePath(windows: true),
+ (e) => e is UnsupportedError);
}
testAdditionalComponents() {
diff --git a/tests/corelib/uri_normalize_path_test.dart b/tests/corelib/uri_normalize_path_test.dart
new file mode 100644
index 0000000..03c818f
--- /dev/null
+++ b/tests/corelib/uri_normalize_path_test.dart
@@ -0,0 +1,54 @@
+// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+library uriNormalizePathTest;
+
+import "package:expect/expect.dart";
+
+test(String path, String normalizedPath) {
+ for (var scheme in ["http", "file", "unknown"]) {
+ for (var auth in [[null, "hostname", null],
+ ["userinfo", "hostname", 1234],
+ [null, null, null]]) {
+ for (var query in [null, "query"]) {
+ for (var fragment in [null, "fragment"]) {
+ var base = new Uri(scheme: scheme,
+ userInfo: auth[0],
+ host: auth[1],
+ port: auth[2],
+ path: path,
+ query: query,
+ fragment: fragment);
+ var expected = base.replace(path:
+ (base.hasAuthority && normalizedPath.isEmpty) ? "/"
+ : normalizedPath);
+ var actual = base.normalizePath();
+ Expect.equals(expected, actual, "$base");
+ }
+ }
+ }
+ }
+}
+testNoChange(String path) {
+ test(path, path);
+}
+
+main() {
+ testNoChange("foo/bar/baz");
+ testNoChange("/foo/bar/baz");
+ testNoChange("foo/bar/baz/");
+ test("foo/bar/..", "foo/");
+ test("foo/bar/.", "foo/bar/");
+ test("foo/./bar/../baz", "foo/baz");
+ test("../../foo", "foo");
+ test("./../foo", "foo");
+ test("./../", "");
+ test("./../.", "");
+ test("foo/bar/baz/../../../../qux", "qux");
+ test("/foo/bar/baz/../../../../qux", "/qux");
+ test(".", "");
+ test("..", "");
+ test("/.", "/");
+ test("/..", "/");
+}
diff --git a/tests/html/canvas_pixel_array_type_alias_test.dart b/tests/html/canvas_pixel_array_type_alias_test.dart
index f346850..4dd6b40 100644
--- a/tests/html/canvas_pixel_array_type_alias_test.dart
+++ b/tests/html/canvas_pixel_array_type_alias_test.dart
@@ -94,7 +94,9 @@
var data = context.createImageData(canvas.width, canvas.height).data;
expect(inscrutable(data).runtimeType == data.runtimeType, isTrue);
});
+ });
+ group('types2_runtimeTypeName', () {
test('runtimeTypeName', () {
var data = context.createImageData(canvas.width, canvas.height).data;
expect('${inscrutable(data).runtimeType}', 'Uint8ClampedList');
diff --git a/tests/html/html.status b/tests/html/html.status
index c9d468d..701d1cb 100644
--- a/tests/html/html.status
+++ b/tests/html/html.status
@@ -6,7 +6,6 @@
interactive_test: Skip # Must be run manually.
dromaeo_smoke_test: Skip # Issue 14521, 8257
cross_frame_test: Skip # Test reloads itself. Issue 18558
-svgelement_test/constructors: Skip # Temporary suppression, WIP alanknight
[ $compiler == none && ($runtime == drt || $runtime == dartium || $runtime == ContentShellOnAndroid) ]
custom/attribute_changed_callback_test/unsupported_on_polyfill: Fail # Issue 18931 (Disabled for Chrome 35 roll)
@@ -54,7 +53,9 @@
isolates_test: Fail # Issue 13921
indexeddb_3_test: Skip # Issue 19578. Timeouts and RuntimeError
fileapi_test/getFile: Pass, Fail # Issue 20488
-node_validator_test/dom_clobbering: Skip # Dartium is immune to DOM clobbering, so the HTML passes through the sanitizer.
+
+# DO NOT Suppress/Skip the below XSS security test for dart2js - any failure is a P0 bug.
+node_validator_important_if_you_suppress_make_the_bug_critical_test/dom_clobbering: Fail # Dartium is immune to DOM clobbering, so the HTML passes through the sanitizer.
[ $compiler == none && ($runtime == drt || $runtime == dartium || $runtime == ContentShellOnAndroid) && $mode == debug ]
websocket_test/websocket: Skip # Issue 17666
@@ -104,10 +105,13 @@
touchevent_test/supported: Fail # Touch events are only supported on touch devices
xhr_cross_origin_test: Pass, Fail # Issue 11884
xhr_test: Pass, Fail # Issue 11884
-audiocontext_test/functional: Skip # Renderer crash. Issue 22327
element_animate_test/omit_timing: Skip # Timing out inexplicably. Temporarily suppressing (alanknight)
element_animate_test/timing_dict: Skip # Timing out inexplicably. Temporarily suppressing (alanknight)
+[ $runtime == chrome && ($system == windows || $system == macos) ]
+# New failure on Chrome 42. Linux bots are not yet updated.
+element_animate_test/simple_timing: RuntimeError # Please triage this failure
+
[$runtime == drt || $runtime == dartium || $runtime == chrome || $runtime == chromeOnAndroid || $runtime == ContentShellOnAndroid ]
webgl_1_test: Pass, Fail # Issue 8219
@@ -185,6 +189,9 @@
worker_test/functional: Fail # IE uses incorrect security context for Blob URIs.
transferables_test: Fail # Issue 9846
+[ $compiler == dart2js && $minified ]
+canvas_pixel_array_type_alias_test/types2_runtimeTypeName: Fail, OK # Issue 12605
+
[ $compiler == dart2js && $runtime == chrome ]
css_test/supportsPointConversions: Fail # Issues 21710
css_test/functional: Fail # Issues 21710
@@ -290,7 +297,7 @@
indexeddb_2_test: RuntimeError # Issue 21433
indexeddb_4_test: RuntimeError # Issue 21433
indexeddb_5_test: RuntimeError # Issue 21433
-wheelevent_test: RuntimeError # Issue 21434
+wheelevent_test: RuntimeError # Issue 21434, 12958
js_test: RuntimeError # Issue 21434
[ $runtime == opera ]
@@ -381,7 +388,7 @@
wheelevent_test: Fail # Issue 12958
[ $compiler == dart2js && $runtime == chrome]
-svgelement_test/supported_altGlyph: RuntimeError # Issue 22154
+svgelement_test/supported_altGlyph: RuntimeError # Issue 23144
[ ($runtime == dartium) && ($system == macos || $system == windows || $system == linux)]
# Desktop operating systems do not support touch events on chrome 34 dartium.
@@ -390,9 +397,6 @@
[ (($runtime == dartium || $runtime == drt) && $system == macos) || $system == windows ]
xhr_test/xhr: Skip # Times out. Issue 21527
-[ $compiler == none && $runtime == dartium ]
-element_offset_test/offset: Pass, Fail # Issue 13719, 13296
-
[ $compiler == dartanalyzer || $compiler == dart2analyzer ]
custom/document_register_basic_test: StaticWarning
custom/element_upgrade_test: StaticWarning
@@ -411,3 +415,149 @@
typing_test: StaticWarning
webgl_1_test: StaticWarning
window_nosuchmethod_test: StaticWarning
+
+[ $compiler == dart2js && $cps_ir ]
+async_spawnuri_test: Crash # cannot compile methods that need interceptor calling convention.
+async_test: Crash # cannot compile methods that need interceptor calling convention.
+audiobuffersourcenode_test: Crash # try/finally
+audiocontext_test: Crash # try/finally
+audioelement_test: Crash # cannot compile methods that need interceptor calling convention.
+b_element_test: Crash # cannot compile methods that need interceptor calling convention.
+blob_constructor_test: Crash # cannot compile methods that need interceptor calling convention.
+cache_test: Crash # try/finally
+callbacks_test: Crash # cannot compile methods that need interceptor calling convention.
+canvas_pixel_array_type_alias_test: Crash # try/finally
+canvas_test: Crash # cannot compile methods that need interceptor calling convention.
+canvasrenderingcontext2d_test: Crash # try/finally
+cdata_test: Crash # cannot compile methods that need interceptor calling convention.
+client_rect_test: Crash # cannot compile methods that need interceptor calling convention.
+cross_domain_iframe_test: Crash # cannot compile methods that need interceptor calling convention.
+crypto_test: Crash # try/finally
+css_rule_list_test: Crash # cannot compile methods that need interceptor calling convention.
+css_test: Crash # try/finally
+cssstyledeclaration_test: Crash # cannot compile methods that need interceptor calling convention.
+custom/attribute_changed_callback_test: Crash # try/finally
+custom/constructor_calls_created_synchronously_test: Crash # cannot compile methods that need interceptor calling convention.
+custom/created_callback_test: Crash # cannot compile methods that need interceptor calling convention.
+custom/document_register_basic_test: Crash # cannot compile methods that need interceptor calling convention.
+custom/document_register_type_extensions_test: Crash # try/finally
+custom/element_upgrade_test: Crash # cannot compile methods that need interceptor calling convention.
+custom/entered_left_view_test: Crash # try/finally
+custom/js_custom_test: Crash # cannot compile methods that need interceptor calling convention.
+custom/mirrors_test: Crash # cannot compile methods that need interceptor calling convention.
+custom/regress_194523002_test: Crash # unsupported element kind: _defaultEnvironment:field
+custom_element_method_clash_test: Crash # try/finally
+custom_element_name_clash_test: Crash # try/finally
+custom_elements_23127_test: Crash # try/finally
+custom_elements_test: Crash # try/finally
+custom_tags_test: Crash # cannot compile methods that need interceptor calling convention.
+dart_object_local_storage_test: Crash # cannot compile methods that need interceptor calling convention.
+datalistelement_test: Crash # cannot compile methods that need interceptor calling convention.
+document_test: Crash # try/finally
+documentfragment_test: Crash # cannot compile methods that need interceptor calling convention.
+dom_constructors_test: Crash # cannot compile methods that need interceptor calling convention.
+domparser_test: Crash # cannot compile methods that need interceptor calling convention.
+element_add_test: Crash # try/finally
+element_animate_test: Crash # try/finally
+element_classes_svg_test: Crash # cannot compile methods that need interceptor calling convention.
+element_classes_test: Crash # cannot compile methods that need interceptor calling convention.
+element_constructor_1_test: Crash # cannot compile methods that need interceptor calling convention.
+element_dimensions_test: Crash # try/finally
+element_offset_test: Crash # try/finally
+element_test: Crash # try/finally
+element_types_constructors1_test: Crash # try/finally
+element_types_constructors2_test: Crash # try/finally
+element_types_constructors3_test: Crash # try/finally
+element_types_constructors4_test: Crash # try/finally
+element_types_constructors5_test: Crash # try/finally
+element_types_constructors6_test: Crash # try/finally
+element_types_test: Crash # try/finally
+event_customevent_test: Crash # cannot compile methods that need interceptor calling convention.
+events_test: Crash # cannot compile methods that need interceptor calling convention.
+exceptions_test: Crash # cannot compile methods that need interceptor calling convention.
+fileapi_test: Crash # try/finally
+filereader_test: Crash # cannot compile methods that need interceptor calling convention.
+fontface_loaded_test: Crash # cannot compile methods that need interceptor calling convention.
+fontface_test: Crash # cannot compile methods that need interceptor calling convention.
+form_data_test: Crash # try/finally
+form_element_test: Crash # cannot compile methods that need interceptor calling convention.
+geolocation_test: Crash # cannot compile methods that need interceptor calling convention.
+hidden_dom_1_test: Crash # cannot compile methods that need interceptor calling convention.
+hidden_dom_2_test: Crash # cannot compile methods that need interceptor calling convention.
+history_test: Crash # try/finally
+htmlcollection_test: Crash # cannot compile methods that need interceptor calling convention.
+htmlelement_test: Crash # cannot compile methods that need interceptor calling convention.
+htmloptionscollection_test: Crash # cannot compile methods that need interceptor calling convention.
+indexeddb_1_test: Crash # try/finally
+indexeddb_2_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+indexeddb_3_test: Crash # cannot compile methods that need interceptor calling convention.
+indexeddb_4_test: Crash # cannot compile methods that need interceptor calling convention.
+indexeddb_5_test: Crash # cannot compile methods that need interceptor calling convention.
+input_element_test: Crash # try/finally
+instance_of_test: Crash # cannot compile methods that need interceptor calling convention.
+isolates_test: Crash # cannot compile methods that need interceptor calling convention.
+js_interop_1_test: Crash # cannot compile methods that need interceptor calling convention.
+js_test: Crash # try/finally
+keyboard_event_test: Crash # cannot compile methods that need interceptor calling convention.
+localstorage_test: Crash # cannot compile methods that need interceptor calling convention.
+location_test: Crash # cannot compile methods that need interceptor calling convention.
+media_stream_test: Crash # try/finally
+mediasource_test: Crash # try/finally
+messageevent_test: Crash # cannot compile methods that need interceptor calling convention.
+mouse_event_test: Crash # cannot compile methods that need interceptor calling convention.
+mutationobserver_test: Crash # try/finally
+native_gc_test: Crash # cannot compile methods that need interceptor calling convention.
+navigator_test: Crash # cannot compile methods that need interceptor calling convention.
+node_test: Crash # try/finally
+node_validator_important_if_you_suppress_make_the_bug_critical_test: Crash # try/finally
+non_instantiated_is_test: Crash # cannot compile methods that need interceptor calling convention.
+notification_test: Crash # try/finally
+performance_api_test: Crash # try/finally
+postmessage_structured_test: Crash # try/finally
+query_test: Crash # cannot compile methods that need interceptor calling convention.
+queryall_test: Crash # cannot compile methods that need interceptor calling convention.
+range_test: Crash # try/finally
+request_animation_frame_test: Crash # cannot compile methods that need interceptor calling convention.
+rtc_test: Crash # try/finally
+selectelement_test: Crash # cannot compile methods that need interceptor calling convention.
+serialized_script_value_test: Crash # cannot compile methods that need interceptor calling convention.
+shadow_dom_test: Crash # try/finally
+shadowroot_test: Crash # cannot compile methods that need interceptor calling convention.
+speechrecognition_test: Crash # try/finally
+storage_quota_test/missingenumcheck: Crash # cannot compile methods that need interceptor calling convention.
+storage_quota_test/none: Crash # cannot compile methods that need interceptor calling convention.
+storage_test: Crash # cannot compile methods that need interceptor calling convention.
+streams_test: Crash # cannot compile methods that need interceptor calling convention.
+svg_test: Crash # try/finally
+svgelement_test: Crash # try/finally
+table_test: Crash # cannot compile methods that need interceptor calling convention.
+touchevent_test: Crash # try/finally
+track_element_constructor_test: Crash # cannot compile methods that need interceptor calling convention.
+transferables_test: Crash # cannot compile methods that need interceptor calling convention.
+transition_event_test: Crash # try/finally
+typed_arrays_1_test: Crash # try/finally
+typed_arrays_2_test: Crash # cannot compile methods that need interceptor calling convention.
+typed_arrays_3_test: Crash # cannot compile methods that need interceptor calling convention.
+typed_arrays_4_test: Crash # cannot compile methods that need interceptor calling convention.
+typed_arrays_5_test: Crash # cannot compile methods that need interceptor calling convention.
+typed_arrays_arraybuffer_test: Crash # cannot compile methods that need interceptor calling convention.
+typed_arrays_dataview_test: Crash # cannot compile methods that need interceptor calling convention.
+typed_arrays_range_checks_test: Crash # cannot compile methods that need interceptor calling convention.
+typed_arrays_simd_test: Crash # cannot compile methods that need interceptor calling convention.
+typing_test: Crash # cannot compile methods that need interceptor calling convention.
+unknownelement_test: Crash # cannot compile methods that need interceptor calling convention.
+uri_test: Crash # cannot compile methods that need interceptor calling convention.
+url_test: Crash # try/finally
+webgl_1_test: Crash # try/finally
+websocket_test: Crash # try/finally
+websql_test: Crash # try/finally
+wheelevent_test: Crash # cannot compile methods that need interceptor calling convention.
+window_eq_test: Crash # cannot compile methods that need interceptor calling convention.
+window_mangling_test: Crash # cannot compile methods that need interceptor calling convention.
+window_nosuchmethod_test: Crash # cannot compile methods that need interceptor calling convention.
+window_test: Crash # cannot compile methods that need interceptor calling convention.
+worker_api_test: Crash # cannot compile methods that need interceptor calling convention.
+worker_test: Crash # try/finally
+xhr_cross_origin_test: Crash # try/finally
+xhr_test: Crash # try/finally
+xsltprocessor_test: Crash # try/finally
diff --git a/tests/html/node_validator_test.dart b/tests/html/node_validator_important_if_you_suppress_make_the_bug_critical_test.dart
similarity index 97%
rename from tests/html/node_validator_test.dart
rename to tests/html/node_validator_important_if_you_suppress_make_the_bug_critical_test.dart
index 46b2beb..cb0196d 100644
--- a/tests/html/node_validator_test.dart
+++ b/tests/html/node_validator_important_if_you_suppress_make_the_bug_critical_test.dart
@@ -2,7 +2,11 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-library validator_test;
+/// This tests HTML validation and sanitization, which is very important
+/// for prevent XSS or other attacks. If you suppress this, or parts of it
+/// please make it a critical bug and bring it to the attention of the
+/// dart:html maintainers.
+library node_validator_test;
import 'dart:html';
import 'dart:svg' as svg;
diff --git a/tests/html/svgelement_test.dart b/tests/html/svgelement_test.dart
index dcfeb4c..2b573ca 100644
--- a/tests/html/svgelement_test.dart
+++ b/tests/html/svgelement_test.dart
@@ -29,11 +29,13 @@
};
testConstructor(String tagName, Function isExpectedClass,
- [bool expectation = true]) {
+ [bool expectation = true, allowsInnerHtml = true]) {
test(tagName, () {
expect(isExpectedClass(new svg.SvgElement.tag(tagName)), expectation);
- expect(isExpectedClass(
- new svg.SvgElement.svg('<$tagName></$tagName>')), expectation);
+ if (allowsInnerHtml) {
+ expect(isExpectedClass(new svg.SvgElement.svg('<$tagName></$tagName>')),
+ expectation && allowsInnerHtml);
+ }
});
}
group('additionalConstructors', () {
@@ -243,7 +245,6 @@
});
group('constructors', () {
- group('supported', () {
testConstructor('a', (e) => e is svg.AElement);
testConstructor('circle', (e) => e is svg.CircleElement);
testConstructor('clipPath', (e) => e is svg.ClipPathElement);
@@ -275,8 +276,9 @@
testConstructor('title', (e) => e is svg.TitleElement);
testConstructor('use', (e) => e is svg.UseElement);
testConstructor('view', (e) => e is svg.ViewElement);
+ // TODO(alanknight): Issue 23144
testConstructor('altGlyph', (e) => e is svg.AltGlyphElement,
- svg.AltGlyphElement.supported);
+ svg.AltGlyphElement.supported, false);
testConstructor('animate', (e) => e is svg.AnimateElement,
svg.AnimateElement.supported);
testConstructor('animateMotion', (e) => e is svg.AnimateMotionElement,
@@ -335,11 +337,10 @@
testConstructor('filter', (e) => e is svg.FilterElement,
svg.FilterElement.supported);
testConstructor('foreignObject', (e) => e is svg.ForeignObjectElement,
- svg.ForeignObjectElement.supported);
+ svg.ForeignObjectElement.supported, false);
testConstructor('metadata', (e) => e is svg.MetadataElement);
testConstructor('set', (e) => e is svg.SetElement,
svg.SetElement.supported);
- });
});
group('outerHtml', () {
diff --git a/tests/isolate/isolate.status b/tests/isolate/isolate.status
index bfacb76..02e3fa6 100644
--- a/tests/isolate/isolate.status
+++ b/tests/isolate/isolate.status
@@ -121,3 +121,60 @@
[ $compiler != none || $runtime != vm ]
package_root_test: SkipByDesign # Uses dart:io.
+
+[ $compiler == dart2js && $cps_ir ]
+capability_test: Crash # (throw _buildException('asyncEnd() was called before asyncStart().')): Unhandled node
+compile_time_error_test/01: Crash # handleStaticFunctionGet: function(entry)
+compile_time_error_test/none: Crash # handleStaticFunctionGet: function(entry)
+count_test: Crash # cannot compile methods that need interceptor calling convention.
+cross_isolate_message_test: Crash # cannot compile methods that need interceptor calling convention.
+function_send_test: Crash # (throw _buildException('asyncEnd() was called before asyncStart().')): Unhandled node
+handle_error2_test: Crash # Unhandled node
+handle_error3_test: Crash # Unhandled node
+handle_error_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+illegal_msg_function_test: Crash # cannot compile methods that need interceptor calling convention.
+illegal_msg_mirror_test: Crash # cannot compile methods that need interceptor calling convention.
+isolate_complex_messages_test: Crash # cannot compile methods that need interceptor calling convention.
+isolate_current_test: Crash # (throw _buildException('asyncEnd() was called before asyncStart().')): Unhandled node
+isolate_import_test/01: Crash # (Isolate): Error expression `Isolate` unhandled.
+isolate_import_test/none: Crash # handleStaticFunctionGet: function(entry)
+isolate_stress_test: Crash # handleStaticFunctionGet: function(worker)
+issue_22778_test: Crash # (throw new ExpectException(message)): Unhandled node
+kill2_test: Crash # (throw _buildException('asyncEnd() was called before asyncStart().')): Unhandled node
+kill_self_test: Crash # handleStaticFunctionGet: function(isomain1)
+kill_test: Crash # (throw _buildException('asyncEnd() was called before asyncStart().')): Unhandled node
+mandel_isolate_test: Crash # cannot compile methods that need interceptor calling convention.
+message2_test: Crash # cannot compile methods that need interceptor calling convention.
+message3_test/byteBuffer: Crash # (throw _buildException('asyncEnd() was called before asyncStart().')): Unhandled node
+message3_test/constInstance: Crash # (throw _buildException('asyncEnd() was called before asyncStart().')): Unhandled node
+message3_test/constList: Crash # (throw _buildException('asyncEnd() was called before asyncStart().')): Unhandled node
+message3_test/constList_identical: Crash # (throw _buildException('asyncEnd() was called before asyncStart().')): Unhandled node
+message3_test/constMap: Crash # (throw _buildException('asyncEnd() was called before asyncStart().')): Unhandled node
+message3_test/fun: Crash # (throw _buildException('asyncEnd() was called before asyncStart().')): Unhandled node
+message3_test/int32x4: Crash # (throw _buildException('asyncEnd() was called before asyncStart().')): Unhandled node
+message3_test/none: Crash # (throw _buildException('asyncEnd() was called before asyncStart().')): Unhandled node
+message_enum_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+message_test: Crash # cannot compile methods that need interceptor calling convention.
+mint_maker_test: Crash # cannot compile methods that need interceptor calling convention.
+nested_spawn2_test: Crash # cannot compile methods that need interceptor calling convention.
+nested_spawn_test: Crash # cannot compile methods that need interceptor calling convention.
+object_leak_test: Crash # (throw _buildException('asyncEnd() was called before asyncStart().')): Unhandled node
+ondone_test: Crash # handleStaticFunctionGet: function(isomain)
+pause_test: Crash # handleStaticFunctionGet: function(isomain1)
+ping_pause_test: Crash # (throw new ExpectException(message)): Unhandled node
+ping_test: Crash # (throw _buildException('asyncEnd() was called before asyncStart().')): Unhandled node
+port_test: Crash # (throw new ExpectException(message)): Unhandled node
+raw_port_test: Crash # cannot compile methods that need interceptor calling convention.
+request_reply_test: Crash # cannot compile methods that need interceptor calling convention.
+simple_message_test/01: Crash # (throw _buildException('asyncEnd() was called before asyncStart().')): Unhandled node
+simple_message_test/none: Crash # (throw _buildException('asyncEnd() was called before asyncStart().')): Unhandled node
+spawn_function_custom_class_test: Crash # cannot compile methods that need interceptor calling convention.
+spawn_function_test: Crash # cannot compile methods that need interceptor calling convention.
+spawn_uri_missing_from_isolate_test: Crash # handleStaticFunctionGet: function(isolate)
+spawn_uri_missing_test: Crash # handleStaticFunctionGet: function(doTest)
+spawn_uri_multi_test/01: Crash # cannot compile methods that need interceptor calling convention.
+spawn_uri_multi_test/none: Crash # cannot compile methods that need interceptor calling convention.
+stacktrace_message_test: Crash # cannot compile methods that need interceptor calling convention.
+start_paused_test: Crash # (throw _buildException('asyncEnd() was called before asyncStart().')): Unhandled node
+static_function_test: Crash # cannot compile methods that need interceptor calling convention.
+unresolved_ports_test: Crash # cannot compile methods that need interceptor calling convention.
diff --git a/tests/isolate/kill2_test.dart b/tests/isolate/kill2_test.dart
index 911cd69..4fb3171 100644
--- a/tests/isolate/kill2_test.dart
+++ b/tests/isolate/kill2_test.dart
@@ -26,7 +26,7 @@
reply.handler = (v) {
result.add(v);
if (v == 2) {
- isolate.kill(Isolate.BEFORE_NEXT_EVENT);
+ isolate.kill(priority: Isolate.BEFORE_NEXT_EVENT);
}
echoPort.send(v - 1);
};
diff --git a/tests/isolate/kill3_test.dart b/tests/isolate/kill3_test.dart
deleted file mode 100644
index 006f7ae..0000000
--- a/tests/isolate/kill3_test.dart
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-import "dart:isolate";
-import "dart:async";
-import "package:expect/expect.dart";
-import "package:async_helper/async_helper.dart";
-
-isomain1(replyPort) {
- RawReceivePort port = new RawReceivePort();
- port.handler = (v) {
- replyPort.send(v);
- if (v == 0) port.close();
- };
- replyPort.send(port.sendPort);
-}
-
-void main() {
- asyncStart();
- var completer = new Completer(); // Completed by first reply from isolate.
- RawReceivePort reply = new RawReceivePort(completer.complete);
- Isolate.spawn(isomain1, reply.sendPort).then((Isolate isolate) {
- List result = [];
- completer.future.then((echoPort) {
- reply.handler = (v) {
- result.add(v);
- echoPort.send(v - 1);
- if (v == 2) {
- isolate.kill(Isolate.AS_EVENT);
- }
- };
- RawReceivePort exitSignal;
- exitSignal = new RawReceivePort((_) {
- Expect.listEquals([4, 3, 2, 1], result);
- exitSignal.close();
- reply.close();
- asyncEnd();
- });
- isolate.addOnExitListener(exitSignal.sendPort);
- echoPort.send(4);
- });
- });
-}
diff --git a/tests/isolate/kill_self_test.dart b/tests/isolate/kill_self_test.dart
index 932dca6..cf2a81d 100644
--- a/tests/isolate/kill_self_test.dart
+++ b/tests/isolate/kill_self_test.dart
@@ -19,7 +19,7 @@
firstEvent = false;
var isolate = new Isolate(controlPort,
terminateCapability: killCapability);
- isolate.kill(Isolate.IMMEDIATE);
+ isolate.kill(priority: Isolate.IMMEDIATE);
};
replyPort.send(port.sendPort);
}
diff --git a/tests/isolate/kill_test.dart b/tests/isolate/kill_test.dart
index d0da5ab..0a0ba85 100644
--- a/tests/isolate/kill_test.dart
+++ b/tests/isolate/kill_test.dart
@@ -26,7 +26,7 @@
reply.handler = (v) {
result.add(v);
if (v == 2) {
- isolate.kill(Isolate.IMMEDIATE);
+ isolate.kill(priority: Isolate.IMMEDIATE);
}
echoPort.send(v - 1);
};
diff --git a/tests/isolate/ondone_test.dart b/tests/isolate/ondone_test.dart
index af990ad..ec0007c 100644
--- a/tests/isolate/ondone_test.dart
+++ b/tests/isolate/ondone_test.dart
@@ -23,6 +23,7 @@
void main() {
testExit();
testCancelExit();
+ testOverrideResponse();
}
void testExit() {
@@ -31,14 +32,15 @@
var completer = new Completer(); // Completed by first reply from isolate.
RawReceivePort reply = new RawReceivePort(completer.complete);
RawReceivePort onExitPort;
- onExitPort = new RawReceivePort((_) {
+ onExitPort = new RawReceivePort((v) {
+ if (v != "RESPONSE") throw "WRONG RESPONSE: $v";
reply.close();
onExitPort.close();
if (!mayComplete) throw "COMPLETED EARLY";
asyncEnd();
});
Isolate.spawn(isomain, reply.sendPort).then((Isolate isolate) {
- isolate.addOnExitListener(onExitPort.sendPort);
+ isolate.addOnExitListener(onExitPort.sendPort, response: "RESPONSE");
return completer.future;
}).then((echoPort) {
int counter = 4;
@@ -92,3 +94,33 @@
});
});
}
+
+void testOverrideResponse() {
+ bool mayComplete = false;
+ asyncStart();
+ var completer = new Completer(); // Completed by first reply from isolate.
+ RawReceivePort reply = new RawReceivePort(completer.complete);
+ RawReceivePort onExitPort;
+ onExitPort = new RawReceivePort((v) {
+ if (v != "RESPONSE2") throw "WRONG RESPONSE: $v";
+ reply.close();
+ onExitPort.close();
+ if (!mayComplete) throw "COMPLETED EARLY";
+ asyncEnd();
+ });
+ Isolate.spawn(isomain, reply.sendPort).then((Isolate isolate) {
+ isolate.addOnExitListener(onExitPort.sendPort, response: "RESPONSE");
+ isolate.addOnExitListener(onExitPort.sendPort, response: "RESPONSE2");
+ return completer.future;
+ }).then((echoPort) {
+ int counter = 4;
+ reply.handler = (v) {
+ if (v != counter) throw "WRONG REPLY";
+ if (v == 0) throw "REPLY INSTEAD OF SHUTDOWN";
+ counter--;
+ mayComplete = (counter == 0);
+ echoPort.send(counter);
+ };
+ echoPort.send(counter);
+ });
+}
diff --git a/tests/isolate/ping_pause_test.dart b/tests/isolate/ping_pause_test.dart
index ec47f7a..1515e98 100644
--- a/tests/isolate/ping_pause_test.dart
+++ b/tests/isolate/ping_pause_test.dart
@@ -41,7 +41,7 @@
isolate.resume(resume);
pingPort.close();
};
- isolate.ping(pingPort.sendPort, Isolate.BEFORE_NEXT_EVENT);
+ isolate.ping(pingPort.sendPort, priority: Isolate.BEFORE_NEXT_EVENT);
echoPort.send(2);
echoPort.send(1);
});
diff --git a/tests/isolate/ping_test.dart b/tests/isolate/ping_test.dart
index 48b1ec5..ee72612 100644
--- a/tests/isolate/ping_test.dart
+++ b/tests/isolate/ping_test.dart
@@ -26,37 +26,34 @@
reply.handler = (v) {
result.add(v);
if (v == 0) {
- Expect.listEquals(["alive", "control", "event"],
+ Expect.listEquals(["alive", "control"],
result.where((x) => x is String).toList(),
"control events");
- Expect.listEquals([4, 3, 2, 1, 0],
+ Expect.listEquals([3, 2, 1, 0],
result.where((x) => x is int).toList(),
"data events");
- Expect.isTrue(result.indexOf("alive") < result.indexOf(3),
- "alive index < 3");
- Expect.isTrue(result.indexOf("control") < result.indexOf(2),
- "control index < 2");
- int eventIndex = result.indexOf("event");
- Expect.isTrue(eventIndex > result.indexOf(2), "event index > 2");
- Expect.isTrue(eventIndex < result.indexOf(1), "event index < 1");
+ Expect.isTrue(result.indexOf("alive") < result.indexOf(2),
+ "alive index < 2");
+ Expect.isTrue(result.indexOf("control") < result.indexOf(1),
+ "control index < 1");
reply.close();
asyncEnd();
}
};
- SendPort createPingPort(message) {
- var pingPort = new RawReceivePort();
- pingPort.handler = (_) {
- result.add(message);
- pingPort.close();
- };
- return pingPort.sendPort;
+ var pingPort = new RawReceivePort();
+ int pingCount = 0;
+ pingPort.handler = (response) {
+ result.add(response);
+ pingCount++;
+ if (pingCount == 2) pingPort.close();
+ };
+ ping(message, priority) {
+ isolate.ping(pingPort.sendPort, response: message, priority: priority);
}
- echoPort.send(4);
- isolate.ping(createPingPort("alive"), Isolate.IMMEDIATE);
echoPort.send(3);
- isolate.ping(createPingPort("control"), Isolate.BEFORE_NEXT_EVENT);
+ ping("alive", Isolate.IMMEDIATE);
echoPort.send(2);
- isolate.ping(createPingPort("event"), Isolate.AS_EVENT);
+ ping("control", Isolate.BEFORE_NEXT_EVENT);
echoPort.send(1);
echoPort.send(0);
});
diff --git a/tests/language/compile_time_constant_checked5_test.dart b/tests/language/compile_time_constant_checked5_test.dart
new file mode 100644
index 0000000..d2a4aa3
--- /dev/null
+++ b/tests/language/compile_time_constant_checked5_test.dart
@@ -0,0 +1,79 @@
+// Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+class A {
+ const A();
+}
+
+class B extends A {
+ const B();
+}
+
+class C extends A {
+ const C();
+ const factory C.d() = D;
+}
+
+class D extends B implements C {
+ const D();
+}
+
+class Test1 {
+ final A x = const A(); /// 01: ok
+ final A x = const B(); /// 02: ok
+ final B x = const A(); /// 03: checked mode compile-time error
+ final B x = const C(); /// 04: checked mode compile-time error, static type warning
+ final B x = const C.d(); /// 05: static type warning
+ const Test1();
+}
+
+// Will be instantiated with U=A and V=B.
+class Test2<U, V> {
+ final U x = const A(); /// 06: static type warning
+ final U x = const B(); /// 07: static type warning
+ final V x = const A(); /// 08: checked mode compile-time error, static type warning
+ final V x = const C(); /// 09: checked mode compile-time error, static type warning
+ final V x = const C.d(); /// 10: static type warning
+ const Test2();
+}
+
+// Will be instantiated with U=A and V=B.
+class Test3<U extends A, V extends B> {
+ final U x = const A(); /// 11: ok
+ final U x = const B(); /// 12: static type warning
+ final V x = const A(); /// 13: checked mode compile-time error
+ final V x = const C(); /// 14: checked mode compile-time error, static type warning
+ final V x = const C.d(); /// 15: static type warning
+ const Test3();
+}
+
+// Will be instantiated with U=A and V=B.
+class Test4<U extends A, V extends A> {
+ final U x = const A(); /// 16: ok
+ final U x = const B(); /// 17: static type warning
+ final V x = const A(); /// 18: checked mode compile-time error
+ final V x = const C(); /// 19: checked mode compile-time error, static type warning
+ final V x = const C.d(); /// 20: static type warning
+ const Test4();
+}
+
+// Will be instantiated with U=dynamic and V=dynamic.
+class Test5<U extends A, V extends B> {
+ final U x = const A(); /// 21: ok
+ final U x = const B(); /// 22: static type warning
+ final V x = const A(); /// 23: ok
+ final V x = const C(); /// 24: static type warning
+ final V x = const C.d(); /// 25: static type warning
+ const Test5();
+}
+
+use(x) => x;
+
+main() {
+ use(const Test1());
+ use(const Test2<A, B>());
+ use(const Test3<A, B>());
+ use(const Test4<A, B>());
+ use(const Test5());
+}
diff --git a/tests/language/const_redirecting_factory_test.dart b/tests/language/const_redirecting_factory_test.dart
new file mode 100644
index 0000000..870a220
--- /dev/null
+++ b/tests/language/const_redirecting_factory_test.dart
@@ -0,0 +1,58 @@
+// Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+import 'package:expect/expect.dart';
+
+class K implements L {
+ final field1;
+ final field2;
+ const K({this.field1: 42, this.field2: true});
+}
+
+class L {
+ const factory L() = K;
+ const factory L.named1({field1, field2}) = K;
+ const factory L.named2({field2, field1}) = K;
+}
+
+const l1 = const L();
+
+const l2a = const L.named1();
+const l2b = const L.named1(field1: 87);
+const l2c = const L.named1(field2: false);
+const l2d = const L.named1(field1: 87, field2: false);
+const l2e = const L.named1(field2: false, field1: 87);
+
+const l3a = const L.named2();
+const l3b = const L.named2(field1: 87);
+const l3c = const L.named2(field2: false);
+const l3d = const L.named2(field1: 87, field2: false);
+const l3e = const L.named2(field2: false, field1: 87);
+
+main() {
+ Expect.equals(42, l1.field1);
+ Expect.equals(true, l1.field2);
+
+ Expect.equals(42, l2a.field1);
+ Expect.equals(true, l2a.field2);
+ Expect.equals(87, l2b.field1);
+ Expect.equals(true, l2b.field2);
+ Expect.equals(42, l2c.field1);
+ Expect.equals(false, l2c.field2);
+ Expect.equals(87, l2d.field1);
+ Expect.equals(false, l2d.field2);
+ Expect.equals(87, l2e.field1);
+ Expect.equals(false, l2e.field2);
+
+ Expect.equals(42, l3a.field1);
+ Expect.equals(true, l3a.field2);
+ Expect.equals(87, l3b.field1);
+ Expect.equals(true, l3b.field2);
+ Expect.equals(42, l3c.field1);
+ Expect.equals(false, l3c.field2);
+ Expect.equals(87, l3d.field1);
+ Expect.equals(false, l3d.field2);
+ Expect.equals(87, l3e.field1);
+ Expect.equals(false, l3e.field2);
+}
\ No newline at end of file
diff --git a/tests/language/custom_await_stack_trace_test.dart b/tests/language/custom_await_stack_trace_test.dart
index cff9181..dfcb429 100644
--- a/tests/language/custom_await_stack_trace_test.dart
+++ b/tests/language/custom_await_stack_trace_test.dart
@@ -1,13 +1,13 @@
import "dart:async";
import "package:expect/expect.dart";
-class Blah extends StackTrace {
+class Blah implements StackTrace {
Blah(this._trace);
-
+
toString() {
return "Blah " + _trace.toString();
}
-
+
var _trace;
}
diff --git a/tests/language/deferred_function_type_lib.dart b/tests/language/deferred_function_type_lib.dart
new file mode 100644
index 0000000..1f0e610
--- /dev/null
+++ b/tests/language/deferred_function_type_lib.dart
@@ -0,0 +1,20 @@
+// Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+import 'package:expect/expect.dart';
+
+class T {
+ A foo(int x) {}
+}
+
+class A{}
+
+typedef A F(int x);
+
+use(x) => x;
+
+runTest() {
+ use(new A());
+ Expect.isTrue(new T().foo is F);
+}
diff --git a/tests/language/deferred_function_type_test.dart b/tests/language/deferred_function_type_test.dart
new file mode 100644
index 0000000..59897c7
--- /dev/null
+++ b/tests/language/deferred_function_type_test.dart
@@ -0,0 +1,11 @@
+// Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+import 'deferred_function_type_lib.dart' deferred as lib;
+
+main() {
+ lib.loadLibrary().then((_) {
+ lib.runTest();
+ });
+}
\ No newline at end of file
diff --git a/tests/language/deferred_regression_22995_lib.dart b/tests/language/deferred_regression_22995_lib.dart
new file mode 100644
index 0000000..d4efaf6
--- /dev/null
+++ b/tests/language/deferred_regression_22995_lib.dart
@@ -0,0 +1,11 @@
+// Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+import 'deferred_regression_22995_test.dart';
+
+foofoo() {
+ new A();
+ new B();
+ new C();
+}
diff --git a/tests/language/deferred_regression_22995_test.dart b/tests/language/deferred_regression_22995_test.dart
new file mode 100644
index 0000000..054b507
--- /dev/null
+++ b/tests/language/deferred_regression_22995_test.dart
@@ -0,0 +1,34 @@
+// Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+// Test that closurizing a function implies a dependency on its type.
+
+import "package:expect/expect.dart";
+
+import 'deferred_regression_22995_lib.dart' deferred as lib;
+
+class A {}
+class B {}
+class C {}
+
+typedef Ti(int x);
+typedef TB(B x);
+typedef TTi(Ti x);
+typedef Tg<T>(T x);
+
+class T {
+ fA(A a) => null;
+ fTB(TB a) => null;
+ fTgC(Tg<C> a) => null;
+}
+
+main() {
+ Expect.isFalse(new T().fA is Ti);
+ Expect.isFalse(new T().fTB is TTi);
+ Expect.isFalse(new T().fTgC is TTi);
+ lib.loadLibrary().then((_) {
+ lib.foofoo();
+ });
+}
+
diff --git a/tests/language/getter_setter_in_lib.dart b/tests/language/getter_setter_in_lib.dart
index 0234f6e..9761ab2 100644
--- a/tests/language/getter_setter_in_lib.dart
+++ b/tests/language/getter_setter_in_lib.dart
@@ -6,3 +6,5 @@
get foo => 42;
set foo(a) {}
+
+get bar => 77;
diff --git a/tests/language/getter_setter_in_lib2.dart b/tests/language/getter_setter_in_lib2.dart
new file mode 100644
index 0000000..addfb65
--- /dev/null
+++ b/tests/language/getter_setter_in_lib2.dart
@@ -0,0 +1,7 @@
+// Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+library GetterSetterInLib2;
+
+set bar(a) { }
diff --git a/tests/language/getter_setter_in_lib3.dart b/tests/language/getter_setter_in_lib3.dart
new file mode 100644
index 0000000..343edfc
--- /dev/null
+++ b/tests/language/getter_setter_in_lib3.dart
@@ -0,0 +1,11 @@
+// Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+library GetterSetterInLib3;
+
+var _f = 33;
+
+set bar(a) { _f = a; }
+
+get bar => _f;
diff --git a/tests/language/getter_setter_in_lib_test.dart b/tests/language/getter_setter_in_lib_test.dart
index deba2ba..2195a29 100644
--- a/tests/language/getter_setter_in_lib_test.dart
+++ b/tests/language/getter_setter_in_lib_test.dart
@@ -5,9 +5,19 @@
library GetterSetterInLibTest;
import "package:expect/expect.dart";
import 'getter_setter_in_lib.dart';
+import 'getter_setter_in_lib2.dart';
+import 'getter_setter_in_lib3.dart' as L3;
main() {
Expect.equals(42, foo);
foo = 43;
Expect.equals(42, foo);
+
+ Expect.equals(77, bar);
+ bar = 43;
+ Expect.equals(77, bar);
+
+ Expect.equals(L3.bar, 33);
+ L3.bar = 44;
+ Expect.equals(L3.bar, 44);
}
diff --git a/tests/language/instance_creation_in_function_annotation_test.dart b/tests/language/instance_creation_in_function_annotation_test.dart
new file mode 100644
index 0000000..804cb97
--- /dev/null
+++ b/tests/language/instance_creation_in_function_annotation_test.dart
@@ -0,0 +1,29 @@
+// Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+// Verify that instance creation expressions inside function
+// annotations are properly handled. See dartbug.com/23354
+
+import 'dart:mirrors';
+import 'package:expect/expect.dart';
+
+class C {
+ final String s;
+ const C(this.s);
+}
+
+class D {
+ final C c;
+ const D(this.c);
+}
+
+@D(const C('foo'))
+f() {}
+
+main() {
+ ClosureMirror closureMirror = reflect(f);
+ List<InstanceMirror> metadata = closureMirror.function.metadata;
+ Expect.equals(1, metadata.length);
+ Expect.equals(metadata[0].reflectee.c.s, 'foo');
+}
diff --git a/tests/language/language.status b/tests/language/language.status
index f49e43c9..1b36eea 100644
--- a/tests/language/language.status
+++ b/tests/language/language.status
@@ -38,13 +38,16 @@
deferred_closurize_load_library_test: Fail # Issue 17523
deferred_inlined_test: Fail # Issue 17523
deferred_optimized_test: Fail # Issue 17523
-multiline_strings_test: Fail # Issue (pending)
regress_22443_test: Fail # Issue 17523
enum_mirror_test: Skip # Issue 11511.
+getter_setter_in_lib_test: Fail # Issue 23288
override_inheritance_mixed_test/08: Fail # Issue 18124
override_inheritance_mixed_test/09: Fail # Issue 18124
+[ $compiler == dart2dart ]
+multiline_strings_test: Fail # Issue (pending)
+
[ $compiler == none || $compiler == dart2dart ]
# Non-contractive types are not supported in the vm.
cyclic_type_test/02: Fail, OK
@@ -59,6 +62,7 @@
[ $compiler == none && $runtime == vm ]
class_keyword_test/02: MissingCompileTimeError # Issue 13627
unicode_bom_test: Fail # Issue 16067
+vm/debug_break_enabled_vm_test/01: Crash, OK # Expected to hit breakpoint.
[ $compiler == none && $checked ]
type_variable_bounds4_test/01: Fail # Issue 14006
@@ -72,20 +76,17 @@
export_ambiguous_main_negative_test: Fail # Issue 14763
[ $compiler == none && ($runtime == dartium || $runtime == ContentShellOnAndroid) && $unchecked ]
-assertion_test: Fail # Issue 13719: Please triage this failure.
-generic_test: Fail # Issue 13719: Please triage this failure.
-list_literal4_test: Fail # Issue 13719: Please triage this failure.
-map_literal4_test: Fail # Issue 13719: Please triage this failure.
-named_parameters_type_test/01: Fail # Issue 13719: Please triage this failure.
-named_parameters_type_test/02: Fail # Issue 13719: Please triage this failure.
-named_parameters_type_test/03: Fail # Issue 13719: Please triage this failure.
-positional_parameters_type_test/01: Fail # Issue 13719: Please triage this failure.
-positional_parameters_type_test/02: Fail # Issue 13719: Please triage this failure.
-type_checks_in_factory_method_test: Fail # Issue 13719: Please triage this failure.
-vm/type_vm_test: Fail # Issue 13719: Please triage this failure.
-
-[ $compiler == none && $runtime == dartium ]
-first_class_types_literals_test: Pass, Fail # Issue 13719: Please triage this failure.
+assertion_test: Fail # Issue 14651.
+generic_test: Fail # Issue 14651.
+list_literal4_test: Fail # Issue 14651.
+map_literal4_test: Fail # Issue 14651.
+named_parameters_type_test/01: Fail # Issue 14651.
+named_parameters_type_test/02: Fail # Issue 14651.
+named_parameters_type_test/03: Fail # Issue 14651.
+positional_parameters_type_test/01: Fail # Issue 14651.
+positional_parameters_type_test/02: Fail # Issue 14651.
+type_checks_in_factory_method_test: Fail # Issue 14651.
+vm/type_vm_test: Fail # Issue 14651.
[ $compiler == none && ( $runtime == dartium || $runtime == drt || $runtime == ContentShellOnAndroid) ]
issue13474_test: Pass, Fail # Issue 14651.
@@ -98,6 +99,7 @@
main_test/21: Fail # Issue 20028
main_test/42: Fail # Issue 20028
mirror_in_static_init_test: Fail # Issue 22071
+vm/debug_break_enabled_vm_test/*: Skip # Issue 14651.
[ $compiler == none && $runtime == drt ]
disassemble_test: Pass, Fail # Issue 18122
@@ -116,6 +118,5 @@
[ $compiler == none && $runtime == ContentShellOnAndroid ]
gc_test: SkipSlow # Times out flakily. Issue 20956
-[ $compiler == none && $runtime == vm && ( $arch == simarm || $arch == arm || $arch == armv5te || $arch == simarm64 || $arch == arm64 || $arch == simmips || $arch == mips) ]
+[ $compiler == none && $runtime == vm && ( $arch == simarm || $arch == arm || $arch == simarmv5te || $arch == armv5te || $arch == simarm64 || $arch == arm64 || $arch == simmips || $arch == mips) ]
vm/load_to_load_unaligned_forwarding_vm_test: Pass, Crash # Unaligned offset. Issue 22151
-
diff --git a/tests/language/language_analyzer.status b/tests/language/language_analyzer.status
index 6b777de..5ced80a 100644
--- a/tests/language/language_analyzer.status
+++ b/tests/language/language_analyzer.status
@@ -13,6 +13,7 @@
async_await_test/02: CompileTimeError # Issue 22052
regress_17382_test: Skip # don't care about the static warning.
regress_23038_test/01: Skip # Issue 23038
+getter_setter_in_lib_test: Fail # issue 23286
issue13179_test: CompileTimeError # Issue 13179
@@ -476,6 +477,7 @@
unbound_getter_test: StaticWarning
unhandled_exception_negative_test: CompileTimeError
unresolved_top_level_method_negative_test: StaticWarning
+vm/debug_break_enabled_vm_test: CompileTimeError, OK
vm/type_cast_vm_test: StaticWarning
vm/type_vm_test: StaticWarning
void_type_test: StaticWarning
@@ -521,6 +523,18 @@
regress_21912_test/02: StaticWarning # Issue 21912
regress_22976_test/02: StaticWarning # Issue 22976
+variable_declaration_metadata_test/02: MissingCompileTimeError # Issue 23204
+variable_declaration_metadata_test/03: MissingCompileTimeError # Issue 23204
+variable_declaration_metadata_test/04: MissingCompileTimeError # Issue 23204
+variable_declaration_metadata_test/06: MissingCompileTimeError # Issue 23204
+variable_declaration_metadata_test/08: MissingCompileTimeError # Issue 23204
+variable_declaration_metadata_test/09: MissingCompileTimeError # Issue 23204
+variable_declaration_metadata_test/10: MissingCompileTimeError # Issue 23204
+variable_declaration_metadata_test/12: MissingCompileTimeError # Issue 23204
+variable_declaration_metadata_test/13: MissingCompileTimeError # Issue 23204
+variable_declaration_metadata_test/14: MissingCompileTimeError # Issue 23204
+variable_declaration_metadata_test/16: MissingCompileTimeError # Issue 23204
+
# Null-aware operators aren't implemented in the Java-based analyzer.
if_null_evaluation_order_test: CompileTimeError
if_null_precedence_test: CompileTimeError
@@ -531,6 +545,10 @@
conditional_property_access_test: CompileTimeError
conditional_method_invocation_test: CompileTimeError
+# This test is expected to generate a warning, since it's
+# intentionally referring to a variable that's not in scope.
+transitive_private_library_access_test: StaticWarning
+
# Issue 16391. These tests are supposed to produce a compile time
# error in checked mode, but they don't:
[ $compiler == dartanalyzer && $checked ]
@@ -561,3 +579,12 @@
malformed2_test/01: MissingCompileTimeError # Issue 16391
type_check_const_function_typedef2_test/00: MissingCompileTimeError # Issue 16391
type_parameter_test/05: MissingCompileTimeError # Issue 16391
+
+compile_time_constant_checked5_test/03: MissingCompileTimeError # Issue 23292
+compile_time_constant_checked5_test/04: MissingCompileTimeError # Issue 23292
+compile_time_constant_checked5_test/08: MissingCompileTimeError # Issue 23292
+compile_time_constant_checked5_test/09: MissingCompileTimeError # Issue 23292
+compile_time_constant_checked5_test/13: MissingCompileTimeError # Issue 23292
+compile_time_constant_checked5_test/14: MissingCompileTimeError # Issue 23292
+compile_time_constant_checked5_test/18: MissingCompileTimeError # Issue 23292
+compile_time_constant_checked5_test/19: MissingCompileTimeError # Issue 23292
diff --git a/tests/language/language_analyzer2.status b/tests/language/language_analyzer2.status
index 8baf949..a49eff2 100644
--- a/tests/language/language_analyzer2.status
+++ b/tests/language/language_analyzer2.status
@@ -14,6 +14,7 @@
enum_syntax_test/06: Fail # 21649
regress_17382_test: Skip # don't care about the static warning.
+getter_setter_in_lib_test: Fail # issue 23286
# Test issue 12694 (was analyzer issue), (1) when "abstract" is import prefix using it as type is warning; (2) currently analyzer resolves prefix as field (don't ask)
built_in_identifier_prefix_test: CompileTimeError # Issue 12694
@@ -422,6 +423,8 @@
unbound_getter_test: StaticWarning
unhandled_exception_negative_test: CompileTimeError
unresolved_top_level_method_negative_test: StaticWarning
+vm/debug_break_vm_test/*: Skip
+vm/debug_break_enabled_vm_test: Skip
vm/type_cast_vm_test: StaticWarning
vm/type_vm_test: StaticWarning
void_type_test: StaticWarning
@@ -459,3 +462,7 @@
main_not_a_function_test/01: Fail # Issue 20030
main_test/03: Fail # Issue 20030
no_main_test/01: Fail # Issue 20030
+
+# This test is expected to generate a warning, since it's
+# intentionally referring to a variable that's not in scope.
+transitive_private_library_access_test: StaticWarning
diff --git a/tests/language/language_dart2js.status b/tests/language/language_dart2js.status
index 1be445a..be1c3a2 100644
--- a/tests/language/language_dart2js.status
+++ b/tests/language/language_dart2js.status
@@ -6,6 +6,7 @@
sync_generator2_test/07: MissingCompileTimeError # Issue 22324
sync_generator2_test/08: MissingCompileTimeError # Issue 22324
sync_generator2_test/10: MissingCompileTimeError # Issue 22324
+getter_setter_in_lib_test: Fail # Issue 23288
async_star_test/02: RuntimeError # 22853
async_star_test/05: RuntimeError, Timeout
@@ -13,15 +14,11 @@
try_catch_on_syntax_test/10: Fail # Issue 19823
try_catch_on_syntax_test/11: Fail # Issue 19823
-deferred_load_constants_test/none: CompileTimeError # issue 22893
-
[ $compiler == dart2js && $runtime == jsshell ]
await_for_test: Skip # Jsshell does not provide periodic timers, Issue 7728
async_star_test: RuntimeError # Jsshell does not provide non-zero timers, Issue 7728
[ $compiler == dart2js || $compiler == dart2dart ]
-regress_22700_test: CompileTimeError # Issue 22700
-reify_typevar_static_test/01: CompileTimeError # Issue 22700
symbol_literal_test/*: Fail # Issue 21825
constructor_duplicate_final_test/01: Fail # Issue 13363
constructor_duplicate_final_test/02: Fail # Issue 13363
@@ -96,6 +93,22 @@
malbounded_type_test2_test: Fail # Issue 14121
default_factory2_test/01: Fail # Issue 14121
+[ ($compiler == dart2js || $compiler == dart2dart) && $checked ]
+compile_time_constant_checked5_test/06: Fail # Issue 23182
+compile_time_constant_checked5_test/07: Fail # Issue 23182
+compile_time_constant_checked5_test/10: Fail # Issue 23182
+compile_time_constant_checked5_test/11: Fail # Issue 23182
+compile_time_constant_checked5_test/12: Fail # Issue 23182
+compile_time_constant_checked5_test/15: Fail # Issue 23182
+compile_time_constant_checked5_test/16: Fail # Issue 23182
+compile_time_constant_checked5_test/17: Fail # Issue 23182
+compile_time_constant_checked5_test/20: Fail # Issue 23182
+compile_time_constant_checked5_test/21: Fail # Issue 23182
+compile_time_constant_checked5_test/22: Fail # Issue 23182
+compile_time_constant_checked5_test/23: Fail # Issue 23182
+compile_time_constant_checked5_test/24: Fail # Issue 23182
+compile_time_constant_checked5_test/25: Fail # Issue 23182
+
[ $compiler == dart2js && $unchecked ]
type_checks_in_factory_method_test: RuntimeError # Issue 12746
assertion_test: RuntimeError # Issue 12748
@@ -109,11 +122,13 @@
issue13474_test: RuntimeError, OK
generic_field_mixin3_test: Crash # Issue 18651
+[ $compiler == dart2js && $unchecked && $minified ]
+f_bounded_quantification5_test: Fail, OK # Issue 12605
+
[ $compiler == dart2js && $minified ]
cyclic_type_test/0*: Fail # Issue 12605
cyclic_type2_test: Fail # Issue 12605
-f_bounded_quantification4_test: Fail # Issue 12605
-f_bounded_quantification5_test: Fail # Issue 12605
+f_bounded_quantification4_test: Fail, OK # Issue 12605
mixin_generic_test: Fail # Issue 12605
mixin_mixin2_test: Fail # Issue 12605
mixin_mixin3_test: Fail # Issue 12605
@@ -204,14 +219,8 @@
[ $compiler == dart2dart && $builder_tag == new_backend ]
regress_13494_test: Pass # Issue 22370, passes for the wrong reason
-await_for_cancel_test: RuntimeError # Issue 23015
-regress_22936_test/01: RuntimeError # Issue 23015
-async_star_cancel_and_throw_in_finally_test: RuntimeError # Issue 23015
-[ $compiler == dart2dart && $builder_tag == new_backend && $host_checked ]
-large_implicit_getter_test: Crash # Stack overflow
-
-[ $compiler == dart2dart && ($minified == true || $builder_tag == new_backend) ]
+[ $compiler == dart2dart && $minified == true ]
type_variable_conflict2_test/01: RuntimeError # Issue 16180
[ $compiler == dart2dart ]
@@ -273,6 +282,8 @@
function_subtype_call1_test: RuntimeError # Issue 21673
function_subtype_call2_test: RuntimeError # Issue 21673
+instance_creation_in_function_annotation_test: Fail # Issue 23363
+
[ $compiler == dart2dart && $minified ]
cyclic_type_test/0*: Fail # Issue 12605.
cyclic_type2_test: Fail # Issue 12605.
@@ -295,3 +306,1874 @@
*deferred*: Pass,RuntimeError # Issue 17458
cha_deopt*: Pass,RuntimeError # Issue 17458
regress_22443_test: Pass,RuntimeError # Issue 17458
+
+[ $compiler == dart2js && $cps_ir ]
+aborting_switch_case_test: Crash # (switch (42){case 42:foo();foo();break;}): Unhandled node
+abstract_exact_selector_test/01: Crash # (throw new ExpectException(message)): Unhandled node
+abstract_exact_selector_test/none: Crash # (throw new ExpectException(message)): Unhandled node
+abstract_getter_test/01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+abstract_method_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+abstract_object_method_test: Crash # (throw new ExpectException(message)): Unhandled node
+abstract_runtime_error_test/01: Crash # (throw new ExpectException(message)): Unhandled node
+abstract_runtime_error_test/02: Crash # (throw new ExpectException(message)): Unhandled node
+abstract_runtime_error_test/03: Crash # (throw new ExpectException(message)): Unhandled node
+abstract_runtime_error_test/none: Crash # (throw new ExpectException(message)): Unhandled node
+abstract_syntax_test/00: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+abstract_syntax_test/01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+abstract_syntax_test/none: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+ackermann_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+adjacent_const_string_literals_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+adjacent_string_literals_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+allocate_large_object_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+allocate_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+allocation_sinking_inlining_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+and_operation_on_non_integer_operand_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+application_negative_test: Crash # (Expect): Error expression `Expect` unhandled.
+argument_definition_test/01: Crash # (test(1,b:2,c:3)): Error expression `test(1,b:2,c:3)` unhandled.
+argument_definition_test/none: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+arithmetic2_test: Crash # (throw new ExpectException(message)): Unhandled node
+arithmetic_canonicalization_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+arithmetic_smi_overflow_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+arithmetic_test: Crash # (throw new ExpectException(message)): Unhandled node
+assertion_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+assign_op_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+assign_top_method_test/01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+assign_to_type_test/01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+assign_to_type_test/02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+assign_to_type_test/03: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+assign_to_type_test/04: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+async_and_or_test: Crash # (throw _buildException('asyncEnd() was called before asyncStart().')): Unhandled node
+async_await_catch_regression_test: Crash # (throw _buildException('asyncEnd() was called before asyncStart().')): Unhandled node
+async_await_syntax_test/a01a: Crash # (a01a()async=>null;): cannot handle async/sync*/async* functions
+async_await_syntax_test/a02a: Crash # (a02a()async{}): cannot handle async/sync*/async* functions
+async_await_syntax_test/a03a: Crash # (a03a()async*{}): cannot handle async/sync*/async* functions
+async_await_syntax_test/a03b: Crash # (a03b()async*{}): cannot handle async/sync*/async* functions
+async_await_syntax_test/a04a: Crash # (a04a()sync*{}): cannot handle async/sync*/async* functions
+async_await_syntax_test/a04b: Crash # (a04b()): Error expression `a04b()` unhandled.
+async_await_syntax_test/a04c: Crash # (a04c()sync*{}): cannot handle async/sync*/async* functions
+async_await_syntax_test/a05a: Crash # (a05a()async{await 0;}): cannot handle async/sync*/async* functions
+async_await_syntax_test/a05b: Crash # (a05b()async{await (a){};await (0);}): cannot handle async/sync*/async* functions
+async_await_syntax_test/a06a: Crash # (a06a()async{await for(var o in st){}}): cannot handle async/sync*/async* functions
+async_await_syntax_test/a07a: Crash # (a07a()sync*{yield 0;}): cannot handle async/sync*/async* functions
+async_await_syntax_test/a07b: Crash # (a07b()): Error expression `a07b()` unhandled.
+async_await_syntax_test/a08a: Crash # (a08a()sync*{yield* [] ;}): cannot handle async/sync*/async* functions
+async_await_syntax_test/a08b: Crash # (a08b()): Error expression `a08b()` unhandled.
+async_await_syntax_test/a09a: Crash # (a09a()async*{yield 0;}): cannot handle async/sync*/async* functions
+async_await_syntax_test/a10a: Crash # (a10a()async*{yield* [] ;}): cannot handle async/sync*/async* functions
+async_await_syntax_test/a11a: Crash # (sync): Error expression `sync` unhandled.
+async_await_syntax_test/a11b: Crash # (get sync sync*{}): cannot handle async/sync*/async* functions
+async_await_syntax_test/a11c: Crash # (get async async{}): cannot handle async/sync*/async* functions
+async_await_syntax_test/a11d: Crash # (get async async*{}): cannot handle async/sync*/async* functions
+async_await_syntax_test/a12g: Crash # (get a12g async=>null;): cannot handle async/sync*/async* functions
+async_await_syntax_test/b01a: Crash # (b01a()async=>null;): cannot handle async/sync*/async* functions
+async_await_syntax_test/b02a: Crash # (b02a()async{}): cannot handle async/sync*/async* functions
+async_await_syntax_test/b03a: Crash # (b03a()async*{}): cannot handle async/sync*/async* functions
+async_await_syntax_test/b04a: Crash # (b04a()sync*{}): cannot handle async/sync*/async* functions
+async_await_syntax_test/b05a: Crash # (b05a()async{await 0;}): cannot handle async/sync*/async* functions
+async_await_syntax_test/b06a: Crash # (b06a()async{await for(var o in st){}}): cannot handle async/sync*/async* functions
+async_await_syntax_test/b07a: Crash # (b07a()sync*{yield 0;}): cannot handle async/sync*/async* functions
+async_await_syntax_test/b08a: Crash # (b08a()sync*{yield* [] ;}): cannot handle async/sync*/async* functions
+async_await_syntax_test/b09a: Crash # (b09a()async*{yield 0;}): cannot handle async/sync*/async* functions
+async_await_syntax_test/b10a: Crash # (b10a()async*{yield* [] ;}): cannot handle async/sync*/async* functions
+async_await_syntax_test/b11b: Crash # (get sync sync*{}): cannot handle async/sync*/async* functions
+async_await_syntax_test/b11c: Crash # (get async async{}): cannot handle async/sync*/async* functions
+async_await_syntax_test/b11d: Crash # (get async async*{}): cannot handle async/sync*/async* functions
+async_await_syntax_test/b12g: Crash # (get b12g async=>null;): cannot handle async/sync*/async* functions
+async_await_syntax_test/c01a: Crash # (c01a()async=>null;): cannot handle async/sync*/async* functions
+async_await_syntax_test/c02a: Crash # (c02a()async{}): cannot handle async/sync*/async* functions
+async_await_syntax_test/c03a: Crash # (c03a()async*{}): cannot handle async/sync*/async* functions
+async_await_syntax_test/c04a: Crash # (c04a()sync*{}): cannot handle async/sync*/async* functions
+async_await_syntax_test/c05a: Crash # (c05a()async{await 0;}): cannot handle async/sync*/async* functions
+async_await_syntax_test/c06a: Crash # (c06a()async{await for(var o in st){}}): cannot handle async/sync*/async* functions
+async_await_syntax_test/c07a: Crash # (c07a()sync*{yield 0;}): cannot handle async/sync*/async* functions
+async_await_syntax_test/c08a: Crash # (c08a()sync*{yield* [] ;}): cannot handle async/sync*/async* functions
+async_await_syntax_test/c09a: Crash # (c09a()async*{yield 0;}): cannot handle async/sync*/async* functions
+async_await_syntax_test/c10a: Crash # (c10a()async*{yield* [] ;}): cannot handle async/sync*/async* functions
+async_await_syntax_test/d01a: Crash # (()async=>null): cannot handle async/sync*/async* functions
+async_await_syntax_test/d02a: Crash # (()async{}): cannot handle async/sync*/async* functions
+async_await_syntax_test/d03a: Crash # (()async*{}): cannot handle async/sync*/async* functions
+async_await_syntax_test/d04a: Crash # (()sync*{}): cannot handle async/sync*/async* functions
+async_await_syntax_test/d05a: Crash # (()async{await 0;}): cannot handle async/sync*/async* functions
+async_await_syntax_test/d06a: Crash # (()async{await for(var o in st){}}): cannot handle async/sync*/async* functions
+async_await_syntax_test/d07a: Crash # (()sync*{yield 0;}): cannot handle async/sync*/async* functions
+async_await_syntax_test/d08a: Crash # (()sync*{yield* [] ;}): cannot handle async/sync*/async* functions
+async_await_syntax_test/d08b: Crash # (()sync*{yield* 0+1;}): cannot handle async/sync*/async* functions
+async_await_syntax_test/d09a: Crash # (()async*{yield 0;}): cannot handle async/sync*/async* functions
+async_await_syntax_test/d10a: Crash # (()async*{yield* [] ;}): cannot handle async/sync*/async* functions
+async_await_test/02: Crash # (f()async{return id(42);}): cannot handle async/sync*/async* functions
+async_await_test/03: Crash # (f()async{return id(42);}): cannot handle async/sync*/async* functions
+async_await_test/none: Crash # (f()async{return id(42);}): cannot handle async/sync*/async* functions
+async_break_in_finally_test: Crash # (throw _buildException('asyncEnd() was called before asyncStart().')): Unhandled node
+async_continue_label_test/await_in_body: Crash # (throw _buildException('asyncEnd() was called before asyncStart().')): Unhandled node
+async_continue_label_test/await_in_condition: Crash # (throw _buildException('asyncEnd() was called before asyncStart().')): Unhandled node
+async_continue_label_test/await_in_init: Crash # (throw _buildException('asyncEnd() was called before asyncStart().')): Unhandled node
+async_continue_label_test/await_in_update: Crash # (throw _buildException('asyncEnd() was called before asyncStart().')): Unhandled node
+async_continue_label_test/none: Crash # (throw _buildException('asyncEnd() was called before asyncStart().')): Unhandled node
+async_control_structures_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+async_finally_rethrow_test: Crash # cannot handle async/sync*/async* functions
+async_or_generator_return_type_stacktrace_test/01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+async_or_generator_return_type_stacktrace_test/02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+async_or_generator_return_type_stacktrace_test/03: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+async_or_generator_return_type_stacktrace_test/none: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+async_regression_23058_test: Crash # (throw _buildException('asyncEnd() was called before asyncStart().')): Unhandled node
+async_rethrow_test: Crash # cannot handle async/sync*/async* functions
+async_return_types_test/nestedFuture: Crash # (throw _buildException('asyncEnd() was called before asyncStart().')): Unhandled node
+async_return_types_test/none: Crash # (throw _buildException('asyncEnd() was called before asyncStart().')): Unhandled node
+async_return_types_test/tooManyTypeParameters: Crash # (throw _buildException('asyncEnd() was called before asyncStart().')): Unhandled node
+async_return_types_test/wrongReturnType: Crash # (throw _buildException('asyncEnd() was called before asyncStart().')): Unhandled node
+async_return_types_test/wrongTypeParameter: Crash # (throw _buildException('asyncEnd() was called before asyncStart().')): Unhandled node
+async_star_cancel_and_throw_in_finally_test: Crash # (throw _buildException('asyncEnd() was called before asyncStart().')): Unhandled node
+asyncstar_concat_test: Crash # (throw _buildException('asyncEnd() was called before asyncStart().')): Unhandled node
+async_star_regression_23116_test: Crash # (throw _buildException('asyncEnd() was called before asyncStart().')): Unhandled node
+async_star_test/01: Crash # (f()async*{}): cannot handle async/sync*/async* functions
+async_star_test/02: Crash # (f()async*{}): cannot handle async/sync*/async* functions
+async_star_test/03: Crash # (f()async*{}): cannot handle async/sync*/async* functions
+async_star_test/04: Crash # (f()async*{}): cannot handle async/sync*/async* functions
+async_star_test/05: Crash # (f()async*{}): cannot handle async/sync*/async* functions
+async_star_test/none: Crash # (f()async*{}): cannot handle async/sync*/async* functions
+asyncstar_throw_in_catch_test: Crash # (throw _buildException('asyncEnd() was called before asyncStart().')): Unhandled node
+asyncstar_yieldstar_test: Crash # (throw _buildException('asyncEnd() was called before asyncStart().')): Unhandled node
+asyncstar_yield_test: Crash # (throw _buildException('asyncEnd() was called before asyncStart().')): Unhandled node
+async_switch_test/none: Crash # (throw _buildException('asyncEnd() was called before asyncStart().')): Unhandled node
+async_switch_test/withDefault: Crash # (throw _buildException('asyncEnd() was called before asyncStart().')): Unhandled node
+async_test/constructor2: Crash # (bar(int p1,p2)async{var z=8;return p2+z+foo;}): cannot handle async/sync*/async* functions
+async_test/constructor3: Crash # (bar(int p1,p2)async{var z=8;return p2+z+foo;}): cannot handle async/sync*/async* functions
+async_test/constructor4: Crash # (bar(int p1,p2)async{var z=8;return p2+z+foo;}): cannot handle async/sync*/async* functions
+async_test/none: Crash # (bar(int p1,p2)async{var z=8;return p2+z+foo;}): cannot handle async/sync*/async* functions
+async_test/setter1: Crash # (bar(int p1,p2)async{var z=8;return p2+z+foo;}): cannot handle async/sync*/async* functions
+async_test/type-mismatch1: Crash # (bar(int p1,p2)async{var z=8;return p2+z+foo;}): cannot handle async/sync*/async* functions
+async_test/type-mismatch2: Crash # (bar(int p1,p2)async{var z=8;return p2+z+foo;}): cannot handle async/sync*/async* functions
+async_test/type-mismatch3: Crash # (bar(int p1,p2)async{var z=8;return p2+z+foo;}): cannot handle async/sync*/async* functions
+async_test/type-mismatch4: Crash # (bar(int p1,p2)async{var z=8;return p2+z+foo;}): cannot handle async/sync*/async* functions
+async_this_bound_test: Crash # (throw _buildException('asyncEnd() was called before asyncStart().')): Unhandled node
+async_throw_in_catch_test/forceAwait: Crash # (throw _buildException('asyncEnd() was called before asyncStart().')): Unhandled node
+async_throw_in_catch_test/none: Crash # (throw _buildException('asyncEnd() was called before asyncStart().')): Unhandled node
+await_backwards_compatibility_test/await1: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+await_backwards_compatibility_test/await2: Crash # (test1()): Error expression `test1()` unhandled.
+await_backwards_compatibility_test/await3: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+await_backwards_compatibility_test/await4: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+await_backwards_compatibility_test/none: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+await_exceptions_test: Crash # (throw _buildException('asyncEnd() was called before asyncStart().')): Unhandled node
+await_for_cancel_test: Crash # (throw _buildException('asyncEnd() was called before asyncStart().')): Unhandled node
+await_for_test: Crash # (throw _buildException('asyncEnd() was called before asyncStart().')): Unhandled node
+await_for_use_local_test: Crash # (throw _buildException('asyncEnd() was called before asyncStart().')): Unhandled node
+await_future_test: Crash # (throw _buildException('asyncEnd() was called before asyncStart().')): Unhandled node
+await_nonfuture_test: Crash # (foo()async{Expect.equals(X,10);return await 5;}): cannot handle async/sync*/async* functions
+await_not_started_immediately_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+await_postfix_expr_test: Crash # (throw _buildException('asyncEnd() was called before asyncStart().')): Unhandled node
+await_regression_test: Crash # cannot handle async/sync*/async* functions
+await_test: Crash # cannot handle async/sync*/async* functions
+bad_constructor_test/06: Crash # (new A()): Error expression `new A()` unhandled.
+bad_named_constructor_negative_test: Crash # Error expression `BadNamedConstructorNegativeTest.testMain()` unhandled.
+bad_named_parameters2_test/01: Crash # (try {caught=false;np.foo(b:25);}on NoSuchMethodError catch (e){caught=true;}): "on T" catch block
+bad_named_parameters2_test/none: Crash # (try {caught=false;}on NoSuchMethodError catch (e){caught=true;}): "on T" catch block
+bad_named_parameters_test/01: Crash # "on T" catch block
+bad_named_parameters_test/02: Crash # (try {caught=false;}on NoSuchMethodError catch (e){caught=true;}): "on T" catch block
+bad_named_parameters_test/03: Crash # (try {caught=false;}on NoSuchMethodError catch (e){caught=true;}): "on T" catch block
+bad_named_parameters_test/04: Crash # (try {caught=false;}on NoSuchMethodError catch (e){caught=true;}): "on T" catch block
+bad_named_parameters_test/05: Crash # (try {caught=false;}on NoSuchMethodError catch (e){caught=true;}): "on T" catch block
+bad_named_parameters_test/none: Crash # (try {caught=false;}on NoSuchMethodError catch (e){caught=true;}): "on T" catch block
+bailout2_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+bailout3_test: Crash # (throw 0): Unhandled node
+bailout4_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+bailout5_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+bailout6_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+bailout7_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+bailout_container_type_test: Crash # (throw 'Test failed'): Unhandled node
+bailout_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+bind_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+bit_operations_test/01: Crash # (throw new ExpectException(message)): Unhandled node
+bit_operations_test/02: Crash # (throw new ExpectException(message)): Unhandled node
+bit_operations_test/03: Crash # (throw new ExpectException(message)): Unhandled node
+bit_operations_test/04: Crash # (throw new ExpectException(message)): Unhandled node
+bit_operations_test/none: Crash # (throw new ExpectException(message)): Unhandled node
+bit_shift_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+bool_check_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+bool_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+bound_closure_equality_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+bound_closure_primitives_test: Crash # (throw new ExpectException(message)): Unhandled node
+branch_canonicalization_test: Crash # (throw new ExpectException(message)): Unhandled node
+branches_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+break_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+built_in_identifier_test/none: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+call_argument_inference_test: Crash # (throw new ExpectException(message)): Unhandled node
+call_closurization_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+call_constructor_on_unresolvable_class_test/01: Crash # (new A()): Error expression `new A()` unhandled.
+call_constructor_on_unresolvable_class_test/02: Crash # (new A.foo()): Error expression `new A.foo()` unhandled.
+call_constructor_on_unresolvable_class_test/03: Crash # (new lib.A()): Error expression `new lib.A()` unhandled.
+call_constructor_on_unresolvable_class_test/04: Crash # (new A()): Error expression `new A()` unhandled.
+call_constructor_on_unresolvable_class_test/05: Crash # (new A.foo()): Error expression `new A.foo()` unhandled.
+call_constructor_on_unresolvable_class_test/06: Crash # (new lib.A()): Error expression `new lib.A()` unhandled.
+call_constructor_on_unresolvable_class_test/07: Crash # (new A()): Error expression `new A()` unhandled.
+call_nonexistent_constructor_test/01: Crash # "on T" catch block
+call_nonexistent_constructor_test/02: Crash # (try {}on NoSuchMethodError catch (e){i=-1;}on String catch (e){i=1;}): "on T" catch block
+call_nonexistent_constructor_test/none: Crash # (try {}on NoSuchMethodError catch (e){i=-1;}on String catch (e){i=1;}): "on T" catch block
+call_nonexistent_static_test/01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+call_nonexistent_static_test/02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+call_nonexistent_static_test/03: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+call_nonexistent_static_test/04: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+call_nonexistent_static_test/05: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+call_nonexistent_static_test/06: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+call_nonexistent_static_test/07: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+call_nonexistent_static_test/08: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+call_nonexistent_static_test/09: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+call_nonexistent_static_test/10: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+call_nonexistent_static_test/none: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+call_operator_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+call_property_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+call_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+call_this_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+call_through_getter_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+call_through_null_getter_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+call_type_literal_test/01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+call_with_no_such_method_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+canonical_const2_test: Crash # (throw new ExpectException(message)): Unhandled node
+canonical_const3_test: Crash # (throw new ExpectException(message)): Unhandled node
+canonical_const_test: Crash # Please triage this failure.
+cascade_2_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+cascade2_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+cascade_in_expression_function_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+cascade_in_initializer_list_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+cascade_precedence_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+cascade_test/none: Crash # cannot compile methods that need interceptor calling convention.
+cast2_test/01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+cast2_test/none: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+cast_test/01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+cast_test/02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+cast_test/03: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+cast_test/04: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+cast_test/05: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+cast_test/07: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+cast_test/08: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+cast_test/10: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+cast_test/12: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+cast_test/13: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+cast_test/14: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+cast_test/15: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+cast_test/none: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+catch_liveness_test: Crash # Please triage this failure.
+cha_deopt1_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+cha_deopt2_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+cha_deopt3_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+char_escape_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+checked_null_test/01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+checked_setter2_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+checked_setter3_test/01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+checked_setter3_test/02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+checked_setter3_test/none: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+checked_setter_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+class_codegen_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+class_cycle_test/00: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+class_cycle_test/01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+class_cycle_test/02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+class_cycle_test/03: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+class_cycle_test/none: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+class_literal_test/01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+class_literal_test/02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+class_literal_test/03: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+class_literal_test/04: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+class_literal_test/05: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+class_literal_test/06: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+class_literal_test/07: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+class_literal_test/08: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+class_literal_test/09: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+class_literal_test/10: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+class_literal_test/11: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+class_literal_test/12: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+class_literal_test/13: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+class_literal_test/14: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+class_literal_test/15: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+class_literal_test/16: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+class_literal_test/17: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+class_literal_test/18: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+class_literal_test/19: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+class_literal_test/20: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+class_literal_test/21: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+class_literal_test/22: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+class_literal_test/23: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+class_literal_test/24: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+class_literal_test/25: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+class_literal_test/none: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+class_override_test/00: Crash # (try {instance.foo();}on NoSuchMethodError catch (error){}finally {}): "on T" catch block
+class_override_test/none: Crash # (try {instance.foo();}finally {}): not exactly one catch block
+class_syntax2_test: Crash # (throw new ExpectException(message)): Unhandled node
+class_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+closure2_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+closure3_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+closure4_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+closure5_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+closure6_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+closure7_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+closure8_test: Crash # cannot compile methods that need interceptor calling convention.
+closure_break1_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+closure_break2_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+closure_break_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+closure_in_constructor_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+closure_in_field_initializer_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+closure_in_initializer2_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+closure_in_initializer_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+closure_internals_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+closure_parameter_types_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+closure_self_reference_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+closure_shared_state_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+closure_side_effect_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+closures_initializer2_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+closures_initializer_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+closures_with_complex_params_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+closure_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+closure_type_test/01: Crash # "on T" catch block
+closure_type_test/none: Crash # "on T" catch block
+closure_type_variables_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+closure_type_variable_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+closure_variable_shadow_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+closure_with_super_field_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+closure_with_super_send_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+code_after_try_is_executed_test/01: Crash # (try {throw 'foo';}on String catch (ex){exception=ex;}): "on T" catch block
+code_after_try_is_executed_test/none: Crash # (try {throw 'foo';}on String catch (ex){exception=ex;}): "on T" catch block
+comparison_test: Crash # (throw new ExpectException(message)): Unhandled node
+compile_time_constant10_test/01: Crash # (throw new ExpectException(message)): Unhandled node
+compile_time_constant10_test/02: Crash # (throw new ExpectException(message)): Unhandled node
+compile_time_constant10_test/none: Crash # (throw new ExpectException(message)): Unhandled node
+compile_time_constant11_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+compile_time_constant2_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+compile_time_constant3_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+compile_time_constant5_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+compile_time_constant6_test: Crash # (throw new ExpectException(message)): Unhandled node
+compile_time_constant7_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+compile_time_constant8_test: Crash # (throw new ExpectException(message)): Unhandled node
+compile_time_constant9_test: Crash # (throw new ExpectException(message)): Unhandled node
+compile_time_constant_a_test: Crash # Please triage this failure.
+compile_time_constant_b_test: Crash # Please triage this failure.
+compile_time_constant_d_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+compile_time_constant_e_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+compile_time_constant_f_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+compile_time_constant_g_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+compile_time_constant_h_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+compile_time_constant_i_test: Crash # (throw new ExpectException(message)): Unhandled node
+compile_time_constant_j_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+compile_time_constant_k_test/01: Crash # Please triage this failure.
+compile_time_constant_k_test/02: Crash # Please triage this failure.
+compile_time_constant_k_test/03: Crash # Please triage this failure.
+compile_time_constant_k_test/none: Crash # Please triage this failure.
+compile_time_constant_l_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+compile_time_constant_m_test: Crash # (throw new ExpectException(message)): Unhandled node
+compile_time_constant_n_test: Crash # (throw new ExpectException(message)): Unhandled node
+compile_time_constant_o_test/01: Crash # Please triage this failure.
+compile_time_constant_o_test/02: Crash # Please triage this failure.
+compile_time_constant_o_test/none: Crash # Please triage this failure.
+compile_time_constant_p_test/01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+compile_time_constant_p_test/none: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+compile_time_constant_test/01: Crash # unable to build cps definition of generative_constructor(Bad#)
+compound_assignment_operator_test: Crash # (throw new ExpectException(message)): Unhandled node
+cond_expr_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+condition_bailout_test: Crash # (throw new ExpectException(message)): Unhandled node
+constant_fold_equals_test: Crash # (throw new ExpectException(message)): Unhandled node
+constant_propagation_phis_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+constant_string_interpolation_test: Crash # (throw new ExpectException(message)): Unhandled node
+const_conditional_test/01: Crash # (throw new ExpectException(message)): Unhandled node
+const_conditional_test/02: Crash # (throw new ExpectException(message)): Unhandled node
+const_conditional_test/03: Crash # (throw new ExpectException(message)): Unhandled node
+const_conditional_test/04: Crash # (throw new ExpectException(message)): Unhandled node
+const_conditional_test/05: Crash # (throw new ExpectException(message)): Unhandled node
+const_conditional_test/06: Crash # (throw new ExpectException(message)): Unhandled node
+const_conditional_test/07: Crash # (throw new ExpectException(message)): Unhandled node
+const_conditional_test/08: Crash # (throw new ExpectException(message)): Unhandled node
+const_conditional_test/09: Crash # (throw new ExpectException(message)): Unhandled node
+const_conditional_test/10: Crash # (throw new ExpectException(message)): Unhandled node
+const_conditional_test/none: Crash # (throw new ExpectException(message)): Unhandled node
+const_constructor_nonconst_field_test/01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+const_constructor_nonconst_field_test/none: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+const_constructor_test/none: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+const_counter_negative_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+const_dynamic_type_literal_test/01: Crash # (throw new ExpectException(message)): Unhandled node
+const_escape_frog_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+const_evaluation_test/01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+const_evaluation_test/none: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+const_factory_redirection_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+const_global_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+const_init_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+const_list_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+const_locals_test: Crash # (throw new ExpectException(message)): Unhandled node
+const_local_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+const_map2_test/none: Crash # Please triage this failure.
+const_map3_test/none: Crash # Please triage this failure.
+const_map4_test: Crash # Please triage this failure.
+const_map_test: Crash # Please triage this failure.
+const_named_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+const_nested_test: Crash # Please triage this failure.
+const_objects_are_immutable_test/01: Crash # Please triage this failure.
+const_objects_are_immutable_test/none: Crash # Please triage this failure.
+constructor10_test/01: Crash # Please triage this failure.
+constructor10_test/02: Crash # Please triage this failure.
+constructor11_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+constructor12_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+constructor2_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+constructor3_negative_test: Crash # Please triage this failure.
+constructor3_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+constructor4_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+constructor5_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+constructor6_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+constructor7_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+constructor8_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+constructor_body_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+constructor_call_wrong_argument_count_negative_test: Crash # Please triage this failure.
+constructor_default_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+constructor_initializer_test/01: Crash # (new A(3)): Error expression `new A(3)` unhandled.
+constructor_initializer_test/none: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+constructor_name_clash_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+constructor_named_arguments_test/01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+constructor_named_arguments_test/none: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+constructor_name_test/01: Crash # (new Foo.Foo()): Error expression `new Foo.Foo()` unhandled.
+constructor_name_test/02: Crash # (new Foo()): Error expression `new Foo()` unhandled.
+constructor_name_test/03: Crash # (new Foo()): Error expression `new Foo()` unhandled.
+constructor_redirect_test/01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+constructor_redirect_test/none: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+constructor_return_test/01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+constructor_return_test/02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+constructor_return_test/03: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+constructor_return_test/04: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+constructor_return_test/05: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+constructor_return_test/none: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+constructor_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+constructor_with_mixin_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+const_string_test: Crash # (throw new ExpectException(message)): Unhandled node
+const_switch2_test/none: Crash # (switch (a){case 1:print("OK");}): Unhandled node
+const_switch_test/01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+const_switch_test/02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+const_switch_test/03: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+const_switch_test/04: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+const_syntax_test/03: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+const_syntax_test/04: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+const_syntax_test/05: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+const_syntax_test/06: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+const_syntax_test/07: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+const_syntax_test/08: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+const_syntax_test/09: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+const_syntax_test/10: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+const_syntax_test/none: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+const_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+const_types_test/23: Crash # (new Superclass()): Error expression `new Superclass()` unhandled.
+const_types_test/24: Crash # (new Superclass()): Error expression `new Superclass()` unhandled.
+const_types_test/25: Crash # (new Superclass()): Error expression `new Superclass()` unhandled.
+const_types_test/26: Crash # (new Superclass()): Error expression `new Superclass()` unhandled.
+const_types_test/27: Crash # (new Superclass()): Error expression `new Superclass()` unhandled.
+const_types_test/28: Crash # (new Superclass()): Error expression `new Superclass()` unhandled.
+const_types_test/29: Crash # (new Superclass()): Error expression `new Superclass()` unhandled.
+const_types_test/30: Crash # (new Superclass()): Error expression `new Superclass()` unhandled.
+const_types_test/41: Crash # (new Superclass()): Error expression `new Superclass()` unhandled.
+context2_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+context_args_with_defaults_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+context_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+continue_test: Crash # (switch (0){case 0:i=22;continue;default:i=25;break;}): Unhandled node
+core_type_check_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+crash_12118_test: Crash # (throw 'Test failed'): Unhandled node
+crash_6725_test/01: Crash # (throw 'f.key != 42 (${f.key})'): Unhandled node
+create_unresolved_type_test/01: Crash # (new F<int>()): Error expression `new F<int>()` unhandled.
+critical_edge2_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+critical_edge_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+ct_const3_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+ct_const4_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+ct_const_test: Crash # "on T" catch block
+custom_await_stack_trace_test: Crash # cannot handle async/sync*/async* functions
+cyclic_import_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+cyclic_type2_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+cyclic_type_test/00: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+cyclic_type_test/01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+cyclic_type_test/02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+cyclic_type_test/03: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+cyclic_type_test/04: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+dangling_else_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+default_class_implicit_constructor_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+default_factory_library_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+default_factory_test/01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+default_factory_test/none: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+default_implementation_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+default_init_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+deferred_closurize_load_library_test: Crash # (throw _buildException('asyncEnd() was called before asyncStart().')): Unhandled node
+deferred_constant_list_test: Crash # (throw _buildException('asyncEnd() was called before asyncStart().')): Unhandled node
+deferred_constraints_constants_test/constructor1: Crash # (const lib.Const()): Error expression `const lib.Const()` unhandled.
+deferred_constraints_constants_test/constructor2: Crash # Error expression `const lib.Const.namedConstructor()` unhandled.
+deferred_constraints_constants_test/default_argument1: Crash # (throw _buildException('asyncEnd() was called before asyncStart().')): Unhandled node
+deferred_constraints_constants_test/default_argument2: Crash # (throw _buildException('asyncEnd() was called before asyncStart().')): Unhandled node
+deferred_constraints_constants_test/metadata1: Crash # (throw _buildException('asyncEnd() was called before asyncStart().')): Unhandled node
+deferred_constraints_constants_test/metadata2: Crash # (throw _buildException('asyncEnd() was called before asyncStart().')): Unhandled node
+deferred_constraints_constants_test/metadata3: Crash # (throw _buildException('asyncEnd() was called before asyncStart().')): Unhandled node
+deferred_constraints_constants_test/none: Crash # (throw _buildException('asyncEnd() was called before asyncStart().')): Unhandled node
+deferred_constraints_constants_test/reference1: Crash # (throw _buildException('asyncEnd() was called before asyncStart().')): Unhandled node
+deferred_constraints_constants_test/reference2: Crash # (throw _buildException('asyncEnd() was called before asyncStart().')): Unhandled node
+deferred_constraints_constants_test/reference_after_load: Crash # (throw _buildException('asyncEnd() was called before asyncStart().')): Unhandled node
+deferred_constraints_type_annotation_test/as_operation: Crash # (throw _buildException('asyncEnd() was called before asyncStart().')): Unhandled node
+deferred_constraints_type_annotation_test/catch_check: Crash # (throw _buildException('asyncEnd() was called before asyncStart().')): Unhandled node
+deferred_constraints_type_annotation_test/is_check: Crash # (throw _buildException('asyncEnd() was called before asyncStart().')): Unhandled node
+deferred_constraints_type_annotation_test/new_before_load: Crash # (throw _buildException('asyncEnd() was called before asyncStart().')): Unhandled node
+deferred_constraints_type_annotation_test/new: CompileTimeError # Please triage this failure.
+deferred_constraints_type_annotation_test/new: Crash # (throw _buildException('asyncEnd() was called before asyncStart().')): Unhandled node
+deferred_constraints_type_annotation_test/new_generic1: CompileTimeError # Please triage this failure.
+deferred_constraints_type_annotation_test/new_generic1: Crash # (throw _buildException('asyncEnd() was called before asyncStart().')): Unhandled node
+deferred_constraints_type_annotation_test/new_generic2: CompileTimeError # Please triage this failure.
+deferred_constraints_type_annotation_test/new_generic2: Crash # (throw _buildException('asyncEnd() was called before asyncStart().')): Unhandled node
+deferred_constraints_type_annotation_test/new_generic3: CompileTimeError # Please triage this failure.
+deferred_constraints_type_annotation_test/new_generic3: Crash # (throw _buildException('asyncEnd() was called before asyncStart().')): Unhandled node
+deferred_constraints_type_annotation_test/none: CompileTimeError # Please triage this failure.
+deferred_constraints_type_annotation_test/none: Crash # (throw _buildException('asyncEnd() was called before asyncStart().')): Unhandled node
+deferred_constraints_type_annotation_test/static_method: CompileTimeError # Please triage this failure.
+deferred_constraints_type_annotation_test/static_method: Crash # (throw _buildException('asyncEnd() was called before asyncStart().')): Unhandled node
+deferred_constraints_type_annotation_test/type_annotation1: Crash # handleStaticGetterInvoke: foreign: function(loadLibrary)
+deferred_constraints_type_annotation_test/type_annotation_generic1: CompileTimeError # Please triage this failure.
+deferred_constraints_type_annotation_test/type_annotation_generic1: Crash # (throw _buildException('asyncEnd() was called before asyncStart().')): Unhandled node
+deferred_constraints_type_annotation_test/type_annotation_generic2: CompileTimeError # Please triage this failure.
+deferred_constraints_type_annotation_test/type_annotation_generic2: Crash # (throw _buildException('asyncEnd() was called before asyncStart().')): Unhandled node
+deferred_constraints_type_annotation_test/type_annotation_generic3: CompileTimeError # Please triage this failure.
+deferred_constraints_type_annotation_test/type_annotation_generic3: Crash # (throw _buildException('asyncEnd() was called before asyncStart().')): Unhandled node
+deferred_constraints_type_annotation_test/type_annotation_generic4: CompileTimeError # Please triage this failure.
+deferred_constraints_type_annotation_test/type_annotation_generic4: Crash # (throw _buildException('asyncEnd() was called before asyncStart().')): Unhandled node
+deferred_constraints_type_annotation_test/type_annotation_non_deferred: CompileTimeError # Please triage this failure.
+deferred_constraints_type_annotation_test/type_annotation_non_deferred: Crash # (throw _buildException('asyncEnd() was called before asyncStart().')): Unhandled node
+deferred_constraints_type_annotation_test/type_annotation_null: CompileTimeError # Please triage this failure.
+deferred_constraints_type_annotation_test/type_annotation_null: Crash # (throw _buildException('asyncEnd() was called before asyncStart().')): Unhandled node
+deferred_constraints_type_annotation_test/type_annotation_top_level: CompileTimeError # Please triage this failure.
+deferred_constraints_type_annotation_test/type_annotation_top_level: Crash # (throw _buildException('asyncEnd() was called before asyncStart().')): Unhandled node
+deferred_function_type_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+deferred_global_test: Crash # (throw _buildException('asyncEnd() was called before asyncStart().')): Unhandled node
+deferred_inheritance_constraints_test/mixin: Crash # (new C()): Error expression `new C()` unhandled.
+deferred_inlined_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+deferred_load_constants_test/01: Crash # (throw _buildException('asyncEnd() was called before asyncStart().')): Unhandled node
+deferred_load_constants_test/02: Crash # (throw _buildException('asyncEnd() was called before asyncStart().')): Unhandled node
+deferred_load_constants_test/03: Crash # (throw _buildException('asyncEnd() was called before asyncStart().')): Unhandled node
+deferred_load_constants_test/04: Crash # (throw _buildException('asyncEnd() was called before asyncStart().')): Unhandled node
+deferred_load_constants_test/05: Crash # (throw _buildException('asyncEnd() was called before asyncStart().')): Unhandled node
+deferred_load_constants_test/none: Crash # (throw _buildException('asyncEnd() was called before asyncStart().')): Unhandled node
+deferred_load_inval_code_test: Crash # handleStaticGetterInvoke: foreign: function(loadLibrary)
+deferred_load_library_wrong_args_test/01: Crash # handleStaticGetterInvoke: foreign: function(loadLibrary)
+deferred_load_library_wrong_args_test/none: Crash # handleStaticGetterInvoke: foreign: function(loadLibrary)
+deferred_mixin_test: Crash # (throw _buildException('asyncEnd() was called before asyncStart().')): Unhandled node
+deferred_no_such_method_test: Crash # (throw _buildException('asyncEnd() was called before asyncStart().')): Unhandled node
+deferred_not_loaded_check_test: Crash # (throw new ExpectException(message)): Unhandled node
+deferred_only_constant_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+deferred_optimized_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+deferred_regression_22995_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+deferred_shadow_load_library_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+deferred_shared_and_unshared_classes_test: Crash # (throw _buildException('asyncEnd() was called before asyncStart().')): Unhandled node
+deferred_static_seperate_test: Crash # (throw _buildException('asyncEnd() was called before asyncStart().')): Unhandled node
+deoptimized_function_on_stack_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+deopt_inlined_function_lazy_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+deopt_inlined_function_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+deopt_lazy_finalization_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+deopt_no_feedback_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+deopt_smi_op_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+div_by_zero_test: Crash # (throw new ExpectException(message)): Unhandled node
+div_with_power_of_two2_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+div_with_power_of_two_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+double_int_addition_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+double_int_to_string_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+double_modulo_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+double_nan_comparison_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+double_to_string_as_exponential2_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+double_to_string_as_exponential3_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+double_to_string_as_exponential_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+double_to_string_as_fixed2_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+double_to_string_as_fixed_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+double_to_string_as_precision2_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+double_to_string_as_precision3_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+double_to_string_as_precision_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+double_to_string_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+do_while2_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+do_while3_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+do_while4_test: Crash # (throw new ExpectException(message)): Unhandled node
+do_while_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+duplicate_implements_test/03: Crash # (new Z()): Error expression `new Z()` unhandled.
+duplicate_implements_test/04: Crash # (new Z()): Error expression `new Z()` unhandled.
+duplicate_interface_negative_test: Crash # (Expect): Error expression `Expect` unhandled.
+duplicate_interface_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+dynamic_call_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+dynamic_field_test/01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+dynamic_field_test/02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+dynamic_prefix_core_test/01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+dynamic_prefix_core_test/none: Crash # (throw new ExpectException(message)): Unhandled node
+dynamic_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+dynamic_type_literal_test: Crash # (throw new ExpectException(message)): Unhandled node
+emit_const_fields_test: Crash # Please triage this failure.
+empty_block_case_test: Crash # "on T" catch block
+enum_const_test/01: Crash # (throw new ExpectException(message)): Unhandled node
+enum_const_test/02: Crash # (throw new ExpectException(message)): Unhandled node
+enum_duplicate_test/01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+enum_duplicate_test/02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+enum_duplicate_test/none: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+enum_index_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+enum_mirror_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+enum_private_test/01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+enum_private_test/02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+enum_private_test/none: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+enum_syntax_test/09: Crash # handleStaticFunctionGet: function(topLevelFunction)
+enum_syntax_test/10: Crash # (C.bla): Error expression `C.bla` unhandled.
+enum_test: Crash # Unhandled node
+equality_test: Crash # (throw new ExpectException(message)): Unhandled node
+error_stacktrace_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+evaluation_redirecting_constructor_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+example_constructor_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+exception_identity_test: Crash # (throw exception): Unhandled node
+exception_test: Crash # (try {throw "Hello";}on String catch (s){print(s);i+= 10;}): "on T" catch block
+execute_finally10_test: Crash # (throw 'Expected exception'): Unhandled node
+execute_finally11_test: Crash # (throw 'Expected exception'): Unhandled node
+execute_finally12_test: Crash # (throw new ExpectException(message)): Unhandled node
+execute_finally1_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+execute_finally2_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+execute_finally3_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+execute_finally4_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+execute_finally5_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+execute_finally6_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+execute_finally7_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+execute_finally8_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+execute_finally9_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+exhaustive_for_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+expect_test: Crash # (try {Expect.fail("fail now");}on Exception catch (msg){print(msg);return;}): "on T" catch block
+extends_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+extend_type_parameter2_negative_test: Crash # (new A()): Error expression `new A()` unhandled.
+external_test/16: Crash # (new Foo()): Error expression `new Foo()` unhandled.
+factory3_test: Crash # (throw "0 is not a T"): Unhandled node
+factory_arrow_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+factory_implementation_test/00: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+factory_implementation_test/none: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+factory_redirection2_test/01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+factory_redirection2_test/none: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+factory_redirection3_cyclic_test/01: Crash # (new A.foo()): Error expression `new A.foo()` unhandled.
+factory_redirection_test/01: Crash # (new A<List>.test01()): Error expression `new A<List>.test01()` unhandled.
+factory_redirection_test/02: Crash # (new A<List>.test02()): Error expression `new A<List>.test02()` unhandled.
+factory_redirection_test/03: Crash # (new A<List>.test03()): Error expression `new A<List>.test03()` unhandled.
+factory_redirection_test/04: Crash # (new C.test04()): Error expression `new C.test04()` unhandled.
+factory_redirection_test/05: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+factory_redirection_test/06: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+factory_redirection_test/07: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+factory_redirection_test/08: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+factory_redirection_test/09: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+factory_redirection_test/10: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+factory_redirection_test/11: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+factory_redirection_test/12: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+factory_redirection_test/13: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+factory_redirection_test/14: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+factory_redirection_test/none: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+factory_return_type_checked_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+factory_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+factory_type_parameter2_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+factory_type_parameter_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+fannkuch_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+fast_method_extraction_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+fauxverride_test/none: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+f_bounded_equality_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+f_bounded_quantification4_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+f_bounded_quantification5_test: Crash # "on T" catch block
+f_bounded_quantification_test/01: Crash # "on T" catch block
+f_bounded_quantification_test/02: Crash # (try {}on TypeError catch (error){got_type_error=true;}): "on T" catch block
+f_bounded_quantification_test/none: Crash # (try {}on TypeError catch (error){got_type_error=true;}): "on T" catch block
+fibo_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+field3a_negative_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+field3_negative_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+field_increment_bailout_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+field_inference_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+field_initialization_order_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+field_optimization2_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+field_optimization3_test: Crash # (throw new ExpectException(message)): Unhandled node
+field_optimization_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+field_override2_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+field_override3_test/none: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+field_override4_test/00: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+field_override4_test/01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+field_override4_test/03: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+field_override4_test/none: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+field_override_test/01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+field_override_test/02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+field_override_test/none: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+field_parameter_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+field_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+final_field_initialization_order_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+final_for_in_variable_test/01: Crash # (i=4): Error expression `i=4` unhandled.
+final_is_not_const_test/01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+final_is_not_const_test/none: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+finally_test: Crash # (try {i=12;}finally {Expect.equals(12,i);executedFinally=true;}): not exactly one catch block
+final_param_test/01: Crash # (x=2): Error expression `x=2` unhandled.
+final_syntax_test/03: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+final_syntax_test/04: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+final_syntax_test/08: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+final_syntax_test/09: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+final_syntax_test/10: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+final_syntax_test/none: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+final_used_in_try_test: Crash # (rethrow;): Unhandled node
+final_variable_assignment_test/01: Crash # (x=0): Error expression `x=0` unhandled.
+final_variable_assignment_test/02: Crash # (x+= 1): Error expression `x+= 1` unhandled.
+final_variable_assignment_test/03: Crash # ( ++x): Error expression ` ++x` unhandled.
+final_variable_assignment_test/04: Crash # (x++ ): Error expression `x++ ` unhandled.
+first_class_types_constants_test: Crash # (throw new ExpectException(message)): Unhandled node
+first_class_types_libraries_test: Crash # (throw new ExpectException(message)): Unhandled node
+first_class_types_literals_test/01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+first_class_types_literals_test/02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+first_class_types_literals_test/03: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+first_class_types_literals_test/04: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+first_class_types_literals_test/05: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+first_class_types_literals_test/06: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+first_class_types_literals_test/07: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+first_class_types_literals_test/08: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+first_class_types_literals_test/09: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+first_class_types_literals_test/10: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+first_class_types_literals_test/11: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+first_class_types_literals_test/12: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+first_class_types_literals_test/none: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+first_class_types_test: Crash # (throw new ExpectException(message)): Unhandled node
+fixed_length_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+fixed_type_variable2_test/01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+fixed_type_variable2_test/02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+fixed_type_variable2_test/03: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+fixed_type_variable2_test/04: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+fixed_type_variable2_test/05: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+fixed_type_variable2_test/06: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+fixed_type_variable_test/01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+fixed_type_variable_test/02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+fixed_type_variable_test/03: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+fixed_type_variable_test/04: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+fixed_type_variable_test/05: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+fixed_type_variable_test/06: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+flatten_test/01: Crash # (test()async{int x=await new Derived<int>();}): cannot handle async/sync*/async* functions
+flatten_test/02: Crash # (test()async{Future<int> f()async=>new Derived<int>();}): cannot handle async/sync*/async* functions
+flatten_test/03: Crash # cannot handle async/sync*/async* functions
+flatten_test/04: Crash # cannot handle async/sync*/async* functions
+flatten_test/05: Crash # cannot handle async/sync*/async* functions
+flatten_test/06: Crash # cannot handle async/sync*/async* functions
+flatten_test/07: Crash # cannot handle async/sync*/async* functions
+flatten_test/08: Crash # cannot handle async/sync*/async* functions
+flatten_test/09: Crash # cannot handle async/sync*/async* functions
+flatten_test/10: Crash # cannot handle async/sync*/async* functions
+flatten_test/11: Crash # cannot handle async/sync*/async* functions
+flatten_test/12: Crash # cannot handle async/sync*/async* functions
+flatten_test/none: Crash # (test()async{}): cannot handle async/sync*/async* functions
+for2_test: Crash # Please triage this failure.
+for_in2_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+for_inlining_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+for_in_side_effects_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+for_in_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+for_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+for_variable_capture_test: Crash # (i=0): For-loop variable captured in loop header
+forwarding_factory_constructor_default_values_test: Crash # (throw "FAILED"): Unhandled node
+forwarding_factory_constructor_default_values_test: RuntimeError # Please triage this failure.
+for_without_condition_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+full_stacktrace1_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+full_stacktrace2_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+full_stacktrace3_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+function_argument_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+function_field_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+function_getter_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+function_literals2_test: Crash # (throw new ExpectException(message)): Unhandled node
+function_literals_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+function_malformed_result_type_test: Crash # (try {f();}on TypeError catch (error){got_type_error=true;}): "on T" catch block
+function_propagation_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+function_subtype0_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+function_subtype1_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+function_subtype2_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+function_subtype_bound_closure0_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+function_subtype_bound_closure1_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+function_subtype_bound_closure2_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+function_subtype_bound_closure3_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+function_subtype_bound_closure4_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+function_subtype_bound_closure5a_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+function_subtype_bound_closure5_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+function_subtype_bound_closure6_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+function_subtype_bound_closure7_test: Crash # (throw new ExpectException(message)): Unhandled node
+function_subtype_call0_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+function_subtype_call1_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+function_subtype_call2_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+function_subtype_cast0_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+function_subtype_cast1_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+function_subtype_cast2_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+function_subtype_cast3_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+function_subtype_checked0_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+function_subtype_closure0_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+function_subtype_closure1_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+function_subtype_factory0_test: Crash # (throw new ExpectException(message)): Unhandled node
+function_subtype_factory1_test: Crash # (throw new ExpectException(message)): Unhandled node
+function_subtype_inline0_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+function_subtype_inline1_test: Crash # (throw new ExpectException(message)): Unhandled node
+function_subtype_inline2_test: Crash # "on T" catch block
+function_subtype_local0_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+function_subtype_local1_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+function_subtype_local2_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+function_subtype_local3_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+function_subtype_local4_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+function_subtype_local5_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+function_subtype_named1_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+function_subtype_named2_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+function_subtype_not0_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+function_subtype_not1_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+function_subtype_not2_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+function_subtype_not3_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+function_subtype_optional1_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+function_subtype_optional2_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+function_subtype_setter0_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+function_subtype_simple0_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+function_subtype_simple1_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+function_subtype_simple2_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+function_subtype_top_level0_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+function_subtype_top_level1_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+function_subtype_typearg0_test: Crash # (throw new ExpectException(message)): Unhandled node
+function_subtype_typearg1_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+function_subtype_typearg2_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+function_subtype_typearg3_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+function_subtype_typearg4_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+function_syntax_test/01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+function_syntax_test/02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+function_syntax_test/03: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+function_syntax_test/04: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+function_syntax_test/05: Crash # (testNestedFunctions()): Error expression `testNestedFunctions()` unhandled.
+function_syntax_test/06: Crash # (testNestedFunctions()): Error expression `testNestedFunctions()` unhandled.
+function_syntax_test/07: Crash # (testNestedFunctions()): Error expression `testNestedFunctions()` unhandled.
+function_syntax_test/08: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+function_syntax_test/09: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+function_syntax_test/10: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+function_syntax_test/11: Crash # (testNestedFunctions()): Error expression `testNestedFunctions()` unhandled.
+function_syntax_test/12: Crash # (testNestedFunctions()): Error expression `testNestedFunctions()` unhandled.
+function_syntax_test/13: Crash # (testNestedFunctions()): Error expression `testNestedFunctions()` unhandled.
+function_syntax_test/14: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+function_syntax_test/15: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+function_syntax_test/16: Crash # (testNestedFunctions()): Error expression `testNestedFunctions()` unhandled.
+function_syntax_test/17: Crash # (testNestedFunctions()): Error expression `testNestedFunctions()` unhandled.
+function_syntax_test/18: Crash # (testNestedFunctions()): Error expression `testNestedFunctions()` unhandled.
+function_syntax_test/19: Crash # (testNestedFunctions()): Error expression `testNestedFunctions()` unhandled.
+function_syntax_test/20: Crash # (testNestedFunctions()): Error expression `testNestedFunctions()` unhandled.
+function_syntax_test/21: Crash # (testNestedFunctions()): Error expression `testNestedFunctions()` unhandled.
+function_syntax_test/22: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+function_syntax_test/23: Crash # (testFunctionExpressions()): Error expression `testFunctionExpressions()` unhandled.
+function_syntax_test/24: Crash # (testFunctionExpressions()): Error expression `testFunctionExpressions()` unhandled.
+function_syntax_test/25: Crash # (testFunctionExpressions()): Error expression `testFunctionExpressions()` unhandled.
+function_syntax_test/26: Crash # (testFunctionExpressions()): Error expression `testFunctionExpressions()` unhandled.
+function_syntax_test/27: Crash # (testFunctionExpressions()): Error expression `testFunctionExpressions()` unhandled.
+function_syntax_test/28: Crash # (testFunctionExpressions()): Error expression `testFunctionExpressions()` unhandled.
+function_syntax_test/29: Crash # (testFunctionExpressions()): Error expression `testFunctionExpressions()` unhandled.
+function_syntax_test/30: Crash # (testFunctionExpressions()): Error expression `testFunctionExpressions()` unhandled.
+function_syntax_test/31: Crash # (testFunctionExpressions()): Error expression `testFunctionExpressions()` unhandled.
+function_syntax_test/32: Crash # (testFunctionExpressions()): Error expression `testFunctionExpressions()` unhandled.
+function_syntax_test/33: Crash # (testFunctionExpressions()): Error expression `testFunctionExpressions()` unhandled.
+function_syntax_test/34: Crash # (testFunctionExpressions()): Error expression `testFunctionExpressions()` unhandled.
+function_syntax_test/35: Crash # (testFunctionExpressions()): Error expression `testFunctionExpressions()` unhandled.
+function_syntax_test/36: Crash # (testFunctionExpressions()): Error expression `testFunctionExpressions()` unhandled.
+function_syntax_test/37: Crash # (testFunctionExpressions()): Error expression `testFunctionExpressions()` unhandled.
+function_syntax_test/44: Crash # (testFunctionExpressions()): Error expression `testFunctionExpressions()` unhandled.
+function_syntax_test/45: Crash # (testFunctionExpressions()): Error expression `testFunctionExpressions()` unhandled.
+function_syntax_test/46: Crash # (testFunctionExpressions()): Error expression `testFunctionExpressions()` unhandled.
+function_syntax_test/47: Crash # (testFunctionExpressions()): Error expression `testFunctionExpressions()` unhandled.
+function_syntax_test/48: Crash # (testFunctionExpressions()): Error expression `testFunctionExpressions()` unhandled.
+function_syntax_test/49: Crash # (testFunctionExpressions()): Error expression `testFunctionExpressions()` unhandled.
+function_syntax_test/50: Crash # (testFunctionExpressions()): Error expression `testFunctionExpressions()` unhandled.
+function_syntax_test/51: Crash # (testFunctionExpressions()): Error expression `testFunctionExpressions()` unhandled.
+function_syntax_test/52: Crash # (testFunctionExpressions()): Error expression `testFunctionExpressions()` unhandled.
+function_syntax_test/53: Crash # (testFunctionExpressions()): Error expression `testFunctionExpressions()` unhandled.
+function_syntax_test/54: Crash # (testFunctionExpressions()): Error expression `testFunctionExpressions()` unhandled.
+function_syntax_test/55: Crash # (testFunctionExpressions()): Error expression `testFunctionExpressions()` unhandled.
+function_syntax_test/64: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+function_syntax_test/65: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+function_syntax_test/66: Crash # (testPrecedence()): Error expression `testPrecedence()` unhandled.
+function_syntax_test/67: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+function_syntax_test/68: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+function_syntax_test/69: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+function_syntax_test/70: Crash # Error expression `testFunctionIdentifierExpression()` unhandled.
+function_syntax_test/71: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+function_syntax_test/72: Crash # (testFunctionIdentifierStatement()): Error expression `testFunctionIdentifierStatement()` unhandled.
+function_syntax_test/73: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+function_syntax_test/none: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+function_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+function_type2_test: Crash # (try {new B<String>();}on TypeError catch (e){caughtException=true;}): "on T" catch block
+function_type3_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+function_type_alias2_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+function_type_alias3_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+function_type_alias4_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+function_type_alias6_test/none: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+function_type_alias8_test: Crash # unsupported element kind: fromThing:field
+function_type_alias_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+function_type_call_getter_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+function_type_parameter2_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+function_type_parameter_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+function_type_test: Crash # (try {FListInt fli=f();}on TypeError catch (error){got_type_error=true;}): "on T" catch block
+function_type_this_parameter_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+generic2_test: Crash # (throw new ExpectException(message)): Unhandled node
+generic_closure_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+generic_constructor_mixin2_test: Crash # "on T" catch block
+generic_constructor_mixin3_test: Crash # "on T" catch block
+generic_constructor_mixin_test: Crash # "on T" catch block
+generic_creation_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+generic_deep_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+generic_field_mixin2_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+generic_field_mixin6_test/01: Crash # "on T" catch block
+generic_field_mixin_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+generic_inheritance_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+generic_instanceof2_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+generic_instanceof3_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+generic_instanceof4_test: Crash # (throw new ExpectException(message)): Unhandled node
+generic_instanceof5_test: Crash # (throw new ExpectException(message)): Unhandled node
+generic_instanceof_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+generic_is_check_test: Crash # (throw new ExpectException(message)): Unhandled node
+generic_list_checked_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+generic_native_test: Crash # (throw new ExpectException(message)): Unhandled node
+generic_object_type_test: Crash # (throw new ExpectException(message)): Unhandled node
+generic_parameterized_extends_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+generics_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+generic_syntax_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+generic_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+getter_closure_execution_order_test: Crash # (throw "${failures.length~/2} tests failed."): Unhandled node
+getter_no_setter2_test/00: Crash # (throw new ExpectException(message)): Unhandled node
+getter_no_setter2_test/01: Crash # (nextVar++ ): Error expression `nextVar++ ` unhandled.
+getter_no_setter2_test/03: Crash # (throw new ExpectException(message)): Unhandled node
+getter_no_setter_test/00: Crash # (throw new ExpectException(message)): Unhandled node
+getter_no_setter_test/01: Crash # (nextVar=0): Error expression `nextVar=0` unhandled.
+getter_no_setter_test/02: Crash # (throw new ExpectException(message)): Unhandled node
+getter_no_setter_test/none: Crash # (throw new ExpectException(message)): Unhandled node
+getter_override2_test/00: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+getter_override2_test/01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+getter_override2_test/03: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+getter_override2_test/none: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+getter_override_test/03: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+getter_override_test/none: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+getter_setter_in_lib_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+getter_setter_interceptor_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+getter_setter_order_test: Crash # (throw new ExpectException(message)): Unhandled node
+getters_setters2_test/01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+getters_setters2_test/02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+getters_setters2_test/03: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+getters_setters2_test/none: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+getters_setters_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+getters_setters_type2_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+getters_setters_type3_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+getters_setters_type_test/01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+getters_setters_type_test/none: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+guess_cid_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+gvn_field_access_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+gvn_interceptor_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+gvn_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+hash_code_mangling_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+hash_map_null_key_foreach_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+hello_script_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+identical_closure2_test: Crash # (throw new ExpectException(message)): Unhandled node
+identical_closure_test: Crash # (throw new ExpectException(message)): Unhandled node
+identical_const_test/05: Crash # Please triage this failure.
+identical_const_test/06: Crash # Please triage this failure.
+identical_const_test/07: Crash # Please triage this failure.
+identical_const_test/08: Crash # Please triage this failure.
+identical_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+if_and_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+if_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+illegal_invocation_test/01: Crash # (foo()): Error expression `foo()` unhandled.
+implicit_closure1_test: Crash # handleStaticFunctionGet: function(Hello#handler1)
+implicit_closure2_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+implicit_closure_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+implicit_scope_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+implicit_super_constructor_call_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+implicit_this_test/01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+implicit_this_test/02: Crash # (new Abstract()): Error expression `new Abstract()` unhandled.
+implicit_this_test/04: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+implicit_this_test/none: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+implied_interface_test: Crash # "on T" catch block
+import_combinators_negative_test: Crash # (ugly): Error expression `ugly` unhandled.
+import_combinators_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+import_core_prefix_test: Crash # (throw new ExpectException(message)): Unhandled node
+import_self_test/01: Crash # (throw new ExpectException(message)): Unhandled node
+import_self_test/none: Crash # (throw new ExpectException(message)): Unhandled node
+import_show_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+incr_op_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+index_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+inference_captured_variable2_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+inference_captured_variable_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+inference_list_or_null_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+inference_mixin_field_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+inference_super_constructor_call_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+inferrer_closure_test: Crash # (throw 'Test failed'): Unhandled node
+inferrer_constructor2_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+inferrer_constructor3_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+inferrer_constructor4_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+inferrer_constructor5_test/01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+inferrer_constructor_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+inferrer_named_parameter_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+inferrer_synthesized_constructor_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+inferrer_synthesized_super_constructor_test: Crash # Please triage this failure.
+inferrer_this_access_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+infinite_switch_label_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+infinity_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+inline_argument_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+inline_closure_with_constant_arguments_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+inlined_conditional_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+inlined_throw_test: Crash # (throw new ExpectException(message)): Unhandled node
+inline_effect_context_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+inline_getter_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+inline_in_for_initializer_and_bailout_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+inline_super_field_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+inline_super_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+inline_test_context_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+inline_value_context_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+instance_compound_assignment_operator_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+instance_field_initializer_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+instance_incr_deopt_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+instance_inline_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+instanceof2_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+instanceof3_test: Crash # "on T" catch block
+instanceof4_test/01: Crash # (throw new ExpectException(message)): Unhandled node
+instanceof4_test/none: Crash # (throw new ExpectException(message)): Unhandled node
+instanceof_optimized_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+instanceof_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+inst_field_initializer1_negative_test: Crash # unable to build cps definition of generative_constructor(A#)
+inst_field_initializer_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+int2_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+integer_division_by_zero_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+interceptor2_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+interceptor3_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+interceptor4_test: Crash # (throw new ExpectException(message)): Unhandled node
+interceptor5_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+interceptor6_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+interceptor7_test: Crash # (throw new ExpectException(message)): Unhandled node
+interceptor8_test: Crash # unsupported element kind: a:field
+interceptor9_test: Crash # (throw e): Unhandled node
+interceptor_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+interface_constants_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+interface_static_method_negative_test: Crash # (new A()): Error expression `new A()` unhandled.
+interface_static_non_final_fields_negative_test: Crash # Error expression `InterfaceStaticNonFinalFieldsNegativeTest` unhandled.
+internal_library_test/01: Crash # (JS('int','0')): handleStaticFunctionInvoke: foreign: function(JS)
+internal_library_test/02: Crash # (JS('int','0')): Error expression `JS('int','0')` unhandled.
+intrinsified_methods_test: Crash # (throw new ExpectException(message)): Unhandled node
+int_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+invocation_mirror2_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+invocation_mirror_invoke_on2_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+invocation_mirror_invoke_on_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+invocation_mirror_test: Crash # cannot compile methods that need interceptor calling convention.
+is_function_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+is_interfaces2_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+is_interfaces_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+is_malformed_type_test/94: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+is_malformed_type_test/95: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+is_malformed_type_test/96: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+is_malformed_type_test/97: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+is_malformed_type_test/98: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+is_malformed_type_test/99: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+is_nan_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+is_not_class1_negative_test: Crash # Error expression `IsNotClass1NegativeTest.testMain()` unhandled.
+is_not_class2_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+is_not_class4_negative_test: Crash # Error expression `IsNotClass4NegativeTest.testMain()` unhandled.
+isnot_malformed_type_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+is_object_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+is_operator_clash_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+is_operator_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+issue10204_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+issue10321_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+issue10561_test: Crash # (throw new ExpectException(message)): Unhandled node
+issue10581_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+issue10721_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+issue10747_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+issue10783_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+issue11724_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+issue11793_test: Crash # unsupported element kind: otherArray:field
+issue12023_test: Crash # Unhandled node
+issue12284_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+issue12336_test: Crash # (throw new ExpectException(message)): Unhandled node
+issue13179_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+issue13474_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+issue1363_test: Crash # (try {contents=libCup.getContents();}on TypeError catch (e){hasThrown=true;}): "on T" catch block
+issue13673_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+issue14014_3_test: Crash # (throw 'Test failed'): Unhandled node
+issue15606_test/01: Crash # (Unresolved): Error expression `Unresolved` unhandled.
+issue_1751477_test: Crash # handleStaticGetterInvoke: foreign: function(loadLibrary)
+issue20476_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+issue21159_test: Crash # (try {foo();}on StackOverflowError catch (e){exceptionCaught=true;}): "on T" catch block
+issue4515170_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+issue7513_test: Crash # (throw new ExpectException(message)): Unhandled node
+issue7525_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+issue9687_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+issue9939_test: Crash # (throw e): Unhandled node
+issue9949_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+js_properties_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+label8_negative_test: Crash # (Label8NegativeTest.errorMethod()): Error expression `Label8NegativeTest.errorMethod()` unhandled.
+label_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+large_class_declaration_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+large_implicit_getter_test: Crash # unsupported element kind: panels:field
+lazy_map_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+lazy_static2_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+lazy_static3_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+lazy_static4_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+lazy_static5_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+lazy_static6_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+lazy_static_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+left_shift_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+library1_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+library5_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+library_ambiguous_test/04: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+library_juxtaposition_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+library_negative_test: Crash # (LibraryNegativeTest.testMain(args)): handleStaticFunctionIncompatibleInvoke
+library_prefixes_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+library_private_in_constructor_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+library_same_name_used_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+licm2_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+licm3_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+licm_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+list_double_index_in_loop2_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+list_double_index_in_loop_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+list_in_closure_test: Crash # (throw new ExpectException(message)): Unhandled node
+list_is_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+list_length_tracer_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+list_literal2_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+list_literal3_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+list_literal4_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+list_literal_negative_test: Crash # Error expression `ListLiteralNegativeTest.testMain()` unhandled.
+list_literal_syntax_test/01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+list_literal_syntax_test/02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+list_literal_syntax_test/03: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+list_literal_syntax_test/none: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+list_literal_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+list_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+list_tracer_in_map_test: Crash # (throw 'Test failed'): Unhandled node
+list_tracer_return_from_tearoff_closure_test: Crash # (throw 'Test failed'): Unhandled node
+liveness_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+load_indexed_constant_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+local_export_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+local_function2_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+local_function3_test: Crash # (try {f.xyz(0);}on NoSuchMethodError catch (e){exception_caught=true;}): "on T" catch block
+local_function_non_equal_test: Crash # (throw new ExpectException(message)): Unhandled node
+local_function_test: Crash # (try {f(1,2);}on NoSuchMethodError catch (e){exception_caught=true;}): "on T" catch block
+logical_expression2_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+logical_expression3_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+logical_expression4_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+logical_expression5_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+logical_expression_test: Crash # (throw new ExpectException(message)): Unhandled node
+loop_exchange2_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+loop_exchange3_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+loop_exchange4_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+loop_exchange_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+loop_hoist_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+malbounded_type_cast2_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+malbounded_type_cast_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+malbounded_type_literal_test: Crash # (throw new ExpectException(message)): Unhandled node
+malbounded_type_test2_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+malbounded_type_test_test/01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+malbounded_type_test_test/02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+malbounded_type_test_test/03: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+malbounded_type_test_test/04: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+malformed2_test/00: Crash # (throw 'Test failed.'): Unhandled node
+malformed_inheritance_test/02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+malformed_inheritance_test/03: Crash # Please triage this failure.
+malformed_inheritance_test/04: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+malformed_inheritance_test/06: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+malformed_inheritance_test/09: Crash # Please triage this failure.
+malformed_inheritance_test/10: Crash # Please triage this failure.
+malformed_test/06: Crash # "on T" catch block
+malformed_test/none: Crash # "on T" catch block
+malformed_type_test: Crash # unsupported element kind: x:field
+many_calls_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+many_generic_instanceof_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+many_named_arguments_test: Crash # (throw new ExpectException(message)): Unhandled node
+many_overridden_no_such_method_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+map_literal10_test: Crash # Please triage this failure.
+map_literal2_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+map_literal3_test: Crash # Please triage this failure.
+map_literal4_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+map_literal5_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+map_literal6_test: Crash # Please triage this failure.
+map_literal7_test: Crash # (throw new ExpectException(message)): Unhandled node
+map_literal8_test: Crash # (throw new ExpectException(message)): Unhandled node
+map_literal9_test: Crash # Please triage this failure.
+map_literal_negative_test: Crash # (MapLiteralNegativeTest.testMain()): Error expression `MapLiteralNegativeTest.testMain()` unhandled.
+map_literal_syntax_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+map_literal_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+map_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+mega_load_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+megamorphic_no_such_method_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+method_binding_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+method_invocation_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+method_name_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+method_override3_test/00: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+method_override3_test/01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+method_override3_test/02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+method_override3_test/none: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+method_override4_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+method_override5_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+method_override6_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+method_override7_test/03: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+method_override7_test/none: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+method_override8_test/02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+method_override8_test/03: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+method_override8_test/none: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+method_override_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+methods_as_constants2_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+methods_as_constants_test: Crash # Please triage this failure.
+minify_closure_variable_collision_test: Crash # (throw 'Test failed'): Unhandled node
+mint_arithmetic_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+mint_compares_test: Crash # (throw new ExpectException(message)): Unhandled node
+mixin_black_listed_test/01: Crash # (throw new ExpectException(message)): Unhandled node
+mixin_black_listed_test/02: Crash # (throw new ExpectException(message)): Unhandled node
+mixin_black_listed_test/05: Crash # (throw new ExpectException(message)): Unhandled node
+mixin_black_listed_test/06: Crash # (throw new ExpectException(message)): Unhandled node
+mixin_black_listed_test/07: Crash # (throw new ExpectException(message)): Unhandled node
+mixin_black_listed_test/08: Crash # (new F2()): Error expression `new F2()` unhandled.
+mixin_black_listed_test/none: Crash # (throw new ExpectException(message)): Unhandled node
+mixin_bound_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+mixin_cyclic_test/01: Crash # Please triage this failure.
+mixin_extends_field_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+mixin_extends_is_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+mixin_extends_method_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+mixin_field_initializer_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+mixin_field_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+mixin_forwarding_constructor1_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+mixin_forwarding_constructor2_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+mixin_forwarding_constructor3_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+mixin_generic_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+mixin_getter_regression_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+mixin_illegal_constructor_test/13: MissingRuntimeError # Please triage this failure.
+mixin_illegal_constructor_test/14: Crash # (new C0.named()): Error expression `new C0.named()` unhandled.
+mixin_illegal_constructor_test/15: MissingRuntimeError # Please triage this failure.
+mixin_illegal_constructor_test/16: Crash # (new D0.named()): Error expression `new D0.named()` unhandled.
+mixin_illegal_cycles_test/02: Crash # Please triage this failure.
+mixin_illegal_cycles_test/03: Crash # Please triage this failure.
+mixin_illegal_cycles_test/04: Crash # Please triage this failure.
+mixin_illegal_cycles_test/06: Crash # Please triage this failure.
+mixin_illegal_static_access_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+mixin_illegal_super_use_test/01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+mixin_illegal_super_use_test/02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+mixin_illegal_super_use_test/03: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+mixin_illegal_super_use_test/04: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+mixin_illegal_super_use_test/05: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+mixin_illegal_super_use_test/06: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+mixin_illegal_super_use_test/07: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+mixin_illegal_super_use_test/08: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+mixin_illegal_super_use_test/09: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+mixin_illegal_super_use_test/10: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+mixin_illegal_super_use_test/11: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+mixin_illegal_super_use_test/none: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+mixin_illegal_syntax_test/13: Crash # (new T0()): Error expression `new T0()` unhandled.
+mixin_implements_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+mixin_invalid_inheritance1_test/01: Crash # Please triage this failure.
+mixin_invalid_inheritance1_test/02: Crash # Please triage this failure.
+mixin_invalid_inheritance1_test/03: Crash # Please triage this failure.
+mixin_invalid_inheritance2_test/01: Crash # (new C<C>()): Error expression `new C<C>()` unhandled.
+mixin_invalid_inheritance2_test/02: Crash # (new C<C>()): Error expression `new C<C>()` unhandled.
+mixin_invalid_inheritance2_test/03: Crash # (new C<C>()): Error expression `new C<C>()` unhandled.
+mixin_issue10216_2_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+mixin_issue10216_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+mixin_is_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+mixin_lib_extends_field_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+mixin_lib_extends_method_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+mixin_method_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+mixin_mixin2_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+mixin_mixin3_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+mixin_mixin4_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+mixin_mixin5_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+mixin_mixin6_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+mixin_mixin7_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+mixin_mixin_bound2_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+mixin_mixin_bound_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+mixin_mixin_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+mixin_naming_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+mixin_only_for_rti_test: Crash # (throw new ExpectException(message)): Unhandled node
+mixin_override_regression_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+mixin_prefix_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+mixin_regress_11398_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+mixin_regress_13688_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+mixin_super_constructor2_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+mixin_super_constructor_default_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+mixin_super_constructor_multiple_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+mixin_super_constructor_named_test/01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+mixin_super_constructor_named_test/none: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+mixin_super_constructor_positionals_test/01: Crash # Please triage this failure.
+mixin_super_constructor_positionals_test/none: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+mixin_super_constructor_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+mixin_this_use_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+mixin_typedef_constructor_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+mixin_type_parameter1_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+mixin_type_parameter2_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+mixin_type_parameter3_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+mixin_type_parameter4_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+mixin_type_parameters_mixin_extends_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+mixin_type_parameters_mixin_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+mixin_type_parameters_simple_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+mixin_type_parameters_super_extends_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+mixin_type_parameters_super_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+mixin_with_two_implicit_constructors_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+modulo_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+mul_recipr_test: Crash # (throw new ExpectException(message)): Unhandled node
+multi_assign_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+multiline_strings_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+multi_pass2_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+multi_pass_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+multiple_field_assignment_constructor_test: Crash # unsupported element kind: a:field
+named_argument_in_const_creation_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+named_argument_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+named_constructor_test/01: Crash # (new Class.named<int>()): Error expression `new Class.named<int>()` unhandled.
+named_constructor_test/03: Crash # (new prefix<int>.Class()): Error expression `new prefix<int>.Class()` unhandled.
+named_constructor_test/none: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+named_parameter_clash_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+named_parameters2_test: Crash # (try {test(10,25,b:26);}on NoSuchMethodError catch (e){foundError=true;}): "on T" catch block
+named_parameters3_test: Crash # (try {test(10,x:99);}on NoSuchMethodError catch (e){foundError=true;}): "on T" catch block
+named_parameters4_test: Crash # (try {test(10,x:99);}on NoSuchMethodError catch (e){foundError=true;}): "on T" catch block
+named_parameters_aggregated_test/02: Crash # Error expression `NamedParametersAggregatedTests.f_missing_comma(10,25)` unhandled.
+named_parameters_aggregated_test/05: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+named_parameters_named_count_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+named_parameters_passing_false_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+named_parameters_passing_falsy_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+named_parameters_passing_null_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+named_parameters_passing_zero_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+named_parameters_test/01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+named_parameters_test/02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+named_parameters_test/03: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+named_parameters_test/04: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+named_parameters_test/05: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+named_parameters_test/06: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+named_parameters_test/07: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+named_parameters_test/08: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+named_parameters_test/09: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+named_parameters_test/10: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+named_parameters_test/none: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+named_parameters_with_conversions_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+named_parameters_with_dollars_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+named_parameters_with_object_property_names_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+namer2_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+namer_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+naming2_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+naming3_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+naming_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+native_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+nested_comments_test: Crash # (throw new ExpectException(message)): Unhandled node
+nested_if_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+nested_switch_label_test: Crash # Unhandled node
+new_expression1_negative_test: Crash # (NewExpression1NegativeTest): Error expression `NewExpression1NegativeTest` unhandled.
+new_expression2_negative_test: Crash # (NewExpression2NegativeTest): Error expression `NewExpression2NegativeTest` unhandled.
+new_expression3_negative_test: Crash # (NewExpression3NegativeTest): Error expression `NewExpression3NegativeTest` unhandled.
+new_prefix_test/01: Crash # (new prefix()): Error expression `new prefix()` unhandled.
+new_statement_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+non_const_constructor_without_body_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+non_const_super_negative_test: Crash # Please triage this failure.
+non_dominating_loop_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+no_such_constructor2_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+no_such_constructor_test/01: MissingRuntimeError # Please triage this failure.
+no_such_method2_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+no_such_method3_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+no_such_method_dispatcher_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+no_such_method_empty_selector_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+no_such_method_subtype_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+no_such_method_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+not_enough_positional_arguments_test/00: MissingRuntimeError # Please triage this failure.
+not_enough_positional_arguments_test/03: Crash # Please triage this failure.
+not_enough_positional_arguments_test/06: Crash # (foo(b:1)): handleStaticFunctionIncompatibleInvoke
+not_enough_positional_arguments_test/06: MissingRuntimeError # Please triage this failure.
+not_enough_positional_arguments_test/07: Crash # Please triage this failure.
+null2_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+null_access_error_test: Crash # "on T" catch block
+null_inline_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+null_is2_test: Crash # (throw new ExpectException(message)): Unhandled node
+null_is_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+null_method_test: Crash # (throw new ExpectException(message)): Unhandled node
+null_no_such_method_test: Crash # unsupported element kind: array:field
+null_test/01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+null_test/02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+null_test/03: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+null_test/none: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+null_to_string2_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+null_to_string_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+number_constant_folding1_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+number_identifier_test/05: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+number_identifier_test/08: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+number_identifier_test/09: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+number_identifier_test/none: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+number_identity2_test: Crash # (throw new ExpectException(message)): Unhandled node
+number_identity_test: Crash # (throw new ExpectException(message)): Unhandled node
+numbers_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+number_syntax_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+on_catch_malformed_type_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+operator2_negative_test: Crash # (new Helper(10)): Error expression `new Helper(10)` unhandled.
+operator2_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+operator3_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+operator4_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+operator5_test: Crash # (try {Expect.equals(42,a>=a);}on TypeError catch (e){}): "on T" catch block
+operator6_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+operator_equals_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+operator_index_evaluation_order_test: Crash # (throw new ExpectException(message)): Unhandled node
+operator_negate_and_method_negate_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+operator_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+optimized_constant_array_string_access_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+optimized_hoisting_checked_mode_assert_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+optimized_isempty_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+optimized_lists_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+optimized_setter_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+optimized_string_charat_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+optimized_string_charcodeat_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+optimize_redundant_array_load_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+optional_named_parameters_test/01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+optional_named_parameters_test/02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+optional_named_parameters_test/03: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+optional_named_parameters_test/04: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+optional_named_parameters_test/05: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+optional_named_parameters_test/06: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+optional_named_parameters_test/07: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+optional_named_parameters_test/08: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+optional_named_parameters_test/09: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+optional_named_parameters_test/none: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+ordered_maps_test: Crash # Please triage this failure.
+osr_test: Crash # (throw "No progress made"): Unhandled node
+overridden_no_such_method_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+override_inheritance_no_such_method_test/03: Crash # cannot compile methods that need interceptor calling convention.
+override_inheritance_no_such_method_test/04: Crash # cannot compile methods that need interceptor calling convention.
+override_inheritance_no_such_method_test/08: Crash # cannot compile methods that need interceptor calling convention.
+override_inheritance_no_such_method_test/11: Crash # cannot compile methods that need interceptor calling convention.
+override_inheritance_no_such_method_test/13: Crash # cannot compile methods that need interceptor calling convention.
+override_method_with_field_test/02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+override_method_with_field_test/none: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+param2_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+parameter_initializer2_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+parameter_initializer4_negative_test: Crash # Please triage this failure.
+parameter_initializer6_negative_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+parameter_initializer_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+parameter_name_conflict_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+parameter_types_specialization_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+param_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+parse_closures_in_initializers_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+parser_quirks_test: Crash # handleStaticFunctionGet: function(f)
+parse_types_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+partial_min_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+patch_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+phi_merge_test: Crash # (switch (value){case 42:break;case 43:break;}): Unhandled node
+positive_bit_operations_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+prefix101_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+prefix10_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+prefix11_negative_test: Crash # (new lib12.Library11(1)): Error expression `new lib12.Library11(1)` unhandled.
+prefix11_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+prefix12_negative_test: Crash # (lib12.top_level11): Error expression `lib12.top_level11` unhandled.
+prefix12_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+prefix14_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+prefix15_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+prefix16_test: Crash # (try {myFunc i=0;}on TypeError catch (error){got_type_error=true;}): "on T" catch block
+prefix1_negative_test: Crash # (library1): Error expression `library1` unhandled.
+prefix21_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+prefix24_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+prefix2_negative_test: Crash # (lib2.Library2): Error expression `lib2.Library2` unhandled.
+prefix3_negative_test: Crash # (lib2.foo=1): Error expression `lib2.foo=1` unhandled.
+prefix4_negative_test: Crash # (new lib11.Library11(1)): Error expression `new lib11.Library11(1)` unhandled.
+prefix5_negative_test: Crash # (lib11): Error expression `lib11` unhandled.
+prefix_new_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+prefix_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+private3_test: Crash # Please triage this failure.
+private4_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+private_access_test/01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+private_access_test/02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+private_access_test/03: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+private_access_test/04: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+private_access_test/05: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+private_access_test/06: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+private_clash_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+private_mixin2_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+private_selector_test: Crash # (throw new ExpectException(message)): Unhandled node
+private_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+propagated_argument_type_check_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+propagate_past_constant_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+property_field_override_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+pure_function2_test: Crash # (throw new ExpectException(message)): Unhandled node
+pure_function_test: Crash # (throw new ExpectException(message)): Unhandled node
+range_analysis2_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+range_analysis3_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+range_analysis_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+raw_string_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+recursive_calls_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+recursive_loop_phis_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+redirecting_factory_default_values_test/01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+redirecting_factory_default_values_test/02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+redirecting_factory_default_values_test/none: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+redirecting_factory_incompatible_signature_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+redirecting_factory_long_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+reexport_core_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+ref_before_declaration_test/00: Crash # (throw "ball"): Unhandled node
+ref_before_declaration_test/01: Crash # (throw "ball"): Unhandled node
+ref_before_declaration_test/02: Crash # (throw "ball"): Unhandled node
+ref_before_declaration_test/03: Crash # (throw "ball"): Unhandled node
+ref_before_declaration_test/04: Crash # (throw "ball"): Unhandled node
+ref_before_declaration_test/05: Crash # (throw "ball"): Unhandled node
+ref_before_declaration_test/06: Crash # (throw "ball"): Unhandled node
+ref_before_declaration_test/07: Crash # (throw "ball"): Unhandled node
+ref_before_declaration_test/none: Crash # (throw "ball"): Unhandled node
+refine_receiver_null_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+reg_exp2_test: Crash # (throw new ExpectException(message)): Unhandled node
+reg_exp3_test: Crash # (try {RegExp exp=new RegExp("[");i=100;}on FormatException catch (e){i=0;}): "on T" catch block
+reg_exp_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+regress_10996_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+regress_11010_test: Crash # (throw 'unexpected result'): Unhandled node
+regress_11800_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+regress_12561_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+regress_13494_test: Crash # (A.unknown=p(2)): Error expression `A.unknown=p(2)` unhandled.
+regress_14105_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+regress_17382_test: Crash # (tl(m(0))): Error expression `tl(m(0))` unhandled.
+regress_18435_test: Crash # Please triage this failure.
+regress_18535_test: Crash # cannot compile methods that need interceptor calling convention.
+regress_19413_test/01: Crash # (foo.f()): Error expression `foo.f()` unhandled.
+regress_21016_test: Crash # unsupported element kind: list:field
+regress_21793_test/01: Crash # (new A()(499)): Error expression `new A()(499)` unhandled.
+regress_21795_test: Crash # (throw "Expected foo in stacktrace!"): Unhandled node
+regress_21998_1_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+regress_21998_2_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+regress_21998_3_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+regress_21998_4_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+regress_22438_test: Crash # cannot handle async/sync*/async* functions
+regress_22443_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+regress_22445_test: Crash # cannot handle async/sync*/async* functions
+regress_22579_test: Crash # cannot handle async/sync*/async* functions
+regress_22700_test: Crash # Please triage this failure.
+regress_22719_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+regress_22728_test: Crash # cannot handle async/sync*/async* functions
+regress_22777_test: Crash # (throw _buildException('asyncEnd() was called before asyncStart().')): Unhandled node
+regress_22822_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+regress_22858_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+regress_22936_test/01: Crash # (try {x=foo();}on NoSuchMethodError {}): "on T" catch block
+regress_22936_test/none: Crash # (try {foo();}on NoSuchMethodError {}): "on T" catch block
+regress_23046_test: Crash # Please triage this failure.
+regress_r24720_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+reify_typevar_static_test/00: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+reify_typevar_static_test/01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+reify_typevar_static_test/02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+reify_typevar_static_test/03: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+reify_typevar_static_test/none: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+reify_typevar_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+resolution_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+resolve_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+rethrow_test: Crash # "on T" catch block
+return_in_loop_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+return_this_type_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+return_type_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+rewrite_assign_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+rewrite_compound_assign_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+rewrite_conditional_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+rewrite_for_update_order_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+rewrite_if_empty_then_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+rewrite_if_return_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+rewrite_if_swap_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+rewrite_implicit_this_test/01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+rewrite_logical_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+rewrite_nested_if1_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+rewrite_nested_if2_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+rewrite_nested_if3_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+rewrite_swap_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+rewrite_variable_initializer_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+rewrite_while_many_exits_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+rewrite_while_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+round_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+runtime_type_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+savannah_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+scoped_variables_try_catch_test: Crash # Please triage this failure.
+scope_variable_test/01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+scope_variable_test/none: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+second_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+setter0_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+setter1_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+setter2_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+setter_no_getter_call_test/01: Crash # (topLevel(3)): Error expression `topLevel(3)` unhandled.
+setter_no_getter_call_test/none: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+setter_no_getter_test/01: Crash # (topLevel++ ): Error expression `topLevel++ ` unhandled.
+setter_override2_test/00: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+setter_override2_test/01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+setter_override2_test/02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+setter_override2_test/03: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+setter_override2_test/none: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+setter_override_test/01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+setter_override_test/02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+setter_override_test/none: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+side_effect_throw_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+skip_expression_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+smaller_4_Interface_Types_A11_t01_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+smaller_4_Interface_Types_A11_t02_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+smi_type_test: Crash # (throw new ExpectException(message)): Unhandled node
+stack_overflow_stacktrace_test: Crash # "on T" catch block
+stack_overflow_test: Crash # "on T" catch block
+stacktrace_rethrow_error_test/none: Crash # (throw "Expected: ${expected} actual: ${actual}"): Unhandled node
+stacktrace_rethrow_error_test/withtraceparameter: Crash # (throw "Expected: ${expected} actual: ${actual}"): Unhandled node
+stacktrace_rethrow_nonerror_test: Crash # (throw "Expected: ${expected} actual: ${actual}"): Unhandled node
+stacktrace_test: Crash # "on T" catch block
+stack_trace_test: Crash # (throw new ExpectException(message)): Unhandled node
+state_mangling2_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+state_mangling3_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+state_mangling4_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+state_mangling_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+statement_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+static_call_wrong_argument_count_negative_test: Crash # (Niesen.goodCall(1,2,3,4)): handleStaticFunctionIncompatibleInvoke
+static_call_wrong_argument_count_negative_test: Fail # Please triage this failure.
+static_closure_identical_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+static_const_field_test: Crash # Please triage this failure.
+static_field3_test/01: Crash # (Foo.x): Error expression `Foo.x` unhandled.
+static_field3_test/02: Crash # (Foo.m): Error expression `Foo.m` unhandled.
+static_field3_test/03: Crash # (Foo.m=1): Error expression `Foo.m=1` unhandled.
+static_field3_test/04: Crash # (Foo.x=1): Error expression `Foo.x=1` unhandled.
+static_field_test/01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+static_field_test/02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+static_field_test/03: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+static_field_test/04: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+static_field_test/none: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+static_final_field2_test/01: Crash # (A.x=2): Error expression `A.x=2` unhandled.
+static_implicit_closure_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+static_initializer_type_error_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+static_inline_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+static_postfix_operator_test: Crash # (throw new ExpectException(message)): Unhandled node
+strict_equal_test: Crash # (throw new ExpectException(message)): Unhandled node
+string_charcode_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+string_escapes_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+string_interpolate2_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+string_interpolate_null_test: Crash # (try {s="Hello Mr. ${a.name}";}on NoSuchMethodError catch (e){return;}): "on T" catch block
+string_interpolate_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+string_interpolation1_negative_test: Crash # Error expression `StringInterpolation1NegativeTest.testMain()` unhandled.
+string_interpolation2_negative_test: Crash # Error expression `StringInterpolation2NegativeTest.testMain()` unhandled.
+string_interpolation4_negative_test: Crash # Error expression `StringInterpolation4NegativeTest.testMain()` unhandled.
+string_interpolation5_negative_test: Crash # Error expression `StringInterpolation5NegativeTest.testMain()` unhandled.
+string_interpolation6_negative_test: Crash # Error expression `StringInterpolation6NegativeTest.testMain()` unhandled.
+string_interpolation7_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+string_interpolation8_test: Crash # (throw new ExpectException(message)): Unhandled node
+string_interpolation_test/01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+string_interpolation_test/none: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+string_intrinsics_test: Crash # (throw new ExpectException(message)): Unhandled node
+string_join_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+string_optimizations_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+string_supertype_checked_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+string_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+substring_test/01: Crash # "on T" catch block
+substring_test/none: Crash # (try {}on TypeError catch (e){}on ArgumentError catch (e){}): "on T" catch block
+super_abstract_method_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+super_all_named_constructor_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+super_assign_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+super_bound_closure_test/01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+super_bound_closure_test/none: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+super_call3_test/01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+super_call3_test/02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+super_call3_test/none: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+super_call4_test: Crash # (throw new ExpectException(message)): Unhandled node
+super_call_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+super_closure_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+super_field_2_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+super_field_access_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+super_field_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+super_first_constructor_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+super_getter_setter_test: Crash # cannot compile methods that need interceptor calling convention.
+super_implicit_closure_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+super_inferrer_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+super_operator_index2_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+super_operator_index3_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+super_operator_index4_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+super_operator_index5_test: Crash # cannot compile methods that need interceptor calling convention.
+super_operator_index6_test: Crash # cannot compile methods that need interceptor calling convention.
+super_operator_index7_test: Crash # cannot compile methods that need interceptor calling convention.
+super_operator_index8_test: Crash # cannot compile methods that need interceptor calling convention.
+super_operator_index_test/01: Crash # cannot compile methods that need interceptor calling convention.
+super_operator_index_test/02: Crash # cannot compile methods that need interceptor calling convention.
+super_operator_index_test/03: Crash # (super[4]=42): Error expression `super[4]=42` unhandled.
+super_operator_index_test/04: Crash # (super[4]+=5): Error expression `super[4]+=5` unhandled.
+super_operator_index_test/05: Crash # (super[4]=42): Error expression `super[4]=42` unhandled.
+super_operator_index_test/06: Crash # (super[4]+=5): Error expression `super[4]+=5` unhandled.
+super_operator_index_test/07: Crash # (super[2]): Error expression `super[2]` unhandled.
+super_operator_index_test/none: Crash # cannot compile methods that need interceptor calling convention.
+super_operator_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+super_setter_interceptor_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+super_setter_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+super_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+switch6_test: Crash # (switch (a){case 0:{x=0;break;}case 1:x=1;break;}): Unhandled node
+switch8_test: Crash # (switch (new List(1)[0]){case const A():throw 'Test failed';}): Unhandled node
+switch_bad_case_test/01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+switch_bad_case_test/02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+switch_bad_case_test/none: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+switch_case_static_const_test: Crash # (switch (p){case S:break;case A.S:break;case 'abc':break;}): Unhandled node
+switch_case_test/none: Crash # (switch (new B()){}): Unhandled node
+switch_fallthru_test: Crash # (try {test(1);}on FallThroughError catch (e){fallthroughCaught=true;}): "on T" catch block
+switch_label2_test: Crash # Unhandled node
+switch_label_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+switch_scope_test: Crash # Unhandled node
+switch_test: Crash # (switch (input){case true:result=12;break;case false:result=22;}): Unhandled node
+switch_try_catch_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+sync_generator1_test/01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+sync_generator1_test/none: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+sync_generator2_test/01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+sync_generator2_test/02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+sync_generator2_test/03: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+sync_generator2_test/04: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+sync_generator2_test/05: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+sync_generator2_test/06: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+sync_generator2_test/07: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+sync_generator2_test/08: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+sync_generator2_test/09: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+sync_generator2_test/10: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+sync_generator2_test/11: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+sync_generator2_test/20: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+sync_generator2_test/30: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+sync_generator2_test/40: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+sync_generator2_test/41: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+sync_generator2_test/50: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+sync_generator2_test/51: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+sync_generator2_test/52: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+sync_generator2_test/none: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+sync_generator3_test/test1: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+sync_generator3_test/test2: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+syncstar_yieldstar_test: Crash # cannot handle async/sync*/async* functions
+syncstar_yield_test/copyParameters: Crash # (throw new ExpectException(message)): Unhandled node
+syncstar_yield_test/none: Crash # (throw new ExpectException(message)): Unhandled node
+temp_mangling_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+ternary_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+test_negative_test: Crash # (TestNegativeTest): Error expression `TestNegativeTest` unhandled.
+third_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+throw1_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+throw2_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+throw3_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+throw4_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+throw5_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+throw6_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+throw8_test: Crash # (throw new ExpectException(message)): Unhandled node
+throw_expr_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+throwing_lazy_variable_test: Crash # (throw 'Test failed'): Unhandled node
+throw_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+top_level_func_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+top_level_getter_arrow_syntax_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+top_level_in_initializer_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+top_level_method_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+top_level_multiple_files_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+top_level_non_prefixed_library_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+top_level_prefixed_declaration_test: Crash # (throw new ExpectException(message)): Unhandled node
+top_level_var_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+transitive_private_library_access_test: Crash # (ClassID): Error expression `ClassID` unhandled.
+tree_shake_typed_selector_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+truncdiv_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+truncdiv_uint32_test: Crash # (throw 'Test failed'): Unhandled node
+try_catch2_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+try_catch3_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+try_catch4_test: Crash # (throw new ExpectException(message)): Unhandled node
+try_catch5_test: Crash # (throw new ExpectException(message)): Unhandled node
+try_catch_on_syntax_test/02: Crash # (test1()): Error expression `test1()` unhandled.
+try_catch_on_syntax_test/03: Crash # (test1()): Error expression `test1()` unhandled.
+try_catch_on_syntax_test/04: Crash # (test1()): Error expression `test1()` unhandled.
+try_catch_on_syntax_test/05: Crash # (test1()): Error expression `test1()` unhandled.
+try_catch_on_syntax_test/06: Crash # (test1()): Error expression `test1()` unhandled.
+try_catch_on_syntax_test/07: Crash # (throw "catch this!"): Unhandled node
+try_catch_on_syntax_test/10: Crash # (throw "catch this!"): Unhandled node
+try_catch_on_syntax_test/11: Crash # (throw "catch this!"): Unhandled node
+try_catch_on_syntax_test/none: Crash # (throw "catch this!"): Unhandled node
+try_catch_optimized1_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+try_catch_optimized2_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+try_catch_optimized3_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+try_catch_optimized4_test: Crash # (try {String res=m.maythrow(i);failed=true;}on MyError catch (e){}): "on T" catch block
+try_catch_osr_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+try_catch_syntax_test/02: Crash # (testMissingTry()): Error expression `testMissingTry()` unhandled.
+try_catch_syntax_test/03: Crash # (testMissingTry()): Error expression `testMissingTry()` unhandled.
+try_catch_syntax_test/04: Crash # (testMissingTry()): Error expression `testMissingTry()` unhandled.
+try_catch_syntax_test/06: Crash # (testIllegalFinally()): Error expression `testIllegalFinally()` unhandled.
+try_catch_syntax_test/08: Crash # (try {}on MammaMia catch (e){}): "on T" catch block
+try_catch_test/01: Crash # "on T" catch block
+try_catch_test/none: Crash # (throw "up"): Unhandled node
+type_argument_in_super_type_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+type_argument_substitution_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+type_check_const_function_typedef2_test/00: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+type_check_const_function_typedef2_test/none: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+type_check_const_function_typedef_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+type_checks_in_factory_method_test: Crash # "on T" catch block
+type_check_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+type_conversion_ssa_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+typedef_is_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+typed_equality_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+typed_message_test: Crash # (throw _buildException('asyncEnd() was called before asyncStart().')): Unhandled node
+typed_selector_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+type_error_test: Crash # "on T" catch block
+type_guard_conversion_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+type_intersection_test: Crash # (throw new ExpectException(message)): Unhandled node
+type_literal_prefix_call_test/00: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+type_parameter_literal_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+type_parameter_test/01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+type_parameter_test/02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+type_parameter_test/03: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+type_parameter_test/04: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+type_parameter_test/05: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+type_parameter_test/06: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+type_parameter_test/none: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+type_promotion_closure_test/01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+type_promotion_closure_test/02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+type_promotion_closure_test/03: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+type_promotion_closure_test/04: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+type_promotion_closure_test/05: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+type_promotion_closure_test/06: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+type_promotion_closure_test/07: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+type_promotion_closure_test/08: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+type_promotion_closure_test/09: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+type_promotion_closure_test/10: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+type_promotion_closure_test/11: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+type_promotion_closure_test/12: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+type_promotion_closure_test/13: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+type_promotion_closure_test/14: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+type_promotion_closure_test/15: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+type_promotion_closure_test/16: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+type_promotion_closure_test/none: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+type_promotion_functions_test/01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+type_promotion_functions_test/02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+type_promotion_functions_test/03: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+type_promotion_functions_test/04: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+type_promotion_functions_test/05: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+type_promotion_functions_test/06: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+type_promotion_functions_test/07: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+type_promotion_functions_test/08: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+type_promotion_functions_test/09: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+type_promotion_functions_test/10: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+type_promotion_functions_test/11: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+type_promotion_functions_test/12: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+type_promotion_functions_test/13: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+type_promotion_functions_test/14: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+type_promotion_functions_test/none: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+type_promotion_more_specific_test/01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+type_promotion_more_specific_test/02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+type_promotion_more_specific_test/03: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+type_promotion_more_specific_test/04: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+type_promotion_more_specific_test/05: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+type_promotion_more_specific_test/06: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+type_promotion_more_specific_test/07: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+type_promotion_more_specific_test/08: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+type_promotion_more_specific_test/09: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+type_promotion_more_specific_test/10: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+type_promotion_more_specific_test/11: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+type_promotion_more_specific_test/12: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+type_promotion_more_specific_test/13: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+type_promotion_more_specific_test/none: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+type_propagation2_test: Crash # cannot compile methods that need interceptor calling convention.
+type_propagation3_test: Crash # (throw 'Test failed'): Unhandled node
+type_propagation_assert_assignable_test: Crash # (throw new ExpectException(message)): Unhandled node
+type_propagation_in_for_update_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+type_propagation_phi_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+type_propagation_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+type_variable_bounds2_test/00: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+type_variable_bounds2_test/01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+type_variable_bounds2_test/02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+type_variable_bounds2_test/03: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+type_variable_bounds2_test/04: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+type_variable_bounds2_test/05: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+type_variable_bounds2_test/06: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+type_variable_bounds2_test/none: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+type_variable_bounds3_test/00: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+type_variable_bounds4_test/01: Crash # "on T" catch block
+type_variable_bounds4_test/none: Crash # "on T" catch block
+type_variable_closure2_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+type_variable_closure_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+type_variable_conflict2_test/01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+type_variable_conflict2_test/03: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+type_variable_conflict2_test/04: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+type_variable_conflict2_test/05: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+type_variable_conflict2_test/07: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+type_variable_conflict2_test/09: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+type_variable_field_initializer_closure_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+type_variable_field_initializer_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+type_variable_function_type_test: Crash # (throw new ExpectException(message)): Unhandled node
+type_variable_identifier_expression_test: Crash # (try {var buf=new B<A>().doFunc();print(buf);}on NoSuchMethodError catch (e){}): "on T" catch block
+type_variable_initializer_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+type_variable_nested_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+type_variable_scope2_test: Crash # "on T" catch block
+typevariable_substitution2_test/01: Crash # Please triage this failure.
+typevariable_substitution2_test/02: Crash # "on T" catch block
+typevariable_substitution2_test/none: Crash # Please triage this failure.
+type_variable_typedef_test: Crash # (throw new ExpectException(message)): Unhandled node
+unary2_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+unary_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+unicode_bom_middle_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+unicode_hash_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+unnamed_closure_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+unqual_name_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+unresolved_default_constructor_test/01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+unresolved_in_factory_negative_test: Crash # (foo()): Error expression `foo()` unhandled.
+unresolved_top_level_method_negative_test: Crash # unsupported element kind: a:field
+unresolved_top_level_var_negative_test: Crash # unsupported element kind: a:field
+value_range2_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+value_range3_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+value_range_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+variable_declaration_metadata_test/06: Crash # (new C()): Error expression `new C()` unhandled.
+variable_declaration_metadata_test/08: Crash # (new C()): Error expression `new C()` unhandled.
+var_init_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+void_type_test: Crash # (try {var x=func();}on TypeError catch (error){got_type_error=true;}): "on T" catch block
+while_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
diff --git a/tests/language/transitive_private_library_access_test.dart b/tests/language/transitive_private_library_access_test.dart
new file mode 100644
index 0000000..a6d9ce4
--- /dev/null
+++ b/tests/language/transitive_private_library_access_test.dart
@@ -0,0 +1,21 @@
+// Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+// Dart test program to check that we can resolve unqualified identifiers
+
+// Import 'dart:typed_data' which internally imports 'dart:_internal'.
+import 'dart:typed_data';
+
+import 'package:expect/expect.dart';
+
+main() {
+ bool exceptionCaught = false;
+ try {
+ // Attempt to access something in 'dart:_internal'.
+ return ClassID.GetID(4);
+ Expect.fail("Should have thrown an exception");
+ } catch (e) {
+ exceptionCaught = true;
+ }
+ Expect.isTrue(exceptionCaught);
+}
diff --git a/tests/language/try_catch3_test.dart b/tests/language/try_catch3_test.dart
index e485b61..09cf98b 100644
--- a/tests/language/try_catch3_test.dart
+++ b/tests/language/try_catch3_test.dart
@@ -69,7 +69,7 @@
j += 60;
} catch (e, trace) {
i = 700;
- trace.printStackTrace(e);
+ print(trace.toString());
print(e.getMessage());
}
try {
@@ -80,14 +80,14 @@
}
} on MyParameterizedException<String, TestException> catch (e, trace) {
i = 800;
- trace.printStackTrace(e);
+ print(trace.toString());
rethrow;
} on MyException catch (exception) {
i = 100;
print(exception.getMessage());
} on TestException catch (e, trace) {
i = 200;
- trace.printStackTrace(e);
+ print(trace.toString());
} finally {
i = 900;
}
diff --git a/tests/language/variable_declaration_metadata_test.dart b/tests/language/variable_declaration_metadata_test.dart
new file mode 100644
index 0000000..7e0a6bd
--- /dev/null
+++ b/tests/language/variable_declaration_metadata_test.dart
@@ -0,0 +1,86 @@
+// Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+// Verify that the individual variable declarations inside a variable
+// declaration list are not allowed to be annotated with metadata.
+
+const annotation = null;
+
+var
+ @annotation /// 01: compile-time error
+ v1,
+ @annotation /// 02: compile-time error
+ v2;
+
+int
+ @annotation /// 03: compile-time error
+ v3,
+ @annotation /// 04: compile-time error
+ v4;
+
+class C {
+ var
+ @annotation /// 05: compile-time error
+ f1,
+ @annotation /// 06: compile-time error
+ f2;
+
+ int
+ @annotation /// 07: compile-time error
+ f3,
+ @annotation /// 08: compile-time error
+ f4;
+}
+
+use(x) => x;
+
+main() {
+ use(v1);
+ use(v2);
+ use(v3);
+ use(v4);
+
+ C c = new C();
+ use(c.f1);
+ use(c.f2);
+ use(c.f3);
+ use(c.f4);
+
+ var
+ @annotation /// 09: compile-time error
+ l1,
+ @annotation /// 10: compile-time error
+ l2;
+
+ int
+ @annotation /// 11: compile-time error
+ l3,
+ @annotation /// 12: compile-time error
+ l4;
+
+ use(l1);
+ use(l2);
+ use(l3);
+ use(l4);
+
+ for (var
+ @annotation /// 13: compile-time error
+ i1 = 0,
+ @annotation /// 14: compile-time error
+ i2 = 0; ; ) {
+ use(i1);
+ use(i2);
+ break;
+ }
+
+ for (int
+ @annotation /// 15: compile-time error
+ i3 = 0,
+ @annotation /// 16: compile-time error
+ i4 = 0; ; ) {
+ use(i3);
+ use(i4);
+ break;
+ }
+}
diff --git a/tests/language/vm/debug_break_enabled_vm_test.dart b/tests/language/vm/debug_break_enabled_vm_test.dart
new file mode 100644
index 0000000..e9b3f05
--- /dev/null
+++ b/tests/language/vm/debug_break_enabled_vm_test.dart
@@ -0,0 +1,23 @@
+// Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+// VMOptions=--optimization-counter-threshold=5 --enable-debug-break
+
+// Verify that the optimizer does not trip over the debug break (StopInstr).
+
+test(i) {
+ if (i.isOdd) {
+ break "never_hit";
+ }
+ // "crash" is not an allowed outcome specifier.
+ // Use "ok" instead and mark the status file with "Crash, OK".
+ if (i == 18) {
+ break "hit"; /// 01: ok
+ }
+}
+
+void main() {
+ for (var i = 0; i < 20; i += 2) {
+ test(i);
+ }
+}
diff --git a/tests/language/vm/debug_break_vm_test.dart b/tests/language/vm/debug_break_vm_test.dart
new file mode 100644
index 0000000..1a8658f
--- /dev/null
+++ b/tests/language/vm/debug_break_vm_test.dart
@@ -0,0 +1,21 @@
+// Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+// A debug break is not valid Dart syntax unless --enable-debug-break.
+
+test(i) {
+ break "outside_loop"; /// 02: compile-time error
+ do {
+ if (i > 15) {
+ break "inside_loop"; /// 03: compile-time error
+ }
+ } while (false);
+}
+
+void main() {
+ break "gdb"; /// 01: compile-time error
+ for (var i = 0; i < 20; i++) {
+ test(i);
+ }
+}
diff --git a/tests/lib/convert/html_escape_test.dart b/tests/lib/convert/html_escape_test.dart
index 8a13773..a9d0b67 100644
--- a/tests/lib/convert/html_escape_test.dart
+++ b/tests/lib/convert/html_escape_test.dart
@@ -14,10 +14,10 @@
'& 'single' values>';
const _OUTPUT_ATTRIBUTE =
- "<A </test> of \xA0 "double" & 'single' values>";
+ "<A </test> of \xA0 "double" & 'single' values>";
const _OUTPUT_SQ_ATTRIBUTE =
- '<A </test> of \xA0 "double" & 'single' values>';
+ '<A </test> of \xA0 "double" & 'single' values>';
const _OUTPUT_ELEMENT =
"""<A </test> of \xA0 "double" & 'single' values>""";
diff --git a/tests/lib/lib.status b/tests/lib/lib.status
index a965810..750a87f 100644
--- a/tests/lib/lib.status
+++ b/tests/lib/lib.status
@@ -22,6 +22,7 @@
mirrors/closurization_equivalence_test: RuntimeError # Issue 6490
mirrors/constructor_kinds_test: RuntimeError # Issue 13799
mirrors/constructor_private_name_test: CompileTimeError # Issue 13597
+mirrors/deferred_type_test: RuntimeError # Issue 6335
mirrors/enum_test: RuntimeError # Issue 6490
mirrors/fake_function_with_call_test: RuntimeError # Issue 11612
mirrors/fake_function_without_call_test: RuntimeError # Issue 11612
@@ -52,6 +53,7 @@
mirrors/library_declarations_test/none: RuntimeError # Issue 13439, Issue 13733
mirrors/library_exports_shown_test: RuntimeError # Issue 6490
mirrors/library_exports_hidden_test: RuntimeError # Issue 6490
+mirrors/library_import_deferred_loading_test: RuntimeError # Issue 6490
mirrors/library_imports_deferred_test: RuntimeError # Issue 6490
mirrors/library_imports_metadata_test: RuntimeError # Issue 6490
mirrors/library_imports_bad_metadata_test/none: RuntimeError # Issue 6490
@@ -60,6 +62,7 @@
mirrors/library_imports_prefixed_test: RuntimeError # Issue 6490
mirrors/library_imports_prefixed_show_hide_test: RuntimeError # Issue 6490
mirrors/library_uri_io_test: SkipByDesign # Uses dart:io.
+mirrors/load_library_test: RuntimeError # Issue 6335
mirrors/local_function_is_static_test: RuntimeError # Issue 6335
mirrors/lru_test: Skip # dart2js_native/lru_test is used instead
mirrors/metadata_allowed_values_test/01: MissingCompileTimeError # Issue 14548
@@ -123,15 +126,6 @@
math/math_test: RuntimeError
math/math2_test: RuntimeError
-[ $compiler == dart2js && $jscl && $unchecked ]
-mirrors/invocation_fuzz_test: RuntimeError # Issue 15566
-
-[ $compiler == dart2js && $jscl && $checked ]
-mirrors/invocation_fuzz_test/none: RuntimeError # Issue 15566
-
-[ $compiler == dart2js && ($minified || $runtime == jsshell) ]
-mirrors/invocation_fuzz_test: RuntimeError # Issue 15566
-
[ $compiler == dart2js && $runtime == jsshell ]
async/timer_regress22626_test: RuntimeError # Non-zero timers not supported; Issue 7728.
async/future_test: RuntimeError # Timer interface not supported; Issue 7728.
@@ -243,6 +237,7 @@
[ $runtime == vm ]
async/timer_not_available_test: Fail, OK
mirrors/native_class_test: Fail, OK # This test is meant to run in a browser.
+mirrors/deferred_type_test: CompileTimeError, OK # Don't have a multitest marker for dynamic compile time errors.
[ $compiler == none ]
async/timer_not_available_test: SkipByDesign # only meant to test when there is no way to implement timer (currently only in d8)
@@ -261,16 +256,14 @@
mirrors/immutable_collections_test: SkipSlow # Dartium debug uses -O0, so this will just timeout and waste bot cycles.
mirrors/mirrors_reader_test: SkipSlow # Dartium debug uses -O0, so this will just timeout and waste bot cycles.
mirrors/library_uri_io_test: SkipByDesign # Uses dart:io.
+mirrors/spawn_function_root_library_test: SkipByDesign # Uses spawnFunction.
mirrors/local_isolate_test: RuntimeError # Issue 12188
+mirrors/deferred_type_test: RuntimeError, OK # Should be CompileTimeError. Issue 22072
[ $compiler == none && $runtime == drt && $system == windows ]
async/multiple_timer_test: Fail, Pass # See Issue 10982
async/timer_test: Fail, Pass # See Issue 10982
-[ $compiler == none && $runtime == dartium ]
-async/schedule_microtask5_test: Pass, Timeout # Issue 13719: Please triage this failure.
-async/timer_cancel2_test: Pass, Timeout # Issue 13719: Please triage this failure.
-
[$compiler == none && $runtime == ContentShellOnAndroid ]
async/stream_timeout_test: RuntimeError, Pass # Issue 19127
async/slow_consumer3_test: SkipSlow # Times out flakily. Issue 20956
@@ -287,9 +280,6 @@
# Deferred loading is not supported by dart2dart.
async/deferred/deferred_in_isolate_test: Skip # Issue 17523
-[ $compiler == dart2dart && $builder_tag == new_backend ]
-async/future_test: RuntimeError # Issue 23015
-
[ $compiler == none && ($runtime == drt || $runtime == dartium || $runtime == ContentShellOnAndroid) ]
# Dart vm does not support spawn from a dom-enabled isolate.
async/deferred/deferred_in_isolate_test: RuntimeError # Issue 16209
@@ -309,6 +299,7 @@
mirrors/repeated_private_anon_mixin_app_test: StaticWarning, OK # Intentional library name conflict.
mirrors/removed_api_test: StaticWarning, OK # Deliberately refers to undeclared members.
+mirrors/deferred_type_test: StaticWarning, OK # Deliberately referes to a deferred type in a declaration.
mirrors/deferred_mirrors_metadata_test: Fail # Issue 17522
@@ -327,10 +318,13 @@
[ $compiler == dart2js && $mode == debug ]
mirrors/native_class_test: Pass, Slow
-[ $arch == simarm ]
+[ $arch == simarm || $arch == simarmv5te ]
convert/chunked_conversion_utf88_test: Skip # Pass, Slow Issue 12644.
convert/utf85_test: Skip # Pass, Slow Issue 12644.
+[ $arch == simarmv5te ]
+mirrors/mirrors_reader_test: Pass, Slow
+
[ $compiler == dart2js ]
profiler/metrics_num_test: Skip # Because of a int / double type test.
@@ -340,9 +334,523 @@
[ $mode == debug && $arch == ia32 && $system == windows ]
convert/streamed_conversion_json_utf8_decode_test: Skip # Verification OOM.
-[ $mode == debug && $arch != ia32 && $arch != x64 && $arch != simarm ]
+[ $mode == debug && $arch != ia32 && $arch != x64 && $arch != simarm && $arch != simarmv5te ]
convert/streamed_conversion_json_utf8_decode_test: Skip # Verification not yet implemented.
[ $runtime == vm && $mode == debug && $builder_tag == asan ]
mirrors/immutable_collections_test: SkipSlow # Timeout.
convert/streamed_conversion_json_utf8_decode_test: Skip # Timeout.
+
+[ $compiler == dart2js && $cps_ir ]
+async/catch_errors11_test: Crash # (throw _buildException('asyncEnd() was called before asyncStart().')): Unhandled node
+async/catch_errors12_test: Crash # (throw _buildException('asyncEnd() was called before asyncStart().')): Unhandled node
+async/catch_errors13_test: Crash # (throw _buildException('asyncEnd() was called before asyncStart().')): Unhandled node
+async/catch_errors14_test: Crash # (throw _buildException('asyncEnd() was called before asyncStart().')): Unhandled node
+async/catch_errors15_test: Crash # (throw _buildException('asyncEnd() was called before asyncStart().')): Unhandled node
+async/catch_errors16_test: Crash # (throw _buildException('asyncEnd() was called before asyncStart().')): Unhandled node
+async/catch_errors17_test: Crash # (throw _buildException('asyncEnd() was called before asyncStart().')): Unhandled node
+async/catch_errors18_test: Crash # (throw _buildException('asyncEnd() was called before asyncStart().')): Unhandled node
+async/catch_errors19_test: Crash # (throw _buildException('asyncEnd() was called before asyncStart().')): Unhandled node
+async/catch_errors20_test: Crash # (throw _buildException('asyncEnd() was called before asyncStart().')): Unhandled node
+async/catch_errors21_test: Crash # (throw _buildException('asyncEnd() was called before asyncStart().')): Unhandled node
+async/catch_errors22_test: Crash # (throw _buildException('asyncEnd() was called before asyncStart().')): Unhandled node
+async/catch_errors23_test: Crash # (throw _buildException('asyncEnd() was called before asyncStart().')): Unhandled node
+async/catch_errors24_test: Crash # (throw _buildException('asyncEnd() was called before asyncStart().')): Unhandled node
+async/catch_errors25_test: Crash # (throw _buildException('asyncEnd() was called before asyncStart().')): Unhandled node
+async/catch_errors26_test: Crash # (throw _buildException('asyncEnd() was called before asyncStart().')): Unhandled node
+async/catch_errors27_test: Crash # (throw _buildException('asyncEnd() was called before asyncStart().')): Unhandled node
+async/catch_errors28_test: Crash # (throw _buildException('asyncEnd() was called before asyncStart().')): Unhandled node
+async/catch_errors2_test: Crash # (throw _buildException('asyncEnd() was called before asyncStart().')): Unhandled node
+async/catch_errors3_test: Crash # (throw _buildException('asyncEnd() was called before asyncStart().')): Unhandled node
+async/catch_errors4_test: Crash # (throw _buildException('asyncEnd() was called before asyncStart().')): Unhandled node
+async/catch_errors5_test: Crash # (throw _buildException('asyncEnd() was called before asyncStart().')): Unhandled node
+async/catch_errors6_test: Crash # (throw _buildException('asyncEnd() was called before asyncStart().')): Unhandled node
+async/catch_errors7_test: Crash # (throw _buildException('asyncEnd() was called before asyncStart().')): Unhandled node
+async/catch_errors8_test: Crash # (throw _buildException('asyncEnd() was called before asyncStart().')): Unhandled node
+async/catch_errors_test: Crash # (throw _buildException('asyncEnd() was called before asyncStart().')): Unhandled node
+async/deferred/deferred_in_isolate_test: Crash # cannot compile methods that need interceptor calling convention.
+async/first_regression_test: Crash # cannot compile methods that need interceptor calling convention.
+async/future_constructor_test: Crash # (throw new ExpectException(message)): Unhandled node
+async/future_delayed_error_test: Crash # (throw _buildException('asyncEnd() was called before asyncStart().')): Unhandled node
+async/future_microtask_test: Crash # (throw _buildException('asyncEnd() was called before asyncStart().')): Unhandled node
+async/futures_test: Crash # (throw _buildException('asyncEnd() was called before asyncStart().')): Unhandled node
+async/future_test: Crash # (throw _buildException('asyncEnd() was called before asyncStart().')): Unhandled node
+async/future_timeout_test: Crash # cannot compile methods that need interceptor calling convention.
+async/future_value_chain2_test: Crash # (throw _buildException('asyncEnd() was called before asyncStart().')): Unhandled node
+async/future_value_chain3_test: Crash # (throw _buildException('asyncEnd() was called before asyncStart().')): Unhandled node
+async/future_value_chain4_test: Crash # (throw _buildException('asyncEnd() was called before asyncStart().')): Unhandled node
+async/future_value_chain_test: Crash # (throw _buildException('asyncEnd() was called before asyncStart().')): Unhandled node
+async/intercept_print1_test: Crash # (throw new ExpectException(message)): Unhandled node
+async/intercept_schedule_microtask1_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+async/intercept_schedule_microtask2_test: Crash # (throw new ExpectException(message)): Unhandled node
+async/intercept_schedule_microtask3_test: Crash # (throw _buildException('asyncEnd() was called before asyncStart().')): Unhandled node
+async/intercept_schedule_microtask4_test: Crash # (throw _buildException('asyncEnd() was called before asyncStart().')): Unhandled node
+async/intercept_schedule_microtask5_test: Crash # (throw _buildException('asyncEnd() was called before asyncStart().')): Unhandled node
+async/intercept_schedule_microtask6_test: Crash # (throw _buildException('asyncEnd() was called before asyncStart().')): Unhandled node
+async/multiple_timer_test: Crash # cannot compile methods that need interceptor calling convention.
+async/print_test/01: Crash # cannot compile methods that need interceptor calling convention.
+async/print_test/none: Crash # cannot compile methods that need interceptor calling convention.
+async/run_zoned1_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+async/run_zoned4_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+async/run_zoned5_test: Crash # (throw _buildException('asyncEnd() was called before asyncStart().')): Unhandled node
+async/run_zoned6_test/01: Crash # (rethrow;): Unhandled node
+async/run_zoned6_test/none: Crash # (rethrow;): Unhandled node
+async/run_zoned7_test: Crash # (throw _buildException('asyncEnd() was called before asyncStart().')): Unhandled node
+async/run_zoned8_test: Crash # (throw _buildException('asyncEnd() was called before asyncStart().')): Unhandled node
+async/run_zoned9_test/01: Crash # (rethrow;): Unhandled node
+async/run_zoned9_test/none: Crash # (rethrow;): Unhandled node
+async/schedule_microtask2_test: Crash # cannot compile methods that need interceptor calling convention.
+async/schedule_microtask3_test: Crash # cannot compile methods that need interceptor calling convention.
+async/schedule_microtask5_test: Crash # cannot compile methods that need interceptor calling convention.
+async/schedule_microtask_test: Crash # (throw _buildException('asyncEnd() was called before asyncStart().')): Unhandled node
+async/slow_consumer2_test: Crash # (throw _buildException('asyncEnd() was called before asyncStart().')): Unhandled node
+async/slow_consumer3_test: Crash # (throw _buildException('asyncEnd() was called before asyncStart().')): Unhandled node
+async/slow_consumer_test: Crash # (throw _buildException('asyncEnd() was called before asyncStart().')): Unhandled node
+async/stack_trace01_test: Crash # (throw _buildException('asyncEnd() was called before asyncStart().')): Unhandled node
+async/stack_trace02_test: Crash # (throw _buildException('asyncEnd() was called before asyncStart().')): Unhandled node
+async/stack_trace03_test: Crash # (throw _buildException('asyncEnd() was called before asyncStart().')): Unhandled node
+async/stack_trace04_test: Crash # (throw _buildException('asyncEnd() was called before asyncStart().')): Unhandled node
+async/stack_trace05_test: Crash # (throw "should never be reached"): Unhandled node
+async/stack_trace06_test: Crash # (throw _buildException('asyncEnd() was called before asyncStart().')): Unhandled node
+async/stack_trace07_test: Crash # (throw "bad things happen"): Unhandled node
+async/stack_trace08_test: Crash # (throw _buildException('asyncEnd() was called before asyncStart().')): Unhandled node
+async/stack_trace09_test: Crash # (throw _buildException('asyncEnd() was called before asyncStart().')): Unhandled node
+async/stack_trace10_test: Crash # (throw "should never be reached"): Unhandled node
+async/stack_trace11_test: Crash # (throw "Unreachable"): Unhandled node
+async/stack_trace12_test: Crash # (throw "Unreachable"): Unhandled node
+async/stack_trace13_test: Crash # (throw "Unreachable"): Unhandled node
+async/stack_trace14_test: Crash # (throw "Unreachable"): Unhandled node
+async/stack_trace15_test: Crash # (throw "Unreachable"): Unhandled node
+async/stack_trace16_test: Crash # (throw _buildException('asyncEnd() was called before asyncStart().')): Unhandled node
+async/stack_trace17_test: Crash # (throw "Unreachable"): Unhandled node
+async/stack_trace18_test: Crash # (throw _buildException('asyncEnd() was called before asyncStart().')): Unhandled node
+async/stack_trace19_test: Crash # (throw _buildException('asyncEnd() was called before asyncStart().')): Unhandled node
+async/stack_trace20_test: Crash # (throw "should never be reached"): Unhandled node
+async/stack_trace21_test: Crash # Unhandled node
+async/stack_trace22_test: Crash # (throw _buildException('asyncEnd() was called before asyncStart().')): Unhandled node
+async/stack_trace23_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+async/stack_trace24_test: Crash # (throw "should never be reached"): Unhandled node
+async/stack_trace25_test: Crash # (throw "unreachable"): Unhandled node
+async/stream_controller_async_test: Crash # cannot compile methods that need interceptor calling convention.
+async/stream_controller_test: Crash # (throw _buildException('asyncEnd() was called before asyncStart().')): Unhandled node
+async/stream_event_transformed_test: Crash # (throw _buildException('asyncEnd() was called before asyncStart().')): Unhandled node
+async/stream_first_where_test: Crash # cannot compile methods that need interceptor calling convention.
+async/stream_from_iterable_test: Crash # cannot compile methods that need interceptor calling convention.
+async/stream_iterator_test: Crash # cannot compile methods that need interceptor calling convention.
+async/stream_join_test: Crash # cannot compile methods that need interceptor calling convention.
+async/stream_last_where_test: Crash # cannot compile methods that need interceptor calling convention.
+async/stream_listen_zone_test: Crash # (throw _buildException('asyncEnd() was called before asyncStart().')): Unhandled node
+async/stream_periodic2_test: Crash # cannot compile methods that need interceptor calling convention.
+async/stream_periodic3_test: Crash # cannot compile methods that need interceptor calling convention.
+async/stream_periodic4_test: Crash # cannot compile methods that need interceptor calling convention.
+async/stream_periodic5_test: Crash # cannot compile methods that need interceptor calling convention.
+async/stream_periodic_test: Crash # cannot compile methods that need interceptor calling convention.
+async/stream_single_test: Crash # cannot compile methods that need interceptor calling convention.
+async/stream_single_to_multi_subscriber_test: Crash # cannot compile methods that need interceptor calling convention.
+async/stream_state_nonzero_timer_test: Crash # cannot compile methods that need interceptor calling convention.
+async/stream_state_test: Crash # cannot compile methods that need interceptor calling convention.
+async/stream_subscription_as_future_test: Crash # cannot compile methods that need interceptor calling convention.
+async/stream_subscription_cancel_test: Crash # cannot compile methods that need interceptor calling convention.
+async/stream_timeout_test: Crash # Please triage this failure.
+async/stream_transformation_broadcast_test: Crash # cannot compile methods that need interceptor calling convention.
+async/stream_transformer_from_handlers_test: Crash # (throw _buildException('asyncEnd() was called before asyncStart().')): Unhandled node
+async/stream_transformer_test: Crash # (throw new ExpectException(message)): Unhandled node
+async/stream_transform_test: Crash # cannot compile methods that need interceptor calling convention.
+async/stream_zones_test: Crash # (throw _buildException('asyncEnd() was called before asyncStart().')): Unhandled node
+async/timer_cancel1_test: Crash # cannot compile methods that need interceptor calling convention.
+async/timer_cancel2_test: Crash # cannot compile methods that need interceptor calling convention.
+async/timer_cancel_test: Crash # cannot compile methods that need interceptor calling convention.
+async/timer_isActive_test: Crash # cannot compile methods that need interceptor calling convention.
+async/timer_isolate_test: Crash # cannot compile methods that need interceptor calling convention.
+async/timer_not_available_test: Crash # (try {new Timer(ms*5,(){});}on UnsupportedError catch (e){failed=true;}): "on T" catch block
+async/timer_regress22626_test: Crash # unsupported element kind: rng:field
+async/timer_repeat_test: Crash # cannot compile methods that need interceptor calling convention.
+async/timer_test: Crash # cannot compile methods that need interceptor calling convention.
+async/zone_bind_callback_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+async/zone_bind_callback_unary_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+async/zone_bind_test: Crash # (throw _buildException('asyncEnd() was called before asyncStart().')): Unhandled node
+async/zone_create_periodic_timer_test: Crash # (throw _buildException('asyncEnd() was called before asyncStart().')): Unhandled node
+async/zone_create_timer2_test: Crash # (throw _buildException('asyncEnd() was called before asyncStart().')): Unhandled node
+async/zone_create_timer_test: Crash # (throw _buildException('asyncEnd() was called before asyncStart().')): Unhandled node
+async/zone_debug_test: Crash # (throw _buildException('asyncEnd() was called before asyncStart().')): Unhandled node
+async/zone_empty_description2_test: Crash # (throw new ExpectException(message)): Unhandled node
+async/zone_empty_description_test: Crash # (throw new ExpectException(message)): Unhandled node
+async/zone_error_callback_test: Crash # (throw _buildException('asyncEnd() was called before asyncStart().')): Unhandled node
+async/zone_fork_test: Crash # (throw new ExpectException(message)): Unhandled node
+async/zone_future_schedule_microtask_test: Crash # (throw _buildException('asyncEnd() was called before asyncStart().')): Unhandled node
+async/zone_register_callback_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+async/zone_register_callback_unary_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+async/zone_root_bind_test: Crash # (throw new ExpectException(message)): Unhandled node
+async/zone_run_guarded_test: Crash # (throw _buildException('asyncEnd() was called before asyncStart().')): Unhandled node
+async/zone_run_test: Crash # (throw _buildException('asyncEnd() was called before asyncStart().')): Unhandled node
+async/zone_run_unary_test: Crash # (throw _buildException('asyncEnd() was called before asyncStart().')): Unhandled node
+async/zone_value_test: Crash # (throw new ExpectException(message)): Unhandled node
+collection/hash_map_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+collection/hash_set_test: Crash # (throw new ExpectException(message)): Unhandled node
+collection/linked_list_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+convert/ascii_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+convert/chunked_conversion1_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+convert/chunked_conversion2_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+convert/chunked_conversion_json_decode1_test: Crash # (throw new ExpectException(message)): Unhandled node
+convert/chunked_conversion_json_encode1_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+convert/chunked_conversion_utf82_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+convert/chunked_conversion_utf83_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+convert/chunked_conversion_utf84_test: Crash # (throw new ExpectException(message)): Unhandled node
+convert/chunked_conversion_utf85_test: Crash # (throw new ExpectException(message)): Unhandled node
+convert/chunked_conversion_utf86_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+convert/chunked_conversion_utf87_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+convert/chunked_conversion_utf88_test: Crash # (throw new ExpectException(message)): Unhandled node
+convert/chunked_conversion_utf89_test: Crash # (throw new ExpectException(message)): Unhandled node
+convert/chunked_conversion_utf8_test: Crash # (throw new ExpectException(message)): Unhandled node
+convert/codec1_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+convert/codec2_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+convert/encoding_test: Crash # (throw _buildException('asyncEnd() was called before asyncStart().')): Unhandled node
+convert/html_escape_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+convert/json_chunk_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+convert/json_lib_test: Crash # cannot compile methods that need interceptor calling convention.
+convert/json_pretty_test: Crash # Please triage this failure.
+convert/json_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+convert/json_toEncodable_reviver_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+convert/json_utf8_chunk_test: Crash # "on T" catch block
+convert/json_util_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+convert/latin1_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+convert/line_splitter_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+convert/streamed_conversion_json_decode1_test: Crash # (throw _buildException('asyncEnd() was called before asyncStart().')): Unhandled node
+convert/streamed_conversion_json_encode1_test: Crash # (throw _buildException('asyncEnd() was called before asyncStart().')): Unhandled node
+convert/streamed_conversion_json_utf8_decode_test: Crash # (throw _buildException('asyncEnd() was called before asyncStart().')): Unhandled node
+convert/streamed_conversion_json_utf8_encode_test: Crash # (throw _buildException('asyncEnd() was called before asyncStart().')): Unhandled node
+convert/streamed_conversion_utf8_decode_test: Crash # (throw _buildException('asyncEnd() was called before asyncStart().')): Unhandled node
+convert/streamed_conversion_utf8_encode_test: Crash # (throw _buildException('asyncEnd() was called before asyncStart().')): Unhandled node
+convert/utf82_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+convert/utf83_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+convert/utf84_test: Crash # (throw new ExpectException(message)): Unhandled node
+convert/utf85_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+convert/utf8_encode_test: Crash # (throw new ExpectException(message)): Unhandled node
+convert/utf8_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+js/datetime_roundtrip_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+js/null_test: Crash # cannot compile methods that need interceptor calling convention.
+math/coin_test: Crash # (throw new ExpectException(message)): Unhandled node
+math/double_pow_test: Crash # (throw new ExpectException(message)): Unhandled node
+math/low_test: Crash # (throw new ExpectException(message)): Unhandled node
+math/math2_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+math/math_parse_double_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+math/math_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+math/min_max_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+math/pi_test: Crash # (throw new ExpectException(message)): Unhandled node
+math/point_test: Crash # cannot compile methods that need interceptor calling convention.
+math/random_big_test: Crash # (throw new ExpectException(message)): Unhandled node
+math/random_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+math/rectangle_test: Crash # Please triage this failure.
+mirrors/abstract_class_test/00: Crash # (throw new ExpectException(message)): Unhandled node
+mirrors/abstract_class_test/none: Crash # (throw new ExpectException(message)): Unhandled node
+mirrors/abstract_test: Crash # (throw new ExpectException(message)): Unhandled node
+mirrors/accessor_cache_overflow_test: Crash # cannot compile methods that need interceptor calling convention.
+mirrors/basic_types_in_dart_core_test: Crash # (throw new ExpectException(message)): Unhandled node
+mirrors/circular_factory_redirection_test/01: Crash # (new A.circular()): Error expression `new A.circular()` unhandled.
+mirrors/circular_factory_redirection_test/02: Crash # (new A.circular2()): Error expression `new A.circular2()` unhandled.
+mirrors/circular_factory_redirection_test/none: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+mirrors/class_declarations_test/01: Crash # (throw new ExpectException(message)): Unhandled node
+mirrors/class_declarations_test/none: Crash # (throw new ExpectException(message)): Unhandled node
+mirrors/class_mirror_location_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+mirrors/class_mirror_type_variables_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+mirrors/closures_test: Crash # (throw new ExpectException(message)): Unhandled node
+mirrors/closurization_equivalence_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+mirrors/constructor_kinds_test/01: Crash # (throw new ExpectException(message)): Unhandled node
+mirrors/constructor_kinds_test/none: Crash # (throw new ExpectException(message)): Unhandled node
+mirrors/constructor_private_name_test: Crash # cannot compile methods that need interceptor calling convention.
+mirrors/constructors_test: Crash # (throw new ExpectException(message)): Unhandled node
+mirrors/dart2js_mirrors_test: Crash # (throw new StateError('FAILED: ${name}.\n${e}\n${trace}')): Unhandled node
+mirrors/declarations_type_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+mirrors/deferred_mirrors_metadata_test: Crash # (throw _buildException('asyncEnd() was called before asyncStart().')): Unhandled node
+mirrors/deferred_mirrors_metatarget_test: Crash # (throw _buildException('asyncEnd() was called before asyncStart().')): Unhandled node
+mirrors/deferred_mirrors_update_test: Crash # handleStaticGetterInvoke: foreign: function(loadLibrary)
+mirrors/deferred_type_test: Crash # handleStaticFunctionGet: function(bad)
+mirrors/delegate_call_through_getter_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+mirrors/delegate_function_invocation_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+mirrors/delegate_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+mirrors/enum_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+mirrors/equality_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+mirrors/fake_function_with_call_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+mirrors/fake_function_without_call_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+mirrors/field_type_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+mirrors/function_type_mirror_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+mirrors/generic_bounded_by_type_parameter_test/01: Crash # (try {}on TypeError catch (e){Expect.isTrue(inCheckedMode());}): "on T" catch block
+mirrors/generic_bounded_by_type_parameter_test/02: Crash # "on T" catch block
+mirrors/generic_bounded_by_type_parameter_test/none: Crash # (try {}on TypeError catch (e){Expect.isTrue(inCheckedMode());}): "on T" catch block
+mirrors/generic_bounded_test/01: Crash # (try {}on TypeError catch (e){Expect.isTrue(inCheckedMode());}): "on T" catch block
+mirrors/generic_bounded_test/02: Crash # "on T" catch block
+mirrors/generic_bounded_test/none: Crash # (try {}on TypeError catch (e){Expect.isTrue(inCheckedMode());}): "on T" catch block
+mirrors/generic_class_declaration_test: Crash # (throw new ExpectException(message)): Unhandled node
+mirrors/generic_f_bounded_mixin_application_test: Crash # (throw new ExpectException(message)): Unhandled node
+mirrors/generic_f_bounded_test/01: Crash # (throw new ExpectException(message)): Unhandled node
+mirrors/generic_f_bounded_test/none: Crash # (throw new ExpectException(message)): Unhandled node
+mirrors/generic_function_typedef_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+mirrors/generic_interface_test/01: Crash # (throw new ExpectException(message)): Unhandled node
+mirrors/generic_interface_test/none: Crash # (throw new ExpectException(message)): Unhandled node
+mirrors/generic_list_test: Crash # (throw new ExpectException(message)): Unhandled node
+mirrors/generic_local_function_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+mirrors/generic_mixin_applications_test: Crash # (throw new ExpectException(message)): Unhandled node
+mirrors/generic_mixin_test: Crash # (throw new ExpectException(message)): Unhandled node
+mirrors/generics_double_substitution_test/01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+mirrors/generics_double_substitution_test/none: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+mirrors/generics_dynamic_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+mirrors/generics_special_types_test: Crash # (throw new ExpectException(message)): Unhandled node
+mirrors/generics_substitution_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+mirrors/generics_test/01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+mirrors/generics_test/none: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+mirrors/generic_superclass_test/01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+mirrors/generic_superclass_test/none: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+mirrors/generic_type_mirror_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+mirrors/get_field_cache_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+mirrors/get_field_static_test/00: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+mirrors/get_field_static_test/none: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+mirrors/get_field_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+mirrors/get_symbol_name_no_such_method_test: Crash # (throw 'Expected: "${expected}", but got "${actual}"'): Unhandled node
+mirrors/globalized_closures2_test/00: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+mirrors/globalized_closures2_test/none: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+mirrors/globalized_closures_test/00: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+mirrors/globalized_closures_test/none: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+mirrors/hierarchy_invariants_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+mirrors/hot_get_field_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+mirrors/hot_set_field_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+mirrors/immutable_collections_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+mirrors/inference_and_no_such_method_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+mirrors/inherited_metadata_test: Crash # (throw new ExpectException(message)): Unhandled node
+mirrors/inherit_field_test: Crash # (throw new ExpectException(message)): Unhandled node
+mirrors/initializing_formals_test/01: Crash # (throw new ExpectException(message)): Unhandled node
+mirrors/initializing_formals_test/03: Crash # cannot compile methods that need interceptor calling convention.
+mirrors/initializing_formals_test/none: Crash # (throw new ExpectException(message)): Unhandled node
+mirrors/instance_members_easier_test: Crash # (throw new ExpectException(message)): Unhandled node
+mirrors/instance_members_test: Crash # (throw new ExpectException(message)): Unhandled node
+mirrors/instance_members_unimplemented_interface_test: Crash # (throw new ExpectException(message)): Unhandled node
+mirrors/instance_members_with_override_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+mirrors/instantiate_abstract_class_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+mirrors/intercepted_cache_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+mirrors/intercepted_class_test: Crash # (throw new ExpectException(message)): Unhandled node
+mirrors/intercepted_object_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+mirrors/intercepted_superclass_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+mirrors/invocation_cache_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+mirrors/invocation_fuzz_test/emptyarray: Crash # unsupported element kind: queue:field
+mirrors/invocation_fuzz_test/false: Crash # unsupported element kind: queue:field
+mirrors/invocation_fuzz_test/none: Crash # unsupported element kind: queue:field
+mirrors/invocation_fuzz_test/smi: Crash # unsupported element kind: queue:field
+mirrors/invocation_fuzz_test/string: Crash # unsupported element kind: queue:field
+mirrors/invoke_call_on_closure_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+mirrors/invoke_call_through_getter_previously_accessed_test/named: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+mirrors/invoke_call_through_getter_previously_accessed_test/none: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+mirrors/invoke_call_through_getter_test/named: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+mirrors/invoke_call_through_getter_test/none: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+mirrors/invoke_call_through_implicit_getter_previously_accessed_test/named: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+mirrors/invoke_call_through_implicit_getter_previously_accessed_test/none: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+mirrors/invoke_call_through_implicit_getter_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+mirrors/invoke_closurization2_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+mirrors/invoke_closurization_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+mirrors/invoke_import_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+mirrors/invoke_named_test/01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+mirrors/invoke_named_test/none: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+mirrors/invoke_natives_malicious_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+mirrors/invoke_private_test: Crash # cannot compile methods that need interceptor calling convention.
+mirrors/invoke_private_wrong_library_test: Crash # Unhandled node
+mirrors/invoke_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+mirrors/invoke_throws_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+mirrors/is_odd_test: Crash # (throw new ExpectException(message)): Unhandled node
+mirrors/lazy_static_test: Crash # (throw new ExpectException(message)): Unhandled node
+mirrors/libraries_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+mirrors/library_declarations_test/01: Crash # (throw new ExpectException(message)): Unhandled node
+mirrors/library_declarations_test/none: Crash # (throw new ExpectException(message)): Unhandled node
+mirrors/library_enumeration_deferred_loading_test: Crash # handleStaticGetterInvoke: foreign: function(loadLibrary)
+mirrors/library_exports_hidden_test: Crash # (throw new ExpectException(message)): Unhandled node
+mirrors/library_exports_shown_test: Crash # (throw new ExpectException(message)): Unhandled node
+mirrors/library_import_deferred_loading_test: Crash # handleStaticGetterInvoke: foreign: function(loadLibrary)
+mirrors/library_imports_bad_metadata_test/01: Crash # (throw new ExpectException(message)): Unhandled node
+mirrors/library_imports_bad_metadata_test/none: Crash # (throw new ExpectException(message)): Unhandled node
+mirrors/library_imports_deferred_test: Crash # (throw new ExpectException(message)): Unhandled node
+mirrors/library_imports_hidden_test: Crash # (throw new ExpectException(message)): Unhandled node
+mirrors/library_imports_metadata_test: Crash # (throw new ExpectException(message)): Unhandled node
+mirrors/library_imports_prefixed_show_hide_test: Crash # (throw new ExpectException(message)): Unhandled node
+mirrors/library_imports_prefixed_test: Crash # (throw new ExpectException(message)): Unhandled node
+mirrors/library_imports_shown_test: Crash # (throw new ExpectException(message)): Unhandled node
+mirrors/library_uri_package_test: Crash # cannot compile methods that need interceptor calling convention.
+mirrors/list_constructor_test/01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+mirrors/list_constructor_test/none: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+mirrors/load_library_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+mirrors/local_function_is_static_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+mirrors/local_isolate_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+mirrors/metadata_allowed_values_test/01: Crash # (throw new ExpectException(message)): Unhandled node
+mirrors/metadata_allowed_values_test/02: Crash # (throw new ExpectException(message)): Unhandled node
+mirrors/metadata_allowed_values_test/03: Crash # (throw new ExpectException(message)): Unhandled node
+mirrors/metadata_allowed_values_test/04: Crash # (throw new ExpectException(message)): Unhandled node
+mirrors/metadata_allowed_values_test/05: Crash # (throw new ExpectException(message)): Unhandled node
+mirrors/metadata_allowed_values_test/06: Crash # (I): Error expression `I` unhandled.
+mirrors/metadata_allowed_values_test/07: Crash # (throw new ExpectException(message)): Unhandled node
+mirrors/metadata_allowed_values_test/08: Crash # (throw new ExpectException(message)): Unhandled node
+mirrors/metadata_allowed_values_test/09: Crash # (throw new ExpectException(message)): Unhandled node
+mirrors/metadata_allowed_values_test/10: Crash # (throw new ExpectException(message)): Unhandled node
+mirrors/metadata_allowed_values_test/11: Crash # (throw new ExpectException(message)): Unhandled node
+mirrors/metadata_allowed_values_test/13: Crash # (throw new ExpectException(message)): Unhandled node
+mirrors/metadata_allowed_values_test/14: Crash # (throw new ExpectException(message)): Unhandled node
+mirrors/metadata_allowed_values_test/15: Crash # (throw new ExpectException(message)): Unhandled node
+mirrors/metadata_allowed_values_test/16: Crash # (throw new ExpectException(message)): Unhandled node
+mirrors/metadata_allowed_values_test/23: Crash # (throw new ExpectException(message)): Unhandled node
+mirrors/metadata_allowed_values_test/24: Crash # (throw new ExpectException(message)): Unhandled node
+mirrors/metadata_allowed_values_test/25: Crash # (throw new ExpectException(message)): Unhandled node
+mirrors/metadata_allowed_values_test/26: Crash # (JJ): Error expression `JJ` unhandled.
+mirrors/metadata_allowed_values_test/27: Crash # (throw new ExpectException(message)): Unhandled node
+mirrors/metadata_allowed_values_test/none: Crash # (throw new ExpectException(message)): Unhandled node
+mirrors/metadata_constructed_constant_test: Crash # (throw new ExpectException(message)): Unhandled node
+mirrors/metadata_constructor_arguments_test/01: Crash # (throw new ExpectException(message)): Unhandled node
+mirrors/metadata_constructor_arguments_test/02: Crash # (throw new ExpectException(message)): Unhandled node
+mirrors/metadata_constructor_arguments_test/03: Crash # (throw new ExpectException(message)): Unhandled node
+mirrors/metadata_constructor_arguments_test/04: Crash # (throw new ExpectException(message)): Unhandled node
+mirrors/metadata_constructor_arguments_test/05: Crash # (throw new ExpectException(message)): Unhandled node
+mirrors/metadata_constructor_arguments_test/06: Crash # (throw new ExpectException(message)): Unhandled node
+mirrors/metadata_constructor_arguments_test/07: Crash # (throw new ExpectException(message)): Unhandled node
+mirrors/metadata_constructor_arguments_test/none: Crash # (throw new ExpectException(message)): Unhandled node
+mirrors/metadata_nested_constructor_call_test/01: Crash # (throw new ExpectException(message)): Unhandled node
+mirrors/metadata_nested_constructor_call_test/02: Crash # (throw new ExpectException(message)): Unhandled node
+mirrors/metadata_nested_constructor_call_test/03: Crash # (throw new ExpectException(message)): Unhandled node
+mirrors/metadata_nested_constructor_call_test/04: Crash # (throw new ExpectException(message)): Unhandled node
+mirrors/metadata_nested_constructor_call_test/05: Crash # (throw new ExpectException(message)): Unhandled node
+mirrors/metadata_nested_constructor_call_test/06: Crash # (throw new ExpectException(message)): Unhandled node
+mirrors/metadata_nested_constructor_call_test/07: Crash # (throw new ExpectException(message)): Unhandled node
+mirrors/metadata_nested_constructor_call_test/08: Crash # (throw new ExpectException(message)): Unhandled node
+mirrors/metadata_nested_constructor_call_test/09: Crash # (throw new ExpectException(message)): Unhandled node
+mirrors/metadata_nested_constructor_call_test/none: Crash # (throw new ExpectException(message)): Unhandled node
+mirrors/method_mirror_location_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+mirrors/method_mirror_name_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+mirrors/method_mirror_properties_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+mirrors/method_mirror_returntype_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+mirrors/method_mirror_source_line_ending_test: Crash # (throw new ExpectException(message)): Unhandled node
+mirrors/method_mirror_source_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+mirrors/mirror_in_static_init_test/01: Crash # unsupported element kind: staticField:field
+mirrors/mirror_in_static_init_test/none: Crash # unsupported element kind: staticField:field
+mirrors/mirrors_nsm_test/dart2js: Crash # (throw new ExpectException(message)): Unhandled node
+mirrors/mirrors_nsm_test/none: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+mirrors/mirrors_reader_test: Crash # (throw 'Unexpected errors occurred reading mirrors.'): Unhandled node
+mirrors/mirrors_resolve_fields_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+mirrors/mirrors_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+mirrors/mirrors_used_get_name2_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+mirrors/mirrors_used_get_name_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+mirrors/mirrors_used_inheritance_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+mirrors/mirrors_used_typedef_declaration_test/01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+mirrors/mirrors_used_typedef_declaration_test/none: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+mirrors/mixin_application_test: Crash # (throw new ExpectException(message)): Unhandled node
+mirrors/mixin_members_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+mirrors/mixin_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+mirrors/model_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+mirrors/native_class_test: Crash # (throw new ExpectException(message)): Unhandled node
+mirrors/new_instance_optional_arguments_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+mirrors/new_instance_with_type_arguments_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+mirrors/no_metadata_test: Crash # (throw new ExpectException(message)): Unhandled node
+mirrors/null2_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+mirrors/null_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+mirrors/operator_test: Crash # (throw new ExpectException(message)): Unhandled node
+mirrors/optional_parameters_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+mirrors/parameter_annotation_mirror_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+mirrors/parameter_is_const_test/01: Crash # (throw new ExpectException(message)): Unhandled node
+mirrors/parameter_is_const_test/none: Crash # (throw new ExpectException(message)): Unhandled node
+mirrors/parameter_metadata_test: Crash # (throw 'Null metadata on ${mirror}'): Unhandled node
+mirrors/parameter_of_mixin_app_constructor_test: Crash # (throw new ExpectException(message)): Unhandled node
+mirrors/parameter_test/01: Crash # (throw new ExpectException(message)): Unhandled node
+mirrors/parameter_test/none: Crash # (throw new ExpectException(message)): Unhandled node
+mirrors/private_symbol_mangling_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+mirrors/private_symbol_test: Crash # cannot compile methods that need interceptor calling convention.
+mirrors/private_types_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+mirrors/proxy_type_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+mirrors/raw_type_test/01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+mirrors/raw_type_test/none: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+mirrors/redirecting_factory_test/01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+mirrors/redirecting_factory_test/02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+mirrors/redirecting_factory_test/none: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+mirrors/reflect_class_test/01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+mirrors/reflect_class_test/02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+mirrors/reflect_class_test/none: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+mirrors/reflected_type_classes_test/01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+mirrors/reflected_type_classes_test/02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+mirrors/reflected_type_classes_test/03: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+mirrors/reflected_type_classes_test/none: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+mirrors/reflected_type_function_type_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+mirrors/reflected_type_special_types_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+mirrors/reflected_type_test/01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+mirrors/reflected_type_test/02: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+mirrors/reflected_type_test/03: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+mirrors/reflected_type_test/none: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+mirrors/reflected_type_typedefs_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+mirrors/reflected_type_typevars_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+mirrors/reflectively_instantiate_uninstantiated_class_test: Crash # "on T" catch block
+mirrors/reflect_model_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+mirrors/reflect_two_classes_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+mirrors/regress_14304_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+mirrors/regress_19731_test: Crash # (throw new ExpectException(message)): Unhandled node
+mirrors/relation_assignable_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+mirrors/relation_subclass_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+mirrors/relation_subtype_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+mirrors/removed_api_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+mirrors/repeated_private_anon_mixin_app_test: Crash # (throw new ExpectException(message)): Unhandled node
+mirrors/return_type_test: Crash # (throw new ExpectException(message)): Unhandled node
+mirrors/runtime_type_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+mirrors/set_field_with_final_inheritance_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+mirrors/set_field_with_final_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+mirrors/spawn_function_root_library_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+mirrors/static_members_easier_test: Crash # (throw new ExpectException(message)): Unhandled node
+mirrors/static_members_test: Crash # (throw new ExpectException(message)): Unhandled node
+mirrors/static_test: Crash # (throw new ExpectException(message)): Unhandled node
+mirrors/superclass2_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+mirrors/superclass_test: Crash # (throw new ExpectException(message)): Unhandled node
+mirrors/symbol_validation_test/01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+mirrors/symbol_validation_test/none: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+mirrors/synthetic_accessor_properties_test: Crash # (throw new ExpectException(message)): Unhandled node
+mirrors/top_level_accessors_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+mirrors/to_string_test: Crash # (throw new ExpectException(message)): Unhandled node
+mirrors/type_argument_is_type_variable_test: Crash # (throw new ExpectException(message)): Unhandled node
+mirrors/typearguments_mirror_test: Crash # (throw new ExpectException(message)): Unhandled node
+mirrors/typedef_deferred_library_test: Crash # (throw _buildException('asyncEnd() was called before asyncStart().')): Unhandled node
+mirrors/typedef_in_signature_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+mirrors/typedef_library_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+mirrors/typedef_metadata_test: Crash # (throw 'Null metadata on ${mirror}'): Unhandled node
+mirrors/typedef_reflected_type_test/01: Crash # (throw new ExpectException(message)): Unhandled node
+mirrors/typedef_reflected_type_test/none: Crash # (throw new ExpectException(message)): Unhandled node
+mirrors/typedef_test: Crash # (throw new ExpectException(message)): Unhandled node
+mirrors/type_mirror_for_type_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+mirrors/type_variable_is_static_test: Crash # (throw new ExpectException(message)): Unhandled node
+mirrors/type_variable_owner_test/01: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+mirrors/type_variable_owner_test/none: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+mirrors/unmangled_type_test: Crash # (throw new ExpectException(message)): Unhandled node
+mirrors/unnamed_library_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+mirrors/variable_is_const_test/01: Crash # (throw new ExpectException(message)): Unhandled node
+mirrors/variable_is_const_test/none: Crash # (throw new ExpectException(message)): Unhandled node
+profiler/metrics_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+profiler/user_tags_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+typed_data/byte_data_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+typed_data/constructor_checks_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+typed_data/endianness_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+typed_data/float32x4_clamp_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+typed_data/float32x4_cross_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+typed_data/float32x4_list_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+typed_data/float32x4_shuffle_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+typed_data/float32x4_sign_mask_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+typed_data/float32x4_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+typed_data/float32x4_transpose_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+typed_data/float32x4_two_arg_shuffle_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+typed_data/float32x4_unbox_phi_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+typed_data/float32x4_unbox_regress_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+typed_data/float64x2_functional_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+typed_data/int32x4_arithmetic_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+typed_data/int32x4_bigint_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+typed_data/int32x4_list_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+typed_data/int32x4_shuffle_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+typed_data/int32x4_sign_mask_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+typed_data/int32x4_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+typed_data/int64_list_load_store_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+typed_data/setRange_1_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+typed_data/setRange_2_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+typed_data/setRange_3_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+typed_data/setRange_4_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+typed_data/setRange_5_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+typed_data/simd_store_to_load_forward_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+typed_data/typed_data_hierarchy_int64_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+typed_data/typed_data_hierarchy_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+typed_data/typed_data_list_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+typed_data/typed_data_load2_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+typed_data/typed_data_sublist_type_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+typed_data/typed_list_iterable_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
diff --git a/tests/lib/mirrors/deferred_type_other.dart b/tests/lib/mirrors/deferred_type_other.dart
new file mode 100644
index 0000000..87dfd47
--- /dev/null
+++ b/tests/lib/mirrors/deferred_type_other.dart
@@ -0,0 +1,7 @@
+// Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+library deferred_type_other;
+
+class DeferredType {}
\ No newline at end of file
diff --git a/tests/lib/mirrors/deferred_type_test.dart b/tests/lib/mirrors/deferred_type_test.dart
new file mode 100644
index 0000000..2681f69
--- /dev/null
+++ b/tests/lib/mirrors/deferred_type_test.dart
@@ -0,0 +1,18 @@
+// Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+library deferred_type;
+
+import 'dart:mirrors';
+import 'package:expect/expect.dart';
+import 'package:async_helper/async_helper.dart';
+
+import 'deferred_type_other.dart' deferred as other;
+
+bad(other.DeferredType x) {}
+
+main() {
+ print((reflect(bad) as ClosureMirror).function.parameters[0].type);
+ throw "Should have died sooner. other.DeferredType is not loaded";
+}
\ No newline at end of file
diff --git a/tests/lib/mirrors/invocation_fuzz_test.dart b/tests/lib/mirrors/invocation_fuzz_test.dart
index 61e7626..4afd372 100644
--- a/tests/lib/mirrors/invocation_fuzz_test.dart
+++ b/tests/lib/mirrors/invocation_fuzz_test.dart
@@ -37,6 +37,10 @@
// TODO(15274): Fix them and remove from blacklist.
'dart.io.SystemEncoding.decode', // Windows only
'dart.io.SystemEncoding.encode', // Windows only
+
+ // Don't call private methods in dart.async as they may circumvent the zoned
+ // error handling below.
+ new RegExp(r"^dart\.async\._.*$"),
];
bool isBlacklisted(Symbol qualifiedSymbol) {
diff --git a/tests/lib/mirrors/library_enumeration_deferred_loading_test.dart b/tests/lib/mirrors/library_enumeration_deferred_loading_test.dart
new file mode 100644
index 0000000..8ad5501
--- /dev/null
+++ b/tests/lib/mirrors/library_enumeration_deferred_loading_test.dart
@@ -0,0 +1,26 @@
+// Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+library library_enumeration_deferred_loading;
+
+import 'dart:mirrors';
+import 'package:expect/expect.dart';
+import 'package:async_helper/async_helper.dart';
+
+import 'other_library.dart' deferred as other;
+
+main() {
+ var ms = currentMirrorSystem();
+ Expect.throws(() => ms.findLibrary(#test.other_library),
+ (e) => true, "should not be loaded yet");
+
+ asyncStart();
+ other.loadLibrary().then((_) {
+ asyncEnd();
+ LibraryMirror otherMirror = ms.findLibrary(#test.other_library);
+ Expect.isNotNull(otherMirror);
+ Expect.equals(#test.other_library, otherMirror.simpleName);
+ Expect.equals(42, other.topLevelMethod());
+ });
+}
\ No newline at end of file
diff --git a/tests/lib/mirrors/library_import_deferred_loading_test.dart b/tests/lib/mirrors/library_import_deferred_loading_test.dart
new file mode 100644
index 0000000..d25daf8
--- /dev/null
+++ b/tests/lib/mirrors/library_import_deferred_loading_test.dart
@@ -0,0 +1,28 @@
+// Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+library library_loading_deferred_loading;
+
+import 'dart:mirrors';
+import 'package:expect/expect.dart';
+import 'stringify.dart';
+import 'package:async_helper/async_helper.dart';
+
+import 'other_library.dart' deferred as other;
+
+main() {
+ var ms = currentMirrorSystem();
+ LibraryMirror thisLibrary = ms.findLibrary(#library_loading_deferred_loading);
+ LibraryDependencyMirror dep =
+ thisLibrary.libraryDependencies.singleWhere((d) => d.prefix == #other);
+ Expect.isNull(dep.targetLibrary, "should not be loaded yet");
+
+ asyncStart();
+ other.loadLibrary().then((_) {
+ asyncEnd();
+ Expect.isNotNull(dep.targetLibrary);
+ Expect.equals(#test.other_library, dep.targetLibrary.simpleName);
+ Expect.equals(42, other.topLevelMethod());
+ });
+}
\ No newline at end of file
diff --git a/tests/lib/mirrors/load_library_test.dart b/tests/lib/mirrors/load_library_test.dart
new file mode 100644
index 0000000..7057eec
--- /dev/null
+++ b/tests/lib/mirrors/load_library_test.dart
@@ -0,0 +1,27 @@
+// Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+library load_library;
+
+import 'dart:mirrors';
+import 'package:expect/expect.dart';
+import 'package:async_helper/async_helper.dart';
+
+import 'other_library.dart' deferred as other;
+
+main() {
+ var ms = currentMirrorSystem();
+ LibraryMirror thisLibrary = ms.findLibrary(#load_library);
+ var dep =
+ thisLibrary.libraryDependencies.singleWhere((d) => d.prefix == #other);
+ Expect.isNull(dep.targetLibrary, "should not be loaded yet");
+
+ asyncStart();
+ dep.loadLibrary().then((_) {
+ asyncEnd();
+ Expect.isNotNull(dep.targetLibrary);
+ Expect.equals(#test.other_library, dep.targetLibrary.simpleName);
+ Expect.equals(42, other.topLevelMethod());
+ });
+}
\ No newline at end of file
diff --git a/tests/lib/mirrors/spawn_function_root_library_test.dart b/tests/lib/mirrors/spawn_function_root_library_test.dart
new file mode 100644
index 0000000..89b9475
--- /dev/null
+++ b/tests/lib/mirrors/spawn_function_root_library_test.dart
@@ -0,0 +1,25 @@
+// Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+import 'dart:mirrors';
+import 'dart:isolate';
+import 'package:expect/expect.dart';
+
+child(SendPort port) {
+ LibraryMirror root = currentMirrorSystem().isolate.rootLibrary;
+ Expect.isNotNull(root);
+ port.send(root.uri.toString());
+}
+
+main() {
+ var port;
+ port = new RawReceivePort((String childRootUri) {
+ LibraryMirror root = currentMirrorSystem().isolate.rootLibrary;
+ Expect.isNotNull(root);
+ Expect.equals(root.uri.toString(), childRootUri);
+ port.close();
+ });
+
+ Isolate.spawn(child, port.sendPort);
+}
\ No newline at end of file
diff --git a/tests/standalone/io/file_system_uri_test.dart b/tests/standalone/io/file_system_uri_test.dart
new file mode 100644
index 0000000..68e8add
--- /dev/null
+++ b/tests/standalone/io/file_system_uri_test.dart
@@ -0,0 +1,42 @@
+// Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+import "package:expect/expect.dart";
+import "dart:io";
+
+testFile(String input) {
+ if (Platform.isWindows) {
+ input = input.replaceAll('/', '\\');
+ }
+ var file = new File(input);
+ var uri = file.uri;
+ var file2 = new File.fromUri(uri);
+ Expect.equals(file.path, file2.path, input);
+}
+
+testDirectory(String input, [String output]) {
+ if (output == null) output = input;
+ if (Platform.isWindows) {
+ input = input.replaceAll('/', '\\');
+ output = output.replaceAll('/', '\\');
+ }
+ var dir = new Directory(input);
+ var uri = dir.uri;
+ var dir2 = new Directory.fromUri(uri);
+ Expect.equals(output, dir2.path, input);
+}
+
+void main() {
+ testFile("");
+ testFile("/");
+ testFile("foo/bar");
+ testFile("/foo/bar");
+ testFile("/foo/bar/");
+
+ testDirectory("");
+ testDirectory("/");
+ testDirectory("foo/bar", "foo/bar/");
+ testDirectory("/foo/bar", "/foo/bar/");
+ testDirectory("/foo/bar/");
+}
diff --git a/tests/standalone/standalone.status b/tests/standalone/standalone.status
index 4b5e3d2..b2e91a8 100644
--- a/tests/standalone/standalone.status
+++ b/tests/standalone/standalone.status
@@ -111,7 +111,7 @@
# Skip until we stabilize language tests.
*: Skip
-[ $arch == simarm || $arch == simmips]
+[ $arch == simarm || $arch == simarmv5te || $arch == simmips]
out_of_memory_test: Skip # passes on Mac, crashes on Linux
oom_error_stacktrace_test: Skip # Fails on Linux
@@ -133,11 +133,11 @@
io/http_client_stays_alive_test: Skip # Timing dependent test, MIPS machine too slow.
[ $compiler == none && ($runtime == dartium || $runtime == ContentShellOnAndroid) && $unchecked ]
-assert_test: Fail # Issue 13719: Please triage this failure.
+assert_test: Fail # Issue 14651.
[ $compiler == none && ($runtime == dartium || $runtime == ContentShellOnAndroid) ]
-javascript_int_overflow_literal_test/01: Fail # Issue 13719: Please triage this failure.
-javascript_int_overflow_test: Fail # Issue 13719: Please triage this failure.
+javascript_int_overflow_literal_test/01: Fail # Issue 14651.
+javascript_int_overflow_test: Fail # Issue 14651.
[ $compiler == dartanalyzer || $compiler == dart2analyzer ]
io/directory_invalid_arguments_test: StaticWarning
@@ -159,7 +159,7 @@
[ $system == windows ]
io/skipping_dart2js_compilations_test: Fail # Issue 19551.
-[ $arch != ia32 && $arch != x64 && $arch != simarm && $mode == debug ]
+[ $arch != ia32 && $arch != x64 && $arch != simarm && $arch != simarmv5te && $mode == debug ]
verified_mem_test: Skip # Not yet implemented.
[ $runtime == vm && $mode == debug && $builder_tag == asan ]
@@ -167,3 +167,219 @@
io/file_lock_test: Skip # Timeout.
io/test_runner_test: Skip # Timeout.
io/http_client_stays_alive_test: Skip # Timeout.
+
+[ $compiler == dart2js && $cps_ir ]
+array_bounds_check_generalization_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+assert_test: Crash # "on T" catch block
+byte_array_view_optimized_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+constant_left_shift_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+coverage_test: Crash # unsupported element kind: context:field
+deoptimization_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+double_temp_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+double_to_int_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+int_list_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+io/addlatexhash_test: Crash # (try {test(tempDir.path);}finally {tempDir.delete(recursive:true);}): not exactly one catch block
+io/async_catch_errors_test: Crash # (throw new ExpectException(message)): Unhandled node
+io/code_collection_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+io/create_recursive_test: Crash # (throw _buildException('asyncEnd() was called before asyncStart().')): Unhandled node
+io/dart_std_io_pipe_test: Crash # (throw new ExpectException(message)): Unhandled node
+io/delete_symlink_test: Crash # (throw _buildException('asyncEnd() was called before asyncStart().')): Unhandled node
+io/dependency_graph_test: Crash # unsupported element kind: UnableToRun:field
+io/directory_chdir_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+io/directory_create_race_test: Crash # (throw _buildException('asyncEnd() was called before asyncStart().')): Unhandled node
+io/directory_error_test: Crash # Unhandled node
+io/directory_fuzz_test: Crash # Please triage this failure.
+io/directory_invalid_arguments_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+io/directory_list_nonexistent_test: Crash # (throw _buildException('asyncEnd() was called before asyncStart().')): Unhandled node
+io/directory_list_pause_test: Crash # Please triage this failure.
+io/directory_non_ascii_sync_test: Crash # (throw new ExpectException(message)): Unhandled node
+io/directory_non_ascii_test: Crash # (throw _buildException('asyncEnd() was called before asyncStart().')): Unhandled node
+io/directory_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+io/directory_uri_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+io/echo_server_stream_test: Crash # (throw new ExpectException(message)): Unhandled node
+io/file_absolute_path_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+io/file_constructor_test: Crash # "on T" catch block
+io/file_copy_test: Crash # (throw _buildException('asyncEnd() was called before asyncStart().')): Unhandled node
+io/file_error_test: Crash # (throw _buildException('asyncEnd() was called before asyncStart().')): Unhandled node
+io/file_fuzz_test: Crash # Please triage this failure.
+io/file_input_stream_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+io/file_invalid_arguments_test: Crash # (throw _buildException('asyncEnd() was called before asyncStart().')): Unhandled node
+io/file_lock_test: Crash # (throw _buildException('asyncEnd() was called before asyncStart().')): Unhandled node
+io/file_non_ascii_sync_test: Crash # (throw new ExpectException(message)): Unhandled node
+io/file_non_ascii_test: Crash # (throw new ExpectException(message)): Unhandled node
+io/file_output_stream_test: Crash # (throw _buildException('asyncEnd() was called before asyncStart().')): Unhandled node
+io/file_read_encoded_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+io/file_read_special_device_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+io/file_stat_test: Crash # (throw _buildException('asyncEnd() was called before asyncStart().')): Unhandled node
+io/file_stream_test: Crash # (throw _buildException('asyncEnd() was called before asyncStart().')): Unhandled node
+io/file_system_async_links_test: Crash # (throw _buildException('asyncEnd() was called before asyncStart().')): Unhandled node
+io/file_system_delete_test: Crash # (throw new ExpectException(message)): Unhandled node
+io/file_system_exists_test: Crash # (throw new ExpectException(message)): Unhandled node
+io/file_system_links_test: Crash # (throw _buildException('asyncEnd() was called before asyncStart().')): Unhandled node
+io/file_system_uri_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+io/file_system_watcher_test: Crash # unsupported element kind: context:field
+io/file_test: Crash # (throw _buildException('asyncEnd() was called before asyncStart().')): Unhandled node
+io/file_typed_data_test: Crash # Please triage this failure.
+io/file_uri_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+io/file_windows_test: Crash # (throw new ExpectException(message)): Unhandled node
+io/file_write_as_test: Crash # (throw _buildException('asyncEnd() was called before asyncStart().')): Unhandled node
+io/http_10_test: Crash # (throw new ExpectException(message)): Unhandled node
+io/http_advanced_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+io/http_auth_digest_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+io/http_auth_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+io/http_basic_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+io/http_bind_test: Crash # cannot handle async/sync*/async* functions
+io/http_client_connect_test: Crash # (throw _buildException('asyncEnd() was called before asyncStart().')): Unhandled node
+io/http_client_exception_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+io/http_client_request_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+io/http_close_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+io/http_compression_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+io/http_connection_header_test: Crash # (throw new ExpectException(message)): Unhandled node
+io/http_connection_info_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+io/http_content_length_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+io/http_cookie_date_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+io/http_cookie_test: Crash # (throw new ExpectException(message)): Unhandled node
+io/http_cross_process_test: Crash # (throw new ExpectException(message)): Unhandled node
+io/http_date_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+io/http_detach_socket_test: Crash # (throw new ExpectException(message)): Unhandled node
+io/http_head_test: Crash # (throw new ExpectException(message)): Unhandled node
+io/http_headers_state_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+io/http_headers_test: Crash # (throw new ExpectException(message)): Unhandled node
+io/http_ipv6_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+io/http_keep_alive_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+io/http_no_reason_phrase_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+io/http_outgoing_size_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+io/http_parser_test: Crash # (throw new ExpectException(message)): Unhandled node
+io/http_proxy_configuration_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+io/http_proxy_test: Crash # Please triage this failure.
+io/http_read_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+io/http_redirect_test: Crash # (throw new ExpectException(message)): Unhandled node
+io/http_request_pipeling_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+io/http_requested_uri_test: Crash # (throw _buildException('asyncEnd() was called before asyncStart().')): Unhandled node
+io/http_response_deadline_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+io/http_server_early_client_close_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+io/http_server_response_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+io/http_server_test: Crash # (throw new ExpectException(message)): Unhandled node
+io/http_session_test: Crash # (throw new ExpectException(message)): Unhandled node
+io/https_bad_certificate_test: Crash # (throw new ExpectException(message)): Unhandled node
+io/https_client_certificate_test: Crash # (throw _buildException('asyncEnd() was called before asyncStart().')): Unhandled node
+io/https_client_exception_test: Crash # (throw _buildException('asyncEnd() was called before asyncStart().')): Unhandled node
+io/https_server_test: Crash # (throw new ExpectException(message)): Unhandled node
+io/https_unauthorized_test: Crash # (throw e): Unhandled node
+io/internet_address_invalid_arguments_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+io/internet_address_test: Crash # (throw new ExpectException(message)): Unhandled node
+io/io_sink_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+io/issue_22636_test: Crash # cannot handle async/sync*/async* functions
+io/issue_22637_test: Crash # cannot handle async/sync*/async* functions
+io/link_async_test: Crash # (throw _buildException('asyncEnd() was called before asyncStart().')): Unhandled node
+io/link_test: Crash # (throw new ExpectException(message)): Unhandled node
+io/link_uri_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+io/network_interface_test: Crash # (throw new ExpectException(message)): Unhandled node
+io/observatory_test: Crash # (throw _buildException('asyncEnd() was called before asyncStart().')): Unhandled node
+io/parent_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+io/pipe_server_test: Crash # (throw _buildException('asyncEnd() was called before asyncStart().')): Unhandled node
+io/platform_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+io/print_sync_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+io/process_check_arguments_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+io/process_detached_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+io/process_environment_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+io/process_exit_negative_test: Crash # (a): Error expression `a` unhandled.
+io/process_exit_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+io/process_invalid_arguments_test: Crash # (throw new ExpectException(message)): Unhandled node
+io/process_kill_test: Crash # (throw new ExpectException(message)): Unhandled node
+io/process_non_ascii_test: Crash # (throw _buildException('asyncEnd() was called before asyncStart().')): Unhandled node
+io/process_path_environment_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+io/process_path_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+io/process_pid_test: Crash # (throw _buildException('asyncEnd() was called before asyncStart().')): Unhandled node
+io/process_run_output_test: Crash # (throw new ExpectException(message)): Unhandled node
+io/process_run_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+io/process_segfault_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+io/process_set_exit_code_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+io/process_start_exception_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+io/process_stderr_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+io/process_stdin_transform_unsubscribe_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+io/process_stdout_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+io/process_sync_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+io/process_working_directory_test: Crash # (throw new ExpectException(message)): Unhandled node
+io/raw_datagram_read_all_test: Crash # (throw _buildException('asyncEnd() was called before asyncStart().')): Unhandled node
+io/raw_datagram_socket_test: Crash # Unhandled node
+io/raw_secure_server_closing_test: Crash # (throw _buildException('asyncEnd() was called before asyncStart().')): Unhandled node
+io/raw_secure_server_socket_argument_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+io/raw_secure_server_socket_test: Crash # (throw _buildException('asyncEnd() was called before asyncStart().')): Unhandled node
+io/raw_secure_socket_pause_test: Crash # Unhandled node
+io/raw_secure_socket_test: Crash # Unhandled node
+io/raw_server_socket_cancel_test: Crash # (throw _buildException('asyncEnd() was called before asyncStart().')): Unhandled node
+io/raw_socket_cross_process_test: Crash # (throw new ExpectException(message)): Unhandled node
+io/raw_socket_test: Crash # (throw _buildException('asyncEnd() was called before asyncStart().')): Unhandled node
+io/raw_socket_typed_data_test: Crash # Please triage this failure.
+io/raw_socket_write_destroy_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+io/read_into_const_list_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+io/regress_10026_test: Crash # (throw _buildException('asyncEnd() was called before asyncStart().')): Unhandled node
+io/regress_21160_test: Crash # Unhandled node
+io/regress_21987_test: Crash # (throw _buildException('asyncEnd() was called before asyncStart().')): Unhandled node
+io/regress_7679_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+io/regress_8828_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+io/regress_9194_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+io/resolve_symbolic_links_test: Crash # (throw _buildException('asyncEnd() was called before asyncStart().')): Unhandled node
+io/secure_bad_certificate_test: Crash # (throw new ExpectException(message)): Unhandled node
+io/secure_builtin_roots_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+io/secure_client_raw_server_test: Crash # (throw _buildException('asyncEnd() was called before asyncStart().')): Unhandled node
+io/secure_client_server_test: Crash # (throw _buildException('asyncEnd() was called before asyncStart().')): Unhandled node
+io/secure_multiple_client_server_test: Crash # (throw _buildException('asyncEnd() was called before asyncStart().')): Unhandled node
+io/secure_server_client_certificate_test: Crash # (throw _buildException('asyncEnd() was called before asyncStart().')): Unhandled node
+io/secure_server_client_no_certificate_test: Crash # (throw _buildException('asyncEnd() was called before asyncStart().')): Unhandled node
+io/secure_server_closing_test: Crash # (throw _buildException('asyncEnd() was called before asyncStart().')): Unhandled node
+io/secure_server_socket_test: Crash # (throw _buildException('asyncEnd() was called before asyncStart().')): Unhandled node
+io/secure_session_resume_test: Crash # (throw _buildException('asyncEnd() was called before asyncStart().')): Unhandled node
+io/secure_socket_alpn_test: Crash # (throw _buildException('asyncEnd() was called before asyncStart().')): Unhandled node
+io/secure_socket_argument_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+io/secure_socket_bad_data_test: Crash # (throw _buildException('asyncEnd() was called before asyncStart().')): Unhandled node
+io/secure_socket_renegotiate_test: Crash # (throw new ExpectException(message)): Unhandled node
+io/secure_socket_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+io/secure_unauthorized_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+io/signals_test: Crash # (throw _buildException('asyncEnd() was called before asyncStart().')): Unhandled node
+io/skipping_dart2js_compilations_test: Crash # unsupported element kind: currentWorkingDirectory:field
+io/sleep_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+io/snapshot_fail_test: Crash # (throw new ExpectException(message)): Unhandled node
+io/socket_bind_test: Crash # (throw _buildException('asyncEnd() was called before asyncStart().')): Unhandled node
+io/socket_close_test: Crash # Unhandled node
+io/socket_cross_process_test: Crash # (throw new ExpectException(message)): Unhandled node
+io/socket_exception_test: Crash # (throw _buildException('asyncEnd() was called before asyncStart().')): Unhandled node
+io/socket_info_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+io/socket_invalid_arguments_test: Crash # (throw _buildException('asyncEnd() was called before asyncStart().')): Unhandled node
+io/socket_ipv6_test: Crash # (throw _buildException('asyncEnd() was called before asyncStart().')): Unhandled node
+io/socket_many_connections_test: Crash # (throw new ExpectException(message)): Unhandled node
+io/socket_port_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+io/socket_source_address_test: Crash # cannot handle async/sync*/async* functions
+io/socket_test: Crash # (throw _buildException('asyncEnd() was called before asyncStart().')): Unhandled node
+io/socket_upgrade_to_secure_test: Crash # (throw _buildException('asyncEnd() was called before asyncStart().')): Unhandled node
+io/status_file_parser_test: Crash # (throw new Exception('Cannot find test status file ${path}')): Unhandled node
+io/stdio_nonblocking_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+io/stdout_bad_argument_test: Crash # handleStaticFunctionGet: function(print)
+io/stdout_close_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+io/stdout_stderr_non_blocking_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+io/stdout_stderr_terminal_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+io/stdout_stderr_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+io/stream_pipe_test: Crash # (throw _buildException('asyncEnd() was called before asyncStart().')): Unhandled node
+io/test_extension_fail_test: Crash # (throw new StateError("bad exit code")): Unhandled node
+io/test_extension_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+io/test_runner_test: Crash # Unhandled node
+io/uri_platform_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+io/web_socket_error_test: Crash # (throw _buildException('asyncEnd() was called before asyncStart().')): Unhandled node
+io/web_socket_ping_test: Crash # (throw new StateError('Hash update method called after digest was retrieved')): Unhandled node
+io/web_socket_pipe_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+io/web_socket_protocol_test: Crash # (throw new ExpectException(message)): Unhandled node
+io/web_socket_test: Crash # (throw _buildException('asyncEnd() was called before asyncStart().')): Unhandled node
+io/web_socket_typed_data_test: Crash # (throw new ExpectException(message)): Unhandled node
+io/windows_environment_test: Crash # (throw "Exit code not 0"): Unhandled node
+io/windows_file_system_async_links_test: Crash # (throw _buildException('asyncEnd() was called before asyncStart().')): Unhandled node
+io/windows_file_system_links_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+io/zlib_test: Crash # (throw _buildException('asyncEnd() was called before asyncStart().')): Unhandled node
+medium_integer_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+oom_error_stacktrace_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+out_of_memory_test: Crash # "on T" catch block
+priority_queue_stress_test: Crash # cannot compile methods that need interceptor calling convention.
+slowpath_safepoints_test: Crash # handleStaticFunctionGet: function(noop)
+status_expression_test: Crash # (throw new ExpectException(message)): Unhandled node
+typed_array_test: Crash # Instance of 'TypeOperator': unimplemented in CodeGenerator
+verified_mem_test: Crash # unsupported element kind: a:field
diff --git a/tests/try/poi/forget_element_test.dart b/tests/try/poi/forget_element_test.dart
index ea27be5..e1ebd3b 100644
--- a/tests/try/poi/forget_element_test.dart
+++ b/tests/try/poi/forget_element_test.dart
@@ -26,7 +26,7 @@
import 'package:compiler/src/elements/visitor.dart' show
ElementVisitor;
-import 'package:compiler/src/dart2jslib.dart' show
+import 'package:compiler/src/compile_time_constants.dart' show
DartConstantCompiler;
import 'package:compiler/src/universe/universe.dart' show
@@ -198,7 +198,7 @@
});
List<MetadataAnnotation> metadata =
- (new MetadataCollector()..visit(library)).metadata;
+ (new MetadataCollector()..visit(library, null)).metadata;
return collector.nodes;
}
@@ -282,16 +282,16 @@
class MetadataCollector extends ElementVisitor {
final List<MetadataAnnotation> metadata = <MetadataAnnotation>[];
- void visitElement(Element e) {
+ void visitElement(Element e, _) {
metadata.addAll(e.metadata.toList());
}
- void visitScopeContainerElement(ScopeContainerElement e) {
+ void visitScopeContainerElement(ScopeContainerElement e, _) {
super.visitScopeContainerElement(e);
e.forEachLocalMember(this.visit);
}
- void visitFunctionElement(FunctionElement e) {
+ void visitFunctionElement(FunctionElement e, _) {
super.visitFunctionElement(e);
if (e.hasFunctionSignature) {
e.functionSignature.forEachParameter(this.visit);
diff --git a/tests/try/try.status b/tests/try/try.status
index b481a5d..722e5b9 100644
--- a/tests/try/try.status
+++ b/tests/try/try.status
@@ -2,7 +2,7 @@
# for details. All rights reserved. Use of this source code is governed by a
# BSD-style license that can be found in the LICENSE file.
-web/incremental_compilation_update_test: Slow, Pass
+web/incremental_compilation_update_test: Slow, RuntimeError # issue 23197
[ $runtime == ie10 || $runtime == ie9 || $runtime == vm || $jscl ]
web/*: Skip
diff --git a/tests/utils/utils.status b/tests/utils/utils.status
index d6c60ad..25aefd7 100644
--- a/tests/utils/utils.status
+++ b/tests/utils/utils.status
@@ -31,3 +31,8 @@
[ $compiler == dart2dart && $builder_tag != new_backend ]
source_mirrors_test: Slow, Pass
dummy_compiler_test: Slow, Pass
+
+[ $compiler == dart2js && $cps_ir ]
+dummy_compiler_test: Crash # (throw _buildException('asyncEnd() was called before asyncStart().')): Unhandled node
+recursive_import_test: Crash # (throw _buildException('asyncEnd() was called before asyncStart().')): Unhandled node
+source_mirrors_test: Crash # (throw _buildException('asyncEnd() was called before asyncStart().')): Unhandled node
diff --git a/tools/VERSION b/tools/VERSION
index f5159ae..b065068 100644
--- a/tools/VERSION
+++ b/tools/VERSION
@@ -25,7 +25,7 @@
#
CHANNEL dev
MAJOR 1
-MINOR 10
+MINOR 11
PATCH 0
-PRERELEASE 1
-PRERELEASE_PATCH 11
+PRERELEASE 0
+PRERELEASE_PATCH 0
diff --git a/tools/bots/bot.py b/tools/bots/bot.py
index 9590a49..550cb47 100644
--- a/tools/bots/bot.py
+++ b/tools/bots/bot.py
@@ -41,12 +41,13 @@
- dart2js_full: Boolean indicating whether this builder will run dart2js
on several different runtimes.
- builder_tag: A tag indicating a special builder setup.
+ - cps_ir: Run the compiler with the cps based backend
"""
def __init__(self, compiler, runtime, mode, system, checked=False,
host_checked=False, minified=False, shard_index=None,
total_shards=None, is_buildbot=False, test_set=None,
csp=None, arch=None, dart2js_full=False, builder_tag=None,
- batch=False):
+ batch=False, cps_ir=False):
self.compiler = compiler
self.runtime = runtime
self.mode = mode
@@ -62,6 +63,7 @@
self.dart2js_full = dart2js_full
self.builder_tag = builder_tag
self.batch = batch
+ self.cps_ir = cps_ir
if (arch == None):
self.arch = 'ia32'
else:
diff --git a/tools/bots/compiler.py b/tools/bots/compiler.py
index 9e47f59..a784a03 100644
--- a/tools/bots/compiler.py
+++ b/tools/bots/compiler.py
@@ -23,7 +23,7 @@
DARTIUM_BUILDER = r'none-dartium-(linux|mac|windows)'
DART2JS_BUILDER = (
- r'dart2js-(linux|mac|windows)(-(jsshell))?-(debug|release)(-(checked|host-checked))?(-(host-checked))?(-(minified))?(-(x64))?-?(\d*)-?(\d*)')
+ r'dart2js-(linux|mac|windows)(-(jsshell))?-(debug|release)(-(checked|host-checked))?(-(host-checked))?(-(minified))?(-(x64))?(-(cps))?-?(\d*)-?(\d*)')
DART2JS_FULL_BUILDER = r'full-(linux|mac|win7|win8)(-(ie10|ie11))?(-checked)?(-minified)?-(\d+)-(\d+)'
WEB_BUILDER = (
r'dart2js-(ie9|ie10|ie11|ff|safari|chrome|chromeOnAndroid|safarimobilesim|opera|drt)-(win7|win8|mac10\.7|mac10\.8|mac10\.9|linux)(-(all|html))?(-(csp))?(-(\d+)-(\d+))?')
@@ -66,6 +66,7 @@
dart2js_full = False
batch = True
builder_tag = None
+ cps_ir = None
dart2js_pattern = re.match(DART2JS_BUILDER, builder_name)
dart2js_full_pattern = re.match(DART2JS_FULL_BUILDER, builder_name)
@@ -126,8 +127,10 @@
minified = True
if dart2js_pattern.group(12) == 'x64':
arch = 'x64'
- shard_index = dart2js_pattern.group(13)
- total_shards = dart2js_pattern.group(14)
+ if dart2js_pattern.group(14) == 'cps':
+ cps_ir = True
+ shard_index = dart2js_pattern.group(15)
+ total_shards = dart2js_pattern.group(16)
elif dartium_pattern:
compiler = 'none'
runtime = 'dartium'
@@ -154,7 +157,7 @@
return bot.BuildInfo(compiler, runtime, mode, system, checked, host_checked,
minified, shard_index, total_shards, is_buildbot,
test_set, csp, arch, dart2js_full, batch=batch,
- builder_tag=builder_tag)
+ builder_tag=builder_tag, cps_ir=cps_ir)
def NeedsXterm(compiler, runtime):
@@ -359,6 +362,7 @@
if build_info.batch: test_flags += ['--dart2js-batch']
if build_info.builder_tag: test_flags += ['--builder-tag=' +
build_info.builder_tag]
+ if build_info.cps_ir: test_flags += ['--cps-ir']
if build_info.dart2js_full:
compiler = build_info.compiler
diff --git a/tools/bots/dart_services.py b/tools/bots/dart_services.py
new file mode 100644
index 0000000..dd0fe3f
--- /dev/null
+++ b/tools/bots/dart_services.py
@@ -0,0 +1,63 @@
+#!/usr/bin/python
+
+# Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
+# for details. All rights reserved. Use of this source code is governed by a
+# BSD-style license that can be found in the LICENSE file.
+
+"""
+Buildbot steps for stress testing analysis engine
+"""
+import os
+import shutil
+import sys
+import bot
+import bot_utils
+
+utils = bot_utils.GetUtils()
+
+def ServicesConfig(name, is_buildbot):
+ """Returns info for the current buildbot.
+ We only run this bot on linux, so all of this is just hard coded.
+ """
+ return bot.BuildInfo('none', 'none', 'release', 'linux')
+
+def Run(args):
+ print "Running: %s" % ' '.join(args)
+ sys.stdout.flush()
+ bot.RunProcess(args)
+
+def ServicesSteps(build_info):
+ build_root = utils.GetBuildRoot('linux')
+ sdk_bin = utils.GetBuildSdkBin('linux', mode='release', arch='ia32')
+ dart_services = os.path.join('third_party', 'dart-services')
+ dart_services_copy = os.path.join(build_root, 'dart-services')
+
+ with bot.BuildStep('Create copy of dart_services'):
+ print 'Removing existing copy of dart_services'
+ shutil.rmtree(dart_services_copy, ignore_errors=True)
+ args = ['cp', '-R', dart_services, dart_services_copy]
+ Run(args)
+
+ with bot.BuildStep('Fixing pubspec file'):
+ pubspec = os.path.join(dart_services_copy, 'pubspec.yaml')
+ # TODO(lukechurch): Actually provide the name of the alternative pubspec
+ testing_pubspec = os.path.join(dart_services_copy, 'pubspec.foobar.yaml')
+ print 'Fixing pubspec up for stress testing'
+ # TODO(lukechurch): change to do the mv of the testing pubspec
+ Run(['ls', pubspec])
+
+ with bot.BuildStep('Run pub'):
+ print 'Print running pub'
+ pub = os.path.join(sdk_bin, 'pub')
+ with utils.ChangedWorkingDirectory(dart_services_copy):
+ args = [pub, 'get']
+
+ with bot.BuildStep('Stress testing'):
+ # Consider doing something more useful here.
+ args = ['ls', 'third_party']
+ Run(args)
+
+
+if __name__ == '__main__':
+ bot.RunBot(ServicesConfig, ServicesSteps)
+
diff --git a/tools/build.py b/tools/build.py
index 4282589..fc2e1cf 100755
--- a/tools/build.py
+++ b/tools/build.py
@@ -55,7 +55,8 @@
default=False, action="store_true")
result.add_option("-a", "--arch",
help='Target architectures (comma-separated).',
- metavar='[all,ia32,x64,simarm,arm,armv5te,simmips,mips,simarm64,arm64,]',
+ metavar='[all,ia32,x64,simarm,arm,simarmv5te,armv5te,simmips,mips'
+ ',simarm64,arm64,]',
default=utils.GuessArchitecture())
result.add_option("--os",
help='Target OSs (comma-separated).',
@@ -105,8 +106,8 @@
print "Unknown mode %s" % mode
return False
for arch in options.arch:
- archs = ['ia32', 'x64', 'simarm', 'arm', 'armv5te', 'simmips', 'mips',
- 'simarm64', 'arm64',]
+ archs = ['ia32', 'x64', 'simarm', 'arm', 'simarmv5te', 'armv5te', 'simmips',
+ 'mips', 'simarm64', 'arm64',]
if not arch in archs:
print "Unknown arch %s" % arch
return False
diff --git a/tools/create_sdk.py b/tools/create_sdk.py
index 72c1235..1424c4d 100755
--- a/tools/create_sdk.py
+++ b/tools/create_sdk.py
@@ -45,6 +45,7 @@
# ......math/
# ......mirrors/
# ......typed_data/
+# ......api_readme.md
# ....util/
# ......(more will come here)
@@ -260,6 +261,7 @@
f.close()
Copy(join(HOME, 'README.dart-sdk'), join(SDK_tmp, 'README'))
+ Copy(join(HOME, 'sdk', 'api_readme.md'), join(SDK_tmp, 'lib', 'api_readme.md'))
move(SDK_tmp, SDK)
diff --git a/tools/dartium/archive.py b/tools/dartium/archive.py
index 0394728..5f8bae8 100755
--- a/tools/dartium/archive.py
+++ b/tools/dartium/archive.py
@@ -25,7 +25,7 @@
CHROMEDRIVER_FILES = ['chromedriver']
elif HOST_OS == 'win':
# TODO: provide proper list.
- CONTENTSHELL_FILES = ['content_shell.exe', 'AHEM____.ttf']
+ CONTENTSHELL_FILES = ['content_shell.exe', 'AHEM____.ttf', 'icudtl.dat', ]
CHROMEDRIVER_FILES = ['chromedriver.exe']
else:
raise Exception('Unsupported platform')
diff --git a/tools/dom/scripts/dartmetadata.py b/tools/dom/scripts/dartmetadata.py
index 5d11efb..3e16cf7 100644
--- a/tools/dom/scripts/dartmetadata.py
+++ b/tools/dom/scripts/dartmetadata.py
@@ -60,7 +60,7 @@
"@Creates('Null')",
],
- # Normally Window is nevernull, but starting from a <template> element in
+ # Normally Window is never null, but starting from a <template> element in
# JavaScript, this will be null:
# template.content.ownerDocument.defaultView
'Document.window': [
@@ -68,12 +68,17 @@
"@Returns('Window|=Object|Null')",
],
- 'Document.getElementsByTagName': [
+ 'Document.getElementsByClassName': [
"@Creates('NodeList|HtmlCollection')",
"@Returns('NodeList|HtmlCollection')",
],
- 'Document.getElementsByClassName': [
+ 'Document.getElementsByName': [
+ "@Creates('NodeList|HtmlCollection')",
+ "@Returns('NodeList|HtmlCollection')",
+ ],
+
+ 'Document.getElementsByTagName': [
"@Creates('NodeList|HtmlCollection')",
"@Returns('NodeList|HtmlCollection')",
],
@@ -98,12 +103,17 @@
"@Returns('JSExtendableArray')",
],
- 'Element.getElementsByTagName': [
+ 'Element.getElementsByClassName': [
"@Creates('NodeList|HtmlCollection')",
"@Returns('NodeList|HtmlCollection')",
],
- 'Element.getElementsByClassName': [
+ 'Element.getElementsByName': [
+ "@Creates('NodeList|HtmlCollection')",
+ "@Returns('NodeList|HtmlCollection')",
+ ],
+
+ 'Element.getElementsByTagName': [
"@Creates('NodeList|HtmlCollection')",
"@Returns('NodeList|HtmlCollection')",
],
@@ -280,12 +290,17 @@
"@annotation_Returns_SerializedScriptValue",
],
- 'ShadowRoot.getElementsByTagName': [
+ 'ShadowRoot.getElementsByClassName': [
"@Creates('NodeList|HtmlCollection')",
"@Returns('NodeList|HtmlCollection')",
],
- 'ShadowRoot.getElementsByClassName': [
+ 'ShadowRoot.getElementsByName': [
+ "@Creates('NodeList|HtmlCollection')",
+ "@Returns('NodeList|HtmlCollection')",
+ ],
+
+ 'ShadowRoot.getElementsByTagName': [
"@Creates('NodeList|HtmlCollection')",
"@Returns('NodeList|HtmlCollection')",
],
diff --git a/tools/dom/src/dart2js_CssClassSet.dart b/tools/dom/src/dart2js_CssClassSet.dart
index cf5fa33..8d483b3 100644
--- a/tools/dom/src/dart2js_CssClassSet.dart
+++ b/tools/dom/src/dart2js_CssClassSet.dart
@@ -142,16 +142,15 @@
static bool _add(Element _element, String value) {
DomTokenList list = _classListOf(_element);
- // Compute returned result independently of action upon the set. One day we
- // will be able to optimize it way if unused.
- bool added = !_classListContains(list, value);
+ // Compute returned result independently of action upon the set.
+ bool added = !_classListContainsBeforeAddOrRemove(list, value);
_classListAdd(list, value);
return added;
}
static bool _remove(Element _element, String value) {
DomTokenList list = _classListOf(_element);
- bool removed = _classListContains(list, value);
+ bool removed = _classListContainsBeforeAddOrRemove(list, value);
_classListRemove(list, value);
return removed;
}
@@ -225,7 +224,17 @@
JS('returns:JSUInt31;effects:none;depends:all;', '#.length', list);
static bool _classListContains(DomTokenList list, String value) =>
- JS('returns:bool;effects:none;depends:all;',
+ JS('returns:bool;effects:none;depends:all',
+ '#.contains(#)', list, value);
+
+ static bool _classListContainsBeforeAddOrRemove(
+ DomTokenList list, String value) =>
+ // 'throws:never' is a lie, since 'contains' will throw on an illegal
+ // token. However, we always call this function immediately prior to
+ // add/remove/toggle with the same token. Often the result of 'contains'
+ // is unused and the lie makes it possible for the 'contains' instruction
+ // to be removed.
+ JS('returns:bool;effects:none;depends:all;throws:null(1)',
'#.contains(#)', list, value);
static void _classListAdd(DomTokenList list, String value) {
diff --git a/tools/gyp/all.gypi b/tools/gyp/all.gypi
index 59706b1..bd03ab0 100644
--- a/tools/gyp/all.gypi
+++ b/tools/gyp/all.gypi
@@ -13,7 +13,7 @@
# Flag that tells us whether to build native support for dart:io.
'dart_io_support': 1,
# Flag controls whether or not frame pointers are enabled.
- 'c_frame_pointers%': 0,
+ 'c_frame_pointers%': 1,
},
'conditions': [
[ 'OS=="linux"', {
diff --git a/tools/gyp/configurations.gypi b/tools/gyp/configurations.gypi
index e6e19ef..5b55362 100644
--- a/tools/gyp/configurations.gypi
+++ b/tools/gyp/configurations.gypi
@@ -20,6 +20,7 @@
['"<(target_arch)"=="armv5te"', { 'dart_target_arch': 'ARMV5TE', }],
['"<(target_arch)"=="arm64"', { 'dart_target_arch': 'ARM64', }],
['"<(target_arch)"=="simarm"', { 'dart_target_arch': 'SIMARM', }],
+ ['"<(target_arch)"=="simarmv5te"', { 'dart_target_arch': 'SIMARMV5TE', }],
['"<(target_arch)"=="simarm64"', { 'dart_target_arch': 'SIMARM64', }],
['"<(target_arch)"=="mips"', { 'dart_target_arch': 'MIPS', }],
['"<(target_arch)"=="simmips"', { 'dart_target_arch': 'SIMMIPS', }],
@@ -62,6 +63,14 @@
]
},
+ 'Dart_simarmv5te_Base': {
+ 'abstract': 1,
+ 'defines': [
+ 'TARGET_ARCH_ARM',
+ 'TARGET_ARCH_ARM_5TE',
+ ]
+ },
+
'Dart_arm_Base': {
'abstract': 1,
'defines': [
@@ -73,6 +82,7 @@
'abstract': 1,
'defines': [
'TARGET_ARCH_ARM',
+ 'TARGET_ARCH_ARM_5TE',
],
},
@@ -174,6 +184,27 @@
],
},
+ 'DebugSIMARMV5TE': {
+ 'inherit_from': [
+ 'Dart_Base', 'Dart_simarmv5te_Base', 'Dart_Debug',
+ 'Dart_<(dart_target_os)_Base',
+ 'Dart_<(dart_target_os)_simarmv5te_Base',
+ 'Dart_<(dart_target_os)_Debug',
+ ],
+ 'defines': [
+ 'DEBUG',
+ ],
+ },
+
+ 'ReleaseSIMARMV5TE': {
+ 'inherit_from': [
+ 'Dart_Base', 'Dart_simarmv5te_Base', 'Dart_Release',
+ 'Dart_<(dart_target_os)_Base',
+ 'Dart_<(dart_target_os)_simarmv5te_Base',
+ 'Dart_<(dart_target_os)_Release',
+ ],
+ },
+
'DebugSIMARM64': {
'inherit_from': [
'Dart_Base', 'Dart_simarm64_Base', 'Dart_Debug',
diff --git a/tools/gyp/configurations_make.gypi b/tools/gyp/configurations_make.gypi
index 2e77656..1556f16 100644
--- a/tools/gyp/configurations_make.gypi
+++ b/tools/gyp/configurations_make.gypi
@@ -32,12 +32,32 @@
'abstract': 1,
'cflags': [ '-m32', '-msse2', '-mfpmath=sse' ],
'ldflags': [ '-m32', ],
+ 'conditions': [
+ ['c_frame_pointers==1', {
+ 'cflags': [
+ # Clang on Linux will still omit frame pointers from leaf
+ # functions unless told otherwise:
+ # (note this flag only works on recent GCC versions.)
+ '-mno-omit-leaf-frame-pointer',
+ ],
+ }],
+ ],
},
'Dart_Linux_x64_Base': {
'abstract': 1,
'cflags': [ '-m64', '-msse2' ],
'ldflags': [ '-m64', ],
+ 'conditions': [
+ ['c_frame_pointers==1', {
+ 'cflags': [
+ # Clang on Linux will still omit frame pointers from leaf
+ # functions unless told otherwise:
+ # (note this flag only works on recent GCC versions.)
+ '-mno-omit-leaf-frame-pointer',
+ ],
+ }],
+ ],
},
'Dart_Linux_simarm_Base': {
@@ -46,6 +66,12 @@
'ldflags': [ '-m32', ],
},
+ 'Dart_Linux_simarmv5te_Base': {
+ 'abstract': 1,
+ 'cflags': [ '-O3', '-m32', '-msse2' ],
+ 'ldflags': [ '-m32', ],
+ },
+
'Dart_Linux_simarm64_Base': {
'abstract': 1,
'cflags': [ '-O3', '-m64', '-msse2' ],
@@ -172,9 +198,6 @@
['c_frame_pointers==1', {
'cflags': [
'-fno-omit-frame-pointer',
- # Clang on Linux will still omit frame pointers from leaf
- # functions unless told otherwise:
- '-mno-omit-leaf-frame-pointer',
],
'defines': [
'PROFILE_NATIVE_CODE'
@@ -192,9 +215,6 @@
['c_frame_pointers==1', {
'cflags': [
'-fno-omit-frame-pointer',
- # Clang on Linux will still omit frame pointers from leaf
- # functions unless told otherwise:
- '-mno-omit-leaf-frame-pointer',
],
'defines': [
'PROFILE_NATIVE_CODE'
diff --git a/tools/gyp/configurations_msvs.gypi b/tools/gyp/configurations_msvs.gypi
index 64176f7..46604eb 100644
--- a/tools/gyp/configurations_msvs.gypi
+++ b/tools/gyp/configurations_msvs.gypi
@@ -24,6 +24,9 @@
'Dart_Win_simarm_Base': {
'abstract': 1,
},
+ 'Dart_Win_simarmv5te_Base': {
+ 'abstract': 1,
+ },
'Dart_Win_simarm64_Base': {
'abstract': 1,
},
diff --git a/tools/gyp/configurations_xcode.gypi b/tools/gyp/configurations_xcode.gypi
index d3055a8..6bd0452 100644
--- a/tools/gyp/configurations_xcode.gypi
+++ b/tools/gyp/configurations_xcode.gypi
@@ -77,6 +77,9 @@
'Dart_Macos_simarm_Base': {
'abstract': 1,
},
+ 'Dart_Macos_simarmv5te_Base': {
+ 'abstract': 1,
+ },
'Dart_Macos_simarm64_Base': {
'abstract': 1,
},
diff --git a/tools/testing/dart/browser_controller.dart b/tools/testing/dart/browser_controller.dart
index 2412d07..a6d061c 100644
--- a/tools/testing/dart/browser_controller.dart
+++ b/tools/testing/dart/browser_controller.dart
@@ -744,7 +744,9 @@
_cleanup = () { userDir.deleteSync(recursive: true); };
var args = ["-profile", "${userDir.path}",
"-no-remote", "-new-instance", url];
- return startBrowser(_binary, args);
+ var environment = new Map<String,String>.from(Platform.environment);
+ environment["MOZ_CRASHREPORTER_DISABLE"] = "1";
+ return startBrowser(_binary, args, environment: environment);
});
}).catchError((e) {
diff --git a/tools/testing/dart/compiler_configuration.dart b/tools/testing/dart/compiler_configuration.dart
index 668804a3..3681bae 100644
--- a/tools/testing/dart/compiler_configuration.dart
+++ b/tools/testing/dart/compiler_configuration.dart
@@ -60,6 +60,7 @@
bool isHostChecked = configuration['host_checked'];
bool useSdk = configuration['use_sdk'];
bool isCsp = configuration['csp'];
+ bool useCps = configuration['cps_ir'];
switch (compiler) {
case 'dartanalyzer':
@@ -73,8 +74,8 @@
case 'dart2js':
return new Dart2jsCompilerConfiguration(
isDebug: isDebug, isChecked: isChecked,
- isHostChecked: isHostChecked, useSdk: useSdk, isCsp: isCsp,
- extraDart2jsOptions:
+ isHostChecked: isHostChecked, useCps: useCps, useSdk: useSdk,
+ isCsp: isCsp, extraDart2jsOptions:
TestUtils.getExtraOptions(configuration, 'dart2js_options'));
case 'dart2dart':
return new Dart2dartCompilerConfiguration(
@@ -225,13 +226,18 @@
/// Configuration for dart2js compiler.
class Dart2jsCompilerConfiguration extends Dart2xCompilerConfiguration {
final bool isCsp;
+ final bool useCps;
final List<String> extraDart2jsOptions;
+ // We cache the extended environment to save memory.
+ static Map<String, String> cpsFlagCache;
+ static Map<String, String> environmentOverridesCacheObject;
Dart2jsCompilerConfiguration({
bool isDebug,
bool isChecked,
bool isHostChecked,
bool useSdk,
+ bool this.useCps,
bool this.isCsp,
this.extraDart2jsOptions})
: super(
@@ -253,13 +259,15 @@
CommandBuilder commandBuilder,
List arguments,
Map<String, String> environmentOverrides) {
+ List compilerArguments = new List.from(arguments)
+ ..addAll(extraDart2jsOptions);
return new CommandArtifact(
<Command>[
this.computeCompilationCommand(
'$tempDir/out.js',
buildDir,
CommandBuilder.instance,
- []..addAll(arguments)..addAll(extraDart2jsOptions),
+ compilerArguments,
environmentOverrides)],
'$tempDir/out.js',
'application/javascript');
diff --git a/tools/testing/dart/runtime_configuration.dart b/tools/testing/dart/runtime_configuration.dart
index 487c9e5..1fbf54d 100644
--- a/tools/testing/dart/runtime_configuration.dart
+++ b/tools/testing/dart/runtime_configuration.dart
@@ -169,6 +169,7 @@
switch (arch) {
case 'simarm':
case 'arm':
+ case' simarmv5te':
case 'armv5te':
case 'simmips':
case 'mips':
diff --git a/tools/testing/dart/test_options.dart b/tools/testing/dart/test_options.dart
index 3ee0c59..9bd9aaa 100644
--- a/tools/testing/dart/test_options.dart
+++ b/tools/testing/dart/test_options.dart
@@ -110,7 +110,7 @@
'The architecture to run tests for',
['-a', '--arch'],
['all', 'ia32', 'x64', 'arm', 'armv5te', 'arm64', 'mips',
- 'simarm', 'simarm64', 'simmips'],
+ 'simarm', 'simarmv5te', 'simarm64', 'simmips'],
'ia32'),
new _TestOptionSpecification(
'system',
@@ -147,6 +147,13 @@
false,
type: 'bool'),
new _TestOptionSpecification(
+ 'cps_ir',
+ 'Run the compiler with the cps based backend',
+ ['--cps-ir'],
+ [],
+ false,
+ type: 'bool'),
+ new _TestOptionSpecification(
'timeout',
'Timeout in seconds',
['-t', '--timeout'],
diff --git a/tools/testing/dart/test_suite.dart b/tools/testing/dart/test_suite.dart
index 2e97c05..07a56d1 100644
--- a/tools/testing/dart/test_suite.dart
+++ b/tools/testing/dart/test_suite.dart
@@ -423,7 +423,6 @@
var dartDir = TestUtils.dartDir;
var futures = [
listDir(dartDir.append('pkg'), isValid),
- listDir(dartDir.append('pkg').append('third_party'), isValid),
listDir(dartDir.append('third_party').append('pkg'), isValid),
listDir(dartDir.append('runtime').append('observatory'), isValid),
];
@@ -2222,6 +2221,9 @@
if (compiler == "dart2js" && configuration["csp"]) {
args.add("--csp");
}
+ if (compiler == "dart2js" && configuration["cps_ir"]) {
+ args.add("--use-cps-ir");
+ }
if (compiler == "dartanalyzer" || compiler == "dart2analyzer") {
args.add("--show-package-warnings");
args.add("--enable-async");
diff --git a/tools/utils.py b/tools/utils.py
index 3c1eacb..4969ad5 100644
--- a/tools/utils.py
+++ b/tools/utils.py
@@ -226,6 +226,7 @@
'arm64': 'arm',
'mips': 'mips',
'simarm': 'ia32',
+ 'simarmv5te': 'ia32',
'simmips': 'ia32',
'simarm64': 'ia32',
}
@@ -272,6 +273,10 @@
build_root = os.path.join(build_root, GetBuildConf(mode, arch, target_os))
return build_root
+def GetBuildSdkBin(host_os, mode=None, arch=None, target_os=None):
+ build_root = GetBuildRoot(host_os, mode, arch, target_os)
+ return os.path.join(build_root, 'dart-sdk', 'bin')
+
def GetBaseDir():
return BASE_DIR
@@ -401,6 +406,40 @@
return None
+# Our schema for releases and archiving is based on an increasing
+# sequence of numbers. In the svn world this was simply the revision of a
+# commit, which would always give us a one to one mapping between the number
+# and the commit. This was true across branches as well, so a number used
+# to archive a build was always unique and unambiguous.
+# In git there is no such global number, so we loosen the requirement a bit.
+# We only use numbers on the master branch (bleeding edge). On branches
+# we use the version number instead for archiving purposes.
+# The number on master is the count of commits on the master branch.
+def GetArchiveVersion():
+ version = ReadVersionFile()
+ if not version:
+ raise 'Could not get the archive version, parsing the version file failed'
+ if version.channel == 'be':
+ return GetGitNumber()
+ return GetSemanticSDKVersion()
+
+# To eliminate clashing with older archived builds on bleding edge we add
+# a base number bigger the largest svn revision (this also gives us an easy
+# way of seeing if an archive comes from git based or svn based commits).
+GIT_NUMBER_BASE = 100000
+def GetGitNumber():
+ p = subprocess.Popen(['git', 'rev-list', 'HEAD', '--count'],
+ stdout = subprocess.PIPE,
+ stderr = subprocess.STDOUT, shell=IsWindows(),
+ cwd = DART_DIR)
+ output, _ = p.communicate()
+ try:
+ number = int(output)
+ return number + GIT_NUMBER_BASE
+ except:
+ print "Warning: could not parse git count, output was %s" % output
+ return None
+
def ParseGitInfoOutput(output):
"""Given a git log, determine the latest corresponding svn revision."""
for line in output.split('\n'):
diff --git a/utils/dartanalyzer/dartanalyzer.gyp b/utils/dartanalyzer/dartanalyzer.gyp
index 4e6cc06..fa15434 100644
--- a/utils/dartanalyzer/dartanalyzer.gyp
+++ b/utils/dartanalyzer/dartanalyzer.gyp
@@ -18,7 +18,7 @@
'<(PRODUCT_DIR)/<(EXECUTABLE_PREFIX)dart<(EXECUTABLE_SUFFIX)',
'../../sdk/lib/_internal/libraries.dart',
'<(SHARED_INTERMEDIATE_DIR)/packages.stamp',
- '<!@(["python", "../../tools/list_files.py", "\\.dart$", "../../pkg/analyzer"])',
+ '<!@(["python", "../../tools/list_files.py", "\\.dart$", "../../third_party/pkg_tested/analyzer_cli"])',
],
'outputs': [
'<(SHARED_INTERMEDIATE_DIR)/dartanalyzer.dart.snapshot',
@@ -27,7 +27,7 @@
'<(PRODUCT_DIR)/<(EXECUTABLE_PREFIX)dart<(EXECUTABLE_SUFFIX)',
'--snapshot=<(SHARED_INTERMEDIATE_DIR)/dartanalyzer.dart.snapshot',
'--package-root=<(PRODUCT_DIR)/packages/',
- '../../pkg/analyzer/bin/analyzer.dart',
+ '../../third_party/pkg_tested/analyzer_cli/bin/analyzer.dart',
],
},
],