Version 1.9.0-dev.4.0
svn merge -r 42675:42855 https://dart.googlecode.com/svn/branches/bleeding_edge trunk
git-svn-id: http://dart.googlecode.com/svn/trunk@42856 260f80e4-7a28-3924-810f-c04153c831b5
diff --git a/docs/language/dartLangSpec.tex b/docs/language/dartLangSpec.tex
index f5b67d6..5cfadd9 100644
--- a/docs/language/dartLangSpec.tex
+++ b/docs/language/dartLangSpec.tex
@@ -758,7 +758,7 @@
\LMLabel{typeOfAFunction}
\LMHash{}
-If a function does not declare a return type explicitly, its return type is \DYNAMIC{} (\ref{typeDynamic}).
+If a function does not declare a return type explicitly, its return type is \DYNAMIC{} (\ref{typeDynamic}), unless it is a constructor function, in which case its return type is the immediately enclosing class.
\LMHash{}
Let $F$ be a function with required formal parameters $T_1$ $p_1 \ldots, T_n$ $p_n$, return type $T_0$ and no optional parameters. Then the type of $F$ is $(T_1 ,\ldots, T_n) \rightarrow T_0$.
@@ -859,12 +859,17 @@
\LMHash{}
A class has constructors, instance members and static members. The instance members of a class are its instance methods, getters, setters and instance variables. The static members of a class are its static methods, getters, setters and static variables. The members of a class are its static and instance members.
-% A class has a static scope and an instance scope. The enclosing scope of the static scope of a non-generic class is the enclosing scope of the class declaration. The enclosing scope of the static scope of a generic class is the type parameter scope (\ref{}) of the generic class declaration.
-%The enclosing scope of a class' instance scope is the class' static scope.
+A class has several scopes:
+\begin{itemize}
+\item A {\em type-parameter scope}, which is empty if the class is not generic (\ref{generics}). The enclosing scope of the type-parameter scope of a class is the enclosing scope of the class declaration.
+\item A {\em static scope}. The enclosing scope of the static scope of a class is the type parameter scope (\ref{generics}) of the class.
+\item An {\em instance scope}.
+The enclosing scope of a class' instance scope is the class' static scope.
+\end{itemize}
-%The enclosing scope of an instance member declaration is the instance scope of the class in which it is declared.
+The enclosing scope of an instance member declaration is the instance scope of the class in which it is declared.
-%The enclosing scope of a static member declaration is the static scope of the class in which it is declared.
+The enclosing scope of a static member declaration is the static scope of the class in which it is declared.
\LMHash{}
@@ -1707,6 +1712,9 @@
%}
\LMHash{}
+The scope of the \EXTENDS{} and \WITH{} clauses of a class $C$ is the type-parameter scope of $C$.
+
+\LMHash{}
%It is a compile-time error if the \EXTENDS{} clause of a class $C$ includes a type expression that does not denote a class available in the lexical scope of $C$.
It is a compile-time error if the \EXTENDS{} clause of a class $C$ specifies an enumerated type (\ref{enums}), a malformed type or a deferred type (\ref{staticTypes}) as a superclass.
% too strict? Do we e want extends List<Undeclared> to work as List<dynamic>?
@@ -1840,6 +1848,9 @@
\end{grammar}
\LMHash{}
+The scope of the \IMPLEMENTS{} clause of a class $C$ is the type-parameter scope of $C$.
+
+\LMHash{}
It is a compile-time error if the \IMPLEMENTS{} clause of a class $C$ specifies a type variable as a superinterface. It is a compile-time error if the \IMPLEMENTS{} clause of a class $C$ specifies an enumerated type (\ref{enums}), a malformed type or deferred type (\ref{staticTypes}) as a superinterface It is a compile-time error if the \IMPLEMENTS{} clause of a class $C$ specifies type \DYNAMIC{} as a superinterface. It is a compile-time error if the \IMPLEMENTS{} clause of a class $C$ specifies a type $T$ as a superinterface more than once.
It is a compile-time error if the superclass of a class $C$ is specified as a superinterface of $C$.
@@ -2160,6 +2171,7 @@
A type parameter $T$ may be suffixed with an \EXTENDS{} clause that specifies the {\em upper bound} for $T$. If no \EXTENDS{} clause is present, the upper bound is \code{Object}. It is a static type warning if a type parameter is a supertype of its upper bound. The bounds of type variables are a form of type annotation and have no effect on execution in production mode.
\LMHash{}
+Type parameters are declared in the type-parameter scope of a class.
The type parameters of a generic $G$ are in scope in the bounds of all of the type parameters of $G$. The type parameters of a generic class declaration $G$ are also in scope in the \EXTENDS{} and \IMPLEMENTS{} clauses of $G$ (if these exist) and in the body of $G$. However, a type parameter is considered to be a malformed type when referenced by a static member.
\rationale{
@@ -2687,7 +2699,7 @@
\end{dartCode}
-\rationale{String interpolation work well for most cases. The main situation where it is not fully satisfactory is for string literals that are too large to fit on a line. Multiline strings can be useful, but in some cases, we want to visually align the code. This can be expressed by writing smaller strings separated by whitespace, as shown here:}
+\rationale{String interpolation works well for most cases. The main situation where it is not fully satisfactory is for string literals that are too large to fit on a line. Multiline strings can be useful, but in some cases, we want to visually align the code. This can be expressed by writing smaller strings separated by whitespace, as shown here:}
@@ -3285,7 +3297,7 @@
\commentary{Note that it this point we are assured that the number of actual type arguments match the number of formal type parameters.}
\LMHash{}
-A fresh instance (\ref{generativeConstructors}), $i$, of class $R$ is allocated. For each instance variable $f$ of $i$, if the variable declaration of $f$ has an initializer expression $e_f$, then $e_f$ is evaluated to an object $o_f$ and $f$ is bound to $o_f$. Otherwise $f$ is bound to \NULL{}.
+A fresh instance (\ref{generativeConstructors}), $i$, of class $R$ is allocated. For each instance variable $f$ of $i$, if the variable declaration of $f$ has an initializer expression $e_f$, then $e_f$ is evaluated, with the type parameters (if any) of $R$ bound to the actual type arguments $V_1, \ldots, V_l$, to an object $o_f$ and $f$ is bound to $o_f$. Otherwise $f$ is bound to \NULL{}.
\commentary{
Observe that \THIS{} is not in scope in $e_f$. Hence, the initialization cannot depend on other properties of the object being instantiated.
@@ -4013,7 +4025,7 @@
\commentary{Observations:
\begin{enumerate}
\item One cannot closurize a getter or a setter.
-\item One can tell whether one implemented a property via a method or via field/getter, which means that one has to plan ahead as to what construct to use, and that choice is reflected in the interface of the class.
+\item One can tell whether one implemented a property via a method or via a field/getter, which means that one has to plan ahead as to what construct to use, and that choice is reflected in the interface of the class.
\end{enumerate}
}
@@ -5132,7 +5144,7 @@
identifier \IN{} expression
.
-{\bf forInitializerStatement:}localVariableDeclaration `{\escapegrammar ;}';
+{\bf forInitializerStatement:}localVariableDeclaration;
expression? `{\escapegrammar ;}'
.
\end{grammar}
@@ -7162,7 +7174,7 @@
\hline
Logical Or & $||$ & Left & 4\\
\hline
-Conditional & e1? e2: e3 & None & 3\\
+Conditional & e1? e2: e3 & Right & 3\\
\hline
Cascade & .. & Left & 2\\
\hline
diff --git a/out2.dart b/out2.dart
new file mode 100644
index 0000000..37b7d33
--- /dev/null
+++ b/out2.dart
@@ -0,0 +1,7 @@
+const MANGLED_GLOBAL_NAMES = 'mangledGlobalNames';
+main() {
+ var v0 = 1;
+ while (true) {
+ print(v0);
+ }
+}
diff --git a/pkg/analysis_server/bin/dartdeps.dart b/pkg/analysis_server/bin/dartdeps.dart
deleted file mode 100644
index 8b6ad68..0000000
--- a/pkg/analysis_server/bin/dartdeps.dart
+++ /dev/null
@@ -1,183 +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:async';
-import 'dart:io';
-
-import 'package:analysis_server/src/analysis_manager.dart';
-import 'package:args/args.dart';
-
-/**
- * Start analysis server as a separate process and use the websocket protocol
- * to analyze the application specified on the command line.
- */
-void main(List<String> args) {
- new _DartDependencyAnalyzer(args).run().catchError((error, stack) {
- print('Analysis failed: $error');
- if (stack != null) {
- print(stack);
- }
- });
-}
-
-/**
- * Instances of [_DartDependencyAnalyzer] launch an analysis server and use
- * that server to analyze the dependencies of an application.
- */
-class _DartDependencyAnalyzer {
- /**
- * The name of the application that is used to start the dependency analyzer.
- */
- static const BINARY_NAME = 'dartdeps';
-
- /**
- * The name of the option used to specify the Dart SDK.
- */
- static const String DART_SDK_OPTION = 'dart-sdk';
-
- /**
- * The name of the option used to print usage information.
- */
- static const String HELP_OPTION = 'help';
-
- /**
- * The name of the option used to specify an already running server.
- */
- static const String SERVER_OPTION = 'server';
-
- /**
- * The command line arguments.
- */
- final List<String> args;
-
- /**
- * The path to the Dart SDK used during analysis.
- */
- String sdkPath;
-
- /**
- * The manager for the analysis server.
- */
- AnalysisManager manager;
-
- _DartDependencyAnalyzer(this.args);
-
- /**
- * Use the given manager to perform the analysis.
- */
- void analyze(AnalysisManager manager) {
- if (manager == null) {
- return;
- }
- this.manager = manager;
- print('Analyzing...');
- }
-
- /**
- * Print information about how to use the server.
- */
- void printUsage(ArgParser parser) {
- print('Usage: $BINARY_NAME [flags] <application_directory>');
- print('');
- print('Supported flags are:');
- print(parser.usage);
- }
-
- /**
- * Parse the command line arguments to determine the application to be
- * analyzed, then launch and manage an analysis server to do the work.
- */
- Future run() {
- return new Future(start).then(analyze).whenComplete(stop);
- }
-
- /**
- * Parse the command line arguments to determine the application to be
- * analyzed, then launch an analysis server.
- * Return `null` if the command line arguments are invalid.
- */
- Future<AnalysisManager> start() {
- ArgParser parser = new ArgParser();
- parser.addOption(DART_SDK_OPTION, help: '[sdkPath] path to Dart SDK');
- parser.addFlag(
- HELP_OPTION,
- help: 'print this help message without starting analysis',
- defaultsTo: false,
- negatable: false);
- parser.addOption(
- SERVER_OPTION,
- help: '[serverUrl] use an analysis server thats already running');
-
- // Parse arguments
- ArgResults results;
- try {
- results = parser.parse(args);
- } on FormatException catch (e) {
- print(e.message);
- print('');
- printUsage(parser);
- exitCode = 1;
- return null;
- }
- if (results[HELP_OPTION]) {
- printUsage(parser);
- return null;
- }
- sdkPath = results[DART_SDK_OPTION];
- if (sdkPath is! String) {
- print('Missing path to Dart SDK');
- printUsage(parser);
- return null;
- }
- Directory sdkDir = new Directory(sdkPath);
- if (!sdkDir.existsSync()) {
- print('Specified Dart SDK does not exist: $sdkPath');
- printUsage(parser);
- return null;
- }
- if (results.rest.length == 0) {
- printUsage(parser);
- exitCode = 1;
- return null;
- }
- Directory appDir = new Directory(results.rest[0]);
- if (!appDir.existsSync()) {
- print('Specified application directory does not exist: $appDir');
- print('');
- printUsage(parser);
- exitCode = 1;
- return null;
- }
- if (results.rest.length > 1) {
- print('Unexpected arguments after $appDir');
- print('');
- printUsage(parser);
- exitCode = 1;
- return null;
- }
-
- // Connect to an already running analysis server
- String serverUrl = results[SERVER_OPTION];
- if (serverUrl != null) {
- return AnalysisManager.connect(serverUrl);
- }
-
- // Launch and connect to a new analysis server
- // Assume that the analysis server entry point is in the same directory
- StringBuffer path = new StringBuffer();
- path.write(FileSystemEntity.parentOf(Platform.script.toFilePath()));
- path.write(Platform.pathSeparator);
- path.write('server.dart');
- return AnalysisManager.start(path.toString());
- }
-
- /**
- * Stop the analysis server.
- */
- void stop() {
- if (manager != null) {
- manager.stop();
- }
- }
-}
diff --git a/pkg/analysis_server/bin/fuzz.dart b/pkg/analysis_server/bin/fuzz.dart
deleted file mode 100644
index 49bdd1d..0000000
--- a/pkg/analysis_server/bin/fuzz.dart
+++ /dev/null
@@ -1,171 +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:async';
-import 'dart:io';
-
-import 'package:args/args.dart';
-import 'package:matcher/matcher.dart';
-import 'package:path/path.dart' as path;
-
-import 'fuzz/server_manager.dart';
-
-/**
- * Start analysis server as a separate process and use the stdio to communicate
- * with the server.
- */
-void main(List<String> args) {
- new _FuzzTest().run(args);
-}
-
-/**
- * Instances of [_FuzzTest] launch and test an analysis server.
- * You must specify the location of the Dart SDK and the directory
- * containing sources to be analyzed.
- */
-class _FuzzTest {
- /**
- * The name of the application that is used to start the fuzz tester.
- */
- static const BINARY_NAME = 'fuzz';
-
- //TODO (danrubel) extract common behavior for use in multiple test scenarios
- //TODO (danrubel) cleanup test to use async/await for better readability
- // VM flag --enable_async
-
- static const String DART_SDK_OPTION = 'dart-sdk';
- static const String HELP_OPTION = 'help';
-
- File serverSnapshot;
- Directory appDir;
-
- /// Parse the arguments and initialize the receiver
- /// Return `true` if proper arguments were provided
- bool parseArgs(List<String> args) {
- ArgParser parser = new ArgParser();
-
- void error(String errMsg) {
- stderr.writeln(errMsg);
- print('');
- _printUsage(parser);
- exitCode = 11;
- }
-
- parser.addOption(DART_SDK_OPTION, help: '[sdkPath] path to Dart SDK');
- parser.addFlag(
- HELP_OPTION,
- help: 'print this help message without starting analysis',
- defaultsTo: false,
- negatable: false);
-
- ArgResults results;
- try {
- results = parser.parse(args);
- } on FormatException catch (e) {
- error(e.message);
- return false;
- }
- if (results[HELP_OPTION]) {
- _printUsage(parser);
- return false;
- }
- String sdkPath = results[DART_SDK_OPTION];
- if (sdkPath is! String) {
- error('Missing path to Dart SDK');
- return false;
- }
- Directory sdkDir = new Directory(sdkPath);
- if (!sdkDir.existsSync()) {
- error('Specified Dart SDK does not exist: $sdkPath');
- return false;
- }
- if (results.rest.length == 0) {
- error('Expected directory to analyze');
- return false;
- }
- appDir = new Directory(results.rest[0]);
- if (!appDir.existsSync()) {
- error('Specified application directory does not exist: $appDir');
- return false;
- }
- if (results.rest.length > 1) {
- error('Unexpected arguments after $appDir');
- return false;
- }
- serverSnapshot = new File(
- path.join(sdkDir.path, 'bin', 'snapshots', 'analysis_server.dart.snapshot'));
- if (!serverSnapshot.existsSync()) {
- error('Analysis Server snapshot not found: $serverSnapshot');
- return false;
- }
- return true;
- }
-
- /// Main entry point for launching, testing, and shutting down the server
- void run(List<String> args) {
- if (!parseArgs(args)) return;
- ServerManager.start(serverSnapshot.path).then((ServerManager manager) {
- runZoned(() {
- test(manager).then(manager.stop).then((_) {
- expect(manager.errorOccurred, isFalse);
- print('Test completed successfully');
- });
- }, onError: (error, stack) {
- stderr.writeln(error);
- print(stack);
- exitCode = 12;
- manager.stop();
- });
- });
- }
-
- /// Use manager to exercise the analysis server
- Future test(ServerManager manager) {
-
- // perform initial analysis
- return manager.analyze(appDir).then((AnalysisResults analysisResults) {
- print(
- 'Found ${analysisResults.errorCount} errors,'
- ' ${analysisResults.warningCount} warnings,'
- ' and ${analysisResults.hintCount} hints in ${analysisResults.elapsed}');
-
- // edit a method body
- return manager.openFileNamed(
- 'domain_completion.dart').then((Editor editor) {
- return editor.moveAfter('Response processRequest(Request request) {');
- }).then((Editor editor) {
- return editor.replace(0, '\nOb');
- }).then((Editor editor) {
-
- // request code completion and assert results
- return editor.getSuggestions().then((List<CompletionResults> list) {
- expect(list, isNotNull);
- expect(list.length, equals(0));
- list.forEach((CompletionResults results) {
- print(
- '${results.elapsed} received ${results.suggestionCount} suggestions');
- });
- return editor;
- });
-
- }).then((Editor editor) {
- print('tests complete');
- });
- });
- }
-
-// void _printAnalysisSummary(AnalysisResults results) {
-// print(
-// 'Found ${results.errorCount} errors, ${results.warningCount} warnings,'
-// ' and ${results.hintCount} hints in $results.elapsed');
-// }
-
- /// Print information about how to use the server.
- void _printUsage(ArgParser parser) {
- print('Usage: $BINARY_NAME [flags] <application_directory>');
- print('');
- print('Supported flags are:');
- print(parser.usage);
- }
-}
diff --git a/pkg/analysis_server/bin/fuzz/README.txt b/pkg/analysis_server/bin/fuzz/README.txt
deleted file mode 100644
index f8d8a44..0000000
--- a/pkg/analysis_server/bin/fuzz/README.txt
+++ /dev/null
@@ -1,9 +0,0 @@
-This directory contains code for fuzz testing the analysis server
-and for generating timing information for tracking server performance.
-
-Run:
-Launch fuzz.dart located in the parent directory.
-
-Overview:
-fuzz.dart - main entry point and simple example of exercizing server
-server_manager.dart - provides high level API for launching and driving server
diff --git a/pkg/analysis_server/bin/fuzz/logging_client_channel.dart b/pkg/analysis_server/bin/fuzz/logging_client_channel.dart
deleted file mode 100644
index 941646d..0000000
--- a/pkg/analysis_server/bin/fuzz/logging_client_channel.dart
+++ /dev/null
@@ -1,85 +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.
-
-part of server.manager;
-
-/**
- * A client channel that logs communication to stdout
- * and handles errors received from the server.
- */
-class LoggingClientChannel implements ClientCommunicationChannel {
- final ClientCommunicationChannel channel;
- int serverErrorCount = 0;
-
- LoggingClientChannel(this.channel) {
- channel.notificationStream.listen((Notification notification) {
- _logNotification(notification);
- if (notification.event == 'server.error') {
- ServerErrorParams error =
- new ServerErrorParams.fromNotification(notification);
- _handleError(
- 'Server reported error: ${error.message}',
- error.stackTrace);
- }
- });
- }
-
- @override
- Stream<Notification> get notificationStream => channel.notificationStream;
-
- @override
- void set notificationStream(Stream<Notification> _notificationStream) {
- throw 'invalid operation';
- }
-
- @override
- Stream<Response> get responseStream => channel.responseStream;
-
- @override
- void set responseStream(Stream<Response> _responseStream) {
- throw 'invalid operation';
- }
-
- @override
- Future close() {
- print('Requesting client channel be closed');
- return channel.close().then((_) {
- print('Client channel closed');
- });
- }
-
- @override
- Future<Response> sendRequest(Request request) {
- _logOperation('=>', request);
- return channel.sendRequest(request).then((Response response) {
- RequestError error = response.error;
- if (error != null) {
- error.code;
- stderr.write('Server Error ${error.code}: ${error.message}');
- print(error.stackTrace);
- exitCode = 31;
- }
- _logOperation('<=', request);
- return response;
- });
- }
-
- void _handleError(String errMsg, String stackTrace) {
- //error.isFatal;
- stderr.writeln('>>> Server reported exception');
- stderr.writeln(errMsg);
- print(stackTrace);
- serverErrorCount++;
- }
-
- void _logNotification(Notification notification) {
- print('<= ${notification.event}');
- }
-
- void _logOperation(String direction, Request request) {
- String id = request.id.padLeft(5);
- String method = request.method.padRight(20);
- print('$direction $id $method');
- }
-}
diff --git a/pkg/analysis_server/bin/fuzz/server_manager.dart b/pkg/analysis_server/bin/fuzz/server_manager.dart
deleted file mode 100644
index e9dcf24..0000000
--- a/pkg/analysis_server/bin/fuzz/server_manager.dart
+++ /dev/null
@@ -1,365 +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 server.manager;
-
-import 'dart:async';
-import 'dart:convert';
-import 'dart:io';
-
-import 'package:matcher/matcher.dart';
-import 'package:analysis_server/src/protocol.dart';
-import 'package:analysis_server/src/channel/channel.dart';
-import 'package:analysis_server/src/channel/byte_stream_channel.dart';
-
-part 'logging_client_channel.dart';
-
-/**
- * The results returned by [ServerManager].analyze(...) once analysis
- * has finished.
- */
-class AnalysisResults {
- Duration elapsed;
- int errorCount = 0;
- int hintCount = 0;
- int warningCount = 0;
-}
-
-
-/**
- * [CompletionResults] contains the completion results returned by the server
- * along with the elapse time to receive those completions.
- */
-class CompletionResults {
- final Duration elapsed;
- final CompletionResultsParams params;
-
- CompletionResults(this.elapsed, this.params);
-
- int get suggestionCount => params.results.length;
-}
-
-/**
- * [Editor] is a virtual editor for inspecting and modifying a file's content
- * and updating the server with those modifications.
- */
-class Editor {
- final ServerManager manager;
- final File file;
- int offset = 0;
- String _content = null;
-
- Editor(this.manager, this.file);
-
- /// Return a future that returns the file content
- Future<String> get content {
- if (_content != null) {
- return new Future.value(_content);
- }
- return file.readAsString().then((String content) {
- _content = content;
- return _content;
- });
- }
-
- /**
- * Request completion suggestions from the server.
- * Return a future that completes with the completions sent.
- */
- Future<List<CompletionResults>> getSuggestions() {
- Request request = new CompletionGetSuggestionsParams(
- file.path,
- offset).toRequest(manager._nextRequestId);
- Stopwatch stopwatch = new Stopwatch()..start();
- return manager.channel.sendRequest(request).then((Response response) {
- String completionId =
- new CompletionGetSuggestionsResult.fromResponse(response).id;
- var completer = new Completer<List<CompletionResults>>();
- List<CompletionResults> results = [];
-
- // Listen for completion suggestions
- StreamSubscription<Notification> subscription;
- subscription =
- manager.channel.notificationStream.listen((Notification notification) {
- if (notification.event == 'completion.results') {
- CompletionResultsParams params =
- new CompletionResultsParams.fromNotification(notification);
- if (params.id == completionId) {
- results.add(new CompletionResults(stopwatch.elapsed, params));
- if (params.isLast) {
- stopwatch.stop();
- subscription.cancel();
- completer.complete(results);
- }
- }
- }
- });
-
- return completer.future;
- });
- }
-
- /**
- * Move the virtual cursor after the given pattern in the source.
- * Return a future that completes once the cursor has been moved.
- */
- Future<Editor> moveAfter(String pattern) {
- return content.then((String content) {
- offset = content.indexOf(pattern);
- return this;
- });
- }
-
- /**
- * Replace the specified number of characters at the current cursor location
- * with the given text, but do not save that content to disk.
- * Return a future that completes once the server has been notified.
- */
- Future<Editor> replace(int replacementLength, String text) {
- return content.then((String oldContent) {
- StringBuffer sb = new StringBuffer();
- sb.write(oldContent.substring(0, offset));
- sb.write(text);
- sb.write(oldContent.substring(offset));
- _content = sb.toString();
- SourceEdit sourceEdit = new SourceEdit(offset, replacementLength, text);
- Request request = new AnalysisUpdateContentParams({
- file.path: new ChangeContentOverlay([sourceEdit])
- }).toRequest(manager._nextRequestId);
- offset += text.length;
- return manager.channel.sendRequest(request).then((Response response) {
- return this;
- });
- });
- }
-}
-
-/**
- * [ServerManager] is used to launch and manage an analysis server
- * running in a separate process.
- */
-class ServerManager {
-
- /**
- * The analysis server process being managed or `null` if not started.
- */
- Process process;
-
- /**
- * The root directory containing the Dart source files to be analyzed.
- */
- Directory appDir;
-
- /**
- * The channel used to communicate with the analysis server.
- */
- LoggingClientChannel _channel;
-
- /**
- * The identifier used in the most recent request to the server.
- * See [_nextRequestId].
- */
- int _lastRequestId = 0;
-
- /**
- * `true` if a server exception was detected on stderr as opposed to an
- * exception that the server reported via the server.error notification.
- */
- bool _unreportedServerException = false;
-
- /**
- * `true` if the [stop] method has been called.
- */
- bool _stopRequested = false;
-
- /**
- * Return the channel used to communicate with the analysis server.
- */
- ClientCommunicationChannel get channel => _channel;
-
- /**
- * Return `true` if a server error occurred.
- */
- bool get errorOccurred =>
- _unreportedServerException || (_channel.serverErrorCount > 0);
-
- String get _nextRequestId => (++_lastRequestId).toString();
-
- /**
- * Direct the server to analyze all sources in the given directory,
- * all sub directories recursively, and any source referenced sources
- * outside this directory hierarch such as referenced packages.
- * Return a future that completes when the analysis is finished.
- */
- Future<AnalysisResults> analyze(Directory appDir) {
- this.appDir = appDir;
- Stopwatch stopwatch = new Stopwatch()..start();
- Request request = new AnalysisSetAnalysisRootsParams(
- [appDir.path],
- []).toRequest(_nextRequestId);
-
- // Request analysis
- return channel.sendRequest(request).then((Response response) {
- AnalysisResults results = new AnalysisResults();
- StreamSubscription<Notification> subscription;
- Completer<AnalysisResults> completer = new Completer<AnalysisResults>();
- subscription =
- channel.notificationStream.listen((Notification notification) {
-
- // Gather analysis results
- if (notification.event == 'analysis.errors') {
- AnalysisErrorsParams params =
- new AnalysisErrorsParams.fromNotification(notification);
- params.errors.forEach((AnalysisError error) {
- AnalysisErrorSeverity severity = error.severity;
- if (severity == AnalysisErrorSeverity.ERROR) {
- results.errorCount += 1;
- } else if (severity == AnalysisErrorSeverity.WARNING) {
- results.warningCount += 1;
- } else if (severity == AnalysisErrorSeverity.INFO) {
- results.hintCount += 1;
- } else {
- print('Unknown error severity: ${severity.name}');
- }
- });
- }
-
- // Stop gathering once analysis is complete
- if (notification.event == 'server.status') {
- ServerStatusParams status =
- new ServerStatusParams.fromNotification(notification);
- AnalysisStatus analysis = status.analysis;
- if (analysis != null && !analysis.isAnalyzing) {
- stopwatch.stop();
- results.elapsed = stopwatch.elapsed;
- subscription.cancel();
- completer.complete(results);
- }
- }
- });
- return completer.future;
- });
- }
-
- /**
- * Send a request to the server for its version information
- * and return a future that completes with the result.
- */
- Future<ServerGetVersionResult> getVersion() {
- Request request = new ServerGetVersionParams().toRequest(_nextRequestId);
- return channel.sendRequest(request).then((Response response) {
- return new ServerGetVersionResult.fromResponse(response);
- });
- }
-
- /**
- * Notify the server that the given file will be edited.
- * Return a virtual editor for inspecting and modifying the file's content.
- */
- Future<Editor> openFileNamed(String fileName) {
- return _findFile(fileName, appDir).then((File file) {
- if (file == null) {
- throw 'Failed to find file named $fileName in ${appDir.path}';
- }
- file = file.absolute;
- Request request =
- new AnalysisSetPriorityFilesParams([file.path]).toRequest(_nextRequestId);
- return channel.sendRequest(request).then((Response response) {
- return new Editor(this, file);
- });
- });
- }
-
- /**
- * Send a request for notifications.
- * Return when the server has acknowledged that request.
- */
- Future setSubscriptions() {
- Request request = new ServerSetSubscriptionsParams(
- [ServerService.STATUS]).toRequest(_nextRequestId);
- return channel.sendRequest(request);
- }
-
- /**
- * Stop the analysis server.
- * Return a future that completes when the server is terminated.
- */
- Future stop([_]) {
- _stopRequested = true;
- print("Requesting server shutdown");
- Request request = new ServerShutdownParams().toRequest(_nextRequestId);
- Duration waitTime = new Duration(seconds: 5);
- return channel.sendRequest(request).timeout(waitTime, onTimeout: () {
- print('Expected shutdown response');
- }).then((Response response) {
- return channel.close().then((_) => process.exitCode);
- }).timeout(new Duration(seconds: 2), onTimeout: () {
- print('Expected server to shutdown');
- process.kill();
- });
- }
-
- /**
- * Locate the given file in the directory tree.
- */
- Future<File> _findFile(String fileName, Directory appDir) {
- return appDir.list(recursive: true).firstWhere((FileSystemEntity entity) {
- return entity is File && entity.path.endsWith(fileName);
- });
- }
-
- /**
- * Launch an analysis server and open a connection to that server.
- */
- Future<ServerManager> _launchServer(String pathToServer) {
- List<String> serverArgs = [pathToServer];
- return Process.start(Platform.executable, serverArgs).catchError((error) {
- exitCode = 21;
- throw 'Failed to launch analysis server: $error';
- }).then((Process process) {
- this.process = process;
- _channel = new LoggingClientChannel(
- new ByteStreamClientChannel(process.stdout, process.stdin));
-
- // simple out of band exception handling
- process.stderr.transform(
- new Utf8Codec().decoder).transform(new LineSplitter()).listen((String line) {
- if (!_unreportedServerException) {
- _unreportedServerException = true;
- stderr.writeln('>>> Unreported server exception');
- }
- stderr.writeln('server.stderr: $line');
- });
-
- // watch for unexpected process termination and catch the exit code
- process.exitCode.then((int code) {
- if (!_stopRequested) {
- fail('Unexpected server termination: $code');
- }
- if (code != null && code != 0) {
- exitCode = code;
- }
- print('Server stopped: $code');
- });
-
- return channel.notificationStream.first.then((Notification notification) {
- print('Server connection established');
- return setSubscriptions().then((_) {
- return getVersion().then((ServerGetVersionResult result) {
- print('Server version ${result.version}');
- return this;
- });
- });
- });
- });
- }
-
- /**
- * Launch analysis server in a separate process
- * and return a future with a manager for that analysis server.
- */
- static Future<ServerManager> start(String serverPath) {
- return new ServerManager()._launchServer(serverPath);
- }
-}
diff --git a/pkg/analysis_server/bin/server.dart b/pkg/analysis_server/bin/server.dart
index 84b7702..f0d075f 100644
--- a/pkg/analysis_server/bin/server.dart
+++ b/pkg/analysis_server/bin/server.dart
@@ -2,12 +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.
-import 'package:analysis_server/driver.dart';
+import 'package:analysis_server/starter.dart';
/**
- * Create and run an HTTP-based analysis server.
+ * Create and run an analysis server.
*/
void main(List<String> args) {
- Driver driver = new Driver();
- driver.start(args);
+ ServerStarter starter = new ServerStarter();
+ starter.start(args);
}
diff --git a/pkg/analysis_server/doc/api.html b/pkg/analysis_server/doc/api.html
index 3b36dd0..c3214a9 100644
--- a/pkg/analysis_server/doc/api.html
+++ b/pkg/analysis_server/doc/api.html
@@ -1441,6 +1441,13 @@
matching the original as possible, but whitespace at the beginning or
end of the selected region will be ignored.
</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.
+ </p>
<h4>Parameters</h4><dl><dt class="field"><b><i>file ( <a href="#type_FilePath">FilePath</a> )</i></b></dt><dd>
@@ -2000,7 +2007,6 @@
-
<dl><dt class="typeDefinition"><a name="type_AddContentOverlay">AddContentOverlay: object</a></dt><dd>
<p>
A directive to begin overlaying the contents of a file. The
@@ -2080,7 +2086,7 @@
An enumeration of the possible types of analysis errors.
</p>
- <dl><dt class="value">ANGULAR</dt><dt class="value">CHECKED_MODE_COMPILE_TIME_ERROR</dt><dt class="value">COMPILE_TIME_ERROR</dt><dt class="value">HINT</dt><dt class="value">POLYMER</dt><dt class="value">STATIC_TYPE_WARNING</dt><dt class="value">STATIC_WARNING</dt><dt class="value">SYNTACTIC_ERROR</dt><dt class="value">TODO</dt></dl></dd><dt class="typeDefinition"><a name="type_AnalysisOptions">AnalysisOptions: object</a></dt><dd>
+ <dl><dt class="value">CHECKED_MODE_COMPILE_TIME_ERROR</dt><dt class="value">COMPILE_TIME_ERROR</dt><dt class="value">HINT</dt><dt class="value">LINT</dt><dt class="value">STATIC_TYPE_WARNING</dt><dt class="value">STATIC_WARNING</dt><dt class="value">SYNTACTIC_ERROR</dt><dt class="value">TODO</dt></dl></dd><dt class="typeDefinition"><a name="type_AnalysisOptions">AnalysisOptions: object</a></dt><dd>
<p>
A set of options controlling what kind of analysis is to be
performed. If the value of a field is omitted the value of the
@@ -2089,19 +2095,22 @@
<dl><dt class="field"><b><i>enableAsync ( <span style="color:#999999">optional</span> bool )</i></b></dt><dd>
- <p>
+ <p><b><i>Deprecated</i></b>/</p><p>
+ </p><p>
True if the client wants to enable support for the
proposed async feature.
</p>
</dd><dt class="field"><b><i>enableDeferredLoading ( <span style="color:#999999">optional</span> bool )</i></b></dt><dd>
- <p>
+ <p><b><i>Deprecated</i></b>/</p><p>
+ </p><p>
True if the client wants to enable support for the
proposed deferred loading feature.
</p>
</dd><dt class="field"><b><i>enableEnums ( <span style="color:#999999">optional</span> bool )</i></b></dt><dd>
- <p>
+ <p><b><i>Deprecated</i></b>/</p><p>
+ </p><p>
True if the client wants to enable support for the
proposed enum feature.
</p>
@@ -2114,7 +2123,13 @@
</dd><dt class="field"><b><i>generateHints ( <span style="color:#999999">optional</span> bool )</i></b></dt><dd>
<p>
- True is hints should be generated as part of generating
+ True if hints should be generated as part of generating
+ errors and warnings.
+ </p>
+ </dd><dt class="field"><b><i>generateLints ( <span style="color:#999999">optional</span> bool )</i></b></dt><dd>
+
+ <p>
+ True if lints should be generated as part of generating
errors and warnings.
</p>
</dd></dl></dd><dt class="typeDefinition"><a name="type_AnalysisService">AnalysisService: String</a></dt><dd>
@@ -2170,13 +2185,7 @@
An identifier used to associate completion results with a
completion request.
</p>
- </dd><dt class="typeDefinition"><a name="type_CompletionRelevance">CompletionRelevance: String</a></dt><dd>
- <p>
- An enumeration of the relevance of a completion
- suggestion.
- </p>
-
- <dl><dt class="value">LOW</dt><dt class="value">DEFAULT</dt><dt class="value">HIGH</dt></dl></dd><dt class="typeDefinition"><a name="type_CompletionSuggestion">CompletionSuggestion: object</a></dt><dd>
+ </dd><dt class="typeDefinition"><a name="type_CompletionSuggestion">CompletionSuggestion: object</a></dt><dd>
<p>
A suggestion for how to complete partially entered text. Many
of the fields are optional, depending on the kind of element
@@ -2188,10 +2197,11 @@
<p>
The kind of element being suggested.
</p>
- </dd><dt class="field"><b><i>relevance ( <a href="#type_CompletionRelevance">CompletionRelevance</a> )</i></b></dt><dd>
+ </dd><dt class="field"><b><i>relevance ( int )</i></b></dt><dd>
<p>
- The relevance of this completion suggestion.
+ The relevance of this completion suggestion
+ where a higher number indicates a higher relevance.
</p>
</dd><dt class="field"><b><i>completion ( String )</i></b></dt><dd>
@@ -2254,8 +2264,9 @@
</dd><dt class="field"><b><i>returnType ( <span style="color:#999999">optional</span> String )</i></b></dt><dd>
<p>
- The return type of the getter, function or method being
- suggested. This field is omitted if the suggested element
+ 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.
</p>
</dd><dt class="field"><b><i>parameterNames ( <span style="color:#999999">optional</span> List<String> )</i></b></dt><dd>
@@ -2963,6 +2974,12 @@
not be satisfied because the content of the file changed before
the requested results could be computed.
</p>
+ </dd><dt class="value">FORMAT_INVALID_FILE</dt><dd>
+
+ <p>
+ An "edit.format" request specified a FilePath
+ which does not match a Dart file in an analysis root.
+ </p>
</dd><dt class="value">GET_ERRORS_INVALID_FILE</dt><dd>
<p>
diff --git a/pkg/analysis_server/lib/plugin/plugin.dart b/pkg/analysis_server/lib/plugin/plugin.dart
new file mode 100644
index 0000000..9df0474
--- /dev/null
+++ b/pkg/analysis_server/lib/plugin/plugin.dart
@@ -0,0 +1,130 @@
+// 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.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/analysis_server/lib/src/analysis_logger.dart b/pkg/analysis_server/lib/src/analysis_logger.dart
index 32a9417..e87bc2a 100644
--- a/pkg/analysis_server/lib/src/analysis_logger.dart
+++ b/pkg/analysis_server/lib/src/analysis_logger.dart
@@ -18,6 +18,15 @@
*/
final logging.Logger baseLogger = new logging.Logger('analysis.server');
+ AnalysisLogger() {
+ logging.Logger.root.onRecord.listen((logging.LogRecord record) {
+ AnalysisEngine.instance.instrumentationService.logLogEntry(
+ record.level.name,
+ record.time,
+ record.message);
+ });
+ }
+
@override
void logError(String message, [CaughtException exception]) {
if (exception == null) {
diff --git a/pkg/analysis_server/lib/src/analysis_server.dart b/pkg/analysis_server/lib/src/analysis_server.dart
index b1941df..14d2480 100644
--- a/pkg/analysis_server/lib/src/analysis_server.dart
+++ b/pkg/analysis_server/lib/src/analysis_server.dart
@@ -154,6 +154,11 @@
new HashMap<AnalysisContext, Completer<AnalysisDoneReason>>();
/**
+ * The option possibly set from the server initialization which disables error notifications.
+ */
+ bool _noErrorNotification;
+
+ /**
* The controller that is notified when analysis is started.
*/
StreamController<AnalysisContext> _onAnalysisStartedController;
@@ -201,6 +206,7 @@
analysisServerOptions.enableIncrementalResolutionApi;
contextDirectoryManager.defaultOptions.incrementalValidation =
analysisServerOptions.enableIncrementalResolutionValidation;
+ _noErrorNotification = analysisServerOptions.noErrorNotification;
AnalysisEngine.instance.logger = new AnalysisLogger();
_onAnalysisStartedController = new StreamController.broadcast();
_onAnalysisCompleteController = new StreamController.broadcast();
@@ -512,7 +518,9 @@
}
}
channel.sendResponse(new Response.unknownRequest(request));
- }, onError: _sendServerErrorNotification);
+ }, onError: (exception, stackTrace) {
+ sendServerErrorNotification(exception, stackTrace, fatal: true);
+ });
}
/**
@@ -603,7 +611,7 @@
'Unexpected exception during analysis',
new CaughtException(exception, stackTrace));
}
- _sendServerErrorNotification(exception, stackTrace);
+ sendServerErrorNotification(exception, stackTrace, fatal: true);
shutdown();
} finally {
if (!operationQueue.isEmpty) {
@@ -627,14 +635,6 @@
}
/**
- * Report to the client that the given [exception] was caught with the
- * associated [stackTrace].
- */
- void reportException(dynamic exception, StackTrace stackTrace) {
- _sendServerErrorNotification(exception, stackTrace);
- }
-
- /**
* Schedules execution of the given [ServerOperation].
*/
void scheduleOperation(ServerOperation operation) {
@@ -680,6 +680,32 @@
}
/**
+ * Sends a `server.error` notification.
+ */
+ void sendServerErrorNotification(exception, stackTrace, {bool fatal: false}) {
+ // prepare exception.toString()
+ String exceptionString;
+ if (exception != null) {
+ exceptionString = exception.toString();
+ } else {
+ exceptionString = 'null exception';
+ }
+ // prepare stackTrace.toString()
+ String stackTraceString;
+ if (stackTrace != null) {
+ stackTraceString = stackTrace.toString();
+ } else {
+ stackTraceString = 'null stackTrace';
+ }
+ // send the notification
+ channel.sendNotification(
+ new ServerErrorParams(
+ fatal,
+ exceptionString,
+ stackTraceString).toNotification());
+ }
+
+ /**
* Send status notification to the client. The `operation` is the operation
* being performed or `null` if analysis is complete.
*/
@@ -819,8 +845,8 @@
* absolute path.
*/
bool shouldSendErrorsNotificationFor(String file) {
- // TODO(scheglov) add support for the "--no-error-notification" flag.
- return contextDirectoryManager.isInAnalysisRoot(file);
+ return !_noErrorNotification &&
+ contextDirectoryManager.isInAnalysisRoot(file);
}
void shutdown() {
@@ -915,38 +941,13 @@
new Future(performOperation);
performOperationPending = true;
}
-
- /**
- * Sends a fatal `server.error` notification.
- */
- void _sendServerErrorNotification(exception, stackTrace) {
- // prepare exception.toString()
- String exceptionString;
- if (exception != null) {
- exceptionString = exception.toString();
- } else {
- exceptionString = 'null exception';
- }
- // prepare stackTrace.toString()
- String stackTraceString;
- if (stackTrace != null) {
- stackTraceString = stackTrace.toString();
- } else {
- stackTraceString = 'null stackTrace';
- }
- // send the notification
- channel.sendNotification(
- new ServerErrorParams(
- true,
- exceptionString,
- stackTraceString).toNotification());
- }
}
class AnalysisServerOptions {
bool enableIncrementalResolutionApi = false;
bool enableIncrementalResolutionValidation = false;
+ bool noErrorNotification = false;
}
/**
diff --git a/pkg/analysis_server/lib/src/constants.dart b/pkg/analysis_server/lib/src/constants.dart
index d79f8f8..7aa71a7 100644
--- a/pkg/analysis_server/lib/src/constants.dart
+++ b/pkg/analysis_server/lib/src/constants.dart
@@ -90,8 +90,6 @@
//
// Analysis option names
//
-const String ANALYZE_ANGULAR = 'analyzeAngular'; // boolean
-const String ANALYZE_POLYMER = 'analyzePolymer'; // boolean
const String ENABLE_ASYNC = 'enableAsync'; // boolean
const String ENABLE_DEFERRED_LOADING = 'enableDeferredLoading'; // boolean
const String ENABLE_ENUMS = 'enableEnums'; // boolean
diff --git a/pkg/analysis_server/lib/src/domain_analysis.dart b/pkg/analysis_server/lib/src/domain_analysis.dart
index cee2708..829745a 100644
--- a/pkg/analysis_server/lib/src/domain_analysis.dart
+++ b/pkg/analysis_server/lib/src/domain_analysis.dart
@@ -175,16 +175,6 @@
var params = new AnalysisUpdateOptionsParams.fromRequest(request);
AnalysisOptions newOptions = params.options;
List<OptionUpdater> updaters = new List<OptionUpdater>();
- if (newOptions.enableDeferredLoading != null) {
- updaters.add((engine.AnalysisOptionsImpl options) {
- options.enableDeferredLoading = newOptions.enableDeferredLoading;
- });
- }
- if (newOptions.enableEnums != null) {
- updaters.add((engine.AnalysisOptionsImpl options) {
- options.enableEnum = newOptions.enableEnums;
- });
- }
if (newOptions.generateDart2jsHints != null) {
updaters.add((engine.AnalysisOptionsImpl options) {
options.dart2jsHint = newOptions.generateDart2jsHints;
diff --git a/pkg/analysis_server/lib/src/edit/edit_domain.dart b/pkg/analysis_server/lib/src/edit/edit_domain.dart
index a1ad8ef..70ce1d3 100644
--- a/pkg/analysis_server/lib/src/edit/edit_domain.dart
+++ b/pkg/analysis_server/lib/src/edit/edit_domain.dart
@@ -23,6 +23,7 @@
import 'package:analyzer/src/generated/parser.dart' as engine;
import 'package:analyzer/src/generated/scanner.dart' as engine;
import 'package:analyzer/src/generated/source.dart';
+import 'package:dart_style/dart_style.dart';
bool test_simulateRefactoringException_change = false;
@@ -56,20 +57,47 @@
}
Response format(Request request) {
- throw new RequestFailure(
- new Response.unsupportedFeature(
- request.id,
- 'The edit.format request is not yet supported'));
-// EditFormatParams params = new EditFormatParams.fromRequest(request);
-// String file = params.file;
-// int initialOffset = params.selectionOffset;
-// int initialLength = params.selectionLength;
-//
-// List<SourceEdit> edits = <SourceEdit>[];
-// int finalOffset = initialOffset;
-// int finalLength = initialLength;
-// return new EditFormatResult(edits, finalOffset, finalLength).toResponse(request.id);
+ EditFormatParams params = new EditFormatParams.fromRequest(request);
+ String file = params.file;
+
+ engine.AnalysisContext context = server.getAnalysisContext(file);
+ if (context == null) {
+ return new Response.formatInvalidFile(request);
+ }
+
+ Source source = server.getSource(file);
+ engine.TimestampedData<String> contents;
+ try {
+ contents = context.getContents(source);
+ } catch (e) {
+ return new Response.formatInvalidFile(request);
+ }
+ String unformattedSource = contents.data;
+
+ SourceCode code = new SourceCode(
+ unformattedSource,
+ uri: null,
+ isCompilationUnit: true,
+ selectionStart: params.selectionOffset,
+ selectionLength: params.selectionLength);
+ DartFormatter formatter = new DartFormatter();
+ SourceCode formattedResult = formatter.formatSource(code);
+ String formattedSource = formattedResult.text;
+
+ List<SourceEdit> edits = <SourceEdit>[];
+
+ if (formattedSource != unformattedSource) {
+ //TODO: replace full replacements with smaller, more targeted edits
+ SourceEdit edit =
+ new SourceEdit(0, unformattedSource.length, formattedSource);
+ edits.add(edit);
+ }
+
+ return new EditFormatResult(
+ edits,
+ formattedResult.selectionStart,
+ formattedResult.selectionLength).toResponse(request.id);
}
Response getAssists(Request request) {
diff --git a/pkg/analysis_server/lib/src/generated_protocol.dart b/pkg/analysis_server/lib/src/generated_protocol.dart
index 2f60507..d83dd32 100644
--- a/pkg/analysis_server/lib/src/generated_protocol.dart
+++ b/pkg/analysis_server/lib/src/generated_protocol.dart
@@ -5331,11 +5331,10 @@
* AnalysisErrorType
*
* enum {
- * ANGULAR
* CHECKED_MODE_COMPILE_TIME_ERROR
* COMPILE_TIME_ERROR
* HINT
- * POLYMER
+ * LINT
* STATIC_TYPE_WARNING
* STATIC_WARNING
* SYNTACTIC_ERROR
@@ -5343,15 +5342,13 @@
* }
*/
class AnalysisErrorType implements Enum {
- static const ANGULAR = const AnalysisErrorType._("ANGULAR");
-
static const CHECKED_MODE_COMPILE_TIME_ERROR = const AnalysisErrorType._("CHECKED_MODE_COMPILE_TIME_ERROR");
static const COMPILE_TIME_ERROR = const AnalysisErrorType._("COMPILE_TIME_ERROR");
static const HINT = const AnalysisErrorType._("HINT");
- static const POLYMER = const AnalysisErrorType._("POLYMER");
+ static const LINT = const AnalysisErrorType._("LINT");
static const STATIC_TYPE_WARNING = const AnalysisErrorType._("STATIC_TYPE_WARNING");
@@ -5367,16 +5364,14 @@
factory AnalysisErrorType(String name) {
switch (name) {
- case "ANGULAR":
- return ANGULAR;
case "CHECKED_MODE_COMPILE_TIME_ERROR":
return CHECKED_MODE_COMPILE_TIME_ERROR;
case "COMPILE_TIME_ERROR":
return COMPILE_TIME_ERROR;
case "HINT":
return HINT;
- case "POLYMER":
- return POLYMER;
+ case "LINT":
+ return LINT;
case "STATIC_TYPE_WARNING":
return STATIC_TYPE_WARNING;
case "STATIC_WARNING":
@@ -5415,21 +5410,28 @@
* "enableEnums": optional bool
* "generateDart2jsHints": optional bool
* "generateHints": optional bool
+ * "generateLints": optional bool
* }
*/
class AnalysisOptions implements HasToJson {
/**
+ * Deprecated/
+ *
* True if the client wants to enable support for the proposed async feature.
*/
bool enableAsync;
/**
+ * Deprecated/
+ *
* True if the client wants to enable support for the proposed deferred
* loading feature.
*/
bool enableDeferredLoading;
/**
+ * Deprecated/
+ *
* True if the client wants to enable support for the proposed enum feature.
*/
bool enableEnums;
@@ -5441,12 +5443,18 @@
bool generateDart2jsHints;
/**
- * True is hints should be generated as part of generating errors and
+ * True if hints should be generated as part of generating errors and
* warnings.
*/
bool generateHints;
- AnalysisOptions({this.enableAsync, this.enableDeferredLoading, this.enableEnums, this.generateDart2jsHints, this.generateHints});
+ /**
+ * True if lints should be generated as part of generating errors and
+ * warnings.
+ */
+ bool generateLints;
+
+ AnalysisOptions({this.enableAsync, this.enableDeferredLoading, this.enableEnums, this.generateDart2jsHints, this.generateHints, this.generateLints});
factory AnalysisOptions.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
if (json == null) {
@@ -5473,7 +5481,11 @@
if (json.containsKey("generateHints")) {
generateHints = jsonDecoder._decodeBool(jsonPath + ".generateHints", json["generateHints"]);
}
- return new AnalysisOptions(enableAsync: enableAsync, enableDeferredLoading: enableDeferredLoading, enableEnums: enableEnums, generateDart2jsHints: generateDart2jsHints, generateHints: generateHints);
+ bool generateLints;
+ if (json.containsKey("generateLints")) {
+ generateLints = jsonDecoder._decodeBool(jsonPath + ".generateLints", json["generateLints"]);
+ }
+ return new AnalysisOptions(enableAsync: enableAsync, enableDeferredLoading: enableDeferredLoading, enableEnums: enableEnums, generateDart2jsHints: generateDart2jsHints, generateHints: generateHints, generateLints: generateLints);
} else {
throw jsonDecoder.mismatch(jsonPath, "AnalysisOptions");
}
@@ -5496,6 +5508,9 @@
if (generateHints != null) {
result["generateHints"] = generateHints;
}
+ if (generateLints != null) {
+ result["generateLints"] = generateLints;
+ }
return result;
}
@@ -5509,7 +5524,8 @@
enableDeferredLoading == other.enableDeferredLoading &&
enableEnums == other.enableEnums &&
generateDart2jsHints == other.generateDart2jsHints &&
- generateHints == other.generateHints;
+ generateHints == other.generateHints &&
+ generateLints == other.generateLints;
}
return false;
}
@@ -5522,6 +5538,7 @@
hash = _JenkinsSmiHash.combine(hash, enableEnums.hashCode);
hash = _JenkinsSmiHash.combine(hash, generateDart2jsHints.hashCode);
hash = _JenkinsSmiHash.combine(hash, generateHints.hashCode);
+ hash = _JenkinsSmiHash.combine(hash, generateLints.hashCode);
return _JenkinsSmiHash.finish(hash);
}
}
@@ -5732,60 +5749,11 @@
}
/**
- * CompletionRelevance
- *
- * enum {
- * LOW
- * DEFAULT
- * HIGH
- * }
- */
-class CompletionRelevance implements Enum {
- static const LOW = const CompletionRelevance._("LOW");
-
- static const DEFAULT = const CompletionRelevance._("DEFAULT");
-
- static const HIGH = const CompletionRelevance._("HIGH");
-
- final String name;
-
- const CompletionRelevance._(this.name);
-
- factory CompletionRelevance(String name) {
- switch (name) {
- case "LOW":
- return LOW;
- case "DEFAULT":
- return DEFAULT;
- case "HIGH":
- return HIGH;
- }
- throw new Exception('Illegal enum value: $name');
- }
-
- factory CompletionRelevance.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
- if (json is String) {
- try {
- return new CompletionRelevance(json);
- } catch(_) {
- // Fall through
- }
- }
- throw jsonDecoder.mismatch(jsonPath, "CompletionRelevance");
- }
-
- @override
- String toString() => "CompletionRelevance.$name";
-
- String toJson() => name;
-}
-
-/**
* CompletionSuggestion
*
* {
* "kind": CompletionSuggestionKind
- * "relevance": CompletionRelevance
+ * "relevance": int
* "completion": String
* "selectionOffset": int
* "selectionLength": int
@@ -5811,9 +5779,10 @@
CompletionSuggestionKind kind;
/**
- * The relevance of this completion suggestion.
+ * The relevance of this completion suggestion where a higher number
+ * indicates a higher relevance.
*/
- CompletionRelevance relevance;
+ int relevance;
/**
* The identifier to be inserted if the suggestion is selected. If the
@@ -5870,9 +5839,9 @@
Element element;
/**
- * The return type of the getter, function or method being suggested. This
- * field is omitted if the suggested element is not a getter, function or
- * method.
+ * 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;
@@ -5927,9 +5896,9 @@
} else {
throw jsonDecoder.missingKey(jsonPath, "kind");
}
- CompletionRelevance relevance;
+ int relevance;
if (json.containsKey("relevance")) {
- relevance = new CompletionRelevance.fromJson(jsonDecoder, jsonPath + ".relevance", json["relevance"]);
+ relevance = jsonDecoder._decodeInt(jsonPath + ".relevance", json["relevance"]);
} else {
throw jsonDecoder.missingKey(jsonPath, "relevance");
}
@@ -6016,7 +5985,7 @@
Map<String, dynamic> toJson() {
Map<String, dynamic> result = {};
result["kind"] = kind.toJson();
- result["relevance"] = relevance.toJson();
+ result["relevance"] = relevance;
result["completion"] = completion;
result["selectionOffset"] = selectionOffset;
result["selectionLength"] = selectionLength;
@@ -9033,6 +9002,7 @@
*
* enum {
* CONTENT_MODIFIED
+ * FORMAT_INVALID_FILE
* GET_ERRORS_INVALID_FILE
* INVALID_OVERLAY_CHANGE
* INVALID_PARAMETER
@@ -9055,6 +9025,12 @@
static const CONTENT_MODIFIED = const RequestErrorCode._("CONTENT_MODIFIED");
/**
+ * An "edit.format" request specified a FilePath which does not match a Dart
+ * file in an analysis root.
+ */
+ static const FORMAT_INVALID_FILE = const RequestErrorCode._("FORMAT_INVALID_FILE");
+
+ /**
* An "analysis.getErrors" request specified a FilePath which does not match
* a file currently subject to analysis.
*/
@@ -9137,6 +9113,8 @@
switch (name) {
case "CONTENT_MODIFIED":
return CONTENT_MODIFIED;
+ case "FORMAT_INVALID_FILE":
+ return FORMAT_INVALID_FILE;
case "GET_ERRORS_INVALID_FILE":
return GET_ERRORS_INVALID_FILE;
case "INVALID_OVERLAY_CHANGE":
diff --git a/pkg/analysis_server/lib/src/operation/operation_analysis.dart b/pkg/analysis_server/lib/src/operation/operation_analysis.dart
index a642da2..facf368 100644
--- a/pkg/analysis_server/lib/src/operation/operation_analysis.dart
+++ b/pkg/analysis_server/lib/src/operation/operation_analysis.dart
@@ -22,55 +22,83 @@
void sendAnalysisNotificationErrors(AnalysisServer server, String file,
LineInfo lineInfo, List<AnalysisError> errors) {
- var serverErrors = protocol.doAnalysisError_listFromEngine(lineInfo, errors);
- var params = new protocol.AnalysisErrorsParams(file, serverErrors);
- server.sendNotification(params.toNotification());
+ try {
+ if (errors == null) {
+ errors = <AnalysisError>[];
+ }
+ var serverErrors =
+ protocol.doAnalysisError_listFromEngine(lineInfo, errors);
+ var params = new protocol.AnalysisErrorsParams(file, serverErrors);
+ server.sendNotification(params.toNotification());
+ } catch (exception, stackTrace) {
+ server.sendServerErrorNotification(exception, stackTrace);
+ }
}
void sendAnalysisNotificationHighlights(AnalysisServer server, String file,
CompilationUnit dartUnit) {
- var regions = new DartUnitHighlightsComputer(dartUnit).compute();
- var params = new protocol.AnalysisHighlightsParams(file, regions);
- server.sendNotification(params.toNotification());
+ try {
+ var regions = new DartUnitHighlightsComputer(dartUnit).compute();
+ var params = new protocol.AnalysisHighlightsParams(file, regions);
+ server.sendNotification(params.toNotification());
+ } catch (exception, stackTrace) {
+ server.sendServerErrorNotification(exception, stackTrace);
+ }
}
void sendAnalysisNotificationNavigation(AnalysisServer server, String file,
CompilationUnit dartUnit) {
- var computer = new DartUnitNavigationComputer(dartUnit);
- computer.compute();
- var params = new protocol.AnalysisNavigationParams(
- file,
- computer.regions,
- computer.targets,
- computer.files);
- server.sendNotification(params.toNotification());
+ try {
+ var computer = new DartUnitNavigationComputer(dartUnit);
+ computer.compute();
+ var params = new protocol.AnalysisNavigationParams(
+ file,
+ computer.regions,
+ computer.targets,
+ computer.files);
+ server.sendNotification(params.toNotification());
+ } catch (exception, stackTrace) {
+ server.sendServerErrorNotification(exception, stackTrace);
+ }
}
void sendAnalysisNotificationOccurrences(AnalysisServer server, String file,
CompilationUnit dartUnit) {
- var occurrences = new DartUnitOccurrencesComputer(dartUnit).compute();
- var params = new protocol.AnalysisOccurrencesParams(file, occurrences);
- server.sendNotification(params.toNotification());
+ try {
+ var occurrences = new DartUnitOccurrencesComputer(dartUnit).compute();
+ var params = new protocol.AnalysisOccurrencesParams(file, occurrences);
+ server.sendNotification(params.toNotification());
+ } catch (exception, stackTrace) {
+ server.sendServerErrorNotification(exception, stackTrace);
+ }
}
void sendAnalysisNotificationOutline(AnalysisServer server, Source source,
LineInfo lineInfo, CompilationUnit dartUnit) {
- var outline =
- new DartUnitOutlineComputer(source, lineInfo, dartUnit).compute();
- var params = new protocol.AnalysisOutlineParams(source.fullName, outline);
- server.sendNotification(params.toNotification());
+ try {
+ var computer = new DartUnitOutlineComputer(source, lineInfo, dartUnit);
+ var outline = computer.compute();
+ var params = new protocol.AnalysisOutlineParams(source.fullName, outline);
+ server.sendNotification(params.toNotification());
+ } catch (exception, stackTrace) {
+ server.sendServerErrorNotification(exception, stackTrace);
+ }
}
void sendAnalysisNotificationOverrides(AnalysisServer server, String file,
CompilationUnit dartUnit) {
- var overrides = new DartUnitOverridesComputer(dartUnit).compute();
- var params = new protocol.AnalysisOverridesParams(file, overrides);
- server.sendNotification(params.toNotification());
+ try {
+ var overrides = new DartUnitOverridesComputer(dartUnit).compute();
+ var params = new protocol.AnalysisOverridesParams(file, overrides);
+ server.sendNotification(params.toNotification());
+ } catch (exception, stackTrace) {
+ server.sendServerErrorNotification(exception, stackTrace);
+ }
}
@@ -113,7 +141,7 @@
}
// process results
sendNotices(server, notices);
- updateIndex(server.index, notices);
+ updateIndex(server, notices);
// continue analysis
server.addOperation(new PerformAnalysisOperation(context, true));
}
@@ -167,24 +195,29 @@
}
}
- void updateIndex(Index index, List<ChangeNotice> notices) {
+ void updateIndex(AnalysisServer server, List<ChangeNotice> notices) {
+ Index index = server.index;
if (index == null) {
return;
}
for (ChangeNotice notice in notices) {
// Dart
- {
+ try {
CompilationUnit dartUnit = notice.compilationUnit;
if (dartUnit != null) {
index.indexUnit(context, dartUnit);
}
+ } catch (exception, stackTrace) {
+ server.sendServerErrorNotification(exception, stackTrace);
}
// HTML
- {
+ try {
HtmlUnit htmlUnit = notice.htmlUnit;
if (htmlUnit != null) {
index.indexHtmlUnit(context, htmlUnit);
}
+ } catch (exception, stackTrace) {
+ server.sendServerErrorNotification(exception, stackTrace);
}
}
}
diff --git a/pkg/analysis_server/lib/src/plugin/plugin_impl.dart b/pkg/analysis_server/lib/src/plugin/plugin_impl.dart
new file mode 100644
index 0000000..2245b6f
--- /dev/null
+++ b/pkg/analysis_server/lib/src/plugin/plugin_impl.dart
@@ -0,0 +1,125 @@
+// 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.plugin.plugin_impl;
+
+import 'dart:collection';
+
+import 'package:analysis_server/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/analysis_server/lib/src/plugin/server_plugin.dart b/pkg/analysis_server/lib/src/plugin/server_plugin.dart
new file mode 100644
index 0000000..9182321
--- /dev/null
+++ b/pkg/analysis_server/lib/src/plugin/server_plugin.dart
@@ -0,0 +1,107 @@
+// 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.plugin.server_plugin;
+
+import 'package:analysis_server/plugin/plugin.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';
+import 'package:analysis_server/src/domain_execution.dart';
+import 'package:analysis_server/src/domain_server.dart';
+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';
+
+/**
+ * A function that will create a request handler that can be used by the given
+ * [server].
+ *
+ * TODO(brianwilkerson) Move this into 'protocol.dart'.
+ */
+typedef RequestHandler RequestHandlerFactory(AnalysisServer server);
+
+/**
+ * A plugin that defines the extension points and extensions that are inherently
+ * defined by the analysis server.
+ */
+class ServerPlugin implements Plugin {
+ /**
+ * 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 unique identifier of this plugin.
+ */
+ static const String UNIQUE_IDENTIFIER = 'analysis_server.core';
+
+ /**
+ * The extension point that allows plugins to register new domains with the
+ * server.
+ */
+ ExtensionPoint domainExtensionPoint;
+
+ /**
+ * Initialize a newly created plugin.
+ */
+ ServerPlugin();
+
+ @override
+ String get uniqueIdentifier => UNIQUE_IDENTIFIER;
+
+ /**
+ * Use the given [server] to create all of the domains ([RequestHandler]'s)
+ * that have been registered and return the newly created domains.
+ */
+ List<RequestHandler> createDomains(AnalysisServer server) {
+ if (domainExtensionPoint == null) {
+ return <RequestHandler>[];
+ }
+ return domainExtensionPoint.extensions.map(
+ (RequestHandlerFactory factory) => factory(server)).toList();
+ }
+
+ @override
+ void registerExtensionPoints(RegisterExtensionPoint registerExtensionPoint) {
+ domainExtensionPoint =
+ registerExtensionPoint(DOMAIN_EXTENSION_POINT, _validateDomainExtension);
+ }
+
+ @override
+ void registerExtensions(RegisterExtension registerExtension) {
+ 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 SearchDomainHandler(server));
+ registerExtension(
+ domainId,
+ (AnalysisServer server) => new CompletionDomainHandler(server));
+ registerExtension(
+ domainId,
+ (AnalysisServer server) => new ExecutionDomainHandler(server));
+ }
+
+ /**
+ * Validate the given extension by throwing an [ExtensionError] if it is not a
+ * valid domain.
+ */
+ void _validateDomainExtension(Object extension) {
+ if (extension is! RequestHandlerFactory) {
+ String id = domainExtensionPoint.uniqueIdentifier;
+ throw new ExtensionError(
+ 'Extensions to $id must be a RequestHandlerFactory');
+ }
+ }
+}
diff --git a/pkg/analysis_server/lib/src/protocol.dart b/pkg/analysis_server/lib/src/protocol.dart
index 8dc44de..95eb38c 100644
--- a/pkg/analysis_server/lib/src/protocol.dart
+++ b/pkg/analysis_server/lib/src/protocol.dart
@@ -718,6 +718,17 @@
/**
* 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
* GET_ERRORS_INVALID_FILE error condition.
*/
Response.getErrorsInvalidFile(Request request)
diff --git a/pkg/analysis_server/lib/src/protocol_server.dart b/pkg/analysis_server/lib/src/protocol_server.dart
index 9f12f18..90e1512 100644
--- a/pkg/analysis_server/lib/src/protocol_server.dart
+++ b/pkg/analysis_server/lib/src/protocol_server.dart
@@ -330,39 +330,41 @@
String _getParametersString(engine.Element element) {
// TODO(scheglov) expose the corresponding feature from ExecutableElement
+ List<engine.ParameterElement> parameters;
if (element is engine.ExecutableElement) {
// valid getters don't have parameters
if (element.kind == engine.ElementKind.GETTER &&
element.parameters.isEmpty) {
return null;
}
- // append parameters
- StringBuffer sb = new StringBuffer();
- String closeOptionalString = '';
- for (engine.ParameterElement parameter in element.parameters) {
- if (sb.isNotEmpty) {
- sb.write(', ');
- }
- if (closeOptionalString.isEmpty) {
- if (parameter.kind == engine.ParameterKind.NAMED) {
- sb.write('{');
- closeOptionalString = '}';
- }
- if (parameter.kind == engine.ParameterKind.POSITIONAL) {
- sb.write('[');
- closeOptionalString = ']';
- }
- }
- sb.write(parameter.toString());
- }
- sb.write(closeOptionalString);
- return '(' + sb.toString() + ')';
+ parameters = element.parameters;
+ } else if (element is engine.FunctionTypeAliasElement) {
+ parameters = element.parameters;
} else {
return null;
}
+ StringBuffer sb = new StringBuffer();
+ String closeOptionalString = '';
+ for (engine.ParameterElement parameter in parameters) {
+ if (sb.isNotEmpty) {
+ sb.write(', ');
+ }
+ if (closeOptionalString.isEmpty) {
+ if (parameter.kind == engine.ParameterKind.NAMED) {
+ sb.write('{');
+ closeOptionalString = '}';
+ }
+ if (parameter.kind == engine.ParameterKind.POSITIONAL) {
+ sb.write('[');
+ closeOptionalString = ']';
+ }
+ }
+ sb.write(parameter.toString());
+ }
+ sb.write(closeOptionalString);
+ return '(' + sb.toString() + ')';
}
-
String _getReturnTypeString(engine.Element element) {
if (element is engine.ExecutableElement) {
if (element.kind == engine.ElementKind.SETTER) {
@@ -370,6 +372,11 @@
} else {
return element.returnType.toString();
}
+ } else if (element is engine.VariableElement) {
+ engine.DartType type = element.type;
+ return type != null ? type.displayName : 'dynamic';
+ } else if (element is engine.FunctionTypeAliasElement) {
+ return element.returnType.toString();
} else {
return null;
}
diff --git a/pkg/analysis_server/lib/driver.dart b/pkg/analysis_server/lib/src/server/driver.dart
similarity index 83%
rename from pkg/analysis_server/lib/driver.dart
rename to pkg/analysis_server/lib/src/server/driver.dart
index dbd550a..92c4ecc 100644
--- a/pkg/analysis_server/lib/driver.dart
+++ b/pkg/analysis_server/lib/src/server/driver.dart
@@ -7,10 +7,14 @@
import 'dart:async';
import 'dart:io';
-import 'package:analysis_server/http_server.dart';
+import 'package:analysis_server/plugin/plugin.dart';
import 'package:analysis_server/src/analysis_server.dart';
+import 'package:analysis_server/src/plugin/plugin_impl.dart';
+import 'package:analysis_server/src/plugin/server_plugin.dart';
+import 'package:analysis_server/src/server/http_server.dart';
+import 'package:analysis_server/src/server/stdio_server.dart';
import 'package:analysis_server/src/socket_server.dart';
-import 'package:analysis_server/stdio_server.dart';
+import 'package:analysis_server/starter.dart';
import 'package:analyzer/instrumentation/instrumentation.dart';
import 'package:analyzer/src/generated/engine.dart';
import 'package:analyzer/src/generated/incremental_logger.dart';
@@ -51,7 +55,7 @@
* server application. It is responsible for parsing command line options
* and starting the HTTP and/or stdio servers.
*/
-class Driver {
+class Driver implements ServerStarter {
/**
* The name of the application that is used to start a server.
*/
@@ -120,6 +124,11 @@
*/
InstrumentationServer instrumentationServer;
+ /**
+ * The plugins that are defined outside the analysis_server package.
+ */
+ List<Plugin> _userDefinedPlugins = <Plugin>[];
+
SocketServer socketServer;
HttpAnalysisServer httpServer;
@@ -127,54 +136,20 @@
StdioAnalysisServer stdioServer;
Driver();
- /**
- * Use the given command-line arguments to start this server.
- */
- void start(List<String> args) {
- ArgParser parser = new ArgParser();
- parser.addOption(
- CLIENT_ID,
- help: "an identifier used to identify the client");
- parser.addFlag(
- ENABLE_INCREMENTAL_RESOLUTION_API,
- help: "enable using incremental resolution for API changes",
- defaultsTo: false,
- negatable: false);
- parser.addFlag(
- ENABLE_INSTRUMENTATION_OPTION,
- help: "enable sending instrumentation information to a server",
- defaultsTo: false,
- negatable: false);
- parser.addFlag(
- HELP_OPTION,
- help: "print this help message without starting a server",
- defaultsTo: false,
- negatable: false);
- parser.addOption(
- INCREMENTAL_RESOLUTION_LOG,
- help: "the description of the incremental resolution log");
- parser.addFlag(
- INCREMENTAL_RESOLUTION_VALIDATION,
- help: "enable validation of incremental resolution results (slow)",
- defaultsTo: false,
- negatable: false);
- parser.addFlag(
- INTERNAL_PRINT_TO_CONSOLE,
- help: "enable sending `print` output to the console",
- defaultsTo: false,
- negatable: false);
- parser.addOption(
- PORT_OPTION,
- help: "[port] the port on which the server will listen");
- parser.addOption(SDK_OPTION, help: "[path] the path to the sdk");
- parser.addFlag(
- NO_ERROR_NOTIFICATION,
- help:
- "disable sending all analysis error notifications to the server (not yet implemented)",
- defaultsTo: false,
- negatable: false);
- ArgResults results = parser.parse(args);
+ /**
+ * Set the [plugins] that are defined outside the analysis_server package.
+ */
+ void set userDefinedPlugins(List<Plugin> plugins) {
+ _userDefinedPlugins = plugins == null ? <Plugin>[] : plugins;
+ }
+
+ /**
+ * Use the given command-line [arguments] to start this server.
+ */
+ void start(List<String> arguments) {
+ ArgParser parser = _createArgParser();
+ ArgResults results = parser.parse(arguments);
if (results[HELP_OPTION]) {
_printUsage(parser);
return;
@@ -218,6 +193,7 @@
results[ENABLE_INCREMENTAL_RESOLUTION_API];
analysisServerOptions.enableIncrementalResolutionValidation =
results[INCREMENTAL_RESOLUTION_VALIDATION];
+ analysisServerOptions.noErrorNotification = results[NO_ERROR_NOTIFICATION];
_initIncrementalLogger(results[INCREMENTAL_RESOLUTION_LOG]);
@@ -234,8 +210,18 @@
new InstrumentationService(instrumentationServer);
// service.logVersion(results[CLIENT_ID], defaultSdk.sdkVersion);
AnalysisEngine.instance.instrumentationService = service;
+ //
+ // Process all of the plugins so that extensions are registered.
+ //
+ ServerPlugin serverPlugin = new ServerPlugin();
+ List<Plugin> plugins = <Plugin>[];
+ plugins.add(serverPlugin);
+ plugins.addAll(_userDefinedPlugins);
+ ExtensionManager manager = new ExtensionManager();
+ manager.processPlugins(plugins);
- socketServer = new SocketServer(analysisServerOptions, defaultSdk, service);
+ socketServer =
+ new SocketServer(analysisServerOptions, defaultSdk, service, serverPlugin);
httpServer = new HttpAnalysisServer(socketServer);
stdioServer = new StdioAnalysisServer(socketServer);
@@ -267,7 +253,8 @@
(Zone self, ZoneDelegate parent, Zone zone, dynamic exception,
StackTrace stackTrace) {
service.logPriorityException(exception, stackTrace);
- socketServer.analysisServer.reportException(exception, stackTrace);
+ AnalysisServer analysisServer = socketServer.analysisServer;
+ analysisServer.sendServerErrorNotification(exception, stackTrace);
throw exception;
};
Function printFunction = print == null ?
@@ -284,6 +271,56 @@
}
/**
+ * Create and return the parser used to parse the command-line arguments.
+ */
+ ArgParser _createArgParser() {
+ ArgParser parser = new ArgParser();
+ parser.addOption(
+ CLIENT_ID,
+ help: "an identifier used to identify the client");
+ parser.addFlag(
+ ENABLE_INCREMENTAL_RESOLUTION_API,
+ help: "enable using incremental resolution for API changes",
+ defaultsTo: false,
+ negatable: false);
+ parser.addFlag(
+ ENABLE_INSTRUMENTATION_OPTION,
+ help: "enable sending instrumentation information to a server",
+ defaultsTo: false,
+ negatable: false);
+ parser.addFlag(
+ HELP_OPTION,
+ help: "print this help message without starting a server",
+ defaultsTo: false,
+ negatable: false);
+ parser.addOption(
+ INCREMENTAL_RESOLUTION_LOG,
+ help: "the description of the incremental resolution log");
+ parser.addFlag(
+ INCREMENTAL_RESOLUTION_VALIDATION,
+ help: "enable validation of incremental resolution results (slow)",
+ defaultsTo: false,
+ negatable: false);
+ parser.addFlag(
+ INTERNAL_PRINT_TO_CONSOLE,
+ help: "enable sending `print` output to the console",
+ defaultsTo: false,
+ negatable: false);
+ parser.addOption(
+ PORT_OPTION,
+ help: "[port] the port on which the server will listen");
+ parser.addOption(SDK_OPTION, help: "[path] the path to the sdk");
+ parser.addFlag(
+ NO_ERROR_NOTIFICATION,
+ help:
+ "disable sending all analysis error notifications to the server",
+ defaultsTo: false,
+ negatable: false);
+
+ return parser;
+ }
+
+ /**
* Print information about how to use the server.
*/
void _printUsage(ArgParser parser) {
diff --git a/pkg/analysis_server/lib/http_server.dart b/pkg/analysis_server/lib/src/server/http_server.dart
similarity index 100%
rename from pkg/analysis_server/lib/http_server.dart
rename to pkg/analysis_server/lib/src/server/http_server.dart
diff --git a/pkg/analysis_server/lib/stdio_server.dart b/pkg/analysis_server/lib/src/server/stdio_server.dart
similarity index 100%
rename from pkg/analysis_server/lib/stdio_server.dart
rename to pkg/analysis_server/lib/src/server/stdio_server.dart
diff --git a/pkg/analysis_server/lib/src/services/completion/arglist_computer.dart b/pkg/analysis_server/lib/src/services/completion/arglist_computer.dart
index 6bb14e1..53ef0ec 100644
--- a/pkg/analysis_server/lib/src/services/completion/arglist_computer.dart
+++ b/pkg/analysis_server/lib/src/services/completion/arglist_computer.dart
@@ -136,7 +136,7 @@
}
@override
- void declaredLabel(Label label) {
+ void declaredLabel(Label label, bool isCaseLabel) {
}
@override
@@ -185,7 +185,7 @@
completion.write(')');
CompletionSuggestion suggestion = new CompletionSuggestion(
CompletionSuggestionKind.ARGUMENT_LIST,
- CompletionRelevance.HIGH,
+ COMPLETION_RELEVANCE_HIGH,
completion.toString(),
completion.length,
0,
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 a9872ec..5435730 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
@@ -10,6 +10,7 @@
import 'package:analysis_server/src/protocol_server.dart' hide Element,
ElementKind;
import 'package:analysis_server/src/services/completion/completion_manager.dart';
+import 'package:analysis_server/src/services/completion/dart_completion_manager.dart';
import 'package:analysis_server/src/services/completion/suggestion_builder.dart';
import 'package:analysis_server/src/services/search/search_engine.dart';
import 'package:analyzer/src/generated/ast.dart';
@@ -177,7 +178,7 @@
if (elem is ClassElement) {
importedClassMap[name] = elem;
}
- _addSuggestion(elem, CompletionRelevance.DEFAULT);
+ _addSuggestion(elem, COMPLETION_RELEVANCE_DEFAULT);
});
}
@@ -201,7 +202,7 @@
if (elem is ClassElement) {
importedClassMap[name] = elem;
}
- _addSuggestion(elem, CompletionRelevance.DEFAULT);
+ _addSuggestion(elem, COMPLETION_RELEVANCE_DEFAULT);
});
} else {
// Exclude elements from prefixed imports
@@ -229,7 +230,7 @@
if (completion != null && completion.length > 0) {
suggestion = new CompletionSuggestion(
CompletionSuggestionKind.INVOCATION,
- CompletionRelevance.DEFAULT,
+ COMPLETION_RELEVANCE_DEFAULT,
completion,
completion.length,
0,
@@ -257,7 +258,7 @@
element.isPublic &&
!excludedLibs.contains(element.library) &&
!_importedCompletions.contains(element.displayName)) {
- _addSuggestion(element, CompletionRelevance.LOW);
+ _addSuggestion(element, COMPLETION_RELEVANCE_LOW);
}
}
});
@@ -266,7 +267,7 @@
/**
* Add a suggestion for the given element.
*/
- void _addSuggestion(Element element, CompletionRelevance relevance) {
+ void _addSuggestion(Element element, int relevance) {
if (element is ExecutableElement) {
if (element.isOperator) {
@@ -275,7 +276,7 @@
}
CompletionSuggestion suggestion =
- createElementSuggestion(element, relevance: relevance);
+ createSuggestion(element, relevance: relevance);
if (element is ExecutableElement) {
DartType returnType = element.returnType;
@@ -333,7 +334,7 @@
@override
void visitClassElement(ClassElement element) {
- cache._addSuggestion(element, CompletionRelevance.DEFAULT);
+ cache._addSuggestion(element, COMPLETION_RELEVANCE_DEFAULT);
}
@override
@@ -348,16 +349,16 @@
@override
void visitFunctionElement(FunctionElement element) {
- cache._addSuggestion(element, CompletionRelevance.DEFAULT);
+ cache._addSuggestion(element, COMPLETION_RELEVANCE_DEFAULT);
}
@override
void visitFunctionTypeAliasElement(FunctionTypeAliasElement element) {
- cache._addSuggestion(element, CompletionRelevance.DEFAULT);
+ cache._addSuggestion(element, COMPLETION_RELEVANCE_DEFAULT);
}
@override
void visitTopLevelVariableElement(TopLevelVariableElement element) {
- cache._addSuggestion(element, CompletionRelevance.DEFAULT);
+ cache._addSuggestion(element, COMPLETION_RELEVANCE_DEFAULT);
}
}
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 5b1acbe..65e3a46 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
@@ -22,6 +22,13 @@
import 'package:analyzer/src/generated/engine.dart';
import 'package:analyzer/src/generated/source.dart';
+// TODO (danrubel) these are temporary constants as we transition completion
+// relevance from CompletionRelevance.LOW/DEFAULT/HIGH to int.
+// These should be removed in a subsequent CL
+const int COMPLETION_RELEVANCE_LOW = 500;
+const int COMPLETION_RELEVANCE_DEFAULT = 1000;
+const int COMPLETION_RELEVANCE_HIGH = 2000;
+
/**
* The base class for computing code completion suggestions.
*/
diff --git a/pkg/analysis_server/lib/src/services/completion/imported_computer.dart b/pkg/analysis_server/lib/src/services/completion/imported_computer.dart
index c32cf32..edbdd8e 100644
--- a/pkg/analysis_server/lib/src/services/completion/imported_computer.dart
+++ b/pkg/analysis_server/lib/src/services/completion/imported_computer.dart
@@ -54,7 +54,8 @@
* [_ImportedSuggestionBuilder] traverses the imports and builds suggestions
* based upon imported elements.
*/
-class _ImportedSuggestionBuilder implements SuggestionBuilder {
+class _ImportedSuggestionBuilder extends ElementSuggestionBuilder implements
+ SuggestionBuilder {
bool shouldWaitForLowPrioritySuggestions;
final DartCompletionRequest request;
final bool typesOnly;
@@ -66,6 +67,9 @@
cache = request.cache;
}
+ @override
+ CompletionSuggestionKind get kind => CompletionSuggestionKind.INVOCATION;
+
/**
* If the needed information is cached, then add suggestions and return `true`
* else return `false` indicating that additional work is necessary.
@@ -114,9 +118,6 @@
return;
}
if (elem is ExecutableElement) {
- if (elem.isOperator) {
- return;
- }
DartType returnType = elem.returnType;
if (returnType != null && returnType.isVoid) {
if (excludeVoidReturn) {
@@ -125,8 +126,7 @@
}
}
}
- request.suggestions.add(
- createElementSuggestion(elem, relevance: CompletionRelevance.DEFAULT));
+ addSuggestion(elem);
});
}
@@ -149,12 +149,14 @@
String name = inheritedTypes.removeLast();
ClassElement elem = cache.importedClassMap[name];
if (visited.add(name) && elem != null) {
+ _addElementSuggestions(elem.fields);
_addElementSuggestions(elem.accessors);
_addElementSuggestions(elem.methods);
elem.allSupertypes.forEach((InterfaceType type) {
- if (visited.add(type.name)) {
- _addElementSuggestions(type.accessors);
- _addElementSuggestions(type.methods);
+ if (visited.add(type.name) && type.element != null) {
+ _addElementSuggestions(type.element.fields);
+ _addElementSuggestions(type.element.accessors);
+ _addElementSuggestions(type.element.methods);
}
});
}
@@ -183,7 +185,7 @@
request.suggestions.add(suggestion);
}
} else {
- if (suggestion.relevance != CompletionRelevance.LOW) {
+ if (suggestion.relevance != COMPLETION_RELEVANCE_LOW) {
request.suggestions.add(suggestion);
}
}
diff --git a/pkg/analysis_server/lib/src/services/completion/keyword_computer.dart b/pkg/analysis_server/lib/src/services/completion/keyword_computer.dart
index 714c483..0d85a50 100644
--- a/pkg/analysis_server/lib/src/services/completion/keyword_computer.dart
+++ b/pkg/analysis_server/lib/src/services/completion/keyword_computer.dart
@@ -87,12 +87,12 @@
// Very simplistic suggestion because analyzer will warn if
// the extends / with / implements keywords are out of order
if (node.extendsClause == null) {
- _addSuggestion(Keyword.EXTENDS, CompletionRelevance.HIGH);
+ _addSuggestion(Keyword.EXTENDS, COMPLETION_RELEVANCE_HIGH);
} else if (node.withClause == null) {
- _addSuggestion(Keyword.WITH, CompletionRelevance.HIGH);
+ _addSuggestion(Keyword.WITH, COMPLETION_RELEVANCE_HIGH);
}
if (node.implementsClause == null) {
- _addSuggestion(Keyword.IMPLEMENTS, CompletionRelevance.HIGH);
+ _addSuggestion(Keyword.IMPLEMENTS, COMPLETION_RELEVANCE_HIGH);
}
}
@@ -120,18 +120,18 @@
if (firstDirective is! LibraryDirective) {
if (firstDirective != null) {
if (request.offset <= firstDirective.offset) {
- _addSuggestions([Keyword.LIBRARY], CompletionRelevance.HIGH);
+ _addSuggestions([Keyword.LIBRARY], COMPLETION_RELEVANCE_HIGH);
}
} else {
if (request.offset <= startOfDeclarations) {
- _addSuggestions([Keyword.LIBRARY], CompletionRelevance.HIGH);
+ _addSuggestions([Keyword.LIBRARY], COMPLETION_RELEVANCE_HIGH);
}
}
}
if (request.offset <= startOfDeclarations) {
_addSuggestions(
[Keyword.EXPORT, Keyword.IMPORT, Keyword.PART],
- CompletionRelevance.HIGH);
+ COMPLETION_RELEVANCE_HIGH);
}
if (request.offset >= endOfDirectives) {
_addSuggestions(
@@ -142,7 +142,7 @@
Keyword.FINAL,
Keyword.TYPEDEF,
Keyword.VAR],
- CompletionRelevance.HIGH);
+ COMPLETION_RELEVANCE_HIGH);
}
}
@@ -167,8 +167,8 @@
}
}
- void _addSuggestion(Keyword keyword, [CompletionRelevance relevance =
- CompletionRelevance.DEFAULT]) {
+ void _addSuggestion(Keyword keyword, [int relevance =
+ COMPLETION_RELEVANCE_DEFAULT]) {
String completion = keyword.syntax;
request.suggestions.add(
new CompletionSuggestion(
@@ -181,8 +181,8 @@
false));
}
- void _addSuggestions(List<Keyword> keywords, [CompletionRelevance relevance =
- CompletionRelevance.DEFAULT]) {
+ void _addSuggestions(List<Keyword> keywords, [int relevance =
+ COMPLETION_RELEVANCE_DEFAULT]) {
keywords.forEach((Keyword keyword) {
_addSuggestion(keyword, relevance);
});
diff --git a/pkg/analysis_server/lib/src/services/completion/local_computer.dart b/pkg/analysis_server/lib/src/services/completion/local_computer.dart
index 2e1aa9e..fb4c505 100644
--- a/pkg/analysis_server/lib/src/services/completion/local_computer.dart
+++ b/pkg/analysis_server/lib/src/services/completion/local_computer.dart
@@ -25,14 +25,24 @@
bool computeFast(DartCompletionRequest request) {
OpType optype = request.optype;
if (optype.includeTopLevelSuggestions) {
- _LocalVisitor localVisitor = new _LocalVisitor(request, request.offset);
- localVisitor.typesOnly = optype.includeOnlyTypeNameSuggestions;
- localVisitor.excludeVoidReturn = !optype.includeVoidReturnSuggestions;
+ _LocalVisitor localVisitor = new _LocalVisitor(
+ request,
+ request.offset,
+ optype.includeOnlyTypeNameSuggestions,
+ !optype.includeVoidReturnSuggestions);
// Collect suggestions from the specific child [AstNode] that contains
// the completion offset and all of its parents recursively.
request.node.accept(localVisitor);
}
+ if (optype.includeStatementLabelSuggestions ||
+ optype.includeCaseLabelSuggestions) {
+ _LabelVisitor labelVisitor = new _LabelVisitor(
+ request,
+ optype.includeStatementLabelSuggestions,
+ optype.includeCaseLabelSuggestions);
+ request.node.accept(labelVisitor);
+ }
// If the unit is not a part and does not reference any parts
// then work is complete
@@ -50,6 +60,131 @@
}
/**
+ * A visitor for collecting suggestions for break and continue labels.
+ */
+class _LabelVisitor extends LocalDeclarationVisitor {
+ final DartCompletionRequest request;
+
+ /**
+ * True if statement labels should be included as suggestions.
+ */
+ final bool includeStatementLabels;
+
+ /**
+ * True if case labels should be included as suggestions.
+ */
+ final bool includeCaseLabels;
+
+ _LabelVisitor(DartCompletionRequest request, this.includeStatementLabels,
+ this.includeCaseLabels)
+ : super(request.offset),
+ request = request;
+
+ @override
+ void declaredClass(ClassDeclaration declaration) {
+ // ignored
+ }
+
+ @override
+ void declaredClassTypeAlias(ClassTypeAlias declaration) {
+ // ignored
+ }
+
+ @override
+ void declaredField(FieldDeclaration fieldDecl, VariableDeclaration varDecl) {
+ // ignored
+ }
+
+ @override
+ void declaredFunction(FunctionDeclaration declaration) {
+ // ignored
+ }
+
+ @override
+ void declaredFunctionTypeAlias(FunctionTypeAlias declaration) {
+ // ignored
+ }
+
+ @override
+ void declaredLabel(Label label, bool isCaseLabel) {
+ if (isCaseLabel ? includeCaseLabels : includeStatementLabels) {
+ CompletionSuggestion suggestion = _addSuggestion(label.label);
+ if (suggestion != null) {
+ suggestion.element =
+ _createElement(protocol.ElementKind.LABEL, label.label);
+ }
+ }
+ }
+
+ @override
+ void declaredLocalVar(SimpleIdentifier name, TypeName type) {
+ // ignored
+ }
+
+ @override
+ void declaredMethod(MethodDeclaration declaration) {
+ // ignored
+ }
+
+ @override
+ void declaredParam(SimpleIdentifier name, TypeName type) {
+ // ignored
+ }
+
+ @override
+ void declaredTopLevelVar(VariableDeclarationList varList,
+ VariableDeclaration varDecl) {
+ // ignored
+ }
+
+ @override
+ bool visitFunctionExpression(FunctionExpression node) {
+ // Labels are only accessible within the local function, so stop visiting
+ // once we reach a function boundary.
+ finished = true;
+ return true;
+ }
+
+ @override
+ bool visitMethodDeclaration(MethodDeclaration node) {
+ // Labels are only accessible within the local function, so stop visiting
+ // once we reach a function boundary.
+ finished = true;
+ return true;
+ }
+
+ CompletionSuggestion _addSuggestion(SimpleIdentifier id) {
+ if (id != null) {
+ String completion = id.name;
+ if (completion != null && completion.length > 0 && completion != '_') {
+ CompletionSuggestion suggestion = new CompletionSuggestion(
+ CompletionSuggestionKind.IDENTIFIER,
+ COMPLETION_RELEVANCE_DEFAULT,
+ completion,
+ completion.length,
+ 0,
+ false,
+ false);
+ request.suggestions.add(suggestion);
+ return suggestion;
+ }
+ }
+ return null;
+ }
+
+ /**
+ * Create a new protocol Element for inclusion in a completion suggestion.
+ */
+ protocol.Element _createElement(protocol.ElementKind kind,
+ SimpleIdentifier id) {
+ String name = id.name;
+ int flags =
+ protocol.Element.makeFlags(isPrivate: Identifier.isPrivateName(name));
+ return new protocol.Element(kind, name, flags);
+ }
+}
+
+/**
* A visitor for collecting suggestions from the most specific child [AstNode]
* that contains the completion offset to the [CompilationUnit].
*/
@@ -61,24 +196,24 @@
null);
final DartCompletionRequest request;
- bool typesOnly = false;
- bool excludeVoidReturn;
+ final bool typesOnly;
+ final bool excludeVoidReturn;
- _LocalVisitor(this.request, int offset) : super(offset) {
- excludeVoidReturn = _computeExcludeVoidReturn(request.node);
- }
+ _LocalVisitor(this.request, int offset, this.typesOnly,
+ this.excludeVoidReturn)
+ : super(offset);
@override
void declaredClass(ClassDeclaration declaration) {
bool isDeprecated = _isDeprecated(declaration);
CompletionSuggestion suggestion =
- _addSuggestion(declaration.name, null, null, isDeprecated);
+ _addSuggestion(declaration.name, NO_RETURN_TYPE, null, isDeprecated);
if (suggestion != null) {
suggestion.element = _createElement(
protocol.ElementKind.CLASS,
declaration.name,
null,
- _LocalVisitor.NO_RETURN_TYPE,
+ NO_RETURN_TYPE,
declaration.isAbstract,
isDeprecated);
}
@@ -88,7 +223,7 @@
void declaredClassTypeAlias(ClassTypeAlias declaration) {
bool isDeprecated = _isDeprecated(declaration);
CompletionSuggestion suggestion =
- _addSuggestion(declaration.name, null, null, isDeprecated);
+ _addSuggestion(declaration.name, NO_RETURN_TYPE, null, isDeprecated);
if (suggestion != null) {
suggestion.element = _createElement(
protocol.ElementKind.CLASS_TYPE_ALIAS,
@@ -106,17 +241,15 @@
return;
}
bool isDeprecated = _isDeprecated(fieldDecl) || _isDeprecated(varDecl);
- CompletionSuggestion suggestion = _addSuggestion(
- varDecl.name,
- fieldDecl.fields.type,
- fieldDecl.parent,
- isDeprecated);
+ TypeName type = fieldDecl.fields.type;
+ CompletionSuggestion suggestion =
+ _addSuggestion(varDecl.name, type, fieldDecl.parent, isDeprecated);
if (suggestion != null) {
suggestion.element = _createElement(
- protocol.ElementKind.GETTER,
+ protocol.ElementKind.FIELD,
varDecl.name,
null,
- fieldDecl.fields.type,
+ type,
false,
isDeprecated);
}
@@ -127,27 +260,32 @@
if (typesOnly) {
return;
}
- if (excludeVoidReturn && _isVoid(declaration.returnType)) {
- return;
- }
+ TypeName returnType = declaration.returnType;
bool isDeprecated = _isDeprecated(declaration);
+ protocol.ElementKind kind;
+ if (declaration.isGetter) {
+ kind = protocol.ElementKind.GETTER;
+ } else if (declaration.isSetter) {
+ if (excludeVoidReturn) {
+ return;
+ }
+ kind = protocol.ElementKind.SETTER;
+ returnType = NO_RETURN_TYPE;
+ } else {
+ if (excludeVoidReturn && _isVoid(returnType)) {
+ return;
+ }
+ kind = protocol.ElementKind.FUNCTION;
+ }
CompletionSuggestion suggestion =
- _addSuggestion(declaration.name, declaration.returnType, null, isDeprecated);
+ _addSuggestion(declaration.name, returnType, null, isDeprecated);
if (suggestion != null) {
FormalParameterList param = declaration.functionExpression.parameters;
- protocol.ElementKind kind;
- if (declaration.isGetter) {
- kind = protocol.ElementKind.GETTER;
- } else if (declaration.isSetter) {
- kind = protocol.ElementKind.SETTER;
- } else {
- kind = protocol.ElementKind.FUNCTION;
- }
suggestion.element = _createElement(
kind,
declaration.name,
param != null ? param.toSource() : null,
- declaration.returnType,
+ returnType,
false,
isDeprecated);
}
@@ -156,22 +294,23 @@
@override
void declaredFunctionTypeAlias(FunctionTypeAlias declaration) {
bool isDeprecated = _isDeprecated(declaration);
+ TypeName returnType = declaration.returnType;
CompletionSuggestion suggestion =
- _addSuggestion(declaration.name, declaration.returnType, null, isDeprecated);
+ _addSuggestion(declaration.name, returnType, null, isDeprecated);
if (suggestion != null) {
// TODO (danrubel) determine parameters and return type
suggestion.element = _createElement(
protocol.ElementKind.FUNCTION_TYPE_ALIAS,
declaration.name,
null,
- NO_RETURN_TYPE,
+ returnType,
true,
isDeprecated);
}
}
@override
- void declaredLabel(Label label) {
+ void declaredLabel(Label label, bool isCaseLabel) {
// ignored
}
@@ -208,7 +347,7 @@
return;
}
kind = protocol.ElementKind.SETTER;
- returnType = null;
+ returnType = NO_RETURN_TYPE;
} else {
if (excludeVoidReturn && _isVoid(returnType)) {
return;
@@ -217,11 +356,8 @@
parameters = declaration.parameters.toSource();
}
bool isDeprecated = _isDeprecated(declaration);
- CompletionSuggestion suggestion = _addSuggestion(
- declaration.name,
- returnType,
- declaration.parent,
- isDeprecated);
+ CompletionSuggestion suggestion =
+ _addSuggestion(declaration.name, returnType, declaration.parent, isDeprecated);
if (suggestion != null) {
suggestion.element = _createElement(
kind,
@@ -265,19 +401,20 @@
}
}
- CompletionSuggestion _addSuggestion(SimpleIdentifier id, TypeName typeName,
+ CompletionSuggestion _addSuggestion(SimpleIdentifier id, TypeName returnType,
ClassDeclaration classDecl, bool isDeprecated) {
if (id != null) {
String completion = id.name;
if (completion != null && completion.length > 0 && completion != '_') {
CompletionSuggestion suggestion = new CompletionSuggestion(
CompletionSuggestionKind.INVOCATION,
- isDeprecated ? CompletionRelevance.LOW : CompletionRelevance.DEFAULT,
+ isDeprecated ? COMPLETION_RELEVANCE_LOW : COMPLETION_RELEVANCE_DEFAULT,
completion,
completion.length,
0,
false,
- false);
+ false,
+ returnType: _nameForType(returnType));
if (classDecl != null) {
SimpleIdentifier identifier = classDecl.name;
if (identifier != null) {
@@ -287,15 +424,6 @@
}
}
}
- if (typeName != null) {
- Identifier identifier = typeName.name;
- if (identifier != null) {
- String name = identifier.name;
- if (name != null && name.length > 0) {
- suggestion.returnType = name;
- }
- }
- }
request.suggestions.add(suggestion);
return suggestion;
}
@@ -303,16 +431,6 @@
return null;
}
- bool _computeExcludeVoidReturn(AstNode node) {
- if (node is Block) {
- return false;
- } else if (node is SimpleIdentifier) {
- return node.parent is ExpressionStatement ? false : true;
- } else {
- return true;
- }
- }
-
/**
* Create a new protocol Element for inclusion in a completion suggestion.
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 ccdd8ba..e7860ab 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
@@ -34,7 +34,7 @@
void declaredFunctionTypeAlias(FunctionTypeAlias declaration);
- void declaredLabel(Label label);
+ void declaredLabel(Label label, bool isCaseLabel);
void declaredLocalVar(SimpleIdentifier name, TypeName type);
@@ -49,11 +49,7 @@
bool visitBlock(Block node) {
node.statements.forEach((Statement stmt) {
if (stmt.offset < offset) {
- if (stmt is LabeledStatement) {
- stmt.labels.forEach((Label label) {
- declaredLabel(label);
- });
- } else if (stmt is VariableDeclarationStatement) {
+ if (stmt is VariableDeclarationStatement) {
VariableDeclarationList varList = stmt.variables;
if (varList != null) {
varList.variables.forEach((VariableDeclaration varDecl) {
@@ -185,6 +181,24 @@
}
@override
+ bool visitSwitchStatement(SwitchStatement node) {
+ for (SwitchMember member in node.members) {
+ for (Label label in member.labels) {
+ declaredLabel(label, true);
+ }
+ }
+ return visitNode(node);
+ }
+
+ @override
+ bool visitLabeledStatement(LabeledStatement node) {
+ for (Label label in node.labels) {
+ declaredLabel(label, false);
+ }
+ return visitNode(node);
+ }
+
+ @override
bool visitMethodDeclaration(MethodDeclaration node) {
_visitParamList(node.parameters);
return visitNode(node);
diff --git a/pkg/analysis_server/lib/src/services/completion/optype.dart b/pkg/analysis_server/lib/src/services/completion/optype.dart
index 21678a3..ef2902b 100644
--- a/pkg/analysis_server/lib/src/services/completion/optype.dart
+++ b/pkg/analysis_server/lib/src/services/completion/optype.dart
@@ -37,6 +37,16 @@
bool includeReturnValueSuggestions = false;
/**
+ * Indicates whether statement labels should be suggested.
+ */
+ bool includeStatementLabelSuggestions = false;
+
+ /**
+ * Indicates whether case labels should be suggested.
+ */
+ bool includeCaseLabelSuggestions = false;
+
+ /**
* Determine the suggestions that should be made based upon the given
* [CompletionTarget] and [offset].
*/
@@ -146,6 +156,13 @@
}
@override
+ void visitBreakStatement(BreakStatement node) {
+ if (node.label == null || identical(entity, node.label)) {
+ optype.includeStatementLabelSuggestions = true;
+ }
+ }
+
+ @override
void visitCascadeExpression(CascadeExpression node) {
if (node.cascadeSections.contains(entity)) {
optype.includeInvocationSuggestions = true;
@@ -191,6 +208,14 @@
}
@override
+ void visitContinueStatement(ContinueStatement node) {
+ if (node.label == null || identical(entity, node.label)) {
+ optype.includeStatementLabelSuggestions = true;
+ optype.includeCaseLabelSuggestions = true;
+ }
+ }
+
+ @override
void visitDoStatement(DoStatement node) {
if (identical(entity, node.condition)) {
optype.includeReturnValueSuggestions = true;
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 584855a..8be79634 100644
--- a/pkg/analysis_server/lib/src/services/completion/suggestion_builder.dart
+++ b/pkg/analysis_server/lib/src/services/completion/suggestion_builder.dart
@@ -14,37 +14,74 @@
import 'package:analyzer/src/generated/element.dart';
import 'package:analyzer/src/generated/utilities_dart.dart';
+const String DYNAMIC = 'dynamic';
+
/**
- * Create a suggestion based upon the given imported element.
+ * Return a suggestion based upon the given element
+ * or `null` if a suggestion is not appropriate for the given element.
*/
-CompletionSuggestion createElementSuggestion(Element element,
- {CompletionRelevance relevance: CompletionRelevance.DEFAULT}) {
+CompletionSuggestion createSuggestion(Element element,
+ {CompletionSuggestionKind kind: CompletionSuggestionKind.INVOCATION,
+ int relevance: COMPLETION_RELEVANCE_DEFAULT}) {
+
+ String nameForType(DartType type) {
+ if (type == null) {
+ return DYNAMIC;
+ }
+ String name = type.displayName;
+ if (name == null || name.length <= 0) {
+ return DYNAMIC;
+ }
+ //TODO (danrubel) include type arguments ??
+ return name;
+ }
+
+ String returnType = null;
+ if (element is ExecutableElement) {
+ if (element.isOperator) {
+ // Do not include operators in suggestions
+ return null;
+ }
+ if (element is PropertyAccessorElement && element.isSetter) {
+ // no return type
+ } else {
+ returnType = nameForType(element.returnType);
+ }
+ } else if (element is VariableElement) {
+ returnType = nameForType(element.type);
+ } else if (element is FunctionTypeAliasElement) {
+ returnType = nameForType(element.returnType);
+ }
+
String completion = element.displayName;
+ bool isDeprecated = element.isDeprecated;
CompletionSuggestion suggestion = new CompletionSuggestion(
- CompletionSuggestionKind.INVOCATION,
- element.isDeprecated ? CompletionRelevance.LOW : relevance,
+ kind,
+ isDeprecated ? COMPLETION_RELEVANCE_LOW : relevance,
completion,
completion.length,
0,
- element.isDeprecated,
+ isDeprecated,
false);
-
- suggestion.element = newElement_fromEngine(element);
-
- DartType type;
- if (element is FunctionElement) {
- type = element.returnType;
- } else if (element is PropertyAccessorElement && element.isGetter) {
- type = element.returnType;
- } else if (element is TopLevelVariableElement) {
- type = element.type;
- }
- if (type != null) {
- String name = type.displayName;
- if (name != null && name.length > 0 && name != 'dynamic') {
- suggestion.returnType = name;
+ suggestion.element = protocol.newElement_fromEngine(element);
+ if (element is ClassMemberElement) {
+ ClassElement enclosingElement = element.enclosingElement;
+ if (enclosingElement != null) {
+ suggestion.declaringType = enclosingElement.displayName;
}
}
+ suggestion.returnType = returnType;
+ if (element is ExecutableElement && element is! PropertyAccessorElement) {
+ suggestion.parameterNames = element.parameters.map(
+ (ParameterElement parameter) => parameter.name).toList();
+ suggestion.parameterTypes = element.parameters.map(
+ (ParameterElement parameter) => parameter.type.displayName).toList();
+ suggestion.requiredParameterCount = element.parameters.where(
+ (ParameterElement parameter) =>
+ parameter.parameterKind == ParameterKind.REQUIRED).length;
+ suggestion.hasNamedParameters = element.parameters.any(
+ (ParameterElement parameter) => parameter.parameterKind == ParameterKind.NAMED);
+ }
return suggestion;
}
@@ -132,12 +169,16 @@
* the visible members in that class. Clients should call
* [ClassElementSuggestionBuilder.suggestionsFor].
*/
-class ClassElementSuggestionBuilder extends _AbstractSuggestionBuilder {
+class ClassElementSuggestionBuilder extends GeneralizingElementVisitor with
+ ElementSuggestionBuilder {
final bool staticOnly;
+ final DartCompletionRequest request;
- ClassElementSuggestionBuilder(DartCompletionRequest request, bool staticOnly)
- : super(request, CompletionSuggestionKind.INVOCATION),
- this.staticOnly = staticOnly;
+ ClassElementSuggestionBuilder(this.request, bool staticOnly)
+ : this.staticOnly = staticOnly;
+
+ @override
+ CompletionSuggestionKind get kind => CompletionSuggestionKind.INVOCATION;
@override
visitClassElement(ClassElement element) {
@@ -157,7 +198,7 @@
if (staticOnly && !element.isStatic) {
return;
}
- _addElementSuggestion(element, element.type, element.enclosingElement);
+ addSuggestion(element);
}
@override
@@ -168,10 +209,7 @@
if (element.isOperator) {
return;
}
- _addElementSuggestion(
- element,
- element.returnType,
- element.enclosingElement);
+ addSuggestion(element);
}
@override
@@ -179,17 +217,7 @@
if (staticOnly && !element.isStatic) {
return;
}
- if (element.isGetter) {
- _addElementSuggestion(
- element,
- element.returnType,
- element.enclosingElement);
- } else if (element.isSetter) {
- _addElementSuggestion(
- element,
- element.returnType,
- element.enclosingElement);
- }
+ addSuggestion(element);
}
/**
@@ -208,19 +236,69 @@
}
/**
+ * Common mixin for sharing behavior
+ */
+abstract class ElementSuggestionBuilder {
+
+ /**
+ * Internal collection of completions to prevent duplicate completions.
+ */
+ final Set<String> _completions = new Set<String>();
+
+ /**
+ * Return the kind of suggestions that should be built.
+ */
+ CompletionSuggestionKind get kind;
+
+ /**
+ * Return the request on which the builder is operating.
+ */
+ DartCompletionRequest get request;
+
+ /**
+ * Add a suggestion based upon the given element.
+ */
+ void addSuggestion(Element element) {
+ if (element.isPrivate) {
+ LibraryElement elementLibrary = element.library;
+ LibraryElement unitLibrary = request.unit.element.library;
+ if (elementLibrary != unitLibrary) {
+ return;
+ }
+ }
+ if (element.isSynthetic) {
+ if (element is PropertyAccessorElement || element is FieldElement) {
+ return;
+ }
+ }
+ String completion = element.displayName;
+ if (completion == null ||
+ completion.length <= 0 ||
+ !_completions.add(completion)) {
+ return;
+ }
+ CompletionSuggestion suggestion = createSuggestion(element, kind: kind);
+ if (suggestion != null) {
+ request.suggestions.add(suggestion);
+ }
+ }
+}
+
+/**
* This class visits elements in a library and provides suggestions based upon
* the visible members in that library. Clients should call
* [LibraryElementSuggestionBuilder.suggestionsFor].
*/
-class LibraryElementSuggestionBuilder extends _AbstractSuggestionBuilder {
+class LibraryElementSuggestionBuilder extends GeneralizingElementVisitor with
+ ElementSuggestionBuilder {
+ final DartCompletionRequest request;
+ final CompletionSuggestionKind kind;
- LibraryElementSuggestionBuilder(DartCompletionRequest request,
- CompletionSuggestionKind kind)
- : super(request, kind);
+ LibraryElementSuggestionBuilder(this.request, this.kind);
@override
visitClassElement(ClassElement element) {
- _addElementSuggestion(element, null, null);
+ addSuggestion(element);
}
@override
@@ -235,17 +313,17 @@
@override
visitFunctionElement(FunctionElement element) {
- _addElementSuggestion(element, element.returnType, null);
+ addSuggestion(element);
}
@override
visitFunctionTypeAliasElement(FunctionTypeAliasElement element) {
- _addElementSuggestion(element, element.returnType, null);
+ addSuggestion(element);
}
@override
visitTopLevelVariableElement(TopLevelVariableElement element) {
- _addElementSuggestion(element, element.type, null);
+ addSuggestion(element);
}
/**
@@ -263,11 +341,14 @@
* This class visits elements in a class and provides suggestions based upon
* the visible named constructors in that class.
*/
-class NamedConstructorSuggestionBuilder extends _AbstractSuggestionBuilder
- implements SuggestionBuilder {
+class NamedConstructorSuggestionBuilder extends GeneralizingElementVisitor with
+ ElementSuggestionBuilder implements SuggestionBuilder {
+ final DartCompletionRequest request;
- NamedConstructorSuggestionBuilder(DartCompletionRequest request)
- : super(request, CompletionSuggestionKind.INVOCATION);
+ NamedConstructorSuggestionBuilder(this.request);
+
+ @override
+ CompletionSuggestionKind get kind => CompletionSuggestionKind.INVOCATION;
@override
bool computeFast(AstNode node) {
@@ -301,10 +382,7 @@
@override
visitConstructorElement(ConstructorElement element) {
- _addElementSuggestion(
- element,
- element.returnType,
- element.enclosingElement);
+ addSuggestion(element);
}
@override
@@ -329,72 +407,3 @@
*/
Future<bool> computeFull(AstNode node);
}
-
-/**
- * Common superclass for sharing behavior
- */
-class _AbstractSuggestionBuilder extends GeneralizingElementVisitor {
- final DartCompletionRequest request;
- final CompletionSuggestionKind kind;
- final Set<String> _completions = new Set<String>();
-
- _AbstractSuggestionBuilder(this.request, this.kind);
-
- void _addElementSuggestion(Element element, DartType type,
- ClassElement enclosingElement) {
- if (element.isSynthetic) {
- return;
- }
- if (element.isPrivate) {
- LibraryElement elementLibrary = element.library;
- LibraryElement unitLibrary = request.unit.element.library;
- if (elementLibrary != unitLibrary) {
- return;
- }
- }
- String completion = element.displayName;
- if (completion == null ||
- completion.length <= 0 ||
- !_completions.add(completion)) {
- return;
- }
- bool isDeprecated = element.isDeprecated;
- CompletionSuggestion suggestion = new CompletionSuggestion(
- kind,
- isDeprecated ? CompletionRelevance.LOW : CompletionRelevance.DEFAULT,
- completion,
- completion.length,
- 0,
- isDeprecated,
- false);
- suggestion.element = protocol.newElement_fromEngine(element);
- if (suggestion.element != null) {
- if (element is FieldElement) {
- suggestion.element.kind = protocol.ElementKind.GETTER;
- suggestion.element.returnType =
- element.type != null ? element.type.displayName : 'dynamic';
- }
- }
- if (enclosingElement != null) {
- suggestion.declaringType = enclosingElement.displayName;
- }
- if (type != null) {
- String typeName = type.displayName;
- if (typeName != null && typeName.length > 0 && typeName != 'dynamic') {
- suggestion.returnType = typeName;
- }
- }
- if (element is ExecutableElement && element is! PropertyAccessorElement) {
- suggestion.parameterNames = element.parameters.map(
- (ParameterElement parameter) => parameter.name).toList();
- suggestion.parameterTypes = element.parameters.map(
- (ParameterElement parameter) => parameter.type.displayName).toList();
- suggestion.requiredParameterCount = element.parameters.where(
- (ParameterElement parameter) =>
- parameter.parameterKind == ParameterKind.REQUIRED).length;
- suggestion.hasNamedParameters = element.parameters.any(
- (ParameterElement parameter) => parameter.parameterKind == ParameterKind.NAMED);
- }
- request.suggestions.add(suggestion);
- }
-}
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 e2b7466..71f55ba 100644
--- a/pkg/analysis_server/lib/src/services/correction/assist_internal.dart
+++ b/pkg/analysis_server/lib/src/services/correction/assist_internal.dart
@@ -343,7 +343,7 @@
}
// prepare source
SourceBuilder builder = new SourceBuilder(file, offset);
- builder.append("var ");
+ builder.append('var ');
// prepare excluded names
Set<String> excluded = new Set<String>();
{
@@ -355,7 +355,7 @@
{
List<String> suggestions =
getVariableNameSuggestionsForExpression(type, expression, excluded);
- builder.startPosition("NAME");
+ builder.startPosition('NAME');
for (int i = 0; i < suggestions.length; i++) {
String name = suggestions[i];
if (i == 0) {
@@ -365,7 +365,7 @@
}
builder.endPosition();
}
- builder.append(" = ");
+ builder.append(' = ');
// add proposal
_insertBuilder(builder);
_addAssist(AssistKind.ASSIGN_TO_LOCAL_VARIABLE, []);
@@ -384,7 +384,7 @@
// add change
String indent = utils.getIndent(1);
String returnSource = 'return ' + _getNodeText(returnValue);
- String newBodySource = "{$eol$prefix${indent}$returnSource;$eol$prefix}";
+ String newBodySource = '{$eol$prefix$indent$returnSource;$eol$prefix}';
_addReplaceEdit(rangeNode(body), newBodySource);
// add proposal
_addAssist(AssistKind.CONVERT_INTO_BLOCK_BODY, []);
@@ -415,10 +415,10 @@
return;
}
// add change
- String newBodySource = "=> ${_getNodeText(returnExpression)}";
+ String newBodySource = '=> ${_getNodeText(returnExpression)}';
if (body.parent is! FunctionExpression ||
body.parent.parent is FunctionDeclaration) {
- newBodySource += ";";
+ newBodySource += ';';
}
_addReplaceEdit(rangeNode(body), newBodySource);
// add proposal
@@ -469,7 +469,7 @@
_addRemoveEdit(
rangeStartEnd(parExpression.rightParenthesis, prefExpression));
}
- _addInsertEdit(isExpression.isOperator.end, "!");
+ _addInsertEdit(isExpression.isOperator.end, '!');
// add proposal
_addAssist(AssistKind.CONVERT_INTO_IS_NOT, []);
}
@@ -518,7 +518,7 @@
_addRemoveEdit(
rangeStartEnd(parExpression.rightParenthesis, prefExpression));
}
- _addInsertEdit(isExpression.isOperator.end, "!");
+ _addInsertEdit(isExpression.isOperator.end, '!');
// add proposal
_addAssist(AssistKind.CONVERT_INTO_IS_NOT, []);
}
@@ -550,14 +550,14 @@
}
// should be "isEmpty"
Element propertyElement = isEmptyIdentifier.bestElement;
- if (propertyElement == null || "isEmpty" != propertyElement.name) {
+ if (propertyElement == null || 'isEmpty' != propertyElement.name) {
_coverageMarker();
return;
}
// should have "isNotEmpty"
Element propertyTarget = propertyElement.enclosingElement;
if (propertyTarget == null ||
- getChildren(propertyTarget, "isNotEmpty").isEmpty) {
+ getChildren(propertyTarget, 'isNotEmpty').isEmpty) {
_coverageMarker();
return;
}
@@ -574,7 +574,7 @@
}
// do replace
_addRemoveEdit(rangeStartStart(prefixExpression, prefixExpression.operand));
- _addReplaceEdit(rangeNode(isEmptyIdentifier), "isNotEmpty");
+ _addReplaceEdit(rangeNode(isEmptyIdentifier), 'isNotEmpty');
// add proposal
_addAssist(AssistKind.CONVERT_INTO_IS_NOT_EMPTY, []);
}
@@ -675,7 +675,7 @@
return;
}
// prepare change
- String showCombinator = " show ${StringUtils.join(referencedNames, ", ")}";
+ String showCombinator = ' show ${StringUtils.join(referencedNames, ', ')}';
_addInsertEdit(importDirective.end - 1, showCombinator);
// add proposal
_addAssist(AssistKind.IMPORT_ADD_SHOW, []);
@@ -812,12 +812,12 @@
String targetConditionSource = _getNodeText(targetCondition);
String innerConditionSource = _getNodeText(innerCondition);
if (_shouldWrapParenthesisBeforeAnd(targetCondition)) {
- targetConditionSource = "(${targetConditionSource})";
+ targetConditionSource = '($targetConditionSource)';
}
if (_shouldWrapParenthesisBeforeAnd(innerCondition)) {
- innerConditionSource = "(${innerConditionSource})";
+ innerConditionSource = '($innerConditionSource)';
}
- condition = "${targetConditionSource} && ${innerConditionSource}";
+ condition = '$targetConditionSource && $innerConditionSource';
}
// replace target "if" statement
{
@@ -829,7 +829,7 @@
String newSource = utils.indentSourceLeftRight(oldSource, false);
_addReplaceEdit(
rangeNode(targetIfStatement),
- "if ($condition) {${eol}${newSource}${prefix}}");
+ 'if ($condition) {$eol$newSource$prefix}');
}
// done
_addAssist(AssistKind.JOIN_IF_WITH_INNER, []);
@@ -875,12 +875,12 @@
String targetConditionSource = _getNodeText(targetCondition);
String outerConditionSource = _getNodeText(outerCondition);
if (_shouldWrapParenthesisBeforeAnd(targetCondition)) {
- targetConditionSource = "(${targetConditionSource})";
+ targetConditionSource = '($targetConditionSource)';
}
if (_shouldWrapParenthesisBeforeAnd(outerCondition)) {
- outerConditionSource = "(${outerConditionSource})";
+ outerConditionSource = '($outerConditionSource)';
}
- condition = "${outerConditionSource} && ${targetConditionSource}";
+ condition = '$outerConditionSource && $targetConditionSource';
}
// replace outer "if" statement
{
@@ -892,7 +892,7 @@
String newSource = utils.indentSourceLeftRight(oldSource, false);
_addReplaceEdit(
rangeNode(outerIfStatement),
- "if ($condition) {${eol}${newSource}${prefix}}");
+ 'if ($condition) {$eol$newSource$prefix}');
}
// done
_addAssist(AssistKind.JOIN_IF_WITH_OUTER, []);
@@ -966,7 +966,7 @@
// add edits
{
int assignOffset = assignExpression.operator.offset;
- _addReplaceEdit(rangeEndStart(declNode, assignOffset), " ");
+ _addReplaceEdit(rangeEndStart(declNode, assignOffset), ' ');
}
// add proposal
_addAssist(AssistKind.JOIN_VARIABLE_DECLARATION, []);
@@ -1033,7 +1033,7 @@
// add edits
{
int assignOffset = assignExpression.operator.offset;
- _addReplaceEdit(rangeEndStart(decl.name, assignOffset), " ");
+ _addReplaceEdit(rangeEndStart(decl.name, assignOffset), ' ');
}
// add proposal
_addAssist(AssistKind.JOIN_VARIABLE_DECLARATION, []);
@@ -1084,7 +1084,7 @@
// add edit
if (typeStart != null && typeEnd != null) {
SourceRange typeRange = rangeStartStart(typeStart, typeEnd);
- _addReplaceEdit(typeRange, "var ");
+ _addReplaceEdit(typeRange, 'var ');
}
// add proposal
_addAssist(AssistKind.REMOVE_TYPE_ANNOTATION, []);
@@ -1299,30 +1299,29 @@
SourceRange thenBlockRange = rangeNode(thenBlock);
// insert inner "if" with right part of "condition"
{
- String source =
- "${eol}${prefix}${indent}if (${rightConditionSource}) {";
+ String source = '$eol$prefix${indent}if ($rightConditionSource) {';
int thenBlockInsideOffset = thenBlockRange.offset + 1;
_addInsertEdit(thenBlockInsideOffset, source);
}
// insert closing "}" for inner "if"
{
int thenBlockEnd = thenBlockRange.end;
- String source = "${indent}}";
+ String source = "$indent}";
// insert before outer "then" block "}"
- source += "${eol}${prefix}";
+ source += '$eol$prefix';
_addInsertEdit(thenBlockEnd - 1, source);
}
} else {
// insert inner "if" with right part of "condition"
- String source = "${eol}${prefix}${indent}if (${rightConditionSource})";
+ String source = '$eol$prefix${indent}if ($rightConditionSource)';
_addInsertEdit(ifStatement.rightParenthesis.offset + 1, source);
}
// indent "then" statements to correspond inner "if"
{
List<Statement> thenStatements = getStatements(thenStatement);
SourceRange linesRange = utils.getLinesRangeStatements(thenStatements);
- String thenIndentOld = "${prefix}${indent}";
- String thenIndentNew = "${thenIndentOld}${indent}";
+ String thenIndentOld = '$prefix$indent';
+ String thenIndentNew = '$thenIndentOld$indent';
_addIndentEdit(linesRange, thenIndentOld, thenIndentNew);
}
// add proposal
@@ -1393,220 +1392,222 @@
utils.getLinesRangeStatements(selectedStatements);
// prepare environment
String indentOld = utils.getNodePrefix(firstStatement);
- String indentNew = "${indentOld}${utils.getIndent(1)}";
+ String indentNew = '$indentOld${utils.getIndent(1)}';
+ String indentedCode =
+ utils.replaceSourceRangeIndent(statementsRange, indentOld, indentNew);
// "block"
{
- _addInsertEdit(statementsRange.offset, "${indentOld}{${eol}");
+ _addInsertEdit(statementsRange.offset, '$indentOld{$eol');
_addIndentEdit(statementsRange, indentOld, indentNew);
- _addInsertEdit(statementsRange.end, "${indentOld}}${eol}");
+ _addInsertEdit(statementsRange.end, '$indentOld}$eol');
exitPosition = _newPosition(lastStatement.end);
// add proposal
_addAssist(AssistKind.SURROUND_WITH_BLOCK, []);
}
// "if"
{
+ int offset = statementsRange.offset;
+ SourceBuilder sb = new SourceBuilder(file, offset);
+ sb.append(indentOld);
+ sb.append('if (');
{
- int offset = statementsRange.offset;
- SourceBuilder sb = new SourceBuilder(file, offset);
- sb.append(indentOld);
- sb.append("if (");
- {
- sb.startPosition("CONDITION");
- sb.append("condition");
- sb.endPosition();
- }
- sb.append(") {");
- sb.append(eol);
- _insertBuilder(sb);
+ sb.startPosition('CONDITION');
+ sb.append('condition');
+ sb.endPosition();
}
- _addIndentEdit(statementsRange, indentOld, indentNew);
- _addInsertEdit(statementsRange.end, "${indentOld}}${eol}");
- exitPosition = _newPosition(lastStatement.end);
+ sb.append(') {');
+ sb.append(eol);
+ sb.append(indentedCode);
+ sb.append(indentOld);
+ sb.append('}');
+ exitPosition = _newPosition(sb.offset + sb.length);
+ sb.append(eol);
+ _insertBuilder(sb, statementsRange.length);
// add proposal
_addAssist(AssistKind.SURROUND_WITH_IF, []);
}
// "while"
{
+ int offset = statementsRange.offset;
+ SourceBuilder sb = new SourceBuilder(file, offset);
+ sb.append(indentOld);
+ sb.append('while (');
{
- int offset = statementsRange.offset;
- SourceBuilder sb = new SourceBuilder(file, offset);
- sb.append(indentOld);
- sb.append("while (");
- {
- sb.startPosition("CONDITION");
- sb.append("condition");
- sb.endPosition();
- }
- sb.append(") {");
- sb.append(eol);
- _insertBuilder(sb);
+ sb.startPosition('CONDITION');
+ sb.append('condition');
+ sb.endPosition();
}
- _addIndentEdit(statementsRange, indentOld, indentNew);
- _addInsertEdit(statementsRange.end, "${indentOld}}${eol}");
- exitPosition = _newPosition(lastStatement.end);
+ sb.append(') {');
+ sb.append(eol);
+ sb.append(indentedCode);
+ sb.append(indentOld);
+ sb.append('}');
+ exitPosition = _newPosition(sb.offset + sb.length);
+ sb.append(eol);
+ _insertBuilder(sb, statementsRange.length);
// add proposal
_addAssist(AssistKind.SURROUND_WITH_WHILE, []);
}
// "for-in"
{
+ int offset = statementsRange.offset;
+ SourceBuilder sb = new SourceBuilder(file, offset);
+ sb.append(indentOld);
+ sb.append('for (var ');
{
- int offset = statementsRange.offset;
- SourceBuilder sb = new SourceBuilder(file, offset);
- sb.append(indentOld);
- sb.append("for (var ");
- {
- sb.startPosition("NAME");
- sb.append("item");
- sb.endPosition();
- }
- sb.append(" in ");
- {
- sb.startPosition("ITERABLE");
- sb.append("iterable");
- sb.endPosition();
- }
- sb.append(") {");
- sb.append(eol);
- _insertBuilder(sb);
+ sb.startPosition('NAME');
+ sb.append('item');
+ sb.endPosition();
}
- _addIndentEdit(statementsRange, indentOld, indentNew);
- _addInsertEdit(statementsRange.end, "${indentOld}}${eol}");
- exitPosition = _newPosition(lastStatement.end);
+ sb.append(' in ');
+ {
+ sb.startPosition('ITERABLE');
+ sb.append('iterable');
+ sb.endPosition();
+ }
+ sb.append(') {');
+ sb.append(eol);
+ sb.append(indentedCode);
+ sb.append(indentOld);
+ sb.append('}');
+ exitPosition = _newPosition(sb.offset + sb.length);
+ sb.append(eol);
+ _insertBuilder(sb, statementsRange.length);
// add proposal
_addAssist(AssistKind.SURROUND_WITH_FOR_IN, []);
}
// "for"
{
+ int offset = statementsRange.offset;
+ SourceBuilder sb = new SourceBuilder(file, offset);
+ sb.append(indentOld);
+ sb.append('for (var ');
{
- int offset = statementsRange.offset;
- SourceBuilder sb = new SourceBuilder(file, offset);
- sb.append(indentOld);
- sb.append("for (var ");
- {
- sb.startPosition("VAR");
- sb.append("v");
- sb.endPosition();
- }
- sb.append(" = ");
- {
- sb.startPosition("INIT");
- sb.append("init");
- sb.endPosition();
- }
- sb.append("; ");
- {
- sb.startPosition("CONDITION");
- sb.append("condition");
- sb.endPosition();
- }
- sb.append("; ");
- {
- sb.startPosition("INCREMENT");
- sb.append("increment");
- sb.endPosition();
- }
- sb.append(") {");
- sb.append(eol);
- _insertBuilder(sb);
+ sb.startPosition('VAR');
+ sb.append('v');
+ sb.endPosition();
}
- _addIndentEdit(statementsRange, indentOld, indentNew);
- _addInsertEdit(statementsRange.end, "${indentOld}}${eol}");
- exitPosition = _newPosition(lastStatement.end);
+ sb.append(' = ');
+ {
+ sb.startPosition('INIT');
+ sb.append('init');
+ sb.endPosition();
+ }
+ sb.append('; ');
+ {
+ sb.startPosition('CONDITION');
+ sb.append('condition');
+ sb.endPosition();
+ }
+ sb.append('; ');
+ {
+ sb.startPosition('INCREMENT');
+ sb.append('increment');
+ sb.endPosition();
+ }
+ sb.append(') {');
+ sb.append(eol);
+ sb.append(indentedCode);
+ sb.append(indentOld);
+ sb.append('}');
+ exitPosition = _newPosition(sb.offset + sb.length);
+ sb.append(eol);
+ _insertBuilder(sb, statementsRange.length);
// add proposal
_addAssist(AssistKind.SURROUND_WITH_FOR, []);
}
// "do-while"
{
- _addInsertEdit(statementsRange.offset, "${indentOld}do {${eol}");
- _addIndentEdit(statementsRange, indentOld, indentNew);
+ int offset = statementsRange.offset;
+ SourceBuilder sb = new SourceBuilder(file, offset);
+ sb.append(indentOld);
+ sb.append('do {');
+ sb.append(eol);
+ sb.append(indentedCode);
+ sb.append(indentOld);
+ sb.append('} while (');
{
- int offset = statementsRange.end;
- SourceBuilder sb = new SourceBuilder(file, offset);
- sb.append(indentOld);
- sb.append("} while (");
- {
- sb.startPosition("CONDITION");
- sb.append("condition");
- sb.endPosition();
- }
- sb.append(");");
- sb.append(eol);
- _insertBuilder(sb);
+ sb.startPosition('CONDITION');
+ sb.append('condition');
+ sb.endPosition();
}
- exitPosition = _newPosition(lastStatement.end);
+ sb.append(');');
+ exitPosition = _newPosition(sb.offset + sb.length);
+ sb.append(eol);
+ _insertBuilder(sb, statementsRange.length);
// add proposal
_addAssist(AssistKind.SURROUND_WITH_DO_WHILE, []);
}
// "try-catch"
{
- _addInsertEdit(statementsRange.offset, "${indentOld}try {${eol}");
- _addIndentEdit(statementsRange, indentOld, indentNew);
+ int offset = statementsRange.offset;
+ SourceBuilder sb = new SourceBuilder(file, offset);
+ sb.append(indentOld);
+ sb.append('try {');
+ sb.append(eol);
+ sb.append(indentedCode);
+ sb.append(indentOld);
+ sb.append('} on ');
{
- int offset = statementsRange.end;
- SourceBuilder sb = new SourceBuilder(file, offset);
- sb.append(indentOld);
- sb.append("} on ");
- {
- sb.startPosition("EXCEPTION_TYPE");
- sb.append("Exception");
- sb.endPosition();
- }
- sb.append(" catch (");
- {
- sb.startPosition("EXCEPTION_VAR");
- sb.append("e");
- sb.endPosition();
- }
- sb.append(") {");
- sb.append(eol);
- //
- sb.append(indentNew);
- {
- sb.startPosition("CATCH");
- sb.append("// TODO");
- sb.endPosition();
- sb.setExitOffset();
- }
- sb.append(eol);
- //
- sb.append(indentOld);
- sb.append("}");
- sb.append(eol);
- //
- _insertBuilder(sb);
- exitPosition = _newPosition(sb.exitOffset);
+ sb.startPosition('EXCEPTION_TYPE');
+ sb.append('Exception');
+ sb.endPosition();
}
+ sb.append(' catch (');
+ {
+ sb.startPosition('EXCEPTION_VAR');
+ sb.append('e');
+ sb.endPosition();
+ }
+ sb.append(') {');
+ sb.append(eol);
+ //
+ sb.append(indentNew);
+ {
+ sb.startPosition('CATCH');
+ sb.append('// TODO');
+ sb.endPosition();
+ sb.setExitOffset();
+ }
+ sb.append(eol);
+ //
+ sb.append(indentOld);
+ sb.append('}');
+ sb.append(eol);
+ _insertBuilder(sb, statementsRange.length);
// add proposal
_addAssist(AssistKind.SURROUND_WITH_TRY_CATCH, []);
}
// "try-finally"
{
- _addInsertEdit(statementsRange.offset, "${indentOld}try {${eol}");
- _addIndentEdit(statementsRange, indentOld, indentNew);
+ int offset = statementsRange.offset;
+ SourceBuilder sb = new SourceBuilder(file, offset);
+ //
+ sb.append(indentOld);
+ sb.append('try {');
+ sb.append(eol);
+ //
+ sb.append(indentedCode);
+ //
+ sb.append(indentOld);
+ sb.append('} finally {');
+ sb.append(eol);
+ //
+ sb.append(indentNew);
{
- int offset = statementsRange.end;
- SourceBuilder sb = new SourceBuilder(file, offset);
- //
- sb.append(indentOld);
- sb.append("} finally {");
- sb.append(eol);
- //
- sb.append(indentNew);
- {
- sb.startPosition("FINALLY");
- sb.append("// TODO");
- sb.endPosition();
- }
+ sb.startPosition('FINALLY');
+ sb.append('// TODO');
+ sb.endPosition();
sb.setExitOffset();
- sb.append(eol);
- //
- sb.append(indentOld);
- sb.append("}");
- sb.append(eol);
- //
- _insertBuilder(sb);
- exitPosition = _newPosition(sb.exitOffset);
}
+ sb.setExitOffset();
+ sb.append(eol);
+ //
+ sb.append(indentOld);
+ sb.append('}');
+ sb.append(eol);
+ //
+ _insertBuilder(sb, statementsRange.length);
// add proposal
_addAssist(AssistKind.SURROUND_WITH_TRY_FINALLY, []);
}
@@ -1670,9 +1671,12 @@
/**
* Inserts the given [SourceBuilder] at its offset.
*/
- void _insertBuilder(SourceBuilder builder) {
- String text = builder.toString();
- _addInsertEdit(builder.offset, text);
+ void _insertBuilder(SourceBuilder builder, [int length = 0]) {
+ {
+ SourceRange range = rangeStartLength(builder.offset, length);
+ String text = builder.toString();
+ _addReplaceEdit(range, text);
+ }
// add linked positions
builder.linkedPositionGroups.forEach((String id, LinkedEditGroup group) {
LinkedEditGroup fixGroup = _getLinkedPosition(id);
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 143cceb..ceec5fe 100644
--- a/pkg/analysis_server/lib/src/services/correction/fix_internal.dart
+++ b/pkg/analysis_server/lib/src/services/correction/fix_internal.dart
@@ -80,7 +80,7 @@
unitLibraryFolder = dirname(unitLibraryFile);
}
- DartType get coreTypeBool => _getCoreType("bool");
+ DartType get coreTypeBool => _getCoreType('bool');
/**
* Returns the EOL to use for this [CompilationUnit].
@@ -264,7 +264,7 @@
void _addFix_boolInsteadOfBoolean() {
SourceRange range = rf.rangeError(error);
- _addReplaceEdit(range, "bool");
+ _addReplaceEdit(range, 'bool');
_addFix(FixKind.REPLACE_BOOLEAN_WITH_BOOL, []);
}
@@ -275,28 +275,28 @@
CompilationUnitMember enclosingMember =
node.getAncestor((node) => node is CompilationUnitMember);
int offset = enclosingMember.end;
- String prefix = "";
+ String prefix = '';
// prepare source
SourceBuilder sb = new SourceBuilder(file, offset);
{
- sb.append("${eol}${eol}");
+ sb.append('$eol$eol');
sb.append(prefix);
// "class"
- sb.append("class ");
+ sb.append('class ');
// append name
{
- sb.startPosition("NAME");
+ sb.startPosition('NAME');
sb.append(name);
sb.endPosition();
}
// no members
- sb.append(" {");
+ sb.append(' {');
sb.append(eol);
- sb.append("}");
+ sb.append('}');
}
// insert source
_insertBuilder(sb);
- _addLinkedPosition("NAME", sb, rf.rangeNode(node));
+ _addLinkedPosition('NAME', sb, rf.rangeNode(node));
// add proposal
_addFix(FixKind.CREATE_CLASS, [name]);
}
@@ -349,14 +349,14 @@
// build method source
SourceBuilder sb = new SourceBuilder(targetFile, targetLocation.offset);
{
- String indent = " ";
+ String indent = ' ';
sb.append(targetLocation.prefix);
sb.append(indent);
sb.append(targetElement.name);
_addFix_undefinedMethod_create_parameters(
sb,
instanceCreation.argumentList);
- sb.append(") {${eol}${indent}}");
+ sb.append(') {$eol$indent}');
sb.append(targetLocation.suffix);
}
// insert source
@@ -407,27 +407,27 @@
// build method source
SourceBuilder sb = new SourceBuilder(targetFile, targetLocation.offset);
{
- String indent = " ";
+ String indent = ' ';
sb.append(targetLocation.prefix);
sb.append(indent);
sb.append(targetElement.name);
- sb.append(".");
+ sb.append('.');
// append name
{
- sb.startPosition("NAME");
+ sb.startPosition('NAME');
sb.append(name.name);
sb.endPosition();
}
_addFix_undefinedMethod_create_parameters(
sb,
instanceCreation.argumentList);
- sb.append(") {${eol}${indent}}");
+ sb.append(') {$eol$indent}');
sb.append(targetLocation.suffix);
}
// insert source
_insertBuilder(sb);
if (targetFile == file) {
- _addLinkedPosition("NAME", sb, rf.rangeNode(name));
+ _addLinkedPosition('NAME', sb, rf.rangeNode(name));
}
// add proposal
_addFixToElement(
@@ -459,23 +459,23 @@
if (initializers.isEmpty) {
int insertOffset = targetConstructor.parameters.end;
sb = new SourceBuilder(file, insertOffset);
- sb.append(" : ");
+ sb.append(' : ');
} else {
ConstructorInitializer lastInitializer =
initializers[initializers.length - 1];
int insertOffset = lastInitializer.end;
sb = new SourceBuilder(file, insertOffset);
- sb.append(", ");
+ sb.append(', ');
}
}
// add super constructor name
- sb.append("super");
+ sb.append('super');
if (!StringUtils.isEmpty(constructorName)) {
- sb.append(".");
+ sb.append('.');
sb.append(constructorName);
}
// add arguments
- sb.append("(");
+ sb.append('(');
bool firstParameter = true;
for (ParameterElement parameter in superConstructor.parameters) {
// skip non-required parameters
@@ -486,7 +486,7 @@
if (firstParameter) {
firstParameter = false;
} else {
- sb.append(", ");
+ sb.append(', ');
}
// default value
DartType parameterType = parameter.type;
@@ -494,7 +494,7 @@
sb.append(getDefaultValueCode(parameterType));
sb.endPosition();
}
- sb.append(")");
+ sb.append(')');
// insert proposal
_insertBuilder(sb);
// add proposal
@@ -556,7 +556,7 @@
sb.append(constructorName);
sb.endPosition();
}
- sb.append("(");
+ sb.append('(');
sb.append(parametersBuffer.toString());
sb.append(') : super');
if (!constructorName.isEmpty) {
@@ -882,7 +882,7 @@
// append method
sb.append(prefix);
sb.append(
- "noSuchMethod(Invocation invocation) => super.noSuchMethod(invocation);");
+ 'noSuchMethod(Invocation invocation) => super.noSuchMethod(invocation);');
sb.append(eol);
}
// done
@@ -902,7 +902,7 @@
String suffix;
{
// if no directives
- prefix = "";
+ prefix = '';
suffix = eol;
CorrectionUtils libraryUtils = new CorrectionUtils(libraryUnit);
// after last directive in library
@@ -910,7 +910,7 @@
if (directive is LibraryDirective || directive is ImportDirective) {
offset = directive.end;
prefix = eol;
- suffix = "";
+ suffix = '';
}
}
// if still beginning of file, skip shebang and line comments
@@ -918,11 +918,11 @@
CorrectionUtils_InsertDesc desc = libraryUtils.getInsertDescTop();
offset = desc.offset;
prefix = desc.prefix;
- suffix = "${desc.suffix}${eol}";
+ suffix = '${desc.suffix}$eol';
}
}
// insert new import
- String importSource = "${prefix}import '${importPath}';${suffix}";
+ String importSource = "${prefix}import '$importPath';$suffix";
_addInsertEdit(offset, importSource);
// add proposal
_addFixToElement(kind, [importPath], libraryUnitElement);
@@ -930,7 +930,7 @@
void _addFix_importLibrary_withElement(String name, ElementKind kind) {
// ignore if private
- if (name.startsWith("_")) {
+ if (name.startsWith('_')) {
return;
}
@@ -953,7 +953,7 @@
PrefixElement prefix = imp.prefix;
if (prefix != null) {
SourceRange range = rf.rangeStartLength(node, 0);
- _addReplaceEdit(range, "${prefix.displayName}.");
+ _addReplaceEdit(range, '${prefix.displayName}.');
_addFix(
FixKind.IMPORT_LIBRARY_PREFIX,
[libraryElement.displayName, prefix.displayName]);
@@ -974,7 +974,7 @@
libraryName = imp.uri;
}
// update library
- String newShowCode = "show ${StringUtils.join(showNames, ", ")}";
+ String newShowCode = 'show ${StringUtils.join(showNames, ", ")}';
_addReplaceEdit(rf.rangeOffsetEnd(showCombinator), newShowCode);
_addFixToElement(
FixKind.IMPORT_LIBRARY_SHOW,
@@ -1086,7 +1086,7 @@
void _addFix_insertSemicolon() {
if (error.message.contains("';'")) {
int insertOffset = error.offset + error.length;
- _addInsertEdit(insertOffset, ";");
+ _addInsertEdit(insertOffset, ';');
_addFix(FixKind.INSERT_SEMICOLON, []);
}
}
@@ -1096,7 +1096,7 @@
IsExpression isExpression = coveredNode as IsExpression;
_addReplaceEdit(
rf.rangeEndEnd(isExpression.expression, isExpression),
- " != null");
+ ' != null');
_addFix(FixKind.USE_NOT_EQ_NULL, []);
}
}
@@ -1106,7 +1106,7 @@
IsExpression isExpression = coveredNode as IsExpression;
_addReplaceEdit(
rf.rangeEndEnd(isExpression.expression, isExpression),
- " == null");
+ ' == null');
_addFix(FixKind.USE_EQ_EQ_NULL, []);
}
}
@@ -1115,7 +1115,7 @@
ClassDeclaration enclosingClass =
node.getAncestor((node) => node is ClassDeclaration);
String className = enclosingClass.name.name;
- _addInsertEdit(enclosingClass.classKeyword.offset, "abstract ");
+ _addInsertEdit(enclosingClass.classKeyword.offset, 'abstract ');
_addFix(FixKind.MAKE_CLASS_ABSTRACT, [className]);
}
@@ -1124,7 +1124,7 @@
MethodDeclaration method = node.parent as MethodDeclaration;
FunctionBody body = method.body;
if (method.name == node && body != null) {
- _addReplaceEdit(rf.rangeEndStart(node, body), " ");
+ _addReplaceEdit(rf.rangeEndStart(node, body), ' ');
_addFix(FixKind.REMOVE_PARAMETERS_IN_GETTER_DECLARATION, []);
}
}
@@ -1195,14 +1195,14 @@
void _addFix_replaceVarWithDynamic() {
SourceRange range = rf.rangeError(error);
- _addReplaceEdit(range, "dynamic");
+ _addReplaceEdit(range, 'dynamic');
_addFix(FixKind.REPLACE_VAR_WITH_DYNAMIC, []);
}
void _addFix_replaceWithConstInstanceCreation() {
if (coveredNode is InstanceCreationExpression) {
var instanceCreation = coveredNode as InstanceCreationExpression;
- _addReplaceEdit(rf.rangeToken(instanceCreation.keyword), "const");
+ _addReplaceEdit(rf.rangeToken(instanceCreation.keyword), 'const');
_addFix(FixKind.USE_CONST, []);
}
}
@@ -1259,7 +1259,7 @@
AstNode enclosingMember =
node.getAncestor((node) => node is CompilationUnitMember);
insertOffset = enclosingMember.end;
- sourcePrefix = "${eol}${eol}";
+ sourcePrefix = '$eol$eol';
utils.targetClassElement = null;
// build method source
SourceBuilder sb = new SourceBuilder(file, insertOffset);
@@ -1272,12 +1272,12 @@
}
// append name
{
- sb.startPosition("NAME");
+ sb.startPosition('NAME');
sb.append(name);
sb.endPosition();
}
_addFix_undefinedMethod_create_parameters(sb, invocation.argumentList);
- sb.append(") {${eol}}");
+ sb.append(') {$eol}');
}
// insert source
_insertBuilder(sb);
@@ -1334,8 +1334,8 @@
staticModifier = _inStaticContext();
prefix = utils.getNodePrefix(enclosingMember);
insertOffset = enclosingMember.end;
- sourcePrefix = "${eol}${eol}";
- sourceSuffix = "";
+ sourcePrefix = '$eol$eol';
+ sourceSuffix = '';
} else {
// prepare target interface type
DartType targetType = target.bestType;
@@ -1350,10 +1350,10 @@
}
// prepare insert offset
ClassDeclaration targetClassNode = targetClassElement.node;
- prefix = " ";
+ prefix = ' ';
insertOffset = targetClassNode.end - 1;
if (targetClassNode.members.isEmpty) {
- sourcePrefix = "";
+ sourcePrefix = '';
} else {
sourcePrefix = eol;
}
@@ -1367,7 +1367,7 @@
sb.append(prefix);
// maybe "static"
if (staticModifier) {
- sb.append("static ");
+ sb.append('static ');
}
// append return type
{
@@ -1376,12 +1376,12 @@
}
// append name
{
- sb.startPosition("NAME");
+ sb.startPosition('NAME');
sb.append(name);
sb.endPosition();
}
_addFix_undefinedMethod_create_parameters(sb, invocation.argumentList);
- sb.append(") {${eol}${prefix}}");
+ sb.append(') {$eol$prefix}');
sb.append(sourceSuffix);
}
// insert source
@@ -1398,14 +1398,14 @@
void _addFix_undefinedMethod_create_parameters(SourceBuilder sb,
ArgumentList argumentList) {
// append parameters
- sb.append("(");
+ sb.append('(');
Set<String> excluded = new Set();
List<Expression> arguments = argumentList.arguments;
for (int i = 0; i < arguments.length; i++) {
Expression argument = arguments[i];
// append separator
if (i != 0) {
- sb.append(", ");
+ sb.append(', ');
}
// append type name
DartType type = argument.bestType;
@@ -1413,19 +1413,19 @@
// TODO(scheglov) use librariesToImport
String typeSource = utils.getTypeSource(type, librariesToImport);
{
- sb.startPosition("TYPE${i}");
+ sb.startPosition('TYPE$i');
sb.append(typeSource);
_addSuperTypeProposals(sb, new Set(), type);
sb.endPosition();
}
- sb.append(" ");
+ sb.append(' ');
// append parameter name
{
List<String> suggestions =
_getArgumentNameSuggestions(excluded, type, argument, i);
String favorite = suggestions[0];
excluded.add(favorite);
- sb.startPosition("ARG${i}");
+ sb.startPosition('ARG$i');
sb.append(favorite);
sb.addSuggestions(LinkedEditSuggestionKind.PARAMETER, suggestions);
sb.endPosition();
@@ -1478,7 +1478,7 @@
}
// replace "/" with "~/"
BinaryExpression binary = target as BinaryExpression;
- _addReplaceEdit(rf.rangeToken(binary.operator), "~/");
+ _addReplaceEdit(rf.rangeToken(binary.operator), '~/');
// remove everything before and after
_addRemoveEdit(rf.rangeStartStart(invocation, binary.leftOperand));
_addRemoveEdit(rf.rangeEndEnd(binary.rightOperand, invocation));
@@ -1574,24 +1574,24 @@
sb.append(prefix);
// may be static
if (isStatic) {
- sb.append("static ");
+ sb.append('static ');
}
// append return type
_appendType(sb, functionType.returnType, groupId: 'RETURN_TYPE');
// append name
{
- sb.startPosition("NAME");
+ sb.startPosition('NAME');
sb.append(name);
sb.endPosition();
}
// append parameters
- sb.append("(");
+ sb.append('(');
List<ParameterElement> parameters = functionType.parameters;
for (int i = 0; i < parameters.length; i++) {
ParameterElement parameter = parameters[i];
// append separator
if (i != 0) {
- sb.append(", ");
+ sb.append(', ');
}
// append type name
DartType type = parameter.type;
@@ -1600,30 +1600,30 @@
// TODO(scheglov) use librariesToImport
String typeSource = utils.getTypeSource(type, librariesToImport);
{
- sb.startPosition("TYPE${i}");
+ sb.startPosition('TYPE$i');
sb.append(typeSource);
_addSuperTypeProposals(sb, new Set(), type);
sb.endPosition();
}
- sb.append(" ");
+ sb.append(' ');
}
// append parameter name
{
- sb.startPosition("ARG${i}");
+ sb.startPosition('ARG$i');
sb.append(parameter.displayName);
sb.endPosition();
}
}
- sb.append(")");
+ sb.append(')');
// close method
- sb.append(" {${eol}${prefix}}");
+ sb.append(' {$eol$prefix}');
sb.append(sourceSuffix);
}
// insert source
_insertBuilder(sb);
// add linked positions
if (targetSource == unitSource) {
- _addLinkedPosition("NAME", sb, rf.rangeNode(node));
+ _addLinkedPosition('NAME', sb, rf.rangeNode(node));
}
}
@@ -1636,8 +1636,8 @@
// prepare environment
int insertOffset = unit.end;
// prepare prefix
- String prefix = "";
- String sourcePrefix = "${eol}";
+ String prefix = '';
+ String sourcePrefix = '$eol';
String sourceSuffix = eol;
_addProposal_createFunction(
functionType,
@@ -1665,10 +1665,10 @@
ClassDeclaration targetClassNode = targetClassElement.node;
int insertOffset = targetClassNode.end - 1;
// prepare prefix
- String prefix = " ";
+ String prefix = ' ';
String sourcePrefix;
if (targetClassNode.members.isEmpty) {
- sourcePrefix = "";
+ sourcePrefix = '';
} else {
sourcePrefix = eol;
}
@@ -1702,13 +1702,13 @@
}
void _appendParameters(SourceBuilder sb, List<ParameterElement> parameters) {
- sb.append("(");
+ sb.append('(');
bool firstParameter = true;
bool sawNamed = false;
bool sawPositional = false;
for (ParameterElement parameter in parameters) {
if (!firstParameter) {
- sb.append(", ");
+ sb.append(', ');
} else {
firstParameter = false;
}
@@ -1716,13 +1716,13 @@
ParameterKind parameterKind = parameter.parameterKind;
if (parameterKind == ParameterKind.NAMED) {
if (!sawNamed) {
- sb.append("{");
+ sb.append('{');
sawNamed = true;
}
}
if (parameterKind == ParameterKind.POSITIONAL) {
if (!sawPositional) {
- sb.append("[");
+ sb.append('[');
sawPositional = true;
}
}
@@ -1732,21 +1732,21 @@
String defaultCode = parameter.defaultValueCode;
if (defaultCode != null) {
if (sawPositional) {
- sb.append(" = ");
+ sb.append(' = ');
} else {
- sb.append(": ");
+ sb.append(': ');
}
sb.append(defaultCode);
}
}
// close parameters
if (sawNamed) {
- sb.append("}");
+ sb.append('}');
}
if (sawPositional) {
- sb.append("]");
+ sb.append(']');
}
- sb.append(")");
+ sb.append(')');
}
void _appendParameterSource(SourceBuilder sb, DartType type, String name) {
@@ -1781,11 +1781,11 @@
*/
String _getConstructorProposalName(ConstructorElement constructor) {
SourceBuilder proposalNameBuffer = new SourceBuilder.buffer();
- proposalNameBuffer.append("super");
+ proposalNameBuffer.append('super');
// may be named
String constructorName = constructor.displayName;
if (!constructorName.isEmpty) {
- proposalNameBuffer.append(".");
+ proposalNameBuffer.append('.');
proposalNameBuffer.append(constructorName);
}
// parameters
@@ -2091,7 +2091,7 @@
if (suggestions.length != 0) {
return suggestions;
}
- return <String>["arg${index}"];
+ return <String>['arg$index'];
}
/**
diff --git a/pkg/analysis_server/lib/src/services/correction/util.dart b/pkg/analysis_server/lib/src/services/correction/util.dart
index 63c85f8..837afd8 100644
--- a/pkg/analysis_server/lib/src/services/correction/util.dart
+++ b/pkg/analysis_server/lib/src/services/correction/util.dart
@@ -877,7 +877,7 @@
return name;
}
// function type
- if (type is FunctionType) {
+ if (type is FunctionType && type.element.isSynthetic) {
FunctionType functionType = type;
StringBuffer sb = new StringBuffer();
// return type
diff --git a/pkg/analysis_server/lib/src/services/index/index.dart b/pkg/analysis_server/lib/src/services/index/index.dart
index acfc835..e80a190 100644
--- a/pkg/analysis_server/lib/src/services/index/index.dart
+++ b/pkg/analysis_server/lib/src/services/index/index.dart
@@ -119,22 +119,6 @@
*/
class IndexConstants {
/**
- * Left: an Angular element.
- * Is referenced at.
- * Right: location.
- */
- static final Relationship ANGULAR_REFERENCE =
- Relationship.getRelationship("angular-reference");
-
- /**
- * Left: an Angular component.
- * Is closed "/>" at.
- * Right: location.
- */
- static final Relationship ANGULAR_CLOSING_TAG_REFERENCE =
- Relationship.getRelationship("angular-closing-tag-reference");
-
- /**
* Left: the Universe or a Library.
* Defines an Element.
* Right: an Element declaration.
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 98d28f2..3159baf 100644
--- a/pkg/analysis_server/lib/src/services/index/index_contributor.dart
+++ b/pkg/analysis_server/lib/src/services/index/index_contributor.dart
@@ -39,7 +39,6 @@
}
// do index
unit.accept(new _IndexContributor(store));
- unit.accept(new _AngularDartIndexContributor(store));
store.doneIndex();
}
@@ -64,259 +63,11 @@
return;
}
// do index
- unit.accept(new _AngularHtmlIndexContributor(store));
store.doneIndex();
}
/**
- * Visits resolved [CompilationUnit] and adds Angular specific relationships
- * into [IndexStore].
- */
-class _AngularDartIndexContributor extends GeneralizingAstVisitor<Object> {
- final IndexStore _store;
-
- _AngularDartIndexContributor(this._store);
-
- @override
- Object visitClassDeclaration(ClassDeclaration node) {
- ClassElement classElement = node.element;
- if (classElement != null) {
- List<ToolkitObjectElement> toolkitObjects = classElement.toolkitObjects;
- for (ToolkitObjectElement object in toolkitObjects) {
- if (object is AngularComponentElement) {
- _indexComponent(object);
- }
- if (object is AngularDecoratorElement) {
- AngularDecoratorElement directive = object;
- _indexDirective(directive);
- }
- }
- }
- // stop visiting
- return null;
- }
-
- @override
- Object visitCompilationUnitMember(CompilationUnitMember node) => null;
-
- void _indexComponent(AngularComponentElement component) {
- _indexProperties(component.properties);
- }
-
- void _indexDirective(AngularDecoratorElement directive) {
- _indexProperties(directive.properties);
- }
-
- /**
- * Index [FieldElement] references from [AngularPropertyElement]s.
- */
- void _indexProperties(List<AngularPropertyElement> properties) {
- for (AngularPropertyElement property in properties) {
- FieldElement field = property.field;
- if (field != null) {
- int offset = property.fieldNameOffset;
- if (offset == -1) {
- continue;
- }
- int length = field.name.length;
- Location location = new Location(property, offset, length);
- // getter reference
- if (property.propertyKind.callsGetter()) {
- PropertyAccessorElement getter = field.getter;
- if (getter != null) {
- _store.recordRelationship(
- getter,
- IndexConstants.IS_REFERENCED_BY,
- location);
- }
- }
- // setter reference
- if (property.propertyKind.callsSetter()) {
- PropertyAccessorElement setter = field.setter;
- if (setter != null) {
- _store.recordRelationship(
- setter,
- IndexConstants.IS_REFERENCED_BY,
- location);
- }
- }
- }
- }
- }
-}
-
-
-/**
- * Visits resolved [HtmlUnit] and adds relationships into [IndexStore].
- */
-class _AngularHtmlIndexContributor extends _ExpressionVisitor {
- /**
- * The [IndexStore] to record relations into.
- */
- final IndexStore _store;
-
- /**
- * The index contributor used to index Dart [Expression]s.
- */
- _IndexContributor _indexContributor;
-
- HtmlElement _htmlUnitElement;
-
- /**
- * Initialize a newly created Angular HTML index contributor.
- *
- * [store] - the [IndexStore] to record relations into.
- */
- _AngularHtmlIndexContributor(this._store) {
- _indexContributor =
- new _AngularHtmlIndexContributor_forEmbeddedDart(_store, this);
- }
-
- @override
- void visitExpression(Expression expression) {
- // Formatter
- if (expression is SimpleIdentifier) {
- Element element = expression.bestElement;
- if (element is AngularElement) {
- _store.recordRelationship(
- element,
- IndexConstants.ANGULAR_REFERENCE,
- _createLocationForIdentifier(expression));
- return;
- }
- }
- // index as a normal Dart expression
- expression.accept(_indexContributor);
- }
-
- @override
- Object visitHtmlUnit(ht.HtmlUnit node) {
- _htmlUnitElement = node.element;
- CompilationUnitElement dartUnitElement =
- _htmlUnitElement.angularCompilationUnit;
- _indexContributor.enterScope(dartUnitElement);
- return super.visitHtmlUnit(node);
- }
-
- @override
- Object visitXmlAttributeNode(ht.XmlAttributeNode node) {
- Element element = node.element;
- if (element != null) {
- ht.Token nameToken = node.nameToken;
- Location location = _createLocationForToken(nameToken);
- _store.recordRelationship(
- element,
- IndexConstants.ANGULAR_REFERENCE,
- location);
- }
- return super.visitXmlAttributeNode(node);
- }
-
- @override
- Object visitXmlTagNode(ht.XmlTagNode node) {
- Element element = node.element;
- if (element != null) {
- // tag
- {
- ht.Token tagToken = node.tagToken;
- Location location = _createLocationForToken(tagToken);
- _store.recordRelationship(
- element,
- IndexConstants.ANGULAR_REFERENCE,
- location);
- }
- // maybe add closing tag range
- ht.Token closingTag = node.closingTag;
- if (closingTag != null) {
- Location location = _createLocationForToken(closingTag);
- _store.recordRelationship(
- element,
- IndexConstants.ANGULAR_CLOSING_TAG_REFERENCE,
- location);
- }
- }
- return super.visitXmlTagNode(node);
- }
-
- Location _createLocationForIdentifier(SimpleIdentifier identifier) =>
- new Location(_htmlUnitElement, identifier.offset, identifier.length);
-
- Location _createLocationForToken(ht.Token token) =>
- new Location(_htmlUnitElement, token.offset, token.length);
-}
-
-
-class _AngularHtmlIndexContributor_forEmbeddedDart extends _IndexContributor {
- final _AngularHtmlIndexContributor angularContributor;
-
- _AngularHtmlIndexContributor_forEmbeddedDart(IndexStore store,
- this.angularContributor)
- : super(store);
-
- @override
- Element peekElement() => angularContributor._htmlUnitElement;
-
- @override
- void recordRelationship(Element element, Relationship relationship,
- Location location) {
- AngularElement angularElement =
- AngularHtmlUnitResolver.getAngularElement(element);
- if (angularElement != null) {
- element = angularElement;
- relationship = IndexConstants.ANGULAR_REFERENCE;
- }
- super.recordRelationship(element, relationship, location);
- }
-}
-
-
-/**
- * Recursively visits an [HtmlUnit] and every embedded [Expression].
- */
-abstract class _ExpressionVisitor extends ht.RecursiveXmlVisitor<Object> {
- /**
- * Visits the given [Expression]s embedded into tag or attribute.
- *
- * [expression] - the [Expression] to visit, not `null`
- */
- void visitExpression(Expression expression);
-
- @override
- Object visitXmlAttributeNode(ht.XmlAttributeNode node) {
- _visitExpressions(node.expressions);
- return super.visitXmlAttributeNode(node);
- }
-
- @override
- Object visitXmlTagNode(ht.XmlTagNode node) {
- _visitExpressions(node.expressions);
- return super.visitXmlTagNode(node);
- }
-
- /**
- * Visits [Expression]s of the given [XmlExpression]s.
- */
- void _visitExpressions(List<ht.XmlExpression> expressions) {
- for (ht.XmlExpression xmlExpression in expressions) {
- if (xmlExpression is AngularXmlExpression) {
- AngularXmlExpression angularXmlExpression = xmlExpression;
- List<Expression> dartExpressions =
- angularXmlExpression.expression.expressions;
- for (Expression dartExpression in dartExpressions) {
- visitExpression(dartExpression);
- }
- }
- if (xmlExpression is ht.RawXmlExpression) {
- ht.RawXmlExpression rawXmlExpression = xmlExpression;
- visitExpression(rawXmlExpression.expression);
- }
- }
- }
-}
-
-
-/**
* Visits a resolved AST and adds relationships into [IndexStore].
*/
class _IndexContributor extends GeneralizingAstVisitor<Object> {
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 e816fbb..d16d29a 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
@@ -684,7 +684,10 @@
@override
void recordRelationship(Element element, Relationship relationship,
Location location) {
- if (element == null || location == null) {
+ if (element == null || element.location == null) {
+ return;
+ }
+ if (location == null) {
return;
}
// special support for UniverseElement
diff --git a/pkg/analysis_server/lib/src/services/search/search_engine.dart b/pkg/analysis_server/lib/src/services/search/search_engine.dart
index 9073be8..87a9127 100644
--- a/pkg/analysis_server/lib/src/services/search/search_engine.dart
+++ b/pkg/analysis_server/lib/src/services/search/search_engine.dart
@@ -27,18 +27,6 @@
*/
class MatchKind {
/**
- * A reference to an Angular element.
- */
- static const MatchKind ANGULAR_REFERENCE =
- const MatchKind('ANGULAR_REFERENCE');
-
- /**
- * A reference to an Angular element.
- */
- static const MatchKind ANGULAR_CLOSING_TAG_REFERENCE =
- const MatchKind('ANGULAR_CLOSING_TAG_REFERENCE');
-
- /**
* A declaration of an element.
*/
static const MatchKind DECLARATION = const MatchKind('DECLARATION');
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 adbab3d..a94aa70 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
@@ -56,14 +56,7 @@
@override
Future<List<SearchMatch>> searchReferences(Element element) {
- if (element.kind == ElementKind.ANGULAR_COMPONENT ||
- element.kind == ElementKind.ANGULAR_CONTROLLER ||
- element.kind == ElementKind.ANGULAR_FORMATTER ||
- element.kind == ElementKind.ANGULAR_PROPERTY ||
- element.kind == ElementKind.ANGULAR_SCOPE_PROPERTY ||
- element.kind == ElementKind.ANGULAR_SELECTOR) {
- return _searchReferences_Angular(element as AngularElement);
- } else if (element.kind == ElementKind.CLASS) {
+ if (element.kind == ElementKind.CLASS) {
return _searchReferences(element);
} else if (element.kind == ElementKind.COMPILATION_UNIT) {
return _searchReferences(element);
@@ -131,19 +124,6 @@
return requestor.merge();
}
- Future<List<SearchMatch>> _searchReferences_Angular(AngularElement element) {
- _Requestor requestor = new _Requestor(_index);
- requestor.add(
- element,
- IndexConstants.ANGULAR_REFERENCE,
- MatchKind.ANGULAR_REFERENCE);
- requestor.add(
- element,
- IndexConstants.ANGULAR_CLOSING_TAG_REFERENCE,
- MatchKind.ANGULAR_CLOSING_TAG_REFERENCE);
- return requestor.merge();
- }
-
Future<List<SearchMatch>>
_searchReferences_Constructor(ConstructorElement constructor) {
_Requestor requestor = new _Requestor(_index);
diff --git a/pkg/analysis_server/lib/src/socket_server.dart b/pkg/analysis_server/lib/src/socket_server.dart
index d6851ec..f2038ec 100644
--- a/pkg/analysis_server/lib/src/socket_server.dart
+++ b/pkg/analysis_server/lib/src/socket_server.dart
@@ -6,13 +6,8 @@
import 'package:analysis_server/src/analysis_server.dart';
import 'package:analysis_server/src/channel/channel.dart';
-import 'package:analysis_server/src/domain_analysis.dart';
-import 'package:analysis_server/src/domain_completion.dart';
-import 'package:analysis_server/src/domain_execution.dart';
-import 'package:analysis_server/src/domain_server.dart';
-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/search/search_domain.dart';
import 'package:analysis_server/src/services/index/index.dart';
import 'package:analysis_server/src/services/index/local_file_index.dart';
import 'package:analyzer/file_system/physical_file_system.dart';
@@ -41,6 +36,7 @@
final AnalysisServerOptions analysisServerOptions;
final DirectoryBasedDartSdk defaultSdk;
final InstrumentationService instrumentationService;
+ final ServerPlugin serverPlugin;
/**
* The analysis server that was created when a client established a
@@ -49,7 +45,7 @@
AnalysisServer analysisServer;
SocketServer(this.analysisServerOptions, this.defaultSdk,
- this.instrumentationService);
+ this.instrumentationService, this.serverPlugin);
/**
* Create an analysis server which will communicate with the client using the
@@ -84,12 +80,6 @@
* Initialize the handlers to be used by the given [server].
*/
void _initializeHandlers(AnalysisServer server) {
- server.handlers = [
- new ServerDomainHandler(server),
- new AnalysisDomainHandler(server),
- new EditDomainHandler(server),
- new SearchDomainHandler(server),
- new CompletionDomainHandler(server),
- new ExecutionDomainHandler(server),];
+ server.handlers = serverPlugin.createDomains(server);
}
}
diff --git a/pkg/analysis_server/lib/starter.dart b/pkg/analysis_server/lib/starter.dart
new file mode 100644
index 0000000..9483fff
--- /dev/null
+++ b/pkg/analysis_server/lib/starter.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.
+
+library driver;
+
+import 'package:analysis_server/plugin/plugin.dart';
+import 'package:analysis_server/src/server/driver.dart';
+import 'package:analyzer/instrumentation/instrumentation.dart';
+
+/**
+ * An object that can be used to start an analysis server.
+ */
+abstract class ServerStarter {
+ /**
+ * Initialize a newly created starter to start up an analysis server.
+ */
+ factory ServerStarter() = Driver;
+
+ /**
+ * Set the instrumentation [server] that is to be used by the analysis server.
+ */
+ void set instrumentationServer(InstrumentationServer server);
+
+ /**
+ * Set the [plugins] that are defined outside the analysis_server package.
+ */
+ void set userDefinedPlugins(List<Plugin> plugins);
+
+ /**
+ * Use the given command-line [arguments] to start this server.
+ */
+ void start(List<String> arguments);
+}
diff --git a/pkg/analysis_server/test/abstract_context.dart b/pkg/analysis_server/test/abstract_context.dart
index 3cf179f..50adbea 100644
--- a/pkg/analysis_server/test/abstract_context.dart
+++ b/pkg/analysis_server/test/abstract_context.dart
@@ -81,13 +81,6 @@
resourceResolver = new ResourceUriResolver(provider);
context = AnalysisEngine.instance.createAnalysisContext();
context.sourceFactory = new SourceFactory([SDK_RESOLVER, resourceResolver]);
- {
- AnalysisOptionsImpl options =
- new AnalysisOptionsImpl.con1(context.analysisOptions);
- options.enableAsync = true;
- options.enableEnum = true;
- context.analysisOptions = options;
- }
}
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 444f222..eb66da4 100644
--- a/pkg/analysis_server/test/analysis/get_errors_test.dart
+++ b/pkg/analysis_server/test/analysis/get_errors_test.dart
@@ -21,7 +21,7 @@
}
-@ReflectiveTestCase()
+@reflectiveTest
class GetErrorsTest extends AbstractAnalysisTest {
static const String requestId = 'test-getError';
diff --git a/pkg/analysis_server/test/analysis/get_hover_test.dart b/pkg/analysis_server/test/analysis/get_hover_test.dart
index 43a9313..6ee8a48 100644
--- a/pkg/analysis_server/test/analysis/get_hover_test.dart
+++ b/pkg/analysis_server/test/analysis/get_hover_test.dart
@@ -19,7 +19,7 @@
}
-@ReflectiveTestCase()
+@reflectiveTest
class AnalysisHoverTest extends AbstractAnalysisTest {
Future<HoverInformation> prepareHover(String search) {
int offset = findOffset(search);
diff --git a/pkg/analysis_server/test/analysis/notification_errors_test.dart b/pkg/analysis_server/test/analysis/notification_errors_test.dart
index 3ff1987..73bca89 100644
--- a/pkg/analysis_server/test/analysis/notification_errors_test.dart
+++ b/pkg/analysis_server/test/analysis/notification_errors_test.dart
@@ -19,7 +19,7 @@
}
-@ReflectiveTestCase()
+@reflectiveTest
class NotificationErrorsTest extends AbstractAnalysisTest {
Map<String, List<AnalysisError>> filesErrors = {};
diff --git a/pkg/analysis_server/test/analysis/notification_highlights_test.dart b/pkg/analysis_server/test/analysis/notification_highlights_test.dart
index 89c8af1..d61c46a 100644
--- a/pkg/analysis_server/test/analysis/notification_highlights_test.dart
+++ b/pkg/analysis_server/test/analysis/notification_highlights_test.dart
@@ -20,7 +20,7 @@
}
-@ReflectiveTestCase()
+@reflectiveTest
class AnalysisNotificationHighlightsTest extends AbstractAnalysisTest {
List<HighlightRegion> regions;
@@ -1017,7 +1017,7 @@
}
-@ReflectiveTestCase()
+@reflectiveTest
class HighlightTypeTest {
void test_constructor() {
expect(
diff --git a/pkg/analysis_server/test/analysis/notification_navigation_test.dart b/pkg/analysis_server/test/analysis/notification_navigation_test.dart
index e8aa4c8..0e810d1 100644
--- a/pkg/analysis_server/test/analysis/notification_navigation_test.dart
+++ b/pkg/analysis_server/test/analysis/notification_navigation_test.dart
@@ -20,7 +20,7 @@
}
-@ReflectiveTestCase()
+@reflectiveTest
class AnalysisNotificationNavigationTest extends AbstractAnalysisTest {
List<NavigationRegion> regions;
List<NavigationTarget> targets;
diff --git a/pkg/analysis_server/test/analysis/notification_occurrences_test.dart b/pkg/analysis_server/test/analysis/notification_occurrences_test.dart
index 7daf84d..baa29d1 100644
--- a/pkg/analysis_server/test/analysis/notification_occurrences_test.dart
+++ b/pkg/analysis_server/test/analysis/notification_occurrences_test.dart
@@ -20,7 +20,7 @@
}
-@ReflectiveTestCase()
+@reflectiveTest
class AnalysisNotificationOccurrencesTest extends AbstractAnalysisTest {
List<Occurrences> occurrencesList;
Occurrences testOccurences;
diff --git a/pkg/analysis_server/test/analysis/notification_outline_test.dart b/pkg/analysis_server/test/analysis/notification_outline_test.dart
index 8cafbf9..b92ec52 100644
--- a/pkg/analysis_server/test/analysis/notification_outline_test.dart
+++ b/pkg/analysis_server/test/analysis/notification_outline_test.dart
@@ -19,7 +19,7 @@
}
-@ReflectiveTestCase()
+@reflectiveTest
class _AnalysisNotificationOutlineTest extends AbstractAnalysisTest {
Outline outline;
diff --git a/pkg/analysis_server/test/analysis/notification_overrides_test.dart b/pkg/analysis_server/test/analysis/notification_overrides_test.dart
index 2c14e32..b9a3157 100644
--- a/pkg/analysis_server/test/analysis/notification_overrides_test.dart
+++ b/pkg/analysis_server/test/analysis/notification_overrides_test.dart
@@ -20,7 +20,7 @@
}
-@ReflectiveTestCase()
+@reflectiveTest
class AnalysisNotificationOverridesTest extends AbstractAnalysisTest {
List<Override> overridesList;
Override override;
diff --git a/pkg/analysis_server/test/analysis/reanalyze_test.dart b/pkg/analysis_server/test/analysis/reanalyze_test.dart
index 70b3258..cd3cd0b 100644
--- a/pkg/analysis_server/test/analysis/reanalyze_test.dart
+++ b/pkg/analysis_server/test/analysis/reanalyze_test.dart
@@ -19,7 +19,7 @@
}
-@ReflectiveTestCase()
+@reflectiveTest
class ReanalyzeTest extends AbstractAnalysisTest {
test_reanalyze() {
createProject();
diff --git a/pkg/analysis_server/test/analysis_abstract.dart b/pkg/analysis_server/test/analysis_abstract.dart
index fffef7c..3cf7602 100644
--- a/pkg/analysis_server/test/analysis_abstract.dart
+++ b/pkg/analysis_server/test/analysis_abstract.dart
@@ -240,8 +240,6 @@
packageMapProvider = new MockPackageMapProvider();
Index index = createIndex();
server = createAnalysisServer(index);
- server.contextDirectoryManager.defaultOptions.enableAsync = true;
- server.contextDirectoryManager.defaultOptions.enableEnum = true;
handler = new AnalysisDomainHandler(server);
// listen for notifications
Stream<Notification> notificationStream =
diff --git a/pkg/analysis_server/test/analysis_server_test.dart b/pkg/analysis_server/test/analysis_server_test.dart
index 78e92ff..7eb7e6a 100644
--- a/pkg/analysis_server/test/analysis_server_test.dart
+++ b/pkg/analysis_server/test/analysis_server_test.dart
@@ -29,7 +29,7 @@
runReflectiveTests(AnalysisServerTest);
}
-@ReflectiveTestCase()
+@reflectiveTest
class AnalysisServerTest {
MockServerChannel channel;
AnalysisServer server;
diff --git a/pkg/analysis_server/test/context_manager_test.dart b/pkg/analysis_server/test/context_manager_test.dart
index 6815aa1..80cf74d 100644
--- a/pkg/analysis_server/test/context_manager_test.dart
+++ b/pkg/analysis_server/test/context_manager_test.dart
@@ -25,7 +25,7 @@
}
-@ReflectiveTestCase()
+@reflectiveTest
class ContextManagerTest {
TestContextManager manager;
MemoryResourceProvider resourceProvider;
diff --git a/pkg/analysis_server/test/domain_analysis_test.dart b/pkg/analysis_server/test/domain_analysis_test.dart
index 3489e67..651fd72 100644
--- a/pkg/analysis_server/test/domain_analysis_test.dart
+++ b/pkg/analysis_server/test/domain_analysis_test.dart
@@ -150,20 +150,6 @@
var response = handler.handleRequest(request);
expect(response, isResponseSuccess('0'));
});
- // TODO(paulberry): disabled because analyzeAngular is currently not in
- // the API.
-// test('valid', () {
-// engine.AnalysisOptions oldOptions = server.contextDirectoryManager.defaultOptions;
-// bool analyzeAngular = !oldOptions.analyzeAngular;
-// bool enableDeferredLoading = oldOptions.enableDeferredLoading;
-// var newOptions = new AnalysisOptions(analyzeAngular: analyzeAngular,
-// enableDeferredLoading: enableDeferredLoading, enableEnums: false);
-// var request = new AnalysisUpdateOptionsParams(newOptions).toRequest('0');
-// var response = handler.handleRequest(request);
-// expect(response, isResponseSuccess('0'));
-// expect(oldOptions.analyzeAngular, equals(analyzeAngular));
-// expect(oldOptions.enableDeferredLoading, equals(enableDeferredLoading));
-// });
});
});
}
@@ -366,7 +352,7 @@
}
-@ReflectiveTestCase()
+@reflectiveTest
class AnalysisDomainTest extends AbstractAnalysisTest {
Map<String, List<AnalysisError>> filesErrors = {};
diff --git a/pkg/analysis_server/test/domain_completion_test.dart b/pkg/analysis_server/test/domain_completion_test.dart
index 365ae51..f6650cf 100644
--- a/pkg/analysis_server/test/domain_completion_test.dart
+++ b/pkg/analysis_server/test/domain_completion_test.dart
@@ -13,6 +13,7 @@
import 'package:analysis_server/src/domain_completion.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';
import 'package:analysis_server/src/services/index/index.dart' show Index;
import 'package:analysis_server/src/services/index/local_memory_index.dart';
import 'package:analysis_server/src/services/search/search_engine.dart';
@@ -35,7 +36,7 @@
runReflectiveTests(CompletionTest);
}
-@ReflectiveTestCase()
+@reflectiveTest
class CompletionManagerTest extends AbstractAnalysisTest {
AnalysisDomainHandler analysisDomain;
Test_CompletionDomainHandler completionDomain;
@@ -241,7 +242,7 @@
}
}
-@ReflectiveTestCase()
+@reflectiveTest
class CompletionTest extends AbstractAnalysisTest {
String completionId;
int completionOffset;
@@ -261,7 +262,7 @@
}
void assertHasResult(CompletionSuggestionKind kind, String completion,
- [CompletionRelevance relevance = CompletionRelevance.DEFAULT, bool isDeprecated
+ [int relevance = COMPLETION_RELEVANCE_DEFAULT, bool isDeprecated
= false, bool isPotential = false]) {
var cs;
suggestions.forEach((s) {
@@ -444,11 +445,11 @@
assertHasResult(
CompletionSuggestionKind.KEYWORD,
'import',
- CompletionRelevance.HIGH);
+ COMPLETION_RELEVANCE_HIGH);
assertHasResult(
CompletionSuggestionKind.KEYWORD,
'class',
- CompletionRelevance.HIGH);
+ COMPLETION_RELEVANCE_HIGH);
});
}
diff --git a/pkg/analysis_server/test/edit/assists_test.dart b/pkg/analysis_server/test/edit/assists_test.dart
index 152ebbb..190d165 100644
--- a/pkg/analysis_server/test/edit/assists_test.dart
+++ b/pkg/analysis_server/test/edit/assists_test.dart
@@ -20,7 +20,7 @@
}
-@ReflectiveTestCase()
+@reflectiveTest
class AssistsTest extends AbstractAnalysisTest {
List<SourceChange> changes;
diff --git a/pkg/analysis_server/test/edit/fixes_test.dart b/pkg/analysis_server/test/edit/fixes_test.dart
index be666fe..2fd66e9 100644
--- a/pkg/analysis_server/test/edit/fixes_test.dart
+++ b/pkg/analysis_server/test/edit/fixes_test.dart
@@ -20,7 +20,7 @@
}
-@ReflectiveTestCase()
+@reflectiveTest
class FixesTest extends AbstractAnalysisTest {
@override
void setUp() {
diff --git a/pkg/analysis_server/test/edit/format_test.dart b/pkg/analysis_server/test/edit/format_test.dart
new file mode 100644
index 0000000..b61d378
--- /dev/null
+++ b/pkg/analysis_server/test/edit/format_test.dart
@@ -0,0 +1,77 @@
+// 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.edit.format;
+
+import 'dart:async';
+
+import 'package:analysis_server/src/edit/edit_domain.dart';
+import 'package:analysis_server/src/protocol.dart';
+import 'package:unittest/unittest.dart' hide ERROR;
+
+import '../analysis_abstract.dart';
+import '../reflective_tests.dart';
+
+
+main() {
+ groupSep = ' | ';
+ runReflectiveTests(FormatTest);
+}
+
+
+@reflectiveTest
+class FormatTest extends AbstractAnalysisTest {
+ @override
+ void setUp() {
+ super.setUp();
+ createProject();
+ handler = new EditDomainHandler(server);
+ }
+
+ Future test_formatSimple() {
+ addTestFile('''
+main() { int x = 3; }
+''');
+ return waitForTasksFinished().then((_) {
+
+ EditFormatResult formatResult = _formatAt(0, 3);
+
+ 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(3));
+ });
+ }
+
+ 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));
+ });
+ }
+
+ EditFormatResult _formatAt(int selectionOffset, int selectionLength) {
+ Request request = new EditFormatParams(
+ testFile,
+ selectionOffset,
+ selectionLength).toRequest('0');
+ Response response = handleSuccessfulRequest(request);
+ return new EditFormatResult.fromResponse(response);
+ }
+
+}
diff --git a/pkg/analysis_server/test/edit/refactoring_test.dart b/pkg/analysis_server/test/edit/refactoring_test.dart
index 9f4fa11..1de0f55 100644
--- a/pkg/analysis_server/test/edit/refactoring_test.dart
+++ b/pkg/analysis_server/test/edit/refactoring_test.dart
@@ -30,7 +30,7 @@
}
-@ReflectiveTestCase()
+@reflectiveTest
class ConvertGetterMethodToMethodTest extends _AbstractGetRefactoring_Test {
test_function() {
addTestFile('''
@@ -126,7 +126,7 @@
}
-@ReflectiveTestCase()
+@reflectiveTest
class ConvertMethodToGetterTest extends _AbstractGetRefactoring_Test {
test_function() {
addTestFile('''
@@ -240,7 +240,7 @@
}
-@ReflectiveTestCase()
+@reflectiveTest
class ExtractLocalVariableTest extends _AbstractGetRefactoring_Test {
Future<Response> sendExtractRequest(int offset, int length, String name,
bool extractAll) {
@@ -411,7 +411,7 @@
}
-@ReflectiveTestCase()
+@reflectiveTest
class ExtractMethodTest extends _AbstractGetRefactoring_Test {
int offset;
int length;
@@ -624,7 +624,7 @@
}
-@ReflectiveTestCase()
+@reflectiveTest
class GetAvailableRefactoringsTest extends AbstractAnalysisTest {
/**
* Tests that there is a RENAME refactoring available at the [search] offset.
@@ -805,7 +805,7 @@
}
-@ReflectiveTestCase()
+@reflectiveTest
class InlineLocalTest extends _AbstractGetRefactoring_Test {
test_feedback() {
addTestFile('''
@@ -867,7 +867,7 @@
}
-@ReflectiveTestCase()
+@reflectiveTest
class InlineMethodTest extends _AbstractGetRefactoring_Test {
InlineMethodOptions options = new InlineMethodOptions(true, true);
@@ -994,7 +994,7 @@
}
-@ReflectiveTestCase()
+@reflectiveTest
class MoveFileTest extends _AbstractGetRefactoring_Test {
MoveFileOptions options = new MoveFileOptions(null);
@@ -1026,7 +1026,7 @@
}
-@ReflectiveTestCase()
+@reflectiveTest
class RenameTest extends _AbstractGetRefactoring_Test {
Future<Response> sendRenameRequest(String search, String newName,
[bool validateOnly = false]) {
@@ -1580,7 +1580,7 @@
}
-@ReflectiveTestCase()
+@reflectiveTest
class _AbstractGetRefactoring_Test extends AbstractAnalysisTest {
/**
* Asserts that [problems] has a single ERROR problem.
diff --git a/pkg/analysis_server/test/edit/sort_members_test.dart b/pkg/analysis_server/test/edit/sort_members_test.dart
index 48aea78..5e0756e 100644
--- a/pkg/analysis_server/test/edit/sort_members_test.dart
+++ b/pkg/analysis_server/test/edit/sort_members_test.dart
@@ -21,7 +21,7 @@
}
-@ReflectiveTestCase()
+@reflectiveTest
class SortMembersTest extends AbstractAnalysisTest {
SourceFileEdit fileEdit;
diff --git a/pkg/analysis_server/test/edit/test_all.dart b/pkg/analysis_server/test/edit/test_all.dart
index a109570..40e83f1 100644
--- a/pkg/analysis_server/test/edit/test_all.dart
+++ b/pkg/analysis_server/test/edit/test_all.dart
@@ -8,6 +8,7 @@
import 'assists_test.dart' as assists_test;
import 'fixes_test.dart' as fixes_test;
+import 'format_test.dart' as format_test;
import 'refactoring_test.dart' as refactoring_test;
import 'sort_members_test.dart' as sort_members_test;
@@ -19,6 +20,7 @@
group('edit', () {
assists_test.main();
fixes_test.main();
+ format_test.main();
refactoring_test.main();
sort_members_test.main();
});
diff --git a/pkg/analysis_server/test/integration/analysis/error_test.dart b/pkg/analysis_server/test/integration/analysis/error_test.dart
index cee4dfc..1a067f4 100644
--- a/pkg/analysis_server/test/integration/analysis/error_test.dart
+++ b/pkg/analysis_server/test/integration/analysis/error_test.dart
@@ -14,7 +14,7 @@
runReflectiveTests(AnalysisErrorIntegrationTest);
}
-@ReflectiveTestCase()
+@reflectiveTest
class AnalysisErrorIntegrationTest extends AbstractAnalysisServerIntegrationTest
{
test_detect_simple_error() {
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 6fc12f4..6a1a582 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
@@ -11,7 +11,7 @@
runReflectiveTests(Test);
}
-@ReflectiveTestCase()
+@reflectiveTest
class Test extends AnalysisDomainGetErrorsTest {
Test() : super(true);
}
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 52e6a91..a0920ca 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
@@ -11,7 +11,7 @@
runReflectiveTests(Test);
}
-@ReflectiveTestCase()
+@reflectiveTest
class Test extends AnalysisDomainGetErrorsTest {
Test() : super(false);
}
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 0356b81..965a37f 100644
--- a/pkg/analysis_server/test/integration/analysis/get_hover_test.dart
+++ b/pkg/analysis_server/test/integration/analysis/get_hover_test.dart
@@ -17,7 +17,7 @@
runReflectiveTests(AnalysisGetHoverIntegrationTest);
}
-@ReflectiveTestCase()
+@reflectiveTest
class AnalysisGetHoverIntegrationTest extends
AbstractAnalysisServerIntegrationTest {
/**
diff --git a/pkg/analysis_server/test/integration/analysis/highlights_test.dart b/pkg/analysis_server/test/integration/analysis/highlights_test.dart
index ba7bc77..f588501 100644
--- a/pkg/analysis_server/test/integration/analysis/highlights_test.dart
+++ b/pkg/analysis_server/test/integration/analysis/highlights_test.dart
@@ -14,7 +14,7 @@
runReflectiveTests(AnalysisHighlightsTest);
}
-@ReflectiveTestCase()
+@reflectiveTest
class AnalysisHighlightsTest extends AbstractAnalysisServerIntegrationTest {
test_highlights() {
String pathname = sourcePath('test.dart');
diff --git a/pkg/analysis_server/test/integration/analysis/navigation_test.dart b/pkg/analysis_server/test/integration/analysis/navigation_test.dart
index 17d3633..e22e83e 100644
--- a/pkg/analysis_server/test/integration/analysis/navigation_test.dart
+++ b/pkg/analysis_server/test/integration/analysis/navigation_test.dart
@@ -14,7 +14,7 @@
runReflectiveTests(AnalysisNavigationTest);
}
-@ReflectiveTestCase()
+@reflectiveTest
class AnalysisNavigationTest extends AbstractAnalysisServerIntegrationTest {
test_navigation() {
String pathname1 = sourcePath('test1.dart');
diff --git a/pkg/analysis_server/test/integration/analysis/occurrences_test.dart b/pkg/analysis_server/test/integration/analysis/occurrences_test.dart
index 826b061..1be1784 100644
--- a/pkg/analysis_server/test/integration/analysis/occurrences_test.dart
+++ b/pkg/analysis_server/test/integration/analysis/occurrences_test.dart
@@ -14,7 +14,7 @@
runReflectiveTests(Test);
}
-@ReflectiveTestCase()
+@reflectiveTest
class Test extends AbstractAnalysisServerIntegrationTest {
test_occurrences() {
String pathname = sourcePath('test.dart');
diff --git a/pkg/analysis_server/test/integration/analysis/outline_test.dart b/pkg/analysis_server/test/integration/analysis/outline_test.dart
index 3597835..4a0adea 100644
--- a/pkg/analysis_server/test/integration/analysis/outline_test.dart
+++ b/pkg/analysis_server/test/integration/analysis/outline_test.dart
@@ -14,7 +14,7 @@
runReflectiveTests(Test);
}
-@ReflectiveTestCase()
+@reflectiveTest
class Test extends AbstractAnalysisServerIntegrationTest {
/**
* Verify that the range of source text covered by the given outline objects
diff --git a/pkg/analysis_server/test/integration/analysis/overrides_test.dart b/pkg/analysis_server/test/integration/analysis/overrides_test.dart
index 05ede74..4c28d7f 100644
--- a/pkg/analysis_server/test/integration/analysis/overrides_test.dart
+++ b/pkg/analysis_server/test/integration/analysis/overrides_test.dart
@@ -14,7 +14,7 @@
runReflectiveTests(Test);
}
-@ReflectiveTestCase()
+@reflectiveTest
class Test extends AbstractAnalysisServerIntegrationTest {
test_overrides() {
String pathname = sourcePath('test.dart');
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 c101417..964e533 100644
--- a/pkg/analysis_server/test/integration/analysis/package_root_test.dart
+++ b/pkg/analysis_server/test/integration/analysis/package_root_test.dart
@@ -15,7 +15,7 @@
runReflectiveTests(Test);
}
-@ReflectiveTestCase()
+@reflectiveTest
class Test extends AbstractAnalysisServerIntegrationTest {
test_package_root() {
String projPath = sourcePath('project');
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 25e8a4c..242ed66 100644
--- a/pkg/analysis_server/test/integration/analysis/reanalyze_concurrent_test.dart
+++ b/pkg/analysis_server/test/integration/analysis/reanalyze_concurrent_test.dart
@@ -19,7 +19,7 @@
runReflectiveTests(Test);
}
-@ReflectiveTestCase()
+@reflectiveTest
class Test extends AbstractAnalysisServerIntegrationTest {
test_reanalyze_concurrent() {
String pathname = sourcePath('test.dart');
diff --git a/pkg/analysis_server/test/integration/analysis/reanalyze_test.dart b/pkg/analysis_server/test/integration/analysis/reanalyze_test.dart
index 88c7b80..59df3ed 100644
--- a/pkg/analysis_server/test/integration/analysis/reanalyze_test.dart
+++ b/pkg/analysis_server/test/integration/analysis/reanalyze_test.dart
@@ -14,7 +14,7 @@
runReflectiveTests(Test);
}
-@ReflectiveTestCase()
+@reflectiveTest
class Test extends AbstractAnalysisServerIntegrationTest {
test_reanalyze() {
String pathname = sourcePath('test.dart');
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 d91a5b0..7a8f10b 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
@@ -14,7 +14,7 @@
runReflectiveTests(Test);
}
-@ReflectiveTestCase()
+@reflectiveTest
class Test extends AbstractAnalysisServerIntegrationTest {
test_updateContent_list() {
String pathname = sourcePath('test.dart');
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 ec6d696..169c42b 100644
--- a/pkg/analysis_server/test/integration/analysis/update_content_test.dart
+++ b/pkg/analysis_server/test/integration/analysis/update_content_test.dart
@@ -14,7 +14,7 @@
runReflectiveTests(Test);
}
-@ReflectiveTestCase()
+@reflectiveTest
class Test extends AbstractAnalysisServerIntegrationTest {
test_updateContent() {
String pathname = sourcePath('test.dart');
diff --git a/pkg/analysis_server/test/integration/asynchrony_test.dart b/pkg/analysis_server/test/integration/asynchrony_test.dart
index 0194fac..ad4cd07 100644
--- a/pkg/analysis_server/test/integration/asynchrony_test.dart
+++ b/pkg/analysis_server/test/integration/asynchrony_test.dart
@@ -24,7 +24,7 @@
* Once enough commands have been sent, we begin reading from the server's
* output buffer, and verify that it responds to the last command.
*/
-@ReflectiveTestCase()
+@reflectiveTest
class AsynchronyIntegrationTest {
/**
* Number of messages to queue up before listening for responses.
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 0c28360..d0ee85e 100644
--- a/pkg/analysis_server/test/integration/completion/get_suggestions_test.dart
+++ b/pkg/analysis_server/test/integration/completion/get_suggestions_test.dart
@@ -15,7 +15,7 @@
runReflectiveTests(Test);
}
-@ReflectiveTestCase()
+@reflectiveTest
class Test extends AbstractAnalysisServerIntegrationTest {
fail_test_getSuggestions_string_var() {
// See dartbug.com/20188
diff --git a/pkg/analysis_server/test/integration/integration_test_methods.dart b/pkg/analysis_server/test/integration/integration_test_methods.dart
index 1d91b21..db72218 100644
--- a/pkg/analysis_server/test/integration/integration_test_methods.dart
+++ b/pkg/analysis_server/test/integration/integration_test_methods.dart
@@ -1018,6 +1018,11 @@
* the original as possible, but whitespace at the beginning or end of the
* selected region will be ignored.
*
+ * 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.
+ *
* Parameters
*
* file ( FilePath )
diff --git a/pkg/analysis_server/test/integration/protocol_matchers.dart b/pkg/analysis_server/test/integration/protocol_matchers.dart
index e348826..32970af3 100644
--- a/pkg/analysis_server/test/integration/protocol_matchers.dart
+++ b/pkg/analysis_server/test/integration/protocol_matchers.dart
@@ -957,11 +957,10 @@
* AnalysisErrorType
*
* enum {
- * ANGULAR
* CHECKED_MODE_COMPILE_TIME_ERROR
* COMPILE_TIME_ERROR
* HINT
- * POLYMER
+ * LINT
* STATIC_TYPE_WARNING
* STATIC_WARNING
* SYNTACTIC_ERROR
@@ -969,11 +968,10 @@
* }
*/
final Matcher isAnalysisErrorType = new MatchesEnum("AnalysisErrorType", [
- "ANGULAR",
"CHECKED_MODE_COMPILE_TIME_ERROR",
"COMPILE_TIME_ERROR",
"HINT",
- "POLYMER",
+ "LINT",
"STATIC_TYPE_WARNING",
"STATIC_WARNING",
"SYNTACTIC_ERROR",
@@ -989,6 +987,7 @@
* "enableEnums": optional bool
* "generateDart2jsHints": optional bool
* "generateHints": optional bool
+ * "generateLints": optional bool
* }
*/
final Matcher isAnalysisOptions = new LazyMatcher(() => new MatchesJsonObject(
@@ -997,7 +996,8 @@
"enableDeferredLoading": isBool,
"enableEnums": isBool,
"generateDart2jsHints": isBool,
- "generateHints": isBool
+ "generateHints": isBool,
+ "generateLints": isBool
}));
/**
@@ -1060,26 +1060,11 @@
final Matcher isCompletionId = isString;
/**
- * CompletionRelevance
- *
- * enum {
- * LOW
- * DEFAULT
- * HIGH
- * }
- */
-final Matcher isCompletionRelevance = new MatchesEnum("CompletionRelevance", [
- "LOW",
- "DEFAULT",
- "HIGH"
-]);
-
-/**
* CompletionSuggestion
*
* {
* "kind": CompletionSuggestionKind
- * "relevance": CompletionRelevance
+ * "relevance": int
* "completion": String
* "selectionOffset": int
* "selectionLength": int
@@ -1101,7 +1086,7 @@
final Matcher isCompletionSuggestion = new LazyMatcher(() => new MatchesJsonObject(
"CompletionSuggestion", {
"kind": isCompletionSuggestionKind,
- "relevance": isCompletionRelevance,
+ "relevance": isInt,
"completion": isString,
"selectionOffset": isInt,
"selectionLength": isInt,
@@ -1789,6 +1774,7 @@
*
* enum {
* CONTENT_MODIFIED
+ * FORMAT_INVALID_FILE
* GET_ERRORS_INVALID_FILE
* INVALID_OVERLAY_CHANGE
* INVALID_PARAMETER
@@ -1804,6 +1790,7 @@
*/
final Matcher isRequestErrorCode = new MatchesEnum("RequestErrorCode", [
"CONTENT_MODIFIED",
+ "FORMAT_INVALID_FILE",
"GET_ERRORS_INVALID_FILE",
"INVALID_OVERLAY_CHANGE",
"INVALID_PARAMETER",
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 3b2c087..7838290 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
@@ -61,7 +61,7 @@
}
}
-@ReflectiveTestCase()
+@reflectiveTest
class Test extends AbstractAnalysisServerIntegrationTest {
/**
* Pathname of the main file to run tests in.
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 61dcfe5..779aff1 100644
--- a/pkg/analysis_server/test/integration/server/get_version_test.dart
+++ b/pkg/analysis_server/test/integration/server/get_version_test.dart
@@ -11,7 +11,7 @@
runReflectiveTests(Test);
}
-@ReflectiveTestCase()
+@reflectiveTest
class Test extends AbstractAnalysisServerIntegrationTest {
test_getVersion() {
return sendServerGetVersion();
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 d3d9890..4804ea1 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
@@ -13,7 +13,7 @@
runReflectiveTests(Test);
}
-@ReflectiveTestCase()
+@reflectiveTest
class Test extends AbstractAnalysisServerIntegrationTest {
test_setSubscriptions_invalidService() {
// TODO(paulberry): verify that if an invalid service is specified, the
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 56be8b5..55c740a 100644
--- a/pkg/analysis_server/test/integration/server/set_subscriptions_test.dart
+++ b/pkg/analysis_server/test/integration/server/set_subscriptions_test.dart
@@ -16,7 +16,7 @@
runReflectiveTests(Test);
}
-@ReflectiveTestCase()
+@reflectiveTest
class Test extends AbstractAnalysisServerIntegrationTest {
test_setSubscriptions() {
bool statusReceived = false;
diff --git a/pkg/analysis_server/test/integration/server/shutdown_test.dart b/pkg/analysis_server/test/integration/server/shutdown_test.dart
index ab556b7..09c4fe4 100644
--- a/pkg/analysis_server/test/integration/server/shutdown_test.dart
+++ b/pkg/analysis_server/test/integration/server/shutdown_test.dart
@@ -15,7 +15,7 @@
runReflectiveTests(Test);
}
-@ReflectiveTestCase()
+@reflectiveTest
class Test extends AbstractAnalysisServerIntegrationTest {
test_shutdown() {
return sendServerShutdown().then((_) {
diff --git a/pkg/analysis_server/test/integration/server/status_test.dart b/pkg/analysis_server/test/integration/server/status_test.dart
index 85c9fb3..4b1b86e 100644
--- a/pkg/analysis_server/test/integration/server/status_test.dart
+++ b/pkg/analysis_server/test/integration/server/status_test.dart
@@ -16,7 +16,7 @@
runReflectiveTests(Test);
}
-@ReflectiveTestCase()
+@reflectiveTest
class Test extends AbstractAnalysisServerIntegrationTest {
test_status() {
// After we kick off analysis, we should get one server.status message with
diff --git a/pkg/analysis_server/test/mocks.dart b/pkg/analysis_server/test/mocks.dart
index 003ea4c..49c2d03 100644
--- a/pkg/analysis_server/test/mocks.dart
+++ b/pkg/analysis_server/test/mocks.dart
@@ -14,7 +14,6 @@
import 'package:analysis_server/src/operation/operation.dart';
import 'package:analysis_server/src/operation/operation_analysis.dart';
import 'package:analysis_server/src/protocol.dart' hide Element, ElementKind;
-import 'package:analysis_server/src/services/index/index.dart';
import 'package:analyzer/file_system/file_system.dart' as resource;
import 'package:analyzer/file_system/memory_file_system.dart' as resource;
import 'package:analyzer/source/package_map_provider.dart';
@@ -331,7 +330,7 @@
}
@override
- void updateIndex(Index index, List<ChangeNotice> notices) {
+ void updateIndex(AnalysisServer server, List<ChangeNotice> notices) {
}
}
diff --git a/pkg/analysis_server/test/operation/test_all.dart b/pkg/analysis_server/test/operation/test_all.dart
index 7df43c4..ca3c425 100644
--- a/pkg/analysis_server/test/operation/test_all.dart
+++ b/pkg/analysis_server/test/operation/test_all.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.
+library test.operation.all;
+
import 'package:unittest/unittest.dart';
import 'operation_queue_test.dart' as operation_queue_test;
diff --git a/pkg/analysis_server/test/plugin/plugin_impl_test.dart b/pkg/analysis_server/test/plugin/plugin_impl_test.dart
new file mode 100644
index 0000000..779c2ca
--- /dev/null
+++ b/pkg/analysis_server/test/plugin/plugin_impl_test.dart
@@ -0,0 +1,183 @@
+// 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:analysis_server/plugin/plugin.dart';
+import 'package:analysis_server/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/analysis_server/test/plugin/test_all.dart b/pkg/analysis_server/test/plugin/test_all.dart
new file mode 100644
index 0000000..e8b0ce3
--- /dev/null
+++ b/pkg/analysis_server/test/plugin/test_all.dart
@@ -0,0 +1,19 @@
+// 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/analysis_server/test/protocol_server_test.dart b/pkg/analysis_server/test/protocol_server_test.dart
index 1de407e..f806f50 100644
--- a/pkg/analysis_server/test/protocol_server_test.dart
+++ b/pkg/analysis_server/test/protocol_server_test.dart
@@ -36,7 +36,7 @@
}
-@ReflectiveTestCase()
+@reflectiveTest
class AnalysisErrorTest {
engine.Source source = new MockSource();
engine.LineInfo lineInfo;
@@ -115,7 +115,7 @@
}
-@ReflectiveTestCase()
+@reflectiveTest
class ElementKindTest {
void test_fromEngine() {
expect(
@@ -163,9 +163,6 @@
expect(
newElementKind_fromEngine(engine.ElementKind.TYPE_PARAMETER),
ElementKind.TYPE_PARAMETER);
- expect(
- newElementKind_fromEngine(engine.ElementKind.ANGULAR_COMPONENT),
- ElementKind.UNKNOWN);
}
void test_string_constructor() {
@@ -219,7 +216,7 @@
}
-@ReflectiveTestCase()
+@reflectiveTest
class ElementTest extends AbstractContextTest {
engine.Element findElementInUnit(engine.CompilationUnit unit, String name,
[engine.ElementKind kind]) {
@@ -307,10 +304,33 @@
expect(location.startColumn, 16);
}
expect(element.parameters, isNull);
- expect(element.returnType, isNull);
+ expect(element.returnType, 'dynamic');
expect(element.flags, Element.FLAG_CONST | Element.FLAG_STATIC);
}
+ void test_fromElement_FUNCTION_TYPE_ALIAS() {
+ engine.Source source = addSource('/test.dart', '''
+typedef int f(String x);
+''');
+ engine.CompilationUnit unit = resolveLibraryUnit(source);
+ engine.FunctionTypeAliasElement engineElement = findElementInUnit(unit, 'f');
+ // create notification Element
+ Element element = newElement_fromEngine(engineElement);
+ expect(element.kind, ElementKind.FUNCTION_TYPE_ALIAS);
+ expect(element.name, 'f');
+ {
+ Location location = element.location;
+ expect(location.file, '/test.dart');
+ expect(location.offset, 12);
+ expect(location.length, 'f'.length);
+ expect(location.startLine, 1);
+ expect(location.startColumn, 13);
+ }
+ expect(element.parameters, '(String x)');
+ expect(element.returnType, 'int');
+ expect(element.flags, 0);
+ }
+
void test_fromElement_GETTER() {
engine.Source source = addSource('/test.dart', '''
class A {
@@ -416,7 +436,7 @@
}
}
-@ReflectiveTestCase()
+@reflectiveTest
class EnumTest {
void test_AnalysisErrorSeverity() {
new EnumTester<engine.ErrorSeverity, AnalysisErrorSeverity>().run(
@@ -438,14 +458,6 @@
newElementKind_fromEngine,
exceptions: {
// TODO(paulberry): do any of the exceptions below constitute bugs?
- engine.ElementKind.ANGULAR_FORMATTER: ElementKind.UNKNOWN,
- engine.ElementKind.ANGULAR_COMPONENT: ElementKind.UNKNOWN,
- engine.ElementKind.ANGULAR_CONTROLLER: ElementKind.UNKNOWN,
- engine.ElementKind.ANGULAR_DIRECTIVE: ElementKind.UNKNOWN,
- engine.ElementKind.ANGULAR_PROPERTY: ElementKind.UNKNOWN,
- engine.ElementKind.ANGULAR_SCOPE_PROPERTY: ElementKind.UNKNOWN,
- engine.ElementKind.ANGULAR_SELECTOR: ElementKind.UNKNOWN,
- engine.ElementKind.ANGULAR_VIEW: ElementKind.UNKNOWN,
engine.ElementKind.DYNAMIC: ElementKind.UNKNOWN,
engine.ElementKind.EMBEDDED_HTML_SCRIPT: ElementKind.UNKNOWN,
engine.ElementKind.ERROR: ElementKind.UNKNOWN,
@@ -454,9 +466,6 @@
engine.ElementKind.HTML: ElementKind.UNKNOWN,
engine.ElementKind.IMPORT: ElementKind.UNKNOWN,
engine.ElementKind.NAME: ElementKind.UNKNOWN,
- engine.ElementKind.POLYMER_ATTRIBUTE: ElementKind.UNKNOWN,
- engine.ElementKind.POLYMER_TAG_DART: ElementKind.UNKNOWN,
- engine.ElementKind.POLYMER_TAG_HTML: ElementKind.UNKNOWN,
engine.ElementKind.UNIVERSE: ElementKind.UNKNOWN
});
}
@@ -465,12 +474,7 @@
// TODO(paulberry): why does the MatchKind class exist at all? Can't we
// use SearchResultKind inside the analysis server?
new EnumTester<MatchKind, SearchResultKind>().run(
- newSearchResultKind_fromEngine,
- exceptions: {
- // TODO(paulberry): do any of the exceptions below constitute bugs?
- MatchKind.ANGULAR_REFERENCE: SearchResultKind.UNKNOWN,
- MatchKind.ANGULAR_CLOSING_TAG_REFERENCE: SearchResultKind.UNKNOWN
- });
+ newSearchResultKind_fromEngine);
}
}
diff --git a/pkg/analysis_server/test/protocol_test.dart b/pkg/analysis_server/test/protocol_test.dart
index 189d871..e4bcb21 100644
--- a/pkg/analysis_server/test/protocol_test.dart
+++ b/pkg/analysis_server/test/protocol_test.dart
@@ -25,7 +25,7 @@
}
-@ReflectiveTestCase()
+@reflectiveTest
class InvalidParameterResponseMatcher extends Matcher {
static const String ERROR_CODE = 'INVALID_PARAMETER';
@@ -54,7 +54,7 @@
}
-@ReflectiveTestCase()
+@reflectiveTest
class NotificationTest {
void test_fromJson() {
Notification original = new Notification('foo');
@@ -101,7 +101,7 @@
}
-@ReflectiveTestCase()
+@reflectiveTest
class RequestErrorTest {
void test_create() {
RequestError error =
@@ -141,7 +141,7 @@
}
-@ReflectiveTestCase()
+@reflectiveTest
class RequestTest {
void test_fromJson() {
Request original = new Request('one', 'aMethod');
@@ -207,7 +207,7 @@
}
-@ReflectiveTestCase()
+@reflectiveTest
class ResponseTest {
void test_create_invalidRequestFormat() {
Response response = new Response.invalidRequestFormat();
diff --git a/pkg/analysis_server/test/reflective_tests.dart b/pkg/analysis_server/test/reflective_tests.dart
index 2730680..80c9073 100644
--- a/pkg/analysis_server/test/reflective_tests.dart
+++ b/pkg/analysis_server/test/reflective_tests.dart
@@ -4,7 +4,7 @@
library reflective_tests;
-@MirrorsUsed(metaTargets: 'ReflectiveTestCase')
+@MirrorsUsed(metaTargets: 'ReflectiveTest')
import 'dart:mirrors';
import 'dart:async';
@@ -31,10 +31,10 @@
ClassMirror classMirror = reflectClass(type);
if (!classMirror.metadata.any(
(InstanceMirror annotation) =>
- annotation.type.reflectedType == ReflectiveTestCase)) {
+ annotation.type.reflectedType == ReflectiveTest)) {
String name = MirrorSystem.getName(classMirror.qualifiedName);
throw new Exception(
- 'Class $name must have annotation "@ReflectiveTestCase()" '
+ 'Class $name must have annotation "@reflectiveTest" '
'in order to be run by runReflectiveTests.');
}
String className = MirrorSystem.getName(classMirror.simpleName);
@@ -124,6 +124,12 @@
* A marker annotation used to instruct dart2js to keep reflection information
* for the annotated classes.
*/
-class ReflectiveTestCase {
- const ReflectiveTestCase();
+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 8c67fc9..8081178 100644
--- a/pkg/analysis_server/test/search/element_references_test.dart
+++ b/pkg/analysis_server/test/search/element_references_test.dart
@@ -19,7 +19,7 @@
}
-@ReflectiveTestCase()
+@reflectiveTest
class ElementReferencesTest extends AbstractSearchDomainTest {
Element searchElement;
@@ -40,6 +40,7 @@
searchId = result.id;
searchElement = result.element;
results.clear();
+ searchDone = false;
if (searchId == null) {
return null;
} else {
@@ -189,22 +190,21 @@
a.fff = 10;
}
''');
- var forGetter = findElementReferences('fff =>', false).then((_) {
+ return findElementReferences('fff =>', false).then((_) {
expect(searchElement.kind, ElementKind.FIELD);
expect(results, hasLength(4));
assertHasResult(SearchResultKind.READ, 'fff); // in m()');
assertHasResult(SearchResultKind.WRITE, 'fff = 1;');
assertHasResult(SearchResultKind.READ, 'fff); // in main()');
assertHasResult(SearchResultKind.WRITE, 'fff = 10;');
- });
- var forSetter = findElementReferences('fff(x) {}', false).then((_) {
+ return findElementReferences('fff(x) {}', false);
+ }).then((_) {
expect(results, hasLength(4));
assertHasResult(SearchResultKind.READ, 'fff); // in m()');
assertHasResult(SearchResultKind.WRITE, 'fff = 1;');
assertHasResult(SearchResultKind.READ, 'fff); // in main()');
assertHasResult(SearchResultKind.WRITE, 'fff = 10;');
});
- return Future.wait([forGetter, forSetter]);
}
test_field_inFormalParameter() {
@@ -678,18 +678,17 @@
vvv = 1;
}
''');
- var forGetter = findElementReferences('vvv =>', false).then((_) {
+ return findElementReferences('vvv =>', false).then((_) {
expect(searchElement.kind, ElementKind.TOP_LEVEL_VARIABLE);
expect(results, hasLength(2));
assertHasResult(SearchResultKind.READ, 'vvv);');
assertHasResult(SearchResultKind.WRITE, 'vvv = 1;');
- });
- var forSetter = findElementReferences('vvv(x) {}', false).then((_) {
+ return findElementReferences('vvv(x) {}', false);
+ }).then((_) {
expect(results, hasLength(2));
assertHasResult(SearchResultKind.READ, 'vvv);');
assertHasResult(SearchResultKind.WRITE, 'vvv = 1;');
});
- return Future.wait([forGetter, forSetter]);
}
test_typeReference_class() {
diff --git a/pkg/analysis_server/test/search/member_declarations_test.dart b/pkg/analysis_server/test/search/member_declarations_test.dart
index d38a7ac..2fb7946 100644
--- a/pkg/analysis_server/test/search/member_declarations_test.dart
+++ b/pkg/analysis_server/test/search/member_declarations_test.dart
@@ -19,7 +19,7 @@
}
-@ReflectiveTestCase()
+@reflectiveTest
class MemberDeclarationsTest extends AbstractSearchDomainTest {
void assertHasDeclaration(ElementKind kind, String className) {
result = findTopLevelResult(kind, className);
diff --git a/pkg/analysis_server/test/search/member_references_test.dart b/pkg/analysis_server/test/search/member_references_test.dart
index b9b1ef14..e2d1caa 100644
--- a/pkg/analysis_server/test/search/member_references_test.dart
+++ b/pkg/analysis_server/test/search/member_references_test.dart
@@ -19,7 +19,7 @@
}
-@ReflectiveTestCase()
+@reflectiveTest
class MemberReferencesTest extends AbstractSearchDomainTest {
void assertHasRef(SearchResultKind kind, String search, bool isPotential) {
assertHasResult(kind, search);
diff --git a/pkg/analysis_server/test/search/search_result_test.dart b/pkg/analysis_server/test/search/search_result_test.dart
index f64b68e..74dc0d5 100644
--- a/pkg/analysis_server/test/search/search_result_test.dart
+++ b/pkg/analysis_server/test/search/search_result_test.dart
@@ -17,7 +17,7 @@
}
-@ReflectiveTestCase()
+@reflectiveTest
class SearchResultKindTest {
void test_fromEngine() {
expect(
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 df4929b..26ec55a 100644
--- a/pkg/analysis_server/test/search/top_level_declarations_test.dart
+++ b/pkg/analysis_server/test/search/top_level_declarations_test.dart
@@ -19,7 +19,7 @@
}
-@ReflectiveTestCase()
+@reflectiveTest
class TopLevelDeclarationsTest extends AbstractSearchDomainTest {
void assertHasDeclaration(ElementKind kind, String name) {
result = findTopLevelResult(kind, name);
diff --git a/pkg/analysis_server/test/search/type_hierarchy_test.dart b/pkg/analysis_server/test/search/type_hierarchy_test.dart
index d598a01..c2d2bad 100644
--- a/pkg/analysis_server/test/search/type_hierarchy_test.dart
+++ b/pkg/analysis_server/test/search/type_hierarchy_test.dart
@@ -22,7 +22,7 @@
}
-@ReflectiveTestCase()
+@reflectiveTest
class GetTypeHierarchyTest extends AbstractAnalysisTest {
static const String requestId = 'test-getTypeHierarchy';
diff --git a/pkg/analysis_server/test/services/completion/arglist_computer_test.dart b/pkg/analysis_server/test/services/completion/arglist_computer_test.dart
index 9eb0635..d200d08 100644
--- a/pkg/analysis_server/test/services/completion/arglist_computer_test.dart
+++ b/pkg/analysis_server/test/services/completion/arglist_computer_test.dart
@@ -16,7 +16,7 @@
runReflectiveTests(ArgListComputerTest);
}
-@ReflectiveTestCase()
+@reflectiveTest
class ArgListComputerTest extends AbstractCompletionTest {
@override
diff --git a/pkg/analysis_server/test/services/completion/combinator_computer_test.dart b/pkg/analysis_server/test/services/completion/combinator_computer_test.dart
index ffe483e..281a5fa 100644
--- a/pkg/analysis_server/test/services/completion/combinator_computer_test.dart
+++ b/pkg/analysis_server/test/services/completion/combinator_computer_test.dart
@@ -6,6 +6,7 @@
import 'package:analysis_server/src/protocol.dart';
import 'package:analysis_server/src/services/completion/combinator_computer.dart';
+import 'package:analysis_server/src/services/completion/dart_completion_manager.dart';
import 'package:unittest/unittest.dart';
import '../../reflective_tests.dart';
@@ -16,7 +17,7 @@
runReflectiveTests(CombinatorComputerTest);
}
-@ReflectiveTestCase()
+@reflectiveTest
class CombinatorComputerTest extends AbstractCompletionTest {
@override
@@ -61,26 +62,26 @@
return computeFull((bool result) {
assertSuggestClass(
'A',
- CompletionRelevance.DEFAULT,
+ COMPLETION_RELEVANCE_DEFAULT,
CompletionSuggestionKind.IDENTIFIER);
assertSuggestClass(
'B',
- CompletionRelevance.DEFAULT,
+ COMPLETION_RELEVANCE_DEFAULT,
CompletionSuggestionKind.IDENTIFIER);
assertSuggestClass(
'PB',
- CompletionRelevance.DEFAULT,
+ COMPLETION_RELEVANCE_DEFAULT,
CompletionSuggestionKind.IDENTIFIER);
assertSuggestTopLevelVar(
'T1',
null,
- CompletionRelevance.DEFAULT,
+ COMPLETION_RELEVANCE_DEFAULT,
CompletionSuggestionKind.IDENTIFIER);
assertSuggestFunction(
'F1',
'PB',
false,
- CompletionRelevance.DEFAULT,
+ COMPLETION_RELEVANCE_DEFAULT,
CompletionSuggestionKind.IDENTIFIER);
assertNotSuggested('C');
assertNotSuggested('D');
@@ -114,36 +115,36 @@
return computeFull((bool result) {
assertSuggestClass(
'A',
- CompletionRelevance.DEFAULT,
+ COMPLETION_RELEVANCE_DEFAULT,
CompletionSuggestionKind.IDENTIFIER);
assertSuggestClass(
'B',
- CompletionRelevance.DEFAULT,
+ COMPLETION_RELEVANCE_DEFAULT,
CompletionSuggestionKind.IDENTIFIER);
assertSuggestClass(
'PB',
- CompletionRelevance.DEFAULT,
+ COMPLETION_RELEVANCE_DEFAULT,
CompletionSuggestionKind.IDENTIFIER);
assertSuggestTopLevelVar(
'T1',
null,
- CompletionRelevance.DEFAULT,
+ COMPLETION_RELEVANCE_DEFAULT,
CompletionSuggestionKind.IDENTIFIER);
assertSuggestFunction(
'F1',
'PB',
false,
- CompletionRelevance.DEFAULT,
+ COMPLETION_RELEVANCE_DEFAULT,
CompletionSuggestionKind.IDENTIFIER);
assertSuggestClass(
'Clz',
- CompletionRelevance.DEFAULT,
+ COMPLETION_RELEVANCE_DEFAULT,
CompletionSuggestionKind.IDENTIFIER);
assertSuggestFunctionTypeAlias(
'F2',
null,
false,
- CompletionRelevance.DEFAULT,
+ COMPLETION_RELEVANCE_DEFAULT,
CompletionSuggestionKind.IDENTIFIER);
assertNotSuggested('C');
assertNotSuggested('D');
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 217a11d..f4f03ef 100644
--- a/pkg/analysis_server/test/services/completion/completion_computer_test.dart
+++ b/pkg/analysis_server/test/services/completion/completion_computer_test.dart
@@ -39,7 +39,7 @@
return new Future.delayed(Duration.ZERO, () => pumpEventQueue(times - 1));
}
-@ReflectiveTestCase()
+@reflectiveTest
class DartCompletionManagerTest extends AbstractSingleUnitTest {
Index index;
SearchEngineImpl searchEngine;
@@ -68,7 +68,7 @@
manager = new DartCompletionManager.create(context, searchEngine, source);
suggestion1 = new CompletionSuggestion(
CompletionSuggestionKind.INVOCATION,
- CompletionRelevance.DEFAULT,
+ COMPLETION_RELEVANCE_DEFAULT,
"suggestion1",
1,
1,
@@ -76,7 +76,7 @@
false);
suggestion2 = new CompletionSuggestion(
CompletionSuggestionKind.IDENTIFIER,
- CompletionRelevance.DEFAULT,
+ COMPLETION_RELEVANCE_DEFAULT,
"suggestion2",
2,
2,
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 fef6789..7981038 100644
--- a/pkg/analysis_server/test/services/completion/completion_manager_test.dart
+++ b/pkg/analysis_server/test/services/completion/completion_manager_test.dart
@@ -17,7 +17,7 @@
runReflectiveTests(CompletionManagerTest);
}
-@ReflectiveTestCase()
+@reflectiveTest
class CompletionManagerTest extends AbstractContextTest {
var perf = new CompletionPerformance();
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 2adf4a7..a6ce671 100644
--- a/pkg/analysis_server/test/services/completion/completion_test_util.dart
+++ b/pkg/analysis_server/test/services/completion/completion_test_util.dart
@@ -71,6 +71,13 @@
new CompletionPerformance());
}
+ void assertHasNoParameterInfo(CompletionSuggestion suggestion) {
+ expect(suggestion.parameterNames, isNull);
+ expect(suggestion.parameterTypes, isNull);
+ expect(suggestion.requiredParameterCount, isNull);
+ expect(suggestion.hasNamedParameters, isNull);
+ }
+
void assertNoSuggestions({CompletionSuggestionKind kind: null}) {
if (kind == null) {
if (request.suggestions.length > 0) {
@@ -98,17 +105,18 @@
CompletionSuggestion assertSuggest(String completion,
{CompletionSuggestionKind csKind: CompletionSuggestionKind.INVOCATION,
- CompletionRelevance relevance: CompletionRelevance.DEFAULT,
- protocol.ElementKind elemKind: null, bool isDeprecated: false, bool isPotential:
- false}) {
+ int relevance: COMPLETION_RELEVANCE_DEFAULT, protocol.ElementKind elemKind:
+ null, bool isDeprecated: false, bool isPotential: false}) {
CompletionSuggestion cs =
getSuggest(completion: completion, csKind: csKind, elemKind: elemKind);
if (cs == null) {
- failedCompletion('expected $completion $csKind', request.suggestions);
+ failedCompletion(
+ 'expected $completion $csKind $elemKind',
+ request.suggestions);
}
expect(cs.kind, equals(csKind));
if (isDeprecated) {
- expect(cs.relevance, equals(CompletionRelevance.LOW));
+ expect(cs.relevance, equals(COMPLETION_RELEVANCE_LOW));
} else {
expect(cs.relevance, equals(relevance));
}
@@ -131,7 +139,7 @@
paramTypes,
cs.parameterNames,
cs.parameterTypes);
- expect(cs.relevance, CompletionRelevance.HIGH);
+ expect(cs.relevance, COMPLETION_RELEVANCE_HIGH);
}
void assertSuggestArgumentList_params(List<String> expectedNames,
@@ -162,9 +170,9 @@
fail(msg.toString());
}
- CompletionSuggestion assertSuggestClass(String name,
- [CompletionRelevance relevance = CompletionRelevance.DEFAULT,
- CompletionSuggestionKind kind = CompletionSuggestionKind.INVOCATION]) {
+ CompletionSuggestion assertSuggestClass(String name, [int relevance =
+ COMPLETION_RELEVANCE_DEFAULT, CompletionSuggestionKind kind =
+ CompletionSuggestionKind.INVOCATION]) {
CompletionSuggestion cs =
assertSuggest(name, csKind: kind, relevance: relevance);
protocol.Element element = cs.element;
@@ -176,9 +184,9 @@
return cs;
}
- CompletionSuggestion assertSuggestClassTypeAlias(String name,
- [CompletionRelevance relevance = CompletionRelevance.DEFAULT,
- CompletionSuggestionKind kind = CompletionSuggestionKind.INVOCATION]) {
+ CompletionSuggestion assertSuggestClassTypeAlias(String name, [int relevance =
+ COMPLETION_RELEVANCE_DEFAULT, CompletionSuggestionKind kind =
+ CompletionSuggestionKind.INVOCATION]) {
CompletionSuggestion cs =
assertSuggest(name, csKind: kind, relevance: relevance);
protocol.Element element = cs.element;
@@ -190,15 +198,36 @@
return cs;
}
+ CompletionSuggestion assertSuggestField(String name, String type,
+ {int relevance: COMPLETION_RELEVANCE_DEFAULT, CompletionSuggestionKind kind:
+ CompletionSuggestionKind.INVOCATION, bool isDeprecated: false}) {
+ CompletionSuggestion cs = assertSuggest(
+ name,
+ csKind: kind,
+ relevance: relevance,
+ elemKind: protocol.ElementKind.FIELD,
+ isDeprecated: isDeprecated);
+ // The returnType represents the type of a field
+ expect(cs.returnType, type != null ? type : 'dynamic');
+ protocol.Element element = cs.element;
+ expect(element, isNotNull);
+ expect(element.kind, equals(protocol.ElementKind.FIELD));
+ expect(element.name, equals(name));
+ expect(element.parameters, isNull);
+ // The returnType represents the type of a field
+ expect(element.returnType, type != null ? type : 'dynamic');
+ return cs;
+ }
+
CompletionSuggestion assertSuggestFunction(String name, String returnType,
- bool isDeprecated, [CompletionRelevance relevance = CompletionRelevance.DEFAULT,
+ [bool isDeprecated = false, int relevance = COMPLETION_RELEVANCE_DEFAULT,
CompletionSuggestionKind kind = CompletionSuggestionKind.INVOCATION]) {
CompletionSuggestion cs = assertSuggest(
name,
csKind: kind,
relevance: relevance,
isDeprecated: isDeprecated);
- expect(cs.returnType, equals(returnType));
+ expect(cs.returnType, returnType != null ? returnType : 'dynamic');
protocol.Element element = cs.element;
expect(element, isNotNull);
expect(element.kind, equals(protocol.ElementKind.FUNCTION));
@@ -215,15 +244,15 @@
}
CompletionSuggestion assertSuggestFunctionTypeAlias(String name,
- String returnType, bool isDeprecated, [CompletionRelevance relevance =
- CompletionRelevance.DEFAULT, CompletionSuggestionKind kind =
+ String returnType, bool isDeprecated, [int relevance =
+ COMPLETION_RELEVANCE_DEFAULT, CompletionSuggestionKind kind =
CompletionSuggestionKind.INVOCATION]) {
CompletionSuggestion cs = assertSuggest(
name,
csKind: kind,
relevance: relevance,
isDeprecated: isDeprecated);
- expect(cs.returnType, equals(returnType));
+ expect(cs.returnType, returnType != null ? returnType : 'dynamic');
protocol.Element element = cs.element;
expect(element, isNotNull);
expect(element.kind, equals(protocol.ElementKind.FUNCTION_TYPE_ALIAS));
@@ -242,16 +271,15 @@
}
CompletionSuggestion assertSuggestGetter(String name, String returnType,
- {CompletionRelevance relevance: CompletionRelevance.DEFAULT,
- CompletionSuggestionKind kind: CompletionSuggestionKind.INVOCATION,
- bool isDeprecated: false}) {
+ {int relevance: COMPLETION_RELEVANCE_DEFAULT, CompletionSuggestionKind kind:
+ CompletionSuggestionKind.INVOCATION, bool isDeprecated: false}) {
CompletionSuggestion cs = assertSuggest(
name,
csKind: kind,
relevance: relevance,
elemKind: protocol.ElementKind.GETTER,
isDeprecated: isDeprecated);
- expect(cs.returnType, equals(returnType));
+ expect(cs.returnType, returnType != null ? returnType : 'dynamic');
protocol.Element element = cs.element;
expect(element, isNotNull);
expect(element.kind, equals(protocol.ElementKind.GETTER));
@@ -265,9 +293,25 @@
return cs;
}
- CompletionSuggestion assertSuggestLibraryPrefix(String prefix,
- [CompletionRelevance relevance = CompletionRelevance.DEFAULT,
- CompletionSuggestionKind kind = CompletionSuggestionKind.INVOCATION]) {
+ CompletionSuggestion assertSuggestLabel(String name, [int relevance =
+ COMPLETION_RELEVANCE_DEFAULT, CompletionSuggestionKind kind =
+ CompletionSuggestionKind.IDENTIFIER]) {
+ CompletionSuggestion cs =
+ assertSuggest(name, csKind: kind, relevance: relevance);
+ expect(cs.returnType, isNull);
+ protocol.Element element = cs.element;
+ expect(element, isNotNull);
+ expect(element.flags, 0);
+ expect(element.kind, equals(protocol.ElementKind.LABEL));
+ expect(element.name, equals(name));
+ expect(element.parameters, isNull);
+ expect(element.returnType, isNull);
+ return cs;
+ }
+
+ CompletionSuggestion assertSuggestLibraryPrefix(String prefix, [int relevance
+ = COMPLETION_RELEVANCE_DEFAULT, CompletionSuggestionKind kind =
+ CompletionSuggestionKind.INVOCATION]) {
// Library prefix should only be suggested by ImportedComputer
if (computer is ImportedComputer) {
CompletionSuggestion cs =
@@ -284,21 +328,19 @@
}
CompletionSuggestion assertSuggestLocalVariable(String name,
- String returnType, [CompletionRelevance relevance = CompletionRelevance.DEFAULT,
+ String returnType, [int relevance = COMPLETION_RELEVANCE_DEFAULT,
CompletionSuggestionKind kind = CompletionSuggestionKind.INVOCATION]) {
// Local variables should only be suggested by LocalComputer
if (computer is LocalComputer) {
CompletionSuggestion cs =
assertSuggest(name, csKind: kind, relevance: relevance);
- expect(cs.returnType, equals(returnType));
+ expect(cs.returnType, returnType != null ? returnType : 'dynamic');
protocol.Element element = cs.element;
expect(element, isNotNull);
expect(element.kind, equals(protocol.ElementKind.LOCAL_VARIABLE));
expect(element.name, equals(name));
expect(element.parameters, isNull);
- expect(
- element.returnType,
- equals(returnType != null ? returnType : 'dynamic'));
+ expect(element.returnType, returnType != null ? returnType : 'dynamic');
return cs;
} else {
return assertNotSuggested(name);
@@ -306,12 +348,12 @@
}
CompletionSuggestion assertSuggestMethod(String name, String declaringType,
- String returnType, [CompletionRelevance relevance = CompletionRelevance.DEFAULT,
+ String returnType, [int relevance = COMPLETION_RELEVANCE_DEFAULT,
CompletionSuggestionKind kind = CompletionSuggestionKind.INVOCATION]) {
CompletionSuggestion cs =
assertSuggest(name, csKind: kind, relevance: relevance);
expect(cs.declaringType, equals(declaringType));
- expect(cs.returnType, equals(returnType));
+ expect(cs.returnType, returnType != null ? returnType : 'dynamic');
protocol.Element element = cs.element;
expect(element, isNotNull);
expect(element.kind, equals(protocol.ElementKind.METHOD));
@@ -320,14 +362,12 @@
expect(param, isNotNull);
expect(param[0], equals('('));
expect(param[param.length - 1], equals(')'));
- expect(
- element.returnType,
- equals(returnType != null ? returnType : 'dynamic'));
+ expect(element.returnType, returnType != null ? returnType : 'dynamic');
return cs;
}
CompletionSuggestion assertSuggestNamedConstructor(String name,
- String returnType, [CompletionRelevance relevance = CompletionRelevance.DEFAULT,
+ String returnType, [int relevance = COMPLETION_RELEVANCE_DEFAULT,
CompletionSuggestionKind kind = CompletionSuggestionKind.INVOCATION]) {
if (computer is InvocationComputer) {
CompletionSuggestion cs =
@@ -348,13 +388,13 @@
}
CompletionSuggestion assertSuggestParameter(String name, String returnType,
- [CompletionRelevance relevance = CompletionRelevance.DEFAULT,
- CompletionSuggestionKind kind = CompletionSuggestionKind.INVOCATION]) {
+ [int relevance = COMPLETION_RELEVANCE_DEFAULT, CompletionSuggestionKind kind =
+ CompletionSuggestionKind.INVOCATION]) {
// Parameters should only be suggested by LocalComputer
if (computer is LocalComputer) {
CompletionSuggestion cs =
assertSuggest(name, csKind: kind, relevance: relevance);
- expect(cs.returnType, equals(returnType));
+ expect(cs.returnType, returnType != null ? returnType : 'dynamic');
protocol.Element element = cs.element;
expect(element, isNotNull);
expect(element.kind, equals(protocol.ElementKind.PARAMETER));
@@ -369,9 +409,9 @@
}
}
- CompletionSuggestion assertSuggestSetter(String name,
- [CompletionRelevance relevance = CompletionRelevance.DEFAULT,
- CompletionSuggestionKind kind = CompletionSuggestionKind.INVOCATION]) {
+ CompletionSuggestion assertSuggestSetter(String name, [int relevance =
+ COMPLETION_RELEVANCE_DEFAULT, CompletionSuggestionKind kind =
+ CompletionSuggestionKind.INVOCATION]) {
CompletionSuggestion cs = assertSuggest(
name,
csKind: kind,
@@ -391,25 +431,22 @@
}
CompletionSuggestion assertSuggestTopLevelVar(String name, String returnType,
- [CompletionRelevance relevance = CompletionRelevance.DEFAULT,
- CompletionSuggestionKind kind = CompletionSuggestionKind.INVOCATION]) {
+ [int relevance = COMPLETION_RELEVANCE_DEFAULT, CompletionSuggestionKind kind =
+ CompletionSuggestionKind.INVOCATION]) {
CompletionSuggestion cs =
assertSuggest(name, csKind: kind, relevance: relevance);
- expect(cs.returnType, equals(returnType));
+ expect(cs.returnType, returnType != null ? returnType : 'dynamic');
protocol.Element element = cs.element;
expect(element, isNotNull);
expect(element.kind, equals(protocol.ElementKind.TOP_LEVEL_VARIABLE));
expect(element.name, equals(name));
expect(element.parameters, isNull);
- //TODO (danrubel) return type level variable 'type' but not as 'returnType'
-// expect(
-// element.returnType,
-// equals(returnType != null ? returnType : 'dynamic'));
+ expect(element.returnType, returnType != null ? returnType : 'dynamic');
return cs;
}
void assertSuggestTopLevelVarGetterSetter(String name, String returnType,
- [CompletionRelevance relevance = CompletionRelevance.DEFAULT]) {
+ [int relevance = COMPLETION_RELEVANCE_DEFAULT]) {
if (computer is ImportedComputer) {
assertSuggestGetter(name, returnType);
assertSuggestSetter(name);
@@ -567,8 +604,8 @@
}
CompletionSuggestion assertLocalSuggestMethod(String name,
- String declaringType, String returnType, [CompletionRelevance relevance =
- CompletionRelevance.DEFAULT]) {
+ String declaringType, String returnType, [int relevance =
+ COMPLETION_RELEVANCE_DEFAULT]) {
if (computer is LocalComputer) {
return assertSuggestMethod(name, declaringType, returnType, relevance);
} else {
@@ -576,9 +613,9 @@
}
}
- CompletionSuggestion assertSuggestImportedClass(String name,
- [CompletionRelevance relevance = CompletionRelevance.DEFAULT,
- CompletionSuggestionKind kind = CompletionSuggestionKind.INVOCATION]) {
+ CompletionSuggestion assertSuggestImportedClass(String name, [int relevance =
+ COMPLETION_RELEVANCE_DEFAULT, CompletionSuggestionKind kind =
+ CompletionSuggestionKind.INVOCATION]) {
if (computer is ImportedComputer) {
return assertSuggestClass(name, relevance, kind);
} else {
@@ -586,9 +623,14 @@
}
}
+ CompletionSuggestion assertSuggestImportedField(String name, String type,
+ [int relevance = COMPLETION_RELEVANCE_DEFAULT]) {
+ return assertNotSuggested(name);
+ }
+
CompletionSuggestion assertSuggestImportedFunction(String name,
- String returnType, [bool isDeprecated = false, CompletionRelevance relevance =
- CompletionRelevance.DEFAULT, CompletionSuggestionKind kind =
+ String returnType, [bool isDeprecated = false, int relevance =
+ COMPLETION_RELEVANCE_DEFAULT, CompletionSuggestionKind kind =
CompletionSuggestionKind.INVOCATION]) {
if (computer is ImportedComputer) {
return assertSuggestFunction(
@@ -603,8 +645,8 @@
}
CompletionSuggestion assertSuggestImportedFunctionTypeAlias(String name,
- String returnType, [bool isDeprecated = false, CompletionRelevance relevance =
- CompletionRelevance.DEFAULT, CompletionSuggestionKind kind =
+ String returnType, [bool isDeprecated = false, int relevance =
+ COMPLETION_RELEVANCE_DEFAULT, CompletionSuggestionKind kind =
CompletionSuggestionKind.INVOCATION]) {
if (computer is ImportedComputer) {
return assertSuggestFunctionTypeAlias(
@@ -619,8 +661,7 @@
}
CompletionSuggestion assertSuggestImportedGetter(String name,
- String returnType, [CompletionRelevance relevance =
- CompletionRelevance.DEFAULT]) {
+ String returnType, [int relevance = COMPLETION_RELEVANCE_DEFAULT]) {
if (computer is ImportedComputer) {
return assertSuggestGetter(name, returnType, relevance: relevance);
} else {
@@ -629,8 +670,8 @@
}
CompletionSuggestion assertSuggestImportedMethod(String name,
- String declaringType, String returnType, [CompletionRelevance relevance =
- CompletionRelevance.DEFAULT]) {
+ String declaringType, String returnType, [int relevance =
+ COMPLETION_RELEVANCE_DEFAULT]) {
if (computer is ImportedComputer) {
return assertSuggestMethod(name, declaringType, returnType, relevance);
} else {
@@ -638,8 +679,17 @@
}
}
+ CompletionSuggestion assertSuggestImportedSetter(String name, [int relevance =
+ COMPLETION_RELEVANCE_DEFAULT]) {
+ if (computer is ImportedComputer) {
+ return assertSuggestSetter(name, relevance);
+ } else {
+ return assertNotSuggested(name);
+ }
+ }
+
CompletionSuggestion assertSuggestImportedTopLevelVar(String name,
- String returnType, [CompletionRelevance relevance = CompletionRelevance.DEFAULT,
+ String returnType, [int relevance = COMPLETION_RELEVANCE_DEFAULT,
CompletionSuggestionKind kind = CompletionSuggestionKind.INVOCATION]) {
if (computer is ImportedComputer) {
return assertSuggestTopLevelVar(name, returnType, relevance, kind);
@@ -648,8 +698,8 @@
}
}
- CompletionSuggestion assertSuggestInvocationClass(String name,
- [CompletionRelevance relevance = CompletionRelevance.DEFAULT]) {
+ CompletionSuggestion assertSuggestInvocationClass(String name, [int relevance
+ = COMPLETION_RELEVANCE_DEFAULT]) {
if (computer is InvocationComputer) {
return assertSuggestClass(name, relevance);
} else {
@@ -657,8 +707,13 @@
}
}
+ CompletionSuggestion assertSuggestInvocationField(String name, String type,
+ {int relevance: COMPLETION_RELEVANCE_DEFAULT, bool isDeprecated: false}) {
+ return assertNotSuggested(name);
+ }
+
CompletionSuggestion assertSuggestInvocationGetter(String name,
- String returnType, {CompletionRelevance relevance: CompletionRelevance.DEFAULT,
+ String returnType, {int relevance: COMPLETION_RELEVANCE_DEFAULT,
bool isDeprecated: false}) {
if (computer is InvocationComputer) {
return assertSuggestGetter(
@@ -672,8 +727,8 @@
}
CompletionSuggestion assertSuggestInvocationMethod(String name,
- String declaringType, String returnType, [CompletionRelevance relevance =
- CompletionRelevance.DEFAULT]) {
+ String declaringType, String returnType, [int relevance =
+ COMPLETION_RELEVANCE_DEFAULT]) {
if (computer is InvocationComputer) {
return assertSuggestMethod(name, declaringType, returnType, relevance);
} else {
@@ -681,8 +736,8 @@
}
}
- CompletionSuggestion assertSuggestInvocationSetter(String name,
- [CompletionRelevance relevance = CompletionRelevance.DEFAULT]) {
+ CompletionSuggestion assertSuggestInvocationSetter(String name, [int relevance
+ = COMPLETION_RELEVANCE_DEFAULT]) {
if (computer is InvocationComputer) {
return assertSuggestSetter(name);
} else {
@@ -691,8 +746,7 @@
}
CompletionSuggestion assertSuggestInvocationTopLevelVar(String name,
- String returnType, [CompletionRelevance relevance =
- CompletionRelevance.DEFAULT]) {
+ String returnType, [int relevance = COMPLETION_RELEVANCE_DEFAULT]) {
if (computer is InvocationComputer) {
return assertSuggestTopLevelVar(name, returnType, relevance);
} else {
@@ -700,8 +754,8 @@
}
}
- CompletionSuggestion assertSuggestLocalClass(String name,
- [CompletionRelevance relevance = CompletionRelevance.DEFAULT]) {
+ CompletionSuggestion assertSuggestLocalClass(String name, [int relevance =
+ COMPLETION_RELEVANCE_DEFAULT]) {
if (computer is LocalComputer) {
return assertSuggestClass(name, relevance);
} else {
@@ -710,7 +764,7 @@
}
CompletionSuggestion assertSuggestLocalClassTypeAlias(String name,
- [CompletionRelevance relevance = CompletionRelevance.DEFAULT]) {
+ [int relevance = COMPLETION_RELEVANCE_DEFAULT]) {
if (computer is LocalComputer) {
return assertSuggestClassTypeAlias(name, relevance);
} else {
@@ -718,9 +772,14 @@
}
}
+ CompletionSuggestion assertSuggestLocalField(String name, String type,
+ [int relevance = COMPLETION_RELEVANCE_DEFAULT]) {
+ return assertNotSuggested(name);
+ }
+
CompletionSuggestion assertSuggestLocalFunction(String name,
- String returnType, [bool isDeprecated = false, CompletionRelevance relevance =
- CompletionRelevance.DEFAULT]) {
+ String returnType, [bool isDeprecated = false, int relevance =
+ COMPLETION_RELEVANCE_DEFAULT]) {
if (computer is LocalComputer) {
return assertSuggestFunction(name, returnType, isDeprecated, relevance);
} else {
@@ -729,8 +788,8 @@
}
CompletionSuggestion assertSuggestLocalFunctionTypeAlias(String name,
- String returnType, [bool isDeprecated = false, CompletionRelevance relevance =
- CompletionRelevance.DEFAULT]) {
+ String returnType, [bool isDeprecated = false, int relevance =
+ COMPLETION_RELEVANCE_DEFAULT]) {
if (computer is LocalComputer) {
return assertSuggestFunctionTypeAlias(
name,
@@ -743,7 +802,7 @@
}
CompletionSuggestion assertSuggestLocalGetter(String name, String returnType,
- [CompletionRelevance relevance = CompletionRelevance.DEFAULT]) {
+ [int relevance = COMPLETION_RELEVANCE_DEFAULT]) {
if (computer is LocalComputer) {
return assertSuggestGetter(name, returnType, relevance: relevance);
} else {
@@ -752,8 +811,8 @@
}
CompletionSuggestion assertSuggestLocalMethod(String name,
- String declaringType, String returnType, [CompletionRelevance relevance =
- CompletionRelevance.DEFAULT]) {
+ String declaringType, String returnType, [int relevance =
+ COMPLETION_RELEVANCE_DEFAULT]) {
if (computer is LocalComputer) {
return assertSuggestMethod(name, declaringType, returnType, relevance);
} else {
@@ -761,8 +820,8 @@
}
}
- CompletionSuggestion assertSuggestLocalSetter(String name,
- [CompletionRelevance relevance = CompletionRelevance.DEFAULT]) {
+ CompletionSuggestion assertSuggestLocalSetter(String name, [int relevance =
+ COMPLETION_RELEVANCE_DEFAULT]) {
if (computer is LocalComputer) {
return assertSuggestSetter(name, relevance);
} else {
@@ -771,8 +830,7 @@
}
CompletionSuggestion assertSuggestLocalTopLevelVar(String name,
- String returnType, [CompletionRelevance relevance =
- CompletionRelevance.DEFAULT]) {
+ String returnType, [int relevance = COMPLETION_RELEVANCE_DEFAULT]) {
if (computer is LocalComputer) {
return assertSuggestTopLevelVar(name, returnType, relevance);
} else {
@@ -780,9 +838,9 @@
}
}
- CompletionSuggestion assertSuggestNonLocalClass(String name,
- [CompletionRelevance relevance = CompletionRelevance.DEFAULT,
- CompletionSuggestionKind kind = CompletionSuggestionKind.INVOCATION]) {
+ CompletionSuggestion assertSuggestNonLocalClass(String name, [int relevance =
+ COMPLETION_RELEVANCE_DEFAULT, CompletionSuggestionKind kind =
+ CompletionSuggestionKind.INVOCATION]) {
return assertSuggestImportedClass(name, relevance, kind);
}
@@ -1134,26 +1192,26 @@
assertSuggestImportedClass('C');
// hidden element suggested as low relevance
// but imported results are partially filtered
- //assertSuggestImportedClass('D', CompletionRelevance.LOW);
+ //assertSuggestImportedClass('D', COMPLETION_RELEVANCE_LOW);
//assertSuggestImportedFunction(
- // 'D1', null, true, CompletionRelevance.LOW);
+ // 'D1', null, true, COMPLETION_RELEVANCE_LOW);
assertSuggestLocalFunction('D2', 'Z');
assertSuggestImportedClass('EE');
// hidden element suggested as low relevance
- //assertSuggestImportedClass('F', CompletionRelevance.LOW);
+ //assertSuggestImportedClass('F', COMPLETION_RELEVANCE_LOW);
assertSuggestLibraryPrefix('g');
assertNotSuggested('G');
- //assertSuggestImportedClass('H', CompletionRelevance.LOW);
+ //assertSuggestImportedClass('H', COMPLETION_RELEVANCE_LOW);
assertSuggestImportedClass('Object');
assertSuggestImportedFunction('min', 'num', false);
//assertSuggestImportedFunction(
// 'max',
// 'num',
// false,
- // CompletionRelevance.LOW);
+ // COMPLETION_RELEVANCE_LOW);
assertSuggestTopLevelVarGetterSetter('T1', 'String');
assertNotSuggested('_T2');
- //assertSuggestImportedTopLevelVar('T3', 'int', CompletionRelevance.LOW);
+ //assertSuggestImportedTopLevelVar('T3', 'int', COMPLETION_RELEVANCE_LOW);
assertNotSuggested('_T4');
assertSuggestLocalTopLevelVar('T5', 'int');
assertSuggestLocalTopLevelVar('_T6', null);
@@ -1213,25 +1271,25 @@
assertNotSuggested('_B');
//assertSuggestImportedClass('C');
// hidden element suggested as low relevance
- assertSuggestImportedClass('D', CompletionRelevance.LOW);
- assertSuggestImportedFunction('D1', null, true, CompletionRelevance.LOW);
+ assertSuggestImportedClass('D', COMPLETION_RELEVANCE_LOW);
+ assertSuggestImportedFunction('D1', null, true, COMPLETION_RELEVANCE_LOW);
assertSuggestLocalFunction('D2', 'Z');
//assertSuggestImportedClass('EE');
// hidden element suggested as low relevance
- //assertSuggestImportedClass('F', CompletionRelevance.LOW);
+ //assertSuggestImportedClass('F', COMPLETION_RELEVANCE_LOW);
//assertSuggestLibraryPrefix('g');
assertNotSuggested('G');
- //assertSuggestImportedClass('H', CompletionRelevance.LOW);
+ //assertSuggestImportedClass('H', COMPLETION_RELEVANCE_LOW);
//assertSuggestImportedClass('Object');
//assertSuggestImportedFunction('min', 'num', false);
//assertSuggestImportedFunction(
// 'max',
// 'num',
// false,
- // CompletionRelevance.LOW);
+ // COMPLETION_RELEVANCE_LOW);
//assertSuggestTopLevelVarGetterSetter('T1', 'String');
assertNotSuggested('_T2');
- //assertSuggestImportedTopLevelVar('T3', 'int', CompletionRelevance.LOW);
+ //assertSuggestImportedTopLevelVar('T3', 'int', COMPLETION_RELEVANCE_LOW);
assertNotSuggested('_T4');
//assertSuggestLocalTopLevelVar('T5', 'int');
//assertSuggestLocalTopLevelVar('_T6', null);
@@ -1245,7 +1303,7 @@
// Block BlockFunctionBody MethodDeclaration ClassDeclaration
addSource('/testB.dart', '''
lib B;
- class F { var f1; f2() { } }
+ class F { var f1; f2() { } get f3 => 0; set f4(fx) { } }
class E extends F { var e1; e2() { } }
class I { int i1; i2() { } }
class M { var m1; int m2() { } }''');
@@ -1254,14 +1312,18 @@
class A extends E implements I with M {a() {^}}''');
computeFast();
return computeFull((bool result) {
- assertSuggestImportedGetter('e1', null);
- assertSuggestImportedGetter('f1', null);
- assertSuggestImportedGetter('i1', 'int');
- assertSuggestImportedGetter('m1', null);
- //TODO (danrubel) include declared type in suggestion
- assertSuggestImportedMethod('e2', null, null);
- assertSuggestImportedMethod('f2', null, null);
- assertSuggestImportedMethod('i2', null, null);
+ // TODO (danrubel) prefer fields over getters
+ // If add `get e1;` to interface I
+ // then suggestions include getter e1 rather than field e1
+ assertSuggestImportedField('e1', null);
+ assertSuggestImportedField('f1', null);
+ assertSuggestImportedField('i1', 'int');
+ assertSuggestImportedField('m1', null);
+ assertSuggestImportedGetter('f3', null);
+ assertSuggestImportedSetter('f4');
+ assertSuggestImportedMethod('e2', 'E', null);
+ assertSuggestImportedMethod('f2', 'F', null);
+ assertSuggestImportedMethod('i2', 'I', null);
//assertSuggestImportedMethod('m2', null, null);
assertNotSuggested('==');
});
@@ -1270,17 +1332,19 @@
test_Block_inherited_local() {
// Block BlockFunctionBody MethodDeclaration ClassDeclaration
addTestSource('''
- class F { var f1; f2() { } }
+ class F { var f1; f2() { } get f3 => 0; set f4(fx) { } }
class E extends F { var e1; e2() { } }
class I { int i1; i2() { } }
class M { var m1; int m2() { } }
class A extends E implements I with M {a() {^}}''');
computeFast();
return computeFull((bool result) {
- assertSuggestLocalGetter('e1', null);
- assertSuggestLocalGetter('f1', null);
- assertSuggestLocalGetter('i1', 'int');
- assertSuggestLocalGetter('m1', null);
+ assertSuggestLocalField('e1', null);
+ assertSuggestLocalField('f1', null);
+ assertSuggestLocalField('i1', 'int');
+ assertSuggestLocalField('m1', null);
+ assertSuggestLocalGetter('f3', null);
+ assertSuggestLocalSetter('f4');
assertSuggestLocalMethod('e2', 'E', null);
assertSuggestLocalMethod('f2', 'F', null);
assertSuggestLocalMethod('i2', 'I', null);
@@ -1301,8 +1365,8 @@
main() {A a; a.^.z}''');
computeFast();
return computeFull((bool result) {
- assertSuggestInvocationGetter('b', null);
- assertSuggestInvocationGetter('_c', 'X');
+ assertSuggestInvocationField('b', null);
+ assertSuggestInvocationField('_c', 'X');
assertNotSuggested('Object');
assertNotSuggested('A');
assertNotSuggested('B');
@@ -1323,8 +1387,8 @@
main() {A a; a..^z}''');
computeFast();
return computeFull((bool result) {
- assertSuggestInvocationGetter('b', null);
- assertSuggestInvocationGetter('_c', 'X');
+ assertSuggestInvocationField('b', null);
+ assertSuggestInvocationField('_c', 'X');
assertNotSuggested('Object');
assertNotSuggested('A');
assertNotSuggested('B');
@@ -1345,8 +1409,8 @@
main() {A a; a..^ return}''');
computeFast();
return computeFull((bool result) {
- assertSuggestInvocationGetter('b', null);
- assertSuggestInvocationGetter('_c', 'X');
+ assertSuggestInvocationField('b', null);
+ assertSuggestInvocationField('_c', 'X');
assertNotSuggested('Object');
assertNotSuggested('A');
assertNotSuggested('B');
@@ -1412,7 +1476,7 @@
computeFast();
return computeFull((bool result) {
CompletionSuggestion suggestionA =
- assertSuggestLocalClass('A', CompletionRelevance.LOW);
+ assertSuggestLocalClass('A', COMPLETION_RELEVANCE_LOW);
if (suggestionA != null) {
expect(suggestionA.element.isDeprecated, isTrue);
expect(suggestionA.element.isPrivate, isFalse);
@@ -1490,8 +1554,8 @@
class A {var b; X _c; foo() {A a; if (^) something}}''');
computeFast();
return computeFull((bool result) {
- assertSuggestLocalGetter('b', null);
- assertSuggestLocalGetter('_c', 'X');
+ assertSuggestLocalField('b', null);
+ assertSuggestLocalField('_c', 'X');
assertSuggestImportedClass('Object');
assertSuggestLocalClass('A');
assertNotSuggested('==');
@@ -1969,7 +2033,7 @@
expect(methodA.element.isPrivate, isFalse);
}
CompletionSuggestion getterF =
- assertSuggestLocalGetter('f', 'X', CompletionRelevance.LOW);
+ assertSuggestLocalGetter('f', 'X', COMPLETION_RELEVANCE_LOW);
if (getterF != null) {
expect(getterF.element.isDeprecated, isTrue);
expect(getterF.element.isPrivate, isFalse);
@@ -1993,13 +2057,13 @@
expect(methodA.element.isPrivate, isTrue);
}
CompletionSuggestion getterF =
- assertSuggestLocalGetter('f', 'X', CompletionRelevance.LOW);
+ assertSuggestLocalField('f', 'X', COMPLETION_RELEVANCE_LOW);
if (getterF != null) {
expect(getterF.element.isDeprecated, isTrue);
expect(getterF.element.isPrivate, isFalse);
expect(getterF.element.parameters, isNull);
}
- CompletionSuggestion getterG = assertSuggestLocalGetter('_g', null);
+ CompletionSuggestion getterG = assertSuggestLocalField('_g', null);
if (getterG != null) {
expect(getterG.element.isDeprecated, isFalse);
expect(getterG.element.isPrivate, isTrue);
@@ -2015,7 +2079,7 @@
computeFast();
return computeFull((bool result) {
CompletionSuggestion methodA =
- assertSuggestLocalMethod('a', 'A', 'Z', CompletionRelevance.LOW);
+ assertSuggestLocalMethod('a', 'A', 'Z', COMPLETION_RELEVANCE_LOW);
if (methodA != null) {
expect(methodA.element.isDeprecated, isTrue);
expect(methodA.element.isPrivate, isFalse);
@@ -2162,9 +2226,9 @@
main() {A.^}''');
computeFast();
return computeFull((bool result) {
- assertSuggestInvocationGetter('scA', 'String');
- assertSuggestInvocationGetter('scB', 'int');
- assertSuggestInvocationGetter('scI', null);
+ assertSuggestInvocationField('scA', 'String');
+ assertSuggestInvocationField('scB', 'int');
+ assertSuggestInvocationField('scI', null);
assertNotSuggested('b');
assertNotSuggested('_c');
assertNotSuggested('d');
@@ -2201,8 +2265,8 @@
main() {A a; a.^}''');
computeFast();
return computeFull((bool result) {
- assertSuggestInvocationGetter('sc', 'int');
- assertSuggestInvocationGetter('b', null, isDeprecated: true);
+ assertSuggestInvocationField('sc', 'int');
+ assertSuggestInvocationField('b', null, isDeprecated: true);
assertNotSuggested('_c');
assertSuggestInvocationGetter('d', 'X');
assertNotSuggested('_e');
@@ -2234,9 +2298,9 @@
class X{}''');
computeFast();
return computeFull((bool result) {
- assertSuggestInvocationGetter('sc', 'int');
- assertSuggestInvocationGetter('b', null);
- assertSuggestInvocationGetter('_c', 'X');
+ assertSuggestInvocationField('sc', 'int');
+ assertSuggestInvocationField('b', null);
+ assertSuggestInvocationField('_c', 'X');
assertSuggestInvocationGetter('d', 'X');
assertSuggestInvocationGetter('_e', null);
assertSuggestInvocationGetter('f', 'X');
@@ -2290,7 +2354,7 @@
foo(X x) {x.^}''');
computeFast();
return computeFull((bool result) {
- assertSuggestInvocationGetter('y', 'M');
+ assertSuggestInvocationField('y', 'M');
assertNotSuggested('_z');
assertNotSuggested('==');
});
@@ -2376,8 +2440,8 @@
class X{}''');
computeFast();
return computeFull((bool result) {
- assertSuggestInvocationGetter('b', null);
- assertSuggestInvocationGetter('_c', 'X');
+ assertSuggestInvocationField('b', null);
+ assertSuggestInvocationField('_c', 'X');
assertSuggestInvocationGetter('d', 'X');
assertSuggestInvocationGetter('_e', null);
assertSuggestInvocationGetter('f', 'X');
@@ -2411,8 +2475,8 @@
class X{}''');
computeFast();
return computeFull((bool result) {
- assertSuggestInvocationGetter('b', null);
- assertSuggestInvocationGetter('_c', 'X');
+ assertSuggestInvocationField('b', null);
+ assertSuggestInvocationField('_c', 'X');
assertSuggestInvocationGetter('d', 'X');
assertSuggestInvocationGetter('_e', null);
assertSuggestInvocationGetter('f', 'X');
diff --git a/pkg/analysis_server/test/services/completion/imported_computer_test.dart b/pkg/analysis_server/test/services/completion/imported_computer_test.dart
index c453231..ded6b43 100644
--- a/pkg/analysis_server/test/services/completion/imported_computer_test.dart
+++ b/pkg/analysis_server/test/services/completion/imported_computer_test.dart
@@ -9,7 +9,6 @@
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_computer.dart';
-import 'package:analyzer/file_system/file_system.dart';
import 'package:analyzer/src/generated/ast.dart';
import 'package:analyzer/src/generated/element.dart';
import 'package:analyzer/src/generated/engine.dart';
@@ -25,7 +24,7 @@
runReflectiveTests(ImportedComputerTest);
}
-@ReflectiveTestCase()
+@reflectiveTest
class ImportedComputerTest extends AbstractSelectorSuggestionTest {
void assertCached(String completion) {
@@ -106,6 +105,12 @@
}
}
+ @override
+ CompletionSuggestion assertSuggestImportedField(String name, String type,
+ [int relevance = COMPLETION_RELEVANCE_DEFAULT]) {
+ return assertSuggestField(name, type, relevance: relevance);
+ }
+
bool isCached(List<CompletionSuggestion> suggestions, String completion) =>
suggestions.any((CompletionSuggestion s) => s.completion == completion);
@@ -201,6 +206,278 @@
});
}
+ test_function_parameters_mixed_required_and_named() {
+ addSource('/libA.dart', '''
+void m(x, {int y}) {}
+''');
+ addTestSource('''
+import '/libA.dart';
+class B extends A {
+ main() {^}
+}
+''');
+ return computeFull((bool result) {
+ CompletionSuggestion suggestion = assertSuggestFunction('m', 'void');
+ expect(suggestion.parameterNames, hasLength(2));
+ expect(suggestion.parameterNames[0], 'x');
+ expect(suggestion.parameterTypes[0], 'dynamic');
+ expect(suggestion.parameterNames[1], 'y');
+ expect(suggestion.parameterTypes[1], 'int');
+ expect(suggestion.requiredParameterCount, 1);
+ expect(suggestion.hasNamedParameters, true);
+ });
+ }
+
+ test_function_parameters_mixed_required_and_positional() {
+ addSource('/libA.dart', '''
+void m(x, [int y]) {}
+''');
+ addTestSource('''
+import '/libA.dart';
+class B extends A {
+ main() {^}
+}
+''');
+ return computeFull((bool result) {
+ CompletionSuggestion suggestion = assertSuggestFunction('m', 'void');
+ expect(suggestion.parameterNames, hasLength(2));
+ expect(suggestion.parameterNames[0], 'x');
+ expect(suggestion.parameterTypes[0], 'dynamic');
+ expect(suggestion.parameterNames[1], 'y');
+ expect(suggestion.parameterTypes[1], 'int');
+ expect(suggestion.requiredParameterCount, 1);
+ expect(suggestion.hasNamedParameters, false);
+ });
+ }
+
+ test_function_parameters_named() {
+ addSource('/libA.dart', '''
+void m({x, int y}) {}
+''');
+ addTestSource('''
+import '/libA.dart';
+class B extends A {
+ main() {^}
+}
+''');
+ return computeFull((bool result) {
+ CompletionSuggestion suggestion = assertSuggestFunction('m', 'void');
+ expect(suggestion.parameterNames, hasLength(2));
+ expect(suggestion.parameterNames[0], 'x');
+ expect(suggestion.parameterTypes[0], 'dynamic');
+ expect(suggestion.parameterNames[1], 'y');
+ expect(suggestion.parameterTypes[1], 'int');
+ expect(suggestion.requiredParameterCount, 0);
+ expect(suggestion.hasNamedParameters, true);
+ });
+ }
+
+ test_function_parameters_none() {
+ addSource('/libA.dart', '''
+void m() {}
+''');
+ addTestSource('''
+import '/libA.dart';
+class B extends A {
+ main() {^}
+}
+''');
+ computeFast();
+ return computeFull((bool result) {
+ CompletionSuggestion suggestion = assertSuggestFunction('m', 'void');
+ expect(suggestion.parameterNames, isEmpty);
+ expect(suggestion.parameterTypes, isEmpty);
+ expect(suggestion.requiredParameterCount, 0);
+ expect(suggestion.hasNamedParameters, false);
+ });
+ }
+
+ test_function_parameters_positional() {
+ addSource('/libA.dart', '''
+void m([x, int y]) {}
+''');
+ addTestSource('''
+import '/libA.dart';
+class B extends A {
+ main() {^}
+}
+''');
+ return computeFull((bool result) {
+ CompletionSuggestion suggestion = assertSuggestFunction('m', 'void');
+ expect(suggestion.parameterNames, hasLength(2));
+ expect(suggestion.parameterNames[0], 'x');
+ expect(suggestion.parameterTypes[0], 'dynamic');
+ expect(suggestion.parameterNames[1], 'y');
+ expect(suggestion.parameterTypes[1], 'int');
+ expect(suggestion.requiredParameterCount, 0);
+ expect(suggestion.hasNamedParameters, false);
+ });
+ }
+
+ test_function_parameters_required() {
+ addSource('/libA.dart', '''
+void m(x, int y) {}
+''');
+ addTestSource('''
+import '/libA.dart';
+class B extends A {
+ main() {^}
+}
+''');
+ return computeFull((bool result) {
+ CompletionSuggestion suggestion = assertSuggestFunction('m', 'void');
+ expect(suggestion.parameterNames, hasLength(2));
+ expect(suggestion.parameterNames[0], 'x');
+ expect(suggestion.parameterTypes[0], 'dynamic');
+ expect(suggestion.parameterNames[1], 'y');
+ expect(suggestion.parameterTypes[1], 'int');
+ expect(suggestion.requiredParameterCount, 2);
+ expect(suggestion.hasNamedParameters, false);
+ });
+ }
+
+ test_method_parameters_mixed_required_and_named() {
+ addSource('/libA.dart', '''
+class A {
+ void m(x, {int y}) {}
+}
+''');
+ addTestSource('''
+import '/libA.dart';
+class B extends A {
+ main() {^}
+}
+''');
+ return computeFull((bool result) {
+ CompletionSuggestion suggestion = assertSuggestMethod('m', 'A', 'void');
+ expect(suggestion.parameterNames, hasLength(2));
+ expect(suggestion.parameterNames[0], 'x');
+ expect(suggestion.parameterTypes[0], 'dynamic');
+ expect(suggestion.parameterNames[1], 'y');
+ expect(suggestion.parameterTypes[1], 'int');
+ expect(suggestion.requiredParameterCount, 1);
+ expect(suggestion.hasNamedParameters, true);
+ });
+ }
+
+ test_method_parameters_mixed_required_and_positional() {
+ addSource('/libA.dart', '''
+class A {
+ void m(x, [int y]) {}
+}
+''');
+ addTestSource('''
+import '/libA.dart';
+class B extends A {
+ main() {^}
+}
+''');
+ return computeFull((bool result) {
+ CompletionSuggestion suggestion = assertSuggestMethod('m', 'A', 'void');
+ expect(suggestion.parameterNames, hasLength(2));
+ expect(suggestion.parameterNames[0], 'x');
+ expect(suggestion.parameterTypes[0], 'dynamic');
+ expect(suggestion.parameterNames[1], 'y');
+ expect(suggestion.parameterTypes[1], 'int');
+ expect(suggestion.requiredParameterCount, 1);
+ expect(suggestion.hasNamedParameters, false);
+ });
+ }
+
+ test_method_parameters_named() {
+ addSource('/libA.dart', '''
+class A {
+ void m({x, int y}) {}
+}
+''');
+ addTestSource('''
+import '/libA.dart';
+class B extends A {
+ main() {^}
+}
+''');
+ return computeFull((bool result) {
+ CompletionSuggestion suggestion = assertSuggestMethod('m', 'A', 'void');
+ expect(suggestion.parameterNames, hasLength(2));
+ expect(suggestion.parameterNames[0], 'x');
+ expect(suggestion.parameterTypes[0], 'dynamic');
+ expect(suggestion.parameterNames[1], 'y');
+ expect(suggestion.parameterTypes[1], 'int');
+ expect(suggestion.requiredParameterCount, 0);
+ expect(suggestion.hasNamedParameters, true);
+ });
+ }
+
+ test_method_parameters_none() {
+ addSource('/libA.dart', '''
+class A {
+ void m() {}
+}
+''');
+ addTestSource('''
+import '/libA.dart';
+class B extends A {
+ main() {^}
+}
+''');
+ computeFast();
+ return computeFull((bool result) {
+ CompletionSuggestion suggestion = assertSuggestMethod('m', 'A', 'void');
+ expect(suggestion.parameterNames, isEmpty);
+ expect(suggestion.parameterTypes, isEmpty);
+ expect(suggestion.requiredParameterCount, 0);
+ expect(suggestion.hasNamedParameters, false);
+ });
+ }
+
+ test_method_parameters_positional() {
+ addSource('/libA.dart', '''
+class A {
+ void m([x, int y]) {}
+}
+''');
+ addTestSource('''
+import '/libA.dart';
+class B extends A {
+ main() {^}
+}
+''');
+ return computeFull((bool result) {
+ CompletionSuggestion suggestion = assertSuggestMethod('m', 'A', 'void');
+ expect(suggestion.parameterNames, hasLength(2));
+ expect(suggestion.parameterNames[0], 'x');
+ expect(suggestion.parameterTypes[0], 'dynamic');
+ expect(suggestion.parameterNames[1], 'y');
+ expect(suggestion.parameterTypes[1], 'int');
+ expect(suggestion.requiredParameterCount, 0);
+ expect(suggestion.hasNamedParameters, false);
+ });
+ }
+
+ test_method_parameters_required() {
+ addSource('/libA.dart', '''
+class A {
+ void m(x, int y) {}
+}
+''');
+ addTestSource('''
+import '/libA.dart';
+class B extends A {
+ main() {^}
+}
+''');
+ return computeFull((bool result) {
+ CompletionSuggestion suggestion = assertSuggestMethod('m', 'A', 'void');
+ expect(suggestion.parameterNames, hasLength(2));
+ expect(suggestion.parameterNames[0], 'x');
+ expect(suggestion.parameterTypes[0], 'dynamic');
+ expect(suggestion.parameterNames[1], 'y');
+ expect(suggestion.parameterTypes[1], 'int');
+ expect(suggestion.requiredParameterCount, 2);
+ expect(suggestion.hasNamedParameters, false);
+ });
+ }
+
/**
* Ensure that completions in one context don't appear in another
*/
@@ -210,13 +487,6 @@
var context2 = AnalysisEngine.instance.createAnalysisContext();
context2.sourceFactory =
new SourceFactory([AbstractContextTest.SDK_RESOLVER, resourceResolver]);
- {
- AnalysisOptionsImpl options =
- new AnalysisOptionsImpl.con1(context2.analysisOptions);
- options.enableAsync = true;
- options.enableEnum = true;
- context2.analysisOptions = options;
- }
String content2 = 'class ClassFromAnotherContext { }';
Source source2 =
provider.newFile('/context2/foo.dart', content2).createSource();
@@ -255,6 +525,60 @@
});
}
+ test_no_parameters_field() {
+ addSource('/libA.dart', '''
+class A {
+ int x;
+}
+''');
+ addTestSource('''
+import '/libA.dart';
+class B extends A {
+ main() {^}
+}
+''');
+ return computeFull((bool result) {
+ CompletionSuggestion suggestion = assertSuggestField('x', 'int');
+ assertHasNoParameterInfo(suggestion);
+ });
+ }
+
+ test_no_parameters_getter() {
+ addSource('/libA.dart', '''
+class A {
+ int get x => null;
+}
+''');
+ addTestSource('''
+import '/libA.dart';
+class B extends A {
+ main() {^}
+}
+''');
+ return computeFull((bool result) {
+ CompletionSuggestion suggestion = assertSuggestGetter('x', 'int');
+ assertHasNoParameterInfo(suggestion);
+ });
+ }
+
+ test_no_parameters_setter() {
+ addSource('/libA.dart', '''
+class A {
+ set x(int value) {};
+}
+''');
+ addTestSource('''
+import '/libA.dart';
+class B extends A {
+ main() {^}
+}
+''');
+ return computeFull((bool result) {
+ CompletionSuggestion suggestion = assertSuggestSetter('x');
+ assertHasNoParameterInfo(suggestion);
+ });
+ }
+
@override
test_partFile_TypeName() {
return super.test_partFile_TypeName().then((_) {
diff --git a/pkg/analysis_server/test/services/completion/invocation_computer_test.dart b/pkg/analysis_server/test/services/completion/invocation_computer_test.dart
index 8b8b30c..2dd068b 100644
--- a/pkg/analysis_server/test/services/completion/invocation_computer_test.dart
+++ b/pkg/analysis_server/test/services/completion/invocation_computer_test.dart
@@ -6,6 +6,7 @@
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/invocation_computer.dart';
import 'package:unittest/unittest.dart';
@@ -17,14 +18,17 @@
runReflectiveTests(InvocationComputerTest);
}
-@ReflectiveTestCase()
+@reflectiveTest
class InvocationComputerTest extends AbstractSelectorSuggestionTest {
- void assertHasNoParameterInfo(CompletionSuggestion suggestion) {
- expect(suggestion.parameterNames, isNull);
- expect(suggestion.parameterTypes, isNull);
- expect(suggestion.requiredParameterCount, isNull);
- expect(suggestion.hasNamedParameters, isNull);
+ @override
+ CompletionSuggestion assertSuggestInvocationField(String name, String type,
+ {int relevance: COMPLETION_RELEVANCE_DEFAULT, bool isDeprecated: false}) {
+ return assertSuggestField(
+ name,
+ type,
+ relevance: relevance,
+ isDeprecated: isDeprecated);
}
@override
@@ -145,7 +149,7 @@
}
void main() {new C().^}''');
return computeFull((bool result) {
- CompletionSuggestion suggestion = assertSuggestGetter('x', 'int');
+ CompletionSuggestion suggestion = assertSuggestField('x', 'int');
assertHasNoParameterInfo(suggestion);
});
}
diff --git a/pkg/analysis_server/test/services/completion/keyword_computer_test.dart b/pkg/analysis_server/test/services/completion/keyword_computer_test.dart
index f6d7fed..c2156c6 100644
--- a/pkg/analysis_server/test/services/completion/keyword_computer_test.dart
+++ b/pkg/analysis_server/test/services/completion/keyword_computer_test.dart
@@ -5,6 +5,7 @@
library test.services.completion.dart.keyword;
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/keyword_computer.dart';
import 'package:analyzer/src/generated/scanner.dart';
import 'package:unittest/unittest.dart';
@@ -17,11 +18,11 @@
runReflectiveTests(KeywordComputerTest);
}
-@ReflectiveTestCase()
+@reflectiveTest
class KeywordComputerTest extends AbstractCompletionTest {
void assertSuggestKeywords(Iterable<Keyword> expectedKeywords,
- [CompletionRelevance relevance = CompletionRelevance.DEFAULT]) {
+ [int relevance = COMPLETION_RELEVANCE_DEFAULT]) {
Set<Keyword> actualKeywords = new Set<Keyword>();
request.suggestions.forEach((CompletionSuggestion s) {
if (s.kind == CompletionSuggestionKind.KEYWORD) {
@@ -75,7 +76,7 @@
Keyword.FINAL,
Keyword.TYPEDEF,
Keyword.VAR],
- CompletionRelevance.HIGH);
+ COMPLETION_RELEVANCE_HIGH);
}
test_before_import() {
@@ -83,7 +84,7 @@
expect(computeFast(), isTrue);
assertSuggestKeywords(
[Keyword.EXPORT, Keyword.IMPORT, Keyword.LIBRARY, Keyword.PART],
- CompletionRelevance.HIGH);
+ COMPLETION_RELEVANCE_HIGH);
}
test_class() {
@@ -91,7 +92,7 @@
expect(computeFast(), isTrue);
assertSuggestKeywords(
[Keyword.EXTENDS, Keyword.IMPLEMENTS],
- CompletionRelevance.HIGH);
+ COMPLETION_RELEVANCE_HIGH);
}
test_class_extends() {
@@ -99,7 +100,7 @@
expect(computeFast(), isTrue);
assertSuggestKeywords(
[Keyword.IMPLEMENTS, Keyword.WITH],
- CompletionRelevance.HIGH);
+ COMPLETION_RELEVANCE_HIGH);
}
test_class_extends_name() {
@@ -111,7 +112,7 @@
test_class_implements() {
addTestSource('class A ^ implements foo');
expect(computeFast(), isTrue);
- assertSuggestKeywords([Keyword.EXTENDS], CompletionRelevance.HIGH);
+ assertSuggestKeywords([Keyword.EXTENDS], COMPLETION_RELEVANCE_HIGH);
}
test_class_implements_name() {
@@ -147,7 +148,7 @@
Keyword.PART,
Keyword.TYPEDEF,
Keyword.VAR],
- CompletionRelevance.HIGH);
+ COMPLETION_RELEVANCE_HIGH);
}
test_function_body() {
@@ -207,7 +208,7 @@
Keyword.PART,
Keyword.TYPEDEF,
Keyword.VAR],
- CompletionRelevance.HIGH);
+ COMPLETION_RELEVANCE_HIGH);
}
test_library_name() {
@@ -262,7 +263,7 @@
Keyword.PART,
Keyword.TYPEDEF,
Keyword.VAR],
- CompletionRelevance.HIGH);
+ COMPLETION_RELEVANCE_HIGH);
}
test_partial_class() {
@@ -280,7 +281,7 @@
Keyword.PART,
Keyword.TYPEDEF,
Keyword.VAR],
- CompletionRelevance.HIGH);
+ COMPLETION_RELEVANCE_HIGH);
}
test_partial_class2() {
@@ -297,7 +298,7 @@
Keyword.PART,
Keyword.TYPEDEF,
Keyword.VAR],
- CompletionRelevance.HIGH);
+ COMPLETION_RELEVANCE_HIGH);
}
void _appendKeywords(StringBuffer msg, Iterable<Keyword> keywords) {
diff --git a/pkg/analysis_server/test/services/completion/local_computer_test.dart b/pkg/analysis_server/test/services/completion/local_computer_test.dart
index 17c1f37..2399393 100644
--- a/pkg/analysis_server/test/services/completion/local_computer_test.dart
+++ b/pkg/analysis_server/test/services/completion/local_computer_test.dart
@@ -4,6 +4,8 @@
library test.services.completion.dart.local;
+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_computer.dart';
import 'package:unittest/unittest.dart';
@@ -15,11 +17,295 @@
runReflectiveTests(LocalComputerTest);
}
-@ReflectiveTestCase()
+@reflectiveTest
class LocalComputerTest extends AbstractSelectorSuggestionTest {
@override
+ CompletionSuggestion assertSuggestLocalField(String name, String type,
+ [int relevance = COMPLETION_RELEVANCE_DEFAULT]) {
+ return assertSuggestField(name, type, relevance: relevance);
+ }
+
+ @override
void setUpComputer() {
computer = new LocalComputer();
}
+
+ test_break_ignores_outer_functions_using_closure() {
+ addTestSource('''
+void main() {
+ foo: while (true) {
+ var f = () {
+ bar: while (true) { break ^ }
+ };
+ }
+}
+''');
+ expect(computeFast(), isTrue);
+ // Labels in outer functions are never accessible.
+ assertSuggestLabel('bar');
+ assertNotSuggested('foo');
+ }
+
+ test_break_ignores_outer_functions_using_local_function() {
+ addTestSource('''
+void main() {
+ foo: while (true) {
+ void f() {
+ bar: while (true) { break ^ }
+ };
+ }
+}
+''');
+ expect(computeFast(), isTrue);
+ // Labels in outer functions are never accessible.
+ assertSuggestLabel('bar');
+ assertNotSuggested('foo');
+ }
+
+ test_break_ignores_toplevel_variables() {
+ addTestSource('''
+int x;
+void main() {
+ while (true) {
+ break ^
+ }
+}
+''');
+ expect(computeFast(), isTrue);
+ assertNotSuggested('x');
+ }
+
+ test_break_ignores_unrelated_statements() {
+ addTestSource('''
+void main() {
+ foo: while (true) {}
+ while (true) { break ^ }
+ bar: while (true) {}
+}
+''');
+ expect(computeFast(), isTrue);
+ // The scope of the label defined by a labeled statement is just the
+ // statement itself, so neither "foo" nor "bar" are in scope at the caret
+ // position.
+ assertNotSuggested('foo');
+ assertNotSuggested('bar');
+ }
+
+ test_break_to_enclosing_loop() {
+ addTestSource('''
+void main() {
+ foo: while (true) {
+ bar: while (true) {
+ break ^
+ }
+ }
+}
+''');
+ expect(computeFast(), isTrue);
+ assertSuggestLabel('foo');
+ assertSuggestLabel('bar');
+ }
+
+ test_continue_from_loop_to_switch() {
+ addTestSource('''
+void main() {
+ switch (x) {
+ foo: case 1:
+ break;
+ bar: case 2:
+ while (true) {
+ continue ^;
+ }
+ break;
+ baz: case 3:
+ break;
+ }
+}
+''');
+ expect(computeFast(), isTrue);
+ assertSuggestLabel('foo');
+ assertSuggestLabel('bar');
+ assertSuggestLabel('baz');
+ }
+
+ test_continue_from_switch_to_loop() {
+ addTestSource('''
+void main() {
+ foo: while (true) {
+ switch (x) {
+ case 1:
+ continue ^;
+ }
+ }
+}
+''');
+ expect(computeFast(), isTrue);
+ assertSuggestLabel('foo');
+ }
+
+ test_continue_ignores_outer_functions_using_closure_with_loop() {
+ addTestSource('''
+void main() {
+ foo: while (true) {
+ var f = () {
+ bar: while (true) { continue ^ }
+ };
+ }
+}
+''');
+ expect(computeFast(), isTrue);
+ // Labels in outer functions are never accessible.
+ assertSuggestLabel('bar');
+ assertNotSuggested('foo');
+ }
+
+ test_continue_ignores_outer_functions_using_closure_with_switch() {
+ addTestSource('''
+void main() {
+ switch (x) {
+ foo: case 1:
+ var f = () {
+ bar: while (true) { continue ^ }
+ };
+ }
+}
+''');
+ expect(computeFast(), isTrue);
+ // Labels in outer functions are never accessible.
+ assertSuggestLabel('bar');
+ assertNotSuggested('foo');
+ }
+
+ test_continue_ignores_outer_functions_using_local_function_with_loop() {
+ addTestSource('''
+void main() {
+ foo: while (true) {
+ void f() {
+ bar: while (true) { continue ^ }
+ };
+ }
+}
+''');
+ expect(computeFast(), isTrue);
+ // Labels in outer functions are never accessible.
+ assertSuggestLabel('bar');
+ assertNotSuggested('foo');
+ }
+
+ test_continue_ignores_outer_functions_using_local_function_with_switch() {
+ addTestSource('''
+void main() {
+ switch (x) {
+ foo: case 1:
+ void f() {
+ bar: while (true) { continue ^ }
+ };
+ }
+}
+''');
+ expect(computeFast(), isTrue);
+ // Labels in outer functions are never accessible.
+ assertSuggestLabel('bar');
+ assertNotSuggested('foo');
+ }
+
+ test_continue_ignores_unrelated_statements() {
+ addTestSource('''
+void main() {
+ foo: while (true) {}
+ while (true) { continue ^ }
+ bar: while (true) {}
+}
+''');
+ expect(computeFast(), isTrue);
+ // The scope of the label defined by a labeled statement is just the
+ // statement itself, so neither "foo" nor "bar" are in scope at the caret
+ // position.
+ assertNotSuggested('foo');
+ assertNotSuggested('bar');
+ }
+
+ test_continue_to_earlier_case() {
+ addTestSource('''
+void main() {
+ switch (x) {
+ foo: case 1:
+ break;
+ case 2:
+ continue ^;
+ case 3:
+ break;
+''');
+ expect(computeFast(), isTrue);
+ assertSuggestLabel('foo');
+ }
+
+ test_continue_to_enclosing_loop() {
+ addTestSource('''
+void main() {
+ foo: while (true) {
+ bar: while (true) {
+ continue ^
+ }
+ }
+}
+''');
+ expect(computeFast(), isTrue);
+ assertSuggestLabel('foo');
+ assertSuggestLabel('bar');
+ }
+
+ test_continue_to_enclosing_switch() {
+ addTestSource('''
+void main() {
+ switch (x) {
+ foo: case 1:
+ break;
+ bar: case 2:
+ switch (y) {
+ case 1:
+ continue ^;
+ }
+ break;
+ baz: case 3:
+ break;
+ }
+}
+''');
+ expect(computeFast(), isTrue);
+ assertSuggestLabel('foo');
+ assertSuggestLabel('bar');
+ assertSuggestLabel('baz');
+ }
+
+ test_continue_to_later_case() {
+ addTestSource('''
+void main() {
+ switch (x) {
+ case 1:
+ break;
+ case 2:
+ continue ^;
+ foo: case 3:
+ break;
+''');
+ expect(computeFast(), isTrue);
+ assertSuggestLabel('foo');
+ }
+
+ test_continue_to_same_case() {
+ addTestSource('''
+void main() {
+ switch (x) {
+ case 1:
+ break;
+ foo: case 2:
+ continue ^;
+ case 3:
+ break;
+''');
+ expect(computeFast(), isTrue);
+ assertSuggestLabel('foo');
+ }
}
diff --git a/pkg/analysis_server/test/services/completion/optype_test.dart b/pkg/analysis_server/test/services/completion/optype_test.dart
index 254695d..eb37281 100644
--- a/pkg/analysis_server/test/services/completion/optype_test.dart
+++ b/pkg/analysis_server/test/services/completion/optype_test.dart
@@ -19,7 +19,7 @@
runReflectiveTests(OpTypeTest);
}
-@ReflectiveTestCase()
+@reflectiveTest
class OpTypeTest {
OpType visitor;
@@ -44,11 +44,14 @@
}
void assertOpType({bool invocation: false, bool returnValue: false,
- bool typeNames: false, bool voidReturn: false}) {
+ bool typeNames: false, bool voidReturn: false, bool statementLabel: false,
+ bool caseLabel: false}) {
expect(visitor.includeInvocationSuggestions, equals(invocation));
expect(visitor.includeReturnValueSuggestions, equals(returnValue));
expect(visitor.includeTypeNameSuggestions, equals(typeNames));
expect(visitor.includeVoidReturnSuggestions, equals(voidReturn));
+ expect(visitor.includeStatementLabelSuggestions, equals(statementLabel));
+ expect(visitor.includeCaseLabelSuggestions, equals(caseLabel));
}
test_Annotation() {
@@ -193,6 +196,21 @@
assertOpType(returnValue: true, typeNames: true, voidReturn: true);
}
+ test_Break_after_label() {
+ addTestSource('main() { foo: while (true) { break foo ^ ; } }');
+ assertOpType(/* No valid completions */);
+ }
+
+ test_Break_before_label() {
+ addTestSource('main() { foo: while (true) { break ^ foo; } }');
+ assertOpType(statementLabel: true);
+ }
+
+ test_Break_no_label() {
+ addTestSource('main() { foo: while (true) { break ^; } }');
+ assertOpType(statementLabel: true);
+ }
+
test_CascadeExpression_selector1() {
// PropertyAccess CascadeExpression ExpressionStatement Block
addTestSource('''
@@ -307,6 +325,21 @@
assertOpType(invocation: true);
}
+ test_Continue_after_label() {
+ addTestSource('main() { foo: while (true) { continue foo ^ ; } }');
+ assertOpType(/* No valid completions */);
+ }
+
+ test_Continue_before_label() {
+ addTestSource('main() { foo: while (true) { continue ^ foo; } }');
+ assertOpType(statementLabel: true, caseLabel: true);
+ }
+
+ test_Continue_no_label() {
+ addTestSource('main() { foo: while (true) { continue ^; } }');
+ assertOpType(statementLabel: true, caseLabel: true);
+ }
+
test_DoStatement() {
// SimpleIdentifier DoStatement Block
addTestSource('main() {do{} while(^x);}');
diff --git a/pkg/analysis_server/test/services/correction/assist_test.dart b/pkg/analysis_server/test/services/correction/assist_test.dart
index b89c6fe..1b252f3 100644
--- a/pkg/analysis_server/test/services/correction/assist_test.dart
+++ b/pkg/analysis_server/test/services/correction/assist_test.dart
@@ -22,7 +22,7 @@
}
-@ReflectiveTestCase()
+@reflectiveTest
class AssistProcessorTest extends AbstractSingleUnitTest {
Index index;
SearchEngineImpl searchEngine;
diff --git a/pkg/analysis_server/test/services/correction/change_test.dart b/pkg/analysis_server/test/services/correction/change_test.dart
index c880a09..7113f91 100644
--- a/pkg/analysis_server/test/services/correction/change_test.dart
+++ b/pkg/analysis_server/test/services/correction/change_test.dart
@@ -23,7 +23,7 @@
}
-@ReflectiveTestCase()
+@reflectiveTest
class ChangeTest {
void test_addEdit() {
SourceChange change = new SourceChange('msg');
@@ -141,7 +141,7 @@
}
-@ReflectiveTestCase()
+@reflectiveTest
class EditTest {
void test_applySequence() {
SourceEdit edit1 = new SourceEdit(5, 2, 'abc');
@@ -193,7 +193,7 @@
}
-@ReflectiveTestCase()
+@reflectiveTest
class FileEditTest {
void test_add_sorts() {
SourceEdit edit1a = new SourceEdit(1, 0, 'a1');
@@ -251,7 +251,7 @@
}
-@ReflectiveTestCase()
+@reflectiveTest
class LinkedEditGroupTest {
void test_new() {
LinkedEditGroup group = new LinkedEditGroup.empty();
@@ -292,7 +292,7 @@
}
-@ReflectiveTestCase()
+@reflectiveTest
class LinkedEditSuggestionTest {
void test_eqEq() {
var a = new LinkedEditSuggestion('a', LinkedEditSuggestionKind.METHOD);
@@ -308,7 +308,7 @@
}
-@ReflectiveTestCase()
+@reflectiveTest
class PositionTest {
void test_eqEq() {
Position a = new Position('/a.dart', 1);
diff --git a/pkg/analysis_server/test/services/correction/fix_test.dart b/pkg/analysis_server/test/services/correction/fix_test.dart
index 794b284..c359221 100644
--- a/pkg/analysis_server/test/services/correction/fix_test.dart
+++ b/pkg/analysis_server/test/services/correction/fix_test.dart
@@ -26,7 +26,7 @@
}
-@ReflectiveTestCase()
+@reflectiveTest
class FixProcessorTest extends AbstractSingleUnitTest {
Index index;
SearchEngineImpl searchEngine;
@@ -769,7 +769,34 @@
''');
}
- void test_createMissingOverrides_functionType() {
+ void test_createMissingOverrides_functionTypeAlias() {
+ _indexTestUnit('''
+typedef int Binary(int left, int right);
+
+abstract class Emulator {
+ void performBinary(Binary binary);
+}
+
+class MyEmulator extends Emulator {
+}
+''');
+ assertHasFix(FixKind.CREATE_MISSING_OVERRIDES, '''
+typedef int Binary(int left, int right);
+
+abstract class Emulator {
+ void performBinary(Binary binary);
+}
+
+class MyEmulator extends Emulator {
+ @override
+ void performBinary(Binary binary) {
+ // TODO: implement performBinary
+ }
+}
+''');
+ }
+
+ void test_createMissingOverrides_functionTypedParameter() {
_indexTestUnit('''
abstract class A {
forEach(int f(double p1, String p2));
diff --git a/pkg/analysis_server/test/services/correction/levenshtein_test.dart b/pkg/analysis_server/test/services/correction/levenshtein_test.dart
index b810ee6..5820acb 100644
--- a/pkg/analysis_server/test/services/correction/levenshtein_test.dart
+++ b/pkg/analysis_server/test/services/correction/levenshtein_test.dart
@@ -15,7 +15,7 @@
runReflectiveTests(LevenshteinTest);
}
-@ReflectiveTestCase()
+@reflectiveTest
class LevenshteinTest {
void test_different_caseInsensitive() {
expect(levenshtein('Saturday', 'sunday', 5, caseSensitive: false), 3);
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 c1b2273..ee82145 100644
--- a/pkg/analysis_server/test/services/correction/name_suggestion_test.dart
+++ b/pkg/analysis_server/test/services/correction/name_suggestion_test.dart
@@ -19,7 +19,7 @@
}
-@ReflectiveTestCase()
+@reflectiveTest
class VariableNameSuggestionTest extends AbstractSingleUnitTest {
void test_forExpression_cast() {
resolveTestUnit('''
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 1d0a975..70eb570 100644
--- a/pkg/analysis_server/test/services/correction/sort_members_test.dart
+++ b/pkg/analysis_server/test/services/correction/sort_members_test.dart
@@ -18,7 +18,7 @@
}
-@ReflectiveTestCase()
+@reflectiveTest
class SortMembersTest extends AbstractSingleUnitTest {
void test_classMembers_accessor() {
_parseTestUnit(r'''
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 cd4a12c..5881a77 100644
--- a/pkg/analysis_server/test/services/correction/source_range_test.dart
+++ b/pkg/analysis_server/test/services/correction/source_range_test.dart
@@ -22,7 +22,7 @@
}
-@ReflectiveTestCase()
+@reflectiveTest
class SourceRangesTest extends AbstractSingleUnitTest {
void test_rangeElementName() {
resolveTestUnit('class ABC {}');
diff --git a/pkg/analysis_server/test/services/correction/status_test.dart b/pkg/analysis_server/test/services/correction/status_test.dart
index 560d346..93f9a08 100644
--- a/pkg/analysis_server/test/services/correction/status_test.dart
+++ b/pkg/analysis_server/test/services/correction/status_test.dart
@@ -24,7 +24,7 @@
}
-@ReflectiveTestCase()
+@reflectiveTest
class RefactoringLocationTest extends AbstractSingleUnitTest {
void test_createLocation_forElement() {
resolveTestUnit('class MyClass {}');
@@ -75,7 +75,7 @@
}
-@ReflectiveTestCase()
+@reflectiveTest
class RefactoringStatusTest {
void test_addError() {
RefactoringStatus refactoringStatus = new RefactoringStatus();
diff --git a/pkg/analysis_server/test/services/correction/strings_test.dart b/pkg/analysis_server/test/services/correction/strings_test.dart
index cba4315..b84c022 100644
--- a/pkg/analysis_server/test/services/correction/strings_test.dart
+++ b/pkg/analysis_server/test/services/correction/strings_test.dart
@@ -17,7 +17,7 @@
}
-@ReflectiveTestCase()
+@reflectiveTest
class StringsTest {
void test_capitalize() {
expect(capitalize(''), '');
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 89eda4b..9d2dacc 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
@@ -61,7 +61,7 @@
}
-@ReflectiveTestCase()
+@reflectiveTest
class DartUnitContributorTest extends AbstractSingleUnitTest {
IndexStore store = new MockIndexStore();
List<RecordedRelation> recordedRelations = <RecordedRelation>[];
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 6bf1f2a..558b226 100644
--- a/pkg/analysis_server/test/services/index/local_index_test.dart
+++ b/pkg/analysis_server/test/services/index/local_index_test.dart
@@ -35,7 +35,7 @@
}
-@ReflectiveTestCase()
+@reflectiveTest
class LocalIndexTest extends AbstractContextTest {
LocalIndex index;
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 9903b1f..1a79bcc 100644
--- a/pkg/analysis_server/test/services/index/store/codec_test.dart
+++ b/pkg/analysis_server/test/services/index/store/codec_test.dart
@@ -24,7 +24,7 @@
}
-@ReflectiveTestCase()
+@reflectiveTest
class _ContextCodecTest {
ContextCodec codec = new ContextCodec();
@@ -63,7 +63,7 @@
}
-@ReflectiveTestCase()
+@reflectiveTest
class _ElementCodecTest extends AbstractSingleUnitTest {
ElementCodec codec;
AnalysisContext context = new MockAnalysisContext('context');
@@ -201,7 +201,7 @@
}
-@ReflectiveTestCase()
+@reflectiveTest
class _RelationshipCodecTest {
StringCodec stringCodec = new StringCodec();
RelationshipCodec codec;
@@ -218,7 +218,7 @@
}
-@ReflectiveTestCase()
+@reflectiveTest
class _StringCodecTest {
StringCodec codec = new StringCodec();
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 e8ce718..f27214d 100644
--- a/pkg/analysis_server/test/services/index/store/collection_test.dart
+++ b/pkg/analysis_server/test/services/index/store/collection_test.dart
@@ -17,7 +17,7 @@
}
-@ReflectiveTestCase()
+@reflectiveTest
class _IntArrayToIntMapTest {
IntArrayToIntMap map = new IntArrayToIntMap();
@@ -31,7 +31,7 @@
}
-@ReflectiveTestCase()
+@reflectiveTest
class _IntToIntSetMapTest {
IntToIntSetMap map = new IntToIntSetMap();
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 d824cf5..6a8bacb 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
@@ -55,7 +55,7 @@
}
-@ReflectiveTestCase()
+@reflectiveTest
class _FileNodeManagerTest {
MockLogger logger = new MockLogger();
StringCodec stringCodec = new StringCodec();
@@ -255,7 +255,7 @@
}
-@ReflectiveTestCase()
+@reflectiveTest
class _IndexNodeTest {
AnalysisContext context = new MockAnalysisContext('context');
ElementCodec elementCodec = new MockElementCodec();
@@ -341,7 +341,7 @@
}
-@ReflectiveTestCase()
+@reflectiveTest
class _LocationDataTest {
AnalysisContext context = new MockAnalysisContext('context');
ElementCodec elementCodec = new MockElementCodec();
@@ -426,7 +426,7 @@
}
-@ReflectiveTestCase()
+@reflectiveTest
class _RelationKeyDataTest {
AnalysisContext context = new MockAnalysisContext('context');
ElementCodec elementCodec = new MockElementCodec();
@@ -478,7 +478,7 @@
-@ReflectiveTestCase()
+@reflectiveTest
class _SplitIndexStoreTest {
AnalysisContext contextA = new MockAnalysisContext('contextA');
@@ -705,6 +705,15 @@
}
}
+ void test_recordRelationship_multiplyDefinedElement() {
+ Element multiplyElement =
+ new MultiplyDefinedElementImpl(contextA, <Element>[elementA, elementB]);
+ Location location = mockLocation(elementA);
+ store.recordRelationship(multiplyElement, relationship, location);
+ store.doneIndex();
+ expect(nodeManager.isEmpty(), isTrue);
+ }
+
void test_recordRelationship_nullElement() {
Location locationA = mockLocation(elementA);
store.recordRelationship(null, relationship, locationA);
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 f9e2044..eef4933 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
@@ -19,7 +19,7 @@
}
-@ReflectiveTestCase()
+@reflectiveTest
class _SeparateFileManagerTest {
TemporaryFolderFileManager fileManager;
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 89ad088..9a07846 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
@@ -21,7 +21,7 @@
}
-@ReflectiveTestCase()
+@reflectiveTest
class ConvertGetterToMethodTest extends RefactoringTest {
ConvertGetterToMethodRefactoring refactoring;
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 543dcae1..21fdbe0 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
@@ -21,7 +21,7 @@
}
-@ReflectiveTestCase()
+@reflectiveTest
class ConvertMethodToGetterTest extends RefactoringTest {
ConvertMethodToGetterRefactoring refactoring;
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 1010ec4..e8ced6a 100644
--- a/pkg/analysis_server/test/services/refactoring/extract_local_test.dart
+++ b/pkg/analysis_server/test/services/refactoring/extract_local_test.dart
@@ -21,7 +21,7 @@
}
-@ReflectiveTestCase()
+@reflectiveTest
class ExtractLocalTest extends RefactoringTest {
ExtractLocalRefactoringImpl refactoring;
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 ba6a7d6..c77bd77 100644
--- a/pkg/analysis_server/test/services/refactoring/extract_method_test.dart
+++ b/pkg/analysis_server/test/services/refactoring/extract_method_test.dart
@@ -21,7 +21,7 @@
}
-@ReflectiveTestCase()
+@reflectiveTest
class ExtractMethodTest extends RefactoringTest {
ExtractMethodRefactoringImpl refactoring;
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 edb99b8..b4646f0 100644
--- a/pkg/analysis_server/test/services/refactoring/inline_local_test.dart
+++ b/pkg/analysis_server/test/services/refactoring/inline_local_test.dart
@@ -20,7 +20,7 @@
}
-@ReflectiveTestCase()
+@reflectiveTest
class InlineLocalTest extends RefactoringTest {
InlineLocalRefactoringImpl refactoring;
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 f76f731..01dfc52 100644
--- a/pkg/analysis_server/test/services/refactoring/inline_method_test.dart
+++ b/pkg/analysis_server/test/services/refactoring/inline_method_test.dart
@@ -22,7 +22,7 @@
}
-@ReflectiveTestCase()
+@reflectiveTest
class InlineMethodTest extends RefactoringTest {
InlineMethodRefactoringImpl refactoring;
bool deleteSource;
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 6c6d53b..3f20034 100644
--- a/pkg/analysis_server/test/services/refactoring/move_file_test.dart
+++ b/pkg/analysis_server/test/services/refactoring/move_file_test.dart
@@ -25,7 +25,7 @@
}
-@ReflectiveTestCase()
+@reflectiveTest
class MoveFileTest extends RefactoringTest {
MoveFileRefactoring refactoring;
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 dff5cf8..534149b 100644
--- a/pkg/analysis_server/test/services/refactoring/naming_conventions_test.dart
+++ b/pkg/analysis_server/test/services/refactoring/naming_conventions_test.dart
@@ -20,7 +20,7 @@
}
-@ReflectiveTestCase()
+@reflectiveTest
class NamingConventionsTest extends RefactoringTest {
@override
Refactoring get refactoring => null;
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 5bcee17..63b8f83 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
@@ -17,7 +17,7 @@
}
-@ReflectiveTestCase()
+@reflectiveTest
class RenameClassMemberTest extends RenameRefactoringTest {
test_checkFinalConditions_hasMember_MethodElement() {
indexTestUnit('''
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 94682bc..90b6153 100644
--- a/pkg/analysis_server/test/services/refactoring/rename_constructor_test.dart
+++ b/pkg/analysis_server/test/services/refactoring/rename_constructor_test.dart
@@ -19,7 +19,7 @@
}
-@ReflectiveTestCase()
+@reflectiveTest
class RenameConstructorTest extends RenameRefactoringTest {
test_checkFinalConditions_hasMember_constructor() {
indexTestUnit('''
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 2d15c49..f0846cf 100644
--- a/pkg/analysis_server/test/services/refactoring/rename_import_test.dart
+++ b/pkg/analysis_server/test/services/refactoring/rename_import_test.dart
@@ -18,7 +18,7 @@
}
-@ReflectiveTestCase()
+@reflectiveTest
class RenameImportTest extends RenameRefactoringTest {
test_checkNewName() {
indexTestUnit("import 'dart:async' as test;");
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 cc8268d..bd41cbc 100644
--- a/pkg/analysis_server/test/services/refactoring/rename_label_test.dart
+++ b/pkg/analysis_server/test/services/refactoring/rename_label_test.dart
@@ -17,7 +17,7 @@
}
-@ReflectiveTestCase()
+@reflectiveTest
class RenameLabelTest extends RenameRefactoringTest {
test_checkNewName_LocalVariableElement() {
indexTestUnit('''
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 6d10598..552ff56 100644
--- a/pkg/analysis_server/test/services/refactoring/rename_library_test.dart
+++ b/pkg/analysis_server/test/services/refactoring/rename_library_test.dart
@@ -19,7 +19,7 @@
}
-@ReflectiveTestCase()
+@reflectiveTest
class RenameLibraryTest extends RenameRefactoringTest {
void test_checkNewName() {
indexTestUnit('''
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 226733e..8cb9478 100644
--- a/pkg/analysis_server/test/services/refactoring/rename_local_test.dart
+++ b/pkg/analysis_server/test/services/refactoring/rename_local_test.dart
@@ -17,7 +17,7 @@
}
-@ReflectiveTestCase()
+@reflectiveTest
class RenameLocalTest extends RenameRefactoringTest {
test_checkFinalConditions_hasLocalFunction_after() {
indexTestUnit('''
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 4356a89..803e9ba 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
@@ -17,7 +17,7 @@
}
-@ReflectiveTestCase()
+@reflectiveTest
class RenameUnitMemberTest extends RenameRefactoringTest {
test_checkFinalConditions_hasTopLevel_ClassElement() {
indexTestUnit('''
diff --git a/pkg/analysis_server/test/services/search/hierarchy_test.dart b/pkg/analysis_server/test/services/search/hierarchy_test.dart
index 87f5eb5..c2acc44 100644
--- a/pkg/analysis_server/test/services/search/hierarchy_test.dart
+++ b/pkg/analysis_server/test/services/search/hierarchy_test.dart
@@ -23,7 +23,7 @@
}
-@ReflectiveTestCase()
+@reflectiveTest
class HierarchyTest extends AbstractSingleUnitTest {
Index index;
SearchEngineImpl searchEngine;
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 b52f81b..a46e524 100644
--- a/pkg/analysis_server/test/services/search/search_engine_test.dart
+++ b/pkg/analysis_server/test/services/search/search_engine_test.dart
@@ -16,7 +16,6 @@
import 'package:unittest/unittest.dart';
import '../../abstract_single_unit.dart';
-import '../../mocks.dart';
import '../../reflective_tests.dart';
@@ -64,33 +63,12 @@
}
-class MockAngularComponentElement extends TypedMock implements
- AngularComponentElement {
- final kind = ElementKind.ANGULAR_COMPONENT;
- noSuchMethod(Invocation invocation) => super.noSuchMethod(invocation);
-}
-
-
-class MockAngularControllerElement extends TypedMock implements
- AngularControllerElement {
- final kind = ElementKind.ANGULAR_CONTROLLER;
- noSuchMethod(Invocation invocation) => super.noSuchMethod(invocation);
-}
-
-
-class MockAngularFormatterElement extends TypedMock implements
- AngularFormatterElement {
- final kind = ElementKind.ANGULAR_FORMATTER;
- noSuchMethod(Invocation invocation) => super.noSuchMethod(invocation);
-}
-
-
class MockIndex extends TypedMock implements Index {
noSuchMethod(Invocation invocation) => super.noSuchMethod(invocation);
}
-@ReflectiveTestCase()
+@reflectiveTest
class SearchEngineImplTest extends AbstractSingleUnitTest {
Index index;
SearchEngineImpl searchEngine;
@@ -189,33 +167,6 @@
});
}
- Future test_searchReferences_AngularComponentElement() {
- // use mocks
- index = new MockIndex();
- searchEngine = new SearchEngineImpl(index);
- Element elementA = new MockElement('A');
- Element elementB = new MockElement('B');
- // fill mocks
- AngularComponentElement element = new MockAngularComponentElement();
- void mockLocation(Element element, Relationship relationship,
- Location location) {
- index.getRelationships(element, relationship);
- when(null).thenReturn(new Future.value([location]));
- }
- mockLocation(
- element,
- IndexConstants.ANGULAR_REFERENCE,
- new Location(elementA, 1, 10));
- mockLocation(
- element,
- IndexConstants.ANGULAR_CLOSING_TAG_REFERENCE,
- new Location(elementB, 2, 20));
- var expected = [
- new ExpectedMatch(elementA, MatchKind.ANGULAR_REFERENCE, 1, 10),
- new ExpectedMatch(elementB, MatchKind.ANGULAR_CLOSING_TAG_REFERENCE, 2, 20)];
- return _verifyReferences(element, expected);
- }
-
Future test_searchReferences_ClassElement() {
_indexTestUnit('''
class A {}
diff --git a/pkg/analysis_server/test/socket_server_test.dart b/pkg/analysis_server/test/socket_server_test.dart
index 047a1c8..c126bd0 100644
--- a/pkg/analysis_server/test/socket_server_test.dart
+++ b/pkg/analysis_server/test/socket_server_test.dart
@@ -8,6 +8,7 @@
import 'package:analysis_server/src/analysis_server.dart';
import 'package:analysis_server/src/constants.dart';
+import 'package:analysis_server/src/plugin/server_plugin.dart';
import 'package:analysis_server/src/protocol.dart';
import 'package:analysis_server/src/socket_server.dart';
import 'package:analyzer/instrumentation/instrumentation.dart';
@@ -15,6 +16,7 @@
import 'package:unittest/unittest.dart';
import 'mocks.dart';
+import 'package:analysis_server/src/plugin/plugin_impl.dart';
main() {
group('SocketServer', () {
@@ -33,10 +35,7 @@
class SocketServerTest {
static void createAnalysisServer_alreadyStarted() {
- SocketServer server = new SocketServer(
- new AnalysisServerOptions(),
- DirectoryBasedDartSdk.defaultSdk,
- InstrumentationService.NULL_SERVICE);
+ SocketServer server = _createSocketServer();
MockServerChannel channel1 = new MockServerChannel();
MockServerChannel channel2 = new MockServerChannel();
server.createAnalysisServer(channel1);
@@ -61,10 +60,7 @@
}
static Future createAnalysisServer_successful() {
- SocketServer server = new SocketServer(
- new AnalysisServerOptions(),
- DirectoryBasedDartSdk.defaultSdk,
- InstrumentationService.NULL_SERVICE);
+ SocketServer server = _createSocketServer();
MockServerChannel channel = new MockServerChannel();
server.createAnalysisServer(channel);
channel.expectMsgCount(notificationCount: 1);
@@ -78,10 +74,7 @@
}
static Future requestHandler_exception() {
- SocketServer server = new SocketServer(
- new AnalysisServerOptions(),
- DirectoryBasedDartSdk.defaultSdk,
- InstrumentationService.NULL_SERVICE);
+ SocketServer server = _createSocketServer();
MockServerChannel channel = new MockServerChannel();
server.createAnalysisServer(channel);
channel.expectMsgCount(notificationCount: 1);
@@ -101,10 +94,7 @@
}
static Future requestHandler_futureException() {
- SocketServer server = new SocketServer(
- new AnalysisServerOptions(),
- DirectoryBasedDartSdk.defaultSdk,
- InstrumentationService.NULL_SERVICE);
+ SocketServer server = _createSocketServer();
MockServerChannel channel = new MockServerChannel();
server.createAnalysisServer(channel);
_MockRequestHandler handler = new _MockRequestHandler(true);
@@ -117,6 +107,17 @@
expect(channel.notificationsReceived[1].event, SERVER_ERROR);
});
}
+
+ static SocketServer _createSocketServer() {
+ ServerPlugin serverPlugin = new ServerPlugin();
+ ExtensionManager manager = new ExtensionManager();
+ manager.processPlugins([serverPlugin]);
+ return new SocketServer(
+ new AnalysisServerOptions(),
+ DirectoryBasedDartSdk.defaultSdk,
+ InstrumentationService.NULL_SERVICE,
+ serverPlugin);
+ }
}
class _MockRequestHandler implements RequestHandler {
diff --git a/pkg/analysis_server/test/test_all.dart b/pkg/analysis_server/test/test_all.dart
index 0a2ff15..eaafee4 100644
--- a/pkg/analysis_server/test/test_all.dart
+++ b/pkg/analysis_server/test/test_all.dart
@@ -14,6 +14,7 @@
import 'domain_server_test.dart' as domain_server_test;
import 'edit/test_all.dart' as edit_all;
import 'operation/test_all.dart' as operation_test_all;
+import 'plugin/test_all.dart' as plugin_test_all;
import 'protocol_server_test.dart' as protocol_server_test;
import 'protocol_test.dart' as protocol_test;
import 'search/test_all.dart' as search_all;
@@ -36,6 +37,7 @@
domain_server_test.main();
edit_all.main();
operation_test_all.main();
+ plugin_test_all.main();
protocol_server_test.main();
protocol_test.main();
search_all.main();
diff --git a/pkg/analysis_server/tool/spec/codegen_analysis_server.dart b/pkg/analysis_server/tool/spec/codegen_analysis_server.dart
index e491f69..2559d1a 100644
--- a/pkg/analysis_server/tool/spec/codegen_analysis_server.dart
+++ b/pkg/analysis_server/tool/spec/codegen_analysis_server.dart
@@ -78,6 +78,17 @@
});
//
+ // isSocketOpen()
+ //
+ publicMethod('isSocketOpen', () {
+ writeln('''/**
+ * Return {@code true} if the socket is open.
+ */''');
+ writeln(
+ 'public boolean isSocketOpen();');
+ });
+
+ //
// start(..)
//
publicMethod('start', () {
diff --git a/pkg/analysis_server/tool/spec/codegen_tools.dart b/pkg/analysis_server/tool/spec/codegen_tools.dart
index 922b482..898f4b7 100644
--- a/pkg/analysis_server/tool/spec/codegen_tools.dart
+++ b/pkg/analysis_server/tool/spec/codegen_tools.dart
@@ -211,14 +211,15 @@
bool check() {
Map<String, FileContentsComputer> map = directoryContentsComputer();
try {
- map.forEach((String file, FileContentsComputer fileContentsComputer) {
+ for (String file in map.keys) {
+ FileContentsComputer fileContentsComputer = map[file];
String expectedContents = fileContentsComputer();
File outputFile =
new File(joinAll(posix.split(posix.join(outputDirPath, file))));
if (expectedContents != outputFile.readAsStringSync()) {
return false;
}
- });
+ }
int nonHiddenFileCount = 0;
outputFile.listSync(
recursive: false,
diff --git a/pkg/analysis_server/tool/spec/spec_input.html b/pkg/analysis_server/tool/spec/spec_input.html
index ad32f19..aa86cb6 100644
--- a/pkg/analysis_server/tool/spec/spec_input.html
+++ b/pkg/analysis_server/tool/spec/spec_input.html
@@ -1224,6 +1224,13 @@
matching the original as possible, but whitespace at the beginning or
end of the selected region will be ignored.
</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.
+ </p>
<params>
<field name="file">
<ref>FilePath</ref>
@@ -1781,11 +1788,10 @@
An enumeration of the possible types of analysis errors.
</p>
<enum>
- <value><code>ANGULAR</code></value>
<value><code>CHECKED_MODE_COMPILE_TIME_ERROR</code></value>
<value><code>COMPILE_TIME_ERROR</code></value>
<value><code>HINT</code></value>
- <value><code>POLYMER</code></value>
+ <value><code>LINT</code></value>
<value><code>STATIC_TYPE_WARNING</code></value>
<value><code>STATIC_WARNING</code></value>
<value><code>SYNTACTIC_ERROR</code></value>
@@ -1801,6 +1807,7 @@
<object>
<field name="enableAsync" optional="true">
<ref>bool</ref>
+ <p><b><i>Deprecated</i></b>/<p>
<p>
True if the client wants to enable support for the
proposed async feature.
@@ -1808,6 +1815,7 @@
</field>
<field name="enableDeferredLoading" optional="true">
<ref>bool</ref>
+ <p><b><i>Deprecated</i></b>/<p>
<p>
True if the client wants to enable support for the
proposed deferred loading feature.
@@ -1815,6 +1823,7 @@
</field>
<field name="enableEnums" optional="true">
<ref>bool</ref>
+ <p><b><i>Deprecated</i></b>/<p>
<p>
True if the client wants to enable support for the
proposed enum feature.
@@ -1830,7 +1839,14 @@
<field name="generateHints" optional="true">
<ref>bool</ref>
<p>
- True is hints should be generated as part of generating
+ True if hints should be generated as part of generating
+ errors and warnings.
+ </p>
+ </field>
+ <field name="generateLints" optional="true">
+ <ref>bool</ref>
+ <p>
+ True if lints should be generated as part of generating
errors and warnings.
</p>
</field>
@@ -1907,17 +1923,6 @@
completion request.
</p>
</type>
- <type name="CompletionRelevance">
- <p>
- An enumeration of the relevance of a completion
- suggestion.
- </p>
- <enum>
- <value><code>LOW</code></value>
- <value><code>DEFAULT</code></value>
- <value><code>HIGH</code></value>
- </enum>
- </type>
<type name="CompletionSuggestion">
<p>
A suggestion for how to complete partially entered text. Many
@@ -1932,9 +1937,10 @@
</p>
</field>
<field name="relevance">
- <ref>CompletionRelevance</ref>
+ <ref>int</ref>
<p>
- The relevance of this completion suggestion.
+ The relevance of this completion suggestion
+ where a higher number indicates a higher relevance.
</p>
</field>
<field name="completion">
@@ -2007,8 +2013,9 @@
<field name="returnType" optional="true">
<ref>String</ref>
<p>
- The return type of the getter, function or method being
- suggested. This field is omitted if the suggested element
+ 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.
</p>
</field>
@@ -2960,6 +2967,13 @@
</p>
</value>
<value>
+ <code>FORMAT_INVALID_FILE</code>
+ <p>
+ An "edit.format" request specified a FilePath
+ which does not match a Dart file in an analysis root.
+ </p>
+ </value>
+ <value>
<code>GET_ERRORS_INVALID_FILE</code>
<p>
An "analysis.getErrors" request specified a FilePath
diff --git a/pkg/analyzer/bin/coverage.dart b/pkg/analyzer/bin/coverage.dart
deleted file mode 100644
index 6fbc0d1..0000000
--- a/pkg/analyzer/bin/coverage.dart
+++ /dev/null
@@ -1,88 +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 runtime.coverage;
-
-import 'dart:io';
-
-import 'package:analyzer/src/services/runtime/coverage/coverage_impl.dart';
-import 'package:analyzer/src/services/runtime/log.dart' as log;
-import 'package:args/args.dart';
-
-
-/// General error code.
-const ERROR = 1;
-
-
-final ArgParser _argParser = new ArgParser()
- ..addFlag('help', negatable: false, help: 'Print this usage information.')
- ..addOption(
- 'level',
- help: 'The level of the coverage.',
- allowed: ['method', 'block', 'statement'],
- defaultsTo: 'statement')
- ..addOption('out', help: 'The output file with statistics.')
- ..addOption(
- 'port',
- help: 'The port to run server on, if 0 select any.',
- defaultsTo: '0');
-
-
-main(args) {
- ArgResults options;
- try {
- options = _argParser.parse(args);
- } on FormatException catch (e) {
- print(e.message);
- print('Run "coverage --help" to see available options.');
- exit(ERROR);
- }
-
- if (options['help']) {
- printUsage();
- return;
- }
-
- // No script to run.
- if (options.rest.isEmpty) {
- printUsage('<No script to run specified>');
- exit(ERROR);
- }
-
- // More than one script specified.
- if (options.rest.length != 1) {
- print('<Only one script should be specified>');
- exit(ERROR);
- }
-
- var scriptPath = options.rest[0];
-
- // Validate that script file exists.
- if (!new File(scriptPath).existsSync()) {
- print('<File "$scriptPath" does not exist>');
- exit(ERROR);
- }
-
- // Prepare output file path.
- var outPath = options['out'];
- if (outPath == null) {
- printUsage('No --out specified.');
- exit(ERROR);
- }
-
- // Configure logigng.
- log.everything();
- log.toConsole();
-
- // Run script.
- runServerApplication(scriptPath, outPath);
-}
-
-
-printUsage([var description = 'Code coverage tool for Dart.']) {
- var usage = _argParser.usage;
- print('$description\n');
- print('Usage: coverage [options] <script>\n');
- print('$usage\n');
-}
diff --git a/pkg/analyzer/lib/instrumentation/file_instrumentation.dart b/pkg/analyzer/lib/instrumentation/file_instrumentation.dart
new file mode 100644
index 0000000..011d211
--- /dev/null
+++ b/pkg/analyzer/lib/instrumentation/file_instrumentation.dart
@@ -0,0 +1,38 @@
+// 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 file_instrumentation;
+
+import 'dart:io';
+
+import 'package:analyzer/instrumentation/instrumentation.dart';
+
+
+/**
+ * An [InstrumentationServer] that writes to a file.
+ */
+class FileInstrumentationServer implements InstrumentationServer {
+ IOSink _sink;
+
+ FileInstrumentationServer(String path) {
+ File file = new File(path);
+ _sink = file.openWrite(mode: FileMode.APPEND);
+ }
+
+ @override
+ void log(String message) {
+ _sink.writeln(message);
+ }
+
+ @override
+ void logWithPriority(String message) {
+ log(message);
+ }
+
+ @override
+ void shutdown() {
+ _sink.close();
+ _sink = null;
+ }
+}
diff --git a/pkg/analyzer/lib/instrumentation/instrumentation.dart b/pkg/analyzer/lib/instrumentation/instrumentation.dart
index 77547fb..c3a9920 100644
--- a/pkg/analyzer/lib/instrumentation/instrumentation.dart
+++ b/pkg/analyzer/lib/instrumentation/instrumentation.dart
@@ -5,6 +5,14 @@
library instrumentation;
/**
+ * A container with analysis performance constants.
+ */
+class AnalysisPerformanceKind {
+ static const String FULL = 'analysis_full';
+ static const String INCREMENTAL = 'analysis_incremental';
+}
+
+/**
* The interface used by client code to communicate with an instrumentation
* server.
*/
@@ -47,7 +55,10 @@
static const String TAG_ERROR = 'Err';
static const String TAG_EXCEPTION = 'Ex';
+ static const String TAG_FILE_READ = 'Read';
+ static const String TAG_LOG_ENTRY = 'Log';
static const String TAG_NOTIFICATION = 'Noti';
+ static const String TAG_PERFORMANCE = 'Perf';
static const String TAG_REQUEST = 'Req';
static const String TAG_RESPONSE = 'Res';
static const String TAG_VERSION = 'Ver';
@@ -89,6 +100,30 @@
}
/**
+ * Log that the contents of the file with the given [path] were read. The file
+ * had the given [content] and [modificationTime].
+ */
+ void logFileRead(String path, int modificationTime, String content) {
+ if (_instrumentationServer != null) {
+ String timeStamp = _toString(modificationTime);
+ _instrumentationServer.log(_join([TAG_FILE_READ, path, timeStamp, content]));
+ }
+ }
+
+ /**
+ * Log that a log entry that was written to the analysis engine's log. The log
+ * entry has the given [level] and [message], and was created at the given
+ * [time].
+ */
+ void logLogEntry(String level, DateTime time, String message) {
+ if (_instrumentationServer != null) {
+ String timeStamp = time == null ? 'null' : time.millisecondsSinceEpoch.toString();
+ _instrumentationServer.log(
+ _join([TAG_LOG_ENTRY, level, timeStamp, message]));
+ }
+ }
+
+ /**
* Log that a notification has been sent to the client.
*/
void logNotification(String notification) {
@@ -96,6 +131,18 @@
}
/**
+ * Log the given performance fact.
+ */
+ void logPerformance(String kind, Stopwatch sw, String message) {
+ sw.stop();
+ String elapsed = sw.elapsedMilliseconds.toString();
+ if (_instrumentationServer != null) {
+ _instrumentationServer.log(
+ _join([TAG_PERFORMANCE, kind, elapsed, message]));
+ }
+ }
+
+ /**
* Log that the given priority [exception] was thrown, with the given
* [stackTrace].
*/
@@ -186,3 +233,33 @@
return object.toString();
}
}
+
+/**
+ * An [InstrumentationServer] that sends messages to multiple instances.
+ */
+class MulticastInstrumentationServer implements InstrumentationServer {
+ final List<InstrumentationServer> _servers;
+
+ MulticastInstrumentationServer(this._servers);
+
+ @override
+ void log(String message) {
+ for (InstrumentationServer server in _servers) {
+ server.log(message);
+ }
+ }
+
+ @override
+ void logWithPriority(String message) {
+ for (InstrumentationServer server in _servers) {
+ server.logWithPriority(message);
+ }
+ }
+
+ @override
+ void shutdown() {
+ for (InstrumentationServer server in _servers) {
+ server.shutdown();
+ }
+ }
+}
diff --git a/pkg/analyzer/lib/options.dart b/pkg/analyzer/lib/options.dart
index af3c712..33a9a1e 100644
--- a/pkg/analyzer/lib/options.dart
+++ b/pkg/analyzer/lib/options.dart
@@ -26,9 +26,6 @@
/** Whether to display version information */
final bool displayVersion;
- /** Whether to enable support for the proposed enum feature. */
- final bool enableEnum;
-
/**
* Whether to treat type mismatches found during constant evaluation as
* errors.
@@ -77,7 +74,6 @@
this.definedVariables = definedVariables,
disableHints = args['no-hints'],
displayVersion = args['version'],
- enableEnum = args['enable-enum'],
enableTypeChecks = args['enable_type_checks'],
ignoreUnrecognizedFlags = args['ignore-unrecognized-flags'],
log = args['log'],
diff --git a/pkg/analyzer/lib/src/analyzer_impl.dart b/pkg/analyzer/lib/src/analyzer_impl.dart
index 34558f8..df17a70 100644
--- a/pkg/analyzer/lib/src/analyzer_impl.dart
+++ b/pkg/analyzer/lib/src/analyzer_impl.dart
@@ -178,7 +178,6 @@
AnalysisOptionsImpl contextOptions = new AnalysisOptionsImpl();
contextOptions.cacheSize = _MAX_CACHE_SIZE;
contextOptions.hint = !options.disableHints;
- contextOptions.enableEnum = options.enableEnum;
context.analysisOptions = contextOptions;
// Create and add a ChangeSet
@@ -306,17 +305,14 @@
int resolveTime = PerformanceStatistics.resolve.result;
int errorsTime = PerformanceStatistics.errors.result;
int hintsTime = PerformanceStatistics.hints.result;
- int angularTime = PerformanceStatistics.angular.result;
stdout.writeln("io-cold:$ioTime");
stdout.writeln("scan-cold:$scanTime");
stdout.writeln("parse-cold:$parseTime");
stdout.writeln("resolve-cold:$resolveTime");
stdout.writeln("errors-cold:$errorsTime");
stdout.writeln("hints-cold:$hintsTime");
- stdout.writeln("angular-cold:$angularTime");
stdout.writeln("other-cold:${totalTime
- - (ioTime + scanTime + parseTime + resolveTime + errorsTime + hintsTime
- + angularTime)}");
+ - (ioTime + scanTime + parseTime + resolveTime + errorsTime + hintsTime)}");
stdout.writeln("total-cold:$totalTime");
}
@@ -343,17 +339,14 @@
int resolveTime = PerformanceStatistics.resolve.result;
int errorsTime = PerformanceStatistics.errors.result;
int hintsTime = PerformanceStatistics.hints.result;
- int angularTime = PerformanceStatistics.angular.result;
stdout.writeln("io:$ioTime");
stdout.writeln("scan:$scanTime");
stdout.writeln("parse:$parseTime");
stdout.writeln("resolve:$resolveTime");
stdout.writeln("errors:$errorsTime");
stdout.writeln("hints:$hintsTime");
- stdout.writeln("angular:$angularTime");
stdout.writeln("other:${totalTime
- - (ioTime + scanTime + parseTime + resolveTime + errorsTime + hintsTime
- + angularTime)}");
+ - (ioTime + scanTime + parseTime + resolveTime + errorsTime + hintsTime)}");
stdout.writeln("total:$totalTime");
}
}
diff --git a/pkg/analyzer/lib/src/generated/ast.dart b/pkg/analyzer/lib/src/generated/ast.dart
index 482f041..eb65e96 100644
--- a/pkg/analyzer/lib/src/generated/ast.dart
+++ b/pkg/analyzer/lib/src/generated/ast.dart
@@ -6942,21 +6942,6 @@
if (nodeElement != null) {
return nodeElement;
}
- // TODO(brianwilkerson) Implement or delete the code below.
-// // try to get Angular specific Element
-// {
-// Element element = null;
-// if (element != null) {
-// return element;
-// }
-// }
-// // try to get Polymer specific Element
-// {
-// Element element = null;
-// if (element != null) {
-// return element;
-// }
-// }
// no Element
return null;
}
diff --git a/pkg/analyzer/lib/src/generated/element.dart b/pkg/analyzer/lib/src/generated/element.dart
index 671547f..9d4bf16 100644
--- a/pkg/analyzer/lib/src/generated/element.dart
+++ b/pkg/analyzer/lib/src/generated/element.dart
@@ -22,764 +22,6 @@
import 'utilities_collection.dart';
import 'utilities_dart.dart';
-/**
- * Information about Angular application.
- */
-class AngularApplication {
- final Source entryPoint;
-
- final Set<Source> _librarySources;
-
- final List<AngularElement> elements;
-
- final List<Source> elementSources;
-
- AngularApplication(this.entryPoint, this._librarySources, this.elements,
- this.elementSources);
-
- /**
- * Checks if this application depends on the library with the given [Source].
- */
- bool dependsOn(Source librarySource) =>
- _librarySources.contains(librarySource);
-}
-
-/**
- * The interface `AngularControllerElement` defines the Angular component described by
- * <code>Component</code> annotation.
- */
-abstract class AngularComponentElement implements AngularHasSelectorElement,
- AngularHasTemplateElement {
- /**
- * Return an array containing all of the properties declared by this component.
- */
- List<AngularPropertyElement> get properties;
-
- /**
- * Return an array containing all of the scope properties set in the implementation of this
- * component.
- */
- List<AngularScopePropertyElement> get scopeProperties;
-
- /**
- * Returns the CSS file URI.
- */
- String get styleUri;
-
- /**
- * Return the offset of the [getStyleUri] in the [getSource].
- *
- * @return the offset of the style URI
- */
- int get styleUriOffset;
-}
-
-/**
- * Implementation of `AngularComponentElement`.
- */
-class AngularComponentElementImpl extends AngularHasSelectorElementImpl
- implements AngularComponentElement {
- /**
- * The offset of the defining <code>Component</code> annotation.
- */
- final int _annotationOffset;
-
- /**
- * The array containing all of the properties declared by this component.
- */
- List<AngularPropertyElement> _properties = AngularPropertyElement.EMPTY_ARRAY;
-
- /**
- * The array containing all of the scope properties set by this component.
- */
- List<AngularScopePropertyElement> _scopeProperties =
- AngularScopePropertyElement.EMPTY_ARRAY;
-
- /**
- * The the CSS file URI.
- */
- String styleUri;
-
- /**
- * The offset of the [styleUri] in the [getSource].
- */
- int styleUriOffset = 0;
-
- /**
- * The HTML template URI.
- */
- String templateUri;
-
- /**
- * The HTML template source.
- */
- Source templateSource;
-
- /**
- * The offset of the [templateUri] in the [getSource].
- */
- int templateUriOffset = 0;
-
- /**
- * Initialize a newly created Angular component to have the given name.
- *
- * @param name the name of this element
- * @param nameOffset the offset of the name of this element in the file that contains the
- * declaration of this element
- */
- AngularComponentElementImpl(String name, int nameOffset,
- this._annotationOffset)
- : super(name, nameOffset);
-
- @override
- String get identifier => "AngularComponent@$_annotationOffset";
-
- @override
- ElementKind get kind => ElementKind.ANGULAR_COMPONENT;
-
- @override
- List<AngularPropertyElement> get properties => _properties;
-
- /**
- * Set an array containing all of the properties declared by this component.
- *
- * @param properties the properties to set
- */
- void set properties(List<AngularPropertyElement> properties) {
- for (AngularPropertyElement property in properties) {
- encloseElement(property as AngularPropertyElementImpl);
- }
- this._properties = properties;
- }
-
- @override
- List<AngularScopePropertyElement> get scopeProperties => _scopeProperties;
-
- /**
- * Set an array containing all of the scope properties declared by this component.
- *
- * @param properties the properties to set
- */
- void set scopeProperties(List<AngularScopePropertyElement> properties) {
- for (AngularScopePropertyElement property in properties) {
- encloseElement(property as AngularScopePropertyElementImpl);
- }
- this._scopeProperties = properties;
- }
-
- @override
- accept(ElementVisitor visitor) => visitor.visitAngularComponentElement(this);
-
- @override
- void visitChildren(ElementVisitor visitor) {
- safelyVisitChildren(_properties, visitor);
- safelyVisitChildren(_scopeProperties, visitor);
- super.visitChildren(visitor);
- }
-}
-
-/**
- * The interface `AngularControllerElement` defines the Angular controller described by
- * <code>Controller</code> annotation.
- */
-abstract class AngularControllerElement implements AngularHasSelectorElement {
-}
-
-/**
- * Implementation of `AngularControllerElement`.
- */
-class AngularControllerElementImpl extends AngularHasSelectorElementImpl
- implements AngularControllerElement {
- /**
- * Initialize a newly created Angular controller to have the given name.
- *
- * @param name the name of this element
- * @param nameOffset the offset of the name of this element in the file that contains the
- * declaration of this element
- */
- AngularControllerElementImpl(String name, int nameOffset)
- : super(name, nameOffset);
-
- @override
- ElementKind get kind => ElementKind.ANGULAR_CONTROLLER;
-
- @override
- accept(ElementVisitor visitor) => visitor.visitAngularControllerElement(this);
-}
-
-/**
- * The interface `AngularDirectiveElement` defines the Angular controller described by
- * <code>Decorator</code> annotation.
- */
-abstract class AngularDecoratorElement implements AngularHasSelectorElement {
- /**
- * Return an array containing all of the properties declared by this directive.
- */
- List<AngularPropertyElement> get properties;
-
- /**
- * Checks if this directive is implemented by the class with given name.
- */
- bool isClass(String name);
-}
-
-/**
- * Implementation of `AngularDirectiveElement`.
- */
-class AngularDecoratorElementImpl extends AngularHasSelectorElementImpl
- implements AngularDecoratorElement {
- /**
- * The offset of the annotation that defines this directive.
- */
- final int _offset;
-
- /**
- * The array containing all of the properties declared by this directive.
- */
- List<AngularPropertyElement> _properties = AngularPropertyElement.EMPTY_ARRAY;
-
- /**
- * Initialize a newly created Angular directive to have the given name.
- *
- * @param offset the offset of the annotation that defines this directive
- */
- AngularDecoratorElementImpl(this._offset) : super(null, -1);
-
- @override
- String get displayName => selector.displayName;
-
- @override
- String get identifier => "Decorator@$_offset";
-
- @override
- ElementKind get kind => ElementKind.ANGULAR_DIRECTIVE;
-
- @override
- List<AngularPropertyElement> get properties => _properties;
-
- /**
- * Set an array containing all of the properties declared by this directive.
- *
- * @param properties the properties to set
- */
- void set properties(List<AngularPropertyElement> properties) {
- for (AngularPropertyElement property in properties) {
- encloseElement(property as AngularPropertyElementImpl);
- }
- this._properties = properties;
- }
-
- @override
- accept(ElementVisitor visitor) => visitor.visitAngularDirectiveElement(this);
-
- @override
- bool isClass(String name) {
- Element enclosing = enclosingElement;
- return enclosing is ClassElement && enclosing.name == name;
- }
-
- @override
- void visitChildren(ElementVisitor visitor) {
- safelyVisitChildren(_properties, visitor);
- super.visitChildren(visitor);
- }
-}
-
-/**
- * The interface `AngularElement` defines the behavior of objects representing information
- * about an Angular specific element.
- */
-abstract class AngularElement implements ToolkitObjectElement {
- /**
- * An empty list of Angular elements.
- */
- static const List<AngularElement> EMPTY_ARRAY = const <AngularElement>[];
-
- /**
- * Returns the [AngularApplication] this element is used in.
- *
- * @return the [AngularApplication] this element is used in
- */
- AngularApplication get application;
-}
-
-/**
- * Implementation of `AngularElement`.
- */
-abstract class AngularElementImpl extends ToolkitObjectElementImpl implements
- AngularElement {
- /**
- * The [AngularApplication] this element is used in.
- */
- AngularApplication _application;
-
- /**
- * Initialize a newly created Angular element to have the given name.
- *
- * @param name the name of this element
- * @param nameOffset the offset of the name of this element in the file that contains the
- * declaration of this element
- */
- AngularElementImpl(String name, int nameOffset) : super(name, nameOffset);
-
- @override
- AngularApplication get application => _application;
-
- /**
- * Set the [AngularApplication] this element is used in.
- */
- void set application(AngularApplication application) {
- this._application = application;
- }
-}
-
-/**
- * The interface `AngularFormatterElement` defines the Angular formatter described by
- * <code>Formatter</code> annotation.
- */
-abstract class AngularFormatterElement implements AngularElement {
-}
-
-/**
- * Implementation of `AngularFormatterElement`.
- */
-class AngularFormatterElementImpl extends AngularElementImpl implements
- AngularFormatterElement {
- /**
- * Initialize a newly created Angular formatter to have the given name.
- *
- * @param name the name of this element
- * @param nameOffset the offset of the name of this element in the file that contains the
- * declaration of this element
- */
- AngularFormatterElementImpl(String name, int nameOffset)
- : super(name, nameOffset);
-
- @override
- ElementKind get kind => ElementKind.ANGULAR_FORMATTER;
-
- @override
- accept(ElementVisitor visitor) => visitor.visitAngularFormatterElement(this);
-}
-
-/**
- * [AngularSelectorElement] based on presence of attribute.
- */
-abstract class AngularHasAttributeSelectorElement implements
- AngularSelectorElement {
-}
-
-/**
- * [AngularSelectorElement] based on presence of a class.
- */
-abstract class AngularHasClassSelectorElement implements AngularSelectorElement
- {
-}
-
-/**
- * Implementation of [AngularSelectorElement] based on presence of a class.
- */
-class AngularHasClassSelectorElementImpl extends AngularSelectorElementImpl
- implements AngularHasClassSelectorElement {
- AngularHasClassSelectorElementImpl(String name, int offset)
- : super(name, offset);
-
- @override
- void appendTo(StringBuffer buffer) {
- buffer.write(".");
- buffer.write(name);
- }
-
- @override
- bool apply(XmlTagNode node) {
- XmlAttributeNode attribute = node.getAttribute("class");
- if (attribute != null) {
- String text = attribute.text;
- if (text != null) {
- String name = this.name;
- for (String className in StringUtils.split(text)) {
- if (className == name) {
- return true;
- }
- }
- }
- }
- return false;
- }
-}
-
-/**
- * The interface `AngularElement` defines the behavior of objects representing information
- * about an Angular element which is applied conditionally using some [AngularSelectorElement].
- */
-abstract class AngularHasSelectorElement implements AngularElement {
- /**
- * Returns the selector specified for this element.
- *
- * @return the [AngularSelectorElement] specified for this element
- */
- AngularSelectorElement get selector;
-}
-
-/**
- * Implementation of `AngularSelectorElement`.
- */
-abstract class AngularHasSelectorElementImpl extends AngularElementImpl
- implements AngularHasSelectorElement {
- /**
- * The selector of this element.
- */
- AngularSelectorElement _selector;
-
- /**
- * Initialize a newly created Angular element to have the given name.
- *
- * @param name the name of this element
- * @param nameOffset the offset of the name of this element in the file that contains the
- * declaration of this element
- */
- AngularHasSelectorElementImpl(String name, int nameOffset)
- : super(name, nameOffset);
-
- @override
- AngularSelectorElement get selector => _selector;
-
- /**
- * Set the selector of this selector-based element.
- *
- * @param selector the selector to set
- */
- void set selector(AngularSelectorElement selector) {
- encloseElement(selector as AngularSelectorElementImpl);
- this._selector = selector;
- }
-
- @override
- void visitChildren(ElementVisitor visitor) {
- safelyVisitChild(_selector, visitor);
- super.visitChildren(visitor);
- }
-}
-
-/**
- * The interface `AngularHasTemplateElement` defines common behavior for
- * [AngularElement] that have template URI / [Source].
- */
-abstract class AngularHasTemplateElement implements AngularElement {
- /**
- * Returns the HTML template [Source], `null` if not resolved.
- */
- Source get templateSource;
-
- /**
- * Returns the HTML template URI.
- */
- String get templateUri;
-
- /**
- * Return the offset of the [getTemplateUri] in the [getSource].
- *
- * @return the offset of the template URI
- */
- int get templateUriOffset;
-}
-
-/**
- * The interface `AngularPropertyElement` defines a single property in
- * [AngularComponentElement].
- */
-abstract class AngularPropertyElement implements AngularElement {
- /**
- * An empty list of property elements.
- */
- static const List<AngularPropertyElement> EMPTY_ARRAY = const
- <AngularPropertyElement>[
- ];
-
- /**
- * Returns the field this property is mapped to.
- *
- * @return the field this property is mapped to.
- */
- FieldElement get field;
-
- /**
- * Return the offset of the field name of this property in the property map, or `-1` if
- * property was created using annotation on [FieldElement].
- *
- * @return the offset of the field name of this property
- */
- int get fieldNameOffset;
-
- /**
- * Returns the kind of this property.
- *
- * @return the kind of this property
- */
- AngularPropertyKind get propertyKind;
-}
-
-/**
- * Implementation of `AngularPropertyElement`.
- */
-class AngularPropertyElementImpl extends AngularElementImpl implements
- AngularPropertyElement {
- /**
- * The [FieldElement] to which this property is bound.
- */
- FieldElement field;
-
- /**
- * The offset of the field name in the property map.
- */
- int fieldNameOffset = -1;
-
- AngularPropertyKind propertyKind;
-
- /**
- * Initialize a newly created Angular property to have the given name.
- *
- * @param name the name of this element
- * @param nameOffset the offset of the name of this element in the file that contains the
- * declaration of this element
- */
- AngularPropertyElementImpl(String name, int nameOffset)
- : super(name, nameOffset);
-
- @override
- ElementKind get kind => ElementKind.ANGULAR_PROPERTY;
-
- @override
- accept(ElementVisitor visitor) => visitor.visitAngularPropertyElement(this);
-}
-
-/**
- * The enumeration `AngularPropertyKind` defines the different kinds of property bindings.
- */
-class AngularPropertyKind extends Enum<AngularPropertyKind> {
- /**
- * `@` - Map the DOM attribute string. The attribute string will be taken literally or
- * interpolated if it contains binding {{}} syntax and assigned to the expression. (cost: 0
- * watches)
- */
- static const AngularPropertyKind ATTR = const AngularPropertyKind('ATTR', 0);
-
- /**
- * `&` - Treat the DOM attribute value as an expression. Assign a closure function into the field.
- * This allows the component to control the invocation of the closure. This is useful for passing
- * expressions into controllers which act like callbacks. (cost: 0 watches)
- */
- static const AngularPropertyKind CALLBACK =
- const AngularPropertyKind('CALLBACK', 1);
-
- /**
- * `=>` - Treat the DOM attribute value as an expression. Set up a watch, which will read the
- * expression in the attribute and assign the value to destination expression. (cost: 1 watch)
- */
- static const AngularPropertyKind ONE_WAY =
- const AngularPropertyKind('ONE_WAY', 2);
-
- /**
- * `=>!` - Treat the DOM attribute value as an expression. Set up a one time watch on expression.
- * Once the expression turns not null it will no longer update. (cost: 1 watches until not null,
- * then 0 watches)
- */
- static const AngularPropertyKind ONE_WAY_ONE_TIME =
- const AngularPropertyKind('ONE_WAY_ONE_TIME', 3);
-
- /**
- * `<=>` - Treat the DOM attribute value as an expression. Set up a watch on both outside as well
- * as component scope to keep the source and destination in sync. (cost: 2 watches)
- */
- static const AngularPropertyKind TWO_WAY =
- const AngularPropertyKind_TWO_WAY('TWO_WAY', 4);
-
- static const List<AngularPropertyKind> values = const [
- ATTR,
- CALLBACK,
- ONE_WAY,
- ONE_WAY_ONE_TIME,
- TWO_WAY];
-
- const AngularPropertyKind(String name, int ordinal) : super(name, ordinal);
-
- /**
- * Returns `true` if property of this kind calls field getter.
- */
- bool callsGetter() => false;
-
- /**
- * Returns `true` if property of this kind calls field setter.
- */
- bool callsSetter() => true;
-}
-
-class AngularPropertyKind_TWO_WAY extends AngularPropertyKind {
- const AngularPropertyKind_TWO_WAY(String name, int ordinal)
- : super(name, ordinal);
-
- @override
- bool callsGetter() => true;
-}
-
-/**
- * The interface `AngularScopeVariableElement` defines the Angular <code>Scope</code>
- * property. They are created for every <code>scope['property'] = value;</code> code snippet.
- */
-abstract class AngularScopePropertyElement implements AngularElement {
- /**
- * An empty list of scope property elements.
- */
- static const List<AngularScopePropertyElement> EMPTY_ARRAY = const
- <AngularScopePropertyElement>[
- ];
-
- /**
- * Returns the type of this property, not `null`, maybe <code>dynamic</code>.
- *
- * @return the type of this property.
- */
- DartType get type;
-}
-
-/**
- * Implementation of `AngularScopePropertyElement`.
- */
-class AngularScopePropertyElementImpl extends AngularElementImpl implements
- AngularScopePropertyElement {
- /**
- * The type of the property
- */
- final DartType type;
-
- /**
- * Initialize a newly created Angular scope property to have the given name.
- *
- * @param name the name of this element
- * @param nameOffset the offset of the name of this element in the file that contains the
- * declaration of this element
- */
- AngularScopePropertyElementImpl(String name, int nameOffset, this.type)
- : super(name, nameOffset);
-
- @override
- ElementKind get kind => ElementKind.ANGULAR_SCOPE_PROPERTY;
-
- @override
- accept(ElementVisitor visitor) =>
- visitor.visitAngularScopePropertyElement(this);
-}
-
-/**
- * [AngularSelectorElement] is used to decide when Angular object should be applied.
- *
- * This class is an [Element] to support renaming component tag names, which are identifiers
- * in selectors.
- */
-abstract class AngularSelectorElement implements AngularElement {
- /**
- * Checks if the given [XmlTagNode] matches this selector.
- *
- * @param node the [XmlTagNode] to check
- * @return `true` if the given [XmlTagNode] matches, or `false` otherwise
- */
- bool apply(XmlTagNode node);
-}
-
-/**
- * Implementation of `AngularFormatterElement`.
- */
-abstract class AngularSelectorElementImpl extends AngularElementImpl implements
- AngularSelectorElement {
- /**
- * Initialize a newly created Angular selector to have the given name.
- *
- * @param name the name of this element
- * @param nameOffset the offset of the name of this element in the file that contains the
- * declaration of this element
- */
- AngularSelectorElementImpl(String name, int nameOffset)
- : super(name, nameOffset);
-
- @override
- ElementKind get kind => ElementKind.ANGULAR_SELECTOR;
-
- @override
- accept(ElementVisitor visitor) => visitor.visitAngularSelectorElement(this);
-}
-
-/**
- * [AngularSelectorElement] based on tag name.
- */
-abstract class AngularTagSelectorElement implements AngularSelectorElement {
-}
-
-/**
- * Implementation of [AngularSelectorElement] based on tag name.
- */
-class AngularTagSelectorElementImpl extends AngularSelectorElementImpl
- implements AngularTagSelectorElement {
- AngularTagSelectorElementImpl(String name, int offset) : super(name, offset);
-
- @override
- AngularApplication get application =>
- (enclosingElement as AngularElementImpl).application;
-
- @override
- bool apply(XmlTagNode node) {
- String tagName = name;
- return node.tag == tagName;
- }
-}
-
-/**
- * The interface `AngularViewElement` defines the Angular view defined using invocation like
- * <code>view('views/create.html')</code>.
- */
-abstract class AngularViewElement implements AngularHasTemplateElement {
- /**
- * An empty list of view elements.
- */
- static const List<AngularViewElement> EMPTY_ARRAY = const
- <AngularViewElement>[
- ];
-}
-
-/**
- * Implementation of `AngularViewElement`.
- */
-class AngularViewElementImpl extends AngularElementImpl implements
- AngularViewElement {
- /**
- * The HTML template URI.
- */
- final String templateUri;
-
- /**
- * The offset of the [templateUri] in the [getSource].
- */
- final int templateUriOffset;
-
- /**
- * The HTML template source.
- */
- Source templateSource;
-
- /**
- * Initialize a newly created Angular view.
- */
- AngularViewElementImpl(this.templateUri, this.templateUriOffset)
- : super(null, -1);
-
- @override
- String get identifier => "AngularView@$templateUriOffset";
-
- @override
- ElementKind get kind => ElementKind.ANGULAR_VIEW;
-
- @override
- accept(ElementVisitor visitor) => visitor.visitAngularViewElement(this);
-}
/**
* For AST nodes that could be in both the getter and setter contexts ([IndexExpression]s and
@@ -1026,15 +268,6 @@
InterfaceType get supertype;
/**
- * Return an array containing all of the toolkit specific objects associated with this class. The
- * array will be empty if the class does not have any toolkit specific objects or if the
- * compilation unit containing the class has not yet had toolkit references resolved.
- *
- * @return the toolkit objects associated with this class
- */
- List<ToolkitObjectElement> get toolkitObjects;
-
- /**
* Return the type defined by the class.
*
* @return the type defined by the class
@@ -1319,11 +552,6 @@
InterfaceType supertype;
/**
- * An array containing all of the toolkit objects attached to this class.
- */
- List<ToolkitObjectElement> _toolkitObjects = ToolkitObjectElement.EMPTY_ARRAY;
-
- /**
* The type defined by the class.
*/
InterfaceType type;
@@ -1541,9 +769,6 @@
ClassDeclaration get node =>
getNodeMatching((node) => node is ClassDeclaration);
- @override
- List<ToolkitObjectElement> get toolkitObjects => _toolkitObjects;
-
/**
* Set whether this class is defined by a typedef construct to correspond to the given value.
*
@@ -1591,19 +816,6 @@
@override
accept(ElementVisitor visitor) => visitor.visitClassElement(this);
- /**
- * Add the given [toolkitObject] to the list of toolkit specific information
- * objects attached to this class.
- */
- void addToolkitObjects(ToolkitObjectElement toolkitObject) {
- (toolkitObject as ToolkitObjectElementImpl).enclosingElement = this;
- if (_toolkitObjects.isEmpty) {
- // Convert from a non-growable list to a growable list.
- _toolkitObjects = <ToolkitObjectElement>[];
- }
- _toolkitObjects.add(toolkitObject);
- }
-
@override
void appendTo(StringBuffer buffer) {
String name = displayName;
@@ -1781,7 +993,6 @@
safelyVisitChildren(_constructors, visitor);
safelyVisitChildren(_fields, visitor);
safelyVisitChildren(_methods, visitor);
- safelyVisitChildren(_toolkitObjects, visitor);
safelyVisitChildren(_typeParameters, visitor);
}
@@ -2025,15 +1236,6 @@
List<PropertyAccessorElement> get accessors;
/**
- * Return an array containing all of the Angular views defined in this compilation unit. The array
- * will be empty if the element does not have any Angular views or if the compilation unit has not
- * yet had toolkit references resolved.
- *
- * @return the Angular views defined in this compilation unit.
- */
- List<AngularViewElement> get angularViews;
-
- /**
* Return the library in which this compilation unit is defined.
*
* @return the library in which this compilation unit is defined
@@ -2151,11 +1353,6 @@
List<FunctionElement> _functions = FunctionElementImpl.EMPTY_ARRAY;
/**
- * A table mapping elements to associated toolkit objects.
- */
- Map<Element, List<ToolkitObjectElement>> _toolkitObjects = {};
-
- /**
* An array containing all of the function type aliases contained in this compilation unit.
*/
List<FunctionTypeAliasElement> _typeAliases =
@@ -2173,11 +1370,6 @@
TopLevelVariableElementImpl.EMPTY_ARRAY;
/**
- * An array containing all of the Angular views contained in this compilation unit.
- */
- List<AngularViewElement> _angularViews = AngularViewElement.EMPTY_ARRAY;
-
- /**
* Initialize a newly created compilation unit element to have the given name.
*
* @param name the name of this element
@@ -2201,21 +1393,6 @@
}
@override
- List<AngularViewElement> get angularViews => _angularViews;
-
- /**
- * Set the Angular views defined in this compilation unit.
- *
- * @param angularViews the Angular views defined in this compilation unit
- */
- void set angularViews(List<AngularViewElement> angularViews) {
- for (AngularViewElement view in angularViews) {
- (view as AngularViewElementImpl).enclosingElement = this;
- }
- this._angularViews = angularViews;
- }
-
- @override
LibraryElement get enclosingElement =>
super.enclosingElement as LibraryElement;
@@ -2404,31 +1581,6 @@
safelyVisitChildren(_typeAliases, visitor);
safelyVisitChildren(_types, visitor);
safelyVisitChildren(_variables, visitor);
- safelyVisitChildren(_angularViews, visitor);
- }
-
- /**
- * Returns the associated toolkit objects.
- *
- * @param element the [Element] to get toolkit objects for
- * @return the associated toolkit objects, may be empty, but not `null`
- */
- List<ToolkitObjectElement> _getToolkitObjects(Element element) {
- List<ToolkitObjectElement> objects = _toolkitObjects[element];
- if (objects != null) {
- return objects;
- }
- return ToolkitObjectElement.EMPTY_ARRAY;
- }
-
- /**
- * Sets the toolkit objects that are associated with the given [Element].
- *
- * @param element the [Element] to associate toolkit objects with
- * @param objects the toolkit objects to associate
- */
- void _setToolkitObjects(Element element, List<ToolkitObjectElement> objects) {
- _toolkitObjects[element] = objects;
}
}
@@ -2649,7 +1801,7 @@
} else {
message = 'Found unnamed constructor element with no enclosing element';
}
- AnalysisEngine.instance.instrumentationService.logError(message);
+ AnalysisEngine.instance.logger.logError(message);
buffer.write('<unknown class>');
} else {
buffer.write(enclosingElement.displayName);
@@ -3472,10 +2624,10 @@
String _name;
/**
- * The offset of the name of this element in the file that contains the declaration of this
- * element.
+ * The offset of the name of this element in the file that contains the
+ * declaration of this element.
*/
- int nameOffset = 0;
+ int _nameOffset = 0;
/**
* A bit-encoded form of the modifiers associated with this element.
@@ -3511,7 +2663,7 @@
* @param nameOffset the offset of the name of this element in the file that contains the
* declaration of this element
*/
- ElementImpl(String name, this.nameOffset) {
+ ElementImpl(String name, this._nameOffset) {
this._name = StringUtilities.intern(name);
}
@@ -3628,6 +2780,22 @@
_cachedHashCode = null;
}
+ /**
+ * The offset of the name of this element in the file that contains the
+ * declaration of this element.
+ */
+ int get nameOffset => _nameOffset;
+
+ /**
+ * Sets the offset of the name of this element in the file that contains the
+ * declaration of this element.
+ */
+ void set nameOffset(int offset) {
+ _nameOffset = offset;
+ _cachedHashCode = null;
+ _cachedLocation = null;
+ }
+
@override
AstNode get node => getNodeMatching((node) => node is AstNode);
@@ -3821,114 +2989,73 @@
* The enumeration `ElementKind` defines the various kinds of elements in the element model.
*/
class ElementKind extends Enum<ElementKind> {
- static const ElementKind ANGULAR_FORMATTER =
- const ElementKind('ANGULAR_FORMATTER', 0, "Angular formatter");
-
- static const ElementKind ANGULAR_COMPONENT =
- const ElementKind('ANGULAR_COMPONENT', 1, "Angular component");
-
- static const ElementKind ANGULAR_CONTROLLER =
- const ElementKind('ANGULAR_CONTROLLER', 2, "Angular controller");
-
- static const ElementKind ANGULAR_DIRECTIVE =
- const ElementKind('ANGULAR_DIRECTIVE', 3, "Angular directive");
-
- static const ElementKind ANGULAR_PROPERTY =
- const ElementKind('ANGULAR_PROPERTY', 4, "Angular property");
-
- static const ElementKind ANGULAR_SCOPE_PROPERTY =
- const ElementKind('ANGULAR_SCOPE_PROPERTY', 5, "Angular scope property");
-
- static const ElementKind ANGULAR_SELECTOR =
- const ElementKind('ANGULAR_SELECTOR', 6, "Angular selector");
-
- static const ElementKind ANGULAR_VIEW =
- const ElementKind('ANGULAR_VIEW', 7, "Angular view");
-
- static const ElementKind CLASS = const ElementKind('CLASS', 8, "class");
+ static const ElementKind CLASS = const ElementKind('CLASS', 0, "class");
static const ElementKind COMPILATION_UNIT =
- const ElementKind('COMPILATION_UNIT', 9, "compilation unit");
+ const ElementKind('COMPILATION_UNIT', 1, "compilation unit");
static const ElementKind CONSTRUCTOR =
- const ElementKind('CONSTRUCTOR', 10, "constructor");
+ const ElementKind('CONSTRUCTOR', 2, "constructor");
static const ElementKind DYNAMIC =
- const ElementKind('DYNAMIC', 11, "<dynamic>");
+ const ElementKind('DYNAMIC', 3, "<dynamic>");
static const ElementKind EMBEDDED_HTML_SCRIPT =
- const ElementKind('EMBEDDED_HTML_SCRIPT', 12, "embedded html script");
+ const ElementKind('EMBEDDED_HTML_SCRIPT', 4, "embedded html script");
- static const ElementKind ERROR = const ElementKind('ERROR', 13, "<error>");
+ static const ElementKind ERROR = const ElementKind('ERROR', 5, "<error>");
static const ElementKind EXPORT =
- const ElementKind('EXPORT', 14, "export directive");
+ const ElementKind('EXPORT', 6, "export directive");
static const ElementKind EXTERNAL_HTML_SCRIPT =
- const ElementKind('EXTERNAL_HTML_SCRIPT', 15, "external html script");
+ const ElementKind('EXTERNAL_HTML_SCRIPT', 7, "external html script");
- static const ElementKind FIELD = const ElementKind('FIELD', 16, "field");
+ static const ElementKind FIELD = const ElementKind('FIELD', 8, "field");
static const ElementKind FUNCTION =
- const ElementKind('FUNCTION', 17, "function");
+ const ElementKind('FUNCTION', 9, "function");
- static const ElementKind GETTER = const ElementKind('GETTER', 18, "getter");
+ static const ElementKind GETTER = const ElementKind('GETTER', 10, "getter");
- static const ElementKind HTML = const ElementKind('HTML', 19, "html");
+ static const ElementKind HTML = const ElementKind('HTML', 11, "html");
static const ElementKind IMPORT =
- const ElementKind('IMPORT', 20, "import directive");
+ const ElementKind('IMPORT', 12, "import directive");
- static const ElementKind LABEL = const ElementKind('LABEL', 21, "label");
+ static const ElementKind LABEL = const ElementKind('LABEL', 13, "label");
static const ElementKind LIBRARY =
- const ElementKind('LIBRARY', 22, "library");
+ const ElementKind('LIBRARY', 14, "library");
static const ElementKind LOCAL_VARIABLE =
- const ElementKind('LOCAL_VARIABLE', 23, "local variable");
+ const ElementKind('LOCAL_VARIABLE', 15, "local variable");
- static const ElementKind METHOD = const ElementKind('METHOD', 24, "method");
+ static const ElementKind METHOD = const ElementKind('METHOD', 16, "method");
- static const ElementKind NAME = const ElementKind('NAME', 25, "<name>");
+ static const ElementKind NAME = const ElementKind('NAME', 17, "<name>");
static const ElementKind PARAMETER =
- const ElementKind('PARAMETER', 26, "parameter");
-
- static const ElementKind POLYMER_ATTRIBUTE =
- const ElementKind('POLYMER_ATTRIBUTE', 27, "Polymer attribute");
-
- static const ElementKind POLYMER_TAG_DART =
- const ElementKind('POLYMER_TAG_DART', 28, "Polymer Dart tag");
-
- static const ElementKind POLYMER_TAG_HTML =
- const ElementKind('POLYMER_TAG_HTML', 29, "Polymer HTML tag");
+ const ElementKind('PARAMETER', 18, "parameter");
static const ElementKind PREFIX =
- const ElementKind('PREFIX', 30, "import prefix");
+ const ElementKind('PREFIX', 19, "import prefix");
- static const ElementKind SETTER = const ElementKind('SETTER', 31, "setter");
+ static const ElementKind SETTER = const ElementKind('SETTER', 20, "setter");
static const ElementKind TOP_LEVEL_VARIABLE =
- const ElementKind('TOP_LEVEL_VARIABLE', 32, "top level variable");
+ const ElementKind('TOP_LEVEL_VARIABLE', 21, "top level variable");
static const ElementKind FUNCTION_TYPE_ALIAS =
- const ElementKind('FUNCTION_TYPE_ALIAS', 33, "function type alias");
+ const ElementKind('FUNCTION_TYPE_ALIAS', 22, "function type alias");
static const ElementKind TYPE_PARAMETER =
- const ElementKind('TYPE_PARAMETER', 34, "type parameter");
+ const ElementKind('TYPE_PARAMETER', 23, "type parameter");
static const ElementKind UNIVERSE =
- const ElementKind('UNIVERSE', 35, "<universe>");
+ const ElementKind('UNIVERSE', 24, "<universe>");
static const List<ElementKind> values = const [
- ANGULAR_FORMATTER,
- ANGULAR_COMPONENT,
- ANGULAR_CONTROLLER,
- ANGULAR_DIRECTIVE,
- ANGULAR_PROPERTY,
- ANGULAR_SCOPE_PROPERTY,
- ANGULAR_SELECTOR,
- ANGULAR_VIEW,
CLASS,
COMPILATION_UNIT,
CONSTRUCTOR,
@@ -3948,9 +3075,6 @@
METHOD,
NAME,
PARAMETER,
- POLYMER_ATTRIBUTE,
- POLYMER_TAG_DART,
- POLYMER_TAG_HTML,
PREFIX,
SETTER,
TOP_LEVEL_VARIABLE,
@@ -4230,22 +3354,6 @@
* element structure.
*/
abstract class ElementVisitor<R> {
- R visitAngularComponentElement(AngularComponentElement element);
-
- R visitAngularControllerElement(AngularControllerElement element);
-
- R visitAngularDirectiveElement(AngularDecoratorElement element);
-
- R visitAngularFormatterElement(AngularFormatterElement element);
-
- R visitAngularPropertyElement(AngularPropertyElement element);
-
- R visitAngularScopePropertyElement(AngularScopePropertyElement element);
-
- R visitAngularSelectorElement(AngularSelectorElement element);
-
- R visitAngularViewElement(AngularViewElement element);
-
R visitClassElement(ClassElement element);
R visitCompilationUnitElement(CompilationUnitElement element);
@@ -4282,12 +3390,6 @@
R visitParameterElement(ParameterElement element);
- R visitPolymerAttributeElement(PolymerAttributeElement element);
-
- R visitPolymerTagDartElement(PolymerTagDartElement element);
-
- R visitPolymerTagHtmlElement(PolymerTagHtmlElement element);
-
R visitPrefixElement(PrefixElement element);
R visitPropertyAccessorElement(PropertyAccessorElement element);
@@ -4904,6 +4006,10 @@
ClassElement get enclosingElement => super.enclosingElement as ClassElement;
@override
+ bool get isEnumConstant =>
+ enclosingElement != null ? enclosingElement.isEnum : false;
+
+ @override
bool get isStatic => hasModifier(Modifier.STATIC);
@override
@@ -4920,10 +4026,6 @@
@override
accept(ElementVisitor visitor) => visitor.visitFieldElement(this);
-
- @override
- bool get isEnumConstant =>
- enclosingElement != null ? enclosingElement.isEnum : false;
}
/**
@@ -5025,6 +4127,9 @@
PropertyAccessorMember.from(baseElement.getter, definingType);
@override
+ bool get isEnumConstant => baseElement.isEnumConstant;
+
+ @override
bool get isStatic => baseElement.isStatic;
@override
@@ -5096,9 +4201,6 @@
}
return false;
}
-
- @override
- bool get isEnumConstant => baseElement.isEnumConstant;
}
/**
@@ -6338,44 +5440,6 @@
*/
class GeneralizingElementVisitor<R> implements ElementVisitor<R> {
@override
- R visitAngularComponentElement(AngularComponentElement element) =>
- visitAngularHasSelectorElement(element);
-
- @override
- R visitAngularControllerElement(AngularControllerElement element) =>
- visitAngularHasSelectorElement(element);
-
- @override
- R visitAngularDirectiveElement(AngularDecoratorElement element) =>
- visitAngularHasSelectorElement(element);
-
- R visitAngularElement(AngularElement element) =>
- visitToolkitObjectElement(element);
-
- @override
- R visitAngularFormatterElement(AngularFormatterElement element) =>
- visitAngularElement(element);
-
- R visitAngularHasSelectorElement(AngularHasSelectorElement element) =>
- visitAngularElement(element);
-
- @override
- R visitAngularPropertyElement(AngularPropertyElement element) =>
- visitAngularElement(element);
-
- @override
- R visitAngularScopePropertyElement(AngularScopePropertyElement element) =>
- visitAngularElement(element);
-
- @override
- R visitAngularSelectorElement(AngularSelectorElement element) =>
- visitAngularElement(element);
-
- @override
- R visitAngularViewElement(AngularViewElement element) =>
- visitAngularElement(element);
-
- @override
R visitClassElement(ClassElement element) => visitElement(element);
@override
@@ -6461,21 +5525,6 @@
visitLocalElement(element);
@override
- R visitPolymerAttributeElement(PolymerAttributeElement element) =>
- visitPolymerElement(element);
-
- R visitPolymerElement(PolymerElement element) =>
- visitToolkitObjectElement(element);
-
- @override
- R visitPolymerTagDartElement(PolymerTagDartElement element) =>
- visitPolymerElement(element);
-
- @override
- R visitPolymerTagHtmlElement(PolymerTagHtmlElement element) =>
- visitPolymerElement(element);
-
- @override
R visitPrefixElement(PrefixElement element) => visitElement(element);
@override
@@ -6485,9 +5534,6 @@
R visitPropertyInducingElement(PropertyInducingElement element) =>
visitVariableElement(element);
- R visitToolkitObjectElement(ToolkitObjectElement element) =>
- visitElement(element);
-
@override
R visitTopLevelVariableElement(TopLevelVariableElement element) =>
visitPropertyInducingElement(element);
@@ -6500,28 +5546,6 @@
}
/**
- * Implementation of [AngularSelectorElement] based on presence of attribute.
- */
-class HasAttributeSelectorElementImpl extends AngularSelectorElementImpl
- implements AngularHasAttributeSelectorElement {
- HasAttributeSelectorElementImpl(String attributeName, int offset)
- : super(attributeName, offset);
-
- @override
- void appendTo(StringBuffer buffer) {
- buffer.write("[");
- buffer.write(name);
- buffer.write("]");
- }
-
- @override
- bool apply(XmlTagNode node) {
- String attributeName = name;
- return node.getAttribute(attributeName) != null;
- }
-}
-
-/**
* The interface `HideElementCombinator` defines the behavior of combinators that cause some
* of the names in a namespace to be hidden when being imported.
*/
@@ -6566,20 +5590,6 @@
*/
abstract class HtmlElement implements Element {
/**
- * Return the [CompilationUnitElement] associated with this Angular HTML file, maybe
- * `null` if not an Angular file.
- */
- CompilationUnitElement get angularCompilationUnit;
-
- /**
- * Return an array containing all of the [PolymerTagHtmlElement]s defined in the HTML file.
- *
- * @return the [PolymerTagHtmlElement]s elements in the HTML file (not `null`,
- * contains no `null`s)
- */
- List<PolymerTagHtmlElement> get polymerTags;
-
- /**
* Return an array 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 {@core source} attribute of a script tag.
@@ -6609,22 +5619,11 @@
List<HtmlScriptElement> _scripts = HtmlScriptElementImpl.EMPTY_ARRAY;
/**
- * The [PolymerTagHtmlElement]s defined in the HTML file.
- */
- List<PolymerTagHtmlElement> _polymerTags = PolymerTagHtmlElement.EMPTY_ARRAY;
-
- /**
* The source that corresponds to this HTML file.
*/
Source source;
/**
- * The element associated with Dart pieces in this HTML unit or `null` if the receiver is
- * not resolved.
- */
- CompilationUnitElement angularCompilationUnit;
-
- /**
* Initialize a newly created HTML element to have the given name.
*
* @param context the analysis context in which the HTML file is defined
@@ -6642,23 +5641,6 @@
ElementKind get kind => ElementKind.HTML;
@override
- List<PolymerTagHtmlElement> get polymerTags => _polymerTags;
-
- /**
- * Set the [PolymerTagHtmlElement]s defined in the HTML file.
- */
- void set polymerTags(List<PolymerTagHtmlElement> polymerTags) {
- if (polymerTags.length == 0) {
- this._polymerTags = PolymerTagHtmlElement.EMPTY_ARRAY;
- return;
- }
- for (PolymerTagHtmlElement tag in polymerTags) {
- (tag as PolymerTagHtmlElementImpl).enclosingElement = this;
- }
- this._polymerTags = polymerTags;
- }
-
- @override
List<HtmlScriptElement> get scripts => _scripts;
/**
@@ -6705,7 +5687,6 @@
void visitChildren(ElementVisitor visitor) {
super.visitChildren(visitor);
safelyVisitChildren(_scripts, visitor);
- safelyVisitChildren(_polymerTags, visitor);
}
}
@@ -8075,29 +7056,6 @@
}
/**
- * Combination of [AngularTagSelectorElementImpl] and [HasAttributeSelectorElementImpl].
- */
-class IsTagHasAttributeSelectorElementImpl extends AngularSelectorElementImpl {
- String _tagName;
-
- String _attributeName;
-
- IsTagHasAttributeSelectorElementImpl(String tagName, String attributeName)
- : super("$tagName[$attributeName]", -1) {
- this._tagName = tagName;
- this._attributeName = attributeName;
- }
-
- String get attributeName => _attributeName;
-
- String get tagName => _tagName;
-
- @override
- bool apply(XmlTagNode node) =>
- node.tag == _tagName && node.getAttribute(_attributeName) != null;
-}
-
-/**
* The interface `LabelElement` defines the behavior of elements representing a label
* associated with a statement.
*/
@@ -8233,14 +7191,6 @@
List<ImportElement> get imports;
/**
- * Return `true` if this library is created for Angular analysis. If this library has not
- * yet had toolkit references resolved, then `false` will be returned.
- *
- * @return `true` if this library is created for Angular analysis
- */
- bool get isAngularHtml;
-
- /**
* Return `true` if this library is an application that can be run in the browser.
*
* @return `true` if this library is an application that can be run in the browser
@@ -8367,11 +7317,6 @@
List<CompilationUnitElement> _parts = CompilationUnitElementImpl.EMPTY_ARRAY;
/**
- * Is `true` if this library is created for Angular analysis.
- */
- bool _isAngularHtml = false;
-
- /**
* The element representing the synthetic function `loadLibrary` that is defined for this
* library, or `null` if the element has not yet been created.
*/
@@ -8397,13 +7342,6 @@
LibraryElementImpl.forNode(this.context, LibraryIdentifier name)
: super.forNode(name);
- /**
- * Specifies if this library is created for Angular analysis.
- */
- void set angularHtml(bool isAngularHtml) {
- this._isAngularHtml = isAngularHtml;
- }
-
@override
CompilationUnitElement get definingCompilationUnit =>
_definingCompilationUnit;
@@ -8510,9 +7448,6 @@
}
@override
- bool get isAngularHtml => _isAngularHtml;
-
- @override
bool get isBrowserApplication =>
entryPoint != null && isOrImportsBrowserLibrary;
@@ -8835,12 +7770,6 @@
* a local variable.
*/
abstract class LocalVariableElement implements LocalElement, VariableElement {
- /**
- * Return an array containing all of the toolkit specific objects attached to this variable.
- *
- * @return the toolkit objects attached to this variable
- */
- List<ToolkitObjectElement> get toolkitObjects;
}
/**
@@ -8903,30 +7832,6 @@
ElementKind get kind => ElementKind.LOCAL_VARIABLE;
@override
- List<ToolkitObjectElement> get toolkitObjects {
- CompilationUnitElementImpl unit =
- getAncestor((element) => element is CompilationUnitElementImpl);
- if (unit == null) {
- return ToolkitObjectElement.EMPTY_ARRAY;
- }
- return unit._getToolkitObjects(this);
- }
-
- /**
- * Set the toolkit specific information objects attached to this variable.
- *
- * @param toolkitObjects the toolkit objects attached to this variable
- */
- void set toolkitObjects(List<ToolkitObjectElement> toolkitObjects) {
- CompilationUnitElementImpl unit =
- getAncestor((element) => element is CompilationUnitElementImpl);
- if (unit == null) {
- return;
- }
- unit._setToolkitObjects(this, toolkitObjects);
- }
-
- @override
SourceRange get visibleRange {
if (_visibleRangeLength < 0) {
return null;
@@ -10191,221 +9096,6 @@
}
/**
- * The interface `PolymerAttributeElement` defines an attribute in
- * [PolymerTagHtmlElement].
- *
- * <pre>
- * <polymer-element name="my-example" attributes='attrA attrB'>
- * </polymer-element>
- * </pre>
- */
-abstract class PolymerAttributeElement implements PolymerElement {
- /**
- * An empty list of Polymer custom tag attributes.
- */
- static const List<PolymerAttributeElement> EMPTY_ARRAY = const
- <PolymerAttributeElement>[
- ];
-
- /**
- * Return the [FieldElement] associated with this attribute. Maybe `null` if
- * [PolymerTagDartElement] does not have a field associated with it.
- */
- FieldElement get field;
-}
-
-/**
- * Implementation of `PolymerAttributeElement`.
- */
-class PolymerAttributeElementImpl extends PolymerElementImpl implements
- PolymerAttributeElement {
- /**
- * The [FieldElement] associated with this attribute.
- */
- FieldElement field;
-
- /**
- * Initialize a newly created Polymer attribute to have the given name.
- *
- * @param name the name of this element
- * @param nameOffset the offset of the name of this element in the file that contains the
- * declaration of this element
- */
- PolymerAttributeElementImpl(String name, int nameOffset)
- : super(name, nameOffset);
-
- @override
- ElementKind get kind => ElementKind.POLYMER_ATTRIBUTE;
-
- @override
- accept(ElementVisitor visitor) => visitor.visitPolymerAttributeElement(this);
-}
-
-/**
- * The interface `PolymerElement` defines the behavior of objects representing information
- * about a Polymer specific element.
- */
-abstract class PolymerElement implements ToolkitObjectElement {
- /**
- * An empty list of Polymer elements.
- */
- static const List<PolymerElement> EMPTY_ARRAY = const <PolymerElement>[];
-}
-
-/**
- * Implementation of `PolymerElement`.
- */
-abstract class PolymerElementImpl extends ToolkitObjectElementImpl implements
- PolymerElement {
- /**
- * Initialize a newly created Polymer element to have the given name.
- *
- * @param name the name of this element
- * @param nameOffset the offset of the name of this element in the file that contains the
- * declaration of this element
- */
- PolymerElementImpl(String name, int nameOffset) : super(name, nameOffset);
-}
-
-/**
- * The interface `PolymerTagDartElement` defines a Polymer custom tag in Dart.
- *
- * <pre>
- * @CustomTag('my-example')
- * </pre>
- */
-abstract class PolymerTagDartElement implements PolymerElement {
- /**
- * Return the [ClassElement] that is associated with this Polymer custom tag. Not
- * `null`, because [PolymerTagDartElement]s are created for [ClassElement]s
- * marked with the `@CustomTag` annotation.
- */
- ClassElement get classElement;
-
- /**
- * Return the [PolymerTagHtmlElement] part of this Polymer custom tag. Maybe `null` if
- * it has not been resolved yet or there are no corresponding Dart part defined.
- */
- PolymerTagHtmlElement get htmlElement;
-}
-
-/**
- * Implementation of `PolymerTagDartElement`.
- */
-class PolymerTagDartElementImpl extends PolymerElementImpl implements
- PolymerTagDartElement {
- /**
- * The [ClassElement] that is associated with this Polymer custom tag.
- */
- final ClassElement classElement;
-
- /**
- * The [PolymerTagHtmlElement] part of this Polymer custom tag. Maybe `null` if it has
- * not been resolved yet or there are no corresponding Dart part defined.
- */
- PolymerTagHtmlElement htmlElement;
-
- /**
- * Initialize a newly created Dart part of a Polymer tag to have the given name.
- *
- * @param name the name of this element
- * @param nameOffset the offset of the name of this element in the file that contains the
- * declaration of this element
- */
- PolymerTagDartElementImpl(String name, int nameOffset, this.classElement)
- : super(name, nameOffset);
-
- @override
- ElementKind get kind => ElementKind.POLYMER_TAG_DART;
-
- @override
- accept(ElementVisitor visitor) => visitor.visitPolymerTagDartElement(this);
-}
-
-/**
- * The interface `PolymerTagHtmlElement` defines a Polymer custom tag in HTML.
- *
- * <pre>
- * <polymer-element name="my-example" attributes='attrA attrB'>
- * </polymer-element>
- * </pre>
- */
-abstract class PolymerTagHtmlElement implements PolymerElement {
- /**
- * An empty list of [PolymerTagHtmlElement]s.
- */
- static const List<PolymerTagHtmlElement> EMPTY_ARRAY = const
- <PolymerTagHtmlElement>[
- ];
-
- /**
- * Return an array containing all of the attributes declared by this tag.
- */
- List<PolymerAttributeElement> get attributes;
-
- /**
- * Return the [PolymerTagDartElement] part on this Polymer custom tag. Maybe `null` if
- * it has not been resolved yet or there are no corresponding Dart part defined.
- */
- PolymerTagDartElement get dartElement;
-}
-
-/**
- * Implementation of `PolymerTagHtmlElement`.
- */
-class PolymerTagHtmlElementImpl extends PolymerElementImpl implements
- PolymerTagHtmlElement {
- /**
- * The [PolymerTagDartElement] part of this Polymer custom tag. Maybe `null` if it has
- * not been resolved yet or there are no corresponding Dart part defined.
- */
- PolymerTagDartElement dartElement;
-
- /**
- * The array containing all of the attributes declared by this tag.
- */
- List<PolymerAttributeElement> _attributes =
- PolymerAttributeElement.EMPTY_ARRAY;
-
- /**
- * Initialize a newly created HTML part of a Polymer tag to have the given name.
- *
- * @param name the name of this element
- * @param nameOffset the offset of the name of this element in the file that contains the
- * declaration of this element
- */
- PolymerTagHtmlElementImpl(String name, int nameOffset)
- : super(name, nameOffset);
-
- @override
- List<PolymerAttributeElement> get attributes => _attributes;
-
- /**
- * Set an array containing all of the attributes declared by this tag.
- *
- * @param attributes the properties to set
- */
- void set attributes(List<PolymerAttributeElement> attributes) {
- for (PolymerAttributeElement property in attributes) {
- encloseElement(property as PolymerAttributeElementImpl);
- }
- this._attributes = attributes;
- }
-
- @override
- ElementKind get kind => ElementKind.POLYMER_TAG_HTML;
-
- @override
- accept(ElementVisitor visitor) => visitor.visitPolymerTagHtmlElement(this);
-
- @override
- void visitChildren(ElementVisitor visitor) {
- safelyVisitChildren(_attributes, visitor);
- super.visitChildren(visitor);
- }
-}
-
-/**
* The interface `PrefixElement` defines the behavior common to elements that represent a
* prefix used to import one or more libraries into another library.
*/
@@ -10975,54 +9665,6 @@
*/
class RecursiveElementVisitor<R> implements ElementVisitor<R> {
@override
- R visitAngularComponentElement(AngularComponentElement element) {
- element.visitChildren(this);
- return null;
- }
-
- @override
- R visitAngularControllerElement(AngularControllerElement element) {
- element.visitChildren(this);
- return null;
- }
-
- @override
- R visitAngularDirectiveElement(AngularDecoratorElement element) {
- element.visitChildren(this);
- return null;
- }
-
- @override
- R visitAngularFormatterElement(AngularFormatterElement element) {
- element.visitChildren(this);
- return null;
- }
-
- @override
- R visitAngularPropertyElement(AngularPropertyElement element) {
- element.visitChildren(this);
- return null;
- }
-
- @override
- R visitAngularScopePropertyElement(AngularScopePropertyElement element) {
- element.visitChildren(this);
- return null;
- }
-
- @override
- R visitAngularSelectorElement(AngularSelectorElement element) {
- element.visitChildren(this);
- return null;
- }
-
- @override
- R visitAngularViewElement(AngularViewElement element) {
- element.visitChildren(this);
- return null;
- }
-
- @override
R visitClassElement(ClassElement element) {
element.visitChildren(this);
return null;
@@ -11131,24 +9773,6 @@
}
@override
- R visitPolymerAttributeElement(PolymerAttributeElement element) {
- element.visitChildren(this);
- return null;
- }
-
- @override
- R visitPolymerTagDartElement(PolymerTagDartElement element) {
- element.visitChildren(this);
- return null;
- }
-
- @override
- R visitPolymerTagHtmlElement(PolymerTagHtmlElement element) {
- element.visitChildren(this);
- return null;
- }
-
- @override
R visitPrefixElement(PrefixElement element) {
element.visitChildren(this);
return null;
@@ -11245,31 +9869,6 @@
*/
class SimpleElementVisitor<R> implements ElementVisitor<R> {
@override
- R visitAngularComponentElement(AngularComponentElement element) => null;
-
- @override
- R visitAngularControllerElement(AngularControllerElement element) => null;
-
- @override
- R visitAngularDirectiveElement(AngularDecoratorElement element) => null;
-
- @override
- R visitAngularFormatterElement(AngularFormatterElement element) => null;
-
- @override
- R visitAngularPropertyElement(AngularPropertyElement element) => null;
-
- @override
- R visitAngularScopePropertyElement(AngularScopePropertyElement element) =>
- null;
-
- @override
- R visitAngularSelectorElement(AngularSelectorElement element) => null;
-
- @override
- R visitAngularViewElement(AngularViewElement element) => null;
-
- @override
R visitClassElement(ClassElement element) => null;
@override
@@ -11325,15 +9924,6 @@
R visitParameterElement(ParameterElement element) => null;
@override
- R visitPolymerAttributeElement(PolymerAttributeElement element) => null;
-
- @override
- R visitPolymerTagDartElement(PolymerTagDartElement element) => null;
-
- @override
- R visitPolymerTagHtmlElement(PolymerTagHtmlElement element) => null;
-
- @override
R visitPrefixElement(PrefixElement element) => null;
@override
@@ -11347,36 +9937,6 @@
}
/**
- * The interface `ToolkitObjectElement` defines the behavior of elements that represent a
- * toolkit specific object, such as Angular controller or component. These elements are not based on
- * the Dart syntax, but on some semantic agreement, such as a special annotation.
- */
-abstract class ToolkitObjectElement implements Element {
- /**
- * An empty list of toolkit object elements.
- */
- static const List<ToolkitObjectElement> EMPTY_ARRAY = const
- <ToolkitObjectElement>[
- ];
-}
-
-/**
- * Instances of the class `ToolkitObjectElementImpl` implement a `ToolkitObjectElement`.
- */
-abstract class ToolkitObjectElementImpl extends ElementImpl implements
- ToolkitObjectElement {
- /**
- * Initialize a newly created toolkit object element to have the given name.
- *
- * @param name the name of this element
- * @param nameOffset the offset of the name of this element in the file that contains the
- * declaration of this element
- */
- ToolkitObjectElementImpl(String name, int nameOffset)
- : super(name, nameOffset);
-}
-
-/**
* The interface `TopLevelVariableElement` defines the behavior of elements representing a
* top-level variable.
*/
diff --git a/pkg/analyzer/lib/src/generated/element_handle.dart b/pkg/analyzer/lib/src/generated/element_handle.dart
index 9e36518..b84e36e 100644
--- a/pkg/analyzer/lib/src/generated/element_handle.dart
+++ b/pkg/analyzer/lib/src/generated/element_handle.dart
@@ -89,9 +89,6 @@
InterfaceType get supertype => actualElement.supertype;
@override
- List<ToolkitObjectElement> get toolkitObjects => actualElement.toolkitObjects;
-
- @override
InterfaceType get type => actualElement.type;
@override
@@ -184,9 +181,6 @@
super.actualElement as CompilationUnitElement;
@override
- List<AngularViewElement> get angularViews => actualElement.angularViews;
-
- @override
LibraryElement get enclosingElement =>
super.enclosingElement as LibraryElement;
@@ -781,9 +775,6 @@
List<ImportElement> get imports => actualElement.imports;
@override
- bool get isAngularHtml => actualElement.isAngularHtml;
-
- @override
bool get isBrowserApplication => actualElement.isBrowserApplication;
@override
@@ -842,9 +833,6 @@
ElementKind get kind => ElementKind.LOCAL_VARIABLE;
@override
- List<ToolkitObjectElement> get toolkitObjects => actualElement.toolkitObjects;
-
- @override
SourceRange get visibleRange => actualElement.visibleRange;
}
diff --git a/pkg/analyzer/lib/src/generated/engine.dart b/pkg/analyzer/lib/src/generated/engine.dart
index 4f8f2ef..5ea16a5 100644
--- a/pkg/analyzer/lib/src/generated/engine.dart
+++ b/pkg/analyzer/lib/src/generated/engine.dart
@@ -33,6 +33,7 @@
import 'source.dart';
import 'utilities_collection.dart';
import 'utilities_general.dart';
+import 'package:analyzer/src/generated/incremental_resolution_validator.dart';
/**
* Type of callback functions used by PendingFuture. Functions of this type
@@ -580,16 +581,6 @@
bool exists(Source source);
/**
- * Return the Angular application that contains the HTML file defined by the given source, or
- * `null` if the source does not represent an HTML file, the Angular application containing
- * the file has not yet been resolved, or the analysis of the HTML file failed for some reason.
- *
- * @param htmlSource the source defining the HTML file
- * @return the Angular application that contains the HTML file defined by the given source
- */
- AngularApplication getAngularApplicationWithHtml(Source htmlSource);
-
- /**
* Return the element model corresponding to the compilation unit defined by the given source in
* the library defined by the given source, or `null` if the element model does not
* currently exist or if the library cannot be analyzed for some reason.
@@ -930,6 +921,16 @@
static bool _TRACE_PERFORM_TASK = false;
/**
+ * The next context identifier.
+ */
+ static int _NEXT_ID = 0;
+
+ /**
+ * The unique identifier of this context.
+ */
+ final int _id = _NEXT_ID++;
+
+ /**
* The set of analysis options controlling the behavior of this context.
*/
AnalysisOptionsImpl _options = new AnalysisOptionsImpl();
@@ -1025,9 +1026,9 @@
WorkManager _workManager = new WorkManager();
/**
- * The set of [AngularApplication] in this context.
+ * The [Stopwatch] of the current "perform tasks cycle".
*/
- Set<AngularApplication> _angularApplications = new Set();
+ Stopwatch _performAnalysisTaskStopwatch;
/**
* The controller for sending [SourcesChangedEvent]s.
@@ -1041,6 +1042,26 @@
List<AnalysisListener> _listeners = new List<AnalysisListener>();
/**
+ * The most recently incrementally resolved [Source].
+ * Is 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].
+ * Is 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;
+
+ /**
* Initialize a newly created analysis context.
*/
AnalysisContextImpl() {
@@ -1060,11 +1081,8 @@
@override
void set analysisOptions(AnalysisOptions options) {
bool needsRecompute =
- this._options.analyzeAngular != options.analyzeAngular ||
this._options.analyzeFunctionBodies != options.analyzeFunctionBodies ||
this._options.generateSdkErrors != options.generateSdkErrors ||
- this._options.enableDeferredLoading != options.enableDeferredLoading ||
- this._options.enableEnum != options.enableEnum ||
this._options.dart2jsHint != options.dart2jsHint ||
(this._options.hint && !options.hint) ||
this._options.preserveComments != options.preserveComments;
@@ -1091,11 +1109,8 @@
_priorityOrder = newPriorityOrder;
}
}
- this._options.analyzeAngular = options.analyzeAngular;
this._options.analyzeFunctionBodies = options.analyzeFunctionBodies;
this._options.generateSdkErrors = options.generateSdkErrors;
- this._options.enableDeferredLoading = options.enableDeferredLoading;
- this._options.enableEnum = options.enableEnum;
this._options.dart2jsHint = options.dart2jsHint;
this._options.hint = options.hint;
this._options.incremental = options.incremental;
@@ -1192,6 +1207,7 @@
*/
AnalysisTask get nextAnalysisTask {
bool hintsEnabled = _options.hint;
+ bool lintsEnabled = _options.lint;
bool hasBlockedTask = false;
//
// Look for incremental analysis
@@ -1224,8 +1240,12 @@
sourcesToRemove.add(source);
continue;
}
- AnalysisContextImpl_TaskData taskData =
- _getNextAnalysisTaskForSource(source, sourceEntry, true, hintsEnabled);
+ AnalysisContextImpl_TaskData taskData = _getNextAnalysisTaskForSource(
+ source,
+ sourceEntry,
+ true,
+ hintsEnabled,
+ lintsEnabled);
task = taskData.task;
if (task != null) {
break;
@@ -1253,8 +1273,12 @@
int priorityCount = _priorityOrder.length;
for (int i = 0; i < priorityCount; i++) {
Source source = _priorityOrder[i];
- AnalysisContextImpl_TaskData taskData =
- _getNextAnalysisTaskForSource(source, _cache.get(source), true, hintsEnabled);
+ AnalysisContextImpl_TaskData taskData = _getNextAnalysisTaskForSource(
+ source,
+ _cache.get(source),
+ true,
+ hintsEnabled,
+ lintsEnabled);
AnalysisTask task = taskData.task;
if (task != null) {
return task;
@@ -1297,8 +1321,12 @@
try {
while (sources.hasNext) {
Source source = sources.next();
- AnalysisContextImpl_TaskData taskData =
- _getNextAnalysisTaskForSource(source, _cache.get(source), false, hintsEnabled);
+ AnalysisContextImpl_TaskData taskData = _getNextAnalysisTaskForSource(
+ source,
+ _cache.get(source),
+ false,
+ hintsEnabled,
+ lintsEnabled);
AnalysisTask task = taskData.task;
if (task != null) {
return task;
@@ -1382,6 +1410,8 @@
List<Source> get sourcesNeedingProcessing {
HashSet<Source> sources = new HashSet<Source>();
bool hintsEnabled = _options.hint;
+ bool lintsEnabled = _options.lint;
+
//
// Look for priority sources that need to be analyzed.
//
@@ -1391,6 +1421,7 @@
_cache.get(source),
true,
hintsEnabled,
+ lintsEnabled,
sources);
}
//
@@ -1404,6 +1435,7 @@
_cache.get(source),
false,
hintsEnabled,
+ lintsEnabled,
sources);
}
return new List<Source>.from(sources);
@@ -1590,6 +1622,8 @@
@override
List<AnalysisError> computeErrors(Source source) {
bool enableHints = _options.hint;
+ bool enableLints = _options.lint;
+
SourceEntry sourceEntry = _getReadableSourceEntry(source);
if (sourceEntry is DartEntry) {
List<AnalysisError> errors = new List<AnalysisError>();
@@ -1621,6 +1655,12 @@
errors,
_getDartHintData(source, source, dartEntry, DartEntry.HINTS));
}
+ if (enableLints) {
+ dartEntry = _getReadableDartEntry(source);
+ ListUtilities.addAll(
+ errors,
+ _getDartLintData(source, source, dartEntry, DartEntry.LINTS));
+ }
} else {
List<Source> libraries = getLibrariesContaining(source);
for (Source librarySource in libraries) {
@@ -1645,6 +1685,12 @@
errors,
_getDartHintData(source, librarySource, dartEntry, DartEntry.HINTS));
}
+ if (enableLints) {
+ dartEntry = _getReadableDartEntry(source);
+ ListUtilities.addAll(
+ errors,
+ _getDartLintData(source, librarySource, dartEntry, DartEntry.LINTS));
+ }
}
}
} on ObsoleteSourceAnalysisException catch (exception, stackTrace) {
@@ -1820,21 +1866,6 @@
}
@override
- AngularApplication getAngularApplicationWithHtml(Source htmlSource) {
- SourceEntry sourceEntry = getReadableSourceEntryOrNull(htmlSource);
- if (sourceEntry is HtmlEntry) {
- HtmlEntry htmlEntry = sourceEntry;
- AngularApplication application =
- htmlEntry.getValue(HtmlEntry.ANGULAR_APPLICATION);
- if (application != null) {
- return application;
- }
- return htmlEntry.getValue(HtmlEntry.ANGULAR_ENTRY);
- }
- return null;
- }
-
- @override
CompilationUnitElement getCompilationUnitElement(Source unitSource,
Source librarySource) {
LibraryElement libraryElement = getLibraryElement(librarySource);
@@ -2158,12 +2189,23 @@
task = nextAnalysisTask;
}
if (task == null) {
+ _validateLastIncrementalResolutionResult();
+ if (_performAnalysisTaskStopwatch != null) {
+ AnalysisEngine.instance.instrumentationService.logPerformance(
+ AnalysisPerformanceKind.FULL,
+ _performAnalysisTaskStopwatch,
+ 'context_id=$_id');
+ _performAnalysisTaskStopwatch = null;
+ }
return new AnalysisResult(
_getChangeNotices(true),
getEnd - getStart,
null,
-1);
}
+ if (_performAnalysisTaskStopwatch == null) {
+ _performAnalysisTaskStopwatch = new Stopwatch()..start();
+ }
String taskDescription = task.toString();
_notifyAboutToPerformTask(taskDescription);
if (_TRACE_PERFORM_TASK) {
@@ -2207,6 +2249,32 @@
performEnd - performStart);
}
+ void _validateLastIncrementalResolutionResult() {
+ if (incrementalResolutionValidation_lastUnitSource == null ||
+ incrementalResolutionValidation_lastLibrarySource == null ||
+ incrementalResolutionValidation_lastUnit == null) {
+ return;
+ }
+ CompilationUnit fullUnit = getResolvedCompilationUnit2(
+ incrementalResolutionValidation_lastUnitSource,
+ incrementalResolutionValidation_lastLibrarySource);
+ if (fullUnit != null) {
+ try {
+ assertSameResolution(
+ incrementalResolutionValidation_lastUnit,
+ fullUnit);
+ } on IncrementalResolutionMismatch catch (mismatch, stack) {
+ String failure = mismatch.message;
+ String message =
+ 'Incremental resolution mismatch:\n$failure\nat\n$stack';
+ AnalysisEngine.instance.logger.logError(message);
+ }
+ }
+ incrementalResolutionValidation_lastUnitSource = null;
+ incrementalResolutionValidation_lastLibrarySource = null;
+ incrementalResolutionValidation_lastUnit = null;
+ }
+
@override
void recordLibraryElements(Map<Source, LibraryElement> elementMap) {
Source htmlSource = _sourceFactory.forUri(DartSdk.DART_HTML);
@@ -2219,7 +2287,6 @@
_recordElementData(dartEntry, library, library.source, htmlSource);
dartEntry.setState(SourceEntry.CONTENT, CacheState.FLUSHED);
dartEntry.setValue(SourceEntry.LINE_INFO, new LineInfo(<int>[0]));
- dartEntry.setValue(DartEntry.ANGULAR_ERRORS, AnalysisError.NO_ERRORS);
// DartEntry.ELEMENT - set in recordElementData
dartEntry.setValue(DartEntry.EXPORTED_LIBRARIES, Source.EMPTY_ARRAY);
dartEntry.setValue(DartEntry.IMPORTED_LIBRARIES, Source.EMPTY_ARRAY);
@@ -2248,6 +2315,10 @@
DartEntry.HINTS,
librarySource,
AnalysisError.NO_ERRORS);
+ dartEntry.setValueInLibrary(
+ DartEntry.LINTS,
+ librarySource,
+ AnalysisError.NO_ERRORS);
}
});
}
@@ -2474,6 +2545,7 @@
void visitCacheItems(void callback(Source source, SourceEntry dartEntry,
DataDescriptor rowDesc, CacheState state)) {
bool hintsEnabled = _options.hint;
+ bool lintsEnabled = _options.lint;
MapIterator<Source, SourceEntry> iterator = _cache.iterator();
while (iterator.moveNext()) {
Source source = iterator.key;
@@ -2490,15 +2562,6 @@
// The public namespace isn't computed by performAnalysisTask()
// and therefore isn't interesting.
continue;
- } else if (descriptor == HtmlEntry.ANGULAR_APPLICATION ||
- descriptor == HtmlEntry.ANGULAR_COMPONENT ||
- descriptor == HtmlEntry.ANGULAR_ENTRY ||
- descriptor == HtmlEntry.ANGULAR_ERRORS ||
- descriptor == HtmlEntry.POLYMER_BUILD_ERRORS ||
- descriptor == HtmlEntry.POLYMER_RESOLUTION_ERRORS) {
- // These values are not currently being computed, so their state is
- // not interesting.
- continue;
} else if (descriptor == HtmlEntry.HINTS) {
// We are not currently recording any hints related to HTML.
continue;
@@ -2514,8 +2577,7 @@
List<Source> librarySources = getLibrariesContaining(source);
for (Source librarySource in librarySources) {
for (DataDescriptor descriptor in sourceEntry.libraryDescriptors) {
- if (descriptor == DartEntry.ANGULAR_ERRORS ||
- descriptor == DartEntry.BUILT_ELEMENT ||
+ if (descriptor == DartEntry.BUILT_ELEMENT ||
descriptor == DartEntry.BUILT_UNIT) {
// These values are not currently being computed, so their state
// is not interesting.
@@ -2523,10 +2585,13 @@
} else if (source.isInSystemLibrary &&
!_generateSdkErrors &&
(descriptor == DartEntry.VERIFICATION_ERRORS ||
- descriptor == DartEntry.HINTS)) {
+ descriptor == DartEntry.HINTS ||
+ descriptor == DartEntry.LINTS)) {
continue;
} else if (!hintsEnabled && descriptor == DartEntry.HINTS) {
continue;
+ } else if (!lintsEnabled && descriptor == DartEntry.LINTS) {
+ continue;
}
callback(
librarySource,
@@ -2633,6 +2698,73 @@
}
/**
+ * Given a source for a Dart file and the library that contains it, return a cache entry in which
+ * the state of the data represented by the given descriptor is either [CacheState.VALID] or
+ * [CacheStateERROR]. This method assumes that the data can be produced by generating lints
+ * for the library if the data is not already cached.
+ *
+ * <b>Note:</b> This method cannot be used in an async environment.
+ *
+ * @param unitSource the source representing the Dart file
+ * @param librarySource the source representing the library containing the Dart file
+ * @param dartEntry the cache entry associated with the Dart file
+ * @param descriptor the descriptor representing the data to be returned
+ * @return a cache entry containing the required data
+ * @throws AnalysisException if data could not be returned because the source could not be parsed
+ */
+ DartEntry _cacheDartLintData(Source unitSource, Source librarySource,
+ DartEntry dartEntry, DataDescriptor descriptor) {
+ //
+ // Check to see whether we already have the information being requested.
+ //
+ CacheState state = dartEntry.getStateInLibrary(descriptor, librarySource);
+ while (state != CacheState.ERROR && state != CacheState.VALID) {
+ //
+ // If not, compute the information.
+ // Unless the modification date of the source continues to change,
+ // this loop will eventually terminate.
+ //
+ DartEntry libraryEntry = _getReadableDartEntry(librarySource);
+ libraryEntry = _cacheDartResolutionData(
+ librarySource,
+ librarySource,
+ libraryEntry,
+ DartEntry.ELEMENT);
+ LibraryElement libraryElement = libraryEntry.getValue(DartEntry.ELEMENT);
+ CompilationUnitElement definingUnit =
+ libraryElement.definingCompilationUnit;
+ List<CompilationUnitElement> parts = libraryElement.parts;
+ List<TimestampedData<CompilationUnit>> units =
+ new List<TimestampedData>(parts.length + 1);
+ units[0] = _getResolvedUnit(definingUnit, librarySource);
+ if (units[0] == null) {
+ Source source = definingUnit.source;
+ units[0] = new TimestampedData<CompilationUnit>(
+ getModificationStamp(source),
+ resolveCompilationUnit(source, libraryElement));
+ }
+ for (int i = 0; i < parts.length; i++) {
+ units[i + 1] = _getResolvedUnit(parts[i], librarySource);
+ if (units[i + 1] == null) {
+ Source source = parts[i].source;
+ units[i +
+ 1] = new TimestampedData<CompilationUnit>(
+ getModificationStamp(source),
+ resolveCompilationUnit(source, libraryElement));
+ }
+ }
+ //TODO(pquitslund): revisit if we need all units or whether one will do
+ dartEntry = new GenerateDartLintsTask(
+ this,
+ units,
+ getLibraryElement(librarySource)).perform(_resultRecorder) as DartEntry;
+ state = dartEntry.getStateInLibrary(descriptor, librarySource);
+ }
+ return dartEntry;
+ }
+
+
+ /**
* Given a source for a Dart file, return a cache entry in which the state of the data represented
* by the given descriptor is either [CacheState.VALID] or [CacheState.ERROR]. This
* method assumes that the data can be produced by parsing the source if it is not already cached.
@@ -3083,8 +3215,27 @@
} else if (originalContents != null) {
_incrementalAnalysisCache =
IncrementalAnalysisCache.clear(_incrementalAnalysisCache, source);
- _sourceChanged(source);
changed = true;
+ // We are removing the overlay for the file, check if the file's
+ // contents is the same as it was in the overlay.
+ SourceEntry sourceEntry = _cache.get(source);
+ if (sourceEntry != null) {
+ try {
+ TimestampedData<String> fileContents = getContents(source);
+ String fileContentsData = fileContents.data;
+ if (fileContentsData == originalContents) {
+ sourceEntry.modificationTime = fileContents.modificationTime;
+ sourceEntry.setValue(SourceEntry.CONTENT, fileContentsData);
+ 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);
+ }
}
return changed;
}
@@ -3175,6 +3326,53 @@
}
/**
+ * Create a [GenerateDartLintsTask] for the given source, marking the lints as
+ * being in-process.
+ *
+ * @param source the source whose content is to be verified
+ * @param dartEntry the entry for the source
+ * @param librarySource the source for the library containing the source
+ * @param libraryEntry the entry for the library
+ * @return task data representing the created task
+ */
+ AnalysisContextImpl_TaskData _createGenerateDartLintsTask(Source source,
+ DartEntry dartEntry, Source librarySource, DartEntry libraryEntry) {
+ if (libraryEntry.getState(DartEntry.ELEMENT) != CacheState.VALID) {
+ return _createResolveDartLibraryTask(librarySource, libraryEntry);
+ }
+ LibraryElement libraryElement = libraryEntry.getValue(DartEntry.ELEMENT);
+ CompilationUnitElement definingUnit =
+ libraryElement.definingCompilationUnit;
+ List<CompilationUnitElement> parts = libraryElement.parts;
+ List<TimestampedData<CompilationUnit>> units =
+ new List<TimestampedData>(parts.length + 1);
+ units[0] = _getResolvedUnit(definingUnit, librarySource);
+ if (units[0] == null) {
+ // TODO(brianwilkerson) We should return a ResolveDartUnitTask
+ // (unless there are multiple ASTs that need to be resolved).
+ return _createResolveDartLibraryTask(librarySource, libraryEntry);
+ }
+ for (int i = 0; i < parts.length; i++) {
+ units[i + 1] = _getResolvedUnit(parts[i], librarySource);
+ if (units[i + 1] == null) {
+ // TODO(brianwilkerson) We should return a ResolveDartUnitTask
+ // (unless there are multiple ASTs that need to be resolved).
+ return _createResolveDartLibraryTask(librarySource, libraryEntry);
+ }
+ }
+ dartEntry.setStateInLibrary(
+ DartEntry.LINTS,
+ librarySource,
+ CacheState.IN_PROCESS);
+ //TODO(pquitslund): revisit if we need all units or whether one will do
+ return new AnalysisContextImpl_TaskData(
+ new GenerateDartLintsTask(this, units, libraryElement),
+ false);
+ }
+
+
+
+ /**
* Create a [GetContentTask] for the given source, marking the content as being in-process.
*
* @param source the source whose content is to be accessed
@@ -3227,104 +3425,6 @@
}
/**
- * Create a [PolymerBuildHtmlTask] for the given source, marking the Polymer elements as
- * being in-process.
- *
- * @param source the source whose content is to be processed
- * @param htmlEntry the entry for the source
- * @return task data representing the created task
- */
- AnalysisContextImpl_TaskData _createPolymerBuildHtmlTask(Source source,
- HtmlEntry htmlEntry) {
- if (htmlEntry.getState(HtmlEntry.RESOLVED_UNIT) != CacheState.VALID) {
- return _createResolveHtmlTask(source, htmlEntry);
- }
- htmlEntry.setState(HtmlEntry.POLYMER_BUILD_ERRORS, CacheState.IN_PROCESS);
- return new AnalysisContextImpl_TaskData(
- new PolymerBuildHtmlTask(
- this,
- source,
- htmlEntry.getValue(SourceEntry.LINE_INFO),
- htmlEntry.getValue(HtmlEntry.RESOLVED_UNIT)),
- false);
- }
-
- /**
- * Create a [PolymerResolveHtmlTask] for the given source, marking the Polymer errors as
- * being in-process.
- *
- * @param source the source whose content is to be resolved
- * @param htmlEntry the entry for the source
- * @return task data representing the created task
- */
- AnalysisContextImpl_TaskData _createPolymerResolveHtmlTask(Source source,
- HtmlEntry htmlEntry) {
- if (htmlEntry.getState(HtmlEntry.RESOLVED_UNIT) != CacheState.VALID) {
- return _createResolveHtmlTask(source, htmlEntry);
- }
- htmlEntry.setState(
- HtmlEntry.POLYMER_RESOLUTION_ERRORS,
- CacheState.IN_PROCESS);
- return new AnalysisContextImpl_TaskData(
- new PolymerResolveHtmlTask(
- this,
- source,
- htmlEntry.getValue(SourceEntry.LINE_INFO),
- htmlEntry.getValue(HtmlEntry.RESOLVED_UNIT)),
- false);
- }
-
- /**
- * Create a [ResolveAngularComponentTemplateTask] for the given source, marking the angular
- * errors as being in-process.
- *
- * @param source the source whose content is to be resolved
- * @param htmlEntry the entry for the source
- * @return task data representing the created task
- */
- AnalysisContextImpl_TaskData
- _createResolveAngularComponentTemplateTask(Source source, HtmlEntry htmlEntry) {
- if (htmlEntry.getState(HtmlEntry.RESOLVED_UNIT) != CacheState.VALID) {
- return _createResolveHtmlTask(source, htmlEntry);
- }
- AngularApplication application =
- htmlEntry.getValue(HtmlEntry.ANGULAR_APPLICATION);
- AngularComponentElement component =
- htmlEntry.getValue(HtmlEntry.ANGULAR_COMPONENT);
- htmlEntry.setState(HtmlEntry.ANGULAR_ERRORS, CacheState.IN_PROCESS);
- return new AnalysisContextImpl_TaskData(
- new ResolveAngularComponentTemplateTask(
- this,
- source,
- htmlEntry.getValue(HtmlEntry.RESOLVED_UNIT),
- component,
- application),
- false);
- }
-
- /**
- * Create a [ResolveAngularEntryHtmlTask] for the given source, marking the angular entry as
- * being in-process.
- *
- * @param source the source whose content is to be resolved
- * @param htmlEntry the entry for the source
- * @return task data representing the created task
- */
- AnalysisContextImpl_TaskData _createResolveAngularEntryHtmlTask(Source source,
- HtmlEntry htmlEntry) {
- if (htmlEntry.getState(HtmlEntry.RESOLVED_UNIT) != CacheState.VALID) {
- return _createResolveHtmlTask(source, htmlEntry);
- }
- htmlEntry.setState(HtmlEntry.ANGULAR_ENTRY, CacheState.IN_PROCESS);
- return new AnalysisContextImpl_TaskData(
- new ResolveAngularEntryHtmlTask(
- this,
- source,
- htmlEntry.getValue(HtmlEntry.RESOLVED_UNIT)),
- false);
- }
-
- /**
* Create a [ResolveDartLibraryTask] for the given source, marking ? as being in-process.
*
* @param source the source whose content is to be resolved
@@ -3469,6 +3569,31 @@
}
/**
+ * Given a source for a Dart file and the library that contains it, return the data represented by
+ * the given descriptor that is associated with that source. This method assumes that the data can
+ * be produced by generating lints for the library if it is not already cached.
+ *
+ * <b>Note:</b> This method cannot be used in an async environment.
+ *
+ * @param unitSource the source representing the Dart file
+ * @param librarySource the source representing the library containing the Dart file
+ * @param dartEntry the entry representing the Dart file
+ * @param descriptor the descriptor representing the data to be returned
+ * @return the requested data about the given source
+ * @throws AnalysisException if data could not be returned because the source could not be
+ * resolved
+ */
+ Object _getDartLintData(Source unitSource, Source librarySource,
+ DartEntry dartEntry, DataDescriptor descriptor) {
+ dartEntry =
+ _cacheDartLintData(unitSource, librarySource, dartEntry, descriptor);
+ if (identical(descriptor, DartEntry.ELEMENT)) {
+ return dartEntry.getValue(descriptor);
+ }
+ return dartEntry.getValueInLibrary(descriptor, librarySource);
+ }
+
+ /**
* Given a source for a Dart file, return the data represented by the given descriptor that is
* associated with that source. This method assumes that the data can be produced by parsing the
* source if it is not already cached.
@@ -3746,10 +3871,12 @@
* @param sourceEntry the cache entry associated with the source
* @param isPriority `true` if the source is a priority source
* @param hintsEnabled `true` if hints are currently enabled
+ * @param lintsEnabled `true` if lints are currently enabled
* @return the next task that needs to be performed for the given source
*/
AnalysisContextImpl_TaskData _getNextAnalysisTaskForSource(Source source,
- SourceEntry sourceEntry, bool isPriority, bool hintsEnabled) {
+ SourceEntry sourceEntry, bool isPriority, bool hintsEnabled,
+ bool lintsEnabled) {
// Refuse to generate tasks for html based files that are above 1500 KB
if (_isTooBigHtmlSourceEntry(source, sourceEntry)) {
// TODO (jwren) we still need to report an error of some kind back to the
@@ -3859,6 +3986,18 @@
libraryEntry);
}
}
+ if (lintsEnabled) {
+ CacheState lintsState =
+ dartEntry.getStateInLibrary(DartEntry.LINTS, librarySource);
+ if (lintsState == CacheState.INVALID ||
+ (isPriority && lintsState == CacheState.FLUSHED)) {
+ return _createGenerateDartLintsTask(
+ source,
+ dartEntry,
+ librarySource,
+ libraryEntry);
+ }
+ }
}
}
}
@@ -3881,44 +4020,6 @@
(isPriority && resolvedUnitState == CacheState.FLUSHED)) {
return _createResolveHtmlTask(source, htmlEntry);
}
- //
- // Angular support
- //
- if (_options.analyzeAngular) {
- // Try to resolve the HTML as an Angular entry point.
- CacheState angularEntryState =
- htmlEntry.getState(HtmlEntry.ANGULAR_ENTRY);
- if (angularEntryState == CacheState.INVALID ||
- (isPriority && angularEntryState == CacheState.FLUSHED)) {
- return _createResolveAngularEntryHtmlTask(source, htmlEntry);
- }
- // Try to resolve the HTML as an Angular application part.
- CacheState angularErrorsState =
- htmlEntry.getState(HtmlEntry.ANGULAR_ERRORS);
- if (angularErrorsState == CacheState.INVALID ||
- (isPriority && angularErrorsState == CacheState.FLUSHED)) {
- return _createResolveAngularComponentTemplateTask(source, htmlEntry);
- }
- }
- //
- // Polymer support
- //
- if (_options.analyzePolymer) {
- // Build elements.
- CacheState polymerBuildErrorsState =
- htmlEntry.getState(HtmlEntry.POLYMER_BUILD_ERRORS);
- if (polymerBuildErrorsState == CacheState.INVALID ||
- (isPriority && polymerBuildErrorsState == CacheState.FLUSHED)) {
- return _createPolymerBuildHtmlTask(source, htmlEntry);
- }
- // Resolve references.
- CacheState polymerResolutionErrorsState =
- htmlEntry.getState(HtmlEntry.POLYMER_RESOLUTION_ERRORS);
- if (polymerResolutionErrorsState == CacheState.INVALID ||
- (isPriority && polymerResolutionErrorsState == CacheState.FLUSHED)) {
- return _createPolymerResolveHtmlTask(source, htmlEntry);
- }
- }
}
return new AnalysisContextImpl_TaskData(null, false);
}
@@ -4041,10 +4142,12 @@
* @param sourceEntry the cache entry associated with the source
* @param isPriority `true` if the source is a priority source
* @param hintsEnabled `true` if hints are currently enabled
+ * @param lintsEnabled `true` if lints are currently enabled
* @param sources the set to which sources should be added
*/
void _getSourcesNeedingProcessing(Source source, SourceEntry sourceEntry,
- bool isPriority, bool hintsEnabled, HashSet<Source> sources) {
+ bool isPriority, bool hintsEnabled, bool lintsEnabled,
+ HashSet<Source> sources) {
if (sourceEntry is DartEntry) {
DartEntry dartEntry = sourceEntry;
CacheState scanErrorsState = dartEntry.getState(DartEntry.SCAN_ERRORS);
@@ -4110,6 +4213,19 @@
}
}
}
+ if (lintsEnabled) {
+ CacheState lintsState =
+ dartEntry.getStateInLibrary(DartEntry.LINTS, librarySource);
+ if (lintsState == CacheState.INVALID ||
+ (isPriority && lintsState == CacheState.FLUSHED)) {
+ LibraryElement libraryElement =
+ libraryEntry.getValue(DartEntry.ELEMENT);
+ if (libraryElement != null) {
+ sources.add(source);
+ return;
+ }
+ }
+ }
}
}
}
@@ -4128,47 +4244,6 @@
sources.add(source);
return;
}
- // Angular
- if (_options.analyzeAngular) {
- CacheState angularErrorsState =
- htmlEntry.getState(HtmlEntry.ANGULAR_ERRORS);
- if (angularErrorsState == CacheState.INVALID ||
- (isPriority && angularErrorsState == CacheState.FLUSHED)) {
- AngularApplication entryInfo =
- htmlEntry.getValue(HtmlEntry.ANGULAR_ENTRY);
- if (entryInfo != null) {
- sources.add(source);
- return;
- }
- AngularApplication applicationInfo =
- htmlEntry.getValue(HtmlEntry.ANGULAR_APPLICATION);
- if (applicationInfo != null) {
- AngularComponentElement component =
- htmlEntry.getValue(HtmlEntry.ANGULAR_COMPONENT);
- if (component != null) {
- sources.add(source);
- return;
- }
- }
- }
- }
- // Polymer
- if (_options.analyzePolymer) {
- // Elements building.
- CacheState polymerBuildErrorsState =
- htmlEntry.getState(HtmlEntry.POLYMER_BUILD_ERRORS);
- if (polymerBuildErrorsState == CacheState.INVALID ||
- (isPriority && polymerBuildErrorsState == CacheState.FLUSHED)) {
- sources.add(source);
- }
- // Resolution.
- CacheState polymerResolutionErrorsState =
- htmlEntry.getState(HtmlEntry.POLYMER_RESOLUTION_ERRORS);
- if (polymerResolutionErrorsState == CacheState.INVALID ||
- (isPriority && polymerResolutionErrorsState == CacheState.FLUSHED)) {
- sources.add(source);
- }
- }
}
}
@@ -4204,54 +4279,6 @@
}
/**
- * In response to a change to Angular entry point [HtmlElement], invalidate any results that
- * depend on it.
- *
- * <b>Note:</b> This method must only be invoked while we are synchronized on [cacheLock].
- *
- * <b>Note:</b> Any cache entries that were accessed before this method was invoked must be
- * re-accessed after this method returns.
- *
- * @param entryCopy the [HtmlEntry] of the (maybe) Angular entry point being invalidated
- */
- void _invalidateAngularResolution(HtmlEntry entryCopy) {
- AngularApplication application =
- entryCopy.getValue(HtmlEntry.ANGULAR_ENTRY);
- if (application == null) {
- return;
- }
- _angularApplications.remove(application);
- // invalidate Entry
- entryCopy.setState(HtmlEntry.ANGULAR_ENTRY, CacheState.INVALID);
- // reset HTML sources
- List<AngularElement> oldAngularElements = application.elements;
- for (AngularElement angularElement in oldAngularElements) {
- if (angularElement is AngularHasTemplateElement) {
- AngularHasTemplateElement hasTemplate = angularElement;
- Source templateSource = hasTemplate.templateSource;
- if (templateSource != null) {
- HtmlEntry htmlEntry = _getReadableHtmlEntry(templateSource);
- htmlEntry.setValue(HtmlEntry.ANGULAR_APPLICATION, null);
- htmlEntry.setValue(HtmlEntry.ANGULAR_COMPONENT, null);
- htmlEntry.setState(HtmlEntry.ANGULAR_ERRORS, CacheState.INVALID);
- _workManager.add(templateSource, SourcePriority.HTML);
- }
- }
- }
- // reset Dart sources
- List<Source> oldElementSources = application.elementSources;
- for (Source elementSource in oldElementSources) {
- DartEntry dartEntry = _getReadableDartEntry(elementSource);
- dartEntry.setValue(DartEntry.ANGULAR_ERRORS, AnalysisError.NO_ERRORS);
- // notify about (disappeared) Angular errors
- ChangeNoticeImpl notice = _getNotice(elementSource);
- notice.setErrors(
- dartEntry.allErrors,
- dartEntry.getValue(SourceEntry.LINE_INFO));
- }
- }
-
- /**
* In response to a change to at least one of the compilation units in the given library,
* invalidate any results that are dependent on the result of resolving that library.
*
@@ -4280,16 +4307,6 @@
}
}
}
- // invalidate Angular applications
- List<AngularApplication> angularApplicationsCopy = <AngularApplication>[];
- for (AngularApplication application in angularApplicationsCopy) {
- if (application.dependsOn(librarySource)) {
- Source entryPointSource = application.entryPoint;
- HtmlEntry htmlEntry = _getReadableHtmlEntry(entryPointSource);
- _invalidateAngularResolution(htmlEntry);
- _workManager.add(entryPointSource, SourcePriority.HTML);
- }
- }
}
/**
@@ -4441,51 +4458,6 @@
// }
/**
- * Updates [HtmlEntry]s that correspond to the previously known and new Angular application
- * information.
- */
- void _recordAngularEntryPoint(HtmlEntry entry,
- ResolveAngularEntryHtmlTask task) {
- AngularApplication application = task.application;
- if (application != null) {
- _angularApplications.add(application);
- // if this is an entry point, then we already resolved it
- entry.setValue(HtmlEntry.ANGULAR_ERRORS, task.entryErrors);
- // schedule HTML templates analysis
- List<AngularElement> newAngularElements = application.elements;
- for (AngularElement angularElement in newAngularElements) {
- if (angularElement is AngularHasTemplateElement) {
- AngularHasTemplateElement hasTemplate = angularElement;
- Source templateSource = hasTemplate.templateSource;
- if (templateSource != null) {
- HtmlEntry htmlEntry = _getReadableHtmlEntry(templateSource);
- htmlEntry.setValue(HtmlEntry.ANGULAR_APPLICATION, application);
- if (hasTemplate is AngularComponentElement) {
- AngularComponentElement component = hasTemplate;
- htmlEntry.setValue(HtmlEntry.ANGULAR_COMPONENT, component);
- }
- htmlEntry.setState(HtmlEntry.ANGULAR_ERRORS, CacheState.INVALID);
- _workManager.add(templateSource, SourcePriority.HTML);
- }
- }
- }
- // update Dart sources errors
- List<Source> newElementSources = application.elementSources;
- for (Source elementSource in newElementSources) {
- DartEntry dartEntry = _getReadableDartEntry(elementSource);
- dartEntry.setValue(
- DartEntry.ANGULAR_ERRORS,
- task.getErrors(elementSource));
- // notify about Dart errors
- ChangeNoticeImpl notice = _getNotice(elementSource);
- notice.setErrors(dartEntry.allErrors, computeLineInfo(elementSource));
- }
- }
- // remember Angular entry point
- entry.setValue(HtmlEntry.ANGULAR_ENTRY, application);
- }
-
- /**
* Record the results produced by performing a [task] and return the cache
* entry associated with the results.
*/
@@ -4599,6 +4571,50 @@
* Record the results produced by performing a [task] and return the cache
* entry associated with the results.
*/
+ DartEntry _recordGenerateDartLintsTask(GenerateDartLintsTask task) {
+ Source librarySource = task.libraryElement.source;
+ CaughtException thrownException = task.exception;
+ DartEntry libraryEntry = null;
+ HashMap<Source, List<AnalysisError>> lintMap = task.lintMap;
+ if (lintMap == null) {
+ // We don't have any information about which sources to mark as invalid
+ // other than the library source.
+ DartEntry libraryEntry = _cache.get(librarySource);
+ if (thrownException == null) {
+ String message =
+ "GenerateDartLintsTask returned a null lint map "
+ "without throwing an exception: ${librarySource.fullName}";
+ thrownException =
+ new CaughtException(new AnalysisException(message), null);
+ }
+ libraryEntry.recordLintErrorInLibrary(librarySource, thrownException);
+ throw new AnalysisException('<rethrow>', thrownException);
+ }
+ lintMap.forEach((Source unitSource, List<AnalysisError> lints) {
+ DartEntry dartEntry = _cache.get(unitSource);
+ if (unitSource == librarySource) {
+ libraryEntry = dartEntry;
+ }
+ if (thrownException == null) {
+ dartEntry.setValueInLibrary(DartEntry.LINTS, librarySource, lints);
+ ChangeNoticeImpl notice = _getNotice(unitSource);
+ LineInfo lineInfo = dartEntry.getValue(SourceEntry.LINE_INFO);
+ notice.setErrors(dartEntry.allErrors, lineInfo);
+ } else {
+ dartEntry.recordLintErrorInLibrary(librarySource, thrownException);
+ }
+ });
+ if (thrownException != null) {
+ throw new AnalysisException('<rethrow>', thrownException);
+ }
+ return libraryEntry;
+ }
+
+
+ /**
+ * Record the results produced by performing a [task] and return the cache
+ * entry associated with the results.
+ */
SourceEntry _recordGetContentsTask(GetContentTask task) {
if (!task.isComplete) {
return null;
@@ -4729,91 +4745,6 @@
* Record the results produced by performing a [task] and return the cache
* entry associated with the results.
*/
- HtmlEntry _recordPolymerBuildHtmlTaskResults(PolymerBuildHtmlTask task) {
- Source source = task.source;
- HtmlEntry htmlEntry = _cache.get(source);
- CaughtException thrownException = task.exception;
- if (thrownException != null) {
- htmlEntry.recordResolutionError(thrownException);
- throw new AnalysisException('<rethrow>', thrownException);
- }
- htmlEntry.setValue(HtmlEntry.POLYMER_BUILD_ERRORS, task.errors);
- // notify about errors
- ChangeNoticeImpl notice = _getNotice(source);
- LineInfo lineInfo = htmlEntry.getValue(SourceEntry.LINE_INFO);
- notice.setErrors(htmlEntry.allErrors, lineInfo);
- return htmlEntry;
- }
-
- /**
- * Record the results produced by performing a [task] and return the cache
- * entry associated with the results.
- */
- HtmlEntry _recordPolymerResolveHtmlTaskResults(PolymerResolveHtmlTask task) {
- Source source = task.source;
- HtmlEntry htmlEntry = _cache.get(source);
- CaughtException thrownException = task.exception;
- if (thrownException != null) {
- htmlEntry.recordResolutionError(thrownException);
- throw new AnalysisException('<rethrow>', thrownException);
- }
- htmlEntry.setValue(HtmlEntry.POLYMER_RESOLUTION_ERRORS, task.errors);
- // notify about errors
- ChangeNoticeImpl notice = _getNotice(source);
- LineInfo lineInfo = htmlEntry.getValue(SourceEntry.LINE_INFO);
- notice.setErrors(htmlEntry.allErrors, lineInfo);
- return htmlEntry;
- }
-
- /**
- * Record the results produced by performing a [task] and return the cache
- * entry associated with the results.
- */
- HtmlEntry
- _recordResolveAngularComponentTemplateTaskResults(ResolveAngularComponentTemplateTask task) {
- Source source = task.source;
- HtmlEntry htmlEntry = _cache.get(source);
- CaughtException thrownException = task.exception;
- if (thrownException != null) {
- htmlEntry.recordResolutionError(thrownException);
- throw new AnalysisException('<rethrow>', thrownException);
- }
- htmlEntry.setValue(HtmlEntry.ANGULAR_ERRORS, task.resolutionErrors);
- // notify about errors
- ChangeNoticeImpl notice = _getNotice(source);
- notice.htmlUnit = task.resolvedUnit;
- LineInfo lineInfo = htmlEntry.getValue(SourceEntry.LINE_INFO);
- notice.setErrors(htmlEntry.allErrors, lineInfo);
- return htmlEntry;
- }
-
- /**
- * Record the results produced by performing a [task] and return the cache
- * entry associated with the results.
- */
- HtmlEntry
- _recordResolveAngularEntryHtmlTaskResults(ResolveAngularEntryHtmlTask task) {
- Source source = task.source;
- HtmlEntry htmlEntry = _cache.get(source);
- CaughtException thrownException = task.exception;
- if (thrownException != null) {
- htmlEntry.recordResolutionError(thrownException);
- throw new AnalysisException('<rethrow>', thrownException);
- }
- htmlEntry.setValue(HtmlEntry.RESOLVED_UNIT, task.resolvedUnit);
- _recordAngularEntryPoint(htmlEntry, task);
- _cache.storedAst(source);
- ChangeNoticeImpl notice = _getNotice(source);
- notice.htmlUnit = task.resolvedUnit;
- LineInfo lineInfo = htmlEntry.getValue(SourceEntry.LINE_INFO);
- notice.setErrors(htmlEntry.allErrors, lineInfo);
- return htmlEntry;
- }
-
- /**
- * Record the results produced by performing a [task] and return the cache
- * entry associated with the results.
- */
DartEntry _recordResolveDartUnitTaskResults(ResolveDartUnitTask task) {
Source unitSource = task.source;
DartEntry dartEntry = _cache.get(unitSource);
@@ -4990,7 +4921,6 @@
if (sourceEntry is HtmlEntry) {
HtmlEntry htmlEntry = sourceEntry;
htmlEntry.modificationTime = getModificationStamp(source);
- _invalidateAngularResolution(htmlEntry);
htmlEntry.invalidateAllInformation();
_cache.removedAst(source);
_workManager.add(source, SourcePriority.HTML);
@@ -5012,6 +4942,12 @@
_cache.removedAst(source);
_workManager.add(source, SourcePriority.UNKNOWN);
}
+ // reset unit in the notification, it is out of date now
+ ChangeNoticeImpl notice = _pendingNotices[source];
+ if (notice != null) {
+ notice.compilationUnit = null;
+ notice.htmlUnit = null;
+ }
}
/**
@@ -5023,7 +4959,6 @@
SourceEntry sourceEntry = _cache.get(source);
if (sourceEntry is HtmlEntry) {
HtmlEntry htmlEntry = sourceEntry;
- _invalidateAngularResolution(htmlEntry);
htmlEntry.recordContentError(
new CaughtException(
new AnalysisException("This source was marked as being deleted"),
@@ -5058,7 +4993,6 @@
void _sourceRemoved(Source source) {
SourceEntry sourceEntry = _cache.get(source);
if (sourceEntry is HtmlEntry) {
- _invalidateAngularResolution(sourceEntry);
} else if (sourceEntry is DartEntry) {
HashSet<Source> libraries = new HashSet<Source>();
for (Source librarySource in getLibrariesContaining(source)) {
@@ -5081,40 +5015,74 @@
* TODO(scheglov) A hackish, limited incremental resolution implementation.
*/
bool _tryPoorMansIncrementalResolution(Source unitSource, String newCode) {
+ incrementalResolutionValidation_lastUnitSource = null;
+ incrementalResolutionValidation_lastLibrarySource = null;
+ incrementalResolutionValidation_lastUnit = null;
+ // prepare the entry
DartEntry dartEntry = _cache.get(unitSource);
if (dartEntry == null) {
return false;
}
- // prepare the (only) library
+ // prepare the (only) library source
List<Source> librarySources = getLibrariesContaining(unitSource);
if (librarySources.length != 1) {
return false;
}
- // prepare the existing unit
Source librarySource = librarySources[0];
- CompilationUnit oldUnit =
- getResolvedCompilationUnit2(unitSource, librarySource);
+ // prepare the library element
+ LibraryElement libraryElement = getLibraryElement(librarySource);
+ if (libraryElement == null) {
+ return false;
+ }
+ // prepare the existing library units
+ Map<Source, CompilationUnit> units = <Source, CompilationUnit>{};
+ for (CompilationUnitElement unitElement in libraryElement.units) {
+ Source unitSource = unitElement.source;
+ CompilationUnit unit =
+ getResolvedCompilationUnit2(unitSource, librarySource);
+ if (unit == null) {
+ return false;
+ }
+ units[unitSource] = unit;
+ }
+ // prepare the existing unit
+ CompilationUnit oldUnit = units[unitSource];
if (oldUnit == null) {
return false;
}
// do resolution
+ Stopwatch perfCounter = new Stopwatch()..start();
PoorMansIncrementalResolver resolver = new PoorMansIncrementalResolver(
typeProvider,
+ units,
unitSource,
dartEntry,
analysisOptions.incrementalApi);
- bool success = resolver.resolve(oldUnit, newCode);
+ 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;
}
- // prepare notice
- ChangeNoticeImpl notice = _getNotice(unitSource);
- notice.compilationUnit = oldUnit;
- // apply updated errors
- {
- LineInfo lineInfo = getLineInfo(unitSource);
- notice.setErrors(dartEntry.allErrors, lineInfo);
+ // 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 notices
+ units.forEach((Source source, CompilationUnit unit) {
+ DartEntry dartEntry = _cache.get(source);
+ LineInfo lineInfo = getLineInfo(source);
+ ChangeNoticeImpl notice = _getNotice(source);
+ notice.compilationUnit = unit;
+ notice.setErrors(dartEntry.allErrors, lineInfo);
+ });
+ // OK
return true;
}
@@ -5194,6 +5162,10 @@
AnalysisContextImpl_this._recordGenerateDartHintsTask(task);
@override
+ DartEntry visitGenerateDartLintsTask(GenerateDartLintsTask task) =>
+ AnalysisContextImpl_this._recordGenerateDartLintsTask(task);
+
+ @override
SourceEntry visitGetContentTask(GetContentTask task) =>
AnalysisContextImpl_this._recordGetContentsTask(task);
@@ -5210,25 +5182,6 @@
AnalysisContextImpl_this._recordParseHtmlTaskResults(task);
@override
- HtmlEntry visitPolymerBuildHtmlTask(PolymerBuildHtmlTask task) =>
- AnalysisContextImpl_this._recordPolymerBuildHtmlTaskResults(task);
-
- @override
- HtmlEntry visitPolymerResolveHtmlTask(PolymerResolveHtmlTask task) =>
- AnalysisContextImpl_this._recordPolymerResolveHtmlTaskResults(task);
-
- @override
- HtmlEntry
- visitResolveAngularComponentTemplateTask(ResolveAngularComponentTemplateTask task) =>
- AnalysisContextImpl_this._recordResolveAngularComponentTemplateTaskResults(
- task);
-
- @override
- HtmlEntry
- visitResolveAngularEntryHtmlTask(ResolveAngularEntryHtmlTask task) =>
- AnalysisContextImpl_this._recordResolveAngularEntryHtmlTaskResults(task);
-
- @override
DartEntry
visitResolveDartLibraryCycleTask(ResolveDartLibraryCycleTask task) =>
AnalysisContextImpl_this.recordResolveDartLibraryCycleTaskResults(task);
@@ -5279,6 +5232,7 @@
bool _astIsNeeded(DartEntry dartEntry) =>
dartEntry.hasInvalidData(DartEntry.HINTS) ||
+ dartEntry.hasInvalidData(DartEntry.LINTS) ||
dartEntry.hasInvalidData(DartEntry.VERIFICATION_ERRORS) ||
dartEntry.hasInvalidData(DartEntry.RESOLUTION_ERRORS);
}
@@ -5879,72 +5833,6 @@
}
/**
- * Information about single piece of data in the cache.
- */
-abstract class AnalysisContextStatistics_CacheRow {
- /**
- * List of possible states which can be queried.
- */
- static const List<CacheState> STATES = const <CacheState>[
- CacheState.ERROR,
- CacheState.FLUSHED,
- CacheState.IN_PROCESS,
- CacheState.INVALID,
- CacheState.VALID];
-
- /**
- * Return the number of entries whose state is [CacheState.ERROR].
- */
- int get errorCount;
-
- /**
- * Return the number of entries whose state is [CacheState.FLUSHED].
- */
- int get flushedCount;
-
- /**
- * Return the number of entries whose state is [CacheState.IN_PROCESS].
- */
- int get inProcessCount;
-
- /**
- * Return the number of entries whose state is [CacheState.INVALID].
- */
- int get invalidCount;
-
- /**
- * Return the name of the data represented by this object.
- */
- String get name;
-
- /**
- * Return the number of entries whose state is [CacheState.VALID].
- */
- int get validCount;
-
- /**
- * Return the number of entries whose state is [state].
- */
- int getCount(CacheState state);
-}
-
-/**
- * Information about a single partition in the cache.
- */
-abstract class AnalysisContextStatistics_PartitionData {
- /**
- * Return the number of entries in the partition that have an AST structure in one state or
- * another.
- */
- int get astCount;
-
- /**
- * Return the total number of entries in the partition.
- */
- int get totalCount;
-}
-
-/**
* Implementation of the [AnalysisContextStatistics].
*/
class AnalysisContextStatisticsImpl implements AnalysisContextStatistics {
@@ -6061,6 +5949,72 @@
}
/**
+ * Information about single piece of data in the cache.
+ */
+abstract class AnalysisContextStatistics_CacheRow {
+ /**
+ * List of possible states which can be queried.
+ */
+ static const List<CacheState> STATES = const <CacheState>[
+ CacheState.ERROR,
+ CacheState.FLUSHED,
+ CacheState.IN_PROCESS,
+ CacheState.INVALID,
+ CacheState.VALID];
+
+ /**
+ * Return the number of entries whose state is [CacheState.ERROR].
+ */
+ int get errorCount;
+
+ /**
+ * Return the number of entries whose state is [CacheState.FLUSHED].
+ */
+ int get flushedCount;
+
+ /**
+ * Return the number of entries whose state is [CacheState.IN_PROCESS].
+ */
+ int get inProcessCount;
+
+ /**
+ * Return the number of entries whose state is [CacheState.INVALID].
+ */
+ int get invalidCount;
+
+ /**
+ * Return the name of the data represented by this object.
+ */
+ String get name;
+
+ /**
+ * Return the number of entries whose state is [CacheState.VALID].
+ */
+ int get validCount;
+
+ /**
+ * Return the number of entries whose state is [state].
+ */
+ int getCount(CacheState state);
+}
+
+/**
+ * Information about a single partition in the cache.
+ */
+abstract class AnalysisContextStatistics_PartitionData {
+ /**
+ * Return the number of entries in the partition that have an AST structure in one state or
+ * another.
+ */
+ int get astCount;
+
+ /**
+ * Return the total number of entries in the partition.
+ */
+ int get totalCount;
+}
+
+/**
* Instances of the class `AnalysisDelta` indicate changes to the types of analysis that
* should be performed.
*/
@@ -6456,13 +6410,6 @@
*/
abstract class AnalysisOptions {
/**
- * Return `true` if analysis is to analyze Angular.
- *
- * @return `true` if analysis is to analyze Angular
- */
- bool get analyzeAngular;
-
- /**
* Return `true` if analysis is to parse and analyze function bodies.
*
* @return `true` if analysis is to parse and analyzer function bodies
@@ -6470,13 +6417,6 @@
bool get analyzeFunctionBodies;
/**
- * Return `true` if analysis is to analyze Polymer.
- *
- * @return `true` if analysis is to analyze Polymer
- */
- bool get analyzePolymer;
-
- /**
* Return the maximum number of sources for which AST structures should be kept in the cache.
*
* @return the maximum number of sources for which AST structures should be kept in the cache
@@ -6501,6 +6441,7 @@
*
* @return `true` if analysis is to include the new deferred loading support
*/
+ @deprecated
bool get enableDeferredLoading;
/**
@@ -6508,6 +6449,7 @@
*
* @return `true` if analysis is to include the new enum support
*/
+ @deprecated
bool get enableEnum;
/**
@@ -6546,6 +6488,13 @@
bool get incrementalValidation;
/**
+ * Return `true` if analysis is to generate lint warnings.
+ *
+ * @return `true` if analysis is to generate lint warnings
+ */
+ bool get lint;
+
+ /**
* Return `true` if analysis is to parse comments.
*
* @return `true` if analysis is to parse comments
@@ -6566,29 +6515,21 @@
/**
* The default value for enabling deferred loading.
*/
+ @deprecated
static bool DEFAULT_ENABLE_DEFERRED_LOADING = true;
/**
* The default value for enabling enum support.
*/
+ @deprecated
static bool DEFAULT_ENABLE_ENUM = false;
/**
- * A flag indicating whether analysis is to analyze Angular.
- */
- bool analyzeAngular = true;
-
- /**
* A flag indicating whether analysis is to parse and analyze function bodies.
*/
bool analyzeFunctionBodies = true;
/**
- * A flag indicating whether analysis is to analyze Polymer.
- */
- bool analyzePolymer = true;
-
- /**
* The maximum number of sources for which AST structures should be kept in the cache.
*/
int cacheSize = DEFAULT_CACHE_SIZE;
@@ -6598,25 +6539,6 @@
*/
bool dart2jsHint = true;
- @deprecated
- @override
- bool get enableAsync => true;
-
- @deprecated
- void set enableAsync(bool enable) {
- // Async support cannot be disabled
- }
-
- /**
- * A flag indicating whether analysis is to enable deferred loading.
- */
- bool enableDeferredLoading = DEFAULT_ENABLE_DEFERRED_LOADING;
-
- /**
- * A flag indicating whether analysis is to enable enum support.
- */
- bool enableEnum = DEFAULT_ENABLE_ENUM;
-
/**
* A flag indicating whether errors, warnings and hints should be generated for sources in the
* SDK.
@@ -6647,6 +6569,11 @@
bool incrementalValidation = false;
/**
+ * A flag indicating whether analysis is to generate lint warnings.
+ */
+ bool lint = false;
+
+ /**
* A flag indicating whether analysis is to parse comments.
*/
bool preserveComments = true;
@@ -6663,21 +6590,45 @@
* @param options the analysis options whose values are being copied
*/
AnalysisOptionsImpl.con1(AnalysisOptions options) {
- analyzeAngular = options.analyzeAngular;
analyzeFunctionBodies = options.analyzeFunctionBodies;
- analyzePolymer = options.analyzePolymer;
cacheSize = options.cacheSize;
dart2jsHint = options.dart2jsHint;
- enableDeferredLoading = options.enableDeferredLoading;
- enableEnum = options.enableEnum;
_generateSdkErrors = options.generateSdkErrors;
hint = options.hint;
incremental = options.incremental;
incrementalApi = options.incrementalApi;
incrementalValidation = options.incrementalValidation;
+ lint = options.lint;
preserveComments = options.preserveComments;
}
+ @deprecated
+ @override
+ bool get enableAsync => true;
+
+ @deprecated
+ void set enableAsync(bool enable) {
+ // Async support cannot be disabled
+ }
+
+ @deprecated
+ @override
+ bool get enableDeferredLoading => true;
+
+ @deprecated
+ void set enableDeferredLoading(bool enable) {
+ // Deferred loading support cannot be disabled
+ }
+
+ @deprecated
+ @override
+ bool get enableEnum => true;
+
+ @deprecated
+ void set enableEnum(bool enable) {
+ // Enum support cannot be disabled
+ }
+
@override
bool get generateSdkErrors => _generateSdkErrors;
@@ -6868,6 +6819,12 @@
* Visit the given [task], returning the result of the visit. This method will
* throw an AnalysisException if the visitor throws an exception.
*/
+ E visitGenerateDartLintsTask(GenerateDartLintsTask task);
+
+ /**
+ * Visit the given [task], returning the result of the visit. This method will
+ * throw an AnalysisException if the visitor throws an exception.
+ */
E visitGetContentTask(GetContentTask task);
/**
@@ -6893,31 +6850,6 @@
* Visit the given [task], returning the result of the visit. This method will
* throw an AnalysisException if the visitor throws an exception.
*/
- E visitPolymerBuildHtmlTask(PolymerBuildHtmlTask task);
-
- /**
- * Visit the given [task], returning the result of the visit. This method will
- * throw an AnalysisException if the visitor throws an exception.
- */
- E visitPolymerResolveHtmlTask(PolymerResolveHtmlTask task);
-
- /**
- * Visit the given [task], returning the result of the visit. This method will
- * throw an AnalysisException if the visitor throws an exception.
- */
- E
- visitResolveAngularComponentTemplateTask(ResolveAngularComponentTemplateTask task);
-
- /**
- * Visit the given [task], returning the result of the visit. This method will
- * throw an AnalysisException if the visitor throws an exception.
- */
- E visitResolveAngularEntryHtmlTask(ResolveAngularEntryHtmlTask task);
-
- /**
- * Visit the given [task], returning the result of the visit. This method will
- * throw an AnalysisException if the visitor throws an exception.
- */
E visitResolveDartLibraryCycleTask(ResolveDartLibraryCycleTask task);
/**
@@ -6946,1037 +6878,6 @@
}
/**
- * An [Expression] with optional [AngularFormatterNode]s.
- */
-class AngularExpression {
- /**
- * The [Expression] to apply formatters to.
- */
- final Expression expression;
-
- /**
- * The formatters to apply.
- */
- final List<AngularFormatterNode> formatters;
-
- AngularExpression(this.expression, this.formatters);
-
- /**
- * Return the offset of the character immediately following the last character of this node's
- * source range. This is equivalent to `node.getOffset() + node.getLength()`.
- *
- * @return the offset of the character just past the node's source range
- */
- int get end {
- if (formatters.isEmpty) {
- return expression.end;
- }
- AngularFormatterNode lastFormatter = formatters[formatters.length - 1];
- List<AngularFormatterArgument> formatterArguments = lastFormatter.arguments;
- if (formatterArguments.isEmpty) {
- return lastFormatter.name.end;
- }
- return formatterArguments[formatterArguments.length - 1].expression.end;
- }
-
- /**
- * Return Dart [Expression]s this Angular expression consists of.
- */
- List<Expression> get expressions {
- List<Expression> expressions = <Expression>[];
- expressions.add(expression);
- for (AngularFormatterNode formatter in formatters) {
- expressions.add(formatter.name);
- for (AngularFormatterArgument formatterArgument in formatter.arguments) {
- expressions.addAll(formatterArgument.subExpressions);
- expressions.add(formatterArgument.expression);
- }
- }
- return expressions;
- }
-
- /**
- * Return the number of characters in the expression's source range.
- */
- int get length => end - offset;
-
- /**
- * Return the offset of the first character in the expression's source range.
- */
- int get offset => expression.offset;
-}
-
-/**
- * Angular formatter argument.
- */
-class AngularFormatterArgument {
- /**
- * The [TokenType.COLON] token.
- */
- final Token token;
-
- /**
- * The argument expression.
- */
- final Expression expression;
-
- /**
- * The optional sub-[Expression]s.
- */
- List<Expression> subExpressions = Expression.EMPTY_ARRAY;
-
- AngularFormatterArgument(this.token, this.expression);
-}
-
-/**
- * Angular formatter node.
- */
-class AngularFormatterNode {
- /**
- * The [TokenType.BAR] token.
- */
- final Token token;
-
- /**
- * The name of the formatter.
- */
- final SimpleIdentifier name;
-
- /**
- * The arguments for this formatter.
- */
- final List<AngularFormatterArgument> arguments;
-
- AngularFormatterNode(this.token, this.name, this.arguments);
-}
-
-/**
- * Instances of the class [AngularHtmlUnitResolver] resolve Angular specific expressions.
- */
-class AngularHtmlUnitResolver extends ht.RecursiveXmlVisitor<Object> {
- static String _NG_APP = "ng-app";
-
- final InternalAnalysisContext _context;
-
- TypeProvider _typeProvider;
-
- AngularHtmlUnitResolver_FilteringAnalysisErrorListener _errorListener;
-
- final Source _source;
-
- final LineInfo _lineInfo;
-
- final ht.HtmlUnit _unit;
-
-// List<AngularElement> _angularElements;
-
- List<NgProcessor> _processors = <NgProcessor>[];
-
- LibraryElementImpl _libraryElement;
-
- CompilationUnitElementImpl _unitElement;
-
- FunctionElementImpl _functionElement;
-
- ResolverVisitor _resolver;
-
- bool _isAngular = false;
-
- List<LocalVariableElementImpl> _definedVariables = <LocalVariableElementImpl>[
- ];
-
- Set<LibraryElement> _injectedLibraries = new Set();
-
- Scope _topNameScope;
-
- Scope _nameScope;
-
- AngularHtmlUnitResolver(this._context, AnalysisErrorListener errorListener,
- this._source, this._lineInfo, this._unit) {
- this._typeProvider = _context.typeProvider;
- this._errorListener =
- new AngularHtmlUnitResolver_FilteringAnalysisErrorListener(errorListener);
- }
-
- /**
- * @return the [TypeProvider] of the [AnalysisContext].
- */
- TypeProvider get typeProvider => _typeProvider;
-
- /**
- * The [AngularApplication] for the Web application with this entry point, may be
- * `null` if not an entry point.
- */
- AngularApplication calculateAngularApplication() {
- // check if Angular at all
- if (!hasAngularAnnotation(_unit)) {
- return null;
- }
- // prepare resolved Dart unit
- CompilationUnit dartUnit = _getDartUnit(_context, _unit);
- if (dartUnit == null) {
- return null;
- }
- // prepare accessible Angular elements
- LibraryElement libraryElement = dartUnit.element.library;
- Set<LibraryElement> libraries = new Set();
- List<AngularElement> angularElements =
- _getAngularElements(libraries, libraryElement);
- // resolve AngularComponentElement template URIs
- // TODO(scheglov) resolve to HtmlElement to allow F3 ?
- Set<Source> angularElementsSources = new Set();
- for (AngularElement angularElement in angularElements) {
- if (angularElement is AngularHasTemplateElement) {
- AngularHasTemplateElement hasTemplate = angularElement;
- angularElementsSources.add(angularElement.source);
- String templateUri = hasTemplate.templateUri;
- if (templateUri == null) {
- continue;
- }
- try {
- Source templateSource = _context.sourceFactory.forUri2(
- _source.resolveRelativeUri(parseUriWithException(templateUri)));
- if (!_context.exists(templateSource)) {
- templateSource =
- _context.sourceFactory.resolveUri(_source, "package:$templateUri");
- if (!_context.exists(templateSource)) {
- _errorListener.onError(
- new AnalysisError.con2(
- angularElement.source,
- hasTemplate.templateUriOffset,
- templateUri.length,
- AngularCode.URI_DOES_NOT_EXIST,
- [templateUri]));
- continue;
- }
- }
- if (!AnalysisEngine.isHtmlFileName(templateUri)) {
- continue;
- }
- if (hasTemplate is AngularComponentElementImpl) {
- hasTemplate.templateSource = templateSource;
- }
- if (hasTemplate is AngularViewElementImpl) {
- hasTemplate.templateSource = templateSource;
- }
- } on URISyntaxException catch (exception) {
- _errorListener.onError(
- new AnalysisError.con2(
- angularElement.source,
- hasTemplate.templateUriOffset,
- templateUri.length,
- AngularCode.INVALID_URI,
- [templateUri]));
- }
- }
- }
- // create AngularApplication
- AngularApplication application = new AngularApplication(
- _source,
- _getLibrarySources(libraries),
- angularElements,
- new List.from(angularElementsSources));
- // set AngularApplication for each AngularElement
- for (AngularElement angularElement in angularElements) {
- (angularElement as AngularElementImpl).application = application;
- }
- // done
- return application;
- }
-
- /**
- * Resolves [source] as an [AngularComponentElement] template file.
- *
- * @param application the Angular application we are resolving for
- * @param component the [AngularComponentElement] to resolve template for, not `null`
- */
- void resolveComponentTemplate(AngularApplication application,
- AngularComponentElement component) {
- _isAngular = true;
- _resolveInternal(application.elements, component);
- }
-
- /**
- * Resolves [source] as an Angular application entry point.
- */
- void resolveEntryPoint(AngularApplication application) {
- _resolveInternal(application.elements, null);
- }
-
- @override
- Object visitXmlAttributeNode(ht.XmlAttributeNode node) {
- _parseEmbeddedExpressionsInAttribute(node);
- _resolveExpressions(node.expressions);
- return super.visitXmlAttributeNode(node);
- }
-
- @override
- Object visitXmlTagNode(ht.XmlTagNode node) {
- bool wasAngular = _isAngular;
- try {
- // new Angular context
- if (node.getAttribute(_NG_APP) != null) {
- _isAngular = true;
- _visitModelDirectives(node);
- }
- // not Angular
- if (!_isAngular) {
- return super.visitXmlTagNode(node);
- }
- // process node in separate name scope
- _pushNameScope();
- try {
- _parseEmbeddedExpressionsInTag(node);
- // apply processors
- for (NgProcessor processor in _processors) {
- if (processor.canApply(node)) {
- processor.apply(this, node);
- }
- }
- // resolve expressions
- _resolveExpressions(node.expressions);
- // process children
- return super.visitXmlTagNode(node);
- } finally {
- _popNameScope();
- }
- } finally {
- _isAngular = wasAngular;
- }
- }
-
- /**
- * Puts into [libraryElement] an artificial [LibraryElementImpl] for this HTML
- * [Source].
- */
- void _createLibraryElement() {
- // create CompilationUnitElementImpl
- String unitName = _source.shortName;
- _unitElement = new CompilationUnitElementImpl(unitName);
- _unitElement.source = _source;
- // create LibraryElementImpl
- _libraryElement =
- new LibraryElementImpl.forNode(_context.getContextFor(_source), null);
- _libraryElement.definingCompilationUnit = _unitElement;
- _libraryElement.angularHtml = true;
- _injectedLibraries.add(_libraryElement);
- // create FunctionElementImpl
- _functionElement = new FunctionElementImpl.forOffset(0);
- _unitElement.functions = <FunctionElement>[_functionElement];
- }
-
- /**
- * Creates new [LocalVariableElementImpl] with given type and identifier.
- *
- * @param type the [Type] of the variable
- * @param identifier the identifier to create variable for
- * @return the new [LocalVariableElementImpl]
- */
- LocalVariableElementImpl _createLocalVariableFromIdentifier(DartType type,
- SimpleIdentifier identifier) {
- LocalVariableElementImpl variable =
- new LocalVariableElementImpl.forNode(identifier);
- _definedVariables.add(variable);
- variable.type = type;
- return variable;
- }
-
- /**
- * Creates new [LocalVariableElementImpl] with given name and type.
- *
- * @param type the [Type] of the variable
- * @param name the name of the variable
- * @return the new [LocalVariableElementImpl]
- */
- LocalVariableElementImpl _createLocalVariableWithName(DartType type,
- String name) {
- SimpleIdentifier identifier = _createIdentifier(name, 0);
- return _createLocalVariableFromIdentifier(type, identifier);
- }
-
- /**
- * Creates new [NgProcessor] for the given [AngularElement], maybe `null` if not
- * supported.
- */
- NgProcessor _createProcessor(AngularElement element) {
- if (element is AngularComponentElement) {
- AngularComponentElement component = element;
- return new NgComponentElementProcessor(component);
- }
- if (element is AngularControllerElement) {
- AngularControllerElement controller = element;
- return new NgControllerElementProcessor(controller);
- }
- if (element is AngularDecoratorElement) {
- AngularDecoratorElement directive = element;
- return new NgDecoratorElementProcessor(directive);
- }
- return null;
- }
-
- /**
- * Puts into [resolver] an [ResolverVisitor] to resolve [Expression]s in
- * [source].
- */
- void _createResolver() {
- InheritanceManager inheritanceManager =
- new InheritanceManager(_libraryElement);
- _resolver = new ResolverVisitor.con2(
- _libraryElement,
- _source,
- _typeProvider,
- inheritanceManager,
- _errorListener);
- _topNameScope = _resolver.pushNameScope();
- // add Scope variables - no type, no location, just to avoid warnings
- {
- DartType type = _typeProvider.dynamicType;
- _topNameScope.define(_createLocalVariableWithName(type, "\$id"));
- _topNameScope.define(_createLocalVariableWithName(type, "\$parent"));
- _topNameScope.define(_createLocalVariableWithName(type, "\$root"));
- }
- }
-
- /**
- * Declares the given [LocalVariableElementImpl] in the [topNameScope].
- */
- void _defineTopVariable(LocalVariableElementImpl variable) {
- _recordDefinedVariable(variable);
- _topNameScope.define(variable);
- _recordTypeLibraryInjected(variable);
- }
-
- /**
- * Defines variable for the given [AngularElement] with type of the enclosing
- * [ClassElement].
- */
- void _defineTopVariable_forClassElement(AngularElement element) {
- ClassElement classElement = element.enclosingElement as ClassElement;
- InterfaceType type = classElement.type;
- LocalVariableElementImpl variable =
- _createLocalVariableWithName(type, element.name);
- _defineTopVariable(variable);
- variable.toolkitObjects = <AngularElement>[element];
- }
-
- /**
- * Defines variable for the given [AngularScopePropertyElement].
- */
- void
- _defineTopVariable_forScopeProperty(AngularScopePropertyElement element) {
- DartType type = element.type;
- LocalVariableElementImpl variable =
- _createLocalVariableWithName(type, element.name);
- _defineTopVariable(variable);
- variable.toolkitObjects = <AngularElement>[element];
- }
-
- /**
- * Declares the given [LocalVariableElementImpl] in the current [nameScope].
- */
- void _defineVariable(LocalVariableElementImpl variable) {
- _recordDefinedVariable(variable);
- _nameScope.define(variable);
- _recordTypeLibraryInjected(variable);
- }
-
-// /**
-// * @return the [AngularElement] with the given name, maybe `null`.
-// */
-// AngularElement _findAngularElement(String name) {
-// for (AngularElement element in _angularElements) {
-// if (name == element.name) {
-// return element;
-// }
-// }
-// return null;
-// }
-
- /**
- * Parses given [String] as an [AngularExpression] at the given offset.
- */
- AngularExpression _parseAngularExpression(String contents, int startIndex,
- int endIndex, int offset) {
- Token token = _scanDart(contents, startIndex, endIndex, offset);
- return _parseAngularExpressionInToken(token);
- }
-
- AngularExpression _parseAngularExpressionInToken(Token token) {
- List<Token> tokens = _splitAtBar(token);
- Expression mainExpression = _parseDartExpressionInToken(tokens[0]);
- // parse formatters
- List<AngularFormatterNode> formatters = <AngularFormatterNode>[];
- for (int i = 1; i < tokens.length; i++) {
- Token formatterToken = tokens[i];
- Token barToken = formatterToken;
- formatterToken = formatterToken.next;
- // parse name
- Expression nameExpression = _parseDartExpressionInToken(formatterToken);
- if (nameExpression is! SimpleIdentifier) {
- _reportErrorForNode(AngularCode.INVALID_FORMATTER_NAME, nameExpression);
- continue;
- }
- SimpleIdentifier name = nameExpression as SimpleIdentifier;
- formatterToken = name.endToken.next;
- // parse arguments
- List<AngularFormatterArgument> arguments = <AngularFormatterArgument>[];
- while (formatterToken.type != TokenType.EOF) {
- // skip ":"
- Token colonToken = formatterToken;
- if (colonToken.type == TokenType.COLON) {
- formatterToken = formatterToken.next;
- } else {
- _reportErrorForToken(AngularCode.MISSING_FORMATTER_COLON, colonToken);
- break;
- }
- // parse argument
- Expression argument = _parseDartExpressionInToken(formatterToken);
- arguments.add(new AngularFormatterArgument(colonToken, argument));
- // next token
- formatterToken = argument.endToken.next;
- }
- formatters.add(new AngularFormatterNode(barToken, name, arguments));
- }
- // done
- return new AngularExpression(mainExpression, formatters);
- }
-
-// /**
-// * Parses given [String] as an [Expression] at the given offset.
-// */
-// Expression _parseDartExpression(String contents, int startIndex, int endIndex,
-// int offset) {
-// Token token = _scanDart(contents, startIndex, endIndex, offset);
-// return _parseDartExpressionInToken(token);
-// }
-
- Expression _parseDartExpressionInToken(Token token) {
- Parser parser = new Parser(_source, _errorListener);
- return parser.parseExpression(token);
- }
-
- /**
- * Parse the value of the given token for embedded expressions, and add any embedded expressions
- * that are found to the given list of expressions.
- *
- * @param expressions the list to which embedded expressions are to be added
- * @param token the token whose value is to be parsed
- */
- void
- _parseEmbeddedExpressions(List<AngularMoustacheXmlExpression> expressions,
- ht.Token token) {
- // prepare Token information
- String lexeme = token.lexeme;
- int offset = token.offset;
- // find expressions between {{ and }}
- int startIndex = StringUtilities.indexOf2(
- lexeme,
- 0,
- AngularMoustacheXmlExpression.OPENING_DELIMITER_CHAR,
- AngularMoustacheXmlExpression.OPENING_DELIMITER_CHAR);
- while (startIndex >= 0) {
- int endIndex = StringUtilities.indexOf2(
- lexeme,
- startIndex + AngularMoustacheXmlExpression.OPENING_DELIMITER_LENGTH,
- AngularMoustacheXmlExpression.CLOSING_DELIMITER_CHAR,
- AngularMoustacheXmlExpression.CLOSING_DELIMITER_CHAR);
- if (endIndex < 0) {
- // TODO(brianwilkerson) Should we report this error or will it be
- // reported by something else?
- return;
- } else if (startIndex +
- AngularMoustacheXmlExpression.OPENING_DELIMITER_LENGTH <
- endIndex) {
- startIndex += AngularMoustacheXmlExpression.OPENING_DELIMITER_LENGTH;
- AngularExpression expression =
- _parseAngularExpression(lexeme, startIndex, endIndex, offset);
- expressions.add(
- new AngularMoustacheXmlExpression(startIndex, endIndex, expression));
- }
- startIndex = StringUtilities.indexOf2(
- lexeme,
- endIndex + AngularMoustacheXmlExpression.CLOSING_DELIMITER_LENGTH,
- AngularMoustacheXmlExpression.OPENING_DELIMITER_CHAR,
- AngularMoustacheXmlExpression.OPENING_DELIMITER_CHAR);
- }
- }
-
- void _parseEmbeddedExpressionsInAttribute(ht.XmlAttributeNode node) {
- List<AngularMoustacheXmlExpression> expressions =
- <AngularMoustacheXmlExpression>[
- ];
- _parseEmbeddedExpressions(expressions, node.valueToken);
- if (!expressions.isEmpty) {
- node.expressions = expressions;
- }
- }
-
- void _parseEmbeddedExpressionsInTag(ht.XmlTagNode node) {
- List<AngularMoustacheXmlExpression> expressions =
- <AngularMoustacheXmlExpression>[
- ];
- ht.Token token = node.attributeEnd;
- ht.Token endToken = node.endToken;
- bool inChild = false;
- while (!identical(token, endToken)) {
- for (ht.XmlTagNode child in node.tagNodes) {
- if (identical(token, child.beginToken)) {
- inChild = true;
- break;
- }
- if (identical(token, child.endToken)) {
- inChild = false;
- break;
- }
- }
- if (!inChild && token.type == ht.TokenType.TEXT) {
- _parseEmbeddedExpressions(expressions, token);
- }
- token = token.next;
- }
- node.expressions = expressions;
- }
-
- void _popNameScope() {
- _nameScope = _resolver.popNameScope();
- }
-
- void _pushNameScope() {
- _nameScope = _resolver.pushNameScope();
- }
-
- void _recordDefinedVariable(LocalVariableElementImpl variable) {
- _definedVariables.add(variable);
- _functionElement.localVariables = new List.from(_definedVariables);
- }
-
- /**
- * When we inject variable, we give access to the library of its type.
- */
- void _recordTypeLibraryInjected(LocalVariableElementImpl variable) {
- LibraryElement typeLibrary = variable.type.element.library;
- _injectedLibraries.add(typeLibrary);
- }
-
- /**
- * Reports given [ErrorCode] at the given [AstNode].
- */
- void _reportErrorForNode(ErrorCode errorCode, AstNode node,
- [List<Object> arguments]) {
- _reportErrorForOffset(errorCode, node.offset, node.length, arguments);
- }
-
- /**
- * Reports given [ErrorCode] at the given position.
- */
- void _reportErrorForOffset(ErrorCode errorCode, int offset, int length,
- [List<Object> arguments]) {
- _errorListener.onError(
- new AnalysisError.con2(_source, offset, length, errorCode, arguments));
- }
-
- /**
- * Reports given [ErrorCode] at the given [Token].
- */
- void _reportErrorForToken(ErrorCode errorCode, Token token,
- [List<Object> arguments]) {
- _reportErrorForOffset(errorCode, token.offset, token.length, arguments);
- }
-
- void _resolveExpression(AngularExpression angularExpression) {
- List<Expression> dartExpressions = angularExpression.expressions;
- for (Expression dartExpression in dartExpressions) {
- _resolveNode(dartExpression);
- }
- }
-
- void _resolveExpressions(List<ht.XmlExpression> expressions) {
- for (ht.XmlExpression xmlExpression in expressions) {
- if (xmlExpression is AngularXmlExpression) {
- AngularXmlExpression angularXmlExpression = xmlExpression;
- _resolveXmlExpression(angularXmlExpression);
- }
- }
- }
-
- /**
- * Resolves Angular specific expressions and elements in the [source].
- *
- * @param angularElements the [AngularElement]s accessible in the component's library, not
- * `null`
- * @param component the [AngularComponentElement] to resolve template for, maybe
- * `null` if not a component template
- */
- void _resolveInternal(List<AngularElement> angularElements,
- AngularComponentElement component) {
-// this._angularElements = angularElements;
- // add built-in processors
- _processors.add(NgModelProcessor.INSTANCE);
- // _processors.add(NgRepeatProcessor.INSTANCE);
- // add element's libraries
- for (AngularElement angularElement in angularElements) {
- _injectedLibraries.add(angularElement.library);
- }
- // prepare Dart library
- _createLibraryElement();
- (_unit.element as HtmlElementImpl).angularCompilationUnit = _unitElement;
- // prepare Dart resolver
- _createResolver();
- // maybe resolving component template
- if (component != null) {
- _defineTopVariable_forClassElement(component);
- for (AngularScopePropertyElement scopeProperty in
- component.scopeProperties) {
- _defineTopVariable_forScopeProperty(scopeProperty);
- }
- }
- // add processors
- for (AngularElement angularElement in angularElements) {
- NgProcessor processor = _createProcessor(angularElement);
- if (processor != null) {
- _processors.add(processor);
- }
- }
- // define formatters
- for (AngularElement angularElement in angularElements) {
- if (angularElement is AngularFormatterElement) {
- _defineTopVariable_forClassElement(angularElement);
- }
- }
- // run this HTML visitor
- _unit.accept(this);
- // simulate imports for injects
- {
- List<ImportElement> imports = <ImportElement>[];
- for (LibraryElement injectedLibrary in _injectedLibraries) {
- ImportElementImpl importElement = new ImportElementImpl(-1);
- importElement.importedLibrary = injectedLibrary;
- imports.add(importElement);
- }
- _libraryElement.imports = imports;
- }
- }
-
- /**
- * Resolves given [AstNode] using [resolver].
- */
- void _resolveNode(AstNode node) {
- node.accept(_resolver);
- }
-
- void _resolveXmlExpression(AngularXmlExpression angularXmlExpression) {
- AngularExpression angularExpression = angularXmlExpression.expression;
- _resolveExpression(angularExpression);
- }
-
- Token _scanDart(String contents, int startIndex, int endIndex, int offset) =>
- ht.HtmlParser.scanDartSource(
- _source,
- _lineInfo,
- contents.substring(startIndex, endIndex),
- offset + startIndex,
- _errorListener);
-
- List<Token> _splitAtBar(Token token) {
- List<Token> tokens = <Token>[];
- tokens.add(token);
- while (token.type != TokenType.EOF) {
- if (token.type == TokenType.BAR) {
- tokens.add(token);
- Token eofToken = new Token(TokenType.EOF, 0);
- token.previous.setNext(eofToken);
- }
- token = token.next;
- }
- return tokens;
- }
-
- /**
- * The "ng-model" directive is special, it contributes to the top-level name scope. These models
- * can be used before actual "ng-model" attribute in HTML. So, we need to define them once we
- * found [NG_APP] context.
- */
- void _visitModelDirectives(ht.XmlTagNode appNode) {
- appNode.accept(new _AngularHtmlUnitResolver_visitModelDirectives(this));
- }
-
- /**
- * Checks if given [Element] is an artificial local variable and returns corresponding
- * [AngularElement], or `null` otherwise.
- */
- static AngularElement getAngularElement(Element element) {
- // may be artificial local variable, replace with AngularElement
- if (element is LocalVariableElement) {
- LocalVariableElement local = element;
- List<ToolkitObjectElement> toolkitObjects = local.toolkitObjects;
- if (toolkitObjects.length == 1 && toolkitObjects[0] is AngularElement) {
- return toolkitObjects[0] as AngularElement;
- }
- }
- // not a special Element
- return null;
- }
-
- /**
- * @return `true` if the given [HtmlUnit] has <code>ng-app</code> annotation.
- */
- static bool hasAngularAnnotation(ht.HtmlUnit htmlUnit) {
- try {
- htmlUnit.accept(
- new RecursiveXmlVisitor_AngularHtmlUnitResolver_hasAngularAnnotation());
- } on AngularHtmlUnitResolver_FoundAppError catch (e) {
- return true;
- }
- return false;
- }
-
- /**
- * Adds [AngularElement] declared by the given top-level [Element].
- *
- * @param angularElements the list to fill with top-level [AngularElement]s
- * @param classElement the [ClassElement] to get [AngularElement]s from
- */
- static void _addAngularElementsFromClass(Set<AngularElement> angularElements,
- ClassElement classElement) {
- for (ToolkitObjectElement toolkitObject in classElement.toolkitObjects) {
- if (toolkitObject is AngularElement) {
- angularElements.add(toolkitObject);
- }
- }
- }
-
- /**
- * Returns the array of all top-level Angular elements that could be used in this library.
- *
- * @param libraryElement the [LibraryElement] to analyze
- * @return the array of all top-level Angular elements that could be used in this library
- */
- static void
- _addAngularElementsFromLibrary(Set<AngularElement> angularElements,
- LibraryElement library, Set<LibraryElement> visited) {
- if (library == null) {
- return;
- }
- if (!visited.add(library)) {
- return;
- }
- // add Angular elements from current library
- for (CompilationUnitElement unit in library.units) {
- angularElements.addAll(unit.angularViews);
- for (ClassElement type in unit.types) {
- _addAngularElementsFromClass(angularElements, type);
- }
- }
- // handle imports
- for (ImportElement importElement in library.imports) {
- LibraryElement importedLibrary = importElement.importedLibrary;
- _addAngularElementsFromLibrary(angularElements, importedLibrary, visited);
- }
- }
-
- static SimpleIdentifier _createIdentifier(String name, int offset) {
- StringToken token = _createStringToken(name, offset);
- return new SimpleIdentifier(token);
- }
-
- static StringToken _createStringToken(String name, int offset) =>
- new StringToken(TokenType.IDENTIFIER, name, offset);
-
- /**
- * Returns the array of all top-level Angular elements that could be used in this library.
- *
- * @param libraryElement the [LibraryElement] to analyze
- * @return the array of all top-level Angular elements that could be used in this library
- */
- static List<AngularElement> _getAngularElements(Set<LibraryElement> libraries,
- LibraryElement libraryElement) {
- Set<AngularElement> angularElements = new Set();
- _addAngularElementsFromLibrary(angularElements, libraryElement, libraries);
- return new List.from(angularElements);
- }
-
- /**
- * Returns the external Dart [CompilationUnit] referenced by the given [HtmlUnit].
- */
- static CompilationUnit _getDartUnit(AnalysisContext context,
- ht.HtmlUnit unit) {
- for (HtmlScriptElement script in unit.element.scripts) {
- if (script is ExternalHtmlScriptElement) {
- Source scriptSource = script.scriptSource;
- if (scriptSource != null) {
- return context.resolveCompilationUnit2(scriptSource, scriptSource);
- }
- }
- }
- return null;
- }
-
- static Set<Source> _getLibrarySources(Set<LibraryElement> libraries) {
- Set<Source> sources = new Set();
- for (LibraryElement library in libraries) {
- sources.add(library.source);
- }
- return sources;
- }
-}
-
-class AngularHtmlUnitResolver_FilteringAnalysisErrorListener implements
- AnalysisErrorListener {
- final AnalysisErrorListener _listener;
-
- AngularHtmlUnitResolver_FilteringAnalysisErrorListener(this._listener);
-
- @override
- void onError(AnalysisError error) {
- ErrorCode errorCode = error.errorCode;
- if (identical(errorCode, StaticWarningCode.UNDEFINED_GETTER) ||
- identical(errorCode, StaticWarningCode.UNDEFINED_IDENTIFIER) ||
- identical(errorCode, StaticTypeWarningCode.UNDEFINED_GETTER)) {
- return;
- }
- _listener.onError(error);
- }
-}
-
-class AngularHtmlUnitResolver_FoundAppError extends Error {
-}
-
-/**
- * Implementation of [AngularXmlExpression] for an [AngularExpression] enclosed between
- * <code>{{</code> and <code>}}</code>.
- */
-class AngularMoustacheXmlExpression extends AngularXmlExpression {
- static int OPENING_DELIMITER_CHAR = 0x7B;
-
- static int CLOSING_DELIMITER_CHAR = 0x7D;
-
- static String OPENING_DELIMITER = "{{";
-
- static String CLOSING_DELIMITER = "}}";
-
- static int OPENING_DELIMITER_LENGTH = OPENING_DELIMITER.length;
-
- static int CLOSING_DELIMITER_LENGTH = CLOSING_DELIMITER.length;
-
- /**
- * The offset of the first character of the opening delimiter.
- */
- final int _openingOffset;
-
- /**
- * The offset of the first character of the closing delimiter.
- */
- final int _closingOffset;
-
- AngularMoustacheXmlExpression(this._openingOffset, this._closingOffset,
- AngularExpression expression)
- : super(expression);
-
- @override
- int get end => _closingOffset + CLOSING_DELIMITER_LENGTH;
-
- @override
- int get length => _closingOffset + CLOSING_DELIMITER_LENGTH - _openingOffset;
-
- @override
- int get offset => _openingOffset;
-}
-
-/**
- * Implementation of [AngularXmlExpression] for an [AngularExpression] embedded without
- * any wrapping characters.
- */
-class AngularRawXmlExpression extends AngularXmlExpression {
- AngularRawXmlExpression(AngularExpression expression) : super(expression);
-
- @override
- int get end => expression.end;
-
- @override
- int get length => expression.length;
-
- @override
- int get offset => expression.offset;
-}
-
-/**
- * Abstract Angular specific [XmlExpression].
- */
-abstract class AngularXmlExpression extends ht.XmlExpression {
- /**
- * The expression that is enclosed between the delimiters.
- */
- final AngularExpression expression;
-
- AngularXmlExpression(this.expression);
-
- @override
- ht.XmlExpression_Reference getReference(int offset) {
- // main expression
- ht.XmlExpression_Reference reference =
- _getReferenceAtNode(expression.expression, offset);
- if (reference != null) {
- return reference;
- }
- // formatters
- for (AngularFormatterNode formatter in expression.formatters) {
- // formatter name
- reference = _getReferenceAtNode(formatter.name, offset);
- if (reference != null) {
- return reference;
- }
- // formatter arguments
- for (AngularFormatterArgument formatterArgument in formatter.arguments) {
- reference = _getReferenceAtNode(formatterArgument.expression, offset);
- if (reference != null) {
- return reference;
- }
- }
- }
- return null;
- }
-
- /**
- * If the given [AstNode] has an [Element] at the given offset, then returns
- * [Reference] with this [Element].
- */
- ht.XmlExpression_Reference _getReferenceAtNode(AstNode root, int offset) {
- AstNode node = new NodeLocator.con1(offset).searchWithin(root);
- if (node != null) {
- Element element = ElementLocator.locate(node);
- return new ht.XmlExpression_Reference(element, node.offset, node.length);
- }
- return null;
- }
-}
-
-/**
- * A `CachedResult` is a single analysis result that is stored in a
- * [SourceEntry].
- */
-class CachedResult<E> {
- /**
- * The state of the cached value.
- */
- CacheState state;
-
- /**
- * The value being cached, or `null` if there is no value (for example, when
- * the [state] is [CacheState.INVALID].
- */
- E value;
-
- /**
- * Initialize a newly created result holder to represent the value of data
- * described by the given [descriptor].
- */
- CachedResult(DataDescriptor descriptor) {
- state = CacheState.INVALID;
- value = descriptor.defaultValue;
- }
-}
-
-/**
* Instances of the class `CachePartition` implement a single partition in an LRU cache of
* information related to analysis.
*/
@@ -8297,6 +7198,32 @@
}
/**
+ * A `CachedResult` is a single analysis result that is stored in a
+ * [SourceEntry].
+ */
+class CachedResult<E> {
+ /**
+ * The state of the cached value.
+ */
+ CacheState state;
+
+ /**
+ * The value being cached, or `null` if there is no value (for example, when
+ * the [state] is [CacheState.INVALID].
+ */
+ E value;
+
+ /**
+ * Initialize a newly created result holder to represent the value of data
+ * described by the given [descriptor].
+ */
+ CachedResult(DataDescriptor descriptor) {
+ state = CacheState.INVALID;
+ value = descriptor.defaultValue;
+ }
+}
+
+/**
* The interface `ChangeNotice` defines the behavior of objects that represent a change to the
* analysis results associated with a given source.
*/
@@ -8736,15 +7663,6 @@
*/
class DartEntry extends SourceEntry {
/**
- * The data descriptor representing the errors reported during Angular
- * resolution.
- */
- static final DataDescriptor<List<AnalysisError>> ANGULAR_ERRORS =
- new DataDescriptor<List<AnalysisError>>(
- "DartEntry.ANGULAR_ERRORS",
- AnalysisError.NO_ERRORS);
-
- /**
* The data descriptor representing the element model representing a single
* compilation unit. This model is incomplete and should not be used except as
* input to another task.
@@ -8833,6 +7751,15 @@
new DataDescriptor<bool>("DartEntry.IS_LAUNCHABLE", false);
/**
+ * The data descriptor representing lint warnings resulting from auditing the
+ * source.
+ */
+ static final DataDescriptor<List<AnalysisError>> LINTS =
+ new DataDescriptor<List<AnalysisError>>(
+ "DartEntry.LINTS",
+ AnalysisError.NO_ERRORS);
+
+ /**
* The data descriptor representing the errors resulting from parsing the
* source.
*/
@@ -8925,9 +7852,9 @@
errors.addAll(state.getValue(RESOLUTION_ERRORS));
errors.addAll(state.getValue(VERIFICATION_ERRORS));
errors.addAll(state.getValue(HINTS));
+ errors.addAll(state.getValue(LINTS));
state = state._nextState;
}
- errors.addAll(getValue(ANGULAR_ERRORS));
if (errors.length == 0) {
return AnalysisError.NO_ERRORS;
}
@@ -9074,13 +8001,13 @@
*/
List<DataDescriptor> get libraryDescriptors {
return <DataDescriptor>[
- DartEntry.ANGULAR_ERRORS,
DartEntry.BUILT_ELEMENT,
DartEntry.BUILT_UNIT,
DartEntry.RESOLUTION_ERRORS,
DartEntry.RESOLVED_UNIT,
DartEntry.VERIFICATION_ERRORS,
- DartEntry.HINTS];
+ DartEntry.HINTS,
+ DartEntry.LINTS];
}
/**
@@ -9255,6 +8182,21 @@
}
/**
+ * Record that an error occurred while attempting to generate lints for the
+ * source represented by this entry. This will set the state of all
+ * verification information as being in error.
+ *
+ * @param librarySource the source of the library in which lints were being generated
+ * @param exception the exception that shows where the error occurred
+ */
+ void recordLintErrorInLibrary(Source librarySource,
+ CaughtException exception) {
+ this.exception = exception;
+ ResolutionState state = _getOrCreateResolutionState(librarySource);
+ state.recordLintError();
+ }
+
+ /**
* Record that an [exception] occurred while attempting to scan or parse the
* entry represented by this entry. This will set the state of all information,
* including any resolution-based information, as being in error.
@@ -9452,8 +8394,7 @@
@override
bool _isValidDescriptor(DataDescriptor descriptor) {
- return descriptor == ANGULAR_ERRORS ||
- descriptor == CONTAINING_LIBRARIES ||
+ return descriptor == CONTAINING_LIBRARIES ||
descriptor == ELEMENT ||
descriptor == EXPORTED_LIBRARIES ||
descriptor == IMPORTED_LIBRARIES ||
@@ -9474,10 +8415,10 @@
* relative to a library.
*/
bool _isValidLibraryDescriptor(DataDescriptor descriptor) {
- return descriptor == ANGULAR_ERRORS ||
- descriptor == BUILT_ELEMENT ||
+ return descriptor == BUILT_ELEMENT ||
descriptor == BUILT_UNIT ||
descriptor == HINTS ||
+ descriptor == LINTS ||
descriptor == RESOLUTION_ERRORS ||
descriptor == RESOLVED_UNIT ||
descriptor == VERIFICATION_ERRORS;
@@ -9639,7 +8580,6 @@
_writeStateOn(buffer, "publicNamespace", PUBLIC_NAMESPACE);
_writeStateOn(buffer, "clientServer", IS_CLIENT);
_writeStateOn(buffer, "launchable", IS_LAUNCHABLE);
- _writeStateOn(buffer, "angularErrors", ANGULAR_ERRORS);
_resolutionState._writeOn(buffer);
}
}
@@ -9689,6 +8629,7 @@
*/
bool astIsNeeded(DartEntry dartEntry) =>
dartEntry.hasInvalidData(DartEntry.HINTS) ||
+ dartEntry.hasInvalidData(DartEntry.LINTS) ||
dartEntry.hasInvalidData(DartEntry.VERIFICATION_ERRORS) ||
dartEntry.hasInvalidData(DartEntry.RESOLUTION_ERRORS);
@@ -9704,51 +8645,6 @@
}
}
-
-/**
- * Recursively visits [HtmlUnit] and every embedded [Expression].
- */
-abstract class ExpressionVisitor extends ht.RecursiveXmlVisitor<Object> {
- /**
- * Visits the given [Expression]s embedded into tag or attribute.
- *
- * @param expression the [Expression] to visit, not `null`
- */
- void visitExpression(Expression expression);
-
- @override
- Object visitXmlAttributeNode(ht.XmlAttributeNode node) {
- _visitExpressions(node.expressions);
- return super.visitXmlAttributeNode(node);
- }
-
- @override
- Object visitXmlTagNode(ht.XmlTagNode node) {
- _visitExpressions(node.expressions);
- return super.visitXmlTagNode(node);
- }
-
- /**
- * Visits [Expression]s of the given [XmlExpression]s.
- */
- void _visitExpressions(List<ht.XmlExpression> expressions) {
- for (ht.XmlExpression xmlExpression in expressions) {
- if (xmlExpression is AngularXmlExpression) {
- AngularXmlExpression angularXmlExpression = xmlExpression;
- List<Expression> dartExpressions =
- angularXmlExpression.expression.expressions;
- for (Expression dartExpression in dartExpressions) {
- visitExpression(dartExpression);
- }
- }
- if (xmlExpression is ht.RawXmlExpression) {
- ht.RawXmlExpression rawXmlExpression = xmlExpression;
- visitExpression(rawXmlExpression.expression);
- }
- }
- }
-}
-
/**
* Instances of the class `GenerateDartErrorsTask` generate errors and warnings for a single
* Dart source.
@@ -9980,6 +8876,57 @@
}
}
+/// Generates lint feedback for a single Dart library.
+class GenerateDartLintsTask extends AnalysisTask {
+
+ ///The compilation units that comprise the library, with the defining
+ ///compilation unit appearing first in the array.
+ final List<TimestampedData<CompilationUnit>> _units;
+
+ /// The element model for the library being analyzed.
+ final LibraryElement libraryElement;
+
+ /// Initialize a newly created task to perform lint checking over these
+ /// [_units] belonging to this [libraryElement] within the given [context].
+ GenerateDartLintsTask(context, this._units, this.libraryElement)
+ : super(context);
+
+ /// A mapping of analyzed sources to their associated lint warnings.
+ /// May be [null] if the task has not been performed or if analysis did not
+ /// complete normally.
+ HashMap<Source, List<AnalysisError>> lintMap;
+
+ @override
+ String get taskDescription {
+ Source librarySource = libraryElement.source;
+ return (librarySource == null) ?
+ "generate Dart lints for library without source" :
+ "generate Dart lints for ${librarySource.fullName}";
+ }
+
+ @override
+ accept(AnalysisTaskVisitor visitor) =>
+ visitor.visitGenerateDartLintsTask(this);
+
+ @override
+ void internalPerform() {
+
+ Iterable<CompilationUnit> compilationUnits =
+ _units.map((TimestampedData<CompilationUnit> unit) => unit.data);
+ RecordingErrorListener errorListener = new RecordingErrorListener();
+ LintGenerator lintGenerator =
+ new LintGenerator(compilationUnits, errorListener);
+ lintGenerator.generate();
+
+ lintMap = new HashMap<Source, List<AnalysisError>>();
+ compilationUnits.forEach((CompilationUnit unit) {
+ Source source = unit.element.source;
+ lintMap[source] = errorListener.getErrorsForSource(source);
+ });
+ }
+}
+
+
/**
* Instances of the class `GetContentTask` get the contents of a source.
*/
@@ -10058,6 +9005,7 @@
TimestampedData<String> data = context.getContents(source);
_content = data.data;
_modificationTime = data.modificationTime;
+ AnalysisEngine.instance.instrumentationService.logFileRead(source.fullName, _modificationTime, _content);
} catch (exception, stackTrace) {
throw new AnalysisException(
"Could not get contents of $source",
@@ -10072,36 +9020,6 @@
*/
class HtmlEntry extends SourceEntry {
/**
- * The data descriptor representing the information about an Angular
- * application this source is used in.
- */
- static final DataDescriptor<AngularApplication> ANGULAR_APPLICATION =
- new DataDescriptor<AngularApplication>("HtmlEntry.ANGULAR_APPLICATION");
-
- /**
- * The data descriptor representing the information about an Angular component
- * this source is used as template for.
- */
- static final DataDescriptor<AngularComponentElement> ANGULAR_COMPONENT =
- new DataDescriptor<AngularComponentElement>("HtmlEntry.ANGULAR_COMPONENT");
-
- /**
- * The data descriptor representing the information about an Angular
- * application for which this source is an entry point.
- */
- static final DataDescriptor<AngularApplication> ANGULAR_ENTRY =
- new DataDescriptor<AngularApplication>("HtmlEntry.ANGULAR_ENTRY");
-
- /**
- * The data descriptor representing the errors reported during Angular
- * resolution.
- */
- static final DataDescriptor<List<AnalysisError>> ANGULAR_ERRORS =
- new DataDescriptor<List<AnalysisError>>(
- "HtmlEntry.ANGULAR_ERRORS",
- AnalysisError.NO_ERRORS);
-
- /**
* The data descriptor representing the HTML element.
*/
static final DataDescriptor<HtmlElement> ELEMENT =
@@ -10155,24 +9073,6 @@
AnalysisError.NO_ERRORS);
/**
- * The data descriptor representing the status of Polymer elements in the
- * source.
- */
- static final DataDescriptor<List<AnalysisError>> POLYMER_BUILD_ERRORS =
- new DataDescriptor<List<AnalysisError>>(
- "HtmlEntry.POLYMER_BUILD_ERRORS",
- AnalysisError.NO_ERRORS);
-
- /**
- * The data descriptor representing the errors reported during Polymer
- * resolution.
- */
- static final DataDescriptor<List<AnalysisError>> POLYMER_RESOLUTION_ERRORS =
- new DataDescriptor<List<AnalysisError>>(
- "HtmlEntry.POLYMER_RESOLUTION_ERRORS",
- AnalysisError.NO_ERRORS);
-
- /**
* Return all of the errors associated with the HTML file that are currently
* cached.
*/
@@ -10180,10 +9080,7 @@
List<AnalysisError> errors = new List<AnalysisError>();
errors.addAll(getValue(PARSE_ERRORS));
errors.addAll(getValue(RESOLUTION_ERRORS));
- errors.addAll(getValue(ANGULAR_ERRORS));
errors.addAll(getValue(HINTS));
- errors.addAll(getValue(POLYMER_BUILD_ERRORS));
- errors.addAll(getValue(POLYMER_RESOLUTION_ERRORS));
if (errors.length == 0) {
return AnalysisError.NO_ERRORS;
}
@@ -10210,15 +9107,9 @@
List<DataDescriptor> result = super.descriptors;
result.addAll(
[
- HtmlEntry.ANGULAR_APPLICATION,
- HtmlEntry.ANGULAR_COMPONENT,
- HtmlEntry.ANGULAR_ENTRY,
- HtmlEntry.ANGULAR_ERRORS,
HtmlEntry.ELEMENT,
HtmlEntry.PARSE_ERRORS,
HtmlEntry.PARSED_UNIT,
- HtmlEntry.POLYMER_BUILD_ERRORS,
- HtmlEntry.POLYMER_RESOLUTION_ERRORS,
HtmlEntry.RESOLUTION_ERRORS,
HtmlEntry.RESOLVED_UNIT,
HtmlEntry.HINTS]);
@@ -10234,8 +9125,6 @@
void flushAstStructures() {
_flush(PARSED_UNIT);
_flush(RESOLVED_UNIT);
- _flush(ANGULAR_ENTRY);
- _flush(ANGULAR_ERRORS);
}
@override
@@ -10253,10 +9142,6 @@
* source files should also be invalidated.
*/
void invalidateAllResolutionInformation(bool invalidateUris) {
- setState(ANGULAR_ENTRY, CacheState.INVALID);
- setState(ANGULAR_ERRORS, CacheState.INVALID);
- setState(POLYMER_BUILD_ERRORS, CacheState.INVALID);
- setState(POLYMER_RESOLUTION_ERRORS, CacheState.INVALID);
setState(ELEMENT, CacheState.INVALID);
setState(RESOLUTION_ERRORS, CacheState.INVALID);
setState(HINTS, CacheState.INVALID);
@@ -10291,27 +9176,18 @@
*/
void recordResolutionError(CaughtException exception) {
this.exception = exception;
- setState(ANGULAR_ERRORS, CacheState.ERROR);
setState(RESOLVED_UNIT, CacheState.ERROR);
setState(ELEMENT, CacheState.ERROR);
setState(RESOLUTION_ERRORS, CacheState.ERROR);
setState(HINTS, CacheState.ERROR);
- setState(POLYMER_BUILD_ERRORS, CacheState.ERROR);
- setState(POLYMER_RESOLUTION_ERRORS, CacheState.ERROR);
}
@override
bool _isValidDescriptor(DataDescriptor descriptor) {
- return descriptor == ANGULAR_APPLICATION ||
- descriptor == ANGULAR_COMPONENT ||
- descriptor == ANGULAR_ENTRY ||
- descriptor == ANGULAR_ERRORS ||
- descriptor == ELEMENT ||
+ return descriptor == ELEMENT ||
descriptor == HINTS ||
descriptor == PARSED_UNIT ||
descriptor == PARSE_ERRORS ||
- descriptor == POLYMER_BUILD_ERRORS ||
- descriptor == POLYMER_RESOLUTION_ERRORS ||
descriptor == REFERENCED_LIBRARIES ||
descriptor == RESOLUTION_ERRORS ||
descriptor == RESOLVED_UNIT ||
@@ -10365,42 +9241,6 @@
"element",
HtmlEntry.ELEMENT,
oldEntry);
- needsSeparator = _writeStateDiffOn(
- buffer,
- needsSeparator,
- "angularApplicationState",
- HtmlEntry.ANGULAR_APPLICATION,
- oldEntry);
- needsSeparator = _writeStateDiffOn(
- buffer,
- needsSeparator,
- "angularComponent",
- HtmlEntry.ANGULAR_COMPONENT,
- oldEntry);
- needsSeparator = _writeStateDiffOn(
- buffer,
- needsSeparator,
- "angularEntry",
- HtmlEntry.ANGULAR_ENTRY,
- oldEntry);
- needsSeparator = _writeStateDiffOn(
- buffer,
- needsSeparator,
- "angularErrors",
- HtmlEntry.ANGULAR_ERRORS,
- oldEntry);
- needsSeparator = _writeStateDiffOn(
- buffer,
- needsSeparator,
- "polymerBuildErrors",
- HtmlEntry.POLYMER_BUILD_ERRORS,
- oldEntry);
- needsSeparator = _writeStateDiffOn(
- buffer,
- needsSeparator,
- "polymerResolutionErrors",
- HtmlEntry.POLYMER_RESOLUTION_ERRORS,
- oldEntry);
return needsSeparator;
}
@@ -10414,12 +9254,6 @@
_writeStateOn(buffer, "resolutionErrors", RESOLUTION_ERRORS);
_writeStateOn(buffer, "referencedLibraries", REFERENCED_LIBRARIES);
_writeStateOn(buffer, "element", ELEMENT);
- _writeStateOn(buffer, "angularApplication", ANGULAR_APPLICATION);
- _writeStateOn(buffer, "angularComponent", ANGULAR_COMPONENT);
- _writeStateOn(buffer, "angularEntry", ANGULAR_ENTRY);
- _writeStateOn(buffer, "angularErrors", ANGULAR_ERRORS);
- _writeStateOn(buffer, "polymerBuildErrors", POLYMER_BUILD_ERRORS);
- _writeStateOn(buffer, "polymerResolutionErrors", POLYMER_RESOLUTION_ERRORS);
}
}
@@ -10722,6 +9556,7 @@
LibraryElement library = element.library;
if (library != null) {
IncrementalResolver resolver = new IncrementalResolver(
+ <Source, CompilationUnit>{},
element,
cache.offset,
cache.oldLength,
@@ -10883,267 +9718,6 @@
}
/**
- * [NgComponentElementProcessor] applies [AngularComponentElement] by parsing mapped
- * attributes as expressions.
- */
-class NgComponentElementProcessor extends NgDirectiveProcessor {
- final AngularComponentElement _element;
-
- NgComponentElementProcessor(this._element);
-
- @override
- void apply(AngularHtmlUnitResolver resolver, ht.XmlTagNode node) {
- node.element = _element.selector;
- for (AngularPropertyElement property in _element.properties) {
- String name = property.name;
- ht.XmlAttributeNode attribute = node.getAttribute(name);
- if (attribute != null) {
- attribute.element = property;
- // resolve if binding
- if (property.propertyKind != AngularPropertyKind.ATTR) {
- AngularExpression expression =
- parseAngularExpression(resolver, attribute);
- resolver._resolveExpression(expression);
- setAngularExpression(attribute, expression);
- }
- }
- }
- }
-
- @override
- bool canApply(ht.XmlTagNode node) => _element.selector.apply(node);
-}
-
-/**
- * [NgControllerElementProcessor] applies [AngularControllerElement].
- */
-class NgControllerElementProcessor extends NgProcessor {
- final AngularControllerElement _element;
-
- NgControllerElementProcessor(this._element);
-
- @override
- void apply(AngularHtmlUnitResolver resolver, ht.XmlTagNode node) {
- InterfaceType type = (_element.enclosingElement as ClassElement).type;
- String name = _element.name;
- LocalVariableElementImpl variable =
- resolver._createLocalVariableWithName(type, name);
- resolver._defineVariable(variable);
- variable.toolkitObjects = <AngularElement>[_element];
- }
-
- @override
- bool canApply(ht.XmlTagNode node) => _element.selector.apply(node);
-}
-
-/**
- * [NgDecoratorElementProcessor] applies [AngularDecoratorElement] by parsing mapped
- * attributes as expressions.
- */
-class NgDecoratorElementProcessor extends NgDirectiveProcessor {
- final AngularDecoratorElement _element;
-
- NgDecoratorElementProcessor(this._element);
-
- @override
- void apply(AngularHtmlUnitResolver resolver, ht.XmlTagNode node) {
- String selectorAttributeName = null;
- {
- AngularSelectorElement selector = _element.selector;
- if (selector is HasAttributeSelectorElementImpl) {
- selectorAttributeName = selector.name;
- // resolve attribute expression
- ht.XmlAttributeNode attribute =
- node.getAttribute(selectorAttributeName);
- if (attribute != null) {
- attribute.element = selector;
- }
- }
- }
- //
- for (AngularPropertyElement property in _element.properties) {
- // prepare attribute name
- String name = property.name;
- if (name == ".") {
- name = selectorAttributeName;
- }
- // prepare attribute
- ht.XmlAttributeNode attribute = node.getAttribute(name);
- if (attribute == null) {
- continue;
- }
- // if not resolved as the selector, resolve as a property
- if (name != selectorAttributeName) {
- attribute.element = property;
- }
- // skip if attribute has no value
- if (!NgDirectiveProcessor.hasValue(attribute)) {
- continue;
- }
- // resolve if binding
- if (property.propertyKind != AngularPropertyKind.ATTR) {
- resolver._pushNameScope();
- try {
- _onNgEventDirective(resolver);
- AngularExpression expression =
- parseAngularExpression(resolver, attribute);
- resolver._resolveExpression(expression);
- setAngularExpression(attribute, expression);
- } finally {
- resolver._popNameScope();
- }
- }
- }
- }
-
- @override
- bool canApply(ht.XmlTagNode node) => _element.selector.apply(node);
-
- /**
- * Support for <code>$event</code> variable in <code>NgEventDirective</code>.
- */
- void _onNgEventDirective(AngularHtmlUnitResolver resolver) {
- if (_element.isClass("NgEventDirective")) {
- DartType dynamicType = resolver.typeProvider.dynamicType;
- resolver._defineVariable(
- resolver._createLocalVariableWithName(dynamicType, "\$event"));
- }
- }
-}
-
-/**
- * [NgDirectiveProcessor] describes any <code>Directive</code> annotation instance.
- */
-abstract class NgDirectiveProcessor extends NgProcessor {
- AngularExpression parseAngularExpression(AngularHtmlUnitResolver resolver,
- ht.XmlAttributeNode attribute) {
- Token token = _scanAttribute(resolver, attribute);
- return resolver._parseAngularExpressionInToken(token);
- }
-
- Expression parseDartExpression(AngularHtmlUnitResolver resolver,
- ht.XmlAttributeNode attribute) {
- Token token = _scanAttribute(resolver, attribute);
- return resolver._parseDartExpressionInToken(token);
- }
-
- /**
- * Sets single [AngularExpression] for [XmlAttributeNode].
- */
- void setAngularExpression(ht.XmlAttributeNode attribute,
- AngularExpression expression) {
- _setExpression(attribute, newAngularRawXmlExpression(expression));
- }
-
- /**
- * Sets single [Expression] for [XmlAttributeNode].
- */
- void setExpression(ht.XmlAttributeNode attribute, Expression expression) {
- _setExpression(attribute, newRawXmlExpression(expression));
- }
-
- void setExpressions(ht.XmlAttributeNode attribute,
- List<ht.XmlExpression> xmlExpressions) {
- attribute.expressions = new List.from(xmlExpressions);
- }
-
- Token _scanAttribute(AngularHtmlUnitResolver resolver,
- ht.XmlAttributeNode attribute) {
- int offset = attribute.valueToken.offset + 1;
- String value = attribute.text;
- return resolver._scanDart(value, 0, value.length, offset);
- }
-
- void _setExpression(ht.XmlAttributeNode attribute,
- ht.XmlExpression xmlExpression) {
- attribute.expressions = <ht.XmlExpression>[xmlExpression];
- }
-
- static bool hasValue(ht.XmlAttributeNode attribute) {
- ht.Token valueToken = attribute.valueToken;
- return valueToken != null && !valueToken.isSynthetic;
- }
-
- static AngularRawXmlExpression
- newAngularRawXmlExpression(AngularExpression e) =>
- new AngularRawXmlExpression(e);
-
- static ht.RawXmlExpression newRawXmlExpression(Expression e) =>
- new ht.RawXmlExpression(e);
-}
-
-/**
- * [NgModelProcessor] describes built-in <code>NgModel</code> directive.
- */
-class NgModelProcessor extends NgDirectiveProcessor {
- static String _NG_MODEL = "ng-model";
-
- static NgModelProcessor INSTANCE = new NgModelProcessor();
-
- @override
- void apply(AngularHtmlUnitResolver resolver, ht.XmlTagNode node) {
- ht.XmlAttributeNode attribute = node.getAttribute(_NG_MODEL);
- Expression expression = parseDartExpression(resolver, attribute);
- // identifiers have been already handled by "apply top"
- if (expression is SimpleIdentifier) {
- return;
- }
- // resolve
- resolver._resolveNode(expression);
- // remember expression
- setExpression(attribute, expression);
- }
-
- @override
- bool canApply(ht.XmlTagNode node) => node.getAttribute(_NG_MODEL) != null;
-
- /**
- * This method is used to define top-level [VariableElement]s for each "ng-model" with
- * simple identifier model.
- */
- void _applyTopDeclarations(AngularHtmlUnitResolver resolver,
- ht.XmlTagNode node) {
- ht.XmlAttributeNode attribute = node.getAttribute(_NG_MODEL);
- Expression expression = parseDartExpression(resolver, attribute);
- // if not identifier, then not a top-level model, delay until "apply"
- if (expression is! SimpleIdentifier) {
- return;
- }
- SimpleIdentifier identifier = expression as SimpleIdentifier;
- // define variable Element
- InterfaceType type = resolver.typeProvider.stringType;
- LocalVariableElementImpl element =
- resolver._createLocalVariableFromIdentifier(type, identifier);
- resolver._defineTopVariable(element);
- // remember expression
- identifier.staticElement = element;
- identifier.staticType = type;
- setExpression(attribute, identifier);
- }
-}
-
-/**
- * [NgProcessor] is used to apply an Angular feature.
- */
-abstract class NgProcessor {
- /**
- * Applies this [NgProcessor] to the resolver.
- *
- * @param resolver the [AngularHtmlUnitResolver] to apply to, not `null`
- * @param node the [XmlTagNode] to apply within, not `null`
- */
- void apply(AngularHtmlUnitResolver resolver, ht.XmlTagNode node);
-
- /**
- * Checks if this processor can be applied to the given [XmlTagNode].
- *
- * @param node the [XmlTagNode] to check
- * @return `true` if this processor can be applied, or `false` otherwise
- */
- bool canApply(ht.XmlTagNode node);
-}
-
-/**
* An implementation of [Logger] that does nothing.
*/
class NullLogger implements Logger {
@@ -11339,8 +9913,6 @@
Parser parser = new Parser(source, errorListener);
AnalysisOptions options = context.analysisOptions;
parser.parseFunctionBodies = options.analyzeFunctionBodies;
- parser.parseDeferredLibraries = options.enableDeferredLoading;
- parser.parseEnum = options.enableEnum;
_unit = parser.parseCompilationUnit(_tokenStream);
_unit.lineInfo = lineInfo;
AnalysisContext analysisContext = context;
@@ -11778,16 +10350,6 @@
static TimeCounter resolve = new TimeCounter();
/**
- * The [TimeCounter] for time spent in Angular analysis.
- */
- static TimeCounter angular = new TimeCounter();
-
- /**
- * The [TimeCounter] for time spent in Polymer analysis.
- */
- static TimeCounter polymer = new TimeCounter();
-
- /**
* The [TimeCounter] for time spent in error verifier.
*/
static TimeCounter errors = new TimeCounter();
@@ -11798,6 +10360,11 @@
static TimeCounter hints = new TimeCounter();
/**
+ * The [TimeCounter] for time spent in linting.
+ */
+ static TimeCounter lint = new TimeCounter();
+
+ /**
* Reset all of the time counters to zero.
*/
static void reset() {
@@ -11805,535 +10372,9 @@
scan = new TimeCounter();
parse = new TimeCounter();
resolve = new TimeCounter();
- angular = new TimeCounter();
- polymer = new TimeCounter();
errors = new TimeCounter();
hints = new TimeCounter();
- }
-}
-
-/**
- * Instances of the class `PolymerBuildHtmlTask` build Polymer specific elements.
- */
-class PolymerBuildHtmlTask extends AnalysisTask {
- /**
- * The source to build which Polymer HTML elements for.
- */
- final Source source;
-
- /**
- * The line information associated with the source.
- */
- final LineInfo _lineInfo;
-
- /**
- * The HTML unit to be resolved.
- */
- final ht.HtmlUnit _unit;
-
- /**
- * The resolution errors that were discovered while building elements.
- */
- List<AnalysisError> _errors = AnalysisError.NO_ERRORS;
-
- /**
- * Initialize a newly created task to perform analysis within the given context.
- *
- * @param context the context in which the task is to be performed
- * @param source the source to be resolved
- * @param lineInfo the line information associated with the source
- * @param unit the HTML unit to build Polymer elements for
- */
- PolymerBuildHtmlTask(InternalAnalysisContext context, this.source,
- this._lineInfo, this._unit)
- : super(context);
-
- List<AnalysisError> get errors => _errors;
-
- @override
- String get taskDescription => "build Polymer elements ${source.fullName}";
-
- @override
- accept(AnalysisTaskVisitor visitor) =>
- visitor.visitPolymerBuildHtmlTask(this);
-
- @override
- void internalPerform() {
- RecordingErrorListener errorListener = new RecordingErrorListener();
- PolymerHtmlUnitBuilder resolver =
- new PolymerHtmlUnitBuilder(context, errorListener, source, _lineInfo, _unit);
- resolver.build();
- _errors = errorListener.getErrorsForSource(source);
- }
-}
-
-/**
- * Instances of the class [PolymerHtmlUnitBuilder] build Polymer specific elements.
- */
-class PolymerHtmlUnitBuilder extends ht.RecursiveXmlVisitor<Object> {
- /**
- * These names are forbidden to use as a custom tag name.
- *
- * http://w3c.github.io/webcomponents/spec/custom/#concepts
- */
- static Set<String> _FORBIDDEN_TAG_NAMES = new Set();
-
- final InternalAnalysisContext _context;
-
- TypeProvider _typeProvider;
-
- final AnalysisErrorListener _errorListener;
-
- final Source _source;
-
- final LineInfo _lineInfo;
-
- final ht.HtmlUnit _unit;
-
- List<PolymerTagHtmlElement> _tagHtmlElements = <PolymerTagHtmlElement>[];
-
- ht.XmlTagNode _elementNode;
-
- String _elementName;
-
- PolymerTagHtmlElementImpl _htmlElement;
-
- PolymerTagDartElementImpl _dartElement;
-
- PolymerHtmlUnitBuilder(this._context, this._errorListener, this._source,
- this._lineInfo, this._unit) {
- this._typeProvider = _context.typeProvider;
- }
-
- /**
- * Returns the only [LibraryElement] referenced by a direct `script` child. Maybe
- * `null` if none.
- */
- LibraryElement get dartUnitElement {
- // TODO(scheglov) Maybe check if more than one "script".
- for (ht.XmlTagNode child in _elementNode.tagNodes) {
- if (child is ht.HtmlScriptTagNode) {
- HtmlScriptElement scriptElement = child.scriptElement;
- if (scriptElement is ExternalHtmlScriptElement) {
- Source scriptSource = scriptElement.scriptSource;
- if (scriptSource != null) {
- return _context.getLibraryElement(scriptSource);
- }
- }
- }
- }
- return null;
- }
-
- /**
- * Builds Polymer specific HTML elements.
- */
- void build() {
- _unit.accept(this);
- // set Polymer tags
- HtmlElementImpl unitElement = _unit.element as HtmlElementImpl;
- unitElement.polymerTags = new List.from(_tagHtmlElements);
- }
-
- @override
- Object visitXmlTagNode(ht.XmlTagNode node) {
- if (node.tag == "polymer-element") {
- _createTagHtmlElement(node);
- }
- // visit children
- return super.visitXmlTagNode(node);
- }
-
- void _createAttributeElements() {
- // prepare "attributes" attribute
- ht.XmlAttributeNode attributesAttribute =
- _elementNode.getAttribute("attributes");
- if (attributesAttribute == null) {
- return;
- }
- // check if there is a Dart part to resolve against it
- if (_dartElement == null) {
- // TODO(scheglov) maybe report error (if it is allowed at all to have
- // element without Dart part)
- return;
- }
- // prepare value of the "attributes" attribute
- String attributesText = attributesAttribute.text;
- if (attributesText.trim().isEmpty) {
- _reportErrorForAttribute(
- attributesAttribute,
- PolymerCode.EMPTY_ATTRIBUTES);
- return;
- }
- // prepare attribute name tokens
- List<PolymerHtmlUnitBuilder_NameToken> nameTokens =
- <PolymerHtmlUnitBuilder_NameToken>[
- ];
- {
- int index = 0;
- int textOffset = attributesAttribute.textOffset;
- int nameOffset = -1;
- StringBuffer nameBuffer = new StringBuffer();
- while (index < attributesText.length) {
- int c = attributesText.codeUnitAt(index++);
- if (Character.isWhitespace(c)) {
- if (nameOffset != -1) {
- nameTokens.add(
- new PolymerHtmlUnitBuilder_NameToken(nameOffset, nameBuffer.toString()));
- nameBuffer = new StringBuffer();
- nameOffset = -1;
- }
- continue;
- }
- if (nameOffset == -1) {
- nameOffset = textOffset + index - 1;
- }
- nameBuffer.writeCharCode(c);
- }
- if (nameOffset != -1) {
- nameTokens.add(
- new PolymerHtmlUnitBuilder_NameToken(nameOffset, nameBuffer.toString()));
- nameBuffer = new StringBuffer();
- }
- }
- // create attributes for name tokens
- List<PolymerAttributeElement> attributes = <PolymerAttributeElement>[];
- Set<String> definedNames = new Set();
- ClassElement classElement = _dartElement.classElement;
- for (PolymerHtmlUnitBuilder_NameToken nameToken in nameTokens) {
- int offset = nameToken._offset;
- // prepare name
- String name = nameToken._value;
- if (!isValidAttributeName(name)) {
- _reportErrorForNameToken(
- nameToken,
- PolymerCode.INVALID_ATTRIBUTE_NAME,
- [name]);
- continue;
- }
- if (!definedNames.add(name)) {
- _reportErrorForNameToken(
- nameToken,
- PolymerCode.DUPLICATE_ATTRIBUTE_DEFINITION,
- [name]);
- continue;
- }
- // create attribute
- PolymerAttributeElementImpl attribute =
- new PolymerAttributeElementImpl(name, offset);
- attributes.add(attribute);
- // resolve field
- FieldElement field = classElement.getField(name);
- if (field == null) {
- _reportErrorForNameToken(
- nameToken,
- PolymerCode.UNDEFINED_ATTRIBUTE_FIELD,
- [name, classElement.displayName]);
- continue;
- }
- if (!_isPublishedField(field)) {
- _reportErrorForNameToken(
- nameToken,
- PolymerCode.ATTRIBUTE_FIELD_NOT_PUBLISHED,
- [name, classElement.displayName]);
- }
- attribute.field = field;
- }
- _htmlElement.attributes = attributes;
- }
-
- void _createTagHtmlElement(ht.XmlTagNode node) {
- this._elementNode = node;
- this._elementName = null;
- this._htmlElement = null;
- this._dartElement = null;
- // prepare 'name' attribute
- ht.XmlAttributeNode nameAttribute = node.getAttribute("name");
- if (nameAttribute == null) {
- _reportErrorForToken(node.tagToken, PolymerCode.MISSING_TAG_NAME);
- return;
- }
- // prepare name
- _elementName = nameAttribute.text;
- if (!isValidTagName(_elementName)) {
- _reportErrorForAttributeValue(
- nameAttribute,
- PolymerCode.INVALID_TAG_NAME,
- [_elementName]);
- return;
- }
- // TODO(scheglov) Maybe check that at least one of "template" or "script"
- // children.
- // TODO(scheglov) Maybe check if more than one top-level "template".
- // create HTML element
- int nameOffset = nameAttribute.textOffset;
- _htmlElement = new PolymerTagHtmlElementImpl(_elementName, nameOffset);
- // bind to the corresponding Dart element
- _dartElement = _findTagDartElement();
- if (_dartElement != null) {
- _htmlElement.dartElement = _dartElement;
- _dartElement.htmlElement = _htmlElement;
- }
- // TODO(scheglov) create attributes
- _createAttributeElements();
- // done
- _tagHtmlElements.add(_htmlElement);
- }
-
- /**
- * Returns the [PolymerTagDartElement] that corresponds to the Polymer custom tag declared
- * by the given [XmlTagNode].
- */
- PolymerTagDartElementImpl _findTagDartElement() {
- LibraryElement dartLibraryElement = dartUnitElement;
- if (dartLibraryElement == null) {
- return null;
- }
- return _findTagDartElement_inLibrary(dartLibraryElement);
- }
-
- /**
- * Returns the [PolymerTagDartElementImpl] declared in the given [LibraryElement] with
- * the [elementName]. Maybe `null`.
- */
- PolymerTagDartElementImpl
- _findTagDartElement_inLibrary(LibraryElement library) {
- try {
- library.accept(new _PolymerHtmlUnitBuilder_findTagDartElement(this));
- } on PolymerHtmlUnitBuilder_FoundTagDartElementError catch (e) {
- return e._result;
- }
- return null;
- }
-
- bool _isPublishedAnnotation(ElementAnnotation annotation) {
- Element element = annotation.element;
- if (element != null && element.name == "published") {
- return true;
- }
- return false;
- }
-
- bool _isPublishedField(FieldElement field) {
- List<ElementAnnotation> annotations = field.metadata;
- for (ElementAnnotation annotation in annotations) {
- if (_isPublishedAnnotation(annotation)) {
- return true;
- }
- }
- return false;
- }
-
- /**
- * Reports an error on the attribute's value, or (if absent) on the attribute's name.
- */
- void _reportErrorForAttribute(ht.XmlAttributeNode node, ErrorCode errorCode,
- [List<Object> arguments]) {
- _reportErrorForOffset(node.offset, node.length, errorCode, arguments);
- }
-
- /**
- * Reports an error on the attribute's value, or (if absent) on the attribute's name.
- */
- void _reportErrorForAttributeValue(ht.XmlAttributeNode node,
- ErrorCode errorCode, [List<Object> arguments]) {
- ht.Token valueToken = node.valueToken;
- if (valueToken == null || valueToken.isSynthetic) {
- _reportErrorForAttribute(node, errorCode, arguments);
- } else {
- _reportErrorForToken(valueToken, errorCode, arguments);
- }
- }
-
- void _reportErrorForNameToken(PolymerHtmlUnitBuilder_NameToken token,
- ErrorCode errorCode, [List<Object> arguments]) {
- int offset = token._offset;
- int length = token._value.length;
- _reportErrorForOffset(offset, length, errorCode, arguments);
- }
-
- void _reportErrorForOffset(int offset, int length, ErrorCode errorCode,
- [List<Object> arguments]) {
- _errorListener.onError(
- new AnalysisError.con2(_source, offset, length, errorCode, arguments));
- }
-
- void _reportErrorForToken(ht.Token token, ErrorCode errorCode,
- [List<Object> arguments]) {
- int offset = token.offset;
- int length = token.length;
- _reportErrorForOffset(offset, length, errorCode, arguments);
- }
-
- static bool isValidAttributeName(String name) {
- // cannot be empty
- if (name.isEmpty) {
- return false;
- }
- // check characters
- int length = name.length;
- for (int i = 0; i < length; i++) {
- int c = name.codeUnitAt(i);
- if (i == 0) {
- if (!Character.isLetter(c)) {
- return false;
- }
- } else {
- if (!(Character.isLetterOrDigit(c) || c == 0x5F)) {
- return false;
- }
- }
- }
- return true;
- }
-
- static bool isValidTagName(String name) {
- // cannot be empty
- if (name.isEmpty) {
- return false;
- }
- // check for forbidden name
- if (_FORBIDDEN_TAG_NAMES.contains(name)) {
- return false;
- }
- // check characters
- int length = name.length;
- bool hasDash = false;
- for (int i = 0; i < length; i++) {
- int c = name.codeUnitAt(i);
- // check for '-'
- if (c == 0x2D) {
- hasDash = true;
- }
- // check character
- if (i == 0) {
- if (hasDash) {
- return false;
- }
- if (!Character.isLetter(c)) {
- return false;
- }
- } else {
- if (!(Character.isLetterOrDigit(c) || c == 0x2D || c == 0x5F)) {
- return false;
- }
- }
- }
- if (!hasDash) {
- return false;
- }
- return true;
- }
-}
-
-class PolymerHtmlUnitBuilder_FoundTagDartElementError extends Error {
- final PolymerTagDartElementImpl _result;
-
- PolymerHtmlUnitBuilder_FoundTagDartElementError(this._result);
-}
-
-class PolymerHtmlUnitBuilder_NameToken {
- final int _offset;
-
- final String _value;
-
- PolymerHtmlUnitBuilder_NameToken(this._offset, this._value);
-}
-
-/**
- * Instances of the class [PolymerHtmlUnitResolver] resolve Polymer specific
- * [XmlTagNode]s and expressions.
- *
- * TODO(scheglov) implement it
- */
-class PolymerHtmlUnitResolver extends ht.RecursiveXmlVisitor<Object> {
- final InternalAnalysisContext _context;
-
- TypeProvider _typeProvider;
-
- final AnalysisErrorListener _errorListener;
-
- final Source _source;
-
- final LineInfo _lineInfo;
-
- final ht.HtmlUnit _unit;
-
- PolymerHtmlUnitResolver(this._context, this._errorListener, this._source,
- this._lineInfo, this._unit) {
- this._typeProvider = _context.typeProvider;
- }
-
- /**
- * Resolves Polymer specific features.
- */
- void resolveUnit() {
- // TODO(scheglov) implement it
- // unit.accept(this);
- }
-
- @override
- Object visitXmlAttributeNode(ht.XmlAttributeNode node) =>
- super.visitXmlAttributeNode(node);
-
- @override
- Object visitXmlTagNode(ht.XmlTagNode node) => super.visitXmlTagNode(node);
-}
-
-/**
- * Instances of the class `PolymerResolveHtmlTask` performs Polymer specific HTML file
- * resolution.
- *
- * TODO(scheglov) implement it
- */
-class PolymerResolveHtmlTask extends AnalysisTask {
- /**
- * The source to be resolved.
- */
- final Source source;
-
- /**
- * The line information associated with the source.
- */
- final LineInfo _lineInfo;
-
- /**
- * The HTML unit to be resolved.
- */
- final ht.HtmlUnit _unit;
-
- /**
- * The resolution errors that were discovered while resolving the source.
- */
- List<AnalysisError> _errors = AnalysisError.NO_ERRORS;
-
- /**
- * Initialize a newly created task to perform analysis within the given context.
- *
- * @param context the context in which the task is to be performed
- * @param source the source to be resolved
- * @param unit the HTML unit to be resolved
- */
- PolymerResolveHtmlTask(InternalAnalysisContext context, this.source,
- this._lineInfo, this._unit)
- : super(context);
-
- List<AnalysisError> get errors => _errors;
-
- @override
- String get taskDescription => "resolve as Polymer ${source.fullName}";
-
- @override
- accept(AnalysisTaskVisitor visitor) =>
- visitor.visitPolymerResolveHtmlTask(this);
-
- @override
- void internalPerform() {
- RecordingErrorListener errorListener = new RecordingErrorListener();
- PolymerHtmlUnitResolver resolver =
- new PolymerHtmlUnitResolver(context, errorListener, source, _lineInfo, _unit);
- resolver.resolveUnit();
- _errors = errorListener.getErrorsForSource(source);
+ lint = new TimeCounter();
}
}
@@ -12405,17 +10446,6 @@
}
}
-class RecursiveXmlVisitor_AngularHtmlUnitResolver_hasAngularAnnotation extends
- ht.RecursiveXmlVisitor<Object> {
- @override
- Object visitXmlTagNode(ht.XmlTagNode node) {
- if (node.getAttribute(AngularHtmlUnitResolver._NG_APP) != null) {
- throw new AngularHtmlUnitResolver_FoundAppError();
- }
- return super.visitXmlTagNode(node);
- }
-}
-
class RecursiveXmlVisitor_ParseHtmlTask_internalPerform extends
ht.RecursiveXmlVisitor<Object> {
final ParseHtmlTask ParseHtmlTask_this;
@@ -12667,6 +10697,7 @@
setState(DartEntry.BUILT_UNIT, CacheState.INVALID);
setState(DartEntry.BUILT_ELEMENT, CacheState.INVALID);
setState(DartEntry.HINTS, CacheState.INVALID);
+ setState(DartEntry.LINTS, CacheState.INVALID);
setState(DartEntry.RESOLVED_UNIT, CacheState.INVALID);
setState(DartEntry.RESOLUTION_ERRORS, CacheState.INVALID);
setState(DartEntry.VERIFICATION_ERRORS, CacheState.INVALID);
@@ -12692,6 +10723,15 @@
}
/**
+ * Record that an exception occurred while attempting to generate lints for
+ * the source associated with this entry. This will set the state of all
+ * verification information as being in error.
+ */
+ void recordLintError() {
+ setState(DartEntry.LINTS, CacheState.ERROR);
+ }
+
+ /**
* Record that an exception occurred while attempting to resolve the source
* associated with this state.
*/
@@ -12699,7 +10739,6 @@
setState(DartEntry.RESOLVED_UNIT, CacheState.ERROR);
setState(DartEntry.RESOLUTION_ERRORS, CacheState.ERROR);
recordVerificationError();
- setState(DartEntry.ANGULAR_ERRORS, CacheState.ERROR);
}
/**
@@ -12800,6 +10839,8 @@
oldEntry);
needsSeparator =
_writeStateDiffOn(buffer, needsSeparator, "hints", DartEntry.HINTS, oldEntry);
+ needsSeparator =
+ _writeStateDiffOn(buffer, needsSeparator, "lints", DartEntry.LINTS, oldEntry);
return needsSeparator;
}
@@ -12820,6 +10861,7 @@
"verificationErrors",
DartEntry.VERIFICATION_ERRORS);
_writeStateOn(buffer, "hints", DartEntry.HINTS);
+ _writeStateOn(buffer, "lints", DartEntry.LINTS);
if (_nextState != null) {
_nextState._writeOn(buffer);
}
@@ -12889,211 +10931,6 @@
}
/**
- * Instances of the class `ResolveAngularComponentTemplateTask` resolve HTML template
- * referenced by [AngularComponentElement].
- */
-class ResolveAngularComponentTemplateTask extends AnalysisTask {
- /**
- * The source to be resolved.
- */
- final Source source;
-
- /**
- * The HTML unit to be resolved.
- */
- final ht.HtmlUnit _unit;
-
- /**
- * The [AngularComponentElement] to resolve template for.
- */
- final AngularComponentElement _component;
-
- /**
- * The Angular application to resolve in context of.
- */
- final AngularApplication _application;
-
- /**
- * The [HtmlUnit] that was resolved by this task.
- */
- ht.HtmlUnit _resolvedUnit;
-
- /**
- * The resolution errors that were discovered while resolving the source.
- */
- List<AnalysisError> _resolutionErrors = AnalysisError.NO_ERRORS;
-
- /**
- * Initialize a newly created task to perform analysis within the given context.
- *
- * @param context the context in which the task is to be performed
- * @param source the source to be resolved
- * @param unit the HTML unit to be resolved
- * @param component the component that uses this HTML template, not `null`
- * @param application the Angular application to resolve in context of
- */
- ResolveAngularComponentTemplateTask(InternalAnalysisContext context,
- this.source, this._unit, this._component, this._application)
- : super(context);
-
- List<AnalysisError> get resolutionErrors => _resolutionErrors;
-
- /**
- * Return the [HtmlUnit] that was resolved by this task.
- *
- * @return the [HtmlUnit] that was resolved by this task
- */
- ht.HtmlUnit get resolvedUnit => _resolvedUnit;
-
- @override
- String get taskDescription => "resolve as Angular template $source";
-
- @override
- accept(AnalysisTaskVisitor visitor) =>
- visitor.visitResolveAngularComponentTemplateTask(this);
-
- @override
- void internalPerform() {
- //
- // Prepare for resolution.
- //
- RecordingErrorListener errorListener = new RecordingErrorListener();
- LineInfo lineInfo = context.getLineInfo(source);
- //
- // Perform resolution.
- //
- if (_application != null) {
- AngularHtmlUnitResolver resolver =
- new AngularHtmlUnitResolver(context, errorListener, source, lineInfo, _unit);
- resolver.resolveComponentTemplate(_application, _component);
- _resolvedUnit = _unit;
- }
- //
- // Remember the errors.
- //
- _resolutionErrors = errorListener.getErrorsForSource(source);
- }
-}
-
-/**
- * Instances of the class `ResolveAngularEntryHtmlTask` resolve a specific HTML file as an
- * Angular entry point.
- */
-class ResolveAngularEntryHtmlTask extends AnalysisTask {
- /**
- * The source to be resolved.
- */
- final Source source;
-
- /**
- * The HTML unit to be resolved.
- */
- final ht.HtmlUnit _unit;
-
- /**
- * The listener to record errors.
- */
- RecordingErrorListener _errorListener = new RecordingErrorListener();
-
- /**
- * The [HtmlUnit] that was resolved by this task.
- */
- ht.HtmlUnit _resolvedUnit;
-
- /**
- * The element produced by resolving the source.
- */
- HtmlElement _element = null;
-
- /**
- * The Angular application to resolve in context of.
- */
- AngularApplication _application;
-
- /**
- * Initialize a newly created task to perform analysis within the given context.
- *
- * @param context the context in which the task is to be performed
- * @param source the source to be resolved
- * @param unit the HTML unit to be resolved
- */
- ResolveAngularEntryHtmlTask(InternalAnalysisContext context, this.source,
- this._unit)
- : super(context);
-
- /**
- * Returns the [AngularApplication] for the Web application with this Angular entry point,
- * maybe `null` if not an Angular entry point.
- */
- AngularApplication get application => _application;
-
- HtmlElement get element => _element;
-
- /**
- * The resolution errors that were discovered while resolving the source.
- */
- List<AnalysisError> get entryErrors =>
- _errorListener.getErrorsForSource(source);
-
- /**
- * Return the [HtmlUnit] that was resolved by this task.
- *
- * @return the [HtmlUnit] that was resolved by this task
- */
- ht.HtmlUnit get resolvedUnit => _resolvedUnit;
-
- @override
- String get taskDescription {
- if (source == null) {
- return "resolve as Angular entry point null source";
- }
- return "resolve as Angular entry point ${source.fullName}";
- }
-
- @override
- accept(AnalysisTaskVisitor visitor) =>
- visitor.visitResolveAngularEntryHtmlTask(this);
-
- /**
- * Returns [AnalysisError]s recorded for the given [Source].
- */
- List<AnalysisError> getErrors(Source source) =>
- _errorListener.getErrorsForSource(source);
-
- @override
- void internalPerform() {
- //
- // Prepare for resolution.
- //
- LineInfo lineInfo = context.getLineInfo(source);
- //
- // Try to resolve as an Angular entry point.
- //
- _application = new AngularHtmlUnitResolver(
- context,
- _errorListener,
- source,
- lineInfo,
- _unit).calculateAngularApplication();
- //
- // Perform resolution.
- //
- if (_application != null) {
- new AngularHtmlUnitResolver(
- context,
- _errorListener,
- source,
- lineInfo,
- _unit).resolveEntryPoint(_application);
- }
- //
- // Remember the resolved unit.
- //
- _resolvedUnit = _unit;
- }
-}
-
-/**
* Instances of the class `ResolveDartLibraryTask` resolve a specific Dart library.
*/
class ResolveDartLibraryCycleTask extends AnalysisTask {
@@ -14390,23 +12227,6 @@
}
}
-class _AngularHtmlUnitResolver_visitModelDirectives extends
- ht.RecursiveXmlVisitor<Object> {
- final AngularHtmlUnitResolver resolver;
-
- _AngularHtmlUnitResolver_visitModelDirectives(this.resolver)
- : super();
-
- @override
- Object visitXmlTagNode(ht.XmlTagNode node) {
- NgModelProcessor directive = NgModelProcessor.INSTANCE;
- if (directive.canApply(node)) {
- directive._applyTopDeclarations(resolver, node);
- }
- return super.visitXmlTagNode(node);
- }
-}
-
class _ElementByIdFinder extends GeneralizingElementVisitor {
final int _id;
Element result;
@@ -14425,20 +12245,3 @@
class _ElementByIdFinderException {
}
-
-class _PolymerHtmlUnitBuilder_findTagDartElement extends
- RecursiveElementVisitor<Object> {
- final PolymerHtmlUnitBuilder PolymerHtmlUnitBuilder_this;
-
- _PolymerHtmlUnitBuilder_findTagDartElement(this.PolymerHtmlUnitBuilder_this)
- : super();
-
- @override
- Object visitPolymerTagDartElement(PolymerTagDartElement element) {
- if (element.name == PolymerHtmlUnitBuilder_this._elementName) {
- throw new PolymerHtmlUnitBuilder_FoundTagDartElementError(
- element as PolymerTagDartElementImpl);
- }
- return null;
- }
-}
diff --git a/pkg/analyzer/lib/src/generated/error.dart b/pkg/analyzer/lib/src/generated/error.dart
index e34d07f..f9411ef 100644
--- a/pkg/analyzer/lib/src/generated/error.dart
+++ b/pkg/analyzer/lib/src/generated/error.dart
@@ -285,81 +285,6 @@
}
/**
- * The enumeration `AngularCode` defines Angular specific problems.
- */
-class AngularCode extends ErrorCode {
- static const AngularCode CANNOT_PARSE_SELECTOR = const AngularCode(
- 'CANNOT_PARSE_SELECTOR',
- "The selector '{0}' cannot be parsed");
-
- static const AngularCode INVALID_FORMATTER_NAME = const AngularCode(
- 'INVALID_FORMATTER_NAME',
- "Formatter name must be a simple identifier");
-
- static const AngularCode INVALID_PROPERTY_KIND = const AngularCode(
- 'INVALID_PROPERTY_KIND',
- "Unknown property binding kind '{0}', use one of the '@', '=>', '=>!' or '<=>'");
-
- static const AngularCode INVALID_PROPERTY_FIELD =
- const AngularCode('INVALID_PROPERTY_FIELD', "Unknown property field '{0}'");
-
- static const AngularCode INVALID_PROPERTY_MAP = const AngularCode(
- 'INVALID_PROPERTY_MAP',
- "Argument 'map' must be a constant map literal");
-
- static const AngularCode INVALID_PROPERTY_NAME = const AngularCode(
- 'INVALID_PROPERTY_NAME',
- "Property name must be a string literal");
-
- static const AngularCode INVALID_PROPERTY_SPEC = const AngularCode(
- 'INVALID_PROPERTY_SPEC',
- "Property binding specification must be a string literal");
-
- static const AngularCode INVALID_REPEAT_SYNTAX = const AngularCode(
- 'INVALID_REPEAT_SYNTAX',
- "Expected statement in form '_item_ in _collection_ [tracked by _id_]'");
-
- static const AngularCode INVALID_REPEAT_ITEM_SYNTAX = const AngularCode(
- 'INVALID_REPEAT_ITEM_SYNTAX',
- "Item must by identifier or in '(_key_, _value_)' pair.");
-
- static const AngularCode INVALID_URI =
- const AngularCode('INVALID_URI', "Invalid URI syntax: '{0}'");
-
- static const AngularCode MISSING_FORMATTER_COLON = const AngularCode(
- 'MISSING_FORMATTER_COLON',
- "Missing ':' before formatter argument");
-
- static const AngularCode MISSING_NAME =
- const AngularCode('MISSING_NAME', "Argument 'name' must be provided");
-
- static const AngularCode MISSING_PUBLISH_AS = const AngularCode(
- 'MISSING_PUBLISH_AS',
- "Argument 'publishAs' must be provided");
-
- static const AngularCode MISSING_SELECTOR =
- const AngularCode('MISSING_SELECTOR', "Argument 'selector' must be provided");
-
- static const AngularCode URI_DOES_NOT_EXIST =
- const AngularCode('URI_DOES_NOT_EXIST', "Target of URI does not exist: '{0}'");
-
- /**
- * Initialize a newly created error code to have the given [name]. The message
- * associated with the error will be created from the given [message]
- * template. The correction associated with the error will be created from the
- * given [correction] template.
- */
- const AngularCode(String name, String message, [String correction])
- : super(name, message, correction);
-
- @override
- ErrorSeverity get errorSeverity => ErrorSeverity.INFO;
-
- @override
- ErrorType get type => ErrorType.ANGULAR;
-}
-
-/**
* Instances of the class `BooleanErrorListener` implement a listener that keeps track of
* whether an error has been reported to it.
*/
@@ -2908,16 +2833,10 @@
const ErrorType('SYNTACTIC_ERROR', 6, ErrorSeverity.ERROR);
/**
- * Angular specific semantic problems.
+ * Lint warnings describe style and best practice recommendations that can be used to formalize a project's style
+ * guidelines.
*/
- static const ErrorType ANGULAR =
- const ErrorType('ANGULAR', 7, ErrorSeverity.INFO);
-
- /**
- * Polymer specific semantic problems.
- */
- static const ErrorType POLYMER =
- const ErrorType('POLYMER', 8, ErrorSeverity.INFO);
+ static const ErrorType LINT = const ErrorType('LINT', 7, ErrorSeverity.INFO);
static const List<ErrorType> values = const [
TODO,
@@ -2927,8 +2846,7 @@
STATIC_WARNING,
STATIC_TYPE_WARNING,
SYNTACTIC_ERROR,
- ANGULAR,
- POLYMER];
+ LINT];
/**
* The severity of this type of error.
@@ -3318,51 +3236,21 @@
}
/**
- * The enumeration `PolymerCode` defines Polymer specific problems.
+ * Defines style and best practice recommendations.
+ *
+ * Unlike [HintCode]s, which are akin to traditional static warnings from a compiler, lint recommendations focus on
+ * matters of style and practices that might aggregated to define a project's style guide.
*/
-class PolymerCode extends ErrorCode {
- static const PolymerCode ATTRIBUTE_FIELD_NOT_PUBLISHED = const PolymerCode(
- 'ATTRIBUTE_FIELD_NOT_PUBLISHED',
- "Field '{0}' in '{1}' must be @published");
+class LintCode extends ErrorCode {
- static const PolymerCode DUPLICATE_ATTRIBUTE_DEFINITION = const PolymerCode(
- 'DUPLICATE_ATTRIBUTE_DEFINITION',
- "The attribute '{0}' is already defined");
-
- static const PolymerCode EMPTY_ATTRIBUTES = const PolymerCode(
- 'EMPTY_ATTRIBUTES',
- "Empty 'attributes' attribute is useless");
-
- static const PolymerCode INVALID_ATTRIBUTE_NAME = const PolymerCode(
- 'INVALID_ATTRIBUTE_NAME',
- "'{0}' is not a valid name for a custom element attribute");
-
- static const PolymerCode INVALID_TAG_NAME = const PolymerCode(
- 'INVALID_TAG_NAME',
- "'{0}' is not a valid name for a custom element");
-
- static const PolymerCode MISSING_TAG_NAME = const PolymerCode(
- 'MISSING_TAG_NAME',
- "Missing tag name of the custom element. Please include an attribute like name='your-tag-name'");
-
- static const PolymerCode UNDEFINED_ATTRIBUTE_FIELD = const PolymerCode(
- 'UNDEFINED_ATTRIBUTE_FIELD',
- "There is no such field '{0}' in '{1}'");
-
- /**
- * Initialize a newly created error code to have the given [name]. The message
- * associated with the error will be created from the given [message]
- * template. The correction associated with the error will be created from the
- * given [correction] template.
- */
- const PolymerCode(String name, String message, [String correction])
+ const LintCode(String name, String message, [String correction])
: super(name, message, correction);
@override
ErrorSeverity get errorSeverity => ErrorSeverity.INFO;
@override
- ErrorType get type => ErrorType.POLYMER;
+ ErrorType get type => ErrorType.LINT;
}
/**
diff --git a/pkg/analyzer/lib/src/generated/html.dart b/pkg/analyzer/lib/src/generated/html.dart
index 1e1b7b3..af8048c 100644
--- a/pkg/analyzer/lib/src/generated/html.dart
+++ b/pkg/analyzer/lib/src/generated/html.dart
@@ -11,8 +11,7 @@
import 'ast.dart';
import 'element.dart';
-import 'engine.dart' show AnalysisEngine, AngularHtmlUnitResolver,
- ExpressionVisitor;
+import 'engine.dart' show AnalysisEngine;
import 'error.dart' show AnalysisErrorListener;
import 'java_core.dart';
import 'java_engine.dart';
@@ -346,23 +345,6 @@
}
}
-class ExpressionVisitor_HtmlUnitUtils_getExpression extends ExpressionVisitor {
- final int offset;
-
- Expression result;
-
- ExpressionVisitor_HtmlUnitUtils_getExpression(this.offset);
-
- @override
- void visitExpression(Expression expression) {
- Expression at = HtmlUnitUtils._getExpressionAt(expression, offset);
- if (at != null) {
- result = at;
- throw new HtmlUnitUtils_FoundExpressionError();
- }
- }
-}
-
/**
* Instances of the class `HtmlParser` are used to parse tokens into a AST structure comprised
* of [XmlNode]s.
@@ -665,178 +647,6 @@
}
/**
- * Utilities locating [Expression]s and [Element]s in [HtmlUnit].
- */
-class HtmlUnitUtils {
- /**
- * Returns the [XmlAttributeNode] that is part of the given [HtmlUnit] and encloses
- * the given offset.
- */
- static XmlAttributeNode getAttributeNode(HtmlUnit htmlUnit, int offset) {
- if (htmlUnit == null) {
- return null;
- }
- RecursiveXmlVisitor_HtmlUnitUtils_getAttributeNode visitor =
- new RecursiveXmlVisitor_HtmlUnitUtils_getAttributeNode(offset);
- try {
- htmlUnit.accept(visitor);
- } on HtmlUnitUtils_FoundAttributeNodeError catch (e) {
- return visitor.result;
- }
- return null;
- }
-
- /**
- * Returns the best [Element] of the given [Expression].
- */
- static Element getElement(Expression expression) {
- if (expression == null) {
- return null;
- }
- return ElementLocator.locate(expression);
- }
-
- /**
- * Returns the [Element] of the [Expression] in the given [HtmlUnit], enclosing
- * the given offset.
- */
- static Element getElementAtOffset(HtmlUnit htmlUnit, int offset) {
- Expression expression = getExpression(htmlUnit, offset);
- return getElement(expression);
- }
-
- /**
- * Returns the [Element] to open when requested at the given [Expression].
- */
- static Element getElementToOpen(HtmlUnit htmlUnit, Expression expression) {
- Element element = getElement(expression);
- {
- AngularElement angularElement =
- AngularHtmlUnitResolver.getAngularElement(element);
- if (angularElement != null) {
- return angularElement;
- }
- }
- return element;
- }
-
- /**
- * Returns the [XmlTagNode] that is part of the given [HtmlUnit] and encloses the
- * given offset.
- */
- static XmlTagNode getEnclosingTagNode(HtmlUnit htmlUnit, int offset) {
- if (htmlUnit == null) {
- return null;
- }
- RecursiveXmlVisitor_HtmlUnitUtils_getEnclosingTagNode visitor =
- new RecursiveXmlVisitor_HtmlUnitUtils_getEnclosingTagNode(offset);
- try {
- htmlUnit.accept(visitor);
- } on HtmlUnitUtils_FoundTagNodeError catch (e) {
- return visitor.result;
- }
- return null;
- }
-
- /**
- * Returns the [Expression] that is part of the given [HtmlUnit] and encloses the
- * given offset.
- */
- static Expression getExpression(HtmlUnit htmlUnit, int offset) {
- if (htmlUnit == null) {
- return null;
- }
- ExpressionVisitor_HtmlUnitUtils_getExpression visitor =
- new ExpressionVisitor_HtmlUnitUtils_getExpression(offset);
- try {
- // TODO(scheglov) this code is very Angular specific
- htmlUnit.accept(visitor);
- } on HtmlUnitUtils_FoundExpressionError catch (e) {
- return visitor.result;
- }
- return null;
- }
-
- /**
- * Returns the [XmlTagNode] that is part of the given [HtmlUnit] and its open or
- * closing tag name encloses the given offset.
- */
- static XmlTagNode getTagNode(HtmlUnit htmlUnit, int offset) {
- XmlTagNode node = getEnclosingTagNode(htmlUnit, offset);
- // do we have an enclosing tag at all?
- if (node == null) {
- return null;
- }
- // is "offset" in the open tag?
- Token openTag = node.tagToken;
- if (openTag.offset <= offset && offset <= openTag.end) {
- return node;
- }
- // is "offset" in the open tag?
- Token closeTag = node.closingTag;
- if (closeTag != null &&
- closeTag.offset <= offset &&
- offset <= closeTag.end) {
- return node;
- }
- // not on a tag name
- return null;
- }
-
- /**
- * Returns the [Expression] that is part of the given root [AstNode] and encloses the
- * given offset.
- */
- static Expression _getExpressionAt(AstNode root, int offset) {
- if (root.offset <= offset && offset <= root.end) {
- AstNode dartNode = new NodeLocator.con1(offset).searchWithin(root);
- if (dartNode is Expression) {
- return dartNode;
- }
- }
- return null;
- }
-}
-
-class HtmlUnitUtils_FoundAttributeNodeError extends Error {
-}
-
-class HtmlUnitUtils_FoundExpressionError extends Error {
-}
-
-class HtmlUnitUtils_FoundTagNodeError extends Error {
-}
-
-/**
- * Implementation of [XmlExpression] for an [Expression] embedded without any wrapping
- * characters.
- */
-class RawXmlExpression extends XmlExpression {
- final Expression expression;
-
- RawXmlExpression(this.expression);
-
- @override
- int get end => expression.end;
-
- @override
- int get length => expression.length;
-
- @override
- int get offset => expression.offset;
-
- @override
- XmlExpression_Reference getReference(int offset) {
- AstNode node = new NodeLocator.con1(offset).searchWithin(expression);
- if (node != null) {
- Element element = ElementLocator.locate(node);
- return new XmlExpression_Reference(element, node.offset, node.length);
- }
- return null;
- }
-}
-
-/**
* Instances of the class `RecursiveXmlVisitor` implement an XML visitor that will recursively
* visit all of the nodes in an XML structure. For example, using an instance of this class to visit
* a [XmlTagNode] will also cause all of the contained [XmlAttributeNode]s and
@@ -872,44 +682,6 @@
}
}
-class RecursiveXmlVisitor_HtmlUnitUtils_getAttributeNode extends
- RecursiveXmlVisitor<Object> {
- final int offset;
-
- XmlAttributeNode result;
-
- RecursiveXmlVisitor_HtmlUnitUtils_getAttributeNode(this.offset);
-
- @override
- Object visitXmlAttributeNode(XmlAttributeNode node) {
- Token nameToken = node.nameToken;
- if (nameToken.offset <= offset && offset <= nameToken.end) {
- result = node;
- throw new HtmlUnitUtils_FoundAttributeNodeError();
- }
- return super.visitXmlAttributeNode(node);
- }
-}
-
-class RecursiveXmlVisitor_HtmlUnitUtils_getEnclosingTagNode extends
- RecursiveXmlVisitor<Object> {
- final int offset;
-
- XmlTagNode result;
-
- RecursiveXmlVisitor_HtmlUnitUtils_getEnclosingTagNode(this.offset);
-
- @override
- Object visitXmlTagNode(XmlTagNode node) {
- if (node.offset <= offset && offset < node.end) {
- result = node;
- super.visitXmlTagNode(node);
- throw new HtmlUnitUtils_FoundTagNodeError();
- }
- return null;
- }
-}
-
/**
* Instances of the class `SimpleXmlVisitor` implement an AST visitor that will do nothing
* when visiting an AST node. It is intended to be a superclass for classes that use the visitor
diff --git a/pkg/analyzer/lib/src/generated/incremental_resolution_validator.dart b/pkg/analyzer/lib/src/generated/incremental_resolution_validator.dart
index 55bc3a1..2f9e3a0 100644
--- a/pkg/analyzer/lib/src/generated/incremental_resolution_validator.dart
+++ b/pkg/analyzer/lib/src/generated/incremental_resolution_validator.dart
@@ -8,22 +8,33 @@
import 'package:analyzer/src/generated/element.dart';
+/**
+ * Validates that the [actual] and the [expected] units have the same structure
+ * and resolution. Throws [IncrementalResolutionMismatch] otherwise.
+ */
void assertSameResolution(CompilationUnit actual, CompilationUnit expected,
- FailHandler failHandler) {
+ {bool validateTypes: false}) {
_SameResolutionValidator validator =
- new _SameResolutionValidator(failHandler, expected);
+ new _SameResolutionValidator(validateTypes, expected);
actual.accept(validator);
}
-typedef FailHandler(String reason);
+/**
+ * This exception is thrown when a mismatch between actual and expected AST
+ * or resolution is found.
+ */
+class IncrementalResolutionMismatch {
+ final String message;
+ IncrementalResolutionMismatch(this.message);
+}
class _SameResolutionValidator implements AstVisitor {
- final FailHandler failHandler;
+ final bool validateTypes;
AstNode other;
- _SameResolutionValidator(this.failHandler, this.other);
+ _SameResolutionValidator(this.validateTypes, this.other);
@override
visitAdjacentStrings(AdjacentStrings node) {
@@ -775,7 +786,7 @@
String message = '';
message += 'Expected: $expected\n';
message += ' Actual: $actual\n';
- failHandler(message);
+ _fail(message);
}
}
@@ -784,7 +795,7 @@
String message = '';
message += 'Expected: null\n';
message += ' Actual: $obj\n';
- failHandler(message);
+ _fail(message);
}
}
@@ -793,33 +804,46 @@
message += 'Expected length: $expected\n';
if (actualList == null) {
message += 'but null found.';
- failHandler(message);
+ _fail(message);
}
int actual = actualList.length;
if (actual != expected) {
message += 'but $actual found\n';
message += 'in $actualList';
- failHandler(message);
+ _fail(message);
}
}
+ void _fail(String message) {
+ throw new IncrementalResolutionMismatch(message);
+ }
+
void _verifyElement(Element a, Element b) {
- if (a != b) {
- print(a.location);
- print(b.location);
- failHandler('Expected: $b\n Actual: $a');
+ if (a is Member && b is Member) {
+ a = (a as Member).baseElement;
+ b = (b as Member).baseElement;
+ }
+ String locationA = _getElementLocationWithoutUri(a);
+ String locationB = _getElementLocationWithoutUri(b);
+ if (locationA != locationB) {
+ int offset = other.offset;
+ _fail('[$offset]\nExpected: $b ($locationB)\n Actual: $a ($locationA)');
}
if (a == null && b == null) {
return;
}
if (a.nameOffset != b.nameOffset) {
- failHandler('Expected: ${b.nameOffset}\n Actual: ${a.nameOffset}');
+ _fail('Expected: ${b.nameOffset}\n Actual: ${a.nameOffset}');
}
}
void _verifyType(DartType a, DartType b) {
+ if (!validateTypes) {
+ return;
+ }
if (a != b) {
- failHandler('Expected: $b\n Actual: $a');
+ int offset = other.offset;
+ _fail('[$offset]\nExpected: $b\n Actual: $a');
}
}
@@ -871,4 +895,50 @@
_visitList(node.metadata, other.metadata);
_visitNode(node.identifier, other.identifier);
}
+
+ /**
+ * Returns an URI scheme independent version of the [element] location.
+ */
+ static String _getElementLocationWithoutUri(Element element) {
+ if (element == null) {
+ return '<null>';
+ }
+ if (element is UriReferencedElementImpl) {
+ return '<ignored>';
+ }
+ ElementLocation location = element.location;
+ List<String> components = location.components;
+ String uriPrefix = '';
+ Element unit = element is CompilationUnitElement ?
+ element :
+ element.getAncestor((e) => e is CompilationUnitElement);
+ if (unit != null) {
+ String libComponent = components[0];
+ String unitComponent = components[1];
+ components = components.sublist(2);
+ uriPrefix = _getShortElementLocationUri(libComponent) +
+ ':' +
+ _getShortElementLocationUri(unitComponent);
+ } else {
+ String libComponent = components[0];
+ components = components.sublist(1);
+ uriPrefix = _getShortElementLocationUri(libComponent);
+ }
+ return uriPrefix + ':' + components.join(':');
+ }
+
+ /**
+ * Returns a "short" version of the given [uri].
+ *
+ * For example:
+ * /User/me/project/lib/my_lib.dart -> my_lib.dart
+ * package:project/my_lib.dart -> my_lib.dart
+ */
+ static String _getShortElementLocationUri(String uri) {
+ int index = uri.lastIndexOf('/');
+ if (index == -1) {
+ return uri;
+ }
+ return uri.substring(index + 1);
+ }
}
diff --git a/pkg/analyzer/lib/src/generated/incremental_resolver.dart b/pkg/analyzer/lib/src/generated/incremental_resolver.dart
index 3b6709a..2088c51 100644
--- a/pkg/analyzer/lib/src/generated/incremental_resolver.dart
+++ b/pkg/analyzer/lib/src/generated/incremental_resolver.dart
@@ -136,6 +136,7 @@
ClassElement element = _findElement(_enclosingUnit.types, name);
_enclosingClass = element;
_processElement(element);
+ _assertSameAnnotations(node, element);
_assertSameTypeParameters(node.typeParameters, element.typeParameters);
// check for missing clauses
if (node.extendsClause == null) {
@@ -264,6 +265,7 @@
}
// process element
_processElement(element);
+ _assertSameAnnotations(node, element);
_assertFalse(element.isSynthetic);
_assertSameType(node.returnType, element.returnType);
_assertCompatibleParameters(
@@ -338,6 +340,7 @@
ExecutableElement newElement = node.element;
try {
_assertNotNull(element);
+ _assertSameAnnotations(node, element);
_assertEquals(node.isStatic, element.isStatic);
_assertSameType(node.returnType, element.returnType);
_assertCompatibleParameters(node.parameters, element.parameters);
@@ -394,8 +397,8 @@
}
// verify
PropertyInducingElement newElement = node.name.staticElement;
- _assertNotNull(element);
_processElement(element);
+ _assertSameAnnotations(node, element);
_assertEquals(node.isConst, element.isConst);
_assertEquals(node.isFinal, element.isFinal);
if (_enclosingFieldNode != null) {
@@ -511,6 +514,33 @@
}
}
+ void _assertSameAnnotation(Annotation node, ElementAnnotation annotation) {
+ Element element = annotation.element;
+ if (element is ConstructorElement) {
+ _assertTrue(node.name is SimpleIdentifier);
+ _assertNull(node.constructorName);
+ TypeName nodeType = new TypeName(node.name, null);
+ _assertSameType(nodeType, element.returnType);
+ // TODO(scheglov) validate arguments
+ }
+ if (element is PropertyAccessorElement) {
+ _assertTrue(node.name is SimpleIdentifier);
+ String nodeName = node.name.name;
+ String elementName = element.displayName;
+ _assertEquals(nodeName, elementName);
+ }
+ }
+
+ void _assertSameAnnotations(AnnotatedNode node, Element element) {
+ List<Annotation> nodeAnnotaitons = node.metadata;
+ List<ElementAnnotation> elementAnnotations = element.metadata;
+ int length = nodeAnnotaitons.length;
+ _assertEquals(elementAnnotations.length, length);
+ for (int i = 0; i < length; i++) {
+ _assertSameAnnotation(nodeAnnotaitons[i], elementAnnotations[i]);
+ }
+ }
+
void _assertSameType(TypeName node, DartType type) {
// no return type == dynamic
if (node == null) {
@@ -745,6 +775,11 @@
*/
class IncrementalResolver {
/**
+ * All resolved units of the [_definingLibrary].
+ */
+ final Map<Source, CompilationUnit> _units;
+
+ /**
* The element of the compilation unit being resolved.
*/
final CompilationUnitElement _definingUnit;
@@ -775,6 +810,11 @@
Source _source;
/**
+ * The source representing the library of the compilation unit being visited.
+ */
+ Source _librarySource;
+
+ /**
* The offset of the changed contents.
*/
final int _updateOffset;
@@ -796,7 +836,7 @@
List<AnalysisError> _resolveErrors = AnalysisError.NO_ERRORS;
List<AnalysisError> _verifyErrors = AnalysisError.NO_ERRORS;
- List<AnalysisError> _hints = AnalysisError.NO_ERRORS;
+ List<AnalysisError> _lints = AnalysisError.NO_ERRORS;
/**
* The elements that should be resolved because of API changes.
@@ -807,10 +847,11 @@
* Initialize a newly created incremental resolver to resolve a node in the
* given source in the given library.
*/
- IncrementalResolver(this._definingUnit, this._updateOffset,
+ IncrementalResolver(this._units, this._definingUnit, this._updateOffset,
this._updateEndOld, this._updateEndNew) {
_updateDelta = _updateEndNew - _updateEndOld;
_definingLibrary = _definingUnit.library;
+ _librarySource = _definingLibrary.source;
_source = _definingUnit.source;
_context = _definingUnit.context;
_typeProvider = _context.typeProvider;
@@ -840,6 +881,7 @@
// verify
_verify(rootNode);
_generateHints(rootNode);
+ _generateLints(rootNode);
// update entry errors
_updateEntry();
// resolve queue in response of API changes
@@ -956,17 +998,43 @@
LoggingTimer timer = logger.startTimer();
try {
RecordingErrorListener errorListener = new RecordingErrorListener();
- CompilationUnit unit = node.getAncestor((n) => n is CompilationUnit);
+ // prepare a list of the library units
+ List<CompilationUnit> units;
+ {
+ CompilationUnit unit = node.getAncestor((n) => n is CompilationUnit);
+ _units[_source] = unit;
+ units = _units.values.toList();
+ }
+ // run the generator
AnalysisContext analysisContext = _definingLibrary.context;
HintGenerator hintGenerator =
- new HintGenerator(<CompilationUnit>[unit], analysisContext, errorListener);
+ new HintGenerator(units, analysisContext, errorListener);
hintGenerator.generateForLibrary();
- _hints = errorListener.getErrorsForSource(_source);
+ // remember hints
+ for (Source source in _units.keys) {
+ List<AnalysisError> hints = errorListener.getErrorsForSource(source);
+ DartEntry entry = _context.getReadableSourceEntryOrNull(source);
+ entry.setValueInLibrary(DartEntry.HINTS, _librarySource, hints);
+ }
} finally {
timer.stop('generate hints');
}
}
+ void _generateLints(AstNode node) {
+ LoggingTimer timer = logger.startTimer();
+ try {
+ RecordingErrorListener errorListener = new RecordingErrorListener();
+ CompilationUnit unit = node.getAncestor((n) => n is CompilationUnit);
+ LintGenerator lintGenerator =
+ new LintGenerator(<CompilationUnit>[unit], errorListener);
+ lintGenerator.generate();
+ _lints = errorListener.getErrorsForSource(_source);
+ } finally {
+ timer.stop('generate lints');
+ }
+ }
+
/**
* Return the element defined by [node], or `null` if the node does not
* define an element.
@@ -1005,10 +1073,11 @@
CompilationUnitElement unit =
element.getAncestor((e) => e is CompilationUnitElement);
IncrementalResolver resolver =
- new IncrementalResolver(unit, node.offset, node.end, node.end);
+ new IncrementalResolver(_units, unit, node.offset, node.end, node.end);
resolver._resolveReferences(node);
resolver._verify(node);
resolver._generateHints(node);
+ resolver._generateLints(node);
resolver._updateEntry();
} finally {
logger.exit();
@@ -1071,12 +1140,12 @@
_shiftErrors(DartEntry.RESOLUTION_ERRORS);
_shiftErrors(DartEntry.VERIFICATION_ERRORS);
_shiftErrors(DartEntry.HINTS);
+ _shiftErrors(DartEntry.LINTS);
}
void _shiftErrors(DataDescriptor<List<AnalysisError>> descriptor) {
- Source librarySource = _definingLibrary.source;
List<AnalysisError> errors =
- entry.getValueInLibrary(descriptor, librarySource);
+ entry.getValueInLibrary(descriptor, _librarySource);
for (AnalysisError error in errors) {
int errorOffset = error.offset;
if (errorOffset > _updateOffset) {
@@ -1096,26 +1165,25 @@
}
void _updateEntry() {
- Source librarySource = _definingLibrary.source;
{
List<AnalysisError> oldErrors =
- entry.getValueInLibrary(DartEntry.RESOLUTION_ERRORS, librarySource);
+ entry.getValueInLibrary(DartEntry.RESOLUTION_ERRORS, _librarySource);
List<AnalysisError> errors = _updateErrors(oldErrors, _resolveErrors);
entry.setValueInLibrary(
DartEntry.RESOLUTION_ERRORS,
- librarySource,
+ _librarySource,
errors);
}
{
List<AnalysisError> oldErrors =
- entry.getValueInLibrary(DartEntry.VERIFICATION_ERRORS, librarySource);
+ entry.getValueInLibrary(DartEntry.VERIFICATION_ERRORS, _librarySource);
List<AnalysisError> errors = _updateErrors(oldErrors, _verifyErrors);
entry.setValueInLibrary(
DartEntry.VERIFICATION_ERRORS,
- librarySource,
+ _librarySource,
errors);
}
- entry.setValueInLibrary(DartEntry.HINTS, librarySource, _hints);
+ entry.setValueInLibrary(DartEntry.LINTS, _librarySource, _lints);
}
List<AnalysisError> _updateErrors(List<AnalysisError> oldErrors,
@@ -1167,6 +1235,7 @@
class PoorMansIncrementalResolver {
final TypeProvider _typeProvider;
+ final Map<Source, CompilationUnit> _units;
final Source _unitSource;
final DartEntry _entry;
CompilationUnitElement _unitElement;
@@ -1179,8 +1248,8 @@
List<AnalysisError> _newScanErrors = <AnalysisError>[];
List<AnalysisError> _newParseErrors = <AnalysisError>[];
- PoorMansIncrementalResolver(this._typeProvider, this._unitSource, this._entry,
- bool resolveApiChanges) {
+ PoorMansIncrementalResolver(this._typeProvider, this._units, this._unitSource,
+ this._entry, bool resolveApiChanges) {
_resolveApiChanges = resolveApiChanges;
}
@@ -1189,9 +1258,10 @@
* Returns `true` if success, or `false` otherwise.
* The [oldUnit] might be damaged.
*/
- bool resolve(CompilationUnit oldUnit, String newCode) {
+ bool resolve(String newCode) {
logger.enter('diff/resolve $_unitSource');
try {
+ CompilationUnit oldUnit = _units[_unitSource];
_unitElement = oldUnit.element;
CompilationUnit newUnit = _parseUnit(newCode);
_TokenPair firstPair =
@@ -1226,6 +1296,7 @@
_shiftTokens(firstPair.oldToken);
{
IncrementalResolver incrementalResolver = new IncrementalResolver(
+ _units,
_unitElement,
_updateOffset,
_updateEndOld,
@@ -1298,6 +1369,7 @@
}
// perform incremental resolution
IncrementalResolver incrementalResolver = new IncrementalResolver(
+ _units,
_unitElement,
_updateOffset,
_updateEndOld,
@@ -1365,11 +1437,13 @@
NodeReplacer.replace(oldComment, newComment);
// update elements
IncrementalResolver incrementalResolver = new IncrementalResolver(
+ _units,
_unitElement,
_updateOffset,
_updateEndOld,
_updateEndNew);
incrementalResolver._updateElementNameOffsets();
+ incrementalResolver._shiftEntryErrors();
_updateEntry();
// resolve references in the comment
incrementalResolver._resolveReferences(newComment);
diff --git a/pkg/analyzer/lib/src/generated/parser.dart b/pkg/analyzer/lib/src/generated/parser.dart
index a6ebecf..ed538c4 100644
--- a/pkg/analyzer/lib/src/generated/parser.dart
+++ b/pkg/analyzer/lib/src/generated/parser.dart
@@ -1112,12 +1112,6 @@
}
@override
- AstNode visitFormalParameterList(FormalParameterList node) {
- // We don't know which kind of parameter to parse.
- throw new InsufficientContextException();
- }
-
- @override
AstNode visitForStatement(ForStatement node) {
if (identical(_oldNode, node.variables)) {
throw new InsufficientContextException();
@@ -1134,6 +1128,12 @@
}
@override
+ AstNode visitFormalParameterList(FormalParameterList node) {
+ // We don't know which kind of parameter to parse.
+ throw new InsufficientContextException();
+ }
+
+ @override
AstNode visitFunctionDeclaration(FunctionDeclaration node) {
if (identical(_oldNode, node.documentationComment)) {
throw new InsufficientContextException();
@@ -1482,19 +1482,19 @@
}
@override
- AstNode visitPrefixedIdentifier(PrefixedIdentifier node) {
- if (identical(_oldNode, node.prefix)) {
- return _parser.parseSimpleIdentifier();
- } else if (identical(_oldNode, node.identifier)) {
- return _parser.parseSimpleIdentifier();
+ AstNode visitPrefixExpression(PrefixExpression node) {
+ if (identical(_oldNode, node.operand)) {
+ throw new InsufficientContextException();
}
return _notAChild(node);
}
@override
- AstNode visitPrefixExpression(PrefixExpression node) {
- if (identical(_oldNode, node.operand)) {
- throw new InsufficientContextException();
+ AstNode visitPrefixedIdentifier(PrefixedIdentifier node) {
+ if (identical(_oldNode, node.prefix)) {
+ return _parser.parseSimpleIdentifier();
+ } else if (identical(_oldNode, node.identifier)) {
+ return _parser.parseSimpleIdentifier();
}
return _notAChild(node);
}
@@ -1825,6 +1825,100 @@
}
/**
+ * Visitor capable of inferring the correct parser state for incremental
+ * parsing. This visitor visits each parent/child relationship in the chain of
+ * ancestors of the node to be replaced (starting with the root of the parse
+ * tree), updating the parser to the correct state for parsing the child of the
+ * given parent. Once it has visited all of these relationships, the parser
+ * will be in the correct state for reparsing the node to be replaced.
+ *
+ * TODO(paulberry): add support for other pieces of parser state (_inAsync,
+ * _inGenerator, _inLoop, and _inSwitch). Note that _inLoop and _inSwitch only
+ * affect error message generation.
+ */
+class IncrementalParseStateBuilder extends SimpleAstVisitor {
+ /**
+ * The parser whose state should be built.
+ */
+ final Parser _parser;
+
+ /**
+ * The child node in the parent/child relationship currently being visited.
+ * (The corresponding parent is the node passed to the visit...() function.)
+ */
+ AstNode _childNode;
+
+ /**
+ * Create an IncrementalParseStateBuilder which will build the correct state
+ * for [_parser].
+ */
+ IncrementalParseStateBuilder(this._parser);
+
+ /**
+ * Build the correct parser state for parsing a replacement for [node].
+ */
+ void buildState(AstNode node) {
+ List<AstNode> ancestors = <AstNode>[];
+ while (node != null) {
+ ancestors.add(node);
+ node = node.parent;
+ }
+ _parser._inInitializer = false;
+ for (int i = ancestors.length - 2; i >= 0; i--) {
+ _childNode = ancestors[i];
+ ancestors[i + 1].accept(this);
+ }
+ }
+
+ @override
+ void visitArgumentList(ArgumentList node) {
+ _parser._inInitializer = false;
+ }
+
+ @override
+ void visitConstructorFieldInitializer(ConstructorFieldInitializer node) {
+ if (identical(_childNode, node.expression)) {
+ _parser._inInitializer = true;
+ }
+ }
+
+ @override
+ void visitIndexExpression(IndexExpression node) {
+ if (identical(_childNode, node.index)) {
+ _parser._inInitializer = false;
+ }
+ }
+
+ @override
+ void visitInterpolationExpression(InterpolationExpression node) {
+ if (identical(_childNode, node.expression)) {
+ _parser._inInitializer = false;
+ }
+ }
+
+ @override
+ void visitListLiteral(ListLiteral node) {
+ if (node.elements.contains(_childNode)) {
+ _parser._inInitializer = false;
+ }
+ }
+
+ @override
+ void visitMapLiteral(MapLiteral node) {
+ if (node.entries.contains(_childNode)) {
+ _parser._inInitializer = false;
+ }
+ }
+
+ @override
+ void visitParenthesizedExpression(ParenthesizedExpression node) {
+ if (identical(_childNode, node.expression)) {
+ _parser._inInitializer = false;
+ }
+ }
+}
+
+/**
* Instances of the class `IncrementalParser` re-parse a single AST structure within a larger
* AST structure.
*/
@@ -2002,100 +2096,6 @@
}
/**
- * Visitor capable of inferring the correct parser state for incremental
- * parsing. This visitor visits each parent/child relationship in the chain of
- * ancestors of the node to be replaced (starting with the root of the parse
- * tree), updating the parser to the correct state for parsing the child of the
- * given parent. Once it has visited all of these relationships, the parser
- * will be in the correct state for reparsing the node to be replaced.
- *
- * TODO(paulberry): add support for other pieces of parser state (_inAsync,
- * _inGenerator, _inLoop, and _inSwitch). Note that _inLoop and _inSwitch only
- * affect error message generation.
- */
-class IncrementalParseStateBuilder extends SimpleAstVisitor {
- /**
- * The parser whose state should be built.
- */
- final Parser _parser;
-
- /**
- * The child node in the parent/child relationship currently being visited.
- * (The corresponding parent is the node passed to the visit...() function.)
- */
- AstNode _childNode;
-
- /**
- * Create an IncrementalParseStateBuilder which will build the correct state
- * for [_parser].
- */
- IncrementalParseStateBuilder(this._parser);
-
- /**
- * Build the correct parser state for parsing a replacement for [node].
- */
- void buildState(AstNode node) {
- List<AstNode> ancestors = <AstNode>[];
- while (node != null) {
- ancestors.add(node);
- node = node.parent;
- }
- _parser._inInitializer = false;
- for (int i = ancestors.length - 2; i >= 0; i--) {
- _childNode = ancestors[i];
- ancestors[i + 1].accept(this);
- }
- }
-
- @override
- void visitArgumentList(ArgumentList node) {
- _parser._inInitializer = false;
- }
-
- @override
- void visitConstructorFieldInitializer(ConstructorFieldInitializer node) {
- if (identical(_childNode, node.expression)) {
- _parser._inInitializer = true;
- }
- }
-
- @override
- void visitIndexExpression(IndexExpression node) {
- if (identical(_childNode, node.index)) {
- _parser._inInitializer = false;
- }
- }
-
- @override
- void visitInterpolationExpression(InterpolationExpression node) {
- if (identical(_childNode, node.expression)) {
- _parser._inInitializer = false;
- }
- }
-
- @override
- void visitListLiteral(ListLiteral node) {
- if (node.elements.contains(_childNode)) {
- _parser._inInitializer = false;
- }
- }
-
- @override
- void visitMapLiteral(MapLiteral node) {
- if (node.entries.contains(_childNode)) {
- _parser._inInitializer = false;
- }
- }
-
- @override
- void visitParenthesizedExpression(ParenthesizedExpression node) {
- if (identical(_childNode, node.expression)) {
- _parser._inInitializer = false;
- }
- }
-}
-
-/**
* Instances of the class `InsufficientContextException` represent a situation in which an AST
* node cannot be re-parsed because there is not enough context to know how to re-parse the node.
* Clients can attempt to re-parse the parent of the node.
@@ -2272,17 +2272,6 @@
bool _parseFunctionBodies = true;
/**
- * A flag indicating whether the parser is to parse deferred libraries.
- */
- bool _parseDeferredLibraries =
- AnalysisOptionsImpl.DEFAULT_ENABLE_DEFERRED_LOADING;
-
- /**
- * A flag indicating whether the parser is to parse enum declarations.
- */
- bool _parseEnum = AnalysisOptionsImpl.DEFAULT_ENABLE_ENUM;
-
- /**
* The next token to be parsed.
*/
Token _currentToken;
@@ -2327,16 +2316,6 @@
}
/**
- * Advance to the next token in the token stream, making it the new current
- * token and return the token that was current before this method was invoked.
- */
- Token getAndAdvance() {
- Token token = _currentToken;
- _advance();
- return token;
- }
-
- /**
* Return `true` if the current token is the first token of a return type that is followed
* by an identifier, possibly followed by a list of type parameters, followed by a
* left-parenthesis. This is used by parseTypeAlias to determine whether or not to parse a return
@@ -2354,12 +2333,21 @@
}
/**
+ * Set whether the parser is to parse the async support.
+ *
+ * @param parseAsync `true` if the parser is to parse the async support
+ */
+ void set parseAsync(bool parseAsync) {
+ // Async support cannot be disabled
+ }
+
+ /**
* Set whether the parser is to parse deferred libraries.
*
* @param parseDeferredLibraries `true` if the parser is to parse deferred libraries
*/
void set parseDeferredLibraries(bool parseDeferredLibraries) {
- this._parseDeferredLibraries = parseDeferredLibraries;
+ // Deferred libraries support cannot be disabled
}
/**
@@ -2368,7 +2356,7 @@
* @param parseEnum `true` if the parser is to parse enum declarations
*/
void set parseEnum(bool parseEnum) {
- this._parseEnum = parseEnum;
+ // Enum support cannot be disabled
}
/**
@@ -2381,6 +2369,16 @@
}
/**
+ * Advance to the next token in the token stream, making it the new current
+ * token and return the token that was current before this method was invoked.
+ */
+ Token getAndAdvance() {
+ Token token = _currentToken;
+ _advance();
+ return token;
+ }
+
+ /**
* Parse an annotation.
*
* <pre>
@@ -5528,7 +5526,7 @@
!_tokenMatches(_peek(), TokenType.OPEN_PAREN)) {
_validateModifiersForTypedef(modifiers);
return _parseTypeAlias(commentAndMetadata);
- } else if (_parseEnum && _matchesKeyword(Keyword.ENUM)) {
+ } else if (_matchesKeyword(Keyword.ENUM)) {
_validateModifiersForEnum(modifiers);
return _parseEnumDeclaration(commentAndMetadata);
}
@@ -5986,6 +5984,40 @@
}
/**
+ * Parse a do statement.
+ *
+ * <pre>
+ * doStatement ::=
+ * 'do' statement 'while' '(' expression ')' ';'
+ * </pre>
+ *
+ * @return the do statement that was parsed
+ */
+ Statement _parseDoStatement() {
+ bool wasInLoop = _inLoop;
+ _inLoop = true;
+ try {
+ Token doKeyword = _expectKeyword(Keyword.DO);
+ Statement body = parseStatement2();
+ Token whileKeyword = _expectKeyword(Keyword.WHILE);
+ Token leftParenthesis = _expect(TokenType.OPEN_PAREN);
+ Expression condition = parseExpression2();
+ Token rightParenthesis = _expect(TokenType.CLOSE_PAREN);
+ Token semicolon = _expect(TokenType.SEMICOLON);
+ return new DoStatement(
+ doKeyword,
+ body,
+ whileKeyword,
+ leftParenthesis,
+ condition,
+ rightParenthesis,
+ semicolon);
+ } finally {
+ _inLoop = wasInLoop;
+ }
+ }
+
+ /**
* Parse a documentation comment.
*
* <pre>
@@ -6027,40 +6059,6 @@
}
/**
- * Parse a do statement.
- *
- * <pre>
- * doStatement ::=
- * 'do' statement 'while' '(' expression ')' ';'
- * </pre>
- *
- * @return the do statement that was parsed
- */
- Statement _parseDoStatement() {
- bool wasInLoop = _inLoop;
- _inLoop = true;
- try {
- Token doKeyword = _expectKeyword(Keyword.DO);
- Statement body = parseStatement2();
- Token whileKeyword = _expectKeyword(Keyword.WHILE);
- Token leftParenthesis = _expect(TokenType.OPEN_PAREN);
- Expression condition = parseExpression2();
- Token rightParenthesis = _expect(TokenType.CLOSE_PAREN);
- Token semicolon = _expect(TokenType.SEMICOLON);
- return new DoStatement(
- doKeyword,
- body,
- whileKeyword,
- leftParenthesis,
- condition,
- rightParenthesis,
- semicolon);
- } finally {
- _inLoop = wasInLoop;
- }
- }
-
- /**
* Parse an empty statement.
*
* <pre>
@@ -6252,64 +6250,6 @@
}
/**
- * Parse a formal parameter. At most one of `isOptional` and `isNamed` can be
- * `true`.
- *
- * <pre>
- * defaultFormalParameter ::=
- * normalFormalParameter ('=' expression)?
- *
- * defaultNamedParameter ::=
- * normalFormalParameter (':' expression)?
- * </pre>
- *
- * @param kind the kind of parameter being expected based on the presence or absence of group
- * delimiters
- * @return the formal parameter that was parsed
- */
- FormalParameter _parseFormalParameter(ParameterKind kind) {
- NormalFormalParameter parameter = parseNormalFormalParameter();
- if (_matches(TokenType.EQ)) {
- Token seperator = getAndAdvance();
- Expression defaultValue = parseExpression2();
- if (kind == ParameterKind.NAMED) {
- _reportErrorForToken(
- ParserErrorCode.WRONG_SEPARATOR_FOR_NAMED_PARAMETER,
- seperator);
- } else if (kind == ParameterKind.REQUIRED) {
- _reportErrorForNode(
- ParserErrorCode.POSITIONAL_PARAMETER_OUTSIDE_GROUP,
- parameter);
- }
- return new DefaultFormalParameter(
- parameter,
- kind,
- seperator,
- defaultValue);
- } else if (_matches(TokenType.COLON)) {
- Token seperator = getAndAdvance();
- Expression defaultValue = parseExpression2();
- if (kind == ParameterKind.POSITIONAL) {
- _reportErrorForToken(
- ParserErrorCode.WRONG_SEPARATOR_FOR_POSITIONAL_PARAMETER,
- seperator);
- } else if (kind == ParameterKind.REQUIRED) {
- _reportErrorForNode(
- ParserErrorCode.NAMED_PARAMETER_OUTSIDE_GROUP,
- parameter);
- }
- return new DefaultFormalParameter(
- parameter,
- kind,
- seperator,
- defaultValue);
- } else if (kind != ParameterKind.REQUIRED) {
- return new DefaultFormalParameter(parameter, kind, null, null);
- }
- return parameter;
- }
-
- /**
* Parse a for statement.
*
* <pre>
@@ -6461,6 +6401,64 @@
}
/**
+ * Parse a formal parameter. At most one of `isOptional` and `isNamed` can be
+ * `true`.
+ *
+ * <pre>
+ * defaultFormalParameter ::=
+ * normalFormalParameter ('=' expression)?
+ *
+ * defaultNamedParameter ::=
+ * normalFormalParameter (':' expression)?
+ * </pre>
+ *
+ * @param kind the kind of parameter being expected based on the presence or absence of group
+ * delimiters
+ * @return the formal parameter that was parsed
+ */
+ FormalParameter _parseFormalParameter(ParameterKind kind) {
+ NormalFormalParameter parameter = parseNormalFormalParameter();
+ if (_matches(TokenType.EQ)) {
+ Token seperator = getAndAdvance();
+ Expression defaultValue = parseExpression2();
+ if (kind == ParameterKind.NAMED) {
+ _reportErrorForToken(
+ ParserErrorCode.WRONG_SEPARATOR_FOR_NAMED_PARAMETER,
+ seperator);
+ } else if (kind == ParameterKind.REQUIRED) {
+ _reportErrorForNode(
+ ParserErrorCode.POSITIONAL_PARAMETER_OUTSIDE_GROUP,
+ parameter);
+ }
+ return new DefaultFormalParameter(
+ parameter,
+ kind,
+ seperator,
+ defaultValue);
+ } else if (_matches(TokenType.COLON)) {
+ Token seperator = getAndAdvance();
+ Expression defaultValue = parseExpression2();
+ if (kind == ParameterKind.POSITIONAL) {
+ _reportErrorForToken(
+ ParserErrorCode.WRONG_SEPARATOR_FOR_POSITIONAL_PARAMETER,
+ seperator);
+ } else if (kind == ParameterKind.REQUIRED) {
+ _reportErrorForNode(
+ ParserErrorCode.NAMED_PARAMETER_OUTSIDE_GROUP,
+ parameter);
+ }
+ return new DefaultFormalParameter(
+ parameter,
+ kind,
+ seperator,
+ defaultValue);
+ } else if (kind != ParameterKind.REQUIRED) {
+ return new DefaultFormalParameter(parameter, kind, null, null);
+ }
+ return parameter;
+ }
+
+ /**
* Parse a function body.
*
* <pre>
@@ -6895,13 +6893,7 @@
Token asToken = null;
SimpleIdentifier prefix = null;
if (_matchesKeyword(Keyword.DEFERRED)) {
- if (_parseDeferredLibraries) {
- deferredToken = getAndAdvance();
- } else {
- _reportErrorForCurrentToken(
- ParserErrorCode.DEFERRED_IMPORTS_NOT_SUPPORTED);
- _advance();
- }
+ deferredToken = getAndAdvance();
}
if (_matchesKeyword(Keyword.AS)) {
asToken = getAndAdvance();
@@ -9984,27 +9976,6 @@
}
}
/**
- * Instances of the class `SyntheticKeywordToken` implement a synthetic keyword token.
- */
-class Parser_SyntheticKeywordToken extends KeywordToken {
- /**
- * Initialize a newly created token to represent the given keyword.
- *
- * @param keyword the keyword being represented by this token
- * @param offset the offset from the beginning of the file to the first character in the token
- */
- Parser_SyntheticKeywordToken(Keyword keyword, int offset)
- : super(keyword, offset);
-
- @override
- int get length => 0;
-
- @override
- Token copy() => new Parser_SyntheticKeywordToken(keyword, offset);
-}
-
-
-/**
* The enumeration `ParserErrorCode` defines the error codes used for errors
* detected by the parser. The convention for this class is for the name of the
* error code to indicate the problem that caused the error to be generated and
@@ -10116,11 +10087,6 @@
'CONTINUE_WITHOUT_LABEL_IN_CASE',
"A continue statement in a switch statement must have a label as a target");
- static const ParserErrorCode DEFERRED_IMPORTS_NOT_SUPPORTED =
- const ParserErrorCode(
- 'DEFERRED_IMPORTS_NOT_SUPPORTED',
- "Deferred imports are not supported by default");
-
static const ParserErrorCode DEPRECATED_CLASS_TYPE_ALIAS =
const ParserErrorCode(
'DEPRECATED_CLASS_TYPE_ALIAS',
@@ -10712,6 +10678,27 @@
/**
+ * Instances of the class `SyntheticKeywordToken` implement a synthetic keyword token.
+ */
+class Parser_SyntheticKeywordToken extends KeywordToken {
+ /**
+ * Initialize a newly created token to represent the given keyword.
+ *
+ * @param keyword the keyword being represented by this token
+ * @param offset the offset from the beginning of the file to the first character in the token
+ */
+ Parser_SyntheticKeywordToken(Keyword keyword, int offset)
+ : super(keyword, offset);
+
+ @override
+ int get length => 0;
+
+ @override
+ Token copy() => new Parser_SyntheticKeywordToken(keyword, offset);
+}
+
+
+/**
* Instances of the class `ResolutionCopier` copies resolution information from one AST
* structure to another as long as the structures of the corresponding children of a pair of nodes
* are the same.
@@ -11188,17 +11175,6 @@
}
@override
- bool visitFormalParameterList(FormalParameterList node) {
- FormalParameterList toNode = this._toNode as FormalParameterList;
- return _and(
- _isEqualTokens(node.leftParenthesis, toNode.leftParenthesis),
- _isEqualNodeLists(node.parameters, toNode.parameters),
- _isEqualTokens(node.leftDelimiter, toNode.leftDelimiter),
- _isEqualTokens(node.rightDelimiter, toNode.rightDelimiter),
- _isEqualTokens(node.rightParenthesis, toNode.rightParenthesis));
- }
-
- @override
bool visitForStatement(ForStatement node) {
ForStatement toNode = this._toNode as ForStatement;
return _and(
@@ -11215,6 +11191,17 @@
}
@override
+ bool visitFormalParameterList(FormalParameterList node) {
+ FormalParameterList toNode = this._toNode as FormalParameterList;
+ return _and(
+ _isEqualTokens(node.leftParenthesis, toNode.leftParenthesis),
+ _isEqualNodeLists(node.parameters, toNode.parameters),
+ _isEqualTokens(node.leftDelimiter, toNode.leftDelimiter),
+ _isEqualTokens(node.rightDelimiter, toNode.rightDelimiter),
+ _isEqualTokens(node.rightParenthesis, toNode.rightParenthesis));
+ }
+
+ @override
bool visitFunctionDeclaration(FunctionDeclaration node) {
FunctionDeclaration toNode = this._toNode as FunctionDeclaration;
return _and(
@@ -11628,20 +11615,6 @@
}
@override
- bool visitPrefixedIdentifier(PrefixedIdentifier node) {
- PrefixedIdentifier toNode = this._toNode as PrefixedIdentifier;
- if (_and(
- _isEqualNodes(node.prefix, toNode.prefix),
- _isEqualTokens(node.period, toNode.period),
- _isEqualNodes(node.identifier, toNode.identifier))) {
- toNode.propagatedType = node.propagatedType;
- toNode.staticType = node.staticType;
- return true;
- }
- return false;
- }
-
- @override
bool visitPrefixExpression(PrefixExpression node) {
PrefixExpression toNode = this._toNode as PrefixExpression;
if (_and(
@@ -11657,6 +11630,20 @@
}
@override
+ bool visitPrefixedIdentifier(PrefixedIdentifier node) {
+ PrefixedIdentifier toNode = this._toNode as PrefixedIdentifier;
+ if (_and(
+ _isEqualNodes(node.prefix, toNode.prefix),
+ _isEqualTokens(node.period, toNode.period),
+ _isEqualNodes(node.identifier, toNode.identifier))) {
+ toNode.propagatedType = node.propagatedType;
+ toNode.staticType = node.staticType;
+ return true;
+ }
+ return false;
+ }
+
+ @override
bool visitPropertyAccess(PropertyAccess node) {
PropertyAccess toNode = this._toNode as PropertyAccess;
if (_and(
diff --git a/pkg/analyzer/lib/src/generated/resolver.dart b/pkg/analyzer/lib/src/generated/resolver.dart
index 952323d..77daa8d 100644
--- a/pkg/analyzer/lib/src/generated/resolver.dart
+++ b/pkg/analyzer/lib/src/generated/resolver.dart
@@ -39,676 +39,6 @@
typedef void VoidFunction();
/**
- * Instances of the class `AngularCompilationUnitBuilder` build an Angular specific element
- * model for a single compilation unit.
- */
-class AngularCompilationUnitBuilder {
- static String _NG_COMPONENT = "Component";
-
- static String _NG_CONTROLLER = "Controller";
-
- static String _NG_DECORATOR = "Decorator";
-
- static String _NG_FORMATTER = "Formatter";
-
- static String _NAME = "name";
-
- static String _SELECTOR = "selector";
-
- static String _PUBLISH_AS = "publishAs";
-
- static String _TEMPLATE_URL = "templateUrl";
-
- static String _CSS_URL = "cssUrl";
-
- static String _NG_ATTR = "NgAttr";
-
- static String _NG_CALLBACK = "NgCallback";
-
- static String _NG_ONE_WAY = "NgOneWay";
-
- static String _NG_ONE_WAY_ONE_TIME = "NgOneWayOneTime";
-
- static String _NG_TWO_WAY = "NgTwoWay";
-
- /**
- * The listener to which errors will be reported.
- */
- final AnalysisErrorListener _errorListener;
-
- /**
- * The source containing the unit that will be analyzed.
- */
- final Source _source;
-
- /**
- * The compilation unit with built Dart element models.
- */
- final CompilationUnit _unit;
-
- /**
- * The [ClassDeclaration] that is currently being analyzed.
- */
- ClassDeclaration _classDeclaration;
-
- /**
- * The [ClassElementImpl] that is currently being analyzed.
- */
- ClassElementImpl _classElement;
-
- /**
- * The [Annotation] that is currently being analyzed.
- */
- Annotation _annotation;
-
- /**
- * Initialize a newly created compilation unit element builder.
- *
- * @param errorListener the listener to which errors will be reported.
- * @param source the source containing the unit that will be analyzed
- * @param unit the compilation unit with built Dart element models
- */
- AngularCompilationUnitBuilder(this._errorListener, this._source, this._unit);
-
- /**
- * Builds Angular specific element models and adds them to the existing Dart elements.
- */
- void build() {
- _parseViews();
- // process classes
- for (CompilationUnitMember unitMember in _unit.declarations) {
- if (unitMember is ClassDeclaration) {
- this._classDeclaration = unitMember;
- this._classElement = _classDeclaration.element as ClassElementImpl;
- // process annotations
- NodeList<Annotation> annotations = _classDeclaration.metadata;
- for (Annotation annotation in annotations) {
- // verify annotation
- if (annotation.arguments == null) {
- continue;
- }
- this._annotation = annotation;
- // @Formatter
- if (_isAngularAnnotation(annotation, _NG_FORMATTER)) {
- _parseFormatter();
- continue;
- }
- // @Component
- if (_isAngularAnnotation(annotation, _NG_COMPONENT)) {
- _parseComponent();
- continue;
- }
- // @Controller
- if (_isAngularAnnotation(annotation, _NG_CONTROLLER)) {
- _parseController();
- continue;
- }
- // @Decorator
- if (_isAngularAnnotation(annotation, _NG_DECORATOR)) {
- _parseDecorator();
- continue;
- }
- }
- }
- }
- }
-
- /**
- * @return the argument [Expression] with given name form [annotation], may be
- * `null` if not found.
- */
- Expression _getArgument(String name) {
- List<Expression> arguments = _annotation.arguments.arguments;
- for (Expression argument in arguments) {
- if (argument is NamedExpression) {
- NamedExpression namedExpression = argument;
- String argumentName = namedExpression.name.label.name;
- if (name == argumentName) {
- return namedExpression.expression;
- }
- }
- }
- return null;
- }
-
- /**
- * @return the [String] value of the named argument.
- */
- String _getStringArgument(String name) => _getStringLiteral(name).value;
-
- /**
- * @return the offset of the value of the named argument.
- */
- int _getStringArgumentOffset(String name) {
- Expression argument = _getArgument(name);
- return (argument as SimpleStringLiteral).contentsOffset;
- }
-
- /**
- * @return the [SimpleStringLiteral] of the named argument.
- */
- SimpleStringLiteral _getStringLiteral(String name) {
- Expression argument = _getArgument(name);
- return argument as SimpleStringLiteral;
- }
-
- /**
- * Checks if [namedArguments] has string value for the argument with the given name.
- */
- bool _hasStringArgument(String name) {
- Expression argument = _getArgument(name);
- return argument is SimpleStringLiteral;
- }
-
- /**
- * Checks if given [Annotation] is an annotation with required name.
- */
- bool _isAngularAnnotation(Annotation annotation, String name) {
- Element element = annotation.element;
- if (element is ConstructorElement) {
- ConstructorElement constructorElement = element;
- if (constructorElement.returnType.displayName != name) {
- return false;
- }
- return _isAngularLibraryElement(constructorElement);
- }
- return false;
- }
-
- /**
- * Checks if the given [Element] is a part of the Angular library.
- */
- bool _isAngularLibraryElement(Element element) {
- LibraryElement library = element.library;
- return library != null &&
- library.name != null &&
- library.name.startsWith("angular");
- }
-
- void _parseComponent() {
- bool isValid = true;
- // publishAs
- String name = null;
- int nameOffset = -1;
- if (_hasStringArgument(_PUBLISH_AS)) {
- name = _getStringArgument(_PUBLISH_AS);
- nameOffset = _getStringArgumentOffset(_PUBLISH_AS);
- }
- // selector
- AngularSelectorElement selector = null;
- if (!_hasStringArgument(_SELECTOR)) {
- _reportErrorForAnnotation(AngularCode.MISSING_SELECTOR);
- isValid = false;
- } else {
- SimpleStringLiteral selectorLiteral = _getStringLiteral(_SELECTOR);
- selector = _parseSelectorFromString(selectorLiteral);
- if (selector == null) {
- _reportErrorForArgument(
- _SELECTOR,
- AngularCode.CANNOT_PARSE_SELECTOR,
- [selectorLiteral]);
- isValid = false;
- }
- }
- // templateUrl
- String templateUri = null;
- int templateUriOffset = -1;
- if (_hasStringArgument(_TEMPLATE_URL)) {
- templateUri = _getStringArgument(_TEMPLATE_URL);
- templateUriOffset = _getStringArgumentOffset(_TEMPLATE_URL);
- }
- // cssUrl
- String styleUri = null;
- int styleUriOffset = -1;
- if (_hasStringArgument(_CSS_URL)) {
- styleUri = _getStringArgument(_CSS_URL);
- styleUriOffset = _getStringArgumentOffset(_CSS_URL);
- }
- // create
- if (isValid) {
- AngularComponentElementImpl element =
- new AngularComponentElementImpl(name, nameOffset, _annotation.offset);
- element.selector = selector;
- element.templateUri = templateUri;
- element.templateUriOffset = templateUriOffset;
- element.styleUri = styleUri;
- element.styleUriOffset = styleUriOffset;
- element.properties = _parseComponentProperties();
- element.scopeProperties = _parseScopeProperties();
- _classElement.addToolkitObjects(element);
- }
- }
-
- /**
- * Parses [AngularPropertyElement]s from [annotation] and [classDeclaration].
- */
- List<AngularPropertyElement> _parseComponentProperties() {
- List<AngularPropertyElement> properties = <AngularPropertyElement>[];
- _parseComponentProperties_fromMap(properties);
- _parseComponentProperties_fromFields(properties);
- return properties;
- }
-
- /**
- * Parses [AngularPropertyElement]s from [annotation].
- */
- void
- _parseComponentProperties_fromFields(List<AngularPropertyElement> properties) {
- NodeList<ClassMember> members = _classDeclaration.members;
- for (ClassMember member in members) {
- if (member is FieldDeclaration) {
- FieldDeclaration fieldDeclaration = member;
- for (Annotation annotation in fieldDeclaration.metadata) {
- // prepare property kind (if property annotation at all)
- AngularPropertyKind kind = null;
- if (_isAngularAnnotation(annotation, _NG_ATTR)) {
- kind = AngularPropertyKind.ATTR;
- } else if (_isAngularAnnotation(annotation, _NG_CALLBACK)) {
- kind = AngularPropertyKind.CALLBACK;
- } else if (_isAngularAnnotation(annotation, _NG_ONE_WAY)) {
- kind = AngularPropertyKind.ONE_WAY;
- } else if (_isAngularAnnotation(annotation, _NG_ONE_WAY_ONE_TIME)) {
- kind = AngularPropertyKind.ONE_WAY_ONE_TIME;
- } else if (_isAngularAnnotation(annotation, _NG_TWO_WAY)) {
- kind = AngularPropertyKind.TWO_WAY;
- }
- // add property
- if (kind != null) {
- SimpleStringLiteral nameLiteral =
- _getOnlySimpleStringLiteralArgument(annotation);
- FieldElement field = _getOnlyFieldElement(fieldDeclaration);
- if (nameLiteral != null && field != null) {
- AngularPropertyElementImpl property =
- new AngularPropertyElementImpl(nameLiteral.value, nameLiteral.contentsOffset);
- property.field = field;
- property.propertyKind = kind;
- properties.add(property);
- }
- }
- }
- }
- }
- }
-
- /**
- * Parses [AngularPropertyElement]s from [annotation].
- */
- void
- _parseComponentProperties_fromMap(List<AngularPropertyElement> properties) {
- Expression mapExpression = _getArgument("map");
- // may be not properties
- if (mapExpression == null) {
- return;
- }
- // prepare map literal
- if (mapExpression is! MapLiteral) {
- _reportErrorForNode(AngularCode.INVALID_PROPERTY_MAP, mapExpression);
- return;
- }
- MapLiteral mapLiteral = mapExpression as MapLiteral;
- // analyze map entries
- for (MapLiteralEntry entry in mapLiteral.entries) {
- // prepare property name
- Expression nameExpression = entry.key;
- if (nameExpression is! SimpleStringLiteral) {
- _reportErrorForNode(AngularCode.INVALID_PROPERTY_NAME, nameExpression);
- continue;
- }
- SimpleStringLiteral nameLiteral = nameExpression as SimpleStringLiteral;
- String name = nameLiteral.value;
- int nameOffset = nameLiteral.contentsOffset;
- // prepare field specification
- Expression specExpression = entry.value;
- if (specExpression is! SimpleStringLiteral) {
- _reportErrorForNode(AngularCode.INVALID_PROPERTY_SPEC, specExpression);
- continue;
- }
- SimpleStringLiteral specLiteral = specExpression as SimpleStringLiteral;
- String spec = specLiteral.value;
- // parse binding kind and field name
- AngularPropertyKind kind;
- int fieldNameOffset;
- if (StringUtilities.startsWithChar(spec, 0x40)) {
- kind = AngularPropertyKind.ATTR;
- fieldNameOffset = 1;
- } else if (StringUtilities.startsWithChar(spec, 0x26)) {
- kind = AngularPropertyKind.CALLBACK;
- fieldNameOffset = 1;
- } else if (StringUtilities.startsWith3(spec, 0, 0x3D, 0x3E, 0x21)) {
- kind = AngularPropertyKind.ONE_WAY_ONE_TIME;
- fieldNameOffset = 3;
- } else if (StringUtilities.startsWith2(spec, 0, 0x3D, 0x3E)) {
- kind = AngularPropertyKind.ONE_WAY;
- fieldNameOffset = 2;
- } else if (StringUtilities.startsWith3(spec, 0, 0x3C, 0x3D, 0x3E)) {
- kind = AngularPropertyKind.TWO_WAY;
- fieldNameOffset = 3;
- } else {
- _reportErrorForNode(
- AngularCode.INVALID_PROPERTY_KIND,
- specLiteral,
- [spec]);
- continue;
- }
- String fieldName = spec.substring(fieldNameOffset);
- fieldNameOffset += specLiteral.contentsOffset;
- // prepare field
- PropertyAccessorElement setter =
- _classElement.type.lookUpSetter(fieldName, _classElement.library);
- if (setter == null) {
- _reportErrorForOffset(
- AngularCode.INVALID_PROPERTY_FIELD,
- fieldNameOffset,
- fieldName.length,
- [fieldName]);
- continue;
- }
- FieldElement field = setter.variable as FieldElement;
- // add property
- AngularPropertyElementImpl property =
- new AngularPropertyElementImpl(name, nameOffset);
- property.field = field;
- property.propertyKind = kind;
- property.fieldNameOffset = fieldNameOffset;
- properties.add(property);
- }
- }
-
- void _parseController() {
- bool isValid = true;
- // publishAs
- if (!_hasStringArgument(_PUBLISH_AS)) {
- _reportErrorForAnnotation(AngularCode.MISSING_PUBLISH_AS);
- isValid = false;
- }
- // selector
- AngularSelectorElement selector = null;
- if (!_hasStringArgument(_SELECTOR)) {
- _reportErrorForAnnotation(AngularCode.MISSING_SELECTOR);
- isValid = false;
- } else {
- SimpleStringLiteral selectorLiteral = _getStringLiteral(_SELECTOR);
- selector = _parseSelectorFromString(selectorLiteral);
- if (selector == null) {
- _reportErrorForArgument(
- _SELECTOR,
- AngularCode.CANNOT_PARSE_SELECTOR,
- [selectorLiteral]);
- isValid = false;
- }
- }
- // create
- if (isValid) {
- String name = _getStringArgument(_PUBLISH_AS);
- int nameOffset = _getStringArgumentOffset(_PUBLISH_AS);
- AngularControllerElementImpl element =
- new AngularControllerElementImpl(name, nameOffset);
- element.selector = selector;
- _classElement.addToolkitObjects(element);
- }
- }
-
- void _parseDecorator() {
- bool isValid = true;
- // selector
- AngularSelectorElement selector = null;
- if (!_hasStringArgument(_SELECTOR)) {
- _reportErrorForAnnotation(AngularCode.MISSING_SELECTOR);
- isValid = false;
- } else {
- SimpleStringLiteral selectorLiteral = _getStringLiteral(_SELECTOR);
- selector = _parseSelectorFromString(selectorLiteral);
- if (selector == null) {
- _reportErrorForArgument(
- _SELECTOR,
- AngularCode.CANNOT_PARSE_SELECTOR,
- [selectorLiteral]);
- isValid = false;
- }
- }
- // create
- if (isValid) {
- int offset = _annotation.offset;
- AngularDecoratorElementImpl element =
- new AngularDecoratorElementImpl(offset);
- element.selector = selector;
- element.properties = _parseComponentProperties();
- _classElement.addToolkitObjects(element);
- }
- }
-
- void _parseFormatter() {
- bool isValid = true;
- // name
- if (!_hasStringArgument(_NAME)) {
- _reportErrorForAnnotation(AngularCode.MISSING_NAME);
- isValid = false;
- }
- // create
- if (isValid) {
- String name = _getStringArgument(_NAME);
- int nameOffset = _getStringArgumentOffset(_NAME);
- _classElement.addToolkitObjects(
- new AngularFormatterElementImpl(name, nameOffset));
- }
- }
-
- List<AngularScopePropertyElement> _parseScopeProperties() {
- List<AngularScopePropertyElement> properties =
- <AngularScopePropertyElement>[
- ];
- _classDeclaration.accept(
- new _AngularCompilationUnitBuilder_parseScopeProperties(properties));
- return properties;
- }
-
- /**
- * Create [AngularViewElement] for each valid <code>view('template.html')</code> invocation,
- * where <code>view</code> is <code>ViewFactory</code>.
- */
- void _parseViews() {
- List<AngularViewElement> views = <AngularViewElement>[];
- _unit.accept(
- new RecursiveAstVisitor_AngularCompilationUnitBuilder_parseViews(views));
- if (!views.isEmpty) {
- List<AngularViewElement> viewArray = views;
- (_unit.element as CompilationUnitElementImpl).angularViews = viewArray;
- }
- }
-
- void _reportErrorForAnnotation(ErrorCode errorCode,
- [List<Object> arguments]) {
- _reportErrorForNode(errorCode, _annotation, arguments);
- }
-
- void _reportErrorForArgument(String argumentName, ErrorCode errorCode,
- [List<Object> arguments]) {
- Expression argument = _getArgument(argumentName);
- _reportErrorForNode(errorCode, argument, arguments);
- }
-
- void _reportErrorForNode(ErrorCode errorCode, AstNode node,
- [List<Object> arguments]) {
- int offset = node.offset;
- int length = node.length;
- _reportErrorForOffset(errorCode, offset, length, arguments);
- }
-
- void _reportErrorForOffset(ErrorCode errorCode, int offset, int length,
- [List<Object> arguments]) {
- _errorListener.onError(
- new AnalysisError.con2(_source, offset, length, errorCode, arguments));
- }
-
- static Element getElement(AstNode node, int offset) {
- // maybe node is not SimpleStringLiteral
- if (node is! SimpleStringLiteral) {
- return null;
- }
- SimpleStringLiteral literal = node as SimpleStringLiteral;
- // maybe has AngularElement
- {
- Element element = literal.toolkitElement;
- if (element is AngularElement) {
- return element;
- }
- }
- // prepare enclosing ClassDeclaration
- ClassDeclaration classDeclaration =
- node.getAncestor((node) => node is ClassDeclaration);
- if (classDeclaration == null) {
- return null;
- }
- // prepare ClassElement
- ClassElement classElement = classDeclaration.element;
- if (classElement == null) {
- return null;
- }
- // check toolkit objects
- for (ToolkitObjectElement toolkitObject in classElement.toolkitObjects) {
- List<AngularPropertyElement> properties =
- AngularPropertyElement.EMPTY_ARRAY;
- // maybe name
- if (toolkitObject is AngularElement) {
- if (_isNameCoveredByLiteral(toolkitObject, node)) {
- return toolkitObject;
- }
- }
- // try selector
- if (toolkitObject is AngularHasSelectorElement) {
- AngularHasSelectorElement hasSelector = toolkitObject;
- AngularSelectorElement selector = hasSelector.selector;
- if (_isNameCoveredByLiteral(selector, node)) {
- return selector;
- }
- }
- // try properties of AngularComponentElement
- if (toolkitObject is AngularComponentElement) {
- AngularComponentElement component = toolkitObject;
- properties = component.properties;
- }
- // try properties of AngularDirectiveElement
- if (toolkitObject is AngularDecoratorElement) {
- AngularDecoratorElement directive = toolkitObject;
- properties = directive.properties;
- }
- // check properties
- for (AngularPropertyElement property in properties) {
- // property name (use complete node range)
- if (_isNameCoveredByLiteral(property, node)) {
- return property;
- }
- // field name (use complete node range, including @, => and <=>)
- FieldElement field = property.field;
- if (field != null) {
- int fieldOffset = property.fieldNameOffset;
- int fieldEnd = fieldOffset + field.name.length;
- if (node.offset <= fieldOffset && fieldEnd < node.end) {
- return field;
- }
- }
- }
- }
- // no Element
- return null;
- }
-
- /**
- * Parses given selector text and returns [AngularSelectorElement]. May be `null` if
- * cannot parse.
- */
- static AngularSelectorElement parseSelector(int offset, String text) {
- // [attribute]
- if (StringUtilities.startsWithChar(text, 0x5B) &&
- StringUtilities.endsWithChar(text, 0x5D)) {
- int nameOffset = offset + 1;
- String attributeName = text.substring(1, text.length - 1);
- // TODO(scheglov) report warning if there are spaces between
- // [ and identifier
- return new HasAttributeSelectorElementImpl(attributeName, nameOffset);
- }
- // .class
- if (StringUtilities.startsWithChar(text, 0x2E)) {
- int nameOffset = offset + 1;
- String className = text.substring(1, text.length);
- return new AngularHasClassSelectorElementImpl(className, nameOffset);
- }
- // tag[attribute]
- if (StringUtilities.endsWithChar(text, 0x5D)) {
- int index = StringUtilities.indexOf1(text, 0, 0x5B);
- if (index != -1) {
- String tagName = text.substring(0, index);
- String attributeName = text.substring(index + 1, text.length - 1);
- if (StringUtilities.isTagName(tagName)) {
- return new IsTagHasAttributeSelectorElementImpl(
- tagName,
- attributeName);
- }
- }
- }
- // tag
- if (StringUtilities.isTagName(text)) {
- return new AngularTagSelectorElementImpl(text, offset);
- }
- return null;
- }
-
- /**
- * Returns the [FieldElement] of the first field in the given [FieldDeclaration].
- */
- static FieldElement _getOnlyFieldElement(FieldDeclaration fieldDeclaration) {
- NodeList<VariableDeclaration> fields = fieldDeclaration.fields.variables;
- return fields[0].element as FieldElement;
- }
-
- /**
- * If given [Annotation] has one argument and it is [SimpleStringLiteral], returns it,
- * otherwise returns `null`.
- */
- static SimpleStringLiteral
- _getOnlySimpleStringLiteralArgument(Annotation annotation) {
- SimpleStringLiteral nameLiteral = null;
- ArgumentList argsNode = annotation.arguments;
- if (argsNode != null) {
- NodeList<Expression> args = argsNode.arguments;
- if (args.length == 1) {
- Expression arg = args[0];
- if (arg is SimpleStringLiteral) {
- nameLiteral = arg;
- }
- }
- }
- return nameLiteral;
- }
-
- /**
- * Checks if the name range of the given [Element] is completely covered by the given
- * [SimpleStringLiteral].
- */
- static bool _isNameCoveredByLiteral(Element element, AstNode node) {
- if (element != null) {
- String name = element.name;
- if (name != null) {
- int nameOffset = element.nameOffset;
- int nameEnd = nameOffset + name.length;
- return node.offset <= nameOffset && nameEnd < node.end;
- }
- }
- return false;
- }
-
- /**
- * Parses given [SimpleStringLiteral] using [parseSelector].
- */
- static AngularSelectorElement
- _parseSelectorFromString(SimpleStringLiteral literal) {
- int offset = literal.contentsOffset;
- String text = literal.stringValue;
- return parseSelector(offset, text);
- }
-}
-
-/**
* Instances of the class `BestPracticesVerifier` traverse an AST structure looking for
* violations of Dart best practices.
*/
@@ -1299,7 +629,8 @@
// TODO(jwren) After dartbug.com/13732, revisit this, we should be able to
// remove the (x is! TypeParameterType) checks.
AstNode parent = node.parent;
- if (parent is ConditionalExpression && (node == parent.thenExpression || node == parent.elseExpression)) {
+ if (parent is ConditionalExpression &&
+ (node == parent.thenExpression || node == parent.elseExpression)) {
Expression thenExpression = parent.thenExpression;
DartType thenType;
if (thenExpression is AsExpression) {
@@ -5138,6 +4469,55 @@
}
}
+
+/// Traverses a library's worth of dart code at a time to generate lint warnings
+/// over the set of sources.
+///
+/// See [LintCode].
+class LintGenerator {
+
+ /// A global container for contributed verifiers.
+ static final List<LintVerifier> VERIFIERS = <LintVerifier>[];
+
+ final Iterable<CompilationUnit> _compilationUnits;
+ final AnalysisErrorListener _errorListener;
+ final Iterable<LintVerifier> _verifiers;
+
+ LintGenerator(this._compilationUnits, this._errorListener,
+ [Iterable<LintVerifier> verifiers])
+ : _verifiers = verifiers != null ? verifiers : VERIFIERS;
+
+ void generate() {
+ TimeCounter_TimeCounterHandle timeCounter =
+ PerformanceStatistics.lint.start();
+ try {
+ _compilationUnits.forEach((cu) {
+ if (cu.element != null) {
+ _generate(cu, cu.element.source);
+ }
+ });
+ } finally {
+ timeCounter.stop();
+ }
+ }
+
+ void _generate(CompilationUnit unit, Source source) {
+ ErrorReporter errorReporter = new ErrorReporter(_errorListener, source);
+ _verifiers.forEach((verifier) {
+ verifier.reporter = errorReporter;
+ return unit.accept(verifier);
+ });
+ }
+}
+
+/// Implementers contribute lint warnings via the provided error [reporter].
+abstract class LintVerifier extends RecursiveAstVisitor<Object> {
+ /// Used to report lint warnings.
+ /// NOTE: this is set by the framework before visit begins.
+ ErrorReporter reporter;
+}
+
+
/**
* Instances of the class {@code HtmlTagInfo} record information about the tags used in an HTML
* file.
@@ -7913,13 +7293,13 @@
}
/**
- * Build the library element for the given library.
+ * Build the library element for the given library. The resulting element is
+ * stored in the [ResolvableLibrary] structure.
*
* @param library the library for which an element model is to be built
- * @return the library element that was built
* @throws AnalysisException if the analysis could not be performed
*/
- LibraryElementImpl buildLibrary2(ResolvableLibrary library) {
+ void buildLibrary2(ResolvableLibrary library) {
CompilationUnitBuilder builder = new CompilationUnitBuilder();
Source librarySource = library.librarySource;
CompilationUnit definingCompilationUnit = library.definingCompilationUnit;
@@ -8021,7 +7401,6 @@
if (sourcedUnitCount > 0) {
_patchTopLevelAccessors(libraryElement);
}
- return libraryElement;
}
/**
@@ -9180,26 +8559,6 @@
} finally {
timeCounter.stop();
}
- // Angular
- timeCounter = PerformanceStatistics.angular.start();
- try {
- for (Source source in library.compilationUnitSources) {
- CompilationUnit ast = library.getAST(source);
- new AngularCompilationUnitBuilder(_errorListener, source, ast).build();
- }
- } finally {
- timeCounter.stop();
- }
- // Polymer
- timeCounter = PerformanceStatistics.polymer.start();
- try {
- for (Source source in library.compilationUnitSources) {
- CompilationUnit ast = library.getAST(source);
- new PolymerCompilationUnitBuilder(ast).build();
- }
- } finally {
- timeCounter.stop();
- }
}
/**
@@ -9528,8 +8887,7 @@
for (ResolvableLibrary library in _librariesInCycle) {
LibraryElementBuilder builder =
new LibraryElementBuilder(analysisContext, errorListener);
- LibraryElementImpl libraryElement = builder.buildLibrary2(library);
- library.libraryElement = libraryElement;
+ builder.buildLibrary2(library);
}
}
@@ -9753,28 +9111,6 @@
} finally {
timeCounter.stop();
}
- // Angular
- timeCounter = PerformanceStatistics.angular.start();
- try {
- for (ResolvableCompilationUnit unit in library.resolvableCompilationUnits)
- {
- Source source = unit.source;
- CompilationUnit ast = unit.compilationUnit;
- new AngularCompilationUnitBuilder(_errorListener, source, ast).build();
- }
- } finally {
- timeCounter.stop();
- }
- // Polymer
- timeCounter = PerformanceStatistics.polymer.start();
- try {
- for (Source source in library.compilationUnitSources) {
- CompilationUnit ast = library.getAST(source);
- new PolymerCompilationUnitBuilder(ast).build();
- }
- } finally {
- timeCounter.stop();
- }
}
/**
@@ -10453,113 +9789,6 @@
}
/**
- * Instances of the class `PolymerCompilationUnitBuilder` build a Polymer specific element
- * model for a single compilation unit.
- */
-class PolymerCompilationUnitBuilder {
- static String _CUSTOM_TAG = "CustomTag";
-
- /**
- * The compilation unit with built Dart element models.
- */
- final CompilationUnit _unit;
-
- /**
- * The [ClassDeclaration] that is currently being analyzed.
- */
- ClassDeclaration _classDeclaration;
-
- /**
- * The [ClassElementImpl] that is currently being analyzed.
- */
- ClassElementImpl _classElement;
-
- /**
- * The [Annotation] that is currently being analyzed.
- */
- Annotation _annotation;
-
- /**
- * Initialize a newly created compilation unit element builder.
- *
- * @param unit the compilation unit with built Dart element models
- */
- PolymerCompilationUnitBuilder(this._unit);
-
- /**
- * Builds Polymer specific element models and adds them to the existing Dart elements.
- */
- void build() {
- // process classes
- for (CompilationUnitMember unitMember in _unit.declarations) {
- if (unitMember is ClassDeclaration) {
- this._classDeclaration = unitMember;
- this._classElement = _classDeclaration.element as ClassElementImpl;
- // process annotations
- NodeList<Annotation> annotations = _classDeclaration.metadata;
- for (Annotation annotation in annotations) {
- // verify annotation
- if (annotation.arguments == null) {
- continue;
- }
- this._annotation = annotation;
- // @CustomTag
- if (_isAnnotation(annotation, _CUSTOM_TAG)) {
- _parseCustomTag();
- continue;
- }
- }
- }
- }
- }
-
- /**
- * Checks if given [Annotation] is an annotation with required name.
- */
- bool _isAnnotation(Annotation annotation, String name) {
- Element element = annotation.element;
- if (element is ConstructorElement) {
- ConstructorElement constructorElement = element;
- return constructorElement.returnType.displayName == name;
- }
- return false;
- }
-
- void _parseCustomTag() {
- List<Expression> arguments = _annotation.arguments.arguments;
- if (arguments.length == 1) {
- Expression nameExpression = arguments[0];
- if (nameExpression is SimpleStringLiteral) {
- SimpleStringLiteral nameLiteral = nameExpression;
- String name = nameLiteral.value;
- int nameOffset = nameLiteral.contentsOffset;
- PolymerTagDartElementImpl element =
- new PolymerTagDartElementImpl(name, nameOffset, _classElement);
- _classElement.addToolkitObjects(element);
- nameLiteral.toolkitElement = element;
- }
- }
- }
-
- static Element getElement(AstNode node, int offset) {
- // maybe node is not SimpleStringLiteral
- if (node is! SimpleStringLiteral) {
- return null;
- }
- SimpleStringLiteral literal = node as SimpleStringLiteral;
- // maybe has PolymerElement
- {
- Element element = literal.toolkitElement;
- if (element is PolymerElement) {
- return element;
- }
- }
- // no Element
- return null;
- }
-}
-
-/**
* Instances of the class `PubVerifier` traverse an AST structure looking for deviations from
* pub best practices.
*/
@@ -10753,62 +9982,6 @@
// }
}
-class RecursiveAstVisitor_AngularCompilationUnitBuilder_parseViews extends
- RecursiveAstVisitor<Object> {
- List<AngularViewElement> views;
-
- RecursiveAstVisitor_AngularCompilationUnitBuilder_parseViews(this.views)
- : super();
-
- @override
- Object visitMethodInvocation(MethodInvocation node) {
- _addView(node);
- return super.visitMethodInvocation(node);
- }
-
- void _addView(MethodInvocation node) {
- // only one argument
- List<Expression> arguments = node.argumentList.arguments;
- if (arguments.length != 1) {
- return;
- }
- // String literal
- Expression argument = arguments[0];
- if (argument is! SimpleStringLiteral) {
- return;
- }
- SimpleStringLiteral literal = argument as SimpleStringLiteral;
- // just view('template')
- if (node.realTarget != null) {
- return;
- }
- // should be ViewFactory
- if (!_isViewFactory(node.methodName)) {
- return;
- }
- // add AngularViewElement
- String templateUri = literal.stringValue;
- int templateUriOffset = literal.contentsOffset;
- views.add(new AngularViewElementImpl(templateUri, templateUriOffset));
- }
-
- bool _isViewFactory(Expression target) {
- if (target is SimpleIdentifier) {
- SimpleIdentifier identifier = target;
- Element element = identifier.staticElement;
- if (element is VariableElement) {
- VariableElement variable = element;
- DartType type = variable.type;
- if (type is InterfaceType) {
- InterfaceType interfaceType = type;
- return interfaceType.name == "ViewFactory";
- }
- }
- }
- return false;
- }
-}
-
/**
* Kind of the redirecting constructor.
*/
@@ -15838,83 +15011,6 @@
}
}
-class _AngularCompilationUnitBuilder_parseScopeProperties extends
- RecursiveAstVisitor<Object> {
- List<AngularScopePropertyElement> properties;
-
- _AngularCompilationUnitBuilder_parseScopeProperties(this.properties)
- : super();
-
- @override
- Object visitAssignmentExpression(AssignmentExpression node) {
- _addProperty(node);
- return super.visitAssignmentExpression(node);
- }
-
- void _addProperty(AssignmentExpression node) {
- // try to find "name" in scope[name]
- SimpleStringLiteral nameNode = _getNameNode(node.leftHandSide);
- if (nameNode == null) {
- return;
- }
- // prepare unique
- String name = nameNode.stringValue;
- if (_hasPropertyWithName(name)) {
- return;
- }
- // do add property
- int nameOffset = nameNode.contentsOffset;
- AngularScopePropertyElement property = new AngularScopePropertyElementImpl(
- name,
- nameOffset,
- node.rightHandSide.bestType);
- nameNode.toolkitElement = property;
- properties.add(property);
- }
-
- SimpleStringLiteral _getNameNode(Expression node) {
- if (node is IndexExpression) {
- IndexExpression indexExpression = node;
- Expression target = indexExpression.target;
- Expression index = indexExpression.index;
- if (index is SimpleStringLiteral && _isContext(target)) {
- return index;
- }
- }
- return null;
- }
-
- bool _hasPropertyWithName(String name) {
- for (AngularScopePropertyElement property in properties) {
- if (property.name == name) {
- return true;
- }
- }
- return false;
- }
-
- bool _isContext(Expression target) {
- if (target is PrefixedIdentifier) {
- PrefixedIdentifier prefixed = target;
- SimpleIdentifier prefix = prefixed.prefix;
- SimpleIdentifier identifier = prefixed.identifier;
- return (identifier.name == "context") && _isScope(prefix);
- }
- return false;
- }
-
- bool _isScope(Expression target) {
- if (target != null) {
- DartType type = target.bestType;
- if (type is InterfaceType) {
- InterfaceType interfaceType = type;
- return interfaceType.name == "Scope";
- }
- }
- return false;
- }
-}
-
class _ConstantVerifier_validateInitializerExpression extends ConstantVisitor {
final ConstantVerifier verifier;
diff --git a/pkg/analyzer/lib/src/generated/testing/test_type_provider.dart b/pkg/analyzer/lib/src/generated/testing/test_type_provider.dart
new file mode 100644
index 0000000..a176816
--- /dev/null
+++ b/pkg/analyzer/lib/src/generated/testing/test_type_provider.dart
@@ -0,0 +1,482 @@
+// 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.
+
+// This code was auto-generated, is not intended to be edited, and is subject to
+// significant change. Please see the README file for more information.
+
+library engine.testing.test_type_provider;
+
+import 'package:analyzer/src/generated/element.dart';
+import 'package:analyzer/src/generated/resolver.dart';
+import 'package:analyzer/src/generated/testing/element_factory.dart';
+
+/**
+ * Instances of the class `TestTypeProvider` implement a type provider that can be used by
+ * tests without creating the element model for the core library.
+ */
+class TestTypeProvider implements TypeProvider {
+ /**
+ * The type representing the built-in type 'bool'.
+ */
+ InterfaceType _boolType;
+
+ /**
+ * The type representing the type 'bottom'.
+ */
+ DartType _bottomType;
+
+ /**
+ * The type representing the built-in type 'double'.
+ */
+ InterfaceType _doubleType;
+
+ /**
+ * The type representing the built-in type 'deprecated'.
+ */
+ InterfaceType _deprecatedType;
+
+ /**
+ * The type representing the built-in type 'dynamic'.
+ */
+ DartType _dynamicType;
+
+ /**
+ * The type representing the built-in type 'Function'.
+ */
+ InterfaceType _functionType;
+
+ /**
+ * The type representing the built-in type 'int'.
+ */
+ InterfaceType _intType;
+
+ /**
+ * The type representing the built-in type 'Iterable'.
+ */
+ InterfaceType _iterableType;
+
+ /**
+ * The type representing the built-in type 'Iterator'.
+ */
+ InterfaceType _iteratorType;
+
+ /**
+ * The type representing the built-in type 'List'.
+ */
+ InterfaceType _listType;
+
+ /**
+ * The type representing the built-in type 'Map'.
+ */
+ InterfaceType _mapType;
+
+ /**
+ * The type representing the built-in type 'Null'.
+ */
+ InterfaceType _nullType;
+
+ /**
+ * The type representing the built-in type 'num'.
+ */
+ InterfaceType _numType;
+
+ /**
+ * The type representing the built-in type 'Object'.
+ */
+ InterfaceType _objectType;
+
+ /**
+ * The type representing the built-in type 'StackTrace'.
+ */
+ InterfaceType _stackTraceType;
+
+ /**
+ * The type representing the built-in type 'String'.
+ */
+ InterfaceType _stringType;
+
+ /**
+ * The type representing the built-in type 'Symbol'.
+ */
+ InterfaceType _symbolType;
+
+ /**
+ * The type representing the built-in type 'Type'.
+ */
+ InterfaceType _typeType;
+
+ /**
+ * The type representing typenames that can't be resolved.
+ */
+ DartType _undefinedType;
+
+ @override
+ InterfaceType get boolType {
+ if (_boolType == null) {
+ ClassElementImpl boolElement = ElementFactory.classElement2("bool");
+ _boolType = boolElement.type;
+ ConstructorElementImpl fromEnvironment =
+ ElementFactory.constructorElement(boolElement, "fromEnvironment", true);
+ fromEnvironment.parameters = <ParameterElement>[
+ ElementFactory.requiredParameter2("name", stringType),
+ ElementFactory.namedParameter2("defaultValue", _boolType)];
+ fromEnvironment.factory = true;
+ boolElement.constructors = <ConstructorElement>[fromEnvironment];
+ }
+ return _boolType;
+ }
+
+ @override
+ DartType get bottomType {
+ if (_bottomType == null) {
+ _bottomType = BottomTypeImpl.instance;
+ }
+ return _bottomType;
+ }
+
+ @override
+ InterfaceType get deprecatedType {
+ if (_deprecatedType == null) {
+ ClassElementImpl deprecatedElement =
+ ElementFactory.classElement2("Deprecated");
+ deprecatedElement.constructors = <ConstructorElement>[
+ ElementFactory.constructorElement(deprecatedElement, null, true, [stringType])];
+ _deprecatedType = deprecatedElement.type;
+ }
+ return _deprecatedType;
+ }
+
+ @override
+ InterfaceType get doubleType {
+ if (_doubleType == null) {
+ _initializeNumericTypes();
+ }
+ return _doubleType;
+ }
+
+ @override
+ DartType get dynamicType {
+ if (_dynamicType == null) {
+ _dynamicType = DynamicTypeImpl.instance;
+ }
+ return _dynamicType;
+ }
+
+ @override
+ InterfaceType get functionType {
+ if (_functionType == null) {
+ _functionType = ElementFactory.classElement2("Function").type;
+ }
+ return _functionType;
+ }
+
+ @override
+ InterfaceType get intType {
+ if (_intType == null) {
+ _initializeNumericTypes();
+ }
+ return _intType;
+ }
+
+ InterfaceType get iterableType {
+ if (_iterableType == null) {
+ ClassElementImpl iterableElement =
+ ElementFactory.classElement2("Iterable", ["E"]);
+ _iterableType = iterableElement.type;
+ DartType eType = iterableElement.typeParameters[0].type;
+ iterableElement.accessors = <PropertyAccessorElement>[
+ ElementFactory.getterElement(
+ "iterator",
+ false,
+ iteratorType.substitute4(<DartType>[eType])),
+ ElementFactory.getterElement("last", false, eType)];
+ _propagateTypeArguments(iterableElement);
+ }
+ return _iterableType;
+ }
+
+ InterfaceType get iteratorType {
+ if (_iteratorType == null) {
+ ClassElementImpl iteratorElement =
+ ElementFactory.classElement2("Iterator", ["E"]);
+ _iteratorType = iteratorElement.type;
+ DartType eType = iteratorElement.typeParameters[0].type;
+ iteratorElement.accessors = <PropertyAccessorElement>[
+ ElementFactory.getterElement("current", false, eType)];
+ _propagateTypeArguments(iteratorElement);
+ }
+ return _iteratorType;
+ }
+
+ @override
+ InterfaceType get listType {
+ if (_listType == null) {
+ ClassElementImpl listElement =
+ ElementFactory.classElement2("List", ["E"]);
+ listElement.constructors =
+ <ConstructorElement>[ElementFactory.constructorElement2(listElement, null)];
+ _listType = listElement.type;
+ DartType eType = listElement.typeParameters[0].type;
+ InterfaceType iterableType =
+ this.iterableType.substitute4(<DartType>[eType]);
+ listElement.interfaces = <InterfaceType>[iterableType];
+ listElement.accessors = <PropertyAccessorElement>[
+ ElementFactory.getterElement("length", false, intType)];
+ listElement.methods = <MethodElement>[
+ ElementFactory.methodElement("[]", eType, [intType]),
+ ElementFactory.methodElement("[]=", VoidTypeImpl.instance, [intType, eType]),
+ ElementFactory.methodElement("add", VoidTypeImpl.instance, [eType])];
+ _propagateTypeArguments(listElement);
+ }
+ return _listType;
+ }
+
+ @override
+ InterfaceType get mapType {
+ if (_mapType == null) {
+ ClassElementImpl mapElement =
+ ElementFactory.classElement2("Map", ["K", "V"]);
+ _mapType = mapElement.type;
+ DartType kType = mapElement.typeParameters[0].type;
+ DartType vType = mapElement.typeParameters[1].type;
+ mapElement.accessors = <PropertyAccessorElement>[
+ ElementFactory.getterElement("length", false, intType)];
+ mapElement.methods = <MethodElement>[
+ ElementFactory.methodElement("[]", vType, [objectType]),
+ ElementFactory.methodElement("[]=", VoidTypeImpl.instance, [kType, vType])];
+ _propagateTypeArguments(mapElement);
+ }
+ return _mapType;
+ }
+
+ @override
+ InterfaceType get nullType {
+ if (_nullType == null) {
+ _nullType = ElementFactory.classElement2("Null").type;
+ }
+ return _nullType;
+ }
+
+ @override
+ InterfaceType get numType {
+ if (_numType == null) {
+ _initializeNumericTypes();
+ }
+ return _numType;
+ }
+
+ @override
+ InterfaceType get objectType {
+ if (_objectType == null) {
+ ClassElementImpl objectElement = ElementFactory.object;
+ _objectType = objectElement.type;
+ objectElement.constructors =
+ <ConstructorElement>[ElementFactory.constructorElement2(objectElement, null)];
+ objectElement.methods = <MethodElement>[
+ ElementFactory.methodElement("toString", stringType),
+ ElementFactory.methodElement("==", boolType, [_objectType]),
+ ElementFactory.methodElement("noSuchMethod", dynamicType, [dynamicType])];
+ objectElement.accessors = <PropertyAccessorElement>[
+ ElementFactory.getterElement("hashCode", false, intType),
+ ElementFactory.getterElement("runtimeType", false, typeType)];
+ }
+ return _objectType;
+ }
+
+ @override
+ InterfaceType get stackTraceType {
+ if (_stackTraceType == null) {
+ _stackTraceType = ElementFactory.classElement2("StackTrace").type;
+ }
+ return _stackTraceType;
+ }
+
+ @override
+ InterfaceType get stringType {
+ if (_stringType == null) {
+ _stringType = ElementFactory.classElement2("String").type;
+ ClassElementImpl stringElement = _stringType.element as ClassElementImpl;
+ stringElement.accessors = <PropertyAccessorElement>[
+ ElementFactory.getterElement("isEmpty", false, boolType),
+ ElementFactory.getterElement("length", false, intType),
+ ElementFactory.getterElement(
+ "codeUnits",
+ false,
+ listType.substitute4(<DartType>[intType]))];
+ stringElement.methods = <MethodElement>[
+ ElementFactory.methodElement("+", _stringType, [_stringType]),
+ ElementFactory.methodElement("toLowerCase", _stringType),
+ ElementFactory.methodElement("toUpperCase", _stringType)];
+ ConstructorElementImpl fromEnvironment =
+ ElementFactory.constructorElement(stringElement, "fromEnvironment", true);
+ fromEnvironment.parameters = <ParameterElement>[
+ ElementFactory.requiredParameter2("name", stringType),
+ ElementFactory.namedParameter2("defaultValue", _stringType)];
+ fromEnvironment.factory = true;
+ stringElement.constructors = <ConstructorElement>[fromEnvironment];
+ }
+ return _stringType;
+ }
+
+ @override
+ InterfaceType get symbolType {
+ if (_symbolType == null) {
+ ClassElementImpl symbolClass = ElementFactory.classElement2("Symbol");
+ ConstructorElementImpl constructor =
+ ElementFactory.constructorElement(symbolClass, null, true, [stringType]);
+ constructor.factory = true;
+ symbolClass.constructors = <ConstructorElement>[constructor];
+ _symbolType = symbolClass.type;
+ }
+ return _symbolType;
+ }
+
+ @override
+ InterfaceType get typeType {
+ if (_typeType == null) {
+ _typeType = ElementFactory.classElement2("Type").type;
+ }
+ return _typeType;
+ }
+
+ @override
+ DartType get undefinedType {
+ if (_undefinedType == null) {
+ _undefinedType = UndefinedTypeImpl.instance;
+ }
+ return _undefinedType;
+ }
+
+ /**
+ * Initialize the numeric types. They are created as a group so that we can (a) create the right
+ * hierarchy and (b) add members to them.
+ */
+ void _initializeNumericTypes() {
+ //
+ // Create the type hierarchy.
+ //
+ ClassElementImpl numElement = ElementFactory.classElement2("num");
+ _numType = numElement.type;
+ ClassElementImpl intElement = ElementFactory.classElement("int", _numType);
+ _intType = intElement.type;
+ ClassElementImpl doubleElement =
+ ElementFactory.classElement("double", _numType);
+ _doubleType = doubleElement.type;
+ //
+ // Force the referenced types to be cached.
+ //
+ objectType;
+ boolType;
+ stringType;
+ //
+ // Add the methods.
+ //
+ numElement.methods = <MethodElement>[
+ ElementFactory.methodElement("+", _numType, [_numType]),
+ ElementFactory.methodElement("-", _numType, [_numType]),
+ ElementFactory.methodElement("*", _numType, [_numType]),
+ ElementFactory.methodElement("%", _numType, [_numType]),
+ ElementFactory.methodElement("/", _doubleType, [_numType]),
+ ElementFactory.methodElement("~/", _numType, [_numType]),
+ ElementFactory.methodElement("-", _numType),
+ ElementFactory.methodElement("remainder", _numType, [_numType]),
+ ElementFactory.methodElement("<", _boolType, [_numType]),
+ ElementFactory.methodElement("<=", _boolType, [_numType]),
+ ElementFactory.methodElement(">", _boolType, [_numType]),
+ ElementFactory.methodElement(">=", _boolType, [_numType]),
+ ElementFactory.methodElement("==", _boolType, [_objectType]),
+ ElementFactory.methodElement("isNaN", _boolType),
+ ElementFactory.methodElement("isNegative", _boolType),
+ ElementFactory.methodElement("isInfinite", _boolType),
+ ElementFactory.methodElement("abs", _numType),
+ ElementFactory.methodElement("floor", _numType),
+ ElementFactory.methodElement("ceil", _numType),
+ ElementFactory.methodElement("round", _numType),
+ ElementFactory.methodElement("truncate", _numType),
+ ElementFactory.methodElement("toInt", _intType),
+ ElementFactory.methodElement("toDouble", _doubleType),
+ ElementFactory.methodElement("toStringAsFixed", _stringType, [_intType]),
+ ElementFactory.methodElement("toStringAsExponential", _stringType, [_intType]),
+ ElementFactory.methodElement("toStringAsPrecision", _stringType, [_intType]),
+ ElementFactory.methodElement("toRadixString", _stringType, [_intType])];
+ intElement.methods = <MethodElement>[
+ ElementFactory.methodElement("&", _intType, [_intType]),
+ ElementFactory.methodElement("|", _intType, [_intType]),
+ ElementFactory.methodElement("^", _intType, [_intType]),
+ ElementFactory.methodElement("~", _intType),
+ ElementFactory.methodElement("<<", _intType, [_intType]),
+ ElementFactory.methodElement(">>", _intType, [_intType]),
+ ElementFactory.methodElement("-", _intType),
+ ElementFactory.methodElement("abs", _intType),
+ ElementFactory.methodElement("round", _intType),
+ ElementFactory.methodElement("floor", _intType),
+ ElementFactory.methodElement("ceil", _intType),
+ ElementFactory.methodElement("truncate", _intType),
+ ElementFactory.methodElement("toString", _stringType)];
+ ConstructorElementImpl fromEnvironment =
+ ElementFactory.constructorElement(intElement, "fromEnvironment", true);
+ fromEnvironment.parameters = <ParameterElement>[
+ ElementFactory.requiredParameter2("name", stringType),
+ ElementFactory.namedParameter2("defaultValue", _intType)];
+ fromEnvironment.factory = true;
+ intElement.constructors = <ConstructorElement>[fromEnvironment];
+ List<FieldElement> fields = <FieldElement>[
+ ElementFactory.fieldElement("NAN", true, false, true, _doubleType),
+ ElementFactory.fieldElement("INFINITY", true, false, true, _doubleType),
+ ElementFactory.fieldElement(
+ "NEGATIVE_INFINITY",
+ true,
+ false,
+ true,
+ _doubleType),
+ ElementFactory.fieldElement("MIN_POSITIVE", true, false, true, _doubleType),
+ ElementFactory.fieldElement("MAX_FINITE", true, false, true, _doubleType)];
+ doubleElement.fields = fields;
+ int fieldCount = fields.length;
+ List<PropertyAccessorElement> accessors =
+ new List<PropertyAccessorElement>(fieldCount);
+ for (int i = 0; i < fieldCount; i++) {
+ accessors[i] = fields[i].getter;
+ }
+ doubleElement.accessors = accessors;
+ doubleElement.methods = <MethodElement>[
+ ElementFactory.methodElement("remainder", _doubleType, [_numType]),
+ ElementFactory.methodElement("+", _doubleType, [_numType]),
+ ElementFactory.methodElement("-", _doubleType, [_numType]),
+ ElementFactory.methodElement("*", _doubleType, [_numType]),
+ ElementFactory.methodElement("%", _doubleType, [_numType]),
+ ElementFactory.methodElement("/", _doubleType, [_numType]),
+ ElementFactory.methodElement("~/", _doubleType, [_numType]),
+ ElementFactory.methodElement("-", _doubleType),
+ ElementFactory.methodElement("abs", _doubleType),
+ ElementFactory.methodElement("round", _doubleType),
+ ElementFactory.methodElement("floor", _doubleType),
+ ElementFactory.methodElement("ceil", _doubleType),
+ ElementFactory.methodElement("truncate", _doubleType),
+ ElementFactory.methodElement("toString", _stringType)];
+ }
+
+ /**
+ * Given a class element representing a class with type parameters, propagate those type
+ * parameters to all of the accessors, methods and constructors defined for the class.
+ *
+ * @param classElement the element representing the class with type parameters
+ */
+ void _propagateTypeArguments(ClassElementImpl classElement) {
+ List<DartType> typeArguments =
+ TypeParameterTypeImpl.getTypes(classElement.typeParameters);
+ for (PropertyAccessorElement accessor in classElement.accessors) {
+ FunctionTypeImpl functionType = accessor.type as FunctionTypeImpl;
+ functionType.typeArguments = typeArguments;
+ }
+ for (MethodElement method in classElement.methods) {
+ FunctionTypeImpl functionType = method.type as FunctionTypeImpl;
+ functionType.typeArguments = typeArguments;
+ }
+ for (ConstructorElement constructor in classElement.constructors) {
+ FunctionTypeImpl functionType = constructor.type as FunctionTypeImpl;
+ functionType.typeArguments = typeArguments;
+ }
+ }
+}
diff --git a/pkg/analyzer/lib/src/services/runtime/coverage/coverage_impl.dart b/pkg/analyzer/lib/src/services/runtime/coverage/coverage_impl.dart
deleted file mode 100644
index b50ccca..0000000
--- a/pkg/analyzer/lib/src/services/runtime/coverage/coverage_impl.dart
+++ /dev/null
@@ -1,339 +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.
-
-/// A library for code coverage support for Dart.
-library runtime.coverage.impl;
-
-import 'dart:async';
-import 'dart:collection' show SplayTreeMap;
-import 'dart:io';
-
-import 'package:path/path.dart' as pathos;
-
-import 'package:analyzer/src/generated/scanner.dart' show CharSequenceReader, Scanner;
-import 'package:analyzer/src/generated/parser.dart' show Parser;
-import 'package:analyzer/src/generated/ast.dart';
-import 'package:analyzer/src/generated/engine.dart' show RecordingErrorListener;
-
-import '../log.dart' as log;
-import 'models.dart';
-
-/// Run the [targetPath] with code coverage rewriting.
-/// Redirects stdandard process streams.
-/// On process exit dumps coverage statistics into the [outPath].
-void runServerApplication(String targetPath, String outPath) {
- var targetFolder = pathos.dirname(targetPath);
- var targetName = pathos.basename(targetPath);
- var server = new CoverageServer(targetFolder, targetPath, outPath);
- server.start().then((port) {
- var targetArgs = ['http://127.0.0.1:$port/$targetName'];
- var dartExecutable = Platform.executable;
- return Process.start(dartExecutable, targetArgs);
- }).then((process) {
- stdin.pipe(process.stdin);
- process.stdout.pipe(stdout);
- process.stderr.pipe(stderr);
- return process.exitCode;
- }).then(exit).catchError((e) {
- log.severe('Error starting $targetPath. $e');
- });
-}
-
-
-/// Abstract server to listen requests and serve files, may be rewriting them.
-abstract class RewriteServer {
- final String basePath;
- int port;
-
- RewriteServer(this.basePath);
-
- /// Runs the HTTP server on the ephemeral port and returns [Future] with it.
- Future<int> start() {
- return HttpServer.bind('127.0.0.1', 0).then((server) {
- port = server.port;
- log.info('RewriteServer is listening at: $port.');
- server.listen((request) {
- if (request.method == 'GET') {
- handleGetRequest(request);
- }
- if (request.method == 'POST') {
- handlePostRequest(request);
- }
- });
- return port;
- });
- }
-
- void handlePostRequest(HttpRequest request);
-
- void handleGetRequest(HttpRequest request) {
- var response = request.response;
- // Prepare path.
- var path = getFilePath(request.uri);
- log.info('[$path] Requested.');
- // May be serve using just path.
- {
- var content = rewritePathContent(path);
- if (content != null) {
- log.info('[$path] Request served by path.');
- response.write(content);
- response.close();
- return;
- }
- }
- // Serve from file.
- log.info('[$path] Serving file.');
- var file = new File(path);
- file.exists().then((found) {
- if (found) {
- // May be this files should be sent as is.
- if (!shouldRewriteFile(path)) {
- return sendFile(request, file);
- }
- // Rewrite content of the file.
- return file.readAsString().then((content) {
- log.finest('[$path] Done reading ${content.length} characters.');
- content = rewriteFileContent(path, content);
- log.fine('[$path] Rewritten.');
- response.write(content);
- return response.close();
- });
- } else {
- log.severe('[$path] File not found.');
- response.statusCode = HttpStatus.NOT_FOUND;
- return response.close();
- }
- }).catchError((e) {
- log.severe('[$path] $e.');
- response.statusCode = HttpStatus.INTERNAL_SERVER_ERROR;
- return response.close();
- });
- }
-
- String getFilePath(Uri uri) {
- var path = uri.path;
- path = pathos.joinAll(uri.pathSegments);
- path = pathos.join(basePath, path);
- return pathos.normalize(path);
- }
-
- Future sendFile(HttpRequest request, File file) {
- return file.resolveSymbolicLinks().then((fullPath) {
- return file.openRead().pipe(request.response);
- });
- }
-
- bool shouldRewriteFile(String path);
-
- /// Subclasses implement this method to rewrite the provided [code] of the
- /// file with [path]. Returns some content or `null` if file content
- /// should be requested.
- String rewritePathContent(String path);
-
- /// Subclasses implement this method to rewrite the provided [code] of the
- /// file with [path].
- String rewriteFileContent(String path, String code);
-}
-
-
-/// Here `CCC` means 'code coverage configuration'.
-const TEST_UNIT_CCC = '''
-class __CCC extends __cc_ut.Configuration {
- void onDone(bool success) {
- __cc.postStatistics();
- super.onDone(success);
- }
-}''';
-
-const TEST_UNIT_CCC_SET = '__cc_ut.unittestConfiguration = new __CCC();';
-
-
-/// Server that rewrites Dart code so that it reports execution of statements
-/// and other nodes.
-class CoverageServer extends RewriteServer {
- final appInfo = new AppInfo();
- final String targetPath;
- final String outPath;
-
- CoverageServer(String basePath, this.targetPath, this.outPath)
- : super(basePath);
-
- void handlePostRequest(HttpRequest request) {
- var id = 0;
- var executedIds = new Set<int>();
- request.listen((data) {
- log.fine('Received statistics, ${data.length} bytes.');
- while (true) {
- var listIndex = id ~/ 8;
- if (listIndex >= data.length) break;
- var bitIndex = id % 8;
- if ((data[listIndex] & (1 << bitIndex)) != 0) {
- executedIds.add(id);
- }
- id++;
- }
- }).onDone(() {
- log.fine('Received all statistics.');
- var buffer = new StringBuffer();
- appInfo.write(buffer, executedIds);
- new File(outPath).writeAsString(buffer.toString()).then((_) {
- return request.response.close();
- }).catchError((e) {
- log.severe('Error in receiving statistics $e.');
- return request.response.close();
- });
- });
- }
-
- String rewritePathContent(String path) {
- if (path.endsWith('__coverage_lib.dart')) {
- String implPath = pathos.joinAll([
- pathos.dirname(Platform.script.toFilePath()),
- '..', 'lib', 'src', 'services', 'runtime', 'coverage',
- 'coverage_lib.dart']);
- var content = new File(implPath).readAsStringSync();
- return content.replaceAll('0; // replaced during rewrite', '$port;');
- }
- return null;
- }
-
- bool shouldRewriteFile(String path) {
- if (pathos.extension(path).toLowerCase() != '.dart') return false;
- // Rewrite target itself, only to send statistics.
- if (path == targetPath) {
- return true;
- }
- // TODO(scheglov) use configuration
- return path.contains('/packages/analyzer/');
- }
-
- String rewriteFileContent(String path, String code) {
- var unit = _parseCode(code);
- log.finest('[$path] Parsed.');
- var injector = new CodeInjector(code);
- // Inject imports.
- var directives = unit.directives;
- if (directives.isNotEmpty && directives[0] is LibraryDirective) {
- injector.inject(directives[0].end,
- 'import "package:unittest/unittest.dart" as __cc_ut;'
- 'import "http://127.0.0.1:$port/__coverage_lib.dart" as __cc;');
- }
- // Inject statistics sender.
- var isTargetScript = path == targetPath;
- if (isTargetScript) {
- for (var node in unit.declarations) {
- if (node is FunctionDeclaration) {
- var body = node.functionExpression.body;
- if (node.name.name == 'main' && body is BlockFunctionBody) {
- injector.inject(node.offset, TEST_UNIT_CCC);
- injector.inject(body.offset + 1, TEST_UNIT_CCC_SET);
- }
- }
- }
- }
- // Inject touch() invocations.
- if (!isTargetScript) {
- appInfo.enterUnit(path, code);
- unit.accept(new InsertTouchInvocationsVisitor(appInfo, injector));
- }
- // Done.
- return injector.getResult();
- }
-
- CompilationUnit _parseCode(String code) {
- var source = null;
- var errorListener = new RecordingErrorListener();
- var parser = new Parser(source, errorListener);
- var reader = new CharSequenceReader(code);
- var scanner = new Scanner(null, reader, errorListener);
- var token = scanner.tokenize();
- return parser.parseCompilationUnit(token);
- }
-}
-
-
-/// The visitor that inserts `touch` method invocations.
-class InsertTouchInvocationsVisitor extends GeneralizingAstVisitor {
- final AppInfo appInfo;
- final CodeInjector injector;
-
- InsertTouchInvocationsVisitor(this.appInfo, this.injector);
-
- visitClassDeclaration(ClassDeclaration node) {
- appInfo.enter('class', node.name.name);
- super.visitClassDeclaration(node);
- appInfo.leave();
- }
-
- visitConstructorDeclaration(ConstructorDeclaration node) {
- var className = (node.parent as ClassDeclaration).name.name;
- var constructorName;
- if (node.name == null) {
- constructorName = className;
- } else {
- constructorName = className + '.' + node.name.name;
- }
- appInfo.enter('constructor', constructorName);
- super.visitConstructorDeclaration(node);
- appInfo.leave();
- }
-
- visitMethodDeclaration(MethodDeclaration node) {
- if (node.isAbstract) {
- super.visitMethodDeclaration(node);
- } else {
- var kind;
- if (node.isGetter) {
- kind = 'getter';
- } else if (node.isSetter) {
- kind = 'setter';
- } else {
- kind = 'method';
- }
- appInfo.enter(kind, node.name.name);
- super.visitMethodDeclaration(node);
- appInfo.leave();
- }
- }
-
- visitStatement(Statement node) {
- insertTouch(node);
- super.visitStatement(node);
- }
-
- void insertTouch(Statement node) {
- if (node is Block) return;
- if (node.parent is LabeledStatement) return;
- if (node.parent is! Block) return;
- // Inject 'touch' invocation.
- var offset = node.offset;
- var id = appInfo.addNode(node);
- injector.inject(offset, '__cc.touch($id);');
- }
-}
-
-
-/// Helper for injecting fragments into some existing code.
-class CodeInjector {
- final String _code;
- final offsetFragmentMap = new SplayTreeMap<int, String>();
-
- CodeInjector(this._code);
-
- void inject(int offset, String fragment) {
- offsetFragmentMap[offset] = fragment;
- }
-
- String getResult() {
- var sb = new StringBuffer();
- var lastOffset = 0;
- offsetFragmentMap.forEach((offset, fragment) {
- sb.write(_code.substring(lastOffset, offset));
- sb.write(fragment);
- lastOffset = offset;
- });
- sb.write(_code.substring(lastOffset, _code.length));
- return sb.toString();
- }
-}
diff --git a/pkg/analyzer/lib/src/services/runtime/coverage/coverage_lib.dart b/pkg/analyzer/lib/src/services/runtime/coverage/coverage_lib.dart
deleted file mode 100644
index 8f1bac8..0000000
--- a/pkg/analyzer/lib/src/services/runtime/coverage/coverage_lib.dart
+++ /dev/null
@@ -1,27 +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.
-
-/// This library is injected into the applications under coverage.
-library coverage_lib;
-
-import 'dart:io';
-import 'dart:typed_data';
-
-const PORT = 0; // replaced during rewrite
-final _executedIds = new Uint8List(1024 * 64);
-
-touch(int id) {
- int listIndex = id ~/ 8;
- int bitIndex = id % 8;
- _executedIds[listIndex] |= 1 << bitIndex;
-}
-
-postStatistics() {
- var httpClient = new HttpClient();
- return httpClient.post('127.0.0.1', PORT, '/statistics')
- .then((request) {
- request.add(_executedIds);
- return request.close();
- });
-}
diff --git a/pkg/analyzer/lib/src/services/runtime/coverage/models.dart b/pkg/analyzer/lib/src/services/runtime/coverage/models.dart
deleted file mode 100644
index bf247f3..0000000
--- a/pkg/analyzer/lib/src/services/runtime/coverage/models.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.
-
-/// A library with code coverage models.
-library runtime.coverage.model;
-
-import 'dart:collection' show SplayTreeMap;
-
-import 'package:analyzer/src/generated/source.dart' show Source, SourceRange;
-import 'package:analyzer/src/generated/ast.dart' show AstNode;
-
-import 'utils.dart';
-
-
-/// Contains information about the application.
-class AppInfo {
- final nodeStack = new List<NodeInfo>();
- final units = new List<UnitInfo>();
- final pathToFile = new Map<String, UnitInfo>();
- NodeInfo currentNode;
- int nextId = 0;
-
- void enterUnit(String path, String content) {
- var unit = new UnitInfo(this, path, content);
- units.add(unit);
- currentNode = unit;
- }
-
- void enter(String kind, String name) {
- nodeStack.add(currentNode);
- currentNode = new NodeInfo(this, currentNode, kind, name);
- }
-
- void leave() {
- currentNode = nodeStack.removeLast();
- }
-
- int addNode(AstNode node) {
- return currentNode.addNode(node);
- }
-
- void write(StringSink sink, Set<int> executedIds) {
- sink.writeln('{');
- units.fold(null, (prev, unit) {
- if (prev != null) sink.writeln(',');
- return unit..write(sink, executedIds, ' ');
- });
- sink.writeln();
- sink.writeln('}');
- }
-}
-
-/// Information about some node - unit, class, method, function.
-class NodeInfo {
- final AppInfo appInfo;
- final NodeInfo parent;
- final String kind;
- final String name;
- final idToRange = new SplayTreeMap<int, SourceRange>();
- final children = <NodeInfo>[];
-
- NodeInfo(this.appInfo, this.parent, this.kind, this.name) {
- if (parent != null) {
- parent.children.add(this);
- }
- }
-
- int addNode(AstNode node) {
- var id = appInfo.nextId++;
- var range = new SourceRange(node.offset, node.length);
- idToRange[id] = range;
- return id;
- }
-
- void write(StringSink sink, Set<int> executedIds, String prefix) {
- sink.writeln('$prefix"$name": {');
- // Kind.
- sink.writeln('$prefix "kind": "$kind",');
- // Print children.
- if (children.isNotEmpty) {
- sink.writeln('$prefix "children": {');
- children.fold(null, (prev, child) {
- if (prev != null) sink.writeln(',');
- return child..write(sink, executedIds, '$prefix ');
- });
- sink.writeln();
- sink.writeln('$prefix }');
- }
- // Print source and line ranges.
- if (children.isEmpty) {
- sink.write('$prefix "ranges": [');
- var rangePrinter = new RangePrinter(unit, sink, executedIds);
- idToRange.forEach(rangePrinter.handle);
- rangePrinter.printRange();
- sink.writeln(']');
- }
- // Close this node.
- sink.write('$prefix}');
- }
-
- UnitInfo get unit => parent.unit;
-}
-
-/// Helper for printing merged source/line intervals.
-class RangePrinter {
- final UnitInfo unit;
- final StringSink sink;
- final Set<int> executedIds;
-
- bool first = true;
- int startId = -1;
- int startOffset = -1;
- int endId = -1;
- int endOffset = -1;
-
- RangePrinter(this.unit, this.sink, this.executedIds);
-
- handle(int id, SourceRange range) {
- if (executedIds.contains(id)) {
- printRange();
- } else {
- if (endId == id - 1) {
- endId = id;
- endOffset = range.end;
- } else {
- startId = id;
- endId = id;
- startOffset = range.offset;
- endOffset = range.end;
- }
- }
- }
-
- void printRange() {
- if (endId == -1) return;
- printSeparator();
- var startLine = unit.getLine(startOffset);
- var endLine = unit.getLine(endOffset);
- sink.write('$startOffset,$endOffset,$startLine,$endLine');
- startId = startOffset = startLine = -1;
- endId = endOffset = endLine = -1;
- }
-
- void printSeparator() {
- if (first) {
- first = false;
- } else {
- sink.write(', ');
- }
- }
-}
-
-/// Contains information about the single unit of the application.
-class UnitInfo extends NodeInfo {
- List<int> lineOffsets;
-
- UnitInfo(AppInfo appInfo, String path, String content)
- : super(appInfo, null, 'unit', path) {
- lineOffsets = getLineOffsets(content);
- }
-
- UnitInfo get unit => this;
-
- int getLine(int offset) {
- return binarySearch(lineOffsets, (x) => x >= offset);
- }
-}
diff --git a/pkg/analyzer/lib/src/services/runtime/coverage/utils.dart b/pkg/analyzer/lib/src/services/runtime/coverage/utils.dart
deleted file mode 100644
index 3af2276..0000000
--- a/pkg/analyzer/lib/src/services/runtime/coverage/utils.dart
+++ /dev/null
@@ -1,47 +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 utils;
-
-
-List<int> getLineOffsets(String text) {
- var offsets = <int> [0];
- var wasSR = false;
- text.codeUnits.asMap().forEach((int i, int codeUnit) {
- if (codeUnit == 13) {
- wasSR = true;
- return;
- }
- if (codeUnit == 10) {
- if (wasSR) {
- offsets.add(i - 1);
- } else {
- offsets.add(i);
- }
- }
- wasSR = false;
- });
- return offsets;
-}
-
-/// Find the first entry in a sorted [list] that matches a monotonic predicate.
-/// Given a result `n`, that all items before `n` will not match, `n` matches,
-/// and all items after `n` match too. The result is -1 when there are no
-/// items, 0 when all items match, and list.length when none does.
-// TODO(scheglov) remove this function after dartbug.com/5624 is fixed.
-int binarySearch(List list, bool matches(item)) {
- if (list.length == 0) return -1;
- if (matches(list.first)) return 0;
- if (!matches(list.last)) return list.length;
- var min = 0;
- var max = list.length - 1;
- while (min < max) {
- var half = min + ((max - min) ~/ 2);
- if (matches(list[half])) {
- max = half;
- } else {
- min = half + 1;
- }
- }
- return max;
-}
diff --git a/pkg/analyzer/lib/src/services/runtime/log.dart b/pkg/analyzer/lib/src/services/runtime/log.dart
deleted file mode 100644
index 6d3c9a6..0000000
--- a/pkg/analyzer/lib/src/services/runtime/log.dart
+++ /dev/null
@@ -1,49 +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.
-
-/// Simple wrapper for [Logger] library.
-library runtime.log;
-
-import "package:logging/logging.dart";
-
-/** Log message at level [Level.FINEST]. */
-void finest(String message) => _logger.log(Level.FINEST, message);
-
-/** Log message at level [Level.FINER]. */
-void finer(String message) => _logger.log(Level.FINER, message);
-
-/** Log message at level [Level.FINE]. */
-void fine(String message) => _logger.log(Level.FINE, message);
-
-/** Log message at level [Level.CONFIG]. */
-void config(String message) => _logger.log(Level.CONFIG, message);
-
-/** Log message at level [Level.INFO]. */
-void info(String message) => _logger.log(Level.INFO, message);
-
-/** Log message at level [Level.WARNING]. */
-void warning(String message) => _logger.log(Level.WARNING, message);
-
-/** Log message at level [Level.SEVERE]. */
-void severe(String message) => _logger.log(Level.SEVERE, message);
-
-/** Log message at level [Level.SHOUT]. */
-void shout(String message) => _logger.log(Level.SHOUT, message);
-
-/// Specifies that all log records should be logged.
-void everything() {
- _logger.level = Level.ALL;
-}
-
-/// Sends all log record to the console.
-void toConsole() {
- _logger.onRecord.listen((LogRecord record) {
- String levelString = record.level.toString();
- while (levelString.length < 6) levelString += ' ';
- print('${record.time}: $levelString ${record.message}');
- });
-}
-
-/// The root [Logger].
-final Logger _logger = Logger.root;
diff --git a/pkg/analyzer/test/cancelable_future_test.dart b/pkg/analyzer/test/cancelable_future_test.dart
index ed0e9af..825945d 100644
--- a/pkg/analyzer/test/cancelable_future_test.dart
+++ b/pkg/analyzer/test/cancelable_future_test.dart
@@ -16,7 +16,7 @@
runReflectiveTests(CancelableFutureTests);
}
-@ReflectiveTestCase()
+@reflectiveTest
class CancelableFutureTests {
Future test_defaultConstructor_returnValue() {
Object obj = new Object();
@@ -140,7 +140,7 @@
}
}
-@ReflectiveTestCase()
+@reflectiveTest
class CancelableCompleterTests {
CancelableCompleter<Object> completer;
int cancelCount = 0;
diff --git a/pkg/analyzer/test/enum_test.dart b/pkg/analyzer/test/enum_test.dart
index 89d258e..3fcf557 100644
--- a/pkg/analyzer/test/enum_test.dart
+++ b/pkg/analyzer/test/enum_test.dart
@@ -25,7 +25,7 @@
}
-@ReflectiveTestCase()
+@reflectiveTest
class EnumTest {
void test_AnalysisLevel() {
new EnumTester<AnalysisLevel>()
@@ -33,12 +33,6 @@
..check_explicit_values();
}
- void test_AngularPropertyKind() {
- new EnumTester<AngularPropertyKind>()
- ..check_getters()
- ..check_explicit_values();
- }
-
void test_AssignmentKind() {
new EnumTester<AssignmentKind>()
..check_getters()
diff --git a/pkg/analyzer/test/file_system/physical_resource_provider_test.dart b/pkg/analyzer/test/file_system/physical_resource_provider_test.dart
index 0590cec..c1c09ca 100644
--- a/pkg/analyzer/test/file_system/physical_resource_provider_test.dart
+++ b/pkg/analyzer/test/file_system/physical_resource_provider_test.dart
@@ -68,9 +68,16 @@
var path = join(tempPath, 'foo');
new io.File(path).writeAsStringSync('contents');
return delayed(() {
- expect(changesReceived, hasLength(1));
+ // There should be an "add" event indicating that the file was added.
+ // Depending on how long it took to write the contents, it may be
+ // followed by "modify" events.
+ expect(changesReceived, isNotEmpty);
expect(changesReceived[0].type, equals(ChangeType.ADD));
expect(changesReceived[0].path, equals(path));
+ for (int i = 1; i < changesReceived.length; i++) {
+ expect(changesReceived[i].type, equals(ChangeType.MODIFY));
+ expect(changesReceived[i].path, equals(path));
+ }
});
}));
diff --git a/pkg/analyzer/test/generated/all_the_rest_test.dart b/pkg/analyzer/test/generated/all_the_rest_test.dart
index ecd06ad..5852a91 100644
--- a/pkg/analyzer/test/generated/all_the_rest_test.dart
+++ b/pkg/analyzer/test/generated/all_the_rest_test.dart
@@ -28,6 +28,7 @@
import 'package:analyzer/src/generated/testing/ast_factory.dart';
import 'package:analyzer/src/generated/testing/element_factory.dart';
import 'package:analyzer/src/generated/testing/html_factory.dart';
+import 'package:analyzer/src/generated/testing/test_type_provider.dart';
import 'package:analyzer/src/generated/utilities_collection.dart';
import 'package:analyzer/src/generated/utilities_dart.dart';
import 'package:unittest/unittest.dart';
@@ -40,9 +41,6 @@
main() {
groupSep = ' | ';
- runReflectiveTests(AngularCompilationUnitBuilderTest);
- runReflectiveTests(AngularHtmlUnitResolverTest);
- runReflectiveTests(AngularHtmlUnitUtilsTest);
runReflectiveTests(ConstantEvaluatorTest);
runReflectiveTests(ConstantFinderTest);
runReflectiveTests(ConstantValueComputerTest);
@@ -452,2550 +450,7 @@
}
-@ReflectiveTestCase()
-class AngularCompilationUnitBuilderTest extends AngularTest {
- void test_bad_notConstructorAnnotation() {
- String mainContent = r'''
-const MY_ANNOTATION = null;
-@MY_ANNOTATION()
-class MyFilter {
-}''';
- resolveMainSource(mainContent);
- // prepare AngularFilterElement
- ClassElement classElement = mainUnitElement.getType("MyFilter");
- AngularFormatterElement filter =
- getAngularElement(classElement, (e) => e is AngularFormatterElement);
- expect(filter, isNull);
- }
-
- void test_Decorator() {
- String mainContent = _createAngularSource(r'''
-@Decorator(selector: '[my-dir]',
- map: const {
- 'my-dir' : '=>myPropA',
- '.' : '&myPropB',
- })
-class MyDirective {
- set myPropA(value) {}
- set myPropB(value) {}
- @NgTwoWay('my-prop-c')
- String myPropC;
-}''');
- resolveMainSourceNoErrors(mainContent);
- // prepare AngularDirectiveElement
- ClassElement classElement = mainUnitElement.getType("MyDirective");
- AngularDecoratorElement directive =
- getAngularElement(classElement, (e) => e is AngularDecoratorElement);
- expect(directive, isNotNull);
- // verify
- expect(directive.name, null);
- expect(directive.nameOffset, -1);
- _assertHasAttributeSelector(directive.selector, "my-dir");
- // verify properties
- List<AngularPropertyElement> properties = directive.properties;
- expect(properties, hasLength(3));
- _assertProperty(
- properties[0],
- "my-dir",
- findMainOffset("my-dir' :"),
- AngularPropertyKind.ONE_WAY,
- "myPropA",
- findMainOffset("myPropA'"));
- _assertProperty(
- properties[1],
- ".",
- findMainOffset(".' :"),
- AngularPropertyKind.CALLBACK,
- "myPropB",
- findMainOffset("myPropB'"));
- _assertProperty(
- properties[2],
- "my-prop-c",
- findMainOffset("my-prop-c'"),
- AngularPropertyKind.TWO_WAY,
- "myPropC",
- -1);
- }
-
- void test_Decorator_bad_cannotParseSelector() {
- String mainContent = _createAngularSource(r'''
-@Decorator(selector: '~bad-selector',
- map: const {
- 'my-dir' : '=>myPropA',
- '.' : '&myPropB',
- })
-class MyDirective {
- set myPropA(value) {}
- set myPropB(value) {}
-}''');
- resolveMainSource(mainContent);
- // has error
- assertMainErrors([AngularCode.CANNOT_PARSE_SELECTOR]);
- }
-
- void test_Decorator_bad_missingSelector() {
- String mainContent = _createAngularSource(r'''
-@Decorator(/*selector: '[my-dir]',*/
- map: const {
- 'my-dir' : '=>myPropA',
- '.' : '&myPropB',
- })
-class MyDirective {
- set myPropA(value) {}
- set myPropB(value) {}
-}''');
- resolveMainSource(mainContent);
- // has error
- assertMainErrors([AngularCode.MISSING_SELECTOR]);
- }
-
- void test_Formatter() {
- String mainContent = _createAngularSource(r'''
-@Formatter(name: 'myFilter')
-class MyFilter {
- call(p1, p2) {}
-}''');
- resolveMainSourceNoErrors(mainContent);
- // prepare AngularFilterElement
- ClassElement classElement = mainUnitElement.getType("MyFilter");
- AngularFormatterElement filter =
- getAngularElement(classElement, (e) => e is AngularFormatterElement);
- expect(filter, isNotNull);
- // verify
- expect(filter.name, "myFilter");
- expect(filter.nameOffset, AngularTest.findOffset(mainContent, "myFilter'"));
- }
-
- void test_Formatter_missingName() {
- String mainContent = _createAngularSource(r'''
-@Formatter()
-class MyFilter {
- call(p1, p2) {}
-}''');
- resolveMainSource(mainContent);
- // has error
- assertMainErrors([AngularCode.MISSING_NAME]);
- // no filter
- ClassElement classElement = mainUnitElement.getType("MyFilter");
- AngularFormatterElement filter =
- getAngularElement(classElement, (e) => e is AngularFormatterElement);
- expect(filter, isNull);
- }
-
- void test_getElement_component_name() {
- resolveMainSource(_createAngularSource(r'''
-@Component(publishAs: 'ctrl', selector: 'myComp',
- templateUrl: 'my_template.html', cssUrl: 'my_styles.css')
-class MyComponent {}'''));
- SimpleStringLiteral node =
- _findMainNode("ctrl'", (n) => n is SimpleStringLiteral);
- int offset = node.offset;
- // find AngularComponentElement
- Element element = AngularCompilationUnitBuilder.getElement(node, offset);
- EngineTestCase.assertInstanceOf(
- (obj) => obj is AngularComponentElement,
- AngularComponentElement,
- element);
- }
-
- void test_getElement_component_property_fromFieldAnnotation() {
- resolveMainSource(_createAngularSource(r'''
-@Component(publishAs: 'ctrl', selector: 'myComp',
- templateUrl: 'my_template.html', cssUrl: 'my_styles.css')
-class MyComponent {
- @NgOneWay('prop')
- var field;
-}'''));
- // prepare node
- SimpleStringLiteral node =
- _findMainNode("prop'", (n) => n is SimpleStringLiteral);
- int offset = node.offset;
- // prepare Element
- Element element = AngularCompilationUnitBuilder.getElement(node, offset);
- expect(element, isNotNull);
- // check AngularPropertyElement
- AngularPropertyElement property = element as AngularPropertyElement;
- expect(property.name, "prop");
- }
-
- void test_getElement_component_property_fromMap() {
- resolveMainSource(_createAngularSource(r'''
-@Component(publishAs: 'ctrl', selector: 'myComp',
- templateUrl: 'my_template.html', cssUrl: 'my_styles.css',
- map: const {
- 'prop' : '@field',
- })
-class MyComponent {
- var field;
-}'''));
- // AngularPropertyElement
- {
- SimpleStringLiteral node =
- _findMainNode("prop'", (n) => n is SimpleStringLiteral);
- int offset = node.offset;
- // prepare Element
- Element element = AngularCompilationUnitBuilder.getElement(node, offset);
- expect(element, isNotNull);
- // check AngularPropertyElement
- AngularPropertyElement property = element as AngularPropertyElement;
- expect(property.name, "prop");
- }
- // FieldElement
- {
- SimpleStringLiteral node =
- _findMainNode("@field'", (n) => n is SimpleStringLiteral);
- int offset = node.offset;
- // prepare Element
- Element element = AngularCompilationUnitBuilder.getElement(node, offset);
- expect(element, isNotNull);
- // check FieldElement
- FieldElement field = element as FieldElement;
- expect(field.name, "field");
- }
- }
-
- void test_getElement_component_selector() {
- resolveMainSource(_createAngularSource(r'''
-@Component(publishAs: 'ctrl', selector: 'myComp',
- templateUrl: 'my_template.html', cssUrl: 'my_styles.css')
-class MyComponent {}'''));
- SimpleStringLiteral node =
- _findMainNode("myComp'", (n) => n is SimpleStringLiteral);
- int offset = node.offset;
- // find AngularSelectorElement
- Element element = AngularCompilationUnitBuilder.getElement(node, offset);
- EngineTestCase.assertInstanceOf(
- (obj) => obj is AngularSelectorElement,
- AngularSelectorElement,
- element);
- }
-
- void test_getElement_controller_name() {
- resolveMainSource(_createAngularSource(r'''
-@Controller(publishAs: 'ctrl', selector: '[myApp]')
-class MyController {
-}'''));
- SimpleStringLiteral node =
- _findMainNode("ctrl'", (n) => n is SimpleStringLiteral);
- int offset = node.offset;
- // find AngularControllerElement
- Element element = AngularCompilationUnitBuilder.getElement(node, offset);
- EngineTestCase.assertInstanceOf(
- (obj) => obj is AngularControllerElement,
- AngularControllerElement,
- element);
- }
-
- void test_getElement_directive_property() {
- resolveMainSource(_createAngularSource(r'''
-@Decorator(selector: '[my-dir]',
- map: const {
- 'my-dir' : '=>field'
- })
-class MyDirective {
- set field(value) {}
-}'''));
- // prepare node
- SimpleStringLiteral node =
- _findMainNode("my-dir'", (n) => n is SimpleStringLiteral);
- int offset = node.offset;
- // prepare Element
- Element element = AngularCompilationUnitBuilder.getElement(node, offset);
- expect(element, isNotNull);
- // check AngularPropertyElement
- AngularPropertyElement property = element as AngularPropertyElement;
- expect(property.name, "my-dir");
- }
-
- void test_getElement_directive_selector() {
- resolveMainSource(_createAngularSource(r'''
-@Decorator(selector: '[my-dir]')
-class MyDirective {}'''));
- SimpleStringLiteral node =
- _findMainNode("my-dir]'", (n) => n is SimpleStringLiteral);
- int offset = node.offset;
- // find AngularSelectorElement
- Element element = AngularCompilationUnitBuilder.getElement(node, offset);
- EngineTestCase.assertInstanceOf(
- (obj) => obj is AngularSelectorElement,
- AngularSelectorElement,
- element);
- }
-
- void test_getElement_filter_name() {
- resolveMainSource(_createAngularSource(r'''
-@Formatter(name: 'myFilter')
-class MyFilter {
- call(p1, p2) {}
-}'''));
- SimpleStringLiteral node =
- _findMainNode("myFilter'", (n) => n is SimpleStringLiteral);
- int offset = node.offset;
- // find FilterElement
- Element element = AngularCompilationUnitBuilder.getElement(node, offset);
- EngineTestCase.assertInstanceOf(
- (obj) => obj is AngularFormatterElement,
- AngularFormatterElement,
- element);
- }
-
- void test_getElement_noClassDeclaration() {
- resolveMainSource("var foo = 'bar';");
- SimpleStringLiteral node =
- _findMainNode("bar'", (n) => n is SimpleStringLiteral);
- Element element = AngularCompilationUnitBuilder.getElement(node, 0);
- expect(element, isNull);
- }
-
- void test_getElement_noClassElement() {
- resolveMainSource(r'''
-class A {
- const A(p);
-}
-
-@A('bar')
-class B {}''');
- SimpleStringLiteral node =
- _findMainNode("bar'", (n) => n is SimpleStringLiteral);
- // reset B element
- ClassDeclaration classDeclaration =
- node.getAncestor((node) => node is ClassDeclaration);
- classDeclaration.name.staticElement = null;
- // class is not resolved - no element
- Element element = AngularCompilationUnitBuilder.getElement(node, 0);
- expect(element, isNull);
- }
-
- void test_getElement_noNode() {
- Element element = AngularCompilationUnitBuilder.getElement(null, 0);
- expect(element, isNull);
- }
-
- void test_getElement_notFound() {
- resolveMainSource(r'''
-class MyComponent {
- var str = 'some string';
-}''');
- // prepare node
- SimpleStringLiteral node =
- _findMainNode("some string'", (n) => n is SimpleStringLiteral);
- int offset = node.offset;
- // no Element
- Element element = AngularCompilationUnitBuilder.getElement(node, offset);
- expect(element, isNull);
- }
-
- void test_getElement_SimpleStringLiteral_withToolkitElement() {
- SimpleStringLiteral literal = AstFactory.string2("foo");
- Element element = new AngularScopePropertyElementImpl("foo", 0, null);
- literal.toolkitElement = element;
- expect(
- AngularCompilationUnitBuilder.getElement(literal, -1),
- same(element));
- }
-
- void test_NgComponent_bad_cannotParseSelector() {
- contextHelper.addSource("/my_template.html", "");
- contextHelper.addSource("/my_styles.css", "");
- String mainContent = _createAngularSource(r'''
-@Component(publishAs: 'ctrl', selector: '~myComp',
- templateUrl: 'my_template.html', cssUrl: 'my_styles.css')
-class MyComponent {
-}''');
- resolveMainSource(mainContent);
- // has error
- assertMainErrors([AngularCode.CANNOT_PARSE_SELECTOR]);
- }
-
- void test_NgComponent_bad_missingSelector() {
- contextHelper.addSource("/my_template.html", "");
- contextHelper.addSource("/my_styles.css", "");
- String mainContent = _createAngularSource(r'''
-@Component(publishAs: 'ctrl', /*selector: 'myComp',*/
- templateUrl: 'my_template.html', cssUrl: 'my_styles.css')
-class MyComponent {
-}''');
- resolveMainSource(mainContent);
- // has error
- assertMainErrors([AngularCode.MISSING_SELECTOR]);
- }
-
- /**
- *
- * https://code.google.com/p/dart/issues/detail?id=16346
- */
- void test_NgComponent_bad_notHtmlTemplate() {
- contextHelper.addSource("/my_template", "");
- contextHelper.addSource("/my_styles.css", "");
- addMainSource(_createAngularSource(r'''
-@NgComponent(publishAs: 'ctrl', selector: 'myComp',
- templateUrl: 'my_template', cssUrl: 'my_styles.css')
-class MyComponent {
-}'''));
- contextHelper.runTasks();
- }
-
- void test_NgComponent_bad_properties_invalidBinding() {
- contextHelper.addSource("/my_template.html", "");
- contextHelper.addSource("/my_styles.css", "");
- String mainContent = _createAngularSource(r'''
-@Component(publishAs: 'ctrl', selector: 'myComp',
- templateUrl: 'my_template.html', cssUrl: 'my_styles.css',
- map: const {'name' : '?field'})
-class MyComponent {
-}''');
- resolveMainSource(mainContent);
- // has error
- assertMainErrors([AngularCode.INVALID_PROPERTY_KIND]);
- }
-
- void test_NgComponent_bad_properties_nameNotStringLiteral() {
- contextHelper.addSource("/my_template.html", "");
- contextHelper.addSource("/my_styles.css", "");
- String mainContent = _createAngularSource(r'''
-@Component(publishAs: 'ctrl', selector: 'myComp',
- templateUrl: 'my_template.html', cssUrl: 'my_styles.css',
- map: const {null : 'field'})
-class MyComponent {
-}''');
- resolveMainSource(mainContent);
- // has error
- assertMainErrors([AngularCode.INVALID_PROPERTY_NAME]);
- }
-
- void test_NgComponent_bad_properties_noSuchField() {
- contextHelper.addSource("/my_template.html", "");
- contextHelper.addSource("/my_styles.css", "");
- String mainContent = _createAngularSource(r'''
-@Component(publishAs: 'ctrl', selector: 'myComp',
- templateUrl: 'my_template.html', cssUrl: 'my_styles.css',
- map: const {'name' : '=>field'})
-class MyComponent {
-}''');
- resolveMainSource(mainContent);
- // has error
- assertMainErrors([AngularCode.INVALID_PROPERTY_FIELD]);
- }
-
- void test_NgComponent_bad_properties_notMapLiteral() {
- contextHelper.addSource("/my_template.html", "");
- contextHelper.addSource("/my_styles.css", "");
- String mainContent = _createAngularSource(r'''
-@Component(publishAs: 'ctrl', selector: 'myComp',
- templateUrl: 'my_template.html', cssUrl: 'my_styles.css',
- map: null)
-class MyComponent {
-}''');
- resolveMainSource(mainContent);
- // has error
- assertMainErrors([AngularCode.INVALID_PROPERTY_MAP]);
- }
-
- void test_NgComponent_bad_properties_specNotStringLiteral() {
- contextHelper.addSource("/my_template.html", "");
- contextHelper.addSource("/my_styles.css", "");
- String mainContent = _createAngularSource(r'''
-@Component(publishAs: 'ctrl', selector: 'myComp',
- templateUrl: 'my_template.html', cssUrl: 'my_styles.css',
- map: const {'name' : null})
-class MyComponent {
-}''');
- resolveMainSource(mainContent);
- // has error
- assertMainErrors([AngularCode.INVALID_PROPERTY_SPEC]);
- }
-
- void test_NgComponent_no_cssUrl() {
- contextHelper.addSource("/my_template.html", "");
- contextHelper.addSource("/my_styles.css", "");
- String mainContent = _createAngularSource(r'''
-@Component(publishAs: 'ctrl', selector: 'myComp',
- templateUrl: 'my_template.html'/*, cssUrl: 'my_styles.css'*/)
-class MyComponent {
-}''');
- resolveMainSource(mainContent);
- // prepare AngularComponentElement
- ClassElement classElement = mainUnitElement.getType("MyComponent");
- AngularComponentElement component =
- getAngularElement(classElement, (e) => e is AngularComponentElement);
- expect(component, isNotNull);
- // no CSS
- expect(component.styleUri, null);
- expect(component.styleUriOffset, -1);
- }
-
- void test_NgComponent_no_publishAs() {
- contextHelper.addSource("/my_template.html", "");
- contextHelper.addSource("/my_styles.css", "");
- String mainContent = _createAngularSource(r'''
-@Component(/*publishAs: 'ctrl',*/ selector: 'myComp',
- templateUrl: 'my_template.html', cssUrl: 'my_styles.css')
-class MyComponent {
-}''');
- resolveMainSource(mainContent);
- // prepare AngularComponentElement
- ClassElement classElement = mainUnitElement.getType("MyComponent");
- AngularComponentElement component =
- getAngularElement(classElement, (e) => e is AngularComponentElement);
- expect(component, isNotNull);
- // no name
- expect(component.name, null);
- expect(component.nameOffset, -1);
- }
-
- void test_NgComponent_no_templateUrl() {
- contextHelper.addSource("/my_template.html", "");
- contextHelper.addSource("/my_styles.css", "");
- String mainContent = _createAngularSource(r'''
-@Component(publishAs: 'ctrl', selector: 'myComp',
- /*templateUrl: 'my_template.html',*/ cssUrl: 'my_styles.css')
-class MyComponent {
-}''');
- resolveMainSource(mainContent);
- // prepare AngularComponentElement
- ClassElement classElement = mainUnitElement.getType("MyComponent");
- AngularComponentElement component =
- getAngularElement(classElement, (e) => e is AngularComponentElement);
- expect(component, isNotNull);
- // no template
- expect(component.templateUri, null);
- expect(component.templateSource, null);
- expect(component.templateUriOffset, -1);
- }
-
- /**
- * https://code.google.com/p/dart/issues/detail?id=19023
- */
- void test_NgComponent_notAngular() {
- contextHelper.addSource("/my_template.html", "");
- contextHelper.addSource("/my_styles.css", "");
- String mainContent = r'''
-class Component {
- const Component(a, b);
-}
-
-@Component('foo', 42)
-class MyComponent {
-}''';
- resolveMainSource(mainContent);
- assertNoMainErrors();
- }
-
- void test_NgComponent_properties_fieldFromSuper() {
- contextHelper.addSource("/my_template.html", "");
- contextHelper.addSource("/my_styles.css", "");
- resolveMainSourceNoErrors(_createAngularSource(r'''
-class MySuper {
- var myPropA;
-}
-
-
-
-@Component(publishAs: 'ctrl', selector: 'myComp',
- templateUrl: 'my_template.html', cssUrl: 'my_styles.css',
- map: const {
- 'prop-a' : '@myPropA'
- })
-class MyComponent extends MySuper {
-}'''));
- // prepare AngularComponentElement
- ClassElement classElement = mainUnitElement.getType("MyComponent");
- AngularComponentElement component =
- getAngularElement(classElement, (e) => e is AngularComponentElement);
- expect(component, isNotNull);
- // verify
- List<AngularPropertyElement> properties = component.properties;
- expect(properties, hasLength(1));
- _assertProperty(
- properties[0],
- "prop-a",
- findMainOffset("prop-a' :"),
- AngularPropertyKind.ATTR,
- "myPropA",
- findMainOffset("myPropA'"));
- }
-
- void test_NgComponent_properties_fromFields() {
- contextHelper.addSource("/my_template.html", "");
- contextHelper.addSource("/my_styles.css", "");
- resolveMainSourceNoErrors(_createAngularSource(r'''
-@Component(publishAs: 'ctrl', selector: 'myComp',
- templateUrl: 'my_template.html', cssUrl: 'my_styles.css')
-class MyComponent {
- @NgAttr('prop-a')
- var myPropA;
- @NgCallback('prop-b')
- var myPropB;
- @NgOneWay('prop-c')
- var myPropC;
- @NgOneWayOneTime('prop-d')
- var myPropD;
- @NgTwoWay('prop-e')
- var myPropE;
-}'''));
- // prepare AngularComponentElement
- ClassElement classElement = mainUnitElement.getType("MyComponent");
- AngularComponentElement component =
- getAngularElement(classElement, (e) => e is AngularComponentElement);
- expect(component, isNotNull);
- // verify
- List<AngularPropertyElement> properties = component.properties;
- expect(properties, hasLength(5));
- _assertProperty(
- properties[0],
- "prop-a",
- findMainOffset("prop-a')"),
- AngularPropertyKind.ATTR,
- "myPropA",
- -1);
- _assertProperty(
- properties[1],
- "prop-b",
- findMainOffset("prop-b')"),
- AngularPropertyKind.CALLBACK,
- "myPropB",
- -1);
- _assertProperty(
- properties[2],
- "prop-c",
- findMainOffset("prop-c')"),
- AngularPropertyKind.ONE_WAY,
- "myPropC",
- -1);
- _assertProperty(
- properties[3],
- "prop-d",
- findMainOffset("prop-d')"),
- AngularPropertyKind.ONE_WAY_ONE_TIME,
- "myPropD",
- -1);
- _assertProperty(
- properties[4],
- "prop-e",
- findMainOffset("prop-e')"),
- AngularPropertyKind.TWO_WAY,
- "myPropE",
- -1);
- }
-
- void test_NgComponent_properties_fromMap() {
- contextHelper.addSource("/my_template.html", "");
- contextHelper.addSource("/my_styles.css", "");
- resolveMainSourceNoErrors(_createAngularSource(r'''
-@Component(publishAs: 'ctrl', selector: 'myComp',
- templateUrl: 'my_template.html', cssUrl: 'my_styles.css',
- map: const {
- 'prop-a' : '@myPropA',
- 'prop-b' : '&myPropB',
- 'prop-c' : '=>myPropC',
- 'prop-d' : '=>!myPropD',
- 'prop-e' : '<=>myPropE'
- })
-class MyComponent {
- var myPropA;
- var myPropB;
- var myPropC;
- var myPropD;
- var myPropE;
-}'''));
- // prepare AngularComponentElement
- ClassElement classElement = mainUnitElement.getType("MyComponent");
- AngularComponentElement component =
- getAngularElement(classElement, (e) => e is AngularComponentElement);
- expect(component, isNotNull);
- // verify
- List<AngularPropertyElement> properties = component.properties;
- expect(properties, hasLength(5));
- _assertProperty(
- properties[0],
- "prop-a",
- findMainOffset("prop-a' :"),
- AngularPropertyKind.ATTR,
- "myPropA",
- findMainOffset("myPropA'"));
- _assertProperty(
- properties[1],
- "prop-b",
- findMainOffset("prop-b' :"),
- AngularPropertyKind.CALLBACK,
- "myPropB",
- findMainOffset("myPropB'"));
- _assertProperty(
- properties[2],
- "prop-c",
- findMainOffset("prop-c' :"),
- AngularPropertyKind.ONE_WAY,
- "myPropC",
- findMainOffset("myPropC'"));
- _assertProperty(
- properties[3],
- "prop-d",
- findMainOffset("prop-d' :"),
- AngularPropertyKind.ONE_WAY_ONE_TIME,
- "myPropD",
- findMainOffset("myPropD'"));
- _assertProperty(
- properties[4],
- "prop-e",
- findMainOffset("prop-e' :"),
- AngularPropertyKind.TWO_WAY,
- "myPropE",
- findMainOffset("myPropE'"));
- }
-
- void test_NgComponent_properties_no() {
- contextHelper.addSource("/my_template.html", "");
- contextHelper.addSource("/my_styles.css", "");
- String mainContent = _createAngularSource(r'''
-@Component(publishAs: 'ctrl', selector: 'myComp',
- templateUrl: 'my_template.html', cssUrl: 'my_styles.css')
-class MyComponent {
-}''');
- resolveMainSourceNoErrors(mainContent);
- // prepare AngularComponentElement
- ClassElement classElement = mainUnitElement.getType("MyComponent");
- AngularComponentElement component =
- getAngularElement(classElement, (e) => e is AngularComponentElement);
- expect(component, isNotNull);
- // verify
- expect(component.name, "ctrl");
- expect(component.nameOffset, AngularTest.findOffset(mainContent, "ctrl'"));
- _assertIsTagSelector(component.selector, "myComp");
- expect(component.templateUri, "my_template.html");
- expect(
- component.templateUriOffset,
- AngularTest.findOffset(mainContent, "my_template.html'"));
- expect(component.styleUri, "my_styles.css");
- expect(
- component.styleUriOffset,
- AngularTest.findOffset(mainContent, "my_styles.css'"));
- expect(component.properties, hasLength(0));
- }
-
- void test_NgComponent_scopeProperties() {
- contextHelper.addSource("/my_template.html", "");
- contextHelper.addSource("/my_styles.css", "");
- String mainContent = _createAngularSource(r'''
-@Component(publishAs: 'ctrl', selector: 'myComp',
- templateUrl: 'my_template.html', cssUrl: 'my_styles.css')
-class MyComponent {
- MyComponent(Scope scope) {
- scope.context['boolProp'] = true;
- scope.context['intProp'] = 42;
- scope.context['stringProp'] = 'foo';
- // duplicate is ignored
- scope.context['boolProp'] = true;
- // LHS is not an IndexExpression
- var v1;
- v1 = 1;
- // LHS is not a Scope access
- var v2;
- v2['name'] = 2;
- }
-}''');
- resolveMainSourceNoErrors(mainContent);
- // prepare AngularComponentElement
- ClassElement classElement = mainUnitElement.getType("MyComponent");
- AngularComponentElement component =
- getAngularElement(classElement, (e) => e is AngularComponentElement);
- expect(component, isNotNull);
- // verify
- List<AngularScopePropertyElement> scopeProperties =
- component.scopeProperties;
- expect(scopeProperties, hasLength(3));
- {
- AngularScopePropertyElement property = scopeProperties[0];
- expect(findMainElement2("boolProp"), same(property));
- expect(property.name, "boolProp");
- expect(
- property.nameOffset,
- AngularTest.findOffset(mainContent, "boolProp'"));
- expect(property.type.name, "bool");
- }
- {
- AngularScopePropertyElement property = scopeProperties[1];
- expect(findMainElement2("intProp"), same(property));
- expect(property.name, "intProp");
- expect(
- property.nameOffset,
- AngularTest.findOffset(mainContent, "intProp'"));
- expect(property.type.name, "int");
- }
- {
- AngularScopePropertyElement property = scopeProperties[2];
- expect(findMainElement2("stringProp"), same(property));
- expect(property.name, "stringProp");
- expect(
- property.nameOffset,
- AngularTest.findOffset(mainContent, "stringProp'"));
- expect(property.type.name, "String");
- }
- }
-
- void test_NgController() {
- String mainContent = _createAngularSource(r'''
-@Controller(publishAs: 'ctrl', selector: '[myApp]')
-class MyController {
-}''');
- resolveMainSourceNoErrors(mainContent);
- // prepare AngularControllerElement
- ClassElement classElement = mainUnitElement.getType("MyController");
- AngularControllerElement controller =
- getAngularElement(classElement, (e) => e is AngularControllerElement);
- expect(controller, isNotNull);
- // verify
- expect(controller.name, "ctrl");
- expect(controller.nameOffset, AngularTest.findOffset(mainContent, "ctrl'"));
- _assertHasAttributeSelector(controller.selector, "myApp");
- }
-
- void test_NgController_cannotParseSelector() {
- String mainContent = _createAngularSource(r'''
-@Controller(publishAs: 'ctrl', selector: '~unknown')
-class MyController {
-}''');
- resolveMainSource(mainContent);
- // has error
- assertMainErrors([AngularCode.CANNOT_PARSE_SELECTOR]);
- }
-
- void test_NgController_missingPublishAs() {
- String mainContent = _createAngularSource(r'''
-@Controller(selector: '[myApp]')
-class MyController {
-}''');
- resolveMainSource(mainContent);
- // has error
- assertMainErrors([AngularCode.MISSING_PUBLISH_AS]);
- }
-
- void test_NgController_missingSelector() {
- String mainContent = _createAngularSource(r'''
-@Controller(publishAs: 'ctrl')
-class MyController {
-}''');
- resolveMainSource(mainContent);
- // has error
- assertMainErrors([AngularCode.MISSING_SELECTOR]);
- }
-
- void test_NgController_noAnnotationArguments() {
- String mainContent = _createAngularSource(r'''
-@NgController
-class MyController {
-}''');
- resolveMainSource(mainContent);
- }
-
- void test_parseSelector_hasAttribute() {
- AngularSelectorElement selector =
- AngularCompilationUnitBuilder.parseSelector(42, "[name]");
- _assertHasAttributeSelector(selector, "name");
- expect(selector.nameOffset, 42 + 1);
- }
-
- void test_parseSelector_hasClass() {
- AngularSelectorElement selector =
- AngularCompilationUnitBuilder.parseSelector(42, ".my-class");
- AngularHasClassSelectorElementImpl classSelector =
- selector as AngularHasClassSelectorElementImpl;
- expect(classSelector.name, "my-class");
- expect(classSelector.toString(), ".my-class");
- expect(selector.nameOffset, 42 + 1);
- // test apply()
- {
- ht.XmlTagNode node =
- HtmlFactory.tagNode("div", [HtmlFactory.attribute("class", "one two")]);
- expect(classSelector.apply(node), isFalse);
- }
- {
- ht.XmlTagNode node = HtmlFactory.tagNode(
- "div",
- [HtmlFactory.attribute("class", "one my-class two")]);
- expect(classSelector.apply(node), isTrue);
- }
- }
-
- void test_parseSelector_isTag() {
- AngularSelectorElement selector =
- AngularCompilationUnitBuilder.parseSelector(42, "name");
- _assertIsTagSelector(selector, "name");
- expect(selector.nameOffset, 42);
- }
-
- void test_parseSelector_isTag_hasAttribute() {
- AngularSelectorElement selector =
- AngularCompilationUnitBuilder.parseSelector(42, "tag[attr]");
- EngineTestCase.assertInstanceOf(
- (obj) => obj is IsTagHasAttributeSelectorElementImpl,
- IsTagHasAttributeSelectorElementImpl,
- selector);
- expect(selector.name, "tag[attr]");
- expect(selector.nameOffset, -1);
- expect((selector as IsTagHasAttributeSelectorElementImpl).tagName, "tag");
- expect(
- (selector as IsTagHasAttributeSelectorElementImpl).attributeName,
- "attr");
- }
-
- void test_parseSelector_unknown() {
- AngularSelectorElement selector =
- AngularCompilationUnitBuilder.parseSelector(0, "~unknown");
- expect(selector, isNull);
- }
-
- void test_view() {
- contextHelper.addSource("/wrong.html", "");
- contextHelper.addSource("/my_templateA.html", "");
- contextHelper.addSource("/my_templateB.html", "");
- String mainContent = _createAngularSource(r'''
-class MyRouteInitializer {
- init(ViewFactory view, foo) {
- foo.view('wrong.html'); // has target
- foo(); // less than one argument
- foo('wrong.html', 'bar'); // more than one argument
- foo('wrong' + '.html'); // not literal
- foo('wrong.html'); // not ViewFactory
- view('my_templateA.html');
- view('my_templateB.html');
- }
-}''');
- resolveMainSourceNoErrors(mainContent);
- // prepare AngularViewElement(s)
- List<AngularViewElement> views = mainUnitElement.angularViews;
- expect(views, hasLength(2));
- {
- AngularViewElement view = views[0];
- expect(view.templateUri, "my_templateA.html");
- expect(view.name, null);
- expect(view.nameOffset, -1);
- expect(
- view.templateUriOffset,
- AngularTest.findOffset(mainContent, "my_templateA.html'"));
- }
- {
- AngularViewElement view = views[1];
- expect(view.templateUri, "my_templateB.html");
- expect(view.name, null);
- expect(view.nameOffset, -1);
- expect(
- view.templateUriOffset,
- AngularTest.findOffset(mainContent, "my_templateB.html'"));
- }
- }
-
- void _assertProperty(AngularPropertyElement property, String expectedName,
- int expectedNameOffset, AngularPropertyKind expectedKind,
- String expectedFieldName, int expectedFieldOffset) {
- expect(property.name, expectedName);
- expect(property.nameOffset, expectedNameOffset);
- expect(property.propertyKind, same(expectedKind));
- expect(property.field.name, expectedFieldName);
- expect(property.fieldNameOffset, expectedFieldOffset);
- }
-
- /**
- * Find [AstNode] of the given type in [mainUnit].
- */
- AstNode _findMainNode(String search, Predicate<AstNode> predicate) {
- return EngineTestCase.findNode(mainUnit, mainContent, search, predicate);
- }
-
- static AngularElement getAngularElement(Element element,
- Predicate<Element> predicate) {
- List<ToolkitObjectElement> toolkitObjects = null;
- if (element is ClassElement) {
- ClassElement classElement = element;
- toolkitObjects = classElement.toolkitObjects;
- }
- if (element is LocalVariableElement) {
- LocalVariableElement variableElement = element;
- toolkitObjects = variableElement.toolkitObjects;
- }
- if (toolkitObjects != null) {
- for (ToolkitObjectElement toolkitObject in toolkitObjects) {
- if (predicate(toolkitObject)) {
- return toolkitObject as AngularElement;
- }
- }
- }
- return null;
- }
-
- static void _assertHasAttributeSelector(AngularSelectorElement selector,
- String name) {
- EngineTestCase.assertInstanceOf(
- (obj) => obj is HasAttributeSelectorElementImpl,
- HasAttributeSelectorElementImpl,
- selector);
- expect((selector as HasAttributeSelectorElementImpl).name, name);
- }
-
- static void _assertIsTagSelector(AngularSelectorElement selector,
- String name) {
- EngineTestCase.assertInstanceOf(
- (obj) => obj is AngularTagSelectorElementImpl,
- AngularTagSelectorElementImpl,
- selector);
- expect((selector as AngularTagSelectorElementImpl).name, name);
- }
-
- static String _createAngularSource(String code) {
- return "import 'angular.dart';\n" + code;
- }
-}
-
-
-@ReflectiveTestCase()
-class AngularHtmlUnitResolverTest extends AngularTest {
- void fail_analysisContext_changeDart_invalidateApplication() {
- addMainSource(r'''
-
-import 'angular.dart';
-
-@Component(
- templateUrl: 'my_template.html', cssUrl: 'my_styles.css',
- publishAs: 'ctrl',
- selector: 'myComponent')
-class MyComponent {
-}''');
- contextHelper.addSource(
- "/entry-point.html",
- AngularTest.createHtmlWithAngular(''));
- addIndexSource2("/my_template.html", r'''
-<div>
- {{ctrl.noMethod()}}
-</div>''');
- contextHelper.addSource("/my_styles.css", "");
- contextHelper.runTasks();
- // there are some errors in my_template.html
- {
- List<AnalysisError> errors = context.getErrors(indexSource).errors;
- expect(errors.length != 0, isTrue);
- }
- // change main.dart, there are no MyComponent anymore
- context.setContents(mainSource, "");
- // ...errors in my_template.html should be removed
- {
- List<AnalysisError> errors = context.getErrors(indexSource).errors;
- expect(errors, isEmpty);
- expect(errors.length == 0, isTrue);
- }
- }
-
- void fail_ngRepeat_additionalVariables() {
- addMyController();
- _resolveIndexNoErrors(AngularTest.createHtmlWithMyController(r'''
-<li ng-repeat='name in ctrl.names'>
- {{$index}} {{$first}} {{$middle}} {{$last}} {{$even}} {{$odd}}
-</li>'''));
- assertResolvedIdentifier2("\$index", "int");
- assertResolvedIdentifier2("\$first", "bool");
- assertResolvedIdentifier2("\$middle", "bool");
- assertResolvedIdentifier2("\$last", "bool");
- assertResolvedIdentifier2("\$even", "bool");
- assertResolvedIdentifier2("\$odd", "bool");
- }
-
- void fail_ngRepeat_bad_expectedIdentifier() {
- addMyController();
- resolveIndex2(AngularTest.createHtmlWithMyController(r'''
-<li ng-repeat='name + 42 in ctrl.names'>
-</li>'''));
- assertErrors(indexSource, [AngularCode.INVALID_REPEAT_ITEM_SYNTAX]);
- }
-
- void fail_ngRepeat_bad_expectedIn() {
- addMyController();
- resolveIndex2(AngularTest.createHtmlWithMyController(r'''
-<li ng-repeat='name : ctrl.names'>
-</li>'''));
- assertErrors(indexSource, [AngularCode.INVALID_REPEAT_SYNTAX]);
- }
-
- void fail_ngRepeat_filters_filter_literal() {
- addMyController();
- _resolveIndexNoErrors(AngularTest.createHtmlWithMyController(r'''
-<li ng-repeat='item in ctrl.items | filter:42:null'/>
-</li>'''));
- // filter "filter" is resolved
- Element filterElement = assertResolvedIdentifier("filter");
- EngineTestCase.assertInstanceOf(
- (obj) => obj is AngularFormatterElement,
- AngularFormatterElement,
- filterElement);
- }
-
- void fail_ngRepeat_filters_filter_propertyMap() {
- addMyController();
- _resolveIndexNoErrors(AngularTest.createHtmlWithMyController(r'''
-<li ng-repeat='item in ctrl.items | filter:{name:null, done:false}'/>
-</li>'''));
- assertResolvedIdentifier2("name:", "String");
- assertResolvedIdentifier2("done:", "bool");
- }
-
- void fail_ngRepeat_filters_missingColon() {
- addMyController();
- resolveIndex2(AngularTest.createHtmlWithMyController(r'''
-<li ng-repeat="item in ctrl.items | orderBy:'' true"/>
-</li>'''));
- assertErrors(indexSource, [AngularCode.MISSING_FORMATTER_COLON]);
- }
-
- void fail_ngRepeat_filters_noArgs() {
- addMyController();
- _resolveIndexNoErrors(AngularTest.createHtmlWithMyController(r'''
-<li ng-repeat="item in ctrl.items | orderBy"/>
-</li>'''));
- // filter "orderBy" is resolved
- Element filterElement = assertResolvedIdentifier("orderBy");
- EngineTestCase.assertInstanceOf(
- (obj) => obj is AngularFormatterElement,
- AngularFormatterElement,
- filterElement);
- }
-
- void fail_ngRepeat_filters_orderBy_emptyString() {
- addMyController();
- _resolveIndexNoErrors(AngularTest.createHtmlWithMyController(r'''
-<li ng-repeat="item in ctrl.items | orderBy:'':true"/>
-</li>'''));
- // filter "orderBy" is resolved
- Element filterElement = assertResolvedIdentifier("orderBy");
- EngineTestCase.assertInstanceOf(
- (obj) => obj is AngularFormatterElement,
- AngularFormatterElement,
- filterElement);
- }
-
- void fail_ngRepeat_filters_orderBy_propertyList() {
- addMyController();
- _resolveIndexNoErrors(AngularTest.createHtmlWithMyController(r'''
-<li ng-repeat="item in ctrl.items | orderBy:['name', 'done']"/>
-</li>'''));
- assertResolvedIdentifier2("name'", "String");
- assertResolvedIdentifier2("done'", "bool");
- }
-
- void fail_ngRepeat_filters_orderBy_propertyName() {
- addMyController();
- _resolveIndexNoErrors(AngularTest.createHtmlWithMyController(r'''
-<li ng-repeat="item in ctrl.items | orderBy:'name'"/>
-</li>'''));
- assertResolvedIdentifier2("name'", "String");
- }
-
- void fail_ngRepeat_filters_orderBy_propertyName_minus() {
- addMyController();
- _resolveIndexNoErrors(AngularTest.createHtmlWithMyController(r'''
-<li ng-repeat="item in ctrl.items | orderBy:'-name'"/>
-</li>'''));
- assertResolvedIdentifier2("name'", "String");
- }
-
- void fail_ngRepeat_filters_orderBy_propertyName_plus() {
- addMyController();
- _resolveIndexNoErrors(AngularTest.createHtmlWithMyController(r'''
-<li ng-repeat="item in ctrl.items | orderBy:'+name'"/>
-</li>'''));
- assertResolvedIdentifier2("name'", "String");
- }
-
- void fail_ngRepeat_filters_orderBy_propertyName_untypedItems() {
- addMyController();
- _resolveIndexNoErrors(AngularTest.createHtmlWithMyController(r'''
-<li ng-repeat="item in ctrl.untypedItems | orderBy:'name'"/>
-</li>'''));
- assertResolvedIdentifier2("name'", "dynamic");
- }
-
- void fail_ngRepeat_filters_two() {
- addMyController();
- _resolveIndexNoErrors(AngularTest.createHtmlWithMyController(r'''
-<li ng-repeat="item in ctrl.items | orderBy:'+' | orderBy:'-'"/>
-</li>'''));
- EngineTestCase.assertInstanceOf(
- (obj) => obj is AngularFormatterElement,
- AngularFormatterElement,
- assertResolvedIdentifier("orderBy:'+'"));
- EngineTestCase.assertInstanceOf(
- (obj) => obj is AngularFormatterElement,
- AngularFormatterElement,
- assertResolvedIdentifier("orderBy:'-'"));
- }
-
- void fail_ngRepeat_resolvedExpressions() {
- addMyController();
- _resolveIndexNoErrors(AngularTest.createHtmlWithMyController(r'''
-<li ng-repeat='name in ctrl.names'>
- {{name}}
-</li>'''));
- assertResolvedIdentifier2("name in", "String");
- assertResolvedIdentifier2("ctrl.", "MyController");
- assertResolvedIdentifier2("names'", "List<String>");
- assertResolvedIdentifier2("name}}", "String");
- }
-
- void fail_ngRepeat_trackBy() {
- addMyController();
- _resolveIndexNoErrors(AngularTest.createHtmlWithMyController(r'''
-<li ng-repeat='name in ctrl.names track by name.length'/>
-</li>'''));
- assertResolvedIdentifier2("length'", "int");
- }
-
- void test_analysisContext_changeEntryPoint_clearAngularErrors_inDart() {
- addMainSource(r'''
-
-import 'angular.dart';
-
-@Component(
- templateUrl: 'no-such-template.html', cssUrl: 'my_styles.css',
- publishAs: 'ctrl',
- selector: 'myComponent')
-class MyComponent {
-}''');
- Source entrySource = contextHelper.addSource(
- "/entry-point.html",
- AngularTest.createHtmlWithAngular(''));
- contextHelper.addSource("/my_styles.css", "");
- contextHelper.runTasks();
- // there are some errors in MyComponent
- {
- List<AnalysisError> errors = context.getErrors(mainSource).errors;
- expect(errors.length != 0, isTrue);
- }
- // make entry-point.html non-Angular
- context.setContents(entrySource, "<html/>");
- // ...errors in MyComponent should be removed
- {
- List<AnalysisError> errors = context.getErrors(mainSource).errors;
- expect(errors.length == 0, isTrue);
- }
- }
-
- void test_analysisContext_changeEntryPoint_clearAngularErrors_inTemplate() {
- addMainSource(r'''
-
-import 'angular.dart';
-
-@Component(
- templateUrl: 'my_template.html', cssUrl: 'my_styles.css',
- publishAs: 'ctrl',
- selector: 'myComponent')
-class MyComponent {
-}''');
- Source entrySource = contextHelper.addSource(
- "/entry-point.html",
- AngularTest.createHtmlWithAngular(''));
- addIndexSource2("/my_template.html", r'''
-<div>
- {{ctrl.noMethod()}}
-</div>''');
- contextHelper.addSource("/my_styles.css", "");
- contextHelper.runTasks();
- // there are some errors in my_template.html
- {
- List<AnalysisError> errors = context.getErrors(indexSource).errors;
- expect(errors.length != 0, isTrue);
- }
- // make entry-point.html non-Angular
- context.setContents(entrySource, "<html/>");
- // ...errors in my_template.html should be removed
- {
- List<AnalysisError> errors = context.getErrors(indexSource).errors;
- expect(errors.length == 0, isTrue);
- }
- }
-
- void test_analysisContext_removeEntryPoint_clearAngularErrors_inDart() {
- addMainSource(r'''
-
-import 'angular.dart';
-
-@Component(
- templateUrl: 'no-such-template.html', cssUrl: 'my_styles.css',
- publishAs: 'ctrl',
- selector: 'myComponent')
-class MyComponent {
-}''');
- Source entrySource = contextHelper.addSource(
- "/entry-point.html",
- AngularTest.createHtmlWithAngular(''));
- contextHelper.addSource("/my_styles.css", "");
- contextHelper.runTasks();
- // there are some errors in MyComponent
- {
- List<AnalysisError> errors = context.getErrors(mainSource).errors;
- expect(errors.length != 0, isTrue);
- }
- // remove entry-point.html
- {
- ChangeSet changeSet = new ChangeSet();
- changeSet.removedSource(entrySource);
- context.applyChanges(changeSet);
- }
- // ...errors in MyComponent should be removed
- {
- List<AnalysisError> errors = context.getErrors(mainSource).errors;
- expect(errors.length == 0, isTrue);
- }
- }
-
- void test_contextProperties() {
- addMyController();
- _resolveIndexNoErrors(AngularTest.createHtmlWithAngular(r'''
-<div>
- {{$id}}
- {{$parent}}
- {{$root}}
-</div>'''));
- assertResolvedIdentifier("\$id");
- assertResolvedIdentifier("\$parent");
- assertResolvedIdentifier("\$root");
- }
-
- void test_getAngularElement_isAngular() {
- // prepare local variable "name" in compilation unit
- CompilationUnitElementImpl unit =
- ElementFactory.compilationUnit("test.dart");
- FunctionElementImpl function = ElementFactory.functionElement("main");
- unit.functions = <FunctionElement>[function];
- LocalVariableElementImpl local =
- ElementFactory.localVariableElement2("name");
- function.localVariables = <LocalVariableElement>[local];
- // set AngularElement
- AngularElement angularElement = new AngularControllerElementImpl("ctrl", 0);
- local.toolkitObjects = <AngularElement>[angularElement];
- expect(
- AngularHtmlUnitResolver.getAngularElement(local),
- same(angularElement));
- }
-
- void test_getAngularElement_notAngular() {
- Element element = ElementFactory.localVariableElement2("name");
- expect(AngularHtmlUnitResolver.getAngularElement(element), isNull);
- }
-
- void test_getAngularElement_notLocal() {
- Element element = ElementFactory.classElement2("Test");
- expect(AngularHtmlUnitResolver.getAngularElement(element), isNull);
- }
-
- /**
- * Test that we resolve "ng-click" expression.
- */
- void test_ngClick() {
- addMyController();
- _resolveIndexNoErrors(
- AngularTest.createHtmlWithMyController(
- r"<button ng-click='ctrl.doSomething($event)'/>"));
- assertResolvedIdentifier("doSomething");
- }
-
- void test_NgComponent_resolveTemplateFile() {
- addMainSource(r'''
-import 'angular.dart';
-
-@Component(
- templateUrl: 'my_template.html', cssUrl: 'my_styles.css',
- publishAs: 'ctrl',
- selector: 'myComponent')
-class MyComponent {
- String field;
-}''');
- contextHelper.addSource(
- "/entry-point.html",
- AngularTest.createHtmlWithAngular(''));
- addIndexSource2("/my_template.html", r'''
-<div>
- {{ctrl.field}}
-</div>''');
- contextHelper.addSource("/my_styles.css", "");
- contextHelper.runTasks();
- resolveIndex();
- assertNoErrors();
- assertResolvedIdentifier2("ctrl.", "MyComponent");
- assertResolvedIdentifier2("field}}", "String");
- }
-
- void test_NgComponent_updateDartFile() {
- Source componentSource = contextHelper.addSource("/my_component.dart", r'''
-library my.component;
-import 'angular.dart';
-@Component(selector: 'myComponent')
-class MyComponent {
-}''');
- contextHelper.addSource("/my_module.dart", r'''
-library my.module;
-import 'my_component.dart';''');
- addMainSource(r'''
-library main;
-import 'my_module.dart';''');
- _resolveIndexNoErrors(
- AngularTest.createHtmlWithMyController("<myComponent/>"));
- // "myComponent" tag was resolved
- {
- ht.XmlTagNode tagNode =
- ht.HtmlUnitUtils.getTagNode(indexUnit, findOffset2("myComponent"));
- AngularSelectorElement tagElement =
- tagNode.element as AngularSelectorElement;
- expect(tagElement, isNotNull);
- expect(tagElement.name, "myComponent");
- }
- // replace "myComponent" with "myComponent2"
- // in my_component.dart and index.html
- {
- context.setContents(
- componentSource,
- _getSourceContent(componentSource).replaceAll("myComponent", "myComponent2"));
- indexContent =
- _getSourceContent(indexSource).replaceAll("myComponent", "myComponent2");
- context.setContents(indexSource, indexContent);
- }
- contextHelper.runTasks();
- resolveIndex();
- // "myComponent2" tag should be resolved
- {
- ht.XmlTagNode tagNode =
- ht.HtmlUnitUtils.getTagNode(indexUnit, findOffset2("myComponent2"));
- AngularSelectorElement tagElement =
- tagNode.element as AngularSelectorElement;
- expect(tagElement, isNotNull);
- expect(tagElement.name, "myComponent2");
- }
- }
-
- void test_NgComponent_use_resolveAttributes() {
- contextHelper.addSource("/my_template.html", r'''
- <div>
- {{ctrl.field}}
- </div>''');
- addMainSource(r'''
-
-import 'angular.dart';
-
-@Component(
- templateUrl: 'my_template.html', cssUrl: 'my_styles.css',
- publishAs: 'ctrl',
- selector: 'myComponent', // selector
- map: const {'attrA' : '=>setA', 'attrB' : '@setB'})
-class MyComponent {
- set setA(value) {}
- set setB(value) {}
-}''');
- _resolveIndexNoErrors(AngularTest.createHtmlWithMyController(r'''
-<input type='text' ng-model='someModel'/>
-<myComponent attrA='someModel' attrB='bbb'/>'''));
- // "attrA" attribute expression was resolved
- expect(findIdentifier("someModel"), isNotNull);
- // "myComponent" tag was resolved
- ht.XmlTagNode tagNode =
- ht.HtmlUnitUtils.getTagNode(indexUnit, findOffset2("myComponent"));
- AngularSelectorElement tagElement =
- tagNode.element as AngularSelectorElement;
- expect(tagElement, isNotNull);
- expect(tagElement.name, "myComponent");
- expect(tagElement.nameOffset, findMainOffset("myComponent', // selector"));
- // "attrA" attribute was resolved
- {
- ht.XmlAttributeNode node =
- ht.HtmlUnitUtils.getAttributeNode(indexUnit, findOffset2("attrA='"));
- AngularPropertyElement element = node.element as AngularPropertyElement;
- expect(element, isNotNull);
- expect(element.name, "attrA");
- expect(element.field.name, "setA");
- }
- // "attrB" attribute was resolved, even if it @binding
- {
- ht.XmlAttributeNode node =
- ht.HtmlUnitUtils.getAttributeNode(indexUnit, findOffset2("attrB='"));
- AngularPropertyElement element = node.element as AngularPropertyElement;
- expect(element, isNotNull);
- expect(element.name, "attrB");
- expect(element.field.name, "setB");
- }
- }
-
- void test_NgDirective_noAttribute() {
- addMainSource(r'''
-
-import 'angular.dart';
-
-@NgDirective(selector: '[my-directive]', map: const {'foo': '=>input'})
-class MyDirective {
- set input(value) {}
-}''');
- _resolveIndexNoErrors(AngularTest.createHtmlWithMyController(r'''
-<div my-directive>
-</div>'''));
- }
-
- void test_NgDirective_noExpression() {
- addMainSource(r'''
-
-import 'angular.dart';
-
-@NgDirective(selector: '[my-directive]', map: const {'.': '=>input'})
-class MyDirective {
- set input(value) {}
-}''');
- _resolveIndexNoErrors(AngularTest.createHtmlWithMyController(r'''
-<div my-directive>
-</div>'''));
- }
-
- void test_NgDirective_resolvedExpression() {
- addMainSource(r'''
-
-import 'angular.dart';
-
-@Decorator(selector: '[my-directive]')
-class MyDirective {
- @NgOneWay('my-property')
- String condition;
-}''');
- _resolveIndexNoErrors(AngularTest.createHtmlWithMyController(r'''
-<input type='text' ng-model='name'>
-<div my-directive my-property='name != null'>
-</div>'''));
- resolveMainNoErrors();
- // "my-directive" attribute was resolved
- {
- AngularSelectorElement selector =
- findMainElement(ElementKind.ANGULAR_SELECTOR, "my-directive");
- ht.XmlAttributeNode attrNodeSelector =
- ht.HtmlUnitUtils.getAttributeNode(indexUnit, findOffset2("my-directive"));
- expect(attrNodeSelector, isNotNull);
- expect(attrNodeSelector.element, same(selector));
- }
- // "my-property" attribute was resolved
- {
- ht.XmlAttributeNode attrNodeProperty =
- ht.HtmlUnitUtils.getAttributeNode(indexUnit, findOffset2("my-property='"));
- AngularPropertyElement propertyElement =
- attrNodeProperty.element as AngularPropertyElement;
- expect(propertyElement, isNotNull);
- expect(propertyElement.propertyKind, same(AngularPropertyKind.ONE_WAY));
- expect(propertyElement.field.name, "condition");
- }
- // "name" expression was resolved
- expect(findIdentifier("name != null"), isNotNull);
- }
-
- void test_NgDirective_resolvedExpression_attrString() {
- addMainSource(r'''
-
-import 'angular.dart';
-
-@NgDirective(selector: '[my-directive])
-class MyDirective {
- @NgAttr('my-property')
- String property;
-}''');
- _resolveIndexNoErrors(AngularTest.createHtmlWithMyController(r'''
-<input type='text' ng-model='name'>
-<div my-directive my-property='name != null'>
-</div>'''));
- resolveMain();
- // @NgAttr means "string attribute", which we don't parse
- expect(findIdentifierMaybe("name != null"), isNull);
- }
-
- void test_NgDirective_resolvedExpression_dotAsName() {
- addMainSource(r'''
-
-import 'angular.dart';
-
-@Decorator(
- selector: '[my-directive]',
- map: const {'.' : '=>condition'})
-class MyDirective {
- set condition(value) {}
-}''');
- _resolveIndexNoErrors(AngularTest.createHtmlWithMyController(r'''
-<input type='text' ng-model='name'>
-<div my-directive='name != null'>
-</div>'''));
- // "name" attribute was resolved
- expect(findIdentifier("name != null"), isNotNull);
- }
-
- /**
- * Test that we resolve "ng-if" expression.
- */
- void test_ngIf() {
- addMyController();
- _resolveIndexNoErrors(
- AngularTest.createHtmlWithMyController("<div ng-if='ctrl.field != null'/>"));
- assertResolvedIdentifier("field");
- }
-
- void test_ngModel_modelAfterUsage() {
- addMyController();
- _resolveIndexNoErrors(AngularTest.createHtmlWithMyController(r'''
-<h3>Hello {{name}}!</h3>
-<input type='text' ng-model='name'>'''));
- assertResolvedIdentifier2("name}}!", "String");
- assertResolvedIdentifier2("name'>", "String");
- }
-
- void test_ngModel_modelBeforeUsage() {
- addMyController();
- _resolveIndexNoErrors(AngularTest.createHtmlWithMyController(r'''
-<input type='text' ng-model='name'>
-<h3>Hello {{name}}!</h3>'''));
- assertResolvedIdentifier2("name}}!", "String");
- Element element = assertResolvedIdentifier2("name'>", "String");
- expect(element.name, "name");
- expect(element.nameOffset, findOffset2("name'>"));
- }
-
- void test_ngModel_notIdentifier() {
- addMyController();
- _resolveIndexNoErrors(
- AngularTest.createHtmlWithMyController(
- "<input type='text' ng-model='ctrl.field'>"));
- assertResolvedIdentifier2("field'>", "String");
- }
-
- /**
- * Test that we resolve "ng-mouseout" expression.
- */
- void test_ngMouseOut() {
- addMyController();
- _resolveIndexNoErrors(
- AngularTest.createHtmlWithMyController(
- r"<button ng-mouseout='ctrl.doSomething($event)'/>"));
- assertResolvedIdentifier("doSomething");
- }
-
- /**
- * Test that we resolve "ng-show" expression.
- */
- void test_ngShow() {
- addMyController();
- _resolveIndexNoErrors(
- AngularTest.createHtmlWithMyController("<div ng-show='ctrl.field != null'/>"));
- assertResolvedIdentifier("field");
- }
-
- void test_notResolved_noDartScript() {
- resolveIndex2(r'''
-<html ng-app>
- <body>
- <div my-marker>
- {{ctrl.field}}
- </div>
- </body>
-</html>''');
- assertNoErrors();
- // Angular is not initialized, so "ctrl" is not parsed
- Expression expression =
- ht.HtmlUnitUtils.getExpression(indexUnit, findOffset2("ctrl"));
- expect(expression, isNull);
- }
-
- void test_notResolved_notAngular() {
- resolveIndex2(r'''
-<html no-ng-app>
- <body>
- <div my-marker>
- {{ctrl.field}}
- </div>
- </body>
-</html>''');
- assertNoErrors();
- // Angular is not initialized, so "ctrl" is not parsed
- Expression expression =
- ht.HtmlUnitUtils.getExpression(indexUnit, findOffset2("ctrl"));
- expect(expression, isNull);
- }
-
- void test_notResolved_wrongControllerMarker() {
- addMyController();
- addIndexSource(r'''
-<html ng-app>
- <body>
- <div not-my-marker>
- {{ctrl.field}}
- </div>
- <script type='application/dart' src='main.dart'></script>
- </body>
-</html>''');
- contextHelper.runTasks();
- resolveIndex();
- // no errors, because we decided to ignore them at the moment
- assertNoErrors();
- // "ctrl" is not resolved
- SimpleIdentifier identifier = findIdentifier("ctrl");
- expect(identifier.bestElement, isNull);
- }
-
- void test_resolveExpression_evenWithout_ngBootstrap() {
- resolveMainSource(r'''
-
-import 'angular.dart';
-
-@Controller(
- selector: '[my-controller]',
- publishAs: 'ctrl')
-class MyController {
- String field;
-}''');
- _resolveIndexNoErrors(r'''
-<html ng-app>
- <body>
- <div my-controller>
- {{ctrl.field}}
- </div>
- <script type='application/dart' src='main.dart'></script>
- </body>
-</html>''');
- assertResolvedIdentifier2("ctrl.", "MyController");
- }
-
- void test_resolveExpression_ignoreUnresolved() {
- resolveMainSource(r'''
-
-import 'angular.dart';
-
-@Controller(
- selector: '[my-controller]',
- publishAs: 'ctrl')
-class MyController {
- Map map;
- Object obj;
-}''');
- resolveIndex2(r'''
-<html ng-app>
- <body>
- <div my-controller>
- {{ctrl.map.property}}
- {{ctrl.obj.property}}
- {{invisibleScopeProperty}}
- </div>
- <script type='application/dart' src='main.dart'></script>
- </body>
-</html>''');
- assertNoErrors();
- // "ctrl.map" and "ctrl.obj" are resolved
- assertResolvedIdentifier2("map", "Map<dynamic, dynamic>");
- assertResolvedIdentifier2("obj", "Object");
- // ...but not "invisibleScopeProperty"
- {
- SimpleIdentifier identifier = findIdentifier("invisibleScopeProperty");
- expect(identifier.bestElement, isNull);
- }
- }
-
- void test_resolveExpression_inAttribute() {
- addMyController();
- _resolveIndexNoErrors(
- AngularTest.createHtmlWithMyController(
- "<button title='{{ctrl.field}}'></button>"));
- assertResolvedIdentifier2("ctrl", "MyController");
- }
-
- void test_resolveExpression_ngApp_onBody() {
- addMyController();
- _resolveIndexNoErrors(r'''
-<html>
- <body ng-app>
- <div my-controller>
- {{ctrl.field}}
- </div>
- <script type='application/dart' src='main.dart'></script>
- </body>
-</html>''');
- assertResolvedIdentifier2("ctrl", "MyController");
- }
-
- void test_resolveExpression_withFormatter() {
- addMyController();
- _resolveIndexNoErrors(
- AngularTest.createHtmlWithMyController("{{ctrl.field | uppercase}}"));
- assertResolvedIdentifier2("ctrl", "MyController");
- assertResolvedIdentifier("uppercase");
- }
-
- void test_resolveExpression_withFormatter_missingColon() {
- addMyController();
- resolveIndex2(
- AngularTest.createHtmlWithMyController(
- "{{ctrl.field | uppercase, lowercase}}"));
- assertErrors(indexSource, [AngularCode.MISSING_FORMATTER_COLON]);
- }
-
- void test_resolveExpression_withFormatter_notSimpleIdentifier() {
- addMyController();
- resolveIndex2(
- AngularTest.createHtmlWithMyController("{{ctrl.field | not.supported}}"));
- assertErrors(indexSource, [AngularCode.INVALID_FORMATTER_NAME]);
- }
-
- void test_scopeProperties() {
- addMainSource(r'''
-
-import 'angular.dart';
-
-@Component(
- templateUrl: 'my_template.html', cssUrl: 'my_styles.css',
- publishAs: 'ctrl',
- selector: 'myComponent')
-class MyComponent {
- String field;
- MyComponent(Scope scope) {
- scope.context['scopeProperty'] = 'abc';
- }
-}
-''');
- contextHelper.addSource(
- "/entry-point.html",
- AngularTest.createHtmlWithAngular(''));
- addIndexSource2("/my_template.html", r'''
-<div>
- {{scopeProperty}}
-</div>''');
- contextHelper.addSource("/my_styles.css", "");
- contextHelper.runTasks();
- resolveIndex();
- assertNoErrors();
- // "scopeProperty" is resolved
- Element element = assertResolvedIdentifier2("scopeProperty}}", "String");
- EngineTestCase.assertInstanceOf(
- (obj) => obj is AngularScopePropertyElement,
- AngularScopePropertyElement,
- AngularHtmlUnitResolver.getAngularElement(element));
- }
-
- void test_scopeProperties_hideWithComponent() {
- addMainSource(r'''
-
-import 'angular.dart';
-
-@Component(
- templateUrl: 'my_template.html', cssUrl: 'my_styles.css',
- publishAs: 'ctrl',
- selector: 'myComponent')
-class MyComponent {
-}
-
-void setScopeProperties(Scope scope) {
- scope.context['ctrl'] = 1;
-}
-''');
- contextHelper.addSource(
- "/entry-point.html",
- AngularTest.createHtmlWithAngular(''));
- addIndexSource2("/my_template.html", r'''
-<div>
- {{ctrl}}
-</div>''');
- contextHelper.addSource("/my_styles.css", "");
- contextHelper.runTasks();
- resolveIndex();
- assertNoErrors();
- // "ctrl" is resolved
- LocalVariableElement element =
- assertResolvedIdentifier("ctrl}}") as LocalVariableElement;
- List<ToolkitObjectElement> toolkitObjects = element.toolkitObjects;
- EngineTestCase.assertInstanceOf(
- (obj) => obj is AngularComponentElement,
- AngularComponentElement,
- toolkitObjects[0]);
- }
-
- void test_view_resolveTemplateFile() {
- addMainSource(r'''
-
-import 'angular.dart';
-
-@Controller(
- selector: '[my-controller]',
- publishAs: 'ctrl')
-class MyController {
- String field;
-}
-
-class MyRouteInitializer {
- init(ViewFactory view) {
- view('my_template.html');
- }
-}''');
- contextHelper.addSource(
- "/entry-point.html",
- AngularTest.createHtmlWithAngular(''));
- addIndexSource2("/my_template.html", r'''
-<div my-controller>
- {{ctrl.field}}
-</div>''');
- contextHelper.addSource("/my_styles.css", "");
- contextHelper.runTasks();
- resolveIndex();
- assertNoErrors();
- assertResolvedIdentifier2("ctrl.", "MyController");
- assertResolvedIdentifier2("field}}", "String");
- }
-
- String _getSourceContent(Source source) {
- return context.getContents(source).data.toString();
- }
-
- void _resolveIndexNoErrors(String content) {
- resolveIndex2(content);
- assertNoErrors();
- verify([indexSource]);
- }
-}
-
-
-/**
- * Tests for [HtmlUnitUtils] for Angular HTMLs.
- */
-@ReflectiveTestCase()
-class AngularHtmlUnitUtilsTest extends AngularTest {
- void test_getElement_forExpression() {
- addMyController();
- _resolveSimpleCtrlFieldHtml();
- // prepare expression
- int offset = indexContent.indexOf("ctrl");
- Expression expression = ht.HtmlUnitUtils.getExpression(indexUnit, offset);
- // get element
- Element element = ht.HtmlUnitUtils.getElement(expression);
- EngineTestCase.assertInstanceOf(
- (obj) => obj is VariableElement,
- VariableElement,
- element);
- expect(element.name, "ctrl");
- }
-
- void test_getElement_forExpression_null() {
- Element element = ht.HtmlUnitUtils.getElement(null);
- expect(element, isNull);
- }
-
- void test_getElement_forOffset() {
- addMyController();
- _resolveSimpleCtrlFieldHtml();
- // no expression
- {
- Element element = ht.HtmlUnitUtils.getElementAtOffset(indexUnit, 0);
- expect(element, isNull);
- }
- // has expression at offset
- {
- int offset = indexContent.indexOf("field");
- Element element = ht.HtmlUnitUtils.getElementAtOffset(indexUnit, offset);
- EngineTestCase.assertInstanceOf(
- (obj) => obj is PropertyAccessorElement,
- PropertyAccessorElement,
- element);
- expect(element.name, "field");
- }
- }
-
- void test_getElementToOpen_controller() {
- addMyController();
- _resolveSimpleCtrlFieldHtml();
- // prepare expression
- int offset = indexContent.indexOf("ctrl");
- Expression expression = ht.HtmlUnitUtils.getExpression(indexUnit, offset);
- // get element
- Element element = ht.HtmlUnitUtils.getElementToOpen(indexUnit, expression);
- EngineTestCase.assertInstanceOf(
- (obj) => obj is AngularControllerElement,
- AngularControllerElement,
- element);
- expect(element.name, "ctrl");
- }
-
- void test_getElementToOpen_field() {
- addMyController();
- _resolveSimpleCtrlFieldHtml();
- // prepare expression
- int offset = indexContent.indexOf("field");
- Expression expression = ht.HtmlUnitUtils.getExpression(indexUnit, offset);
- // get element
- Element element = ht.HtmlUnitUtils.getElementToOpen(indexUnit, expression);
- EngineTestCase.assertInstanceOf(
- (obj) => obj is PropertyAccessorElement,
- PropertyAccessorElement,
- element);
- expect(element.name, "field");
- }
-
- void test_getEnclosingTagNode() {
- resolveIndex2(r'''
-<html>
- <body ng-app>
- <badge name='abc'> 123 </badge>
- </body>
-</html>''');
- // no unit
- expect(ht.HtmlUnitUtils.getEnclosingTagNode(null, 0), isNull);
- // wrong offset
- expect(ht.HtmlUnitUtils.getEnclosingTagNode(indexUnit, -1), isNull);
- // valid offset
- ht.XmlTagNode expected = _getEnclosingTagNode("<badge");
- expect(expected, isNotNull);
- expect(expected.tag, "badge");
- expect(_getEnclosingTagNode("badge"), same(expected));
- expect(_getEnclosingTagNode("name="), same(expected));
- expect(_getEnclosingTagNode("123"), same(expected));
- expect(_getEnclosingTagNode("/badge"), same(expected));
- }
-
- void test_getExpression() {
- addMyController();
- _resolveSimpleCtrlFieldHtml();
- // try offset without expression
- expect(ht.HtmlUnitUtils.getExpression(indexUnit, 0), isNull);
- // try offset with expression
- int offset = indexContent.indexOf("ctrl");
- expect(ht.HtmlUnitUtils.getExpression(indexUnit, offset), isNotNull);
- expect(ht.HtmlUnitUtils.getExpression(indexUnit, offset + 1), isNotNull);
- expect(ht.HtmlUnitUtils.getExpression(indexUnit, offset + 2), isNotNull);
- expect(
- ht.HtmlUnitUtils.getExpression(indexUnit, offset + "ctrl.field".length),
- isNotNull);
- // try without unit
- expect(ht.HtmlUnitUtils.getExpression(null, offset), isNull);
- }
-
- void test_getTagNode() {
- resolveIndex2(r'''
-<html>
- <body ng-app>
- <badge name='abc'> 123 </badge> done
- </body>
-</html>''');
- // no unit
- expect(ht.HtmlUnitUtils.getTagNode(null, 0), isNull);
- // wrong offset
- expect(ht.HtmlUnitUtils.getTagNode(indexUnit, -1), isNull);
- // on tag name
- ht.XmlTagNode expected = _getTagNode("badge name=");
- expect(expected, isNotNull);
- expect(expected.tag, "badge");
- expect(_getTagNode("badge"), same(expected));
- expect(_getTagNode(" name="), same(expected));
- expect(_getTagNode("adge name="), same(expected));
- expect(_getTagNode("badge>"), same(expected));
- expect(_getTagNode("adge>"), same(expected));
- expect(_getTagNode("> done"), same(expected));
- // in tag node, but not on the name token
- expect(_getTagNode("name="), isNull);
- expect(_getTagNode("123"), isNull);
- }
-
- ht.XmlTagNode _getEnclosingTagNode(String search) {
- return ht.HtmlUnitUtils.getEnclosingTagNode(
- indexUnit,
- indexContent.indexOf(search));
- }
-
- ht.XmlTagNode _getTagNode(String search) {
- return ht.HtmlUnitUtils.getTagNode(indexUnit, indexContent.indexOf(search));
- }
-
- void _resolveSimpleCtrlFieldHtml() {
- resolveIndex2(r'''
-<html>
- <body ng-app>
- <div my-controller>
- {{ctrl.field}}
- </div>
- <script type='application/dart' src='main.dart'></script>
- </body>
-</html>''');
- }
-}
-
-
-abstract class AngularTest extends EngineTestCase {
- AnalysisContextHelper contextHelper = new AnalysisContextHelper();
-
- AnalysisContext context;
-
- String mainContent;
-
- Source mainSource;
-
- CompilationUnit mainUnit;
-
- CompilationUnitElement mainUnitElement;
- String indexContent;
- Source indexSource;
- ht.HtmlUnit indexUnit;
- HtmlElement indexHtmlUnit;
- CompilationUnitElement indexDartUnitElement;
- /**
- * Fills [indexContent] and [indexSource].
- */
- void addIndexSource(String content) {
- addIndexSource2("/index.html", content);
- }
- /**
- * Fills [indexContent] and [indexSource].
- */
- void addIndexSource2(String name, String content) {
- indexContent = content;
- indexSource = contextHelper.addSource(name, indexContent);
- }
- /**
- * Fills [mainContent] and [mainSource].
- */
- void addMainSource(String content) {
- mainContent = content;
- mainSource = contextHelper.addSource("/main.dart", content);
- }
- void addMyController() {
- resolveMainSource(r'''
-
-import 'angular.dart';
-
-class Item {
- String name;
- bool done;
-}
-
-@Controller(
- selector: '[my-controller]',
- publishAs: 'ctrl')
-class MyController {
- String field;
- List<String> names;
- List<Item> items;
- var untypedItems;
- doSomething(event) {}
-}''');
- }
- /**
- * Assert that the number of errors reported against the given source matches the number of errors
- * that are given and that they have the expected error codes. The order in which the errors were
- * gathered is ignored.
- *
- * @param source the source against which the errors should have been reported
- * @param expectedErrorCodes the error codes of the errors that should have been reported
- * @throws AnalysisException if the reported errors could not be computed
- * @throws AssertionFailedError if a different number of errors have been reported than were
- * expected
- */
- void assertErrors(Source source, [List<ErrorCode> expectedErrorCodes =
- ErrorCode.EMPTY_LIST]) {
- GatheringErrorListener errorListener = new GatheringErrorListener();
- AnalysisErrorInfo errorsInfo = context.getErrors(source);
- for (AnalysisError error in errorsInfo.errors) {
- errorListener.onError(error);
- }
- errorListener.assertErrorsWithCodes(expectedErrorCodes);
- }
-
- void assertMainErrors(List<ErrorCode> expectedErrorCodes) {
- assertErrors(mainSource, expectedErrorCodes);
- }
-
- /**
- * Assert that no errors have been reported against the [indexSource].
- */
- void assertNoErrors() {
- assertErrors(indexSource);
- }
-
- void assertNoErrors2(Source source) {
- assertErrors(source);
- }
-
- /**
- * Assert that no errors have been reported against the [mainSource].
- */
- void assertNoMainErrors() {
- assertErrors(mainSource);
- }
-
- /**
- * Checks that [indexHtmlUnit] has [SimpleIdentifier] with given name, resolved to
- * not `null` [Element].
- */
- Element assertResolvedIdentifier(String name) {
- SimpleIdentifier identifier = findIdentifier(name);
- // check Element
- Element element = identifier.bestElement;
- expect(element, isNotNull);
- // return Element for further analysis
- return element;
- }
-
- Element assertResolvedIdentifier2(String name, String expectedTypeName) {
- SimpleIdentifier identifier = findIdentifier(name);
- // check Element
- Element element = identifier.bestElement;
- expect(element, isNotNull);
- // check Type
- DartType type = identifier.bestType;
- expect(type, isNotNull);
- expect(type.toString(), expectedTypeName);
- // return Element for further analysis
- return element;
- }
-
- /**
- * @return [AstNode] which has required offset and type.
- */
- AstNode findExpression(int offset, Predicate<AstNode> predicate) {
- Expression expression = ht.HtmlUnitUtils.getExpression(indexUnit, offset);
- return expression != null ? expression.getAncestor(predicate) : null;
- }
-
- /**
- * Returns the [SimpleIdentifier] at the given search pattern. Fails if not found.
- */
- SimpleIdentifier findIdentifier(String search) {
- SimpleIdentifier identifier = findIdentifierMaybe(search);
- expect(identifier, isNotNull, reason: "$search in $indexContent");
- // check that offset/length of the identifier is valid
- {
- int offset = identifier.offset;
- int end = identifier.end;
- String contentStr = indexContent.substring(offset, end);
- expect(contentStr, identifier.name);
- }
- // done
- return identifier;
- }
-
- /**
- * Returns the [SimpleIdentifier] at the given search pattern, or `null` if not found.
- */
- SimpleIdentifier findIdentifierMaybe(String search) {
- return findExpression(
- findOffset2(search),
- (node) => node is SimpleIdentifier);
- }
-
- /**
- * Returns [Element] from [indexDartUnitElement].
- */
- Element findIndexElement(String name) {
- return findElement2(indexDartUnitElement, name);
- }
-
- /**
- * Returns [Element] from [mainUnitElement].
- */
- Element findMainElement(ElementKind kind, String name) {
- return findElement(mainUnitElement, kind, name);
- }
-
- /**
- * Returns [Element] from [mainUnitElement].
- */
- Element findMainElement2(String name) => findElement2(mainUnitElement, name);
-
- /**
- * @return the offset of given <code>search</code> string in [mainContent]. Fails test if
- * not found.
- */
- int findMainOffset(String search) => findOffset(mainContent, search);
-
- /**
- * @return the offset of given <code>search</code> string in [indexContent]. Fails test if
- * not found.
- */
- int findOffset2(String search) => findOffset(indexContent, search);
-
- /**
- * Resolves [indexSource].
- */
- void resolveIndex() {
- indexUnit = context.resolveHtmlUnit(indexSource);
- indexHtmlUnit = indexUnit.element;
- indexDartUnitElement = indexHtmlUnit.angularCompilationUnit;
- }
-
- void resolveIndex2(String content) {
- addIndexSource(content);
- contextHelper.runTasks();
- resolveIndex();
- }
-
- /**
- * Resolves [mainSource].
- */
- void resolveMain() {
- mainUnit = contextHelper.resolveDefiningUnit(mainSource);
- mainUnitElement = mainUnit.element;
- }
-
- /**
- * Resolves [mainSource].
- */
- void resolveMainNoErrors() {
- resolveMain();
- assertNoErrors2(mainSource);
- }
-
- void resolveMainSource(String content) {
- addMainSource(content);
- resolveMain();
- }
-
- void resolveMainSourceNoErrors(String content) {
- resolveMainSource(content);
- assertNoErrors2(mainSource);
- }
-
- @override
- void setUp() {
- super.setUp();
- _configureForAngular(contextHelper);
- context = contextHelper.context;
- }
-
- @override
- void tearDown() {
- contextHelper = null;
- context = null;
- // main
- mainContent = null;
- mainSource = null;
- mainUnit = null;
- mainUnitElement = null;
- // index
- indexContent = null;
- indexSource = null;
- indexUnit = null;
- indexHtmlUnit = null;
- indexDartUnitElement = null;
- // super
- super.tearDown();
- }
-
- /**
- * Verify that all of the identifiers in the HTML units associated with the given sources have
- * been resolved.
- *
- * @param sources the sources identifying the compilation units to be verified
- * @throws Exception if the contents of the compilation unit cannot be accessed
- */
- void verify(List<Source> sources) {
- ResolutionVerifier verifier = new ResolutionVerifier();
- for (Source source in sources) {
- ht.HtmlUnit htmlUnit = context.getResolvedHtmlUnit(source);
- htmlUnit.accept(new ExpressionVisitor_AngularTest_verify(verifier));
- }
- verifier.assertResolved();
- }
-
- void _configureForAngular(AnalysisContextHelper contextHelper) {
- contextHelper.addSource("/angular.dart", r'''
-library angular;
-
-class Scope {
- Map context;
-}
-
-class Formatter {
- final String name;
- const Formatter({this.name});
-}
-
-class Directive {
- const Directive({
- selector,
- children,
- visibility,
- module,
- map,
- exportedExpressions,
- exportedExpressionAttrs
- });
-}
-
-class Decorator {
- const Decorator({
- children/*: Directive.COMPILE_CHILDREN*/,
- map,
- selector,
- module,
- visibility,
- exportedExpressions,
- exportedExpressionAttrs
- });
-}
-
-class Controller {
- const Controller({
- children,
- publishAs,
- map,
- selector,
- visibility,
- publishTypes,
- exportedExpressions,
- exportedExpressionAttrs
- });
-}
-
-class NgAttr {
- const NgAttr(String name);
-}
-class NgCallback {
- const NgCallback(String name);
-}
-class NgOneWay {
- const NgOneWay(String name);
-}
-class NgOneWayOneTime {
- const NgOneWayOneTime(String name);
-}
-class NgTwoWay {
- const NgTwoWay(String name);
-}
-
-class Component extends Directive {
- const Component({
- this.template,
- this.templateUrl,
- this.cssUrl,
- this.applyAuthorStyles,
- this.resetStyleInheritance,
- publishAs,
- module,
- map,
- selector,
- visibility,
- exportExpressions,
- exportExpressionAttrs
- }) : super(selector: selector,
- children: null/*NgAnnotation.COMPILE_CHILDREN*/,
- visibility: visibility,
- map: map,
- module: module,
- exportExpressions: exportExpressions,
- exportExpressionAttrs: exportExpressionAttrs);
-}
-
-@Decorator(selector: '[ng-click]', map: const {'ng-click': '&onEvent'})
-@Decorator(selector: '[ng-mouseout]', map: const {'ng-mouseout': '&onEvent'})
-class NgEventDirective {
- set onEvent(value) {}
-}
-
-@Decorator(selector: '[ng-if]', map: const {'ng-if': '=>condition'})
-class NgIfDirective {
- set condition(value) {}
-}
-
-@Decorator(selector: '[ng-show]', map: const {'ng-show': '=>show'})
-class NgShowDirective {
- set show(value) {}
-}
-
-@Formatter(name: 'filter')
-class FilterFormatter {}
-
-@Formatter(name: 'orderBy')
-class OrderByFilter {}
-
-@Formatter(name: 'uppercase')
-class UppercaseFilter {}
-
-class ViewFactory {
- call(String templateUrl) => null;
-}
-
-class Module {
- install(Module m) {}
- type(Type t) {}
- value(Type t, value) {}
-}
-
-class Injector {}
-
-Injector ngBootstrap({
- Module module: null,
- List<Module> modules: null,
- /*dom.Element*/ element: null,
- String selector: '[ng-app]',
- /*Injector*/ injectorFactory/*(List<Module> modules): _defaultInjectorFactory*/}) {}
-''');
- }
-
- /**
- * Creates an HTML content that has Angular marker and script with
- * the "main.dart" reference.
- */
- static String createHtmlWithAngular(String innerCode) {
- String source = '''
-<html ng-app>
- <body>
-$innerCode
- <script type='application/dart' src='main.dart'></script>
- </body>
-</html>''';
- return source;
- }
-
- /**
- * Creates an HTML content that has Angular marker, script with "main.dart" reference and
- * "MyController" injected.
- */
- static String createHtmlWithMyController(String innerHtml) {
- String source = '''
-<html ng-app>
- <body>
- <div my-controller>
-$innerHtml
- </div>
- <script type='application/dart' src='main.dart'></script>
- </body>
-</html>''';
- return source;
- }
-
- /**
- * Finds an [Element] with the given names inside of the given root [Element].
- *
- * TODO(scheglov) maybe move this method to Element
- *
- * @param root the root [Element] to start searching from
- * @param kind the kind of the [Element] to find, if `null` then any kind
- * @param name the name of an [Element] to find
- * @return the found [Element] or `null` if not found
- */
- static Element findElement(Element root, ElementKind kind, String name) {
- _AngularTest_findElement visitor = new _AngularTest_findElement(kind, name);
- root.accept(visitor);
- return visitor.result;
- }
-
- /**
- * Finds an [Element] with the given names inside of the given root [Element].
- *
- * @param root the root [Element] to start searching from
- * @param name the name of an [Element] to find
- * @return the found [Element] or `null` if not found
- */
- static Element findElement2(Element root, String name) {
- return findElement(root, null, name);
- }
-
- /**
- * @return the offset of given <code>search</code> string in <code>content</code>. Fails test if
- * not found.
- */
- static int findOffset(String content, String search) {
- int offset = content.indexOf(search);
- expect(offset, isNot(-1));
- return offset;
- }
-}
-
-
-@ReflectiveTestCase()
+@reflectiveTest
class ConstantEvaluatorTest extends ResolverTestCase {
void fail_constructor() {
EvaluationResult result = _getExpressionValue("?");
@@ -3380,7 +835,7 @@
}
-@ReflectiveTestCase()
+@reflectiveTest
class ConstantFinderTest extends EngineTestCase {
AstNode _node;
@@ -3516,7 +971,7 @@
}
-@ReflectiveTestCase()
+@reflectiveTest
class ConstantValueComputerTest extends ResolverTestCase {
void test_annotation_constConstructor() {
CompilationUnit compilationUnit = resolveSource(r'''
@@ -4750,7 +2205,7 @@
}
-@ReflectiveTestCase()
+@reflectiveTest
class ConstantVisitorTest extends ResolverTestCase {
void test_visitConditionalExpression_false() {
Expression thenExpression = AstFactory.integer(1);
@@ -4922,7 +2377,7 @@
}
-@ReflectiveTestCase()
+@reflectiveTest
class ContentCacheTest {
void test_setContents() {
Source source = new TestSource();
@@ -4942,7 +2397,7 @@
}
-@ReflectiveTestCase()
+@reflectiveTest
class DartObjectImplTest extends EngineTestCase {
TypeProvider _typeProvider = new TestTypeProvider();
@@ -7191,7 +4646,7 @@
}
-@ReflectiveTestCase()
+@reflectiveTest
class DartUriResolverTest {
void test_creation() {
JavaFile sdkDirectory = DirectoryBasedDartSdk.defaultSdkDirectory;
@@ -7237,7 +4692,7 @@
}
-@ReflectiveTestCase()
+@reflectiveTest
class DeclaredVariablesTest extends EngineTestCase {
void test_getBool_false() {
TestTypeProvider typeProvider = new TestTypeProvider();
@@ -7339,7 +4794,7 @@
}
-@ReflectiveTestCase()
+@reflectiveTest
class DirectoryBasedDartSdkTest {
void fail_getDocFileFor() {
DirectoryBasedDartSdk sdk = _createDartSdk();
@@ -7452,7 +4907,7 @@
}
-@ReflectiveTestCase()
+@reflectiveTest
class DirectoryBasedSourceContainerTest {
void test_contains() {
JavaFile dir = FileUtilities2.createFile("/does/not/exist");
@@ -7472,7 +4927,7 @@
}
-@ReflectiveTestCase()
+@reflectiveTest
class ElementBuilderTest extends EngineTestCase {
void test_visitCatchClause() {
ElementHolder holder = new ElementHolder();
@@ -8729,7 +6184,7 @@
}
-@ReflectiveTestCase()
+@reflectiveTest
class ElementLocatorTest extends ResolverTestCase {
void fail_locate_ExportDirective() {
AstNode id = _findNodeIn("export", "export 'dart:core';");
@@ -9200,7 +6655,7 @@
}
-@ReflectiveTestCase()
+@reflectiveTest
class EnumMemberBuilderTest extends EngineTestCase {
void test_visitEnumDeclaration_multiple() {
String firstName = "ONE";
@@ -9283,7 +6738,7 @@
}
-@ReflectiveTestCase()
+@reflectiveTest
class ErrorReporterTest extends EngineTestCase {
/**
* Create a type with the given name in a compilation unit with the given name.
@@ -9336,7 +6791,7 @@
}
-@ReflectiveTestCase()
+@reflectiveTest
class ErrorSeverityTest extends EngineTestCase {
void test_max_error_error() {
expect(
@@ -9394,7 +6849,7 @@
}
-@ReflectiveTestCase()
+@reflectiveTest
class ExitDetectorTest extends ParserTestCase {
void fail_doStatement_continue_with_label() {
_assertFalse("{ x: do { continue x; } while(true); }");
@@ -9884,19 +7339,7 @@
}
-class ExpressionVisitor_AngularTest_verify extends ExpressionVisitor {
- ResolutionVerifier verifier;
-
- ExpressionVisitor_AngularTest_verify(this.verifier);
-
- @override
- void visitExpression(Expression expression) {
- expression.accept(verifier);
- }
-}
-
-
-@ReflectiveTestCase()
+@reflectiveTest
class FileBasedSourceTest {
void test_equals_false_differentFiles() {
JavaFile file1 = FileUtilities2.createFile("/does/not/exist1.dart");
@@ -10113,7 +7556,7 @@
}
-@ReflectiveTestCase()
+@reflectiveTest
class FileUriResolverTest {
void test_creation() {
expect(new FileUriResolver(), isNotNull);
@@ -10138,7 +7581,7 @@
}
-@ReflectiveTestCase()
+@reflectiveTest
class HtmlParserTest extends EngineTestCase {
/**
* The name of the 'script' tag in an HTML file.
@@ -10322,7 +7765,7 @@
}
-@ReflectiveTestCase()
+@reflectiveTest
class HtmlTagInfoBuilderTest extends HtmlParserTest {
void test_builder() {
HtmlTagInfoBuilder builder = new HtmlTagInfoBuilder();
@@ -10346,7 +7789,7 @@
}
-@ReflectiveTestCase()
+@reflectiveTest
class HtmlUnitBuilderTest extends EngineTestCase {
AnalysisContextImpl _context;
@override
@@ -10484,7 +7927,7 @@
/**
* Instances of the class `HtmlWarningCodeTest` test the generation of HTML warning codes.
*/
-@ReflectiveTestCase()
+@reflectiveTest
class HtmlWarningCodeTest extends EngineTestCase {
/**
* The source factory used to create the sources to be resolved.
@@ -10595,7 +8038,7 @@
}
-@ReflectiveTestCase()
+@reflectiveTest
class ReferenceFinderTest extends EngineTestCase {
DirectedGraph<AstNode> _referenceGraph;
Map<VariableElement, VariableDeclaration> _variableDeclarationMap;
@@ -10758,7 +8201,7 @@
}
-@ReflectiveTestCase()
+@reflectiveTest
class SDKLibrariesReaderTest extends EngineTestCase {
void test_readFrom_dart2js() {
LibraryMap libraryMap = new SdkLibrariesReader(
@@ -10830,7 +8273,7 @@
}
-@ReflectiveTestCase()
+@reflectiveTest
class SourceFactoryTest {
void test_creation() {
expect(new SourceFactory([]), isNotNull);
@@ -10898,7 +8341,7 @@
}
-@ReflectiveTestCase()
+@reflectiveTest
class StringScannerTest extends AbstractScannerTest {
@override
ht.AbstractScanner newScanner(String input) {
@@ -10910,7 +8353,7 @@
/**
* Instances of the class `ToSourceVisitorTest`
*/
-@ReflectiveTestCase()
+@reflectiveTest
class ToSourceVisitorTest extends EngineTestCase {
void fail_visitHtmlScriptTagNode_attributes_content() {
_assertSource(
@@ -10965,7 +8408,7 @@
}
-@ReflectiveTestCase()
+@reflectiveTest
class UriKindTest {
void test_fromEncoding() {
expect(UriKind.fromEncoding(0x64), same(UriKind.DART_URI));
@@ -11343,25 +8786,6 @@
}
-class _AngularTest_findElement extends GeneralizingElementVisitor<Object> {
- final ElementKind kind;
-
- final String name;
-
- Element result;
-
- _AngularTest_findElement(this.kind, this.name);
-
- @override
- Object visitElement(Element element) {
- if ((kind == null || element.kind == kind) && name == element.name) {
- result = element;
- }
- return super.visitElement(element);
- }
-}
-
-
class _ExpectedScript {
String _expectedExternalScriptName;
HtmlUnitBuilderTest_ExpectedLibrary _expectedLibrary;
diff --git a/pkg/analyzer/test/generated/ast_test.dart b/pkg/analyzer/test/generated/ast_test.dart
index 6e5127e..3bfa906 100644
--- a/pkg/analyzer/test/generated/ast_test.dart
+++ b/pkg/analyzer/test/generated/ast_test.dart
@@ -95,7 +95,7 @@
}
}
-@ReflectiveTestCase()
+@reflectiveTest
class BreadthFirstVisitorTest extends ParserTestCase {
void test_it() {
String source = r'''
@@ -147,7 +147,7 @@
}
}
-@ReflectiveTestCase()
+@reflectiveTest
class ClassDeclarationTest extends ParserTestCase {
void test_getConstructor() {
List<ConstructorInitializer> initializers =
@@ -246,7 +246,7 @@
}
}
-@ReflectiveTestCase()
+@reflectiveTest
class ClassTypeAliasTest extends ParserTestCase {
void test_isAbstract() {
expect(
@@ -264,7 +264,7 @@
}
}
-@ReflectiveTestCase()
+@reflectiveTest
class ConstantEvaluatorTest extends ParserTestCase {
void fail_constructor() {
Object value = _getConstantValue("?");
@@ -582,7 +582,7 @@
ParserTestCase.parseExpression(source).accept(new ConstantEvaluator());
}
-@ReflectiveTestCase()
+@reflectiveTest
class ConstructorDeclarationTest extends EngineTestCase {
void test_firstTokenAfterCommentAndMetadata_all_inverted() {
Token externalKeyword = TokenFactory.tokenFromKeyword(Keyword.EXTERNAL);
@@ -662,7 +662,7 @@
}
}
-@ReflectiveTestCase()
+@reflectiveTest
class IndexExpressionTest extends EngineTestCase {
void test_inGetterContext_assignment_compound_left() {
IndexExpression expression = AstFactory.indexExpression(
@@ -797,7 +797,7 @@
}
}
-@ReflectiveTestCase()
+@reflectiveTest
class NodeListTest extends EngineTestCase {
void test_add() {
AstNode parent = AstFactory.argumentList();
@@ -1025,7 +1025,7 @@
}
}
-@ReflectiveTestCase()
+@reflectiveTest
class NodeLocatorTest extends ParserTestCase {
void test_range() {
CompilationUnit unit =
@@ -1087,7 +1087,7 @@
}
}
-@ReflectiveTestCase()
+@reflectiveTest
class SimpleIdentifierTest extends ParserTestCase {
void test_inDeclarationContext_catch_exception() {
SimpleIdentifier identifier =
@@ -1406,7 +1406,7 @@
}
}
-@ReflectiveTestCase()
+@reflectiveTest
class SimpleStringLiteralTest extends ParserTestCase {
void test_contentsEnd() {
expect(
@@ -1620,7 +1620,7 @@
}
}
-@ReflectiveTestCase()
+@reflectiveTest
class StringInterpolationTest extends ParserTestCase {
void test_contentsOffsetEnd() {
AstFactory.interpolationExpression(AstFactory.identifier3('bb'));
@@ -1750,7 +1750,7 @@
}
}
-@ReflectiveTestCase()
+@reflectiveTest
class ToSourceVisitorTest extends EngineTestCase {
void test_visitAdjacentStrings() {
_assertSource(
@@ -4044,7 +4044,7 @@
}
}
-@ReflectiveTestCase()
+@reflectiveTest
class VariableDeclarationTest extends ParserTestCase {
void test_getDocumentationComment_onGrandParent() {
VariableDeclaration varDecl = AstFactory.variableDeclaration("a");
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 1928df7..968adec 100644
--- a/pkg/analyzer/test/generated/compile_time_error_code_test.dart
+++ b/pkg/analyzer/test/generated/compile_time_error_code_test.dart
@@ -18,7 +18,7 @@
runReflectiveTests(CompileTimeErrorCodeTest);
}
-@ReflectiveTestCase()
+@reflectiveTest
class CompileTimeErrorCodeTest extends ResolverTestCase {
void fail_compileTimeConstantRaisesException() {
Source source = addSource(r'''
@@ -194,7 +194,6 @@
}
void test_accessPrivateEnumField() {
- resetWithEnum();
Source source = addSource(r'''
enum E { ONE }
String name(E e) {
@@ -639,7 +638,7 @@
}
void test_constDeferredClass() {
- resolveWithAndWithoutExperimental(<String>[r'''
+ resolveWithErrors(<String>[r'''
library lib1;
class A {
const A();
@@ -649,12 +648,11 @@
main() {
const a.A();
}'''],
- <ErrorCode>[ParserErrorCode.DEFERRED_IMPORTS_NOT_SUPPORTED],
<ErrorCode>[CompileTimeErrorCode.CONST_DEFERRED_CLASS]);
}
void test_constDeferredClass_namedConstructor() {
- resolveWithAndWithoutExperimental(<String>[r'''
+ resolveWithErrors(<String>[r'''
library lib1;
class A {
const A.b();
@@ -664,7 +662,6 @@
main() {
const a.A.b();
}'''],
- <ErrorCode>[ParserErrorCode.DEFERRED_IMPORTS_NOT_SUPPORTED],
<ErrorCode>[CompileTimeErrorCode.CONST_DEFERRED_CLASS]);
}
@@ -866,25 +863,23 @@
}
void test_constInitializedWithNonConstValueFromDeferredClass() {
- resolveWithAndWithoutExperimental(<String>[r'''
+ resolveWithErrors(<String>[r'''
library lib1;
const V = 1;''', r'''
library root;
import 'lib1.dart' deferred as a;
const B = a.V;'''],
- <ErrorCode>[ParserErrorCode.DEFERRED_IMPORTS_NOT_SUPPORTED],
<ErrorCode>[
CompileTimeErrorCode.CONST_INITIALIZED_WITH_NON_CONSTANT_VALUE_FROM_DEFERRED_LIBRARY]);
}
void test_constInitializedWithNonConstValueFromDeferredClass_nested() {
- resolveWithAndWithoutExperimental(<String>[r'''
+ resolveWithErrors(<String>[r'''
library lib1;
const V = 1;''', r'''
library root;
import 'lib1.dart' deferred as a;
const B = a.V + 1;'''],
- <ErrorCode>[ParserErrorCode.DEFERRED_IMPORTS_NOT_SUPPORTED],
<ErrorCode>[
CompileTimeErrorCode.CONST_INITIALIZED_WITH_NON_CONSTANT_VALUE_FROM_DEFERRED_LIBRARY]);
}
@@ -1416,25 +1411,23 @@
}
void test_extendsDeferredClass() {
- resolveWithAndWithoutExperimental(<String>[r'''
+ resolveWithErrors(<String>[r'''
library lib1;
class A {}''', r'''
library root;
import 'lib1.dart' deferred as a;
class B extends a.A {}'''],
- <ErrorCode>[ParserErrorCode.DEFERRED_IMPORTS_NOT_SUPPORTED],
<ErrorCode>[CompileTimeErrorCode.EXTENDS_DEFERRED_CLASS]);
}
void test_extendsDeferredClass_classTypeAlias() {
- resolveWithAndWithoutExperimental(<String>[r'''
+ resolveWithErrors(<String>[r'''
library lib1;
class A {}''', r'''
library root;
import 'lib1.dart' deferred as a;
class M {}
class C = a.A with M;'''],
- <ErrorCode>[ParserErrorCode.DEFERRED_IMPORTS_NOT_SUPPORTED],
<ErrorCode>[CompileTimeErrorCode.EXTENDS_DEFERRED_CLASS]);
}
@@ -1571,7 +1564,6 @@
}
void test_extendsEnum() {
- resetWithEnum();
Source source = addSource(r'''
enum E { ONE }
class A extends E {}''');
@@ -1881,18 +1873,17 @@
}
void test_implementsDeferredClass() {
- resolveWithAndWithoutExperimental(<String>[r'''
+ resolveWithErrors(<String>[r'''
library lib1;
class A {}''', r'''
library root;
import 'lib1.dart' deferred as a;
class B implements a.A {}'''],
- <ErrorCode>[ParserErrorCode.DEFERRED_IMPORTS_NOT_SUPPORTED],
<ErrorCode>[CompileTimeErrorCode.IMPLEMENTS_DEFERRED_CLASS]);
}
void test_implementsDeferredClass_classTypeAlias() {
- resolveWithAndWithoutExperimental(<String>[r'''
+ resolveWithErrors(<String>[r'''
library lib1;
class A {}''', r'''
library root;
@@ -1900,7 +1891,6 @@
class B {}
class M {}
class C = B with M implements a.A;'''],
- <ErrorCode>[ParserErrorCode.DEFERRED_IMPORTS_NOT_SUPPORTED],
<ErrorCode>[CompileTimeErrorCode.IMPLEMENTS_DEFERRED_CLASS]);
}
@@ -2039,7 +2029,6 @@
}
void test_implementsEnum() {
- resetWithEnum();
Source source = addSource(r'''
enum E { ONE }
class A implements E {}''');
@@ -2481,7 +2470,6 @@
}
void test_instantiateEnum_const() {
- resetWithEnum();
Source source = addSource(r'''
enum E { ONE }
E e(String name) {
@@ -2493,7 +2481,6 @@
}
void test_instantiateEnum_new() {
- resetWithEnum();
Source source = addSource(r'''
enum E { ONE }
E e(String name) {
@@ -2633,38 +2620,35 @@
void test_invalidAnnotationFromDeferredLibrary() {
// See test_invalidAnnotation_notConstantVariable
- resolveWithAndWithoutExperimental(<String>[r'''
+ resolveWithErrors(<String>[r'''
library lib1;
class V { const V(); }
const v = const V();''', r'''
library root;
import 'lib1.dart' deferred as a;
@a.v main () {}'''],
- <ErrorCode>[ParserErrorCode.DEFERRED_IMPORTS_NOT_SUPPORTED],
<ErrorCode>[CompileTimeErrorCode.INVALID_ANNOTATION_FROM_DEFERRED_LIBRARY]);
}
void test_invalidAnnotationFromDeferredLibrary_constructor() {
// See test_invalidAnnotation_notConstantVariable
- resolveWithAndWithoutExperimental(<String>[r'''
+ resolveWithErrors(<String>[r'''
library lib1;
class C { const C(); }''', r'''
library root;
import 'lib1.dart' deferred as a;
@a.C() main () {}'''],
- <ErrorCode>[ParserErrorCode.DEFERRED_IMPORTS_NOT_SUPPORTED],
<ErrorCode>[CompileTimeErrorCode.INVALID_ANNOTATION_FROM_DEFERRED_LIBRARY]);
}
void test_invalidAnnotationFromDeferredLibrary_namedConstructor() {
// See test_invalidAnnotation_notConstantVariable
- resolveWithAndWithoutExperimental(<String>[r'''
+ resolveWithErrors(<String>[r'''
library lib1;
class C { const C.name(); }''', r'''
library root;
import 'lib1.dart' deferred as a;
@a.C.name() main () {}'''],
- <ErrorCode>[ParserErrorCode.DEFERRED_IMPORTS_NOT_SUPPORTED],
<ErrorCode>[CompileTimeErrorCode.INVALID_ANNOTATION_FROM_DEFERRED_LIBRARY]);
}
@@ -3054,7 +3038,6 @@
}
void test_missingEnumConstantInSwitch() {
- resetWithEnum();
Source source = addSource(r'''
enum E { ONE, TWO, THREE, FOUR }
bool odd(E e) {
@@ -3096,25 +3079,23 @@
}
void test_mixinDeferredClass() {
- resolveWithAndWithoutExperimental(<String>[r'''
+ resolveWithErrors(<String>[r'''
library lib1;
class A {}''', r'''
library root;
import 'lib1.dart' deferred as a;
class B extends Object with a.A {}'''],
- <ErrorCode>[ParserErrorCode.DEFERRED_IMPORTS_NOT_SUPPORTED],
<ErrorCode>[CompileTimeErrorCode.MIXIN_DEFERRED_CLASS]);
}
void test_mixinDeferredClass_classTypeAlias() {
- resolveWithAndWithoutExperimental(<String>[r'''
+ resolveWithErrors(<String>[r'''
library lib1;
class A {}''', r'''
library root;
import 'lib1.dart' deferred as a;
class B {}
class C = B with a.A;'''],
- <ErrorCode>[ParserErrorCode.DEFERRED_IMPORTS_NOT_SUPPORTED],
<ErrorCode>[CompileTimeErrorCode.MIXIN_DEFERRED_CLASS]);
}
@@ -3355,7 +3336,6 @@
}
void test_mixinOfEnum() {
- resetWithEnum();
Source source = addSource(r'''
enum E { ONE }
class A extends Object with E {}''');
@@ -3842,25 +3822,23 @@
}
void test_nonConstantDefaultValueFromDeferredLibrary() {
- resolveWithAndWithoutExperimental(<String>[r'''
+ resolveWithErrors(<String>[r'''
library lib1;
const V = 1;''', r'''
library root;
import 'lib1.dart' deferred as a;
f({x : a.V}) {}'''],
- <ErrorCode>[ParserErrorCode.DEFERRED_IMPORTS_NOT_SUPPORTED],
<ErrorCode>[
CompileTimeErrorCode.NON_CONSTANT_DEFAULT_VALUE_FROM_DEFERRED_LIBRARY]);
}
void test_nonConstantDefaultValueFromDeferredLibrary_nested() {
- resolveWithAndWithoutExperimental(<String>[r'''
+ resolveWithErrors(<String>[r'''
library lib1;
const V = 1;''', r'''
library root;
import 'lib1.dart' deferred as a;
f({x : a.V + 1}) {}'''],
- <ErrorCode>[ParserErrorCode.DEFERRED_IMPORTS_NOT_SUPPORTED],
<ErrorCode>[
CompileTimeErrorCode.NON_CONSTANT_DEFAULT_VALUE_FROM_DEFERRED_LIBRARY]);
}
@@ -3879,7 +3857,7 @@
}
void test_nonConstCaseExpressionFromDeferredLibrary() {
- resolveWithAndWithoutExperimental(<String>[r'''
+ resolveWithErrors(<String>[r'''
library lib1;
const int c = 1;''', r'''
library root;
@@ -3890,13 +3868,12 @@
break;
}
}'''],
- <ErrorCode>[ParserErrorCode.DEFERRED_IMPORTS_NOT_SUPPORTED],
<ErrorCode>[
CompileTimeErrorCode.NON_CONSTANT_CASE_EXPRESSION_FROM_DEFERRED_LIBRARY]);
}
void test_nonConstCaseExpressionFromDeferredLibrary_nested() {
- resolveWithAndWithoutExperimental(<String>[r'''
+ resolveWithErrors(<String>[r'''
library lib1;
const int c = 1;''', r'''
library root;
@@ -3907,7 +3884,6 @@
break;
}
}'''],
- <ErrorCode>[ParserErrorCode.DEFERRED_IMPORTS_NOT_SUPPORTED],
<ErrorCode>[
CompileTimeErrorCode.NON_CONSTANT_CASE_EXPRESSION_FROM_DEFERRED_LIBRARY]);
}
@@ -3923,7 +3899,7 @@
}
void test_nonConstListElementFromDeferredLibrary() {
- resolveWithAndWithoutExperimental(<String>[r'''
+ resolveWithErrors(<String>[r'''
library lib1;
const int c = 1;''', r'''
library root;
@@ -3931,13 +3907,12 @@
f() {
return const [a.c];
}'''],
- <ErrorCode>[ParserErrorCode.DEFERRED_IMPORTS_NOT_SUPPORTED],
<ErrorCode>[
CompileTimeErrorCode.NON_CONSTANT_LIST_ELEMENT_FROM_DEFERRED_LIBRARY]);
}
void test_nonConstListElementFromDeferredLibrary_nested() {
- resolveWithAndWithoutExperimental(<String>[r'''
+ resolveWithErrors(<String>[r'''
library lib1;
const int c = 1;''', r'''
library root;
@@ -3945,7 +3920,6 @@
f() {
return const [a.c + 1];
}'''],
- <ErrorCode>[ParserErrorCode.DEFERRED_IMPORTS_NOT_SUPPORTED],
<ErrorCode>[
CompileTimeErrorCode.NON_CONSTANT_LIST_ELEMENT_FROM_DEFERRED_LIBRARY]);
}
@@ -3985,7 +3959,7 @@
}
void test_nonConstMapKeyFromDeferredLibrary() {
- resolveWithAndWithoutExperimental(<String>[r'''
+ resolveWithErrors(<String>[r'''
library lib1;
const int c = 1;''', r'''
library root;
@@ -3993,12 +3967,11 @@
f() {
return const {a.c : 0};
}'''],
- <ErrorCode>[ParserErrorCode.DEFERRED_IMPORTS_NOT_SUPPORTED],
<ErrorCode>[CompileTimeErrorCode.NON_CONSTANT_MAP_KEY_FROM_DEFERRED_LIBRARY]);
}
void test_nonConstMapKeyFromDeferredLibrary_nested() {
- resolveWithAndWithoutExperimental(<String>[r'''
+ resolveWithErrors(<String>[r'''
library lib1;
const int c = 1;''', r'''
library root;
@@ -4006,7 +3979,6 @@
f() {
return const {a.c + 1 : 0};
}'''],
- <ErrorCode>[ParserErrorCode.DEFERRED_IMPORTS_NOT_SUPPORTED],
<ErrorCode>[CompileTimeErrorCode.NON_CONSTANT_MAP_KEY_FROM_DEFERRED_LIBRARY]);
}
@@ -4021,7 +3993,7 @@
}
void test_nonConstMapValueFromDeferredLibrary() {
- resolveWithAndWithoutExperimental(<String>[r'''
+ resolveWithErrors(<String>[r'''
library lib1;
const int c = 1;''', r'''
library root;
@@ -4029,12 +4001,11 @@
f() {
return const {'a' : a.c};
}'''],
- <ErrorCode>[ParserErrorCode.DEFERRED_IMPORTS_NOT_SUPPORTED],
<ErrorCode>[CompileTimeErrorCode.NON_CONSTANT_MAP_VALUE_FROM_DEFERRED_LIBRARY]);
}
void test_nonConstMapValueFromDeferredLibrary_nested() {
- resolveWithAndWithoutExperimental(<String>[r'''
+ resolveWithErrors(<String>[r'''
library lib1;
const int c = 1;''', r'''
library root;
@@ -4042,7 +4013,6 @@
f() {
return const {'a' : a.c + 1};
}'''],
- <ErrorCode>[ParserErrorCode.DEFERRED_IMPORTS_NOT_SUPPORTED],
<ErrorCode>[CompileTimeErrorCode.NON_CONSTANT_MAP_VALUE_FROM_DEFERRED_LIBRARY]);
}
@@ -4168,7 +4138,7 @@
}
void test_nonConstValueInInitializerFromDeferredLibrary_field() {
- resolveWithAndWithoutExperimental(<String>[r'''
+ resolveWithErrors(<String>[r'''
library lib1;
const int c = 1;''', r'''
library root;
@@ -4177,13 +4147,12 @@
final int x;
const A() : x = a.c;
}'''],
- <ErrorCode>[ParserErrorCode.DEFERRED_IMPORTS_NOT_SUPPORTED],
<ErrorCode>[
CompileTimeErrorCode.NON_CONSTANT_VALUE_IN_INITIALIZER_FROM_DEFERRED_LIBRARY]);
}
void test_nonConstValueInInitializerFromDeferredLibrary_field_nested() {
- resolveWithAndWithoutExperimental(<String>[r'''
+ resolveWithErrors(<String>[r'''
library lib1;
const int c = 1;''', r'''
library root;
@@ -4192,13 +4161,12 @@
final int x;
const A() : x = a.c + 1;
}'''],
- <ErrorCode>[ParserErrorCode.DEFERRED_IMPORTS_NOT_SUPPORTED],
<ErrorCode>[
CompileTimeErrorCode.NON_CONSTANT_VALUE_IN_INITIALIZER_FROM_DEFERRED_LIBRARY]);
}
void test_nonConstValueInInitializerFromDeferredLibrary_redirecting() {
- resolveWithAndWithoutExperimental(<String>[r'''
+ resolveWithErrors(<String>[r'''
library lib1;
const int c = 1;''', r'''
library root;
@@ -4207,13 +4175,12 @@
const A.named(p);
const A() : this.named(a.c);
}'''],
- <ErrorCode>[ParserErrorCode.DEFERRED_IMPORTS_NOT_SUPPORTED],
<ErrorCode>[
CompileTimeErrorCode.NON_CONSTANT_VALUE_IN_INITIALIZER_FROM_DEFERRED_LIBRARY]);
}
void test_nonConstValueInInitializerFromDeferredLibrary_super() {
- resolveWithAndWithoutExperimental(<String>[r'''
+ resolveWithErrors(<String>[r'''
library lib1;
const int c = 1;''', r'''
library root;
@@ -4224,7 +4191,6 @@
class B extends A {
const B() : super(a.c);
}'''],
- <ErrorCode>[ParserErrorCode.DEFERRED_IMPORTS_NOT_SUPPORTED],
<ErrorCode>[
CompileTimeErrorCode.NON_CONSTANT_VALUE_IN_INITIALIZER_FROM_DEFERRED_LIBRARY]);
}
@@ -4870,7 +4836,7 @@
}
void test_sharedDeferredPrefix() {
- resolveWithAndWithoutExperimental(<String>[r'''
+ resolveWithErrors(<String>[r'''
library lib1;
f1() {}''', r'''
library lib2;
@@ -4879,7 +4845,6 @@
import 'lib1.dart' deferred as lib;
import 'lib2.dart' as lib;
main() { lib.f1(); lib.f2(); }'''],
- <ErrorCode>[ParserErrorCode.DEFERRED_IMPORTS_NOT_SUPPORTED],
<ErrorCode>[CompileTimeErrorCode.SHARED_DEFERRED_PREFIX]);
}
diff --git a/pkg/analyzer/test/generated/element_test.dart b/pkg/analyzer/test/generated/element_test.dart
index 145f8ea..399d8c4 100644
--- a/pkg/analyzer/test/generated/element_test.dart
+++ b/pkg/analyzer/test/generated/element_test.dart
@@ -15,6 +15,7 @@
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:unittest/unittest.dart';
import '../reflective_tests.dart';
@@ -24,7 +25,6 @@
main() {
groupSep = ' | ';
- runReflectiveTests(AngularPropertyKindTest);
runReflectiveTests(ElementKindTest);
runReflectiveTests(FunctionTypeImplTest);
runReflectiveTests(InterfaceTypeImplTest);
@@ -40,40 +40,7 @@
runReflectiveTests(MultiplyDefinedElementImplTest);
}
-@ReflectiveTestCase()
-class AngularPropertyKindTest extends EngineTestCase {
- void test_ATTR() {
- AngularPropertyKind kind = AngularPropertyKind.ATTR;
- expect(kind.callsGetter(), isFalse);
- expect(kind.callsSetter(), isTrue);
- }
-
- void test_CALLBACK() {
- AngularPropertyKind kind = AngularPropertyKind.CALLBACK;
- expect(kind.callsGetter(), isFalse);
- expect(kind.callsSetter(), isTrue);
- }
-
- void test_ONE_WAY() {
- AngularPropertyKind kind = AngularPropertyKind.ONE_WAY;
- expect(kind.callsGetter(), isFalse);
- expect(kind.callsSetter(), isTrue);
- }
-
- void test_ONE_WAY_ONE_TIME() {
- AngularPropertyKind kind = AngularPropertyKind.ONE_WAY_ONE_TIME;
- expect(kind.callsGetter(), isFalse);
- expect(kind.callsSetter(), isTrue);
- }
-
- void test_TWO_WAY() {
- AngularPropertyKind kind = AngularPropertyKind.TWO_WAY;
- expect(kind.callsGetter(), isTrue);
- expect(kind.callsSetter(), isTrue);
- }
-}
-
-@ReflectiveTestCase()
+@reflectiveTest
class ClassElementImplTest extends EngineTestCase {
void test_getAllSupertypes_interface() {
ClassElement classA = ElementFactory.classElement2("A");
@@ -928,7 +895,7 @@
}
}
-@ReflectiveTestCase()
+@reflectiveTest
class CompilationUnitElementImplTest extends EngineTestCase {
void test_getEnum_declared() {
TestTypeProvider typeProvider = new TestTypeProvider();
@@ -971,7 +938,7 @@
}
}
-@ReflectiveTestCase()
+@reflectiveTest
class ElementImplTest extends EngineTestCase {
void test_equals() {
LibraryElementImpl library =
@@ -1067,7 +1034,7 @@
}
}
-@ReflectiveTestCase()
+@reflectiveTest
class ElementKindTest extends EngineTestCase {
void test_of_nonNull() {
expect(
@@ -1080,7 +1047,7 @@
}
}
-@ReflectiveTestCase()
+@reflectiveTest
class ElementLocationImplTest extends EngineTestCase {
void test_create_encoding() {
String encoding = "a;b;c";
@@ -1145,7 +1112,7 @@
}
}
-@ReflectiveTestCase()
+@reflectiveTest
class FunctionTypeImplTest extends EngineTestCase {
void test_creation() {
expect(
@@ -1744,7 +1711,7 @@
}
}
-@ReflectiveTestCase()
+@reflectiveTest
class HtmlElementImplTest extends EngineTestCase {
void test_equals_differentSource() {
AnalysisContextImpl context = createAnalysisContext();
@@ -1773,7 +1740,7 @@
}
}
-@ReflectiveTestCase()
+@reflectiveTest
class InterfaceTypeImplTest extends EngineTestCase {
/**
* The type provider used to access the types.
@@ -3395,7 +3362,7 @@
}
}
-@ReflectiveTestCase()
+@reflectiveTest
class LibraryElementImplTest extends EngineTestCase {
void test_creation() {
expect(
@@ -3565,7 +3532,7 @@
}
}
-@ReflectiveTestCase()
+@reflectiveTest
class MultiplyDefinedElementImplTest extends EngineTestCase {
void test_fromElements_conflicting() {
Element firstElement = ElementFactory.localVariableElement2("xx");
@@ -3618,7 +3585,7 @@
}
}
-@ReflectiveTestCase()
+@reflectiveTest
class TypeParameterTypeImplTest extends EngineTestCase {
void test_creation() {
expect(
@@ -3747,7 +3714,7 @@
}
}
-@ReflectiveTestCase()
+@reflectiveTest
class UnionTypeImplTest extends EngineTestCase {
ClassElement _classA;
@@ -3946,7 +3913,7 @@
}
}
-@ReflectiveTestCase()
+@reflectiveTest
class VoidTypeImplTest extends EngineTestCase {
/**
* Reference {code VoidTypeImpl.getInstance()}.
diff --git a/pkg/analyzer/test/generated/engine_test.dart b/pkg/analyzer/test/generated/engine_test.dart
index c85d291..fb15c2c 100644
--- a/pkg/analyzer/test/generated/engine_test.dart
+++ b/pkg/analyzer/test/generated/engine_test.dart
@@ -50,10 +50,12 @@
runReflectiveTests(DartEntryTest);
runReflectiveTests(GenerateDartErrorsTaskTest);
runReflectiveTests(GenerateDartHintsTaskTest);
+ runReflectiveTests(GenerateDartLintsTaskTest);
runReflectiveTests(GetContentTaskTest);
runReflectiveTests(HtmlEntryTest);
runReflectiveTests(IncrementalAnalysisCacheTest);
runReflectiveTests(IncrementalAnalysisTaskTest);
+ runReflectiveTests(LintGeneratorTest);
runReflectiveTests(ParseDartTaskTest);
runReflectiveTests(ParseHtmlTaskTest);
runReflectiveTests(PartitionManagerTest);
@@ -68,7 +70,7 @@
}
-@ReflectiveTestCase()
+@reflectiveTest
class AnalysisCacheTest extends EngineTestCase {
void test_creation() {
expect(new AnalysisCache(new List<CachePartition>(0)), isNotNull);
@@ -151,7 +153,7 @@
}
-@ReflectiveTestCase()
+@reflectiveTest
class AnalysisContextImplTest extends EngineTestCase {
/**
* An analysis context whose source factory is [sourceFactory].
@@ -218,7 +220,6 @@
AnalysisOptionsImpl options =
new AnalysisOptionsImpl.con1(_context.analysisOptions);
options.cacheSize = 256;
- options.enableEnum = true;
_context.analysisOptions = options;
}
@@ -2241,30 +2242,23 @@
}
-@ReflectiveTestCase()
+@reflectiveTest
class AnalysisOptionsImplTest extends EngineTestCase {
void test_AnalysisOptionsImpl_copy() {
bool booleanValue = true;
for (int i = 0; i < 2; i++, booleanValue = !booleanValue) {
AnalysisOptionsImpl options = new AnalysisOptionsImpl();
- options.analyzeAngular = booleanValue;
options.analyzeFunctionBodies = booleanValue;
- options.analyzePolymer = booleanValue;
options.cacheSize = i;
options.dart2jsHint = booleanValue;
- options.enableDeferredLoading = booleanValue;
options.generateSdkErrors = booleanValue;
options.hint = booleanValue;
options.incremental = booleanValue;
options.preserveComments = booleanValue;
AnalysisOptionsImpl copy = new AnalysisOptionsImpl.con1(options);
- expect(copy.analyzeAngular, options.analyzeAngular);
expect(copy.analyzeFunctionBodies, options.analyzeFunctionBodies);
- expect(copy.analyzePolymer, options.analyzePolymer);
expect(copy.cacheSize, options.cacheSize);
expect(copy.dart2jsHint, options.dart2jsHint);
- expect(copy.enableDeferredLoading, options.enableDeferredLoading);
- expect(copy.enableEnum, options.enableEnum);
expect(copy.generateSdkErrors, options.generateSdkErrors);
expect(copy.hint, options.hint);
expect(copy.incremental, options.incremental);
@@ -2272,13 +2266,6 @@
}
}
- void test_getAnalyzeAngular() {
- AnalysisOptionsImpl options = new AnalysisOptionsImpl();
- bool value = !options.analyzeAngular;
- options.analyzeAngular = value;
- expect(options.analyzeAngular, value);
- }
-
void test_getAnalyzeFunctionBodies() {
AnalysisOptionsImpl options = new AnalysisOptionsImpl();
bool value = !options.analyzeFunctionBodies;
@@ -2286,13 +2273,6 @@
expect(options.analyzeFunctionBodies, value);
}
- void test_getAnalyzePolymer() {
- AnalysisOptionsImpl options = new AnalysisOptionsImpl();
- bool value = !options.analyzePolymer;
- options.analyzePolymer = value;
- expect(options.analyzePolymer, value);
- }
-
void test_getCacheSize() {
AnalysisOptionsImpl options = new AnalysisOptionsImpl();
expect(options.cacheSize, AnalysisOptionsImpl.DEFAULT_CACHE_SIZE);
@@ -2308,24 +2288,6 @@
expect(options.dart2jsHint, value);
}
- void test_getEnableDeferredLoading() {
- AnalysisOptionsImpl options = new AnalysisOptionsImpl();
- expect(
- options.enableDeferredLoading,
- AnalysisOptionsImpl.DEFAULT_ENABLE_DEFERRED_LOADING);
- bool value = !options.enableDeferredLoading;
- options.enableDeferredLoading = value;
- expect(options.enableDeferredLoading, value);
- }
-
- void test_getEnableEnum() {
- AnalysisOptionsImpl options = new AnalysisOptionsImpl();
- expect(options.enableEnum, AnalysisOptionsImpl.DEFAULT_ENABLE_ENUM);
- bool value = !options.enableEnum;
- options.enableEnum = value;
- expect(options.enableEnum, value);
- }
-
void test_getGenerateSdkErrors() {
AnalysisOptionsImpl options = new AnalysisOptionsImpl();
bool value = !options.generateSdkErrors;
@@ -2373,7 +2335,7 @@
}
-@ReflectiveTestCase()
+@reflectiveTest
class AnalysisTaskTest extends EngineTestCase {
void test_perform_exception() {
InternalAnalysisContext context = new AnalysisContextImpl();
@@ -2389,7 +2351,7 @@
}
-@ReflectiveTestCase()
+@reflectiveTest
class DartEntryTest extends EngineTestCase {
void test_allErrors() {
Source source = new TestSource();
@@ -2416,10 +2378,6 @@
<AnalysisError>[
new AnalysisError.con1(source, StaticWarningCode.CASE_BLOCK_NOT_TERMINATED)]);
entry.setValueInLibrary(
- DartEntry.ANGULAR_ERRORS,
- source,
- <AnalysisError>[new AnalysisError.con1(source, AngularCode.MISSING_NAME)]);
- entry.setValueInLibrary(
DartEntry.HINTS,
source,
<AnalysisError>[new AnalysisError.con1(source, HintCode.DEAD_CODE)]);
@@ -2454,9 +2412,6 @@
expect(entry.getState(DartEntry.TOKEN_STREAM), same(CacheState.INVALID));
expect(
- entry.getStateInLibrary(DartEntry.ANGULAR_ERRORS, librarySource),
- same(CacheState.INVALID));
- expect(
entry.getStateInLibrary(DartEntry.BUILT_ELEMENT, librarySource),
same(CacheState.INVALID));
expect(
@@ -2732,9 +2687,6 @@
expect(entry.getState(DartEntry.TOKEN_STREAM), same(CacheState.INVALID));
expect(
- entry.getStateInLibrary(DartEntry.ANGULAR_ERRORS, librarySource),
- same(CacheState.INVALID));
- expect(
entry.getStateInLibrary(DartEntry.BUILT_ELEMENT, librarySource),
same(CacheState.INVALID));
expect(
@@ -2783,9 +2735,6 @@
expect(entry.getState(DartEntry.TOKEN_STREAM), same(CacheState.VALID));
expect(
- entry.getStateInLibrary(DartEntry.ANGULAR_ERRORS, librarySource),
- same(CacheState.INVALID));
- expect(
entry.getStateInLibrary(DartEntry.BUILT_ELEMENT, librarySource),
same(CacheState.INVALID));
expect(
@@ -2834,9 +2783,6 @@
expect(entry.getState(DartEntry.TOKEN_STREAM), same(CacheState.VALID));
expect(
- entry.getStateInLibrary(DartEntry.ANGULAR_ERRORS, librarySource),
- same(CacheState.INVALID));
- expect(
entry.getStateInLibrary(DartEntry.BUILT_ELEMENT, librarySource),
same(CacheState.INVALID));
expect(
@@ -2916,9 +2862,6 @@
expect(entry.getState(DartEntry.TOKEN_STREAM), same(CacheState.VALID));
expect(
- entry.getStateInLibrary(DartEntry.ANGULAR_ERRORS, firstLibrary),
- same(CacheState.ERROR));
- expect(
entry.getStateInLibrary(DartEntry.BUILT_ELEMENT, firstLibrary),
same(CacheState.ERROR));
expect(
@@ -2938,9 +2881,6 @@
same(CacheState.ERROR));
expect(
- entry.getStateInLibrary(DartEntry.ANGULAR_ERRORS, secondLibrary),
- same(CacheState.VALID));
- expect(
entry.getStateInLibrary(DartEntry.BUILT_ELEMENT, secondLibrary),
same(CacheState.VALID));
expect(
@@ -2989,9 +2929,6 @@
expect(entry.getState(DartEntry.TOKEN_STREAM), same(CacheState.ERROR));
expect(
- entry.getStateInLibrary(DartEntry.ANGULAR_ERRORS, firstLibrary),
- same(CacheState.ERROR));
- expect(
entry.getStateInLibrary(DartEntry.BUILT_ELEMENT, firstLibrary),
same(CacheState.ERROR));
expect(
@@ -3052,9 +2989,6 @@
expect(entry.getState(DartEntry.TOKEN_STREAM), same(CacheState.VALID));
expect(
- entry.getStateInLibrary(DartEntry.ANGULAR_ERRORS, firstLibrary),
- same(CacheState.VALID));
- expect(
entry.getStateInLibrary(DartEntry.BUILT_ELEMENT, firstLibrary),
same(CacheState.VALID));
expect(
@@ -3074,9 +3008,6 @@
same(CacheState.VALID));
expect(
- entry.getStateInLibrary(DartEntry.ANGULAR_ERRORS, secondLibrary),
- same(CacheState.VALID));
- expect(
entry.getStateInLibrary(DartEntry.BUILT_ELEMENT, secondLibrary),
same(CacheState.VALID));
expect(
@@ -3124,9 +3055,6 @@
expect(entry.getState(DartEntry.TOKEN_STREAM), same(CacheState.VALID));
expect(
- entry.getStateInLibrary(DartEntry.ANGULAR_ERRORS, firstLibrary),
- same(CacheState.ERROR));
- expect(
entry.getStateInLibrary(DartEntry.BUILT_ELEMENT, firstLibrary),
same(CacheState.ERROR));
expect(
@@ -3186,9 +3114,6 @@
expect(entry.getState(DartEntry.TOKEN_STREAM), same(CacheState.VALID));
expect(
- entry.getStateInLibrary(DartEntry.ANGULAR_ERRORS, firstLibrary),
- same(CacheState.ERROR));
- expect(
entry.getStateInLibrary(DartEntry.BUILT_ELEMENT, firstLibrary),
same(CacheState.ERROR));
expect(
@@ -3249,9 +3174,6 @@
expect(entry.getState(DartEntry.TOKEN_STREAM), same(CacheState.VALID));
expect(
- entry.getStateInLibrary(DartEntry.ANGULAR_ERRORS, firstLibrary),
- same(CacheState.ERROR));
- expect(
entry.getStateInLibrary(DartEntry.BUILT_ELEMENT, firstLibrary),
same(CacheState.VALID));
expect(
@@ -3271,9 +3193,6 @@
same(CacheState.ERROR));
expect(
- entry.getStateInLibrary(DartEntry.ANGULAR_ERRORS, secondLibrary),
- same(CacheState.VALID));
- expect(
entry.getStateInLibrary(DartEntry.BUILT_ELEMENT, secondLibrary),
same(CacheState.VALID));
expect(
@@ -3321,9 +3240,6 @@
expect(entry.getState(DartEntry.TOKEN_STREAM), same(CacheState.ERROR));
expect(
- entry.getStateInLibrary(DartEntry.ANGULAR_ERRORS, firstLibrary),
- same(CacheState.ERROR));
- expect(
entry.getStateInLibrary(DartEntry.BUILT_ELEMENT, firstLibrary),
same(CacheState.ERROR));
expect(
@@ -3384,9 +3300,6 @@
expect(entry.getState(DartEntry.TOKEN_STREAM), same(CacheState.VALID));
expect(
- entry.getStateInLibrary(DartEntry.ANGULAR_ERRORS, firstLibrary),
- same(CacheState.VALID));
- expect(
entry.getStateInLibrary(DartEntry.BUILT_ELEMENT, firstLibrary),
same(CacheState.VALID));
expect(
@@ -3406,9 +3319,6 @@
same(CacheState.ERROR));
expect(
- entry.getStateInLibrary(DartEntry.ANGULAR_ERRORS, secondLibrary),
- same(CacheState.VALID));
- expect(
entry.getStateInLibrary(DartEntry.BUILT_ELEMENT, secondLibrary),
same(CacheState.VALID));
expect(
@@ -3758,7 +3668,6 @@
entry.setValue(DartEntry.SOURCE_KIND, null);
entry.setValue(DartEntry.TOKEN_STREAM, null);
if (firstLibrary != null) {
- entry.setValueInLibrary(DartEntry.ANGULAR_ERRORS, firstLibrary, null);
entry.setValueInLibrary(DartEntry.BUILT_ELEMENT, firstLibrary, null);
entry.setValueInLibrary(DartEntry.BUILT_UNIT, firstLibrary, null);
entry.setValueInLibrary(DartEntry.HINTS, firstLibrary, null);
@@ -3770,7 +3679,6 @@
null);
}
if (secondLibrary != null) {
- entry.setValueInLibrary(DartEntry.ANGULAR_ERRORS, secondLibrary, null);
entry.setValueInLibrary(DartEntry.BUILT_ELEMENT, secondLibrary, null);
entry.setValueInLibrary(DartEntry.BUILT_UNIT, secondLibrary, null);
entry.setValueInLibrary(DartEntry.HINTS, secondLibrary, null);
@@ -3807,9 +3715,6 @@
expect(entry.getState(DartEntry.TOKEN_STREAM), same(CacheState.VALID));
if (firstLibrary != null) {
expect(
- entry.getStateInLibrary(DartEntry.ANGULAR_ERRORS, firstLibrary),
- same(CacheState.VALID));
- expect(
entry.getStateInLibrary(DartEntry.BUILT_ELEMENT, firstLibrary),
same(CacheState.VALID));
expect(
@@ -3830,9 +3735,6 @@
}
if (secondLibrary != null) {
expect(
- entry.getStateInLibrary(DartEntry.ANGULAR_ERRORS, secondLibrary),
- same(CacheState.VALID));
- expect(
entry.getStateInLibrary(DartEntry.BUILT_ELEMENT, secondLibrary),
same(CacheState.VALID));
expect(
@@ -3894,7 +3796,7 @@
}
-@ReflectiveTestCase()
+@reflectiveTest
class GenerateDartErrorsTaskTest extends EngineTestCase {
void test_accept() {
GenerateDartErrorsTask task =
@@ -4023,7 +3925,7 @@
}
-@ReflectiveTestCase()
+@reflectiveTest
class GenerateDartHintsTaskTest extends EngineTestCase {
void test_accept() {
GenerateDartHintsTask task = new GenerateDartHintsTask(null, null, null);
@@ -4104,8 +4006,119 @@
}
}
+@reflectiveTest
+class GenerateDartLintsTaskTest extends EngineTestCase {
+ void test_accept() {
+ GenerateDartLintsTask task = new GenerateDartLintsTask(null, null, null);
+ expect(task.accept(new GenerateDartLintsTaskTestTV_accept()), isTrue);
+ }
+ void test_exception() {
+ GenerateDartLintsTask task = new GenerateDartLintsTask(null, null, null);
+ expect(task.exception, isNull);
+ }
+ void test_lintMap() {
+ GenerateDartLintsTask task = new GenerateDartLintsTask(null, null, null);
+ expect(task.lintMap, isNull);
+ }
+ void test_libraryElement() {
+ InternalAnalysisContext context = AnalysisContextFactory.contextWithCore();
+ LibraryElement element = ElementFactory.library(context, "lib");
+ GenerateDartLintsTask task =
+ new GenerateDartLintsTask(context, null, element);
+ expect(task.libraryElement, same(element));
+ }
-@ReflectiveTestCase()
+ void test_perform() {
+ InternalAnalysisContext context = AnalysisContextFactory.contextWithCore();
+ ChangeSet changeSet = new ChangeSet();
+ Source librarySource =
+ new FileBasedSource.con1(FileUtilities2.createFile("/test.dart"));
+ changeSet.addedSource(librarySource);
+ context.applyChanges(changeSet);
+ context.setContents(librarySource, r'''
+library lib;
+''');
+ List<TimestampedData<CompilationUnit>> units = new List<TimestampedData>(1);
+ units[0] = new TimestampedData<CompilationUnit>(
+ context.getModificationStamp(librarySource),
+ context.resolveCompilationUnit2(librarySource, librarySource));
+ GenerateDartLintsTask task = new GenerateDartLintsTask(
+ context,
+ units,
+ context.computeLibraryElement(librarySource));
+ task.perform(new GenerateDartLintsTaskTestTV_perform(librarySource));
+ }
+}
+
+class GenerateDartLintsTaskTestTV_accept extends TestTaskVisitor<bool> {
+ @override
+ bool visitGenerateDartLintsTask(GenerateDartLintsTask task) => true;
+}
+
+class GenerateDartLintsTaskTestTV_perform extends TestTaskVisitor<bool> {
+ Source librarySource;
+ GenerateDartLintsTaskTestTV_perform(this.librarySource);
+ @override
+ bool visitGenerateDartLintsTask(GenerateDartLintsTask task) {
+ CaughtException exception = task.exception;
+ if (exception != null) {
+ throw exception;
+ }
+ expect(task.libraryElement, isNotNull);
+ return true;
+ }
+}
+
+@reflectiveTest
+class LintGeneratorTest extends EngineTestCase {
+ void test_generate() {
+
+ InternalAnalysisContext context = AnalysisContextFactory.contextWithCore();
+ ChangeSet changeSet = new ChangeSet();
+ Source librarySource =
+ new FileBasedSource.con1(FileUtilities2.createFile("/test.dart"));
+ changeSet.addedSource(librarySource);
+ context.applyChanges(changeSet);
+ context.setContents(librarySource, r'''
+library lib;
+''');
+
+ CompilationUnit unit =
+ context.resolveCompilationUnit2(librarySource, librarySource);
+ List<CompilationUnit> units = <CompilationUnit>[];
+ units.add(unit);
+
+ RecordingErrorListener errorListener = new RecordingErrorListener();
+
+ LintGeneratorTest_Verifier verifier = new LintGeneratorTest_Verifier();
+
+ LintGenerator lintGenerator =
+ new LintGenerator(units, errorListener, [verifier]);
+ lintGenerator.generate();
+
+ verifier.testExpectations();
+ }
+}
+
+
+class LintGeneratorTest_Verifier extends LintVerifier {
+
+ bool visited;
+
+ @override
+ Object visitCompilationUnit(CompilationUnit node) {
+ visited = true;
+ return null;
+ }
+
+ testExpectations() {
+ expect(reporter, isNotNull);
+ expect(visited, isTrue);
+ }
+}
+
+
+@reflectiveTest
class GetContentTaskTest extends EngineTestCase {
void test_accept() {
Source source = new TestSource('/test.dart', '');
@@ -4182,7 +4195,7 @@
}
-@ReflectiveTestCase()
+@reflectiveTest
class HtmlEntryTest extends EngineTestCase {
void set state(DataDescriptor descriptor) {
HtmlEntry entry = new HtmlEntry();
@@ -4209,38 +4222,14 @@
<AnalysisError>[
new AnalysisError.con1(source, HtmlWarningCode.INVALID_URI, ["-"])]);
entry.setValue(
- HtmlEntry.ANGULAR_ERRORS,
- <AnalysisError>[
- new AnalysisError.con1(source, AngularCode.INVALID_REPEAT_SYNTAX, ["-"])]);
- entry.setValue(
- HtmlEntry.POLYMER_BUILD_ERRORS,
- <AnalysisError>[
- new AnalysisError.con1(source, PolymerCode.INVALID_ATTRIBUTE_NAME, ["-"])]);
- entry.setValue(
- HtmlEntry.POLYMER_RESOLUTION_ERRORS,
- <AnalysisError>[
- new AnalysisError.con1(source, PolymerCode.INVALID_ATTRIBUTE_NAME, ["-"])]);
- entry.setValue(
HtmlEntry.HINTS,
<AnalysisError>[new AnalysisError.con1(source, HintCode.DEAD_CODE)]);
- expect(entry.allErrors, hasLength(6));
+ expect(entry.allErrors, hasLength(3));
}
void test_invalidateAllResolutionInformation() {
HtmlEntry entry = _entryWithValidState();
entry.invalidateAllResolutionInformation(false);
- expect(
- entry.getState(HtmlEntry.ANGULAR_APPLICATION),
- same(CacheState.VALID));
- expect(entry.getState(HtmlEntry.ANGULAR_COMPONENT), same(CacheState.VALID));
- expect(entry.getState(HtmlEntry.ANGULAR_ENTRY), same(CacheState.INVALID));
- expect(entry.getState(HtmlEntry.ANGULAR_ERRORS), same(CacheState.INVALID));
- expect(
- entry.getState(HtmlEntry.POLYMER_BUILD_ERRORS),
- same(CacheState.INVALID));
- expect(
- entry.getState(HtmlEntry.POLYMER_RESOLUTION_ERRORS),
- same(CacheState.INVALID));
expect(entry.getState(HtmlEntry.ELEMENT), same(CacheState.INVALID));
expect(entry.getState(HtmlEntry.HINTS), same(CacheState.INVALID));
expect(entry.getState(SourceEntry.LINE_INFO), same(CacheState.VALID));
@@ -4257,18 +4246,6 @@
void test_invalidateAllResolutionInformation_includingUris() {
HtmlEntry entry = _entryWithValidState();
entry.invalidateAllResolutionInformation(true);
- expect(
- entry.getState(HtmlEntry.ANGULAR_APPLICATION),
- same(CacheState.VALID));
- expect(entry.getState(HtmlEntry.ANGULAR_COMPONENT), same(CacheState.VALID));
- expect(entry.getState(HtmlEntry.ANGULAR_ENTRY), same(CacheState.INVALID));
- expect(entry.getState(HtmlEntry.ANGULAR_ERRORS), same(CacheState.INVALID));
- expect(
- entry.getState(HtmlEntry.POLYMER_BUILD_ERRORS),
- same(CacheState.INVALID));
- expect(
- entry.getState(HtmlEntry.POLYMER_RESOLUTION_ERRORS),
- same(CacheState.INVALID));
expect(entry.getState(HtmlEntry.ELEMENT), same(CacheState.INVALID));
expect(entry.getState(HtmlEntry.HINTS), same(CacheState.INVALID));
expect(entry.getState(SourceEntry.LINE_INFO), same(CacheState.VALID));
@@ -4282,10 +4259,6 @@
same(CacheState.INVALID));
}
- void test_setState_angularErrors() {
- state = HtmlEntry.ANGULAR_ERRORS;
- }
-
void test_setState_element() {
state = HtmlEntry.ELEMENT;
}
@@ -4306,14 +4279,6 @@
state = HtmlEntry.PARSE_ERRORS;
}
- void test_setState_polymerBuildErrors() {
- state = HtmlEntry.POLYMER_BUILD_ERRORS;
- }
-
- void test_setState_polymerResolutionErrors() {
- state = HtmlEntry.POLYMER_RESOLUTION_ERRORS;
- }
-
void test_setState_referencedLibraries() {
state = HtmlEntry.REFERENCED_LIBRARIES;
}
@@ -4322,13 +4287,6 @@
state = HtmlEntry.RESOLUTION_ERRORS;
}
- void test_setValue_angularErrors() {
- _setValue(
- HtmlEntry.ANGULAR_ERRORS,
- <AnalysisError>[
- new AnalysisError.con1(null, AngularCode.INVALID_REPEAT_SYNTAX, ["-"])]);
- }
-
void test_setValue_element() {
_setValue(HtmlEntry.ELEMENT, new HtmlElementImpl(null, "test.html"));
}
@@ -4363,20 +4321,6 @@
new AnalysisError.con1(null, HtmlWarningCode.INVALID_URI, ["-"])]);
}
- void test_setValue_polymerBuildErrors() {
- _setValue(
- HtmlEntry.POLYMER_BUILD_ERRORS,
- <AnalysisError>[
- new AnalysisError.con1(null, PolymerCode.INVALID_ATTRIBUTE_NAME, ["-"])]);
- }
-
- void test_setValue_polymerResolutionErrors() {
- _setValue(
- HtmlEntry.POLYMER_RESOLUTION_ERRORS,
- <AnalysisError>[
- new AnalysisError.con1(null, PolymerCode.INVALID_ATTRIBUTE_NAME, ["-"])]);
- }
-
void test_setValue_referencedLibraries() {
_setValue(HtmlEntry.REFERENCED_LIBRARIES, <Source>[new TestSource()]);
}
@@ -4390,31 +4334,19 @@
HtmlEntry _entryWithValidState() {
HtmlEntry entry = new HtmlEntry();
- entry.setValue(HtmlEntry.ANGULAR_APPLICATION, null);
- entry.setValue(HtmlEntry.ANGULAR_COMPONENT, null);
- entry.setValue(HtmlEntry.ANGULAR_ERRORS, null);
entry.setValue(HtmlEntry.ELEMENT, null);
entry.setValue(HtmlEntry.HINTS, null);
entry.setValue(SourceEntry.LINE_INFO, null);
entry.setValue(HtmlEntry.PARSE_ERRORS, null);
entry.setValue(HtmlEntry.PARSED_UNIT, null);
- entry.setValue(HtmlEntry.POLYMER_BUILD_ERRORS, null);
- entry.setValue(HtmlEntry.POLYMER_RESOLUTION_ERRORS, null);
entry.setValue(HtmlEntry.REFERENCED_LIBRARIES, null);
entry.setValue(HtmlEntry.RESOLUTION_ERRORS, null);
- expect(entry.getState(HtmlEntry.ANGULAR_ERRORS), same(CacheState.VALID));
expect(entry.getState(HtmlEntry.ELEMENT), same(CacheState.VALID));
expect(entry.getState(HtmlEntry.HINTS), same(CacheState.VALID));
expect(entry.getState(SourceEntry.LINE_INFO), same(CacheState.VALID));
expect(entry.getState(HtmlEntry.PARSE_ERRORS), same(CacheState.VALID));
expect(entry.getState(HtmlEntry.PARSED_UNIT), same(CacheState.VALID));
expect(
- entry.getState(HtmlEntry.POLYMER_BUILD_ERRORS),
- same(CacheState.VALID));
- expect(
- entry.getState(HtmlEntry.POLYMER_RESOLUTION_ERRORS),
- same(CacheState.VALID));
- expect(
entry.getState(HtmlEntry.REFERENCED_LIBRARIES),
same(CacheState.VALID));
expect(entry.getState(HtmlEntry.RESOLUTION_ERRORS), same(CacheState.VALID));
@@ -4432,7 +4364,7 @@
}
-@ReflectiveTestCase()
+@reflectiveTest
class IncrementalAnalysisCacheTest {
Source _source = new TestSource();
DartEntry _entry = new DartEntry();
@@ -4957,7 +4889,7 @@
}
-@ReflectiveTestCase()
+@reflectiveTest
class IncrementalAnalysisTaskTest extends EngineTestCase {
void test_accept() {
IncrementalAnalysisTask task = new IncrementalAnalysisTask(null, null);
@@ -5034,7 +4966,7 @@
}
-@ReflectiveTestCase()
+@reflectiveTest
class ParseDartTaskTest extends EngineTestCase {
void test_accept() {
ParseDartTask task = new ParseDartTask(null, null, null, null);
@@ -5232,7 +5164,7 @@
}
-@ReflectiveTestCase()
+@reflectiveTest
class ParseHtmlTaskTest extends EngineTestCase {
ParseHtmlTask parseContents(String contents, TestLogger testLogger) {
return parseSource(
@@ -5416,7 +5348,7 @@
}
-@ReflectiveTestCase()
+@reflectiveTest
class PartitionManagerTest extends EngineTestCase {
void test_clearCache() {
PartitionManager manager = new PartitionManager();
@@ -5446,7 +5378,7 @@
}
-@ReflectiveTestCase()
+@reflectiveTest
class ResolveDartLibraryTaskTest extends EngineTestCase {
void test_accept() {
ResolveDartLibraryTask task = new ResolveDartLibraryTask(null, null, null);
@@ -5527,7 +5459,7 @@
}
-@ReflectiveTestCase()
+@reflectiveTest
class ResolveDartUnitTaskTest extends EngineTestCase {
void test_accept() {
ResolveDartUnitTask task = new ResolveDartUnitTask(null, null, null);
@@ -5628,7 +5560,7 @@
}
-@ReflectiveTestCase()
+@reflectiveTest
class ResolveHtmlTaskTest extends EngineTestCase {
void test_accept() {
ResolveHtmlTask task = new ResolveHtmlTask(null, null, 0, null);
@@ -5727,7 +5659,7 @@
}
-@ReflectiveTestCase()
+@reflectiveTest
class ScanDartTaskTest extends EngineTestCase {
void test_accept() {
ScanDartTask task = new ScanDartTask(null, null, null);
@@ -5791,7 +5723,7 @@
}
-@ReflectiveTestCase()
+@reflectiveTest
class SdkCachePartitionTest extends EngineTestCase {
void test_contains_false() {
SdkCachePartition partition = new SdkCachePartition(null, 8);
@@ -5813,7 +5745,7 @@
}
-@ReflectiveTestCase()
+@reflectiveTest
class SourcesChangedEventTest {
void test_added() {
@@ -6078,11 +6010,6 @@
return false;
}
@override
- AngularApplication getAngularApplicationWithHtml(Source htmlSource) {
- fail("Unexpected invocation of getAngularApplicationWithHtml");
- return null;
- }
- @override
CompilationUnitElement getCompilationUnitElement(Source unitSource,
Source librarySource) {
fail("Unexpected invocation of getCompilationUnitElement");
@@ -6399,18 +6326,6 @@
}
-class TestAnalysisContext_test_getAngularApplicationWithHtml extends
- TestAnalysisContext {
- bool invoked = false;
- TestAnalysisContext_test_getAngularApplicationWithHtml();
- @override
- AngularApplication getAngularApplicationWithHtml(Source htmlSource) {
- invoked = true;
- return null;
- }
-}
-
-
class TestAnalysisContext_test_getCompilationUnitElement extends
TestAnalysisContext {
bool invoked = false;
@@ -6911,27 +6826,6 @@
return null;
}
@override
- E visitPolymerBuildHtmlTask(PolymerBuildHtmlTask task) {
- fail("Unexpectedly invoked visitPolymerBuildHtmlTask");
- return null;
- }
- @override
- E visitPolymerResolveHtmlTask(PolymerResolveHtmlTask task) {
- fail("Unexpectedly invoked visitPolymerResolveHtmlTask");
- return null;
- }
- @override
- E
- visitResolveAngularComponentTemplateTask(ResolveAngularComponentTemplateTask task) {
- fail("Unexpectedly invoked visitResolveAngularComponentTemplateTask");
- return null;
- }
- @override
- E visitResolveAngularEntryHtmlTask(ResolveAngularEntryHtmlTask task) {
- fail("Unexpectedly invoked visitResolveAngularEntryHtmlTask");
- return null;
- }
- @override
E visitResolveDartLibraryCycleTask(ResolveDartLibraryCycleTask task) {
fail("Unexpectedly invoked visitResolveDartLibraryCycleTask");
return null;
@@ -6956,10 +6850,16 @@
fail("Unexpectedly invoked visitScanDartTask");
return null;
}
+
+ @override
+ E visitGenerateDartLintsTask(GenerateDartLintsTask task) {
+ fail("Unexpectedly invoked visitGenerateDartLintsTask");
+ return null;
+ }
}
-@ReflectiveTestCase()
+@reflectiveTest
class UniversalCachePartitionTest extends EngineTestCase {
void test_contains() {
UniversalCachePartition partition =
@@ -7049,7 +6949,7 @@
}
-@ReflectiveTestCase()
+@reflectiveTest
class WorkManagerTest extends EngineTestCase {
void test_addFirst() {
TestSource source1 = new TestSource("/f1.dart");
diff --git a/pkg/analyzer/test/generated/incremental_resolver_test.dart b/pkg/analyzer/test/generated/incremental_resolver_test.dart
index 16ecdd9..b45db86 100644
--- a/pkg/analyzer/test/generated/incremental_resolver_test.dart
+++ b/pkg/analyzer/test/generated/incremental_resolver_test.dart
@@ -63,13 +63,79 @@
}
-@ReflectiveTestCase()
+@reflectiveTest
class DeclarationMatcherTest extends ResolverTestCase {
void setUp() {
super.setUp();
test_resolveApiChanges = true;
}
+ void test_false_class_annotation_accessor_edit() {
+ _assertDoesNotMatch(r'''
+const my_annotationA = const Object();
+const my_annotationB = const Object();
+@my_annotationA
+class A {
+}
+''', r'''
+const my_annotationA = const Object();
+const my_annotationB = const Object();
+@my_annotationB
+class A {
+}
+''');
+ }
+
+ void test_false_class_annotation_constructor_edit() {
+ _assertDoesNotMatch(r'''
+class MyAnnotationA {
+ const MyAnnotationA();
+}
+class MyAnnotationB {
+ const MyAnnotationB();
+}
+@MyAnnotationA()
+class A {
+}
+''', r'''
+class MyAnnotationA {
+ const MyAnnotationA();
+}
+class MyAnnotationB {
+ const MyAnnotationB();
+}
+@MyAnnotationB()
+class A {
+}
+''');
+ }
+
+ void test_false_class_annotations_add() {
+ _assertDoesNotMatch(r'''
+const my_annotation = const Object();
+class A {
+}
+''', r'''
+const my_annotation = const Object();
+@my_annotation
+class A {
+}
+''');
+ }
+
+ void test_false_class_annotations_remove() {
+ _assertDoesNotMatch(r'''
+const my_annotation = const Object();
+@my_annotation
+class A {
+}
+''', r'''
+const my_annotation = const Object();
+class A {
+}
+''');
+ }
+
void test_false_class_list_add() {
_assertDoesNotMatch(r'''
class A {}
@@ -317,7 +383,6 @@
}
void test_false_enum_constants_add() {
- resetWithEnum();
_assertDoesNotMatch(r'''
enum E {A, B}
''', r'''
@@ -326,7 +391,6 @@
}
void test_false_enum_constants_remove() {
- resetWithEnum();
_assertDoesNotMatch(r'''
enum E {A, B, C}
''', r'''
@@ -813,6 +877,54 @@
''');
}
+ void test_false_method_annotation_edit() {
+ _assertDoesNotMatchOK(r'''
+const my_annotationA = const Object();
+const my_annotationB = const Object();
+class A {
+ @my_annotationA
+ void m() {}
+}
+''', r'''
+const my_annotationA = const Object();
+const my_annotationB = const Object();
+class A {
+ @my_annotationB
+ void m() {}
+}
+''');
+ }
+
+ void test_false_method_annotations_add() {
+ _assertDoesNotMatchOK(r'''
+const my_annotation = const Object();
+class A {
+ void m() {}
+}
+''', r'''
+const my_annotation = const Object();
+class A {
+ @my_annotation
+ void m() {}
+}
+''');
+ }
+
+ void test_false_method_annotations_remove() {
+ _assertDoesNotMatchOK(r'''
+const my_annotation = const Object();
+class A {
+ @my_annotation
+ void m() {}
+}
+''', r'''
+const my_annotation = const Object();
+class A {
+ void m() {}
+}
+''');
+ }
+
void test_false_method_list_add() {
_assertDoesNotMatchOK(r'''
class A {
@@ -1185,6 +1297,20 @@
''');
}
+ void test_true_class_annotations_same() {
+ _assertMatches(r'''
+const my_annotation = const Object();
+@my_annotation
+class A {
+}
+''', r'''
+const my_annotation = const Object();
+@my_annotation
+class A {
+}
+''');
+ }
+
void test_true_class_list_reorder() {
_assertMatches(r'''
class A {}
@@ -1370,7 +1496,6 @@
}
void test_true_enum_constants_reorder() {
- resetWithEnum();
_assertMatches(r'''
enum E {A, B, C}
''', r'''
@@ -1379,7 +1504,6 @@
}
void test_true_enum_list_reorder() {
- resetWithEnum();
_assertMatches(r'''
enum A {A1, A2, A3}
enum B {B1, B2, B3}
@@ -1392,7 +1516,6 @@
}
void test_true_enum_list_same() {
- resetWithEnum();
_assertMatches(r'''
enum A {A1, A2, A3}
enum B {B1, B2, B3}
@@ -1616,6 +1739,42 @@
''');
}
+ void test_true_method_annotation_accessor_same() {
+ _assertMatches(r'''
+const my_annotation = const Object();
+class A {
+ @my_annotation
+ void m() {}
+}
+''', r'''
+const my_annotation = const Object();
+class A {
+ @my_annotation
+ void m() {}
+}
+''');
+ }
+
+ void test_true_method_annotation_constructor_same() {
+ _assertMatches(r'''
+class MyAnnotation {
+ const MyAnnotation();
+}
+class A {
+ @MyAnnotation()
+ void m() {}
+}
+''', r'''
+class MyAnnotation {
+ const MyAnnotation();
+}
+class A {
+ @MyAnnotation()
+ void m() {}
+}
+''');
+ }
+
void test_true_method_list_reorder() {
_assertMatches(r'''
class A {
@@ -1917,7 +2076,7 @@
}
-@ReflectiveTestCase()
+@reflectiveTest
class IncrementalResolverTest extends ResolverTestCase {
Source source;
String code;
@@ -2273,11 +2432,10 @@
int updateOffset = edit.offset;
int updateEndOld = updateOffset + edit.length;
int updateOldNew = updateOffset + edit.replacement.length;
- IncrementalResolver resolver = new IncrementalResolver(
- unit.element,
- updateOffset,
- updateEndOld,
- updateOldNew);
+ IncrementalResolver resolver =
+ new IncrementalResolver(<Source, CompilationUnit>{
+ source: newUnit
+ }, unit.element, updateOffset, updateEndOld, updateOldNew);
bool success = resolver.resolve(newNode);
expect(success, isTrue);
List<AnalysisError> newErrors = analysisContext.getErrors(source).errors;
@@ -2289,7 +2447,11 @@
LibraryElement library = resolve(source);
fullNewUnit = resolveCompilationUnit(source, library);
}
- assertSameResolution(unit, fullNewUnit, fail);
+ try {
+ assertSameResolution(unit, fullNewUnit);
+ } on IncrementalResolutionMismatch catch (mismatch) {
+ fail(mismatch.message);
+ }
// errors
List<AnalysisError> newFullErrors =
analysisContext.getErrors(source).errors;
@@ -2356,7 +2518,7 @@
* The test for [poorMansIncrementalResolution] function and its integration
* into [AnalysisContext].
*/
-@ReflectiveTestCase()
+@reflectiveTest
class PoorMansIncrementalResolutionTest extends ResolverTestCase {
Source source;
String code;
@@ -2462,6 +2624,7 @@
* A function [main] with a parameter [p] of type [int].
*/
main(int p) {
+ unresolvedFunctionProblem();
}
/**
* Other comment with [int] reference.
@@ -2474,6 +2637,7 @@
* Inserted text with [String] reference.
*/
main(int p) {
+ unresolvedFunctionProblem();
}
/**
* Other comment with [int] reference.
@@ -2894,6 +3058,82 @@
''');
}
+ void test_unusedHint_add_wasUsedOnlyInPart() {
+ Source partSource = addNamedSource('/my_unit.dart', r'''
+part of lib;
+
+f(A a) {
+ a._foo();
+}
+''');
+ _resolveUnit(r'''
+library lib;
+part 'my_unit.dart';
+class A {
+ _foo() {
+ print(1);
+ }
+}
+''');
+ _runTasks();
+ // perform incremental resolution
+ _resetWithIncremental(true);
+ analysisContext2.setContents(partSource, r'''
+part of lib;
+
+f(A a) {
+// a._foo();
+}
+''');
+ // a new hint should be added
+ List<AnalysisError> errors = analysisContext.getErrors(source).errors;
+ expect(errors, hasLength(1));
+ expect(errors[0].errorCode.type, ErrorType.HINT);
+ // the same hint should be reported using a ChangeNotice
+ bool noticeFound = false;
+ AnalysisResult result = analysisContext2.performAnalysisTask();
+ for (ChangeNotice notice in result.changeNotices) {
+ if (notice.source == source) {
+ expect(notice.errors, contains(errors[0]));
+ noticeFound = true;
+ }
+ }
+ expect(noticeFound, isTrue);
+ }
+
+ void test_unusedHint_false_stillUsedInPart() {
+ addNamedSource('/my_unit.dart', r'''
+part of lib;
+
+f(A a) {
+ a._foo();
+}
+''');
+ _resolveUnit(r'''
+library lib;
+part 'my_unit.dart';
+class A {
+ _foo() {
+ print(1);
+ }
+}
+''');
+ // perform incremental resolution
+ _resetWithIncremental(true);
+ analysisContext2.setContents(source, r'''
+library lib;
+part 'my_unit.dart';
+class A {
+ _foo() {
+ print(12);
+ }
+}
+''');
+ // no hints
+ List<AnalysisError> errors = analysisContext.getErrors(source).errors;
+ expect(errors, isEmpty);
+ }
+
void test_updateErrors_addNew_hint() {
_resolveUnit(r'''
int main() {
@@ -3113,7 +3353,11 @@
LibraryElement library = resolve(source);
CompilationUnit fullNewUnit = resolveCompilationUnit(source, library);
// Validate that "incremental" and "full" units have the same resolution.
- assertSameResolution(newUnit, fullNewUnit, fail);
+ try {
+ assertSameResolution(newUnit, fullNewUnit, validateTypes: true);
+ } on IncrementalResolutionMismatch catch (mismatch) {
+ fail(mismatch.message);
+ }
_assertEqualTokens(newUnit, fullNewUnit);
List<AnalysisError> newFullErrors =
analysisContext.getErrors(source).errors;
@@ -3158,7 +3402,7 @@
}
-@ReflectiveTestCase()
+@reflectiveTest
class ResolutionContextBuilderTest extends EngineTestCase {
GatheringErrorListener listener = new GatheringErrorListener();
diff --git a/pkg/analyzer/test/generated/incremental_scanner_test.dart b/pkg/analyzer/test/generated/incremental_scanner_test.dart
index 36a84f8..9592bc0 100644
--- a/pkg/analyzer/test/generated/incremental_scanner_test.dart
+++ b/pkg/analyzer/test/generated/incremental_scanner_test.dart
@@ -17,7 +17,7 @@
runReflectiveTests(IncrementalScannerTest);
}
-@ReflectiveTestCase()
+@reflectiveTest
class IncrementalScannerTest extends EngineTestCase {
/**
* The first token from the token stream resulting from parsing the original
diff --git a/pkg/analyzer/test/generated/non_error_resolver_test.dart b/pkg/analyzer/test/generated/non_error_resolver_test.dart
index 31d055d..2264443 100644
--- a/pkg/analyzer/test/generated/non_error_resolver_test.dart
+++ b/pkg/analyzer/test/generated/non_error_resolver_test.dart
@@ -6,7 +6,6 @@
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/error.dart';
import 'package:analyzer/src/generated/parser.dart' show ParserErrorCode;
import 'package:analyzer/src/generated/source_io.dart';
@@ -22,7 +21,7 @@
runReflectiveTests(NonErrorResolverTest);
}
-@ReflectiveTestCase()
+@reflectiveTest
class NonErrorResolverTest extends ResolverTestCase {
void fail_undefinedEnumConstant() {
Source source = addSource(r'''
@@ -774,7 +773,7 @@
}
void test_constDeferredClass_new() {
- resolveWithAndWithoutExperimental(<String>[r'''
+ resolveWithErrors(<String>[r'''
library lib1;
class A {
const A.b();
@@ -784,7 +783,6 @@
main() {
new a.A.b();
}'''],
- <ErrorCode>[ParserErrorCode.DEFERRED_IMPORTS_NOT_SUPPORTED],
<ErrorCode>[]);
}
@@ -2515,16 +2513,13 @@
}
void test_loadLibraryDefined() {
- resolveWithAndWithoutExperimental(<String>[r'''
+ resolveWithErrors(<String>[r'''
library lib1;
foo() => 22;''', r'''
import 'lib1.dart' deferred as other;
main() {
other.loadLibrary().then((_) => other.foo());
}'''],
- <ErrorCode>[
- ParserErrorCode.DEFERRED_IMPORTS_NOT_SUPPORTED,
- StaticTypeWarningCode.UNDEFINED_FUNCTION],
<ErrorCode>[]);
}
@@ -2617,7 +2612,6 @@
}
void test_missingEnumConstantInSwitch_all() {
- resetWithEnum();
Source source = addSource(r'''
enum E { A, B, C }
@@ -2634,7 +2628,6 @@
}
void test_missingEnumConstantInSwitch_default() {
- resetWithEnum();
Source source = addSource(r'''
enum E { A, B, C }
@@ -3973,7 +3966,7 @@
}
void test_sharedDeferredPrefix() {
- resolveWithAndWithoutExperimental(<String>[r'''
+ resolveWithErrors(<String>[r'''
library lib1;
f1() {}''', r'''
library lib2;
@@ -3985,7 +3978,6 @@
import 'lib2.dart' as lib;
import 'lib3.dart' as lib;
main() { lib1.f1(); lib.f2(); lib.f3(); }'''],
- <ErrorCode>[ParserErrorCode.DEFERRED_IMPORTS_NOT_SUPPORTED],
<ErrorCode>[]);
}
diff --git a/pkg/analyzer/test/generated/parser_test.dart b/pkg/analyzer/test/generated/parser_test.dart
index 2612254..ac43b31 100644
--- a/pkg/analyzer/test/generated/parser_test.dart
+++ b/pkg/analyzer/test/generated/parser_test.dart
@@ -123,7 +123,7 @@
*
* Simpler tests should be defined in the class [SimpleParserTest].
*/
-@ReflectiveTestCase()
+@reflectiveTest
class ComplexParserTest extends ParserTestCase {
void test_additiveExpression_normal() {
BinaryExpression expression = ParserTestCase.parseExpression("x + y - z");
@@ -584,7 +584,7 @@
* The class `ErrorParserTest` defines parser tests that test the parsing of code to ensure
* that errors are correctly reported, and in some cases, not reported.
*/
-@ReflectiveTestCase()
+@reflectiveTest
class ErrorParserTest extends ParserTestCase {
void fail_expectedListOrMapLiteral() {
// It isn't clear that this test can ever pass. The parser is currently
@@ -2578,7 +2578,7 @@
}
}
-@ReflectiveTestCase()
+@reflectiveTest
class IncrementalParserTest extends EngineTestCase {
void fail_replace_identifier_with_functionLiteral_in_initializer_interp() {
// TODO(paulberry, brianwilkerson): broken due to incremental scanning bugs
@@ -2969,7 +2969,7 @@
}
}
-@ReflectiveTestCase()
+@reflectiveTest
class NonErrorParserTest extends ParserTestCase {
void test_constFactory_external() {
ParserTestCase.parse(
@@ -3023,10 +3023,7 @@
* @return the parser that was created
*/
static Parser createParser(GatheringErrorListener listener) {
- Parser parser = new Parser(null, listener);
- parser.parseDeferredLibraries = true;
- parser.parseEnum = true;
- return parser;
+ return new Parser(null, listener);
}
/**
@@ -3059,7 +3056,6 @@
//
Parser parser = createParser(listener);
parser.parseFunctionBodies = parseFunctionBodies;
- parser.parseDeferredLibraries = true;
Object result =
invokeParserMethodImpl(parser, methodName, objects, tokenStream);
//
@@ -3271,7 +3267,7 @@
* The class `RecoveryParserTest` defines parser tests that test the parsing of invalid code
* sequences to ensure that the correct recovery steps are taken in the parser.
*/
-@ReflectiveTestCase()
+@reflectiveTest
class RecoveryParserTest extends ParserTestCase {
void fail_incomplete_returnType() {
ParserTestCase.parseCompilationUnit(r'''
@@ -4517,7 +4513,7 @@
}
}
-@ReflectiveTestCase()
+@reflectiveTest
class ResolutionCopierTest extends EngineTestCase {
void test_visitAnnotation() {
String annotationName = "proxy";
@@ -5167,7 +5163,7 @@
*
* More complex tests should be defined in the class [ComplexParserTest].
*/
-@ReflectiveTestCase()
+@reflectiveTest
class SimpleParserTest extends ParserTestCase {
void fail_parseCommentReference_this() {
// This fails because we are returning null from the method and asserting
diff --git a/pkg/analyzer/test/generated/resolver_test.dart b/pkg/analyzer/test/generated/resolver_test.dart
index 6cc66f8..380829c 100644
--- a/pkg/analyzer/test/generated/resolver_test.dart
+++ b/pkg/analyzer/test/generated/resolver_test.dart
@@ -23,6 +23,7 @@
import 'package:analyzer/src/generated/source_io.dart';
import 'package:analyzer/src/generated/static_type_analyzer.dart';
import 'package:analyzer/src/generated/testing/ast_factory.dart';
+import 'package:analyzer/src/generated/testing/test_type_provider.dart';
import 'package:analyzer/src/generated/testing/element_factory.dart';
import 'package:analyzer/src/generated/utilities_dart.dart';
import 'package:unittest/unittest.dart';
@@ -378,8 +379,6 @@
bool needsRecompute =
currentOptions.analyzeFunctionBodies != options.analyzeFunctionBodies ||
currentOptions.generateSdkErrors != options.generateSdkErrors ||
- currentOptions.enableDeferredLoading != options.enableDeferredLoading ||
- currentOptions.enableEnum != options.enableEnum ||
currentOptions.dart2jsHint != options.dart2jsHint ||
(currentOptions.hint && !options.hint) ||
currentOptions.preserveComments != options.preserveComments;
@@ -465,7 +464,7 @@
}
}
-@ReflectiveTestCase()
+@reflectiveTest
class AnalysisDeltaTest extends EngineTestCase {
TestSource source1 = new TestSource('/1.dart');
TestSource source2 = new TestSource('/2.dart');
@@ -505,7 +504,7 @@
}
}
-@ReflectiveTestCase()
+@reflectiveTest
class ChangeSetTest extends EngineTestCase {
void test_changedContent() {
TestSource source = new TestSource();
@@ -558,7 +557,7 @@
}
}
-@ReflectiveTestCase()
+@reflectiveTest
class CheckedModeCompileTimeErrorCodeTest extends ResolverTestCase {
void test_fieldFormalParameterAssignableToField_extends() {
// According to checked-mode type checking rules, a value of type B is
@@ -1144,7 +1143,7 @@
}
}
-@ReflectiveTestCase()
+@reflectiveTest
class ElementResolverTest extends EngineTestCase {
/**
* The error listener to which errors will be reported.
@@ -2078,7 +2077,7 @@
}
}
-@ReflectiveTestCase()
+@reflectiveTest
class EnclosedScopeTest extends ResolverTestCase {
void test_define_duplicate() {
GatheringErrorListener listener = new GatheringErrorListener();
@@ -2109,7 +2108,7 @@
}
}
-@ReflectiveTestCase()
+@reflectiveTest
class ErrorResolverTest extends ResolverTestCase {
void test_breakLabelOnSwitchMember() {
Source source = addSource(r'''
@@ -2172,7 +2171,7 @@
}
}
-@ReflectiveTestCase()
+@reflectiveTest
class HintCodeTest extends ResolverTestCase {
void fail_deadCode_statementAfterRehrow() {
Source source = addSource(r'''
@@ -2978,14 +2977,13 @@
}
void test_importDeferredLibraryWithLoadFunction() {
- resolveWithAndWithoutExperimental(<String>[r'''
+ resolveWithErrors(<String>[r'''
library lib1;
loadLibrary() {}
f() {}''', r'''
library root;
import 'lib1.dart' deferred as lib1;
main() { lib1.f(); }'''],
- <ErrorCode>[ParserErrorCode.DEFERRED_IMPORTS_NOT_SUPPORTED],
<ErrorCode>[HintCode.IMPORT_DEFERRED_LIBRARY_WITH_LOAD_FUNCTION]);
}
@@ -4443,7 +4441,7 @@
}
}
-@ReflectiveTestCase()
+@reflectiveTest
class InheritanceManagerTest extends EngineTestCase {
/**
* The type provider used to access the types.
@@ -5661,7 +5659,7 @@
}
}
-@ReflectiveTestCase()
+@reflectiveTest
class LibraryElementBuilderTest extends EngineTestCase {
/**
* The analysis context used to analyze sources.
@@ -5845,7 +5843,7 @@
}
}
-@ReflectiveTestCase()
+@reflectiveTest
class LibraryImportScopeTest extends ResolverTestCase {
void test_conflictingImports() {
AnalysisContext context = new AnalysisContextImpl();
@@ -6041,7 +6039,7 @@
}
}
-@ReflectiveTestCase()
+@reflectiveTest
class LibraryResolver2Test extends ResolverTestCase {
LibraryResolver2 _resolver;
@@ -6088,7 +6086,7 @@
}
}
-@ReflectiveTestCase()
+@reflectiveTest
class LibraryResolverTest extends ResolverTestCase {
LibraryResolver _resolver;
@@ -6129,7 +6127,7 @@
}
}
-@ReflectiveTestCase()
+@reflectiveTest
class LibraryScopeTest extends ResolverTestCase {
void test_creation_empty() {
LibraryElement definingLibrary = createDefaultTestLibrary();
@@ -6166,7 +6164,7 @@
}
}
-@ReflectiveTestCase()
+@reflectiveTest
class LibraryTest extends EngineTestCase {
/**
* The error listener to which all errors will be reported.
@@ -6283,7 +6281,7 @@
FileUtilities2.createFile(definingCompilationUnitPath)));
}
-@ReflectiveTestCase()
+@reflectiveTest
class MemberMapTest {
/**
* The null type.
@@ -6329,7 +6327,7 @@
}
}
-@ReflectiveTestCase()
+@reflectiveTest
class NonHintCodeTest extends ResolverTestCase {
void test_deadCode_deadBlock_conditionalElse_debugConst() {
Source source = addSource(r'''
@@ -6548,13 +6546,12 @@
}
void test_importDeferredLibraryWithLoadFunction() {
- resolveWithAndWithoutExperimental(<String>[r'''
+ resolveWithErrors(<String>[r'''
library lib1;
f() {}''', r'''
library root;
import 'lib1.dart' deferred as lib1;
main() { lib1.f(); }'''],
- <ErrorCode>[ParserErrorCode.DEFERRED_IMPORTS_NOT_SUPPORTED],
ErrorCode.EMPTY_LIST);
}
@@ -7829,15 +7826,6 @@
}
/**
- * Reset the analysis context to have the 'enableEnum' option set to true.
- */
- void resetWithEnum() {
- AnalysisOptionsImpl analysisOptions = new AnalysisOptionsImpl();
- analysisOptions.enableEnum = true;
- resetWithOptions(analysisOptions);
- }
-
- /**
* Reset the analysis context to have the given options applied.
*
* @param options the analysis options to be applied to the context
@@ -7892,12 +7880,19 @@
return null;
}
+ void resolveWithErrors(List<String> strSources, List<ErrorCode> codes) {
+ // Analysis and assertions
+ Source source = resolveSources(strSources);
+ assertErrors(source, codes);
+ verify([source]);
+ }
+
void resolveWithAndWithoutExperimental(List<String> strSources,
List<ErrorCode> codesWithoutExperimental,
List<ErrorCode> codesWithExperimental) {
// Setup analysis context as non-experimental
AnalysisOptionsImpl options = new AnalysisOptionsImpl();
- options.enableDeferredLoading = false;
+// options.enableDeferredLoading = false;
resetWithOptions(options);
// Analysis and assertions
Source source = resolveSources(strSources);
@@ -7981,7 +7976,7 @@
null;
}
-@ReflectiveTestCase()
+@reflectiveTest
class ScopeTest extends ResolverTestCase {
void test_define_duplicate() {
GatheringErrorListener errorListener = new GatheringErrorListener();
@@ -8039,7 +8034,7 @@
localLookup(name, referencingLibrary);
}
-@ReflectiveTestCase()
+@reflectiveTest
class SimpleResolverTest extends ResolverTestCase {
void fail_staticInvocation() {
Source source = addSource(r'''
@@ -8662,7 +8657,6 @@
}
void test_enum_externalLibrary() {
- resetWithEnum();
addNamedSource("/my_lib.dart", r'''
library my_lib;
enum EEE {A, B, C}''');
@@ -9382,7 +9376,7 @@
/**
* Like [StaticTypeAnalyzerTest], but as end-to-end tests.
*/
-@ReflectiveTestCase()
+@reflectiveTest
class StaticTypeAnalyzer2Test extends ResolverTestCase {
String testCode;
Source testSource;
@@ -9455,7 +9449,7 @@
}
}
-@ReflectiveTestCase()
+@reflectiveTest
class StaticTypeAnalyzerTest extends EngineTestCase {
/**
* The error listener to which errors will be reported.
@@ -10874,7 +10868,7 @@
* The class `StrictModeTest` contains tests to ensure that the correct errors and warnings
* are reported when the analysis engine is run in strict mode.
*/
-@ReflectiveTestCase()
+@reflectiveTest
class StrictModeTest extends ResolverTestCase {
void fail_for() {
Source source = addSource(r'''
@@ -11026,7 +11020,7 @@
}
}
-@ReflectiveTestCase()
+@reflectiveTest
class SubtypeManagerTest extends EngineTestCase {
/**
* The inheritance manager being tested.
@@ -11122,477 +11116,9 @@
}
}
-/**
- * Instances of the class `TestTypeProvider` implement a type provider that can be used by
- * tests without creating the element model for the core library.
- */
-class TestTypeProvider implements TypeProvider {
- /**
- * The type representing the built-in type 'bool'.
- */
- InterfaceType _boolType;
- /**
- * The type representing the type 'bottom'.
- */
- DartType _bottomType;
- /**
- * The type representing the built-in type 'double'.
- */
- InterfaceType _doubleType;
-
- /**
- * The type representing the built-in type 'deprecated'.
- */
- InterfaceType _deprecatedType;
-
- /**
- * The type representing the built-in type 'dynamic'.
- */
- DartType _dynamicType;
-
- /**
- * The type representing the built-in type 'Function'.
- */
- InterfaceType _functionType;
-
- /**
- * The type representing the built-in type 'int'.
- */
- InterfaceType _intType;
-
- /**
- * The type representing the built-in type 'Iterable'.
- */
- InterfaceType _iterableType;
-
- /**
- * The type representing the built-in type 'Iterator'.
- */
- InterfaceType _iteratorType;
-
- /**
- * The type representing the built-in type 'List'.
- */
- InterfaceType _listType;
-
- /**
- * The type representing the built-in type 'Map'.
- */
- InterfaceType _mapType;
-
- /**
- * The type representing the built-in type 'Null'.
- */
- InterfaceType _nullType;
-
- /**
- * The type representing the built-in type 'num'.
- */
- InterfaceType _numType;
-
- /**
- * The type representing the built-in type 'Object'.
- */
- InterfaceType _objectType;
-
- /**
- * The type representing the built-in type 'StackTrace'.
- */
- InterfaceType _stackTraceType;
-
- /**
- * The type representing the built-in type 'String'.
- */
- InterfaceType _stringType;
-
- /**
- * The type representing the built-in type 'Symbol'.
- */
- InterfaceType _symbolType;
-
- /**
- * The type representing the built-in type 'Type'.
- */
- InterfaceType _typeType;
-
- /**
- * The type representing typenames that can't be resolved.
- */
- DartType _undefinedType;
-
- @override
- InterfaceType get boolType {
- if (_boolType == null) {
- ClassElementImpl boolElement = ElementFactory.classElement2("bool");
- _boolType = boolElement.type;
- ConstructorElementImpl fromEnvironment =
- ElementFactory.constructorElement(boolElement, "fromEnvironment", true);
- fromEnvironment.parameters = <ParameterElement>[
- ElementFactory.requiredParameter2("name", stringType),
- ElementFactory.namedParameter2("defaultValue", _boolType)];
- fromEnvironment.factory = true;
- boolElement.constructors = <ConstructorElement>[fromEnvironment];
- }
- return _boolType;
- }
-
- @override
- DartType get bottomType {
- if (_bottomType == null) {
- _bottomType = BottomTypeImpl.instance;
- }
- return _bottomType;
- }
-
- @override
- InterfaceType get deprecatedType {
- if (_deprecatedType == null) {
- ClassElementImpl deprecatedElement =
- ElementFactory.classElement2("Deprecated");
- deprecatedElement.constructors = <ConstructorElement>[
- ElementFactory.constructorElement(deprecatedElement, null, true, [stringType])];
- _deprecatedType = deprecatedElement.type;
- }
- return _deprecatedType;
- }
-
- @override
- InterfaceType get doubleType {
- if (_doubleType == null) {
- _initializeNumericTypes();
- }
- return _doubleType;
- }
-
- @override
- DartType get dynamicType {
- if (_dynamicType == null) {
- _dynamicType = DynamicTypeImpl.instance;
- }
- return _dynamicType;
- }
-
- @override
- InterfaceType get functionType {
- if (_functionType == null) {
- _functionType = ElementFactory.classElement2("Function").type;
- }
- return _functionType;
- }
-
- @override
- InterfaceType get intType {
- if (_intType == null) {
- _initializeNumericTypes();
- }
- return _intType;
- }
-
- InterfaceType get iterableType {
- if (_iterableType == null) {
- ClassElementImpl iterableElement =
- ElementFactory.classElement2("Iterable", ["E"]);
- _iterableType = iterableElement.type;
- DartType eType = iterableElement.typeParameters[0].type;
- iterableElement.accessors = <PropertyAccessorElement>[
- ElementFactory.getterElement(
- "iterator",
- false,
- iteratorType.substitute4(<DartType>[eType])),
- ElementFactory.getterElement("last", false, eType)];
- _propagateTypeArguments(iterableElement);
- }
- return _iterableType;
- }
-
- InterfaceType get iteratorType {
- if (_iteratorType == null) {
- ClassElementImpl iteratorElement =
- ElementFactory.classElement2("Iterator", ["E"]);
- _iteratorType = iteratorElement.type;
- DartType eType = iteratorElement.typeParameters[0].type;
- iteratorElement.accessors = <PropertyAccessorElement>[
- ElementFactory.getterElement("current", false, eType)];
- _propagateTypeArguments(iteratorElement);
- }
- return _iteratorType;
- }
-
- @override
- InterfaceType get listType {
- if (_listType == null) {
- ClassElementImpl listElement =
- ElementFactory.classElement2("List", ["E"]);
- listElement.constructors =
- <ConstructorElement>[ElementFactory.constructorElement2(listElement, null)];
- _listType = listElement.type;
- DartType eType = listElement.typeParameters[0].type;
- InterfaceType iterableType =
- this.iterableType.substitute4(<DartType>[eType]);
- listElement.interfaces = <InterfaceType>[iterableType];
- listElement.accessors = <PropertyAccessorElement>[
- ElementFactory.getterElement("length", false, intType)];
- listElement.methods = <MethodElement>[
- ElementFactory.methodElement("[]", eType, [intType]),
- ElementFactory.methodElement("[]=", VoidTypeImpl.instance, [intType, eType]),
- ElementFactory.methodElement("add", VoidTypeImpl.instance, [eType])];
- _propagateTypeArguments(listElement);
- }
- return _listType;
- }
-
- @override
- InterfaceType get mapType {
- if (_mapType == null) {
- ClassElementImpl mapElement =
- ElementFactory.classElement2("Map", ["K", "V"]);
- _mapType = mapElement.type;
- DartType kType = mapElement.typeParameters[0].type;
- DartType vType = mapElement.typeParameters[1].type;
- mapElement.accessors = <PropertyAccessorElement>[
- ElementFactory.getterElement("length", false, intType)];
- mapElement.methods = <MethodElement>[
- ElementFactory.methodElement("[]", vType, [objectType]),
- ElementFactory.methodElement("[]=", VoidTypeImpl.instance, [kType, vType])];
- _propagateTypeArguments(mapElement);
- }
- return _mapType;
- }
-
- @override
- InterfaceType get nullType {
- if (_nullType == null) {
- _nullType = ElementFactory.classElement2("Null").type;
- }
- return _nullType;
- }
-
- @override
- InterfaceType get numType {
- if (_numType == null) {
- _initializeNumericTypes();
- }
- return _numType;
- }
-
- @override
- InterfaceType get objectType {
- if (_objectType == null) {
- ClassElementImpl objectElement = ElementFactory.object;
- _objectType = objectElement.type;
- objectElement.constructors =
- <ConstructorElement>[ElementFactory.constructorElement2(objectElement, null)];
- objectElement.methods = <MethodElement>[
- ElementFactory.methodElement("toString", stringType),
- ElementFactory.methodElement("==", boolType, [_objectType]),
- ElementFactory.methodElement("noSuchMethod", dynamicType, [dynamicType])];
- objectElement.accessors = <PropertyAccessorElement>[
- ElementFactory.getterElement("hashCode", false, intType),
- ElementFactory.getterElement("runtimeType", false, typeType)];
- }
- return _objectType;
- }
-
- @override
- InterfaceType get stackTraceType {
- if (_stackTraceType == null) {
- _stackTraceType = ElementFactory.classElement2("StackTrace").type;
- }
- return _stackTraceType;
- }
-
- @override
- InterfaceType get stringType {
- if (_stringType == null) {
- _stringType = ElementFactory.classElement2("String").type;
- ClassElementImpl stringElement = _stringType.element as ClassElementImpl;
- stringElement.accessors = <PropertyAccessorElement>[
- ElementFactory.getterElement("isEmpty", false, boolType),
- ElementFactory.getterElement("length", false, intType),
- ElementFactory.getterElement(
- "codeUnits",
- false,
- listType.substitute4(<DartType>[intType]))];
- stringElement.methods = <MethodElement>[
- ElementFactory.methodElement("+", _stringType, [_stringType]),
- ElementFactory.methodElement("toLowerCase", _stringType),
- ElementFactory.methodElement("toUpperCase", _stringType)];
- ConstructorElementImpl fromEnvironment =
- ElementFactory.constructorElement(stringElement, "fromEnvironment", true);
- fromEnvironment.parameters = <ParameterElement>[
- ElementFactory.requiredParameter2("name", stringType),
- ElementFactory.namedParameter2("defaultValue", _stringType)];
- fromEnvironment.factory = true;
- stringElement.constructors = <ConstructorElement>[fromEnvironment];
- }
- return _stringType;
- }
-
- @override
- InterfaceType get symbolType {
- if (_symbolType == null) {
- ClassElementImpl symbolClass = ElementFactory.classElement2("Symbol");
- ConstructorElementImpl constructor =
- ElementFactory.constructorElement(symbolClass, null, true, [stringType]);
- constructor.factory = true;
- symbolClass.constructors = <ConstructorElement>[constructor];
- _symbolType = symbolClass.type;
- }
- return _symbolType;
- }
-
- @override
- InterfaceType get typeType {
- if (_typeType == null) {
- _typeType = ElementFactory.classElement2("Type").type;
- }
- return _typeType;
- }
-
- @override
- DartType get undefinedType {
- if (_undefinedType == null) {
- _undefinedType = UndefinedTypeImpl.instance;
- }
- return _undefinedType;
- }
-
- /**
- * Initialize the numeric types. They are created as a group so that we can (a) create the right
- * hierarchy and (b) add members to them.
- */
- void _initializeNumericTypes() {
- //
- // Create the type hierarchy.
- //
- ClassElementImpl numElement = ElementFactory.classElement2("num");
- _numType = numElement.type;
- ClassElementImpl intElement = ElementFactory.classElement("int", _numType);
- _intType = intElement.type;
- ClassElementImpl doubleElement =
- ElementFactory.classElement("double", _numType);
- _doubleType = doubleElement.type;
- //
- // Force the referenced types to be cached.
- //
- objectType;
- boolType;
- stringType;
- //
- // Add the methods.
- //
- numElement.methods = <MethodElement>[
- ElementFactory.methodElement("+", _numType, [_numType]),
- ElementFactory.methodElement("-", _numType, [_numType]),
- ElementFactory.methodElement("*", _numType, [_numType]),
- ElementFactory.methodElement("%", _numType, [_numType]),
- ElementFactory.methodElement("/", _doubleType, [_numType]),
- ElementFactory.methodElement("~/", _numType, [_numType]),
- ElementFactory.methodElement("-", _numType),
- ElementFactory.methodElement("remainder", _numType, [_numType]),
- ElementFactory.methodElement("<", _boolType, [_numType]),
- ElementFactory.methodElement("<=", _boolType, [_numType]),
- ElementFactory.methodElement(">", _boolType, [_numType]),
- ElementFactory.methodElement(">=", _boolType, [_numType]),
- ElementFactory.methodElement("==", _boolType, [_objectType]),
- ElementFactory.methodElement("isNaN", _boolType),
- ElementFactory.methodElement("isNegative", _boolType),
- ElementFactory.methodElement("isInfinite", _boolType),
- ElementFactory.methodElement("abs", _numType),
- ElementFactory.methodElement("floor", _numType),
- ElementFactory.methodElement("ceil", _numType),
- ElementFactory.methodElement("round", _numType),
- ElementFactory.methodElement("truncate", _numType),
- ElementFactory.methodElement("toInt", _intType),
- ElementFactory.methodElement("toDouble", _doubleType),
- ElementFactory.methodElement("toStringAsFixed", _stringType, [_intType]),
- ElementFactory.methodElement("toStringAsExponential", _stringType, [_intType]),
- ElementFactory.methodElement("toStringAsPrecision", _stringType, [_intType]),
- ElementFactory.methodElement("toRadixString", _stringType, [_intType])];
- intElement.methods = <MethodElement>[
- ElementFactory.methodElement("&", _intType, [_intType]),
- ElementFactory.methodElement("|", _intType, [_intType]),
- ElementFactory.methodElement("^", _intType, [_intType]),
- ElementFactory.methodElement("~", _intType),
- ElementFactory.methodElement("<<", _intType, [_intType]),
- ElementFactory.methodElement(">>", _intType, [_intType]),
- ElementFactory.methodElement("-", _intType),
- ElementFactory.methodElement("abs", _intType),
- ElementFactory.methodElement("round", _intType),
- ElementFactory.methodElement("floor", _intType),
- ElementFactory.methodElement("ceil", _intType),
- ElementFactory.methodElement("truncate", _intType),
- ElementFactory.methodElement("toString", _stringType)];
- ConstructorElementImpl fromEnvironment =
- ElementFactory.constructorElement(intElement, "fromEnvironment", true);
- fromEnvironment.parameters = <ParameterElement>[
- ElementFactory.requiredParameter2("name", stringType),
- ElementFactory.namedParameter2("defaultValue", _intType)];
- fromEnvironment.factory = true;
- intElement.constructors = <ConstructorElement>[fromEnvironment];
- List<FieldElement> fields = <FieldElement>[
- ElementFactory.fieldElement("NAN", true, false, true, _doubleType),
- ElementFactory.fieldElement("INFINITY", true, false, true, _doubleType),
- ElementFactory.fieldElement(
- "NEGATIVE_INFINITY",
- true,
- false,
- true,
- _doubleType),
- ElementFactory.fieldElement("MIN_POSITIVE", true, false, true, _doubleType),
- ElementFactory.fieldElement("MAX_FINITE", true, false, true, _doubleType)];
- doubleElement.fields = fields;
- int fieldCount = fields.length;
- List<PropertyAccessorElement> accessors =
- new List<PropertyAccessorElement>(fieldCount);
- for (int i = 0; i < fieldCount; i++) {
- accessors[i] = fields[i].getter;
- }
- doubleElement.accessors = accessors;
- doubleElement.methods = <MethodElement>[
- ElementFactory.methodElement("remainder", _doubleType, [_numType]),
- ElementFactory.methodElement("+", _doubleType, [_numType]),
- ElementFactory.methodElement("-", _doubleType, [_numType]),
- ElementFactory.methodElement("*", _doubleType, [_numType]),
- ElementFactory.methodElement("%", _doubleType, [_numType]),
- ElementFactory.methodElement("/", _doubleType, [_numType]),
- ElementFactory.methodElement("~/", _doubleType, [_numType]),
- ElementFactory.methodElement("-", _doubleType),
- ElementFactory.methodElement("abs", _doubleType),
- ElementFactory.methodElement("round", _doubleType),
- ElementFactory.methodElement("floor", _doubleType),
- ElementFactory.methodElement("ceil", _doubleType),
- ElementFactory.methodElement("truncate", _doubleType),
- ElementFactory.methodElement("toString", _stringType)];
- }
-
- /**
- * Given a class element representing a class with type parameters, propagate those type
- * parameters to all of the accessors, methods and constructors defined for the class.
- *
- * @param classElement the element representing the class with type parameters
- */
- void _propagateTypeArguments(ClassElementImpl classElement) {
- List<DartType> typeArguments =
- TypeParameterTypeImpl.getTypes(classElement.typeParameters);
- for (PropertyAccessorElement accessor in classElement.accessors) {
- FunctionTypeImpl functionType = accessor.type as FunctionTypeImpl;
- functionType.typeArguments = typeArguments;
- }
- for (MethodElement method in classElement.methods) {
- FunctionTypeImpl functionType = method.type as FunctionTypeImpl;
- functionType.typeArguments = typeArguments;
- }
- for (ConstructorElement constructor in classElement.constructors) {
- FunctionTypeImpl functionType = constructor.type as FunctionTypeImpl;
- functionType.typeArguments = typeArguments;
- }
- }
-}
-
-@ReflectiveTestCase()
+@reflectiveTest
class TypeOverrideManagerTest extends EngineTestCase {
void test_exitScope_noScopes() {
TypeOverrideManager manager = new TypeOverrideManager();
@@ -11663,7 +11189,7 @@
}
}
-@ReflectiveTestCase()
+@reflectiveTest
class TypePropagationTest extends ResolverTestCase {
void fail_mergePropagatedTypesAtJoinPoint_1() {
// https://code.google.com/p/dart/issues/detail?id=19929
@@ -13139,7 +12665,7 @@
}
-@ReflectiveTestCase()
+@reflectiveTest
class TypeProviderImplTest extends EngineTestCase {
void test_creation() {
//
@@ -13226,7 +12752,7 @@
}
}
-@ReflectiveTestCase()
+@reflectiveTest
class TypeResolverVisitorTest extends EngineTestCase {
/**
* The error listener to which errors will be reported.
diff --git a/pkg/analyzer/test/generated/scanner_test.dart b/pkg/analyzer/test/generated/scanner_test.dart
index 05cf061..59321ec 100644
--- a/pkg/analyzer/test/generated/scanner_test.dart
+++ b/pkg/analyzer/test/generated/scanner_test.dart
@@ -20,7 +20,7 @@
runReflectiveTests(TokenTypeTest);
}
-@ReflectiveTestCase()
+@reflectiveTest
class CharSequenceReaderTest {
void test_advance() {
CharSequenceReader reader = new CharSequenceReader("x");
@@ -124,7 +124,7 @@
}
}
-@ReflectiveTestCase()
+@reflectiveTest
class KeywordStateTest {
void test_KeywordState() {
//
@@ -168,7 +168,7 @@
}
}
-@ReflectiveTestCase()
+@reflectiveTest
class ScannerTest {
void fail_incomplete_string_interpolation() {
// https://code.google.com/p/dart/issues/detail?id=18073
@@ -1341,7 +1341,7 @@
}
}
-@ReflectiveTestCase()
+@reflectiveTest
class TokenTypeTest extends EngineTestCase {
void test_isOperator() {
expect(TokenType.AMPERSAND.isOperator, isTrue);
diff --git a/pkg/analyzer/test/generated/static_type_warning_code_test.dart b/pkg/analyzer/test/generated/static_type_warning_code_test.dart
index e694c14..0ceb9d4 100644
--- a/pkg/analyzer/test/generated/static_type_warning_code_test.dart
+++ b/pkg/analyzer/test/generated/static_type_warning_code_test.dart
@@ -17,7 +17,7 @@
runReflectiveTests(StaticTypeWarningCodeTest);
}
-@ReflectiveTestCase()
+@reflectiveTest
class StaticTypeWarningCodeTest extends ResolverTestCase {
void fail_inaccessibleSetter() {
Source source = addSource(r'''
diff --git a/pkg/analyzer/test/generated/static_warning_code_test.dart b/pkg/analyzer/test/generated/static_warning_code_test.dart
index 44cc510..716899a 100644
--- a/pkg/analyzer/test/generated/static_warning_code_test.dart
+++ b/pkg/analyzer/test/generated/static_warning_code_test.dart
@@ -18,7 +18,7 @@
runReflectiveTests(StaticWarningCodeTest);
}
-@ReflectiveTestCase()
+@reflectiveTest
class StaticWarningCodeTest extends ResolverTestCase {
void fail_undefinedGetter() {
Source source = addSource(r'''
@@ -1403,15 +1403,12 @@
}
void test_importOfNonLibrary() {
- resolveWithAndWithoutExperimental(<String>[r'''
+ resolveWithErrors(<String>[r'''
part of lib;
class A {}''', r'''
library lib;
import 'lib1.dart' deferred as p;
var a = new p.A();'''],
- <ErrorCode>[
- CompileTimeErrorCode.IMPORT_OF_NON_LIBRARY,
- ParserErrorCode.DEFERRED_IMPORTS_NOT_SUPPORTED],
<ErrorCode>[StaticWarningCode.IMPORT_OF_NON_LIBRARY]);
}
@@ -3063,7 +3060,7 @@
}
void test_typeAnnotationDeferredClass_asExpression() {
- resolveWithAndWithoutExperimental(<String>[r'''
+ resolveWithErrors(<String>[r'''
library lib1;
class A {}''', r'''
library root;
@@ -3071,12 +3068,11 @@
f(var v) {
v as a.A;
}'''],
- <ErrorCode>[ParserErrorCode.DEFERRED_IMPORTS_NOT_SUPPORTED],
<ErrorCode>[StaticWarningCode.TYPE_ANNOTATION_DEFERRED_CLASS]);
}
void test_typeAnnotationDeferredClass_catchClause() {
- resolveWithAndWithoutExperimental(<String>[r'''
+ resolveWithErrors(<String>[r'''
library lib1;
class A {}''', r'''
library root;
@@ -3086,12 +3082,11 @@
} on a.A {
}
}'''],
- <ErrorCode>[ParserErrorCode.DEFERRED_IMPORTS_NOT_SUPPORTED],
<ErrorCode>[StaticWarningCode.TYPE_ANNOTATION_DEFERRED_CLASS]);
}
void test_typeAnnotationDeferredClass_fieldFormalParameter() {
- resolveWithAndWithoutExperimental(<String>[r'''
+ resolveWithErrors(<String>[r'''
library lib1;
class A {}''', r'''
library root;
@@ -3100,35 +3095,32 @@
var v;
C(a.A this.v);
}'''],
- <ErrorCode>[ParserErrorCode.DEFERRED_IMPORTS_NOT_SUPPORTED],
<ErrorCode>[StaticWarningCode.TYPE_ANNOTATION_DEFERRED_CLASS]);
}
void test_typeAnnotationDeferredClass_functionDeclaration_returnType() {
- resolveWithAndWithoutExperimental(<String>[r'''
+ resolveWithErrors(<String>[r'''
library lib1;
class A {}''', r'''
library root;
import 'lib1.dart' deferred as a;
a.A f() { return null; }'''],
- <ErrorCode>[ParserErrorCode.DEFERRED_IMPORTS_NOT_SUPPORTED],
<ErrorCode>[StaticWarningCode.TYPE_ANNOTATION_DEFERRED_CLASS]);
}
void
test_typeAnnotationDeferredClass_functionTypedFormalParameter_returnType() {
- resolveWithAndWithoutExperimental(<String>[r'''
+ resolveWithErrors(<String>[r'''
library lib1;
class A {}''', r'''
library root;
import 'lib1.dart' deferred as a;
f(a.A g()) {}'''],
- <ErrorCode>[ParserErrorCode.DEFERRED_IMPORTS_NOT_SUPPORTED],
<ErrorCode>[StaticWarningCode.TYPE_ANNOTATION_DEFERRED_CLASS]);
}
void test_typeAnnotationDeferredClass_isExpression() {
- resolveWithAndWithoutExperimental(<String>[r'''
+ resolveWithErrors(<String>[r'''
library lib1;
class A {}''', r'''
library root;
@@ -3136,12 +3128,11 @@
f(var v) {
bool b = v is a.A;
}'''],
- <ErrorCode>[ParserErrorCode.DEFERRED_IMPORTS_NOT_SUPPORTED],
<ErrorCode>[StaticWarningCode.TYPE_ANNOTATION_DEFERRED_CLASS]);
}
void test_typeAnnotationDeferredClass_methodDeclaration_returnType() {
- resolveWithAndWithoutExperimental(<String>[r'''
+ resolveWithErrors(<String>[r'''
library lib1;
class A {}''', r'''
library root;
@@ -3149,66 +3140,60 @@
class C {
a.A m() { return null; }
}'''],
- <ErrorCode>[ParserErrorCode.DEFERRED_IMPORTS_NOT_SUPPORTED],
<ErrorCode>[StaticWarningCode.TYPE_ANNOTATION_DEFERRED_CLASS]);
}
void test_typeAnnotationDeferredClass_simpleFormalParameter() {
- resolveWithAndWithoutExperimental(<String>[r'''
+ resolveWithErrors(<String>[r'''
library lib1;
class A {}''', r'''
library root;
import 'lib1.dart' deferred as a;
f(a.A v) {}'''],
- <ErrorCode>[ParserErrorCode.DEFERRED_IMPORTS_NOT_SUPPORTED],
<ErrorCode>[StaticWarningCode.TYPE_ANNOTATION_DEFERRED_CLASS]);
}
void test_typeAnnotationDeferredClass_typeArgumentList() {
- resolveWithAndWithoutExperimental(<String>[r'''
+ resolveWithErrors(<String>[r'''
library lib1;
class A {}''', r'''
library root;
import 'lib1.dart' deferred as a;
class C<E> {}
C<a.A> c;'''],
- <ErrorCode>[ParserErrorCode.DEFERRED_IMPORTS_NOT_SUPPORTED],
<ErrorCode>[StaticWarningCode.TYPE_ANNOTATION_DEFERRED_CLASS]);
}
void test_typeAnnotationDeferredClass_typeArgumentList2() {
- resolveWithAndWithoutExperimental(<String>[r'''
+ resolveWithErrors(<String>[r'''
library lib1;
class A {}''', r'''
library root;
import 'lib1.dart' deferred as a;
class C<E, F> {}
C<a.A, a.A> c;'''],
- <ErrorCode>[ParserErrorCode.DEFERRED_IMPORTS_NOT_SUPPORTED],
<ErrorCode>[
StaticWarningCode.TYPE_ANNOTATION_DEFERRED_CLASS,
StaticWarningCode.TYPE_ANNOTATION_DEFERRED_CLASS]);
}
void test_typeAnnotationDeferredClass_typeParameter_bound() {
- resolveWithAndWithoutExperimental(<String>[r'''
+ resolveWithErrors(<String>[r'''
library lib1;
class A {}''', r'''
library root;
import 'lib1.dart' deferred as a;
class C<E extends a.A> {}'''],
- <ErrorCode>[ParserErrorCode.DEFERRED_IMPORTS_NOT_SUPPORTED],
<ErrorCode>[StaticWarningCode.TYPE_ANNOTATION_DEFERRED_CLASS]);
}
void test_typeAnnotationDeferredClass_variableDeclarationList() {
- resolveWithAndWithoutExperimental(<String>[r'''
+ resolveWithErrors(<String>[r'''
library lib1;
class A {}''', r'''
library root;
import 'lib1.dart' deferred as a;
a.A v;'''],
- <ErrorCode>[ParserErrorCode.DEFERRED_IMPORTS_NOT_SUPPORTED],
<ErrorCode>[StaticWarningCode.TYPE_ANNOTATION_DEFERRED_CLASS]);
}
diff --git a/pkg/analyzer/test/generated/utilities_test.dart b/pkg/analyzer/test/generated/utilities_test.dart
index 15d39b9..02a3667 100644
--- a/pkg/analyzer/test/generated/utilities_test.dart
+++ b/pkg/analyzer/test/generated/utilities_test.dart
@@ -61,7 +61,7 @@
}
}
-@ReflectiveTestCase()
+@reflectiveTest
class AstClonerTest extends EngineTestCase {
void test_visitAdjacentStrings() {
_assertClone(
@@ -2053,7 +2053,7 @@
}
}
-@ReflectiveTestCase()
+@reflectiveTest
class BooleanArrayTest {
void test_get_negative() {
try {
@@ -2113,7 +2113,7 @@
}
}
-@ReflectiveTestCase()
+@reflectiveTest
class DirectedGraphTest extends EngineTestCase {
void test_addEdge() {
DirectedGraph<DirectedGraphTest_Node> graph =
@@ -3251,7 +3251,7 @@
StringLiteral get(UriBasedDirective node) => node.uri;
}
-@ReflectiveTestCase()
+@reflectiveTest
class LineInfoTest {
void test_creation() {
expect(new LineInfo(<int>[0]), isNotNull);
@@ -3563,7 +3563,7 @@
NodeList<Statement> getList(SwitchMember node) => node.statements;
}
-@ReflectiveTestCase()
+@reflectiveTest
class ListUtilitiesTest {
void test_addAll_emptyToEmpty() {
List<String> list = new List<String>();
@@ -3596,7 +3596,7 @@
}
}
-@ReflectiveTestCase()
+@reflectiveTest
class MultipleMapIteratorTest extends EngineTestCase {
void test_multipleMaps_firstEmpty() {
Map<String, String> map1 = new HashMap<String, String>();
@@ -3714,7 +3714,7 @@
}
}
-@ReflectiveTestCase()
+@reflectiveTest
class NodeReplacerTest extends EngineTestCase {
/**
* An empty list of tokens.
@@ -4764,7 +4764,7 @@
NodeList<C> getList(P parent);
}
-@ReflectiveTestCase()
+@reflectiveTest
class SingleMapIteratorTest extends EngineTestCase {
void test_empty() {
Map<String, String> map = new HashMap<String, String>();
@@ -4822,7 +4822,7 @@
}
}
-@ReflectiveTestCase()
+@reflectiveTest
class SourceRangeTest {
void test_access() {
SourceRange r = new SourceRange(10, 1);
@@ -4972,7 +4972,7 @@
}
}
-@ReflectiveTestCase()
+@reflectiveTest
class StringUtilitiesTest {
void test_EMPTY() {
expect(StringUtilities.EMPTY, "");
@@ -5229,7 +5229,7 @@
}
-@ReflectiveTestCase()
+@reflectiveTest
class TokenMapTest {
void test_creation() {
expect(new TokenMap(), isNotNull);
diff --git a/pkg/analyzer/test/instrumentation/instrumentation_test.dart b/pkg/analyzer/test/instrumentation/instrumentation_test.dart
index a0345a7..ec2aa7c 100644
--- a/pkg/analyzer/test/instrumentation/instrumentation_test.dart
+++ b/pkg/analyzer/test/instrumentation/instrumentation_test.dart
@@ -12,11 +12,12 @@
main() {
group('instrumentation', () {
runReflectiveTests(InstrumentationServiceTest);
+ runReflectiveTests(MulticastInstrumentationServerTest);
});
}
-@ReflectiveTestCase()
-class InstrumentationServiceTest extends ReflectiveTestCase {
+@reflectiveTest
+class InstrumentationServiceTest {
void assertNormal(TestInstrumentationServer server, String tag,
String message) {
String sent = server.normalChannel.toString();
@@ -55,6 +56,32 @@
assertNormal(server, InstrumentationService.TAG_EXCEPTION, '$message:null');
}
+ void test_logFileRead() {
+ TestInstrumentationServer server = new TestInstrumentationServer();
+ InstrumentationService service = new InstrumentationService(server);
+ String path = '/file/path';
+ int time = 978336000000;
+ String content = 'class C {\n}\n';
+ service.logFileRead(path, time, content);
+ assertNormal(
+ server,
+ InstrumentationService.TAG_FILE_READ,
+ '$path:$time:$content');
+ }
+
+ void test_logLogEntry() {
+ TestInstrumentationServer server = new TestInstrumentationServer();
+ InstrumentationService service = new InstrumentationService(server);
+ String level = 'level';
+ DateTime time = new DateTime(2001);
+ String message = 'message';
+ service.logLogEntry(level, time, message);
+ assertNormal(
+ server,
+ InstrumentationService.TAG_LOG_ENTRY,
+ '$level:${time.millisecondsSinceEpoch}:$message');
+ }
+
void test_logNotification() {
TestInstrumentationServer server = new TestInstrumentationServer();
InstrumentationService service = new InstrumentationService(server);
@@ -80,6 +107,47 @@
}
}
+@reflectiveTest
+class MulticastInstrumentationServerTest {
+ TestInstrumentationServer serverA = new TestInstrumentationServer();
+ TestInstrumentationServer serverB = new TestInstrumentationServer();
+ MulticastInstrumentationServer server;
+
+ void setUp() {
+ server = new MulticastInstrumentationServer([serverA, serverB]);
+ }
+
+ void test_log() {
+ server.log('foo bar');
+ _assertNormal(serverA, 'foo bar');
+ _assertNormal(serverB, 'foo bar');
+ }
+
+ void test_logWithPriority() {
+ server.logWithPriority('foo bar');
+ _assertPriority(serverA, 'foo bar');
+ _assertPriority(serverB, 'foo bar');
+ }
+
+ void test_shutdown() {
+ server.shutdown();
+ }
+
+ void _assertNormal(TestInstrumentationServer server, String message) {
+ String sent = server.normalChannel.toString();
+ if (!sent.endsWith('$message\n')) {
+ fail('Expected "...$message", found "$sent"');
+ }
+ }
+
+ void _assertPriority(TestInstrumentationServer server, String message) {
+ String sent = server.priorityChannel.toString();
+ if (!sent.endsWith('$message\n')) {
+ fail('Expected "...$message", found "$sent"');
+ }
+ }
+}
+
class TestInstrumentationServer implements InstrumentationServer {
StringBuffer normalChannel = new StringBuffer();
StringBuffer priorityChannel = new StringBuffer();
diff --git a/pkg/analyzer/test/options_test.dart b/pkg/analyzer/test/options_test.dart
index 5f1bfd6..3d16370 100644
--- a/pkg/analyzer/test/options_test.dart
+++ b/pkg/analyzer/test/options_test.dart
@@ -18,7 +18,6 @@
expect(options.dartSdkPath, isNotNull);
expect(options.disableHints, isFalse);
expect(options.displayVersion, isFalse);
- expect(options.enableEnum, isFalse);
expect(options.enableTypeChecks, isFalse);
expect(options.ignoreUnrecognizedFlags, isFalse);
expect(options.log, isFalse);
@@ -46,12 +45,6 @@
expect(options.definedVariables['bar'], isNull);
});
- test('enable enum', () {
- CommandLineOptions options =
- CommandLineOptions.parse(['--dart-sdk', '.', '--enable-enum', 'foo.dart']);
- expect(options.enableEnum, isTrue);
- });
-
test('enable type checks', () {
CommandLineOptions options = CommandLineOptions.parse(
['--dart-sdk', '.', '--enable_type_checks', 'foo.dart']);
diff --git a/pkg/analyzer/test/reflective_tests.dart b/pkg/analyzer/test/reflective_tests.dart
index 2730680..80c9073 100644
--- a/pkg/analyzer/test/reflective_tests.dart
+++ b/pkg/analyzer/test/reflective_tests.dart
@@ -4,7 +4,7 @@
library reflective_tests;
-@MirrorsUsed(metaTargets: 'ReflectiveTestCase')
+@MirrorsUsed(metaTargets: 'ReflectiveTest')
import 'dart:mirrors';
import 'dart:async';
@@ -31,10 +31,10 @@
ClassMirror classMirror = reflectClass(type);
if (!classMirror.metadata.any(
(InstanceMirror annotation) =>
- annotation.type.reflectedType == ReflectiveTestCase)) {
+ annotation.type.reflectedType == ReflectiveTest)) {
String name = MirrorSystem.getName(classMirror.qualifiedName);
throw new Exception(
- 'Class $name must have annotation "@ReflectiveTestCase()" '
+ 'Class $name must have annotation "@reflectiveTest" '
'in order to be run by runReflectiveTests.');
}
String className = MirrorSystem.getName(classMirror.simpleName);
@@ -124,6 +124,12 @@
* A marker annotation used to instruct dart2js to keep reflection information
* for the annotated classes.
*/
-class ReflectiveTestCase {
- const ReflectiveTestCase();
+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/analyzer2dart/lib/src/cps_generator.dart b/pkg/analyzer2dart/lib/src/cps_generator.dart
index 7efa423..369b5da 100644
--- a/pkg/analyzer2dart/lib/src/cps_generator.dart
+++ b/pkg/analyzer2dart/lib/src/cps_generator.dart
@@ -65,11 +65,12 @@
analyzer.PropertyInducingElement field, VariableDeclaration node) {
dart2js.FieldElement element = converter.convertElement(field);
return withBuilder(
- new IrBuilder(DART_CONSTANT_SYSTEM,
- element,
- // TODO(johnniwinther): Supported closure variables.
- const <dart2js.Local>[]),
+ new DartIrBuilder(DART_CONSTANT_SYSTEM,
+ element,
+ // TODO(johnniwinther): Supported closure variables.
+ new NullClosureVariableInfo()),
() {
+ irBuilder.buildFieldInitializerHeader();
ir.Primitive initializer = build(node.initializer);
return irBuilder.makeFieldDefinition(initializer);
});
@@ -79,16 +80,13 @@
analyzer.FunctionElement function, FunctionExpression node) {
dart2js.FunctionElement element = converter.convertElement(function);
return withBuilder(
- new IrBuilder(DART_CONSTANT_SYSTEM,
- element,
- // TODO(johnniwinther): Supported closure variables.
- const <dart2js.Local>[]),
+ new DartIrBuilder(DART_CONSTANT_SYSTEM,
+ element,
+ // TODO(johnniwinther): Supported closure variables.
+ new NullClosureVariableInfo()),
() {
- function.parameters.forEach((analyzer.ParameterElement parameter) {
- // TODO(johnniwinther): Support "closure variables", that is variables
- // accessed from an inner function.
- irBuilder.createFunctionParameter(converter.convertElement(parameter));
- });
+ irBuilder.buildFunctionHeader(
+ function.parameters.map(converter.convertElement));
// Visit the body directly to avoid processing the signature as
// expressions.
visit(node.body);
@@ -521,3 +519,7 @@
isTypeTest: false);
}
}
+
+class NullClosureVariableInfo extends ClosureVariableInfo {
+ Iterable get capturedVariables => const [];
+}
diff --git a/pkg/analyzer2dart/lib/src/util.dart b/pkg/analyzer2dart/lib/src/util.dart
index 18d0a86..34bc33d 100644
--- a/pkg/analyzer2dart/lib/src/util.dart
+++ b/pkg/analyzer2dart/lib/src/util.dart
@@ -9,7 +9,7 @@
import 'package:analyzer/analyzer.dart';
import 'package:analyzer/src/generated/source.dart';
import 'package:compiler/src/universe/universe.dart';
-import 'package:compiler/src/source_file.dart';
+import 'package:compiler/src/io/source_file.dart';
Selector createSelectorFromMethodInvocation(ArgumentList node,
String name) {
diff --git a/pkg/async_helper/lib/async_helper.dart b/pkg/async_helper/lib/async_helper.dart
index 808e198..37496bc 100644
--- a/pkg/async_helper/lib/async_helper.dart
+++ b/pkg/async_helper/lib/async_helper.dart
@@ -91,4 +91,4 @@
void asyncTest(f()) {
asyncStart();
f().then(asyncSuccess);
-}
\ No newline at end of file
+}
diff --git a/pkg/compiler/lib/src/apiimpl.dart b/pkg/compiler/lib/src/apiimpl.dart
index 8567fb3..6f9250d 100644
--- a/pkg/compiler/lib/src/apiimpl.dart
+++ b/pkg/compiler/lib/src/apiimpl.dart
@@ -12,7 +12,7 @@
import 'elements/elements.dart' as elements;
import 'package:_internal/libraries.dart' hide LIBRARIES;
import 'package:_internal/libraries.dart' as library_info show LIBRARIES;
-import 'source_file.dart';
+import 'io/source_file.dart';
const bool forceIncrementalSupport =
const bool.fromEnvironment('DART2JS_EXPERIMENTAL_INCREMENTAL_SUPPORT');
@@ -70,6 +70,7 @@
sourceMapUri: extractUriOption(options, '--source-map='),
outputUri: extractUriOption(options, '--out='),
terseDiagnostics: hasOption(options, '--terse'),
+ deferredMapUri: extractUriOption(options, '--deferred-map='),
dumpInfo: hasOption(options, '--dump-info'),
buildId: extractStringOption(
options, '--build-id=',
@@ -91,11 +92,17 @@
userHandlerTask = new leg.GenericTask('Diagnostic handler', this),
userProviderTask = new leg.GenericTask('Input provider', this),
]);
- if (!libraryRoot.path.endsWith("/")) {
- throw new ArgumentError("libraryRoot must end with a /");
+ if (libraryRoot == null) {
+ throw new ArgumentError("[libraryRoot] is null.");
}
- if (packageRoot != null && !packageRoot.path.endsWith("/")) {
- throw new ArgumentError("packageRoot must end with a /");
+ if (!libraryRoot.path.endsWith("/")) {
+ throw new ArgumentError("[libraryRoot] must end with a /.");
+ }
+ if (packageRoot == null) {
+ throw new ArgumentError("[packageRoot] is null.");
+ }
+ if (!packageRoot.path.endsWith("/")) {
+ throw new ArgumentError("[packageRoot] must end with a /.");
}
if (!analyzeOnly) {
if (enableAsyncAwait) {
@@ -309,10 +316,6 @@
}
Uri translatePackageUri(leg.Spannable node, Uri uri) {
- if (packageRoot == null) {
- reportFatalError(
- node, leg.MessageKind.PACKAGE_ROOT_NOT_SET, {'uri': uri});
- }
return packageRoot.resolve(uri.path);
}
diff --git a/pkg/compiler/lib/src/closure.dart b/pkg/compiler/lib/src/closure.dart
index fc78950..46219a33 100644
--- a/pkg/compiler/lib/src/closure.dart
+++ b/pkg/compiler/lib/src/closure.dart
@@ -104,7 +104,7 @@
// find a more general solution.
class ClosureFieldElement extends ElementX
implements VariableElement, CapturedVariable {
- /// The source variable this element refers to.
+ /// The [BoxLocal] or [LocalElement] being accessed through the field.
final Local local;
ClosureFieldElement(String name,
@@ -301,25 +301,25 @@
// The box-element for a scope, and the captured variables that need to be
// stored in the box.
class ClosureScope {
- BoxLocal boxElement;
- Map<VariableElement, BoxFieldElement> _capturedVariableMapping;
+ final BoxLocal boxElement;
+ final Map<Local, BoxFieldElement> capturedVariables;
// If the scope is attached to a [For] contains the variables that are
// declared in the initializer of the [For] and that need to be boxed.
// Otherwise contains the empty List.
List<VariableElement> boxedLoopVariables = const <VariableElement>[];
- ClosureScope(this.boxElement, this._capturedVariableMapping);
+ ClosureScope(this.boxElement, this.capturedVariables);
bool hasBoxedLoopVariables() => !boxedLoopVariables.isEmpty;
bool isCapturedVariable(VariableElement variable) {
- return _capturedVariableMapping.containsKey(variable);
+ return capturedVariables.containsKey(variable);
}
void forEachCapturedVariable(f(LocalVariableElement variable,
BoxFieldElement boxField)) {
- _capturedVariableMapping.forEach(f);
+ capturedVariables.forEach(f);
}
}
@@ -335,19 +335,12 @@
// other argument. It is only set for instance-members.
final ThisLocal thisLocal;
- // Maps free locals, arguments and function elements to their captured
- // copies.
- final Map<Local, CapturedVariable> _freeVariableMapping =
+ // Maps free locals, arguments, function elements, and box locals to
+ // their locations.
+ final Map<Local, CapturedVariable> freeVariableMap =
new Map<Local, CapturedVariable>();
- // Maps closure-fields to their captured elements. This is somehow the inverse
- // mapping of [freeVariableMapping], but whereas [freeVariableMapping] does
- // not deal with boxes, here we map instance-fields (which might represent
- // boxes) to their boxElement.
- final Map<ClosureFieldElement, Local> _closureFieldMapping =
- new Map<ClosureFieldElement, Local>();
-
- // Maps scopes ([Loop] and [FunctionExpression] nodes) to their
+ // Maps [Loop] and [FunctionExpression] nodes to their
// [ClosureScope] which contains their box and the
// captured variables that are stored in the box.
// This map will be empty if the method/closure of this [ClosureData] does not
@@ -362,45 +355,23 @@
this.thisLocal);
void addFreeVariable(Local element) {
- assert(_freeVariableMapping[element] == null);
- _freeVariableMapping[element] = null;
+ assert(freeVariableMap[element] == null);
+ freeVariableMap[element] = null;
}
- Iterable<Local> get freeVariables => _freeVariableMapping.keys;
+ Iterable<Local> get freeVariables => freeVariableMap.keys;
bool isFreeVariable(Local element) {
- return _freeVariableMapping.containsKey(element);
+ return freeVariableMap.containsKey(element);
}
- CapturedVariable getFreeVariableElement(Local element) {
- return _freeVariableMapping[element];
- }
-
- /// Sets the free [variable] to be captured by the [boxField].
- void setFreeVariableBoxField(Local variable,
- BoxFieldElement boxField) {
- _freeVariableMapping[variable] = boxField;
- }
-
- /// Sets the free [variable] to be captured by the [closureField].
- void setFreeVariableClosureField(Local variable,
- ClosureFieldElement closureField) {
- _freeVariableMapping[variable] = closureField;
- }
-
-
void forEachFreeVariable(f(Local variable,
CapturedVariable field)) {
- _freeVariableMapping.forEach(f);
+ freeVariableMap.forEach(f);
}
Local getLocalVariableForClosureField(ClosureFieldElement field) {
- return _closureFieldMapping[field];
- }
-
- void setLocalVariableForClosureField(ClosureFieldElement field,
- Local variable) {
- _closureFieldMapping[field] = variable;
+ return field.local;
}
bool get isClosure => closureElement != null;
@@ -412,7 +383,7 @@
}
bool isVariableBoxed(Local variable) {
- CapturedVariable copy = _freeVariableMapping[variable];
+ CapturedVariable copy = freeVariableMap[variable];
if (copy is BoxFieldElement) {
return true;
}
@@ -421,7 +392,7 @@
void forEachCapturedVariable(void f(Local variable,
CapturedVariable field)) {
- _freeVariableMapping.forEach((variable, copy) {
+ freeVariableMap.forEach((variable, copy) {
if (variable is BoxLocal) return;
f(variable, copy);
});
@@ -432,7 +403,7 @@
void forEachBoxedVariable(void f(LocalVariableElement local,
BoxFieldElement field)) {
- _freeVariableMapping.forEach((variable, copy) {
+ freeVariableMap.forEach((variable, copy) {
if (!isVariableBoxed(variable)) return;
f(variable, copy);
});
@@ -442,7 +413,7 @@
}
void removeMyselfFrom(Universe universe) {
- _freeVariableMapping.values.forEach((e) {
+ freeVariableMap.values.forEach((e) {
universe.closurizedMembers.remove(e);
universe.fieldSetters.remove(e);
universe.fieldGetters.remove(e);
@@ -544,7 +515,7 @@
Iterable<Local> freeVariables = data.freeVariables.toList();
freeVariables.forEach((Local fromElement) {
assert(data.isFreeVariable(fromElement));
- assert(data.getFreeVariableElement(fromElement) == null);
+ assert(data.freeVariableMap[fromElement] == null);
assert(isCapturedVariable(fromElement));
BoxFieldElement boxFieldElement =
getCapturedVariableBoxField(fromElement);
@@ -554,7 +525,7 @@
fieldCaptures.add(fromElement);
} else {
// A boxed element.
- data.setFreeVariableBoxField(fromElement, boxFieldElement);
+ data.freeVariableMap[fromElement] = boxFieldElement;
boxes.add(boxFieldElement.box);
}
});
@@ -566,8 +537,7 @@
ClosureFieldElement closureField =
new ClosureFieldElement(name, local, closureClass);
closureClass.addField(closureField, compiler);
- data.setLocalVariableForClosureField(closureField, local);
- data.setFreeVariableClosureField(local, closureField);
+ data.freeVariableMap[local] = closureField;
}
// Add the box elements first so we get the same ordering.
@@ -848,7 +818,30 @@
}
visitFor(For node) {
- visitLoop(node);
+ inNewScope(node, () {
+ // First visit initializer and update so we can easily check if a loop
+ // variable was captured in one of these subexpressions.
+ if (node.initializer != null) visit(node.initializer);
+ if (node.update != null) visit(node.update);
+
+ // Loop variables that have not been captured yet can safely be flagged as
+ // non-mutated, because no nested function can observe the mutation.
+ if (node.initializer is VariableDefinitions) {
+ VariableDefinitions definitions = node.initializer;
+ definitions.definitions.nodes.forEach((Node node) {
+ LocalVariableElement local = elements[node];
+ if (!isCapturedVariable(local)) {
+ mutatedVariables.remove(local);
+ }
+ });
+ }
+
+ // Visit condition and body.
+ // This must happen after the above, so any loop variables mutated in the
+ // condition or body are indeed flagged as mutated.
+ if (node.conditionStatement != null) visit(node.conditionStatement);
+ if (node.body != null) visit(node.body);
+ });
// See if we have declared loop variables that need to be boxed.
if (node.initializer == null) return;
VariableDefinitions definitions = node.initializer.asVariableDefinitions();
diff --git a/pkg/compiler/lib/src/compile_time_constants.dart b/pkg/compiler/lib/src/compile_time_constants.dart
index 31eb5b3..24bacbe 100644
--- a/pkg/compiler/lib/src/compile_time_constants.dart
+++ b/pkg/compiler/lib/src/compile_time_constants.dart
@@ -133,8 +133,9 @@
Node node = element.node;
if (pendingVariables.contains(element)) {
if (isConst) {
- compiler.reportFatalError(
+ compiler.reportError(
node, MessageKind.CYCLIC_COMPILE_TIME_CONSTANTS);
+ return new ErroneousConstantExpression();
}
return null;
}
@@ -155,7 +156,7 @@
if (elementType.isMalformed && !value.value.isNull) {
if (isConst) {
ErroneousElement element = elementType.element;
- compiler.reportFatalError(
+ compiler.reportError(
node, element.messageKind, element.messageArguments);
} else {
// We need to throw an exception at runtime.
@@ -166,7 +167,7 @@
if (!constantSystem.isSubtype(compiler.types,
constantType, elementType)) {
if (isConst) {
- compiler.reportFatalError(
+ compiler.reportError(
node, MessageKind.NOT_ASSIGNABLE,
{'fromType': constantType, 'toType': elementType});
} else {
@@ -507,6 +508,16 @@
assert(elements.isTypeLiteral(send));
return makeTypeConstant(send, elements.getTypeLiteralType(send));
} else if (send.receiver != null) {
+ if (send.selector.asIdentifier().source == "length") {
+ AstConstant left = evaluate(send.receiver);
+ if (left != null && left.value.isString) {
+ StringConstantValue stringConstantValue = left.value;
+ DartString string = stringConstantValue.primitiveValue;
+ IntConstantValue length = constantSystem.createInt(string.length);
+ return new AstConstant(
+ context, send, new VariableConstantExpression(length, element));
+ }
+ }
// Fall through to error handling.
} else if (!Elements.isUnresolved(element)
&& element.isVariable
@@ -520,7 +531,7 @@
}
return signalNotCompileTimeConstant(send);
} else if (send.isCall) {
- if (identical(element, compiler.identicalFunction)
+ if (element == compiler.identicalFunction
&& send.argumentCount() == 2) {
AstConstant left = evaluate(send.argumentsNode.nodes.head);
AstConstant right = evaluate(send.argumentsNode.nodes.tail.head);
@@ -605,9 +616,10 @@
} else if (!condition.value.isBool) {
DartType conditionType = condition.value.getType(compiler.coreTypes);
if (isEvaluatingConstant) {
- compiler.reportFatalError(
+ compiler.reportError(
node.condition, MessageKind.NOT_ASSIGNABLE,
{'fromType': conditionType, 'toType': compiler.boolClass.rawType});
+ return new ErroneousAstConstant(context, node);
}
return null;
}
@@ -655,10 +667,14 @@
if (!selector.applies(target, compiler.world)) {
String name = Elements.constructorNameForDiagnostics(
target.enclosingClass.name, target.name);
- compiler.reportFatalError(
+ compiler.reportError(
node,
MessageKind.INVALID_CONSTRUCTOR_ARGUMENTS,
{'constructorName': name});
+
+ return new List<AstConstant>.filled(
+ target.functionSignature.parameterCount,
+ new ErroneousAstConstant(context, node));
}
return selector.makeArgumentsList2(arguments,
target,
@@ -728,14 +744,14 @@
ConstantValue defaultValue = normalizedArguments[1].value;
if (firstArgument.isNull) {
- compiler.reportFatalError(
+ compiler.reportError(
send.arguments.head, MessageKind.NULL_NOT_ALLOWED);
return null;
}
if (!firstArgument.isString) {
DartType type = defaultValue.getType(compiler.coreTypes);
- compiler.reportFatalError(
+ compiler.reportError(
send.arguments.head, MessageKind.NOT_ASSIGNABLE,
{'fromType': type, 'toType': compiler.stringClass.rawType});
return null;
@@ -744,7 +760,7 @@
if (constructor == compiler.intEnvironment &&
!(defaultValue.isNull || defaultValue.isInt)) {
DartType type = defaultValue.getType(compiler.coreTypes);
- compiler.reportFatalError(
+ compiler.reportError(
send.arguments.tail.head, MessageKind.NOT_ASSIGNABLE,
{'fromType': type, 'toType': compiler.intClass.rawType});
return null;
@@ -753,7 +769,7 @@
if (constructor == compiler.boolEnvironment &&
!(defaultValue.isNull || defaultValue.isBool)) {
DartType type = defaultValue.getType(compiler.coreTypes);
- compiler.reportFatalError(
+ compiler.reportError(
send.arguments.tail.head, MessageKind.NOT_ASSIGNABLE,
{'fromType': type, 'toType': compiler.boolClass.rawType});
return null;
@@ -762,7 +778,7 @@
if (constructor == compiler.stringEnvironment &&
!(defaultValue.isNull || defaultValue.isString)) {
DartType type = defaultValue.getType(compiler.coreTypes);
- compiler.reportFatalError(
+ compiler.reportError(
send.arguments.tail.head, MessageKind.NOT_ASSIGNABLE,
{'fromType': type, 'toType': compiler.stringClass.rawType});
return null;
@@ -810,7 +826,8 @@
Selector selector,
List<AstConstant> concreteArguments,
List<AstConstant> normalizedArguments) {
- assert(invariant(node, selector.applies(constructor, compiler.world),
+ assert(invariant(node, selector.applies(constructor, compiler.world) ||
+ compiler.compilationFailed,
message: "Selector $selector does not apply to constructor "
"$constructor."));
@@ -850,13 +867,16 @@
error(Node node, MessageKind message) {
// TODO(floitsch): get the list of constants that are currently compiled
// and present some kind of stack-trace.
- compiler.reportFatalError(node, message);
+ compiler.reportError(node, message);
}
AstConstant signalNotCompileTimeConstant(Node node,
{MessageKind message: MessageKind.NOT_A_COMPILE_TIME_CONSTANT}) {
if (isEvaluatingConstant) {
error(node, message);
+
+ return new AstConstant(
+ null, node, new PrimitiveConstantExpression(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
@@ -913,7 +933,7 @@
if (!constantSystem.isSubtype(compiler.types,
constantType, elementType)) {
compiler.withCurrentElement(constant.element, () {
- compiler.reportFatalError(
+ compiler.reportError(
constant.node, MessageKind.NOT_ASSIGNABLE,
{'fromType': constantType, 'toType': elementType});
});
@@ -1098,4 +1118,10 @@
ConstantValue get value => expression.value;
String toString() => expression.toString();
-}
\ No newline at end of file
+}
+
+/// A synthetic constant used to recover from errors.
+class ErroneousAstConstant extends AstConstant {
+ ErroneousAstConstant(Element element, Node node)
+ : super(element, node, new ErroneousConstantExpression());
+}
diff --git a/pkg/compiler/lib/src/compiler.dart b/pkg/compiler/lib/src/compiler.dart
index 4646013..1d31f07 100644
--- a/pkg/compiler/lib/src/compiler.dart
+++ b/pkg/compiler/lib/src/compiler.dart
@@ -669,6 +669,7 @@
final bool trustPrimitives;
final bool enableConcreteTypeInference;
final bool disableTypeInferenceFlag;
+ final Uri deferredMapUri;
final bool dumpInfo;
final bool useContentSecurityPolicy;
final bool enableExperimentalMirrors;
@@ -985,6 +986,7 @@
this.outputUri: null,
this.buildId: UNDETERMINED_BUILD_ID,
this.terseDiagnostics: false,
+ this.deferredMapUri: null,
this.dumpInfo: false,
this.showPackageWarnings: false,
this.useContentSecurityPolicy: false,
@@ -1531,7 +1533,7 @@
// compile-time constants that are metadata. This means adding
// something to the resolution queue. So we cannot wait with
// this until after the resolution queue is processed.
- deferredLoadTask.ensureMetadataResolved(this);
+ deferredLoadTask.beforeResolution(this);
phase = PHASE_RESOLVING;
if (analyzeAll) {
@@ -1788,34 +1790,6 @@
node, messageKind, arguments, api.Diagnostic.ERROR);
}
- /**
- * Reports an error and then aborts the compiler. Avoid using this method.
- *
- * In order to support incremental compilation, it is preferable to use
- * [reportError]. However, care must be taken to leave the compiler in a
- * consistent state, for example, by creating synthetic erroneous objects.
- *
- * If there's absolutely no way to leave the compiler in a consistent state,
- * calling this method is preferred as it will set [compilerWasCancelled] to
- * true which alerts the incremental compiler to discard all state and start
- * a new compiler. Throwing an exception is also better, as this will set
- * [hasCrashed] which the incremental compiler also listens too (but don't
- * throw exceptions, it creates a really bad user experience).
- *
- * In any case, calling this method is a last resort, as it essentially
- * breaks the user experience of the incremental compiler. The purpose of the
- * incremental compiler is to improve developer productivity. Developers
- * frequently make mistakes, so syntax errors and spelling errors are
- * considered normal to the incremental compiler.
- */
- void reportFatalError(Spannable node, MessageKind messageKind,
- [Map arguments = const {}]) {
- reportError(node, messageKind, arguments);
- // TODO(ahe): Make this only abort the current method.
- throw new CompilerCancelledException(
- 'Error: Cannot continue due to previous error.');
- }
-
void reportWarning(Spannable node, MessageKind messageKind,
[Map arguments = const {}]) {
reportDiagnosticInternal(
@@ -2155,7 +2129,12 @@
}
}
-class CompilerCancelledException implements Exception {
+/// Don't throw this error. It immediately aborts the compiler which causes the
+/// following problems:
+///
+/// 1. No further errors and warnings are reported.
+/// 2. Breaks incremental compilation.
+class CompilerCancelledException extends Error {
final String reason;
CompilerCancelledException(this.reason);
diff --git a/pkg/compiler/lib/src/constant_system_dart.dart b/pkg/compiler/lib/src/constant_system_dart.dart
index 30fb62e..0c507a7 100644
--- a/pkg/compiler/lib/src/constant_system_dart.dart
+++ b/pkg/compiler/lib/src/constant_system_dart.dart
@@ -233,6 +233,12 @@
NumConstantValue rightNum = right;
double result = leftNum.primitiveValue + rightNum.primitiveValue;
return DART_CONSTANT_SYSTEM.createDouble(result);
+ } else if (left.isString && right.isString) {
+ StringConstantValue leftString = left;
+ StringConstantValue rightString = right;
+ DartString result = new DartString.concat(leftString.primitiveValue,
+ rightString.primitiveValue);
+ return DART_CONSTANT_SYSTEM.createString(result);
} else {
return null;
}
diff --git a/pkg/compiler/lib/src/constants/expressions.dart b/pkg/compiler/lib/src/constants/expressions.dart
index fe1357d..ef416fa 100644
--- a/pkg/compiler/lib/src/constants/expressions.dart
+++ b/pkg/compiler/lib/src/constants/expressions.dart
@@ -45,6 +45,17 @@
}
}
+/// A synthetic constant used to recover from errors.
+class ErroneousConstantExpression extends ConstantExpression {
+ final PrimitiveConstantValue value = new NullConstantValue();
+
+ ErroneousConstantExpression();
+
+ accept(ConstantExpressionVisitor visitor, [context]) {
+ // Do nothing. This is an error.
+ }
+}
+
/// Boolean, int, double, string, or null constant.
class PrimitiveConstantExpression extends ConstantExpression {
final PrimitiveConstantValue value;
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 3a1ea5d..4f42e9d 100644
--- a/pkg/compiler/lib/src/cps_ir/cps_ir_builder.dart
+++ b/pkg/compiler/lib/src/cps_ir/cps_ir_builder.dart
@@ -9,12 +9,15 @@
import '../dart_types.dart';
import '../dart2jslib.dart';
import '../elements/elements.dart';
-import '../source_file.dart';
+import '../io/source_file.dart';
import '../tree/tree.dart' as ast;
import '../scanner/scannerlib.dart' show Token, isUserDefinableOperator;
import '../universe/universe.dart' show SelectorKind;
import 'cps_ir_nodes.dart' as ir;
import '../elements/modelx.dart' show SynthesizedConstructorElementX;
+import '../closure.dart';
+import '../closure.dart' as closurelib;
+import '../js_backend/js_backend.dart' show JavaScriptBackend;
part 'cps_ir_builder_visitor.dart';
@@ -24,18 +27,18 @@
/// [ir.Primitive] that is their value. Parameters and locals are
/// assigned indexes which can be used to refer to them.
class Environment {
- /// A map from elements to their environment index.
- final Map<Element, int> variable2index;
+ /// A map from locals to their environment index.
+ final Map<Local, int> variable2index;
/// A reverse map from environment indexes to the variable.
- final List<Element> index2variable;
+ final List<Local> index2variable;
/// A map from environment indexes to their value.
final List<ir.Primitive> index2value;
Environment.empty()
- : variable2index = <Element, int>{},
- index2variable = <Element>[],
+ : variable2index = <Local, int>{},
+ index2variable = <Local>[],
index2value = <ir.Primitive>[];
/// Construct an environment that is a copy of another one.
@@ -43,14 +46,14 @@
/// The mapping from elements to indexes is shared, not copied.
Environment.from(Environment other)
: variable2index = other.variable2index,
- index2variable = new List<Element>.from(other.index2variable),
+ index2variable = new List<Local>.from(other.index2variable),
index2value = new List<ir.Primitive>.from(other.index2value);
get length => index2variable.length;
ir.Primitive operator [](int index) => index2value[index];
- void extend(Element element, ir.Primitive value) {
+ void extend(Local element, ir.Primitive value) {
// Assert that the name is not already in the environment. `null` is used
// as the name of anonymous variables. Because the variable2index map is
// shared, `null` can already occur. This is safe because such variables
@@ -64,14 +67,13 @@
index2value.add(value);
}
- ir.Primitive lookup(Element element) {
- assert(!element.isConst);
+ ir.Primitive lookup(Local element) {
assert(invariant(element, variable2index.containsKey(element),
message: "Unknown variable: $element."));
return index2value[variable2index[element]];
}
- void update(Element element, ir.Primitive value) {
+ void update(Local element, ir.Primitive value) {
index2value[variable2index[element]] = value;
}
@@ -82,7 +84,7 @@
assert(other.length >= length);
for (int i = 0; i < length; ++i) {
// An index maps to the same variable in both environments.
- Element variable = index2variable[i];
+ Local variable = index2variable[i];
if (variable != other.index2variable[i]) return false;
// The variable maps to the same index in both environments.
@@ -179,8 +181,6 @@
/// Shared state between IrBuilders of nested functions.
class IrBuilderClosureState {
- final Iterable<Entity> closureLocals;
-
/// Maps local variables to their corresponding [ClosureVariable] object.
final Map<Local, ir.ClosureVariable> local2closure =
<Local, ir.ClosureVariable>{};
@@ -194,13 +194,12 @@
return function2closures.putIfAbsent(element, () => <ir.ClosureVariable>[]);
}
- IrBuilderClosureState(this.closureLocals) {
- for (Local local in closureLocals) {
- ExecutableElement context = local.executableContext;
- ir.ClosureVariable variable = new ir.ClosureVariable(context, local);
- local2closure[local] = variable;
- getClosureList(context).add(variable);
- }
+ /// Creates a closure variable for the given local.
+ void makeClosureVariable(Local local) {
+ ir.ClosureVariable variable =
+ new ir.ClosureVariable(local.executableContext, local);
+ local2closure[local] = variable;
+ getClosureList(local.executableContext).add(variable);
}
}
@@ -222,21 +221,60 @@
final List<ir.Definition> functionParameters = <ir.Definition>[];
+ /// Maps boxed locals to their location. These locals are not part of
+ /// the environment.
+ final Map<Local, ClosureLocation> boxedVariables = {};
+
+ /// If non-null, this refers to the receiver (`this`) in the enclosing method.
+ ir.Primitive receiver;
+
IrBuilderSharedState(this.constantSystem, this.currentElement);
}
/// A factory for building the cps IR.
-class IrBuilder {
+///
+/// [DartIrBuilder] and [JsIrBuilder] implement nested functions and captured
+/// variables in different ways.
+abstract class IrBuilder {
+ IrBuilder _makeInstance();
+
+ void declareLocalVariable(LocalVariableElement element,
+ {ir.Primitive initialValue});
+ void declareLocalFunction(LocalFunctionElement element, Object function);
+ ir.Primitive buildFunctionExpression(Object function);
+ ir.Primitive buildLocalGet(LocalElement element);
+ ir.Primitive buildLocalSet(LocalElement element, ir.Primitive value);
+
+ /// Called when entering a nested function with free variables.
+ /// The free variables should subsequently be accessible using [buildLocalGet]
+ /// and [buildLocalSet].
+ void _buildClosureEnvironmentSetup(ClosureEnvironment env);
+
+ /// Enter a scope that declares boxed variables. The boxed variables must
+ /// subsequently be accessible using [buildLocalGet], [buildLocalSet], etc.
+ void _buildClosureScopeSetup(ClosureScope scope);
+
+ /// Add the given function parameter to the IR, and bind it in the environment
+ /// or put it in its box, if necessary.
+ void _createFunctionParameter(ParameterElement parameterElement);
+
+ /// Called before the update expression of a for-loop. A new box should be
+ /// created for [scope] and the values from the old box should be copied over.
+ void _migrateLoopVariables(ClosureScope scope);
+
// TODO(johnniwinther): Make these field final and remove the default values
// when [IrBuilder] is a property of [IrBuilderVisitor] instead of a mixin.
final List<ir.Parameter> _parameters = <ir.Parameter>[];
- final IrBuilderSharedState state;
+ IrBuilderSharedState state;
- final IrBuilderClosureState closure;
+ IrBuilderClosureState closure;
/// A map from variable indexes to their values.
+ ///
+ /// [BoxLocal]s map to their box. [LocalElement]s that are boxed are not
+ /// in the map; look up their [BoxLocal] instead.
Environment environment;
// The IR builder maintains a context, which is an expression with a hole in
@@ -266,12 +304,12 @@
ir.Expression _root = null;
ir.Expression _current = null;
- IrBuilder(ConstantSystem constantSystem,
- ExecutableElement currentElement,
- Iterable<Entity> closureLocals)
- : this.state = new IrBuilderSharedState(constantSystem, currentElement),
- this.closure = new IrBuilderClosureState(closureLocals),
- this.environment = new Environment.empty();
+ /// Initialize a new top-level IR builder.
+ void _init(ConstantSystem constantSystem, ExecutableElement currentElement) {
+ state = new IrBuilderSharedState(constantSystem, currentElement);
+ closure = new IrBuilderClosureState();
+ environment = new Environment.empty();
+ }
/// Construct a delimited visitor for visiting a subtree.
///
@@ -279,10 +317,12 @@
/// local variables to their values, which is initially a copy of the parent
/// environment. It has its own context for building an IR expression, so
/// the built expression is not plugged into the parent's context.
- IrBuilder.delimited(IrBuilder parent)
- : this.state = parent.state,
- this.closure = parent.closure,
- this.environment = new Environment.from(parent.environment);
+ IrBuilder makeDelimitedBuilder() {
+ return _makeInstance()
+ ..state = state
+ ..closure = closure
+ ..environment = new Environment.from(environment);
+ }
/// Construct a visitor for a recursive continuation.
///
@@ -292,101 +332,53 @@
/// recursive invocations will be passed values for all the local variables,
/// which may be eliminated later if they are redundant---if they take on
/// the same value at all invocation sites.
- IrBuilder.recursive(IrBuilder parent)
- : this.state = parent.state,
- this.closure = parent.closure,
- this.environment = new Environment.empty() {
- parent.environment.index2variable.forEach(createLocalParameter);
+ IrBuilder makeRecursiveBuilder() {
+ IrBuilder inner = _makeInstance()
+ ..state = state
+ ..closure = closure
+ ..environment = new Environment.empty();
+ environment.index2variable.forEach(inner.createLocalParameter);
+ return inner;
}
/// Construct a builder for an inner function.
- IrBuilder.innerFunction(IrBuilder parent,
- ExecutableElement currentElement)
- : this.state = new IrBuilderSharedState(parent.state.constantSystem,
- currentElement),
- this.closure = parent.closure,
- this.environment = new Environment.empty();
-
+ IrBuilder makeInnerFunctionBuilder(ExecutableElement currentElement) {
+ return _makeInstance()
+ ..state = new IrBuilderSharedState(state.constantSystem, currentElement)
+ ..closure = closure
+ ..environment = new Environment.empty();
+ }
bool get isOpen => _root == null || _current != null;
- /// True if [element] is a local variable, local function, or parameter that
- /// is accessed from an inner function. Recursive self-references in a local
- /// function count as closure accesses.
- ///
- /// If `true`, [element] is a [LocalElement].
- bool isClosureVariable(Element element) {
- return closure.closureLocals.contains(element);
+
+ void buildFieldInitializerHeader({ClosureScope closureScope}) {
+ _buildClosureScopeSetup(closureScope);
}
- /// Returns the [ClosureVariable] corresponding to the given variable.
- /// Returns `null` for non-closure variables.
- ir.ClosureVariable getClosureVariable(LocalElement element) {
- return closure.local2closure[element];
+ void buildFunctionHeader(Iterable<ParameterElement> parameters,
+ {ClosureScope closureScope,
+ ClosureEnvironment closureEnvironment}) {
+ _buildClosureEnvironmentSetup(closureEnvironment);
+ _buildClosureScopeSetup(closureScope);
+ parameters.forEach(_createFunctionParameter);
}
- /// Adds the given parameter to the function currently being built.
- void createFunctionParameter(ParameterElement parameterElement) {
- if (isClosureVariable(parameterElement)) {
- state.functionParameters.add(getClosureVariable(parameterElement));
- } else {
- state.functionParameters.add(createLocalParameter(parameterElement));
- }
- }
-
- /// Create a parameter for [parameterElement] and add it to the current
- /// environment.
- ir.Parameter createLocalParameter(LocalElement parameterElement) {
- ir.Parameter parameter = new ir.Parameter(parameterElement);
+ /// Creates a parameter for [local] and adds it to the current environment.
+ ir.Parameter createLocalParameter(Local local) {
+ ir.Parameter parameter = new ir.Parameter(local);
_parameters.add(parameter);
- environment.extend(parameterElement, parameter);
+ environment.extend(local, parameter);
return parameter;
}
- /// Add the constant [variableElement] to the environment with [value] as its
+ /// Adds the constant [variableElement] to the environment with [value] as its
/// constant value.
void declareLocalConstant(LocalVariableElement variableElement,
ConstantExpression value) {
state.localConstants.add(new ConstDeclaration(variableElement, value));
}
- /// Add [variableElement] to the environment with [initialValue] as its
- /// initial value.
- void declareLocalVariable(LocalVariableElement variableElement,
- {ir.Primitive initialValue}) {
- assert(isOpen);
- if (initialValue == null) {
- // TODO(kmillikin): Consider pooling constants.
- // The initial value is null.
- initialValue = buildNullLiteral();
- }
- if (isClosureVariable(variableElement)) {
- add(new ir.SetClosureVariable(getClosureVariable(variableElement),
- initialValue,
- isDeclaration: true));
- } else {
- // In case a primitive was introduced for the initializer expression,
- // use this variable element to help derive a good name for it.
- initialValue.useElementAsHint(variableElement);
- environment.extend(variableElement, initialValue);
- }
- }
-
- /// Add [functionElement] to the environment with provided [definition].
- void declareLocalFunction(LocalFunctionElement functionElement,
- ir.FunctionDefinition definition) {
- assert(isOpen);
- if (isClosureVariable(functionElement)) {
- ir.ClosureVariable variable = getClosureVariable(functionElement);
- add(new ir.DeclareFunction(variable, definition));
- } else {
- ir.CreateFunction prim = new ir.CreateFunction(definition);
- add(new ir.LetPrim(prim));
- environment.extend(functionElement, prim);
- prim.useElementAsHint(functionElement);
- }
- }
-
// Plug an expression into the 'hole' in the context being accumulated. The
// empty context (just a hole) is represented by root (and current) being
// null. Since the hole in the current context is filled by this function,
@@ -522,8 +514,8 @@
assert(isOpen);
// The then and else expressions are delimited.
- IrBuilder thenBuilder = new IrBuilder.delimited(this);
- IrBuilder elseBuilder = new IrBuilder.delimited(this);
+ IrBuilder thenBuilder = makeDelimitedBuilder();
+ IrBuilder elseBuilder = makeDelimitedBuilder();
ir.Primitive thenValue = buildThenExpression(thenBuilder);
ir.Primitive elseValue = buildElseExpression(elseBuilder);
@@ -561,13 +553,6 @@
}
- /// Create a function expression from [definition].
- ir.Primitive buildFunctionExpression(ir.FunctionDefinition definition) {
- ir.CreateFunction prim = new ir.CreateFunction(definition);
- add(new ir.LetPrim(prim));
- return prim;
- }
-
/**
* Add an explicit `return null` for functions that don't have a return
* statement on each branch. This includes functions with an empty body,
@@ -766,44 +751,12 @@
(k) => new ir.ConcatenateStrings(k, arguments));
}
- /// Create a read access of [local].
- ir.Primitive buildLocalGet(LocalElement local) {
- assert(isOpen);
- if (isClosureVariable(local)) {
- ir.Primitive result =
- new ir.GetClosureVariable(getClosureVariable(local));
- add(new ir.LetPrim(result));
- return result;
- } else {
- return environment.lookup(local);
- }
- }
-
- /// Create a write access to [local] with the provided [value].
- ir.Primitive buildLocalSet(LocalElement local, ir.Primitive value) {
- assert(isOpen);
- if (isClosureVariable(local)) {
- add(new ir.SetClosureVariable(getClosureVariable(local), value));
- } else {
- value.useElementAsHint(local);
- environment.update(local, value);
- }
- return value;
- }
-
/// Create an invocation of [local] where the argument structure is defined
/// by [selector] and the argument values are defined by [arguments].
ir.Primitive buildLocalInvocation(LocalElement local,
Selector selector,
List<ir.Definition> arguments) {
- ir.Primitive receiver;
- if (isClosureVariable(local)) {
- receiver = new ir.GetClosureVariable(getClosureVariable(local));
- add(new ir.LetPrim(receiver));
- } else {
- receiver = environment.lookup(local);
- }
- return _buildInvokeCall(receiver, selector, arguments);
+ return _buildInvokeCall(buildLocalGet(local), selector, arguments);
}
/// Create an invocation of the [functionExpression] where the argument
@@ -829,8 +782,8 @@
assert(isOpen);
// The then and else parts are delimited.
- IrBuilder thenBuilder = new IrBuilder.delimited(this);
- IrBuilder elseBuilder = new IrBuilder.delimited(this);
+ IrBuilder thenBuilder = makeDelimitedBuilder();
+ IrBuilder elseBuilder = makeDelimitedBuilder();
buildThenPart(thenBuilder);
buildElsePart(elseBuilder);
@@ -913,11 +866,16 @@
///
/// The jump [target] is used to identify which `break` and `continue`
/// statements that have this `for` statement as their target.
+ ///
+ /// The [closureScope] identifies variables that should be boxed in this loop.
+ /// This includes variables declared inside the body of the loop as well as
+ /// in the for-loop initializer.
void buildFor({SubbuildFunction buildInitializer,
SubbuildFunction buildCondition,
SubbuildFunction buildBody,
SubbuildFunction buildUpdate,
- JumpTarget target}) {
+ JumpTarget target,
+ ClosureScope closureScope}) {
assert(isOpen);
// For loops use four named continuations: the entry to the condition,
@@ -942,9 +900,23 @@
// invocation of the continue continuation (i.e., no continues in the
// body), the continue continuation is inlined in the body.
+ // If the variables declared in the initializer must be boxed, we must
+ // create the box before entering the loop and renew the box at the end
+ // of the loop.
+ bool hasBoxedLoopVariables = closureScope != null &&
+ !closureScope.boxedLoopVariables.isEmpty;
+
+ // If a variable declared in the initializer must be boxed, we should
+ // create the box before initializing these variables.
+ // Otherwise, it is best to create the box inside the body so we don't have
+ // to create a box before the loop AND at the end of the loop.
+ if (hasBoxedLoopVariables) {
+ _buildClosureScopeSetup(closureScope);
+ }
+
buildInitializer(this);
- IrBuilder condBuilder = new IrBuilder.recursive(this);
+ IrBuilder condBuilder = makeRecursiveBuilder();
ir.Primitive condition = buildCondition(condBuilder);
if (condition == null) {
// If the condition is empty then the body is entered unconditionally.
@@ -956,7 +928,14 @@
state.breakCollectors.add(breakCollector);
state.continueCollectors.add(continueCollector);
- IrBuilder bodyBuilder = new IrBuilder.delimited(condBuilder);
+ IrBuilder bodyBuilder = condBuilder.makeDelimitedBuilder();
+
+ // If we did not yet create a box for the boxed variables, we must create it
+ // here. This saves us from
+ if (!hasBoxedLoopVariables) {
+ bodyBuilder._buildClosureScopeSetup(closureScope);
+ }
+
buildBody(bodyBuilder);
assert(state.breakCollectors.last == breakCollector);
assert(state.continueCollectors.last == continueCollector);
@@ -969,8 +948,11 @@
// is instead placed just outside the body of the body continuation.
bool hasContinues = !continueCollector.isEmpty;
IrBuilder updateBuilder = hasContinues
- ? new IrBuilder.recursive(condBuilder)
+ ? condBuilder.makeRecursiveBuilder()
: bodyBuilder;
+ if (hasBoxedLoopVariables) {
+ updateBuilder._migrateLoopVariables(closureScope);
+ }
buildUpdate(updateBuilder);
// Create body entry and loop exit continuations and a branch to them.
@@ -1056,21 +1038,22 @@
Element variableElement,
Selector variableSelector,
SubbuildFunction buildBody,
- JumpTarget target}) {
+ JumpTarget target,
+ ClosureScope closureScope}) {
// The for-in loop
//
// for (a in e) s;
//
// Is compiled analogously to:
//
- // a = e.iterator;
- // while (a.moveNext()) {
- // var n0 = a.current;
+ // it = e.iterator;
+ // while (it.moveNext()) {
+ // var a = it.current;
// s;
// }
// The condition and body are delimited.
- IrBuilder condBuilder = new IrBuilder.recursive(this);
+ IrBuilder condBuilder = makeRecursiveBuilder();
ir.Primitive expressionReceiver = buildExpression(this);
List<ir.Primitive> emptyArguments = new List<ir.Primitive>();
@@ -1094,7 +1077,8 @@
state.breakCollectors.add(breakCollector);
state.continueCollectors.add(continueCollector);
- IrBuilder bodyBuilder = new IrBuilder.delimited(condBuilder);
+ IrBuilder bodyBuilder = condBuilder.makeDelimitedBuilder();
+ bodyBuilder._buildClosureScopeSetup(closureScope);
if (buildVariableDeclaration != null) {
buildVariableDeclaration(bodyBuilder);
}
@@ -1170,7 +1154,8 @@
/// statements that have this `while` statement as their target.
void buildWhile({SubbuildFunction buildCondition,
SubbuildFunction buildBody,
- JumpTarget target}) {
+ JumpTarget target,
+ ClosureScope closureScope}) {
assert(isOpen);
// While loops use four named continuations: the entry to the body, the
// loop exit, the loop back edge (continue), and the loop exit (break).
@@ -1189,7 +1174,7 @@
// statement occurs in the exit continuation).
// The condition and body are delimited.
- IrBuilder condBuilder = new IrBuilder.recursive(this);
+ IrBuilder condBuilder = makeRecursiveBuilder();
ir.Primitive condition = buildCondition(condBuilder);
JumpCollector breakCollector = new JumpCollector(target);
@@ -1197,7 +1182,8 @@
state.breakCollectors.add(breakCollector);
state.continueCollectors.add(continueCollector);
- IrBuilder bodyBuilder = new IrBuilder.delimited(condBuilder);
+ IrBuilder bodyBuilder = condBuilder.makeDelimitedBuilder();
+ bodyBuilder._buildClosureScopeSetup(closureScope);
buildBody(bodyBuilder);
assert(state.breakCollectors.last == breakCollector);
assert(state.continueCollectors.last == continueCollector);
@@ -1375,18 +1361,18 @@
// The translation must convert both e0 and e1 to booleans and handle
// local variable assignments in e1.
- IrBuilder rightBuilder = new IrBuilder.delimited(this);
+ IrBuilder rightBuilder = makeDelimitedBuilder();
ir.Primitive rightValue = buildRightValue(rightBuilder);
// A dummy empty target for the branch on the left subexpression branch.
// This enables using the same infrastructure for join-point continuations
// as in visitIf and visitConditional. It will hold a definition of the
// appropriate constant and an invocation of the join-point continuation.
- IrBuilder emptyBuilder = new IrBuilder.delimited(this);
+ IrBuilder emptyBuilder = makeDelimitedBuilder();
// Dummy empty targets for right true and right false. They hold
// definitions of the appropriate constant and an invocation of the
// join-point continuation.
- IrBuilder rightTrueBuilder = new IrBuilder.delimited(rightBuilder);
- IrBuilder rightFalseBuilder = new IrBuilder.delimited(rightBuilder);
+ IrBuilder rightTrueBuilder = rightBuilder.makeDelimitedBuilder();
+ IrBuilder rightFalseBuilder = rightBuilder.makeDelimitedBuilder();
// If we don't evaluate the right subexpression, the value of the whole
// expression is this constant.
@@ -1448,12 +1434,15 @@
return joinContinuation.parameters.last;
}
- /// Creates an access to `this`.
+ /// Creates an access to the receiver from the current (or enclosing) method.
+ ///
+ /// If inside a closure class, [buildThis] will redirect access through
+ /// closure fields in order to access the receiver from the enclosing method.
ir.Primitive buildThis() {
- assert(isOpen);
- ir.Primitive result = new ir.This();
- add(new ir.LetPrim(result));
- return result;
+ if (state.receiver != null) return state.receiver;
+ ir.Primitive thisPrim = new ir.This();
+ add(new ir.LetPrim(thisPrim));
+ return thisPrim;
}
/// Create a non-recursive join-point continuation.
@@ -1561,3 +1550,336 @@
return join;
}
}
+
+/// Dart-specific subclass of [IrBuilder].
+///
+/// Inner functions are represented by a [FunctionDefinition] with the
+/// IR for the inner function nested inside.
+///
+/// Captured variables are translated to ref cells (see [ClosureVariable])
+/// using [GetClosureVariable] and [SetClosureVariable].
+class DartIrBuilder extends IrBuilder {
+ ClosureVariableInfo closureVariables;
+
+ IrBuilder _makeInstance() => new DartIrBuilder._blank(closureVariables);
+ DartIrBuilder._blank(this.closureVariables);
+
+ DartIrBuilder(ConstantSystem constantSystem,
+ ExecutableElement currentElement,
+ this.closureVariables) {
+ _init(constantSystem, currentElement);
+ closureVariables.capturedVariables.forEach(closure.makeClosureVariable);
+ }
+
+ /// True if [local] is stored in a [ClosureVariable].
+ bool isInClosureVariable(Local local) {
+ return closure.local2closure.containsKey(local);
+ }
+
+ /// Gets the [ClosureVariable] containing the value of [local].
+ ir.ClosureVariable getClosureVariable(Local local) {
+ return closure.local2closure[local];
+ }
+
+ void _buildClosureScopeSetup(ClosureScope scope) {
+ assert(scope == null);
+ }
+
+ void _buildClosureEnvironmentSetup(ClosureEnvironment env) {
+ assert(env == null);
+ }
+
+ void _migrateLoopVariables(ClosureScope scope) {
+ assert(scope == null);
+ }
+
+ void _createFunctionParameter(ParameterElement parameterElement) {
+ ir.Parameter parameter = new ir.Parameter(parameterElement);
+ _parameters.add(parameter);
+ if (isInClosureVariable(parameterElement)) {
+ state.functionParameters.add(getClosureVariable(parameterElement));
+ } else {
+ state.functionParameters.add(parameter);
+ environment.extend(parameterElement, parameter);
+ }
+ }
+
+ void declareLocalVariable(LocalVariableElement variableElement,
+ {ir.Primitive initialValue}) {
+ assert(isOpen);
+ if (initialValue == null) {
+ initialValue = buildNullLiteral();
+ }
+ if (isInClosureVariable(variableElement)) {
+ add(new ir.SetClosureVariable(getClosureVariable(variableElement),
+ initialValue,
+ isDeclaration: true));
+ } else {
+ initialValue.useElementAsHint(variableElement);
+ environment.extend(variableElement, initialValue);
+ }
+ }
+
+ /// Add [functionElement] to the environment with provided [definition].
+ void declareLocalFunction(LocalFunctionElement functionElement,
+ ir.FunctionDefinition definition) {
+ assert(isOpen);
+ if (isInClosureVariable(functionElement)) {
+ ir.ClosureVariable variable = getClosureVariable(functionElement);
+ add(new ir.DeclareFunction(variable, definition));
+ } else {
+ ir.CreateFunction prim = new ir.CreateFunction(definition);
+ add(new ir.LetPrim(prim));
+ environment.extend(functionElement, prim);
+ prim.useElementAsHint(functionElement);
+ }
+ }
+
+ /// Create a function expression from [definition].
+ ir.Primitive buildFunctionExpression(ir.FunctionDefinition definition) {
+ ir.CreateFunction prim = new ir.CreateFunction(definition);
+ add(new ir.LetPrim(prim));
+ return prim;
+ }
+
+ /// Create a read access of [local].
+ ir.Primitive buildLocalGet(LocalElement local) {
+ assert(isOpen);
+ if (isInClosureVariable(local)) {
+ ir.Primitive result = new ir.GetClosureVariable(getClosureVariable(local));
+ result.useElementAsHint(local);
+ add(new ir.LetPrim(result));
+ return result;
+ } else {
+ return environment.lookup(local);
+ }
+ }
+
+ /// Create a write access to [local] with the provided [value].
+ ir.Primitive buildLocalSet(LocalElement local, ir.Primitive value) {
+ assert(isOpen);
+ if (isInClosureVariable(local)) {
+ add(new ir.SetClosureVariable(getClosureVariable(local), value));
+ } else {
+ value.useElementAsHint(local);
+ environment.update(local, value);
+ }
+ return value;
+ }
+
+
+}
+
+/// JS-specific subclass of [IrBuilder].
+///
+/// Inner functions are represented by a [ClosureClassElement], and captured
+/// variables are boxed as necessary using [CreateBox], [GetField], [SetField].
+class JsIrBuilder extends IrBuilder {
+ IrBuilder _makeInstance() => new JsIrBuilder._blank();
+ JsIrBuilder._blank();
+
+ JsIrBuilder(ConstantSystem constantSystem, ExecutableElement currentElement) {
+ _init(constantSystem, currentElement);
+ }
+
+ void _buildClosureEnvironmentSetup(ClosureEnvironment env) {
+ if (env == null) return;
+
+ // Obtain a reference to the function object (this).
+ ir.Primitive thisPrim = new ir.This();
+ add(new ir.LetPrim(thisPrim));
+
+ // Obtain access to the free variables.
+ env.freeVariables.forEach((Local local, ClosureLocation location) {
+ if (location.isBox) {
+ // Boxed variables are loaded from their box on-demand.
+ state.boxedVariables[local] = location;
+ } else {
+ // Unboxed variables are loaded from the function object immediately.
+ // This includes BoxLocals which are themselves unboxed variables.
+ ir.Primitive load = new ir.GetField(thisPrim, location.field);
+ add(new ir.LetPrim(load));
+ environment.extend(local, load);
+ }
+ });
+
+ // If the function captures a reference to the receiver from the
+ // enclosing method, remember which primitive refers to the receiver object.
+ if (env.thisLocal != null && env.freeVariables.containsKey(env.thisLocal)) {
+ state.receiver = environment.lookup(env.thisLocal);
+ }
+
+ // If the function has a self-reference, use the value of `this`.
+ if (env.selfReference != null) {
+ environment.extend(env.selfReference, thisPrim);
+ }
+ }
+
+ void _buildClosureScopeSetup(ClosureScope scope) {
+ if (scope == null) return;
+ ir.CreateBox boxPrim = new ir.CreateBox();
+ add(new ir.LetPrim(boxPrim));
+ environment.extend(scope.box, boxPrim);
+ boxPrim.useElementAsHint(scope.box);
+ scope.capturedVariables.forEach((Local local, ClosureLocation location) {
+ assert(!state.boxedVariables.containsKey(local));
+ if (location.isBox) {
+ state.boxedVariables[local] = location;
+ }
+ });
+ }
+
+ void _createFunctionParameter(ParameterElement parameterElement) {
+ ir.Parameter parameter = new ir.Parameter(parameterElement);
+ _parameters.add(parameter);
+ state.functionParameters.add(parameter);
+ ClosureLocation location = state.boxedVariables[parameterElement];
+ if (location != null) {
+ add(new ir.SetField(environment.lookup(location.box),
+ location.field,
+ parameter));
+ } else {
+ environment.extend(parameterElement, parameter);
+ }
+ }
+
+ void declareLocalVariable(LocalElement variableElement,
+ {ir.Primitive initialValue}) {
+ assert(isOpen);
+ if (initialValue == null) {
+ initialValue = buildNullLiteral();
+ }
+ ClosureLocation location = state.boxedVariables[variableElement];
+ if (location != null) {
+ add(new ir.SetField(environment.lookup(location.box),
+ location.field,
+ initialValue));
+ } else {
+ initialValue.useElementAsHint(variableElement);
+ environment.extend(variableElement, initialValue);
+ }
+ }
+
+ /// Add [functionElement] to the environment with provided [definition].
+ void declareLocalFunction(LocalFunctionElement functionElement,
+ ClosureClassElement classElement) {
+ ir.Primitive closure = buildFunctionExpression(classElement);
+ declareLocalVariable(functionElement, initialValue: closure);
+ }
+
+ ir.Primitive buildFunctionExpression(ClosureClassElement classElement) {
+ List<ir.Primitive> arguments = <ir.Primitive>[];
+ for (ClosureFieldElement field in classElement.closureFields) {
+ arguments.add(environment.lookup(field.local));
+ }
+ ir.Primitive closure = new ir.CreateClosureClass(classElement, arguments);
+ add(new ir.LetPrim(closure));
+ return closure;
+ }
+
+ /// Create a read access of [local].
+ ir.Primitive buildLocalGet(LocalElement local) {
+ assert(isOpen);
+ ClosureLocation location = state.boxedVariables[local];
+ if (location != null) {
+ ir.Primitive result = new ir.GetField(environment.lookup(location.box),
+ location.field);
+ result.useElementAsHint(local);
+ add(new ir.LetPrim(result));
+ return result;
+ } else {
+ return environment.lookup(local);
+ }
+ }
+
+ /// Create a write access to [local] with the provided [value].
+ ir.Primitive buildLocalSet(LocalElement local, ir.Primitive value) {
+ assert(isOpen);
+ ClosureLocation location = state.boxedVariables[local];
+ if (location != null) {
+ add(new ir.SetField(environment.lookup(location.box),
+ location.field,
+ value));
+ } else {
+ value.useElementAsHint(local);
+ environment.update(local, value);
+ }
+ return value;
+ }
+
+ void _migrateLoopVariables(ClosureScope scope) {
+ if (scope == null) return;
+ ir.Primitive box = environment.lookup(scope.box);
+ ir.Primitive newBox = new ir.CreateBox();
+ newBox.useElementAsHint(scope.box);
+ add(new ir.LetPrim(newBox));
+ for (VariableElement loopVar in scope.boxedLoopVariables) {
+ ClosureLocation location = scope.capturedVariables[loopVar];
+ ir.Primitive get = new ir.GetField(box, location.field);
+ add(new ir.LetPrim(get));
+ add(new ir.SetField(newBox, location.field, get));
+ }
+ environment.update(scope.box, newBox);
+ }
+
+}
+
+
+/// Location of a variable relative to a given closure.
+class ClosureLocation {
+ /// If not `null`, this location is [box].[field].
+ /// The location of [box] can be obtained separately from an
+ /// enclosing [ClosureEnvironment] or [ClosureScope].
+ /// If `null`, then the location is [field] on the enclosing function object.
+ final BoxLocal box;
+
+ /// The field in which the variable is stored.
+ final Entity field;
+
+ bool get isBox => box != null;
+
+ ClosureLocation(this.box, this.field);
+}
+
+/// Introduces a new box and binds local variables to this box.
+///
+/// A [ClosureScope] may exist for each function and for each loop.
+/// Generally, one may pass `null` to the [IrBuilder] instead of a
+/// [ClosureScope] when a given scope has no boxed variables.
+class ClosureScope {
+ /// This box is now in scope and [capturedVariables] may use it.
+ final BoxLocal box;
+
+ /// Maps [LocalElement]s to their location.
+ final Map<Local, ClosureLocation> capturedVariables;
+
+ /// If this is the scope of a for-loop, [boxedLoopVariables] is the list
+ /// of boxed variables that are declared in the initializer.
+ final List<VariableElement> boxedLoopVariables;
+
+ ClosureScope(this.box, this.capturedVariables, this.boxedLoopVariables);
+}
+
+/// Environment passed when building a nested function, describing how
+/// to access variables from the enclosing scope.
+class ClosureEnvironment {
+ /// References to this local should be treated as recursive self-reference.
+ /// (This is *not* in [freeVariables]).
+ final LocalFunctionElement selfReference;
+
+ /// If non-null, [thisLocal] has an entry in [freeVariables] describing where
+ /// to find the captured value of `this`.
+ final ThisLocal thisLocal;
+
+ /// Maps [LocalElement]s, [BoxLocal]s and [ThisLocal] to their location.
+ final Map<Local, ClosureLocation> freeVariables;
+
+ ClosureEnvironment(this.selfReference, this.thisLocal, this.freeVariables);
+}
+
+/// Information about which variables are captured in a closure.
+/// This is used by the [DartIrBuilder] instead of [ClosureScope] and
+/// [ClosureEnvironment].
+abstract class ClosureVariableInfo {
+ Iterable<Local> get capturedVariables;
+}
diff --git a/pkg/compiler/lib/src/cps_ir/cps_ir_builder_visitor.dart b/pkg/compiler/lib/src/cps_ir/cps_ir_builder_visitor.dart
index 8d47781..25a9ff9 100644
--- a/pkg/compiler/lib/src/cps_ir/cps_ir_builder_visitor.dart
+++ b/pkg/compiler/lib/src/cps_ir/cps_ir_builder_visitor.dart
@@ -108,6 +108,7 @@
with IrBuilderMixin<ast.Node> {
final Compiler compiler;
final SourceFile sourceFile;
+ ClosureClassMap closureMap;
// In SSA terms, join-point continuation parameters are the phis and the
// continuation invocation arguments are the corresponding phi inputs. To
@@ -131,6 +132,10 @@
IrBuilderVisitor(TreeElements elements, this.compiler, this.sourceFile)
: super(elements);
+ /// True if using the JavaScript backend; we use this to determine how
+ /// closures should be translated.
+ bool get isJavaScriptBackend => compiler.backend is JavaScriptBackend;
+
/**
* Builds the [ir.ExecutableDefinition] for an executable element. In case the
* function uses features that cannot be expressed in the IR, this element
@@ -148,8 +153,74 @@
});
}
+ Map mapValues(Map map, dynamic fn(dynamic)) {
+ Map result = {};
+ map.forEach((key,value) {
+ result[key] = fn(value);
+ });
+ return result;
+ }
+
+ // Converts closure.dart's CapturedVariable into a ClosureLocation.
+ // There is a 1:1 corresponce between these; we do this because the IR builder
+ // should not depend on synthetic elements.
+ ClosureLocation getLocation(CapturedVariable v) {
+ if (v is BoxFieldElement) {
+ return new ClosureLocation(v.box, v);
+ } else {
+ ClosureFieldElement field = v;
+ return new ClosureLocation(null, field);
+ }
+ }
+
+ /// If the current function is a nested function with free variables (or a
+ /// captured reference to `this`), this returns a [ClosureEnvironment]
+ /// indicating how to access these.
+ ClosureEnvironment getClosureEnvironment() {
+ if (closureMap == null) return null; // dart2dart does not use closureMap.
+ if (closureMap.closureElement == null) return null;
+ return new ClosureEnvironment(
+ closureMap.closureElement,
+ closureMap.thisLocal,
+ mapValues(closureMap.freeVariableMap, getLocation));
+ }
+
+ /// If [node] has declarations for variables that should be boxed, this
+ /// returns a [ClosureScope] naming a box to create, and enumerating the
+ /// variables that should be stored in the box.
+ ///
+ /// Also see [ClosureScope].
+ ClosureScope getClosureScope(ast.Node node) {
+ if (closureMap == null) return null; // dart2dart does not use closureMap.
+ closurelib.ClosureScope scope = closureMap.capturingScopes[node];
+ if (scope == null) return null;
+ // We translate a ClosureScope from closure.dart into IR builder's variant
+ // because the IR builder should not depend on the synthetic elements
+ // created in closure.dart.
+ return new ClosureScope(scope.boxElement,
+ mapValues(scope.capturedVariables, getLocation),
+ scope.boxedLoopVariables);
+ }
+
+ IrBuilder makeIRBuilder(ast.Node node, ExecutableElement element) {
+ if (isJavaScriptBackend) {
+ closureMap = compiler.closureToClassMapper.computeClosureToClassMapping(
+ element,
+ node,
+ elements);
+ return new JsIrBuilder(compiler.backend.constantSystem, element);
+ } else {
+ DetectClosureVariables closures = new DetectClosureVariables(elements);
+ if (!element.isSynthesized) {
+ closures.visit(node);
+ }
+ return new DartIrBuilder(compiler.backend.constantSystem,
+ element,
+ closures);
+ }
+ }
+
/// Returns a [ir.FieldDefinition] describing the initializer of [element].
- /// Returns `null` if [element] has no initializer.
ir.FieldDefinition buildField(FieldElement element) {
assert(invariant(element, element.isImplementation));
ast.VariableDefinitions definitions = element.node;
@@ -160,14 +231,12 @@
}
assert(fieldDefinition != null);
assert(elements[fieldDefinition] != null);
- DetectClosureVariables closureLocals =
- new DetectClosureVariables(elements);
- closureLocals.visit(fieldDefinition);
- IrBuilder builder = new IrBuilder(compiler.backend.constantSystem,
- element,
- closureLocals.usedFromClosure);
+ IrBuilder builder = makeIRBuilder(fieldDefinition, element);
+
return withBuilder(builder, () {
+ builder.buildFieldInitializerHeader(
+ closureScope: getClosureScope(fieldDefinition));
ir.Primitive initializer;
if (fieldDefinition is ast.SendSet) {
ast.SendSet sendSet = fieldDefinition;
@@ -180,9 +249,12 @@
ir.FunctionDefinition _makeFunctionBody(FunctionElement element,
ast.FunctionExpression node) {
FunctionSignature signature = element.functionSignature;
- signature.orderedForEachParameter((ParameterElement parameterElement) {
- irBuilder.createFunctionParameter(parameterElement);
- });
+ List<ParameterElement> parameters = [];
+ signature.orderedForEachParameter(parameters.add);
+
+ irBuilder.buildFunctionHeader(parameters,
+ closureScope: getClosureScope(node),
+ closureEnvironment: getClosureEnvironment());
List<ConstantExpression> defaults = new List<ConstantExpression>();
signature.orderedOptionalParameters.forEach((ParameterElement element) {
@@ -212,7 +284,7 @@
void tryAddInitializingFormal(ParameterElement parameterElement) {
if (parameterElement.isInitializingFormal) {
InitializingFormalElement initializingFormal = parameterElement;
- withBuilder(new IrBuilder.delimited(irBuilder), () {
+ withBuilder(irBuilder.makeDelimitedBuilder(), () {
ir.Primitive value = irBuilder.buildLocalGet(parameterElement);
result.add(irBuilder.makeFieldInitializer(
initializingFormal.fieldElement,
@@ -230,7 +302,7 @@
if (initializer is ast.SendSet) {
// Field initializer.
FieldElement field = elements[initializer];
- withBuilder(new IrBuilder.delimited(irBuilder), () {
+ withBuilder(irBuilder.makeDelimitedBuilder(), () {
ir.Primitive value = visit(initializer.arguments.head);
ir.RunnableBody body = irBuilder.makeRunnableBody(value);
result.add(irBuilder.makeFieldInitializer(field, body));
@@ -244,7 +316,7 @@
Selector selector = elements.getSelector(initializer);
List<ir.RunnableBody> arguments =
initializer.arguments.mapToList((ast.Node argument) {
- return withBuilder(new IrBuilder.delimited(irBuilder), () {
+ return withBuilder(irBuilder.makeDelimitedBuilder(), () {
ir.Primitive value = visit(argument);
return irBuilder.makeRunnableBody(value);
});
@@ -288,12 +360,6 @@
if (!element.isSynthesized) {
assert(node != null);
assert(elements[node] != null);
-
- // TODO(karlklose): this information should be provided by resolution.
- DetectClosureVariables closureLocals =
- new DetectClosureVariables(elements);
- closureLocals.visit(node);
- usedFromClosure = closureLocals.usedFromClosure;
} else {
SynthesizedConstructorElementX constructor = element;
if (!constructor.isDefaultConstructor) {
@@ -303,9 +369,7 @@
usedFromClosure = <Entity>[];
}
- IrBuilder builder = new IrBuilder(compiler.backend.constantSystem,
- element,
- usedFromClosure);
+ IrBuilder builder = makeIRBuilder(node, element);
return withBuilder(builder, () => _makeFunctionBody(element, node));
}
@@ -346,12 +410,13 @@
}
visitFor(ast.For node) {
- // TODO(kmillikin,sigurdm): Handle closure variables declared in a for-loop.
- if (node.initializer is ast.VariableDefinitions) {
+ // TODO(asgerf): Handle closure variables declared in a for-loop.
+ if (!isJavaScriptBackend && node.initializer is ast.VariableDefinitions) {
ast.VariableDefinitions definitions = node.initializer;
for (ast.Node definition in definitions.definitions.nodes) {
- Element element = elements[definition];
- if (irBuilder.isClosureVariable(element)) {
+ LocalElement element = elements[definition];
+ DartIrBuilder dartIrBuilder = irBuilder;
+ if (dartIrBuilder.isInClosureVariable(element)) {
return giveup(definition, 'Closure variable in for loop initializer');
}
}
@@ -363,6 +428,7 @@
buildCondition: subbuild(node.condition),
buildBody: subbuild(node.body),
buildUpdate: subbuildSequence(node.update),
+ closureScope: getClosureScope(node),
target: target);
}
@@ -379,7 +445,7 @@
JumpTarget target = elements.getTargetDefinition(body);
JumpCollector jumps = new JumpCollector(target);
irBuilder.state.breakCollectors.add(jumps);
- IrBuilder innerBuilder = new IrBuilder.delimited(irBuilder);
+ IrBuilder innerBuilder = irBuilder.makeDelimitedBuilder();
withBuilder(innerBuilder, () {
visit(body);
});
@@ -420,7 +486,8 @@
irBuilder.buildWhile(
buildCondition: subbuild(node.condition),
buildBody: subbuild(node.body),
- target: elements.getTargetDefinition(node));
+ target: elements.getTargetDefinition(node),
+ closureScope: getClosureScope(node));
}
visitForIn(ast.ForIn node) {
@@ -439,7 +506,8 @@
variableElement: variableElement,
variableSelector: selector,
buildBody: subbuild(node.body),
- target: elements.getTargetDefinition(node));
+ target: elements.getTargetDefinition(node),
+ closureScope: getClosureScope(node));
}
ir.Primitive visitVariableDefinitions(ast.VariableDefinitions node) {
@@ -950,13 +1018,21 @@
return irBuilder.buildConstantLiteral(constant);
}
- ir.FunctionDefinition makeSubFunction(ast.FunctionExpression node) {
- FunctionElement element = elements[node];
- assert(invariant(element, element.isImplementation));
+ /// Returns the backend-specific representation of an inner function.
+ Object makeSubFunction(ast.FunctionExpression node) {
+ if (isJavaScriptBackend) {
+ ClosureClassMap innerMap =
+ compiler.closureToClassMapper.getMappingForNestedFunction(node);
+ ClosureClassElement closureClass = innerMap.closureClassElement;
+ return closureClass;
+ } else {
+ FunctionElement element = elements[node];
+ assert(invariant(element, element.isImplementation));
- IrBuilder builder = new IrBuilder.innerFunction(irBuilder, element);
+ IrBuilder builder = irBuilder.makeInnerFunctionBuilder(element);
- return withBuilder(builder, () => _makeFunctionBody(element, node));
+ return withBuilder(builder, () => _makeFunctionBody(element, node));
+ }
}
ir.Primitive visitFunctionExpression(ast.FunctionExpression node) {
@@ -965,7 +1041,7 @@
visitFunctionDeclaration(ast.FunctionDeclaration node) {
LocalFunctionElement element = elements[node.function];
- ir.FunctionDefinition inner = makeSubFunction(node.function);
+ Object inner = makeSubFunction(node.function);
irBuilder.declareLocalFunction(element, inner);
}
@@ -994,19 +1070,17 @@
/// Classifies local variables and local functions as 'closure variables'.
/// A closure variable is one that is accessed from an inner function nested
/// one or more levels inside the one that declares it.
-class DetectClosureVariables extends ast.Visitor {
+class DetectClosureVariables extends ast.Visitor
+ implements ClosureVariableInfo {
final TreeElements elements;
DetectClosureVariables(this.elements);
FunctionElement currentFunction;
bool insideInitializer = false;
- Set<Local> usedFromClosure = new Set<Local>();
- Set<FunctionElement> recursiveFunctions = new Set<FunctionElement>();
-
- bool isClosureVariable(Entity entity) => usedFromClosure.contains(entity);
+ Set<Local> capturedVariables = new Set<Local>();
void markAsClosureVariable(Local local) {
- usedFromClosure.add(local);
+ capturedVariables.add(local);
}
visit(ast.Node node) => node.accept(this);
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 07bc61a..430eb6d 100644
--- a/pkg/compiler/lib/src/cps_ir/cps_ir_nodes.dart
+++ b/pkg/compiler/lib/src/cps_ir/cps_ir_nodes.dart
@@ -13,6 +13,7 @@
import '../universe/universe.dart' show Selector, SelectorKind;
import '../dart_types.dart' show DartType, GenericType;
import '../cps_ir/optimizers.dart';
+import '../closure.dart' show ClosureClassElement;
abstract class Node {
/// A pointer to the parent node. Is null until set by optimization passes.
@@ -59,7 +60,7 @@
abstract class Primitive extends Definition<Primitive> {
/// The [VariableElement] or [ParameterElement] from which the primitive
/// binding originated.
- Element hint;
+ Entity hint;
/// Register in which the variable binding this primitive can be allocated.
/// Separate register spaces are used for primitives with different [element].
@@ -69,7 +70,7 @@
/// Use the given element as a hint for naming this primitive.
///
/// Has no effect if this primitive already has a non-null [element].
- void useElementAsHint(Element hint) {
+ void useElementAsHint(Entity hint) {
if (this.hint == null) {
this.hint = hint;
}
@@ -460,6 +461,55 @@
/// to the Tree IR, which is implemented in JsTreeBuilder.
abstract class JsSpecificNode {}
+/// Directly assigns to a field on a given object.
+class SetField extends Expression implements InteriorNode, JsSpecificNode {
+ final Reference<Primitive> object;
+ Element field;
+ final Reference<Primitive> value;
+ Expression body;
+
+ SetField(Primitive object, this.field, Primitive value)
+ : this.object = new Reference<Primitive>(object),
+ this.value = new Reference<Primitive>(value);
+
+ Expression plug(Expression expr) {
+ assert(body == null);
+ return body = expr;
+ }
+
+ accept(Visitor visitor) => visitor.visitSetField(this);
+}
+
+/// Directly reads from a field on a given object.
+class GetField extends Primitive implements JsSpecificNode {
+ final Reference<Primitive> object;
+ Element field;
+
+ GetField(Primitive object, this.field)
+ : this.object = new Reference<Primitive>(object);
+
+ accept(Visitor visitor) => visitor.visitGetField(this);
+}
+
+/// Creates an object for holding boxed variables captured by a closure.
+class CreateBox extends Primitive implements JsSpecificNode {
+ accept(Visitor visitor) => visitor.visitCreateBox(this);
+}
+
+/// Instantiates a synthetic class created by closure conversion.
+class CreateClosureClass extends Primitive implements JsSpecificNode {
+ final ClosureClassElement classElement;
+
+ /// Values and boxes for locals captured by the closure.
+ /// The order corresponds to [ClosureClassElement.closureFields].
+ final List<Reference<Primitive>> arguments;
+
+ CreateClosureClass(this.classElement, List<Primitive> arguments)
+ : this.arguments = _referenceList(arguments);
+
+ accept(Visitor visitor) => visitor.visitCreateClosureClass(this);
+}
+
class Identical extends Primitive implements JsSpecificNode {
final Reference<Primitive> left;
final Reference<Primitive> right;
@@ -544,8 +594,8 @@
}
class Parameter extends Primitive {
- Parameter(Element element) {
- super.hint = element;
+ Parameter(Entity hint) {
+ super.hint = hint;
}
accept(Visitor visitor) => visitor.visitParameter(this);
@@ -757,6 +807,7 @@
T visitTypeOperator(TypeOperator node) => visitExpression(node);
T visitSetClosureVariable(SetClosureVariable node) => visitExpression(node);
T visitDeclareFunction(DeclareFunction node) => visitExpression(node);
+ T visitSetField(SetField node) => visitExpression(node);
// Definitions.
T visitLiteralList(LiteralList node) => visitPrimitive(node);
@@ -769,6 +820,9 @@
T visitParameter(Parameter node) => visitPrimitive(node);
T visitContinuation(Continuation node) => visitDefinition(node);
T visitClosureVariable(ClosureVariable node) => visitDefinition(node);
+ T visitGetField(GetField node) => visitDefinition(node);
+ T visitCreateBox(CreateBox node) => visitDefinition(node);
+ T visitCreateClosureClass(CreateClosureClass node) => visitDefinition(node);
// Conditions.
T visitIsTrue(IsTrue node) => visitCondition(node);
@@ -998,6 +1052,31 @@
processInterceptor(node);
processReference(node.input);
}
+
+ processCreateClosureClass(CreateClosureClass node) {}
+ visitCreateClosureClass(CreateClosureClass node) {
+ processCreateClosureClass(node);
+ node.arguments.forEach(processReference);
+ }
+
+ processSetField(SetField node) {}
+ visitSetField(SetField node) {
+ processSetField(node);
+ processReference(node.object);
+ processReference(node.value);
+ visit(node.body);
+ }
+
+ processGetField(GetField node) {}
+ visitGetField(GetField node) {
+ processGetField(node);
+ processReference(node.object);
+ }
+
+ processCreateBox(CreateBox node) {}
+ visitCreateBox(CreateBox node) {
+ processCreateBox(node);
+ }
}
/// Keeps track of currently unused register indices.
@@ -1027,15 +1106,14 @@
/// for removing all of the redundant variables.
class RegisterAllocator extends Visitor {
/// Separate register spaces for each source-level variable/parameter.
- /// Note that null is used as key for primitives without elements.
- final Map<Element, RegisterArray> elementRegisters =
- <Element, RegisterArray>{};
+ /// Note that null is used as key for primitives without hints.
+ final Map<Local, RegisterArray> elementRegisters = <Local, RegisterArray>{};
- RegisterArray getRegisterArray(Element element) {
- RegisterArray registers = elementRegisters[element];
+ RegisterArray getRegisterArray(Local local) {
+ RegisterArray registers = elementRegisters[local];
if (registers == null) {
registers = new RegisterArray();
- elementRegisters[element] = registers;
+ elementRegisters[local] = registers;
}
return registers;
}
@@ -1203,6 +1281,23 @@
// JavaScript specific nodes.
+ void visitSetField(SetField node) {
+ visit(node.body);
+ visitReference(node.value);
+ visitReference(node.object);
+ }
+
+ void visitGetField(GetField node) {
+ visitReference(node.object);
+ }
+
+ void visitCreateBox(CreateBox node) {
+ }
+
+ void visitCreateClosureClass(CreateClosureClass node) {
+ node.arguments.forEach(visitReference);
+ }
+
void visitIdentical(Identical node) {
visitReference(node.left);
visitReference(node.right);
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 1a162c8..8496f54 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
@@ -228,6 +228,30 @@
return '(IsTrue $value)';
}
+ String visitSetField(SetField node) {
+ String object = access(node.object);
+ String field = node.field.name;
+ String value = access(node.value);
+ String body = indentBlock(() => visit(node.body));
+ return '$indentation(SetField $object $field $value)\n$body';
+ }
+
+ String visitGetField(GetField node) {
+ String object = access(node.object);
+ String field = node.field.toString();
+ return '(GetField $object $field)';
+ }
+
+ String visitCreateBox(CreateBox node) {
+ return '(CreateBox)';
+ }
+
+ String visitCreateClosureClass(CreateClosureClass node) {
+ String className = node.classElement.name;
+ String arguments = node.arguments.map(access).join(' ');
+ return '(CreateClosureClass $className ($arguments))';
+ }
+
String visitIdentical(Identical node) {
String left = access(node.left);
String right = access(node.right);
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 c68ce94..c4d5f1f 100644
--- a/pkg/compiler/lib/src/cps_ir/cps_ir_tracer.dart
+++ b/pkg/compiler/lib/src/cps_ir/cps_ir_tracer.dart
@@ -251,6 +251,31 @@
return "IsTrue(${names.name(node.value.definition)})";
}
+ visitSetField(cps_ir.SetField node) {
+ String dummy = names.name(node);
+ String object = formatReference(node.object);
+ String field = node.field.name;
+ String value = formatReference(node.value);
+ printStmt(dummy, 'SetField $object.$field = $value');
+ visit(node.body);
+ }
+
+ visitGetField(cps_ir.GetField node) {
+ String object = formatReference(node.object);
+ String field = node.field.name;
+ return 'GetField($object.$field)';
+ }
+
+ visitCreateBox(cps_ir.CreateBox node) {
+ return 'CreateBox';
+ }
+
+ visitCreateClosureClass(cps_ir.CreateClosureClass node) {
+ String className = node.classElement.name;
+ String arguments = node.arguments.map(formatReference).join(', ');
+ return 'CreateClosureClass $className ($arguments)';
+ }
+
visitIdentical(cps_ir.Identical node) {
String left = formatReference(node.left);
String right = formatReference(node.right);
@@ -258,7 +283,7 @@
}
visitInterceptor(cps_ir.Interceptor node) {
- return "Interceptor(${node.input})";
+ return "Interceptor(${formatReference(node.input)})";
}
visitThis(cps_ir.This node) {
@@ -432,6 +457,10 @@
visit(exp.body);
}
+ visitSetField(cps_ir.SetField exp) {
+ visit(exp.body);
+ }
+
visitDeclareFunction(cps_ir.DeclareFunction exp) {
visit(exp.body);
}
diff --git a/pkg/compiler/lib/src/cps_ir/shrinking_reductions.dart b/pkg/compiler/lib/src/cps_ir/shrinking_reductions.dart
index 336c1c4..089921b 100644
--- a/pkg/compiler/lib/src/cps_ir/shrinking_reductions.dart
+++ b/pkg/compiler/lib/src/cps_ir/shrinking_reductions.dart
@@ -420,6 +420,23 @@
processInterceptor(Interceptor node) {
node.input.parent = node;
}
+
+ processSetField(SetField node) {
+ node.object.parent = node;
+ node.value.parent = node;
+ node.body.parent = node;
+ }
+
+ processGetField(GetField node) {
+ node.object.parent = node;
+ }
+
+ processCreateClosureClass(CreateClosureClass node) {
+ node.arguments.forEach((Reference ref) => ref.parent = node);
+ }
+
+ processCreateBox(CreateBox node) {
+ }
}
class _ReductionKind {
diff --git a/pkg/compiler/lib/src/cps_ir/type_propagation.dart b/pkg/compiler/lib/src/cps_ir/type_propagation.dart
index 9585ff9..c68a917 100644
--- a/pkg/compiler/lib/src/cps_ir/type_propagation.dart
+++ b/pkg/compiler/lib/src/cps_ir/type_propagation.dart
@@ -786,6 +786,22 @@
void visitInterceptor(Interceptor node) {
setReachable(node.input.definition);
}
+
+ void visitGetField(GetField node) {
+ setValue(node, nonConst());
+ }
+
+ void visitSetField(SetField node) {
+ setReachable(node.body);
+ }
+
+ void visitCreateBox(CreateBox node) {
+ setValue(node, nonConst());
+ }
+
+ void visitCreateClosureClass(CreateClosureClass node) {
+ setValue(node, nonConst());
+ }
}
/// Represents the abstract value of a primitive value at some point in the
diff --git a/pkg/compiler/lib/src/dart2js.dart b/pkg/compiler/lib/src/dart2js.dart
index aa564ed..80be4a7 100644
--- a/pkg/compiler/lib/src/dart2js.dart
+++ b/pkg/compiler/lib/src/dart2js.dart
@@ -12,7 +12,7 @@
stdin, stderr;
import '../compiler.dart' as api;
-import 'source_file.dart';
+import 'io/source_file.dart';
import 'source_file_provider.dart';
import 'filenames.dart';
import 'util/uri_extras.dart';
@@ -333,6 +333,7 @@
new OptionHandler('--categories=.*', setCategories),
new OptionHandler('--disable-type-inference', implyCompilation),
new OptionHandler('--terse', passThrough),
+ new OptionHandler('--deferred-map=.+', implyCompilation),
new OptionHandler('--dump-info', implyCompilation),
new OptionHandler('--disallow-unsafe-eval',
(_) => hasDisallowUnsafeEval = true),
@@ -599,6 +600,10 @@
unsupported category, for example, --categories=help. To enable
all categories, use --categories=all.
+ --deferred-map=<file>
+ Generates a json file with a mapping from each deferred import to a list of
+ the part.js files that will be loaded.
+
--dump-info
Generates an out.info.json file with information about the generated code.
You can inspect the generated file with the viewer at:
@@ -668,7 +673,11 @@
}
}
-const _EXIT_SIGNAL = const Object();
+class _ExitSignal {
+ const _ExitSignal();
+}
+
+const _EXIT_SIGNAL = const _ExitSignal();
void batchMain(List<String> batchArguments) {
int exitCode;
diff --git a/pkg/compiler/lib/src/dart2jslib.dart b/pkg/compiler/lib/src/dart2jslib.dart
index 7537fa8..fcfbf5e 100644
--- a/pkg/compiler/lib/src/dart2jslib.dart
+++ b/pkg/compiler/lib/src/dart2jslib.dart
@@ -47,7 +47,7 @@
import 'resolution/resolution.dart';
import 'scanner/scannerlib.dart';
import 'ssa/ssa.dart';
-import 'source_file.dart' show SourceFile;
+import 'io/source_file.dart' show SourceFile;
import 'tracer.dart' show Tracer;
import 'tree/tree.dart';
import 'types/types.dart' as ti;
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 3007f52..26a0fa5 100644
--- a/pkg/compiler/lib/src/dart_backend/backend_ast_emitter.dart
+++ b/pkg/compiler/lib/src/dart_backend/backend_ast_emitter.dart
@@ -894,6 +894,24 @@
return new SuperInitializer(node.target,
emitArguments(arguments, node.selector));
}
+
+ @override
+ visitGetField(tree.GetField node, arg) => errorUnsupportedNode(node);
+
+ @override
+ visitSetField(tree.SetField node, arg) => errorUnsupportedNode(node);
+
+ @override
+ visitCreateBox(tree.CreateBox node, arg) => errorUnsupportedNode(node);
+
+ @override
+ visitCreateClosureClass(tree.CreateClosureClass node, arg) {
+ return errorUnsupportedNode(node);
+ }
+
+ errorUnsupportedNode(tree.JsSpecificNode node) {
+ throw '$node not supported by dart backend';
+ }
}
class TypeGenerator {
diff --git a/pkg/compiler/lib/src/dart_backend/outputter.dart b/pkg/compiler/lib/src/dart_backend/outputter.dart
index d41d604..45da8e9 100644
--- a/pkg/compiler/lib/src/dart_backend/outputter.dart
+++ b/pkg/compiler/lib/src/dart_backend/outputter.dart
@@ -155,7 +155,7 @@
PlaceholderCollector collector = new PlaceholderCollector(
listener,
mirrorRenamer,
- libraryInfo.fixedMemberNames,
+ libraryInfo.fixedDynamicNames,
elementInfo.elementAsts,
mainFunction);
@@ -183,7 +183,9 @@
&& isSafeToRemoveTypeDeclarations(elementInfo.classMembers));
PlaceholderRenamer placeholderRenamer = new PlaceholderRenamer(
- libraryInfo.fixedMemberNames, libraryInfo.reexportingLibraries,
+ libraryInfo.fixedDynamicNames,
+ libraryInfo.fixedStaticNames,
+ libraryInfo.reexportingLibraries,
cutDeclarationTypes: shouldCutDeclarationTypes,
enableMinification: enableMinification);
@@ -215,18 +217,21 @@
}
class LibraryInfo {
- final Set<String> fixedMemberNames;
+ final Set<String> fixedStaticNames;
+ final Set<String> fixedDynamicNames;
final Map<Element, LibraryElement> reexportingLibraries;
final List<LibraryElement> userLibraries;
- LibraryInfo(this.fixedMemberNames,
+ LibraryInfo(this.fixedStaticNames,
+ this.fixedDynamicNames,
this.reexportingLibraries,
this.userLibraries);
static LibraryInfo processLibraries(
Iterable<LibraryElement> libraries,
Iterable<AstElement> resolvedElements) {
- Set<String> fixedMemberNames = new Set<String>();
+ Set<String> fixedStaticNames = new Set<String>();
+ Set<String> fixedDynamicNames = new Set<String>();
Map<Element, LibraryElement> reexportingLibraries =
<Element, LibraryElement>{};
List<LibraryElement> userLibraries = <LibraryElement>[];
@@ -246,13 +251,10 @@
assert(invariant(classElement, classElement.isResolved,
message: "Unresolved platform class."));
classElement.forEachLocalMember((member) {
- String name = member.name;
- // Skip operator names.
- if (!name.startsWith(r'operator$')) {
- // Fetch name of named constructors and factories if any,
- // otherwise store regular name.
- // TODO(antonm): better way to analyze the name.
- fixedMemberNames.add(name.split(r'$').last);
+ if (member.isInstanceMember) {
+ fixedDynamicNames.add(member.name);
+ } else {
+ fixedStaticNames.add(member.name);
}
});
}
@@ -260,7 +262,7 @@
// if one imports dart:core with a prefix, we cannot tell prefix.name
// from dynamic invocation (alas!). So we'd better err on preserving
// those names.
- fixedMemberNames.add(element.name);
+ fixedStaticNames.add(element.name);
});
for (Element export in library.exports) {
@@ -282,20 +284,16 @@
element.functionSignature.optionalParameters;
for (final optional in optionalParameters) {
if (!optional.isInitializingFormal) continue;
- fixedMemberNames.add(optional.name);
+ fixedDynamicNames.add(optional.name);
}
}
// The VM will automatically invoke the call method of objects
// that are invoked as functions. Make sure to not rename that.
- fixedMemberNames.add('call');
- // TODO(antonm): TypeError.srcType and TypeError.dstType are defined in
- // runtime/lib/error.dart. Overall, all DartVM specific libs should be
- // accounted for.
- fixedMemberNames.add('srcType');
- fixedMemberNames.add('dstType');
+ fixedDynamicNames.add('call');
return new LibraryInfo(
- fixedMemberNames, reexportingLibraries, userLibraries);
+ fixedStaticNames, fixedDynamicNames,
+ reexportingLibraries, userLibraries);
}
}
@@ -523,11 +521,18 @@
}
}
} else {
- for(LibraryElement library in placeholderRenamer.platformImports) {
- if (library.isPlatformLibrary && !library.isInternalLibrary) {
- mainUnparser.unparseImportTag(library.canonicalUri.toString());
+ placeholderRenamer.platformImports.forEach(
+ (LibraryElement library, String prefix) {
+ assert(library.isPlatformLibrary && !library.isInternalLibrary);
+ mainUnparser.unparseImportTag(library.canonicalUri.toString());
+ if (prefix != null) {
+ // Adding a prefixed import because (some) top-level access need
+ // it to avoid shadowing.
+ // TODO(johnniwinther): Avoid prefix-less import if not needed.
+ mainUnparser.unparseImportTag(library.canonicalUri.toString(),
+ prefix: prefix);
}
- }
+ });
}
for (int i = 0; i < elementInfo.topLevelElements.length; i++) {
diff --git a/pkg/compiler/lib/src/dart_backend/placeholder_collector.dart b/pkg/compiler/lib/src/dart_backend/placeholder_collector.dart
index c403119..60f3fe8 100644
--- a/pkg/compiler/lib/src/dart_backend/placeholder_collector.dart
+++ b/pkg/compiler/lib/src/dart_backend/placeholder_collector.dart
@@ -279,7 +279,7 @@
void tryMakeMemberPlaceholder(Identifier node) {
assert(node != null);
if (node is Operator) return;
- final identifier = node.source;
+ String identifier = node.source;
if (fixedMemberNames.contains(identifier)) return;
memberPlaceholders.putIfAbsent(
identifier, () => new Set<Identifier>()).add(node);
diff --git a/pkg/compiler/lib/src/dart_backend/renamer.dart b/pkg/compiler/lib/src/dart_backend/renamer.dart
index 79b8c58..21bef08 100644
--- a/pkg/compiler/lib/src/dart_backend/renamer.dart
+++ b/pkg/compiler/lib/src/dart_backend/renamer.dart
@@ -72,12 +72,14 @@
class PlaceholderRenamer {
/// After running [computeRenames] this will contain the computed renames.
final Map<Node, String> renames = new Map<Node, String>();
- /// After running [computeRenames] this will contain the used platform
- /// libraries.
- final Set<LibraryElement> platformImports = new Set<LibraryElement>();
+ /// After running [computeRenames] this will map the used platform
+ /// libraries to their respective prefixes.
+ final Map<LibraryElement, String> platformImports =
+ <LibraryElement, String>{};
final bool enableMinification;
- final Set<String> fixedMemberNames;
+ final Set<String> fixedDynamicNames;
+ final Set<String> fixedStaticNames;
final Map<Element, LibraryElement> reexportingLibraries;
final bool cutDeclarationTypes;
@@ -92,7 +94,8 @@
Generator _generator;
- PlaceholderRenamer(this.fixedMemberNames,
+ PlaceholderRenamer(this.fixedDynamicNames,
+ this.fixedStaticNames,
this.reexportingLibraries,
{this.enableMinification, this.cutDeclarationTypes});
@@ -102,7 +105,7 @@
}
}
- String _generateUniqueTopLevelName(originalName) {
+ String _generateUniqueTopLevelName(String originalName) {
String newName = _generator.generate(originalName, (name) {
return _forbiddenIdentifiers.contains(name) ||
_allNamedParameterIdentifiers.contains(name);
@@ -142,14 +145,23 @@
library = reexportingLibraries[entity];
}
if (library.isPlatformLibrary) {
- if (library.canonicalUri != Compiler.DART_CORE) {
- platformImports.add(library);
- }
+ // TODO(johnniwinther): Handle prefixes for dart:core.
+ if (library.canonicalUri == Compiler.DART_CORE) return entity.name;
if (library.isInternalLibrary) {
throw new SpannableAssertionFailure(entity,
"Internal library $library should never have been imported from "
"the code compiled by dart2dart.");
}
+
+ String prefix = platformImports.putIfAbsent(library, () => null);
+ if (entity.isTopLevel &&
+ fixedDynamicNames.contains(entity.name)) {
+ if (prefix == null) {
+ prefix = _generateUniqueTopLevelName('');
+ platformImports[library] = prefix;
+ }
+ return '$prefix.${entity.name}';
+ }
return entity.name;
}
}
@@ -261,7 +273,8 @@
_allNamedParameterIdentifiers.addAll(functionScope.parameterIdentifiers);
}
- _forbiddenIdentifiers = new Set<String>.from(fixedMemberNames);
+ _forbiddenIdentifiers = new Set<String>.from(fixedDynamicNames);
+ _forbiddenIdentifiers.addAll(fixedStaticNames);
_forbiddenIdentifiers.addAll(Keyword.keywords.keys);
_forbiddenIdentifiers.add('main');
diff --git a/pkg/compiler/lib/src/deferred_load.dart b/pkg/compiler/lib/src/deferred_load.dart
index f11b654..00eaf84c 100644
--- a/pkg/compiler/lib/src/deferred_load.dart
+++ b/pkg/compiler/lib/src/deferred_load.dart
@@ -40,6 +40,7 @@
import 'util/util.dart' show
Link, makeUnique;
+import 'util/uri_extras.dart' as uri_extras;
import 'util/setlet.dart' show
Setlet;
@@ -74,10 +75,15 @@
/// loaded.
final Setlet<Import> imports = new Setlet<Import>();
+ /// `true` if this output unit is for the main output file.
+ final bool isMainOutput;
+
/// A unique name representing this [OutputUnit].
/// Based on the set of [imports].
String name;
+ OutputUnit({this.isMainOutput: false});
+
String toString() => "OutputUnit($name)";
bool operator==(OutputUnit other) {
@@ -110,7 +116,7 @@
new LiteralDartString("main")), null, null, null);
/// The OutputUnit that will be loaded when the program starts.
- final OutputUnit mainOutputUnit = new OutputUnit();
+ final OutputUnit mainOutputUnit = new OutputUnit(isMainOutput: true);
/// A set containing (eventually) all output units that will result from the
/// program.
@@ -146,6 +152,10 @@
final Map<Import, LibraryElement> _allDeferredImports =
new Map<Import, LibraryElement>();
+ /// Because the token-stream is forgotten later in the program, we cache a
+ /// description of each deferred import.
+ final _deferredImportDescriptions = new Map<Import, ImportDescription>();
+
// For each deferred import we want to know exactly what elements have to
// be loaded.
Map<Import, Set<Element>> _importedDeferredBy = null;
@@ -617,7 +627,7 @@
});
}
- void ensureMetadataResolved(Compiler compiler) {
+ void beforeResolution(Compiler compiler) {
if (compiler.mainApp == null) return;
_allDeferredImports[_fakeMainImport] = compiler.mainApp;
var lastDeferred;
@@ -659,7 +669,7 @@
Element element =
metadata.constant.value.getType(compiler.coreTypes).element;
if (element == deferredLibraryClass) {
- compiler.reportFatalError(
+ compiler.reportError(
import, MessageKind.DEFERRED_OLD_SYNTAX);
}
}
@@ -671,13 +681,16 @@
// The last import we saw with the same prefix.
Import previousDeferredImport = prefixDeferredImport[prefix];
if (import.isDeferred) {
- _allDeferredImports[import] = library.getLibraryFromTag(import);
+ LibraryElement importedLibrary = library.getLibraryFromTag(import);
+ _allDeferredImports[import] = importedLibrary;
if (prefix == null) {
compiler.reportError(import,
MessageKind.DEFERRED_LIBRARY_WITHOUT_PREFIX);
} else {
prefixDeferredImport[prefix] = import;
+ _deferredImportDescriptions[import] =
+ new ImportDescription(import, library, compiler);
}
isProgramSplit = true;
lastDeferred = import;
@@ -764,4 +777,62 @@
}
return null;
}
+
+ /// Returns a json-style map for describing what files that are loaded by a
+ /// given deferred import.
+ /// The mapping is structured as:
+ /// library uri -> {"name": library name, "files": (prefix -> list of files)}
+ /// Where
+ ///
+ /// - <library uri> is the relative uri of the library making a deferred
+ /// import
+ /// - <library name> is the name of the libary, and "<unnamed>" if it is
+ /// unnamed.
+ /// - <prefix> is the `as` prefix used for a given deferred import.
+ /// - <list of files> is a list of the filenames the must be loaded when that
+ /// import is loaded.
+ Map<String, Map<String, dynamic>> computeDeferredMap() {
+ JavaScriptBackend backend = compiler.backend;
+ Map<String, Map<String, dynamic>> mapping =
+ new Map<String, Map<String, dynamic>>();
+ _deferredImportDescriptions.keys.forEach((ast.Import import) {
+ List<OutputUnit> outputUnits = hunksToLoad[importDeferName[import]];
+ ImportDescription description = _deferredImportDescriptions[import];
+ Map<String, dynamic> libraryMap =
+ mapping.putIfAbsent(description.importingUri,
+ () => <String, dynamic>{"name": description.importingLibraryName,
+ "imports": <String, List<String>>{}});
+
+ libraryMap["imports"][description.prefix] = outputUnits.map(
+ (OutputUnit outputUnit) {
+ return backend.deferredPartFileName(outputUnit.name);
+ }).toList();
+ });
+ return mapping;
+ }
+}
+
+class ImportDescription {
+ /// Relative uri to the importing library.
+ final String importingUri;
+ /// The prefix this import is imported as.
+ final String prefix;
+ final LibraryElement _importingLibrary;
+
+ ImportDescription(Import import,
+ LibraryElement importingLibrary,
+ Compiler compiler)
+ : importingUri = uri_extras.relativize(
+ compiler.mainApp.canonicalUri,
+ importingLibrary.canonicalUri, false),
+ prefix = import.prefix.source,
+ _importingLibrary = importingLibrary;
+
+ String get importingLibraryName {
+ String libraryName = _importingLibrary.getLibraryName();
+ return libraryName == ""
+ ? "<unnamed>"
+ : libraryName;
+ }
+
}
diff --git a/pkg/compiler/lib/src/diagnostic_listener.dart b/pkg/compiler/lib/src/diagnostic_listener.dart
index 40d77b1..d57b11d 100644
--- a/pkg/compiler/lib/src/diagnostic_listener.dart
+++ b/pkg/compiler/lib/src/diagnostic_listener.dart
@@ -12,10 +12,6 @@
SourceSpan spanFromSpannable(Spannable node);
- /// Reports an error and terminates computation immediately.
- void reportFatalError(Spannable node, MessageKind errorCode,
- [Map arguments = const {}]);
-
void reportError(Spannable node, MessageKind errorCode,
[Map arguments = const {}]);
diff --git a/pkg/compiler/lib/src/dump_info.dart b/pkg/compiler/lib/src/dump_info.dart
index b2442b9..c92ea25 100644
--- a/pkg/compiler/lib/src/dump_info.dart
+++ b/pkg/compiler/lib/src/dump_info.dart
@@ -639,6 +639,10 @@
'holding': holding,
'outputUnits': outputUnits,
'dump_version': 3,
+ 'deferredFiles': compiler.deferredLoadTask.computeDeferredMap(),
+ // This increases when new information is added to the map, but the viewer
+ // still is compatible.
+ 'dump_minor_version': '1'
};
Duration toJsonDuration = new DateTime.now().difference(startToJsonTime);
diff --git a/pkg/compiler/lib/src/elements/modelx.dart b/pkg/compiler/lib/src/elements/modelx.dart
index aaa56ab..903f205 100644
--- a/pkg/compiler/lib/src/elements/modelx.dart
+++ b/pkg/compiler/lib/src/elements/modelx.dart
@@ -12,21 +12,22 @@
import '../resolution/resolution.dart';
import '../resolution/class_members.dart' show ClassMemberMixin;
-import '../dart2jslib.dart' show invariant,
- InterfaceType,
- DartType,
- TypeVariableType,
- TypedefType,
- DualKind,
- MessageKind,
- DiagnosticListener,
- Script,
- FunctionType,
- Selector,
- Constant,
- Compiler,
- Backend,
- isPrivateName;
+import '../dart2jslib.dart' show
+ Backend,
+ Compiler,
+ Constant,
+ DartType,
+ DiagnosticListener,
+ DualKind,
+ FunctionType,
+ InterfaceType,
+ MessageKind,
+ Script,
+ Selector,
+ TypeVariableType,
+ TypedefType,
+ invariant,
+ isPrivateName;
import '../dart_types.dart';
@@ -327,6 +328,20 @@
accept(ElementVisitor visitor) => visitor.visitErroneousElement(this);
}
+/// A constructor that was synthesized to recover from a compile-time error.
+class ErroneousConstructorElementX extends ErroneousElementX {
+ // TODO(ahe): Instead of subclassing [ErroneousElementX], this class should
+ // be more like [ErroneousFieldElementX]. In particular, its kind should be
+ // [ElementKind.GENERATIVE_CONSTRUCTOR], and it shouldn't throw as much.
+
+ ErroneousConstructorElementX(
+ MessageKind messageKind,
+ Map messageArguments,
+ String name,
+ Element enclosing)
+ : super(messageKind, messageArguments, name, enclosing);
+}
+
/// A message attached to a [WarnOnUseElementX].
class WrappedMessage {
/// The message position. If [:null:] the position of the reference to the
@@ -384,7 +399,7 @@
accept(ElementVisitor visitor) => visitor.visitWarnOnUseElement(this);
}
-class AmbiguousElementX extends ElementX implements AmbiguousElement {
+abstract class AmbiguousElementX extends ElementX implements AmbiguousElement {
/**
* The message to report on resolving this element.
*/
@@ -423,6 +438,20 @@
return set;
}
+ accept(ElementVisitor visitor) => visitor.visitAmbiguousElement(this);
+
+ bool get isTopLevel => false;
+}
+
+/// Element synthesized to diagnose an ambiguous import.
+class AmbiguousImportX extends AmbiguousElementX {
+ AmbiguousImportX(
+ MessageKind messageKind,
+ Map messageArguments,
+ Element enclosingElement, Element existingElement, Element newElement)
+ : super(messageKind, messageArguments, enclosingElement, existingElement,
+ newElement);
+
void diagnose(Element context, DiagnosticListener listener) {
Setlet ambiguousElements = flatten();
MessageKind code = (ambiguousElements.length == 1)
@@ -440,10 +469,16 @@
});
}
}
+}
- accept(ElementVisitor visitor) => visitor.visitAmbiguousElement(this);
-
- bool get isTopLevel => false;
+/// Element synthesized to recover from a duplicated member of an element.
+class DuplicatedElementX extends AmbiguousElementX {
+ DuplicatedElementX(
+ MessageKind messageKind,
+ Map messageArguments,
+ Element enclosingElement, Element existingElement, Element newElement)
+ : super(messageKind, messageArguments, enclosingElement, existingElement,
+ newElement);
}
class ScopeX {
@@ -491,27 +526,32 @@
listener.reportError(accessor,
MessageKind.DUPLICATE_DEFINITION,
{'name': accessor.name});
- // TODO(johnniwinther): Make this an info instead of a fatal error.
- listener.reportFatalError(other,
- MessageKind.EXISTING_DEFINITION,
- {'name': accessor.name});
+ listener.reportInfo(
+ other, MessageKind.EXISTING_DEFINITION, {'name': accessor.name});
+
+ contents[accessor.name] = new DuplicatedElementX(
+ MessageKind.DUPLICATE_DEFINITION, {'name': accessor.name},
+ accessor.memberContext.enclosingElement, other, accessor);
}
if (existing != null) {
if (!identical(existing.kind, ElementKind.ABSTRACT_FIELD)) {
reportError(existing);
+ return;
} else {
AbstractFieldElementX field = existing;
accessor.abstractField = field;
if (accessor.isGetter) {
if (field.getter != null && field.getter != accessor) {
reportError(field.getter);
+ return;
}
field.getter = accessor;
} else {
assert(accessor.isSetter);
if (field.setter != null && field.setter != accessor) {
reportError(field.setter);
+ return;
}
field.setter = accessor;
}
@@ -699,7 +739,7 @@
import, MessageKind.HIDDEN_IMPORT, existing, element);
}
} else {
- Element ambiguousElement = new AmbiguousElementX(
+ Element ambiguousElement = new AmbiguousImportX(
MessageKind.DUPLICATE_IMPORT, {'name': name},
enclosingElement, existing, element);
importScope[name] = ambiguousElement;
@@ -1267,6 +1307,81 @@
}
}
+/// A field that was synthesized to recover from a compile-time error.
+class ErroneousFieldElementX extends ElementX implements FieldElementX {
+ final VariableList variables;
+
+ ErroneousFieldElementX(Identifier name, Element enclosingElement)
+ : variables = new VariableList(Modifiers.EMPTY)
+ ..definitions = new VariableDefinitions(
+ null, Modifiers.EMPTY, new NodeList.singleton(name))
+ ..type = const DynamicType(),
+ super(name.source, ElementKind.FIELD, enclosingElement);
+
+ VariableDefinitions get definitionsCache => variables.definitions;
+
+ set definitionsCache(VariableDefinitions _) {
+ throw new UnsupportedError("definitionsCache=");
+ }
+
+ bool get hasNode => true;
+
+ VariableDefinitions get node => definitionsCache;
+
+ bool get hasResolvedAst => false;
+
+ ResolvedAst get resolvedAst {
+ throw new UnsupportedError("resolvedAst");
+ }
+
+ DynamicType get type => const DynamicType();
+
+ Token get token => node.getBeginToken();
+
+ get initializerCache {
+ throw new UnsupportedError("initializerCache");
+ }
+
+ set initializerCache(_) {
+ throw new UnsupportedError("initializerCache=");
+ }
+
+ void createDefinitions(VariableDefinitions definitions) {
+ throw new UnsupportedError("createDefinitions");
+ }
+
+ get initializer => null;
+
+ bool get isErroneous => true;
+
+ get nestedClosures {
+ throw new UnsupportedError("nestedClosures");
+ }
+
+ set nestedClosures(_) {
+ throw new UnsupportedError("nestedClosures=");
+ }
+
+ // TODO(ahe): Should this throw or do nothing?
+ accept(ElementVisitor visitor) => visitor.visitFieldElement(this);
+
+ // TODO(ahe): Should return the context of the error site?
+ MemberElement get memberContext => this;
+
+ // TODO(ahe): Should return the definingElement of the error site?
+ AstElement get definingElement => this;
+
+ void reuseElement() {
+ throw new UnsupportedError("reuseElement");
+ }
+
+ FieldElementX copyWithEnclosing(Element enclosingElement) {
+ throw new UnsupportedError("copyWithEnclosing");
+ }
+
+ DartType computeType(Compiler compiler) => type;
+}
+
/// [Element] for a parameter-like element.
class FormalElementX extends ElementX
with AstElementMixin
@@ -1369,7 +1484,7 @@
/// `A(this.field)`.
class InitializingFormalElementX extends ParameterElementX
implements InitializingFormalElement {
- FieldElement fieldElement;
+ final FieldElement fieldElement;
InitializingFormalElementX(ConstructorElement constructorDeclaration,
VariableDefinitions variables,
@@ -1386,6 +1501,29 @@
bool get isLocal => false;
}
+class ErroneousInitializingFormalElementX extends ParameterElementX
+ implements InitializingFormalElementX {
+ final ErroneousFieldElementX fieldElement;
+
+ ErroneousInitializingFormalElementX(
+ Identifier identifier,
+ Element enclosingElement)
+ : this.fieldElement =
+ new ErroneousFieldElementX(identifier, enclosingElement),
+ super(
+ ElementKind.INITIALIZING_FORMAL,
+ enclosingElement, null, identifier, null);
+
+ VariableDefinitions get definitions => fieldElement.node;
+
+ MemberElement get memberContext => enclosingElement;
+
+ bool get isLocal => false;
+
+ bool get isErroneous => true;
+
+ DynamicType get type => const DynamicType();
+}
class AbstractFieldElementX extends ElementX implements AbstractFieldElement {
FunctionElementX getter;
diff --git a/pkg/compiler/lib/src/enqueue.dart b/pkg/compiler/lib/src/enqueue.dart
index c2638b4..9d04cd1 100644
--- a/pkg/compiler/lib/src/enqueue.dart
+++ b/pkg/compiler/lib/src/enqueue.dart
@@ -697,6 +697,7 @@
}
bool internalAddToWorkList(Element element) {
+ if (element.isErroneous) return false;
assert(invariant(element, element is AnalyzableElement,
message: 'Element $element is not analyzable.'));
if (hasBeenResolved(element)) return false;
diff --git a/pkg/compiler/lib/src/hash/sha1.dart b/pkg/compiler/lib/src/hash/sha1.dart
index 949621d..60716a4 100644
--- a/pkg/compiler/lib/src/hash/sha1.dart
+++ b/pkg/compiler/lib/src/hash/sha1.dart
@@ -11,33 +11,55 @@
import 'dart:math' show pow;
import 'dart:convert';
-/// Returns the base64-encoded SHA-1 hash of the utf-8 bytes of [input].
-String hashOfString(String input) {
- Hash hasher = new SHA1();
- hasher.add(const Utf8Encoder().convert(input));
- return _bytesToBase64(hasher.close());
-}
+import '../io/code_output.dart' show CodeOutputListener;
-/**
- * Converts a list of bytes into a Base 64 encoded string.
- *
- * The list can be any list of integers in the range 0..255,
- * for example a message digest.
- *
- * If [addLineSeparator] is true, the resulting string will be
- * broken into lines of 76 characters, separated by "\r\n".
- *
- * If [urlSafe] is true, the result is URL and filename safe.
- *
- * Based on [RFC 4648](http://tools.ietf.org/html/rfc4648)
- *
- */
-String _bytesToBase64(List<int> bytes,
- {bool urlSafe : false,
- bool addLineSeparator : false}) {
- return _CryptoUtils.bytesToBase64(bytes,
- urlSafe,
- addLineSeparator);
+class Hasher implements CodeOutputListener {
+ Hash _hasher = new SHA1();
+ String _hashString;
+
+ @override
+ void onDone(int length) {
+ // Do nothing.
+ }
+
+ @override
+ void onText(String text) {
+ if (_hasher != null) {
+ _hasher.add(const Utf8Encoder().convert(text));
+ }
+ }
+
+ /// Returns the base64-encoded SHA-1 hash of the utf-8 bytes of the output
+ /// text.
+ String getHash() {
+ if (_hashString == null) {
+ _hashString = _bytesToBase64(_hasher.close());
+ _hasher = null;
+ }
+ return _hashString;
+ }
+
+ /**
+ * Converts a list of bytes into a Base 64 encoded string.
+ *
+ * The list can be any list of integers in the range 0..255,
+ * for example a message digest.
+ *
+ * If [addLineSeparator] is true, the resulting string will be
+ * broken into lines of 76 characters, separated by "\r\n".
+ *
+ * If [urlSafe] is true, the result is URL and filename safe.
+ *
+ * Based on [RFC 4648](http://tools.ietf.org/html/rfc4648)
+ *
+ */
+ String _bytesToBase64(List<int> bytes,
+ {bool urlSafe : false,
+ bool addLineSeparator : false}) {
+ return _CryptoUtils.bytesToBase64(bytes,
+ urlSafe,
+ addLineSeparator);
+ }
}
diff --git a/pkg/compiler/lib/src/io/code_output.dart b/pkg/compiler/lib/src/io/code_output.dart
index f7f1c9b..bd97af0 100644
--- a/pkg/compiler/lib/src/io/code_output.dart
+++ b/pkg/compiler/lib/src/io/code_output.dart
@@ -6,8 +6,6 @@
import 'dart:async';
-import '../source_file.dart';
-
import 'source_map_builder.dart';
class CodeOutputMarker {
@@ -17,27 +15,55 @@
CodeOutputMarker(this.offsetDelta, this.sourcePosition);
}
+abstract class CodeOutputListener {
+ void onText(String text);
+ void onDone(int length);
+}
+
abstract class CodeOutput {
- List<CodeOutputMarker> markers = new List<CodeOutputMarker>();
+ /// Write [text] to this output.
+ ///
+ /// If the output is closed, a [StateError] is thrown.
+ void add(String text);
- int lastBufferOffset = 0;
- int mappedRangeCounter = 0;
+ /// Adds the content of [buffer] to the output and adds its markers to
+ /// [markers].
+ ///
+ /// If the output is closed, a [StateError] is thrown.
+ void addBuffer(CodeBuffer buffer);
+ /// Returns the number of characters currently write to this output.
int get length;
- void _writeInternal(String text);
+ /// Returns `true` if this output has been closed.
+ bool get isClosed;
- /// Converts [object] to a string and adds it to the buffer. If [object] is a
- /// [CodeBuffer], adds its markers to [markers].
- void write(var object) {
- if (object is CodeBuffer) {
- addBuffer(object);
- return;
+ /// Closes the output. Further writes will cause a [StateError].
+ void close();
+
+ /// Applies [f] to every marker in this output.
+ void forEachSourceLocation(void f(int targetOffset,
+ SourceFileLocation sourceLocation));
+}
+
+abstract class AbstractCodeOutput extends CodeOutput {
+ List<CodeOutputMarker> markers = new List<CodeOutputMarker>();
+ int lastBufferOffset = 0;
+ int mappedRangeCounter = 0;
+ bool isClosed = false;
+
+ void _addInternal(String text);
+
+ @override
+ void add(String text) {
+ if (isClosed) {
+ throw new StateError("Code output is closed. Trying to write '$text'.");
}
if (mappedRangeCounter == 0) setSourceLocation(null);
- _writeInternal(object);
+ _addInternal(text);
}
+ @override
void addBuffer(CodeBuffer other) {
if (other.markers.length > 0) {
CodeOutputMarker firstMarker = other.markers[0];
@@ -50,7 +76,10 @@
}
lastBufferOffset = length + other.lastBufferOffset;
}
- _writeInternal(other.getText());
+ if (!other.isClosed) {
+ other.close();
+ }
+ _addInternal(other.getText());
}
void beginMappedRange() {
@@ -78,141 +107,58 @@
f(targetOffset, marker.sourcePosition);
});
}
+
+ void close() {
+ if (isClosed) {
+ throw new StateError("Code output is already closed.");
+ }
+ isClosed = true;
+ }
}
/// [CodeOutput] using a [StringBuffer] as backend.
-class CodeBuffer extends CodeOutput implements StringBuffer {
+class CodeBuffer extends AbstractCodeOutput {
StringBuffer buffer = new StringBuffer();
@override
- void _writeInternal(String text) {
+ void _addInternal(String text) {
buffer.write(text);
}
@override
int get length => buffer.length;
- @override
- bool get isEmpty => buffer.isEmpty;
-
- @override
- bool get isNotEmpty => buffer.isNotEmpty;
-
- @override
- void writeAll(Iterable<Object> 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);
- }
- }
- }
-
- @override
- void writeln([var object = ""]) {
- write(object);
- write("\n");
- }
-
- @override
- void writeCharCode(int charCode) {
- buffer.writeCharCode(charCode);
- }
-
- @override
- void clear() {
- buffer = new StringBuffer();
- markers.clear();
- lastBufferOffset = 0;
+ String getText() {
+ return buffer.toString();
}
String toString() {
throw "Don't use CodeBuffer.toString() since it drops sourcemap data.";
}
-
- String getText() {
- return buffer.toString();
- }
}
/// [CodeOutput] using a [CompilationOutput] as backend.
-class StreamCodeOutput extends CodeOutput {
+class StreamCodeOutput extends AbstractCodeOutput {
int length = 0;
final EventSink<String> output;
+ final List<CodeOutputListener> _listeners;
- StreamCodeOutput(this.output);
+ StreamCodeOutput(this.output, [this._listeners]);
@override
- void _writeInternal(String text) {
+ void _addInternal(String text) {
output.add(text);
length += text.length;
+ if (_listeners != null) {
+ _listeners.forEach((listener) => listener.onText(text));
+ }
}
void close() {
output.close();
- }
-}
-
-/// [StreamCodeSink] that collects line information.
-class LineColumnCodeOutput extends StreamCodeOutput
- implements LineColumnProvider {
- int lastLineStart = 0;
- List<int> lineStarts = <int>[0];
-
- LineColumnCodeOutput(EventSink<String> output) : super(output);
-
- @override
- void _writeInternal(String text) {
- int offset = lastLineStart;
- int index = 0;
- while (index < text.length) {
- // Unix uses '\n' and Windows uses '\r\n', so this algorithm works for
- // both platforms.
- index = text.indexOf('\n', index) + 1;
- if (index <= 0) break;
- lastLineStart = offset + index;
- lineStarts.add(lastLineStart);
- }
- super._writeInternal(text);
- }
-
- @override
- int getLine(int offset) {
- List<int> starts = lineStarts;
- if (offset < 0|| starts.last <= offset) {
- throw 'bad position #$offset in buffer with length ${length}.';
- }
- int first = 0;
- int count = starts.length;
- while (count > 1) {
- int step = count ~/ 2;
- int middle = first + step;
- int lineStart = starts[middle];
- if (offset < lineStart) {
- count = step;
- } else {
- first = middle;
- count -= step;
- }
- }
- return first;
- }
-
- @override
- int getColumn(int line, int offset) {
- return offset - lineStarts[line];
- }
-
- @override
- void close() {
- lineStarts.add(length);
super.close();
+ if (_listeners != null) {
+ _listeners.forEach((listener) => listener.onDone(length));
+ }
}
}
diff --git a/pkg/compiler/lib/src/io/line_column_provider.dart b/pkg/compiler/lib/src/io/line_column_provider.dart
new file mode 100644
index 0000000..5aa700c
--- /dev/null
+++ b/pkg/compiler/lib/src/io/line_column_provider.dart
@@ -0,0 +1,73 @@
+// 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 dart2js.io.line_column;
+
+import 'code_output.dart';
+
+/// Interface for providing line/column information.
+abstract class LineColumnProvider {
+ /// Returns the line number (0-based) for [offset].
+ int getLine(int offset);
+
+ /// Returns the column number (0-based) for [offset] at the given [line].
+ int getColumn(int line, int offset);
+}
+
+/// [CodeOutputListener] that collects line information.
+class LineColumnCollector extends CodeOutputListener
+ implements LineColumnProvider {
+ int lastLineStart = 0;
+ List<int> lineStarts = <int>[0];
+
+ void _collect(String text) {
+ int offset = lastLineStart;
+ int index = 0;
+ while (index < text.length) {
+ // Unix uses '\n' and Windows uses '\r\n', so this algorithm works for
+ // both platforms.
+ index = text.indexOf('\n', index) + 1;
+ if (index <= 0) break;
+ lastLineStart = offset + index;
+ lineStarts.add(lastLineStart);
+ }
+ }
+
+ @override
+ void onText(String text) {
+ _collect(text);
+ }
+
+ @override
+ int getLine(int offset) {
+ List<int> starts = lineStarts;
+ if (offset < 0 || starts.last <= offset) {
+ throw 'bad position #$offset in buffer with length ${lineStarts.last}.';
+ }
+ int first = 0;
+ int count = starts.length;
+ while (count > 1) {
+ int step = count ~/ 2;
+ int middle = first + step;
+ int lineStart = starts[middle];
+ if (offset < lineStart) {
+ count = step;
+ } else {
+ first = middle;
+ count -= step;
+ }
+ }
+ return first;
+ }
+
+ @override
+ int getColumn(int line, int offset) {
+ return offset - lineStarts[line];
+ }
+
+ @override
+ void onDone(int length) {
+ lineStarts.add(length);
+ }
+}
diff --git a/pkg/compiler/lib/src/source_file.dart b/pkg/compiler/lib/src/io/source_file.dart
similarity index 95%
rename from pkg/compiler/lib/src/source_file.dart
rename to pkg/compiler/lib/src/io/source_file.dart
index ad92b46..a106e5e 100644
--- a/pkg/compiler/lib/src/source_file.dart
+++ b/pkg/compiler/lib/src/io/source_file.dart
@@ -2,19 +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 source_file;
+library dart2js.io.source_file;
import 'dart:math';
import 'dart:convert' show UTF8;
-/// Interface for providing line/column information.
-abstract class LineColumnProvider {
- /// Returns the line number (0-based) for [offset].
- int getLine(int offset);
-
- /// Returns the column number (0-based) for [offset] at the given [line].
- int getColumn(int line, int offset);
-}
+import 'line_column_provider.dart';
/**
* Represents a file of source code. The content can be either a [String] or
diff --git a/pkg/compiler/lib/src/io/source_map_builder.dart b/pkg/compiler/lib/src/io/source_map_builder.dart
index de80533..117e298 100644
--- a/pkg/compiler/lib/src/io/source_map_builder.dart
+++ b/pkg/compiler/lib/src/io/source_map_builder.dart
@@ -6,8 +6,9 @@
import '../util/util.dart';
import '../scanner/scannerlib.dart' show Token;
-import '../source_file.dart';
import '../util/uri_extras.dart' show relativize;
+import 'line_column_provider.dart';
+import 'source_file.dart';
class SourceMapBuilder {
static const int VLQ_BASE_SHIFT = 5;
@@ -20,7 +21,7 @@
final Uri uri;
final Uri fileUri;
- SourceFile targetFile;
+ LineColumnProvider lineColumnProvider;
List<SourceMapEntry> entries;
Map<String, int> sourceUrlMap;
@@ -36,7 +37,7 @@
int previousSourceNameIndex;
bool firstEntryInLine;
- SourceMapBuilder(this.uri, this.fileUri, this.targetFile) {
+ SourceMapBuilder(this.uri, this.fileUri, this.lineColumnProvider) {
entries = new List<SourceMapEntry>();
sourceUrlMap = new Map<String, int>();
@@ -87,7 +88,8 @@
void addMapping(int targetOffset, SourceFileLocation sourceLocation) {
bool sameLine(int position, otherPosition) {
- return targetFile.getLine(position) == targetFile.getLine(otherPosition);
+ return lineColumnProvider.getLine(position) ==
+ lineColumnProvider.getLine(otherPosition);
}
if (!entries.isEmpty && sameLine(targetOffset, entries.last.targetOffset)) {
@@ -125,8 +127,9 @@
String build() {
resetPreviousSourceLocation();
StringBuffer mappingsBuffer = new StringBuffer();
- entries.forEach((SourceMapEntry entry) => writeEntry(entry, targetFile,
- mappingsBuffer));
+ entries.forEach((SourceMapEntry entry) {
+ writeEntry(entry, mappingsBuffer);
+ });
StringBuffer buffer = new StringBuffer();
buffer.write('{\n');
buffer.write(' "version": 3,\n');
@@ -151,9 +154,10 @@
return buffer.toString();
}
- void writeEntry(SourceMapEntry entry, SourceFile targetFile, StringBuffer output) {
- int targetLine = targetFile.getLine(entry.targetOffset);
- int targetColumn = targetFile.getColumn(targetLine, entry.targetOffset);
+ void writeEntry(SourceMapEntry entry, StringBuffer output) {
+ int targetLine = lineColumnProvider.getLine(entry.targetOffset);
+ int targetColumn =
+ lineColumnProvider.getColumn(targetLine, entry.targetOffset);
if (targetLine > previousTargetLine) {
for (int i = previousTargetLine; i < targetLine; ++i) {
diff --git a/pkg/compiler/lib/src/js/nodes.dart b/pkg/compiler/lib/src/js/nodes.dart
index 9e0a76b..d5c574e 100644
--- a/pkg/compiler/lib/src/js/nodes.dart
+++ b/pkg/compiler/lib/src/js/nodes.dart
@@ -741,8 +741,7 @@
case ',':
return EXPRESSION;
default:
- throw new leg.CompilerCancelledException(
- "Internal Error: Unhandled binary operator: $op");
+ throw "Internal Error: Unhandled binary operator: $op";
}
}
}
diff --git a/pkg/compiler/lib/src/js/printer.dart b/pkg/compiler/lib/src/js/printer.dart
index b5bce3d..1e43895 100644
--- a/pkg/compiler/lib/src/js/printer.dart
+++ b/pkg/compiler/lib/src/js/printer.dart
@@ -58,7 +58,7 @@
if (str != "") {
if (pendingSemicolon) {
if (!shouldCompressOutput) {
- outBuffer.write(";");
+ outBuffer.add(";");
} 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-
@@ -72,19 +72,19 @@
// is escaped in strings, it is a lot easier to deal with semicolons
// than newlines because the former doesn't need escaping.
if (USE_NEW_EMITTER || expressionContinuationRegExp.hasMatch(str)) {
- outBuffer.write(";");
+ outBuffer.add(";");
} else {
- outBuffer.write("\n");
+ outBuffer.add("\n");
}
}
}
if (pendingSpace &&
(!shouldCompressOutput || identifierCharacterRegExp.hasMatch(str))) {
- outBuffer.write(" ");
+ outBuffer.add(" ");
}
pendingSpace = false;
pendingSemicolon = false;
- outBuffer.write(str);
+ outBuffer.add(str);
lastAddedString = str;
}
}
diff --git a/pkg/compiler/lib/src/js_backend/backend.dart b/pkg/compiler/lib/src/js_backend/backend.dart
index e57db6d..d57e9a2 100644
--- a/pkg/compiler/lib/src/js_backend/backend.dart
+++ b/pkg/compiler/lib/src/js_backend/backend.dart
@@ -172,7 +172,6 @@
ClassElement irRepresentationClass;
Element getInterceptorMethod;
- Element interceptedNames;
ClassElement jsInvocationMirrorClass;
@@ -182,14 +181,6 @@
static const bool TRACE_CALLS = false;
Element traceHelper;
- /**
- * This element is a top-level variable (in generated output) that the
- * compiler initializes to a datastructure used to map from a Type to the
- * interceptor. See declaration of `mapTypeToInterceptor` in
- * `interceptors.dart`.
- */
- Element mapTypeToInterceptor;
-
TypeMask get stringType => compiler.typesTask.stringType;
TypeMask get doubleType => compiler.typesTask.doubleType;
TypeMask get intType => compiler.typesTask.intType;
@@ -1741,8 +1732,6 @@
if (uri == DART_INTERCEPTORS) {
getInterceptorMethod = findMethod('getInterceptor');
- interceptedNames = findVariable('interceptedNames');
- mapTypeToInterceptor = findVariable('mapTypeToInterceptor');
getNativeInterceptorMethod = findMethod('getNativeInterceptor');
List<ClassElement> classes = [
@@ -2308,6 +2297,20 @@
// communicate with the spawning isolate.
enqueuer.enableIsolateSupport();
}
+
+ /// Returns the filename for the output-unit named [name].
+ ///
+ /// The filename is of the form "<main output file>_<name>.part.js".
+ /// If [addExtension] is false, the ".part.js" suffix is left out.
+ String deferredPartFileName(String name, {bool addExtension: true}) {
+ assert(name != "");
+ String outPath = compiler.outputUri != null
+ ? compiler.outputUri.path
+ : "out";
+ String outName = outPath.substring(outPath.lastIndexOf('/') + 1);
+ String extension = addExtension ? ".part.js" : "";
+ return "${outName}_$name$extension";
+ }
}
class JavaScriptResolutionCallbacks extends ResolutionCallbacks {
diff --git a/pkg/compiler/lib/src/js_backend/codegen/codegen.dart b/pkg/compiler/lib/src/js_backend/codegen/codegen.dart
index 05bacf5..cf32d70 100644
--- a/pkg/compiler/lib/src/js_backend/codegen/codegen.dart
+++ b/pkg/compiler/lib/src/js_backend/codegen/codegen.dart
@@ -424,4 +424,33 @@
// TODO: implement SuperInitializer
}
+ @override
+ js.Expression visitCreateBox(tree_ir.CreateBox node) {
+ return new js.ObjectInitializer([]);
+ }
+
+ @override
+ js.Expression visitCreateClosureClass(tree_ir.CreateClosureClass node) {
+ registry.registerInstantiatedClass(node.classElement);
+ return new js.New(glue.closureClassConstructorAccess(node.classElement),
+ node.arguments.map(visitExpression).toList());
+ }
+
+ @override
+ js.Expression visitGetField(tree_ir.GetField node) {
+ return new js.PropertyAccess.field(
+ visitExpression(node.object),
+ glue.instanceFieldPropertyName(node.field));
+ }
+
+ @override
+ void 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);
+ }
}
diff --git a/pkg/compiler/lib/src/js_backend/codegen/glue.dart b/pkg/compiler/lib/src/js_backend/codegen/glue.dart
index d15a458..bac9e33 100644
--- a/pkg/compiler/lib/src/js_backend/codegen/glue.dart
+++ b/pkg/compiler/lib/src/js_backend/codegen/glue.dart
@@ -11,6 +11,7 @@
import '../../constants/values.dart';
import '../../elements/elements.dart';
import '../../constants/expressions.dart';
+import '../../closure.dart' show ClosureClassElement;
/// Encapsulates the dependencies of the function-compiler to the compiler,
/// backend and emitter.
@@ -79,4 +80,13 @@
void registerSpecializedGetInterceptor(Set<ClassElement> classes) {
_backend.registerSpecializedGetInterceptor(classes);
}
+
+ js.Expression closureClassConstructorAccess(ClosureClassElement element) {
+ return _backend.emitter.closureClassConstructorAccess(element);
+ }
+
+ String instanceFieldPropertyName(Element field) {
+ return _namer.instanceFieldPropertyName(field);
+ }
+
}
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 32dde10..b21bb5e 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
@@ -48,4 +48,25 @@
new Selector.fromElement(getInterceptor),
<Expression>[getVariableReference(node.input)]);
}
+
+ Expression visitGetField(cps_ir.GetField node) {
+ return new GetField(getVariableReference(node.object), node.field);
+ }
+
+ Statement visitSetField(cps_ir.SetField node) {
+ return new SetField(getVariableReference(node.object),
+ node.field,
+ getVariableReference(node.value),
+ visit(node.body));
+ }
+
+ Expression visitCreateBox(cps_ir.CreateBox node) {
+ return new CreateBox();
+ }
+
+ Expression visitCreateClosureClass(cps_ir.CreateClosureClass node) {
+ return new CreateClosureClass(
+ node.classElement,
+ node.arguments.map(getVariableReference).toList());
+ }
}
diff --git a/pkg/compiler/lib/src/js_backend/codegen/task.dart b/pkg/compiler/lib/src/js_backend/codegen/task.dart
index 8ecde4c8..0068a21 100644
--- a/pkg/compiler/lib/src/js_backend/codegen/task.dart
+++ b/pkg/compiler/lib/src/js_backend/codegen/task.dart
@@ -11,7 +11,7 @@
import '../js_backend.dart';
import '../../dart2jslib.dart';
-import '../../source_file.dart';
+import '../../io/source_file.dart';
import '../../cps_ir/cps_ir_nodes.dart' as cps;
import '../../cps_ir/cps_ir_builder.dart';
import '../../tree_ir/tree_ir_nodes.dart' as tree_ir;
@@ -44,8 +44,7 @@
// TODO(karlklose,sigurm): remove and update dart-doc of [compile].
final FunctionCompiler fallbackCompiler;
- // TODO(sigurdm): Assign this.
- Tracer tracer;
+ Tracer get tracer => compiler.tracer;
CspFunctionCompiler(Compiler compiler, JavaScriptBackend backend)
: irBuilderTask = new IrBuilderTask(compiler),
@@ -98,7 +97,6 @@
cps.FunctionDefinition compileToCpsIR(AstElement element) {
// TODO(sigurdm): Support these constructs.
if (element.isGenerativeConstructorBody ||
- element.enclosingClass is ClosureClassElement ||
element.isNative ||
element.isField) {
giveUp('unsupported element kind: ${element.name}:${element.kind}');
@@ -108,7 +106,9 @@
if (cpsNode == null) {
giveUp('unable to build cps definition of $element');
}
+ traceGraph("IR Builder", cpsNode);
new UnsugarVisitor(glue).rewrite(cpsNode);
+ traceGraph("Unsugaring", cpsNode);
return cpsNode;
}
@@ -131,7 +131,6 @@
cps.FunctionDefinition optimizeCpsIR(cps.FunctionDefinition cpsNode) {
// Transformations on the CPS IR.
- traceGraph("IR Builder", cpsNode);
TypePropagator typePropagator = new TypePropagator<TypeMask>(
compiler.types,
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 9afb0884..deadc5f 100644
--- a/pkg/compiler/lib/src/js_backend/constant_system_javascript.dart
+++ b/pkg/compiler/lib/src/js_backend/constant_system_javascript.dart
@@ -97,6 +97,23 @@
}
}
+class JavaScriptAddOperation implements BinaryOperation {
+ final _addOperation = const AddOperation();
+ String get name => _addOperation.name;
+
+ const JavaScriptAddOperation();
+
+ ConstantValue fold(ConstantValue left, ConstantValue right) {
+ ConstantValue result = _addOperation.fold(left, right);
+ if (result != null && result.isNum) {
+ return JAVA_SCRIPT_CONSTANT_SYSTEM.convertToJavaScriptConstant(result);
+ }
+ return result;
+ }
+
+ apply(left, right) => _addOperation.apply(left, right);
+}
+
class JavaScriptBinaryArithmeticOperation implements BinaryOperation {
final BinaryOperation dartArithmeticOperation;
@@ -146,7 +163,7 @@
final int BITS31 = 0x8FFFFFFF;
final int BITS32 = 0xFFFFFFFF;
- final add = const JavaScriptBinaryArithmeticOperation(const AddOperation());
+ final add = const JavaScriptAddOperation();
final bitAnd = const JavaScriptBinaryBitOperation(const BitAndOperation());
final bitNot = const JavaScriptBitNotOperation();
final bitOr = const JavaScriptBinaryBitOperation(const BitOrOperation());
diff --git a/pkg/compiler/lib/src/js_backend/js_backend.dart b/pkg/compiler/lib/src/js_backend/js_backend.dart
index 3f8d0d5..e621f38 100644
--- a/pkg/compiler/lib/src/js_backend/js_backend.dart
+++ b/pkg/compiler/lib/src/js_backend/js_backend.dart
@@ -34,6 +34,7 @@
ElementVisitor;
import '../js_backend/codegen/task.dart';
import 'patch_resolver.dart';
+import '../deferred_load.dart';
part 'backend.dart';
part 'checked_mode_helpers.dart';
diff --git a/pkg/compiler/lib/src/js_backend/native_emitter.dart b/pkg/compiler/lib/src/js_backend/native_emitter.dart
index f945fef..60f1155 100644
--- a/pkg/compiler/lib/src/js_backend/native_emitter.dart
+++ b/pkg/compiler/lib/src/js_backend/native_emitter.dart
@@ -9,7 +9,6 @@
final Map<Element, ClassBuilder> cachedBuilders;
final CodeEmitterTask emitterTask;
- CodeBuffer nativeBuffer;
// Native classes found in the application.
Set<ClassElement> nativeClasses = new Set<ClassElement>();
@@ -33,7 +32,6 @@
subtypes = new Map<ClassElement, List<ClassElement>>(),
directSubtypes = new Map<ClassElement, List<ClassElement>>(),
nativeMethods = new Set<FunctionElement>(),
- nativeBuffer = new CodeBuffer(),
cachedBuilders = emitterTask.compiler.cacheStrategy.newMap();
Compiler get compiler => emitterTask.compiler;
@@ -45,7 +43,6 @@
}
/**
- * Writes the class definitions for the interceptors to [mainBuffer].
* Writes code to associate dispatch tags with interceptors to [nativeBuffer].
*
* The interceptors are filtered to avoid emitting trivial interceptors. For
@@ -68,7 +65,6 @@
*/
void generateNativeClasses(
List<ClassElement> classes,
- CodeBuffer mainBuffer,
Map<ClassElement, Map<String, jsAst.Expression>> additionalProperties) {
// Compute a pre-order traversal of the subclass forest. We actually want a
// post-order traversal but it is easier to compute the pre-order and use it
@@ -442,7 +438,7 @@
return isSupertypeOfNativeClass(element);
}
- void assembleCode(CodeBuffer targetBuffer) {
+ void assembleCode(CodeOutput targetOutput) {
List<jsAst.Property> objectProperties = <jsAst.Property>[];
jsAst.Property addProperty(String name, jsAst.Expression value) {
@@ -470,13 +466,14 @@
[ defPropFunction,
new jsAst.ObjectInitializer(objectProperties)]);
- if (emitterTask.compiler.enableMinification) targetBuffer.write(';');
- targetBuffer.write(jsAst.prettyPrint(
+ if (emitterTask.compiler.enableMinification) {
+ targetOutput.add(';');
+ }
+ targetOutput.addBuffer(jsAst.prettyPrint(
new jsAst.ExpressionStatement(init), compiler));
- targetBuffer.write('\n');
+ targetOutput.add('\n');
}
- targetBuffer.write(nativeBuffer);
- targetBuffer.write('\n');
+ targetOutput.add('\n');
}
}
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 01c5963..db34000 100644
--- a/pkg/compiler/lib/src/js_emitter/code_emitter_task.dart
+++ b/pkg/compiler/lib/src/js_emitter/code_emitter_task.dart
@@ -27,6 +27,8 @@
new Map<OutputUnit, List<ConstantValue>>();
final Map<OutputUnit, List<Element>> outputStaticLists =
new Map<OutputUnit, List<Element>>();
+ final Map<OutputUnit, List<VariableElement>> outputStaticNonFinalFieldLists =
+ new Map<OutputUnit, List<VariableElement>>();
final Map<OutputUnit, Set<LibraryElement>> outputLibraryLists =
new Map<OutputUnit, Set<LibraryElement>>();
@@ -118,6 +120,10 @@
return emitter.typeAccess(e);
}
+ jsAst.Expression closureClassConstructorAccess(ClosureClassElement e) {
+ return emitter.closureClassConstructorAccess(e);
+ }
+
void registerReadTypeVariable(TypeVariableElement element) {
readTypeVariables.add(element);
}
@@ -360,10 +366,22 @@
backend.generatedCode.keys.where(isStaticFunction);
for (Element element in Elements.sortedByPosition(elements)) {
- outputStaticLists.putIfAbsent(
+ List<Element> list = outputStaticLists.putIfAbsent(
compiler.deferredLoadTask.outputUnitForElement(element),
- () => new List<Element>())
- .add(element);
+ () => new List<Element>());
+ list.add(element);
+ }
+ }
+
+ void computeNeededStaticNonFinalFields() {
+ JavaScriptConstantCompiler handler = backend.constants;
+ Iterable<VariableElement> staticNonFinalFields =
+ handler.getStaticNonFinalFieldsForEmission();
+ for (Element element in Elements.sortedByPosition(staticNonFinalFields)) {
+ List<VariableElement> list = outputStaticNonFinalFieldLists.putIfAbsent(
+ compiler.deferredLoadTask.outputUnitForElement(element),
+ () => new List<VariableElement>());
+ list.add(element);
}
}
@@ -387,6 +405,7 @@
computeNeededDeclarations();
computeNeededConstants();
computeNeededStatics();
+ computeNeededStaticNonFinalFields();
computeNeededLibraries();
}
@@ -443,6 +462,9 @@
/// Returns the JS expression representing the type [e].
jsAst.Expression typeAccess(Element e);
+ /// Returns the JS constructor for the given closure class [e].
+ jsAst.Expression closureClassConstructorAccess(ClosureClassElement e);
+
int compareConstants(ConstantValue a, ConstantValue b);
bool isConstantInlinedOrAlreadyEmitted(ConstantValue constant);
diff --git a/pkg/compiler/lib/src/js_emitter/js_emitter.dart b/pkg/compiler/lib/src/js_emitter/js_emitter.dart
index 3a951ba..aeb48b5 100644
--- a/pkg/compiler/lib/src/js_emitter/js_emitter.dart
+++ b/pkg/compiler/lib/src/js_emitter/js_emitter.dart
@@ -4,6 +4,9 @@
library dart2js.js_emitter;
+import 'dart:async';
+import 'dart:convert';
+
import '../common.dart';
import '../constants/expressions.dart';
@@ -18,8 +21,7 @@
import '../dart_types.dart' show
TypedefType;
-import '../io/code_output.dart' show
- CodeBuffer;
+import '../io/code_output.dart';
import '../elements/elements.dart' show
ConstructorBodyElement,
@@ -30,7 +32,7 @@
import '../hash/sha1.dart' show hashOfString;
-// import '../helpers/helpers.dart'; // Included for debug helpers.
+import '../helpers/helpers.dart'; // Included for debug helpers.
import '../js/js.dart' as jsAst;
import '../js/js.dart' show
@@ -55,9 +57,9 @@
import 'new_emitter/emitter.dart' as new_js_emitter;
-import '../source_file.dart' show
- SourceFile,
- StringSourceFile;
+import '../io/line_column_provider.dart' show
+ LineColumnCollector,
+ LineColumnProvider;
import '../io/source_map_builder.dart' show
SourceMapBuilder;
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 b2c5273..c3df243 100644
--- a/pkg/compiler/lib/src/js_emitter/new_emitter/emitter.dart
+++ b/pkg/compiler/lib/src/js_emitter/new_emitter/emitter.dart
@@ -134,5 +134,10 @@
}
@override
+ js.PropertyAccess closureClassConstructorAccess(ClassElement element) {
+ return _globalPropertyAccess(element);
+ }
+
+ @override
void invalidateCaches() {}
}
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 d441e13..7f53cbd 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
@@ -450,7 +450,7 @@
}
return;
}
- emitter.needsArrayInitializerSupport = true;
+ emitter.needsStructuredMemberInfo = true;
// This element is needed for reflection or needs additional stubs or has a
// super alias. So we need to retain additional information.
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 ff8eecb..4adec5d 100644
--- a/pkg/compiler/lib/src/js_emitter/old_emitter/emitter.dart
+++ b/pkg/compiler/lib/src/js_emitter/old_emitter/emitter.dart
@@ -16,6 +16,7 @@
final InterceptorEmitter interceptorEmitter = new InterceptorEmitter();
final MetadataEmitter metadataEmitter = new MetadataEmitter();
+ // TODO(johnniwinther): Wrap these fields in a caching strategy.
final Set<ConstantValue> cachedEmittedConstants;
final CodeBuffer cachedEmittedConstantsBuffer = new CodeBuffer();
final Map<Element, ClassBuilder> cachedClassBuilders;
@@ -24,18 +25,19 @@
bool needsClassSupport = false;
bool needsMixinSupport = false;
bool needsLazyInitializer = false;
- /// This is set to true in ContainerBuilder if the program contains
- /// function elements that need extra handling. In this case the element is
- /// stored along with an array containing the needed information.
- bool needsArrayInitializerSupport = false;
+
+ /// True if [ContainerBuilder.addMemberMethodFromInfo] used "structured info",
+ /// that is, some function was needed for reflection, had stubs, or had a
+ /// super alias.
+ bool needsStructuredMemberInfo = false;
+
final Namer namer;
ConstantEmitter constantEmitter;
NativeEmitter get nativeEmitter => task.nativeEmitter;
TypeTestRegistry get typeTestRegistry => task.typeTestRegistry;
// The full code that is written to each hunk part-file.
- Map<OutputUnit, CodeBuffer> outputBuffers = new Map<OutputUnit, CodeBuffer>();
- final CodeBuffer deferredConstants = new CodeBuffer();
+ Map<OutputUnit, CodeOutput> outputBuffers = new Map<OutputUnit, CodeOutput>();
/** Shorter access to [isolatePropertiesName]. Both here in the code, as
well as in the generated code. */
@@ -65,14 +67,6 @@
String get n => compiler.enableMinification ? "" : "\n";
String get N => compiler.enableMinification ? "\n" : ";\n";
- CodeBuffer getBuffer(OutputUnit outputUnit) {
- return outputBuffers.putIfAbsent(outputUnit, () => new CodeBuffer());
- }
-
- CodeBuffer get mainBuffer {
- return getBuffer(compiler.deferredLoadTask.mainOutputUnit);
- }
-
/**
* List of expressions and statements that will be included in the
* precompiled function.
@@ -137,8 +131,8 @@
_cspPrecompiledConstructorNames.clear();
}
- void addComment(String comment, CodeBuffer buffer) {
- buffer.write(jsAst.prettyPrint(js.comment(comment), compiler));
+ void addComment(String comment, CodeOutput output) {
+ output.addBuffer(jsAst.prettyPrint(js.comment(comment), compiler));
}
@override
@@ -237,6 +231,11 @@
return globalPropertyAccess(element);
}
+ @override
+ jsAst.PropertyAccess closureClassConstructorAccess(ClosureClassElement e) {
+ return globalPropertyAccess(e);
+ }
+
List<jsAst.Statement> buildTrivialNsmHandlers(){
return nsmEmitter.buildTrivialNsmHandlers();
}
@@ -335,14 +334,14 @@
jsAst.Expression defineClass = js('''
function(name, fields) {
var accessors = [];
-
+
var str = "function " + name + "(";
var body = "";
if (#hasIsolateSupport) { var fieldNames = ""; }
-
+
for (var i = 0; i < fields.length; i++) {
if(i != 0) str += ", ";
-
+
var field = generateAccessor(fields[i], accessors, name);
if (#hasIsolateSupport) { fieldNames += "'" + field + "',"; }
var parameter = "parameter_" + field;
@@ -361,7 +360,7 @@
str += name + ".$fieldNamesProperty=[" + fieldNames + "];\\n";
}
str += accessors.join("");
-
+
return str;
}''', { 'hasIsolateSupport': hasIsolateSupport });
@@ -581,9 +580,9 @@
'allowNativesSubclassing': true});
}
- void emitFinishIsolateConstructorInvocation(CodeBuffer buffer) {
+ void emitFinishIsolateConstructorInvocation(CodeOutput output) {
String isolate = namer.isolateName;
- buffer.write("$isolate = $finishIsolateConstructorName($isolate)$N");
+ output.add("$isolate = $finishIsolateConstructorName($isolate)$N");
}
/// In minified mode we want to keep the name for the most common core types.
@@ -763,44 +762,50 @@
}
}
- void emitStaticNonFinalFieldInitializations(CodeBuffer buffer,
+ void emitStaticNonFinalFieldInitializations(CodeOutput output,
OutputUnit outputUnit) {
- JavaScriptConstantCompiler handler = backend.constants;
- Iterable<VariableElement> staticNonFinalFields =
- handler.getStaticNonFinalFieldsForEmission();
- for (Element element in Elements.sortedByPosition(staticNonFinalFields)) {
- // [:interceptedNames:] is handled in [emitInterceptedNames].
- if (element == backend.interceptedNames) continue;
- // `mapTypeToInterceptor` is handled in [emitMapTypeToInterceptor].
- if (element == backend.mapTypeToInterceptor) continue;
- compiler.withCurrentElement(element, () {
- jsAst.Expression initialValue;
- if (outputUnit !=
- compiler.deferredLoadTask.outputUnitForElement(element)) {
- if (outputUnit == compiler.deferredLoadTask.mainOutputUnit) {
- // In the main output-unit we output a stub initializer for deferred
- // variables, such that `isolateProperties` stays a fast object.
- initialValue = jsAst.number(0);
- } else {
- // Don't output stubs outside the main output file.
- return;
- }
- } else {
- initialValue = constantEmitter.referenceInInitializationContext(
- handler.getInitialValueFor(element).value);
+ void emitInitialization(Element element, jsAst.Expression initialValue) {
+ jsAst.Expression init =
+ js('$isolateProperties.# = #',
+ [namer.getNameOfGlobalField(element), initialValue]);
+ output.addBuffer(jsAst.prettyPrint(init, compiler,
+ monitor: compiler.dumpInfoTask));
+ output.add('$N');
+ }
+ bool inMainUnit = (outputUnit == compiler.deferredLoadTask.mainOutputUnit);
+ JavaScriptConstantCompiler handler = backend.constants;
+
+ Iterable<Element> fields = task.outputStaticNonFinalFieldLists[outputUnit];
+ // If the outputUnit does not contain any static non-final fields, then
+ // [fields] is `null`.
+ if (fields != null) {
+ for (Element element in fields) {
+ compiler.withCurrentElement(element, () {
+ ConstantValue constant = handler.getInitialValueFor(element).value;
+ emitInitialization(
+ element,
+ constantEmitter.referenceInInitializationContext(constant));
+ });
+ }
+ }
+
+ if (inMainUnit && task.outputStaticNonFinalFieldLists.length > 1) {
+ // In the main output-unit we output a stub initializer for deferred
+ // variables, so that `isolateProperties` stays a fast object.
+ task.outputStaticNonFinalFieldLists.forEach(
+ (OutputUnit fieldsOutputUnit, Iterable<VariableElement> fields) {
+ if (fieldsOutputUnit == outputUnit) return; // Skip the main unit.
+ for (Element element in fields) {
+ compiler.withCurrentElement(element, () {
+ emitInitialization(element, jsAst.number(0));
+ });
}
- jsAst.Expression init =
- js('$isolateProperties.# = #',
- [namer.getNameOfGlobalField(element), initialValue]);
- buffer.write(jsAst.prettyPrint(init, compiler,
- monitor: compiler.dumpInfoTask));
- buffer.write('$N');
});
}
}
- void emitLazilyInitializedStaticFields(CodeBuffer buffer) {
+ void emitLazilyInitializedStaticFields(CodeOutput output) {
JavaScriptConstantCompiler handler = backend.constants;
List<VariableElement> lazyFields =
handler.getLazilyInitializedFieldsForEmission();
@@ -810,9 +815,9 @@
jsAst.Expression init =
buildLazilyInitializedStaticField(element, isolateProperties);
if (init == null) continue;
- buffer.write(
+ output.addBuffer(
jsAst.prettyPrint(init, compiler, monitor: compiler.dumpInfoTask));
- buffer.write("$N");
+ output.add("$N");
}
}
}
@@ -871,25 +876,25 @@
return namer.constantName(a).compareTo(namer.constantName(b));
}
- void emitCompileTimeConstants(CodeBuffer buffer, OutputUnit outputUnit) {
+ void emitCompileTimeConstants(CodeOutput output, OutputUnit outputUnit) {
List<ConstantValue> constants = outputConstantLists[outputUnit];
if (constants == null) return;
- bool isMainBuffer = buffer == mainBuffer;
- if (compiler.hasIncrementalSupport && isMainBuffer) {
- buffer = cachedEmittedConstantsBuffer;
+ CodeOutput constantOutput = output;
+ if (compiler.hasIncrementalSupport && outputUnit.isMainOutput) {
+ constantOutput = cachedEmittedConstantsBuffer;
}
for (ConstantValue constant in constants) {
- if (compiler.hasIncrementalSupport && isMainBuffer) {
+ if (compiler.hasIncrementalSupport && outputUnit.isMainOutput) {
if (cachedEmittedConstants.contains(constant)) continue;
cachedEmittedConstants.add(constant);
}
jsAst.Expression init = buildConstantInitializer(constant);
- buffer.write(jsAst.prettyPrint(init, compiler,
- monitor: compiler.dumpInfoTask));
- buffer.write('$N');
+ constantOutput.addBuffer(jsAst.prettyPrint(init, compiler,
+ monitor: compiler.dumpInfoTask));
+ constantOutput.add('$N');
}
- if (compiler.hasIncrementalSupport && isMainBuffer) {
- mainBuffer.write(cachedEmittedConstantsBuffer);
+ if (compiler.hasIncrementalSupport && outputUnit.isMainOutput) {
+ output.addBuffer(constantOutput);
}
}
@@ -906,8 +911,8 @@
'${namer.isolateName}.$makeConstListProperty(#)');
}
- void emitMakeConstantList(CodeBuffer buffer) {
- buffer.write(
+ void emitMakeConstantList(CodeOutput output) {
+ output.addBuffer(
jsAst.prettyPrint(
// Functions are stored in the hidden class and not as properties in
// the object. We never actually look at the value, but only want
@@ -919,7 +924,7 @@
}''',
[namer.isolateName, makeConstListProperty]),
compiler, monitor: compiler.dumpInfoTask));
- buffer.write(N);
+ output.add(N);
}
/// Returns the code equivalent to:
@@ -933,7 +938,7 @@
[backend.emitter.staticFunctionAccess(isolateMain), mainAccess]);
}
- emitMain(CodeBuffer buffer) {
+ emitMain(CodeOutput output) {
if (compiler.isMockCompilation) return;
Element main = compiler.mainFunction;
jsAst.Expression mainCallClosure = null;
@@ -955,14 +960,14 @@
backend,
generateEmbeddedGlobalAccess,
js("convertToFastObject", []));
- buffer.write(jsAst.prettyPrint(nativeBoilerPlate,
- compiler, monitor: compiler.dumpInfoTask));
+ output.addBuffer(jsAst.prettyPrint(
+ nativeBoilerPlate, compiler, monitor: compiler.dumpInfoTask));
}
jsAst.Expression currentScriptAccess =
generateEmbeddedGlobalAccess(embeddedNames.CURRENT_SCRIPT);
- addComment('BEGIN invoke [main].', buffer);
+ addComment('BEGIN invoke [main].', output);
// This code finds the currently executing script by listening to the
// onload event of all script tags and getting the first script which
// finishes. Since onload is called immediately after execution this should
@@ -999,14 +1004,14 @@
})''', {'currentScript': currentScriptAccess,
'mainCallClosure': mainCallClosure});
- buffer.write(';');
- buffer.write(jsAst.prettyPrint(invokeMain,
- compiler, monitor: compiler.dumpInfoTask));
- buffer.write(N);
- addComment('END invoke [main].', buffer);
+ output.add(';');
+ output.addBuffer(jsAst.prettyPrint(invokeMain,
+ compiler, monitor: compiler.dumpInfoTask));
+ output.add(N);
+ addComment('END invoke [main].', output);
}
- void emitInitFunction(CodeBuffer buffer) {
+ void emitInitFunction(CodeOutput output) {
String isolate = namer.currentIsolate;
jsAst.Expression allClassesAccess =
generateEmbeddedGlobalAccess(embeddedNames.ALL_CLASSES);
@@ -1034,17 +1039,17 @@
getterName, lazyValue) {
if (!#lazies) #lazies = Object.create(null);
#lazies[fieldName] = getterName;
-
+
var sentinelUndefined = {};
var sentinelInProgress = {};
prototype[fieldName] = sentinelUndefined;
-
+
prototype[getterName] = function () {
var result = $isolate[fieldName];
try {
if (result === sentinelUndefined) {
$isolate[fieldName] = sentinelInProgress;
-
+
try {
result = $isolate[fieldName] = lazyValue();
} finally {
@@ -1057,7 +1062,7 @@
if (result === sentinelInProgress)
#cyclicThrow(staticName);
}
-
+
return result;
} finally {
$isolate[getterName] = function() { return this[fieldName]; };
@@ -1115,7 +1120,7 @@
}
return Isolate;
}
-
+
}''', {'allClasses': allClassesAccess,
'interceptorsByTag': interceptorsByTagAccess,
'leafTags': leafTagsAccess,
@@ -1128,12 +1133,14 @@
'hasIncrementalSupport': compiler.hasIncrementalSupport,
'lazyInitializerProperty': lazyInitializerProperty,});
- buffer.write(jsAst.prettyPrint(decl,
- compiler, monitor: compiler.dumpInfoTask).getText());
- if (compiler.enableMinification) buffer.write('\n');
+ output.addBuffer(
+ jsAst.prettyPrint(decl, compiler, monitor: compiler.dumpInfoTask));
+ if (compiler.enableMinification) {
+ output.add('\n');
+ }
}
- void emitConvertToFastObjectFunction() {
+ void emitConvertToFastObjectFunction(CodeOutput output) {
List<jsAst.Statement> debugCode = <jsAst.Statement>[];
if (DEBUG_FAST_OBJECTS) {
debugCode.add(js.statement(r'''
@@ -1160,11 +1167,11 @@
return properties;
}''', [debugCode]);
- mainBuffer.write(jsAst.prettyPrint(convertToFastObject, compiler));
- mainBuffer.write(N);
+ output.addBuffer(jsAst.prettyPrint(convertToFastObject, compiler));
+ output.add(N);
}
- void writeLibraryDescriptors(CodeBuffer buffer, LibraryElement library) {
+ void writeLibraryDescriptors(CodeOutput output, LibraryElement library) {
var uri = "";
if (!compiler.enableMinification || backend.mustPreserveUris) {
uri = library.canonicalUri;
@@ -1192,20 +1199,23 @@
compiler.dumpInfoTask.registerElementAst(library, metadata);
compiler.dumpInfoTask.registerElementAst(library, initializers);
- buffer
- ..write('["$libraryName",$_')
- ..write('"${uri}",$_')
- ..write(metadata == null ? "" : jsAst.prettyPrint(metadata,
- compiler,
- monitor: compiler.dumpInfoTask))
- ..write(',$_')
- ..write(namer.globalObjectFor(library))
- ..write(',$_')
- ..write(jsAst.prettyPrint(initializers,
- compiler,
- monitor: compiler.dumpInfoTask))
- ..write(library == compiler.mainApp ? ',${n}1' : "")
- ..write('],$n');
+ output
+ ..add('["$libraryName",$_')
+ ..add('"${uri}",$_');
+ if (metadata != null) {
+ output.addBuffer(jsAst.prettyPrint(metadata,
+ compiler,
+ monitor: compiler.dumpInfoTask));
+ }
+ output
+ ..add(',$_')
+ ..add(namer.globalObjectFor(library))
+ ..add(',$_')
+ ..addBuffer(jsAst.prettyPrint(initializers,
+ compiler,
+ monitor: compiler.dumpInfoTask))
+ ..add(library == compiler.mainApp ? ',${n}1' : "")
+ ..add('],$n');
}
void emitPrecompiledConstructor(OutputUnit outputUnit,
@@ -1232,7 +1242,7 @@
''' /* next string is not a raw string */ '''
if (#hasIsolateSupport) {
#constructorName.$fieldNamesProperty = #fieldNamesArray;
- }
+ }
}''',
{"constructorName": constructorName,
"constructorNameString": js.string(constructorName),
@@ -1242,22 +1252,6 @@
cspPrecompiledConstructorNamesFor(outputUnit).add(js('#', constructorName));
}
- /// Extracts the output name of the compiler's outputUri.
- String deferredPartFileName(OutputUnit outputUnit,
- {bool addExtension: true}) {
- String outPath = compiler.outputUri != null
- ? compiler.outputUri.path
- : "out";
- String outName = outPath.substring(outPath.lastIndexOf('/') + 1);
- String extension = addExtension ? ".part.js" : "";
- if (outputUnit == compiler.deferredLoadTask.mainOutputUnit) {
- return "$outName$extension";
- } else {
- String name = outputUnit.name;
- return "${outName}_$name$extension";
- }
- }
-
void emitLibraries(Iterable<LibraryElement> libraries) {
if (libraries.isEmpty) return;
@@ -1314,7 +1308,7 @@
}
}
- void emitMangledNames() {
+ void emitMangledNames(CodeOutput output) {
if (!mangledFieldNames.isEmpty) {
var keys = mangledFieldNames.keys.toList();
keys.sort();
@@ -1327,13 +1321,13 @@
jsAst.Expression mangledNamesAccess =
generateEmbeddedGlobalAccess(embeddedNames.MANGLED_NAMES);
var map = new jsAst.ObjectInitializer(properties);
- mainBuffer.write(
+ output.addBuffer(
jsAst.prettyPrint(
js.statement('# = #', [mangledNamesAccess, map]),
compiler,
monitor: compiler.dumpInfoTask));
if (compiler.enableMinification) {
- mainBuffer.write(';');
+ output.add(';');
}
}
if (!mangledGlobalFieldNames.isEmpty) {
@@ -1347,13 +1341,13 @@
jsAst.Expression mangledGlobalNamesAccess =
generateEmbeddedGlobalAccess(embeddedNames.MANGLED_GLOBAL_NAMES);
var map = new jsAst.ObjectInitializer(properties);
- mainBuffer.write(
+ output.addBuffer(
jsAst.prettyPrint(
js.statement('# = #', [mangledGlobalNamesAccess, map]),
compiler,
monitor: compiler.dumpInfoTask));
if (compiler.enableMinification) {
- mainBuffer.write(';');
+ output.add(';');
}
}
}
@@ -1377,27 +1371,39 @@
void emitMainOutputUnit(Map<OutputUnit, String> deferredLoadHashes,
CodeBuffer nativeBuffer) {
- bool isProgramSplit = compiler.deferredLoadTask.isProgramSplit;
- OutputUnit mainOutputUnit = compiler.deferredLoadTask.mainOutputUnit;
+ LineColumnCollector lineColumnCollector;
+ List<CodeOutputListener> codeOutputListeners;
+ if (generateSourceMap) {
+ lineColumnCollector = new LineColumnCollector();
+ codeOutputListeners = <CodeOutputListener>[lineColumnCollector];
+ }
- mainBuffer.write(buildGeneratedBy());
- addComment(HOOKS_API_USAGE, mainBuffer);
+ OutputUnit mainOutputUnit = compiler.deferredLoadTask.mainOutputUnit;
+ CodeOutput mainOutput =
+ new StreamCodeOutput(compiler.outputProvider('', 'js'),
+ codeOutputListeners);
+ outputBuffers[mainOutputUnit] = mainOutput;
+
+ bool isProgramSplit = compiler.deferredLoadTask.isProgramSplit;
+
+ mainOutput.add(buildGeneratedBy());
+ addComment(HOOKS_API_USAGE, mainOutput);
if (isProgramSplit) {
/// For deferred loading we communicate the initializers via this global
/// variable. The deferred hunks will add their initialization to this.
/// The semicolon is important in minified mode, without it the
/// following parenthesis looks like a call to the object literal.
- mainBuffer..write(
+ mainOutput.add(
'self.${deferredInitializers} = self.${deferredInitializers} || '
'Object.create(null);$n');
}
// Using a named function here produces easier to read stack traces in
// Chrome/V8.
- mainBuffer.write('(function(${namer.currentIsolate})$_{\n');
+ mainOutput.add('(function(${namer.currentIsolate})$_{\n');
if (compiler.hasIncrementalSupport) {
- mainBuffer.write(jsAst.prettyPrint(js.statement(
+ mainOutput.addBuffer(jsAst.prettyPrint(js.statement(
"""
{
#helper = #helper || Object.create(null);
@@ -1415,9 +1421,9 @@
'addMethod': buildIncrementalAddMethod() }), compiler));
}
if (isProgramSplit) {
- /// We collect all the global state of the, so it can be passed to the
+ /// We collect all the global state, so it can be passed to the
/// initializer of deferred files.
- mainBuffer.write('var ${globalsHolder}$_=${_}Object.create(null)$N');
+ mainOutput.add('var ${globalsHolder}$_=${_}Object.create(null)$N');
}
jsAst.Statement mapFunction = js.statement('''
@@ -1433,30 +1439,30 @@
return x;
}
''');
- mainBuffer.write(jsAst.prettyPrint(mapFunction, compiler));
+ mainOutput.addBuffer(jsAst.prettyPrint(mapFunction, compiler));
for (String globalObject in Namer.reservedGlobalObjectNames) {
// The global objects start as so-called "slow objects". For V8, this
// means that it won't try to make map transitions as we add properties
// to these objects. Later on, we attempt to turn these objects into
// fast objects by calling "convertToFastObject" (see
// [emitConvertToFastObjectFunction]).
- mainBuffer.write('var ${globalObject}$_=${_}');
+ mainOutput.add('var ${globalObject}$_=${_}');
if(isProgramSplit) {
- mainBuffer.write('${globalsHolder}.$globalObject$_=${_}');
+ mainOutput.add('${globalsHolder}.$globalObject$_=${_}');
}
- mainBuffer.write('map()$N');
+ mainOutput.add('map()$N');
}
- mainBuffer.write('function ${namer.isolateName}()$_{}\n');
+ mainOutput.add('function ${namer.isolateName}()$_{}\n');
if (isProgramSplit) {
- mainBuffer.write(
+ mainOutput.add(
'${globalsHolder}.${namer.isolateName}$_=$_${namer.isolateName}$N'
'${globalsHolder}.$initName$_=${_}$initName$N'
'${globalsHolder}.$parseReflectionDataName$_=$_'
'$parseReflectionDataName$N');
}
- mainBuffer.write('init()$N$n');
- mainBuffer.write('$isolateProperties$_=$_$isolatePropertiesName$N');
+ mainOutput.add('init()$N$n');
+ mainOutput.add('$isolateProperties$_=$_$isolatePropertiesName$N');
emitStaticFunctions(task.outputStaticLists[mainOutputUnit]);
@@ -1468,83 +1474,84 @@
}
if (compiler.enableMinification) {
- mainBuffer.write(';');
+ mainOutput.add(';');
}
- if (elementDescriptors.isNotEmpty) {
- Iterable<LibraryElement> libraries =
- task.outputLibraryLists[mainOutputUnit];
- if (libraries == null) libraries = [];
- emitLibraries(libraries);
- emitTypedefs();
- emitMangledNames();
+ Iterable<LibraryElement> libraries =
+ task.outputLibraryLists[mainOutputUnit];
+ if (libraries == null) libraries = [];
+ emitLibraries(libraries);
+ emitTypedefs();
+ emitMangledNames(mainOutput);
- checkEverythingEmitted(elementDescriptors.keys);
+ checkEverythingEmitted(elementDescriptors.keys);
- CodeBuffer libraryBuffer = new CodeBuffer();
- for (LibraryElement library in Elements.sortedByPosition(libraries)) {
- writeLibraryDescriptors(libraryBuffer, library);
- elementDescriptors.remove(library);
- }
-
- mainBuffer
- ..write(
- jsAst.prettyPrint(
- getReflectionDataParser(this, backend),
- compiler))
- ..write(n);
-
- // The argument to reflectionDataParser is assigned to a temporary 'dart'
- // so that 'dart.' will appear as the prefix to dart methods in stack
- // traces and profile entries.
- mainBuffer..write('var dart = [$n')
- ..write(libraryBuffer)
- ..write(']$N')
- ..write('$parseReflectionDataName(dart)$N');
+ CodeBuffer libraryBuffer = new CodeBuffer();
+ for (LibraryElement library in Elements.sortedByPosition(libraries)) {
+ writeLibraryDescriptors(libraryBuffer, library);
+ elementDescriptors.remove(library);
}
- interceptorEmitter.emitGetInterceptorMethods(mainBuffer);
- interceptorEmitter.emitOneShotInterceptors(mainBuffer);
+ mainOutput
+ ..addBuffer(
+ jsAst.prettyPrint(
+ getReflectionDataParser(this, backend),
+ compiler))
+ ..add(n);
+
+ // The argument to reflectionDataParser is assigned to a temporary 'dart'
+ // so that 'dart.' will appear as the prefix to dart methods in stack
+ // traces and profile entries.
+ mainOutput..add('var dart = [$n')
+ ..addBuffer(libraryBuffer)
+ ..add(']$N')
+ ..add('$parseReflectionDataName(dart)$N');
+
+ interceptorEmitter.emitGetInterceptorMethods(mainOutput);
+ interceptorEmitter.emitOneShotInterceptors(mainOutput);
if (task.outputContainsConstantList) {
- emitMakeConstantList(mainBuffer);
+ emitMakeConstantList(mainOutput);
}
// Constants in checked mode call into RTI code to set type information
// which may need getInterceptor (and one-shot interceptor) methods, so
// we have to make sure that [emitGetInterceptorMethods] and
// [emitOneShotInterceptors] have been called.
- emitCompileTimeConstants(mainBuffer, mainOutputUnit);
+ emitCompileTimeConstants(mainOutput, mainOutputUnit);
- emitDeferredBoilerPlate(mainBuffer, deferredLoadHashes);
+ emitDeferredBoilerPlate(mainOutput, deferredLoadHashes);
+
+ if (compiler.deferredMapUri != null) {
+ outputDeferredMap();
+ }
// Static field initializations require the classes and compile-time
// constants to be set up.
- emitStaticNonFinalFieldInitializations(mainBuffer, mainOutputUnit);
- interceptorEmitter.emitInterceptedNames(mainBuffer);
- interceptorEmitter.emitMapTypeToInterceptor(mainBuffer);
- emitLazilyInitializedStaticFields(mainBuffer);
+ emitStaticNonFinalFieldInitializations(mainOutput, mainOutputUnit);
+ interceptorEmitter.emitMapTypeToInterceptor(mainOutput);
+ emitLazilyInitializedStaticFields(mainOutput);
- mainBuffer.writeln();
- mainBuffer.write(nativeBuffer);
+ mainOutput.add('\n');
+ mainOutput.addBuffer(nativeBuffer);
- metadataEmitter.emitMetadata(mainBuffer);
+ metadataEmitter.emitMetadata(mainOutput);
isolateProperties = isolatePropertiesName;
// The following code should not use the short-hand for the
// initialStatics.
- mainBuffer.write('${namer.currentIsolate}$_=${_}null$N');
+ mainOutput.add('${namer.currentIsolate}$_=${_}null$N');
- emitFinishIsolateConstructorInvocation(mainBuffer);
- mainBuffer.write(
+ emitFinishIsolateConstructorInvocation(mainOutput);
+ mainOutput.add(
'${namer.currentIsolate}$_=${_}new ${namer.isolateName}()$N');
- emitConvertToFastObjectFunction();
+ emitConvertToFastObjectFunction(mainOutput);
for (String globalObject in Namer.reservedGlobalObjectNames) {
- mainBuffer.write('$globalObject = convertToFastObject($globalObject)$N');
+ mainOutput.add('$globalObject = convertToFastObject($globalObject)$N');
}
if (DEBUG_FAST_OBJECTS) {
- mainBuffer.write(r'''
+ mainOutput.add(r'''
// The following only works on V8 when run with option
// "--allow-natives-syntax". We use'new Function' because the
// miniparser does not understand V8 native syntax.
@@ -1573,7 +1580,7 @@
}
''');
for (String object in Namer.userGlobalObjects) {
- mainBuffer.write('''
+ mainOutput.add('''
if (typeof print === "function") {
print("Size of $object: "
+ String(Object.getOwnPropertyNames($object).length)
@@ -1585,31 +1592,30 @@
jsAst.FunctionDeclaration precompiledFunctionAst =
buildCspPrecompiledFunctionFor(mainOutputUnit);
- emitInitFunction(mainBuffer);
- emitMain(mainBuffer);
- mainBuffer.write('})()\n');
+ emitInitFunction(mainOutput);
+ emitMain(mainOutput);
+ mainOutput.add('})()\n');
if (compiler.useContentSecurityPolicy) {
- mainBuffer.write(
+ mainOutput.addBuffer(
jsAst.prettyPrint(
precompiledFunctionAst,
compiler,
monitor: compiler.dumpInfoTask,
- allowVariableMinification: false).getText());
+ allowVariableMinification: false));
}
- String assembledCode = mainBuffer.getText();
if (generateSourceMap) {
- outputSourceMap(assembledCode, mainBuffer, '',
- compiler.sourceMapUri, compiler.outputUri);
- mainBuffer.write(
+ mainOutput.add(
generateSourceMapTag(compiler.sourceMapUri, compiler.outputUri));
- assembledCode = mainBuffer.getText();
}
- compiler.outputProvider('', 'js')
- ..add(assembledCode)
- ..close();
+ mainOutput.close();
+
+ if (generateSourceMap) {
+ outputSourceMap(mainOutput, lineColumnCollector, '',
+ compiler.sourceMapUri, compiler.outputUri);
+ }
}
/// Used by incremental compilation to patch up the prototype of
@@ -1758,6 +1764,7 @@
if (libraries == null) libraries = [];
emitLibraries(libraries);
+ // TODO(johnniwinther): Avoid creating [CodeBuffer]s.
CodeBuffer buffer = new CodeBuffer();
outputBuffers[outputUnit] = buffer;
for (LibraryElement library in Elements.sortedByPosition(libraries)) {
@@ -1772,6 +1779,7 @@
CodeBuffer buildNativesBuffer() {
// Emit native classes on [nativeBuffer].
+ // TODO(johnniwinther): Avoid creating a [CodeBuffer].
final CodeBuffer nativeBuffer = new CodeBuffer();
if (nativeClasses.isEmpty) return nativeBuffer;
@@ -1779,8 +1787,7 @@
addComment('Native classes', nativeBuffer);
- nativeEmitter.generateNativeClasses(nativeClasses, mainBuffer,
- additionalProperties);
+ nativeEmitter.generateNativeClasses(nativeClasses, additionalProperties);
nativeEmitter.finishGenerateNativeClasses();
nativeEmitter.assembleCode(nativeBuffer);
@@ -1805,7 +1812,6 @@
!backend.htmlLibraryIsLoaded) {
compiler.reportHint(NO_LOCATION_SPANNABLE, MessageKind.PREAMBLE);
}
-
// Return the total program size.
return outputBuffers.values.fold(0, (a, b) => a + b.length);
}
@@ -1844,8 +1850,8 @@
() => new ClassBuilder(owner, namer));
}
- /// Emits support-code for deferred loading into [buffer].
- void emitDeferredBoilerPlate(CodeBuffer buffer,
+ /// Emits support-code for deferred loading into [output].
+ void emitDeferredBoilerPlate(CodeOutput output,
Map<OutputUnit, String> deferredLoadHashes) {
jsAst.Statement functions = js.statement('''
{
@@ -1873,7 +1879,7 @@
embeddedNames.INITIALIZE_LOADED_HUNK),
"deferredInitialized": generateEmbeddedGlobalAccess(
embeddedNames.DEFERRED_INITIALIZED)});
- buffer.write(jsAst.prettyPrint(functions,
+ output.addBuffer(jsAst.prettyPrint(functions,
compiler, monitor: compiler.dumpInfoTask));
// Write a javascript mapping from Deferred import load ids (derrived
// from the import prefix.) to a list of lists of uris of hunks to load,
@@ -1889,7 +1895,7 @@
List<String> hashes = new List<String>();
deferredLibraryHashes[loadId] = new List<String>();
for (OutputUnit outputUnit in outputUnits) {
- uris.add(deferredPartFileName(outputUnit));
+ uris.add(backend.deferredPartFileName(outputUnit.name));
hashes.add(deferredLoadHashes[outputUnit]);
}
@@ -1908,11 +1914,10 @@
new jsAst.ObjectInitializer(properties, isOneLiner: true);
jsAst.Node globalName = generateEmbeddedGlobalAccess(name);
- buffer.write(jsAst.prettyPrint(
+ output.addBuffer(jsAst.prettyPrint(
js("# = #", [globalName, initializer]),
compiler, monitor: compiler.dumpInfoTask));
- buffer.write('$N');
-
+ output.add('$N');
}
emitMapping(embeddedNames.DEFERRED_LIBRARY_URIS, deferredLibraryUris);
@@ -1931,39 +1936,55 @@
for (OutputUnit outputUnit in compiler.deferredLoadTask.allOutputUnits) {
if (outputUnit == compiler.deferredLoadTask.mainOutputUnit) continue;
- CodeBuffer libraryDescriptorBuffer = deferredBuffers[outputUnit];
+ CodeOutput libraryDescriptorBuffer = deferredBuffers[outputUnit];
- CodeBuffer outputBuffer = new CodeBuffer();
+ List<CodeOutputListener> outputListeners = <CodeOutputListener>[];
+ Hasher hasher = new Hasher();
+ outputListeners.add(hasher);
- outputBuffer..write(buildGeneratedBy())
- ..write('${deferredInitializers}.current$_=$_'
- 'function$_(${globalsHolder}) {$N');
- for (String globalObject in Namer.reservedGlobalObjectNames) {
- outputBuffer
- .write('var $globalObject$_=$_'
- '${globalsHolder}.$globalObject$N');
+ LineColumnCollector lineColumnCollector;
+ if (generateSourceMap) {
+ lineColumnCollector = new LineColumnCollector();
+ outputListeners.add(lineColumnCollector);
}
- outputBuffer
- ..write('var init$_=$_${globalsHolder}.init$N')
- ..write('var $parseReflectionDataName$_=$_'
+
+ String partPrefix =
+ backend.deferredPartFileName(outputUnit.name, addExtension: false);
+ CodeOutput output = new StreamCodeOutput(
+ compiler.outputProvider(partPrefix, 'part.js'),
+ outputListeners);
+
+ outputBuffers[outputUnit] = output;
+
+ output
+ ..add(buildGeneratedBy())
+ ..add('${deferredInitializers}.current$_=$_'
+ 'function$_(${globalsHolder}) {$N');
+ for (String globalObject in Namer.reservedGlobalObjectNames) {
+ output
+ .add('var $globalObject$_=$_'
+ '${globalsHolder}.$globalObject$N');
+ }
+ output
+ ..add('var init$_=$_${globalsHolder}.init$N')
+ ..add('var $parseReflectionDataName$_=$_'
'$globalsHolder.$parseReflectionDataName$N')
- ..write('var ${namer.isolateName}$_=$_'
+ ..add('var ${namer.isolateName}$_=$_'
'${globalsHolder}.${namer.isolateName}$N');
if (libraryDescriptorBuffer != null) {
- // TODO(ahe): This defines a lot of properties on the
- // Isolate.prototype object. We know this will turn it into a
- // slow object in V8, so instead we should do something similar
- // to Isolate.$finishIsolateConstructor.
- outputBuffer
- ..write('var ${namer.currentIsolate}$_=$_$isolatePropertiesName$N')
+ // TODO(ahe): This defines a lot of properties on the
+ // Isolate.prototype object. We know this will turn it into a
+ // slow object in V8, so instead we should do something similar
+ // to Isolate.$finishIsolateConstructor.
+ output
+ ..add('var ${namer.currentIsolate}$_=$_$isolatePropertiesName$N')
// The argument to reflectionDataParser is assigned to a temporary
// 'dart' so that 'dart.' will appear as the prefix to dart methods
// in stack traces and profile entries.
- ..write('var dart = [$n ')
- ..addBuffer(libraryDescriptorBuffer)
- ..write(']$N')
- ..write('$parseReflectionDataName(dart)$N');
-
+ ..add('var dart = [$n ')
+ ..addBuffer(libraryDescriptorBuffer)
+ ..add(']$N')
+ ..add('$parseReflectionDataName(dart)$N');
}
// Set the currentIsolate variable to the current isolate (which is
@@ -1975,33 +1996,33 @@
// After we have done the setup it must point to the current Isolate.
// Otherwise all methods/functions accessing isolate variables will
// access the wrong object.
- outputBuffer.write("${namer.currentIsolate}$_=${_}arguments[1]$N");
+ output.add("${namer.currentIsolate}$_=${_}arguments[1]$N");
- emitCompileTimeConstants(outputBuffer, outputUnit);
- emitStaticNonFinalFieldInitializations(outputBuffer, outputUnit);
- outputBuffer.write('}$N');
+ emitCompileTimeConstants(output, outputUnit);
+ emitStaticNonFinalFieldInitializations(output, outputUnit);
+ output.add('}$N');
if (compiler.useContentSecurityPolicy) {
jsAst.FunctionDeclaration precompiledFunctionAst =
buildCspPrecompiledFunctionFor(outputUnit);
- outputBuffer.write(
+ output.addBuffer(
jsAst.prettyPrint(
precompiledFunctionAst, compiler,
monitor: compiler.dumpInfoTask,
- allowVariableMinification: false).getText());
+ allowVariableMinification: false));
}
// Make a unique hash of the code (before the sourcemaps are added)
// This will be used to retrieve the initializing function from the global
// variable.
- String hash = hashOfString(outputBuffer.getText());
+ String hash = hasher.getHash();
- outputBuffer.write('${deferredInitializers}["$hash"]$_=$_'
- '${deferredInitializers}.current$N');
+ output.add('${deferredInitializers}["$hash"]$_=$_'
+ '${deferredInitializers}.current$N');
- String partPrefix = deferredPartFileName(outputUnit, addExtension: false);
if (generateSourceMap) {
+
Uri mapUri, partUri;
Uri sourceMapUri = compiler.sourceMapUri;
Uri outputUri = compiler.outputUri;
@@ -2022,16 +2043,14 @@
partUri = compiler.outputUri.replace(pathSegments: partSegments);
}
- outputSourceMap(outputBuffer.getText(), outputBuffer, partName,
- mapUri, partUri);
- outputBuffer.write(generateSourceMapTag(mapUri, partUri));
+ output.add(generateSourceMapTag(mapUri, partUri));
+ output.close();
+ outputSourceMap(output, lineColumnCollector, partName,
+ mapUri, partUri);
+ } else {
+ output.close();
}
- outputBuffers[outputUnit] = outputBuffer;
- compiler.outputProvider(partPrefix, 'part.js')
- ..add(outputBuffer.getText())
- ..close();
-
hunkHashes[outputUnit] = hash;
}
return hunkHashes;
@@ -2043,21 +2062,35 @@
return '// Generated by dart2js, the Dart to JavaScript compiler$suffix.\n';
}
- void outputSourceMap(String code, CodeBuffer buffer, String name,
- [Uri sourceMapUri, Uri fileUri]) {
+ void outputSourceMap(CodeOutput output,
+ LineColumnProvider lineColumnProvider,
+ String name,
+ [Uri sourceMapUri,
+ Uri fileUri]) {
if (!generateSourceMap) return;
// Create a source file for the compilation output. This allows using
// [:getLine:] to transform offsets to line numbers in [SourceMapBuilder].
- SourceFile compiledFile = new StringSourceFile(null, code);
SourceMapBuilder sourceMapBuilder =
- new SourceMapBuilder(sourceMapUri, fileUri, compiledFile);
- buffer.forEachSourceLocation(sourceMapBuilder.addMapping);
+ new SourceMapBuilder(sourceMapUri, fileUri, lineColumnProvider);
+ output.forEachSourceLocation(sourceMapBuilder.addMapping);
String sourceMap = sourceMapBuilder.build();
compiler.outputProvider(name, 'js.map')
..add(sourceMap)
..close();
}
+ void outputDeferredMap() {
+ Map<String, dynamic> mapping = new Map<String, dynamic>();
+ // Json does not support comments, so we embed the explanation in the
+ // data.
+ mapping["_comment"] = "This mapping shows which compiled `.js` files are "
+ "needed for a given deferred library import.";
+ mapping.addAll(compiler.deferredLoadTask.computeDeferredMap());
+ compiler.outputProvider(compiler.deferredMapUri.path, 'deferred_map')
+ ..add(const JsonEncoder.withIndent(" ").convert(mapping))
+ ..close();
+ }
+
void invalidateCaches() {
if (!compiler.hasIncrementalSupport) return;
if (cachedElements.isEmpty) return;
diff --git a/pkg/compiler/lib/src/js_emitter/old_emitter/interceptor_emitter.dart b/pkg/compiler/lib/src/js_emitter/old_emitter/interceptor_emitter.dart
index a33b9c6..189d392 100644
--- a/pkg/compiler/lib/src/js_emitter/old_emitter/interceptor_emitter.dart
+++ b/pkg/compiler/lib/src/js_emitter/old_emitter/interceptor_emitter.dart
@@ -13,7 +13,7 @@
}
}
- void emitGetInterceptorMethod(CodeBuffer buffer,
+ void emitGetInterceptorMethod(CodeOutput output,
String key,
Set<ClassElement> classes) {
InterceptorStubGenerator stubGenerator =
@@ -21,27 +21,27 @@
jsAst.Expression function =
stubGenerator.generateGetInterceptorMethod(classes);
- buffer.write(jsAst.prettyPrint(
+ output.addBuffer(jsAst.prettyPrint(
js('${namer.globalObjectFor(backend.interceptorsLibrary)}.# = #',
[key, function]),
compiler));
- buffer.write(N);
+ output.add(N);
}
/**
* Emit all versions of the [:getInterceptor:] method.
*/
- void emitGetInterceptorMethods(CodeBuffer buffer) {
- emitter.addComment('getInterceptor methods', buffer);
+ void emitGetInterceptorMethods(CodeOutput output) {
+ emitter.addComment('getInterceptor methods', output);
Map<String, Set<ClassElement>> specializedGetInterceptors =
backend.specializedGetInterceptors;
for (String name in specializedGetInterceptors.keys.toList()..sort()) {
Set<ClassElement> classes = specializedGetInterceptors[name];
- emitGetInterceptorMethod(buffer, name, classes);
+ emitGetInterceptorMethod(output, name, classes);
}
}
- void emitOneShotInterceptors(CodeBuffer buffer) {
+ void emitOneShotInterceptors(CodeOutput output) {
List<String> names = backend.oneShotInterceptors.keys.toList();
names.sort();
@@ -54,39 +54,33 @@
jsAst.Expression assignment =
js('${globalObject}.# = #', [name, function]);
- buffer.write(jsAst.prettyPrint(assignment, compiler));
- buffer.write(N);
+ output.addBuffer(jsAst.prettyPrint(assignment, compiler));
+ output.add(N);
}
}
/**
* If [JSInvocationMirror._invokeOn] has been compiled, emit all the
* possible selector names that are intercepted into the
- * [interceptedNames] top-level variable. The implementation of
+ * [interceptedNames] embedded global. The implementation of
* [_invokeOn] will use it to determine whether it should call the
* method with an extra parameter.
*/
- void emitInterceptedNames(CodeBuffer buffer) {
- // TODO(ahe): We should not generate the list of intercepted names at
- // compile time, it can be generated automatically at runtime given
- // subclasses of Interceptor (which can easily be identified).
- if (!compiler.enabledInvokeOn) return;
-
- // TODO(ahe): We should roll this into
- // [emitStaticNonFinalFieldInitializations].
- String name = backend.namer.getNameOfGlobalField(backend.interceptedNames);
+ jsAst.ObjectInitializer generateInterceptedNamesSet() {
+ // We could also generate the list of intercepted names at
+ // runtime, by running through the subclasses of Interceptor
+ // (which can easily be identified).
+ if (!compiler.enabledInvokeOn) return null;
int index = 0;
- var invocationNames = interceptorInvocationNames.toList()..sort();
- List<jsAst.Expression> elements = invocationNames.map(js.string).toList();
- jsAst.ArrayInitializer array =
- new jsAst.ArrayInitializer(elements);
-
- jsAst.Expression assignment =
- js('${emitter.isolateProperties}.# = #', [name, array]);
-
- buffer.write(jsAst.prettyPrint(assignment, compiler));
- buffer.write(N);
+ List<String> invocationNames = interceptorInvocationNames.toList()..sort();
+ List<jsAst.Property> properties =
+ new List<jsAst.Property>(invocationNames.length);
+ for (int i = 0; i < invocationNames.length; i++) {
+ String name = invocationNames[i];
+ properties[i] = new jsAst.Property(js.string(name), js.number(1));
+ }
+ return new jsAst.ObjectInitializer(properties, isOneLiner: true);
}
/**
@@ -94,7 +88,7 @@
* [findInterceptorForType]. See declaration of [mapTypeToInterceptor] in
* `interceptors.dart`.
*/
- void emitMapTypeToInterceptor(CodeBuffer buffer) {
+ void emitMapTypeToInterceptor(CodeOutput output) {
// TODO(sra): Perhaps inject a constant instead?
CustomElementsAnalysis analysis = backend.customElementsAnalysis;
if (!analysis.needsTable) return;
@@ -144,12 +138,11 @@
}
jsAst.ArrayInitializer array = new jsAst.ArrayInitializer(elements);
- String name =
- backend.namer.getNameOfGlobalField(backend.mapTypeToInterceptor);
- jsAst.Expression assignment =
- js('${emitter.isolateProperties}.# = #', [name, array]);
+ jsAst.Expression mapTypeToInterceptor = emitter
+ .generateEmbeddedGlobalAccess(embeddedNames.MAP_TYPE_TO_INTERCEPTOR);
+ jsAst.Expression assignment = js('# = #', [mapTypeToInterceptor, array]);
- buffer.write(jsAst.prettyPrint(assignment, compiler));
- buffer.write(N);
+ output.addBuffer(jsAst.prettyPrint(assignment, compiler));
+ output.add(N);
}
}
diff --git a/pkg/compiler/lib/src/js_emitter/old_emitter/metadata_emitter.dart b/pkg/compiler/lib/src/js_emitter/old_emitter/metadata_emitter.dart
index 4814889..4366c6d 100644
--- a/pkg/compiler/lib/src/js_emitter/old_emitter/metadata_emitter.dart
+++ b/pkg/compiler/lib/src/js_emitter/old_emitter/metadata_emitter.dart
@@ -103,21 +103,21 @@
});
}
- void emitMetadata(CodeBuffer buffer) {
+ void emitMetadata(CodeOutput output) {
String metadataAccess = emitter.generateEmbeddedGlobalAccessString(
embeddedNames.METADATA);
- buffer.write('$metadataAccess$_=$_[');
+ output.add('$metadataAccess$_=$_[');
for (String metadata in globalMetadata) {
if (metadata is String) {
if (metadata != 'null') {
- buffer.write(metadata);
+ output.add(metadata);
}
} else {
throw 'Unexpected value in metadata: ${Error.safeToString(metadata)}';
}
- buffer.write(',$n');
+ output.add(',$n');
}
- buffer.write('];$n');
+ output.add('];$n');
}
List<int> computeMetadata(FunctionElement element) {
diff --git a/pkg/compiler/lib/src/js_emitter/old_emitter/reflection_data_parser.dart b/pkg/compiler/lib/src/js_emitter/old_emitter/reflection_data_parser.dart
index e324d5e..993db08 100644
--- a/pkg/compiler/lib/src/js_emitter/old_emitter/reflection_data_parser.dart
+++ b/pkg/compiler/lib/src/js_emitter/old_emitter/reflection_data_parser.dart
@@ -68,8 +68,6 @@
var flag = descriptor[property];
if (flag > 0)
descriptor[previousProperty].$reflectableField = flag;
- } else if (firstChar === "@" && property !== "@") {
- newDesc[property.substring(1)][$metadataField] = descriptor[property];
} else if (firstChar === "*") {
newDesc[previousProperty].$defaultValuesField = descriptor[property];
var optionalMethods = newDesc.$methodsWithOptionalArgumentsField;
@@ -150,9 +148,6 @@
descriptor[previousProperty].$reflectableField = flag;
if (element && element.length)
#typeInformation[previousProperty] = element;
- } else if (firstChar === "@") {
- property = property.substring(1);
- ${namer.currentIsolate}[property][$metadataField] = element;
} else if (firstChar === "*") {
globalObject[previousProperty].$defaultValuesField = element;
var optionalMethods = descriptor.$methodsWithOptionalArgumentsField;
@@ -165,7 +160,7 @@
functions.push(property);
#globalFunctions[property] = element;
} else if (element.constructor === Array) {
- if (#needsArrayInitializerSupport) {
+ if (#needsStructuredMemberInfo) {
addStubs(globalObject, element, property,
true, descriptor, functions);
}
@@ -181,7 +176,7 @@
''', {'typeInformation': typeInformationAccess,
'globalFunctions': globalFunctionsAccess,
'hasClasses': oldEmitter.needsClassSupport,
- 'needsArrayInitializerSupport': oldEmitter.needsArrayInitializerSupport});
+ 'needsStructuredMemberInfo': oldEmitter.needsStructuredMemberInfo});
/**
@@ -241,7 +236,10 @@
if (getterStubName) functions.push(getterStubName);
f.\$stubName = getterStubName;
f.\$callName = null;
- if (isIntercepted) #interceptedNames[getterStubName] = true;
+ // Update the interceptedNames map (which only exists if `invokeOn` was
+ // enabled).
+ if (#enabledInvokeOn)
+ if (isIntercepted) #interceptedNames[getterStubName] = 1;
}
if (#usesMangledNames) {
@@ -271,7 +269,8 @@
}
}
}
-''', {'globalFunctions' : globalFunctionsAccess,
+''', {'globalFunctions': globalFunctionsAccess,
+ 'enabledInvokeOn': compiler.enabledInvokeOn,
'interceptedNames': interceptedNamesAccess,
'usesMangledNames':
compiler.mirrorsLibrary != null || compiler.enabledFunctionApply,
@@ -280,6 +279,9 @@
List<jsAst.Statement> tearOffCode = buildTearOffCode(backend);
+ jsAst.ObjectInitializer interceptedNamesSet =
+ oldEmitter.interceptorEmitter.generateInterceptedNamesSet();
+
jsAst.Statement init = js.statement('''{
var functionCounter = 0;
if (!#libraries) #libraries = [];
@@ -288,7 +290,8 @@
if (!#statics) #statics = map();
if (!#typeInformation) #typeInformation = map();
if (!#globalFunctions) #globalFunctions = map();
- if (!#interceptedNames) #interceptedNames = map();
+ if (#enabledInvokeOn)
+ if (!#interceptedNames) #interceptedNames = #interceptedNamesSet;
var libraries = #libraries;
var mangledNames = #mangledNames;
var mangledGlobalNames = #mangledGlobalNames;
@@ -340,7 +343,9 @@
'statics': staticsAccess,
'typeInformation': typeInformationAccess,
'globalFunctions': globalFunctionsAccess,
+ 'enabledInvokeOn': compiler.enabledInvokeOn,
'interceptedNames': interceptedNamesAccess,
+ 'interceptedNamesSet': interceptedNamesSet,
'notInCspMode': !compiler.useContentSecurityPolicy,
'needsClassSupport': oldEmitter.needsClassSupport});
@@ -431,7 +436,7 @@
#processClassData;
}
#processStatics;
- if (#needsArrayInitializerSupport) {
+ if (#needsStructuredMemberInfo) {
#addStubs;
#tearOffCode;
}
@@ -448,7 +453,7 @@
'init': init,
'finishClasses': finishClasses,
'needsClassSupport': oldEmitter.needsClassSupport,
- 'needsArrayInitializerSupport': oldEmitter.needsArrayInitializerSupport});
+ 'needsStructuredMemberInfo': oldEmitter.needsStructuredMemberInfo});
}
diff --git a/pkg/compiler/lib/src/js_emitter/program_builder.dart b/pkg/compiler/lib/src/js_emitter/program_builder.dart
index f26076f..79885e03 100644
--- a/pkg/compiler/lib/src/js_emitter/program_builder.dart
+++ b/pkg/compiler/lib/src/js_emitter/program_builder.dart
@@ -128,20 +128,11 @@
return result;
}
- /// Returns a name composed of the main output file name and [name].
- String _outputFileName(String name) {
- assert(name != "");
- String outPath = _compiler.outputUri != null
- ? _compiler.outputUri.path
- : "out";
- String outName = outPath.substring(outPath.lastIndexOf('/') + 1);
- return "${outName}_$name";
- }
-
DeferredOutput _buildDeferredOutput(MainOutput mainOutput,
Fragment fragment) {
DeferredOutput result = new DeferredOutput(
- _outputFileName(fragment.name), fragment.name,
+ backend.deferredPartFileName(fragment.name, addExtension: false),
+ fragment.name,
mainOutput,
_buildLibraries(fragment),
_buildStaticNonFinalFields(fragment),
@@ -444,6 +435,7 @@
List<ConstantValue> constantValues) {
if (constantValues == null) return;
for (ConstantValue constantValue in constantValues) {
+ _registry.registerConstant(outputUnit, constantValue);
assert(!_constants.containsKey(constantValue));
String name = namer.constantName(constantValue);
String constantObject = namer.globalObjectForConstant(constantValue);
diff --git a/pkg/compiler/lib/src/js_emitter/registry.dart b/pkg/compiler/lib/src/js_emitter/registry.dart
index 0c036b3..e0115b1 100644
--- a/pkg/compiler/lib/src/js_emitter/registry.dart
+++ b/pkg/compiler/lib/src/js_emitter/registry.dart
@@ -54,6 +54,10 @@
final Map<OutputUnit, Fragment> _deferredFragmentsMap =
<OutputUnit, Fragment>{};
+ /// Cache for the last seen output unit.
+ OutputUnit _lastOutputUnit;
+ Fragment _lastFragment;
+
DeferredLoadTask get _deferredLoadTask => _compiler.deferredLoadTask;
Iterable<Holder> get holders => _holdersMap.values;
Iterable<Fragment> get deferredFragments => _deferredFragmentsMap.values;
@@ -68,17 +72,23 @@
OutputUnit get _mainOutputUnit => _deferredLoadTask.mainOutputUnit;
Fragment _mapUnitToFragment(OutputUnit targetUnit) {
+ if (targetUnit == _lastOutputUnit) return _lastFragment;
+
if (mainFragment == null) {
mainFragment = new Fragment.main(_deferredLoadTask.mainOutputUnit);
}
- if (!_isProgramSplit) {
- assert(targetUnit == _deferredLoadTask.mainOutputUnit);
- return mainFragment;
+
+ Fragment result;
+ if (targetUnit == _mainOutputUnit) {
+ result = mainFragment;
+ } else {
+ String name = targetUnit.name;
+ result = _deferredFragmentsMap.putIfAbsent(
+ targetUnit, () => new Fragment.deferred(targetUnit, name));
}
- if (targetUnit == _mainOutputUnit) return mainFragment;
- String name = targetUnit.name;
- return _deferredFragmentsMap.putIfAbsent(
- targetUnit, () => new Fragment.deferred(targetUnit, name));
+ _lastOutputUnit = targetUnit;
+ _lastFragment = result;
+ return result;
}
/// Adds all elements to their respective libraries in the correct fragment.
@@ -89,6 +99,12 @@
}
}
+ void registerConstant(OutputUnit outputUnit, ConstantValue constantValue) {
+ // We just need to make sure that the target fragment is registered.
+ // Otherwise a fragment that contains only constants is not built.
+ _mapUnitToFragment(outputUnit);
+ }
+
Holder registerHolder(String name) {
return _holdersMap.putIfAbsent(
name,
diff --git a/pkg/compiler/lib/src/js_emitter/type_test_generator.dart b/pkg/compiler/lib/src/js_emitter/type_test_generator.dart
index 2c9ce0d..f4b184f 100644
--- a/pkg/compiler/lib/src/js_emitter/type_test_generator.dart
+++ b/pkg/compiler/lib/src/js_emitter/type_test_generator.dart
@@ -74,7 +74,7 @@
compiler.closureToClassMapper.closureMappingCache[node];
if (closureData != null) {
ClosureFieldElement thisLocal =
- closureData.getFreeVariableElement(closureData.thisLocal);
+ closureData.freeVariableMap[closureData.thisLocal];
if (thisLocal != null) {
String thisName = namer.instanceFieldPropertyName(thisLocal);
thisAccess = js('this.#', thisName);
diff --git a/pkg/compiler/lib/src/resolution/class_members.dart b/pkg/compiler/lib/src/resolution/class_members.dart
index 5e753f8..aaa40aa 100644
--- a/pkg/compiler/lib/src/resolution/class_members.dart
+++ b/pkg/compiler/lib/src/resolution/class_members.dart
@@ -348,8 +348,15 @@
}
} else {
assert(declared.name == superMember.name);
+
if (declared.isStatic) {
for (Member inherited in superMember.declarations) {
+ if (cls == inherited.declarer.element) {
+ // An error should already have been reported.
+ assert(invariant(declared.element, compiler.compilationFailed));
+ continue;
+ }
+
reportMessage(
inherited.element, MessageKind.NO_STATIC_OVERRIDE, () {
reportErrorWithContext(
@@ -361,6 +368,14 @@
DartType declaredType = declared.functionType;
for (Member inherited in superMember.declarations) {
+ if (inherited.element == declared.element) {
+ // TODO(ahe): For some reason, "call" elements are repeated in
+ // superMember.declarations. Investigate why.
+ } else if (cls == inherited.declarer.element) {
+ // An error should already have been reported.
+ assert(invariant(declared.element, compiler.compilationFailed));
+ continue;
+ }
void reportError(MessageKind errorKind, MessageKind infoKind) {
reportMessage(
diff --git a/pkg/compiler/lib/src/resolution/members.dart b/pkg/compiler/lib/src/resolution/members.dart
index 2a39487..74ec34e 100644
--- a/pkg/compiler/lib/src/resolution/members.dart
+++ b/pkg/compiler/lib/src/resolution/members.dart
@@ -743,7 +743,7 @@
Element nextTarget = target.immediateRedirectionTarget;
if (seen.contains(nextTarget)) {
error(node, MessageKind.CYCLIC_REDIRECTING_FACTORY);
- break;
+ return;
}
seen.add(target);
target = nextTarget;
@@ -1119,6 +1119,7 @@
compiler.internalError(member,
"No abstract field for accessor");
} else if (!identical(lookupElement.kind, ElementKind.ABSTRACT_FIELD)) {
+ if (lookupElement.isErroneous || lookupElement.isAmbiguous) return;
compiler.internalError(member,
"Inaccessible abstract field for accessor");
}
@@ -1332,8 +1333,7 @@
}
error(Spannable node, MessageKind kind, [arguments = const {}]) {
- // TODO(ahe): Make non-fatal.
- compiler.reportFatalError(node, kind, arguments);
+ compiler.reportError(node, kind, arguments);
}
Link<MetadataAnnotation> resolveMetadata(Element element,
@@ -1411,8 +1411,12 @@
target = constructor.enclosingClass.lookupLocalMember(name);
if (target == null) {
error(selector, MessageKind.CANNOT_RESOLVE, {'name': name});
+ target = new ErroneousFieldElementX(
+ selector.asIdentifier(), constructor.enclosingClass);
} else if (target.kind != ElementKind.FIELD) {
error(selector, MessageKind.NOT_A_FIELD, {'fieldName': name});
+ target = new ErroneousFieldElementX(
+ selector.asIdentifier(), constructor.enclosingClass);
} else if (!target.isInstanceMember) {
error(selector, MessageKind.INIT_STATIC_FIELD, {'fieldName': name});
}
@@ -1639,7 +1643,7 @@
R visit(Node node) => (node == null) ? null : node.accept(this);
void error(Spannable node, MessageKind kind, [Map arguments = const {}]) {
- compiler.reportFatalError(node, kind, arguments);
+ compiler.reportError(node, kind, arguments);
}
void warning(Spannable node, MessageKind kind, [Map arguments = const {}]) {
@@ -2230,6 +2234,9 @@
MessageKind kind,
[Map arguments = const {}]) {
compiler.reportWarning(node, kind, arguments);
+ // TODO(ahe): Use [allowedCategory] to synthesize a more precise subclass
+ // of [ErroneousElementX]. For example, [ErroneousFieldElementX],
+ // [ErroneousConstructorElementX], etc.
return new ErroneousElementX(kind, arguments, name, enclosingElement);
}
@@ -2240,7 +2247,9 @@
}
return null;
} else if (node.isSuper()) {
- if (!inInstanceContext) error(node, MessageKind.NO_SUPER_IN_STATIC);
+ if (!inInstanceContext) {
+ error(node, MessageKind.NO_SUPER_IN_STATIC);
+ }
if ((ElementCategory.SUPER & allowedCategory) == 0) {
error(node, MessageKind.INVALID_USE_OF_SUPER);
}
@@ -2267,9 +2276,11 @@
// Use the erroneous element.
} else {
if ((element.kind.category & allowedCategory) == 0) {
- // TODO(ahe): Improve error message. Need UX input.
- error(node, MessageKind.GENERIC,
- {'text': "is not an expression $element"});
+ element = warnAndCreateErroneousElement(
+ node, name,
+ MessageKind.GENERIC,
+ // TODO(ahe): Improve error message. Need UX input.
+ {'text': "is not an expression $element"});
}
}
if (!Elements.isUnresolved(element) && element.isClass) {
@@ -2526,12 +2537,14 @@
// TODO(ahe): Why is this using GENERIC?
error(node.selector, MessageKind.GENERIC,
{'text': "expected an identifier"});
+ return null;
} else if (node.isSuperCall) {
if (node.isOperator) {
if (isUserDefinableOperator(name)) {
name = selector.name;
} else {
error(node.selector, MessageKind.ILLEGAL_SUPER_SEND, {'name': name});
+ return null;
}
}
if (!inInstanceContext) {
@@ -2543,6 +2556,7 @@
// for a real error message.
error(node.receiver, MessageKind.GENERIC,
{'text': "Object has no superclass"});
+ return null;
}
// TODO(johnniwinther): Ensure correct behavior if currentClass is a
// patch.
@@ -3342,6 +3356,11 @@
compiler.resolver.constantCompiler.compileNode(
node, registry.mapping);
+ if (constant == null) {
+ assert(invariant(node, compiler.compilationFailed));
+ return;
+ }
+
ConstantValue value = constant.value;
if (value.isMap) {
checkConstMapKeysDontOverrideEquals(node, value);
@@ -4907,11 +4926,20 @@
} else if (element.isTypedef) {
error(node, MessageKind.CANNOT_INSTANTIATE_TYPEDEF,
{'typedefName': name});
+ element = new ErroneousConstructorElementX(
+ MessageKind.CANNOT_INSTANTIATE_TYPEDEF,
+ {'typedefName': name}, name, resolver.enclosingElement);
} else if (element.isTypeVariable) {
error(node, MessageKind.CANNOT_INSTANTIATE_TYPE_VARIABLE,
{'typeVariableName': name});
+ element = new ErroneousConstructorElementX(
+ MessageKind.CANNOT_INSTANTIATE_TYPE_VARIABLE,
+ {'typeVariableName': name}, name, resolver.enclosingElement);
} else if (!element.isClass && !element.isPrefix) {
error(node, MessageKind.NOT_A_TYPE, {'node': name});
+ element = new ErroneousConstructorElementX(
+ MessageKind.NOT_A_TYPE, {'node': name}, name,
+ resolver.enclosingElement);
}
return element;
}
diff --git a/pkg/compiler/lib/src/resolution/resolution.dart b/pkg/compiler/lib/src/resolution/resolution.dart
index 8c1f867..3489fbd 100644
--- a/pkg/compiler/lib/src/resolution/resolution.dart
+++ b/pkg/compiler/lib/src/resolution/resolution.dart
@@ -14,30 +14,35 @@
import '../tree/tree.dart';
import '../scanner/scannerlib.dart';
import '../elements/elements.dart';
-import '../elements/modelx.dart'
- show BaseClassElementX,
- BaseFunctionElementX,
- ConstructorElementX,
- ErroneousElementX,
- FieldElementX,
- FormalElementX,
- FunctionElementX,
- FunctionSignatureX,
- InitializingFormalElementX,
- LabelDefinitionX,
- LocalFunctionElementX,
- LocalParameterElementX,
- LocalVariableElementX,
- MetadataAnnotationX,
- MixinApplicationElementX,
- ParameterElementX,
- ParameterMetadataAnnotation,
- SynthesizedConstructorElementX,
- JumpTargetX,
- TypedefElementX,
- TypeVariableElementX,
- VariableElementX,
- VariableList;
+
+import '../elements/modelx.dart' show
+ BaseClassElementX,
+ BaseFunctionElementX,
+ ConstructorElementX,
+ ErroneousConstructorElementX,
+ ErroneousElementX,
+ ErroneousFieldElementX,
+ ErroneousInitializingFormalElementX,
+ FieldElementX,
+ FormalElementX,
+ FunctionElementX,
+ FunctionSignatureX,
+ InitializingFormalElementX,
+ JumpTargetX,
+ LabelDefinitionX,
+ LocalFunctionElementX,
+ LocalParameterElementX,
+ LocalVariableElementX,
+ MetadataAnnotationX,
+ MixinApplicationElementX,
+ ParameterElementX,
+ ParameterMetadataAnnotation,
+ SynthesizedConstructorElementX,
+ TypeVariableElementX,
+ TypedefElementX,
+ VariableElementX,
+ VariableList;
+
import '../ordered_typeset.dart' show OrderedTypeSet, OrderedTypeSetBuilder;
import '../util/util.dart';
diff --git a/pkg/compiler/lib/src/resolution/signatures.dart b/pkg/compiler/lib/src/resolution/signatures.dart
index 8b31d43..8260d8b 100644
--- a/pkg/compiler/lib/src/resolution/signatures.dart
+++ b/pkg/compiler/lib/src/resolution/signatures.dart
@@ -172,13 +172,17 @@
InitializingFormalElementX createFieldParameter(Send node,
Expression initializer) {
InitializingFormalElementX element;
- if (node.receiver.asIdentifier() == null ||
- !node.receiver.asIdentifier().isThis()) {
+ Identifier receiver = node.receiver.asIdentifier();
+ if (receiver == null || !receiver.isThis()) {
error(node, MessageKind.INVALID_PARAMETER);
- } else if (!identical(enclosingElement.kind,
- ElementKind.GENERATIVE_CONSTRUCTOR)) {
- error(node, MessageKind.INITIALIZING_FORMAL_NOT_ALLOWED);
+ return new ErroneousInitializingFormalElementX(
+ getParameterName(node), enclosingElement);
} else {
+ if (!enclosingElement.isGenerativeConstructor) {
+ error(node, MessageKind.INITIALIZING_FORMAL_NOT_ALLOWED);
+ return new ErroneousInitializingFormalElementX(
+ getParameterName(node), enclosingElement);
+ }
Identifier name = getParameterName(node);
validateName(name);
Element fieldElement =
@@ -186,8 +190,12 @@
if (fieldElement == null ||
!identical(fieldElement.kind, ElementKind.FIELD)) {
error(node, MessageKind.NOT_A_FIELD, {'fieldName': name});
+ fieldElement = new ErroneousFieldElementX(
+ name, enclosingElement.enclosingClass);
} else if (!fieldElement.isInstanceMember) {
error(node, MessageKind.NOT_INSTANCE_FIELD, {'fieldName': name});
+ fieldElement = new ErroneousFieldElementX(
+ name, enclosingElement.enclosingClass);
}
element = new InitializingFormalElementX(enclosingElement,
currentDefinitions, name, initializer, fieldElement);
diff --git a/pkg/compiler/lib/src/scanner/listener.dart b/pkg/compiler/lib/src/scanner/listener.dart
index 887232e..338b5dc 100644
--- a/pkg/compiler/lib/src/scanner/listener.dart
+++ b/pkg/compiler/lib/src/scanner/listener.dart
@@ -1463,10 +1463,15 @@
memberErrors = memberErrors.tail;
}
+ /// Don't call this method. Should only be used as a last resort when there
+ /// is no feasible way to recover from a parser error.
void reportFatalError(Spannable spannable,
String message) {
- listener.reportFatalError(
+ listener.reportError(
spannable, MessageKind.GENERIC, {'text': message});
+ // Some parse errors are infeasible to recover from, so we abort
+ // compilation instead.
+ throw new CompilerCancelledException(message);
}
void reportError(Spannable spannable,
@@ -1490,6 +1495,8 @@
{bool this.throwOnFatalError: false})
: super(listener, element, null);
+ /// Don't call this method. Should only be used as a last resort when there
+ /// is no feasible way to recover from a parser error.
void reportFatalError(Spannable spannable,
String message) {
if (throwOnFatalError) {
diff --git a/pkg/compiler/lib/src/scanner/scannerlib.dart b/pkg/compiler/lib/src/scanner/scannerlib.dart
index 8177496..7543bb5 100644
--- a/pkg/compiler/lib/src/scanner/scannerlib.dart
+++ b/pkg/compiler/lib/src/scanner/scannerlib.dart
@@ -32,7 +32,7 @@
import '../tree/tree.dart';
import '../util/characters.dart';
import '../util/util.dart';
-import '../source_file.dart' show SourceFile, Utf8BytesSourceFile;
+import '../io/source_file.dart' show SourceFile, Utf8BytesSourceFile;
import 'dart:convert' show UTF8, UNICODE_BOM_CHARACTER_RUNE;
import 'dart:typed_data' show Uint8List;
diff --git a/pkg/compiler/lib/src/source_file_provider.dart b/pkg/compiler/lib/src/source_file_provider.dart
index a511fff..978156c 100644
--- a/pkg/compiler/lib/src/source_file_provider.dart
+++ b/pkg/compiler/lib/src/source_file_provider.dart
@@ -12,7 +12,7 @@
import '../compiler.dart' as api show Diagnostic, DiagnosticHandler;
import 'dart2js.dart' show AbortLeg;
import 'colors.dart' as colors;
-import 'source_file.dart';
+import 'io/source_file.dart';
import 'filenames.dart';
import 'util/uri_extras.dart';
import 'dart:typed_data';
@@ -249,7 +249,11 @@
Uri uri;
String sourceMapFileName;
bool isPrimaryOutput = false;
- if (name == '') {
+ // TODO (johnniwinther, sigurdm): Make a better interface for
+ // output-providers.
+ if (extension == "deferred_map") {
+ uri = out.resolve(name);
+ } else if (name == '') {
if (extension == 'js' || extension == 'dart') {
isPrimaryOutput = true;
uri = out;
@@ -261,7 +265,7 @@
" \"Content-Security-Policy: script-src 'self'\"");
} else if (extension == 'js.map' || extension == 'dart.map') {
uri = sourceMapOut;
- } else if (extension == 'info.html' || extension == "info.json") {
+ } else if (extension == "info.json") {
String outName = out.path.substring(out.path.lastIndexOf('/') + 1);
uri = out.resolve('$outName.$extension');
} else {
diff --git a/pkg/compiler/lib/src/ssa/ssa.dart b/pkg/compiler/lib/src/ssa/ssa.dart
index 5defd6c..e702138 100644
--- a/pkg/compiler/lib/src/ssa/ssa.dart
+++ b/pkg/compiler/lib/src/ssa/ssa.dart
@@ -24,7 +24,7 @@
import '../native/native.dart' as native;
import '../scanner/scannerlib.dart'
show PartialFunctionElement, Token, PLUS_TOKEN;
-import '../source_file.dart';
+import '../io/source_file.dart';
import '../io/source_map_builder.dart';
import '../tree/tree.dart' as ast;
import '../types/types.dart';
diff --git a/pkg/compiler/lib/src/string_validator.dart b/pkg/compiler/lib/src/string_validator.dart
index d967e44..5a7c331 100644
--- a/pkg/compiler/lib/src/string_validator.dart
+++ b/pkg/compiler/lib/src/string_validator.dart
@@ -102,7 +102,7 @@
}
void stringParseError(String message, Token token, int offset) {
- listener.reportFatalError(
+ listener.reportError(
token, MessageKind.GENERIC, {'text': "$message @ $offset"});
}
diff --git a/pkg/compiler/lib/src/tree_ir/optimization/copy_propagator.dart b/pkg/compiler/lib/src/tree_ir/optimization/copy_propagator.dart
index 0e3c61aa..a2828b6 100644
--- a/pkg/compiler/lib/src/tree_ir/optimization/copy_propagator.dart
+++ b/pkg/compiler/lib/src/tree_ir/optimization/copy_propagator.dart
@@ -224,6 +224,13 @@
return node;
}
+ Statement visitSetField(SetField node) {
+ node.next = visitStatement(node.next);
+ visitExpression(node.value);
+ visitExpression(node.object);
+ return node;
+ }
+
void visitFunctionExpression(FunctionExpression node) {
new CopyPropagator().rewrite(node.definition);
}
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 a78f8b6..c02a739 100644
--- a/pkg/compiler/lib/src/tree_ir/optimization/logical_rewriter.dart
+++ b/pkg/compiler/lib/src/tree_ir/optimization/logical_rewriter.dart
@@ -315,6 +315,27 @@
return node;
}
+ Statement visitSetField(SetField node) {
+ node.object = visitExpression(node.object);
+ node.value = visitExpression(node.value);
+ node.next = visitStatement(node.next);
+ return node;
+ }
+
+ Expression visitGetField(GetField node) {
+ node.object = visitExpression(node.object);
+ return node;
+ }
+
+ Expression visitCreateBox(CreateBox node) {
+ return node;
+ }
+
+ Expression visitCreateClosureClass(CreateClosureClass node) {
+ _rewriteList(node.arguments);
+ return node;
+ }
+
/// True if the given expression is known to evaluate to a boolean.
/// This will not recursively traverse [Conditional] expressions, but if
/// applied to the result of [visitExpression] conditionals will have been
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 182e806..c461157 100644
--- a/pkg/compiler/lib/src/tree_ir/optimization/loop_rewriter.dart
+++ b/pkg/compiler/lib/src/tree_ir/optimization/loop_rewriter.dart
@@ -127,4 +127,12 @@
void visitFunctionExpression(FunctionExpression node) {
new LoopRewriter().rewrite(node.definition);
}
+
+ Statement visitSetField(SetField node) {
+ visitExpression(node.object);
+ visitExpression(node.value);
+ node.next = visitStatement(node.next);
+ 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 a483add..91f0b75 100644
--- a/pkg/compiler/lib/src/tree_ir/optimization/statement_rewriter.dart
+++ b/pkg/compiler/lib/src/tree_ir/optimization/statement_rewriter.dart
@@ -407,6 +407,29 @@
return node;
}
+ Statement visitSetField(SetField node) {
+ node.next = visitStatement(node.next);
+ node.object = visitExpression(node.object);
+ node.value = visitExpression(node.value);
+ return node;
+ }
+
+ Expression visitGetField(GetField node) {
+ node.object = visitExpression(node.object);
+ return node;
+ }
+
+ Expression visitCreateBox(CreateBox node) {
+ return node;
+ }
+
+ Expression visitCreateClosureClass(CreateClosureClass node) {
+ for (int i = node.arguments.length - 1; i >= 0; --i) {
+ node.arguments[i] = visitExpression(node.arguments[i]);
+ }
+ return node;
+ }
+
/// If [s] and [t] are similar statements we extract their subexpressions
/// and returns a new statement of the same type using expressions combined
/// with the [combine] callback. For example:
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 d0f01f4..4cc853c 100644
--- a/pkg/compiler/lib/src/tree_ir/tree_ir_builder.dart
+++ b/pkg/compiler/lib/src/tree_ir/tree_ir_builder.dart
@@ -47,10 +47,9 @@
final dart2js.InternalErrorFunction internalError;
/// Maps variable/parameter elements to the Tree variables that represent it.
- final Map<Element, List<Variable>> element2variables =
- <Element,List<Variable>>{};
+ final Map<Local, List<Variable>> local2variables = <Local, List<Variable>>{};
- /// Like [element2variables], except for closure variables.
+ /// Like [local2variables], except for closure variables.
final Map<cps_ir.ClosureVariable, Variable> local2closure =
<cps_ir.ClosureVariable, Variable>{};
@@ -87,7 +86,7 @@
if (primitive.registerIndex == null) {
return null; // variable is unused
}
- List<Variable> variables = element2variables.putIfAbsent(primitive.hint,
+ List<Variable> variables = local2variables.putIfAbsent(primitive.hint,
() => <Variable>[]);
while (variables.length <= primitive.registerIndex) {
variables.add(new Variable(currentElement, primitive.hint));
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 947df50..4aaacef 100644
--- a/pkg/compiler/lib/src/tree_ir/tree_ir_nodes.dart
+++ b/pkg/compiler/lib/src/tree_ir/tree_ir_nodes.dart
@@ -12,6 +12,7 @@
import '../universe/universe.dart';
import '../universe/universe.dart' show Selector;
import 'optimization/optimization.dart';
+import '../closure.dart' show ClosureClassElement;
// The Tree language is the target of translation out of the CPS-based IR.
//
@@ -650,6 +651,47 @@
applyPass(Pass pass) => pass.rewriteConstructorDefinition(this);
}
+abstract class JsSpecificNode implements Node {}
+
+class CreateBox extends Expression implements JsSpecificNode {
+ accept(ExpressionVisitor visitor) => visitor.visitCreateBox(this);
+ accept1(ExpressionVisitor1 visitor, arg) => visitor.visitCreateBox(this, arg);
+}
+
+class CreateClosureClass extends Expression implements JsSpecificNode {
+ ClosureClassElement classElement;
+ List<Expression> arguments;
+
+ CreateClosureClass(this.classElement, this.arguments);
+
+ accept(ExpressionVisitor visitor) => visitor.visitCreateClosureClass(this);
+ accept1(ExpressionVisitor1 visitor, arg) {
+ return visitor.visitCreateClosureClass(this, arg);
+ }
+}
+
+class GetField extends Expression implements JsSpecificNode {
+ Expression object;
+ Element field;
+
+ GetField(this.object, this.field);
+
+ accept(ExpressionVisitor visitor) => visitor.visitGetField(this);
+ accept1(ExpressionVisitor1 visitor, arg) => visitor.visitGetField(this, arg);
+}
+
+class SetField extends Statement implements JsSpecificNode {
+ Expression object;
+ Element field;
+ Expression value;
+ Statement next;
+
+ SetField(this.object, this.field, this.value, this.next);
+
+ accept(StatementVisitor visitor) => visitor.visitSetField(this);
+ accept1(StatementVisitor1 visitor, arg) => visitor.visitSetField(this, arg);
+}
+
abstract class ExpressionVisitor<E> {
E visitExpression(Expression e) => e.accept(this);
E visitVariable(Variable node);
@@ -670,6 +712,9 @@
E visitFunctionExpression(FunctionExpression node);
E visitFieldInitializer(FieldInitializer node);
E visitSuperInitializer(SuperInitializer node);
+ E visitGetField(GetField node);
+ E visitCreateBox(CreateBox node);
+ E visitCreateClosureClass(CreateClosureClass node);
}
abstract class ExpressionVisitor1<E, A> {
@@ -692,6 +737,9 @@
E visitFunctionExpression(FunctionExpression node, A arg);
E visitFieldInitializer(FieldInitializer node, A arg);
E visitSuperInitializer(SuperInitializer node, A arg);
+ E visitGetField(GetField node, A arg);
+ E visitCreateBox(CreateBox node, A arg);
+ E visitCreateClosureClass(CreateClosureClass node, A arg);
}
abstract class StatementVisitor<S> {
@@ -706,6 +754,7 @@
S visitWhileCondition(WhileCondition node);
S visitFunctionDeclaration(FunctionDeclaration node);
S visitExpressionStatement(ExpressionStatement node);
+ S visitSetField(SetField node);
}
abstract class StatementVisitor1<S, A> {
@@ -720,6 +769,7 @@
S visitWhileCondition(WhileCondition node, A arg);
S visitFunctionDeclaration(FunctionDeclaration node, A arg);
S visitExpressionStatement(ExpressionStatement node, A arg);
+ S visitSetField(SetField node, A arg);
}
abstract class Visitor<S, E> implements ExpressionVisitor<E>,
@@ -854,4 +904,21 @@
visitSuperInitializer(SuperInitializer node) {
node.arguments.forEach(visitStatement);
}
+
+ visitGetField(GetField node) {
+ visitExpression(node.object);
+ }
+
+ visitSetField(SetField node) {
+ visitExpression(node.object);
+ visitExpression(node.value);
+ visitStatement(node.next);
+ }
+
+ visitCreateBox(CreateBox node) {
+ }
+
+ visitCreateClosureClass(CreateClosureClass node) {
+ node.arguments.forEach(visitExpression);
+ }
}
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 be1fb18..9620b57 100644
--- a/pkg/compiler/lib/src/tree_ir/tree_ir_tracer.dart
+++ b/pkg/compiler/lib/src/tree_ir/tree_ir_tracer.dart
@@ -151,6 +151,11 @@
visitStatement(node.next);
}
+ visitSetField(SetField node) {
+ _addStatement(node);
+ visitStatement(node.next);
+ }
+
}
class TreeTracer extends TracerUtil with StatementVisitor, PassMixin {
@@ -277,6 +282,16 @@
printStatement(null, 'function ${node.definition.element.name}');
}
+ visitSetField(SetField node) {
+ String object = expr(node.object);
+ String field = node.field.name;
+ String value = expr(node.value);
+ if (SubexpressionVisitor.usesInfixNotation(node.object)) {
+ object = '($object)';
+ }
+ printStatement(null, '$object.$field = $value');
+ }
+
String expr(Expression e) {
return e.accept(new SubexpressionVisitor(names));
}
@@ -368,7 +383,7 @@
return "typevar [${node.typeVariable.name}]";
}
- bool usesInfixNotation(Expression node) {
+ static bool usesInfixNotation(Expression node) {
return node is Conditional || node is LogicalOperator;
}
@@ -417,6 +432,25 @@
throw "$node should not be visited by $this";
}
+ String visitGetField(GetField node) {
+ String object = visitExpression(node.object);
+ String field = node.field.name;
+ if (usesInfixNotation(node.object)) {
+ object = '($object)';
+ }
+ return '$object.$field';
+ }
+
+ String visitCreateBox(CreateBox node) {
+ return 'CreateBox';
+ }
+
+ String visitCreateClosureClass(CreateClosureClass node) {
+ String className = node.classElement.name;
+ String arguments = node.arguments.map(visitExpression).join(', ');
+ return 'CreateClosure $className($arguments)';
+ }
+
}
/**
diff --git a/pkg/compiler/lib/src/typechecker.dart b/pkg/compiler/lib/src/typechecker.dart
index 2243375..61dbd7d 100644
--- a/pkg/compiler/lib/src/typechecker.dart
+++ b/pkg/compiler/lib/src/typechecker.dart
@@ -254,8 +254,8 @@
final ClassElement currentClass;
- InterfaceType thisType;
- InterfaceType superType;
+ DartType thisType;
+ DartType superType;
Link<DartType> cascadeTypes = const Link<DartType>();
@@ -339,6 +339,10 @@
if (currentClass != null) {
thisType = currentClass.thisType;
superType = currentClass.supertype;
+ } else {
+ // If these are used, an error should have been reported by the resolver.
+ thisType = const DynamicType();
+ superType = const DynamicType();
}
}
diff --git a/pkg/compiler/lib/src/use_unused_api.dart b/pkg/compiler/lib/src/use_unused_api.dart
index a53d722..359aa9b 100644
--- a/pkg/compiler/lib/src/use_unused_api.dart
+++ b/pkg/compiler/lib/src/use_unused_api.dart
@@ -192,8 +192,6 @@
}
useCodeBuffer(io.CodeBuffer buffer) {
- buffer.writeln();
- new io.LineColumnCodeOutput(null);
}
usedByTests() {
diff --git a/pkg/compiler/lib/src/warnings.dart b/pkg/compiler/lib/src/warnings.dart
index e1bb353..908d9cf 100644
--- a/pkg/compiler/lib/src/warnings.dart
+++ b/pkg/compiler/lib/src/warnings.dart
@@ -182,7 +182,19 @@
"Cannot resolve type '#{typeName}'.");
static const MessageKind DUPLICATE_DEFINITION = const MessageKind(
- "Duplicate definition of '#{name}'.");
+ "Duplicate definition of '#{name}'.",
+ howToFix: "Try to rename or remove this definition.",
+ examples: const ["""
+class C {
+ void f() {}
+ int get f => 1;
+}
+
+main() {
+ new C();
+}
+
+"""]);
static const MessageKind EXISTING_DEFINITION = const MessageKind(
"Existing definition of '#{name}'.");
@@ -1351,9 +1363,6 @@
"The class '#{class}' overrides 'operator==', "
"but not 'get hashCode'.");
- static const MessageKind PACKAGE_ROOT_NOT_SET = const MessageKind(
- "Cannot resolve '#{uri}'. Package root has not been set.");
-
static const MessageKind INTERNAL_LIBRARY_FROM = const MessageKind(
"Internal library '#{resolvedUri}' is not accessible from "
"'#{importingUri}'.");
diff --git a/pkg/compiler/samples/darttags/darttags.dart b/pkg/compiler/samples/darttags/darttags.dart
index c44cdf0..3a29821 100644
--- a/pkg/compiler/samples/darttags/darttags.dart
+++ b/pkg/compiler/samples/darttags/darttags.dart
@@ -42,7 +42,7 @@
import 'package:compiler/src/mirrors/mirrors_util.dart' show nameOf;
import 'package:compiler/src/filenames.dart';
-import 'package:compiler/src/source_file.dart';
+import 'package:compiler/src/io/source_file.dart';
import 'package:compiler/src/source_file_provider.dart';
import 'package:compiler/src/util/uri_extras.dart';
diff --git a/pkg/compiler/samples/jsonify/jsonify.dart b/pkg/compiler/samples/jsonify/jsonify.dart
index bb0c413..f09ad7f 100644
--- a/pkg/compiler/samples/jsonify/jsonify.dart
+++ b/pkg/compiler/samples/jsonify/jsonify.dart
@@ -16,7 +16,7 @@
show BackDoor;
import '../../lib/src/filenames.dart';
-import '../../lib/src/source_file.dart';
+import '../../lib/src/io/source_file.dart';
import '../../lib/src/source_file_provider.dart';
import '../../lib/src/util/uri_extras.dart';
@@ -46,7 +46,12 @@
Uri myLocation =
handler.provider.cwd.resolveUri(Platform.script);
- sdkRoot = myLocation.resolve(SDK_ROOT).resolve('../');
+ Uri packageRoot =
+ handler.provider.cwd.resolve(Platform.packageRoot);
+
+ Uri libraryRoot = myLocation.resolve(SDK_ROOT);
+
+ sdkRoot = libraryRoot.resolve('../');
// Get the names of public dart2js libraries.
Iterable<String> names = LIBRARIES.keys.where(isPublicDart2jsLibrary);
@@ -54,7 +59,7 @@
// Turn the names into uris by prepending dart: to them.
List<Uri> uris = names.map((String name) => Uri.parse('dart:$name')).toList();
- analyze(uris, myLocation.resolve(SDK_ROOT), null, handler.provider, handler)
+ analyze(uris, libraryRoot, packageRoot, handler.provider, handler)
.then(jsonify);
}
diff --git a/pkg/dart2js_incremental/lib/caching_compiler.dart b/pkg/dart2js_incremental/lib/caching_compiler.dart
index efc79bd..0d0a145 100644
--- a/pkg/dart2js_incremental/lib/caching_compiler.dart
+++ b/pkg/dart2js_incremental/lib/caching_compiler.dart
@@ -72,7 +72,7 @@
..needsClassSupport = true
..needsMixinSupport = true
..needsLazyInitializer = true
- ..needsArrayInitializerSupport = true;
+ ..needsStructuredMemberInfo = true;
Uri core = Uri.parse("dart:core");
return compiler.libraryLoader.loadLibrary(core).then((_) {
@@ -130,7 +130,6 @@
..globalMetadataMap.clear();
backend.emitter.nativeEmitter
- ..nativeBuffer.clear()
..nativeClasses.clear()
..nativeMethods.clear();
@@ -138,7 +137,6 @@
backend.emitter.oldEmitter
..outputBuffers.clear()
- ..deferredConstants.clear()
..isolateProperties = null
..classesCollector = null
..neededClasses.clear()
diff --git a/pkg/dart2js_incremental/lib/library_updater.dart b/pkg/dart2js_incremental/lib/library_updater.dart
index f63852f..a3017b1 100644
--- a/pkg/dart2js_incremental/lib/library_updater.dart
+++ b/pkg/dart2js_incremental/lib/library_updater.dart
@@ -38,7 +38,7 @@
Scanner,
Token;
-import 'package:compiler/src/source_file.dart' show
+import 'package:compiler/src/io/source_file.dart' show
CachingUtf8BytesSourceFile,
SourceFile,
StringSourceFile;
diff --git a/pkg/docgen/lib/src/generator.dart b/pkg/docgen/lib/src/generator.dart
index 2f1722c..7df0260 100644
--- a/pkg/docgen/lib/src/generator.dart
+++ b/pkg/docgen/lib/src/generator.dart
@@ -274,9 +274,10 @@
..showWarnings = false).diagnosticHandler;
Uri libraryUri = new Uri.file(appendSlash(libraryRoot));
Uri packageUri = null;
- if (packageRoot != null) {
- packageUri = new Uri.file(appendSlash(packageRoot));
+ if (packageRoot == null) {
+ packageRoot = Platform.packageRoot;
}
+ packageUri = new Uri.file(appendSlash(packageRoot));
return dart2js.analyze(libraries, libraryUri, packageUri,
provider.readStringFromUri, diagnosticHandler, ['--preserve-comments',
'--categories=Client,Server'])..catchError((error) {
diff --git a/pkg/pkg.status b/pkg/pkg.status
index 299dd12..440a191 100644
--- a/pkg/pkg.status
+++ b/pkg/pkg.status
@@ -92,6 +92,9 @@
[ $compiler == dart2js && $runtime == drt ]
async/test/stream_zip_test: RuntimeError, Pass # Issue 18548
+[ $compiler == dart2js && ($runtime == chrome || $runtime == ff) ]
+collection/test/unmodifiable_collection_test: Skip # Times out. Issue 22050
+
[ $runtime == vm || $runtime == d8 || $runtime == jsshell ]
third_party/angular_tests/browser_test: Skip # uses dart:html
@@ -182,7 +185,3 @@
[ $use_repository_packages ]
analyzer/test/*: PubGetError
-
-[ $runtime == vm ]
-analysis_server/test/search/element_references_test: RuntimeError # Issue 22014
-
diff --git a/runtime/bin/builtin_natives.cc b/runtime/bin/builtin_natives.cc
index b1ae667..efa61c4 100644
--- a/runtime/bin/builtin_natives.cc
+++ b/runtime/bin/builtin_natives.cc
@@ -50,6 +50,7 @@
V(File_Stat, 1) \
V(File_LastModified, 1) \
V(File_Flush, 1) \
+ V(File_Lock, 4) \
V(File_Create, 1) \
V(File_CreateLink, 2) \
V(File_LinkTarget, 1) \
diff --git a/runtime/bin/dartutils.h b/runtime/bin/dartutils.h
index b87669f..9b6557c 100644
--- a/runtime/bin/dartutils.h
+++ b/runtime/bin/dartutils.h
@@ -493,7 +493,8 @@
public:
DECLARE_COBJECT_CONSTRUCTORS(SendPort)
- Dart_Port Value() const { return cobject_->value.as_send_port; }
+ Dart_Port Value() const { return cobject_->value.as_send_port.id; }
+ Dart_Port OriginId() const { return cobject_->value.as_send_port.origin_id; }
private:
DISALLOW_COPY_AND_ASSIGN(CObjectSendPort);
diff --git a/runtime/bin/file.cc b/runtime/bin/file.cc
index a98ff3d..c4c417b 100644
--- a/runtime/bin/file.cc
+++ b/runtime/bin/file.cc
@@ -391,6 +391,35 @@
}
+void FUNCTION_NAME(File_Lock)(Dart_NativeArguments args) {
+ File* file = GetFilePointer(Dart_GetNativeArgument(args, 0));
+ ASSERT(file != NULL);
+ int64_t lock;
+ int64_t start;
+ int64_t end;
+ if (DartUtils::GetInt64Value(Dart_GetNativeArgument(args, 1), &lock) &&
+ DartUtils::GetInt64Value(Dart_GetNativeArgument(args, 2), &start) &&
+ DartUtils::GetInt64Value(Dart_GetNativeArgument(args, 3), &end)) {
+ if ((lock >= File::kLockMin) && (lock <= File::kLockMax) &&
+ (start >= 0) && (end == -1 || end > start)) {
+ if (file->Lock(static_cast<File::LockType>(lock), start, end)) {
+ Dart_SetReturnValue(args, Dart_True());
+ } else {
+ Dart_Handle err = DartUtils::NewDartOSError();
+ if (Dart_IsError(err)) Dart_PropagateError(err);
+ Dart_SetReturnValue(args, err);
+ }
+ return;
+ }
+ }
+
+ OSError os_error(-1, "Invalid argument", OSError::kUnknown);
+ Dart_Handle err = DartUtils::NewDartOSError(&os_error);
+ if (Dart_IsError(err)) Dart_PropagateError(err);
+ Dart_SetReturnValue(args, err);
+}
+
+
void FUNCTION_NAME(File_Create)(Dart_NativeArguments args) {
const char* str =
DartUtils::GetStringValue(Dart_GetNativeArgument(args, 0));
@@ -1196,5 +1225,30 @@
return CObject::IllegalArgumentError();
}
+
+CObject* File::LockRequest(const CObjectArray& request) {
+ if (request.Length() == 4 &&
+ request[0]->IsIntptr() &&
+ request[1]->IsInt32OrInt64() &&
+ request[2]->IsInt32OrInt64() &&
+ request[3]->IsInt32OrInt64()) {
+ File* file = CObjectToFilePointer(request[0]);
+ ASSERT(file != NULL);
+ if (!file->IsClosed()) {
+ int64_t lock = CObjectInt32OrInt64ToInt64(request[1]);
+ int64_t start = CObjectInt32OrInt64ToInt64(request[2]);
+ int64_t end = CObjectInt32OrInt64ToInt64(request[3]);
+ if (file->Lock(static_cast<File::LockType>(lock), start, end)) {
+ return CObject::True();
+ } else {
+ return CObject::NewOSError();
+ }
+ } else {
+ return CObject::FileClosedError();
+ }
+ }
+ return CObject::IllegalArgumentError();
+}
+
} // namespace bin
} // namespace dart
diff --git a/runtime/bin/file.h b/runtime/bin/file.h
index 990b7b2..7a8107f 100644
--- a/runtime/bin/file.h
+++ b/runtime/bin/file.h
@@ -69,6 +69,15 @@
kStatSize = 6
};
+ enum LockType {
+ // These match the constants in FileStat in file_impl.dart.
+ kLockMin = 0,
+ kLockUnlock = 0,
+ kLockShared = 1,
+ kLockExclusive = 2,
+ kLockMax = 2
+ };
+
~File();
intptr_t GetFD();
@@ -105,6 +114,9 @@
// Flush contents of file.
bool Flush();
+ // Lock range of a file.
+ bool Lock(LockType lock, int64_t start, int64_t end);
+
// Returns whether the file has been closed.
bool IsClosed();
@@ -168,6 +180,7 @@
static CObject* TypeRequest(const CObjectArray& request);
static CObject* IdenticalRequest(const CObjectArray& request);
static CObject* StatRequest(const CObjectArray& request);
+ static CObject* LockRequest(const CObjectArray& request);
private:
explicit File(FileHandle* handle) : handle_(handle) { }
diff --git a/runtime/bin/file_android.cc b/runtime/bin/file_android.cc
index 410fa0f..015fc0a 100644
--- a/runtime/bin/file_android.cc
+++ b/runtime/bin/file_android.cc
@@ -111,6 +111,32 @@
}
+bool File::Lock(File::LockType lock, int64_t start, int64_t end) {
+ ASSERT(handle_->fd() >= 0);
+ ASSERT(end == -1 || end > start);
+ struct flock fl;
+ switch (lock) {
+ case File::kLockUnlock:
+ fl.l_type = F_UNLCK;
+ break;
+ case File::kLockShared:
+ fl.l_type = F_RDLCK;
+ break;
+ case File::kLockExclusive:
+ fl.l_type = F_WRLCK;
+ break;
+ default:
+ return false;
+ }
+ fl.l_whence = SEEK_SET;
+ fl.l_start = start;
+ fl.l_len = end == -1 ? 0 : end - start;
+ // fcntl does not block, but fails if the lock cannot be acquired.
+ int rc = fcntl(handle_->fd(), F_SETLK, &fl);
+ return rc != -1;
+}
+
+
int64_t File::Length() {
ASSERT(handle_->fd() >= 0);
struct stat st;
diff --git a/runtime/bin/file_linux.cc b/runtime/bin/file_linux.cc
index c770caf..9fc4bd1 100644
--- a/runtime/bin/file_linux.cc
+++ b/runtime/bin/file_linux.cc
@@ -109,6 +109,32 @@
}
+bool File::Lock(File::LockType lock, int64_t start, int64_t end) {
+ ASSERT(handle_->fd() >= 0);
+ ASSERT(end == -1 || end > start);
+ struct flock fl;
+ switch (lock) {
+ case File::kLockUnlock:
+ fl.l_type = F_UNLCK;
+ break;
+ case File::kLockShared:
+ fl.l_type = F_RDLCK;
+ break;
+ case File::kLockExclusive:
+ fl.l_type = F_WRLCK;
+ break;
+ default:
+ return false;
+ }
+ fl.l_whence = SEEK_SET;
+ fl.l_start = start;
+ fl.l_len = end == -1 ? 0 : end - start;
+ // fcntl does not block, but fails if the lock cannot be acquired.
+ int rc = fcntl(handle_->fd(), F_SETLK, &fl);
+ return rc != -1;
+}
+
+
int64_t File::Length() {
ASSERT(handle_->fd() >= 0);
struct stat64 st;
diff --git a/runtime/bin/file_macos.cc b/runtime/bin/file_macos.cc
index 830b3c4..ce3b5f4 100644
--- a/runtime/bin/file_macos.cc
+++ b/runtime/bin/file_macos.cc
@@ -111,6 +111,32 @@
}
+bool File::Lock(File::LockType lock, int64_t start, int64_t end) {
+ ASSERT(handle_->fd() >= 0);
+ ASSERT(end == -1 || end > start);
+ struct flock fl;
+ switch (lock) {
+ case File::kLockUnlock:
+ fl.l_type = F_UNLCK;
+ break;
+ case File::kLockShared:
+ fl.l_type = F_RDLCK;
+ break;
+ case File::kLockExclusive:
+ fl.l_type = F_WRLCK;
+ break;
+ default:
+ return false;
+ }
+ fl.l_whence = SEEK_SET;
+ fl.l_start = start;
+ fl.l_len = end == -1 ? 0 : end - start;
+ // fcntl does not block, but fails if the lock cannot be acquired.
+ int rc = fcntl(handle_->fd(), F_SETLK, &fl);
+ return rc != -1;
+}
+
+
int64_t File::Length() {
ASSERT(handle_->fd() >= 0);
struct stat st;
diff --git a/runtime/bin/file_patch.dart b/runtime/bin/file_patch.dart
index ed8e3a0..2ca3e58 100644
--- a/runtime/bin/file_patch.dart
+++ b/runtime/bin/file_patch.dart
@@ -38,6 +38,8 @@
/* patch */ static _truncate(int id, int length) native "File_Truncate";
/* patch */ static _length(int id) native "File_Length";
/* patch */ static _flush(int id) native "File_Flush";
+ /* patch */ static _lock(int id, int lock, int start, int end)
+ native "File_Lock";
}
diff --git a/runtime/bin/file_win.cc b/runtime/bin/file_win.cc
index 7a4b0f0..62e7961 100644
--- a/runtime/bin/file_win.cc
+++ b/runtime/bin/file_win.cc
@@ -17,6 +17,7 @@
#include "bin/builtin.h"
#include "bin/log.h"
#include "bin/utils.h"
+#include "platform/utils.h"
namespace dart {
@@ -105,6 +106,44 @@
}
+bool File::Lock(File::LockType lock, int64_t start, int64_t end) {
+ ASSERT(handle_->fd() >= 0);
+ ASSERT(end == -1 || end > start);
+ HANDLE handle = reinterpret_cast<HANDLE>(_get_osfhandle(handle_->fd()));
+ OVERLAPPED overlapped;
+ ZeroMemory(&overlapped, sizeof(OVERLAPPED));
+
+ overlapped.Offset = Utils::Low32Bits(start);
+ overlapped.OffsetHigh = Utils::High32Bits(start);
+
+ int64_t length = end == -1 ? 0 : end - start;
+ if (length == 0) length = kMaxInt64;
+ int32_t length_low = Utils::Low32Bits(length);
+ int32_t length_high = Utils::High32Bits(length);
+
+
+ BOOL rc;
+ switch (lock) {
+ case File::kLockUnlock:
+ rc = UnlockFileEx(handle, 0, length_low, length_high, &overlapped);
+ break;
+ case File::kLockShared:
+ case File::kLockExclusive: {
+ DWORD flags = LOCKFILE_FAIL_IMMEDIATELY;
+ if (lock == File::kLockExclusive) {
+ flags |= LOCKFILE_EXCLUSIVE_LOCK;
+ }
+ rc = LockFileEx(handle, flags, 0,
+ length_low, length_high, &overlapped);
+ break;
+ }
+ default:
+ UNREACHABLE();
+ }
+ return rc;
+}
+
+
int64_t File::Length() {
ASSERT(handle_->fd() >= 0);
struct __stat64 st;
@@ -437,7 +476,7 @@
// Remove "\??\" from beginning of target.
if (target_length > 4 && wcsncmp(L"\\??\\", target, 4) == 0) {
target += 4;
- target_length -=4;
+ target_length -= 4;
}
int utf8_length = WideCharToMultiByte(CP_UTF8,
0,
diff --git a/runtime/bin/io_service.h b/runtime/bin/io_service.h
index af829eb..87810d0 100644
--- a/runtime/bin/io_service.h
+++ b/runtime/bin/io_service.h
@@ -41,18 +41,19 @@
V(File, Type, 24) \
V(File, Identical, 25) \
V(File, Stat, 26) \
- V(Socket, Lookup, 27) \
- V(Socket, ListInterfaces, 28) \
- V(Socket, ReverseLookup, 29) \
- V(Directory, Create, 30) \
- V(Directory, Delete, 31) \
- V(Directory, Exists, 32) \
- V(Directory, CreateTemp, 33) \
- V(Directory, ListStart, 34) \
- V(Directory, ListNext, 35) \
- V(Directory, ListStop, 36) \
- V(Directory, Rename, 37) \
- V(SSLFilter, ProcessFilter, 38)
+ V(File, Lock, 27) \
+ V(Socket, Lookup, 28) \
+ V(Socket, ListInterfaces, 29) \
+ V(Socket, ReverseLookup, 30) \
+ V(Directory, Create, 31) \
+ V(Directory, Delete, 32) \
+ V(Directory, Exists, 33) \
+ V(Directory, CreateTemp, 34) \
+ V(Directory, ListStart, 35) \
+ V(Directory, ListNext, 36) \
+ V(Directory, ListStop, 37) \
+ V(Directory, Rename, 38) \
+ V(SSLFilter, ProcessFilter, 39)
#define DECLARE_REQUEST(type, method, id) \
k##type##method##Request = id,
diff --git a/runtime/bin/io_service_patch.dart b/runtime/bin/io_service_patch.dart
index 612703e..d00f9f2 100644
--- a/runtime/bin/io_service_patch.dart
+++ b/runtime/bin/io_service_patch.dart
@@ -20,7 +20,14 @@
_initialize(index);
var completer = new Completer();
_messageMap[id] = completer;
- _servicePort[index].send([id, _replyToPort, request, data]);
+ try {
+ _servicePort[index].send([id, _replyToPort, request, data]);
+ } catch (error) {
+ _messageMap.remove(id).complete(error);
+ if (_messageMap.length == 0) {
+ _finalize();
+ }
+ }
return completer.future;
}
@@ -35,14 +42,18 @@
assert(data is List && data.length == 2);
_messageMap.remove(data[0]).complete(data[1]);
if (_messageMap.length == 0) {
- _id = 0;
- _receivePort.close();
- _receivePort = null;
+ _finalize();
}
};
}
}
+ static void _finalize() {
+ _id = 0;
+ _receivePort.close();
+ _receivePort = null;
+ }
+
static int _getNextId() {
if (_id == 0x7FFFFFFF) _id = 0;
return _id++;
diff --git a/runtime/include/dart_native_api.h b/runtime/include/dart_native_api.h
index 850de91..2176aad 100644
--- a/runtime/include/dart_native_api.h
+++ b/runtime/include/dart_native_api.h
@@ -57,7 +57,10 @@
intptr_t used;
struct _Dart_CObject* digits;
} as_bigint;
- Dart_Port as_send_port;
+ struct {
+ Dart_Port id;
+ Dart_Port origin_id;
+ } as_send_port;
struct {
intptr_t length;
struct _Dart_CObject** values;
diff --git a/runtime/lib/bigint.dart b/runtime/lib/bigint.dart
index 191739e..a22bb51 100644
--- a/runtime/lib/bigint.dart
+++ b/runtime/lib/bigint.dart
@@ -58,52 +58,32 @@
// Bigint constant values.
// Note: Not declared as final in order to satisfy optimizer, which expects
// constants to be in canonical form (Smi).
- static _Bigint ONE = new _Bigint()._setInt(1);
+ static _Bigint ONE = new _Bigint._fromInt(1);
// Digit conversion table for parsing.
static final Map<int, int> DIGIT_TABLE = _createDigitTable();
// Internal data structure.
+ // TODO(regis): Remove the 3 native setters below and provide a constructor
+ // taking all 3 field values, which is equivalent to making the fields final.
bool get _neg native "Bigint_getNeg";
void set _neg(bool value) native "Bigint_setNeg";
int get _used native "Bigint_getUsed";
void set _used(int value) native "Bigint_setUsed";
Uint32List get _digits native "Bigint_getDigits";
- void set _digits(Uint32List digits) {
- // The VM expects digits_ to be a Uint32List.
- assert(digits != null);
- _set_digits(digits);
- }
-
- void _set_digits(Uint32List value) native "Bigint_setDigits";
+ void set _digits(Uint32List value) native "Bigint_setDigits";
// Factory returning an instance initialized to value 0.
factory _Bigint() native "Bigint_allocate";
- // Factory returning an instance initialized to an integer value.
+ // Factory returning an instance initialized to an integer value no larger
+ // than a Mint.
factory _Bigint._fromInt(int i) {
- return new _Bigint()._setInt(i);
- }
-
- // Factory returning an instance initialized to a hex string.
- factory _Bigint._fromHex(String s) {
- return new _Bigint()._setHex(s);
- }
-
- // Factory returning an instance initialized to a double value given by its
- // components.
- factory _Bigint._fromDouble(int sign, int significand, int exponent) {
- return new _Bigint()._setDouble(sign, significand, exponent);
- }
-
- // Initialize instance to the given value no larger than a Mint.
- _Bigint _setInt(int i) {
assert(i is! _Bigint);
- _ensureLength(2);
- _used = 2;
+ bool neg;
var l, h;
if (i < 0) {
- _neg = true;
+ neg = true;
if (i == MIN_INT64) {
l = 0;
h = 0x80000000;
@@ -112,56 +92,18 @@
h = (-i) >> DIGIT_BITS;
}
} else {
- _neg = false;
+ neg = false;
l = i & DIGIT_MASK;
h = i >> DIGIT_BITS;
}
- _digits[0] = l;
- _digits[1] = h;
- _clamp();
- return this;
- }
-
- // Initialize instance to the given hex string.
- // TODO(regis): Copy Bigint::NewFromHexCString, fewer digit accesses.
- // TODO(regis): Unused.
- _Bigint _setHex(String s) {
- const int HEX_BITS = 4;
- const int HEX_DIGITS_PER_DIGIT = 8;
- var hexDigitIndex = s.length;
- _ensureLength((hexDigitIndex + HEX_DIGITS_PER_DIGIT - 1) ~/ HEX_DIGITS_PER_DIGIT);
- var bitIndex = 0;
- var digits = _digits;
- while (--hexDigitIndex >= 0) {
- var digit = DIGIT_TABLE[s.codeUnitAt(hexDigitIndex)];
- if (digit = null) {
- if (s[hexDigitIndex] == "-") _neg = true;
- continue; // Ignore invalid digits.
- }
- _neg = false; // Ignore "-" if not at index 0.
- if (bitIndex == 0) {
- digits[_used++] = digit;
- // TODO(regis): What if too many bad digits were ignored and
- // _used becomes larger than _digits.length? error or reallocate?
- } else {
- digits[_used - 1] |= digit << bitIndex;
- }
- bitIndex = (bitIndex + HEX_BITS) % DIGIT_BITS;
- }
- _clamp();
- return this;
- }
-
- // Initialize instance to the given double value.
- _Bigint _setDouble(int sign, int significand, int exponent) {
- assert(significand >= 0);
- assert(exponent >= 0);
- _setInt(significand);
- _neg = sign < 0;
- if (exponent > 0) {
- _lShiftTo(exponent, this);
- }
- return this;
+ var result = new _Bigint();
+ result._ensureLength(2);
+ result._neg = neg;
+ result._used = 2;
+ result._digits[0] = l;
+ result._digits[1] = h;
+ result._clamp();
+ return result;
}
// Create digit conversion table for parsing.
@@ -1311,7 +1253,6 @@
}
int _moduloFromInteger(int other) {
_Bigint result = new _Bigint();
- var ob = other._toBigint();
other._toBigint()._divRemTo(this, null, result);
if (result._neg) {
if (_neg) {
@@ -1387,7 +1328,7 @@
var j = e._used - 1;
var w;
var is1 = true;
- var r = new _Bigint()._setInt(1);
+ var r = new _Bigint._fromInt(1);
var r2 = new _Bigint();
var t;
var e_digits = e._digits;
diff --git a/runtime/lib/double.cc b/runtime/lib/double.cc
index 49c49a8..4173c140 100644
--- a/runtime/lib/double.cc
+++ b/runtime/lib/double.cc
@@ -79,20 +79,13 @@
args.SetAt(0, String::Handle(String::New(error_msg)));
Exceptions::ThrowByType(Exceptions::kUnsupported, args);
}
- // TODO(regis): Should we implement Bigint::NewFromDouble instead?
if ((-1.0 < val) && (val < 1.0)) {
return Smi::New(0);
}
DoubleInternals internals = DoubleInternals(val);
- if (internals.IsSpecial()) {
- const Array& exception_arguments = Array::Handle(Array::New(1));
- exception_arguments.SetAt(
- 0, Object::Handle(String::New("BigintOperations::NewFromDouble")));
- Exceptions::ThrowByType(Exceptions::kInternalError, exception_arguments);
- }
+ ASSERT(!internals.IsSpecial()); // Only Infinity and NaN are special.
uint64_t significand = internals.Significand();
intptr_t exponent = internals.Exponent();
- intptr_t sign = internals.Sign();
if (exponent <= 0) {
significand >>= -exponent;
exponent = 0;
@@ -104,37 +97,16 @@
}
// A significand has at most 63 bits (after the shift above).
// The cast to int64_t is hence safe.
+ int64_t ival = static_cast<int64_t>(significand);
+ if (internals.Sign() < 0) {
+ ival = -ival;
+ }
if (exponent == 0) {
// The double fits in a Smi or Mint.
- int64_t ival = static_cast<int64_t>(significand);
- if (sign < 0) {
- ival = -ival;
- }
return Integer::New(ival);
}
- // Lookup the factory creating a Bigint from a double.
- const Class& bigint_class =
- Class::Handle(Library::LookupCoreClass(Symbols::_Bigint()));
- ASSERT(!bigint_class.IsNull());
- const Function& factory_method = Function::Handle(
- bigint_class.LookupFactoryAllowPrivate(
- Symbols::_BigintFromDoubleFactory()));
- ASSERT(!factory_method.IsNull());
-
- // Create the argument list.
- const intptr_t kNumArgs = 4;
- const Array& args = Array::Handle(Array::New(kNumArgs));
- // Factories get type arguments.
- args.SetAt(0, Object::null_type_arguments());
- args.SetAt(1, Smi::Handle(Smi::New(sign)));
- args.SetAt(2,
- Integer::Handle(Integer::New(static_cast<int64_t>(significand))));
- args.SetAt(3, Integer::Handle(Integer::New(exponent)));
-
- // Invoke the constructor and return the new object.
Integer& result = Integer::Handle();
- result ^= DartEntry::InvokeFunction(factory_method, args);
- ASSERT(result.IsBigint());
+ result = Bigint::NewFromShiftedInt64(ival, exponent);
return result.AsValidInteger();
}
diff --git a/runtime/lib/integers.cc b/runtime/lib/integers.cc
index 257e680..d9f9e06 100644
--- a/runtime/lib/integers.cc
+++ b/runtime/lib/integers.cc
@@ -440,6 +440,7 @@
DEFINE_NATIVE_ENTRY(Bigint_setDigits, 2) {
const Bigint& bigint = Bigint::CheckedHandle(arguments->NativeArgAt(0));
const TypedData& digits = TypedData::CheckedHandle(arguments->NativeArgAt(1));
+ ASSERT(!digits.IsNull());
bigint.set_digits(digits);
return Object::null();
}
diff --git a/runtime/lib/integers.dart b/runtime/lib/integers.dart
index accda5b..48f6dc1 100644
--- a/runtime/lib/integers.dart
+++ b/runtime/lib/integers.dart
@@ -200,7 +200,7 @@
int toInt() { return this; }
double toDouble() { return new _Double.fromInteger(this); }
- _Bigint _toBigint() { return new _Bigint()._setInt(this); }
+ _Bigint _toBigint() { return new _Bigint._fromInt(this); }
num _toBigintOrDouble() { return _toBigint(); }
String toStringAsFixed(int fractionDigits) {
diff --git a/runtime/lib/isolate.cc b/runtime/lib/isolate.cc
index e7fdebc..ac7a9aa 100644
--- a/runtime/lib/isolate.cc
+++ b/runtime/lib/isolate.cc
@@ -102,7 +102,8 @@
GET_NON_NULL_NATIVE_ARGUMENT(Instance, obj, arguments->NativeArgAt(1));
uint8_t* data = NULL;
- MessageWriter writer(&data, &allocator);
+ bool can_send_any_object = (isolate->origin_id() == port.origin_id());
+ MessageWriter writer(&data, &allocator, can_send_any_object);
writer.WriteMessage(obj);
// TODO(turnidge): Throw an exception when the return value is false?
@@ -178,6 +179,11 @@
Isolate::SetCurrent(parent_isolate);
return false;
}
+ if (!state->is_spawn_uri()) {
+ // For isolates spawned using the spawnFunction semantics we set
+ // the origin_id to the origin_id of the parent isolate.
+ child_isolate->set_origin_id(parent_isolate->origin_id());
+ }
state->set_isolate(reinterpret_cast<Isolate*>(child_isolate));
Isolate::SetCurrent(parent_isolate);
@@ -185,8 +191,7 @@
}
-static RawObject* Spawn(Isolate* parent_isolate,
- IsolateSpawnState* state) {
+static void Spawn(Isolate* parent_isolate, IsolateSpawnState* state) {
// Create a new isolate.
char* error = NULL;
if (!CreateIsolate(parent_isolate, state, &error)) {
@@ -196,19 +201,13 @@
ThrowIsolateSpawnException(msg);
}
- // Create a SendPort for the new isolate.
- Isolate* spawned_isolate = state->isolate();
- const SendPort& port = SendPort::Handle(
- SendPort::New(spawned_isolate->main_port()));
-
// Start the new isolate if it is already marked as runnable.
+ Isolate* spawned_isolate = state->isolate();
MutexLocker ml(spawned_isolate->mutex());
spawned_isolate->set_spawn_state(state);
if (spawned_isolate->is_runnable()) {
spawned_isolate->Run();
}
-
- return port.raw();
}
@@ -226,8 +225,11 @@
ctx = Closure::context(closure);
ASSERT(ctx.num_variables() == 0);
#endif
- return Spawn(isolate, new IsolateSpawnState(
- port.Id(), func, message, paused.value()));
+ Spawn(isolate, new IsolateSpawnState(port.Id(),
+ func,
+ message,
+ paused.value()));
+ return Object::null();
}
}
const String& msg = String::Handle(String::New(
@@ -265,12 +267,13 @@
utf8_package_root[len] = '\0';
}
- return Spawn(isolate, new IsolateSpawnState(port.Id(),
- canonical_uri,
- utf8_package_root,
- args,
- message,
- paused.value()));
+ Spawn(isolate, new IsolateSpawnState(port.Id(),
+ canonical_uri,
+ utf8_package_root,
+ args,
+ message,
+ paused.value()));
+ return Object::null();
}
@@ -293,7 +296,7 @@
msg.SetAt(0, Smi::Handle(Smi::New(Message::kIsolateLibOOBMsg)));
uint8_t* data = NULL;
- MessageWriter writer(&data, &allocator);
+ MessageWriter writer(&data, &allocator, false);
writer.WriteMessage(msg);
PortMap::PostMessage(new Message(port.Id(),
diff --git a/runtime/lib/isolate_patch.dart b/runtime/lib/isolate_patch.dart
index d949f81..b0383d8 100644
--- a/runtime/lib/isolate_patch.dart
+++ b/runtime/lib/isolate_patch.dart
@@ -342,13 +342,13 @@
static const _KILL = 4;
- static SendPort _spawnFunction(SendPort readyPort, Function topLevelFunction,
- var message, bool paused)
+ static void _spawnFunction(SendPort readyPort, Function topLevelFunction,
+ var message, bool paused)
native "Isolate_spawnFunction";
- static SendPort _spawnUri(SendPort readyPort, String uri,
- List<String> args, var message,
- bool paused, String packageRoot)
+ static void _spawnUri(SendPort readyPort, String uri,
+ List<String> args, var message,
+ bool paused, String packageRoot)
native "Isolate_spawnUri";
static void _sendOOB(port, msg) native "Isolate_sendOOB";
diff --git a/runtime/observatory/lib/elements.dart b/runtime/observatory/lib/elements.dart
index 4c291ce..f63249d 100644
--- a/runtime/observatory/lib/elements.dart
+++ b/runtime/observatory/lib/elements.dart
@@ -10,6 +10,7 @@
export 'package:observatory/src/elements/code_view.dart';
export 'package:observatory/src/elements/context_ref.dart';
export 'package:observatory/src/elements/context_view.dart';
+export 'package:observatory/src/elements/cpu_profile.dart';
export 'package:observatory/src/elements/curly_block.dart';
export 'package:observatory/src/elements/debugger.dart';
export 'package:observatory/src/elements/error_view.dart';
@@ -25,7 +26,6 @@
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_profile.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';
diff --git a/runtime/observatory/lib/elements.html b/runtime/observatory/lib/elements.html
index 954da13..eeb782d 100644
--- a/runtime/observatory/lib/elements.html
+++ b/runtime/observatory/lib/elements.html
@@ -5,6 +5,7 @@
<link rel="import" href="src/elements/class_view.html">
<link rel="import" href="src/elements/code_ref.html">
<link rel="import" href="src/elements/code_view.html">
+<link rel="import" href="src/elements/cpu_profile.html">
<link rel="import" href="src/elements/curly_block.html">
<link rel="import" href="src/elements/debugger.html">
<link rel="import" href="src/elements/error_view.html">
diff --git a/runtime/observatory/lib/object_graph.dart b/runtime/observatory/lib/object_graph.dart
index ec6cdae..9c9ad34 100644
--- a/runtime/observatory/lib/object_graph.dart
+++ b/runtime/observatory/lib/object_graph.dart
@@ -38,6 +38,9 @@
class ObjectVertex {
// Never null. The isolate root has id 0.
final int _id;
+ bool get isRoot => _id == 0;
+ // TODO(koda): Include units in object graph metadata.
+ int addressForWordSize(int bytesPerWord) => _id * 2 * bytesPerWord;
// null for VM-heap objects.
int _shallowSize;
int get shallowSize => _shallowSize;
@@ -75,12 +78,27 @@
_addFrom(reader);
}
_computeRetainedSizes();
+ _mostRetained = new List<ObjectVertex>.from(
+ vertices.where((u) => !u.isRoot));
+ _mostRetained.sort((u, v) => v.retainedSize - u.retainedSize);
}
Iterable<ObjectVertex> get vertices => _idToVertex.values;
+ List<ObjectVertex> _mostRetained;
ObjectVertex get root => _asVertex(0);
+ Iterable<ObjectVertex> getMostRetained({int classId, int limit}) {
+ var result = _mostRetained;
+ if (classId != null) {
+ result = result.where((u) => u.classId == classId);
+ }
+ if (limit != null) {
+ result = result.take(limit);
+ }
+ return result;
+ }
+
void _computeRetainedSizes() {
// The retained size for an object is the sum of the shallow sizes of
// all its descendants in the dominator tree (including itself).
diff --git a/runtime/observatory/lib/service.dart b/runtime/observatory/lib/service.dart
index 9b66b2e..73f3f1b 100644
--- a/runtime/observatory/lib/service.dart
+++ b/runtime/observatory/lib/service.dart
@@ -9,6 +9,7 @@
import 'dart:typed_data';
import 'package:logging/logging.dart';
+import 'package:observatory/object_graph.dart';
import 'package:observatory/tracer.dart';
import 'package:observe/observe.dart';
diff --git a/runtime/observatory/lib/service_common.dart b/runtime/observatory/lib/service_common.dart
index b460174..18567b7 100644
--- a/runtime/observatory/lib/service_common.dart
+++ b/runtime/observatory/lib/service_common.dart
@@ -172,7 +172,9 @@
_webSocket.nonStringToByteData(data).then((ByteData bytes) {
// See format spec. in VMs Service::SendEvent.
int offset = 0;
- int metaSize = bytes.getUint64(offset, Endianness.BIG_ENDIAN);
+ // Dart2JS workaround (no getUint64). Limit to 4 GB metadata.
+ assert(bytes.getUint32(offset, Endianness.BIG_ENDIAN) == 0);
+ int metaSize = bytes.getUint32(offset + 4, Endianness.BIG_ENDIAN);
offset += 8;
var meta = _utf8Decoder.convert(new Uint8List.view(
bytes.buffer, bytes.offsetInBytes + offset, metaSize));
diff --git a/runtime/observatory/lib/src/app/application.dart b/runtime/observatory/lib/src/app/application.dart
index 54a0118..a280f4e 100644
--- a/runtime/observatory/lib/src/app/application.dart
+++ b/runtime/observatory/lib/src/app/application.dart
@@ -87,6 +87,9 @@
notifications.add(event);
break;
+ case '_Graph':
+ event.isolate.loadHeapSnapshot(event);
+ break;
case 'GC':
// Ignore GC events for now.
diff --git a/runtime/observatory/lib/src/app/view_model.dart b/runtime/observatory/lib/src/app/view_model.dart
index fcdb425..48d0c10 100644
--- a/runtime/observatory/lib/src/app/view_model.dart
+++ b/runtime/observatory/lib/src/app/view_model.dart
@@ -5,26 +5,26 @@
part of app;
abstract class TableTreeRow extends Observable {
- final TableTreeRow parent;
- @observable final int depth;
- @observable final List<TableTreeRow> children = new List<TableTreeRow>();
- @observable final List<String> columns = [];
static const arrowRight = '\u2192';
static const arrowDownRight = '\u21b3';
- static const showExpanderStyle = 'cursor: pointer;';
- static const hideExpanderStyle = 'visibility:hidden;';
+ // Number of pixels each subtree is indented.
+ static const subtreeIndent = 16;
- // TODO(johnmccutchan): Move expander display decisions into html once
- // tables and templates are better supported.
- @observable String expander = arrowRight;
- @observable String expanderStyle = showExpanderStyle;
+ final TableTree tree;
+ final TableTreeRow parent;
+ final int depth;
+ final List<TableTreeRow> children = new List<TableTreeRow>();
+ final List<TableCellElement> tableColumns = new List<TableCellElement>();
+ SpanElement _expander;
+ TableRowElement _tr;
+ TableRowElement get tr {
+ assert(_tr != null);
+ return _tr;
+ }
- TableTreeRow(TableTreeRow parent) :
+ TableTreeRow(this.tree, TableTreeRow parent) :
parent = parent,
depth = parent != null ? parent.depth+1 : 0 {
- if (!hasChildren()) {
- expanderStyle = hideExpanderStyle;
- }
}
bool _expanded = false;
@@ -35,48 +35,121 @@
if (changed) {
// If the state has changed, fire callbacks.
if (_expanded) {
- expander = arrowDownRight;
- onShow();
+ _onExpand();
} else {
- expander = arrowRight;
- onHide();
+ _onCollapse();
}
}
}
- bool toggle() {
+ bool expandOrCollapse() {
expanded = !expanded;
return expanded;
}
bool hasChildren();
- /// Fired when the tree row is expanded. Add children rows here.
- void onShow();
+ String _backgroundColorClassForRow() {
+ const colors = const ['rowColor0', 'rowColor1', 'rowColor2', 'rowColor3',
+ 'rowColor4', 'rowColor5', 'rowColor6', 'rowColor7',
+ 'rowColor8'];
+ var index = (depth - 1) % colors.length;
+ return colors[index];
+ }
- /// Fired when the tree row is collapsed.
- void onHide();
+ void _buildRow() {
+ _tr = new TableRowElement();
+ for (var i = 0; i < tree.columnCount; i++) {
+ var cell = _tr.insertCell(-1);
+ cell.classes.add(_backgroundColorClassForRow());
+ tableColumns.add(cell);
+ }
+ var firstColumn = tableColumns[0];
+ _expander = new SpanElement();
+ _expander.style.display = 'inline-block';
+ _expander.style.minWidth = '1.5em';
+ _expander.onClick.listen(onClick);
+ firstColumn.children.add(_expander);
+ firstColumn.style.paddingLeft = '${depth * subtreeIndent}px';
+ updateExpanderView();
+ }
+
+ void updateExpanderView() {
+ if (_expander == null) {
+ return;
+ }
+ if (!hasChildren()) {
+ _expander.style.visibility = 'hidden';
+ _expander.style.cursor = 'auto';
+ return;
+ } else {
+ _expander.style.visibility = 'visible';
+ _expander.style.cursor = 'pointer';
+ }
+ _expander.text = expanded ? arrowDownRight : arrowRight;
+ }
+
+ /// Fired when the tree row is being shown.
+ /// Populate tr and add logical children here.
+ void onShow() {
+ assert(_tr == null);
+ _buildRow();
+ }
+
+ /// Fired when the tree row is being hidden.
+ void onHide() {
+ assert(_tr != null);
+ _tr = null;
+ tableColumns.clear();
+ _expander = null;
+ }
+
+ /// Fired when the tree row is being expanded.
+ void _onExpand() {
+ for (var child in children) {
+ child.onShow();
+ child.updateExpanderView();
+ }
+ updateExpanderView();
+ }
+
+ /// Fired when the tree row is being collapsed.
+ void _onCollapse() {
+ for (var child in children) {
+ child.onHide();
+ }
+ updateExpanderView();
+ }
+
+ void onClick(Event e) {
+ tree.toggle(this);
+ e.stopPropagation();
+ }
}
class TableTree extends Observable {
- @observable final List<TableTreeRow> rows = toObservable([]);
+ final TableSectionElement tableBody;
+ final List<TableTreeRow> rows = [];
+ final int columnCount;
/// Create a table tree with column [headers].
- TableTree();
+ TableTree(this.tableBody, this.columnCount);
/// Initialize the table tree with the list of root children.
void initialize(TableTreeRow root) {
+ tableBody.children.clear();
rows.clear();
root.onShow();
rows.addAll(root.children);
+ for (var i = 0; i < rows.length; i++) {
+ rows[i].onShow();
+ tableBody.children.add(rows[i].tr);
+ }
}
- /// Toggle expansion of row at [rowIndex].
- void toggle(int rowIndex) {
- assert(rowIndex >= 0);
- assert(rowIndex < rows.length);
- var row = rows[rowIndex];
- if (row.toggle()) {
+ /// Toggle expansion of row in tree.
+ void toggle(TableTreeRow row) {
+ if (row.expandOrCollapse()) {
_expand(row);
} else {
_collapse(row);
@@ -89,6 +162,9 @@
int index = _index(row);
assert(index != -1);
rows.insertAll(index + 1, row.children);
+ for (var i = 0; i < row.children.length; i++) {
+ tableBody.children.insert(index + i + 1, row.children[i].tr);
+ }
}
void _collapse(TableTreeRow row) {
@@ -107,6 +183,9 @@
// Remove all children.
int index = _index(row);
rows.removeRange(index + 1, index + 1 + childCount);
+ for (var i = 0; i < childCount; i++) {
+ tableBody.children.removeAt(index + 1);
+ }
}
}
diff --git a/runtime/observatory/lib/src/elements/class_tree.dart b/runtime/observatory/lib/src/elements/class_tree.dart
index c9e1153..c42fb29 100644
--- a/runtime/observatory/lib/src/elements/class_tree.dart
+++ b/runtime/observatory/lib/src/elements/class_tree.dart
@@ -14,26 +14,30 @@
class ClassTreeRow extends TableTreeRow {
@reflectable final Isolate isolate;
@reflectable final Class cls;
- ClassTreeRow(this.isolate, this.cls, ClassTreeRow parent) : super(parent) {
+ ClassTreeRow(this.isolate, this.cls, TableTree tree, ClassTreeRow parent)
+ : super(tree, parent) {
assert(isolate != null);
assert(cls != null);
}
void onShow() {
- if (children.length > 0) {
- // Child rows already created.
- return;
- }
- for (var subclass in cls.subclasses) {
- if (subclass.isPatch) {
- continue;
+ super.onShow();
+ if (children.length == 0) {
+ for (var subclass in cls.subclasses) {
+ if (subclass.isPatch) {
+ continue;
+ }
+ var row = new ClassTreeRow(isolate, subclass, tree, this);
+ children.add(row);
}
- var row = new ClassTreeRow(isolate, subclass, this);
- children.add(row);
}
- }
+ var classCell = tableColumns[0];
+ // Enable expansion by clicking anywhere on the class column.
+ classCell.onClick.listen(onClick);
- void onHide() {
+ var classRef = new Element.tag('class-ref');
+ classRef.ref = cls;
+ classCell.children.add(classRef);
}
bool hasChildren() {
@@ -53,7 +57,9 @@
@override
void attached() {
super.attached();
- tree = new TableTree();
+ var tableBody = shadowRoot.querySelector('#tableTreeBody');
+ assert(tableBody != null);
+ tree = new TableTree(tableBody, 1);
if (isolate != null) {
_update(isolate.objectClass);
}
@@ -67,49 +73,16 @@
void _update(Class root) {
try {
- var rootRow = new ClassTreeRow(isolate, root, null);
- rootRow.children.add(new ClassTreeRow(isolate, root, rootRow));
+ var rootRow = new ClassTreeRow(isolate, root, tree, null);
+ rootRow.children.add(new ClassTreeRow(isolate, root, tree, rootRow));
tree.initialize(rootRow);
} catch (e, stackTrace) {
Logger.root.warning('_update', e, stackTrace);
}
// Check if we only have one node at the root and expand it.
if (tree.rows.length == 1) {
- tree.toggle(0);
+ tree.toggle(tree.rows[0]);
}
notifyPropertyChange(#tree, null, tree);
}
-
- @observable String padding(TableTreeRow row) {
- return 'padding-left: ${row.depth * 16}px;';
- }
-
- @observable String coloring(TableTreeRow row) {
- const colors = const ['rowColor0', 'rowColor1', 'rowColor2', 'rowColor3',
- 'rowColor4', 'rowColor5', 'rowColor6', 'rowColor7',
- 'rowColor8'];
- var index = (row.depth - 1) % colors.length;
- return colors[index];
- }
-
- @observable void toggleExpanded(Event e, var detail, Element target) {
- // We only want to expand a tree row if the target of the click is
- // the table cell (passed in as target) or the span containing the
- // expander symbol (#expand).
- var eventTarget = e.target;
- if ((eventTarget.id != 'expand') && (e.target != target)) {
- // Target of click was not the expander span or the table cell.
- return;
- }
- var row = target.parent;
- if (row is TableRowElement) {
- try {
- // Subtract 1 to get 0 based indexing.
- tree.toggle(row.rowIndex - 1);
- } catch (e, stackTrace) {
- Logger.root.warning('toggleExpanded', e, stackTrace);
- }
- }
- }
-
}
diff --git a/runtime/observatory/lib/src/elements/class_tree.html b/runtime/observatory/lib/src/elements/class_tree.html
index 96270d2..cbe79d1 100644
--- a/runtime/observatory/lib/src/elements/class_tree.html
+++ b/runtime/observatory/lib/src/elements/class_tree.html
@@ -97,21 +97,12 @@
<div class="content-centered">
<h1>Class Hierarchy</h1>
<table id="tableTree" class="table">
- <thead>
+ <thead id="tableTreeHeader">
<tr>
<th>Class</th>
</tr>
</thead>
- <tbody>
- <tr template repeat="{{row in tree.rows }}">
- <td on-click="{{toggleExpanded}}"
- class="{{ coloring(row) }}"
- style="{{ padding(row) }}">
- <span id="expand" style="{{ row.expanderStyle }}">{{ row.expander }}</span>
- <class-ref ref="{{ row.cls }}"></class-ref>
- </td>
- </tr>
- </tbody>
+ <tbody id="tableTreeBody"></tbody>
</table>
</div>
</template>
diff --git a/runtime/observatory/lib/src/elements/class_view.dart b/runtime/observatory/lib/src/elements/class_view.dart
index 2338362..e9e08d5 100644
--- a/runtime/observatory/lib/src/elements/class_view.dart
+++ b/runtime/observatory/lib/src/elements/class_view.dart
@@ -14,6 +14,7 @@
@published Class cls;
@observable ServiceMap instances;
@observable int retainedBytes;
+ @observable ObservableList mostRetained;
ClassViewElement.created() : super.created();
Future<ServiceObject> eval(String text) {
@@ -26,6 +27,16 @@
instances = obj;
});
}
+
+ Future<ServiceObject> retainedToplist(var limit) {
+ return cls.isolate.fetchHeapSnapshot().then(
+ (HeapSnapshot snapshot) =>
+ Future.wait(snapshot.getMostRetained(classId: cls.vmCid,
+ limit: 10))).then(
+ (List<ServiceObject> most) {
+ mostRetained = new ObservableList.from(most);
+ });
+ }
// TODO(koda): Add no-arg "calculate-link" instead of reusing "eval-link".
Future<ServiceObject> retainedSize(var dummy) {
@@ -37,6 +48,7 @@
void refresh(var done) {
instances = null;
retainedBytes = null;
+ mostRetained = null;
cls.reload().whenComplete(done);
}
diff --git a/runtime/observatory/lib/src/elements/class_view.html b/runtime/observatory/lib/src/elements/class_view.html
index f8af57d..400bc83 100644
--- a/runtime/observatory/lib/src/elements/class_view.html
+++ b/runtime/observatory/lib/src/elements/class_view.html
@@ -166,7 +166,7 @@
</div>
</div>
<div class="memberItem">
- <div class="memberName">retained size</div>
+ <div class="memberName">total retained memory size</div>
<div class="memberValue">
<template if="{{ retainedBytes == null }}">
<eval-link callback="{{ retainedSize }}"
@@ -178,6 +178,21 @@
</template>
</div>
</div>
+ <div class="memberItem">
+ <div class="memberName">toplist by retained memory</div>
+ <div class="memberValue">
+ <template if="{{ mostRetained == null }}">
+ <eval-link callback="{{ retainedToplist }}"
+ label="[find]">
+ </eval-link>
+ </template>
+ <template if="{{ mostRetained != null }}">
+ <template repeat="{{ most in mostRetained }}">
+ {{ most.retainedSize | formatSize }}<instance-ref ref="{{ most }}"></instance-ref><br>
+ </template>
+ </template>
+ </div>
+ </div>
</template>
</div>
diff --git a/runtime/observatory/lib/src/elements/isolate_profile.dart b/runtime/observatory/lib/src/elements/cpu_profile.dart
similarity index 63%
rename from runtime/observatory/lib/src/elements/isolate_profile.dart
rename to runtime/observatory/lib/src/elements/cpu_profile.dart
index 4122d96..44b9e0b 100644
--- a/runtime/observatory/lib/src/elements/isolate_profile.dart
+++ b/runtime/observatory/lib/src/elements/cpu_profile.dart
@@ -2,13 +2,14 @@
// 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_profile_element;
+library cpu_profile_element;
import 'dart:html';
import 'observatory_element.dart';
import 'package:logging/logging.dart';
import 'package:observatory/service.dart';
import 'package:observatory/app.dart';
+import 'package:observatory/elements.dart';
import 'package:polymer/polymer.dart';
class ProfileCodeTrieNodeTreeRow extends TableTreeRow {
@@ -24,8 +25,9 @@
@reflectable String tipTime = '';
ProfileCodeTrieNodeTreeRow(this.profile, this.root, this.node,
+ TableTree tree,
ProfileCodeTrieNodeTreeRow parent)
- : super(parent) {
+ : super(tree, parent) {
assert(root != null);
assert(node != null);
tipTicks = '${node.count}';
@@ -55,8 +57,6 @@
}
tipExclusive = Utils.formatPercent(node.code.exclusiveTicks, root.count);
}
- columns.add(tipParent);
- columns.add(tipExclusive);
}
bool shouldDisplayChild(CodeTrieNode childNode, double threshold) {
@@ -64,22 +64,71 @@
((childNode.code.exclusiveTicks / root.count) > threshold);
}
- void onShow() {
- var threshold = profile['threshold'];
- if (children.length > 0) {
- // Child rows already created.
- return;
- }
- for (var childNode in node.children) {
- if (!shouldDisplayChild(childNode, threshold)) {
- continue;
- }
- var row = new ProfileCodeTrieNodeTreeRow(profile, root, childNode, this);
- children.add(row);
- }
+ void _buildTooltip(DivElement memberList, Map<String, String> items) {
+ items.forEach((k, v) {
+ var item = new DivElement();
+ item.classes.add('memberItem');
+ var name = new DivElement();
+ name.classes.add('memberName');
+ name.classes.add('white');
+ name.text = k;
+ var value = new DivElement();
+ value.classes.add('memberValue');
+ value.classes.add('white');
+ value.text = v;
+ item.children.add(name);
+ item.children.add(value);
+ memberList.children.add(item);
+ });
}
- void onHide() {
+ void onShow() {
+ super.onShow();
+ if (children.length == 0) {
+ var threshold = profile['threshold'];
+ for (var childNode in node.children) {
+ if (!shouldDisplayChild(childNode, threshold)) {
+ continue;
+ }
+ var row =
+ new ProfileCodeTrieNodeTreeRow(profile, root, childNode, tree, this);
+ children.add(row);
+ }
+ }
+ var row = tr;
+
+ var methodCell = tableColumns[0];
+ // Enable expansion by clicking anywhere on the method column.
+ methodCell.onClick.listen(onClick);
+
+ // Insert the parent percentage
+ var parentPercent = new DivElement();
+ parentPercent.style.position = 'relative';
+ parentPercent.style.display = 'inline';
+ parentPercent.text = tipParent;
+ methodCell.children.add(parentPercent);
+
+ var codeRef = new Element.tag('code-ref');
+ codeRef.ref = code;
+ methodCell.children.add(codeRef);
+
+ var selfCell = tableColumns[1];
+ selfCell.style.position = 'relative';
+ selfCell.text = tipExclusive;
+
+ var tooltipDiv = new DivElement();
+ tooltipDiv.classes.add('tooltip');
+
+ var memberListDiv = new DivElement();
+ memberListDiv.classes.add('memberList');
+ tooltipDiv.children.add(memberListDiv);
+ _buildTooltip(memberListDiv, {
+ 'Kind' : tipKind,
+ 'Percent of Parent' : tipParent,
+ 'Sample Count' : tipTicks,
+ 'Approximate Execution Time': tipTime,
+ });
+ selfCell.children.add(tooltipDiv);
}
bool hasChildren() {
@@ -87,10 +136,10 @@
}
}
-/// Displays an IsolateProfile
-@CustomTag('isolate-profile')
-class IsolateProfileElement extends ObservatoryElement {
- IsolateProfileElement.created() : super.created();
+/// Displays a CpuProfile
+@CustomTag('cpu-profile')
+class CpuProfileElement extends ObservatoryElement {
+ CpuProfileElement.created() : super.created();
@published ServiceMap profile;
@observable bool hideTagsChecked;
@observable String sampleCount = '';
@@ -130,7 +179,9 @@
@override
void attached() {
super.attached();
- tree = new TableTree();
+ var tableBody = shadowRoot.querySelector('#tableTreeBody');
+ assert(tableBody != null);
+ tree = new TableTree(tableBody, 2);
_update();
}
@@ -161,13 +212,15 @@
}
try {
tree.initialize(
- new ProfileCodeTrieNodeTreeRow(profile, root, root, null));
+ new ProfileCodeTrieNodeTreeRow(profile, root, root, tree, null));
} catch (e, stackTrace) {
+ print(e);
+ print(stackTrace);
Logger.root.warning('_buildStackTree', e, stackTrace);
}
// Check if we only have one node at the root and expand it.
if (tree.rows.length == 1) {
- tree.toggle(0);
+ tree.toggle(tree.rows[0]);
}
notifyPropertyChange(#tree, null, tree);
}
@@ -175,36 +228,4 @@
void _buildTree() {
_buildStackTree();
}
-
- @observable String padding(TableTreeRow row) {
- return 'padding-left: ${row.depth * 16}px;';
- }
-
- @observable String coloring(TableTreeRow row) {
- const colors = const ['rowColor0', 'rowColor1', 'rowColor2', 'rowColor3',
- 'rowColor4', 'rowColor5', 'rowColor6', 'rowColor7',
- 'rowColor8'];
- var index = (row.depth - 1) % colors.length;
- return colors[index];
- }
-
- @observable void toggleExpanded(Event e, var detail, Element target) {
- // We only want to expand a tree row if the target of the click is
- // the table cell (passed in as target) or the span containing the
- // expander symbol (#expand).
- var eventTarget = e.target;
- if ((eventTarget.id != 'expand') && (e.target != target)) {
- // Target of click was not the expander span or the table cell.
- return;
- }
- var row = target.parent;
- if (row is TableRowElement) {
- // Subtract 1 to get 0 based indexing.
- try {
- tree.toggle(row.rowIndex - 1);
- } catch (e, stackTrace) {
- Logger.root.warning('toggleExpanded', e, stackTrace);
- }
- }
- }
}
diff --git a/runtime/observatory/lib/src/elements/isolate_profile.html b/runtime/observatory/lib/src/elements/cpu_profile.html
similarity index 71%
rename from runtime/observatory/lib/src/elements/isolate_profile.html
rename to runtime/observatory/lib/src/elements/cpu_profile.html
index f7fb0b1..7955cc1 100644
--- a/runtime/observatory/lib/src/elements/isolate_profile.html
+++ b/runtime/observatory/lib/src/elements/cpu_profile.html
@@ -5,7 +5,7 @@
<link rel="import" href="observatory_element.html">
<link rel="import" href="sliding_checkbox.html">
-<polymer-element name="isolate-profile" extends="observatory-element">
+<polymer-element name="cpu-profile" extends="observatory-element">
<template>
<link rel="stylesheet" href="css/shared.css">
<nav-bar>
@@ -142,51 +142,17 @@
</div>
<hr>
<table id="tableTree" class="table">
- <thead>
+ <thead id="tableTreeheader">
<tr>
<th>Method</th>
<th>Self</th>
</tr>
</thead>
- <tbody>
- <tr template repeat="{{row in tree.rows }}" style="{{}}">
- <td on-click="{{toggleExpanded}}"
- class="{{ coloring(row) }}"
- style="{{ padding(row) }}">
- <span id="expand" style="{{ row.expanderStyle }}">{{ row.expander }}</span>
- <div style="position: relative;display: inline">
- {{row.columns[0]}}
- </div>
- <code-ref ref="{{ row.code }}"></code-ref>
- </td>
- <td class="{{ coloring(row) }}" style="position: relative">
- {{row.columns[1]}}
- <div class="tooltip">
- <div class="memberList">
- <div class="memberItem">
- <div class="memberName white">Kind</div>
- <div class="memberValue white">{{ row.tipKind }}</div>
- </div>
- <div class="memberItem">
- <div class="memberName white">Percent of Parent</div>
- <div class="memberValue white">{{ row.tipParent }}</div>
- </div>
- <div class="memberItem">
- <div class="memberName white">Sample Count</div>
- <div class="memberValue white">{{ row.tipTicks }} ({{ row.tipExclusive }})</div>
- </div>
- <div class="memberItem">
- <div class="memberName white">Approximate Execution Time</div>
- <div class="memberValue white">{{ row.tipTime }}</div>
- </div>
- </div>
- </div>
- </td>
- </tr>
+ <tbody id="tableTreeBody">
</tbody>
</table>
</div>
</template>
</polymer-element>
-<script type="application/dart" src="isolate_profile.dart"></script>
+<script type="application/dart" src="cpu_profile.dart"></script>
diff --git a/runtime/observatory/lib/src/elements/heap_profile.dart b/runtime/observatory/lib/src/elements/heap_profile.dart
index 1171fb6..a0adf9e 100644
--- a/runtime/observatory/lib/src/elements/heap_profile.dart
+++ b/runtime/observatory/lib/src/elements/heap_profile.dart
@@ -99,7 +99,7 @@
@override
void detached() {
- _subscription.cancel((){});
+ _subscription.cancel();
super.detached();
}
diff --git a/runtime/observatory/lib/src/elements/observatory_element.dart b/runtime/observatory/lib/src/elements/observatory_element.dart
index 43a4b5b..b31ac94 100644
--- a/runtime/observatory/lib/src/elements/observatory_element.dart
+++ b/runtime/observatory/lib/src/elements/observatory_element.dart
@@ -88,6 +88,7 @@
/// within the application using the [LocationManager].
void goto(MouseEvent event, var detail, Element target) {
app.locationManager.onGoto(event, detail, target);
+ event.stopPropagation();
}
/// Create a link that can be consumed by [goto].
diff --git a/runtime/observatory/lib/src/elements/service_view.dart b/runtime/observatory/lib/src/elements/service_view.dart
index 161758e..98ed51c 100644
--- a/runtime/observatory/lib/src/elements/service_view.dart
+++ b/runtime/observatory/lib/src/elements/service_view.dart
@@ -121,7 +121,7 @@
element.process = object;
return element;
case 'Profile':
- IsolateProfileElement element = new Element.tag('isolate-profile');
+ CpuProfileElement element = new Element.tag('cpu-profile');
element.profile = object;
return element;
case 'RandomAccessFileList':
diff --git a/runtime/observatory/lib/src/elements/service_view.html b/runtime/observatory/lib/src/elements/service_view.html
index 8d385d4..02a3ff8 100644
--- a/runtime/observatory/lib/src/elements/service_view.html
+++ b/runtime/observatory/lib/src/elements/service_view.html
@@ -3,13 +3,13 @@
<link rel="import" href="class_view.html">
<link rel="import" href="code_view.html">
<link rel="import" href="context_view.html">
+<link rel="import" href="cpu_profile.html">
<link rel="import" href="error_view.html">
<link rel="import" href="field_view.html">
<link rel="import" href="function_view.html">
<link rel="import" href="heap_map.html">
<link rel="import" href="heap_profile.html">
<link rel="import" href="instance_view.html">
-<link rel="import" href="isolate_profile.html">
<link rel="import" href="library_view.html">
<link rel="import" href="observatory_element.html">
<link rel="import" href="script_view.html">
diff --git a/runtime/observatory/lib/src/service/object.dart b/runtime/observatory/lib/src/service/object.dart
index 3c8f3b7..4a0842d 100644
--- a/runtime/observatory/lib/src/service/object.dart
+++ b/runtime/observatory/lib/src/service/object.dart
@@ -693,6 +693,32 @@
}
}
+class HeapSnapshot {
+ final ObjectGraph graph;
+ final DateTime timeStamp;
+ final Isolate isolate;
+
+ HeapSnapshot(this.isolate, ByteData data) :
+ graph = new ObjectGraph(new ReadStream(data)),
+ timeStamp = new DateTime.now() {
+ }
+
+ List<Future<ServiceObject>> getMostRetained({int classId, int limit}) {
+ var result = [];
+ for (var v in graph.getMostRetained(classId: classId, limit: limit)) {
+ var address = v.addressForWordSize(isolate.vm.architectureBits ~/ 8);
+ result.add(isolate.get(
+ 'address/${address.toRadixString(16)}?ref=true').then((obj) {
+ obj.retainedSize = v.retainedSize;
+ return new Future(() => obj);
+ }));
+ }
+ return result;
+ }
+
+
+}
+
/// State for a running isolate.
class Isolate extends ServiceObjectOwner with Coverage {
@reflectable VM get vm => owner;
@@ -854,6 +880,21 @@
@observable String fileAndLine;
@observable DartError error;
+ @observable HeapSnapshot latestSnapshot;
+ Completer<HeapSnapshot> _snapshotFetch;
+
+ void loadHeapSnapshot(ServiceEvent event) {
+ latestSnapshot = new HeapSnapshot(this, event.data);
+ _snapshotFetch.complete(latestSnapshot);
+ }
+
+ Future<HeapSnapshot> fetchHeapSnapshot() {
+ if (_snapshotFetch == null || _snapshotFetch.isCompleted) {
+ get('graph');
+ _snapshotFetch = new Completer<HeapSnapshot>();
+ }
+ return _snapshotFetch.future;
+ }
void updateHeapsFromMap(ObservableMap map) {
newSpace.update(map['new']);
@@ -1541,6 +1582,7 @@
class Instance extends ServiceObject {
@observable Class clazz;
@observable int size;
+ @observable int retainedSize;
@observable String valueAsString; // If primitive.
@observable bool valueAsStringIsTruncated;
@observable ServiceFunction closureFunc; // If a closure.
diff --git a/runtime/observatory/observatory.gypi b/runtime/observatory/observatory.gypi
index 426920d..7cc201d 100644
--- a/runtime/observatory/observatory.gypi
+++ b/runtime/observatory/observatory.gypi
@@ -42,6 +42,8 @@
'dependencies': [
'dart_bootstrap#host',
'fetch_observatory_deps#host',
+ # We use packages for building
+ '../pkg/pkg.gyp:pkg_packages#target',
],
'toolsets': ['host'],
'sources': [
@@ -78,6 +80,8 @@
'lib/src/elements/context_ref.html',
'lib/src/elements/context_view.dart',
'lib/src/elements/context_view.html',
+ 'lib/src/elements/cpu_profile.dart',
+ 'lib/src/elements/cpu_profile.html',
'lib/src/elements/curly_block.dart',
'lib/src/elements/curly_block.html',
'lib/src/elements/debugger.dart',
@@ -112,8 +116,6 @@
'lib/src/elements/instance_view.html',
'lib/src/elements/io_view.dart',
'lib/src/elements/io_view.html',
- 'lib/src/elements/isolate_profile.dart',
- 'lib/src/elements/isolate_profile.html',
'lib/src/elements/isolate_ref.dart',
'lib/src/elements/isolate_ref.html',
'lib/src/elements/isolate_summary.dart',
@@ -175,6 +177,7 @@
'action_name': 'pub_build_observatory',
'inputs': [
'../../tools/observatory_tool.py',
+ '<(SHARED_INTERMEDIATE_DIR)/packages.stamp',
'<@(_sources)',
],
'outputs': [
@@ -222,4 +225,4 @@
],
},
],
-}
\ No newline at end of file
+}
diff --git a/runtime/platform/assert.h b/runtime/platform/assert.h
index f1b2547..7aee9c3 100644
--- a/runtime/platform/assert.h
+++ b/runtime/platform/assert.h
@@ -65,10 +65,10 @@
template<typename E, typename A>
void GreaterEqual(const E& left, const A& right);
+#endif
template<typename T>
- void NotNull(const T p);
-#endif
+ T NotNull(const T p);
private:
const char* const file_;
@@ -215,14 +215,15 @@
std::string es = ess.str(), as = ass.str();
Fail("expected: %s >= %s", es.c_str(), as.c_str());
}
+#endif
template<typename T>
-void DynamicAssertionHelper::NotNull(const T p) {
- if (p != NULL) return;
+T DynamicAssertionHelper::NotNull(const T p) {
+ if (p != NULL) return p;
Fail("expected: not NULL, found NULL");
+ return NULL;
}
-#endif
} // namespace dart
@@ -258,6 +259,11 @@
// mode.
#define DEBUG_ASSERT(cond) ASSERT(cond)
+// Returns 'ptr'; useful for initializer lists:
+// class Foo { Foo(int* ptr) : ptr_(ASSERT_NOTNULL(ptr)) ...
+#define ASSERT_NOTNULL(ptr) \
+ dart::Assert(__FILE__, __LINE__).NotNull((ptr))
+
#else // if defined(DEBUG)
// In order to avoid variable unused warnings for code that only uses
@@ -267,6 +273,8 @@
#define DEBUG_ASSERT(cond)
+#define ASSERT_NOTNULL(ptr) (ptr)
+
#endif // if defined(DEBUG)
diff --git a/runtime/tests/vm/vm.status b/runtime/tests/vm/vm.status
index 01ab6c1..d2d66d6 100644
--- a/runtime/tests/vm/vm.status
+++ b/runtime/tests/vm/vm.status
@@ -75,7 +75,6 @@
[ $arch == mips ]
cc/StaticNonNullSumCallCodegen: Crash, Pass # Issue 17440
-cc/Sdc1Ldc1: Crash # Issue 20182
cc/JSON_JSONStream_Options: Crash, Pass # Issue 19328
[ $arch == mips && $mode == debug ]
diff --git a/runtime/vm/assembler_ia32.cc b/runtime/vm/assembler_ia32.cc
index adc9505..c060bbf 100644
--- a/runtime/vm/assembler_ia32.cc
+++ b/runtime/vm/assembler_ia32.cc
@@ -1457,6 +1457,15 @@
}
+void Assembler::testb(const Address& address, const Immediate& imm) {
+ ASSERT(imm.is_int8());
+ AssemblerBuffer::EnsureCapacity ensured(&buffer_);
+ EmitUint8(0xF6);
+ EmitOperand(0, address);
+ EmitUint8(imm.value() & 0xFF);
+}
+
+
void Assembler::andl(Register dst, Register src) {
AssemblerBuffer::EnsureCapacity ensured(&buffer_);
EmitUint8(0x23);
@@ -2212,7 +2221,21 @@
}
-void Assembler::VerifyHeapWord(const Address& address) {
+void Assembler::VerifyHeapWord(const Address& address,
+ FieldContent old_content) {
+#if defined(DEBUG)
+ switch (old_content) {
+ case kEmptyOrSmiOrNull:
+ VerifyUninitialized(address);
+ break;
+ case kHeapObjectOrSmi:
+ VerifyObjectOrSmi(address);
+ break;
+ case kOnlySmi:
+ VerifySmi(address);
+ break;
+ }
+#endif // DEBUG
if (VerifiedMemory::enabled()) {
Register addr_reg = EDX;
Register value = EBX;
@@ -2233,8 +2256,10 @@
}
-void Assembler::VerifiedWrite(const Address& dest, Register value) {
- VerifyHeapWord(dest);
+void Assembler::VerifiedWrite(const Address& dest,
+ Register value,
+ FieldContent old_content) {
+ VerifyHeapWord(dest, old_content);
movl(dest, value);
if (VerifiedMemory::enabled()) {
Register temp = (value == EDX) ? ECX : EDX;
@@ -2246,13 +2271,55 @@
}
+#if defined(DEBUG)
+void Assembler::VerifyObjectOrSmi(const Address& dest) {
+ Label ok;
+ testb(dest, Immediate(kHeapObjectTag));
+ j(ZERO, &ok, Assembler::kNearJump);
+ // Non-smi case: Verify object pointer is word-aligned when untagged.
+ COMPILE_ASSERT(kHeapObjectTag == 1);
+ testb(dest, Immediate((kWordSize - 1) - kHeapObjectTag));
+ j(ZERO, &ok, Assembler::kNearJump);
+ Stop("Expected heap object or Smi");
+ Bind(&ok);
+}
+
+
+void Assembler::VerifyUninitialized(const Address& dest) {
+ Label ok;
+ testb(dest, Immediate(kHeapObjectTag));
+ j(ZERO, &ok, Assembler::kNearJump);
+ // Non-smi case: Check for the special zap word or null.
+#if defined(DEBUG)
+ cmpl(dest, Immediate(Heap::kZap32Bits));
+ j(EQUAL, &ok, Assembler::kNearJump);
+#else
+#error Only supported in DEBUG mode
+#endif
+ cmpl(dest, Immediate(reinterpret_cast<uint32_t>(Object::null())));
+ j(EQUAL, &ok, Assembler::kNearJump);
+ Stop("Expected zapped, Smi or null");
+ Bind(&ok);
+}
+
+
+void Assembler::VerifySmi(const Address& dest, const char* stop_msg) {
+ Label done;
+ testb(dest, Immediate(kHeapObjectTag));
+ j(ZERO, &done, Assembler::kNearJump);
+ Stop(stop_msg);
+ Bind(&done);
+}
+#endif // defined(DEBUG)
+
+
// Destroys the value register.
void Assembler::StoreIntoObject(Register object,
const Address& dest,
Register value,
bool can_value_be_smi) {
ASSERT(object != value);
- VerifiedWrite(dest, value);
+ VerifiedWrite(dest, value, kHeapObjectOrSmi);
Label done;
if (can_value_be_smi) {
StoreIntoObjectFilter(object, value, &done);
@@ -2277,8 +2344,9 @@
void Assembler::StoreIntoObjectNoBarrier(Register object,
const Address& dest,
- Register value) {
- VerifiedWrite(dest, value);
+ Register value,
+ FieldContent old_content) {
+ VerifiedWrite(dest, value, old_content);
#if defined(DEBUG)
Label done;
pushl(value);
@@ -2304,8 +2372,9 @@
void Assembler::StoreIntoObjectNoBarrier(Register object,
const Address& dest,
- const Object& value) {
- VerifyHeapWord(dest);
+ const Object& value,
+ FieldContent old_content) {
+ VerifyHeapWord(dest, old_content);
if (value.IsSmi() || value.InVMHeap()) {
Immediate imm_value(reinterpret_cast<int32_t>(value.raw()));
movl(dest, imm_value);
@@ -2331,20 +2400,19 @@
void Assembler::StoreIntoSmiField(const Address& dest, Register value) {
- VerifiedWrite(dest, value);
#if defined(DEBUG)
Label done;
testl(value, Immediate(kHeapObjectTag));
j(ZERO, &done);
- Stop("Smi expected");
+ Stop("New value must be Smi.");
Bind(&done);
#endif // defined(DEBUG)
+ VerifiedWrite(dest, value, kOnlySmi);
}
-void Assembler::ZeroSmiField(const Address& dest) {
- // TODO(koda): Add VerifySmi once we distinguish initalization.
- VerifyHeapWord(dest);
+void Assembler::ZeroInitSmiField(const Address& dest) {
+ VerifyHeapWord(dest, kEmptyOrSmiOrNull);
Immediate zero(Smi::RawValue(0));
movl(dest, zero);
if (VerifiedMemory::enabled()) {
@@ -2360,8 +2428,7 @@
void Assembler::IncrementSmiField(const Address& dest, int32_t increment) {
// Note: FlowGraphCompiler::EdgeCounterIncrementSizeInBytes depends on
// the length of this instruction sequence.
- // TODO(koda): Add VerifySmi once we distinguish initalization.
- VerifyHeapWord(dest);
+ VerifyHeapWord(dest, kOnlySmi);
Immediate inc_imm(Smi::RawValue(increment));
addl(dest, inc_imm);
if (VerifiedMemory::enabled()) {
diff --git a/runtime/vm/assembler_ia32.h b/runtime/vm/assembler_ia32.h
index 23ea4a2..a0d03de 100644
--- a/runtime/vm/assembler_ia32.h
+++ b/runtime/vm/assembler_ia32.h
@@ -536,6 +536,7 @@
void testl(Register reg1, Register reg2);
void testl(Register reg, const Immediate& imm);
+ void testb(const Address& address, const Immediate& imm);
void andl(Register dst, const Immediate& imm);
void andl(Register dst, Register src);
@@ -668,6 +669,14 @@
void CompareObject(Register reg, const Object& object);
void LoadDoubleConstant(XmmRegister dst, double value);
+ // When storing into a heap object field, knowledge of the previous content
+ // is expressed through these constants.
+ enum FieldContent {
+ kEmptyOrSmiOrNull, // Empty = garbage/zapped in release/debug mode.
+ kHeapObjectOrSmi,
+ kOnlySmi,
+ };
+
void StoreIntoObject(Register object, // Object we are storing into.
const Address& dest, // Where we are storing into.
Register value, // Value we are storing.
@@ -675,14 +684,26 @@
void StoreIntoObjectNoBarrier(Register object,
const Address& dest,
- Register value);
+ Register value,
+ FieldContent old_content = kHeapObjectOrSmi);
+ void InitializeFieldNoBarrier(Register object,
+ const Address& dest,
+ Register value) {
+ return StoreIntoObjectNoBarrier(object, dest, value, kEmptyOrSmiOrNull);
+ }
void StoreIntoObjectNoBarrier(Register object,
const Address& dest,
- const Object& value);
+ const Object& value,
+ FieldContent old_content = kHeapObjectOrSmi);
+ void InitializeFieldNoBarrier(Register object,
+ const Address& dest,
+ const Object& value) {
+ return StoreIntoObjectNoBarrier(object, dest, value, kEmptyOrSmiOrNull);
+ }
// Stores a Smi value into a heap object field that always contains a Smi.
void StoreIntoSmiField(const Address& dest, Register value);
- void ZeroSmiField(const Address& dest);
+ void ZeroInitSmiField(const Address& dest);
// Increments a Smi field. Leaves flags in same state as an 'addl'.
void IncrementSmiField(const Address& dest, int32_t increment);
@@ -945,11 +966,17 @@
void StoreIntoObjectFilterNoSmi(Register object,
Register value,
Label* no_update);
-
- // Analogous to VerifiedMemory::Verify(address, kWordSize).
- void VerifyHeapWord(const Address& address);
- // Analogous to VerifiedMemory::Write.
- void VerifiedWrite(const Address& dest, Register value);
+#if defined(DEBUG)
+ void VerifyUninitialized(const Address& address);
+ void VerifyObjectOrSmi(const Address& address);
+ void VerifySmi(const Address& address, const char* stop_msg = "Expected Smi");
+#endif // DEBUG
+ // Like VerifiedMemory::Verify(address, kWordSize) and ::Write, but also,
+ // in DEBUG mode, verifies that 'address' has content of type 'old_content'.
+ void VerifyHeapWord(const Address& address, FieldContent old_content);
+ void VerifiedWrite(const Address& dest,
+ Register value,
+ FieldContent old_content);
void UnverifiedStoreOldObject(const Address& dest, const Object& value);
int32_t jit_cookie();
diff --git a/runtime/vm/assembler_ia32_test.cc b/runtime/vm/assembler_ia32_test.cc
index b260e17..6492625 100644
--- a/runtime/vm/assembler_ia32_test.cc
+++ b/runtime/vm/assembler_ia32_test.cc
@@ -198,6 +198,27 @@
}
+ASSEMBLER_TEST_GENERATE(Testb, assembler) {
+ __ movl(EAX, Immediate(1));
+ __ movl(ECX, Immediate(0));
+ __ pushl(Immediate(0xffffff11));
+ __ testb(Address(ESP, 0), Immediate(0x10));
+ // Fail if zero flag set.
+ __ cmove(EAX, ECX);
+ __ testb(Address(ESP, 0), Immediate(0x20));
+ // Fail if zero flag not set.
+ __ cmovne(EAX, ECX);
+ __ popl(ECX);
+ __ ret();
+}
+
+
+ASSEMBLER_TEST_RUN(Testb, test) {
+ typedef int (*TestbCode)();
+ EXPECT_EQ(1, reinterpret_cast<TestbCode>(test->entry())());
+}
+
+
ASSEMBLER_TEST_GENERATE(Increment, assembler) {
__ movl(EAX, Immediate(0));
__ pushl(EAX);
diff --git a/runtime/vm/assembler_mips_test.cc b/runtime/vm/assembler_mips_test.cc
index b49b806..d382503 100644
--- a/runtime/vm/assembler_mips_test.cc
+++ b/runtime/vm/assembler_mips_test.cc
@@ -1640,12 +1640,13 @@
ASSEMBLER_TEST_GENERATE(Sdc1Ldc1, assembler) {
- __ AddImmediate(SP, -8 * kWordSize);
- __ LoadImmediate(T1, ~(8 - 1));
- __ and_(T0, SP, T1); // Need 8 byte alignment.
+ __ mov(T0, SP);
+ __ AddImmediate(SP, -3 * kWordSize);
+ __ AndImmediate(SP, SP, ~(8 - 1)); // Align SP by 8 bytes.
__ LoadImmediate(D1, 1.0);
- __ sdc1(D1, Address(T0));
- __ ldc1(D0, Address(T0));
+ __ sdc1(D1, Address(SP));
+ __ ldc1(D0, Address(SP));
+ __ mov(SP, T0);
__ Ret();
}
diff --git a/runtime/vm/assembler_x64.cc b/runtime/vm/assembler_x64.cc
index f9b1aec..169db47 100644
--- a/runtime/vm/assembler_x64.cc
+++ b/runtime/vm/assembler_x64.cc
@@ -151,8 +151,9 @@
void Assembler::CallPatchable(const ExternalLabel* label) {
ASSERT(allow_constant_pool());
intptr_t call_start = buffer_.GetPosition();
- LoadExternalLabel(TMP, label, kPatchable, PP);
- call(TMP);
+ const int32_t offset =
+ Array::element_offset(FindExternalLabel(label, kPatchable));
+ call(Address::AddressBaseImm32(PP, offset - kHeapObjectTag));
ASSERT((buffer_.GetPosition() - call_start) == kCallExternalLabelSize);
}
@@ -161,8 +162,9 @@
if (Isolate::Current() == Dart::vm_isolate()) {
call(label);
} else {
- LoadExternalLabel(TMP, label, kNotPatchable, pp);
- call(TMP);
+ const int32_t offset =
+ Array::element_offset(FindExternalLabel(label, kNotPatchable));
+ call(Address::AddressBaseImm32(pp, offset - kHeapObjectTag));
}
}
@@ -1599,6 +1601,16 @@
}
+void Assembler::testb(const Address& address, const Immediate& imm) {
+ AssemblerBuffer::EnsureCapacity ensured(&buffer_);
+ EmitOperandREX(0, address, REX_NONE);
+ EmitUint8(0xF6);
+ EmitOperand(0, address);
+ ASSERT(imm.is_int8());
+ EmitUint8(imm.value() & 0xFF);
+}
+
+
void Assembler::testq(Register reg1, Register reg2) {
AssemblerBuffer::EnsureCapacity ensured(&buffer_);
Operand operand(reg2);
@@ -2590,7 +2602,7 @@
intptr_t call_start = buffer_.GetPosition();
LoadExternalLabel(TMP, label, kPatchable, pp);
jmp(TMP);
- ASSERT((buffer_.GetPosition() - call_start) == kCallExternalLabelSize);
+ ASSERT((buffer_.GetPosition() - call_start) == kJmpExternalLabelSize);
}
@@ -2740,11 +2752,11 @@
}
-void Assembler::Drop(intptr_t stack_elements) {
+void Assembler::Drop(intptr_t stack_elements, Register tmp) {
ASSERT(stack_elements >= 0);
if (stack_elements <= 4) {
for (intptr_t i = 0; i < stack_elements; i++) {
- popq(TMP);
+ popq(tmp);
}
return;
}
@@ -2987,7 +2999,21 @@
}
-void Assembler::VerifyHeapWord(const Address& address) {
+void Assembler::VerifyHeapWord(const Address& address,
+ FieldContent old_content) {
+#if defined(DEBUG)
+ switch (old_content) {
+ case kEmptyOrSmiOrNull:
+ VerifyUninitialized(address);
+ break;
+ case kHeapObjectOrSmi:
+ VerifyObjectOrSmi(address);
+ break;
+ case kOnlySmi:
+ VerifySmi(address);
+ break;
+ }
+#endif // DEBUG
if (VerifiedMemory::enabled()) {
Register addr_reg = RDX;
Register value = RBX;
@@ -3009,8 +3035,10 @@
}
-void Assembler::VerifiedWrite(const Address& dest, Register value) {
- VerifyHeapWord(dest);
+void Assembler::VerifiedWrite(const Address& dest,
+ Register value,
+ FieldContent old_content) {
+ VerifyHeapWord(dest, old_content);
movq(dest, value);
if (VerifiedMemory::enabled()) {
Register temp = (value == RDX) ? RCX : RDX;
@@ -3022,12 +3050,57 @@
}
+#if defined(DEBUG)
+void Assembler::VerifyObjectOrSmi(const Address& dest) {
+ Label ok;
+ testb(dest, Immediate(kHeapObjectTag));
+ j(ZERO, &ok, Assembler::kNearJump);
+ // Non-smi case: Verify object pointer is word-aligned when untagged.
+ COMPILE_ASSERT(kHeapObjectTag == 1);
+ testb(dest, Immediate((kWordSize - 1) - kHeapObjectTag));
+ j(ZERO, &ok, Assembler::kNearJump);
+ static const bool kFixedLengthEncoding = true;
+ Stop("Expected heap object or Smi", kFixedLengthEncoding);
+ Bind(&ok);
+}
+
+
+void Assembler::VerifyUninitialized(const Address& dest) {
+ Label ok;
+ testb(dest, Immediate(kHeapObjectTag));
+ j(ZERO, &ok, Assembler::kNearJump);
+ // Non-smi case: Check for the special zap word or null.
+#if defined(DEBUG)
+ cmpq(dest, Immediate(Heap::kZap64Bits));
+ j(EQUAL, &ok, Assembler::kNearJump);
+#else
+#error Only supported in DEBUG mode
+#endif
+ cmpq(dest, Immediate(reinterpret_cast<uint64_t>(Object::null())));
+ j(EQUAL, &ok, Assembler::kNearJump);
+ static const bool kFixedLengthEncoding = true;
+ Stop("Expected zapped, Smi or null", kFixedLengthEncoding);
+ Bind(&ok);
+}
+
+
+void Assembler::VerifySmi(const Address& dest, const char* stop_msg) {
+ Label done;
+ testb(dest, Immediate(kHeapObjectTag));
+ j(ZERO, &done, Assembler::kNearJump);
+ static const bool kFixedLengthEncoding = true;
+ Stop(stop_msg, kFixedLengthEncoding);
+ Bind(&done);
+}
+#endif // defined(DEBUG)
+
+
void Assembler::StoreIntoObject(Register object,
const Address& dest,
Register value,
bool can_value_be_smi) {
ASSERT(object != value);
- VerifiedWrite(dest, value);
+ VerifiedWrite(dest, value, kHeapObjectOrSmi);
Label done;
if (can_value_be_smi) {
StoreIntoObjectFilter(object, value, &done);
@@ -3048,8 +3121,9 @@
void Assembler::StoreIntoObjectNoBarrier(Register object,
const Address& dest,
- Register value) {
- VerifiedWrite(dest, value);
+ Register value,
+ FieldContent old_content) {
+ VerifiedWrite(dest, value, old_content);
#if defined(DEBUG)
Label done;
pushq(value);
@@ -3065,9 +3139,10 @@
void Assembler::StoreIntoObjectNoBarrier(Register object,
const Address& dest,
const Object& value,
- Register pp) {
+ Register pp,
+ FieldContent old_content) {
+ VerifyHeapWord(dest, old_content);
if (VerifiedMemory::enabled()) {
- VerifyHeapWord(dest);
Register temp = (pp == RCX) ? RDX : RCX;
pushq(temp);
leaq(temp, dest);
@@ -3082,20 +3157,20 @@
void Assembler::StoreIntoSmiField(const Address& dest, Register value) {
- VerifiedWrite(dest, value);
#if defined(DEBUG)
Label done;
testq(value, Immediate(kHeapObjectTag));
j(ZERO, &done);
- Stop("Smi expected");
+ Stop("New value must be Smi.");
Bind(&done);
#endif // defined(DEBUG)
+ VerifiedWrite(dest, value, kOnlySmi);
}
-void Assembler::ZeroSmiField(const Address& dest) {
+void Assembler::ZeroInitSmiField(const Address& dest) {
// TODO(koda): Add VerifySmi once we distinguish initalization.
- VerifyHeapWord(dest);
+ VerifyHeapWord(dest, kEmptyOrSmiOrNull);
Immediate zero(Smi::RawValue(0));
movq(dest, zero);
if (VerifiedMemory::enabled()) {
@@ -3112,7 +3187,7 @@
// Note: FlowGraphCompiler::EdgeCounterIncrementSizeInBytes depends on
// the length of this instruction sequence.
// TODO(koda): Add VerifySmi once we distinguish initalization.
- VerifyHeapWord(dest);
+ VerifyHeapWord(dest, kOnlySmi);
Immediate inc_imm(Smi::RawValue(increment));
addq(dest, inc_imm);
if (VerifiedMemory::enabled()) {
diff --git a/runtime/vm/assembler_x64.h b/runtime/vm/assembler_x64.h
index c902b0d..580a248 100644
--- a/runtime/vm/assembler_x64.h
+++ b/runtime/vm/assembler_x64.h
@@ -352,7 +352,8 @@
void call(Label* label);
void call(const ExternalLabel* label);
- static const intptr_t kCallExternalLabelSize = 10;
+ static const intptr_t kCallExternalLabelSize = 7;
+ static const intptr_t kJmpExternalLabelSize = 10;
void pushq(Register reg);
void pushq(const Address& address);
@@ -516,6 +517,7 @@
void testl(Register reg1, Register reg2);
void testl(Register reg, const Immediate& imm);
+ void testb(const Address& address, const Immediate& imm);
void testq(Register reg1, Register reg2);
void testq(Register reg, const Immediate& imm);
@@ -726,7 +728,7 @@
void SubImmediate(Register reg, const Immediate& imm, Register pp);
void SubImmediate(const Address& address, const Immediate& imm, Register pp);
- void Drop(intptr_t stack_elements);
+ void Drop(intptr_t stack_elements, Register tmp = TMP);
enum Patchability {
kPatchable,
@@ -755,6 +757,14 @@
void PushObject(const Object& object, Register pp);
void CompareObject(Register reg, const Object& object, Register pp);
+ // When storing into a heap object field, knowledge of the previous content
+ // is expressed through these constants.
+ enum FieldContent {
+ kEmptyOrSmiOrNull, // Empty = garbage/zapped in release/debug mode.
+ kHeapObjectOrSmi,
+ kOnlySmi,
+ };
+
// Destroys value.
void StoreIntoObject(Register object, // Object we are storing into.
const Address& dest, // Where we are storing into.
@@ -763,15 +773,28 @@
void StoreIntoObjectNoBarrier(Register object,
const Address& dest,
- Register value);
+ Register value,
+ FieldContent old_content = kHeapObjectOrSmi);
+ void InitializeFieldNoBarrier(Register object,
+ const Address& dest,
+ Register value) {
+ return StoreIntoObjectNoBarrier(object, dest, value, kEmptyOrSmiOrNull);
+ }
void StoreIntoObjectNoBarrier(Register object,
const Address& dest,
const Object& value,
- Register pp);
+ Register pp,
+ FieldContent old_content = kHeapObjectOrSmi);
+ void InitializeFieldNoBarrier(Register object,
+ const Address& dest,
+ const Object& value,
+ Register pp) {
+ return StoreIntoObjectNoBarrier(object, dest, value, pp, kEmptyOrSmiOrNull);
+ }
// Stores a Smi value into a heap object field that always contains a Smi.
void StoreIntoSmiField(const Address& dest, Register value);
- void ZeroSmiField(const Address& dest);
+ void ZeroInitSmiField(const Address& dest);
// Increments a Smi field. Leaves flags in same state as an 'addq'.
void IncrementSmiField(const Address& dest, int64_t increment);
@@ -1109,11 +1132,17 @@
void StoreIntoObjectFilterNoSmi(Register object,
Register value,
Label* no_update);
-
- // Analogous to VerifiedMemory::Verify(address, kWordSize).
- void VerifyHeapWord(const Address& address);
- // Analogous to VerifiedMemory::Write.
- void VerifiedWrite(const Address& dest, Register value);
+#if defined(DEBUG)
+ void VerifyUninitialized(const Address& address);
+ void VerifyObjectOrSmi(const Address& address);
+ void VerifySmi(const Address& address, const char* stop_msg = "Expected Smi");
+#endif // DEBUG
+ // Like VerifiedMemory::Verify(address, kWordSize) and ::Write, but also,
+ // in DEBUG mode, verifies that 'address' has content of type 'old_content'.
+ void VerifyHeapWord(const Address& address, FieldContent old_content);
+ void VerifiedWrite(const Address& dest,
+ Register value,
+ FieldContent old_content);
// Unaware of write barrier (use StoreInto* methods for storing to objects).
void MoveImmediate(const Address& dst, const Immediate& imm, Register pp);
diff --git a/runtime/vm/assembler_x64_test.cc b/runtime/vm/assembler_x64_test.cc
index c2107ce..a62341e 100644
--- a/runtime/vm/assembler_x64_test.cc
+++ b/runtime/vm/assembler_x64_test.cc
@@ -297,6 +297,30 @@
}
+ASSEMBLER_TEST_GENERATE(Testb, assembler) {
+ Label done;
+ __ movq(RAX, Immediate(1));
+ __ movq(RCX, Immediate(0));
+ __ pushq(Immediate(0xffffff11));
+ __ testb(Address(RSP, 0), Immediate(0x10));
+ // Fail if zero flag set.
+ __ cmoveq(RAX, RCX);
+ __ testb(Address(RSP, 0), Immediate(0x20));
+ // Fail if zero flag not set.
+ __ j(ZERO, &done);
+ __ movq(RAX, Immediate(0));
+ __ Bind(&done);
+ __ popq(RCX);
+ __ ret();
+}
+
+
+ASSEMBLER_TEST_RUN(Testb, test) {
+ typedef int (*TestbCode)();
+ EXPECT_EQ(1, reinterpret_cast<TestbCode>(test->entry())());
+}
+
+
ASSEMBLER_TEST_GENERATE(Increment, assembler) {
__ movq(RAX, Immediate(0));
__ pushq(RAX);
diff --git a/runtime/vm/benchmark_test.cc b/runtime/vm/benchmark_test.cc
index ccca86d..656c44c 100644
--- a/runtime/vm/benchmark_test.cc
+++ b/runtime/vm/benchmark_test.cc
@@ -529,7 +529,7 @@
timer.Start();
for (intptr_t i = 0; i < kLoopCount; i++) {
StackZone zone(isolate);
- MessageWriter writer(&buffer, &message_allocator);
+ MessageWriter writer(&buffer, &message_allocator, true);
writer.WriteMessage(null_object);
intptr_t buffer_len = writer.BytesWritten();
@@ -552,7 +552,7 @@
timer.Start();
for (intptr_t i = 0; i < kLoopCount; i++) {
StackZone zone(isolate);
- MessageWriter writer(&buffer, &message_allocator);
+ MessageWriter writer(&buffer, &message_allocator, true);
writer.WriteMessage(smi_object);
intptr_t buffer_len = writer.BytesWritten();
@@ -577,7 +577,7 @@
timer.Start();
for (intptr_t i = 0; i < kLoopCount; i++) {
StackZone zone(isolate);
- MessageWriter writer(&buffer, &malloc_allocator);
+ MessageWriter writer(&buffer, &malloc_allocator, true);
writer.WriteMessage(array_object);
intptr_t buffer_len = writer.BytesWritten();
diff --git a/runtime/vm/code_descriptors.h b/runtime/vm/code_descriptors.h
index ab854bf..e7daafb 100644
--- a/runtime/vm/code_descriptors.h
+++ b/runtime/vm/code_descriptors.h
@@ -135,7 +135,7 @@
list_[try_index].pc_offset = pc_offset;
ASSERT(handler_types.IsZoneHandle());
list_[try_index].handler_types = &handler_types;
- list_[try_index].needs_stacktrace = needs_stacktrace;
+ list_[try_index].needs_stacktrace |= needs_stacktrace;
}
@@ -145,7 +145,10 @@
if (try_index == CatchClauseNode::kInvalidTryIndex) {
return;
}
- ASSERT((0 <= try_index) && (try_index < Length()));
+ ASSERT(try_index >= 0);
+ while (Length() <= try_index) {
+ AddPlaceHolder();
+ }
list_[try_index].needs_stacktrace = true;
}
diff --git a/runtime/vm/code_patcher.h b/runtime/vm/code_patcher.h
index 10ab117..4e2435f 100644
--- a/runtime/vm/code_patcher.h
+++ b/runtime/vm/code_patcher.h
@@ -82,11 +82,6 @@
const Code& code,
ICData* ic_data);
- // Return the arguments descriptor array of the closure call
- // before the given return address.
- static RawArray* GetClosureArgDescAt(uword return_address,
- const Code& code);
-
static intptr_t InstanceCallSizeInBytes();
static void InsertCallAt(uword start, uword target);
diff --git a/runtime/vm/code_patcher_arm.cc b/runtime/vm/code_patcher_arm.cc
index 92de85e..8cbe89c 100644
--- a/runtime/vm/code_patcher_arm.cc
+++ b/runtime/vm/code_patcher_arm.cc
@@ -13,14 +13,6 @@
namespace dart {
-RawArray* CodePatcher::GetClosureArgDescAt(uword return_address,
- const Code& code) {
- ASSERT(code.ContainsInstructionAt(return_address));
- CallPattern call(return_address, code);
- return call.ClosureArgumentsDescriptor();
-}
-
-
uword CodePatcher::GetStaticCallTargetAt(uword return_address,
const Code& code) {
ASSERT(code.ContainsInstructionAt(return_address));
diff --git a/runtime/vm/code_patcher_arm64.cc b/runtime/vm/code_patcher_arm64.cc
index c2a0138..fd29dc5 100644
--- a/runtime/vm/code_patcher_arm64.cc
+++ b/runtime/vm/code_patcher_arm64.cc
@@ -12,14 +12,6 @@
namespace dart {
-RawArray* CodePatcher::GetClosureArgDescAt(uword return_address,
- const Code& code) {
- ASSERT(code.ContainsInstructionAt(return_address));
- CallPattern call(return_address, code);
- return call.ClosureArgumentsDescriptor();
-}
-
-
uword CodePatcher::GetStaticCallTargetAt(uword return_address,
const Code& code) {
ASSERT(code.ContainsInstructionAt(return_address));
diff --git a/runtime/vm/code_patcher_ia32.cc b/runtime/vm/code_patcher_ia32.cc
index 48cf684..194aa02 100644
--- a/runtime/vm/code_patcher_ia32.cc
+++ b/runtime/vm/code_patcher_ia32.cc
@@ -150,51 +150,6 @@
};
-// The expected pattern of a Dart closure call:
-// mov EDX, arguments_descriptor_array
-// call target_address
-// <- return address
-class ClosureCall : public ValueObject {
- public:
- explicit ClosureCall(uword return_address)
- : start_(return_address - (kInstr1Size + kInstr2Size)) {
- ASSERT(IsValid(return_address));
- ASSERT(kInstr2Size == Assembler::kCallExternalLabelSize);
- }
-
- static bool IsValid(uword return_address) {
- uint8_t* code_bytes = reinterpret_cast<uint8_t*>(
- return_address - (kInstr1Size + kInstr2Size));
- return (code_bytes[0] == 0xBA) && (code_bytes[kInstr1Size] == 0xE8);
- }
-
- RawArray* arguments_descriptor() const {
- return *reinterpret_cast<RawArray**>(start_ + 1);
- }
-
- private:
- static const int kInstr1Size = 5; // mov EDX, arguments descriptor array
- static const int kInstr2Size = 5; // call stub
-
- uword return_address() const {
- return start_ + kInstr1Size + kInstr2Size;
- }
- uword call_address() const { return start_; }
-
- uword start_;
- DISALLOW_IMPLICIT_CONSTRUCTORS(ClosureCall);
-};
-
-
-
-RawArray* CodePatcher::GetClosureArgDescAt(uword return_address,
- const Code& code) {
- ASSERT(code.ContainsInstructionAt(return_address));
- ClosureCall call(return_address);
- return call.arguments_descriptor();
-}
-
-
uword CodePatcher::GetStaticCallTargetAt(uword return_address,
const Code& code) {
ASSERT(code.ContainsInstructionAt(return_address));
diff --git a/runtime/vm/code_patcher_mips.cc b/runtime/vm/code_patcher_mips.cc
index 13195e8..4b6ceca 100644
--- a/runtime/vm/code_patcher_mips.cc
+++ b/runtime/vm/code_patcher_mips.cc
@@ -12,14 +12,6 @@
namespace dart {
-RawArray* CodePatcher::GetClosureArgDescAt(uword return_address,
- const Code& code) {
- ASSERT(code.ContainsInstructionAt(return_address));
- CallPattern call(return_address, code);
- return call.ClosureArgumentsDescriptor();
-}
-
-
uword CodePatcher::GetStaticCallTargetAt(uword return_address,
const Code& code) {
ASSERT(code.ContainsInstructionAt(return_address));
diff --git a/runtime/vm/code_patcher_x64.cc b/runtime/vm/code_patcher_x64.cc
index a9bdf479..b4fa546 100644
--- a/runtime/vm/code_patcher_x64.cc
+++ b/runtime/vm/code_patcher_x64.cc
@@ -17,10 +17,9 @@
namespace dart {
// The expected pattern of a Dart unoptimized call (static and instance):
-// 00: 49 8b 9f imm32 mov RBX, [PP + off]
-// 07: 4d 8b 9f imm32 mov R11, [PP + off]
-// 14: 41 ff d3 call R11
-// 17 <- return address
+// 0: 49 8b 9f imm32 mov RBX, [PP + off]
+// 7: 41 ff 97 imm32 call [PP + off]
+// 14 <- return address
class UnoptimizedCall : public ValueObject {
public:
UnoptimizedCall(uword return_address, const Code& code)
@@ -30,17 +29,15 @@
ASSERT((kCallPatternSize - 7) == Assembler::kCallExternalLabelSize);
}
- static const int kCallPatternSize = 17;
+ static const int kCallPatternSize = 14;
static bool IsValid(uword return_address) {
uint8_t* code_bytes =
reinterpret_cast<uint8_t*>(return_address - kCallPatternSize);
return (code_bytes[0] == 0x49) && (code_bytes[1] == 0x8B) &&
(code_bytes[2] == 0x9F) &&
- (code_bytes[7] == 0x4D) && (code_bytes[8] == 0x8B) &&
- (code_bytes[9] == 0x9F) &&
- (code_bytes[14] == 0x41) && (code_bytes[15] == 0xFF) &&
- (code_bytes[16] == 0xD3);
+ (code_bytes[7] == 0x41) && (code_bytes[8] == 0xFF) &&
+ (code_bytes[9] == 0x97);
}
RawObject* ic_data() const {
@@ -99,29 +96,53 @@
};
-// The expected pattern of a dart static call:
-// 00 mov R10, arguments_descriptor_array (10 bytes) (optional in polym. calls)
-// 11: 4d 8b 9f imm32 mov R11, [PP + off]
-// 16: call R11 (3 bytes)
-// <- return address
-class StaticCall : public ValueObject {
+// The expected pattern of a call where the target is loaded from
+// the object pool:
+// 0: 41 ff 97 imm32 call [PP + off]
+// 7: <- return address
+class PoolPointerCall : public ValueObject {
public:
- explicit StaticCall(uword return_address, const Code& code)
- : start_(return_address - kCallPatternSize),
- object_pool_(Array::Handle(code.ObjectPool())) {
+ explicit PoolPointerCall(uword return_address)
+ : start_(return_address - kCallPatternSize) {
ASSERT(IsValid(return_address));
- ASSERT(kCallPatternSize == Assembler::kCallExternalLabelSize);
}
- static const int kCallPatternSize = 10;
+ static const int kCallPatternSize = 7;
static bool IsValid(uword return_address) {
uint8_t* code_bytes =
reinterpret_cast<uint8_t*>(return_address - kCallPatternSize);
- return (code_bytes[0] == 0x4D) && (code_bytes[1] == 0x8B) &&
- (code_bytes[2] == 0x9F) &&
- (code_bytes[7] == 0x41) && (code_bytes[8] == 0xFF) &&
- (code_bytes[9] == 0xD3);
+ return (code_bytes[0] == 0x41) && (code_bytes[1] == 0xFF) &&
+ (code_bytes[2] == 0x97);
+ }
+
+ int32_t pp_offset() const {
+ return *reinterpret_cast<int32_t*>(start_ + 3);
+ }
+
+ void set_pp_offset(int32_t offset) const {
+ *reinterpret_cast<int32_t*>(start_ + 3) = offset;
+ CPU::FlushICache(start_, kCallPatternSize);
+ }
+
+ protected:
+ uword start_;
+
+ private:
+ DISALLOW_IMPLICIT_CONSTRUCTORS(PoolPointerCall);
+};
+
+
+// The expected pattern of a dart static call:
+// 0: 41 ff 97 imm32 call [PP + off]
+// 7: <- return address
+class StaticCall : public PoolPointerCall {
+ public:
+ StaticCall(uword return_address, const Code& code)
+ : PoolPointerCall(return_address),
+ object_pool_(Array::Handle(code.ObjectPool())) {
+ ASSERT(IsValid(return_address));
+ ASSERT(kCallPatternSize == Assembler::kCallExternalLabelSize);
}
uword target() const {
@@ -137,90 +158,11 @@
}
private:
- uword start_;
const Array& object_pool_;
DISALLOW_IMPLICIT_CONSTRUCTORS(StaticCall);
};
-// The expected pattern of a call where the target is loaded from
-// the object pool:
-// 00: 4d 8b 9f imm32 mov R11, [PP + off]
-// 07: 41 ff d3 call R11
-// 10 <- return address
-class PoolPointerCall : public ValueObject {
- public:
- explicit PoolPointerCall(uword return_address)
- : start_(return_address - kCallPatternSize) {
- ASSERT(IsValid(return_address));
- }
-
- static bool IsValid(uword return_address) {
- uint8_t* code_bytes =
- reinterpret_cast<uint8_t*>(return_address - kCallPatternSize);
- return (code_bytes[0] == 0x4D) && (code_bytes[1] == 0x8B) &&
- (code_bytes[2] == 0x9F) &&
- (code_bytes[7] == 0x41) && (code_bytes[8] == 0xFF) &&
- (code_bytes[9] == 0xD3);
- }
-
- int32_t pp_offset() const {
- return *reinterpret_cast<int32_t*>(start_ + 3);
- }
-
- void set_pp_offset(int32_t offset) const {
- *reinterpret_cast<int32_t*>(start_ + 3) = offset;
- CPU::FlushICache(start_, kCallPatternSize);
- }
-
- private:
- static const int kCallPatternSize = 7 + 3;
- uword start_;
- DISALLOW_IMPLICIT_CONSTRUCTORS(PoolPointerCall);
-};
-
-
-// The expected code pattern of a Dart closure call:
-// 00: 49 ba imm64 mov R10, immediate 2 ; 10 bytes
-// 10: 4d 8b 9f imm32 mov R11, [PP + off]
-// 17: 41 ff d3 call R11 ; 3 bytes
-// 20: <- return_address
-class ClosureCall : public ValueObject {
- public:
- explicit ClosureCall(uword return_address)
- : start_(return_address - kCallPatternSize) {
- ASSERT(IsValid(return_address));
- }
-
- static bool IsValid(uword return_address) {
- uint8_t* code_bytes =
- reinterpret_cast<uint8_t*>(return_address - kCallPatternSize);
- return (code_bytes[00] == 0x49) && (code_bytes[01] == 0xBA) &&
- (code_bytes[10] == 0x4D) && (code_bytes[11] == 0x8B) &&
- (code_bytes[12] == 0x9F) &&
- (code_bytes[17] == 0x41) && (code_bytes[18] == 0xFF) &&
- (code_bytes[19] == 0xD3);
- }
-
- RawArray* arguments_descriptor() const {
- return *reinterpret_cast<RawArray**>(start_ + 2);
- }
-
- private:
- static const int kCallPatternSize = 10 + 7 + 3;
- uword start_;
- DISALLOW_IMPLICIT_CONSTRUCTORS(ClosureCall);
-};
-
-
-RawArray* CodePatcher::GetClosureArgDescAt(uword return_address,
- const Code& code) {
- ASSERT(code.ContainsInstructionAt(return_address));
- ClosureCall call(return_address);
- return call.arguments_descriptor();
-}
-
-
uword CodePatcher::GetStaticCallTargetAt(uword return_address,
const Code& code) {
ASSERT(code.ContainsInstructionAt(return_address));
diff --git a/runtime/vm/dart_api_impl.cc b/runtime/vm/dart_api_impl.cc
index e3b85c3..ac26ef4 100644
--- a/runtime/vm/dart_api_impl.cc
+++ b/runtime/vm/dart_api_impl.cc
@@ -1576,7 +1576,7 @@
DARTSCOPE(isolate);
const Object& object = Object::Handle(isolate, Api::UnwrapHandle(handle));
uint8_t* data = NULL;
- MessageWriter writer(&data, &allocator);
+ MessageWriter writer(&data, &allocator, false);
writer.WriteMessage(object);
intptr_t len = writer.BytesWritten();
return PortMap::PostMessage(new Message(
diff --git a/runtime/vm/dart_api_impl_test.cc b/runtime/vm/dart_api_impl_test.cc
index dc89423..444e040 100644
--- a/runtime/vm/dart_api_impl_test.cc
+++ b/runtime/vm/dart_api_impl_test.cc
@@ -7015,7 +7015,7 @@
response->type = Dart_CObject_kInt32;
response->value.as_int32 = 123;
Dart_PostCObject(
- message->value.as_array.values[0]->value.as_send_port, response);
+ message->value.as_array.values[0]->value.as_send_port.id, response);
}
@@ -7031,7 +7031,7 @@
response->type = Dart_CObject_kInt32;
response->value.as_int32 = 321;
Dart_PostCObject(
- message->value.as_array.values[0]->value.as_send_port, response);
+ message->value.as_array.values[0]->value.as_send_port.id, response);
}
diff --git a/runtime/vm/dart_api_message.cc b/runtime/vm/dart_api_message.cc
index a601017..ab9eaa2 100644
--- a/runtime/vm/dart_api_message.cc
+++ b/runtime/vm/dart_api_message.cc
@@ -608,8 +608,10 @@
}
case kSendPortCid: {
int64_t value64 = Read<int64_t>();
+ int64_t originId = Read<uint64_t>();
Dart_CObject* object = AllocateDartCObject(Dart_CObject_kSendPort);
- object->value.as_send_port = value64;
+ object->value.as_send_port.id = value64;
+ object->value.as_send_port.origin_id = originId;
AddBackRef(object_id, object, kIsDeserialized);
return object;
}
diff --git a/runtime/vm/dart_entry_test.cc b/runtime/vm/dart_entry_test.cc
index 2b159c8..5f939ed 100644
--- a/runtime/vm/dart_entry_test.cc
+++ b/runtime/vm/dart_entry_test.cc
@@ -63,7 +63,6 @@
String& name = String::Handle(String::New("foo"));
Function& function = Function::Handle(cls.LookupStaticFunction(name));
EXPECT(!function.IsNull());
- GrowableArray<const Object*> arguments;
const Object& retval = Object::Handle(
DartEntry::InvokeFunction(function, Object::empty_array()));
EXPECT(retval.IsError());
diff --git a/runtime/vm/disassembler_ia32.cc b/runtime/vm/disassembler_ia32.cc
index c8ef618..b81fdde 100644
--- a/runtime/vm/disassembler_ia32.cc
+++ b/runtime/vm/disassembler_ia32.cc
@@ -1332,10 +1332,16 @@
PrintCPURegister(rm);
Print(",");
PrintHex(*(data+2));
+ data += 3;
} else {
- UNIMPLEMENTED();
+ data++;
+ Print("test_b ");
+ data += PrintRightOperand(data);
+ int32_t imm = *data;
+ Print(",");
+ PrintHex(imm);
+ data++;
}
- data += 3;
}
break;
diff --git a/runtime/vm/exceptions.cc b/runtime/vm/exceptions.cc
index 0a5ed8f..0f8bdbb 100644
--- a/runtime/vm/exceptions.cc
+++ b/runtime/vm/exceptions.cc
@@ -697,10 +697,6 @@
library = Library::CoreLibrary();
class_name = &Symbols::UnsupportedError();
break;
- case kInternalError:
- library = Library::CoreLibrary();
- class_name = &Symbols::InternalError();
- break;
case kNullThrown:
library = Library::CoreLibrary();
class_name = &Symbols::NullThrownError();
diff --git a/runtime/vm/exceptions.h b/runtime/vm/exceptions.h
index 68a8b07..cf0eb98 100644
--- a/runtime/vm/exceptions.h
+++ b/runtime/vm/exceptions.h
@@ -55,7 +55,6 @@
kUnsupported,
kStackOverflow,
kOutOfMemory,
- kInternalError,
kNullThrown,
kIsolateSpawn,
kIsolateUnhandledException,
diff --git a/runtime/vm/flow_graph_builder.cc b/runtime/vm/flow_graph_builder.cc
index 4868197..033e0a1 100644
--- a/runtime/vm/flow_graph_builder.cc
+++ b/runtime/vm/flow_graph_builder.cc
@@ -3492,7 +3492,8 @@
store_value,
kEmitStoreBarrier,
node->token_pos());
- store->set_is_initialization(true); // Maybe initializing store.
+ // Maybe initializing unboxed store.
+ store->set_is_potential_unboxed_initialization(true);
ReturnDefinition(store);
}
diff --git a/runtime/vm/flow_graph_compiler_ia32.cc b/runtime/vm/flow_graph_compiler_ia32.cc
index c4e0874..7771e56 100644
--- a/runtime/vm/flow_graph_compiler_ia32.cc
+++ b/runtime/vm/flow_graph_compiler_ia32.cc
@@ -1235,15 +1235,29 @@
intptr_t increment_start = assembler_->CodeSize();
#endif // DEBUG
__ IncrementSmiField(FieldAddress(EAX, Array::element_offset(0)), 1);
+#if defined(DEBUG)
// If the assertion below fails, update EdgeCounterIncrementSizeInBytes.
- DEBUG_ASSERT((assembler_->CodeSize() - increment_start) ==
- EdgeCounterIncrementSizeInBytes());
+ intptr_t expected = EdgeCounterIncrementSizeInBytes();
+ intptr_t actual = assembler_->CodeSize() - increment_start;
+ if (actual != expected) {
+ FATAL2("Edge counter increment length: %" Pd ", expected %" Pd "\n",
+ actual,
+ expected);
+ }
+#endif // DEBUG
}
int32_t FlowGraphCompiler::EdgeCounterIncrementSizeInBytes() {
// Used by CodePatcher; so must be constant across all code in an isolate.
- return VerifiedMemory::enabled() ? 50 : 4;
+ int32_t size = 4;
+#if defined(DEBUG)
+ size += 19; // VerifySmi
+#endif // DEBUG
+ if (VerifiedMemory::enabled()) {
+ size += 50;
+ }
+ return size;
}
diff --git a/runtime/vm/flow_graph_compiler_x64.cc b/runtime/vm/flow_graph_compiler_x64.cc
index 11fa54a..33eb9e5 100644
--- a/runtime/vm/flow_graph_compiler_x64.cc
+++ b/runtime/vm/flow_graph_compiler_x64.cc
@@ -1249,7 +1249,7 @@
&target_label,
RawPcDescriptors::kUnoptStaticCall,
locs);
- __ Drop(argument_count);
+ __ Drop(argument_count, RCX);
#if defined(DEBUG)
__ movq(RBX, Immediate(kInvalidObjectPointer));
__ movq(R10, Immediate(kInvalidObjectPointer));
@@ -1286,7 +1286,14 @@
int32_t FlowGraphCompiler::EdgeCounterIncrementSizeInBytes() {
// Used by CodePatcher; so must be constant across all code in an isolate.
- return VerifiedMemory::enabled() ? 73 : 5;
+ int32_t size = 5;
+#if defined(DEBUG)
+ size += 36; // VerifySmi
+#endif // DEBUG
+ if (VerifiedMemory::enabled()) {
+ size += 72;
+ }
+ return size;
}
@@ -1311,7 +1318,7 @@
target_label,
RawPcDescriptors::kIcCall,
locs);
- __ Drop(argument_count);
+ __ Drop(argument_count, RCX);
}
@@ -1328,7 +1335,7 @@
target_label,
RawPcDescriptors::kIcCall,
locs);
- __ Drop(argument_count);
+ __ Drop(argument_count, RCX);
#if defined(DEBUG)
__ movq(R10, Immediate(kInvalidObjectPointer));
#endif
@@ -1392,7 +1399,7 @@
Isolate::kNoDeoptId, token_pos);
RecordSafepoint(locs);
AddDeoptIndexAtCall(Isolate::ToDeoptAfter(deopt_id), token_pos);
- __ Drop(argument_count);
+ __ Drop(argument_count, RCX);
}
@@ -1413,7 +1420,7 @@
RawPcDescriptors::kOptStaticCall,
locs);
AddStaticCallTarget(function);
- __ Drop(argument_count);
+ __ Drop(argument_count, RCX);
}
@@ -1565,7 +1572,7 @@
locs);
const Function& function = *sorted[i].target;
AddStaticCallTarget(function);
- __ Drop(argument_count);
+ __ Drop(argument_count, RCX);
if (!is_last_check) {
__ jmp(&match_found);
}
diff --git a/runtime/vm/flow_graph_optimizer.cc b/runtime/vm/flow_graph_optimizer.cc
index 75519d2..b89159c 100644
--- a/runtime/vm/flow_graph_optimizer.cc
+++ b/runtime/vm/flow_graph_optimizer.cc
@@ -4504,7 +4504,7 @@
void FlowGraphOptimizer::VisitStoreInstanceField(
StoreInstanceFieldInstr* instr) {
if (instr->IsUnboxedStore()) {
- ASSERT(instr->is_initialization_);
+ ASSERT(instr->is_potential_unboxed_initialization_);
// Determine if this field should be unboxed based on the usage of getter
// and setter functions: The heuristic requires that the setter has a
// usage count of at least 1/kGetterSetterRatio of the getter usage count.
@@ -4549,7 +4549,9 @@
new Value(flow_graph_->constant_null()),
kNoStoreBarrier,
instr->token_pos());
- store->set_is_initialization(true); // Won't be eliminated by DSE.
+ // Storing into uninitialized memory; remember to prevent dead store
+ // elimination and ensure proper GC barrier.
+ store->set_is_object_reference_initialization(true);
flow_graph_->InsertAfter(replacement, store, NULL, FlowGraph::kEffect);
Definition* cursor = store;
for (intptr_t i = 0; i < instr->num_context_variables(); ++i) {
@@ -4559,7 +4561,9 @@
new Value(flow_graph_->constant_null()),
kNoStoreBarrier,
instr->token_pos());
- store->set_is_initialization(true); // Won't be eliminated by DSE.
+ // Storing into uninitialized memory; remember to prevent dead store
+ // elimination and ensure proper GC barrier.
+ store->set_is_object_reference_initialization(true);
flow_graph_->InsertAfter(cursor, store, NULL, FlowGraph::kEffect);
cursor = store;
}
@@ -7132,11 +7136,12 @@
bool CanEliminateStore(Instruction* instr) {
switch (instr->tag()) {
- case Instruction::kStoreInstanceField:
- if (instr->AsStoreInstanceField()->is_initialization()) {
- // Can't eliminate stores that initialized unboxed fields.
- return false;
- }
+ case Instruction::kStoreInstanceField: {
+ StoreInstanceFieldInstr* store_instance = instr->AsStoreInstanceField();
+ // Can't eliminate stores that initialize fields.
+ return !(store_instance->is_potential_unboxed_initialization() ||
+ store_instance->is_object_reference_initialization());
+ }
case Instruction::kStoreIndexed:
case Instruction::kStoreStaticField:
return true;
diff --git a/runtime/vm/flow_graph_type_propagator.cc b/runtime/vm/flow_graph_type_propagator.cc
index 0863a162..770030d 100644
--- a/runtime/vm/flow_graph_type_propagator.cc
+++ b/runtime/vm/flow_graph_type_propagator.cc
@@ -166,25 +166,40 @@
}
StrictCompareInstr* compare = branch->comparison()->AsStrictCompare();
- if ((compare == NULL) || !compare->right()->BindsToConstantNull()) {
+ if ((compare == NULL) || !compare->right()->BindsToConstant()) {
return;
}
const intptr_t rollback_point = rollback_.length();
Definition* defn = compare->left()->definition();
+ const Object& right = compare->right()->BoundConstant();
+ intptr_t cid = right.GetClassId();
+
+ if (defn->IsLoadClassId() && right.IsSmi()) {
+ defn = defn->AsLoadClassId()->object()->definition();
+ cid = Smi::Cast(right).Value();
+ }
+
+ if (!CheckClassInstr::IsImmutableClassId(cid)) {
+ return;
+ }
if (compare->kind() == Token::kEQ_STRICT) {
- branch->set_constrained_type(MarkNonNullable(defn));
- PropagateRecursive(branch->false_successor());
+ if (cid == kNullCid) {
+ branch->set_constrained_type(MarkNonNullable(defn));
+ PropagateRecursive(branch->false_successor());
+ }
- SetCid(defn, kNullCid);
+ SetCid(defn, cid);
PropagateRecursive(branch->true_successor());
} else if (compare->kind() == Token::kNE_STRICT) {
- branch->set_constrained_type(MarkNonNullable(defn));
- PropagateRecursive(branch->true_successor());
+ if (cid == kNullCid) {
+ branch->set_constrained_type(MarkNonNullable(defn));
+ PropagateRecursive(branch->true_successor());
+ }
- SetCid(defn, kNullCid);
+ SetCid(defn, cid);
PropagateRecursive(branch->false_successor());
}
@@ -280,6 +295,12 @@
void FlowGraphTypePropagator::VisitCheckClassId(CheckClassIdInstr* check) {
+ if (!check->Dependencies().IsNone()) {
+ // TODO(vegorov): If check is affected by side-effect we can still propagate
+ // the type further but not the cid.
+ return;
+ }
+
LoadClassIdInstr* load_cid =
check->value()->definition()->OriginalDefinition()->AsLoadClassId();
if (load_cid != NULL) {
diff --git a/runtime/vm/gc_sweeper.cc b/runtime/vm/gc_sweeper.cc
index 063f6aa..270c9cc 100644
--- a/runtime/vm/gc_sweeper.cc
+++ b/runtime/vm/gc_sweeper.cc
@@ -44,6 +44,10 @@
obj_size = free_end - current;
if (is_executable) {
memset(reinterpret_cast<void*>(current), 0xcc, obj_size);
+ } else {
+#if defined(DEBUG)
+ memset(reinterpret_cast<void*>(current), Heap::kZapByte, obj_size);
+#endif // DEBUG
}
if ((current != start) || (free_end != end)) {
// Only add to the free list if not covering the whole page.
@@ -77,7 +81,9 @@
while (current < end) {
RawObject* cur_obj = RawObject::FromAddr(current);
ASSERT(!cur_obj->IsMarked());
- current += cur_obj->Size();
+ intptr_t obj_size = cur_obj->Size();
+ memset(reinterpret_cast<void*>(current), Heap::kZapByte, obj_size);
+ current += obj_size;
}
#endif // DEBUG
return words_to_end;
diff --git a/runtime/vm/globals.h b/runtime/vm/globals.h
index 267b4a3..597756d 100644
--- a/runtime/vm/globals.h
+++ b/runtime/vm/globals.h
@@ -72,10 +72,12 @@
// When using GCC we can use GCC attributes to ensure that certain
-// contants are 16 byte aligned.
+// contants are 8 or 16 byte aligned.
#if defined(TARGET_OS_WINDOWS)
+#define ALIGN8 __declspec(align(8))
#define ALIGN16 __declspec(align(16))
#else
+#define ALIGN8 __attribute__((aligned(8)))
#define ALIGN16 __attribute__((aligned(16)))
#endif
diff --git a/runtime/vm/growable_array.h b/runtime/vm/growable_array.h
index 5f73008..d18391d 100644
--- a/runtime/vm/growable_array.h
+++ b/runtime/vm/growable_array.h
@@ -4,6 +4,8 @@
// Defines growable array classes, that differ where they are allocated:
// - GrowableArray: allocated on stack.
// - ZoneGrowableArray: allocated in the zone.
+// - MallocGrowableArray: allocates using malloc/realloc; free is only called
+// at destruction.
#ifndef VM_GROWABLE_ARRAY_H_
#define VM_GROWABLE_ARRAY_H_
@@ -15,23 +17,24 @@
namespace dart {
-template<typename T, typename B>
+template<typename T, typename B, typename Allocator = Zone>
class BaseGrowableArray : public B {
public:
- explicit BaseGrowableArray(Zone* zone)
- : length_(0), capacity_(0), data_(NULL), zone_(zone) {
- ASSERT(zone_ != NULL);
- }
+ explicit BaseGrowableArray(Allocator* allocator)
+ : length_(0), capacity_(0), data_(NULL), allocator_(allocator) {}
- BaseGrowableArray(intptr_t initial_capacity, Zone* zone)
- : length_(0), capacity_(0), data_(NULL), zone_(zone) {
- ASSERT(zone_ != NULL);
+ BaseGrowableArray(intptr_t initial_capacity, Allocator* allocator)
+ : length_(0), capacity_(0), data_(NULL), allocator_(allocator) {
if (initial_capacity > 0) {
capacity_ = Utils::RoundUpToPowerOfTwo(initial_capacity);
- data_ = zone_->Alloc<T>(capacity_);
+ data_ = allocator_->template Alloc<T>(capacity_);
}
}
+ ~BaseGrowableArray() {
+ allocator_->template Free<T>(data_, capacity_);
+ }
+
intptr_t length() const { return length_; }
T* data() const { return data_; }
bool is_empty() const { return length_ == 0; }
@@ -97,7 +100,7 @@
intptr_t length_;
intptr_t capacity_;
T* data_;
- Zone* zone_; // Zone in which we are allocating the array.
+ Allocator* allocator_; // Used to (re)allocate the array.
// Used for growing the array.
void Resize(intptr_t new_length);
@@ -106,19 +109,20 @@
};
-template<typename T, typename B>
-inline void BaseGrowableArray<T, B>::Sort(
+template<typename T, typename B, typename Allocator>
+inline void BaseGrowableArray<T, B, Allocator>::Sort(
int compare(const T*, const T*)) {
typedef int (*CompareFunction)(const void*, const void*);
qsort(data_, length_, sizeof(T), reinterpret_cast<CompareFunction>(compare));
}
-template<typename T, typename B>
-void BaseGrowableArray<T, B>::Resize(intptr_t new_length) {
+template<typename T, typename B, typename Allocator>
+void BaseGrowableArray<T, B, Allocator>::Resize(intptr_t new_length) {
if (new_length > capacity_) {
intptr_t new_capacity = Utils::RoundUpToPowerOfTwo(new_length);
- T* new_data = zone_->Realloc<T>(data_, capacity_, new_capacity);
+ T* new_data =
+ allocator_->template Realloc<T>(data_, capacity_, new_capacity);
ASSERT(new_data != NULL);
data_ = new_data;
capacity_ = new_capacity;
@@ -127,10 +131,10 @@
}
-template<typename T, typename B>
-void BaseGrowableArray<T, B>::SetLength(intptr_t new_length) {
+template<typename T, typename B, typename Allocator>
+void BaseGrowableArray<T, B, Allocator>::SetLength(intptr_t new_length) {
if (new_length > capacity_) {
- T* new_data = zone_->Alloc<T>(new_length);
+ T* new_data = allocator_->template Alloc<T>(new_length);
ASSERT(new_data != NULL);
data_ = new_data;
capacity_ = new_length;
@@ -144,13 +148,14 @@
public:
GrowableArray(Isolate* isolate, intptr_t initial_capacity)
: BaseGrowableArray<T, ValueObject>(
- initial_capacity, isolate->current_zone()) {}
+ initial_capacity, ASSERT_NOTNULL(isolate->current_zone())) {}
explicit GrowableArray(intptr_t initial_capacity)
: BaseGrowableArray<T, ValueObject>(
- initial_capacity, Isolate::Current()->current_zone()) {}
+ initial_capacity,
+ ASSERT_NOTNULL(Isolate::Current()->current_zone())) {}
GrowableArray()
: BaseGrowableArray<T, ValueObject>(
- Isolate::Current()->current_zone()) {}
+ ASSERT_NOTNULL(Isolate::Current()->current_zone())) {}
};
@@ -159,14 +164,46 @@
public:
ZoneGrowableArray(Isolate* isolate, intptr_t initial_capacity)
: BaseGrowableArray<T, ZoneAllocated>(
- initial_capacity, isolate->current_zone()) {}
+ initial_capacity, ASSERT_NOTNULL(isolate->current_zone())) {}
explicit ZoneGrowableArray(intptr_t initial_capacity)
: BaseGrowableArray<T, ZoneAllocated>(
initial_capacity,
- Isolate::Current()->current_zone()) {}
- ZoneGrowableArray() :
- BaseGrowableArray<T, ZoneAllocated>(
- Isolate::Current()->current_zone()) {}
+ ASSERT_NOTNULL(Isolate::Current()->current_zone())) {}
+ ZoneGrowableArray()
+ : BaseGrowableArray<T, ZoneAllocated>(
+ ASSERT_NOTNULL(Isolate::Current()->current_zone())) {}
+};
+
+
+class Malloc : public AllStatic {
+ public:
+ template <class T>
+ static inline T* Alloc(intptr_t len) {
+ return reinterpret_cast<T*>(malloc(len * sizeof(T)));
+ }
+
+ template <class T>
+ static inline T* Realloc(T* old_array, intptr_t old_len, intptr_t new_len) {
+ return reinterpret_cast<T*>(realloc(old_array, new_len * sizeof(T)));
+ }
+
+ template <class T>
+ static inline void Free(T* old_array, intptr_t old_len) {
+ free(old_array);
+ }
+};
+
+
+class EmptyBase {};
+
+
+template<typename T>
+class MallocGrowableArray : public BaseGrowableArray<T, EmptyBase, Malloc> {
+ public:
+ explicit MallocGrowableArray(intptr_t initial_capacity)
+ : BaseGrowableArray<T, EmptyBase, Malloc>(initial_capacity, NULL) {}
+ MallocGrowableArray()
+ : BaseGrowableArray<T, EmptyBase, Malloc>(NULL) {}
};
} // namespace dart
diff --git a/runtime/vm/growable_array_test.cc b/runtime/vm/growable_array_test.cc
index 2adf39d..09c1605 100644
--- a/runtime/vm/growable_array_test.cc
+++ b/runtime/vm/growable_array_test.cc
@@ -8,8 +8,9 @@
namespace dart {
-TEST_CASE(GrowableArray) {
- GrowableArray<int> g;
+template<class GrowableArrayInt, class GrowableArrayInt64>
+void TestGrowableArray() {
+ GrowableArrayInt g;
EXPECT_EQ(0, g.length());
EXPECT(g.is_empty());
g.Add(5);
@@ -17,7 +18,7 @@
EXPECT_EQ(1, g.length());
EXPECT(!g.is_empty());
g.Add(3);
- const GrowableArray<int>& temp = g;
+ const GrowableArrayInt& temp = g;
EXPECT_EQ(5, temp[0]);
EXPECT_EQ(3, temp[1]);
for (int i = 0; i < 10000; i++) {
@@ -26,7 +27,7 @@
EXPECT_EQ(10002, g.length());
EXPECT_EQ(10000 - 1, g.Last());
- GrowableArray<int64_t> f(10);
+ GrowableArrayInt64 f(10);
EXPECT_EQ(0, f.length());
f.Add(-1LL);
f.Add(15LL);
@@ -38,7 +39,7 @@
EXPECT_EQ(100 - 1, f.Last());
EXPECT_EQ(-1LL, f[0]);
- GrowableArray<int> h;
+ GrowableArrayInt h;
EXPECT_EQ(0, h.length());
h.Add(101);
h.Add(102);
@@ -62,6 +63,18 @@
}
+TEST_CASE(GrowableArray) {
+ TestGrowableArray<GrowableArray<int>,
+ GrowableArray<int64_t> >();
+}
+
+
+TEST_CASE(MallocGrowableArray) {
+ TestGrowableArray<MallocGrowableArray<int>,
+ MallocGrowableArray<int64_t> >();
+}
+
+
static int greatestFirst(const int* a, const int* b) {
if (*a > *b) {
return -1;
diff --git a/runtime/vm/heap.h b/runtime/vm/heap.h
index 137bcd3..aa11c73 100644
--- a/runtime/vm/heap.h
+++ b/runtime/vm/heap.h
@@ -63,6 +63,13 @@
static const intptr_t kHeapSizeInMB = kHeapSizeInMWords * kWordSize;
static const intptr_t kCodeHeapSizeInMB = 18;
+#if defined(DEBUG)
+ // Pattern for unused new space and swept old space.
+ static const uint64_t kZap64Bits = 0xf3f3f3f3f3f3f3f3;
+ static const uint32_t kZap32Bits = static_cast<uint32_t>(kZap64Bits);
+ static const uint8_t kZapByte = static_cast<uint8_t>(kZap64Bits);
+#endif // DEBUG
+
~Heap();
Scavenger* new_space() const { return new_space_; }
diff --git a/runtime/vm/intermediate_language.cc b/runtime/vm/intermediate_language.cc
index df597c8..3608370 100644
--- a/runtime/vm/intermediate_language.cc
+++ b/runtime/vm/intermediate_language.cc
@@ -152,20 +152,42 @@
}
+bool CheckClassInstr::IsImmutableClassId(intptr_t cid) {
+ switch (cid) {
+ case kOneByteStringCid:
+ case kTwoByteStringCid:
+ return false;
+ default:
+ return true;
+ }
+}
+
+
+static bool AreAllChecksImmutable(const ICData& checks) {
+ const intptr_t len = checks.NumberOfChecks();
+ for (intptr_t i = 0; i < len; i++) {
+ if (checks.IsUsedAt(i)) {
+ if (!CheckClassInstr::IsImmutableClassId(
+ checks.GetReceiverClassIdAt(i))) {
+ return false;
+ }
+ }
+ }
+ return true;
+}
+
+
EffectSet CheckClassInstr::Dependencies() const {
// Externalization of strings via the API can change the class-id.
- const bool externalizable =
- unary_checks().HasReceiverClassId(kOneByteStringCid) ||
- unary_checks().HasReceiverClassId(kTwoByteStringCid);
- return externalizable ? EffectSet::Externalization() : EffectSet::None();
+ return !AreAllChecksImmutable(unary_checks()) ?
+ EffectSet::Externalization() : EffectSet::None();
}
EffectSet CheckClassIdInstr::Dependencies() const {
// Externalization of strings via the API can change the class-id.
- const bool externalizable =
- cid_ == kOneByteStringCid || cid_ == kTwoByteStringCid;
- return externalizable ? EffectSet::Externalization() : EffectSet::None();
+ return !CheckClassInstr::IsImmutableClassId(cid_) ?
+ EffectSet::Externalization() : EffectSet::None();
}
@@ -2580,8 +2602,8 @@
// Don't generate a table when contained in an unreachable block.
return;
}
- ASSERT(SuccessorCount() == offsets_.Capacity());
- offsets_.SetLength(SuccessorCount());
+ ASSERT(SuccessorCount() == offsets_.Length());
+ intptr_t element_size = offsets_.ElementSizeInBytes();
for (intptr_t i = 0; i < SuccessorCount(); i++) {
TargetEntryInstr* target = SuccessorAt(i);
intptr_t offset = target->offset();
@@ -2605,7 +2627,7 @@
ASSERT(offset > 0);
offset -= Assembler::EntryPointToPcMarkerOffset();
- offsets_.SetAt(i, Smi::ZoneHandle(isolate, Smi::New(offset)));
+ offsets_.SetInt32(i * element_size, offset);
}
}
diff --git a/runtime/vm/intermediate_language.h b/runtime/vm/intermediate_language.h
index 370bd8f..a12992d 100644
--- a/runtime/vm/intermediate_language.h
+++ b/runtime/vm/intermediate_language.h
@@ -2199,7 +2199,7 @@
// to IndirectGoto as an input.
class IndirectGotoInstr : public TemplateInstruction<1, NoThrow> {
public:
- IndirectGotoInstr(GrowableObjectArray* offsets,
+ IndirectGotoInstr(TypedData* offsets,
Value* offset_from_start)
: offsets_(*offsets) {
SetInputAt(0, offset_from_start);
@@ -2207,6 +2207,11 @@
DECLARE_INSTRUCTION(IndirectGoto)
+ virtual Representation RequiredInputRepresentation(intptr_t idx) const {
+ ASSERT(idx == 0);
+ return kNoRepresentation;
+ }
+
virtual intptr_t ArgumentCount() const { return 0; }
void AddSuccessor(TargetEntryInstr* successor) {
@@ -2228,12 +2233,12 @@
virtual void PrintTo(BufferFormatter* f) const;
- const GrowableObjectArray& offsets() const { return offsets_; }
+ Value* offset() const { return inputs_[0]; }
void ComputeOffsetTable(Isolate* isolate);
private:
GrowableArray<TargetEntryInstr*> successors_;
- GrowableObjectArray& offsets_;
+ TypedData& offsets_;
};
@@ -3425,7 +3430,8 @@
offset_in_bytes_(field.Offset()),
emit_store_barrier_(emit_store_barrier),
token_pos_(token_pos),
- is_initialization_(false) {
+ is_potential_unboxed_initialization_(false),
+ is_object_reference_initialization_(false) {
SetInputAt(kInstancePos, instance);
SetInputAt(kValuePos, value);
}
@@ -3439,14 +3445,20 @@
offset_in_bytes_(offset_in_bytes),
emit_store_barrier_(emit_store_barrier),
token_pos_(token_pos),
- is_initialization_(false) {
+ is_potential_unboxed_initialization_(false),
+ is_object_reference_initialization_(false) {
SetInputAt(kInstancePos, instance);
SetInputAt(kValuePos, value);
}
DECLARE_INSTRUCTION(StoreInstanceField)
- void set_is_initialization(bool value) { is_initialization_ = value; }
+ void set_is_potential_unboxed_initialization(bool value) {
+ is_potential_unboxed_initialization_ = value;
+ }
+ void set_is_object_reference_initialization(bool value) {
+ is_object_reference_initialization_ = value;
+ }
enum {
kInstancePos = 0,
@@ -3455,7 +3467,12 @@
Value* instance() const { return inputs_[kInstancePos]; }
Value* value() const { return inputs_[kValuePos]; }
- bool is_initialization() const { return is_initialization_; }
+ bool is_potential_unboxed_initialization() const {
+ return is_potential_unboxed_initialization_;
+ }
+ bool is_object_reference_initialization() const {
+ return is_object_reference_initialization_;
+ }
virtual intptr_t token_pos() const { return token_pos_; }
const Field& field() const { return field_; }
@@ -3500,7 +3517,11 @@
intptr_t offset_in_bytes_;
const StoreBarrierType emit_store_barrier_;
const intptr_t token_pos_;
- bool is_initialization_; // Marks stores in the constructor.
+ // This may be the first store to an unboxed field.
+ bool is_potential_unboxed_initialization_;
+ // True if this store initializes an object reference field of an object that
+ // was allocated uninitialized; see AllocateUninitializedContext.
+ bool is_object_reference_initialization_;
DISALLOW_COPY_AND_ASSIGN(StoreInstanceFieldInstr);
};
@@ -7581,6 +7602,8 @@
void set_licm_hoisted(bool value) { licm_hoisted_ = value; }
+ static bool IsImmutableClassId(intptr_t cid);
+
private:
const ICData& unary_checks_;
GrowableArray<intptr_t> cids_; // Sorted, lowest first.
diff --git a/runtime/vm/intermediate_language_arm.cc b/runtime/vm/intermediate_language_arm.cc
index cc62653..1c2eb89 100644
--- a/runtime/vm/intermediate_language_arm.cc
+++ b/runtime/vm/intermediate_language_arm.cc
@@ -1993,7 +1993,7 @@
((IsPotentialUnboxedStore()) ? 3 : 0);
LocationSummary* summary = new(isolate) LocationSummary(
isolate, kNumInputs, kNumTemps,
- ((IsUnboxedStore() && opt && is_initialization_) ||
+ ((IsUnboxedStore() && opt && is_potential_unboxed_initialization_) ||
IsPotentialUnboxedStore())
? LocationSummary::kCallOnSlowPath
: LocationSummary::kNoCall);
@@ -2053,7 +2053,7 @@
const Register temp2 = locs()->temp(1).reg();
const intptr_t cid = field().UnboxedFieldCid();
- if (is_initialization_) {
+ if (is_potential_unboxed_initialization_) {
const Class* cls = NULL;
switch (cid) {
case kDoubleCid:
@@ -6778,9 +6778,11 @@
// Add the offset.
Register offset_reg = locs()->in(0).reg();
- __ add(target_address_reg,
- target_address_reg,
- Operand(offset_reg, ASR, kSmiTagSize));
+ Operand offset_opr =
+ (offset()->definition()->representation() == kTagged) ?
+ Operand(offset_reg, ASR, kSmiTagSize) :
+ Operand(offset_reg);
+ __ add(target_address_reg, target_address_reg, offset_opr);
// Jump to the absolute address.
__ bx(target_address_reg);
diff --git a/runtime/vm/intermediate_language_arm64.cc b/runtime/vm/intermediate_language_arm64.cc
index 2080ef2..4e9794f 100644
--- a/runtime/vm/intermediate_language_arm64.cc
+++ b/runtime/vm/intermediate_language_arm64.cc
@@ -1753,7 +1753,7 @@
((IsPotentialUnboxedStore()) ? 2 : 0);
LocationSummary* summary = new(isolate) LocationSummary(
isolate, kNumInputs, kNumTemps,
- ((IsUnboxedStore() && opt && is_initialization_) ||
+ ((IsUnboxedStore() && opt && is_potential_unboxed_initialization_) ||
IsPotentialUnboxedStore())
? LocationSummary::kCallOnSlowPath
: LocationSummary::kNoCall);
@@ -1789,7 +1789,7 @@
const Register temp2 = locs()->temp(1).reg();
const intptr_t cid = field().UnboxedFieldCid();
- if (is_initialization_) {
+ if (is_potential_unboxed_initialization_) {
const Class* cls = NULL;
switch (cid) {
case kDoubleCid:
@@ -5462,9 +5462,11 @@
// Add the offset.
Register offset_reg = locs()->in(0).reg();
- __ add(target_address_reg,
- target_address_reg,
- Operand(offset_reg, ASR, kSmiTagSize));
+ Operand offset_opr =
+ (offset()->definition()->representation() == kTagged) ?
+ Operand(offset_reg, ASR, kSmiTagSize) :
+ Operand(offset_reg);
+ __ add(target_address_reg, target_address_reg, offset_opr);
// Jump to the absolute address.
__ br(target_address_reg);
diff --git a/runtime/vm/intermediate_language_ia32.cc b/runtime/vm/intermediate_language_ia32.cc
index dd6ae5c..79978e9 100644
--- a/runtime/vm/intermediate_language_ia32.cc
+++ b/runtime/vm/intermediate_language_ia32.cc
@@ -1718,7 +1718,7 @@
((IsPotentialUnboxedStore()) ? 3 : 0);
LocationSummary* summary = new(isolate) LocationSummary(
isolate, kNumInputs, kNumTemps,
- ((IsUnboxedStore() && opt && is_initialization_) ||
+ ((IsUnboxedStore() && opt && is_potential_unboxed_initialization_) ||
IsPotentialUnboxedStore())
? LocationSummary::kCallOnSlowPath
: LocationSummary::kNoCall);
@@ -1779,7 +1779,7 @@
Register temp2 = locs()->temp(1).reg();
const intptr_t cid = field().UnboxedFieldCid();
- if (is_initialization_) {
+ if (is_potential_unboxed_initialization_) {
const Class* cls = NULL;
switch (cid) {
case kDoubleCid:
@@ -1927,11 +1927,18 @@
__ StoreIntoObjectNoBarrier(
instance_reg,
FieldAddress(instance_reg, offset_in_bytes_),
- locs()->in(1).constant());
+ locs()->in(1).constant(),
+ is_object_reference_initialization_ ?
+ Assembler::kEmptyOrSmiOrNull :
+ Assembler::kHeapObjectOrSmi);
} else {
Register value_reg = locs()->in(1).reg();
__ StoreIntoObjectNoBarrier(instance_reg,
- FieldAddress(instance_reg, offset_in_bytes_), value_reg);
+ FieldAddress(instance_reg, offset_in_bytes_),
+ value_reg,
+ is_object_reference_initialization_ ?
+ Assembler::kEmptyOrSmiOrNull :
+ Assembler::kHeapObjectOrSmi);
}
}
__ Bind(&skip_store);
@@ -2050,12 +2057,12 @@
EBX); // end address
// Store the type argument field.
- __ StoreIntoObjectNoBarrier(EAX,
+ __ InitializeFieldNoBarrier(EAX,
FieldAddress(EAX, Array::type_arguments_offset()),
kElemTypeReg);
// Set the length field.
- __ StoreIntoObjectNoBarrier(EAX,
+ __ InitializeFieldNoBarrier(EAX,
FieldAddress(EAX, Array::length_offset()),
kLengthReg);
@@ -2073,13 +2080,13 @@
intptr_t current_offset = 0;
__ movl(EBX, raw_null);
while (current_offset < array_size) {
- __ StoreIntoObjectNoBarrier(EAX, Address(EDI, current_offset), EBX);
+ __ InitializeFieldNoBarrier(EAX, Address(EDI, current_offset), EBX);
current_offset += kWordSize;
}
} else {
Label init_loop;
__ Bind(&init_loop);
- __ StoreIntoObjectNoBarrier(EAX, Address(EDI, 0), Object::null_object());
+ __ InitializeFieldNoBarrier(EAX, Address(EDI, 0), Object::null_object());
__ addl(EDI, Immediate(kWordSize));
__ cmpl(EDI, EBX);
__ j(BELOW, &init_loop, Assembler::kNearJump);
@@ -6550,7 +6557,9 @@
// Add the offset.
Register offset_reg = locs()->in(0).reg();
- __ SmiUntag(offset_reg);
+ if (offset()->definition()->representation() == kTagged) {
+ __ SmiUntag(offset_reg);
+ }
__ addl(target_address_reg, offset_reg);
// Jump to the absolute address.
diff --git a/runtime/vm/intermediate_language_mips.cc b/runtime/vm/intermediate_language_mips.cc
index cc97483..5f79413 100644
--- a/runtime/vm/intermediate_language_mips.cc
+++ b/runtime/vm/intermediate_language_mips.cc
@@ -1916,7 +1916,7 @@
((IsPotentialUnboxedStore()) ? 3 : 0);
LocationSummary* summary = new(isolate) LocationSummary(
isolate, kNumInputs, kNumTemps,
- ((IsUnboxedStore() && opt && is_initialization_) ||
+ ((IsUnboxedStore() && opt && is_potential_unboxed_initialization_) ||
IsPotentialUnboxedStore())
? LocationSummary::kCallOnSlowPath
: LocationSummary::kNoCall);
@@ -1971,7 +1971,7 @@
Register temp2 = locs()->temp(1).reg();
const intptr_t cid = field().UnboxedFieldCid();
- if (is_initialization_) {
+ if (is_potential_unboxed_initialization_) {
const Class* cls = NULL;
switch (cid) {
case kDoubleCid:
@@ -5439,7 +5439,9 @@
// Add the offset.
Register offset_reg = locs()->in(0).reg();
+ if (offset()->definition()->representation() == kTagged) {
__ SmiUntag(offset_reg);
+ }
__ addu(target_address_reg, target_address_reg, offset_reg);
// Jump to the absolute address.
diff --git a/runtime/vm/intermediate_language_x64.cc b/runtime/vm/intermediate_language_x64.cc
index a12001c..867c335 100644
--- a/runtime/vm/intermediate_language_x64.cc
+++ b/runtime/vm/intermediate_language_x64.cc
@@ -1274,11 +1274,11 @@
break;
case kTypedDataInt16ArrayCid:
case kTypedDataUint16ArrayCid:
- case kTypedDataInt32ArrayCid:
- case kTypedDataUint32ArrayCid:
// Writable register because the value must be untagged before storing.
locs->set_in(2, Location::WritableRegister());
break;
+ case kTypedDataInt32ArrayCid:
+ case kTypedDataUint32ArrayCid:
case kTypedDataInt64ArrayCid:
locs->set_in(2, Location::RequiresRegister());
break;
@@ -1724,7 +1724,7 @@
((IsPotentialUnboxedStore()) ? 3 : 0);
LocationSummary* summary = new(isolate) LocationSummary(
isolate, kNumInputs, kNumTemps,
- ((IsUnboxedStore() && opt && is_initialization_) ||
+ ((IsUnboxedStore() && opt && is_potential_unboxed_initialization_) ||
IsPotentialUnboxedStore())
? LocationSummary::kCallOnSlowPath
: LocationSummary::kNoCall);
@@ -1783,7 +1783,7 @@
Register temp2 = locs()->temp(1).reg();
const intptr_t cid = field().UnboxedFieldCid();
- if (is_initialization_) {
+ if (is_potential_unboxed_initialization_) {
const Class* cls = NULL;
switch (cid) {
case kDoubleCid:
@@ -1928,11 +1928,19 @@
if (locs()->in(1).IsConstant()) {
__ StoreIntoObjectNoBarrier(instance_reg,
FieldAddress(instance_reg, offset_in_bytes_),
- locs()->in(1).constant(), PP);
+ locs()->in(1).constant(),
+ PP,
+ is_object_reference_initialization_ ?
+ Assembler::kEmptyOrSmiOrNull :
+ Assembler::kHeapObjectOrSmi);
} else {
Register value_reg = locs()->in(1).reg();
__ StoreIntoObjectNoBarrier(instance_reg,
- FieldAddress(instance_reg, offset_in_bytes_), value_reg);
+ FieldAddress(instance_reg, offset_in_bytes_),
+ value_reg,
+ is_object_reference_initialization_ ?
+ Assembler::kEmptyOrSmiOrNull :
+ Assembler::kHeapObjectOrSmi);
}
}
__ Bind(&skip_store);
@@ -2048,12 +2056,12 @@
// RAX: new object start as a tagged pointer.
// Store the type argument field.
- __ StoreIntoObjectNoBarrier(RAX,
+ __ InitializeFieldNoBarrier(RAX,
FieldAddress(RAX, Array::type_arguments_offset()),
kElemTypeReg);
// Set the length field.
- __ StoreIntoObjectNoBarrier(RAX,
+ __ InitializeFieldNoBarrier(RAX,
FieldAddress(RAX, Array::length_offset()),
kLengthReg);
@@ -2069,13 +2077,13 @@
if (array_size < (kInlineArraySize * kWordSize)) {
intptr_t current_offset = 0;
while (current_offset < array_size) {
- __ StoreIntoObjectNoBarrier(RAX, Address(RDI, current_offset), R12);
+ __ InitializeFieldNoBarrier(RAX, Address(RDI, current_offset), R12);
current_offset += kWordSize;
}
} else {
Label init_loop;
__ Bind(&init_loop);
- __ StoreIntoObjectNoBarrier(RAX, Address(RDI, 0), R12);
+ __ InitializeFieldNoBarrier(RAX, Address(RDI, 0), R12);
__ addq(RDI, Immediate(kWordSize));
__ cmpq(RDI, RCX);
__ j(BELOW, &init_loop, Assembler::kNearJump);
@@ -6208,7 +6216,9 @@
__ movq(target_address_reg, Address(RBP, kPcMarkerSlotFromFp * kWordSize));
// Calculate the final absolute address.
- __ SmiUntag(offset_reg);
+ if (offset()->definition()->representation() == kTagged) {
+ __ SmiUntag(offset_reg);
+ }
__ addq(target_address_reg, offset_reg);
// Jump to the absolute address.
diff --git a/runtime/vm/intrinsifier_ia32.cc b/runtime/vm/intrinsifier_ia32.cc
index ecd126c..7415188 100644
--- a/runtime/vm/intrinsifier_ia32.cc
+++ b/runtime/vm/intrinsifier_ia32.cc
@@ -115,12 +115,17 @@
// Try allocating in new space.
const Class& cls = Class::Handle(
Isolate::Current()->object_store()->growable_object_array_class());
- __ TryAllocate(cls, &fall_through, Assembler::kNearJump, EAX, EBX);
+#if defined(DEBUG)
+ static const bool kJumpLength = Assembler::kFarJump;
+#else
+ static const bool kJumpLength = Assembler::kNearJump;
+#endif // DEBUG
+ __ TryAllocate(cls, &fall_through, kJumpLength, EAX, EBX);
// Store backing array object in growable array object.
__ movl(EBX, Address(ESP, kArrayOffset)); // data argument.
// EAX is new, no barrier needed.
- __ StoreIntoObjectNoBarrier(
+ __ InitializeFieldNoBarrier(
EAX,
FieldAddress(EAX, GrowableObjectArray::data_offset()),
EBX);
@@ -128,12 +133,12 @@
// EAX: new growable array object start as a tagged pointer.
// Store the type argument field in the growable array object.
__ movl(EBX, Address(ESP, kTypeArgumentsOffset)); // type argument.
- __ StoreIntoObjectNoBarrier(
+ __ InitializeFieldNoBarrier(
EAX,
FieldAddress(EAX, GrowableObjectArray::type_arguments_offset()),
EBX);
- __ ZeroSmiField(FieldAddress(EAX, GrowableObjectArray::length_offset()));
+ __ ZeroInitSmiField(FieldAddress(EAX, GrowableObjectArray::length_offset()));
__ ret(); // returns the newly allocated object in EAX.
__ Bind(&fall_through);
@@ -328,7 +333,7 @@
/* EAX: new object start as a tagged pointer. */ \
/* EBX: new object end address. */ \
__ movl(EDI, Address(ESP, kArrayLengthStackOffset)); /* Array length. */ \
- __ StoreIntoObjectNoBarrier(EAX, \
+ __ InitializeFieldNoBarrier(EAX, \
FieldAddress(EAX, type_name::length_offset()), \
EDI); \
/* Initialize all array elements to 0. */ \
@@ -1868,14 +1873,14 @@
// EDI: allocation size.
__ addl(EBX, EDI);
- __ j(CARRY, &pop_and_fail, Assembler::kNearJump);
+ __ j(CARRY, &pop_and_fail);
// Check if the allocation fits into the remaining space.
// EAX: potential new object start.
// EBX: potential next object start.
// EDI: allocation size.
__ cmpl(EBX, Address::Absolute(heap->EndAddress(space)));
- __ j(ABOVE_EQUAL, &pop_and_fail, Assembler::kNearJump);
+ __ j(ABOVE_EQUAL, &pop_and_fail);
// Successfully allocated the object(s), now update top to point to
// next object start and initialize the object.
@@ -1906,11 +1911,11 @@
// Set the length field.
__ popl(EDI);
- __ StoreIntoObjectNoBarrier(EAX,
+ __ InitializeFieldNoBarrier(EAX,
FieldAddress(EAX, String::length_offset()),
EDI);
// Clear hash.
- __ ZeroSmiField(FieldAddress(EAX, String::hash_offset()));
+ __ ZeroInitSmiField(FieldAddress(EAX, String::hash_offset()));
__ jmp(ok, Assembler::kNearJump);
__ Bind(&pop_and_fail);
diff --git a/runtime/vm/intrinsifier_x64.cc b/runtime/vm/intrinsifier_x64.cc
index c8fb868..4f80141 100644
--- a/runtime/vm/intrinsifier_x64.cc
+++ b/runtime/vm/intrinsifier_x64.cc
@@ -76,7 +76,7 @@
// Store backing array object in growable array object.
__ movq(RCX, Address(RSP, kArrayOffset)); // data argument.
// RAX is new, no barrier needed.
- __ StoreIntoObjectNoBarrier(
+ __ InitializeFieldNoBarrier(
RAX,
FieldAddress(RAX, GrowableObjectArray::data_offset()),
RCX);
@@ -84,13 +84,13 @@
// RAX: new growable array object start as a tagged pointer.
// Store the type argument field in the growable array object.
__ movq(RCX, Address(RSP, kTypeArgumentsOffset)); // type argument.
- __ StoreIntoObjectNoBarrier(
+ __ InitializeFieldNoBarrier(
RAX,
FieldAddress(RAX, GrowableObjectArray::type_arguments_offset()),
RCX);
// Set the length field in the growable array object to 0.
- __ ZeroSmiField(FieldAddress(RAX, GrowableObjectArray::length_offset()));
+ __ ZeroInitSmiField(FieldAddress(RAX, GrowableObjectArray::length_offset()));
__ ret(); // returns the newly allocated object in RAX.
__ Bind(&fall_through);
@@ -286,7 +286,7 @@
/* RAX: new object start as a tagged pointer. */ \
/* RCX: new object end address. */ \
__ movq(RDI, Address(RSP, kArrayLengthStackOffset)); /* Array length. */ \
- __ StoreIntoObjectNoBarrier(RAX, \
+ __ InitializeFieldNoBarrier(RAX, \
FieldAddress(RAX, type_name::length_offset()), \
RDI); \
/* Initialize all array elements to 0. */ \
@@ -1778,11 +1778,11 @@
// Set the length field.
__ popq(RDI);
- __ StoreIntoObjectNoBarrier(RAX,
+ __ InitializeFieldNoBarrier(RAX,
FieldAddress(RAX, String::length_offset()),
RDI);
// Clear hash.
- __ ZeroSmiField(FieldAddress(RAX, String::hash_offset()));
+ __ ZeroInitSmiField(FieldAddress(RAX, String::hash_offset()));
__ jmp(ok, Assembler::kNearJump);
__ Bind(&pop_and_fail);
diff --git a/runtime/vm/isolate.cc b/runtime/vm/isolate.cc
index e76b09e..0b3c156 100644
--- a/runtime/vm/isolate.cc
+++ b/runtime/vm/isolate.cc
@@ -52,6 +52,24 @@
#define I (isolate())
+#if defined(DEBUG)
+// Helper class to ensure that a live origin_id is never reused
+// and assigned to an isolate.
+class VerifyOriginId : public IsolateVisitor {
+ public:
+ explicit VerifyOriginId(Dart_Port id) : id_(id) {}
+
+ void VisitIsolate(Isolate* isolate) {
+ ASSERT(isolate->origin_id() != id_);
+ }
+
+ private:
+ Dart_Port id_;
+ DISALLOW_COPY_AND_ASSIGN(VerifyOriginId);
+};
+#endif
+
+
static uint8_t* allocator(uint8_t* ptr, intptr_t old_size, intptr_t new_size) {
void* new_ptr = realloc(reinterpret_cast<void*>(ptr), new_size);
return reinterpret_cast<uint8_t*>(new_ptr);
@@ -60,8 +78,9 @@
static void SerializeObject(const Instance& obj,
uint8_t** obj_data,
- intptr_t* obj_len) {
- MessageWriter writer(obj_data, &allocator);
+ intptr_t* obj_len,
+ bool allow_any_object) {
+ MessageWriter writer(obj_data, &allocator, allow_any_object);
writer.WriteMessage(obj);
*obj_len = writer.BytesWritten();
}
@@ -97,8 +116,6 @@
#endif
bool IsCurrentIsolate() const;
virtual Isolate* isolate() const { return isolate_; }
- bool UnhandledExceptionCallbackHandler(const Object& message,
- const UnhandledException& error);
private:
// Keep in sync with isolate_patch.dart.
@@ -117,8 +134,7 @@
// processing of further events.
bool HandleLibMessage(const Array& message);
- bool ProcessUnhandledException(const Object& message, const Error& result);
- RawFunction* ResolveCallbackFunction();
+ bool ProcessUnhandledException(const Error& result);
Isolate* isolate_;
};
@@ -181,7 +197,7 @@
if (priority == kImmediateAction) {
uint8_t* data = NULL;
intptr_t len = 0;
- SerializeObject(Object::null_instance(), &data, &len);
+ SerializeObject(Object::null_instance(), &data, &len, false);
PortMap::PostMessage(new Message(send_port.Id(),
data, len,
Message::kNormalPriority));
@@ -195,7 +211,7 @@
message.SetAt(3, Smi::Handle(I, Smi::New(kImmediateAction)));
uint8_t* data = NULL;
intptr_t len = 0;
- SerializeObject(message, &data, &len);
+ SerializeObject(message, &data, &len, false);
this->PostMessage(new Message(Message::kIllegalPort,
data, len,
Message::kNormalPriority),
@@ -223,7 +239,7 @@
message.SetAt(3, Smi::Handle(I, Smi::New(kImmediateAction)));
uint8_t* data = NULL;
intptr_t len = 0;
- SerializeObject(message, &data, &len);
+ SerializeObject(message, &data, &len, false);
this->PostMessage(new Message(Message::kIllegalPort,
data, len,
Message::kNormalPriority),
@@ -272,8 +288,7 @@
msg_handler = DartLibraryCalls::LookupHandler(message->dest_port());
if (msg_handler.IsError()) {
delete message;
- return ProcessUnhandledException(Object::null_instance(),
- Error::Cast(msg_handler));
+ return ProcessUnhandledException(Error::Cast(msg_handler));
}
if (msg_handler.IsNull()) {
// If the port has been closed then the message will be dropped at this
@@ -293,8 +308,7 @@
if (msg_obj.IsError()) {
// An error occurred while reading the message.
delete message;
- return ProcessUnhandledException(Object::null_instance(),
- Error::Cast(msg_obj));
+ return ProcessUnhandledException(Error::Cast(msg_obj));
}
if (!msg_obj.IsNull() && !msg_obj.IsInstance()) {
// TODO(turnidge): We need to decide what an isolate does with
@@ -356,7 +370,7 @@
const Object& result = Object::Handle(I,
DartLibraryCalls::HandleMessage(msg_handler, msg));
if (result.IsError()) {
- success = ProcessUnhandledException(msg, Error::Cast(result));
+ success = ProcessUnhandledException(Error::Cast(result));
} else {
ASSERT(result.IsNull());
}
@@ -366,71 +380,6 @@
}
-RawFunction* IsolateMessageHandler::ResolveCallbackFunction() {
- ASSERT(I->object_store()->unhandled_exception_handler() != NULL);
- String& callback_name = String::Handle(I);
- if (I->object_store()->unhandled_exception_handler() != String::null()) {
- callback_name = I->object_store()->unhandled_exception_handler();
- } else {
- callback_name = String::New("_unhandledExceptionCallback");
- }
- Library& lib = Library::Handle(I, I->object_store()->isolate_library());
- Function& func = Function::Handle(I, lib.LookupLocalFunction(callback_name));
- if (func.IsNull()) {
- lib = I->object_store()->root_library();
- // Note: bootstrap code in builtin library may attempt to resolve a
- // callback function before the script is fully loaded, in which case
- // the root library may not be registered yet.
- if (!lib.IsNull()) {
- func = lib.LookupLocalFunction(callback_name);
- }
- }
- return func.raw();
-}
-
-
-bool IsolateMessageHandler::UnhandledExceptionCallbackHandler(
- const Object& message, const UnhandledException& error) {
- const Instance& cause = Instance::Handle(I, error.exception());
- const Instance& stacktrace = Instance::Handle(I, error.stacktrace());
-
- // Wrap these args into an IsolateUncaughtException object.
- const Array& exception_args = Array::Handle(I, Array::New(3));
- exception_args.SetAt(0, message);
- exception_args.SetAt(1, cause);
- exception_args.SetAt(2, stacktrace);
- const Object& exception = Object::Handle(I,
- Exceptions::Create(Exceptions::kIsolateUnhandledException,
- exception_args));
- if (exception.IsError()) {
- return false;
- }
- ASSERT(exception.IsInstance());
-
- // Invoke script's callback function.
- Object& function = Object::Handle(I, ResolveCallbackFunction());
- if (function.IsNull() || function.IsError()) {
- return false;
- }
- const Array& callback_args = Array::Handle(I, Array::New(1));
- callback_args.SetAt(0, exception);
- const Object& result = Object::Handle(I,
- DartEntry::InvokeFunction(Function::Cast(function), callback_args));
- if (result.IsError()) {
- const Error& err = Error::Cast(result);
- OS::PrintErr("failed calling unhandled exception callback: %s\n",
- err.ToErrorCString());
- return false;
- }
-
- ASSERT(result.IsBool());
- bool continue_from_exception = Bool::Cast(result).value();
- if (continue_from_exception) {
- I->object_store()->clear_sticky_error();
- }
- return continue_from_exception;
-}
-
#if defined(DEBUG)
void IsolateMessageHandler::CheckAccess() {
ASSERT(IsCurrentIsolate());
@@ -443,10 +392,10 @@
}
-bool IsolateMessageHandler::ProcessUnhandledException(
- const Object& message, const Error& result) {
+bool IsolateMessageHandler::ProcessUnhandledException(const Error& result) {
+ // Notify the debugger about specific unhandled exceptions which are withheld
+ // when being thrown.
if (result.IsUnhandledException()) {
- // Invoke the isolate's uncaught exception handler, if it exists.
const UnhandledException& error = UnhandledException::Cast(result);
RawInstance* exception = error.exception();
if ((exception == I->object_store()->out_of_memory()) ||
@@ -454,12 +403,6 @@
// We didn't notify the debugger when the stack was full. Do it now.
I->debugger()->SignalExceptionThrown(Instance::Handle(exception));
}
- if ((exception != I->object_store()->out_of_memory()) &&
- (exception != I->object_store()->stack_overflow())) {
- if (UnhandledExceptionCallbackHandler(message, error)) {
- return true;
- }
- }
}
// Invoke the isolate's unhandled exception callback if there is one.
@@ -498,6 +441,7 @@
name_(NULL),
start_time_(OS::GetCurrentTimeMicros()),
main_port_(0),
+ origin_id_(0),
pause_capability_(0),
terminate_capability_(0),
heap_(NULL),
@@ -708,6 +652,12 @@
// main thread.
result->SetStackLimitFromStackBase(reinterpret_cast<uword>(&result));
result->set_main_port(PortMap::CreatePort(result->message_handler()));
+#if defined(DEBUG)
+ // Verify that we are never reusing a live origin id.
+ VerifyOriginId id_verifier(result->main_port());
+ Isolate::VisitIsolates(&id_verifier);
+#endif
+ result->set_origin_id(result->main_port());
result->set_pause_capability(result->random()->NextUInt64());
result->set_terminate_capability(result->random()->NextUInt64());
@@ -929,12 +879,6 @@
return false;
}
- // Set up specific unhandled exception handler.
- const String& callback_name = String::Handle(
- isolate, String::New(state->exception_callback_name()));
- isolate->object_store()->
- set_unhandled_exception_handler(callback_name);
-
Object& result = Object::Handle();
result = state->ResolveFunction();
bool is_spawn_uri = state->is_spawn_uri();
@@ -1551,7 +1495,6 @@
library_url_(NULL),
class_name_(NULL),
function_name_(NULL),
- exception_callback_name_(NULL),
serialized_args_(NULL),
serialized_args_len_(0),
serialized_message_(NULL),
@@ -1569,8 +1512,11 @@
const String& class_name = String::Handle(cls.Name());
class_name_ = strdup(class_name.ToCString());
}
- exception_callback_name_ = strdup("_unhandledExceptionCallback");
- SerializeObject(message, &serialized_message_, &serialized_message_len_);
+ bool can_send_any_object = true;
+ SerializeObject(message,
+ &serialized_message_,
+ &serialized_message_len_,
+ can_send_any_object);
}
@@ -1586,7 +1532,6 @@
library_url_(NULL),
class_name_(NULL),
function_name_(NULL),
- exception_callback_name_(NULL),
serialized_args_(NULL),
serialized_args_len_(0),
serialized_message_(NULL),
@@ -1598,9 +1543,15 @@
}
library_url_ = NULL;
function_name_ = strdup("main");
- exception_callback_name_ = strdup("_unhandledExceptionCallback");
- SerializeObject(args, &serialized_args_, &serialized_args_len_);
- SerializeObject(message, &serialized_message_, &serialized_message_len_);
+ bool can_send_any_object = false;
+ SerializeObject(args,
+ &serialized_args_,
+ &serialized_args_len_,
+ can_send_any_object);
+ SerializeObject(message,
+ &serialized_message_,
+ &serialized_message_len_,
+ can_send_any_object);
}
@@ -1610,7 +1561,6 @@
free(library_url_);
free(function_name_);
free(class_name_);
- free(exception_callback_name_);
free(serialized_args_);
free(serialized_message_);
}
diff --git a/runtime/vm/isolate.h b/runtime/vm/isolate.h
index 5302c42..d2fb921 100644
--- a/runtime/vm/isolate.h
+++ b/runtime/vm/isolate.h
@@ -170,6 +170,12 @@
ASSERT(main_port_ == 0); // Only set main port once.
main_port_ = port;
}
+ Dart_Port origin_id() const { return origin_id_; }
+ void set_origin_id(Dart_Port id) {
+ ASSERT((id == main_port_ && origin_id_ == 0) ||
+ (origin_id_ == main_port_));
+ origin_id_ = id;
+ }
void set_pause_capability(uint64_t value) { pause_capability_ = value; }
uint64_t pause_capability() const { return pause_capability_; }
void set_terminate_capability(uint64_t value) {
@@ -633,6 +639,7 @@
char* name_;
int64_t start_time_;
Dart_Port main_port_;
+ Dart_Port origin_id_; // Isolates created by spawnFunc have some origin id.
uint64_t pause_capability_;
uint64_t terminate_capability_;
Heap* heap_;
@@ -834,7 +841,6 @@
char* library_url() const { return library_url_; }
char* class_name() const { return class_name_; }
char* function_name() const { return function_name_; }
- char* exception_callback_name() const { return exception_callback_name_; }
bool is_spawn_uri() const { return library_url_ == NULL; }
bool paused() const { return paused_; }
@@ -851,7 +857,6 @@
char* library_url_;
char* class_name_;
char* function_name_;
- char* exception_callback_name_;
uint8_t* serialized_args_;
intptr_t serialized_args_len_;
uint8_t* serialized_message_;
diff --git a/runtime/vm/json_stream.cc b/runtime/vm/json_stream.cc
index d87ca01..ecdd2ae 100644
--- a/runtime/vm/json_stream.cc
+++ b/runtime/vm/json_stream.cc
@@ -102,7 +102,7 @@
ASSERT(!reply.IsNull());
uint8_t* data = NULL;
- MessageWriter writer(&data, &allocator);
+ MessageWriter writer(&data, &allocator, false);
writer.WriteMessage(reply);
PortMap::PostMessage(new Message(port, data,
writer.BytesWritten(),
diff --git a/runtime/vm/method_recognizer.h b/runtime/vm/method_recognizer.h
index 5f8f2a3..188fd4d 100644
--- a/runtime/vm/method_recognizer.h
+++ b/runtime/vm/method_recognizer.h
@@ -157,7 +157,7 @@
V(_Smi, get:bitLength, Smi_bitLength, 869986288) \
V(_Bigint, set:_neg, Bigint_setNeg, 1924982939) \
V(_Bigint, set:_used, Bigint_setUsed, 1574448752) \
- V(_Bigint, _set_digits, Bigint_setDigits, 1865626071) \
+ V(_Bigint, set:_digits, Bigint_setDigits, 1109140916) \
V(_Bigint, _absAdd, Bigint_absAdd, 97148049) \
V(_Bigint, _absSub, Bigint_absSub, 159012285) \
V(_Bigint, _mulAdd, Bigint_mulAdd, 1625285265) \
@@ -381,8 +381,7 @@
V(_Bigint, get:_used, Bigint_getUsed, 1308559334) \
V(_Bigint, set:_used, Bigint_setUsed, 1574448752) \
V(_Bigint, get:_digits, Bigint_getDigits, 1408092463) \
- V(_Bigint, set:_digits, Bigint_setDigits, 1625268649) \
- V(_Bigint, _set_digits, Bigint_setDigits, 1865626071) \
+ V(_Bigint, set:_digits, Bigint_setDigits, 1109140916) \
// A list of core function that should never be inlined.
#define INLINE_BLACK_LIST(V) \
diff --git a/runtime/vm/object.cc b/runtime/vm/object.cc
index f315d20..4046022f 100644
--- a/runtime/vm/object.cc
+++ b/runtime/vm/object.cc
@@ -162,11 +162,14 @@
// The following functions are marked as invisible, meaning they will be hidden
// in the stack trace and will be hidden from reflective access.
+// All mutators of canonical constants should be hidden from reflective access.
// Additionally, private functions in dart:* that are native or constructors are
// marked as invisible by the parser.
#define INVISIBLE_CLASS_FUNCTIONS(V) \
V(AsyncLibrary, _AsyncRun, _scheduleImmediate) \
V(CoreLibrary, StringBuffer, _addPart) \
+ V(CoreLibrary, _Bigint, _ensureLength) \
+ V(CoreLibrary, _Bigint, _clamp) \
V(CoreLibrary, _Bigint, _absAdd) \
V(CoreLibrary, _Bigint, _absSub) \
V(CoreLibrary, _Bigint, _estQuotientDigit) \
@@ -19939,7 +19942,8 @@
bool is_control_port,
Heap::Space space) {
Isolate* isolate = Isolate::Current();
- const SendPort& send_port = SendPort::Handle(isolate, SendPort::New(id));
+ const SendPort& send_port =
+ SendPort::Handle(isolate, SendPort::New(id, isolate->origin_id()));
ReceivePort& result = ReceivePort::Handle(isolate);
{
@@ -19970,6 +19974,13 @@
RawSendPort* SendPort::New(Dart_Port id, Heap::Space space) {
+ return New(id, Isolate::Current()->origin_id(), space);
+}
+
+
+RawSendPort* SendPort::New(Dart_Port id,
+ Dart_Port origin_id,
+ Heap::Space space) {
SendPort& result = SendPort::Handle();
{
RawObject* raw = Object::Allocate(SendPort::kClassId,
@@ -19978,6 +19989,7 @@
NoGCScope no_gc;
result ^= raw;
result.StoreNonPointer(&result.raw_ptr()->id_, id);
+ result.StoreNonPointer(&result.raw_ptr()->origin_id_, origin_id);
}
return result.raw();
}
diff --git a/runtime/vm/object.h b/runtime/vm/object.h
index 3c9a99f..9adf134 100644
--- a/runtime/vm/object.h
+++ b/runtime/vm/object.h
@@ -7247,10 +7247,20 @@
public:
Dart_Port Id() const { return raw_ptr()->id_; }
+ Dart_Port origin_id() const { return raw_ptr()->origin_id_; }
+ void set_origin_id(Dart_Port id) const {
+ ASSERT(origin_id() == 0);
+ StoreNonPointer(&(raw_ptr()->origin_id_), id);
+ }
+
static intptr_t InstanceSize() {
return RoundedAllocationSize(sizeof(RawSendPort));
}
- static RawSendPort* New(Dart_Port id, Heap::Space space = Heap::kNew);
+ static RawSendPort* New(Dart_Port id,
+ Heap::Space space = Heap::kNew);
+ static RawSendPort* New(Dart_Port id,
+ Dart_Port origin_id,
+ Heap::Space space = Heap::kNew);
private:
FINAL_HEAP_OBJECT_IMPLEMENTATION(SendPort, Instance);
diff --git a/runtime/vm/object_store.cc b/runtime/vm/object_store.cc
index 3cb7d03..59ba57a 100644
--- a/runtime/vm/object_store.cc
+++ b/runtime/vm/object_store.cc
@@ -76,7 +76,6 @@
pending_deferred_loads_(GrowableObjectArray::null()),
resume_capabilities_(GrowableObjectArray::null()),
sticky_error_(Error::null()),
- unhandled_exception_handler_(String::null()),
empty_context_(Context::null()),
stack_overflow_(Instance::null()),
out_of_memory_(Instance::null()),
diff --git a/runtime/vm/object_store.h b/runtime/vm/object_store.h
index 7453dba..23dad67 100644
--- a/runtime/vm/object_store.h
+++ b/runtime/vm/object_store.h
@@ -349,13 +349,6 @@
}
void clear_sticky_error() { sticky_error_ = Error::null(); }
- RawString* unhandled_exception_handler() const {
- return unhandled_exception_handler_;
- }
- void set_unhandled_exception_handler(const String& value) {
- unhandled_exception_handler_ = value.raw();
- }
-
RawContext* empty_context() const { return empty_context_; }
void set_empty_context(const Context& value) {
empty_context_ = value.raw();
@@ -496,7 +489,6 @@
RawGrowableObjectArray* pending_deferred_loads_;
RawGrowableObjectArray* resume_capabilities_;
RawError* sticky_error_;
- RawString* unhandled_exception_handler_;
RawContext* empty_context_;
RawInstance* stack_overflow_;
RawInstance* out_of_memory_;
diff --git a/runtime/vm/raw_object.h b/runtime/vm/raw_object.h
index 4dbaa7c..e9e97b9 100644
--- a/runtime/vm/raw_object.h
+++ b/runtime/vm/raw_object.h
@@ -1816,6 +1816,7 @@
class RawSendPort : public RawInstance {
RAW_HEAP_OBJECT_IMPLEMENTATION(SendPort);
Dart_Port id_;
+ Dart_Port origin_id_;
friend class ReceivePort;
};
diff --git a/runtime/vm/raw_object_snapshot.cc b/runtime/vm/raw_object_snapshot.cc
index 46f9117..3bf9794 100644
--- a/runtime/vm/raw_object_snapshot.cc
+++ b/runtime/vm/raw_object_snapshot.cc
@@ -116,7 +116,17 @@
SnapshotWriterVisitor visitor(writer);
visitor.VisitPointers(from(), to());
} else {
- writer->WriteClassId(this);
+ // Until we have maps implemented as internal VM objects we will use
+ // the collections library qualifier to allow maps to be sent across.
+ if (writer->can_send_any_object() ||
+ writer->AllowObjectsInDartLibrary(ptr()->library_)) {
+ writer->WriteClassId(this);
+ } else {
+ // We do not allow regular dart instances in isolate messages.
+ writer->SetWriteException(Exceptions::kArgument,
+ "Illegal argument in isolate message"
+ " : (object is a regular Dart Instance)");
+ }
}
}
@@ -2666,9 +2676,10 @@
intptr_t tags,
Snapshot::Kind kind) {
uint64_t id = reader->Read<uint64_t>();
+ uint64_t origin_id = reader->Read<uint64_t>();
SendPort& result = SendPort::ZoneHandle(reader->isolate(),
- SendPort::New(id));
+ SendPort::New(id, origin_id));
reader->AddBackRef(object_id, &result, kIsDeserialized);
return result.raw();
}
@@ -2685,6 +2696,7 @@
writer->WriteTags(writer->GetObjectTags(this));
writer->Write<uint64_t>(ptr()->id_);
+ writer->Write<uint64_t>(ptr()->origin_id_);
}
diff --git a/runtime/vm/regexp.cc b/runtime/vm/regexp.cc
index 93e4997..5d31fbf 100644
--- a/runtime/vm/regexp.cc
+++ b/runtime/vm/regexp.cc
@@ -5102,7 +5102,13 @@
const intptr_t kParamCount = RegExpMacroAssembler::kParamCount;
Function& fn = Function::Handle(isolate, Function::New(
- Symbols::IrregExp(),
+ // Append the regexp pattern to the function name.
+ String::Handle(isolate, Symbols::New(
+ String::Handle(isolate, String::Concat(
+ String::Handle(isolate, String::Concat(
+ Symbols::Irregexp(),
+ Symbols::ColonSpace(), Heap::kOld)),
+ String::Handle(regexp.pattern()), Heap::kOld)))),
RawFunction::kIrregexpFunction,
true, // Static.
false, // Not const.
diff --git a/runtime/vm/regexp_assembler.cc b/runtime/vm/regexp_assembler.cc
index 4a2fed2..4ecf4c1 100644
--- a/runtime/vm/regexp_assembler.cc
+++ b/runtime/vm/regexp_assembler.cc
@@ -217,8 +217,8 @@
const intptr_t entries_count = entry_block_->indirect_entries().length();
- GrowableObjectArray& offsets = GrowableObjectArray::ZoneHandle(
- I, GrowableObjectArray::New(entries_count, Heap::kOld));
+ TypedData& offsets = TypedData::ZoneHandle(I,
+ TypedData::New(kTypedDataInt32ArrayCid, entries_count, Heap::kOld));
PushArgumentInstr* block_offsets_push =
PushArgument(Bind(new(I) ConstantInstr(offsets)));
diff --git a/runtime/vm/scavenger.cc b/runtime/vm/scavenger.cc
index 56f9f99..5ea4ad4 100644
--- a/runtime/vm/scavenger.cc
+++ b/runtime/vm/scavenger.cc
@@ -327,7 +327,8 @@
SemiSpace::~SemiSpace() {
if (reserved_ != NULL) {
#if defined(DEBUG)
- memset(reserved_->address(), kZapValue, size_in_words() << kWordSizeLog2);
+ memset(reserved_->address(), Heap::kZapByte,
+ size_in_words() << kWordSizeLog2);
#endif // defined(DEBUG)
delete reserved_;
}
@@ -366,7 +367,7 @@
return NULL;
}
#if defined(DEBUG)
- memset(reserved->address(), kZapValue, size_in_bytes);
+ memset(reserved->address(), Heap::kZapByte, size_in_bytes);
VerifiedMemory::Accept(reserved->start(), size_in_bytes);
#endif // defined(DEBUG)
return new SemiSpace(reserved);
@@ -378,7 +379,7 @@
#ifdef DEBUG
if (reserved_ != NULL) {
const intptr_t size_in_bytes = size_in_words() << kWordSizeLog2;
- memset(reserved_->address(), kZapValue, size_in_bytes);
+ memset(reserved_->address(), Heap::kZapByte, size_in_bytes);
VerifiedMemory::Accept(reserved_->start(), size_in_bytes);
}
#endif
diff --git a/runtime/vm/scavenger.h b/runtime/vm/scavenger.h
index 75af237..117b3fe 100644
--- a/runtime/vm/scavenger.h
+++ b/runtime/vm/scavenger.h
@@ -61,10 +61,6 @@
static SemiSpace* cache_;
static Mutex* mutex_;
-
-#ifdef DEBUG
- static const intptr_t kZapValue = 0xf3;
-#endif
};
diff --git a/runtime/vm/service.cc b/runtime/vm/service.cc
index 018e65e..1aae8ae 100644
--- a/runtime/vm/service.cc
+++ b/runtime/vm/service.cc
@@ -228,7 +228,7 @@
// Serialize message.
uint8_t* data = NULL;
- MessageWriter writer(&data, &allocator);
+ MessageWriter writer(&data, &allocator, false);
writer.WriteMessage(message);
// TODO(turnidge): Throw an exception when the return value is false?
@@ -497,7 +497,7 @@
name));
ASSERT(!list.IsNull());
uint8_t* data = NULL;
- MessageWriter writer(&data, &allocator);
+ MessageWriter writer(&data, &allocator, false);
writer.WriteMessage(list);
intptr_t len = writer.BytesWritten();
if (FLAG_trace_service) {
@@ -525,7 +525,7 @@
name));
ASSERT(!list.IsNull());
uint8_t* data = NULL;
- MessageWriter writer(&data, &allocator);
+ MessageWriter writer(&data, &allocator, false);
writer.WriteMessage(list);
intptr_t len = writer.BytesWritten();
if (FLAG_trace_service) {
@@ -2633,7 +2633,7 @@
// Push the event to port_.
uint8_t* data = NULL;
- MessageWriter writer(&data, &allocator);
+ MessageWriter writer(&data, &allocator, false);
writer.WriteMessage(list);
intptr_t len = writer.BytesWritten();
if (FLAG_trace_service) {
diff --git a/runtime/vm/snapshot.cc b/runtime/vm/snapshot.cc
index d7b1c4b..7bbf5ef 100644
--- a/runtime/vm/snapshot.cc
+++ b/runtime/vm/snapshot.cc
@@ -1039,7 +1039,8 @@
SnapshotWriter::SnapshotWriter(Snapshot::Kind kind,
uint8_t** buffer,
ReAlloc alloc,
- intptr_t initial_size)
+ intptr_t initial_size,
+ bool can_send_any_object)
: BaseWriter(buffer, alloc, initial_size),
kind_(kind),
isolate_(Isolate::Current()),
@@ -1048,7 +1049,8 @@
forward_list_(kMaxPredefinedObjectIds),
exception_type_(Exceptions::kNone),
exception_msg_(NULL),
- unmarked_objects_(false) {
+ unmarked_objects_(false),
+ can_send_any_object_(can_send_any_object) {
}
@@ -1708,9 +1710,15 @@
}
+bool SnapshotWriter::AllowObjectsInDartLibrary(RawLibrary* library) {
+ return (library == object_store()->collection_library() ||
+ library == object_store()->typed_data_library());
+}
+
+
void SnapshotWriter::ThrowException(Exceptions::ExceptionType type,
const char* msg) {
- isolate()->object_store()->clear_sticky_error();
+ object_store()->clear_sticky_error();
UnmarkAll();
if (msg != NULL) {
const String& msg_obj = String::Handle(String::New(msg));
diff --git a/runtime/vm/snapshot.h b/runtime/vm/snapshot.h
index 0b3e994..f0ef323 100644
--- a/runtime/vm/snapshot.h
+++ b/runtime/vm/snapshot.h
@@ -568,7 +568,8 @@
SnapshotWriter(Snapshot::Kind kind,
uint8_t** buffer,
ReAlloc alloc,
- intptr_t initial_size);
+ intptr_t initial_size,
+ bool can_send_any_object);
public:
// Snapshot kind.
@@ -589,6 +590,7 @@
void set_exception_msg(const char* msg) {
exception_msg_ = msg;
}
+ bool can_send_any_object() const { return can_send_any_object_; }
void ThrowException(Exceptions::ExceptionType type, const char* msg);
// Write a version string for the snapshot.
@@ -623,6 +625,7 @@
RawClass* cls,
intptr_t tags);
void WriteInstanceRef(RawObject* raw, RawClass* cls);
+ bool AllowObjectsInDartLibrary(RawLibrary* library);
Isolate* isolate() const { return isolate_; }
ObjectStore* object_store() const { return object_store_; }
@@ -636,6 +639,7 @@
Exceptions::ExceptionType exception_type_; // Exception type.
const char* exception_msg_; // Message associated with exception.
bool unmarked_objects_; // True if marked objects have been unmarked.
+ bool can_send_any_object_; // True if any Dart instance can be sent.
friend class RawArray;
friend class RawClass;
@@ -663,7 +667,7 @@
public:
static const intptr_t kInitialSize = 64 * KB;
FullSnapshotWriter(uint8_t** buffer, ReAlloc alloc)
- : SnapshotWriter(Snapshot::kFull, buffer, alloc, kInitialSize) {
+ : SnapshotWriter(Snapshot::kFull, buffer, alloc, kInitialSize, true) {
ASSERT(buffer != NULL);
ASSERT(alloc != NULL);
}
@@ -681,7 +685,7 @@
public:
static const intptr_t kInitialSize = 64 * KB;
ScriptSnapshotWriter(uint8_t** buffer, ReAlloc alloc)
- : SnapshotWriter(Snapshot::kScript, buffer, alloc, kInitialSize) {
+ : SnapshotWriter(Snapshot::kScript, buffer, alloc, kInitialSize, true) {
ASSERT(buffer != NULL);
ASSERT(alloc != NULL);
}
@@ -698,8 +702,12 @@
class MessageWriter : public SnapshotWriter {
public:
static const intptr_t kInitialSize = 512;
- MessageWriter(uint8_t** buffer, ReAlloc alloc)
- : SnapshotWriter(Snapshot::kMessage, buffer, alloc, kInitialSize) {
+ MessageWriter(uint8_t** buffer, ReAlloc alloc, bool can_send_any_object)
+ : SnapshotWriter(Snapshot::kMessage,
+ buffer,
+ alloc,
+ kInitialSize,
+ can_send_any_object) {
ASSERT(buffer != NULL);
ASSERT(alloc != NULL);
}
diff --git a/runtime/vm/snapshot_test.cc b/runtime/vm/snapshot_test.cc
index fe78fda..53fb9a6 100644
--- a/runtime/vm/snapshot_test.cc
+++ b/runtime/vm/snapshot_test.cc
@@ -151,7 +151,7 @@
// Write snapshot with object content.
uint8_t* buffer;
- MessageWriter writer(&buffer, &zone_allocator);
+ MessageWriter writer(&buffer, &zone_allocator, true);
const Object& null_object = Object::Handle();
writer.WriteMessage(null_object);
intptr_t buffer_len = writer.BytesWritten();
@@ -177,7 +177,7 @@
// Write snapshot with object content.
uint8_t* buffer;
- MessageWriter writer(&buffer, &zone_allocator);
+ MessageWriter writer(&buffer, &zone_allocator, true);
const Smi& smi = Smi::Handle(Smi::New(124));
writer.WriteMessage(smi);
intptr_t buffer_len = writer.BytesWritten();
@@ -204,7 +204,7 @@
// Write snapshot with object content.
uint8_t* buffer;
- MessageWriter writer(&buffer, &zone_allocator);
+ MessageWriter writer(&buffer, &zone_allocator, true);
const Smi& smi = Smi::Handle(Smi::New(-1));
writer.WriteMessage(smi);
intptr_t buffer_len = writer.BytesWritten();
@@ -229,7 +229,7 @@
Dart_CObject* SerializeAndDeserializeMint(const Mint& mint) {
// Write snapshot with object content.
uint8_t* buffer;
- MessageWriter writer(&buffer, &zone_allocator);
+ MessageWriter writer(&buffer, &zone_allocator, true);
writer.WriteMessage(mint);
intptr_t buffer_len = writer.BytesWritten();
@@ -299,7 +299,7 @@
// Write snapshot with object content.
uint8_t* buffer;
- MessageWriter writer(&buffer, &zone_allocator);
+ MessageWriter writer(&buffer, &zone_allocator, true);
const Double& dbl = Double::Handle(Double::New(101.29));
writer.WriteMessage(dbl);
intptr_t buffer_len = writer.BytesWritten();
@@ -326,7 +326,7 @@
// Write snapshot with true object.
uint8_t* buffer;
- MessageWriter writer(&buffer, &zone_allocator);
+ MessageWriter writer(&buffer, &zone_allocator, true);
const Bool& bl = Bool::True();
writer.WriteMessage(bl);
intptr_t buffer_len = writer.BytesWritten();
@@ -355,7 +355,7 @@
// Write snapshot with false object.
uint8_t* buffer;
- MessageWriter writer(&buffer, &zone_allocator);
+ MessageWriter writer(&buffer, &zone_allocator, true);
const Bool& bl = Bool::False();
writer.WriteMessage(bl);
intptr_t buffer_len = writer.BytesWritten();
@@ -387,7 +387,7 @@
// Write snapshot with object content.
uint8_t* buffer;
- MessageWriter writer(&buffer, &zone_allocator);
+ MessageWriter writer(&buffer, &zone_allocator, true);
const char* cstr = "0x270FFFFFFFFFFFFFD8F0";
const String& str = String::Handle(String::New(cstr));
Bigint& bigint = Bigint::Handle();
@@ -419,7 +419,7 @@
Dart_CObject* SerializeAndDeserializeBigint(const Bigint& bigint) {
// Write snapshot with object content.
uint8_t* buffer;
- MessageWriter writer(&buffer, &zone_allocator);
+ MessageWriter writer(&buffer, &zone_allocator, true);
writer.WriteMessage(bigint);
intptr_t buffer_len = writer.BytesWritten();
@@ -471,7 +471,7 @@
TEST_CASE(SerializeSingletons) {
// Write snapshot with object content.
uint8_t* buffer;
- MessageWriter writer(&buffer, &malloc_allocator);
+ MessageWriter writer(&buffer, &malloc_allocator, true);
writer.WriteObject(Object::class_class());
writer.WriteObject(Object::type_arguments_class());
writer.WriteObject(Object::function_class());
@@ -513,7 +513,7 @@
EXPECT(Utf8::IsValid(reinterpret_cast<const uint8_t*>(cstr), strlen(cstr)));
// Write snapshot with object content.
uint8_t* buffer;
- MessageWriter writer(&buffer, &zone_allocator);
+ MessageWriter writer(&buffer, &zone_allocator, true);
String& str = String::Handle(String::New(cstr));
writer.WriteMessage(str);
intptr_t buffer_len = writer.BytesWritten();
@@ -555,7 +555,7 @@
// Write snapshot with object content.
uint8_t* buffer;
- MessageWriter writer(&buffer, &zone_allocator);
+ MessageWriter writer(&buffer, &zone_allocator, true);
const int kArrayLength = 10;
Array& array = Array::Handle(Array::New(kArrayLength));
Smi& smi = Smi::Handle();
@@ -645,7 +645,7 @@
// Write snapshot with object content.
uint8_t* buffer;
- MessageWriter writer(&buffer, &zone_allocator);
+ MessageWriter writer(&buffer, &zone_allocator, true);
const int kArrayLength = 0;
Array& array = Array::Handle(Array::New(kArrayLength));
writer.WriteMessage(array);
@@ -674,7 +674,7 @@
// Write snapshot with object content.
uint8_t* buffer;
- MessageWriter writer(&buffer, &zone_allocator);
+ MessageWriter writer(&buffer, &zone_allocator, true);
const int kTypedDataLength = 256;
TypedData& typed_data = TypedData::Handle(
TypedData::New(kTypedDataUint8ArrayCid, kTypedDataLength));
@@ -708,7 +708,7 @@
{ \
StackZone zone(Isolate::Current()); \
uint8_t* buffer; \
- MessageWriter writer(&buffer, &zone_allocator); \
+ MessageWriter writer(&buffer, &zone_allocator, true); \
const int kArrayLength = 127; \
TypedData& array = TypedData::Handle( \
TypedData::New(kTypedData##darttype##ArrayCid, kArrayLength)); \
@@ -739,7 +739,7 @@
reinterpret_cast<uint8_t*>(data), length)); \
intptr_t scale = array.ElementSizeInBytes(); \
uint8_t* buffer; \
- MessageWriter writer(&buffer, &zone_allocator); \
+ MessageWriter writer(&buffer, &zone_allocator, true); \
writer.WriteMessage(array); \
intptr_t buffer_len = writer.BytesWritten(); \
SnapshotReader reader(buffer, buffer_len, \
@@ -786,7 +786,7 @@
// Write snapshot with object content.
uint8_t* buffer;
- MessageWriter writer(&buffer, &zone_allocator);
+ MessageWriter writer(&buffer, &zone_allocator, true);
const int kTypedDataLength = 0;
TypedData& typed_data = TypedData::Handle(
TypedData::New(kTypedDataUint8ArrayCid, kTypedDataLength));
@@ -816,7 +816,7 @@
public:
static const intptr_t kInitialSize = 64 * KB;
TestSnapshotWriter(uint8_t** buffer, ReAlloc alloc)
- : SnapshotWriter(Snapshot::kScript, buffer, alloc, kInitialSize) {
+ : SnapshotWriter(Snapshot::kScript, buffer, alloc, kInitialSize, true) {
ASSERT(buffer != NULL);
ASSERT(alloc != NULL);
}
@@ -1463,7 +1463,7 @@
// Serialize the list into a message.
uint8_t* buffer;
- MessageWriter writer(&buffer, &zone_allocator);
+ MessageWriter writer(&buffer, &zone_allocator, false);
const Object& list = Object::Handle(Api::UnwrapHandle(result));
writer.WriteMessage(list);
intptr_t buffer_len = writer.BytesWritten();
@@ -1477,7 +1477,7 @@
static void CheckString(Dart_Handle dart_string, const char* expected) {
StackZone zone(Isolate::Current());
uint8_t* buffer;
- MessageWriter writer(&buffer, &zone_allocator);
+ MessageWriter writer(&buffer, &zone_allocator, false);
String& str = String::Handle();
str ^= Api::UnwrapHandle(dart_string);
writer.WriteMessage(str);
@@ -1497,7 +1497,7 @@
static void CheckStringInvalid(Dart_Handle dart_string) {
StackZone zone(Isolate::Current());
uint8_t* buffer;
- MessageWriter writer(&buffer, &zone_allocator);
+ MessageWriter writer(&buffer, &zone_allocator, false);
String& str = String::Handle();
str ^= Api::UnwrapHandle(dart_string);
writer.WriteMessage(str);
@@ -1607,7 +1607,7 @@
{
StackZone zone(Isolate::Current());
uint8_t* buffer;
- MessageWriter writer(&buffer, &zone_allocator);
+ MessageWriter writer(&buffer, &zone_allocator, false);
Smi& smi = Smi::Handle();
smi ^= Api::UnwrapHandle(smi_result);
writer.WriteMessage(smi);
@@ -1625,7 +1625,7 @@
{
StackZone zone(Isolate::Current());
uint8_t* buffer;
- MessageWriter writer(&buffer, &zone_allocator);
+ MessageWriter writer(&buffer, &zone_allocator, false);
Bigint& bigint = Bigint::Handle();
bigint ^= Api::UnwrapHandle(bigint_result);
writer.WriteMessage(bigint);
@@ -2725,7 +2725,7 @@
TEST_CASE(OmittedObjectEncodingLength) {
StackZone zone(Isolate::Current());
uint8_t* buffer;
- MessageWriter writer(&buffer, &zone_allocator);
+ MessageWriter writer(&buffer, &zone_allocator, true);
writer.WriteInlinedObjectHeader(kOmittedObjectId);
// For performance, we'd like single-byte headers when ids are omitted.
// If this starts failing, consider renumbering the snapshot ids.
diff --git a/runtime/vm/stub_code_ia32.cc b/runtime/vm/stub_code_ia32.cc
index 576087a..611d119 100644
--- a/runtime/vm/stub_code_ia32.cc
+++ b/runtime/vm/stub_code_ia32.cc
@@ -369,7 +369,7 @@
__ Bind(&loop);
__ movl(EDI, Address(EBX, 0));
// No generational barrier needed, since array is in new space.
- __ StoreIntoObjectNoBarrier(EAX, Address(ECX, 0), EDI);
+ __ InitializeFieldNoBarrier(EAX, Address(ECX, 0), EDI);
__ AddImmediate(ECX, Immediate(kWordSize));
__ AddImmediate(EBX, Immediate(-kWordSize));
__ Bind(&loop_condition);
@@ -631,12 +631,12 @@
// ECX: array element type.
// EDX: Array length as Smi (preserved).
// Store the type argument field.
- __ StoreIntoObjectNoBarrier(EAX,
+ __ InitializeFieldNoBarrier(EAX,
FieldAddress(EAX, Array::type_arguments_offset()),
ECX);
// Set the length field.
- __ StoreIntoObjectNoBarrier(EAX,
+ __ InitializeFieldNoBarrier(EAX,
FieldAddress(EAX, Array::length_offset()),
EDX);
@@ -654,7 +654,7 @@
__ cmpl(EDI, EBX);
__ j(ABOVE_EQUAL, &done, Assembler::kNearJump);
// No generational barrier needed, since we are storing null.
- __ StoreIntoObjectNoBarrier(EAX, Address(EDI, 0), Object::null_object());
+ __ InitializeFieldNoBarrier(EAX, Address(EDI, 0), Object::null_object());
__ addl(EDI, Immediate(kWordSize));
__ jmp(&init_loop, Assembler::kNearJump);
__ Bind(&done);
@@ -813,7 +813,12 @@
if (FLAG_use_slow_path) {
__ jmp(&slow_case);
} else {
- __ j(ABOVE_EQUAL, &slow_case, Assembler::kNearJump);
+#if defined(DEBUG)
+ static const bool kJumpLength = Assembler::kFarJump;
+#else
+ static const bool kJumpLength = Assembler::kNearJump;
+#endif // DEBUG
+ __ j(ABOVE_EQUAL, &slow_case, kJumpLength);
}
// Successfully allocated the object, now update top to point to
@@ -861,7 +866,7 @@
// EAX: new object.
// EDX: number of context variables.
// No generational barrier needed, since we are storing null.
- __ StoreIntoObjectNoBarrier(EAX,
+ __ InitializeFieldNoBarrier(EAX,
FieldAddress(EAX, Context::parent_offset()),
Object::null_object());
@@ -876,7 +881,7 @@
__ Bind(&loop);
__ decl(EDX);
// No generational barrier needed, since we are storing null.
- __ StoreIntoObjectNoBarrier(EAX,
+ __ InitializeFieldNoBarrier(EAX,
Address(EBX, EDX, TIMES_4, 0),
Object::null_object());
__ Bind(&entry);
@@ -1054,7 +1059,7 @@
for (intptr_t current_offset = Instance::NextFieldOffset();
current_offset < instance_size;
current_offset += kWordSize) {
- __ StoreIntoObjectNoBarrier(EAX,
+ __ InitializeFieldNoBarrier(EAX,
FieldAddress(EAX, current_offset),
Object::null_object());
}
@@ -1070,7 +1075,7 @@
__ Bind(&init_loop);
__ cmpl(ECX, EBX);
__ j(ABOVE_EQUAL, &done, Assembler::kNearJump);
- __ StoreIntoObjectNoBarrier(EAX,
+ __ InitializeFieldNoBarrier(EAX,
Address(ECX, 0),
Object::null_object());
__ addl(ECX, Immediate(kWordSize));
@@ -1081,7 +1086,8 @@
// EDX: new object type arguments.
// Set the type arguments in the new object.
intptr_t offset = cls.type_arguments_field_offset();
- __ StoreIntoObjectNoBarrier(EAX, FieldAddress(EAX, offset), EDX);
+ // TODO(koda): Figure out why previous content is sometimes null here.
+ __ InitializeFieldNoBarrier(EAX, FieldAddress(EAX, offset), EDX);
}
// Done allocating and initializing the instance.
// EAX: new object (tagged).
diff --git a/runtime/vm/stub_code_x64.cc b/runtime/vm/stub_code_x64.cc
index d62e613..16e0858 100644
--- a/runtime/vm/stub_code_x64.cc
+++ b/runtime/vm/stub_code_x64.cc
@@ -364,11 +364,16 @@
// R12: address of first argument on stack.
// RBX: address of first argument in array.
Label loop, loop_condition;
- __ jmp(&loop_condition, Assembler::kNearJump);
+#if defined(DEBUG)
+ static const bool kJumpLength = Assembler::kFarJump;
+#else
+ static const bool kJumpLength = Assembler::kNearJump;
+#endif // DEBUG
+ __ jmp(&loop_condition, kJumpLength);
__ Bind(&loop);
__ movq(RDI, Address(R12, 0));
// No generational barrier needed, since array is in new space.
- __ StoreIntoObjectNoBarrier(RAX, Address(RBX, 0), RDI);
+ __ InitializeFieldNoBarrier(RAX, Address(RBX, 0), RDI);
__ addq(RBX, Immediate(kWordSize));
__ subq(R12, Immediate(kWordSize));
__ Bind(&loop_condition);
@@ -632,12 +637,12 @@
// RAX: new object start as a tagged pointer.
// Store the type argument field.
- __ StoreIntoObjectNoBarrier(RAX,
+ __ InitializeFieldNoBarrier(RAX,
FieldAddress(RAX, Array::type_arguments_offset()),
RBX);
// Set the length field.
- __ StoreIntoObjectNoBarrier(RAX,
+ __ InitializeFieldNoBarrier(RAX,
FieldAddress(RAX, Array::length_offset()),
R10);
@@ -652,11 +657,16 @@
Label init_loop;
__ Bind(&init_loop);
__ cmpq(RDI, RCX);
- __ j(ABOVE_EQUAL, &done, Assembler::kNearJump);
+#if defined(DEBUG)
+ static const bool kJumpLength = Assembler::kFarJump;
+#else
+ static const bool kJumpLength = Assembler::kNearJump;
+#endif // DEBUG
+ __ j(ABOVE_EQUAL, &done, kJumpLength);
// No generational barrier needed, since we are storing null.
- __ StoreIntoObjectNoBarrier(RAX, Address(RDI, 0), R12);
+ __ InitializeFieldNoBarrier(RAX, Address(RDI, 0), R12);
__ addq(RDI, Immediate(kWordSize));
- __ jmp(&init_loop, Assembler::kNearJump);
+ __ jmp(&init_loop, kJumpLength);
__ Bind(&done);
__ ret(); // returns the newly allocated object in RAX.
@@ -888,7 +898,7 @@
// RAX: new object.
// R10: number of context variables.
// No generational barrier needed, since we are storing null.
- __ StoreIntoObjectNoBarrier(RAX,
+ __ InitializeFieldNoBarrier(RAX,
FieldAddress(RAX, Context::parent_offset()),
R12);
@@ -898,12 +908,16 @@
{
Label loop, entry;
__ leaq(R13, FieldAddress(RAX, Context::variable_offset(0)));
-
- __ jmp(&entry, Assembler::kNearJump);
+#if defined(DEBUG)
+ static const bool kJumpLength = Assembler::kFarJump;
+#else
+ static const bool kJumpLength = Assembler::kNearJump;
+#endif // DEBUG
+ __ jmp(&entry, kJumpLength);
__ Bind(&loop);
__ decq(R10);
// No generational barrier needed, since we are storing null.
- __ StoreIntoObjectNoBarrier(RAX,
+ __ InitializeFieldNoBarrier(RAX,
Address(R13, R10, TIMES_8, 0),
R12);
__ Bind(&entry);
@@ -1077,7 +1091,7 @@
for (intptr_t current_offset = Instance::NextFieldOffset();
current_offset < instance_size;
current_offset += kWordSize) {
- __ StoreIntoObjectNoBarrier(RAX,
+ __ InitializeFieldNoBarrier(RAX,
FieldAddress(RAX, current_offset),
R12);
}
@@ -1092,8 +1106,13 @@
Label done;
__ Bind(&init_loop);
__ cmpq(RCX, RBX);
- __ j(ABOVE_EQUAL, &done, Assembler::kNearJump);
- __ StoreIntoObjectNoBarrier(RAX, Address(RCX, 0), R12);
+#if defined(DEBUG)
+ static const bool kJumpLength = Assembler::kFarJump;
+#else
+ static const bool kJumpLength = Assembler::kNearJump;
+#endif // DEBUG
+ __ j(ABOVE_EQUAL, &done, kJumpLength);
+ __ InitializeFieldNoBarrier(RAX, Address(RCX, 0), R12);
__ addq(RCX, Immediate(kWordSize));
__ jmp(&init_loop, Assembler::kNearJump);
__ Bind(&done);
@@ -1102,7 +1121,7 @@
// RDX: new object type arguments.
// Set the type arguments in the new object.
intptr_t offset = cls.type_arguments_field_offset();
- __ StoreIntoObjectNoBarrier(RAX, FieldAddress(RAX, offset), RDX);
+ __ InitializeFieldNoBarrier(RAX, FieldAddress(RAX, offset), RDX);
}
// Done allocating and initializing the instance.
// RAX: new object (tagged).
@@ -1630,7 +1649,12 @@
__ LoadIsolate(RAX);
__ movzxb(RAX, Address(RAX, Isolate::single_step_offset()));
__ cmpq(RAX, Immediate(0));
- __ j(NOT_EQUAL, &stepping, Assembler::kNearJump);
+#if defined(DEBUG)
+ static const bool kJumpLength = Assembler::kFarJump;
+#else
+ static const bool kJumpLength = Assembler::kNearJump;
+#endif // DEBUG
+ __ j(NOT_EQUAL, &stepping, kJumpLength);
__ Bind(&done_stepping);
// RBX: IC data object (preserved).
diff --git a/runtime/vm/symbols.h b/runtime/vm/symbols.h
index b3e6bcb..2dc9f24 100644
--- a/runtime/vm/symbols.h
+++ b/runtime/vm/symbols.h
@@ -148,7 +148,6 @@
V(_Smi, "_Smi") \
V(_Mint, "_Mint") \
V(_Bigint, "_Bigint") \
- V(_BigintFromDoubleFactory, "_Bigint._fromDouble") \
V(_Double, "_Double") \
V(Bool, "bool") \
V(True, "true") \
@@ -171,7 +170,7 @@
V(StackTrace, "StackTrace") \
V(JSSyntaxRegExp, "_JSSyntaxRegExp") \
V(RegExp, "RegExp") \
- V(IrregExp, ":irregexp") \
+ V(Irregexp, ":irregexp") \
V(Object, "Object") \
V(Int, "int") \
V(Double, "double") \
@@ -273,7 +272,6 @@
V(UnsupportedError, "UnsupportedError") \
V(StackOverflowError, "StackOverflowError") \
V(OutOfMemoryError, "OutOfMemoryError") \
- V(InternalError, "_InternalError") \
V(NullThrownError, "NullThrownError") \
V(IsolateSpawnException, "IsolateSpawnException") \
V(IsolateUnhandledException, "_IsolateUnhandledException") \
diff --git a/runtime/vm/zone.cc b/runtime/vm/zone.cc
index dc8dcf2..b16c030 100644
--- a/runtime/vm/zone.cc
+++ b/runtime/vm/zone.cc
@@ -63,6 +63,7 @@
Zone::Segment* Zone::Segment::New(intptr_t size, Zone::Segment* next) {
ASSERT(size >= 0);
Segment* result = reinterpret_cast<Segment*>(new uint8_t[size]);
+ ASSERT(Utils::IsAligned(result->start(), Zone::kAlignment));
if (result != NULL) {
#ifdef DEBUG
// Zap the entire allocated segment (including the header).
diff --git a/runtime/vm/zone.h b/runtime/vm/zone.h
index fea44c9..0d89c5d 100644
--- a/runtime/vm/zone.h
+++ b/runtime/vm/zone.h
@@ -67,6 +67,7 @@
large_segments_(NULL),
handles_(),
previous_(NULL) {
+ ASSERT(Utils::IsAligned(position_, kAlignment));
#ifdef DEBUG
// Zap the entire initial buffer.
memset(initial_buffer_.pointer(), kZapUninitializedByte,
@@ -84,7 +85,7 @@
}
// All pointers returned from AllocateUnsafe() and New() have this alignment.
- static const intptr_t kAlignment = kWordSize;
+ static const intptr_t kAlignment = kDoubleSize;
// Default initial chunk size.
static const intptr_t kInitialChunkSize = 1 * KB;
@@ -112,16 +113,32 @@
// Delete all objects and free all memory allocated in the zone.
void DeleteAll();
+ // Does not actually free any memory. Enables templated containers like
+ // BaseGrowableArray to use different allocators.
+ template <class ElementType>
+ void Free(ElementType* old_array, intptr_t len) {
+#ifdef DEBUG
+ if (len > 0) {
+ memset(old_array, kZapUninitializedByte, len * sizeof(ElementType));
+ }
+#endif
+ }
+
#if defined(DEBUG)
// Dump the current allocated sizes in the zone object.
void DumpZoneSizes();
#endif
+ // Overflow check (FATAL) for array length.
+ template <class ElementType>
+ static inline void CheckLength(intptr_t len);
+
// This buffer is used for allocation before any segments.
// This would act as the initial stack allocated chunk so that we don't
// end up calling malloc/free on zone scopes that allocate less than
// kChunkSize
- uint8_t buffer_[kInitialChunkSize];
+ COMPILE_ASSERT(kAlignment <= 8);
+ ALIGN8 uint8_t buffer_[kInitialChunkSize];
MemoryRegion initial_buffer_;
// The free region in the current (head) segment or the initial buffer is
@@ -149,7 +166,8 @@
friend class StackZone;
friend class ApiZone;
- template<typename T, typename B> friend class BaseGrowableArray;
+ template<typename T, typename B, typename Allocator>
+ friend class BaseGrowableArray;
DISALLOW_COPY_AND_ASSIGN(Zone);
};
@@ -225,26 +243,48 @@
return result;
}
+
+template <class ElementType>
+inline void Zone::CheckLength(intptr_t len) {
+ const intptr_t kElementSize = sizeof(ElementType);
+ if (len > (kIntptrMax / kElementSize)) {
+ FATAL2("Zone::Alloc: 'len' is too large: len=%" Pd ", kElementSize=%" Pd,
+ len, kElementSize);
+ }
+}
+
+
template <class ElementType>
inline ElementType* Zone::Alloc(intptr_t len) {
- const intptr_t element_size = sizeof(ElementType);
- if (len > (kIntptrMax / element_size)) {
- FATAL2("Zone::Alloc: 'len' is too large: len=%" Pd ", element_size=%" Pd,
- len, element_size);
- }
- return reinterpret_cast<ElementType*>(AllocUnsafe(len * element_size));
+ CheckLength<ElementType>(len);
+ return reinterpret_cast<ElementType*>(AllocUnsafe(len * sizeof(ElementType)));
}
template <class ElementType>
inline ElementType* Zone::Realloc(ElementType* old_data,
- intptr_t old_len,
- intptr_t new_len) {
+ intptr_t old_len,
+ intptr_t new_len) {
+ CheckLength<ElementType>(new_len);
+ const intptr_t kElementSize = sizeof(ElementType);
+ uword old_end = reinterpret_cast<uword>(old_data) + (old_len * kElementSize);
+ // Resize existing allocation if nothing was allocated in between...
+ if (Utils::RoundUp(old_end, kAlignment) == position_) {
+ uword new_end =
+ reinterpret_cast<uword>(old_data) + (new_len * kElementSize);
+ // ...and there is sufficient space.
+ if (new_end <= limit_) {
+ position_ = Utils::RoundUp(new_end, kAlignment);
+ return old_data;
+ }
+ }
+ if (new_len <= old_len) {
+ return old_data;
+ }
ElementType* new_data = Alloc<ElementType>(new_len);
if (old_data != 0) {
memmove(reinterpret_cast<void*>(new_data),
reinterpret_cast<void*>(old_data),
- Utils::Minimum(old_len * sizeof(ElementType),
- new_len * sizeof(ElementType)));
+ old_len * kElementSize);
}
return new_data;
}
diff --git a/sdk/lib/_internal/compiler/js_lib/interceptors.dart b/sdk/lib/_internal/compiler/js_lib/interceptors.dart
index 22e2e91..accb591 100644
--- a/sdk/lib/_internal/compiler/js_lib/interceptors.dart
+++ b/sdk/lib/_internal/compiler/js_lib/interceptors.dart
@@ -5,7 +5,8 @@
library _interceptors;
import 'dart:_js_embedded_names' show
- DISPATCH_PROPERTY_NAME;
+ DISPATCH_PROPERTY_NAME,
+ MAP_TYPE_TO_INTERCEPTOR;
import 'dart:collection';
import 'dart:_internal' hide Symbol;
@@ -175,14 +176,6 @@
}
/**
- * If [JSInvocationMirror._invokeOn] is being used, this variable
- * contains a JavaScript array with the names of methods that are
- * intercepted.
- */
-var interceptedNames;
-
-
-/**
* Data structure used to map a [Type] to the [Interceptor] and constructors for
* that type. It is JavaScript array of 3N entries of adjacent slots containing
* a [Type], followed by an [Interceptor] class for the type, followed by a
@@ -196,8 +189,9 @@
* is accessed only by code that also calls [findIndexForWebComponentType]. If
* this assumption is invalidated, the compiler will have to be updated.
*/
-// TODO(sra): Mark this as initialized to a constant with unknown value.
-var mapTypeToInterceptor;
+get mapTypeToInterceptor {
+ return JS_EMBEDDED_GLOBAL('', MAP_TYPE_TO_INTERCEPTOR);
+}
int findIndexForNativeSubclassType(Type type) {
if (JS('bool', '# == null', mapTypeToInterceptor)) return null;
diff --git a/sdk/lib/_internal/compiler/js_lib/io_patch.dart b/sdk/lib/_internal/compiler/js_lib/io_patch.dart
index 97dae37..c2c218a 100644
--- a/sdk/lib/_internal/compiler/js_lib/io_patch.dart
+++ b/sdk/lib/_internal/compiler/js_lib/io_patch.dart
@@ -184,6 +184,10 @@
static _flush(int id) {
throw new UnsupportedError("RandomAccessFile._flush");
}
+ @patch
+ static _lock(int id, int lock, int start, int end) {
+ throw new UnsupportedError("RandomAccessFile._lock");
+ }
}
@patch
diff --git a/sdk/lib/_internal/compiler/js_lib/js_helper.dart b/sdk/lib/_internal/compiler/js_lib/js_helper.dart
index ef28952..e578583 100644
--- a/sdk/lib/_internal/compiler/js_lib/js_helper.dart
+++ b/sdk/lib/_internal/compiler/js_lib/js_helper.dart
@@ -225,18 +225,10 @@
var receiver = object;
var name = _internalName;
var arguments = _arguments;
- var embeddedInterceptedNames = JS_EMBEDDED_GLOBAL('', INTERCEPTED_NAMES);
- // TODO(ngeoffray): If this functionality ever become performance
- // critical, we might want to dynamically change [interceptedNames]
- // to be a JavaScript object with intercepted names as property
- // instead of a JavaScript array.
- // TODO(floitsch): we already add stubs (tear-off getters) as properties
- // in the embedded global interceptedNames.
- // Finish the transition and always use the object as hashtable.
+ var interceptedNames = JS_EMBEDDED_GLOBAL('', INTERCEPTED_NAMES);
bool isIntercepted =
- JS("bool",
- 'Object.prototype.hasOwnProperty.call(#, #) || #.indexOf(#) !== -1',
- embeddedInterceptedNames, name, interceptedNames, name);
+ JS("bool", 'Object.prototype.hasOwnProperty.call(#, #)',
+ interceptedNames, name);
if (isIntercepted) {
receiver = interceptor;
if (JS('bool', '# === #', object, interceptor)) {
diff --git a/sdk/lib/_internal/compiler/js_lib/js_number.dart b/sdk/lib/_internal/compiler/js_lib/js_number.dart
index 81adc2b..63afa4b 100644
--- a/sdk/lib/_internal/compiler/js_lib/js_number.dart
+++ b/sdk/lib/_internal/compiler/js_lib/js_number.dart
@@ -110,8 +110,7 @@
toDouble() => this;
String toStringAsFixed(int fractionDigits) {
- checkNum(fractionDigits);
- // TODO(floitsch): fractionDigits must be an integer.
+ checkInt(fractionDigits);
if (fractionDigits < 0 || fractionDigits > 20) {
throw new RangeError(fractionDigits);
}
@@ -123,8 +122,7 @@
String toStringAsExponential([int fractionDigits]) {
String result;
if (fractionDigits != null) {
- // TODO(floitsch): fractionDigits must be an integer.
- checkNum(fractionDigits);
+ checkInt(fractionDigits);
if (fractionDigits < 0 || fractionDigits > 20) {
throw new RangeError(fractionDigits);
}
@@ -137,8 +135,7 @@
}
String toStringAsPrecision(int precision) {
- // TODO(floitsch): precision must be an integer.
- checkNum(precision);
+ checkInt(precision);
if (precision < 1 || precision > 21) {
throw new RangeError(precision);
}
@@ -149,9 +146,33 @@
}
String toRadixString(int radix) {
- checkNum(radix);
+ checkInt(radix);
if (radix < 2 || radix > 36) throw new RangeError(radix);
- return JS('String', r'#.toString(#)', this, radix);
+ String result = JS('String', r'#.toString(#)', this, radix);
+ const int rightParenCode = 0x29;
+ if (result.codeUnitAt(result.length - 1) != rightParenCode) {
+ return result;
+ }
+ return _handleIEtoString(result);
+ }
+
+ static String _handleIEtoString(String result) {
+ // Result is probably IE's untraditional format for large numbers,
+ // e.g., "8.0000000000008(e+15)" for 0x8000000000000800.toString(16).
+ var match = JS('List|Null',
+ r'/^([\da-z]+)(?:\.([\da-z]+))?\(e\+(\d+)\)$/.exec(#)',
+ result);
+ if (match == null) {
+ // Then we don't know how to handle it at all.
+ throw new UnsupportedError("Unexpected toString result: $result");
+ }
+ String result = JS('String', '#', match[1]);
+ int exponent = JS("int", "+#", match[3]);
+ if (match[2] != null) {
+ result = JS('String', '# + #', result, match[2]);
+ exponent -= JS('int', '#.length', match[2]);
+ }
+ return result + "0" * exponent;
}
// Note: if you change this, also change the function [S].
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 14bfd8c..bd72f09 100644
--- a/sdk/lib/_internal/compiler/js_lib/shared/embedded_names.dart
+++ b/sdk/lib/_internal/compiler/js_lib/shared/embedded_names.dart
@@ -15,7 +15,14 @@
const TYPE_INFORMATION = 'typeInformation';
const GLOBAL_FUNCTIONS = 'globalFunctions';
const STATICS = 'statics';
+
+/**
+ * If [JSInvocationMirror._invokeOn] is being used, this embedded global
+ * contains a JavaScript map with the names of methods that are
+ * intercepted.
+ */
const INTERCEPTED_NAMES = 'interceptedNames';
+
const MANGLED_GLOBAL_NAMES = 'mangledGlobalNames';
const MANGLED_NAMES = 'mangledNames';
const LIBRARIES = 'libraries';
@@ -41,3 +48,5 @@
const TYPEDEF_TYPE_PROPERTY_NAME = r"$typedefType";
const TYPEDEF_PREDICATE_PROPERTY_NAME = r"$$isTypedef";
const NATIVE_SUPERCLASS_TAG_NAME = r"$nativeSuperclassTag";
+
+const MAP_TYPE_TO_INTERCEPTOR = "mapTypeToInterceptor";
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 41427e6..35740f0 100644
--- a/sdk/lib/_internal/pub/lib/src/barback/dart2js_transformer.dart
+++ b/sdk/lib/_internal/pub/lib/src/barback/dart2js_transformer.dart
@@ -15,7 +15,7 @@
import '../../../../../../../pkg/compiler/lib/compiler.dart' as compiler;
import '../../../../../../../pkg/compiler/lib/src/dart2js.dart'
show AbortLeg;
-import '../../../../../../../pkg/compiler/lib/src/source_file.dart';
+import '../../../../../../../pkg/compiler/lib/src/io/source_file.dart';
import '../barback.dart';
import '../dart.dart' as dart;
import '../utils.dart';
diff --git a/sdk/lib/_internal/pub/lib/src/git.dart b/sdk/lib/_internal/pub/lib/src/git.dart
index 2c522eb..53d69d8 100644
--- a/sdk/lib/_internal/pub/lib/src/git.dart
+++ b/sdk/lib/_internal/pub/lib/src/git.dart
@@ -50,10 +50,14 @@
"Please ensure Git is correctly installed.");
}
+ log.muteProgress();
return runProcess(_gitCommand, args, workingDir: workingDir,
environment: environment).then((result) {
if (!result.success) throw new GitException(args, result.stderr.join("\n"));
+
return result.stdout;
+ }).whenComplete(() {
+ log.unmuteProgress();
});
}
diff --git a/sdk/lib/_internal/pub/lib/src/log.dart b/sdk/lib/_internal/pub/lib/src/log.dart
index 1462712..107970b 100644
--- a/sdk/lib/_internal/pub/lib/src/log.dart
+++ b/sdk/lib/_internal/pub/lib/src/log.dart
@@ -42,9 +42,6 @@
/// [recordTranscript()] is called.
Transcript<Entry> _transcript;
-/// All currently-running progress indicators.
-final _progresses = new Set<Progress>();
-
/// The currently-animated progress indicator, if any.
///
/// This will also be in [_progresses].
@@ -374,13 +371,10 @@
/// information will only be visible at [Level.FINE].
Future progress(String message, Future callback(), {bool fine: false}) {
_stopProgress();
+
var progress = new Progress(message, fine: fine);
_animatedProgress = progress;
- _progresses.add(progress);
- return callback().whenComplete(() {
- progress.stop();
- _progresses.remove(progress);
- });
+ return callback().whenComplete(progress.stop);
}
/// Stops animating the running progress indicator, if currently running.
@@ -389,6 +383,31 @@
_animatedProgress = null;
}
+/// The number of outstanding calls to [muteProgress] that have not been unmuted
+/// yet.
+int _numMutes = 0;
+
+/// Whether progress animation should be muted or not.
+bool get isMuted => _numMutes > 0;
+
+/// Stops animating any ongoing progress.
+///
+/// This is called before spawning Git since Git sometimes writes directly to
+/// the terminal to ask for login credentials, which would then get overwritten
+/// by the progress animation.
+///
+/// Each call to this must be paired with a call to [unmuteProgress].
+void muteProgress() {
+ _numMutes++;
+}
+
+/// Resumes animating any ongoing progress once all calls to [muteProgress]
+/// have made their matching [unmuteProgress].
+void unmuteProgress() {
+ assert(_numMutes > 0);
+ _numMutes--;
+}
+
/// Wraps [text] in the ANSI escape codes to make it bold when on a platform
/// that supports that.
///
diff --git a/sdk/lib/_internal/pub/lib/src/progress.dart b/sdk/lib/_internal/pub/lib/src/progress.dart
index 6c0ffdc..5029f61 100644
--- a/sdk/lib/_internal/pub/lib/src/progress.dart
+++ b/sdk/lib/_internal/pub/lib/src/progress.dart
@@ -48,10 +48,11 @@
return;
}
- _update();
_timer = new Timer.periodic(new Duration(milliseconds: 100), (_) {
_update();
});
+
+ _update();
}
/// Stops the progress indicator.
@@ -88,11 +89,11 @@
/// Refreshes the progress line.
void _update() {
+ if (log.isMuted) return;
+
stdout.write(log.format("\r$_message... "));
// Show the time only once it gets noticeably long.
- if (_stopwatch.elapsed.inSeconds > 0) {
- stdout.write(log.gray(_time));
- }
+ if (_stopwatch.elapsed.inSeconds > 0) stdout.write("${log.gray(_time)} ");
}
}
diff --git a/sdk/lib/_internal/pub/pub.status b/sdk/lib/_internal/pub/pub.status
index b22be5d..449c482 100644
--- a/sdk/lib/_internal/pub/pub.status
+++ b/sdk/lib/_internal/pub/pub.status
@@ -6,8 +6,6 @@
test/serve/web_socket/url_to_asset_id_test: Pass, Slow
test/transformer/loads_a_diamond_transformer_dependency_graph_test: Pass, Slow
-test/async_compile_test: Fail # pub_generated need to be updated (see dartbug.com/21940)
-
# Pub only runs on the VM, so just rule out all compilers.
[ $compiler == dart2js || $compiler == dart2dart ]
*: Skip
diff --git a/sdk/lib/_internal/pub_generated/README.md b/sdk/lib/_internal/pub_generated/README.md
index 06095b6..f4908d9 100644
--- a/sdk/lib/_internal/pub_generated/README.md
+++ b/sdk/lib/_internal/pub_generated/README.md
@@ -12,7 +12,7 @@
The code here was compiled using the async-await compiler at commit:
- b151ae5aeb8b825c528f46181d80430b2ee33a63
+ 04e540562a04380a3e20a422c8bfe306e6f79f95
(Note: this file is also parsed by a tool to update the above commit, so be
careful not to reformat it.)
diff --git a/sdk/lib/_internal/pub_generated/bin/pub.dart b/sdk/lib/_internal/pub_generated/bin/pub.dart
index 50ee1ce..b6d3712 100644
--- a/sdk/lib/_internal/pub_generated/bin/pub.dart
+++ b/sdk/lib/_internal/pub_generated/bin/pub.dart
@@ -253,7 +253,7 @@
scheduleMicrotask(() {
try {
join0() {
- runProcess('ver', []).then((x0) {
+ new Future.value(runProcess('ver', [])).then((x0) {
try {
var result = x0;
join1() {
@@ -261,7 +261,7 @@
}
if (result.stdout.join('\n').contains('XP')) {
log.error('Sorry, but pub is not supported on Windows XP.');
- flushThenExit(exit_codes.USAGE).then((x1) {
+ new Future.value(flushThenExit(exit_codes.USAGE)).then((x1) {
try {
x1;
join1();
diff --git a/sdk/lib/_internal/pub_generated/lib/src/barback/asset_environment.dart b/sdk/lib/_internal/pub_generated/lib/src/barback/asset_environment.dart
index 5a6000b..8316d4e 100644
--- a/sdk/lib/_internal/pub_generated/lib/src/barback/asset_environment.dart
+++ b/sdk/lib/_internal/pub_generated/lib/src/barback/asset_environment.dart
@@ -74,7 +74,7 @@
final completer0 = new Completer();
scheduleMicrotask(() {
try {
- entrypoint.loadPackageGraph().then((x0) {
+ new Future.value(entrypoint.loadPackageGraph()).then((x0) {
try {
var graph = x0;
graph = _adjustPackageGraph(graph, mode, packages);
@@ -82,9 +82,8 @@
barback.log.listen(_log);
var environment =
new AssetEnvironment._(graph, barback, mode, watcherType, hostname, basePort);
- environment._load(
- entrypoints: entrypoints,
- useDart2JS: useDart2JS).then((x1) {
+ new Future.value(
+ environment._load(entrypoints: entrypoints, useDart2JS: useDart2JS)).then((x1) {
try {
x1;
completer0.complete(environment);
@@ -294,7 +293,7 @@
log.fine("Executables for ${packageName}: ${executableIds}");
join1() {
var package = graph.packages[packageName];
- servePackageBinDirectory(packageName).then((x0) {
+ new Future.value(servePackageBinDirectory(packageName)).then((x0) {
try {
var server = x0;
join2() {
@@ -309,18 +308,19 @@
}
try {
var precompiled = {};
- waitAndPrintErrors(executableIds.map(((id) {
+ new Future.value(waitAndPrintErrors(executableIds.map(((id) {
final completer0 = new Completer();
scheduleMicrotask(() {
try {
var basename = path.url.basename(id.path);
var snapshotPath =
path.join(directory, "${basename}.snapshot");
- runProcess(
- Platform.executable,
- [
- '--snapshot=${snapshotPath}',
- server.url.resolve(basename).toString()]).then((x0) {
+ new Future.value(
+ runProcess(
+ Platform.executable,
+ [
+ '--snapshot=${snapshotPath}',
+ server.url.resolve(basename).toString()])).then((x0) {
try {
var result = x0;
join0() {
@@ -347,7 +347,7 @@
}
});
return completer0.future;
- }))).then((x1) {
+ })))).then((x1) {
try {
x1;
final v0 = precompiled;
@@ -553,7 +553,7 @@
(config) => config.id.package == '\$dart2js');
}));
join0() {
- BarbackServer.bind(this, _hostname, 0).then((x0) {
+ new Future.value(BarbackServer.bind(this, _hostname, 0)).then((x0) {
try {
var transformerServer = x0;
var errorStream = barback.errors.map(((error) {
@@ -561,9 +561,9 @@
log.error(log.red(error.message));
log.fine(error.stackTrace.terse);
}));
- _withStreamErrors((() {
+ new Future.value(_withStreamErrors((() {
return log.progress("Loading source assets", _provideSources);
- }), [errorStream, barback.results]).then((x1) {
+ }), [errorStream, barback.results])).then((x1) {
try {
x1;
log.fine("Provided sources.");
@@ -581,7 +581,7 @@
message,
null));
}));
- _withStreamErrors((() {
+ new Future.value(_withStreamErrors((() {
final completer0 = new Completer();
scheduleMicrotask(() {
try {
@@ -590,10 +590,11 @@
final completer0 = new Completer();
scheduleMicrotask(() {
try {
- loadAllTransformers(
- this,
- transformerServer,
- entrypoints: entrypoints).then((x0) {
+ new Future.value(
+ loadAllTransformers(
+ this,
+ transformerServer,
+ entrypoints: entrypoints)).then((x0) {
try {
x0;
transformerServer.close();
@@ -614,7 +615,7 @@
});
return completer0.future;
}),
- [errorStream, barback.results, transformerServer.results]).then((x2) {
+ [errorStream, barback.results, transformerServer.results])).then((x2) {
try {
x2;
completer0.complete();
@@ -653,12 +654,13 @@
final completer0 = new Completer();
scheduleMicrotask(() {
try {
- Future.wait(graph.packages.values.map(((package) {
+ new Future.value(Future.wait(graph.packages.values.map(((package) {
final completer0 = new Completer();
scheduleMicrotask(() {
try {
join0() {
- _provideDirectorySources(package, "lib").then((x0) {
+ new Future.value(
+ _provideDirectorySources(package, "lib")).then((x0) {
try {
x0;
completer0.complete();
@@ -677,7 +679,7 @@
}
});
return completer0.future;
- }))).then((x0) {
+ })))).then((x0) {
try {
x0;
completer0.complete();
diff --git a/sdk/lib/_internal/pub_generated/lib/src/barback/dart2js_transformer.dart b/sdk/lib/_internal/pub_generated/lib/src/barback/dart2js_transformer.dart
index 66dce7b..3910ef8 100644
--- a/sdk/lib/_internal/pub_generated/lib/src/barback/dart2js_transformer.dart
+++ b/sdk/lib/_internal/pub_generated/lib/src/barback/dart2js_transformer.dart
@@ -14,7 +14,7 @@
import '../../../../../../../pkg/compiler/lib/compiler.dart' as compiler;
import '../../../../../../../pkg/compiler/lib/src/dart2js.dart' show AbortLeg;
-import '../../../../../../../pkg/compiler/lib/src/source_file.dart';
+import '../../../../../../../pkg/compiler/lib/src/io/source_file.dart';
import '../barback.dart';
import '../dart.dart' as dart;
import '../utils.dart';
diff --git a/sdk/lib/_internal/pub_generated/lib/src/barback/load_all_transformers.dart b/sdk/lib/_internal/pub_generated/lib/src/barback/load_all_transformers.dart
index 39d988e..43ae020 100644
--- a/sdk/lib/_internal/pub_generated/lib/src/barback/load_all_transformers.dart
+++ b/sdk/lib/_internal/pub_generated/lib/src/barback/load_all_transformers.dart
@@ -59,12 +59,13 @@
var it0 = stagedTransformers.iterator;
break0() {
join2() {
- Future.wait(environment.graph.packages.values.map(((package) {
+ new Future.value(
+ Future.wait(environment.graph.packages.values.map(((package) {
final completer0 = new Completer();
scheduleMicrotask(() {
try {
- loader.transformersForPhases(
- package.pubspec.transformers).then((x0) {
+ new Future.value(
+ loader.transformersForPhases(package.pubspec.transformers)).then((x0) {
try {
var phases = x0;
var transformers =
@@ -99,7 +100,7 @@
}
});
return completer0.future;
- }))).then((x1) {
+ })))).then((x1) {
try {
x1;
completer0.complete();
@@ -123,7 +124,8 @@
join3(x2) {
var snapshotPath = x2;
first = false;
- loader.load(stage, snapshot: snapshotPath).then((x3) {
+ new Future.value(
+ loader.load(stage, snapshot: snapshotPath)).then((x3) {
trampoline0 = () {
trampoline0 = null;
try {
@@ -131,14 +133,15 @@
var packagesToUpdate = unionAll(stage.map(((id) {
return packagesThatUseTransformers[id];
})));
- Future.wait(packagesToUpdate.map(((packageName) {
+ new Future.value(
+ Future.wait(packagesToUpdate.map(((packageName) {
final completer0 = new Completer();
scheduleMicrotask(() {
try {
var package =
environment.graph.packages[packageName];
- loader.transformersForPhases(
- package.pubspec.transformers).then((x0) {
+ new Future.value(
+ loader.transformersForPhases(package.pubspec.transformers)).then((x0) {
try {
var phases = x0;
environment.barback.updateTransformers(
@@ -154,7 +157,7 @@
}
});
return completer0.future;
- }))).then((x4) {
+ })))).then((x4) {
trampoline0 = () {
trampoline0 = null;
try {
diff --git a/sdk/lib/_internal/pub_generated/lib/src/barback/transformer_loader.dart b/sdk/lib/_internal/pub_generated/lib/src/barback/transformer_loader.dart
index 2097910..d2b952c 100644
--- a/sdk/lib/_internal/pub_generated/lib/src/barback/transformer_loader.dart
+++ b/sdk/lib/_internal/pub_generated/lib/src/barback/transformer_loader.dart
@@ -58,13 +58,14 @@
return !_isolates.containsKey(id);
})).toList();
join0() {
- log.progress("Loading ${toSentence(ids)} transformers", (() {
+ new Future.value(
+ log.progress("Loading ${toSentence(ids)} transformers", (() {
return TransformerIsolate.spawn(
_environment,
_transformerServer,
ids,
snapshot: snapshot);
- })).then((x0) {
+ }))).then((x0) {
try {
var isolate = x0;
var it0 = ids.iterator;
@@ -126,7 +127,7 @@
completer0.complete(_transformers[config]);
}
if (_isolates.containsKey(config.id)) {
- _isolates[config.id].create(config).then((x0) {
+ new Future.value(_isolates[config.id].create(config)).then((x0) {
try {
var transformers = x0;
join2() {
@@ -198,11 +199,12 @@
final completer0 = new Completer();
scheduleMicrotask(() {
try {
- Future.wait(phases.map(((phase) {
+ new Future.value(Future.wait(phases.map(((phase) {
final completer0 = new Completer();
scheduleMicrotask(() {
try {
- waitAndPrintErrors(phase.map(transformersFor)).then((x0) {
+ new Future.value(
+ waitAndPrintErrors(phase.map(transformersFor))).then((x0) {
try {
var transformers = x0;
completer0.complete(unionAll(transformers));
@@ -215,7 +217,7 @@
}
});
return completer0.future;
- }))).then((x0) {
+ })))).then((x0) {
try {
var result = x0;
completer0.complete(result.toList());
diff --git a/sdk/lib/_internal/pub_generated/lib/src/command/cache_repair.dart b/sdk/lib/_internal/pub_generated/lib/src/command/cache_repair.dart
index 278b327..5d1b83e 100644
--- a/sdk/lib/_internal/pub_generated/lib/src/command/cache_repair.dart
+++ b/sdk/lib/_internal/pub_generated/lib/src/command/cache_repair.dart
@@ -29,7 +29,7 @@
break0() {
join0() {
join1() {
- globals.repairActivatedPackages().then((x0) {
+ new Future.value(globals.repairActivatedPackages()).then((x0) {
try {
var results = x0;
join2() {
@@ -39,7 +39,8 @@
completer0.complete();
}
if (failures > 0) {
- flushThenExit(exit_codes.UNAVAILABLE).then((x1) {
+ new Future.value(
+ flushThenExit(exit_codes.UNAVAILABLE)).then((x1) {
try {
x1;
join5();
@@ -104,7 +105,7 @@
if (it0.moveNext()) {
var source = it0.current;
join6() {
- source.repairCachedPackages().then((x2) {
+ new Future.value(source.repairCachedPackages()).then((x2) {
trampoline0 = () {
trampoline0 = null;
try {
diff --git a/sdk/lib/_internal/pub_generated/lib/src/command/downgrade.dart b/sdk/lib/_internal/pub_generated/lib/src/command/downgrade.dart
index 1de7e16..fd38854 100644
--- a/sdk/lib/_internal/pub_generated/lib/src/command/downgrade.dart
+++ b/sdk/lib/_internal/pub_generated/lib/src/command/downgrade.dart
@@ -37,10 +37,11 @@
scheduleMicrotask(() {
try {
var dryRun = commandOptions['dry-run'];
- entrypoint.acquireDependencies(
- SolveType.DOWNGRADE,
- useLatest: commandOptions.rest,
- dryRun: dryRun).then((x0) {
+ new Future.value(
+ entrypoint.acquireDependencies(
+ SolveType.DOWNGRADE,
+ useLatest: commandOptions.rest,
+ dryRun: dryRun)).then((x0) {
try {
x0;
join0() {
diff --git a/sdk/lib/_internal/pub_generated/lib/src/command/global_run.dart b/sdk/lib/_internal/pub_generated/lib/src/command/global_run.dart
index ca85396..ed4d93e 100644
--- a/sdk/lib/_internal/pub_generated/lib/src/command/global_run.dart
+++ b/sdk/lib/_internal/pub_generated/lib/src/command/global_run.dart
@@ -42,14 +42,11 @@
join1() {
var args = commandOptions.rest.skip(1).toList();
join2() {
- globals.runExecutable(
- package,
- executable,
- args,
- mode: mode).then((x0) {
+ new Future.value(
+ globals.runExecutable(package, executable, args, mode: mode)).then((x0) {
try {
var exitCode = x0;
- flushThenExit(exitCode).then((x1) {
+ new Future.value(flushThenExit(exitCode)).then((x1) {
try {
x1;
completer0.complete();
diff --git a/sdk/lib/_internal/pub_generated/lib/src/command/run.dart b/sdk/lib/_internal/pub_generated/lib/src/command/run.dart
index a340f79..a9fee0f 100644
--- a/sdk/lib/_internal/pub_generated/lib/src/command/run.dart
+++ b/sdk/lib/_internal/pub_generated/lib/src/command/run.dart
@@ -41,15 +41,11 @@
join1() {
var mode;
join2() {
- runExecutable(
- entrypoint,
- package,
- executable,
- args,
- mode: mode).then((x0) {
+ new Future.value(
+ runExecutable(entrypoint, package, executable, args, mode: mode)).then((x0) {
try {
var exitCode = x0;
- flushThenExit(exitCode).then((x1) {
+ new Future.value(flushThenExit(exitCode)).then((x1) {
try {
x1;
completer0.complete();
diff --git a/sdk/lib/_internal/pub_generated/lib/src/command/serve.dart b/sdk/lib/_internal/pub_generated/lib/src/command/serve.dart
index 2aae583..268f63a 100644
--- a/sdk/lib/_internal/pub_generated/lib/src/command/serve.dart
+++ b/sdk/lib/_internal/pub_generated/lib/src/command/serve.dart
@@ -96,19 +96,21 @@
var adminPort = x0;
join1(x1) {
var watcherType = x1;
- AssetEnvironment.create(
- entrypoint,
- mode,
- watcherType: watcherType,
- hostname: hostname,
- basePort: port,
- useDart2JS: useDart2JS).then((x2) {
+ new Future.value(
+ AssetEnvironment.create(
+ entrypoint,
+ mode,
+ watcherType: watcherType,
+ hostname: hostname,
+ basePort: port,
+ useDart2JS: useDart2JS)).then((x2) {
try {
var environment = x2;
var directoryLength = sourceDirectories.map(((dir) {
return dir.length;
})).reduce(math.max);
- environment.startAdminServer(adminPort).then((x3) {
+ new Future.value(
+ environment.startAdminServer(adminPort)).then((x3) {
try {
var server = x3;
server.results.listen(((_) {
@@ -131,7 +133,7 @@
}
}), onError: _fatalError);
environment.resumeUpdates();
- _completer.future.then((x4) {
+ new Future.value(_completer.future).then((x4) {
try {
x4;
completer0.complete();
@@ -145,10 +147,8 @@
trampoline0 = null;
if (it0.moveNext()) {
var directory = it0.current;
- _startServer(
- environment,
- directory,
- directoryLength).then((x5) {
+ new Future.value(
+ _startServer(environment, directory, directoryLength)).then((x5) {
trampoline0 = () {
trampoline0 = null;
try {
@@ -206,7 +206,7 @@
final completer0 = new Completer();
scheduleMicrotask(() {
try {
- environment.serveDirectory(rootDirectory).then((x0) {
+ new Future.value(environment.serveDirectory(rootDirectory)).then((x0) {
try {
var server = x0;
join0() {
diff --git a/sdk/lib/_internal/pub_generated/lib/src/command/upgrade.dart b/sdk/lib/_internal/pub_generated/lib/src/command/upgrade.dart
index bd67719..92bf32a 100644
--- a/sdk/lib/_internal/pub_generated/lib/src/command/upgrade.dart
+++ b/sdk/lib/_internal/pub_generated/lib/src/command/upgrade.dart
@@ -38,10 +38,11 @@
scheduleMicrotask(() {
try {
var dryRun = commandOptions['dry-run'];
- entrypoint.acquireDependencies(
- SolveType.UPGRADE,
- useLatest: commandOptions.rest,
- dryRun: dryRun).then((x0) {
+ new Future.value(
+ entrypoint.acquireDependencies(
+ SolveType.UPGRADE,
+ useLatest: commandOptions.rest,
+ dryRun: dryRun)).then((x0) {
try {
x0;
join0() {
diff --git a/sdk/lib/_internal/pub_generated/lib/src/dart.dart b/sdk/lib/_internal/pub_generated/lib/src/dart.dart
index 8a66472..2f83268 100644
--- a/sdk/lib/_internal/pub_generated/lib/src/dart.dart
+++ b/sdk/lib/_internal/pub_generated/lib/src/dart.dart
@@ -151,7 +151,7 @@
scheduleMicrotask(() {
try {
join0() {
- withTempDir(((dir) {
+ new Future.value(withTempDir(((dir) {
final completer0 = new Completer();
scheduleMicrotask(() {
try {
@@ -159,15 +159,15 @@
writeTextFile(dartPath, code, dontLogContents: true);
var port = new ReceivePort();
join0(x0) {
- Isolate.spawn(_isolateBuffer, {
+ new Future.value(Isolate.spawn(_isolateBuffer, {
'replyTo': port.sendPort,
'uri': path.toUri(dartPath).toString(),
'packageRoot': x0,
'message': message
- }).then((x1) {
+ })).then((x1) {
try {
x1;
- port.first.then((x2) {
+ new Future.value(port.first).then((x2) {
try {
var response = x2;
join1() {
@@ -177,9 +177,8 @@
join3() {
snapshotArgs.addAll(
['--snapshot=${snapshot}', dartPath]);
- runProcess(
- Platform.executable,
- snapshotArgs).then((x3) {
+ new Future.value(
+ runProcess(Platform.executable, snapshotArgs)).then((x3) {
try {
var result = x3;
join4() {
@@ -237,7 +236,7 @@
}
});
return completer0.future;
- })).then((x0) {
+ }))).then((x0) {
try {
x0;
completer0.complete();
@@ -266,11 +265,12 @@
}
}
try {
- Isolate.spawnUri(
- path.toUri(snapshot),
- [],
- message,
- packageRoot: packageRoot).then((x1) {
+ new Future.value(
+ Isolate.spawnUri(
+ path.toUri(snapshot),
+ [],
+ message,
+ packageRoot: packageRoot)).then((x1) {
try {
x1;
completer0.complete(null);
diff --git a/sdk/lib/_internal/pub_generated/lib/src/entrypoint.dart b/sdk/lib/_internal/pub_generated/lib/src/entrypoint.dart
index 4927ec0..5234361 100644
--- a/sdk/lib/_internal/pub_generated/lib/src/entrypoint.dart
+++ b/sdk/lib/_internal/pub_generated/lib/src/entrypoint.dart
@@ -115,26 +115,28 @@
final completer0 = new Completer();
scheduleMicrotask(() {
try {
- resolveVersions(
- type,
- cache.sources,
- root,
- lockFile: lockFile,
- useLatest: useLatest).then((x0) {
+ new Future.value(
+ resolveVersions(
+ type,
+ cache.sources,
+ root,
+ lockFile: lockFile,
+ useLatest: useLatest)).then((x0) {
try {
var result = x0;
join0() {
result.showReport(type);
join1() {
join2() {
- Future.wait(result.packages.map(_get)).then((x1) {
+ new Future.value(
+ Future.wait(result.packages.map(_get))).then((x1) {
try {
var ids = x1;
_saveLockFile(ids);
join3() {
_linkOrDeleteSecondaryPackageDirs();
result.summarizeChanges(type, dryRun: dryRun);
- loadPackageGraph(result).then((x2) {
+ new Future.value(loadPackageGraph(result)).then((x2) {
try {
var packageGraph = x2;
packageGraph.loadTransformerCache().clearIfOutdated(
@@ -203,7 +205,7 @@
scheduleMicrotask(() {
try {
join0() {
- loadPackageGraph().then((x0) {
+ new Future.value(loadPackageGraph()).then((x0) {
try {
var graph = x0;
var depsDir = path.join('.pub', 'deps', 'debug');
@@ -222,7 +224,8 @@
})).toSet();
join1() {
join2() {
- log.progress("Precompiling dependencies", (() {
+ new Future.value(
+ log.progress("Precompiling dependencies", (() {
final completer0 = new Completer();
scheduleMicrotask(() {
try {
@@ -230,19 +233,22 @@
dependenciesToPrecompile.map(graph.transitiveDependencies)).map(((package) {
return package.name;
})).toSet();
- AssetEnvironment.create(
- this,
- BarbackMode.DEBUG,
- packages: packagesToLoad,
- useDart2JS: false).then((x0) {
+ new Future.value(
+ AssetEnvironment.create(
+ this,
+ BarbackMode.DEBUG,
+ packages: packagesToLoad,
+ useDart2JS: false)).then((x0) {
try {
var environment = x0;
environment.barback.errors.listen(((_) {
}));
- environment.barback.getAllAssets().then((x1) {
+ new Future.value(
+ environment.barback.getAllAssets()).then((x1) {
try {
var assets = x1;
- waitAndPrintErrors(assets.map(((asset) {
+ new Future.value(
+ waitAndPrintErrors(assets.map(((asset) {
final completer0 = new Completer();
scheduleMicrotask(() {
try {
@@ -250,9 +256,8 @@
var destPath =
path.join(depsDir, asset.id.package, path.fromUri(asset.id.path));
ensureDir(path.dirname(destPath));
- createFileFromStream(
- asset.read(),
- destPath).then((x0) {
+ new Future.value(
+ createFileFromStream(asset.read(), destPath)).then((x0) {
try {
x0;
completer0.complete();
@@ -272,7 +277,7 @@
}
});
return completer0.future;
- }))).then((x2) {
+ })))).then((x2) {
try {
x2;
log.message(
@@ -301,7 +306,7 @@
dependenciesToPrecompile.forEach(
(package) => deleteEntry(path.join(depsDir, package)));
throw error;
- })).then((x1) {
+ }))).then((x1) {
try {
x1;
completer0.complete();
@@ -394,7 +399,7 @@
fileExists(sdkVersionPath) &&
readTextFile(sdkVersionPath) == "${sdk.version}\n";
join1() {
- loadPackageGraph().then((x0) {
+ new Future.value(loadPackageGraph()).then((x0) {
try {
var graph = x0;
var executables =
@@ -407,7 +412,8 @@
break0() {
join2() {
join3() {
- log.progress("Precompiling executables", (() {
+ new Future.value(
+ log.progress("Precompiling executables", (() {
final completer0 = new Completer();
scheduleMicrotask(() {
try {
@@ -421,28 +427,30 @@
unionAll(executables.values.map(((ids) {
return ids.toSet();
})));
- AssetEnvironment.create(
- this,
- BarbackMode.RELEASE,
- packages: packagesToLoad,
- entrypoints: executableIds,
- useDart2JS: false).then((x0) {
+ new Future.value(
+ AssetEnvironment.create(
+ this,
+ BarbackMode.RELEASE,
+ packages: packagesToLoad,
+ entrypoints: executableIds,
+ useDart2JS: false)).then((x0) {
try {
var environment = x0;
environment.barback.errors.listen(((error) {
log.error(log.red("Build error:\n$error"));
}));
- waitAndPrintErrors(
- executables.keys.map(((package) {
+ new Future.value(
+ waitAndPrintErrors(executables.keys.map(((package) {
final completer0 = new Completer();
scheduleMicrotask(() {
try {
var dir = path.join(binDir, package);
cleanDir(dir);
- environment.precompileExecutables(
- package,
- dir,
- executableIds: executables[package]).then((x0) {
+ new Future.value(
+ environment.precompileExecutables(
+ package,
+ dir,
+ executableIds: executables[package])).then((x0) {
try {
x0;
completer0.complete();
@@ -455,7 +463,7 @@
}
});
return completer0.future;
- }))).then((x1) {
+ })))).then((x1) {
try {
x1;
completer0.complete();
@@ -472,7 +480,7 @@
}
});
return completer0.future;
- })).then((x1) {
+ }))).then((x1) {
try {
x1;
completer0.complete();
@@ -700,20 +708,22 @@
scheduleMicrotask(() {
try {
join0() {
- log.progress("Loading package graph", (() {
+ new Future.value(log.progress("Loading package graph", (() {
final completer0 = new Completer();
scheduleMicrotask(() {
try {
join0() {
- ensureLockFileIsUpToDate().then((x0) {
+ new Future.value(ensureLockFileIsUpToDate()).then((x0) {
try {
x0;
- Future.wait(lockFile.packages.values.map(((id) {
+ new Future.value(
+ Future.wait(lockFile.packages.values.map(((id) {
final completer0 = new Completer();
scheduleMicrotask(() {
try {
var source = cache.sources[id.source];
- source.getDirectory(id).then((x0) {
+ new Future.value(
+ source.getDirectory(id)).then((x0) {
try {
var dir = x0;
completer0.complete(
@@ -727,7 +737,7 @@
}
});
return completer0.future;
- }))).then((x1) {
+ })))).then((x1) {
try {
var packages = x1;
var packageMap =
@@ -747,11 +757,12 @@
}, onError: completer0.completeError);
}
if (result != null) {
- Future.wait(result.packages.map(((id) {
+ new Future.value(Future.wait(result.packages.map(((id) {
final completer0 = new Completer();
scheduleMicrotask(() {
try {
- cache.sources[id.source].getDirectory(id).then((x0) {
+ new Future.value(
+ cache.sources[id.source].getDirectory(id)).then((x0) {
try {
var dir = x0;
completer0.complete(
@@ -765,7 +776,7 @@
}
});
return completer0.future;
- }))).then((x2) {
+ })))).then((x2) {
try {
var packages = x2;
completer0.complete(
@@ -787,7 +798,7 @@
}
});
return completer0.future;
- }), fine: true).then((x0) {
+ }), fine: true)).then((x0) {
try {
var graph = x0;
_packageGraph = graph;
diff --git a/sdk/lib/_internal/pub_generated/lib/src/executable.dart b/sdk/lib/_internal/pub_generated/lib/src/executable.dart
index 3737939..d8016ea 100644
--- a/sdk/lib/_internal/pub_generated/lib/src/executable.dart
+++ b/sdk/lib/_internal/pub_generated/lib/src/executable.dart
@@ -49,11 +49,12 @@
join5() {
var assetPath = "${p.url.joinAll(p.split(executable))}.dart";
var id = new AssetId(package, assetPath);
- AssetEnvironment.create(
- entrypoint,
- mode,
- useDart2JS: false,
- entrypoints: [id]).then((x0) {
+ new Future.value(
+ AssetEnvironment.create(
+ entrypoint,
+ mode,
+ useDart2JS: false,
+ entrypoints: [id])).then((x0) {
try {
var environment = x0;
environment.barback.errors.listen(((error) {
@@ -73,9 +74,8 @@
vmArgs.add(
server.url.resolve(relativePath).toString());
vmArgs.addAll(args);
- Process.start(
- Platform.executable,
- vmArgs).then((x0) {
+ new Future.value(
+ Process.start(Platform.executable, vmArgs)).then((x0) {
try {
var process = x0;
process.stderr.listen(stderr.add);
@@ -105,7 +105,8 @@
})));
}
if (package == entrypoint.root.name) {
- environment.serveDirectory(rootDir).then((x1) {
+ new Future.value(
+ environment.serveDirectory(rootDir)).then((x1) {
try {
server = x1;
join6();
@@ -114,8 +115,8 @@
}
}, onError: completer0.completeError);
} else {
- environment.servePackageBinDirectory(
- package).then((x2) {
+ new Future.value(
+ environment.servePackageBinDirectory(package)).then((x2) {
try {
server = x2;
join6();
@@ -165,7 +166,7 @@
!entrypoint.root.immediateDependencies.any(((dep) {
return dep.name == package;
}))) {
- entrypoint.loadPackageGraph().then((x3) {
+ new Future.value(entrypoint.loadPackageGraph()).then((x3) {
try {
var graph = x3;
join7() {
@@ -228,7 +229,8 @@
final completer0 = new Completer();
scheduleMicrotask(() {
try {
- Process.start(Platform.executable, vmArgs).then((x0) {
+ new Future.value(
+ Process.start(Platform.executable, vmArgs)).then((x0) {
try {
var process = x0;
process.stderr.listen(stderr.add);
@@ -245,11 +247,11 @@
});
return completer0.future;
}
- runProcess(stdin1).then((x0) {
+ new Future.value(runProcess(stdin1)).then((x0) {
try {
var exitCode = x0;
join2() {
- recompile().then((x1) {
+ new Future.value(recompile()).then((x1) {
try {
x1;
completer0.complete(runProcess(stdin2));
diff --git a/sdk/lib/_internal/pub_generated/lib/src/git.dart b/sdk/lib/_internal/pub_generated/lib/src/git.dart
index 1e3291f..a574e8a 100644
--- a/sdk/lib/_internal/pub_generated/lib/src/git.dart
+++ b/sdk/lib/_internal/pub_generated/lib/src/git.dart
@@ -50,13 +50,17 @@
"Cannot find a Git executable.\n" "Please ensure Git is correctly installed.");
}
+ log.muteProgress();
return runProcess(
_gitCommand,
args,
workingDir: workingDir,
environment: environment).then((result) {
if (!result.success) throw new GitException(args, result.stderr.join("\n"));
+
return result.stdout;
+ }).whenComplete(() {
+ log.unmuteProgress();
});
}
diff --git a/sdk/lib/_internal/pub_generated/lib/src/global_packages.dart b/sdk/lib/_internal/pub_generated/lib/src/global_packages.dart
index a05d2ce..aff228f 100644
--- a/sdk/lib/_internal/pub_generated/lib/src/global_packages.dart
+++ b/sdk/lib/_internal/pub_generated/lib/src/global_packages.dart
@@ -85,14 +85,15 @@
scheduleMicrotask(() {
try {
var source = cache.sources["git"] as GitSource;
- source.getPackageNameFromRepo(repo).then((x0) {
+ new Future.value(source.getPackageNameFromRepo(repo)).then((x0) {
try {
var name = x0;
_describeActive(name);
- _installInCache(
- new PackageDep(name, "git", VersionConstraint.any, repo),
- executables,
- overwriteBinStubs: overwriteBinStubs).then((x1) {
+ new Future.value(
+ _installInCache(
+ new PackageDep(name, "git", VersionConstraint.any, repo),
+ executables,
+ overwriteBinStubs: overwriteBinStubs)).then((x1) {
try {
x1;
completer0.complete();
@@ -127,10 +128,11 @@
scheduleMicrotask(() {
try {
_describeActive(name);
- _installInCache(
- new PackageDep(name, "hosted", constraint, name),
- executables,
- overwriteBinStubs: overwriteBinStubs).then((x0) {
+ new Future.value(
+ _installInCache(
+ new PackageDep(name, "hosted", constraint, name),
+ executables,
+ overwriteBinStubs: overwriteBinStubs)).then((x0) {
try {
x0;
completer0.complete();
@@ -160,7 +162,7 @@
scheduleMicrotask(() {
try {
var entrypoint = new Entrypoint(path, cache);
- entrypoint.ensureLockFileIsUpToDate().then((x0) {
+ new Future.value(entrypoint.ensureLockFileIsUpToDate()).then((x0) {
try {
x0;
var name = entrypoint.root.name;
@@ -209,24 +211,26 @@
"pub global activate",
dependencies: [dep],
sources: cache.sources));
- resolveVersions(SolveType.GET, cache.sources, root).then((x0) {
+ new Future.value(
+ resolveVersions(SolveType.GET, cache.sources, root)).then((x0) {
try {
var result = x0;
join0() {
result.showReport(SolveType.GET);
- Future.wait(result.packages.map(_cacheDependency)).then((x1) {
+ new Future.value(
+ Future.wait(result.packages.map(_cacheDependency))).then((x1) {
try {
var ids = x1;
var lockFile = new LockFile(ids);
- new Entrypoint.inMemory(
- root,
- lockFile,
- cache).loadPackageGraph(result).then((x2) {
+ new Future.value(
+ new Entrypoint.inMemory(
+ root,
+ lockFile,
+ cache).loadPackageGraph(result)).then((x2) {
try {
var graph = x2;
- _precompileExecutables(
- graph.entrypoint,
- dep.name).then((x3) {
+ new Future.value(
+ _precompileExecutables(graph.entrypoint, dep.name)).then((x3) {
try {
var snapshots = x3;
_writeLockFile(dep.name, lockFile);
@@ -295,14 +299,15 @@
try {
var binDir = p.join(_directory, package, 'bin');
cleanDir(binDir);
- entrypoint.loadPackageGraph().then((x0) {
+ new Future.value(entrypoint.loadPackageGraph()).then((x0) {
try {
var graph = x0;
- AssetEnvironment.create(
- entrypoint,
- BarbackMode.RELEASE,
- entrypoints: graph.packages[package].executableIds,
- useDart2JS: false).then((x1) {
+ new Future.value(
+ AssetEnvironment.create(
+ entrypoint,
+ BarbackMode.RELEASE,
+ entrypoints: graph.packages[package].executableIds,
+ useDart2JS: false)).then((x1) {
try {
var environment = x1;
environment.barback.errors.listen(((error) {
@@ -338,7 +343,7 @@
completer0.complete(source.resolveId(id));
}
if (!id.isRoot && source is CachedSource) {
- source.downloadToSystemCache(id).then((x0) {
+ new Future.value(source.downloadToSystemCache(id)).then((x0) {
try {
x0;
join0();
@@ -640,19 +645,19 @@
id = _loadPackageId(entry);
log.message(
"Reactivating ${log.bold(id.name)} ${id.version}...");
- find(id.name).then((x0) {
+ new Future.value(find(id.name)).then((x0) {
trampoline0 = () {
trampoline0 = null;
try {
var entrypoint = x0;
- entrypoint.loadPackageGraph().then((x1) {
+ new Future.value(
+ entrypoint.loadPackageGraph()).then((x1) {
trampoline0 = () {
trampoline0 = null;
try {
var graph = x1;
- _precompileExecutables(
- entrypoint,
- id.name).then((x2) {
+ new Future.value(
+ _precompileExecutables(entrypoint, id.name)).then((x2) {
trampoline0 = () {
trampoline0 = null;
try {
diff --git a/sdk/lib/_internal/pub_generated/lib/src/log.dart b/sdk/lib/_internal/pub_generated/lib/src/log.dart
index 2b8cb4a..94a40b6 100644
--- a/sdk/lib/_internal/pub_generated/lib/src/log.dart
+++ b/sdk/lib/_internal/pub_generated/lib/src/log.dart
@@ -42,9 +42,6 @@
/// [recordTranscript()] is called.
Transcript<Entry> _transcript;
-/// All currently-running progress indicators.
-final _progresses = new Set<Progress>();
-
/// The currently-animated progress indicator, if any.
///
/// This will also be in [_progresses].
@@ -376,13 +373,10 @@
/// information will only be visible at [Level.FINE].
Future progress(String message, Future callback(), {bool fine: false}) {
_stopProgress();
+
var progress = new Progress(message, fine: fine);
_animatedProgress = progress;
- _progresses.add(progress);
- return callback().whenComplete(() {
- progress.stop();
- _progresses.remove(progress);
- });
+ return callback().whenComplete(progress.stop);
}
/// Stops animating the running progress indicator, if currently running.
@@ -391,6 +385,31 @@
_animatedProgress = null;
}
+/// The number of outstanding calls to [muteProgress] that have not been unmuted
+/// yet.
+int _numMutes = 0;
+
+/// Whether progress animation should be muted or not.
+bool get isMuted => _numMutes > 0;
+
+/// Stops animating any ongoing progress.
+///
+/// This is called before spawning Git since Git sometimes writes directly to
+/// the terminal to ask for login credentials, which would then get overwritten
+/// by the progress animation.
+///
+/// Each call to this must be paired with a call to [unmuteProgress].
+void muteProgress() {
+ _numMutes++;
+}
+
+/// Resumes animating any ongoing progress once all calls to [muteProgress]
+/// have made their matching [unmuteProgress].
+void unmuteProgress() {
+ assert(_numMutes > 0);
+ _numMutes--;
+}
+
/// Wraps [text] in the ANSI escape codes to make it bold when on a platform
/// that supports that.
///
diff --git a/sdk/lib/_internal/pub_generated/lib/src/progress.dart b/sdk/lib/_internal/pub_generated/lib/src/progress.dart
index d74da56..483157d2 100644
--- a/sdk/lib/_internal/pub_generated/lib/src/progress.dart
+++ b/sdk/lib/_internal/pub_generated/lib/src/progress.dart
@@ -49,10 +49,11 @@
return;
}
- _update();
_timer = new Timer.periodic(new Duration(milliseconds: 100), (_) {
_update();
});
+
+ _update();
}
/// Stops the progress indicator.
@@ -89,11 +90,11 @@
/// Refreshes the progress line.
void _update() {
+ if (log.isMuted) return;
+
stdout.write(log.format("\r$_message... "));
// Show the time only once it gets noticeably long.
- if (_stopwatch.elapsed.inSeconds > 0) {
- stdout.write(log.gray(_time));
- }
+ if (_stopwatch.elapsed.inSeconds > 0) stdout.write("${log.gray(_time)} ");
}
}
diff --git a/sdk/lib/_internal/pub_generated/lib/src/source/git.dart b/sdk/lib/_internal/pub_generated/lib/src/source/git.dart
index b8cabb2..18b4954 100644
--- a/sdk/lib/_internal/pub_generated/lib/src/source/git.dart
+++ b/sdk/lib/_internal/pub_generated/lib/src/source/git.dart
@@ -193,16 +193,14 @@
}
}
try {
- git.run(
- ["clean", "-d", "--force", "-x"],
- workingDir: package.dir).then((x0) {
+ new Future.value(
+ git.run(["clean", "-d", "--force", "-x"], workingDir: package.dir)).then((x0) {
trampoline0 = () {
trampoline0 = null;
try {
x0;
- git.run(
- ["reset", "--hard", "HEAD"],
- workingDir: package.dir).then((x1) {
+ new Future.value(
+ git.run(["reset", "--hard", "HEAD"], workingDir: package.dir)).then((x1) {
trampoline0 = () {
trampoline0 = null;
try {
diff --git a/sdk/lib/_internal/pub_generated/lib/src/source/hosted.dart b/sdk/lib/_internal/pub_generated/lib/src/source/hosted.dart
index bc4bcd5..489671c 100644
--- a/sdk/lib/_internal/pub_generated/lib/src/source/hosted.dart
+++ b/sdk/lib/_internal/pub_generated/lib/src/source/hosted.dart
@@ -148,7 +148,7 @@
var packages =
_getCachedPackagesInDirectory(path.basename(serverDir));
packages.sort(Package.orderByNameAndVersion);
- Future.forEach(packages, ((package) {
+ new Future.value(Future.forEach(packages, ((package) {
final completer0 = new Completer();
scheduleMicrotask(() {
try {
@@ -177,11 +177,8 @@
}
}
try {
- _download(
- url,
- package.name,
- package.version,
- package.dir).then((x0) {
+ new Future.value(
+ _download(url, package.name, package.version, package.dir)).then((x0) {
try {
x0;
successes++;
@@ -198,7 +195,7 @@
}
});
return completer0.future;
- })).then((x0) {
+ }))).then((x0) {
trampoline0 = () {
trampoline0 = null;
try {
diff --git a/sdk/lib/_internal/pub_generated/lib/src/validator/dependency.dart b/sdk/lib/_internal/pub_generated/lib/src/validator/dependency.dart
index d558407..efbd53c 100644
--- a/sdk/lib/_internal/pub_generated/lib/src/validator/dependency.dart
+++ b/sdk/lib/_internal/pub_generated/lib/src/validator/dependency.dart
@@ -40,7 +40,8 @@
scheduleMicrotask(() {
try {
var caretDeps = [];
- Future.forEach(entrypoint.root.pubspec.dependencies, ((dependency) {
+ new Future.value(
+ Future.forEach(entrypoint.root.pubspec.dependencies, ((dependency) {
final completer0 = new Completer();
scheduleMicrotask(() {
try {
@@ -48,7 +49,7 @@
completer0.complete();
}
if (dependency.source != "hosted") {
- _warnAboutSource(dependency).then((x0) {
+ new Future.value(_warnAboutSource(dependency)).then((x0) {
try {
x0;
join0();
@@ -111,7 +112,7 @@
}
});
return completer0.future;
- })).then((x0) {
+ }))).then((x0) {
try {
x0;
join0() {
diff --git a/sdk/lib/_internal/pub_generated/test/global/binstubs/utils.dart b/sdk/lib/_internal/pub_generated/test/global/binstubs/utils.dart
index 7e1a7ae..bd2243f 100644
--- a/sdk/lib/_internal/pub_generated/test/global/binstubs/utils.dart
+++ b/sdk/lib/_internal/pub_generated/test/global/binstubs/utils.dart
@@ -20,7 +20,7 @@
join0(x0) {
var separator = x0;
var path = "${Platform.environment["PATH"]}${separator}${binDir}";
- getPubTestEnvironment().then((x1) {
+ new Future.value(getPubTestEnvironment()).then((x1) {
try {
var environment = x1;
environment["PATH"] = path;
diff --git a/sdk/lib/async/future.dart b/sdk/lib/async/future.dart
index 10aa237..7f4050c 100644
--- a/sdk/lib/async/future.dart
+++ b/sdk/lib/async/future.dart
@@ -239,14 +239,24 @@
* Returns a future which will complete once all the futures in a list are
* complete. If any of the futures in the list completes with an error,
* the resulting future also completes with an error. Otherwise the value
- * of the returned future will be a list of all the values that were produced.
+ * of the returned future will be a list of all the values that were
+ * produced.
*
* If `eagerError` is true, the future completes with an error immediately on
* the first error from one of the futures. Otherwise all futures must
* complete before the returned future is completed (still with the first
* error to occur, the remaining errors are silently dropped).
+ *
+ * If [cleanUp] is provided, in the case of an error, any non-null result of
+ * a successful future is passed to `cleanUp`, which can then release any
+ * resources that the successful operation allocated.
+ *
+ * The call to `cleanUp` should not throw. If it does, the error will be an
+ * uncaught asynchronous error.
*/
- static Future<List> wait(Iterable<Future> futures, {bool eagerError: false}) {
+ static Future<List> wait(Iterable<Future> futures,
+ {bool eagerError: false,
+ void cleanUp(successValue)}) {
final _Future<List> result = new _Future<List>();
List values; // Collects the values. Set to null on error.
int remaining = 0; // How many futures are we waiting for.
@@ -254,11 +264,18 @@
StackTrace stackTrace; // The stackTrace that came with the error.
// Handle an error from any of the futures.
- handleError(theError, theStackTrace) {
- final bool isFirstError = (values != null);
- values = null;
+ void handleError(theError, theStackTrace) {
remaining--;
- if (isFirstError) {
+ if (values != null) {
+ if (cleanUp != null) {
+ for (var value in values) {
+ if (value != null) {
+ // Ensure errors from cleanUp are uncaught.
+ new Future.sync(() { cleanUp(value); });
+ }
+ }
+ }
+ values = null;
if (remaining == 0 || eagerError) {
result._completeError(theError, theStackTrace);
} else {
@@ -281,8 +298,14 @@
if (remaining == 0) {
result._completeWithValue(values);
}
- } else if (remaining == 0 && !eagerError) {
- result._completeError(error, stackTrace);
+ } else {
+ if (cleanUp != null && value != null) {
+ // Ensure errors from cleanUp are uncaught.
+ new Future.sync(() { cleanUp(value); });
+ }
+ if (remaining == 0 && !eagerError) {
+ result._completeError(error, stackTrace);
+ }
}
}, onError: handleError);
}
diff --git a/sdk/lib/io/directory_impl.dart b/sdk/lib/io/directory_impl.dart
index 00c0450..a54b2ef 100644
--- a/sdk/lib/io/directory_impl.dart
+++ b/sdk/lib/io/directory_impl.dart
@@ -286,6 +286,9 @@
if (response is int) {
id = response;
next();
+ } else if (response is Error) {
+ controller.addError(response);
+ close();
} else {
error(response);
close();
diff --git a/sdk/lib/io/file.dart b/sdk/lib/io/file.dart
index 9565d4d..711793a 100644
--- a/sdk/lib/io/file.dart
+++ b/sdk/lib/io/file.dart
@@ -32,6 +32,20 @@
/// end of it. The file is created if it does not already exist.
const APPEND = FileMode.APPEND;
+
+/// Type of lock when requesting a lock on a file.
+class FileLock {
+ final int _lock;
+
+ /// Shared file lock.
+ static const SHARED = const FileLock._internal(0);
+
+ /// Exclusive file lock.
+ static const EXCLUSIVE = const FileLock._internal(1);
+
+ const FileLock._internal(this._lock);
+}
+
/**
* A reference to a file on the file system.
*
@@ -698,6 +712,104 @@
void flushSync();
/**
+ * Locks the file or part of the file.
+ *
+ * By default an exclusive lock will be obtained, but that can be overridden
+ * by the [mode] argument.
+ *
+ * Locks the byte range from [start] to [end] of the file, with the
+ * byte at position `end` not included. If no arguments are
+ * specified, the full file is locked, If only `start` is specified
+ * the file is locked from byte position `start` to the end of the
+ * file, no matter how large it grows. It is possible to specify an
+ * explicit value of `end` which is past the current length of the file.
+ *
+ * To obtain an exclusive lock on a file it must be opened for writing.
+ *
+ * *NOTE* file locking does have slight differences in behavior across
+ * platforms:
+ *
+ * On Linux and Mac OS this uses advisory locks, which have the
+ * surprising semantics that all locks associated with a given file
+ * are removed when *any* file descriptor for that file is closed by
+ * the process. Note that this does not actually lock the file for
+ * access. Also note that advisory locks are on a process
+ * level. This means that several isolates in the same process can
+ * obtain an exclusive lock on the same file.
+ *
+ * On Windows the regions used for lock and unlock needs to match. If that
+ * is not the case unlocking will result in the OS error "The segment is
+ * already unlocked".
+ */
+ Future<RandomAccessFile> lock(
+ [FileLock mode = FileLock.EXCLUSIVE, int start = 0, int end]);
+
+ /**
+ * Synchronously locks the file or part of the file.
+ *
+ * By default an exclusive lock will be obtained, but that can be overridden
+ * by the [mode] argument.
+ *
+ * Locks the byte range from [start] to [end] of the file ,with the
+ * byte at position `end` not included. If no arguments are
+ * specified, the full file is locked, If only `start` is specified
+ * the file is locked from byte position `start` to the end of the
+ * file, no matter how large it grows. It is possible to specify an
+ * explicit value of `end` which is past the current length of the file.
+ *
+ * To obtain an exclusive lock on a file it must be opened for writing.
+ *
+ * *NOTE* file locking does have slight differences in behavior across
+ * platforms:
+ *
+ * On Linux and Mac OS this uses advisory locks, which have the
+ * surprising semantics that all locks associated with a given file
+ * are removed when *any* file descriptor for that file is closed by
+ * the process. Note that this does not actually lock the file for
+ * access. Also note that advisory locks are on a process
+ * level. This means that several isolates in the same process can
+ * obtain an exclusive lock on the same file.
+ *
+ * On Windows the regions used for lock and unlock needs to match. If that
+ * is not the case unlocking will result in the OS error "The segment is
+ * already unlocked".
+ *
+ */
+ void lockSync([FileLock mode = FileLock.EXCLUSIVE, int start = 0, int end]);
+
+ /**
+ * Unlocks the file or part of the file.
+ *
+ * Unlocks the byte range from [start] to [end] of the file, with
+ * the byte at position `end` not included. If no arguments are
+ * specified, the full file is unlocked, If only `start` is
+ * specified the file is unlocked from byte position `start` to the
+ * end of the file.
+ *
+ * *NOTE* file locking does have slight differences in behavior across
+ * platforms:
+ *
+ * See [lock] for more details.
+ */
+ Future<RandomAccessFile> unlock([int start = 0, int end]);
+
+ /**
+ * Synchronously unlocks the file or part of the file.
+ *
+ * Unlocks the byte range from [start] to [end] of the file, with
+ * the byte at position `end` not included. If no arguments are
+ * specified, the full file is unlocked, If only `start` is
+ * specified the file is unlocked from byte position `start` to the
+ * end of the file.
+ *
+ * *NOTE* file locking does have slight differences in behavior across
+ * platforms:
+ *
+ * See [lockSync] for more details.
+ */
+ void unlockSync([int start = 0, int end]);
+
+ /**
* Returns a human-readable string for this RandomAccessFile instance.
*/
String toString();
diff --git a/sdk/lib/io/file_impl.dart b/sdk/lib/io/file_impl.dart
index 72d5a6d..b0babc2 100644
--- a/sdk/lib/io/file_impl.dart
+++ b/sdk/lib/io/file_impl.dart
@@ -940,6 +940,85 @@
}
}
+ static final int LOCK_UNLOCK = 0;
+ static final int LOCK_SHARED = 1;
+ static final int LOCK_EXCLUSIVE = 2;
+
+ Future<RandomAccessFile> lock(
+ [FileLock mode = FileLock.EXCLUSIVE, int start = 0, int end]) {
+ if ((start != null && start is !int) ||
+ (end != null && end is !int) ||
+ mode is !FileLock) {
+ throw new ArgumentError();
+ }
+ if (start == null) start = 0;
+ if (end == null) end = -1;
+ if (start < 0 || end < -1 || (end != -1 && start >= end)) {
+ throw new ArgumentError();
+ }
+ int lock = mode == FileLock.EXCLUSIVE ? LOCK_EXCLUSIVE : LOCK_SHARED;
+ return _dispatch(_FILE_LOCK, [_id, lock, start, end])
+ .then((response) {
+ if (_isErrorResponse(response)) {
+ throw _exceptionFromResponse(response, 'lock failed', path);
+ }
+ return this;
+ });
+ }
+
+ Future<RandomAccessFile> unlock([int start = 0, int end]) {
+ if ((start != null && start is !int) ||
+ (end != null && end is !int)) {
+ throw new ArgumentError();
+ }
+ if (start == null) start = 0;
+ if (end == null) end = -1;
+ if (start == end) throw new ArgumentError();
+ return _dispatch(_FILE_LOCK, [_id, LOCK_UNLOCK, start, end])
+ .then((response) {
+ if (_isErrorResponse(response)) {
+ throw _exceptionFromResponse(response, 'unlock failed', path);
+ }
+ return this;
+ });
+ }
+
+ external static _lock(int id, int lock, int start, int end);
+
+ void lockSync([FileLock mode = FileLock.EXCLUSIVE, int start = 0, int end]) {
+ _checkAvailable();
+ if ((start != null && start is !int) ||
+ (end != null && end is !int) ||
+ mode is !FileLock) {
+ throw new ArgumentError();
+ }
+ if (start == null) start = 0;
+ if (end == null) end = -1;
+ if (start < 0 || end < -1 || (end != -1 && start >= end)) {
+ throw new ArgumentError();
+ }
+ int lock = mode == FileLock.EXCLUSIVE ? LOCK_EXCLUSIVE : LOCK_SHARED;
+ var result = _lock(_id, lock, start, end);
+ if (result is OSError) {
+ throw new FileSystemException('lock failed', path, result);
+ }
+ }
+
+ void unlockSync([int start = 0, int end]) {
+ _checkAvailable();
+ if ((start != null && start is !int) ||
+ (end != null && end is !int)) {
+ throw new ArgumentError();
+ }
+ if (start == null) start = 0;
+ if (end == null) end = -1;
+ if (start == end) throw new ArgumentError();
+ var result = _lock(_id, LOCK_UNLOCK, start, end);
+ if (result is OSError) {
+ throw new FileSystemException('unlock failed', path, result);
+ }
+ }
+
bool get closed => _id == 0;
Future _dispatch(int request, List data, { bool markClosed: false }) {
diff --git a/sdk/lib/io/file_system_entity.dart b/sdk/lib/io/file_system_entity.dart
index 2c43295..ee4312f 100644
--- a/sdk/lib/io/file_system_entity.dart
+++ b/sdk/lib/io/file_system_entity.dart
@@ -269,22 +269,30 @@
/**
* Resolves the path of a file system object relative to the
* current working directory, resolving all symbolic links on
- * the path and resolving all '..' and '.' path segments.
- * [resolveSymbolicLinks] returns a [:Future<String>:]
+ * the path and resolving all `..` and `.` path segments.
*
- * [resolveSymbolicLinks] uses the operating system's native filesystem api
- * to resolve the path, using the realpath function on linux and
- * Mac OS, and the GetFinalPathNameByHandle function on Windows.
- * If the path does not point to an existing file system object,
- * [resolveSymbolicLinks] completes the returned Future with an FileSystemException.
+ * [resolveSymbolicLinks] uses the operating system's native
+ * file system API to resolve the path, using the `realpath` function
+ * on linux and Mac OS, and the `GetFinalPathNameByHandle` function on
+ * Windows. If the path does not point to an existing file system object,
+ * `resolveSymbolicLinks` throws a `FileSystemException`.
*
- * On Windows, symbolic links are resolved to their target before applying
- * a '..' that follows, and on other platforms, the '..' is applied to the
- * symbolic link without resolving it. The second behavior can be emulated
- * on Windows by processing any '..' segments before calling
- * [resolveSymbolicLinks]. One way of doing this is with the URI class:
- * [:new Uri.parse('.').resolveUri(new Uri.file(input)).toFilePath();],
- * since [resolve] removes '..' segments.
+ * On Windows the `..` segments are resolved _before_ resolving the symbolic
+ * link, and on other platforms the symbolic links are _resolved to their
+ * target_ before applying a `..` that follows.
+ *
+ * To ensure the same behavior on all platforms resolve `..` segments before
+ * calling `resolveSymbolicLinks`. One way of doing this is with the `Uri`
+ * class:
+ *
+ * var path = Uri.parse('.').resolveUri(new Uri.file(input)).toFilePath();
+ * if (path == '') path = '.';
+ * new File(path).resolveSymbolicLinks().then((resolved) {
+ * print(resolved);
+ * });
+ *
+ * since `Uri.resolve` removes `..` segments. This will result in the Windows
+ * behavior.
*/
Future<String> resolveSymbolicLinks() {
return _IOService.dispatch(_FILE_RESOLVE_SYMBOLIC_LINKS, [path])
@@ -301,21 +309,29 @@
/**
* Resolves the path of a file system object relative to the
* current working directory, resolving all symbolic links on
- * the path and resolving all '..' and '.' path segments.
+ * the path and resolving all `..` and `.` path segments.
*
* [resolveSymbolicLinksSync] uses the operating system's native
- * filesystem api to resolve the path, using the realpath function
- * on linux and Mac OS, and the GetFinalPathNameByHandle function on Windows.
- * If the path does not point to an existing file system object,
- * [resolveSymbolicLinksSync] throws a FileSystemException.
+ * file system API to resolve the path, using the `realpath` function
+ * on linux and Mac OS, and the `GetFinalPathNameByHandle` function on
+ * Windows. If the path does not point to an existing file system object,
+ * `resolveSymbolicLinksSync` throws a `FileSystemException`.
*
- * On Windows, symbolic links are resolved to their target before applying
- * a '..' that follows, and on other platforms, the '..' is applied to the
- * symbolic link without resolving it. The second behavior can be emulated
- * on Windows by processing any '..' segments before calling
- * [resolveSymbolicLinks]. One way of doing this is with the URI class:
- * [:new Uri.parse('.').resolveUri(new Uri.file(input)).toFilePath();],
- * since [resolve] removes '..' segments.
+ * On Windows the `..` segments are resolved _before_ resolving the symbolic
+ * link, and on other platforms the symbolic links are _resolved to their
+ * target_ before applying a `..` that follows.
+ *
+ * To ensure the same behavior on all platforms resolve `..` segments before
+ * calling `resolveSymbolicLinksSync`. One way of doing this is with the `Uri`
+ * class:
+ *
+ * var path = Uri.parse('.').resolveUri(new Uri.file(input)).toFilePath();
+ * if (path == '') path = '.';
+ * var resolved = new File(path).resolveSymbolicLinksSync();
+ * print(resolved);
+ *
+ * since `Uri.resolve` removes `..` segments. This will result in the Windows
+ * behavior.
*/
String resolveSymbolicLinksSync() {
var result = _resolveSymbolicLinks(path);
diff --git a/sdk/lib/io/io_service.dart b/sdk/lib/io/io_service.dart
index 4becb03..03db8ad 100644
--- a/sdk/lib/io/io_service.dart
+++ b/sdk/lib/io/io_service.dart
@@ -32,18 +32,19 @@
const int _FILE_TYPE = 24;
const int _FILE_IDENTICAL = 25;
const int _FILE_STAT = 26;
-const int _SOCKET_LOOKUP = 27;
-const int _SOCKET_LIST_INTERFACES = 28;
-const int _SOCKET_REVERSE_LOOKUP = 29;
-const int _DIRECTORY_CREATE = 30;
-const int _DIRECTORY_DELETE = 31;
-const int _DIRECTORY_EXISTS = 32;
-const int _DIRECTORY_CREATE_TEMP = 33;
-const int _DIRECTORY_LIST_START = 34;
-const int _DIRECTORY_LIST_NEXT = 35;
-const int _DIRECTORY_LIST_STOP = 36;
-const int _DIRECTORY_RENAME = 37;
-const int _SSL_PROCESS_FILTER = 38;
+const int _FILE_LOCK = 27;
+const int _SOCKET_LOOKUP = 28;
+const int _SOCKET_LIST_INTERFACES = 29;
+const int _SOCKET_REVERSE_LOOKUP = 30;
+const int _DIRECTORY_CREATE = 31;
+const int _DIRECTORY_DELETE = 32;
+const int _DIRECTORY_EXISTS = 33;
+const int _DIRECTORY_CREATE_TEMP = 34;
+const int _DIRECTORY_LIST_START = 35;
+const int _DIRECTORY_LIST_NEXT = 36;
+const int _DIRECTORY_LIST_STOP = 37;
+const int _DIRECTORY_RENAME = 38;
+const int _SSL_PROCESS_FILTER = 39;
class _IOService {
external static Future dispatch(int request, List data);
diff --git a/site/try/src/interaction_manager.dart b/site/try/src/interaction_manager.dart
index 57cf459..7df3923 100644
--- a/site/try/src/interaction_manager.dart
+++ b/site/try/src/interaction_manager.dart
@@ -33,7 +33,7 @@
UnmatchedToken,
UnterminatedToken;
-import 'package:compiler/src/source_file.dart' show
+import 'package:compiler/src/io/source_file.dart' show
StringSourceFile;
import 'package:compiler/src/string_validator.dart' show
diff --git a/tests/co19/co19-analyzer.status b/tests/co19/co19-analyzer.status
index bf3862e..3d3ecf6 100644
--- a/tests/co19/co19-analyzer.status
+++ b/tests/co19/co19-analyzer.status
@@ -259,14 +259,35 @@
# co19-roll r786
LayoutTests/fast/events/initkeyboardevent-crash_t01: StaticWarning # co19-roll r786: Please triage this failure.
LayoutTests/fast/events/wheelevent-constructor_t01: StaticWarning # co19-roll r786: Please triage this failure.
-LayoutTests/fast/svg/getbbox_t01: StaticWarning # co19-roll r786: Please triage this failure.
+
+# co19-roll r801
+LayoutTests/fast/html/select-dropdown-consistent-background-color_t01: StaticWarning # co19-roll r801: Please triage this failure.
+LayoutTests/fast/inline/boundingBox-with-continuation_t01: StaticWarning # co19-roll r801: Please triage this failure.
+LayoutTests/fast/loader/about-blank-hash-kept_t01: StaticWarning # co19-roll r801: Please triage this failure.
+LayoutTests/fast/loader/hashchange-event-properties_t01: StaticWarning # co19-roll r801: Please triage this failure.
+LayoutTests/fast/loader/scroll-position-restored-on-reload-at-load-event_t01: StaticWarning # co19-roll r801: Please triage this failure.
+LayoutTests/fast/loader/stateobjects/replacestate-in-onunload_t01: StaticWarning # co19-roll r801: Please triage this failure.
+LayoutTests/fast/media/media-query-list-syntax_t01: StaticWarning # co19-roll r801: Please triage this failure.
+LayoutTests/fast/media/mq-append-delete_t01: StaticWarning # co19-roll r801: Please triage this failure.
+LayoutTests/fast/media/mq-color-index_t02: StaticWarning # co19-roll r801: Please triage this failure.
+LayoutTests/fast/media/mq-js-media-except_t01: StaticWarning # co19-roll r801: Please triage this failure.
+LayoutTests/fast/media/mq-js-media-except_t02: StaticWarning # co19-roll r801: Please triage this failure.
+LayoutTests/fast/media/mq-parsing_t01: StaticWarning # co19-roll r801: Please triage this failure.
+LayoutTests/fast/mediastream/RTCPeerConnection-AddRemoveStream_t01: StaticWarning # co19-roll r801: Please triage this failure.
+LayoutTests/fast/multicol/vertical-lr/float-truncation_t01: StaticWarning # co19-roll r801: Please triage this failure.
+LayoutTests/fast/multicol/vertical-lr/image-inside-nested-blocks-with-border_t01: StaticWarning # co19-roll r801: Please triage this failure.
+LayoutTests/fast/multicol/vertical-rl/float-truncation_t01: StaticWarning # co19-roll r801: Please triage this failure.
+LayoutTests/fast/multicol/vertical-rl/image-inside-nested-blocks-with-border_t01: StaticWarning # co19-roll r801: Please triage this failure.
+LayoutTests/fast/overflow/scroll-vertical-not-horizontal_t01: StaticWarning # co19-roll r801: Please triage this failure.
+LayoutTests/fast/ruby/after-doesnt-crash_t01: StaticWarning # co19-roll r801: Please triage this failure.
+LayoutTests/fast/shapes/shape-outside-floats/shape-outside-big-box-border-radius_t01: StaticWarning # co19-roll r801: Please triage this failure.
+LayoutTests/fast/shapes/shape-outside-floats/shape-outside-floats-diamond-margin-polygon_t01: StaticWarning # co19-roll r801: Please triage this failure.
+LayoutTests/fast/shapes/shape-outside-floats/shape-outside-floats-image-margin_t01: StaticWarning # co19-roll r801: Please triage this failure.
+LayoutTests/fast/shapes/shape-outside-floats/shape-outside-floats-image-margin_t02: StaticWarning # co19-roll r801: Please triage this failure.
+LayoutTests/fast/shapes/shape-outside-floats/shape-outside-rounded-boxes_t01: StaticWarning # co19-roll r801: Please triage this failure.
LayoutTests/fast/xpath/4XPath/Core/test_core_functions_t01: StaticWarning # co19 issue 703
WebPlatformTest/dom/Node-replaceChild_t01: CompileTimeError # co19-roll r761: Please triage this failure.
WebPlatformTest/html/semantics/forms/the-input-element/email_t02: StaticWarning # co19 issue 701
-
-LayoutTests/fast/table/before-child-non-table-section-add-table-crash_t01: StaticWarning # co19 issue 720.
-LayoutTests/fast/table/computeLogicalWidth-table-needsSectionRecalc_t01: StaticWarning # co19 issue 720.
-LayoutTests/fast/table/incorrect-colgroup-span-values_t01: StaticWarning # co19 issue 720.
-LayoutTests/fast/table/rowindex-comment-nodes_t01: StaticWarning # co19 issue 720.
-LayoutTests/fast/table/table-cell-offset-width_t01: StaticWarning # co19 issue 720.
+Language/12_Expressions/12_Instance_Creation/2_Const_A11_t01: MissingCompileTimeError # Issue 22010
+Language/12_Expressions/12_Instance_Creation/2_Const_A11_t03: MissingCompileTimeError # Issue 22010
diff --git a/tests/co19/co19-analyzer2.status b/tests/co19/co19-analyzer2.status
index e7124c5..668753e 100644
--- a/tests/co19/co19-analyzer2.status
+++ b/tests/co19/co19-analyzer2.status
@@ -254,14 +254,35 @@
# co19-roll r786
LayoutTests/fast/events/initkeyboardevent-crash_t01: StaticWarning # co19-roll r786: Please triage this failure.
LayoutTests/fast/events/wheelevent-constructor_t01: StaticWarning # co19-roll r786: Please triage this failure.
-LayoutTests/fast/svg/getbbox_t01: StaticWarning # co19-roll r786: Please triage this failure.
+
+# co19-roll r801
+LayoutTests/fast/html/select-dropdown-consistent-background-color_t01: StaticWarning # co19-roll r801: Please triage this failure.
+LayoutTests/fast/inline/boundingBox-with-continuation_t01: StaticWarning # co19-roll r801: Please triage this failure.
+LayoutTests/fast/loader/about-blank-hash-kept_t01: StaticWarning # co19-roll r801: Please triage this failure.
+LayoutTests/fast/loader/hashchange-event-properties_t01: StaticWarning # co19-roll r801: Please triage this failure.
+LayoutTests/fast/loader/scroll-position-restored-on-reload-at-load-event_t01: StaticWarning # co19-roll r801: Please triage this failure.
+LayoutTests/fast/loader/stateobjects/replacestate-in-onunload_t01: StaticWarning # co19-roll r801: Please triage this failure.
+LayoutTests/fast/media/media-query-list-syntax_t01: StaticWarning # co19-roll r801: Please triage this failure.
+LayoutTests/fast/media/mq-append-delete_t01: StaticWarning # co19-roll r801: Please triage this failure.
+LayoutTests/fast/media/mq-color-index_t02: StaticWarning # co19-roll r801: Please triage this failure.
+LayoutTests/fast/media/mq-js-media-except_t01: StaticWarning # co19-roll r801: Please triage this failure.
+LayoutTests/fast/media/mq-js-media-except_t02: StaticWarning # co19-roll r801: Please triage this failure.
+LayoutTests/fast/media/mq-parsing_t01: StaticWarning # co19-roll r801: Please triage this failure.
+LayoutTests/fast/mediastream/RTCPeerConnection-AddRemoveStream_t01: StaticWarning # co19-roll r801: Please triage this failure.
+LayoutTests/fast/multicol/vertical-lr/float-truncation_t01: StaticWarning # co19-roll r801: Please triage this failure.
+LayoutTests/fast/multicol/vertical-lr/image-inside-nested-blocks-with-border_t01: StaticWarning # co19-roll r801: Please triage this failure.
+LayoutTests/fast/multicol/vertical-rl/float-truncation_t01: StaticWarning # co19-roll r801: Please triage this failure.
+LayoutTests/fast/multicol/vertical-rl/image-inside-nested-blocks-with-border_t01: StaticWarning # co19-roll r801: Please triage this failure.
+LayoutTests/fast/overflow/scroll-vertical-not-horizontal_t01: StaticWarning # co19-roll r801: Please triage this failure.
+LayoutTests/fast/ruby/after-doesnt-crash_t01: StaticWarning # co19-roll r801: Please triage this failure.
+LayoutTests/fast/shapes/shape-outside-floats/shape-outside-big-box-border-radius_t01: StaticWarning # co19-roll r801: Please triage this failure.
+LayoutTests/fast/shapes/shape-outside-floats/shape-outside-floats-diamond-margin-polygon_t01: StaticWarning # co19-roll r801: Please triage this failure.
+LayoutTests/fast/shapes/shape-outside-floats/shape-outside-floats-image-margin_t01: StaticWarning # co19-roll r801: Please triage this failure.
+LayoutTests/fast/shapes/shape-outside-floats/shape-outside-floats-image-margin_t02: StaticWarning # co19-roll r801: Please triage this failure.
+LayoutTests/fast/shapes/shape-outside-floats/shape-outside-rounded-boxes_t01: StaticWarning # co19-roll r801: Please triage this failure.
LayoutTests/fast/xpath/4XPath/Core/test_core_functions_t01: StaticWarning # co19 issue 703
WebPlatformTest/dom/Node-replaceChild_t01: CompileTimeError # co19-roll r761: Please triage this failure.
WebPlatformTest/html/semantics/forms/the-input-element/email_t02: StaticWarning # co19 issue 701
-
-LayoutTests/fast/table/before-child-non-table-section-add-table-crash_t01: StaticWarning # co19 issue 720.
-LayoutTests/fast/table/computeLogicalWidth-table-needsSectionRecalc_t01: StaticWarning # co19 issue 720.
-LayoutTests/fast/table/incorrect-colgroup-span-values_t01: StaticWarning # co19 issue 720.
-LayoutTests/fast/table/rowindex-comment-nodes_t01: StaticWarning # co19 issue 720.
-LayoutTests/fast/table/table-cell-offset-width_t01: StaticWarning # co19 issue 720.
+Language/12_Expressions/12_Instance_Creation/2_Const_A11_t01: MissingCompileTimeError # Issue 22010
+Language/12_Expressions/12_Instance_Creation/2_Const_A11_t03: MissingCompileTimeError # Issue 22010
diff --git a/tests/co19/co19-co19.status b/tests/co19/co19-co19.status
index e89e3ee..136e761 100644
--- a/tests/co19/co19-co19.status
+++ b/tests/co19/co19-co19.status
@@ -14,6 +14,7 @@
# Tests that fail everywhere, including the analyzer.
LibTest/typed_data/ByteData/buffer_A01_t01: Fail # co19 r736 bug - sent comment.
+LayoutTests/fast/mediastream/getusermedia_t01: Fail # co19 issue 738.
# These tests are obsolete and need updating.
WebPlatformTest/shadow-dom/elements-and-dom-objects/shadowroot-object/shadowroot-attributes/test-002_t01: Skip # Issue 19019
@@ -79,9 +80,6 @@
[ $runtime == dartium || $compiler == dart2js ]
LibTest/async/Future/Future.delayed_A01_t02: Pass, Fail # Issue 15524
-[ $compiler == dart2js || $compiler == none ]
-LibTest/async/DeferredLibrary/DeferredLibrary_A01_t01: Fail # co19 issue 718
-
### CHECKED MODE FAILURES ###
[ $compiler != dartanalyzer && $compiler != dart2analyzer && $checked ]
diff --git a/tests/co19/co19-dart2dart.status b/tests/co19/co19-dart2dart.status
index 8be59a6..d431158 100644
--- a/tests/co19/co19-dart2dart.status
+++ b/tests/co19/co19-dart2dart.status
@@ -89,6 +89,8 @@
Language/12_Expressions/12_Instance_Creation/1_New_A06_t04: fail # co19-roll r546: Please triage this failure
Language/12_Expressions/12_Instance_Creation/1_New_A06_t05: fail # co19-roll r546: Please triage this failure
Language/12_Expressions/12_Instance_Creation/1_New_A06_t06: fail # co19-roll r546: Please triage this failure
+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/22_Equality_A01_t01: fail # co19-roll r546: Please triage this failure
Language/12_Expressions/22_Equality_A05_t01: fail # co19-roll r546: Please triage this failure
Language/12_Expressions/30_Identifier_Reference_A02_t01: fail # co19-roll r546: Please triage this failure
@@ -115,8 +117,9 @@
LibTest/isolate/SendPort/send_A01_t02: CompileTimeError # co19-roll r706: Please triage this failure
LibTest/isolate/SendPort/send_A01_t03: CompileTimeError # co19-roll r706: Please triage this failure
-LibTest/isolate/Isolate/spawn_A02_t02: RuntimeError # Dart issue 15617
-LibTest/isolate/Isolate/spawnUri_A02_t01: RuntimeError # Dart issue 15617
+LibTest/isolate/Isolate/spawn_A02_t02: RuntimeError # Issue 15617
+LibTest/isolate/Isolate/spawnUri_A02_t01: RuntimeError # Issue 15617
+LibTest/async/DeferredLibrary/DeferredLibrary_A01_t01: RuntimeError # Issue 22032
[ $compiler == dart2dart && $minified ]
Language/12_Expressions/14_Function_Invocation/4_Function_Expression_Invocation_A01_t02: fail # co19-roll r559: Please triage this failure
diff --git a/tests/co19/co19-dart2js.status b/tests/co19/co19-dart2js.status
index 934fc87..ed32291 100644
--- a/tests/co19/co19-dart2js.status
+++ b/tests/co19/co19-dart2js.status
@@ -8,16 +8,14 @@
# Crashes first, please. Then untriaged bugs. There is a section below
# for co19 bugs.
[ $compiler == dart2js ]
-# This test uses the old annotation-based syntax.
-LibTest/async/DeferredLibrary/DeferredLibrary_A01_t01: CompileTimeError # co19 issue 700
LibTest/core/List/removeAt_A02_t01: RuntimeError # Issue 1533
LibTest/isolate/ReceivePort/receive_A01_t02: RuntimeError # Issue 6750
Language/05_Variables/05_Variables_A11_t01: MissingCompileTimeError # Issue 21050
Language/13_Statements/04_Local_Function_Declaration_A04_t01: MissingCompileTimeError # Issue 21050
Language/13_Statements/04_Local_Function_Declaration_A04_t03: MissingCompileTimeError # Issue 21050
-Language/07_Classes/6_Constructors/1_Generative_Constructors_A20_t02: fail # 13363
-Language/07_Classes/6_Constructors/1_Generative_Constructors_A12_t02: fail # 13363
+Language/07_Classes/6_Constructors/1_Generative_Constructors_A20_t02: fail # Issue 13363
+Language/07_Classes/6_Constructors/1_Generative_Constructors_A12_t02: fail # Issue 13363
Language/07_Classes/07_Classes_A13_t02: Fail # Missing CT error on member with same name a type parameter
Language/07_Classes/07_Classes_A13_t03: Fail # Missing CT error on member with same name a type parameter
@@ -27,9 +25,9 @@
Language/07_Classes/07_Classes_A13_t09: Fail # Missing CT error on member with same name a type parameter
Language/03_Overview/1_Scoping_A02_t05: CompileTimeError # Issue 21072
Language/03_Overview/1_Scoping_A02_t06: CompileTimeError # Issue 21072
-LibTest/async/Stream/listen_A05_t01: RuntimeError # https://code.google.com/p/co19/issues/detail?id=736 (see also dartbug.com/15171)
-LibTest/core/double/INFINITY_A01_t04: RuntimeError # TODO(ahe): Please triage this failure.
-LibTest/core/double/NEGATIVE_INFINITY_A01_t04: RuntimeError # TODO(ahe): Please triage this failure.
+LibTest/async/Stream/listen_A05_t01: RuntimeError # co19 issue 736. Issue 15171
+LibTest/core/double/INFINITY_A01_t04: RuntimeError # Please triage this failure.
+LibTest/core/double/NEGATIVE_INFINITY_A01_t04: RuntimeError # Please triage this failure.
LibTest/typed_data/ByteData/getFloat32_A02_t02: fail # co19-roll r569: Please triage this failure
LibTest/typed_data/ByteData/getFloat64_A02_t02: fail # co19-roll r569: Please triage this failure
LibTest/typed_data/ByteData/getInt16_A02_t02: fail # co19-roll r569: Please triage this failure
@@ -156,7 +154,6 @@
# can understand so he can file a bug later.
#
[ $compiler == dart2js ]
-Language/03_Overview/2_Privacy_A01_t11: Pass, OK # co19 issue 316
Language/06_Functions/4_External_Functions_A01_t01: CompileTimeError, OK # http://dartbug.com/5021
LibTest/core/int/hashCode_A01_t01: RuntimeError, OK # co19 issue 308
LibTest/typed_data/Int64List/*: Fail # co19-roll r559: Please triage this failure
@@ -294,7 +291,7 @@
LibTest/math/log_A01_t01: Fail # TODO(dart2js-team): Please triage this failure.
-[ $compiler == dart2js && ($runtime == ie10 || $runtime == ff || $runtime == chrome || $runtime == drt || $runtime == safari || $runtime == safarimobilesim || $runtime == opera ) ]
+[ $compiler == dart2js && ( $runtime == ie10 || $runtime == drt || $runtime == safari || $runtime == safarimobilesim || $runtime == opera ) ]
*: Skip
#
@@ -438,9 +435,6 @@
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
-Language/12_Expressions/33_Type_Cast_A02_t03: fail # co19 issue 716
-Language/13_Statements/10_Rethrow_A01_t04: fail # co19 issue 719
-Language/13_Statements/10_Rethrow_A01_t05: fail # co19 issue 719
Language/14_Libraries_and_Scripts/1_Imports_A03_t08: fail # Issue 21171
Language/14_Libraries_and_Scripts/1_Imports_A03_t09: fail # Issue 21171
Language/14_Libraries_and_Scripts/1_Imports_A03_t10: fail # Issue 21171
@@ -449,7 +443,6 @@
Language/14_Libraries_and_Scripts/1_Imports_A03_t30: fail # co19 issue 723
Language/15_Types/4_Interface_Types_A11_t01: crash # Issue 21174
Language/15_Types/4_Interface_Types_A11_t02: crash # Issue 21174
-Language/15_Types/4_Interface_Types_A12_t10: fail # co19 issue 716
LibTest/convert/JsonCodec/encode_A01_t01: RuntimeError # code.google.com/p/co19/issues/detail?id=735
LibTest/convert/JsonCodec/encode_A01_t02: RuntimeError # code.google.com/p/co19/issues/detail?id=735
LibTest/core/DateTime/DateTime_A01_t03: fail # co19-roll r546: Please triage this failure
@@ -501,13 +494,6 @@
LibTest/collection/ListBase/ListBase_class_A01_t01: RuntimeError # Please triage this failure
LibTest/collection/ListMixin/ListMixin_class_A01_t01: RuntimeError # Please triage this failure
-[ $compiler == dart2js && $checked ]
-Language/12_Expressions/03_Numbers_A05_t02: fail # co19 issue 716
-Language/12_Expressions/19_Conditional_A04_t03: fail # co19 issue 716
-Language/12_Expressions/20_Logical_Boolean_Expressions_A03_t01: fail # Issue 21195 and co19 issue 725
-Language/12_Expressions/27_Unary_Expressions_A02_t03: fail # Issue 21196 and co19 issue 726
-Language/13_Statements/06_For/1_For_Loop_A01_t08: fail # co19 issue 727
-
[ $compiler == dart2js && $runtime == jsshell ]
LibTest/typed_data/Float32List/Float32List.view_A06_t01: fail # co19-roll r587: Please triage this failure
LibTest/typed_data/Float32List/hashCode_A01_t01: fail # co19-roll r559: Please triage this failure
@@ -582,14 +568,6 @@
LibTest/math/sin_A01_t02: RuntimeError # V8 issue 3006, https://code.google.com/p/v8/issues/detail?id=3006
[ $compiler == dart2js && $minified ]
-Language/12_Expressions/14_Function_Invocation/4_Function_Expression_Invocation_A01_t02: fail # co19 issue 729
-Language/12_Expressions/15_Method_Invocation/1_Ordinary_Invocation_A05_t02: fail # co19 issue 729
-Language/12_Expressions/15_Method_Invocation/1_Ordinary_Invocation_A05_t03: fail # co19 issue 729
-Language/12_Expressions/17_Getter_Invocation_A02_t01: fail # co19 issue 729
-Language/12_Expressions/18_Assignment_A05_t02: fail # co19 issue 729
-Language/12_Expressions/18_Assignment_A05_t04: fail # co19 issue 729
-Language/12_Expressions/18_Assignment_A05_t05: fail # co19 issue 729
-Language/12_Expressions/18_Assignment_A08_t04: fail # co19 issue 729
LibTest/typed_data/Float32List/runtimeType_A01_t01: fail # co19-roll r559: Please triage this failure
LibTest/typed_data/Float32x4List/runtimeType_A01_t01: fail # co19-roll r559: Please triage this failure
LibTest/typed_data/Float64List/runtimeType_A01_t01: fail # co19-roll r559: Please triage this failure
@@ -619,7 +597,6 @@
[ $compiler == dart2js ]
LibTest/core/List/List_class_A01_t01: RuntimeError # co19-roll r623: Please triage this failure
-Language/03_Overview/2_Privacy_A01_t02: RuntimeError # co19 issue 730
Language/12_Expressions/20_Logical_Boolean_Expressions_A06_t16: RuntimeError # Issue 21271
Language/12_Expressions/20_Logical_Boolean_Expressions_A06_t17: RuntimeError # Issue 21271
LibTest/convert/JsonDecoder/fuse_A01_t01: RuntimeError # co19-roll r667: Please triage this failure
@@ -638,3 +615,2505 @@
LibTest/collection/ListBase/ListBase_class_A01_t01: Pass, Timeout
LibTest/collection/ListMixin/ListMixin_class_A01_t01: Pass, Timeout
LibTest/core/List/List_class_A01_t01: Pass, Timeout
+
+[ $compiler == dart2js && ($runtime == chrome || $runtime == drt) ]
+Language/12_Expressions/00_Object_Identity/1_Object_Identity_A05_t02: RuntimeError # Please triage this failure
+Language/12_Expressions/17_Getter_Invocation_A07_t02: RuntimeError # Please triage this failure
+LayoutTests/fast/alignment/parse-align-items_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/alignment/parse-align-self_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/alignment/parse-justify-self_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/animation/request-animation-frame-cancel_t01: Skip # Times out. Please triage this failure
+LayoutTests/fast/animation/request-animation-frame-cancel2_t01: Skip # Times out. Please triage this failure
+LayoutTests/fast/animation/request-animation-frame-prefix_t01: Skip # Times out. Please triage this failure
+LayoutTests/fast/animation/request-animation-frame-timestamps_t01: Skip # Times out. Please triage this failure
+LayoutTests/fast/animation/request-animation-frame-timestamps-advance_t01: Skip # Times out. Please triage this failure
+LayoutTests/fast/animation/request-animation-frame-within-callback_t01: Skip # Times out. Please triage this failure
+LayoutTests/fast/backgrounds/repeat/parsing-background-repeat_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/borders/border-radius-child_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/2d.fillText.gradient_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/2d.text.draw.fill.maxWidth.gradient_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/2d.text.draw.fill.maxWidth.negative_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/2d.text.draw.fill.maxWidth.veryLarge_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/2d.text.draw.fill.maxWidth.verySmall_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/canvas-arc-negative-radius_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/canvas-as-image-incremental-repaint_t01: Skip # Times out. Please triage this failure
+LayoutTests/fast/canvas/canvas-blending-text_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/canvas-currentTransform_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/canvas-empty-image-pattern_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/canvas-getImageData-invalid_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/canvas-getImageData-large-crash_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/canvas-getImageData-largeNonintegralDimensions_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/canvas-imageSmoothingEnabled-repaint_t01: Skip # Times out. Please triage this failure
+LayoutTests/fast/canvas/canvas-large-dimensions_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/canvas-large-fills_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/canvas-lineDash_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/canvas-lose-restore-googol-size_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/canvas-lose-restore-max-int-size_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/canvas-putImageData_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/canvas-resize-after-paint_t01: Skip # Times out. Please triage this failure
+LayoutTests/fast/canvas/draw-custom-focus-ring_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/getPutImageDataPairTest_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/setWidthResetAfterForcedRender_t01: Skip # Times out. Please triage this failure
+
+LayoutTests/fast/canvas/webgl/context-attributes-alpha-depth-stencil-antialias-t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/webgl/context-lost_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/webgl/copy-tex-image-and-sub-image-2d_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/webgl/framebuffer-bindings-unaffected-on-resize_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/webgl/framebuffer-object-attachment_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/webgl/framebuffer-test_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/webgl/gl-teximage_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/webgl/invalid-passed-params_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/webgl/object-deletion-behaviour_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/webgl/tex-image-and-sub-image-2d-with-array-buffer-view_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/webgl/tex-image-and-sub-image-2d-with-canvas-rgb565_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/webgl/tex-image-and-sub-image-2d-with-canvas-rgba4444_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/webgl/tex-image-and-sub-image-2d-with-canvas-rgba5551_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/webgl/tex-image-and-sub-image-2d-with-canvas_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/webgl/tex-image-and-sub-image-2d-with-image-data-rgb565_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/webgl/tex-image-and-sub-image-2d-with-image-data-rgba4444_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/webgl/tex-image-and-sub-image-2d-with-image-data-rgba5551_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/webgl/tex-image-and-sub-image-2d-with-image-data_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/webgl/tex-image-and-sub-image-2d-with-image-rgb565_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/webgl/tex-image-and-sub-image-2d-with-image-rgba4444_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/webgl/tex-image-and-sub-image-2d-with-image-rgba5551_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/webgl/tex-image-and-sub-image-2d-with-image_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/webgl/tex-image-and-sub-image-2d-with-video-rgb565_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/webgl/tex-image-and-sub-image-2d-with-video-rgba4444_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/webgl/tex-image-and-sub-image-2d-with-video-rgba5551_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/webgl/tex-image-and-sub-image-2d-with-video_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/webgl/tex-input-validation_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/webgl/tex-sub-image-2d-bad-args_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/webgl/tex-sub-image-2d_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/webgl/tex-sub-image-cube-maps_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/webgl/texImageTest_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/webgl/uniform-location_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/webgl/uninitialized-test_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/webgl/webgl-depth-texture_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css-generated-content/bug91547_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css-generated-content/hit-test-generated-content_t01: Pass, RuntimeError # Please triage this failure
+LayoutTests/fast/css-generated-content/malformed-url_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css-generated-content/pseudo-animation_t01: Pass, RuntimeError # Please triage this failure
+LayoutTests/fast/css-generated-content/pseudo-animation-before-onload_t01: Pass, RuntimeError # Please triage this failure
+LayoutTests/fast/css-generated-content/pseudo-animation-display_t01: Skip # Times out. Please triage this failure
+LayoutTests/fast/css-generated-content/pseudo-element-events_t01: Skip # Times out. Please triage this failure
+LayoutTests/fast/css-generated-content/pseudo-transition-event_t01: Skip # Times out. Please triage this failure
+LayoutTests/fast/css-generated-content/pseudo-transition_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css-grid-layout/auto-content-resolution-rows_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css-grid-layout/breadth-size-resolution-grid_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css-grid-layout/calc-resolution-grid-item_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css-grid-layout/display-grid-set-get_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css-grid-layout/flex-and-minmax-content-resolution-rows_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css-grid-layout/flex-content-resolution-columns_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css-grid-layout/flex-content-resolution-rows_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css-grid-layout/grid-auto-columns-rows-get-set_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css-grid-layout/grid-auto-flow-get-set_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css-grid-layout/grid-auto-flow-update_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css-grid-layout/grid-container-change-explicit-grid-recompute-child_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css-grid-layout/grid-element-border-grid-item_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css-grid-layout/grid-element-border-padding-grid-item_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css-grid-layout/grid-element-empty-row-column_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css-grid-layout/grid-element-min-max-height_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css-grid-layout/grid-element-padding-grid-item_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css-grid-layout/grid-element-padding-margin_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css-grid-layout/grid-element-shrink-to-fit_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css-grid-layout/grid-item-area-get-set_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css-grid-layout/grid-item-bad-named-area-auto-placement_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css-grid-layout/grid-item-bad-resolution-double-span_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css-grid-layout/grid-item-change-order-auto-flow_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css-grid-layout/grid-item-display_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css-grid-layout/grid-item-margin-auto-columns-rows-horiz-bt_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css-grid-layout/grid-item-margin-auto-columns-rows-vert-lr_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css-grid-layout/grid-item-margin-auto-columns-rows-vert-rl_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css-grid-layout/grid-item-margin-auto-columns-rows_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css-grid-layout/grid-item-margin-resolution_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css-grid-layout/grid-item-order-auto-flow-resolution_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css-grid-layout/grid-template-areas-get-set_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css-grid-layout/implicit-rows-auto-resolution_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css-grid-layout/justify-self-cell_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css-grid-layout/minmax-fixed-logical-height-only_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css-grid-layout/minmax-fixed-logical-width-only_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css-grid-layout/percent-grid-item-in-percent-grid-track-in-percent-grid_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css-grid-layout/percent-grid-item-in-percent-grid-track-update_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css-grid-layout/percent-grid-item-in-percent-grid-track_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css-grid-layout/percent-padding-margin-resolution-grid-item-update_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css-grid-layout/percent-padding-margin-resolution-grid-item_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css-grid-layout/percent-resolution-grid-item_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css-grid-layout/place-cell-by-index_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css/add-remove-stylesheets-at-once-minimal-recalc-style_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css/checked-pseudo-selector_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css/collapsed-whitespace-reattach-in-style-recalc_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css/content/content-none_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css/content/content-normal_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css/css-properties-case-insensitive_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css/css3-nth-tokens-style_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css/cursor-parsing-quirks_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css/deprecated-flexbox-auto-min-size_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css/first-child-display-change-inverse_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css/focus-display-block-inline_t01: Pass, RuntimeError # Please triage this failure
+LayoutTests/fast/css/font-face-cache-bug_t01: Pass, RuntimeError # Please triage this failure
+LayoutTests/fast/css/font-face-multiple-ranges-for-unicode-range_t01: Pass, RuntimeError # Please triage this failure
+LayoutTests/fast/css/font-face-unicode-range-load_t01: Pass, RuntimeError # Please triage this failure
+LayoutTests/fast/css/font-face-unicode-range-overlap-load_t01: Pass, RuntimeError # Please triage this failure
+LayoutTests/fast/css/font-face-unicode-range-monospace_t01: Pass, RuntimeError # Please triage this failure
+LayoutTests/fast/css/fontface-properties_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css/fontfaceset-loadingdone_t01: Pass, RuntimeError # Please triage this failure
+LayoutTests/fast/css/html-attr-case-sensitivity_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css/id-or-class-before-stylesheet_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css/implicit-attach-marking_t01: Skip # Times out. Please triage this failure
+LayoutTests/fast/css/inherit-initial-shorthand-values_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css/invalid-predefined-color_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css/link-alternate-stylesheet-1_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css/link-alternate-stylesheet-2_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css/link-alternate-stylesheet-3_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css/link-alternate-stylesheet-4_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css/link-alternate-stylesheet-5_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css/media-query-recovery_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css/modify-ua-rules-from-javascript_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css/parsing-at-rule-recovery_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css/parsing-page-rule_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css/parsing-selector-error-recovery_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css/pseudo-any_t01: Pass, RuntimeError # Please triage this failure
+LayoutTests/fast/css/pseudo-target-indirect-sibling-001_t01: Skip # Times out. Please triage this failure
+LayoutTests/fast/css/pseudo-target-indirect-sibling-002_t01: Skip # Times out. Please triage this failure
+LayoutTests/fast/css/readonly-pseudoclass-opera-001_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css/readonly-pseudoclass-opera-002_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css/readonly-pseudoclass-opera-003_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css/readonly-pseudoclass-opera-004_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css/readonly-pseudoclass-opera-005_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css/shadow-current-color_t01: Skip # Times out. Please triage this failure
+LayoutTests/fast/css/sticky/parsing-position-sticky_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css/style-element-process-crash_t01: Skip # Times out. Please triage this failure
+LayoutTests/fast/css/style-scoped/style-scoped-nested_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css/style-scoped/style-scoped-with-dom-operation_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css/style-scoped/style-scoped-with-important-rule_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css/stylesheet-enable-first-alternate-on-load-sheet_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css/stylesheet-enable-second-alternate-link_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css/webkit-keyframes-errors_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css/word-break-user-modify-allowed-values_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css3-text/css3-text-align-last/getComputedStyle/getComputedStyle-text-align-last-inherited_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css3-text/css3-text-align-last/getComputedStyle/getComputedStyle-text-align-last_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css3-text/css3-text-decoration/getComputedStyle/getComputedStyle-text-decoration-color_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css3-text/css3-text-decoration/getComputedStyle/getComputedStyle-text-decoration-line_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css3-text/css3-text-decoration/getComputedStyle/getComputedStyle-text-decoration-style_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css3-text/css3-text-decoration/getComputedStyle/getComputedStyle-text-underline-position_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css3-text/css3-text-indent/getComputedStyle/getComputedStyle-text-indent-inherited_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css3-text/css3-text-indent/getComputedStyle/getComputedStyle-text-indent_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css3-text/css3-text-justify/getComputedStyle/getComputedStyle-text-justify_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/52776_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/DOMException/XPathException_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/DOMImplementation/createDocument-namespace-err_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/Document/CaretRangeFromPoint/basic_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/Document/CaretRangeFromPoint/caretRangeFromPoint-in-strict-mode-wtih-checkbox_t01: Pass, RuntimeError # Please triage this failure
+LayoutTests/fast/dom/Document/CaretRangeFromPoint/caretRangeFromPoint-in-zoom-and-scroll_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/Document/CaretRangeFromPoint/hittest-relative-to-viewport_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/Document/CaretRangeFromPoint/replace-element_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/Document/createElementNS-namespace-err_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/Element/attribute-uppercase_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/Element/getClientRects_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/Element/setAttributeNS-namespace-err_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/HTMLAnchorElement/remove-href-from-focused-anchor_t01: Skip # Times out. Please triage this failure
+LayoutTests/fast/dom/HTMLAnchorElement/set-href-attribute-hash_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/HTMLAnchorElement/set-href-attribute-host_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/HTMLAnchorElement/set-href-attribute-hostname_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/HTMLAnchorElement/set-href-attribute-pathname_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/HTMLAnchorElement/set-href-attribute-port_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/HTMLAnchorElement/set-href-attribute-protocol_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/HTMLAnchorElement/set-href-attribute-search_t01: Pass, RuntimeError # Please triage this failure
+LayoutTests/fast/dom/HTMLDialogElement/dialog-autofocus_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/HTMLDialogElement/dialog-return-value_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/HTMLDialogElement/dialog-scrolled-viewport_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/HTMLDialogElement/inert-node-is-unfocusable_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/HTMLDialogElement/inert-node-is-unselectable_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/HTMLDialogElement/multiple-centered-dialogs_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/HTMLDialogElement/non-anchored-dialog-positioning_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/HTMLDialogElement/show-modal-focusing-steps_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/HTMLDocument/active-element-gets-unforcusable_t01: Skip # Times out. Please triage this failure
+LayoutTests/fast/dom/HTMLDocument/set-focus-on-valid-element_t01: Skip # Times out. Please triage this failure
+LayoutTests/fast/dom/HTMLElement/set-inner-outer-optimization_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/HTMLElement/spellcheck_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/HTMLFormElement/move-option-between-documents_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/HTMLImageElement/image-alt-text_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/HTMLImageElement/parse-src_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/HTMLInputElement/input-image-alt-text_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/HTMLLinkElement/link-beforeload-recursive_t01: Skip # Times out. Please triage this failure
+LayoutTests/fast/dom/HTMLLinkElement/resolve-url-on-insertion_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/HTMLObjectElement/beforeload-set-text-crash_t01: Skip # Times out. Please triage this failure
+LayoutTests/fast/dom/HTMLOptionElement/collection-setter-getter_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/HTMLOutputElement/dom-settable-token-list_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/HTMLScriptElement/async-false-inside-async-false-load_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/HTMLScriptElement/async-inline-script_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/HTMLScriptElement/async-onbeforeload_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/HTMLScriptElement/defer-inline-script_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/HTMLScriptElement/defer-onbeforeload_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/HTMLScriptElement/remove-in-beforeload_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/HTMLScriptElement/script-set-src_t01: Pass, RuntimeError # Please triage this failure
+LayoutTests/fast/dom/HTMLSelectElement/selected-index-preserved-when-option-text-changes_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/HTMLTemplateElement/custom-element-wrapper-gc_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/HTMLTemplateElement/innerHTML_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/HTMLTemplateElement/ownerDocumentXHTML_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/MutationObserver/observe-childList_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/MutationObserver/weak-callback-gc-crash_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/Node/fragment-mutation_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/Node/initial-values_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/NodeIterator/NodeIterator-basic_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/Range/bug-19527_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/Range/insertNode-empty-fragment-crash_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/Range/mutation_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/Range/range-constructor_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/Range/range-created-during-remove-children_t01: Pass, RuntimeError # Please triage this failure
+LayoutTests/fast/dom/Range/range-detached-exceptions_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/Range/range-expand_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/Range/range-insertNode-separate-endContainer_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/Range/range-insertNode-splittext_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/SelectorAPI/dumpNodeList-2_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/SelectorAPI/dumpNodeList-almost-strict_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/SelectorAPI/dumpNodeList_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/StyleSheet/css-medialist-item_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/StyleSheet/discarded-sheet-owner-null_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/TreeWalker/TreeWalker-basic_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/Window/getMatchedCSSRules-nested-rules_t01: Pass, RuntimeError # Please triage this failure
+LayoutTests/fast/dom/Window/window-resize-contents_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/Window/window-resize_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/Window/window-scroll-arguments_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/anchor-without-content_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/attribute-namespaces-get-set_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/blur-contenteditable_t01: Pass, RuntimeError # Please triage this failure
+LayoutTests/fast/dom/characterdata-api-arguments_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/client-width-height-quirks_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/computed-style-set-property_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/css-cached-import-rule_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/cssTarget-crash_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/custom/document-register-svg-extends_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/dataset-xhtml_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/dataset_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/document-importNode-arguments_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/domparser-parsefromstring-mimetype-support_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/empty-hash-and-search_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/focus-contenteditable_t01: Pass, RuntimeError # Please triage this failure
+LayoutTests/fast/dom/fragment-activation-focuses-target_t01: Pass, RuntimeError # Please triage this failure
+LayoutTests/fast/dom/getElementsByClassName/011_t01: Pass, RuntimeError # Please triage this failure
+LayoutTests/fast/dom/getElementsByClassName/dumpNodeList_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/horizontal-scrollbar-in-rtl-doesnt-fire-onscroll_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/horizontal-scrollbar-in-rtl_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/horizontal-scrollbar-when-dir-change_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/implementation-createHTMLDocument_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/navigatorcontentutils/is-protocol-handler-registered_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/option-properties_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/partial-layout-overlay-scrollbars_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/set-innerHTML_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/shadow/event-path_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/shadow/shadowhost-keyframes_t01: Pass, RuntimeError # Please triage this failure
+LayoutTests/fast/dom/shadow/no-renderers-for-light-children_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/shadow/pseudoclass-update-checked-option_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/shadow/pseudoclass-update-disabled-optgroup_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/shadow/pseudoclass-update-disabled-option_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/shadow/pseudoclass-update-enabled-optgroup_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/shadow/pseudoclass-update-enabled-option_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/shadow/shadow-content-crash_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/shadow/shadow-removechild-and-blur-event_t01: Pass, RuntimeError # Please triage this failure
+LayoutTests/fast/dom/shadow/shadowroot-keyframes_t01: Pass, RuntimeError # Please triage this failure
+LayoutTests/fast/dynamic/crash-generated-counter_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dynamic/crash-generated-image_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dynamic/crash-generated-quote_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dynamic/crash-generated-text_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dynamic/insertAdjacentElement_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dynamic/recursive-layout_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/events/add-event-without-document_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/events/change-overflow-on-overflow-change_t01: Skip # Times out. Please triage this failure
+LayoutTests/fast/events/clipboard-clearData_t01: Skip # Times out. Please triage this failure
+LayoutTests/fast/events/clipboard-dataTransferItemList_t01: Skip # Times out. Please triage this failure
+LayoutTests/fast/events/div-focus_t01: Pass, RuntimeError # Please triage this failure
+LayoutTests/fast/events/document-elementFromPoint_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/events/event-creation_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/events/event-listener-html-non-html-confusion_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/events/event-trace_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/events/fire-scroll-event_t01: Skip # Times out. Please triage this failure
+LayoutTests/fast/events/fire-scroll-event-element_t01: Skip # Times out. Please triage this failure
+LayoutTests/fast/events/initkeyboardevent-crash_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/events/input-focus-no-duplicate-events_t01: Pass, 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/label-focus_t01: Pass, RuntimeError # Please triage this failure
+LayoutTests/fast/events/mutation-during-replace-child-2_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/events/mutation-during-replace-child_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/events/nested-event-remove-node-crash_t01: Skip # Times out. Please triage this failure
+LayoutTests/fast/events/overflowchanged-event-raf-timing_t01: Skip # Times out. Please triage this failure
+LayoutTests/fast/events/scoped/editing-commands_t01: Pass, RuntimeError # Please triage this failure
+LayoutTests/fast/events/scroll-during-zoom-change_t01: Skip # Times out. Please triage this failure
+LayoutTests/fast/events/scroll-event-does-not-bubble_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/events/scroll-event-phase_t01: Skip # Times out. Please triage this failure
+LayoutTests/fast/events/tabindex-removal-from-focused-element_t01: Pass, RuntimeError # Please triage this failure
+LayoutTests/fast/events/wheelevent-constructor_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/exclusions/parsing/parsing-wrap-flow_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/exclusions/parsing/parsing-wrap-through_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/files/blob-close-read_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/files/blob-close-revoke_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/files/blob-close_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/files/blob-parts-slice-test_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/files/blob-slice-test_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/files/url-null_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/files/xhr-response-blob_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/filesystem/async-operations_t01: Pass, RuntimeError # Please triage this failure
+LayoutTests/fast/filesystem/directory-entry-to-uri_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/filesystem/file-entry-to-uri_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/filesystem/filesystem-reference_t01: Pass, RuntimeError # Please triage this failure
+LayoutTests/fast/forms/autofocus-input-css-style-change_t01: Skip # Times out. Please triage this failure
+LayoutTests/fast/forms/autofocus-focus-only-once_t01: Skip # Times out. Please triage this failure
+LayoutTests/fast/forms/autofocus-opera-007_t01: Skip # Times out. Please triage this failure
+LayoutTests/fast/forms/autofocus-readonly-attribute_t01: Skip # Times out. Please triage this failure
+LayoutTests/fast/forms/button/button-disabled-blur_t01: Pass, RuntimeError # Please triage this failure
+LayoutTests/fast/forms/button-baseline-and-collapsing_t01: Pass, RuntimeError # Please triage this failure
+LayoutTests/fast/forms/clone-input-with-dirty-value_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/forms/date/input-valueasdate-date_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/forms/date-multiple-fields/date-multiple-fields-onblur-setvalue-onfocusremoved_t01: Pass, RuntimeError # Please triage this failure
+LayoutTests/fast/forms/datetimelocal/input-valueasdate-datetimelocal_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/forms/datetimelocal/input-valueasnumber-datetimelocal_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/forms/file/file-input-capture_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/forms/focus_t01: Pass, RuntimeError # Please triage this failure
+LayoutTests/fast/forms/focus-style-pending_t01: Skip # Times out. Please triage this failure
+LayoutTests/fast/forms/input-appearance-elementFromPoint_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/forms/input-hit-test-border_t01: Pass, RuntimeError # Please triage this failure
+LayoutTests/fast/forms/input-inputmode_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/forms/input-width-height-attributes-without-renderer-loaded-image_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/forms/listbox-selection-2_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/forms/menulist-disabled-selected-option_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/forms/menulist-selection-reset_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/forms/menulist-submit-without-selection_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/forms/multiple-selected-options-innerHTML_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/forms/option-change-single-selected_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/forms/option-strip-unicode-spaces_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/forms/parser-associated-form-removal_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/forms/plaintext-mode-1_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/forms/search-popup-crasher_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/forms/select-change-popup-to-listbox-in-event-handler_t01: Skip # Times out. Please triage this failure
+LayoutTests/fast/forms/select-clientheight-large-size_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/forms/select-clientheight-with-multiple-attr_t01: Pass, RuntimeError # Please triage this failure
+LayoutTests/fast/forms/select-list-box-mouse-focus_t01: Pass, RuntimeError # Please triage this failure
+LayoutTests/fast/forms/setrangetext_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/forms/submit-nil-value-field-assert_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/forms/textarea-paste-newline_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/forms/textfield-focus-out_t01: Skip # Times out. Please triage this failure
+LayoutTests/fast/html/hidden-attr_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/html/imports/import-element-removed-flag_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/html/imports/import-events_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/html/select-dropdown-consistent-background-color_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/inline/boundingBox-with-continuation_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/inline/inline-position-top-align_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/inline/inline-with-empty-inline-children_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/inline/out-of-flow-objects-and-whitespace-after-empty-inline_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/inline/parent-inline-element-padding-contributes-width_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/inline/positioned-element-padding-contributes-width_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/layers/normal-flow-hit-test_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/layers/zindex-hit-test_t01: Pass, RuntimeError # Please triage this failure
+LayoutTests/fast/loader/about-blank-hash-change_t01: Skip # Times out. Please triage this failure
+LayoutTests/fast/loader/about-blank-hash-kept_t01: Skip # Times out. Please triage this failure
+LayoutTests/fast/loader/hashchange-event-properties_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/loader/loadInProgress_t01: Pass, RuntimeError # Please triage this failure
+LayoutTests/fast/loader/onhashchange-attribute-listeners_t01: Skip # Times out. Please triage this failure
+LayoutTests/fast/loader/scroll-position-restored-on-back_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/loader/scroll-position-restored-on-reload-at-load-event_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/loader/stateobjects/replacestate-in-onunload_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/masking/parsing-clip-path-shape_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/masking/parsing-mask-source-type_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/masking/parsing-mask_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/media/media-query-list-syntax_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/mediastream/RTCPeerConnection-AddRemoveStream_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/multicol/balance-short-trailing-empty-block_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/multicol/balance-trailing-border_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/multicol/balance-trailing-border_t02: RuntimeError # Please triage this failure
+LayoutTests/fast/multicol/break-after-always-bottom-margin_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/multicol/break-properties_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/multicol/cssom-view_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/multicol/flipped-blocks-hit-test_t01: Pass, RuntimeError # Please triage this failure
+LayoutTests/fast/multicol/float-truncation_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/multicol/hit-test-above-or-below_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/multicol/hit-test-end-of-column-with-line-height_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/multicol/hit-test-end-of-column_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/multicol/hit-test-float_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/multicol/hit-test-gap-between-pages_t01: Pass, RuntimeError # Please triage this failure
+LayoutTests/fast/multicol/hit-test-gap-between-pages-flipped_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/multicol/newmulticol/balance-images_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/multicol/newmulticol/balance-maxheight_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/multicol/newmulticol/balance_t04: RuntimeError # Please triage this failure
+LayoutTests/fast/multicol/newmulticol/balance_t07: RuntimeError # Please triage this failure
+LayoutTests/fast/multicol/newmulticol/balance_t08: RuntimeError # Please triage this failure
+LayoutTests/fast/multicol/newmulticol/balance_t09: RuntimeError # Please triage this failure
+LayoutTests/fast/multicol/newmulticol/balance_t10: RuntimeError # Please triage this failure
+LayoutTests/fast/multicol/vertical-lr/float-truncation_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/multicol/vertical-rl/break-properties_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/multicol/vertical-rl/float-truncation_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/multicol/vertical-rl/image-inside-nested-blocks-with-border_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/multicol/widows_t01: Pass, RuntimeError # Please triage this failure
+LayoutTests/fast/multicol/widows_t02: RuntimeError # Please triage this failure
+LayoutTests/fast/overflow/replaced-child-100percent-height-inside-fixed-container-with-overflow-auto_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/parser/foster-parent-adopted_t02: RuntimeError # Please triage this failure
+LayoutTests/fast/parser/fragment-parser-doctype_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/parser/innerhtml-with-prefixed-elements_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/parser/pre-first-line-break_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/replaced/container-width-zero_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/replaced/iframe-with-percentage-height-within-table-with-anonymous-table-cell_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/replaced/iframe-with-percentage-height-within-table-with-table-cell-ignore-height_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/replaced/table-percent-height_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/replaced/table-percent-width_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/ruby/ruby-line-height_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/shapes/parsing/parsing-shape-lengths_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/shapes/shape-outside-floats/shape-outside-big-box-border-radius_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/shapes/shape-outside-floats/shape-outside-floats-diamond-margin-polygon_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/shapes/shape-outside-floats/shape-outside-floats-ellipse-margin-left_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/shapes/shape-outside-floats/shape-outside-floats-ellipse-margin-right_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/shapes/shape-outside-floats/shape-outside-floats-image-margin_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/shapes/shape-outside-floats/shape-outside-floats-image-margin_t02: 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-floats-inset-rounded-different-writing-modes-right_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/shapes/shape-outside-floats/shape-outside-rounded-boxes_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/shapes/shape-outside-floats/shape-outside-rounded-boxes_t02: RuntimeError # Please triage this failure
+LayoutTests/fast/speechsynthesis/speech-synthesis-boundary-events_t01: Skip # Times out. Please triage this failure
+LayoutTests/fast/speechsynthesis/speech-synthesis-cancel_t01: Skip # Times out. Please triage this failure
+LayoutTests/fast/speechsynthesis/speech-synthesis-pause-resume_t01: Skip # Times out. Please triage this failure
+LayoutTests/fast/speechsynthesis/speech-synthesis-speak_t01: Skip # Times out. Please triage this failure
+LayoutTests/fast/speechsynthesis/speech-synthesis-utterance-uses-voice_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/speechsynthesis/speech-synthesis-voices_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/storage/disallowed-storage_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/storage/storage-disallowed-in-data-url_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/sub-pixel/cssom-subpixel-precision_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/sub-pixel/float-containing-block-with-margin_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/sub-pixel/replaced-element-baseline_t01: Pass, RuntimeError # Please triage this failure
+LayoutTests/fast/sub-pixel/table-rows-have-stable-height_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/table/anonymous-table-section-removed_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/table/caption-orthogonal-writing-mode-sizing_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/table/col-width-span-expand_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/table/css-table-max-height_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/table/css-table-max-width_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/table/css-table-width-with-border-padding_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/table/hittest-tablecell-bottom-edge_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/table/hittest-tablecell-right-edge_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/table/hittest-tablecell-with-borders-bottom-edge_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/table/hittest-tablecell-with-borders-right-edge_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/table/large-shrink-wrapped-width_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/table/margins-perpendicular-containing-block_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/table/min-width-css-block-table_t01: Pass, RuntimeError # Please triage this failure
+LayoutTests/fast/table/min-width-css-inline-table_t01: Pass, RuntimeError # Please triage this failure
+LayoutTests/fast/table/min-width-html-block-table_t01: Pass, RuntimeError # Please triage this failure
+LayoutTests/fast/table/min-width-html-inline-table_t01: Pass, RuntimeError # Please triage this failure
+LayoutTests/fast/table/nested-tables-with-div-offset_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/table/padding-height-and-override-height_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/table/table-all-rowspans-height-distribution-in-rows-except-overlapped_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/table/table-all-rowspans-height-distribution-in-rows_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/table/table-cell-offset-width_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/table/table-colgroup-present-after-table-row_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/table/table-rowspan-cell-with-empty-cell_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/table/table-rowspan-height-distribution-in-rows_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/table/table-rowspan-height-distribution-in-rows_t02: RuntimeError # Please triage this failure
+LayoutTests/fast/table/table-with-content-width-exceeding-max-width_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/text-autosizing/vertical-writing-mode_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/text/find-spaces_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/text/international/cjk-segmentation_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/text/international/iso-8859-8_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/text/international/rtl-text-wrapping_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/text/international/thai-offsetForPosition-inside-character_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/text/ipa-tone-letters_t01: Pass, RuntimeError # Please triage this failure
+LayoutTests/fast/text/line-break-after-question-mark_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/text/offsetForPosition-cluster-at-zero_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/text/regional-indicator-symobls_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/text/remove-zero-length-run_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/text/sub-pixel/text-scaling-ltr_t01: Pass, RuntimeError # Please triage this failure
+LayoutTests/fast/text/sub-pixel/text-scaling-pixel_t01: Pass, RuntimeError # Please triage this failure
+LayoutTests/fast/text/sub-pixel/text-scaling-rtl_t01: Pass, RuntimeError # Please triage this failure
+LayoutTests/fast/text/sub-pixel/text-scaling-vertical_t01: Pass, RuntimeError # Please triage this failure
+LayoutTests/fast/text/sub-pixel/text-scaling-webfont_t01: Pass, RuntimeError # Please triage this failure
+LayoutTests/fast/text/text-combine-shrink-to-fit_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/transforms/bounding-rect-zoom_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/transforms/hit-test-large-scale_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/url/file-http-base_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/url/file_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/url/host_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/url/idna2003_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/url/idna2008_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/url/invalid-urls-utf8_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/url/ipv4_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/url/ipv6_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/url/path_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/url/query_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/url/relative-unix_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/url/relative-win_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/url/relative_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/url/segments-from-data-url_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/url/segments_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/url/standard-url_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/writing-mode/auto-sizing-orthogonal-flows_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/writing-mode/flipped-blocks-hit-test-overflow_t01: Pass, RuntimeError # Please triage this failure
+LayoutTests/fast/writing-mode/positionForPoint_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/writing-mode/table-hit-test_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/writing-mode/vertical-inline-block-hittest_t01: Pass, RuntimeError # Please triage this failure
+LayoutTests/fast/xmlhttprequest/xmlhttprequest-responseXML-xml-text-responsetype_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/xmlhttprequest/xmlhttprequest-responsetype-arraybuffer_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/xpath/4XPath/Borrowed/cz_20030217_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/xpath/4XPath/Borrowed/namespace-nodes_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/xpath/4XPath/Core/test_core_functions_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/xpath/4XPath/Core/test_core_functions_t02: RuntimeError # Please triage this failure
+LayoutTests/fast/xpath/4XPath/Core/test_node_test_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/xpath/4XPath/Core/test_node_test_t02: RuntimeError # Please triage this failure
+LayoutTests/fast/xpath/ambiguous-operators_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/xpath/attr-namespace_t02: RuntimeError # Please triage this failure
+LayoutTests/fast/xpath/ensure-null-namespace_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/xpath/implicit-node-args_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/xpath/invalid-resolver_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/xpath/node-name-case-sensitivity_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/xpath/node-name-case-sensitivity_t02: RuntimeError # Please triage this failure
+LayoutTests/fast/xpath/position_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/xpath/py-dom-xpath/data_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/xpath/py-dom-xpath/expressions_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/xpath/py-dom-xpath/paths_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/xpath/reverse-axes_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/xsl/default-html_t01: RuntimeError # Please triage this failure
+LibTest/core/RegExp/Pattern_semantics/firstMatch_CharacterEscape_A06_t02: RuntimeError # Please triage this failure
+LibTest/core/RegExp/Pattern_semantics/firstMatch_DecimalEscape_A01_t02: RuntimeError # Please triage this failure
+LibTest/core/RegExp/Pattern_semantics/firstMatch_NonEmptyClassRanges_A01_t01: RuntimeError # Please triage this failure
+LibTest/core/RegExp/Pattern_semantics/firstMatch_NonEmptyClassRanges_A01_t05: RuntimeError # Please triage this failure
+LibTest/core/RegExp/Pattern_semantics/firstMatch_NonEmptyClassRanges_A01_t06: RuntimeError # Please triage this failure
+LibTest/core/int/compareTo_A01_t01: RuntimeError # Please triage this failure
+LibTest/core/int/operator_left_shift_A01_t01: RuntimeError # Please triage this failure
+LibTest/core/int/operator_remainder_A01_t03: RuntimeError # Please triage this failure
+LibTest/core/int/operator_truncating_division_A01_t02: RuntimeError # Please triage this failure
+LibTest/core/int/remainder_A01_t01: RuntimeError # Please triage this failure
+LibTest/core/int/remainder_A01_t03: RuntimeError # Please triage this failure
+LibTest/core/int/toRadixString_A01_t01: RuntimeError # Please triage this failure
+LibTest/html/CanvasRenderingContext2D/addEventListener_A01_t03: RuntimeError # Please triage this failure
+LibTest/html/CanvasRenderingContext2D/addEventListener_A01_t06: RuntimeError # Please triage this failure
+LibTest/html/Document/childNodes_A01_t01: RuntimeError # Please triage this failure
+LibTest/html/Document/clone_A01_t01: RuntimeError # Please triage this failure
+LibTest/html/Document/clone_A01_t02: RuntimeError # Please triage this failure
+LibTest/html/Document/securityPolicy_A01_t01: RuntimeError # Please triage this failure
+LibTest/html/Element/blur_A01_t01: Skip # Times out. Please triage this failure
+LibTest/html/Element/borderEdge_A01_t01: RuntimeError # Please triage this failure
+LibTest/html/Element/contentEdge_A01_t01: RuntimeError # Please triage this failure
+LibTest/html/Element/dataset_A02_t01: RuntimeError # Please triage this failure
+LibTest/html/Element/focus_A01_t01: Skip # Times out. Please triage this failure
+LibTest/html/Element/getAttributeNS_A01_t01: RuntimeError # Please triage this failure
+LibTest/html/Element/getClientRects_A01_t02: RuntimeError # Please triage this failure
+LibTest/html/Element/getNamespacedAttributes_A01_t01: RuntimeError # Please triage this failure
+LibTest/html/Element/isContentEditable_A01_t01: RuntimeError # Please triage this failure
+LibTest/html/Element/isContentEditable_A02_t01: RuntimeError # Please triage this failure
+LibTest/html/Element/marginEdge_A01_t01: RuntimeError # Please triage this failure
+LibTest/html/Element/mouseWheelEvent_A01_t01: Skip # Times out. Please triage this failure
+LibTest/html/Element/onMouseWheel_A01_t01: Skip # Times out. Please triage this failure
+LibTest/html/Element/onTransitionEnd_A01_t01: RuntimeError # Please triage this failure
+LibTest/html/Element/paddingEdge_A01_t01: RuntimeError # Please triage this failure
+LibTest/html/Element/querySelectorAll_A01_t02: RuntimeError # Please triage this failure
+LibTest/html/Element/replaceWith_A01_t02: RuntimeError # Please triage this failure
+LibTest/html/Element/transitionEndEvent_A01_t01: RuntimeError # Please triage this failure
+LibTest/html/HttpRequest/getAllResponseHeaders_A01_t01: RuntimeError # Please triage this failure
+LibTest/html/HttpRequest/getResponseHeader_A01_t01: RuntimeError # Please triage this failure
+LibTest/html/HttpRequest/getString_A01_t01: RuntimeError # Please triage this failure
+LibTest/html/HttpRequest/onError_A01_t02: Skip # Times out. Please triage this failure
+LibTest/html/HttpRequest/request_A01_t01: RuntimeError # Please triage this failure
+LibTest/html/HttpRequest/responseText_A01_t02: Skip # Times out. Please triage this failure
+LibTest/html/HttpRequest/responseType_A01_t01: RuntimeError # Please triage this failure
+LibTest/html/HttpRequest/setRequestHeader_A01_t01: RuntimeError # Please triage this failure
+LibTest/html/HttpRequest/statusText_A01_t01: RuntimeError # Please triage this failure
+LibTest/html/HttpRequest/status_A01_t01: RuntimeError # Please triage this failure
+LibTest/html/HttpRequestUpload/onError_A01_t02: Skip # Times out. Please triage this failure
+LibTest/html/HttpRequestUpload/onLoadEnd_A01_t01: Skip # Times out. Please triage this failure
+LibTest/html/HttpRequestUpload/onLoadStart_A01_t01: Skip # Times out. Please triage this failure
+LibTest/html/HttpRequestUpload/onLoad_A01_t01: Skip # Times out. Please triage this failure
+LibTest/html/IFrameElement/IFrameElement.created_A01_t01: RuntimeError # Please triage this failure
+LibTest/html/IFrameElement/appendHtml_A01_t01: RuntimeError # Please triage this failure
+LibTest/html/IFrameElement/appendHtml_A01_t02: RuntimeError # Please triage this failure
+LibTest/html/IFrameElement/attributeChanged_A01_t01: RuntimeError # Please triage this failure
+LibTest/html/IFrameElement/attributes_setter_A01_t01: RuntimeError # Please triage this failure
+LibTest/html/IFrameElement/blur_A01_t01: Skip # Times out. Please triage this failure
+LibTest/html/IFrameElement/borderEdge_A01_t01: RuntimeError # Please triage this failure
+LibTest/html/IFrameElement/clone_A01_t02: RuntimeError # Please triage this failure
+LibTest/html/IFrameElement/contentWindow_A01_t01: RuntimeError # Please triage this failure
+LibTest/html/IFrameElement/createFragment_A01_t01: RuntimeError # Please triage this failure
+LibTest/html/IFrameElement/createFragment_A01_t02: RuntimeError # Please triage this failure
+LibTest/html/IFrameElement/createFragment_A01_t03: RuntimeError # Please triage this failure
+LibTest/html/IFrameElement/createShadowRoot_A01_t01: RuntimeError # Please triage this failure
+LibTest/html/IFrameElement/focus_A01_t01: Skip # Times out. Please triage this failure
+LibTest/html/IFrameElement/getClientRects_A01_t02: RuntimeError # Please triage this failure
+LibTest/html/IFrameElement/getNamespacedAttributes_A01_t01: RuntimeError # Please triage this failure
+LibTest/html/IFrameElement/innerHtml_A01_t01: RuntimeError # Please triage this failure
+LibTest/html/IFrameElement/isContentEditable_A01_t01: RuntimeError # Please triage this failure
+LibTest/html/IFrameElement/leftView_A01_t01: Skip # Times out. Please triage this failure
+LibTest/html/IFrameElement/marginEdge_A01_t01: RuntimeError # Please triage this failure
+LibTest/html/IFrameElement/offsetTo_A01_t01: RuntimeError # Please triage this failure
+LibTest/html/IFrameElement/onMouseWheel_A01_t01: Skip # Times out. Please triage this failure
+LibTest/html/IFrameElement/onTransitionEnd_A01_t01: RuntimeError # Please triage this failure
+LibTest/html/IFrameElement/outerHtml_setter_A01_t01: RuntimeError # Please triage this failure
+LibTest/html/IFrameElement/paddingEdge_A01_t01: RuntimeError # Please triage this failure
+LibTest/html/IFrameElement/querySelector_A01_t01: RuntimeError # Please triage this failure
+LibTest/html/IFrameElement/setInnerHtml_A01_t01: RuntimeError # Please triage this failure
+LibTest/html/Node/append_A01_t02: RuntimeError # Please triage this failure
+LibTest/html/Node/nodes_A01_t01: RuntimeError # Please triage this failure
+LibTest/html/Node/nodes_A01_t02: RuntimeError # Please triage this failure
+LibTest/html/Node/parent_A01_t01: RuntimeError # Please triage this failure
+LibTest/html/Node/previousNode_A01_t01: RuntimeError # Please triage this failure
+LibTest/html/Window/animationFrame_A01_t01: Skip # Times out. Please triage this failure
+LibTest/html/Window/close_A01_t01: RuntimeError # Please triage this failure
+LibTest/html/Window/document_A01_t01: RuntimeError # Please triage this failure
+LibTest/html/Window/find_A01_t01: RuntimeError # Please triage this failure
+LibTest/html/Window/find_A03_t01: RuntimeError # Please triage this failure
+LibTest/html/Window/find_A06_t01: RuntimeError # Please triage this failure
+LibTest/html/Window/moveBy_A01_t01: RuntimeError # Please triage this failure
+LibTest/html/Window/moveTo_A01_t01: RuntimeError # Please triage this failure
+LibTest/html/Window/moveTo_A02_t01: RuntimeError # Please triage this failure
+LibTest/html/Window/postMessage_A01_t01: RuntimeError # Please triage this failure
+LibTest/html/Window/postMessage_A01_t02: RuntimeError # Please triage this failure
+LibTest/html/Window/requestFileSystem_A02_t01: RuntimeError # Please triage this failure
+LibTest/html/Window/resizeBy_A01_t01: RuntimeError # Please triage this failure
+LibTest/html/Window/resizeTo_A01_t01: RuntimeError # Please triage this failure
+LibTest/typed_data/Float32x4List/Float32x4List.view_A06_t01: RuntimeError # Please triage this failure
+LibTest/typed_data/Int32x4/operator_OR_A01_t01: RuntimeError # Please triage this failure
+LibTest/typed_data/Uint8ClampedList/buffer_A01_t01: Pass, RuntimeError # Please triage this failure
+WebPlatformTest/DOMEvents/approved/EventObject.after.dispatchEvenr_t01: RuntimeError # Please triage this failure
+WebPlatformTest/DOMEvents/approved/EventObject.multiple.dispatchEvent_t01: RuntimeError # Please triage this failure
+WebPlatformTest/DOMEvents/approved/ProcessingInstruction.DOMCharacterDataModified_t01: Skip # Times out. Please triage this failure
+WebPlatformTest/DOMEvents/approved/addEventListener.optional.useCapture_t01: RuntimeError # Please triage this failure
+WebPlatformTest/Utils/test/asyncTestFail_t01: RuntimeError # Please triage this failure
+WebPlatformTest/Utils/test/asyncTestFail_t02: RuntimeError # Please triage this failure
+WebPlatformTest/Utils/test/asyncTestTimeout_t01: Skip # Times out. Please triage this failure
+WebPlatformTest/custom-elements/concepts/type_A03_t01: RuntimeError # Please triage this failure
+WebPlatformTest/custom-elements/concepts/type_A05_t01: RuntimeError # Please triage this failure
+WebPlatformTest/custom-elements/concepts/type_A06_t01: RuntimeError # Please triage this failure
+WebPlatformTest/custom-elements/instantiating/createElementNS_A02_t01: RuntimeError # Please triage this failure
+WebPlatformTest/custom-elements/instantiating/createElementNS_A03_t01: RuntimeError # Please triage this failure
+WebPlatformTest/custom-elements/instantiating/createElementNS_A04_t01: RuntimeError # Please triage this failure
+WebPlatformTest/custom-elements/instantiating/createElement_A02_t01: RuntimeError # Please triage this failure
+WebPlatformTest/custom-elements/instantiating/createElement_A03_t01: RuntimeError # Please triage this failure
+WebPlatformTest/custom-elements/instantiating/createElement_A04_t01: RuntimeError # Please triage this failure
+WebPlatformTest/custom-elements/instantiating/isAttribute_A01_t01: RuntimeError # Please triage this failure
+WebPlatformTest/custom-elements/instantiating/isAttribute_A01_t02: RuntimeError # Please triage this failure
+WebPlatformTest/dom/EventTarget/dispatchEvent_A02_t01: RuntimeError # Please triage this failure
+WebPlatformTest/dom/EventTarget/dispatchEvent_A03_t01: Skip # Times out. Please triage this failure
+WebPlatformTest/dom/events/type_A01_t01: RuntimeError # Please triage this failure
+WebPlatformTest/dom/nodes/DOMImplementation-createDocument_t01: RuntimeError # Please triage this failure
+WebPlatformTest/dom/nodes/DOMImplementation-hasFeature_t01: RuntimeError # Please triage this failure
+WebPlatformTest/dom/nodes/Document-adoptNode_t01: RuntimeError # Please triage this failure
+WebPlatformTest/dom/nodes/Document-getElementsByTagName_t01: RuntimeError # Please triage this failure
+WebPlatformTest/dom/nodes/Element-childElementCount_t01: RuntimeError # Please triage this failure
+WebPlatformTest/dom/nodes/Node-appendChild_t01: RuntimeError # Please triage this failure
+WebPlatformTest/dom/nodes/Node-appendChild_t02: RuntimeError # Please triage this failure
+WebPlatformTest/dom/nodes/Node-insertBefore_t01: RuntimeError # Please triage this failure
+WebPlatformTest/dom/nodes/Node-isEqualNode_t01: RuntimeError # Please triage this failure
+WebPlatformTest/dom/nodes/Node-nodeName_t01: RuntimeError # Please triage this failure
+WebPlatformTest/dom/nodes/Node-replaceChild_t01: RuntimeError # Please triage this failure
+WebPlatformTest/dom/nodes/Node-textContent_t01: RuntimeError # Please triage this failure
+WebPlatformTest/dom/nodes/attributes/setAttributeNS_A05_t01: RuntimeError # Please triage this failure
+WebPlatformTest/dom/nodes/attributes/setAttributeNS_A06_t03: RuntimeError # Please triage this failure
+WebPlatformTest/dom/nodes/attributes/setAttributeNS_A07_t02: RuntimeError # Please triage this failure
+WebPlatformTest/dom/nodes/attributes/setAttributeNS_A07_t03: RuntimeError # Please triage this failure
+WebPlatformTest/dom/nodes/attributes/setAttributeNS_A08_t01: RuntimeError # Please triage this failure
+WebPlatformTest/dom/nodes/attributes/setAttribute_A03_t01: RuntimeError # Please triage this failure
+WebPlatformTest/dom/ranges/Range-comparePoint_t02: RuntimeError # Please triage this failure
+WebPlatformTest/html-imports/link-import_t01: RuntimeError # Please triage this failure
+WebPlatformTest/html-imports/link-import_t02: RuntimeError # Please triage this failure
+WebPlatformTest/html-imports/loading-import_t01: RuntimeError # Please triage this failure
+WebPlatformTest/html-templates/innerhtml-on-templates/innerhtml_t01: RuntimeError # Please triage this failure
+WebPlatformTest/html-templates/parsing-html-templates/additions-to-the-in-head-insertion-mode/generating-of-implied-end-tags_t01: RuntimeError # Please triage this failure
+WebPlatformTest/html-templates/parsing-html-templates/additions-to-the-in-head-insertion-mode/template-end-tag-without-start-one_t01: RuntimeError # Please triage this failure
+WebPlatformTest/html-templates/parsing-html-templates/clearing-the-stack-back-to-a-given-context/clearing-stack-back-to-a-table-body-context_t01: RuntimeError # Please triage this failure
+WebPlatformTest/html-templates/parsing-html-templates/clearing-the-stack-back-to-a-given-context/clearing-stack-back-to-a-table-context_t01: RuntimeError # Please triage this failure
+WebPlatformTest/html-templates/parsing-html-templates/creating-an-element-for-the-token/template-owner-document_t01: RuntimeError # Please triage this failure
+WebPlatformTest/html-templates/template-element/template-as-a-descendant_t01: RuntimeError # Please triage this failure
+WebPlatformTest/html/browsers/browsing-the-web/read-media/pageload-image_t01: RuntimeError # Please triage this failure
+WebPlatformTest/html/browsers/browsing-the-web/read-media/pageload-video_t01: RuntimeError # Please triage this failure
+WebPlatformTest/html/browsers/browsing-the-web/read-text/load-text-plain_t01: RuntimeError # Please triage this failure
+WebPlatformTest/html/dom/documents/dom-tree-accessors/Document.getElementsByClassName-null_t01: RuntimeError # Please triage this failure
+WebPlatformTest/html/dom/documents/dom-tree-accessors/document.body-getter_t01: RuntimeError # Please triage this failure
+WebPlatformTest/html/dom/documents/dom-tree-accessors/document.body-setter_t01: RuntimeError # Please triage this failure
+WebPlatformTest/html/dom/documents/dom-tree-accessors/document.getElementsByName-namespace_t01: RuntimeError # Please triage this failure
+WebPlatformTest/html/dom/documents/dom-tree-accessors/document.title_t01: RuntimeError # Please triage this failure
+WebPlatformTest/html/dom/documents/dom-tree-accessors/document.title_t05: RuntimeError # Please triage this failure
+WebPlatformTest/html/dom/documents/dom-tree-accessors/document.title_t07: RuntimeError # Please triage this failure
+WebPlatformTest/html/dom/documents/dom-tree-accessors/nameditem_t02: RuntimeError # Please triage this failure
+WebPlatformTest/html/dom/elements/global-attributes/dataset-delete_t01: RuntimeError # Please triage this failure
+WebPlatformTest/html/dom/elements/global-attributes/dataset-get_t01: RuntimeError # Please triage this failure
+WebPlatformTest/html/dom/elements/global-attributes/dataset-set_t01: RuntimeError # Please triage this failure
+WebPlatformTest/html/semantics/document-metadata/styling/LinkStyle_t01: RuntimeError # Please triage this failure
+WebPlatformTest/html/semantics/embedded-content/media-elements/error-codes/error_t01: Skip # Times out. Please triage this failure
+WebPlatformTest/html/semantics/embedded-content/media-elements/interfaces/HTMLElement/HTMLTrackElement/src_t01: RuntimeError # Please triage this failure
+WebPlatformTest/html/semantics/embedded-content/media-elements/interfaces/TextTrack/cues_t01: Skip # Times out. Please triage this failure
+WebPlatformTest/html/semantics/embedded-content/media-elements/interfaces/TextTrack/mode_t01: RuntimeError # Please triage this failure
+WebPlatformTest/html/semantics/forms/attributes-common-to-form-controls/formAction_document_address_t01: RuntimeError # Please triage this failure
+WebPlatformTest/html/semantics/forms/attributes-common-to-form-controls/formaction_t01: RuntimeError # Please triage this failure
+WebPlatformTest/html/semantics/forms/textfieldselection/textfieldselection-setRangeText_t01: RuntimeError # Please triage this failure
+WebPlatformTest/html/semantics/forms/textfieldselection/textfieldselection-setSelectionRange_t01: Pass, RuntimeError # Please triage this failure
+WebPlatformTest/html/semantics/forms/the-button-element/button-validation_t01: RuntimeError # Please triage this failure
+WebPlatformTest/html/semantics/forms/the-fieldset-element/disabled_t01: RuntimeError # Please triage this failure
+WebPlatformTest/html/semantics/forms/the-form-element/form-autocomplete_t01: RuntimeError # Please triage this failure
+WebPlatformTest/html/semantics/forms/the-form-element/form-elements-matches_t01: RuntimeError # Please triage this failure
+WebPlatformTest/html/semantics/forms/the-form-element/form-elements-nameditem_t02: RuntimeError # Please triage this failure
+WebPlatformTest/html/semantics/forms/the-input-element/date_t01: RuntimeError # Please triage this failure
+WebPlatformTest/html/semantics/forms/the-input-element/datetime-local_t01: RuntimeError # Please triage this failure
+WebPlatformTest/html/semantics/forms/the-input-element/datetime_t01: RuntimeError # Please triage this failure
+WebPlatformTest/html/semantics/forms/the-input-element/datetime_t02: RuntimeError # Please triage this failure
+WebPlatformTest/html/semantics/forms/the-input-element/email_t01: RuntimeError # Please triage this failure
+WebPlatformTest/html/semantics/forms/the-input-element/hidden_t01: RuntimeError # Please triage this failure
+WebPlatformTest/html/semantics/forms/the-input-element/input-textselection_t01: RuntimeError # Please triage this failure
+WebPlatformTest/html/semantics/forms/the-input-element/month_t01: RuntimeError # Please triage this failure
+WebPlatformTest/html/semantics/forms/the-input-element/password_t01: RuntimeError # Please triage this failure
+WebPlatformTest/html/semantics/forms/the-input-element/range_t01: RuntimeError # Please triage this failure
+WebPlatformTest/html/semantics/forms/the-input-element/text_t01: RuntimeError # Please triage this failure
+WebPlatformTest/html/semantics/forms/the-input-element/time_t01: RuntimeError # Please triage this failure
+WebPlatformTest/html/semantics/forms/the-input-element/time_t02: RuntimeError # Please triage this failure
+WebPlatformTest/html/semantics/forms/the-input-element/type-change-state_t01: RuntimeError # Please triage this failure
+WebPlatformTest/html/semantics/forms/the-input-element/url_t01: RuntimeError # Please triage this failure
+WebPlatformTest/html/semantics/forms/the-input-element/valueMode_t01: RuntimeError # Please triage this failure
+WebPlatformTest/html/semantics/forms/the-input-element/week_t01: RuntimeError # Please triage this failure
+WebPlatformTest/html/semantics/forms/the-meter-element/meter_t01: RuntimeError # Please triage this failure
+WebPlatformTest/html/semantics/forms/the-option-element/option-text-recurse_t01: RuntimeError # Please triage this failure
+WebPlatformTest/html/semantics/forms/the-option-element/option-text-spaces_t01: RuntimeError # Please triage this failure
+WebPlatformTest/html/semantics/grouping-content/the-blockquote-element/grouping-blockquote_t01: RuntimeError # Please triage this failure
+WebPlatformTest/html/semantics/grouping-content/the-ol-element/ol.start-reflection_t02: RuntimeError # Please triage this failure
+WebPlatformTest/html/semantics/interactive-elements/the-dialog-element/dialog-close_t01: RuntimeError # Please triage this failure
+WebPlatformTest/html/semantics/interactive-elements/the-dialog-element/dialog-showModal_t01: RuntimeError # Please triage this failure
+WebPlatformTest/html/semantics/scripting-1/the-script-element/async_t11: RuntimeError # Please triage this failure
+WebPlatformTest/html/semantics/scripting-1/the-script-element/script-text_t02: RuntimeError # Please triage this failure
+WebPlatformTest/html/semantics/selectors/pseudo-classes/checked_t01: RuntimeError # Please triage this failure
+WebPlatformTest/html/semantics/selectors/pseudo-classes/default_t01: RuntimeError # Please triage this failure
+WebPlatformTest/html/semantics/selectors/pseudo-classes/dir_t01: RuntimeError # Please triage this failure
+WebPlatformTest/html/semantics/selectors/pseudo-classes/disabled_t01: RuntimeError # Please triage this failure
+WebPlatformTest/html/semantics/selectors/pseudo-classes/enabled_t01: RuntimeError # Please triage this failure
+WebPlatformTest/html/semantics/selectors/pseudo-classes/focus_t01: Pass, RuntimeError # Please triage this failure
+WebPlatformTest/html/semantics/selectors/pseudo-classes/indeterminate_t01: RuntimeError # Please triage this failure
+WebPlatformTest/html/semantics/selectors/pseudo-classes/inrange-outofrange_t01: RuntimeError # Please triage this failure
+WebPlatformTest/html/semantics/selectors/pseudo-classes/link_t01: RuntimeError # Please triage this failure
+WebPlatformTest/html/semantics/selectors/pseudo-classes/valid-invalid_t01: RuntimeError # Please triage this failure
+WebPlatformTest/html/semantics/tabular-data/the-table-element/table-rows_t01: RuntimeError # Please triage this failure
+WebPlatformTest/html/semantics/tabular-data/the-tr-element/rowIndex_t01: RuntimeError # Please triage this failure
+WebPlatformTest/html/syntax/parsing/Document.getElementsByTagName-foreign_t02: RuntimeError # Please triage this failure
+WebPlatformTest/html/syntax/serializing-html-fragments/outerHTML_t01: RuntimeError # Please triage this failure
+WebPlatformTest/html/webappapis/system-state-and-capabilities/the-navigator-object/protocol_t00: Pass, RuntimeError # Please triage this failure
+WebPlatformTest/html/webappapis/system-state-and-capabilities/the-navigator-object/protocol/t01: RuntimeError # Please triage this failure
+WebPlatformTest/html/webappapis/system-state-and-capabilities/the-navigator-object/protocol/t02: RuntimeError # Please triage this failure
+WebPlatformTest/html/webappapis/system-state-and-capabilities/the-navigator-object/protocol/t03: RuntimeError # Please triage this failure
+WebPlatformTest/html/webappapis/system-state-and-capabilities/the-navigator-object/protocol/t04: RuntimeError # Please triage this failure
+WebPlatformTest/html/webappapis/system-state-and-capabilities/the-navigator-object/protocol/t05: RuntimeError # Please triage this failure
+WebPlatformTest/html/webappapis/system-state-and-capabilities/the-navigator-object/protocol/t06: RuntimeError # Please triage this failure
+WebPlatformTest/shadow-dom/elements-and-dom-objects/extensions-to-element-interface/attributes/test-001_t01: RuntimeError # Please triage this failure
+WebPlatformTest/shadow-dom/elements-and-dom-objects/extensions-to-element-interface/attributes/test-004_t01: RuntimeError # Please triage this failure
+WebPlatformTest/shadow-dom/elements-and-dom-objects/extensions-to-element-interface/attributes/test-004_t02: RuntimeError # Please triage this failure
+WebPlatformTest/shadow-dom/elements-and-dom-objects/extensions-to-element-interface/methods/elements-001_t01: RuntimeError # Please triage this failure
+WebPlatformTest/shadow-dom/elements-and-dom-objects/the-content-html-element/test-004_t01: RuntimeError # Please triage this failure
+WebPlatformTest/shadow-dom/elements-and-dom-objects/the-content-html-element/test-004_t02: RuntimeError # Please triage this failure
+WebPlatformTest/shadow-dom/elements-and-dom-objects/the-content-html-element/test-006_t01: RuntimeError # Please triage this failure
+WebPlatformTest/shadow-dom/elements-and-dom-objects/the-shadow-html-element/test-001_t01: RuntimeError # Please triage this failure
+WebPlatformTest/shadow-dom/elements-and-dom-objects/the-shadow-html-element/test-003_t01: RuntimeError # Please triage this failure
+WebPlatformTest/shadow-dom/elements-and-dom-objects/the-shadow-html-element/test-003_t02: RuntimeError # Please triage this failure
+WebPlatformTest/shadow-dom/elements-and-dom-objects/the-shadow-html-element/test-005_t01: RuntimeError # Please triage this failure
+WebPlatformTest/shadow-dom/events/event-dispatch/test-001_t01: RuntimeError # Please triage this failure
+WebPlatformTest/shadow-dom/events/event-dispatch/test-003_t01: RuntimeError # Please triage this failure
+WebPlatformTest/shadow-dom/events/event-retargeting/test-001_t01: RuntimeError # Please triage this failure
+WebPlatformTest/shadow-dom/events/event-retargeting/test-002_t01: RuntimeError # Please triage this failure
+WebPlatformTest/shadow-dom/events/event-retargeting/test-004_t01: RuntimeError # Please triage this failure
+WebPlatformTest/shadow-dom/events/retargeting-focus-events/test-001_t01: Skip # Times out. Please triage this failure
+WebPlatformTest/shadow-dom/events/retargeting-focus-events/test-001_t02: Skip # Times out. Please triage this failure
+WebPlatformTest/shadow-dom/events/retargeting-focus-events/test-001_t05: Skip # Times out. Please triage this failure
+WebPlatformTest/shadow-dom/events/retargeting-focus-events/test-002_t01: Pass, RuntimeError # Please triage this failure
+WebPlatformTest/shadow-dom/events/retargeting-focus-events/test-003_t01: Pass, RuntimeError # Please triage this failure
+WebPlatformTest/shadow-dom/events/retargeting-relatedtarget/test-003_t01: RuntimeError # Please triage this failure
+WebPlatformTest/shadow-dom/html-elements-and-their-shadow-trees/test-001_t01: RuntimeError # Please triage this failure
+WebPlatformTest/shadow-dom/html-elements-and-their-shadow-trees/test-002_t01: RuntimeError # Please triage this failure
+WebPlatformTest/shadow-dom/html-elements-and-their-shadow-trees/test-003_t01: RuntimeError # Please triage this failure
+WebPlatformTest/shadow-dom/shadow-trees/custom-pseudo-elements/test-001_t01: RuntimeError # Please triage this failure
+WebPlatformTest/shadow-dom/shadow-trees/distributed-pseudo-element/test-001_t01: RuntimeError # Please triage this failure
+WebPlatformTest/shadow-dom/shadow-trees/distributed-pseudo-element/test-002_t01: RuntimeError # Please triage this failure
+WebPlatformTest/shadow-dom/shadow-trees/lower-boundary-encapsulation/test-004_t01: RuntimeError # Please triage this failure
+WebPlatformTest/shadow-dom/shadow-trees/upper-boundary-encapsulation/ownerdocument-002_t01: RuntimeError # Please triage this failure
+WebPlatformTest/shadow-dom/shadow-trees/upper-boundary-encapsulation/test-009_t01: RuntimeError # Please triage this failure
+WebPlatformTest/webstorage/event_constructor_t01: RuntimeError # Please triage this failure
+WebPlatformTest/webstorage/event_constructor_t02: RuntimeError # Please triage this failure
+WebPlatformTest/webstorage/event_local_key_t01: RuntimeError # Please triage this failure
+WebPlatformTest/webstorage/event_session_key_t01: RuntimeError # 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 && ($runtime == chrome || $runtime == drt) && $checked ]
+LayoutTests/fast/css-intrinsic-dimensions/css-tables_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css-intrinsic-dimensions/intrinsic-sized-absolutes_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css-intrinsic-dimensions/intrinsic-sized-blocks_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css-intrinsic-dimensions/intrinsic-sized-column-flex-items_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css-intrinsic-dimensions/intrinsic-sized-flex-items_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css-intrinsic-dimensions/intrinsic-sized-replaced-absolutes_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css-intrinsic-dimensions/multicol_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css-intrinsic-dimensions/tables_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css-intrinsic-dimensions/width-shrinks-avoid-floats_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css/box-sizing-border-box-dynamic-padding-border-update_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css/display-inline-block-scrollbar_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css/fixed-width-intrinsic-width-excludes-scrollbars_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css/style-scoped/style-scoped-scoping-nodes-different-order_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/HTMLDialogElement/top-layer-position-relative_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/HTMLDialogElement/top-layer-position-static_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/HTMLLabelElement/form/test1_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/HTMLTableElement/insert-row_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/events/scroll-event-phase_t01: Skip # Times out. Please triage this failure
+LayoutTests/fast/filesystem/file-writer-abort_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/filesystem/file-writer-events_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/filesystem/op-copy_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/filesystem/op-get-entry_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/filesystem/op-get-metadata_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/filesystem/op-get-parent_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/filesystem/op-move_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/filesystem/op-read-directory_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/filesystem/op-remove_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/filesystem/op-restricted-chars_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/filesystem/op-restricted-names_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/filesystem/op-restricted-unicode_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/flexbox/flexing-overflow-scroll-item_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/flexbox/intrinsic-min-width-applies-with-fixed-width_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/html/article-element_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/html/aside-element_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/inline/empty-inline-before-collapsed-space_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/lists/list-style-position-inside_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/lists/marker-preferred-margins_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/multicol/fixed-column-percent-logical-height-orthogonal-writing-mode_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/multicol/vertical-lr/image-inside-nested-blocks-with-border_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/replaced/available-height-for-content_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/replaced/computed-image-width-with-percent-height-and-fixed-ancestor_t01: Pass, RuntimeError # Please triage this failure
+LayoutTests/fast/replaced/computed-image-width-with-percent-height-and-fixed-ancestor-vertical-lr_t01: Pass, RuntimeError # Please triage this failure
+LayoutTests/fast/replaced/computed-image-width-with-percent-height-inside-table-cell-and-fixed-ancestor_t01: Pass, RuntimeError # Please triage this failure
+LayoutTests/fast/shapes/parsing/parsing-shape-image-threshold_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/shapes/parsing/parsing-shape-margin_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/shapes/parsing/parsing-shape-outside_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/table/absolute-table-percent-lengths_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/table/css-table-width_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/table/fixed-table-layout-width-change_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/table/html-table-width-max-width-constrained_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/table/margins-flipped-text-direction_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/table/min-max-width-preferred-size_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/table/switch-table-layout-dynamic-cells_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/table/switch-table-layout-multiple-section_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/table/switch-table-layout_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/table/table-width-exceeding-max-width_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/text/line-break-after-inline-latin1_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/xmlhttprequest/xmlhttprequest-bad-mimetype_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/xmlhttprequest/xmlhttprequest-invalid-values_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/xpath/xpath-result-eventlistener-crash_t01: RuntimeError # Please triage this failure
+LibTest/html/Node/ownerDocument_A01_t01: RuntimeError # Please triage this failure
+WebPlatformTest/DOMEvents/approved/Propagation.path.target.removed_t01: RuntimeError # Please triage this failure
+WebPlatformTest/custom-elements/instantiating/createElementNS_A05_t01: RuntimeError # Please triage this failure
+WebPlatformTest/custom-elements/instantiating/createElement_A05_t01: RuntimeError # Please triage this failure
+WebPlatformTest/dom/nodes/DOMImplementation-createDocumentType_t01: RuntimeError # Please triage this failure
+WebPlatformTest/html-templates/parsing-html-templates/clearing-the-stack-back-to-a-given-context/clearing-stack-back-to-a-table-row-context_t01: RuntimeError # Please triage this failure
+WebPlatformTest/html/dom/elements/global-attributes/dataset-enumeration_t01: RuntimeError # Please triage this failure
+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 || $runtime == drt) && $system != macos ]
+LayoutTests/fast/canvas/webgl/WebGLContextEvent_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/webgl/array-bounds-clamping_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/webgl/attrib-location-length-limits_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/webgl/bad-arguments-test_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/webgl/buffer-bind-test_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/webgl/buffer-data-array-buffer_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/webgl/canvas-2d-webgl-texture_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/webgl/canvas-resize-crash_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/webgl/canvas-test_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/webgl/canvas-zero-size_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/webgl/compressed-tex-image_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/webgl/context-destroyed-crash_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/webgl/context-lost-restored_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/webgl/css-webkit-canvas-repaint_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/webgl/css-webkit-canvas_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/webgl/draw-arrays-out-of-bounds_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/webgl/draw-elements-out-of-bounds_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/webgl/draw-webgl-to-canvas-2d_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/webgl/drawingbuffer-test_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/webgl/error-reporting_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/webgl/functions-returning-strings_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/webgl/get-active-test_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/webgl/gl-bind-attrib-location-test_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/webgl/gl-enable-enum-test_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/webgl/gl-enum-tests_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/webgl/gl-get-calls_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/webgl/gl-getshadersource_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/webgl/gl-getstring_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/webgl/gl-object-get-calls_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/webgl/gl-pixelstorei_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/webgl/gl-uniformmatrix4fv_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/webgl/gl-vertex-attrib-zero-issues_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/webgl/gl-vertex-attrib_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/webgl/gl-vertexattribpointer_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/webgl/glsl-conformance_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/webgl/incorrect-context-object-behaviour_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/webgl/index-validation-copies-indices_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/webgl/index-validation-crash-with-buffer-sub-data_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/webgl/index-validation-verifies-too-many-indices_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/webgl/index-validation-with-resized-buffer_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/webgl/index-validation_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/webgl/invalid-UTF-16_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/webgl/is-object_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/webgl/null-object-behaviour_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/webgl/null-uniform-location_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/webgl/oes-element-index-uint_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/webgl/oes-vertex-array-object_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/webgl/point-size_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/webgl/premultiplyalpha-test_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/webgl/program-test_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/webgl/read-pixels-pack-alignment_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/webgl/read-pixels-test_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/webgl/renderbuffer-initialization_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/webgl/renderer-and-vendor-strings_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/webgl/shader-precision-format_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/webgl/tex-image-and-uniform-binding-bugs_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/webgl/tex-image-webgl_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/webgl/texImage2DImageDataTest_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/webgl/texture-active-bind_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/webgl/texture-bindings-uneffected-on-resize_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/webgl/texture-color-profile_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/webgl/texture-complete_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/webgl/texture-npot_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/webgl/texture-transparent-pixels-initialized_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/webgl/triangle_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/webgl/uniform-location-length-limits_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/webgl/viewport-unchanged-upon-resize_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/webgl/webgl-composite-modes-repaint_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/webgl/webgl-composite-modes_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/webgl/webgl-exceptions_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/webgl/webgl-large-texture_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/webgl/webgl-layer-update_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/webgl/webgl-specific_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/webgl/webgl-texture-binding-preserved_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/webgl/webgl-unprefixed-context-id_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/webgl/webgl-viewport-parameters-preserved_t01: RuntimeError # Please triage this failure
+
+[ $compiler == dart2js && $runtime == ff ]
+Language/12_Expressions/00_Object_Identity/1_Object_Identity_A05_t02: RuntimeError # Please triage this failure
+Language/12_Expressions/17_Getter_Invocation_A07_t02: RuntimeError # Please triage this failure
+LayoutTests/fast/alignment/parse-align-items_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/alignment/parse-align-self_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/alignment/parse-justify-self_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/animation/request-animation-frame-cancel2_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/animation/request-animation-frame-prefix_t01: Skip # Times out. Please triage this failure
+LayoutTests/fast/animation/request-animation-frame-timestamps-advance_t01: Skip # Times out. Please triage this failure
+LayoutTests/fast/animation/request-animation-frame-within-callback_t01: Skip # Times out. Please triage this failure
+LayoutTests/fast/backgrounds/background-position-parsing-2_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/backgrounds/background-repeat-computed-style_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/backgrounds/background-shorthand-with-backgroundSize-style_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/backgrounds/mask-box-image-width_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/backgrounds/multiple-backgrounds-computed-style_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/backgrounds/repeat/parsing-background-repeat_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/borders/border-color-visited_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/borders/border-radius-child_t01: Pass, RuntimeError # Please triage this failure
+LayoutTests/fast/borders/border-width-percent_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/box-sizing/css-table-with-box-sizing_t01: Pass, RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/2d.fillText.gradient_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/2d.text.draw.fill.maxWidth.gradient_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/2d.text.draw.fill.maxWidth.negative_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/2d.text.draw.fill.maxWidth.veryLarge_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/2d.text.draw.fill.maxWidth.verySmall_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/DrawImageSinglePixelStretch_t01: Pass, RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/alpha_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/canvas-arc-negative-radius_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/canvas-as-image-incremental-repaint_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/canvas-as-image_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/canvas-blend-solid_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/canvas-blending-text_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/canvas-composite-canvas_t01: Pass, RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/canvas-composite-image_t01: Pass, RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/canvas-composite-text-alpha_t01: Pass, RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/canvas-css-crazy_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/canvas-currentColor_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/canvas-currentTransform_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/canvas-drawImage-incomplete_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/canvas-ellipse-360-winding_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/canvas-ellipse-negative-radius_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/canvas-ellipse-zero-lineto_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/canvas-ellipse_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/canvas-empty-image-pattern_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/canvas-fill-zeroSizeGradient_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/canvas-fillRect-zeroSizeGradient_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/canvas-fillText-invalid-maxWidth_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/canvas-fillText-zeroSizeGradient_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/canvas-font-ex-units-crash_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/canvas-frameless-document-text_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/canvas-getImageData-invalid_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/canvas-getImageData-large-crash_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/canvas-getImageData-rounding_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/canvas-imageSmoothingEnabled-repaint_t01: Skip # Times out. Please triage this failure
+LayoutTests/fast/canvas/canvas-imageSmoothingEnabled_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/canvas-large-dimensions_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/canvas-large-fills_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/canvas-lineDash_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/canvas-lose-restore-googol-size_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/canvas-lose-restore-max-int-size_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/canvas-putImageData_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/canvas-resetTransform_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/canvas-resize-after-paint_t01: Skip # Times out. Please triage this failure
+LayoutTests/fast/canvas/canvas-scale-shadowBlur_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/canvas-scale-strokePath-shadow_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/canvas-set-properties-with-non-invertible-ctm_t01: Pass, RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/canvas-setTransform_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/canvas-stroke-zeroSizeGradient_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/canvas-strokePath-gradient-shadow_t01: Pass, RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/canvas-strokeRect-alpha-shadow_t01: Pass, RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/canvas-strokeRect-gradient-shadow_t01: Pass, RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/canvas-strokeRect-zeroSizeGradient_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/canvas-strokeText-invalid-maxWidth_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/canvas-strokeText-zeroSizeGradient_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/canvas-toDataURL-crash_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/crash-set-font_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/draw-custom-focus-ring_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/drawImage-with-negative-source-destination_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/drawImage-with-valid-image_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/getPutImageDataPairTest_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/rgba-parsing_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/webgl/WebGLContextEvent_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/webgl/array-bounds-clamping_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/webgl/attrib-location-length-limits_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/webgl/bad-arguments-test_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/webgl/buffer-bind-test_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/webgl/buffer-data-array-buffer_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/webgl/canvas-2d-webgl-texture_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/webgl/canvas-resize-crash_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/webgl/canvas-test_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/webgl/canvas-zero-size_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/webgl/compressed-tex-image_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/webgl/context-attributes-alpha-depth-stencil-antialias-t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/webgl/context-destroyed-crash_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/webgl/context-lost-restored_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/webgl/context-lost_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/webgl/copy-tex-image-and-sub-image-2d_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/webgl/css-webkit-canvas-repaint_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/webgl/css-webkit-canvas_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/webgl/draw-arrays-out-of-bounds_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/webgl/draw-elements-out-of-bounds_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/webgl/draw-webgl-to-canvas-2d_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/webgl/drawingbuffer-test_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/webgl/error-reporting_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/webgl/framebuffer-bindings-unaffected-on-resize_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/webgl/framebuffer-object-attachment_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/webgl/framebuffer-test_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/webgl/functions-returning-strings_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/webgl/get-active-test_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/webgl/gl-bind-attrib-location-test_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/webgl/gl-enable-enum-test_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/webgl/gl-enum-tests_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/webgl/gl-get-calls_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/webgl/gl-getshadersource_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/webgl/gl-getstring_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/webgl/gl-object-get-calls_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/webgl/gl-pixelstorei_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/webgl/gl-teximage_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/webgl/gl-uniformmatrix4fv_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/webgl/gl-vertex-attrib-zero-issues_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/webgl/gl-vertex-attrib_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/webgl/gl-vertexattribpointer_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/webgl/glsl-conformance_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/webgl/incorrect-context-object-behaviour_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/webgl/index-validation-copies-indices_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/webgl/index-validation-crash-with-buffer-sub-data_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/webgl/index-validation-verifies-too-many-indices_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/webgl/index-validation-with-resized-buffer_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/webgl/index-validation_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/webgl/invalid-UTF-16_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/webgl/invalid-passed-params_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/webgl/is-object_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/webgl/null-object-behaviour_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/webgl/null-uniform-location_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/webgl/object-deletion-behaviour_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/webgl/oes-element-index-uint_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/webgl/oes-vertex-array-object_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/webgl/point-size_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/webgl/premultiplyalpha-test_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/webgl/program-test_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/webgl/read-pixels-pack-alignment_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/webgl/read-pixels-test_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/webgl/renderbuffer-initialization_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/webgl/renderer-and-vendor-strings_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/webgl/shader-precision-format_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/webgl/tex-image-and-sub-image-2d-with-array-buffer-view_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/webgl/tex-image-and-sub-image-2d-with-canvas-rgb565_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/webgl/tex-image-and-sub-image-2d-with-canvas-rgba4444_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/webgl/tex-image-and-sub-image-2d-with-canvas-rgba5551_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/webgl/tex-image-and-sub-image-2d-with-canvas_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/webgl/tex-image-and-sub-image-2d-with-image-data-rgb565_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/webgl/tex-image-and-sub-image-2d-with-image-data-rgba4444_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/webgl/tex-image-and-sub-image-2d-with-image-data-rgba5551_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/webgl/tex-image-and-sub-image-2d-with-image-data_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/webgl/tex-image-and-sub-image-2d-with-image-rgb565_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/webgl/tex-image-and-sub-image-2d-with-image-rgba4444_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/webgl/tex-image-and-sub-image-2d-with-image-rgba5551_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/webgl/tex-image-and-sub-image-2d-with-image_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/webgl/tex-image-and-sub-image-2d-with-video-rgb565_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/webgl/tex-image-and-sub-image-2d-with-video-rgba4444_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/webgl/tex-image-and-sub-image-2d-with-video-rgba5551_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/webgl/tex-image-and-sub-image-2d-with-video_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/webgl/tex-image-and-uniform-binding-bugs_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/webgl/tex-image-webgl_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/webgl/tex-input-validation_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/webgl/tex-sub-image-2d-bad-args_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/webgl/tex-sub-image-2d_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/webgl/tex-sub-image-cube-maps_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/webgl/texImage2DImageDataTest_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/webgl/texImageTest_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/webgl/texture-active-bind_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/webgl/texture-bindings-uneffected-on-resize_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/webgl/texture-color-profile_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/webgl/texture-complete_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/webgl/texture-npot_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/webgl/texture-transparent-pixels-initialized_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/webgl/triangle_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/webgl/uniform-location-length-limits_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/webgl/uniform-location_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/webgl/uninitialized-test_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/webgl/viewport-unchanged-upon-resize_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/webgl/webgl-composite-modes-repaint_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/webgl/webgl-composite-modes_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/webgl/webgl-depth-texture_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/webgl/webgl-exceptions_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/webgl/webgl-large-texture_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/webgl/webgl-layer-update_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/webgl/webgl-specific_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/webgl/webgl-texture-binding-preserved_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/webgl/webgl-unprefixed-context-id_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/webgl/webgl-viewport-parameters-preserved_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css-generated-content/bug91547_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css-generated-content/malformed-url_t01: Skip # Times out. Please triage this failure
+LayoutTests/fast/css-generated-content/pseudo-animation_t01: Pass, RuntimeError # Please triage this failure
+LayoutTests/fast/css-generated-content/pseudo-animation-before-onload_t01: Pass, RuntimeError # Please triage this failure
+LayoutTests/fast/css-generated-content/pseudo-animation-display_t01: Skip # Times out. Please triage this failure
+LayoutTests/fast/css-generated-content/pseudo-element-events_t01: Skip # Times out. Please triage this failure
+LayoutTests/fast/css-generated-content/pseudo-transition-event_t01: Skip # Times out. Please triage this failure
+LayoutTests/fast/css-generated-content/pseudo-transition_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css-grid-layout/auto-content-resolution-rows_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css-grid-layout/breadth-size-resolution-grid_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css-grid-layout/calc-resolution-grid-item_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css-grid-layout/display-grid-set-get_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css-grid-layout/flex-and-minmax-content-resolution-rows_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css-grid-layout/flex-content-resolution-columns_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css-grid-layout/flex-content-resolution-rows_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css-grid-layout/grid-auto-columns-rows-get-set_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css-grid-layout/grid-auto-flow-get-set_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css-grid-layout/grid-auto-flow-update_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css-grid-layout/grid-container-change-explicit-grid-recompute-child_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css-grid-layout/grid-element-border-grid-item_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css-grid-layout/grid-element-border-padding-grid-item_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css-grid-layout/grid-element-empty-row-column_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css-grid-layout/grid-element-min-max-height_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css-grid-layout/grid-element-padding-grid-item_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css-grid-layout/grid-element-padding-margin_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css-grid-layout/grid-element-shrink-to-fit_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css-grid-layout/grid-item-area-get-set_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css-grid-layout/grid-item-bad-named-area-auto-placement_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css-grid-layout/grid-item-bad-resolution-double-span_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css-grid-layout/grid-item-change-order-auto-flow_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css-grid-layout/grid-item-display_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css-grid-layout/grid-item-margin-auto-columns-rows-horiz-bt_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css-grid-layout/grid-item-margin-auto-columns-rows-vert-lr_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css-grid-layout/grid-item-margin-auto-columns-rows-vert-rl_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css-grid-layout/grid-item-margin-auto-columns-rows_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css-grid-layout/grid-item-margin-resolution_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css-grid-layout/grid-item-order-auto-flow-resolution_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css-grid-layout/grid-template-areas-get-set_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css-grid-layout/implicit-rows-auto-resolution_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css-grid-layout/justify-self-cell_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css-grid-layout/minmax-fixed-logical-height-only_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css-grid-layout/minmax-fixed-logical-width-only_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css-grid-layout/percent-grid-item-in-percent-grid-track-in-percent-grid_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css-grid-layout/percent-grid-item-in-percent-grid-track-update_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css-grid-layout/percent-grid-item-in-percent-grid-track_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css-grid-layout/percent-padding-margin-resolution-grid-item-update_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css-grid-layout/percent-padding-margin-resolution-grid-item_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css-grid-layout/percent-resolution-grid-item_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css-grid-layout/place-cell-by-index_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css-intrinsic-dimensions/css-tables_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css-intrinsic-dimensions/height-property-value_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css-intrinsic-dimensions/intrinsic-sized-absolutes_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css-intrinsic-dimensions/intrinsic-sized-blocks_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css-intrinsic-dimensions/intrinsic-sized-replaced-absolutes_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css-intrinsic-dimensions/multicol_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css-intrinsic-dimensions/tables_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css-intrinsic-dimensions/width-property-value_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css-intrinsic-dimensions/width-shrinks-avoid-floats_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css/MarqueeLayoutTest_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css/add-remove-stylesheets-at-once-minimal-recalc-style_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css/aspect-ratio-inheritance_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css/aspect-ratio-parsing-tests_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css/auto-min-size_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css/background-clip-text_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css/background-parser-crash_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css/background-position-serialize_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css/background-serialize_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css/border-image-null-image-crash_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css/border-image-style-length_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css/border-radius-property-value_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css/border-shorthand-initialize-longhands_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css/border-start-end_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css/border-width-large_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css/box-sizing-backwards-compat-prefix_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css/checked-pseudo-selector_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css/child-selector-implicit-tbody_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css/computed-offset-with-zoom_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css/content-language-case-insensitivity_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css/content-language-dynamically-added_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css/content-language-dynamically-removed_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css/content-language-mapped-to-webkit-locale_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css/content-language-multiple_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css/content-language-no-content_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css/content/content-none_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css/content/content-normal_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css/content/content-quotes-06_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css/counters/complex-before_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css/counters/counter-cssText_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css/counters/counter-reset-subtree-insert-crash_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css/css-escaped-identifier_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css/css-keyframe-style-crash_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css/css-keyframe-unexpected-end_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css/css-properties-case-insensitive_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css/css-selector-text_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css/css3-nth-tokens-style_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css/cssText-shorthand_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css/csstext-of-content-string_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css/cursor-parsing-image-set_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css/cursor-parsing-quirks_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css/cursor-parsing_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css/deprecated-flex-box-zero-width-intrinsic-max-width_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css/deprecated-flexbox-auto-min-size_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css/draggable-region-parser_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css/dynamic-class-backdrop-pseudo_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css/dynamic-class-pseudo-elements_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css/ex-unit-with-no-x-height_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css/first-child-display-change-inverse_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css/focus-display-block-inline_t01: Pass, RuntimeError # Please triage this failure
+LayoutTests/fast/css/font-face-insert-link_t01: Pass, RuntimeError # Please triage this failure
+LayoutTests/fast/css/font-face-multiple-ranges-for-unicode-range_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css/font-face-unicode-range-load_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css/font-face-unicode-range-monospace_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css/font-face-unicode-range-overlap-load_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css/font-face-used-after-retired_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css/font-family-trailing-bracket-gunk_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css/font-property-priority_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css/font-shorthand-from-longhands_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css/font-shorthand-mix-inherit_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css/fontface-properties_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css/fontfaceset-download-error_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css/fontfaceset-events_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css/fontfaceset-loadingdone_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css/getComputedStyle/computed-style-border-image_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css/getComputedStyle/computed-style-cross-fade_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css/getComputedStyle/computed-style-font_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css/getComputedStyle/computed-style-properties_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css/getComputedStyle/counterIncrement-without-counter_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css/getComputedStyle/font-family-fallback-reset_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css/getComputedStyle/getComputedStyle-border-image-slice_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css/getComputedStyle/getComputedStyle-border-radius-shorthand_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css/getComputedStyle/getComputedStyle-border-style-shorthand_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css/getComputedStyle/getComputedStyle-borderRadius-2_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css/getComputedStyle/getComputedStyle-column-rule_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css/getComputedStyle/getComputedStyle-length-unit_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css/getComputedStyle/getComputedStyle-zIndex-auto_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css/getComputedStyle/getComputedStyle-zoom-and-background-size_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css/getPropertyValue-border_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css/getPropertyValue-clip_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css/getPropertyValue-column-rule_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css/getPropertyValue-columns_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css/getPropertyValue-webkit-margin-collapse_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css/getPropertyValue-webkit-text-stroke_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css/html-attr-case-sensitivity_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css/id-or-class-before-stylesheet_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css/image-set-setting_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css/important-js-override_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css/inherit-initial-shorthand-values_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css/inherited-properties-rare-text_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css/insertRule-font-face_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css/insertRule-media_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css/invalid-import-rule-insertion_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css/invalid-predefined-color_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css/invalidation/clears-invalidation-whole-tree_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css/invalidation/detach-reattach-shadow_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css/invalidation/detach-reattach_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css/invalidation/dynamic-selector-list-pseudo_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css/invalidation/invalidation-set-with-adjacent-combinators_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css/invalidation/shadow-host-toggle_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css/invalidation/targeted-class-any-pseudo_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css/invalidation/targeted-class-host-pseudo_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css/invalidation/targeted-class-id_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css/invalidation/targeted-class-shadow-combinator_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css/invalidation/targeted-class-type-selectors_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css/invalidation/toggle-style-inside-shadow-root_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css/legacy-opacity-styles_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css/link-alternate-stylesheet-1_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css/link-alternate-stylesheet-2_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css/link-alternate-stylesheet-3_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css/link-alternate-stylesheet-4_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css/link-alternate-stylesheet-5_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css/link-disabled-attr-parser_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css/list-item-text-align_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css/margin-start-end_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css/media-query-recovery_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css/modify-ua-rules-from-javascript_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css/nested-at-rules_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css/overflow-property_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css/padding-start-end_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css/parse-color-int-or-percent-crash_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css/parsing-at-rule-recovery_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css/parsing-css-allowed-string-characters_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css/parsing-css-escapes_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css/parsing-css-nonascii_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css/parsing-css-nth-child_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css/parsing-object-fit_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css/parsing-object-position_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css/parsing-page-rule_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css/parsing-selector-error-recovery_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css/parsing-unexpected-eof_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css/parsing-webkit-font-smoothing_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css/position-absolute-float_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css/pseudo-any_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css/pseudo-invalid-001_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css/pseudo-invalid-novalidate-001_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css/pseudo-required-optional-004_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css/pseudo-required-optional-006_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css/pseudo-required-optional-unapplied_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css/pseudo-target-indirect-sibling-001_t01: Skip # Times out. Please triage this failure
+LayoutTests/fast/css/pseudo-target-indirect-sibling-002_t01: Skip # Times out. Please triage this failure
+LayoutTests/fast/css/pseudo-valid-dynamic_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css/pseudo-valid-unapplied_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css/pseudostyle-anonymous-text_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css/readonly-pseudoclass-opera-001_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css/readonly-pseudoclass-opera-002_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css/readonly-pseudoclass-opera-003_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css/readonly-pseudoclass-opera-004_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css/readonly-pseudoclass-opera-005_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css/readwrite-contenteditable-recalc_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css/recalc-optgroup-inherit_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css/relative-positioned-block-crash_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css/remove-attribute-style_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css/remove-class-name_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css/selector-text-escape_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css/shorthand-setProperty-important_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css/sibling-selectors_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css/string-quote-binary_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css/style-element-process-crash_t01: Skip # Times out. Please triage this failure
+LayoutTests/fast/css/style-scoped/style-scoped-in-shadow_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css/style-scoped/style-scoped-nested_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css/style-scoped/style-scoped-scoping-nodes-different-order_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css/style-scoped/style-scoped-shadow-crash_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css/style-scoped/style-scoped-with-important-rule_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css/text-align-webkit-match-parent-parse_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css/text-align-webkit-match-parent_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css/transform-origin-parsing_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css/unicode-bidi-computed-value_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css/url-with-multi-byte-unicode-escape_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css/vertical-align-length-copy-bug_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css/webkit-color-adjust_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css/webkit-keyframes-crash_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css/webkit-keyframes-errors_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css/word-break-user-modify-allowed-values_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css/zoom-property-parsing_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css3-text/css3-text-decoration/getComputedStyle/getComputedStyle-text-decoration-color_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css3-text/css3-text-decoration/getComputedStyle/getComputedStyle-text-decoration-line_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css3-text/css3-text-decoration/getComputedStyle/getComputedStyle-text-decoration-style_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css3-text/css3-text-decoration/getComputedStyle/getComputedStyle-text-underline-position_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css3-text/css3-text-indent/getComputedStyle/getComputedStyle-text-indent-inherited_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css3-text/css3-text-indent/getComputedStyle/getComputedStyle-text-indent_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css3-text/css3-text-justify/getComputedStyle/getComputedStyle-text-justify_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/52776_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/DOMException/dispatch-event-exception_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/DOMImplementation/createDocument-namespace-err_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/Document/CaretRangeFromPoint/basic_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/Document/CaretRangeFromPoint/caretRangeFromPoint-in-strict-mode-wtih-checkbox_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/Document/CaretRangeFromPoint/caretRangeFromPoint-in-user-select-none_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/Document/CaretRangeFromPoint/caretRangeFromPoint-in-zoom-and-scroll_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/Document/CaretRangeFromPoint/caretRangeFromPoint-with-first-letter-style_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/Document/CaretRangeFromPoint/hittest-relative-to-viewport_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/Document/CaretRangeFromPoint/replace-element_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/Document/createElement-valid-names_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/Document/createElementNS-namespace-err_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/Document/document-title-get_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/Element/attribute-uppercase_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/Element/fixed-position-offset-parent_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/Element/getBoundingClientRect-getClientRects-relative-to-viewport_t01: Pass, RuntimeError # Please triage this failure
+LayoutTests/fast/dom/Element/getClientRects_t01: Pass, RuntimeError # Please triage this failure
+LayoutTests/fast/dom/Element/id-in-insert-hr_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/Element/offsetTop-table-cell_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/Element/scrollWidth_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/Element/setAttributeNS-namespace-err_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/HTMLAnchorElement/remove-href-from-focused-anchor_t01: Skip # Times out. Please triage this failure
+LayoutTests/fast/dom/HTMLAnchorElement/set-href-attribute-hash_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/HTMLAnchorElement/set-href-attribute-host_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/HTMLAnchorElement/set-href-attribute-hostname_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/HTMLAnchorElement/set-href-attribute-pathname_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/HTMLAnchorElement/set-href-attribute-port_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/HTMLAnchorElement/set-href-attribute-protocol_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/HTMLAnchorElement/set-href-attribute-search_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/HTMLBaseElement/href-attribute-resolves-with-respect-to-document_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/HTMLButtonElement/change-type_t01: Pass, RuntimeError # Please triage this failure
+LayoutTests/fast/dom/HTMLDialogElement/dialog-autofocus_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/HTMLDialogElement/dialog-close-event_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/HTMLDialogElement/dialog-enabled_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/HTMLDialogElement/dialog-open_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/HTMLDialogElement/dialog-return-value_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/HTMLDialogElement/dialog-scrolled-viewport_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/HTMLDialogElement/dialog-show-modal_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/HTMLDialogElement/inert-does-not-match-disabled-selector_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/HTMLDialogElement/inert-node-is-unfocusable_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/HTMLDialogElement/inert-node-is-unselectable_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/HTMLDialogElement/multiple-centered-dialogs_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/HTMLDialogElement/non-anchored-dialog-positioning_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/HTMLDialogElement/show-modal-focusing-steps_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/HTMLDialogElement/submit-dialog-close-event_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/HTMLDialogElement/synthetic-click-inert_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/HTMLDialogElement/top-layer-position-relative_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/HTMLDialogElement/top-layer-position-static_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/HTMLDocument/active-element-gets-unforcusable_t01: Skip # Times out. Please triage this failure
+LayoutTests/fast/dom/HTMLDocument/set-focus-on-valid-element_t01: Skip # Times out. Please triage this failure
+LayoutTests/fast/dom/HTMLElement/attr-dir-auto-change-before-text-node_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/HTMLElement/attr-dir-auto-change-child-node_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/HTMLElement/attr-dir-auto-change-text-form-control_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/HTMLElement/attr-dir-auto-change-text_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/HTMLElement/attr-dir-auto-children_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/HTMLElement/attr-dir-auto-remove-add-children_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/HTMLElement/attr-dir-auto-text-form-control-child_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/HTMLElement/attr-dir-auto-text-form-control_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/HTMLElement/attr-dir-auto_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/HTMLElement/attr-dir-value-change_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/HTMLElement/attr-empty-string_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/HTMLElement/attr-false-string_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/HTMLElement/attr-invalid-string_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/HTMLElement/attr-missing-ancestor-false_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/HTMLElement/attr-missing-ancestor-true_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/HTMLElement/attr-missing-parent-ancestor-missing_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/HTMLElement/attr-missing-parent-false_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/HTMLElement/attr-missing-parent-true_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/HTMLElement/attr-true-string_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/HTMLElement/set-false_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/HTMLElement/set-inherit-parent-false_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/HTMLElement/set-inherit-parent-true_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/HTMLElement/set-inner-outer-optimization_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/HTMLElement/set-invalid-value_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/HTMLElement/set-true_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/HTMLElement/set-value-caseinsensitive_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/HTMLElement/spellcheck_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/HTMLElement/translate_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/HTMLFormElement/move-option-between-documents_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/HTMLImageElement/image-alt-text_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/HTMLImageElement/image-natural-width-height_t01: Pass, RuntimeError # Please triage this failure
+LayoutTests/fast/dom/HTMLImageElement/parse-src_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/HTMLInputElement/input-hidden-value_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/HTMLInputElement/input-image-alt-text_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/HTMLLabelElement/click-label_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/HTMLLinkElement/link-and-subresource-test_t01: Skip # Times out. Please triage this failure
+LayoutTests/fast/dom/HTMLLinkElement/link-beforeload-recursive_t01: Skip # Times out. Please triage this failure
+LayoutTests/fast/dom/HTMLLinkElement/link-onerror-stylesheet-with-existent-and-non-existent-import_t01: Pass, RuntimeError # Please triage this failure
+LayoutTests/fast/dom/HTMLLinkElement/prefetch-onerror_t01: Skip # Times out. Please triage this failure
+LayoutTests/fast/dom/HTMLLinkElement/prefetch-onload_t01: Skip # Times out. Please triage this failure
+LayoutTests/fast/dom/HTMLLinkElement/prefetch_t01: Skip # Times out. Please triage this failure
+LayoutTests/fast/dom/HTMLLinkElement/resolve-url-on-insertion_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/HTMLMeterElement/set-meter-properties_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/HTMLObjectElement/beforeload-set-text-crash_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/HTMLObjectElement/form/test1_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/HTMLObjectElement/set-type-to-null-crash_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/HTMLOptionElement/collection-setter-getter_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/HTMLOutputElement/dom-settable-token-list_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/HTMLOutputElement/htmloutputelement-validity_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/HTMLProgressElement/set-progress-properties_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/HTMLScriptElement/async-false-inside-async-false-load_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/HTMLScriptElement/async-inline-script_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/HTMLScriptElement/async-onbeforeload_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/HTMLScriptElement/defer-inline-script_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/HTMLScriptElement/defer-onbeforeload_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/HTMLScriptElement/remove-in-beforeload_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/HTMLScriptElement/remove-source_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/HTMLScriptElement/script-set-src_t01: Pass, RuntimeError # Please triage this failure
+LayoutTests/fast/dom/HTMLSelectElement/change-multiple-preserve-selection_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/HTMLStyleElement/style-onerror-with-existent-and-non-existent-import_t01: Pass, RuntimeError # Please triage this failure
+LayoutTests/fast/dom/HTMLTableElement/cellpadding-attribute_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/HTMLTemplateElement/custom-element-wrapper-gc_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/HTMLTemplateElement/cycles-in-shadow_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/HTMLTemplateElement/innerHTML_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/HTMLTemplateElement/ownerDocumentXHTML_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/HTMLTemplateElement/xhtml-parsing-and-serialization_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/MutationObserver/added-out-of-order_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/MutationObserver/database-callback-delivery_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/MutationObserver/observe-attributes_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/MutationObserver/observe-childList_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/MutationObserver/observe-options-attributes_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/MutationObserver/observe-options-character-data_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/MutationObserver/removed-out-of-order_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/MutationObserver/weak-callback-gc-crash_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/Node/fragment-mutation_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/Node/initial-values_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/NodeIterator/NodeIterator-basic_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/NodeList/nodelist-reachable_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/Range/13000_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/Range/bug-19527_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/Range/getClientRects-character_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/Range/insertNode-empty-fragment-crash_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/Range/mutation_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/Range/range-constructor_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/Range/range-created-during-remove-children_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/Range/range-detached-exceptions_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/Range/range-expand_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/Range/range-insertNode-assertion_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/Range/range-insertNode-separate-endContainer_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/Range/range-insertNode-splittext_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/SelectorAPI/caseTagX_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/SelectorAPI/dumpNodeList-2_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/SelectorAPI/dumpNodeList-almost-strict_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/SelectorAPI/dumpNodeList_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/StyleSheet/css-insert-import-rule-to-shadow-stylesheets_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/StyleSheet/css-medialist-item_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/StyleSheet/detached-parent-rule-without-wrapper_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/StyleSheet/detached-shadow-style_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/StyleSheet/detached-stylesheet-without-wrapper_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/StyleSheet/discarded-sheet-owner-null_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/StyleSheet/empty-shadow-style_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/StyleSheet/removed-media-rule-deleted-parent-crash_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/StyleSheet/removed-stylesheet-rule-deleted-parent-crash_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/TreeWalker/TreeWalker-basic_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/Window/getMatchedCSSRules-nested-rules_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/Window/getMatchedCSSRules-null-crash_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/Window/getMatchedCSSRules-parent-stylesheets_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/Window/getMatchedCSSRules-with-invalid-pseudo-elements_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/Window/getMatchedCSSRules-with-pseudo-elements-complex_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/Window/getMatchedCSSRules-with-pseudo-elements_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/Window/window-resize-contents_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/Window/window-resize_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/Window/window-screen-properties_t01: Pass, RuntimeError # Please triage this failure
+LayoutTests/fast/dom/XMLSerializer-attribute-entities_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/anchor-origin_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/anchor-without-content_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/attribute-namespaces-get-set_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/background-shorthand-csstext_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/blur-contenteditable_t01: Pass, RuntimeError # Please triage this failure
+LayoutTests/fast/dom/boolean-attribute-reflection_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/characterdata-api-arguments_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/click-method-on-html-element_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/client-width-height-quirks_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/computed-style-set-property_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/containerNode_t01: Skip # Times out. Please triage this failure
+LayoutTests/fast/dom/css-cached-import-rule_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/css-delete-doc_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/css-innerHTML_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/css-mediarule-functions_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/css-rule-functions_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/css-selectorText_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/css-shortHands_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/css-shorthand-common-value_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/cssTarget-crash_t01: Pass, RuntimeError # Please triage this failure
+LayoutTests/fast/dom/custom/attribute-changed-callback_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/custom/constructor-calls-created-synchronously_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/custom/created-callback_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/custom/document-register-basic_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/custom/document-register-namespace_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/custom/document-register-on-create-callback_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/custom/document-register-svg-extends_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/custom/document-register-type-extensions_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/custom/element-names_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/custom/element-type_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/custom/element-upgrade_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/custom/invalid-type-extension-crash_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/custom/lifecycle-created-createElement-recursion_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/custom/type-extensions_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/custom/unresolved-pseudoclass_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/custom/upgrade-candidate-remove-crash_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/dataset-xhtml_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/dataset_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/delete-contents_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/document-importNode-arguments_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/dom-parse-serialize-display_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/dom-parse-serialize-xmldecl_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/dom-parse-serialize_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/domparser-parsefromstring-mimetype-support_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/empty-hash-and-search_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/focus-contenteditable_t01: Pass, RuntimeError # Please triage this failure
+LayoutTests/fast/dom/fragment-activation-focuses-target_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/getElementsByClassName/010_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/getElementsByClassName/011_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/getElementsByClassName/dumpNodeList_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/getelementsbyname-invalidation-cache_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/horizontal-scrollbar-in-rtl-doesnt-fire-onscroll_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/horizontal-scrollbar-in-rtl_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/horizontal-scrollbar-when-dir-change_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/implementation-createHTMLDocument_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/importNode-unsupported-node-type_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/insert-span-into-long-text-bug-28245_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/insertBefore-refChild-crash_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/javascript-backslash_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/length-attribute-mapping_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/location-hash_t01: Skip # Times out. Please triage this failure
+LayoutTests/fast/dom/navigator-userAgent_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/navigatorcontentutils/is-protocol-handler-registered_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/navigatorcontentutils/register-protocol-handler_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/navigatorcontentutils/unregister-protocol-handler_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/object-plugin-hides-properties_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/offset-position-writing-modes_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/option-properties_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/partial-layout-non-overlay-scrollbars_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/partial-layout-overlay-scrollbars_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/remove-body-during-body-replacement_t01: Skip # Times out. Please triage this failure
+LayoutTests/fast/dom/set-innerHTML_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/shadow/access-document-of-detached-stylesheetlist-crash_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/shadow/base-in-shadow-tree_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/shadow/content-element-crash_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/shadow/content-element-includer_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/shadow/content-element-outside-shadow-style_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/shadow/content-pseudo-element-css-text_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/shadow/content-pseudo-element-dynamic-attribute-change_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/shadow/content-pseudo-element-overridden_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/shadow/content-pseudo-element-relative-selector-css-text_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/shadow/content-pseudo-element-with-host-pseudo-class_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/shadow/content-reprojection-fallback-crash_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/shadow/custom-pseudo-in-selector-api_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/shadow/distribution-crash_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/shadow/distribution-for-event-path_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/shadow/distribution-update-recalcs-style_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/shadow/elementfrompoint_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/shadow/event-path-not-in-document_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/shadow/event-path_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/shadow/form-in-shadow_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/shadow/get-distributed-nodes-orphan_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/shadow/get-element-by-id-in-shadow-mutation_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/shadow/getComputedStyle-composed-parent-dirty_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/shadow/getelementbyid-in-orphan_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/shadow/getelementbyid-shadow_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/shadow/host-context-pseudo-class-css-text_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/shadow/host-pseudo-class-css-text_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/shadow/host-wrapper-reclaimed_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/shadow/insertion-point-list-menu-crash_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/shadow/insertion-point-shadow-crash_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/shadow/insertion-point-video-crash_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/shadow/link-in-shadow-tree_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/shadow/nested-reprojection-inconsistent_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/shadow/no-renderers-for-light-children_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/shadow/offsetWidth-host-style-change_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/shadow/olderShadowRoot_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/shadow/pseudoclass-update-checked-option_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/shadow/pseudoclass-update-disabled-optgroup_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/shadow/pseudoclass-update-disabled-option_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/shadow/pseudoclass-update-enabled-optgroup_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/shadow/pseudoclass-update-enabled-option_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/shadow/reinsert-insertion-point_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/shadow/remove-and-insert-style_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/shadow/remove-styles-in-shadow-crash-2_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/shadow/remove-styles-in-shadow-crash_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/shadow/shadow-aware-shadow-root_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/shadow/shadow-content-crash_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/shadow/shadow-disable_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/shadow/shadow-element-inactive_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/shadow/shadow-hierarchy-exception_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/shadow/shadow-removechild-and-blur-event_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/shadow/shadow-root-append_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/shadow/shadow-root-js-api_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/shadow/shadow-root-node-list_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/shadow/shadow-root-text-child_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/shadow/shadow-ul-li_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/shadow/shadowdom-dynamic-styling_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/shadow/shadowdom-for-input-spellcheck_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/shadow/shadowdom-for-input-type-change_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/shadow/shadowdom-for-unknown-with-form_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/shadow/shadowhost-keyframes_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/shadow/shadowroot-clonenode_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/shadow/shadowroot-host_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/shadow/shadowroot-keyframes_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/shadow/sibling-rules-dynamic-changes_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/shadow/stale-distribution-after-shadow-removal_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/shadow/style-insertion-crash_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/shadow/style-of-distributed-node_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/shadow/style-sharing-sibling-shadow_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/shadow/style-sharing-styles-in-older-shadow-roots_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/shadow/suppress-mutation-events-in-shadow-characterdata_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/shadow/title-element-in-shadow_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/subtree-modified-attributes_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/text-control-crash-on-select_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/vertical-scrollbar-when-dir-change_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dynamic/checkbox-selection-crash_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dynamic/crash-generated-counter_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dynamic/crash-generated-image_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dynamic/crash-generated-quote_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dynamic/crash-generated-text_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dynamic/insertAdjacentElement_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dynamic/insertAdjacentHTML-allowed-parents_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dynamic/recursive-layout_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/events/add-event-without-document_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/events/change-overflow-on-overflow-change_t01: Skip # Times out. Please triage this failure
+LayoutTests/fast/events/clipboard-clearData_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/events/clipboard-dataTransferItemList-remove_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/events/clipboard-dataTransferItemList_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/events/div-focus_t01: Pass, RuntimeError # Please triage this failure
+LayoutTests/fast/events/document-elementFromPoint_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/events/event-attributes-after-exception_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/events/event-creation_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/events/event-fire-order_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/events/event-listener-html-non-html-confusion_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/events/event-trace_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/events/fire-scroll-event_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/events/form-onchange_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: Pass, 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: Pass, RuntimeError # Please triage this failure
+LayoutTests/fast/events/mutation-during-replace-child-2_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/events/mutation-during-replace-child_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/events/nested-event-remove-node-crash_t01: Skip # Times out. Please triage this failure
+LayoutTests/fast/events/overflowchanged-event-raf-timing_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/events/scoped/editing-commands_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/events/scroll-event-does-not-bubble_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/events/selectstart-on-selectall_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/events/selectstart-prevent-selectall_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/events/tabindex-removal-from-focused-element_t01: Pass, RuntimeError # Please triage this failure
+LayoutTests/fast/events/wheelevent-constructor_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/eventsource/eventsource-constructor_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/exclusions/parsing/parsing-wrap-flow_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/exclusions/parsing/parsing-wrap-through_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/files/blob-close-read_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/files/blob-close-revoke_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/files/blob-close_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/files/blob-constructor_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/files/blob-parts-slice-test_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/files/blob-slice-test_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/files/file-reader-immediate-abort_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/files/file-reader-methods-illegal-arguments_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/files/url-null_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/files/xhr-response-blob_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/filesystem/async-operations_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/filesystem/directory-entry-to-uri_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/filesystem/file-after-reload-crash_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/filesystem/file-entry-to-uri_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/filesystem/file-from-file-entry_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/filesystem/file-metadata-after-write_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/filesystem/file-writer-abort-continue_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/filesystem/file-writer-abort-depth_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/filesystem/file-writer-abort_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/filesystem/file-writer-empty-blob_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/filesystem/file-writer-events_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/filesystem/file-writer-gc-blob_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/filesystem/file-writer-truncate-extend_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/filesystem/file-writer-write-overlapped_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/filesystem/filesystem-reference_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/filesystem/filesystem-unserializable_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/filesystem/filesystem-uri-origin_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/filesystem/input-access-entries_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/filesystem/op-copy_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/filesystem/op-get-entry_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/filesystem/op-get-metadata_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/filesystem/op-get-parent_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/filesystem/op-move_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/filesystem/op-read-directory_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/filesystem/op-remove_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/filesystem/op-restricted-chars_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/filesystem/op-restricted-names_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/filesystem/op-restricted-unicode_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/filesystem/read-directory-many_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/filesystem/read-directory_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/filesystem/simple-readonly-file-object_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/filesystem/simple-readonly_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/filesystem/simple-required-arguments-getdirectory_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/filesystem/simple-required-arguments-getfile_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/filesystem/simple-temporary_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/filesystem/snapshot-file-with-gc_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/flexbox/box-orient-button_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/flexbox/box-size-integer-overflow_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/flexbox/flexing-overflow-scroll-item_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/flexbox/repaint-scrollbar_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/forms/11423_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/forms/4628409_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/forms/8250_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/forms/ValidityState-customError_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/forms/ValidityState-patternMismatch_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/forms/ValidityState-tooLong-input_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/forms/ValidityState-tooLong-textarea_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/forms/ValidityState-typeMismatch-email_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/forms/ValidityState-typeMismatch-url_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/forms/ValidityState-valueMissing-001_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/forms/ValidityState-valueMissing-003_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/forms/autocomplete_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/forms/autofocus-focus-only-once_t01: Skip # Times out. Please triage this failure
+LayoutTests/fast/forms/autofocus-input-css-style-change_t01: Skip # Times out. Please triage this failure
+LayoutTests/fast/forms/autofocus-opera-004_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/forms/autofocus-opera-005_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/forms/autofocus-opera-007_t01: Skip # Times out. Please triage this failure
+LayoutTests/fast/forms/autofocus-readonly-attribute_t01: Skip # Times out. Please triage this failure
+LayoutTests/fast/forms/button/button-disabled-blur_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/forms/button-baseline-and-collapsing_t01: Pass, RuntimeError # Please triage this failure
+LayoutTests/fast/forms/checkValidity-001_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/forms/checkValidity-002_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/forms/checkValidity-004_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/forms/checkValidity-handler-updates-dom_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/forms/clone-input-with-dirty-value_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/forms/datalist/datalist-child-validation_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/forms/datalist/datalist_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/forms/datalist/input-list_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/forms/date-multiple-fields/date-multiple-fields-change-layout-by-value_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/forms/date-multiple-fields/date-multiple-fields-onblur-setvalue-onfocusremoved_t01: Pass, RuntimeError # Please triage this failure
+LayoutTests/fast/forms/date/ValidityState-rangeOverflow-date_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/forms/date/ValidityState-rangeUnderflow-date_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/forms/date/ValidityState-stepMismatch-date_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/forms/date/ValidityState-typeMismatch-date_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/forms/date/date-input-type_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/forms/date/date-pseudo-classes_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/forms/date/input-date-validation-message_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/forms/date/input-valueasdate-date_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/forms/date/input-valueasnumber-date_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/forms/datetimelocal-multiple-fields/datetimelocal-multiple-fields-change-layout-by-value_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/forms/datetimelocal/ValidityState-rangeOverflow-datetimelocal_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/forms/datetimelocal/ValidityState-rangeUnderflow-datetimelocal_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/forms/datetimelocal/ValidityState-stepMismatch-datetimelocal_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/forms/datetimelocal/ValidityState-typeMismatch-datetimelocal_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/forms/datetimelocal/datetimelocal-input-type_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/forms/datetimelocal/datetimelocal-interactive-validation-required_t01: Pass, RuntimeError # Please triage this failure
+LayoutTests/fast/forms/datetimelocal/datetimelocal-pseudo-classes_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/forms/datetimelocal/input-valueasdate-datetimelocal_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/forms/datetimelocal/input-valueasnumber-datetimelocal_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/forms/delete-text-with-invisible-br_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/forms/fieldset/fieldset-disabled_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/forms/fieldset/fieldset-elements_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/forms/file/file-input-capture_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/forms/focus-style-pending_t01: Skip # Times out. Please triage this failure
+LayoutTests/fast/forms/focus_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/forms/form-attribute_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/forms/form-dirname-attribute_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/forms/formmethod-attribute-input-2_t01: Pass, RuntimeError # Please triage this failure
+LayoutTests/fast/forms/incremental-dom-property_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/forms/input-appearance-elementFromPoint_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/forms/input-appearance-maxlength_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/forms/input-changing-value_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/forms/input-file-set-value_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/forms/input-implicit-length-limit_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/forms/input-inputmode_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/forms/input-maxlength-unsupported_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/forms/input-maxlength_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/forms/input-setvalue-selection_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/forms/input-text-paste-maxlength_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/forms/input-value-sanitization_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/forms/input-width-height-attributes_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/forms/input-widths_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/forms/listbox-select-all_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/forms/listbox-selection-2_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/forms/menulist-disabled-selected-option_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/forms/menulist-selection-reset_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/forms/menulist-submit-without-selection_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/forms/min-content-form-controls_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/forms/multiple-selected-options-innerHTML_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/forms/onchange-change-type_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/forms/option-change-single-selected_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/forms/option-strip-unicode-spaces_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/forms/parser-associated-form-removal_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/forms/paste-into-textarea_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/forms/paste-multiline-text-input_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/forms/plaintext-mode-1_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/forms/search-popup-crasher_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/forms/select-change-popup-to-listbox-in-event-handler_t01: Skip # Times out. Please triage this failure
+LayoutTests/fast/forms/select-change-popup-to-listbox-roundtrip_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/forms/select-clientheight-large-size_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/forms/select-clientheight-with-multiple-attr_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/forms/select-list-box-mouse-focus_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/forms/select-max-length_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/forms/select-namedItem_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/forms/selection-direction_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/forms/selection-wrongtype_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/forms/setCustomValidity-existence_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/forms/setrangetext_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/forms/shadow-tree-exposure_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/forms/submit-nil-value-field-assert_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/forms/text-control-select-blurred_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/forms/textarea-maxlength_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/forms/textarea-no-scroll-on-blur_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/forms/textarea-paste-newline_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/forms/textarea-rows-cols_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/forms/textarea-set-defaultvalue-after-value_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/forms/textarea-submit-crash_t01: Pass, RuntimeError # Please triage this failure
+LayoutTests/fast/forms/textarea-trailing-newline_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/forms/textfield-clone_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/forms/textfield-focus-out_t01: Skip # Times out. Please triage this failure
+LayoutTests/fast/forms/validationMessage_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/forms/validity-property_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/forms/willvalidate_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/html/article-element_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/html/aside-element_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/html/details-add-child-1_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/html/details-add-child-2_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/html/details-add-details-child-1_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/html/details-add-details-child-2_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/html/details-click-controls_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/html/details-mouse-click_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/html/figcaption-element_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/html/figure-element_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/html/footer-element_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/html/header-element_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/html/hgroup-element_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/html/hidden-attr_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/html/imports/import-element-removed-flag_t01: Skip # Times out. Please triage this failure
+LayoutTests/fast/html/imports/import-events_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/html/main-element_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/html/mark-element_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/html/section-element_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/html/select-dropdown-consistent-background-color_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/inline/boundingBox-with-continuation_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/inline/inline-position-top-align_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/inline/inline-relative-offset-boundingbox_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/inline/inline-with-empty-inline-children_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/inline/out-of-flow-objects-and-whitespace-after-empty-inline_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/inline/parent-inline-element-padding-contributes-width_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/inline/positioned-element-padding-contributes-width_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/innerHTML/innerHTML-uri-resolution_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/innerHTML/javascript-url_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/lists/list-style-position-inside_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/loader/about-blank-hash-change_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/loader/about-blank-hash-kept_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/loader/hashchange-event-properties_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/loader/onhashchange-attribute-listeners_t01: Skip # Times out. Please triage this failure
+LayoutTests/fast/loader/scroll-position-restored-on-back_t01: Skip # Times out. Please triage this failure
+LayoutTests/fast/loader/scroll-position-restored-on-reload-at-load-event_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/masking/parsing-clip-path-iri_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/masking/parsing-clip-path-shape_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/masking/parsing-mask-source-type_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/masking/parsing-mask_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/media/color-does-not-include-alpha_t01: Pass, RuntimeError # Please triage this failure
+LayoutTests/fast/media/invalid-lengths_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/media/matchmedium-query-api_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/media/media-query-list-syntax_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/media/media-query-serialization_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/media/mq-append-delete_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/mediastream/RTCPeerConnection-AddRemoveStream_t01: Skip # Times out. Please triage this failure
+LayoutTests/fast/mediastream/RTCPeerConnection_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/multicol/balance-short-trailing-empty-block_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/multicol/balance-trailing-border_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/multicol/balance-trailing-border_t02: RuntimeError # Please triage this failure
+LayoutTests/fast/multicol/balance-unbreakable_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/multicol/break-after-always-bottom-margin_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/multicol/break-properties_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/multicol/column-width-zero_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/multicol/columns-shorthand-parsing_t02: RuntimeError # Please triage this failure
+LayoutTests/fast/multicol/cssom-view_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/multicol/fixed-column-percent-logical-height-orthogonal-writing-mode_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/multicol/flipped-blocks-hit-test_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/multicol/float-truncation_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/multicol/gap-non-negative_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/multicol/hit-test-above-or-below_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/multicol/hit-test-end-of-column-with-line-height_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/multicol/hit-test-end-of-column_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/multicol/hit-test-float_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/multicol/hit-test-gap-between-pages-flipped_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/multicol/hit-test-gap-between-pages_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/multicol/image-inside-nested-blocks-with-border_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/multicol/inherit-column-values_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/multicol/initial-column-values_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/multicol/inline-getclientrects_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/multicol/newmulticol/balance-images_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/multicol/newmulticol/balance-maxheight_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/multicol/newmulticol/balance-maxheight_t02: RuntimeError # Please triage this failure
+LayoutTests/fast/multicol/newmulticol/balance_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/multicol/newmulticol/balance_t02: RuntimeError # Please triage this failure
+LayoutTests/fast/multicol/newmulticol/balance_t04: RuntimeError # Please triage this failure
+LayoutTests/fast/multicol/newmulticol/balance_t05: RuntimeError # Please triage this failure
+LayoutTests/fast/multicol/newmulticol/balance_t06: RuntimeError # Please triage this failure
+LayoutTests/fast/multicol/newmulticol/balance_t07: RuntimeError # Please triage this failure
+LayoutTests/fast/multicol/newmulticol/balance_t08: RuntimeError # Please triage this failure
+LayoutTests/fast/multicol/newmulticol/balance_t09: RuntimeError # Please triage this failure
+LayoutTests/fast/multicol/newmulticol/balance_t10: RuntimeError # Please triage this failure
+LayoutTests/fast/multicol/vertical-lr/break-properties_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/multicol/vertical-lr/float-truncation_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/multicol/vertical-lr/gap-non-negative_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/multicol/vertical-lr/image-inside-nested-blocks-with-border_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/multicol/vertical-rl/break-properties_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/multicol/vertical-rl/float-truncation_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/multicol/vertical-rl/gap-non-negative_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/multicol/vertical-rl/image-inside-nested-blocks-with-border_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/multicol/widows_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/multicol/widows_t02: RuntimeError # Please triage this failure
+LayoutTests/fast/multicol/zeroColumnCount_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/overflow/height-during-simplified-layout_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/overflow/overflow-rtl-vertical-origin_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/overflow/scrollbar-restored_t01: Pass, RuntimeError # Please triage this failure
+LayoutTests/fast/parser/block-nesting-cap_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/parser/foster-parent-adopted_t02: RuntimeError # Please triage this failure
+LayoutTests/fast/parser/fragment-parser-doctype_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/parser/innerhtml-with-prefixed-elements_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/parser/pre-first-line-break_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/parser/stray-param_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/parser/strict-img-in-map_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/replaced/container-width-zero_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/replaced/table-percent-height-text-controls_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/replaced/table-percent-height_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/replaced/table-percent-width_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/ruby/ruby-line-height_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/scrolling/scroll-element-into-view_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/selectors/specificity-overflow_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/shapes/parsing/parsing-shape-image-threshold_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/shapes/parsing/parsing-shape-lengths_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/shapes/parsing/parsing-shape-margin_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/shapes/parsing/parsing-shape-outside-none_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/shapes/parsing/parsing-shape-outside_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/shapes/parsing/parsing-shape-property-aliases_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/shapes/shape-outside-floats/shape-outside-big-box-border-radius_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/shapes/shape-outside-floats/shape-outside-floats-diamond-margin-polygon_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/shapes/shape-outside-floats/shape-outside-floats-ellipse-margin-left_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/shapes/shape-outside-floats/shape-outside-floats-ellipse-margin-right_t01: 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-floats-inset-rounded-different-writing-modes-right_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/shapes/shape-outside-floats/shape-outside-rounded-boxes_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/shapes/shape-outside-floats/shape-outside-rounded-boxes_t02: RuntimeError # Please triage this failure
+LayoutTests/fast/speechsynthesis/speech-synthesis-boundary-events_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/speechsynthesis/speech-synthesis-cancel_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/speechsynthesis/speech-synthesis-pause-resume_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/speechsynthesis/speech-synthesis-speak_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/speechsynthesis/speech-synthesis-utterance-uses-voice_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/speechsynthesis/speech-synthesis-voices_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/storage/disallowed-storage_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/storage/storage-disallowed-in-data-url_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/sub-pixel/computedstylemargin_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/sub-pixel/cssom-subpixel-precision_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/svg/tabindex-focus_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/svg/whitespace-angle_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/svg/whitespace-integer_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/svg/whitespace-length_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/svg/whitespace-number_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/table/anonymous-table-section-removed_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/table/border-changes_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/table/caption-orthogonal-writing-mode-sizing_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/table/css-table-max-width_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/table/incorrect-colgroup-span-values_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/table/large-shrink-wrapped-width_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/table/min-width-css-block-table_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/table/min-width-css-inline-table_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/table/min-width-html-block-table_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/table/min-width-html-inline-table_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/table/padding-height-and-override-height_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/table/table-cell-offset-width_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/table/table-size-integer-overflow_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/table/td-bordercolor-attribute_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/text/find-kana_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/text/find-russian_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/text/find-soft-hyphen_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/text/international/iso-8859-8_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/text/international/listbox-width-rtl_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/text/international/thai-offsetForPosition-inside-character_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/text/line-break-after-question-mark_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/text/line-breaks-after-hyphen-before-number_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/text/offsetForPosition-cluster-at-zero_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/text/pre-wrap-trailing-tab_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/text/remove-zero-length-run_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/text/selection-exceptions_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/text/sub-pixel/text-scaling-ltr_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/text/sub-pixel/text-scaling-pixel_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/text/sub-pixel/text-scaling-rtl_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/text/sub-pixel/text-scaling-vertical_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/text/sub-pixel/text-scaling-webfont_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/text/text-combine-shrink-to-fit_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/text/text-fragment-first-letter-update-crash_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/text/window-find_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/text/zero-width-characters-complex-script_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/text/zero-width-characters_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/transforms/topmost-becomes-bottomost-for-scrolling_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/transforms/transform-inside-overflow-scroll_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/url/anchor_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/url/file-http-base_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/url/file_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/url/host-lowercase-per-scheme_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/url/host_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/url/idna2003_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/url/idna2008_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/url/invalid-urls-utf8_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/url/ipv4_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/url/ipv6_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/url/mailto_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/url/path_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/url/port_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/url/query_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/url/relative-unix_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/url/relative-win_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/url/relative_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/url/segments-from-data-url_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/url/segments_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/url/standard-url_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/writing-mode/auto-sizing-orthogonal-flows_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/writing-mode/block-formatting-context_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/writing-mode/display-mutation_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/writing-mode/flipped-blocks-hit-test-overflow-scroll_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/writing-mode/flipped-blocks-hit-test-overflow_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/writing-mode/percentage-padding_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/writing-mode/positionForPoint_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/writing-mode/table-hit-test_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/writing-mode/vertical-inline-block-hittest_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/xmlhttprequest/xmlhttprequest-get_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/xmlhttprequest/xmlhttprequest-invalid-values_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/xmlhttprequest/xmlhttprequest-responseXML-invalid-xml_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/xmlhttprequest/xmlhttprequest-responseXML-xml-text-responsetype_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/xmlhttprequest/xmlhttprequest-responsetype-abort_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/xmlhttprequest/xmlhttprequest-responsetype-arraybuffer_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/xmlhttprequest/xmlhttprequest-responsetype-before-open-sync-request_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/xmlhttprequest/xmlhttprequest-responsetype-before-open_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/xpath/4XPath/Borrowed/cz_20030217_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/xpath/4XPath/Borrowed/namespace-nodes_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/xpath/4XPath/Core/test_core_functions_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/xpath/4XPath/Core/test_core_functions_t02: RuntimeError # Please triage this failure
+LayoutTests/fast/xpath/4XPath/Core/test_node_test_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/xpath/4XPath/Core/test_node_test_t02: RuntimeError # Please triage this failure
+LayoutTests/fast/xpath/ambiguous-operators_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/xpath/attr-namespace_t02: RuntimeError # Please triage this failure
+LayoutTests/fast/xpath/ensure-null-namespace_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/xpath/implicit-node-args_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/xpath/invalid-resolver_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/xpath/node-name-case-sensitivity_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/xpath/node-name-case-sensitivity_t02: RuntimeError # Please triage this failure
+LayoutTests/fast/xpath/position_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/xpath/py-dom-xpath/data_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/xpath/py-dom-xpath/expressions_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/xpath/py-dom-xpath/paths_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/xpath/reverse-axes_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/xsl/default-html_t01: RuntimeError # Please triage this failure
+LibTest/async/Stream/Stream.periodic_A01_t01: Pass, RuntimeError # Please triage this failure
+LibTest/async/Timer/Timer.periodic_A01_t01: Pass, RuntimeError # Please triage this failure
+LibTest/core/RegExp/Pattern_semantics/firstMatch_CharacterEscape_A06_t02: RuntimeError # Please triage this failure
+LibTest/core/RegExp/Pattern_semantics/firstMatch_DecimalEscape_A01_t02: RuntimeError # Please triage this failure
+LibTest/core/RegExp/Pattern_semantics/firstMatch_NonEmptyClassRanges_A01_t01: RuntimeError # Please triage this failure
+LibTest/core/RegExp/Pattern_semantics/firstMatch_NonEmptyClassRanges_A01_t05: RuntimeError # Please triage this failure
+LibTest/core/RegExp/Pattern_semantics/firstMatch_NonEmptyClassRanges_A01_t06: RuntimeError # Please triage this failure
+LibTest/core/double/roundToDouble_A01_t01: RuntimeError # Please triage this failure
+LibTest/core/double/round_A01_t01: RuntimeError # Please triage this failure
+LibTest/core/int/compareTo_A01_t01: RuntimeError # Please triage this failure
+LibTest/core/int/operator_left_shift_A01_t01: RuntimeError # Please triage this failure
+LibTest/core/int/operator_remainder_A01_t03: RuntimeError # Please triage this failure
+LibTest/core/int/operator_truncating_division_A01_t02: RuntimeError # Please triage this failure
+LibTest/core/int/remainder_A01_t01: RuntimeError # Please triage this failure
+LibTest/core/int/remainder_A01_t03: RuntimeError # Please triage this failure
+LibTest/core/int/toRadixString_A01_t01: RuntimeError # Please triage this failure
+LibTest/html/CanvasRenderingContext2D/addEventListener_A01_t03: RuntimeError # Please triage this failure
+LibTest/html/CanvasRenderingContext2D/addEventListener_A01_t06: RuntimeError # Please triage this failure
+LibTest/html/Document/childNodes_A01_t01: RuntimeError # Please triage this failure
+LibTest/html/Document/clone_A01_t01: RuntimeError # Please triage this failure
+LibTest/html/Document/clone_A01_t02: RuntimeError # Please triage this failure
+LibTest/html/Document/securityPolicy_A01_t01: RuntimeError # Please triage this failure
+LibTest/html/Element/Element.tag_A01_t01: RuntimeError # Please triage this failure
+LibTest/html/Element/attributeChanged_A01_t01: RuntimeError # Please triage this failure
+LibTest/html/Element/blur_A01_t01: Skip # Times out. Please triage this failure
+LibTest/html/Element/borderEdge_A01_t01: RuntimeError # Please triage this failure
+LibTest/html/Element/contentEdge_A01_t01: RuntimeError # Please triage this failure
+LibTest/html/Element/dataset_A02_t01: RuntimeError # Please triage this failure
+LibTest/html/Element/enteredView_A01_t01: RuntimeError # Please triage this failure
+LibTest/html/Element/focus_A01_t01: Skip # Times out. Please triage this failure
+LibTest/html/Element/getAttributeNS_A01_t01: RuntimeError # Please triage this failure
+LibTest/html/Element/getNamespacedAttributes_A01_t01: RuntimeError # Please triage this failure
+LibTest/html/Element/isTagSupported_A01_t01: RuntimeError # Please triage this failure
+LibTest/html/Element/leftView_A01_t01: RuntimeError # Please triage this failure
+LibTest/html/Element/marginEdge_A01_t01: RuntimeError # Please triage this failure
+LibTest/html/Element/mouseWheelEvent_A01_t01: Skip # Times out. Please triage this failure
+LibTest/html/Element/onMouseWheel_A01_t01: Skip # Times out. Please triage this failure
+LibTest/html/Element/paddingEdge_A01_t01: RuntimeError # Please triage this failure
+LibTest/html/Element/querySelectorAll_A01_t02: RuntimeError # Please triage this failure
+LibTest/html/Element/replaceWith_A01_t02: RuntimeError # Please triage this failure
+LibTest/html/Element/tagName_A01_t01: RuntimeError # Please triage this failure
+LibTest/html/Element/tagName_A01_t03: RuntimeError # Please triage this failure
+LibTest/html/Element/translate_A01_t01: RuntimeError # Please triage this failure
+LibTest/html/HttpRequest/getAllResponseHeaders_A01_t01: RuntimeError # Please triage this failure
+LibTest/html/HttpRequest/getResponseHeader_A01_t01: RuntimeError # Please triage this failure
+LibTest/html/HttpRequest/getString_A01_t01: RuntimeError # Please triage this failure
+LibTest/html/HttpRequest/onError_A01_t02: Skip # Times out. Please triage this failure
+LibTest/html/HttpRequest/overrideMimeType_A01_t01: RuntimeError # Please triage this failure
+LibTest/html/HttpRequest/request_A01_t01: RuntimeError # Please triage this failure
+LibTest/html/HttpRequest/responseText_A01_t02: Skip # Times out. Please triage this failure
+LibTest/html/HttpRequest/responseType_A01_t01: RuntimeError # Please triage this failure
+LibTest/html/HttpRequest/responseType_A01_t02: RuntimeError # Please triage this failure
+LibTest/html/HttpRequest/setRequestHeader_A01_t01: RuntimeError # Please triage this failure
+LibTest/html/HttpRequest/statusText_A01_t01: RuntimeError # Please triage this failure
+LibTest/html/HttpRequest/status_A01_t01: RuntimeError # Please triage this failure
+LibTest/html/HttpRequestUpload/onAbort_A01_t01: Skip # Times out. Please triage this failure
+LibTest/html/HttpRequestUpload/onError_A01_t02: Skip # Times out. Please triage this failure
+LibTest/html/HttpRequestUpload/onLoadEnd_A01_t01: Skip # Times out. Please triage this failure
+LibTest/html/HttpRequestUpload/onLoadStart_A01_t01: Skip # Times out. Please triage this failure
+LibTest/html/HttpRequestUpload/onLoad_A01_t01: Skip # Times out. Please triage this failure
+LibTest/html/IFrameElement/IFrameElement.created_A01_t01: RuntimeError # Please triage this failure
+LibTest/html/IFrameElement/appendHtml_A01_t01: RuntimeError # Please triage this failure
+LibTest/html/IFrameElement/appendHtml_A01_t02: RuntimeError # Please triage this failure
+LibTest/html/IFrameElement/attributeChanged_A01_t01: RuntimeError # Please triage this failure
+LibTest/html/IFrameElement/attributes_setter_A01_t01: RuntimeError # Please triage this failure
+LibTest/html/IFrameElement/blur_A01_t01: Skip # Times out. Please triage this failure
+LibTest/html/IFrameElement/borderEdge_A01_t01: RuntimeError # Please triage this failure
+LibTest/html/IFrameElement/clone_A01_t02: RuntimeError # Please triage this failure
+LibTest/html/IFrameElement/contentWindow_A01_t01: RuntimeError # Please triage this failure
+LibTest/html/IFrameElement/createFragment_A01_t01: RuntimeError # Please triage this failure
+LibTest/html/IFrameElement/createFragment_A01_t02: RuntimeError # Please triage this failure
+LibTest/html/IFrameElement/createFragment_A01_t03: RuntimeError # Please triage this failure
+LibTest/html/IFrameElement/createShadowRoot_A01_t01: RuntimeError # Please triage this failure
+LibTest/html/IFrameElement/focus_A01_t01: Skip # Times out. Please triage this failure
+LibTest/html/IFrameElement/getNamespacedAttributes_A01_t01: RuntimeError # Please triage this failure
+LibTest/html/IFrameElement/innerHtml_A01_t01: RuntimeError # Please triage this failure
+LibTest/html/IFrameElement/leftView_A01_t01: RuntimeError # Please triage this failure
+LibTest/html/IFrameElement/marginEdge_A01_t01: RuntimeError # Please triage this failure
+LibTest/html/IFrameElement/offsetTo_A01_t01: RuntimeError # Please triage this failure
+LibTest/html/IFrameElement/onMouseWheel_A01_t01: Skip # Times out. Please triage this failure
+LibTest/html/IFrameElement/outerHtml_setter_A01_t01: RuntimeError # Please triage this failure
+LibTest/html/IFrameElement/paddingEdge_A01_t01: RuntimeError # Please triage this failure
+LibTest/html/IFrameElement/querySelector_A01_t01: RuntimeError # Please triage this failure
+LibTest/html/IFrameElement/setInnerHtml_A01_t01: RuntimeError # Please triage this failure
+LibTest/html/IFrameElement/spellcheck_A01_t01: RuntimeError # Please triage this failure
+LibTest/html/IFrameElement/tagName_A01_t03: RuntimeError # Please triage this failure
+LibTest/html/IFrameElement/translate_A01_t01: RuntimeError # Please triage this failure
+LibTest/html/Node/append_A01_t02: RuntimeError # Please triage this failure
+LibTest/html/Node/nodes_A01_t01: RuntimeError # Please triage this failure
+LibTest/html/Node/nodes_A01_t02: RuntimeError # Please triage this failure
+LibTest/html/Node/parent_A01_t01: RuntimeError # Please triage this failure
+LibTest/html/Node/previousNode_A01_t01: RuntimeError # Please triage this failure
+LibTest/html/Window/document_A01_t01: RuntimeError # Please triage this failure
+LibTest/html/Window/find_A01_t01: RuntimeError # Please triage this failure
+LibTest/html/Window/find_A03_t01: RuntimeError # Please triage this failure
+LibTest/html/Window/find_A04_t01: RuntimeError # Please triage this failure
+LibTest/html/Window/find_A06_t01: RuntimeError # Please triage this failure
+LibTest/html/Window/moveBy_A01_t01: RuntimeError # Please triage this failure
+LibTest/html/Window/moveTo_A01_t01: RuntimeError # Please triage this failure
+LibTest/html/Window/moveTo_A02_t01: RuntimeError # Please triage this failure
+LibTest/html/Window/postMessage_A01_t01: RuntimeError # Please triage this failure
+LibTest/html/Window/postMessage_A01_t02: RuntimeError # Please triage this failure
+LibTest/html/Window/requestFileSystem_A01_t01: RuntimeError # Please triage this failure
+LibTest/html/Window/requestFileSystem_A01_t02: RuntimeError # Please triage this failure
+LibTest/html/Window/requestFileSystem_A02_t01: RuntimeError # Please triage this failure
+LibTest/html/Window/resizeBy_A01_t01: RuntimeError # Please triage this failure
+LibTest/html/Window/resizeTo_A01_t01: RuntimeError # Please triage this failure
+LibTest/typed_data/Float32List/Float32List.view_A06_t01: RuntimeError # Please triage this failure
+LibTest/typed_data/Float32x4List/Float32x4List.view_A06_t01: RuntimeError # Please triage this failure
+LibTest/typed_data/Float64List/Float64List.view_A06_t01: RuntimeError # Please triage this failure
+LibTest/typed_data/Int16List/Int16List.view_A06_t01: RuntimeError # Please triage this failure
+LibTest/typed_data/Int32List/Int32List.view_A06_t01: RuntimeError # Please triage this failure
+LibTest/typed_data/Int32x4/operator_OR_A01_t01: RuntimeError # Please triage this failure
+LibTest/typed_data/Uint16List/Uint16List.view_A06_t01: RuntimeError # Please triage this failure
+LibTest/typed_data/Uint32List/Uint32List.view_A06_t01: RuntimeError # Please triage this failure
+WebPlatformTest/DOMEvents/approved/EventObject.after.dispatchEvenr_t01: RuntimeError # Please triage this failure
+WebPlatformTest/DOMEvents/approved/ProcessingInstruction.DOMCharacterDataModified_t01: Skip # Times out. Please triage this failure
+WebPlatformTest/DOMEvents/approved/addEventListener.optional.useCapture_t01: RuntimeError # Please triage this failure
+WebPlatformTest/Utils/test/asyncTestFail_t01: RuntimeError # Please triage this failure
+WebPlatformTest/Utils/test/asyncTestFail_t02: RuntimeError # Please triage this failure
+WebPlatformTest/Utils/test/asyncTestTimeout_t01: Skip # Times out. Please triage this failure
+WebPlatformTest/custom-elements/concepts/type_A01_t01: RuntimeError # Please triage this failure
+WebPlatformTest/custom-elements/concepts/type_A04_t01: RuntimeError # Please triage this failure
+WebPlatformTest/custom-elements/concepts/type_A05_t01: RuntimeError # Please triage this failure
+WebPlatformTest/custom-elements/concepts/type_A06_t01: RuntimeError # Please triage this failure
+WebPlatformTest/custom-elements/concepts/type_A07_t01: RuntimeError # Please triage this failure
+WebPlatformTest/custom-elements/concepts/type_A08_t01: RuntimeError # Please triage this failure
+WebPlatformTest/custom-elements/instantiating/createElementNS_A01_t01: RuntimeError # Please triage this failure
+WebPlatformTest/custom-elements/instantiating/createElementNS_A02_t01: RuntimeError # Please triage this failure
+WebPlatformTest/custom-elements/instantiating/createElementNS_A03_t01: RuntimeError # Please triage this failure
+WebPlatformTest/custom-elements/instantiating/createElementNS_A04_t01: RuntimeError # Please triage this failure
+WebPlatformTest/custom-elements/instantiating/createElementNS_A05_t01: RuntimeError # Please triage this failure
+WebPlatformTest/custom-elements/instantiating/createElement_A01_t01: RuntimeError # Please triage this failure
+WebPlatformTest/custom-elements/instantiating/createElement_A02_t01: RuntimeError # Please triage this failure
+WebPlatformTest/custom-elements/instantiating/createElement_A03_t01: RuntimeError # Please triage this failure
+WebPlatformTest/custom-elements/instantiating/createElement_A04_t01: RuntimeError # Please triage this failure
+WebPlatformTest/custom-elements/instantiating/createElement_A05_t01: RuntimeError # Please triage this failure
+WebPlatformTest/custom-elements/instantiating/isAttribute_A01_t01: RuntimeError # Please triage this failure
+WebPlatformTest/custom-elements/instantiating/isAttribute_A01_t02: RuntimeError # Please triage this failure
+WebPlatformTest/custom-elements/instantiating/isAttribute_A02_t01: RuntimeError # Please triage this failure
+WebPlatformTest/custom-elements/instantiating/isAttribute_A03_t01: RuntimeError # Please triage this failure
+WebPlatformTest/custom-elements/instantiating/localName_A01_t01: RuntimeError # Please triage this failure
+WebPlatformTest/custom-elements/instantiating/namespace_A01_t01: RuntimeError # Please triage this failure
+WebPlatformTest/dom/EventTarget/dispatchEvent_A02_t01: RuntimeError # Please triage this failure
+WebPlatformTest/dom/events/type_A01_t01: RuntimeError # Please triage this failure
+WebPlatformTest/dom/nodes/DOMImplementation-createDocument_t01: RuntimeError # Please triage this failure
+WebPlatformTest/dom/nodes/DOMImplementation-hasFeature_t01: RuntimeError # Please triage this failure
+WebPlatformTest/dom/nodes/Document-adoptNode_t01: RuntimeError # Please triage this failure
+WebPlatformTest/dom/nodes/Document-createElementNS_t01: RuntimeError # Please triage this failure
+WebPlatformTest/dom/nodes/Document-getElementsByTagName_t01: RuntimeError # Please triage this failure
+WebPlatformTest/dom/nodes/Element-childElementCount_t01: RuntimeError # Please triage this failure
+WebPlatformTest/dom/nodes/Node-appendChild_t01: RuntimeError # Please triage this failure
+WebPlatformTest/dom/nodes/Node-appendChild_t02: RuntimeError # Please triage this failure
+WebPlatformTest/dom/nodes/Node-insertBefore_t01: RuntimeError # Please triage this failure
+WebPlatformTest/dom/nodes/Node-isEqualNode_t01: RuntimeError # Please triage this failure
+WebPlatformTest/dom/nodes/Node-nodeName_t01: RuntimeError # Please triage this failure
+WebPlatformTest/dom/nodes/Node-replaceChild_t01: RuntimeError # Please triage this failure
+WebPlatformTest/dom/nodes/attributes/setAttributeNS_A05_t01: RuntimeError # Please triage this failure
+WebPlatformTest/dom/nodes/attributes/setAttributeNS_A06_t03: RuntimeError # Please triage this failure
+WebPlatformTest/dom/nodes/attributes/setAttributeNS_A07_t02: RuntimeError # Please triage this failure
+WebPlatformTest/dom/nodes/attributes/setAttributeNS_A07_t03: RuntimeError # Please triage this failure
+WebPlatformTest/dom/nodes/attributes/setAttributeNS_A08_t01: RuntimeError # Please triage this failure
+WebPlatformTest/dom/nodes/attributes/setAttributeNS_A10_t01: RuntimeError # Please triage this failure
+WebPlatformTest/dom/nodes/attributes/setAttribute_A03_t01: RuntimeError # Please triage this failure
+WebPlatformTest/dom/ranges/Range-comparePoint_t02: RuntimeError # Please triage this failure
+WebPlatformTest/html-imports/link-import_t01: RuntimeError # Please triage this failure
+WebPlatformTest/html-imports/link-import_t02: RuntimeError # Please triage this failure
+WebPlatformTest/html-imports/loading-import_t01: RuntimeError # Please triage this failure
+WebPlatformTest/html-templates/additions-to-the-steps-to-clone-a-node/templates-copy-document-owner_t01: RuntimeError # Please triage this failure
+WebPlatformTest/html-templates/innerhtml-on-templates/innerhtml_t01: RuntimeError # Please triage this failure
+WebPlatformTest/html-templates/parsing-html-templates/additions-to-the-in-head-insertion-mode/generating-of-implied-end-tags_t01: RuntimeError # Please triage this failure
+WebPlatformTest/html-templates/parsing-html-templates/clearing-the-stack-back-to-a-given-context/clearing-stack-back-to-a-table-body-context_t01: RuntimeError # Please triage this failure
+WebPlatformTest/html-templates/parsing-html-templates/clearing-the-stack-back-to-a-given-context/clearing-stack-back-to-a-table-context_t01: RuntimeError # Please triage this failure
+WebPlatformTest/html-templates/parsing-html-templates/creating-an-element-for-the-token/template-owner-document_t01: RuntimeError # Please triage this failure
+WebPlatformTest/html-templates/template-element/node-document-changes_t01: RuntimeError # Please triage this failure
+WebPlatformTest/html-templates/template-element/template-as-a-descendant_t01: RuntimeError # Please triage this failure
+WebPlatformTest/html-templates/template-element/template-content_t01: RuntimeError # Please triage this failure
+WebPlatformTest/html/browsers/browsing-the-web/read-media/pageload-image_t01: RuntimeError # Please triage this failure
+WebPlatformTest/html/browsers/browsing-the-web/read-media/pageload-video_t01: RuntimeError # Please triage this failure
+WebPlatformTest/html/browsers/browsing-the-web/read-text/load-text-plain_t01: RuntimeError # Please triage this failure
+WebPlatformTest/html/dom/documents/dom-tree-accessors/Document.getElementsByClassName-null_t01: RuntimeError # Please triage this failure
+WebPlatformTest/html/dom/documents/dom-tree-accessors/document.body-getter_t01: RuntimeError # Please triage this failure
+WebPlatformTest/html/dom/documents/dom-tree-accessors/document.body-setter_t01: RuntimeError # Please triage this failure
+WebPlatformTest/html/dom/documents/dom-tree-accessors/document.getElementsByName-namespace_t01: RuntimeError # Please triage this failure
+WebPlatformTest/html/dom/documents/dom-tree-accessors/document.getElementsByName-newelements_t01: RuntimeError # Please triage this failure
+WebPlatformTest/html/dom/documents/dom-tree-accessors/document.title_t01: RuntimeError # Please triage this failure
+WebPlatformTest/html/dom/documents/dom-tree-accessors/document.title_t03: RuntimeError # Please triage this failure
+WebPlatformTest/html/dom/documents/dom-tree-accessors/document.title_t07: RuntimeError # Please triage this failure
+WebPlatformTest/html/dom/documents/dom-tree-accessors/nameditem_t02: RuntimeError # Please triage this failure
+WebPlatformTest/html/dom/documents/dom-tree-accessors/nameditem_t05: RuntimeError # Please triage this failure
+WebPlatformTest/html/dom/elements/global-attributes/dataset-delete_t01: RuntimeError # Please triage this failure
+WebPlatformTest/html/dom/elements/global-attributes/dataset-get_t01: RuntimeError # Please triage this failure
+WebPlatformTest/html/dom/elements/global-attributes/dataset-set_t01: RuntimeError # Please triage this failure
+WebPlatformTest/html/semantics/embedded-content/media-elements/error-codes/error_t01: Skip # Times out. Please triage this failure
+WebPlatformTest/html/semantics/embedded-content/media-elements/interfaces/HTMLElement/HTMLMediaElement/addTextTrack_t01: RuntimeError # Please triage this failure
+WebPlatformTest/html/semantics/embedded-content/media-elements/interfaces/HTMLElement/HTMLTrackElement/src_t01: RuntimeError # Please triage this failure
+WebPlatformTest/html/semantics/embedded-content/media-elements/interfaces/TextTrack/cues_t01: RuntimeError # Please triage this failure
+WebPlatformTest/html/semantics/embedded-content/media-elements/interfaces/TextTrack/mode_t01: RuntimeError # Please triage this failure
+WebPlatformTest/html/semantics/forms/attributes-common-to-form-controls/formAction_document_address_t01: RuntimeError # Please triage this failure
+WebPlatformTest/html/semantics/forms/attributes-common-to-form-controls/formaction_t01: RuntimeError # Please triage this failure
+WebPlatformTest/html/semantics/forms/textfieldselection/selection-not-application-textarea_t01: RuntimeError # Please triage this failure
+WebPlatformTest/html/semantics/forms/textfieldselection/selection_t01: RuntimeError # Please triage this failure
+WebPlatformTest/html/semantics/forms/textfieldselection/textfieldselection-setRangeText_t01: RuntimeError # Please triage this failure
+WebPlatformTest/html/semantics/forms/textfieldselection/textfieldselection-setSelectionRange_t01: RuntimeError # Please triage this failure
+WebPlatformTest/html/semantics/forms/the-button-element/button-validation_t01: RuntimeError # Please triage this failure
+WebPlatformTest/html/semantics/forms/the-datalist-element/datalistoptions_t01: RuntimeError # Please triage this failure
+WebPlatformTest/html/semantics/forms/the-form-element/form-autocomplete_t01: RuntimeError # Please triage this failure
+WebPlatformTest/html/semantics/forms/the-form-element/form-elements-matches_t01: RuntimeError # Please triage this failure
+WebPlatformTest/html/semantics/forms/the-form-element/form-elements-nameditem_t02: RuntimeError # Please triage this failure
+WebPlatformTest/html/semantics/forms/the-input-element/date_t01: RuntimeError # Please triage this failure
+WebPlatformTest/html/semantics/forms/the-input-element/datetime-local_t01: RuntimeError # Please triage this failure
+WebPlatformTest/html/semantics/forms/the-input-element/datetime_t01: RuntimeError # Please triage this failure
+WebPlatformTest/html/semantics/forms/the-input-element/datetime_t02: RuntimeError # Please triage this failure
+WebPlatformTest/html/semantics/forms/the-input-element/email_t01: RuntimeError # Please triage this failure
+WebPlatformTest/html/semantics/forms/the-input-element/hidden_t01: RuntimeError # Please triage this failure
+WebPlatformTest/html/semantics/forms/the-input-element/input-textselection_t01: RuntimeError # Please triage this failure
+WebPlatformTest/html/semantics/forms/the-input-element/month_t01: RuntimeError # Please triage this failure
+WebPlatformTest/html/semantics/forms/the-input-element/password_t01: RuntimeError # Please triage this failure
+WebPlatformTest/html/semantics/forms/the-input-element/range_t01: RuntimeError # Please triage this failure
+WebPlatformTest/html/semantics/forms/the-input-element/range_t02: RuntimeError # Please triage this failure
+WebPlatformTest/html/semantics/forms/the-input-element/text_t01: RuntimeError # Please triage this failure
+WebPlatformTest/html/semantics/forms/the-input-element/time_t01: RuntimeError # Please triage this failure
+WebPlatformTest/html/semantics/forms/the-input-element/time_t02: RuntimeError # Please triage this failure
+WebPlatformTest/html/semantics/forms/the-input-element/type-change-state_t01: RuntimeError # Please triage this failure
+WebPlatformTest/html/semantics/forms/the-input-element/valueMode_t01: RuntimeError # Please triage this failure
+WebPlatformTest/html/semantics/forms/the-input-element/week_t01: RuntimeError # Please triage this failure
+WebPlatformTest/html/semantics/forms/the-meter-element/meter_t01: RuntimeError # Please triage this failure
+WebPlatformTest/html/semantics/forms/the-option-element/option-text-recurse_t01: RuntimeError # Please triage this failure
+WebPlatformTest/html/semantics/forms/the-option-element/option-text-spaces_t01: RuntimeError # Please triage this failure
+WebPlatformTest/html/semantics/grouping-content/the-blockquote-element/grouping-blockquote_t01: RuntimeError # Please triage this failure
+WebPlatformTest/html/semantics/grouping-content/the-ol-element/ol.start-reflection_t02: RuntimeError # Please triage this failure
+WebPlatformTest/html/semantics/interactive-elements/the-details-element/toggleEvent_t01: RuntimeError # Please triage this failure
+WebPlatformTest/html/semantics/interactive-elements/the-dialog-element/dialog-close_t01: RuntimeError # Please triage this failure
+WebPlatformTest/html/semantics/interactive-elements/the-dialog-element/dialog-showModal_t01: RuntimeError # Please triage this failure
+WebPlatformTest/html/semantics/scripting-1/the-script-element/script-text_t02: RuntimeError # Please triage this failure
+WebPlatformTest/html/semantics/selectors/pseudo-classes/checked_t01: RuntimeError # Please triage this failure
+WebPlatformTest/html/semantics/selectors/pseudo-classes/dir_t01: RuntimeError # Please triage this failure
+WebPlatformTest/html/semantics/selectors/pseudo-classes/enabled_t01: RuntimeError # Please triage this failure
+WebPlatformTest/html/semantics/selectors/pseudo-classes/focus_t01: Pass, RuntimeError # Please triage this failure
+WebPlatformTest/html/semantics/selectors/pseudo-classes/indeterminate_t01: RuntimeError # Please triage this failure
+WebPlatformTest/html/semantics/selectors/pseudo-classes/inrange-outofrange_t01: RuntimeError # Please triage this failure
+WebPlatformTest/html/semantics/tabular-data/the-caption-element/caption_t01: RuntimeError # Please triage this failure
+WebPlatformTest/html/semantics/tabular-data/the-table-element/caption-methods_t01: RuntimeError # Please triage this failure
+WebPlatformTest/html/semantics/tabular-data/the-table-element/table-insertRow_t01: RuntimeError # Please triage this failure
+WebPlatformTest/html/semantics/tabular-data/the-table-element/table-rows_t01: RuntimeError # Please triage this failure
+WebPlatformTest/html/syntax/parsing/Document.getElementsByTagName-foreign_t02: RuntimeError # Please triage this failure
+WebPlatformTest/html/syntax/serializing-html-fragments/outerHTML_t01: RuntimeError # Please triage this failure
+WebPlatformTest/html/webappapis/system-state-and-capabilities/the-navigator-object/protocol_t00: RuntimeError # Please triage this failure
+WebPlatformTest/html/webappapis/system-state-and-capabilities/the-navigator-object/protocol/t01: RuntimeError # Please triage this failure
+WebPlatformTest/html/webappapis/system-state-and-capabilities/the-navigator-object/protocol/t02: RuntimeError # Please triage this failure
+WebPlatformTest/html/webappapis/system-state-and-capabilities/the-navigator-object/protocol/t03: RuntimeError # Please triage this failure
+WebPlatformTest/html/webappapis/system-state-and-capabilities/the-navigator-object/protocol/t04: RuntimeError # Please triage this failure
+WebPlatformTest/html/webappapis/system-state-and-capabilities/the-navigator-object/protocol/t05: RuntimeError # Please triage this failure
+WebPlatformTest/html/webappapis/system-state-and-capabilities/the-navigator-object/protocol/t06: RuntimeError # Please triage this failure
+WebPlatformTest/shadow-dom/elements-and-dom-objects/extensions-to-element-interface/attributes/test-001_t01: RuntimeError # Please triage this failure
+WebPlatformTest/shadow-dom/elements-and-dom-objects/extensions-to-element-interface/attributes/test-004_t01: RuntimeError # Please triage this failure
+WebPlatformTest/shadow-dom/elements-and-dom-objects/extensions-to-element-interface/attributes/test-004_t02: RuntimeError # Please triage this failure
+WebPlatformTest/shadow-dom/elements-and-dom-objects/extensions-to-element-interface/attributes/test-005_t01: RuntimeError # Please triage this failure
+WebPlatformTest/shadow-dom/elements-and-dom-objects/extensions-to-element-interface/methods/elements-001_t01: RuntimeError # Please triage this failure
+WebPlatformTest/shadow-dom/elements-and-dom-objects/extensions-to-element-interface/methods/test-001_t01: RuntimeError # Please triage this failure
+WebPlatformTest/shadow-dom/elements-and-dom-objects/extensions-to-element-interface/methods/test-002_t01: RuntimeError # Please triage this failure
+WebPlatformTest/shadow-dom/elements-and-dom-objects/extensions-to-element-interface/methods/test-003_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
+WebPlatformTest/shadow-dom/elements-and-dom-objects/shadowroot-object/shadowroot-attributes/test-007_t01: RuntimeError # Please triage this failure
+WebPlatformTest/shadow-dom/elements-and-dom-objects/shadowroot-object/shadowroot-attributes/test-008_t01: RuntimeError # Please triage this failure
+WebPlatformTest/shadow-dom/elements-and-dom-objects/shadowroot-object/shadowroot-attributes/test-009_t01: RuntimeError # Please triage this failure
+WebPlatformTest/shadow-dom/elements-and-dom-objects/shadowroot-object/shadowroot-attributes/test-010_t01: RuntimeError # Please triage this failure
+WebPlatformTest/shadow-dom/elements-and-dom-objects/shadowroot-object/shadowroot-attributes/test-011_t01: RuntimeError # Please triage this failure
+WebPlatformTest/shadow-dom/elements-and-dom-objects/shadowroot-object/shadowroot-attributes/test-012_t01: RuntimeError # Please triage this failure
+WebPlatformTest/shadow-dom/elements-and-dom-objects/shadowroot-object/shadowroot-attributes/test-013_t01: RuntimeError # Please triage this failure
+WebPlatformTest/shadow-dom/elements-and-dom-objects/shadowroot-object/shadowroot-methods/test-001_t01: RuntimeError # Please triage this failure
+WebPlatformTest/shadow-dom/elements-and-dom-objects/shadowroot-object/shadowroot-methods/test-002_t01: RuntimeError # Please triage this failure
+WebPlatformTest/shadow-dom/elements-and-dom-objects/shadowroot-object/shadowroot-methods/test-005_t01: RuntimeError # Please triage this failure
+WebPlatformTest/shadow-dom/elements-and-dom-objects/shadowroot-object/shadowroot-methods/test-007_t01: RuntimeError # Please triage this failure
+WebPlatformTest/shadow-dom/elements-and-dom-objects/shadowroot-object/shadowroot-methods/test-010_t01: RuntimeError # Please triage this failure
+WebPlatformTest/shadow-dom/elements-and-dom-objects/the-content-html-element/test-001_t01: RuntimeError # Please triage this failure
+WebPlatformTest/shadow-dom/elements-and-dom-objects/the-content-html-element/test-002_t01: RuntimeError # Please triage this failure
+WebPlatformTest/shadow-dom/elements-and-dom-objects/the-content-html-element/test-003_t01: RuntimeError # Please triage this failure
+WebPlatformTest/shadow-dom/elements-and-dom-objects/the-content-html-element/test-004_t01: RuntimeError # Please triage this failure
+WebPlatformTest/shadow-dom/elements-and-dom-objects/the-content-html-element/test-004_t02: RuntimeError # Please triage this failure
+WebPlatformTest/shadow-dom/elements-and-dom-objects/the-content-html-element/test-005_t01: RuntimeError # Please triage this failure
+WebPlatformTest/shadow-dom/elements-and-dom-objects/the-content-html-element/test-006_t01: RuntimeError # Please triage this failure
+WebPlatformTest/shadow-dom/elements-and-dom-objects/the-shadow-html-element/test-001_t01: RuntimeError # Please triage this failure
+WebPlatformTest/shadow-dom/elements-and-dom-objects/the-shadow-html-element/test-002_t01: RuntimeError # Please triage this failure
+WebPlatformTest/shadow-dom/elements-and-dom-objects/the-shadow-html-element/test-003_t01: RuntimeError # Please triage this failure
+WebPlatformTest/shadow-dom/elements-and-dom-objects/the-shadow-html-element/test-003_t02: RuntimeError # Please triage this failure
+WebPlatformTest/shadow-dom/elements-and-dom-objects/the-shadow-html-element/test-004_t01: RuntimeError # Please triage this failure
+WebPlatformTest/shadow-dom/elements-and-dom-objects/the-shadow-html-element/test-005_t01: RuntimeError # Please triage this failure
+WebPlatformTest/shadow-dom/events/event-dispatch/test-001_t01: RuntimeError # Please triage this failure
+WebPlatformTest/shadow-dom/events/event-dispatch/test-002_t01: RuntimeError # Please triage this failure
+WebPlatformTest/shadow-dom/events/event-dispatch/test-003_t01: RuntimeError # Please triage this failure
+WebPlatformTest/shadow-dom/events/event-retargeting/test-001_t01: RuntimeError # Please triage this failure
+WebPlatformTest/shadow-dom/events/event-retargeting/test-002_t01: RuntimeError # Please triage this failure
+WebPlatformTest/shadow-dom/events/event-retargeting/test-003_t01: RuntimeError # Please triage this failure
+WebPlatformTest/shadow-dom/events/event-retargeting/test-004_t01: RuntimeError # Please triage this failure
+WebPlatformTest/shadow-dom/events/events-that-are-always-stopped/test-001_t01: RuntimeError # Please triage this failure
+WebPlatformTest/shadow-dom/events/events-that-are-always-stopped/test-002_t01: RuntimeError # Please triage this failure
+WebPlatformTest/shadow-dom/events/events-that-are-always-stopped/test-003_t01: RuntimeError # Please triage this failure
+WebPlatformTest/shadow-dom/events/events-that-are-always-stopped/test-004_t01: RuntimeError # Please triage this failure
+WebPlatformTest/shadow-dom/events/events-that-are-always-stopped/test-005_t01: RuntimeError # Please triage this failure
+WebPlatformTest/shadow-dom/events/events-that-are-always-stopped/test-006_t01: RuntimeError # Please triage this failure
+WebPlatformTest/shadow-dom/events/events-that-are-always-stopped/test-007_t01: RuntimeError # Please triage this failure
+WebPlatformTest/shadow-dom/events/events-that-are-always-stopped/test-008_t01: RuntimeError # Please triage this failure
+WebPlatformTest/shadow-dom/events/events-that-are-always-stopped/test-009_t01: RuntimeError # Please triage this failure
+WebPlatformTest/shadow-dom/events/retargeting-focus-events/test-001_t01: RuntimeError # Please triage this failure
+WebPlatformTest/shadow-dom/events/retargeting-focus-events/test-001_t02: RuntimeError # Please triage this failure
+WebPlatformTest/shadow-dom/events/retargeting-focus-events/test-001_t03: RuntimeError # Please triage this failure
+WebPlatformTest/shadow-dom/events/retargeting-focus-events/test-001_t04: RuntimeError # Please triage this failure
+WebPlatformTest/shadow-dom/events/retargeting-focus-events/test-001_t05: RuntimeError # Please triage this failure
+WebPlatformTest/shadow-dom/events/retargeting-focus-events/test-001_t06: RuntimeError # Please triage this failure
+WebPlatformTest/shadow-dom/events/retargeting-focus-events/test-002_t01: RuntimeError # Please triage this failure
+WebPlatformTest/shadow-dom/events/retargeting-focus-events/test-003_t01: RuntimeError # Please triage this failure
+WebPlatformTest/shadow-dom/events/retargeting-relatedtarget/test-001_t01: RuntimeError # Please triage this failure
+WebPlatformTest/shadow-dom/events/retargeting-relatedtarget/test-002_t01: RuntimeError # Please triage this failure
+WebPlatformTest/shadow-dom/events/retargeting-relatedtarget/test-003_t01: RuntimeError # Please triage this failure
+WebPlatformTest/shadow-dom/html-elements-and-their-shadow-trees/test-001_t01: RuntimeError # Please triage this failure
+WebPlatformTest/shadow-dom/html-elements-and-their-shadow-trees/test-002_t01: RuntimeError # Please triage this failure
+WebPlatformTest/shadow-dom/html-elements-and-their-shadow-trees/test-003_t01: RuntimeError # Please triage this failure
+WebPlatformTest/shadow-dom/html-elements-and-their-shadow-trees/test-004_t01: RuntimeError # Please triage this failure
+WebPlatformTest/shadow-dom/html-elements-in-shadow-trees/html-forms/test-001_t01: RuntimeError # Please triage this failure
+WebPlatformTest/shadow-dom/html-elements-in-shadow-trees/html-forms/test-002_t01: RuntimeError # Please triage this failure
+WebPlatformTest/shadow-dom/html-elements-in-shadow-trees/inert-html-elements/test-002_t01: RuntimeError # Please triage this failure
+WebPlatformTest/shadow-dom/shadow-trees/composition/test-001_t01: RuntimeError # Please triage this failure
+WebPlatformTest/shadow-dom/shadow-trees/custom-pseudo-elements/test-001_t01: RuntimeError # Please triage this failure
+WebPlatformTest/shadow-dom/shadow-trees/distributed-pseudo-element/test-001_t01: RuntimeError # Please triage this failure
+WebPlatformTest/shadow-dom/shadow-trees/distributed-pseudo-element/test-002_t01: RuntimeError # Please triage this failure
+WebPlatformTest/shadow-dom/shadow-trees/hosting-multiple-shadow-trees/test-001_t01: RuntimeError # Please triage this failure
+WebPlatformTest/shadow-dom/shadow-trees/hosting-multiple-shadow-trees/test-002_t01: RuntimeError # Please triage this failure
+WebPlatformTest/shadow-dom/shadow-trees/hosting-multiple-shadow-trees/test-003_t01: RuntimeError # Please triage this failure
+WebPlatformTest/shadow-dom/shadow-trees/lower-boundary-encapsulation/distribution-003_t01: RuntimeError # Please triage this failure
+WebPlatformTest/shadow-dom/shadow-trees/lower-boundary-encapsulation/test-003_t01: RuntimeError # Please triage this failure
+WebPlatformTest/shadow-dom/shadow-trees/lower-boundary-encapsulation/test-004_t01: RuntimeError # Please triage this failure
+WebPlatformTest/shadow-dom/shadow-trees/lower-boundary-encapsulation/test-005_t01: RuntimeError # Please triage this failure
+WebPlatformTest/shadow-dom/shadow-trees/nested-shadow-trees/test-001_t01: RuntimeError # Please triage this failure
+WebPlatformTest/shadow-dom/shadow-trees/rendering-shadow-trees/test-001_t01: RuntimeError # Please triage this failure
+WebPlatformTest/shadow-dom/shadow-trees/reprojection/test-001_t01: RuntimeError # Please triage this failure
+WebPlatformTest/shadow-dom/shadow-trees/satisfying-matching-criteria/test-001_t01: RuntimeError # Please triage this failure
+WebPlatformTest/shadow-dom/shadow-trees/satisfying-matching-criteria/test-002_t01: RuntimeError # Please triage this failure
+WebPlatformTest/shadow-dom/shadow-trees/satisfying-matching-criteria/test-003_t01: RuntimeError # Please triage this failure
+WebPlatformTest/shadow-dom/shadow-trees/satisfying-matching-criteria/test-004_t01: RuntimeError # Please triage this failure
+WebPlatformTest/shadow-dom/shadow-trees/satisfying-matching-criteria/test-005_t01: RuntimeError # Please triage this failure
+WebPlatformTest/shadow-dom/shadow-trees/satisfying-matching-criteria/test-006_t01: RuntimeError # Please triage this failure
+WebPlatformTest/shadow-dom/shadow-trees/satisfying-matching-criteria/test-017_t01: RuntimeError # Please triage this failure
+WebPlatformTest/shadow-dom/shadow-trees/upper-boundary-encapsulation/dom-tree-accessors-002_t01: RuntimeError # Please triage this failure
+WebPlatformTest/shadow-dom/shadow-trees/upper-boundary-encapsulation/ownerdocument-001_t01: RuntimeError # Please triage this failure
+WebPlatformTest/shadow-dom/shadow-trees/upper-boundary-encapsulation/ownerdocument-002_t01: RuntimeError # Please triage this failure
+WebPlatformTest/shadow-dom/shadow-trees/upper-boundary-encapsulation/selectors-api-001_t01: RuntimeError # Please triage this failure
+WebPlatformTest/shadow-dom/shadow-trees/upper-boundary-encapsulation/selectors-api-002_t01: RuntimeError # Please triage this failure
+WebPlatformTest/shadow-dom/shadow-trees/upper-boundary-encapsulation/shadow-root-001_t01: RuntimeError # Please triage this failure
+WebPlatformTest/shadow-dom/shadow-trees/upper-boundary-encapsulation/test-005_t01: RuntimeError # Please triage this failure
+WebPlatformTest/shadow-dom/shadow-trees/upper-boundary-encapsulation/test-007_t01: RuntimeError # Please triage this failure
+WebPlatformTest/shadow-dom/shadow-trees/upper-boundary-encapsulation/test-009_t01: RuntimeError # Please triage this failure
+WebPlatformTest/shadow-dom/shadow-trees/upper-boundary-encapsulation/test-011_t01: RuntimeError # Please triage this failure
+WebPlatformTest/webstorage/event_constructor_t01: RuntimeError # Please triage this failure
+WebPlatformTest/webstorage/event_constructor_t02: RuntimeError # Please triage this failure
+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_quotaexceedederr_t01: Skip # Times out. Please triage this failure
+WebPlatformTest/webstorage/storage_session_setitem_t01: RuntimeError # Please triage this failure
diff --git a/tests/co19/co19-dartium.status b/tests/co19/co19-dartium.status
index 9660f1f..d61e858 100644
--- a/tests/co19/co19-dartium.status
+++ b/tests/co19/co19-dartium.status
@@ -6,19 +6,21 @@
*: Skip # running co19 tests on content_shell would make our dartium cycle-times very long
[ $compiler == none && $runtime == dartium && $system == macos ]
-LayoutTests/fast/writing-mode/broken-ideographic-font_t01: Skip # Timing out on the bots
+LayoutTests/fast/writing-mode/broken-ideographic-font_t01: Skip # Timing out on the bots. Please triage this failure.
LayoutTests/fast/css-generated-content/pseudo-animation-before-onload_t01: Skip # Depends on animation timing, commented as known to be flaky in test. Will not fix.
LayoutTests/fast/writing-mode/vertical-inline-block-hittest_t01: Pass, RuntimeError # Issue 21605
LayoutTests/fast/writing-mode/flipped-blocks-hit-test-overflow_t01: Pass, RuntimeError # Issue 21605
-[ $compiler == none && $mode == debug && ($runtime == drt || $runtime == dartium || $runtime == ContentShellOnAndroid) ]
+[ $compiler == none && ($runtime == dartium || $runtime == ContentShellOnAndroid) ]
LayoutTests/fast/canvas/canvas-lineDash-input-sequence_t01: Skip # Issue 20867
LayoutTests/fast/canvas/webgl/tex-image-and-sub-image-2d-with-video-rgba4444_t01: Skip # Issue 20540
LayoutTests/fast/canvas/webgl/tex-image-and-sub-image-2d-with-video-rgb565_t01: Skip # Issue 20540
LayoutTests/fast/canvas/webgl/tex-image-and-sub-image-2d-with-video-rgba5551_t01: Skip # Issue 20540
LayoutTests/fast/canvas/webgl/tex-image-and-sub-image-2d-with-video_t01: Skip # Issue 20540
-
-[ $compiler == none && ($runtime == dartium || $runtime == ContentShellOnAndroid) ]
+Language/12_Expressions/12_Instance_Creation/2_Const_A11_t01: Fail # Issue 22007
+Language/12_Expressions/12_Instance_Creation/2_Const_A11_t03: Fail # Issue 22007
+Language/14_Libraries_and_Scripts/3_Parts_A01_t05: Skip # Times out flakily. Issue 20881
+LayoutTests/fast/speechsynthesis/*: Skip # Times out on Dartium. Fails elsewhere. Issue 22017
LayoutTests/fast/borders/border-radius-child_t01: Skip # co19 issue 732.
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.
@@ -43,12 +45,17 @@
LayoutTests/fast/dom/css-cached-import-rule_t01: Skip # Test reloads itself. Issue 18558.
LayoutTests/fast/dom/cssTarget-crash_t01: Skip # Test reloads itself. Issue 18558.
LayoutTests/fast/dom/empty-hash-and-search_t01: Skip # Test reloads itself. Issue 18558.
+LayoutTests/fast/forms/datetimelocal/datetimelocal-interactive-validation-required_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.
-Language/07_Classes/6_Constructors/1_Generative_Constructors_A09_t01: Pass, Fail # Issue 13719: Please triage this failure.
-Language/14_Libraries_and_Scripts/3_Parts_A02_t02: Skip # Issue 13719: Please triage this failure.
+LayoutTests/fast/mediastream/getusermedia_t01: Skip # co19 issue 738
+
+Language/07_Classes/6_Constructors/1_Generative_Constructors_A09_t01: Pass, Fail #: Please triage this failure.
+Language/14_Libraries_and_Scripts/3_Parts_A02_t02: Skip # Please triage this failure.
Language/14_Libraries_and_Scripts/4_Scripts_A03_t03: Pass # Issue 14478: This should break.
-LibTest/async/Completer/completeError_A02_t01: Pass, Fail # Issue 13719: Please triage this failure.
-LibTest/core/int/operator_left_shift_A01_t02: Pass, Fail # Issue 13719: Please triage this failure.
+LibTest/async/Completer/completeError_A02_t01: Pass, Fail # Please triage this failure.
+LibTest/core/int/operator_left_shift_A01_t02: Pass, Fail # Please triage this failure.
LibTest/isolate/SendPort/send_A02_t01: Fail # Issue 13921
LibTest/isolate/SendPort/send_A02_t04: Fail # Issue 13921
LibTest/isolate/SendPort/send_A02_t05: Fail # Issue 13921
@@ -131,100 +138,93 @@
LibTest/isolate/ReceivePort/transform_A01_t02: RuntimeError # Issue 13921
LibTest/isolate/ReceivePort/where_A01_t01: RuntimeError # Issue 13921
LibTest/isolate/ReceivePort/where_A01_t02: RuntimeError # Issue 13921
-
-# New Dartium failures on new co19 browser tests in co19 revision 706.
-
-LibTest/html/Element/blur_A01_t01: Skip # Issue 17758. Please triage this failure.
-LibTest/html/IFrameElement/blur_A01_t01: Skip # Issue 17758. Please triage this failure.
-LibTest/html/Element/focus_A01_t01: Skip # Issue 17758. Please triage this failure.
-LibTest/html/IFrameElement/focus_A01_t01: Skip # Issue 17758. Please triage this failure.
-LibTest/html/IFrameElement/enteredView_A01_t01: Skip # Issue 17758. Please triage this failure.
-LibTest/html/IFrameElement/leftView_A01_t01: Skip # Issue 17758. Please triage this failure.
-LibTest/html/HttpRequest/onError_A01_t02: Skip # Issue 17758. Please triage this failure.
-LibTest/html/HttpRequest/responseText_A01_t02: Skip # Issue 17758. Please triage this failure.
-LibTest/html/HttpRequestUpload/onError_A01_t02: Skip # Issue 17758. Please triage this failure.
-LibTest/html/HttpRequestUpload/onLoadEnd_A01_t01: Skip # Issue 17758. Please triage this failure.
-LibTest/html/HttpRequestUpload/onLoadStart_A01_t01: Skip # Issue 17758. Please triage this failure.
-LibTest/html/HttpRequestUpload/onLoad_A01_t01: Skip # Issue 17758. Please triage this failure.
-WebPlatformTest/dom/events/event_constants/constants_A01_t01: Skip # Issue 17758. Please triage this failure.
-WebPlatformTest/dom/events/event_constructors/Event_A01_t01: Skip # Issue 17758. Please triage this failure.
-WebPlatformTest/dom/events/event_constructors/Event_A02_t01: Skip # Issue 17758. Please triage this failure.
-
-LayoutTests/fast/dom/DOMImplementation/createDocument-namespace-err_t01: RuntimeError # Issue 17758. Please triage this failure.
-LayoutTests/fast/dom/Document/CaretRangeFromPoint/basic_t01: RuntimeError # Issue 17758. Please triage this failure.
-LayoutTests/fast/dom/Document/CaretRangeFromPoint/caretRangeFromPoint-in-zoom-and-scroll_t01: RuntimeError # Issue 17758. Please triage this failure.
-LayoutTests/fast/dom/Document/CaretRangeFromPoint/hittest-relative-to-viewport_t01: RuntimeError # Issue 17758. Please triage this failure.
-LayoutTests/fast/dom/Document/CaretRangeFromPoint/replace-element_t01: Pass, RuntimeError # Issue 17758. Please triage this failure.
-LayoutTests/fast/dom/Document/createElementNS-namespace-err_t01: RuntimeError # Issue 17758. Please triage this failure.
-LayoutTests/fast/dom/Element/attribute-uppercase_t01: RuntimeError # Issue 17758. Please triage this failure.
-LayoutTests/fast/dom/Element/getClientRects_t01: RuntimeError # Issue 17758. Please triage this failure.
-LayoutTests/fast/dom/Element/setAttributeNS-namespace-err_t01: RuntimeError # Issue 17758. Please triage this failure.
-LayoutTests/fast/html/hidden-attr_t01: RuntimeError # Issue 17758. Please triage this failure.
-LayoutTests/fast/html/imports/import-element-removed-flag_t01: RuntimeError # Issue 17758. Please triage this failure.
-LayoutTests/fast/html/imports/import-events_t01: RuntimeError # Issue 17758. Please triage this failure.
-LibTest/async/Stream/Stream.periodic_A01_t01: Pass, RuntimeError # Issue 17758. Please triage this failure.
-LibTest/html/Document/childNodes_A01_t01: RuntimeError # Issue 17758. Please triage this failure.
-LibTest/html/Document/clone_A01_t01: RuntimeError # Issue 17758. Please triage this failure.
-LibTest/html/Document/clone_A01_t02: RuntimeError # Issue 17758. Please triage this failure.
-LibTest/html/Document/securityPolicy_A01_t01: RuntimeError # Issue 17758. Please triage this failure.
-LibTest/html/Element/borderEdge_A01_t01: RuntimeError # Issue 17758. Please triage this failure.
-LibTest/html/Element/contentEdge_A01_t01: RuntimeError # Issue 17758. Please triage this failure.
-LibTest/html/Element/dataset_A02_t01: RuntimeError # Issue 17758. Please triage this failure.
-LibTest/html/Element/getAttributeNS_A01_t01: RuntimeError # Issue 17758. Please triage this failure.
-LibTest/html/Element/getAttributeNS_A01_t02: RuntimeError # Issue 19055.
-LibTest/html/Element/getClientRects_A01_t02: RuntimeError # Issue 17758. Please triage this failure.
-LibTest/html/Element/getNamespacedAttributes_A01_t01: RuntimeError # Issue 17758. Please triage this failure.
-LibTest/html/Element/isContentEditable_A01_t01: RuntimeError # Issue 17758. Please triage this failure.
-LibTest/html/Element/isContentEditable_A02_t01: RuntimeError # Issue 17758. Please triage this failure.
-LibTest/html/Element/marginEdge_A01_t01: RuntimeError # Issue 17758. Please triage this failure.
-LibTest/html/Element/paddingEdge_A01_t01: RuntimeError # Issue 17758. Please triage this failure.
-LibTest/html/Element/replaceWith_A01_t02: RuntimeError # Issue 17758. Please triage this failure.
-LibTest/html/HttpRequest/responseType_A01_t01: RuntimeError # Issue 17758. Please triage this failure.
-LibTest/html/HttpRequest/responseType_A01_t03: RuntimeError # Issue 17758. Please triage this failure.
-LibTest/html/HttpRequest/statusText_A01_t01: RuntimeError # Issue 17758. Please triage this failure.
-LibTest/html/IFrameElement/IFrameElement.created_A01_t01: RuntimeError # Issue 17758. Please triage this failure.
-LibTest/html/IFrameElement/appendHtml_A01_t01: RuntimeError # Issue 17758. Please triage this failure.
-LibTest/html/IFrameElement/appendHtml_A01_t02: RuntimeError # Issue 17758. Please triage this failure.
-LibTest/html/IFrameElement/attributeChanged_A01_t01: RuntimeError # Issue 17758. Please triage this failure.
-LibTest/html/IFrameElement/attributes_setter_A01_t01: RuntimeError # Issue 17758. Please triage this failure.
-LibTest/html/IFrameElement/borderEdge_A01_t01: RuntimeError # Issue 17758. Please triage this failure.
-LibTest/html/IFrameElement/clone_A01_t02: RuntimeError # Issue 17758. Please triage this failure.
-LibTest/html/IFrameElement/contentWindow_A01_t01: RuntimeError # Issue 17758. Please triage this failure.
-LibTest/html/IFrameElement/createFragment_A01_t01: RuntimeError # Issue 17758. Please triage this failure.
-LibTest/html/IFrameElement/createFragment_A01_t02: RuntimeError # Issue 17758. Please triage this failure.
-LibTest/html/IFrameElement/createFragment_A01_t03: RuntimeError # Issue 17758. Please triage this failure.
-LibTest/html/IFrameElement/createShadowRoot_A01_t01: RuntimeError # Issue 17758. Please triage this failure.
-LibTest/html/IFrameElement/getClientRects_A01_t02: RuntimeError # Issue 17758. Please triage this failure.
-LibTest/html/IFrameElement/getNamespacedAttributes_A01_t01: RuntimeError # Issue 17758. Please triage this failure.
-LibTest/html/IFrameElement/innerHtml_A01_t01: RuntimeError # Issue 17758. Please triage this failure.
-LibTest/html/IFrameElement/isContentEditable_A01_t01: RuntimeError # Issue 17758. Please triage this failure.
-LibTest/html/IFrameElement/marginEdge_A01_t01: RuntimeError # Issue 17758. Please triage this failure.
-LibTest/html/IFrameElement/offsetTo_A01_t01: RuntimeError # Issue 17758. Please triage this failure.
-LibTest/html/IFrameElement/setInnerHtml_A01_t01: RuntimeError # Issue 17758. Please triage this failure.
-LibTest/html/Window/close_A01_t01: RuntimeError # Issue 17758. Please triage this failure.
-LibTest/html/Window/find_A01_t01: RuntimeError # Issue 17758. Please triage this failure.
-LibTest/html/Window/find_A03_t01: RuntimeError # Issue 17758. Please triage this failure.
-LibTest/html/Window/find_A06_t01: RuntimeError # Issue 17758. Please triage this failure.
-LibTest/html/Window/moveTo_A01_t01: RuntimeError, Pass # Issue 17758. Please triage this failure.
-LibTest/html/Window/moveTo_A02_t01: RuntimeError # Issue 17758. Please triage this failure.
-LibTest/html/Window/postMessage_A01_t01: RuntimeError # Issue 17758. Please triage this failure.
-LibTest/html/Window/requestFileSystem_A02_t01: RuntimeError, Pass # Issue 17758. Please triage this failure.
-LibTest/html/Window/resizeBy_A01_t01: RuntimeError # Issue 17758. Please triage this failure.
-LibTest/html/Window/resizeTo_A01_t01: RuntimeError # Issue 17758. Please triage this failure.
-LibTest/isolate/SendPort/send_A01_t01: RuntimeError # Issue 17758. Please triage this failure.
-LibTest/isolate/SendPort/send_A01_t02: RuntimeError # Issue 17758. Please triage this failure.
-LibTest/isolate/SendPort/send_A01_t03: RuntimeError # Issue 17758. Please triage this failure.
-LibTest/isolate/SendPort/send_A01_t04: RuntimeError # Issue 17758. Please triage this failure.
-
+LibTest/html/Element/blur_A01_t01: Skip # co19-roll r706. Please triage this failure.
+LibTest/html/IFrameElement/blur_A01_t01: Skip # co19-roll r706. Please triage this failure.
+LibTest/html/Element/focus_A01_t01: Skip # co19-roll r706. Please triage this failure.
+LibTest/html/IFrameElement/focus_A01_t01: Skip # co19-roll r706. Please triage this failure.
+LibTest/html/IFrameElement/enteredView_A01_t01: Skip # co19-roll r706. Please triage this failure.
+LibTest/html/IFrameElement/leftView_A01_t01: Skip # co19-roll r706. Please triage this failure.
+LibTest/html/HttpRequest/onError_A01_t02: Skip # co19-roll r706. Please triage this failure.
+LibTest/html/HttpRequest/responseText_A01_t02: Skip # co19-roll r706. Please triage this failure.
+LibTest/html/HttpRequestUpload/onError_A01_t02: Skip # co19-roll r706. Please triage this failure.
+LibTest/html/HttpRequestUpload/onLoadEnd_A01_t01: Skip # co19-roll r706. Please triage this failure.
+LibTest/html/HttpRequestUpload/onLoadStart_A01_t01: Skip # co19-roll r706. Please triage this failure.
+LibTest/html/HttpRequestUpload/onLoad_A01_t01: Skip # co19-roll r706. Please triage this failure.
+WebPlatformTest/dom/events/event_constants/constants_A01_t01: Skip # co19-roll r706. Please triage this failure.
+WebPlatformTest/dom/events/event_constructors/Event_A01_t01: Skip # co19-roll r706. Please triage this failure.
+WebPlatformTest/dom/events/event_constructors/Event_A02_t01: Skip # co19-roll r706. Please triage this failure.
+LayoutTests/fast/dom/DOMImplementation/createDocument-namespace-err_t01: RuntimeError # co19-roll r706. Please triage this failure.
+LayoutTests/fast/dom/Document/CaretRangeFromPoint/basic_t01: RuntimeError # co19-roll r706. Please triage this failure.
+LayoutTests/fast/dom/Document/CaretRangeFromPoint/caretRangeFromPoint-in-zoom-and-scroll_t01: RuntimeError # co19-roll r706. Please triage this failure.
+LayoutTests/fast/dom/Document/CaretRangeFromPoint/hittest-relative-to-viewport_t01: RuntimeError # co19-roll r706. Please triage this failure.
+LayoutTests/fast/dom/Document/CaretRangeFromPoint/replace-element_t01: Pass, RuntimeError # co19-roll r706. Please triage this failure.
+LayoutTests/fast/dom/Document/createElementNS-namespace-err_t01: RuntimeError # co19-roll r706. Please triage this failure.
+LayoutTests/fast/dom/Element/attribute-uppercase_t01: RuntimeError # co19-roll r706. Please triage this failure.
+LayoutTests/fast/dom/Element/getClientRects_t01: RuntimeError # co19-roll r706. Please triage this failure.
+LayoutTests/fast/dom/Element/setAttributeNS-namespace-err_t01: RuntimeError # co19-roll r706. Please triage this failure.
+LayoutTests/fast/html/hidden-attr_t01: RuntimeError # co19-roll r706. Please triage this failure.
+LayoutTests/fast/html/imports/import-element-removed-flag_t01: RuntimeError # co19-roll r706. Please triage this failure.
+LayoutTests/fast/html/imports/import-events_t01: RuntimeError # co19-roll r706. Please triage this failure.
+LibTest/async/Stream/Stream.periodic_A01_t01: Pass, RuntimeError # co19-roll r706. Please triage this failure.
+LibTest/html/Document/childNodes_A01_t01: RuntimeError # co19-roll r706. Please triage this failure.
+LibTest/html/Document/clone_A01_t01: RuntimeError # co19-roll r706. Please triage this failure.
+LibTest/html/Document/clone_A01_t02: RuntimeError # co19-roll r706. Please triage this failure.
+LibTest/html/Document/securityPolicy_A01_t01: RuntimeError # co19-roll r706. Please triage this failure.
+LibTest/html/Element/borderEdge_A01_t01: RuntimeError # co19-roll r706. Please triage this failure.
+LibTest/html/Element/contentEdge_A01_t01: RuntimeError # co19-roll r706. Please triage this failure.
+LibTest/html/Element/dataset_A02_t01: RuntimeError # co19-roll r706. Please triage this failure.
+LibTest/html/Element/getAttributeNS_A01_t01: RuntimeError # co19-roll r706. Please triage this failure.
+LibTest/html/Element/getAttributeNS_A01_t02: RuntimeError # Please triage this failure.
+LibTest/html/Element/getClientRects_A01_t02: RuntimeError # co19-roll r706. Please triage this failure.
+LibTest/html/Element/getNamespacedAttributes_A01_t01: RuntimeError # co19-roll r706. Please triage this failure.
+LibTest/html/Element/isContentEditable_A01_t01: RuntimeError # co19-roll r706. Please triage this failure.
+LibTest/html/Element/isContentEditable_A02_t01: RuntimeError # co19-roll r706. Please triage this failure.
+LibTest/html/Element/marginEdge_A01_t01: RuntimeError # co19-roll r706. Please triage this failure.
+LibTest/html/Element/paddingEdge_A01_t01: RuntimeError # co19-roll r706. Please triage this failure.
+LibTest/html/Element/replaceWith_A01_t02: RuntimeError # co19-roll r706. Please triage this failure.
+LibTest/html/HttpRequest/responseType_A01_t01: RuntimeError # co19-roll r706. Please triage this failure.
+LibTest/html/HttpRequest/responseType_A01_t03: RuntimeError # co19-roll r706. Please triage this failure.
+LibTest/html/HttpRequest/statusText_A01_t01: RuntimeError # co19-roll r706. Please triage this failure.
+LibTest/html/IFrameElement/IFrameElement.created_A01_t01: RuntimeError # co19-roll r706. Please triage this failure.
+LibTest/html/IFrameElement/appendHtml_A01_t01: RuntimeError # co19-roll r706. Please triage this failure.
+LibTest/html/IFrameElement/appendHtml_A01_t02: RuntimeError # co19-roll r706. Please triage this failure.
+LibTest/html/IFrameElement/attributeChanged_A01_t01: RuntimeError # co19-roll r706. Please triage this failure.
+LibTest/html/IFrameElement/attributes_setter_A01_t01: RuntimeError # co19-roll r706. Please triage this failure.
+LibTest/html/IFrameElement/borderEdge_A01_t01: RuntimeError # co19-roll r706. Please triage this failure.
+LibTest/html/IFrameElement/clone_A01_t02: RuntimeError # co19-roll r706. Please triage this failure.
+LibTest/html/IFrameElement/contentWindow_A01_t01: RuntimeError # co19-roll r706. Please triage this failure.
+LibTest/html/IFrameElement/createFragment_A01_t01: RuntimeError # co19-roll r706. Please triage this failure.
+LibTest/html/IFrameElement/createFragment_A01_t02: RuntimeError # co19-roll r706. Please triage this failure.
+LibTest/html/IFrameElement/createFragment_A01_t03: RuntimeError # co19-roll r706. Please triage this failure.
+LibTest/html/IFrameElement/createShadowRoot_A01_t01: RuntimeError # co19-roll r706. Please triage this failure.
+LibTest/html/IFrameElement/getClientRects_A01_t02: RuntimeError # co19-roll r706. Please triage this failure.
+LibTest/html/IFrameElement/getNamespacedAttributes_A01_t01: RuntimeError # co19-roll r706. Please triage this failure.
+LibTest/html/IFrameElement/innerHtml_A01_t01: RuntimeError # co19-roll r706. Please triage this failure.
+LibTest/html/IFrameElement/isContentEditable_A01_t01: RuntimeError # co19-roll r706. Please triage this failure.
+LibTest/html/IFrameElement/marginEdge_A01_t01: RuntimeError # co19-roll r706. Please triage this failure.
+LibTest/html/IFrameElement/offsetTo_A01_t01: RuntimeError # co19-roll r706. Please triage this failure.
+LibTest/html/IFrameElement/setInnerHtml_A01_t01: RuntimeError # co19-roll r706. Please triage this failure.
+LibTest/html/Window/close_A01_t01: RuntimeError # co19-roll r706. Please triage this failure.
+LibTest/html/Window/find_A01_t01: RuntimeError # co19-roll r706. Please triage this failure.
+LibTest/html/Window/find_A03_t01: RuntimeError # co19-roll r706. Please triage this failure.
+LibTest/html/Window/find_A06_t01: RuntimeError # co19-roll r706. Please triage this failure.
+LibTest/html/Window/moveTo_A01_t01: RuntimeError, Pass # co19-roll r706. Please triage this failure.
+LibTest/html/Window/moveTo_A02_t01: RuntimeError # co19-roll r706. Please triage this failure.
+LibTest/html/Window/postMessage_A01_t01: RuntimeError # co19-roll r706. Please triage this failure.
+LibTest/html/Window/requestFileSystem_A02_t01: RuntimeError, Pass # co19-roll r706. Please triage this failure.
+LibTest/html/Window/resizeBy_A01_t01: RuntimeError # co19-roll r706. Please triage this failure.
+LibTest/html/Window/resizeTo_A01_t01: RuntimeError # co19-roll r706. Please triage this failure.
+LibTest/isolate/SendPort/send_A01_t01: RuntimeError # co19-roll r706. Please triage this failure.
+LibTest/isolate/SendPort/send_A01_t02: RuntimeError # co19-roll r706. Please triage this failure.
+LibTest/isolate/SendPort/send_A01_t03: RuntimeError # co19-roll r706. Please triage this failure.
+LibTest/isolate/SendPort/send_A01_t04: RuntimeError # co19-roll r706. Please triage this failure.
Language/12_Expressions/13_Spawning_an_Isolate_A01_t01: RuntimeError # co19-roll r667: Please triage this failure
LibTest/isolate/Isolate/spawn_A01_t01: RuntimeError # co19-roll r667: Please triage this failure
LibTest/isolate/Isolate/spawn_A01_t02: RuntimeError # co19-roll r667: Please triage this failure
LibTest/isolate/Isolate/spawn_A01_t03: RuntimeError # co19-roll r667: Please triage this failure
LibTest/isolate/Isolate/spawn_A01_t04: RuntimeError # co19-roll r667: Please triage this failure
LibTest/isolate/Isolate/spawn_A01_t05: RuntimeError # co19-roll r667: Please triage this failure
-
LibTest/async/Timer/Timer_A01_t01: RuntimeError, Pass # Issue 16475
-
LayoutTests/fast/dom/HTMLAnchorElement/remove-href-from-focused-anchor_t01: Skip # co19-roll r722: Please triage this failure.
LayoutTests/fast/dom/HTMLAnchorElement/set-href-attribute-hash_t01: RuntimeError # co19-roll r722: Please triage this failure.
LayoutTests/fast/dom/HTMLAnchorElement/set-href-attribute-host_t01: RuntimeError # co19-roll r722: Please triage this failure.
@@ -264,11 +264,9 @@
LibTest/html/Node/nodes_A01_t02: RuntimeError # co19-roll r722: Please triage this failure.
LibTest/html/Node/parent_A01_t01: RuntimeError # co19-roll r722: Please triage this failure.
LibTest/html/Node/previousNode_A01_t01: RuntimeError # co19-roll r722: Please triage this failure.
-WebPlatformTest/custom-elements/concepts/type_A03_t01: RuntimeError # Issue 19055.
+WebPlatformTest/custom-elements/concepts/type_A03_t01: RuntimeError # Please triage this failure.
WebPlatformTest/custom-elements/concepts/type_A05_t01: RuntimeError # co19-roll r722: Please triage this failure.
WebPlatformTest/custom-elements/concepts/type_A06_t01: RuntimeError # co19-roll r722: Please triage this failure.
-WebPlatformTest/dom/nodes/Node-appendChild_t01: RuntimeError # Issue 21136
-WebPlatformTest/dom/ranges/Range-comparePoint_t02: RuntimeError # Issue 21136
WebPlatformTest/html-templates/innerhtml-on-templates/innerhtml_t01: RuntimeError # co19-roll r722: Please triage this failure.
WebPlatformTest/html-templates/parsing-html-templates/additions-to-the-in-head-insertion-mode/generating-of-implied-end-tags_t01: RuntimeError # co19-roll r722: Please triage this failure.
WebPlatformTest/html-templates/parsing-html-templates/additions-to-the-in-head-insertion-mode/template-end-tag-without-start-one_t01: RuntimeError # co19-roll r722: Please triage this failure.
@@ -286,14 +284,12 @@
WebPlatformTest/shadow-dom/events/event-retargeting/test-001_t01: RuntimeError # co19-roll r722: Please triage this failure.
WebPlatformTest/shadow-dom/events/event-retargeting/test-002_t01: RuntimeError # co19-roll r722: Please triage this failure.
WebPlatformTest/shadow-dom/events/event-retargeting/test-004_t01: RuntimeError # co19-roll r722: Please triage this failure.
-
WebPlatformTest/shadow-dom/events/retargeting-focus-events/test-001_t01: RuntimeError, Skip # co19-roll r722: Please triage this failure.
WebPlatformTest/shadow-dom/events/retargeting-focus-events/test-001_t02: Skip # co19-roll r722: Please triage this failure.
WebPlatformTest/shadow-dom/events/retargeting-focus-events/test-001_t05: Skip # co19-roll r722: Please triage this failure.
WebPlatformTest/shadow-dom/events/retargeting-focus-events/test-001_t06: Skip # co19-roll r722: Please triage this failure.
WebPlatformTest/shadow-dom/events/retargeting-focus-events/test-002_t01: RuntimeError, Pass # co19-roll r722: Please triage this failure.
WebPlatformTest/shadow-dom/events/retargeting-focus-events/test-003_t01: RuntimeError, Pass # co19-roll r722: Please triage this failure.
-
WebPlatformTest/shadow-dom/events/retargeting-relatedtarget/test-003_t01: RuntimeError # co19-roll r722: Please triage this failure.
WebPlatformTest/shadow-dom/html-elements-and-their-shadow-trees/test-001_t01: RuntimeError # co19-roll r722: Please triage this failure.
WebPlatformTest/shadow-dom/html-elements-and-their-shadow-trees/test-002_t01: RuntimeError # co19-roll r722: Please triage this failure.
@@ -302,19 +298,6 @@
WebPlatformTest/shadow-dom/shadow-trees/distributed-pseudo-element/test-001_t01: RuntimeError # co19-roll r722: Please triage this failure.
WebPlatformTest/shadow-dom/shadow-trees/distributed-pseudo-element/test-002_t01: RuntimeError # co19-roll r722: Please triage this failure.
WebPlatformTest/shadow-dom/shadow-trees/lower-boundary-encapsulation/test-004_t01: RuntimeError # co19-roll r722: Please triage this failure.
-WebPlatformTest/shadow-dom/shadow-trees/satisfying-matching-criteria/test-007_t01: RuntimeError # co19-roll r722: Please triage this failure.
-WebPlatformTest/shadow-dom/shadow-trees/satisfying-matching-criteria/test-008_t01: RuntimeError # Issue 19055.
-WebPlatformTest/shadow-dom/shadow-trees/satisfying-matching-criteria/test-009_t01: RuntimeError # Issue 19055.
-WebPlatformTest/shadow-dom/shadow-trees/satisfying-matching-criteria/test-010_t01: RuntimeError # Issue 19055.
-WebPlatformTest/shadow-dom/shadow-trees/satisfying-matching-criteria/test-011_t01: RuntimeError # Issue 19055.
-WebPlatformTest/shadow-dom/shadow-trees/satisfying-matching-criteria/test-012_t01: RuntimeError # Issue 19055.
-WebPlatformTest/shadow-dom/shadow-trees/satisfying-matching-criteria/test-013_t01: RuntimeError # Issue 19055.
-WebPlatformTest/shadow-dom/shadow-trees/satisfying-matching-criteria/test-014_t01: RuntimeError # Issue 19055.
-WebPlatformTest/shadow-dom/shadow-trees/satisfying-matching-criteria/test-015_t01: RuntimeError # Issue 19055.
-WebPlatformTest/shadow-dom/shadow-trees/satisfying-matching-criteria/test-016_t01: RuntimeError # Issue 19055.
-WebPlatformTest/shadow-dom/shadow-trees/satisfying-matching-criteria/test-018_t01: RuntimeError # Issue 19055.
-WebPlatformTest/shadow-dom/shadow-trees/satisfying-matching-criteria/test-019_t01: RuntimeError # Issue 19055.
-WebPlatformTest/shadow-dom/shadow-trees/satisfying-matching-criteria/test-020_t01: RuntimeError # Issue 19055.
WebPlatformTest/shadow-dom/shadow-trees/upper-boundary-encapsulation/ownerdocument-002_t01: RuntimeError # co19-roll r722: Please triage this failure.
LayoutTests/fast/dom/HTMLDocument/active-element-gets-unforcusable_t01: Skip # co19-roll r722: Please triage this failure.
LayoutTests/fast/dom/HTMLDocument/set-focus-on-valid-element_t01: Skip # co19-roll r722: Please triage this failure.
@@ -335,7 +318,7 @@
LayoutTests/fast/dom/MutationObserver/weak-callback-gc-crash_t01: RuntimeError # co19-roll r722: Please triage this failure.
LayoutTests/fast/dom/Node/initial-values_t01: RuntimeError # co19-roll r722: Please triage this failure.
LayoutTests/fast/dom/Range/range-created-during-remove-children_t01: RuntimeError, Pass # co19-roll r722: Please triage this failure.
-LayoutTests/fast/dom/Range/range-detached-exceptions_t01: RuntimeError # Issue 19055.
+LayoutTests/fast/dom/Range/range-detached-exceptions_t01: RuntimeError # Please triage this failure.
LayoutTests/fast/html/imports/import-element-removed-flag_t01: Skip # co19-roll r722: Please triage this failure.
LibTest/collection/ListBase/ListBase_class_A01_t01: Skip # co19-roll r722: Please triage this failure.
LibTest/collection/ListMixin/ListMixin_class_A01_t01: Skip # co19-roll r722: Please triage this failure.
@@ -361,25 +344,25 @@
WebPlatformTest/dom/nodes/Node-appendChild_t02: RuntimeError, Pass # co19-roll r722: Please triage this failure.
WebPlatformTest/dom/nodes/Node-insertBefore_t01: RuntimeError # co19-roll r722: Please triage this failure.
WebPlatformTest/dom/nodes/Node-isEqualNode_t01: RuntimeError # co19-roll r722: Please triage this failure.
-WebPlatformTest/dom/nodes/Node-nodeName_t01: RuntimeError # Issue 19055.
+WebPlatformTest/dom/nodes/Node-nodeName_t01: RuntimeError # Please triage this failure.
WebPlatformTest/dom/nodes/Node-replaceChild_t01: RuntimeError # co19-roll r722: Please triage this failure
-WebPlatformTest/dom/nodes/Node-textContent_t01: RuntimeError # Issue 18931
+WebPlatformTest/dom/nodes/Node-textContent_t01: RuntimeError # Please triage this failure.
WebPlatformTest/dom/nodes/attributes/setAttributeNS_A05_t01: RuntimeError # co19-roll r722: Please triage this failure.
WebPlatformTest/dom/nodes/attributes/setAttributeNS_A06_t03: RuntimeError # co19-roll r722: Please triage this failure.
WebPlatformTest/dom/nodes/attributes/setAttributeNS_A07_t02: RuntimeError # co19-roll r722: Please triage this failure.
WebPlatformTest/dom/nodes/attributes/setAttributeNS_A07_t03: RuntimeError # co19-roll r722: Please triage this failure.
WebPlatformTest/dom/nodes/attributes/setAttributeNS_A08_t01: RuntimeError # co19-roll r722: Please triage this failure.
WebPlatformTest/dom/nodes/attributes/setAttribute_A03_t01: RuntimeError # co19-roll r722: Please triage this failure.
-WebPlatformTest/shadow-dom/elements-and-dom-objects/shadowroot-object/shadowroot-attributes/test-005_t01: RuntimeError # Issue 18931
-WebPlatformTest/shadow-dom/elements-and-dom-objects/shadowroot-object/shadowroot-attributes/test-006_t01: RuntimeError # Issue 18931
-WebPlatformTest/shadow-dom/elements-and-dom-objects/the-content-html-element/test-004_t01: RuntimeError # Issue 18931
-WebPlatformTest/shadow-dom/elements-and-dom-objects/the-content-html-element/test-004_t02: RuntimeError # Issue 18931
-WebPlatformTest/shadow-dom/elements-and-dom-objects/the-shadow-html-element/test-003_t01: RuntimeError # Issue 18931
-WebPlatformTest/shadow-dom/elements-and-dom-objects/the-shadow-html-element/test-003_t02: RuntimeError # Issue 18931
-WebPlatformTest/shadow-dom/events/event-dispatch/test-002_t01: RuntimeError # Issue 18931
-WebPlatformTest/shadow-dom/events/retargeting-relatedtarget/test-001_t01: RuntimeError # Issue 18931
-WebPlatformTest/shadow-dom/events/retargeting-relatedtarget/test-002_t01: RuntimeError # Issue 18931
-WebPlatformTest/shadow-dom/shadow-trees/upper-boundary-encapsulation/test-009_t01: RuntimeError # Issue 18931
+WebPlatformTest/shadow-dom/elements-and-dom-objects/shadowroot-object/shadowroot-attributes/test-005_t01: RuntimeError # Please triage this failure.
+WebPlatformTest/shadow-dom/elements-and-dom-objects/shadowroot-object/shadowroot-attributes/test-006_t01: RuntimeError # Please triage this failure.
+WebPlatformTest/shadow-dom/elements-and-dom-objects/the-content-html-element/test-004_t01: RuntimeError # Please triage this failure.
+WebPlatformTest/shadow-dom/elements-and-dom-objects/the-content-html-element/test-004_t02: RuntimeError # Please triage this failure.
+WebPlatformTest/shadow-dom/elements-and-dom-objects/the-shadow-html-element/test-003_t01: RuntimeError # Please triage this failure.
+WebPlatformTest/shadow-dom/elements-and-dom-objects/the-shadow-html-element/test-003_t02: RuntimeError # Please triage this failure.
+WebPlatformTest/shadow-dom/events/event-dispatch/test-002_t01: RuntimeError # Please triage this failure.
+WebPlatformTest/shadow-dom/events/retargeting-relatedtarget/test-001_t01: RuntimeError # Please triage this failure.
+WebPlatformTest/shadow-dom/events/retargeting-relatedtarget/test-002_t01: RuntimeError # Please triage this failure.
+WebPlatformTest/shadow-dom/shadow-trees/upper-boundary-encapsulation/test-009_t01: RuntimeError # Please triage this failure.
# co19-roll r738.
WebPlatformTest/DOMEvents/approved/ProcessingInstruction.DOMCharacterDataModified_t01: Skip # Times out. co19-roll r738: Please triage this failure.
@@ -480,10 +463,6 @@
LayoutTests/fast/canvas/webgl/null-object-behaviour_t01: RuntimeError # co19-roll r761: Please triage this failure.
LayoutTests/fast/canvas/webgl/premultiplyalpha-test_t01: RuntimeError # co19-roll r761: Please triage this failure.
LayoutTests/fast/canvas/webgl/renderbuffer-initialization_t01: RuntimeError, Pass # co19-roll r761: Please triage this failure.
-LayoutTests/fast/canvas/webgl/tex-image-and-sub-image-2d-with-video-rgb565_t01: RuntimeError # co19-roll r761: Please triage this failure.
-LayoutTests/fast/canvas/webgl/tex-image-and-sub-image-2d-with-video-rgba4444_t01: RuntimeError # co19-roll r761: Please triage this failure.
-LayoutTests/fast/canvas/webgl/tex-image-and-sub-image-2d-with-video-rgba5551_t01: RuntimeError # co19-roll r761: Please triage this failure.
-LayoutTests/fast/canvas/webgl/tex-image-and-sub-image-2d-with-video_t01: RuntimeError # co19-roll r761: Please triage this failure.
LayoutTests/fast/canvas/webgl/triangle_t01: RuntimeError, Pass # co19-roll r761: Please triage this failure.
LayoutTests/fast/canvas/webgl/uniform-location_t01: RuntimeError # co19-roll r761: Please triage this failure.
LayoutTests/fast/canvas/winding-enumeration_t01: RuntimeError # co19-roll r761: Please triage this failure.
@@ -495,6 +474,7 @@
LayoutTests/fast/css/css-properties-case-insensitive_t01: RuntimeError # co19-roll r761: Please triage this failure.
LayoutTests/fast/css/css3-nth-tokens-style_t01: RuntimeError # co19-roll r761: Please triage this failure.
LayoutTests/fast/css/cursor-parsing-quirks_t01: RuntimeError # co19-roll r761: Please triage this failure.
+LayoutTests/fast/css/deprecated-flexbox-auto-min-size_t01: Pass, RuntimeError # co19-roll r761: Please triage this failure.
LayoutTests/fast/css/first-child-display-change-inverse_t01: RuntimeError # co19-roll r761: Please triage this failure.
LayoutTests/fast/css/focus-display-block-inline_t01: RuntimeError, Pass # co19-roll r761: Please triage this failure.
LayoutTests/fast/css/font-face-cache-bug_t01: RuntimeError # co19-roll r761: Please triage this failure.
@@ -704,7 +684,6 @@
LayoutTests/fast/sub-pixel/replaced-element-baseline_t01: RuntimeError # co19-roll r786: Please triage this failure.
LayoutTests/fast/sub-pixel/table-rows-have-stable-height_t01: RuntimeError # co19-roll r786: Please triage this failure.
LayoutTests/fast/table/anonymous-table-section-removed_t01: RuntimeError # co19-roll r786: Please triage this failure.
-LayoutTests/fast/table/before-child-non-table-section-add-table-crash_t01: RuntimeError # co19-roll r786: Please triage this failure.
LayoutTests/fast/table/caption-orthogonal-writing-mode-sizing_t01: RuntimeError # co19-roll r786: Please triage this failure.
LayoutTests/fast/table/col-width-span-expand_t01: RuntimeError # co19-roll r786: Please triage this failure.
LayoutTests/fast/table/computeLogicalWidth-table-needsSectionRecalc_t01: Pass, RuntimeError # co19-roll r786: Please triage this failure.
@@ -784,27 +763,154 @@
LayoutTests/fast/xsl/default-html_t01: RuntimeError # co19-roll r786: Please triage this failure.
WebPlatformTest/html/semantics/forms/the-input-element/password_t01: RuntimeError # co19-roll r786: Please triage this failure.
WebPlatformTest/html/syntax/parsing/Document.getElementsByTagName-foreign_t02: RuntimeError # co19-roll r786: Please triage this failure.
-LayoutTests/fast/dom/52776_t01: RuntimeError # Re-enable fast/dom tests: Please triage this failure.
-LayoutTests/fast/dom/DOMException/XPathException_t01: RuntimeError # Re-enable fast/dom tests: Please triage this failure.
-LayoutTests/fast/dom/Node/fragment-mutation_t01: RuntimeError # Re-enable fast/dom tests: Please triage this failure.
-LayoutTests/fast/dom/Range/bug-19527_t01: RuntimeError # Re-enable fast/dom tests: Please triage this failure.
-LayoutTests/fast/dom/Range/insertNode-empty-fragment-crash_t01: RuntimeError # Re-enable fast/dom tests: Please triage this failure.
-LayoutTests/fast/dom/Range/mutation_t01: RuntimeError # Re-enable fast/dom tests: Please triage this failure.
-LayoutTests/fast/dom/Range/range-constructor_t01: RuntimeError # Re-enable fast/dom tests: Please triage this failure.
-LayoutTests/fast/dom/Range/range-expand_t01: RuntimeError # Re-enable fast/dom tests: Please triage this failure.
-LayoutTests/fast/dom/Range/range-insertNode-separate-endContainer_t01: RuntimeError # Re-enable fast/dom tests: Please triage this failure.
-LayoutTests/fast/dom/Range/range-insertNode-splittext_t01: RuntimeError # Re-enable fast/dom tests: Please triage this failure.
-LayoutTests/fast/dom/document-importNode-arguments_t01: RuntimeError # Re-enable fast/dom tests: Please triage this failure.
-LayoutTests/fast/dom/domparser-parsefromstring-mimetype-support_t01: RuntimeError # Re-enable fast/dom tests: Please triage this failure.
-LayoutTests/fast/dom/horizontal-scrollbar-in-rtl_t01: RuntimeError # Re-enable fast/dom tests: Please triage this failure.
-LayoutTests/fast/dom/text-api-arguments_t01: RuntimeError # Re-enable fast/dom tests: Please triage this failure.
-Language/14_Libraries_and_Scripts/3_Parts_A01_t05: Skip # Times out flakily. Issue 20881
+LayoutTests/fast/dom/52776_t01: RuntimeError # Please triage this failure.
+LayoutTests/fast/dom/DOMException/XPathException_t01: RuntimeError # Please triage this failure.
+LayoutTests/fast/dom/Node/fragment-mutation_t01: RuntimeError # Please triage this failure.
+LayoutTests/fast/dom/Range/bug-19527_t01: RuntimeError # Please triage this failure.
+LayoutTests/fast/dom/Range/insertNode-empty-fragment-crash_t01: RuntimeError # Please triage this failure.
+LayoutTests/fast/dom/Range/mutation_t01: RuntimeError # Please triage this failure.
+LayoutTests/fast/dom/Range/range-constructor_t01: RuntimeError # Please triage this failure.
+LayoutTests/fast/dom/Range/range-expand_t01: RuntimeError # Please triage this failure.
+LayoutTests/fast/dom/Range/range-insertNode-separate-endContainer_t01: RuntimeError # Please triage this failure.
+LayoutTests/fast/dom/Range/range-insertNode-splittext_t01: RuntimeError # Please triage this failure.
+LayoutTests/fast/dom/document-importNode-arguments_t01: RuntimeError # Please triage this failure.
+LayoutTests/fast/dom/domparser-parsefromstring-mimetype-support_t01: RuntimeError # Please triage this failure.
+LayoutTests/fast/dom/horizontal-scrollbar-in-rtl_t01: RuntimeError # Please triage this failure.
+LayoutTests/fast/dom/text-api-arguments_t01: RuntimeError # Please triage this failure.
+
+# co19-roll r801
+LayoutTests/fast/canvas/webgl/canvas-test_t01: Pass, RuntimeError # co19-roll r801: Please triage this failure.
+LayoutTests/fast/dom/Document/CaretRangeFromPoint/caretRangeFromPoint-in-strict-mode-wtih-checkbox_t01: Pass, RuntimeError # co19-roll r801: Please triage this failure.
+LayoutTests/fast/dom/MutationObserver/database-callback-delivery_t01: Pass, RuntimeError # co19-roll r801: Please triage this failure.
+LayoutTests/fast/events/change-overflow-on-overflow-change_t01: Pass, RuntimeError # co19-roll r801: Please triage this failure.
+LayoutTests/fast/filesystem/file-writer-abort-continue_t01: Pass, RuntimeError # co19-roll r801: Please triage this failure.
+LayoutTests/fast/filesystem/file-writer-abort-depth_t01: Pass, RuntimeError # co19-roll r801: Please triage this failure.
+LayoutTests/fast/filesystem/file-writer-events_t01: Pass, RuntimeError # co19-roll r801: Please triage this failure.
+LayoutTests/fast/filesystem/file-writer-gc-blob_t01: Pass, RuntimeError # co19-roll r801: Please triage this failure.
+LayoutTests/fast/filesystem/file-writer-write-overlapped_t01: Pass, RuntimeError # co19-roll r801: Please triage this failure.
+LayoutTests/fast/filesystem/read-directory-many_t01: Pass, RuntimeError # co19-roll r801: Please triage this failure.
+LayoutTests/fast/filesystem/simple-readonly_t01: Pass, RuntimeError # co19-roll r801: Please triage this failure.
+LayoutTests/fast/forms/HTMLOptionElement_selected2_t01: Skip # Times out. co19-roll r801: Please triage this failure.
+LayoutTests/fast/forms/autofocus-focus-only-once_t01: Skip # Times out. co19-roll r801: Please triage this failure.
+LayoutTests/fast/forms/autofocus-input-css-style-change_t01: Skip # Times out. co19-roll r801: Please triage this failure.
+LayoutTests/fast/forms/autofocus-opera-007_t01: Skip # Times out. co19-roll r801: Please triage this failure.
+LayoutTests/fast/forms/autofocus-readonly-attribute_t01: Skip # Times out. co19-roll r801: Please triage this failure.
+LayoutTests/fast/forms/button-baseline-and-collapsing_t01: Pass, RuntimeError # co19-roll r801: Please triage this failure.
+LayoutTests/fast/forms/button/button-disabled-blur_t01: Pass, RuntimeError # co19-roll r801: Please triage this failure.
+LayoutTests/fast/forms/clone-input-with-dirty-value_t01: RuntimeError # co19-roll r801: Please triage this failure.
+LayoutTests/fast/forms/date-multiple-fields/date-multiple-fields-change-layout-by-value_t01: Pass, RuntimeError # co19-roll r801: Please triage this failure.
+LayoutTests/fast/forms/date-multiple-fields/date-multiple-fields-onblur-setvalue-onfocusremoved_t01: Pass, RuntimeError # co19-roll r801: Please triage this failure.
+LayoutTests/fast/forms/datetimelocal-multiple-fields/datetimelocal-multiple-fields-change-layout-by-value_t01: Pass, RuntimeError # co19-roll r801: Please triage this failure.
+LayoutTests/fast/forms/focus-style-pending_t01: Skip # Times out. co19-roll r801: Please triage this failure.
+LayoutTests/fast/forms/focus_t01: Pass, RuntimeError # co19-roll r801: Please triage this failure.
+LayoutTests/fast/forms/formmethod-attribute-button-html_t01: Pass, RuntimeError # co19-roll r801: Please triage this failure.
+LayoutTests/fast/forms/formmethod-attribute-input-html_t01: Pass, RuntimeError # co19-roll r801: Please triage this failure.
+LayoutTests/fast/forms/input-appearance-elementFromPoint_t01: RuntimeError # co19-roll r801: Please triage this failure.
+LayoutTests/fast/forms/input-hit-test-border_t01: Pass, RuntimeError # co19-roll r801: Please triage this failure.
+LayoutTests/fast/forms/input-stepup-stepdown_t01: RuntimeError # co19-roll r801: Please triage this failure.
+LayoutTests/fast/forms/input-width-height-attributes-without-renderer-loaded-image_t01: RuntimeError # co19-roll r801: Please triage this failure.
+LayoutTests/fast/forms/listbox-select-all_t01: Pass, RuntimeError # co19-roll r801: Please triage this failure.
+LayoutTests/fast/forms/listbox-selection-2_t01: RuntimeError # co19-roll r801: Please triage this failure.
+LayoutTests/fast/forms/menulist-disabled-selected-option_t01: Pass, RuntimeError # co19-roll r801: Please triage this failure.
+LayoutTests/fast/forms/menulist-selection-reset_t01: RuntimeError # co19-roll r801: Please triage this failure.
+LayoutTests/fast/forms/menulist-submit-without-selection_t01: Pass, RuntimeError # co19-roll r801: Please triage this failure.
+LayoutTests/fast/forms/multiple-selected-options-innerHTML_t01: RuntimeError # co19-roll r801: Please triage this failure.
+LayoutTests/fast/forms/option-change-single-selected_t01: RuntimeError # co19-roll r801: Please triage this failure.
+LayoutTests/fast/forms/option-strip-unicode-spaces_t01: RuntimeError # co19-roll r801: Please triage this failure.
+LayoutTests/fast/forms/parser-associated-form-removal_t01: RuntimeError # co19-roll r801: Please triage this failure.
+LayoutTests/fast/forms/plaintext-mode-1_t01: RuntimeError # co19-roll r801: Please triage this failure.
+LayoutTests/fast/forms/search-popup-crasher_t01: Pass, RuntimeError # co19-roll r801: Please triage this failure.
+LayoutTests/fast/forms/select-change-popup-to-listbox-in-event-handler_t01: Skip # Times out. co19-roll r801: Please triage this failure.
+LayoutTests/fast/forms/select-clientheight-large-size_t01: RuntimeError # co19-roll r801: Please triage this failure.
+LayoutTests/fast/forms/select-clientheight-with-multiple-attr_t01: Pass, RuntimeError # co19-roll r801: Please triage this failure.
+LayoutTests/fast/forms/select-list-box-mouse-focus_t01: Pass, RuntimeError # co19-roll r801: Please triage this failure.
+LayoutTests/fast/forms/submit-nil-value-field-assert_t01: RuntimeError # co19-roll r801: Please triage this failure.
+LayoutTests/fast/forms/textarea-paste-newline_t01: RuntimeError # co19-roll r801: Please triage this failure.
+LayoutTests/fast/forms/textarea-scrollbar-height_t01: Pass, RuntimeError # co19-roll r801: Please triage this failure.
+LayoutTests/fast/forms/textfield-focus-out_t01: Skip # Times out. co19-roll r801: Please triage this failure.
+LayoutTests/fast/html/select-dropdown-consistent-background-color_t01: RuntimeError # co19-roll r801: Please triage this failure.
+LayoutTests/fast/inline/boundingBox-with-continuation_t01: RuntimeError # co19-roll r801: Please triage this failure.
+LayoutTests/fast/inline/inline-position-top-align_t01: RuntimeError # co19-roll r801: Please triage this failure.
+LayoutTests/fast/inline/inline-with-empty-inline-children_t01: RuntimeError # co19-roll r801: Please triage this failure.
+LayoutTests/fast/inline/out-of-flow-objects-and-whitespace-after-empty-inline_t01: RuntimeError # co19-roll r801: Please triage this failure.
+LayoutTests/fast/inline/parent-inline-element-padding-contributes-width_t01: RuntimeError # co19-roll r801: Please triage this failure.
+LayoutTests/fast/inline/positioned-element-padding-contributes-width_t01: RuntimeError # co19-roll r801: Please triage this failure.
+LayoutTests/fast/layers/normal-flow-hit-test_t01: RuntimeError # co19-roll r801: Please triage this failure.
+LayoutTests/fast/layers/zindex-hit-test_t01: Pass, RuntimeError # co19-roll r801: Please triage this failure.
+LayoutTests/fast/loader/about-blank-hash-change_t01: Skip # Times out. co19-roll r801: Please triage this failure.
+LayoutTests/fast/loader/about-blank-hash-kept_t01: Skip # Times out. co19-roll r801: Please triage this failure.
+LayoutTests/fast/loader/hashchange-event-properties_t01: RuntimeError # co19-roll r801: Please triage this failure.
+LayoutTests/fast/loader/loadInProgress_t01: Pass, RuntimeError # co19-roll r801: Please triage this failure.
+LayoutTests/fast/loader/onhashchange-attribute-listeners_t01: Skip # Times out. co19-roll r801: Please triage this failure.
+LayoutTests/fast/loader/scroll-position-restored-on-back_t01: RuntimeError # co19-roll r801: Please triage this failure.
+LayoutTests/fast/loader/scroll-position-restored-on-reload-at-load-event_t01: Skip # Times out. co19-roll r801: Please triage this failure.
+LayoutTests/fast/loader/stateobjects/pushstate-updates-location_t01: RuntimeError # co19-roll r801: Please triage this failure.
+LayoutTests/fast/loader/stateobjects/replacestate-in-onunload_t01: RuntimeError # co19-roll r801: Please triage this failure.
+LayoutTests/fast/loader/stateobjects/replacestate-updates-location_t01: RuntimeError # co19-roll r801: Please triage this failure.
+LayoutTests/fast/masking/parsing-clip-path-shape_t01: RuntimeError # co19-roll r801: Please triage this failure.
+LayoutTests/fast/masking/parsing-mask-source-type_t01: RuntimeError # co19-roll r801: Please triage this failure.
+LayoutTests/fast/masking/parsing-mask_t01: RuntimeError # co19-roll r801: Please triage this failure.
+LayoutTests/fast/media/media-query-list-syntax_t01: RuntimeError # co19-roll r801: Please triage this failure.
+LayoutTests/fast/mediastream/RTCPeerConnection-AddRemoveStream_t01: RuntimeError # co19-roll r801: Please triage this failure.
+LayoutTests/fast/multicol/balance-short-trailing-empty-block_t01: RuntimeError # co19-roll r801: Please triage this failure.
+LayoutTests/fast/multicol/balance-trailing-border_t01: RuntimeError # co19-roll r801: Please triage this failure.
+LayoutTests/fast/multicol/balance-trailing-border_t02: RuntimeError # co19-roll r801: Please triage this failure.
+LayoutTests/fast/multicol/break-after-always-bottom-margin_t01: RuntimeError # co19-roll r801: Please triage this failure.
+LayoutTests/fast/multicol/break-properties_t01: RuntimeError # co19-roll r801: Please triage this failure.
+LayoutTests/fast/multicol/cssom-view_t01: RuntimeError # co19-roll r801: Please triage this failure.
+LayoutTests/fast/multicol/flipped-blocks-hit-test_t01: Pass, RuntimeError # co19-roll r801: Please triage this failure.
+LayoutTests/fast/multicol/float-truncation_t01: RuntimeError # co19-roll r801: Please triage this failure.
+LayoutTests/fast/multicol/hit-test-above-or-below_t01: RuntimeError # co19-roll r801: Please triage this failure.
+LayoutTests/fast/multicol/hit-test-end-of-column-with-line-height_t01: RuntimeError # co19-roll r801: Please triage this failure.
+LayoutTests/fast/multicol/hit-test-end-of-column_t01: RuntimeError # co19-roll r801: Please triage this failure.
+LayoutTests/fast/multicol/hit-test-float_t01: RuntimeError # co19-roll r801: Please triage this failure.
+LayoutTests/fast/multicol/hit-test-gap-between-pages_t01: Pass, RuntimeError # co19-roll r801: Please triage this failure.
+LayoutTests/fast/multicol/hit-test-gap-between-pages-flipped_t01: RuntimeError # co19-roll r801: Please triage this failure.
+LayoutTests/fast/multicol/newmulticol/balance-images_t01: RuntimeError # co19-roll r801: Please triage this failure.
+LayoutTests/fast/multicol/newmulticol/balance-maxheight_t01: RuntimeError # co19-roll r801: Please triage this failure.
+LayoutTests/fast/multicol/newmulticol/balance_t04: Pass, RuntimeError # co19-roll r801: Please triage this failure.
+LayoutTests/fast/multicol/newmulticol/balance_t07: RuntimeError # co19-roll r801: Please triage this failure.
+LayoutTests/fast/multicol/newmulticol/balance_t08: RuntimeError # co19-roll r801: Please triage this failure.
+LayoutTests/fast/multicol/newmulticol/balance_t09: RuntimeError # co19-roll r801: Please triage this failure.
+LayoutTests/fast/multicol/newmulticol/balance_t10: RuntimeError # co19-roll r801: Please triage this failure.
+LayoutTests/fast/multicol/vertical-lr/float-truncation_t01: RuntimeError # co19-roll r801: Please triage this failure.
+LayoutTests/fast/multicol/vertical-rl/break-properties_t01: RuntimeError # co19-roll r801: Please triage this failure.
+LayoutTests/fast/multicol/vertical-rl/float-truncation_t01: RuntimeError # co19-roll r801: Please triage this failure.
+LayoutTests/fast/multicol/vertical-rl/image-inside-nested-blocks-with-border_t01: RuntimeError # co19-roll r801: Please triage this failure.
+LayoutTests/fast/multicol/widows_t01: Pass, RuntimeError # co19-roll r801: Please triage this failure.
+LayoutTests/fast/multicol/widows_t02: RuntimeError # co19-roll r801: Please triage this failure.
+LayoutTests/fast/overflow/child-100percent-height-inside-fixed-container-with-overflow-auto_t01: Pass, RuntimeError # co19-roll r801: Please triage this failure.
+LayoutTests/fast/overflow/replaced-child-100percent-height-inside-fixed-container-with-overflow-auto_t01: RuntimeError # co19-roll r801: Please triage this failure.
+LayoutTests/fast/overflow/scroll-vertical-not-horizontal_t01: RuntimeError # co19-roll r801: Please triage this failure.
+LayoutTests/fast/overflow/scrollbar-restored_t01: Pass, RuntimeError # co19-roll r801: Please triage this failure.
+LayoutTests/fast/parser/foster-parent-adopted_t02: RuntimeError # co19-roll r801: Please triage this failure.
+LayoutTests/fast/parser/fragment-parser-doctype_t01: RuntimeError # co19-roll r801: Please triage this failure.
+LayoutTests/fast/parser/innerhtml-with-prefixed-elements_t01: RuntimeError # co19-roll r801: Please triage this failure.
+LayoutTests/fast/parser/pre-first-line-break_t01: RuntimeError # co19-roll r801: Please triage this failure.
+LayoutTests/fast/replaced/container-width-zero_t01: RuntimeError # co19-roll r801: Please triage this failure.
+LayoutTests/fast/replaced/iframe-with-percentage-height-within-table-with-anonymous-table-cell_t01: Pass, RuntimeError # co19-roll r801: Please triage this failure.
+LayoutTests/fast/replaced/iframe-with-percentage-height-within-table-with-table-cell-ignore-height_t01: RuntimeError # co19-roll r801: Please triage this failure.
+LayoutTests/fast/replaced/preferred-widths_t01: Pass, RuntimeError # co19-roll r801: Please triage this failure.
+LayoutTests/fast/replaced/table-percent-height_t01: RuntimeError # co19-roll r801: Please triage this failure.
+LayoutTests/fast/replaced/table-percent-width_t01: RuntimeError # co19-roll r801: Please triage this failure.
+LayoutTests/fast/ruby/ruby-line-height_t01: RuntimeError # co19-roll r801: Please triage this failure.
+LayoutTests/fast/shapes/parsing/parsing-shape-lengths_t01: RuntimeError # co19-roll r801: Please triage this failure.
+LayoutTests/fast/shapes/shape-outside-floats/shape-outside-big-box-border-radius_t01: RuntimeError # co19-roll r801: Please triage this failure.
+LayoutTests/fast/shapes/shape-outside-floats/shape-outside-floats-diamond-margin-polygon_t01: RuntimeError # co19-roll r801: Please triage this failure.
+LayoutTests/fast/shapes/shape-outside-floats/shape-outside-floats-ellipse-margin-left_t01: RuntimeError # co19-roll r801: Please triage this failure.
+LayoutTests/fast/shapes/shape-outside-floats/shape-outside-floats-ellipse-margin-right_t01: RuntimeError # co19-roll r801: Please triage this failure.
+LayoutTests/fast/shapes/shape-outside-floats/shape-outside-floats-image-margin_t01: RuntimeError # co19-roll r801: Please triage this failure.
+LayoutTests/fast/shapes/shape-outside-floats/shape-outside-floats-image-margin_t02: RuntimeError # co19-roll r801: Please triage this failure.
+LayoutTests/fast/shapes/shape-outside-floats/shape-outside-floats-inset-rounded-different-writing-modes-left_t01: RuntimeError # co19-roll r801: Please triage this failure.
+LayoutTests/fast/shapes/shape-outside-floats/shape-outside-floats-inset-rounded-different-writing-modes-right_t01: RuntimeError # co19-roll r801: Please triage this failure.
+LayoutTests/fast/shapes/shape-outside-floats/shape-outside-rounded-boxes_t01: RuntimeError # co19-roll r801: Please triage this failure.
+LayoutTests/fast/shapes/shape-outside-floats/shape-outside-rounded-boxes_t02: RuntimeError # co19-roll r801: Please triage this failure.
+LayoutTests/fast/table/nested-tables-with-div-offset_t01: Pass, RuntimeError # co19-roll r801: Please triage this failure.
[ $compiler == none && ($runtime == dartium || $runtime == ContentShellOnAndroid ) && $checked ]
-# New Dartium checked failures on new co19 browser tests in co19 revision 706.
-LayoutTests/fast/html/article-element_t01: RuntimeError # Issue 17758. Please triage this failure.
-LayoutTests/fast/html/aside-element_t01: RuntimeError # Issue 17758. Please triage this failure.
-LayoutTests/fast/innerHTML/innerHTML-svg-read_t01: RuntimeError, Pass # Issue 17758. Please triage this failure.
+LayoutTests/fast/html/article-element_t01: RuntimeError # co19-roll r706. Please triage this failure.
+LayoutTests/fast/html/aside-element_t01: RuntimeError # co19-roll r706. Please triage this failure.
+LayoutTests/fast/innerHTML/innerHTML-svg-read_t01: RuntimeError, Pass # co19-roll r706. Please triage this failure.
LayoutTests/fast/dom/HTMLLabelElement/form/test1_t01: RuntimeError # co19-roll r722: Please triage this failure.
LayoutTests/fast/dom/HTMLTableElement/insert-row_t01: RuntimeError # co19-roll r722: Please triage this failure.
LibTest/html/Node/ownerDocument_A01_t01: RuntimeError # co19-roll r722: Please triage this failure.
@@ -823,8 +929,10 @@
LayoutTests/fast/dom/shadow/shadowhost-keyframes_t01: RuntimeError, Pass # co19-roll r738: Please triage this failure.
# co19-roll r761
+LayoutTests/fast/canvas/webgl/framebuffer-object-attachment_t01: RuntimeError # co19-roll r761: Please triage this failure.
+LayoutTests/fast/canvas/webgl/oes-vertex-array-object_t01: RuntimeError # co19-roll r761: Please triage this failure.
+LayoutTests/fast/canvas/webgl/read-pixels-test_t01: RuntimeError # co19-roll r761: Please triage this failure.
LayoutTests/fast/css/box-sizing-border-box-dynamic-padding-border-update_t01: RuntimeError # co19-roll r761: Please triage this failure.
-LayoutTests/fast/css/deprecated-flexbox-auto-min-size_t01: RuntimeError # co19-roll r761: Please triage this failure.
LayoutTests/fast/css/display-inline-block-scrollbar_t01: RuntimeError # co19-roll r761: Please triage this failure.
LayoutTests/fast/css/fixed-width-intrinsic-width-excludes-scrollbars_t01: RuntimeError # co19-roll r761: Please triage this failure.
LayoutTests/fast/xpath/xpath-result-eventlistener-crash_t01: RuntimeError # co19-roll r761: Please triage this failure.
@@ -867,8 +975,26 @@
LayoutTests/fast/url/trivial_t01: RuntimeError # co19-roll r786: Please triage this failure.
LayoutTests/fast/xmlhttprequest/xmlhttprequest-bad-mimetype_t01: RuntimeError # co19-roll r786: Please triage this failure.
LayoutTests/fast/xmlhttprequest/xmlhttprequest-invalid-values_t01: RuntimeError # co19-roll r786: Please triage this failure.
-LayoutTests/fast/dom/HTMLDialogElement/top-layer-position-relative_t01: RuntimeError # Reenable fast/dom tests: Please triage this failure.
-LayoutTests/fast/dom/HTMLDialogElement/top-layer-position-static_t01: RuntimeError # Reenable fast/dom tests: Please triage this failure.
+LayoutTests/fast/dom/HTMLDialogElement/top-layer-position-relative_t01: RuntimeError # Please triage this failure.
+LayoutTests/fast/dom/HTMLDialogElement/top-layer-position-static_t01: RuntimeError # Please triage this failure.
+
+# co19 roll r801
+LayoutTests/fast/flexbox/flexing-overflow-scroll-item_t01: RuntimeError # co19-roll r801: Please triage this failure.
+LayoutTests/fast/flexbox/intrinsic-min-width-applies-with-fixed-width_t01: RuntimeError # co19-roll r801: Please triage this failure.
+LayoutTests/fast/forms/select-list-box-mouse-focus_t01: Pass, RuntimeError # co19-roll r801: Please triage this failure.
+LayoutTests/fast/inline/empty-inline-before-collapsed-space_t01: RuntimeError # co19-roll r801: Please triage this failure.
+LayoutTests/fast/lists/list-style-position-inside_t01: RuntimeError # co19-roll r801: Please triage this failure.
+LayoutTests/fast/lists/marker-preferred-margins_t01: RuntimeError # co19-roll r801: Please triage this failure.
+LayoutTests/fast/multicol/fixed-column-percent-logical-height-orthogonal-writing-mode_t01: RuntimeError # co19-roll r801: Please triage this failure.
+LayoutTests/fast/multicol/vertical-lr/image-inside-nested-blocks-with-border_t01: RuntimeError # co19-roll r801: Please triage this failure.
+LayoutTests/fast/replaced/available-height-for-content_t01: RuntimeError # co19-roll r801: Please triage this failure.
+LayoutTests/fast/replaced/computed-image-width-with-percent-height-and-fixed-ancestor_t01: Pass, RuntimeError # co19-roll r801: Please triage this failure.
+LayoutTests/fast/replaced/computed-image-width-with-percent-height-and-fixed-ancestor-vertical-lr_t01: Pass, RuntimeError # co19-roll r801: Please triage this failure.
+LayoutTests/fast/replaced/computed-image-width-with-percent-height-inside-table-cell-and-fixed-ancestor_t01: Pass, RuntimeError # co19-roll r801: Please triage this failure.
+LayoutTests/fast/replaced/computed-image-width-with-percent-height-inside-table-cell-and-fixed-ancestor-vertical-lr_t01: Pass, RuntimeError # co19-roll r801: Please triage this failure.
+LayoutTests/fast/shapes/parsing/parsing-shape-image-threshold_t01: RuntimeError # co19-roll r801: Please triage this failure.
+LayoutTests/fast/shapes/parsing/parsing-shape-margin_t01: RuntimeError # co19-roll r801: Please triage this failure.
+LayoutTests/fast/shapes/parsing/parsing-shape-outside_t01: RuntimeError # co19-roll r801: Please triage this failure.
[ $compiler == none && ($runtime == dartium || $runtime == ContentShellOnAndroid) && $mode == debug ]
WebPlatformTest/html/semantics/embedded-content/media-elements/interfaces/TextTrack/mode_t01: Skip # Issue 19495.
@@ -883,7 +1009,7 @@
LayoutTests/fast/canvas/canvas-composite-text-alpha_t01: RuntimeError # co19-roll r761: Please triage this failure.
LayoutTests/fast/canvas/canvas-scale-drawImage-shadow_t01: RuntimeError, Pass # co19-roll r761: Please triage this failure.
LayoutTests/fast/canvas/canvas-scale-fillPath-shadow_t01: RuntimeError, Pass # co19-roll r761: Please triage this failure.
-LayoutTests/fast/canvas/canvas-scale-fillRect-shadow_t01: RuntimeError, Pass # co19-roll r761: Please triage this failure.
+LayoutTests/fast/canvas/canvas-scale-fillRect-shadow_t01: Skip # Times out. co19-roll r761: Please triage this failure.
LayoutTests/fast/canvas/canvas-transforms-fillRect-shadow_t01: RuntimeError, Pass # co19-roll r761: Please triage this failure.
LayoutTests/fast/canvas/webgl/canvas-test_t01: RuntimeError, Pass # co19-roll r761: Please triage this failure.
LayoutTests/fast/canvas/webgl/webgl-large-texture_t01: Skip # Times out flakily. co19-roll r761: Please triage this failure.
@@ -895,107 +1021,129 @@
LayoutTests/fast/css-generated-content/hit-test-generated-content_t01: RuntimeError # co19-roll r786: Please triage this failure.
LayoutTests/fast/css-intrinsic-dimensions/css-tables_t01: RuntimeError # co19-roll r786: Please triage this failure.
LayoutTests/fast/css-intrinsic-dimensions/tables_t01: RuntimeError # co19-roll r786: Please triage this failure.
+LayoutTests/fast/filesystem/file-writer-abort-continue_t01: Skip # Times out. co19-roll r786: Please triage this failure.
LayoutTests/fast/text/international/listbox-width-rtl_t01: RuntimeError # co19-roll r786: Please triage this failure.
LayoutTests/fast/text-autosizing/text-removal_t01: RuntimeError # co19-roll r786: Please triage this failure.
LayoutTests/fast/transforms/scrollIntoView-transformed_t01: RuntimeError # co19-roll r786: Please triage this failure.
-LayoutTests/fast/dom/partial-layout-overlay-scrollbars_t01: Pass, RuntimeError # Reenable fast/dom tests: Please triage this failure.
-LayoutTests/fast/dom/partial-layout-non-overlay-scrollbars_t01: Pass, RuntimeError # Reenable fast/dom tests: Please triage this failure.
-LayoutTests/fast/dom/shadow/shadowdom-for-input-type-change_t01: RuntimeError # Reenable fast/dom tests: Please triage this failure.
-LayoutTests/fast/dom/jsDevicePixelRatio_t01: RuntimeError # Reenable fast/dom tests: Please triage this failure.
-LayoutTests/fast/dom/HTMLLinkElement/prefetch-beforeload_t01: Pass, RuntimeError # Reenable fast/dom tests: Please triage this failure.
+LayoutTests/fast/dom/partial-layout-overlay-scrollbars_t01: Pass, RuntimeError # Please triage this failure.
+LayoutTests/fast/dom/partial-layout-non-overlay-scrollbars_t01: Pass, RuntimeError # Please triage this failure.
+LayoutTests/fast/dom/shadow/shadowdom-for-input-type-change_t01: RuntimeError # Please triage this failure.
+LayoutTests/fast/dom/jsDevicePixelRatio_t01: RuntimeError # Please triage this failure.
+LayoutTests/fast/dom/HTMLLinkElement/prefetch-beforeload_t01: Pass, RuntimeError # Please triage this failure.
+LayoutTests/fast/forms/activate-and-disabled-elements_t01: Skip # Times out. co19-roll r801: Please triage this failure.
+LayoutTests/fast/inline/continuation-inlines-inserted-in-reverse-after-block_t01: Skip # Times out. co19-roll r801: Please triage this failure.
+LayoutTests/fast/inline/fixed-pos-moves-with-abspos-inline-parent_t01: Skip # Times out. co19-roll r801: Please triage this failure.
+LayoutTests/fast/inline/inline-relative-offset-boundingbox_t01: Skip # Times out. co19-roll r801: Please triage this failure.
+LayoutTests/fast/inline/out-of-flow-objects-and-whitespace-after-empty-inline_t01: Skip # Times out. co19-roll r801: Please triage this failure.
+LayoutTests/fast/inline/parent-inline-element-padding-contributes-width_t01: Skip # Times out. co19-roll r801: Please triage this failure.
+LayoutTests/fast/layers/negative-scroll-positions_t01: Skip # Times out. co19-roll r801: Please triage this failure.
+LayoutTests/fast/loader/loadInProgress_t01: Pass, RuntimeError # co19-roll r801: Please triage this failure.
+LayoutTests/fast/table/table-rowspan-height-distribution-in-rows_t02: Skip # Times out. Please triage this failure.
+LayoutTests/fast/writing-mode/auto-margins-across-boundaries_t01: Skip # Times out. Please triage this failure.
+LayoutTests/fast/writing-mode/auto-sizing-orthogonal-flows_t01: Skip # Times out. Please triage this failure.
+LayoutTests/fast/writing-mode/block-formatting-context_t01: Skip # Times out. Please triage this failure.
+LayoutTests/fast/writing-mode/broken-ideographic-font_t01: Skip # Times out. co19-roll r801: Please triage this failure.
+LayoutTests/fast/writing-mode/display-mutation_t01: Skip # Times out. co19-roll r801: Please triage this failure.
+LayoutTests/fast/writing-mode/flipped-blocks-hit-test-overflow-scroll_t01: Skip # Times out. Please triage this failure.
+LayoutTests/fast/writing-mode/flipped-blocks-text-map-local-to-container_t01: Skip # Times out. co19-roll r801: Please triage this failure.
+LayoutTests/fast/writing-mode/percentage-margins-absolute-replaced_t01: Skip # Times out. Please triage this failure.
+LayoutTests/fast/writing-mode/percentage-padding_t01: Skip # Times out. co19-roll r801: Please triage this failure.
+LayoutTests/fast/writing-mode/vertical-font-vmtx-units-per-em_t01: Skip # Times out. Please triage this failure.
+LayoutTests/fast/writing-mode/vertical-inline-block-hittest_t01: Skip # Times out. Please triage this failure.
+LibTest/core/DateTime/parse_A01_t02: Skip # Times out. Please triage this failure.
-[ $compiler == none && $runtime == dartium && ($mode != debug || $system != macos) ]
-LayoutTests/fast/canvas/webgl/WebGLContextEvent_t01: RuntimeError # co19-roll r761: Please triage this failure.
-LayoutTests/fast/canvas/webgl/array-bounds-clamping_t01: RuntimeError # co19-roll r761: Please triage this failure.
-LayoutTests/fast/canvas/webgl/attrib-location-length-limits_t01: RuntimeError # co19-roll r761: Please triage this failure.
-LayoutTests/fast/canvas/webgl/buffer-bind-test_t01: RuntimeError # co19-roll r761: Please triage this failure.
-LayoutTests/fast/canvas/webgl/buffer-data-array-buffer_t01: RuntimeError # co19-roll r761: Please triage this failure.
-LayoutTests/fast/canvas/webgl/canvas-2d-webgl-texture_t01: RuntimeError # co19-roll r761: Please triage this failure.
-LayoutTests/fast/canvas/webgl/canvas-test_t01: RuntimeError # co19-roll r761: Please triage this failure.
-LayoutTests/fast/canvas/webgl/canvas-zero-size_t01: RuntimeError # co19-roll r761: Please triage this failure.
-LayoutTests/fast/canvas/webgl/compressed-tex-image_t01: RuntimeError # co19-roll r761: Please triage this failure.
-LayoutTests/fast/canvas/webgl/context-destroyed-crash_t01: RuntimeError # co19-roll r761: Please triage this failure.
-LayoutTests/fast/canvas/webgl/context-lost-restored_t01: RuntimeError # co19-roll r761: Please triage this failure.
-LayoutTests/fast/canvas/webgl/css-webkit-canvas-repaint_t01: RuntimeError # co19-roll r761: Please triage this failure.
-LayoutTests/fast/canvas/webgl/css-webkit-canvas_t01: RuntimeError # co19-roll r761: Please triage this failure.
-LayoutTests/fast/canvas/webgl/draw-arrays-out-of-bounds_t01: RuntimeError # co19-roll r761: Please triage this failure.
-LayoutTests/fast/canvas/webgl/draw-elements-out-of-bounds_t01: RuntimeError # co19-roll r761: Please triage this failure.
-LayoutTests/fast/canvas/webgl/error-reporting_t01: RuntimeError # co19-roll r761: Please triage this failure.
-LayoutTests/fast/canvas/webgl/framebuffer-bindings-unaffected-on-resize_t01: RuntimeError # co19-roll r761: Please triage this failure.
-LayoutTests/fast/canvas/webgl/framebuffer-object-attachment_t01: RuntimeError # co19-roll r761: Please triage this failure.
-LayoutTests/fast/canvas/webgl/framebuffer-test_t01: RuntimeError # co19-roll r761: Please triage this failure.
-LayoutTests/fast/canvas/webgl/functions-returning-strings_t01: RuntimeError # co19-roll r761: Please triage this failure.
-LayoutTests/fast/canvas/webgl/get-active-test_t01: RuntimeError # co19-roll r761: Please triage this failure.
-LayoutTests/fast/canvas/webgl/gl-bind-attrib-location-test_t01: RuntimeError # co19-roll r761: Please triage this failure.
-LayoutTests/fast/canvas/webgl/gl-enable-enum-test_t01: RuntimeError # co19-roll r761: Please triage this failure.
-LayoutTests/fast/canvas/webgl/gl-enum-tests_t01: RuntimeError # co19-roll r761: Please triage this failure.
-LayoutTests/fast/canvas/webgl/gl-get-calls_t01: RuntimeError # co19-roll r761: Please triage this failure.
-LayoutTests/fast/canvas/webgl/gl-getshadersource_t01: RuntimeError # co19-roll r761: Please triage this failure.
-LayoutTests/fast/canvas/webgl/gl-getstring_t01: RuntimeError # co19-roll r761: Please triage this failure.
-LayoutTests/fast/canvas/webgl/gl-pixelstorei_t01: RuntimeError # co19-roll r761: Please triage this failure.
-LayoutTests/fast/canvas/webgl/gl-teximage_t01: RuntimeError # co19-roll r761: Please triage this failure.
-LayoutTests/fast/canvas/webgl/gl-uniformmatrix4fv_t01: RuntimeError # co19-roll r761: Please triage this failure.
-LayoutTests/fast/canvas/webgl/gl-vertex-attrib-zero-issues_t01: RuntimeError # co19-roll r761: Please triage this failure.
-LayoutTests/fast/canvas/webgl/gl-vertex-attrib_t01: RuntimeError # co19-roll r761: Please triage this failure.
-LayoutTests/fast/canvas/webgl/gl-vertexattribpointer_t01: RuntimeError # co19-roll r761: Please triage this failure.
-LayoutTests/fast/canvas/webgl/glsl-conformance_t01: RuntimeError # co19-roll r761: Please triage this failure.
-LayoutTests/fast/canvas/webgl/index-validation-copies-indices_t01: RuntimeError # co19-roll r761: Please triage this failure.
-LayoutTests/fast/canvas/webgl/index-validation-crash-with-buffer-sub-data_t01: RuntimeError # co19-roll r761: Please triage this failure.
-LayoutTests/fast/canvas/webgl/index-validation-verifies-too-many-indices_t01: RuntimeError # co19-roll r761: Please triage this failure.
-LayoutTests/fast/canvas/webgl/index-validation-with-resized-buffer_t01: RuntimeError # co19-roll r761: Please triage this failure.
-LayoutTests/fast/canvas/webgl/index-validation_t01: RuntimeError # co19-roll r761: Please triage this failure.
-LayoutTests/fast/canvas/webgl/invalid-UTF-16_t01: RuntimeError # co19-roll r761: Please triage this failure.
-LayoutTests/fast/canvas/webgl/invalid-passed-params_t01: RuntimeError # co19-roll r761: Please triage this failure.
-LayoutTests/fast/canvas/webgl/null-uniform-location_t01: RuntimeError # co19-roll r761: Please triage this failure.
-LayoutTests/fast/canvas/webgl/object-deletion-behaviour_t01: RuntimeError # co19-roll r761: Please triage this failure.
-LayoutTests/fast/canvas/webgl/oes-element-index-uint_t01: RuntimeError # co19-roll r761: Please triage this failure.
-LayoutTests/fast/canvas/webgl/oes-vertex-array-object_t01: RuntimeError # co19-roll r761: Please triage this failure.
-LayoutTests/fast/canvas/webgl/point-size_t01: RuntimeError # co19-roll r761: Please triage this failure.
-LayoutTests/fast/canvas/webgl/program-test_t01: RuntimeError # co19-roll r761: Please triage this failure.
-LayoutTests/fast/canvas/webgl/read-pixels-pack-alignment_t01: RuntimeError # co19-roll r761: Please triage this failure.
-LayoutTests/fast/canvas/webgl/read-pixels-test_t01: RuntimeError # co19-roll r761: Please triage this failure.
-LayoutTests/fast/canvas/webgl/renderer-and-vendor-strings_t01: RuntimeError # co19-roll r761: Please triage this failure.
-LayoutTests/fast/canvas/webgl/shader-precision-format_t01: RuntimeError # co19-roll r761: Please triage this failure.
-LayoutTests/fast/canvas/webgl/tex-image-and-sub-image-2d-with-array-buffer-view_t01: RuntimeError # co19-roll r761: Please triage this failure.
-LayoutTests/fast/canvas/webgl/tex-image-and-sub-image-2d-with-canvas-rgb565_t01: RuntimeError # co19-roll r761: Please triage this failure.
-LayoutTests/fast/canvas/webgl/tex-image-and-sub-image-2d-with-canvas-rgba4444_t01: RuntimeError # co19-roll r761: Please triage this failure.
-LayoutTests/fast/canvas/webgl/tex-image-and-sub-image-2d-with-canvas-rgba5551_t01: RuntimeError # co19-roll r761: Please triage this failure.
-LayoutTests/fast/canvas/webgl/tex-image-and-sub-image-2d-with-canvas_t01: RuntimeError # co19-roll r761: Please triage this failure.
-LayoutTests/fast/canvas/webgl/tex-image-and-sub-image-2d-with-image-data-rgb565_t01: RuntimeError # co19-roll r761: Please triage this failure.
-LayoutTests/fast/canvas/webgl/tex-image-and-sub-image-2d-with-image-data-rgba4444_t01: RuntimeError # co19-roll r761: Please triage this failure.
-LayoutTests/fast/canvas/webgl/tex-image-and-sub-image-2d-with-image-data-rgba5551_t01: RuntimeError # co19-roll r761: Please triage this failure.
-LayoutTests/fast/canvas/webgl/tex-image-and-sub-image-2d-with-image-data_t01: RuntimeError # co19-roll r761: Please triage this failure.
-LayoutTests/fast/canvas/webgl/tex-image-and-sub-image-2d-with-image-rgb565_t01: RuntimeError # co19-roll r761: Please triage this failure.
-LayoutTests/fast/canvas/webgl/tex-image-and-sub-image-2d-with-image-rgba4444_t01: RuntimeError # co19-roll r761: Please triage this failure.
-LayoutTests/fast/canvas/webgl/tex-image-and-sub-image-2d-with-image-rgba5551_t01: RuntimeError # co19-roll r761: Please triage this failure.
-LayoutTests/fast/canvas/webgl/tex-image-and-sub-image-2d-with-image_t01: RuntimeError # co19-roll r761: Please triage this failure.
-LayoutTests/fast/canvas/webgl/tex-image-and-uniform-binding-bugs_t01: RuntimeError # co19-roll r761: Please triage this failure.
-LayoutTests/fast/canvas/webgl/tex-image-webgl_t01: RuntimeError # co19-roll r761: Please triage this failure.
-LayoutTests/fast/canvas/webgl/tex-input-validation_t01: RuntimeError # co19-roll r761: Please triage this failure.
-LayoutTests/fast/canvas/webgl/tex-sub-image-2d-bad-args_t01: RuntimeError # co19-roll r761: Please triage this failure.
-LayoutTests/fast/canvas/webgl/tex-sub-image-2d_t01: RuntimeError # co19-roll r761: Please triage this failure.
-LayoutTests/fast/canvas/webgl/tex-sub-image-cube-maps_t01: RuntimeError # co19-roll r761: Please triage this failure.
-LayoutTests/fast/canvas/webgl/texImage2DImageDataTest_t01: RuntimeError # co19-roll r761: Please triage this failure.
-LayoutTests/fast/canvas/webgl/texImageTest_t01: RuntimeError # co19-roll r761: Please triage this failure.
-LayoutTests/fast/canvas/webgl/texture-active-bind_t01: RuntimeError # co19-roll r761: Please triage this failure.
-LayoutTests/fast/canvas/webgl/texture-bindings-uneffected-on-resize_t01: RuntimeError # co19-roll r761: Please triage this failure.
-LayoutTests/fast/canvas/webgl/texture-color-profile_t01: RuntimeError # co19-roll r761: Please triage this failure.
-LayoutTests/fast/canvas/webgl/texture-complete_t01: RuntimeError # co19-roll r761: Please triage this failure.
-LayoutTests/fast/canvas/webgl/texture-npot_t01: RuntimeError # co19-roll r761: Please triage this failure.
-LayoutTests/fast/canvas/webgl/texture-transparent-pixels-initialized_t01: RuntimeError # co19-roll r761: Please triage this failure.
-LayoutTests/fast/canvas/webgl/uniform-location-length-limits_t01: RuntimeError # co19-roll r761: Please triage this failure.
-LayoutTests/fast/canvas/webgl/uninitialized-test_t01: RuntimeError # co19-roll r761: Please triage this failure.
-LayoutTests/fast/canvas/webgl/viewport-unchanged-upon-resize_t01: RuntimeError # co19-roll r761: Please triage this failure.
-LayoutTests/fast/canvas/webgl/webgl-composite-modes-repaint_t01: RuntimeError # co19-roll r761: Please triage this failure.
-LayoutTests/fast/canvas/webgl/webgl-composite-modes_t01: RuntimeError # co19-roll r761: Please triage this failure.
+[ $compiler == none && $runtime == dartium ]
LayoutTests/fast/canvas/webgl/webgl-depth-texture_t01: RuntimeError # co19-roll r761: Please triage this failure.
-LayoutTests/fast/canvas/webgl/webgl-exceptions_t01: RuntimeError # co19-roll r761: Please triage this failure.
-LayoutTests/fast/canvas/webgl/webgl-large-texture_t01: RuntimeError # co19-roll r761: Please triage this failure.
-LayoutTests/fast/canvas/webgl/webgl-layer-update_t01: RuntimeError # co19-roll r761: Please triage this failure.
-LayoutTests/fast/canvas/webgl/webgl-specific_t01: RuntimeError # co19-roll r761: Please triage this failure.
-LayoutTests/fast/canvas/webgl/webgl-texture-binding-preserved_t01: RuntimeError # co19-roll r761: Please triage this failure.
-LayoutTests/fast/canvas/webgl/webgl-unprefixed-context-id_t01: RuntimeError # co19-roll r761: Please triage this failure.
-LayoutTests/fast/canvas/webgl/webgl-viewport-parameters-preserved_t01: RuntimeError # co19-roll r761: Please triage this failure.
+LayoutTests/fast/canvas/webgl/WebGLContextEvent_t01: RuntimeError # Issue 22026
+LayoutTests/fast/canvas/webgl/array-bounds-clamping_t01: RuntimeError # Issue 22026
+LayoutTests/fast/canvas/webgl/attrib-location-length-limits_t01: RuntimeError # Issue 22026
+LayoutTests/fast/canvas/webgl/buffer-bind-test_t01: RuntimeError # Issue 22026
+LayoutTests/fast/canvas/webgl/buffer-data-array-buffer_t01: RuntimeError # Issue 22026
+LayoutTests/fast/canvas/webgl/canvas-2d-webgl-texture_t01: RuntimeError # Issue 22026
+LayoutTests/fast/canvas/webgl/canvas-test_t01: RuntimeError # Issue 22026
+LayoutTests/fast/canvas/webgl/canvas-zero-size_t01: RuntimeError # Issue 22026
+LayoutTests/fast/canvas/webgl/compressed-tex-image_t01: RuntimeError # Issue 22026
+LayoutTests/fast/canvas/webgl/context-destroyed-crash_t01: RuntimeError # Issue 22026
+LayoutTests/fast/canvas/webgl/context-lost-restored_t01: RuntimeError # Issue 22026
+LayoutTests/fast/canvas/webgl/css-webkit-canvas-repaint_t01: RuntimeError # Issue 22026
+LayoutTests/fast/canvas/webgl/css-webkit-canvas_t01: RuntimeError # Issue 22026
+LayoutTests/fast/canvas/webgl/draw-arrays-out-of-bounds_t01: RuntimeError # Issue 22026
+LayoutTests/fast/canvas/webgl/draw-elements-out-of-bounds_t01: RuntimeError # Issue 22026
+LayoutTests/fast/canvas/webgl/error-reporting_t01: RuntimeError # Issue 22026
+LayoutTests/fast/canvas/webgl/framebuffer-bindings-unaffected-on-resize_t01: RuntimeError # Issue 22026
+LayoutTests/fast/canvas/webgl/framebuffer-object-attachment_t01: RuntimeError # Issue 22026
+LayoutTests/fast/canvas/webgl/framebuffer-test_t01: RuntimeError # Issue 22026
+LayoutTests/fast/canvas/webgl/functions-returning-strings_t01: RuntimeError # Issue 22026
+LayoutTests/fast/canvas/webgl/get-active-test_t01: RuntimeError # Issue 22026
+LayoutTests/fast/canvas/webgl/gl-bind-attrib-location-test_t01: RuntimeError # Issue 22026
+LayoutTests/fast/canvas/webgl/gl-enable-enum-test_t01: RuntimeError # Issue 22026
+LayoutTests/fast/canvas/webgl/gl-enum-tests_t01: RuntimeError # Issue 22026
+LayoutTests/fast/canvas/webgl/gl-get-calls_t01: RuntimeError # Issue 22026
+LayoutTests/fast/canvas/webgl/gl-getshadersource_t01: RuntimeError # Issue 22026
+LayoutTests/fast/canvas/webgl/gl-getstring_t01: RuntimeError # Issue 22026
+LayoutTests/fast/canvas/webgl/gl-pixelstorei_t01: RuntimeError # Issue 22026
+LayoutTests/fast/canvas/webgl/gl-teximage_t01: RuntimeError # Issue 22026
+LayoutTests/fast/canvas/webgl/gl-uniformmatrix4fv_t01: RuntimeError # Issue 22026
+LayoutTests/fast/canvas/webgl/gl-vertex-attrib-zero-issues_t01: RuntimeError # Issue 22026
+LayoutTests/fast/canvas/webgl/gl-vertex-attrib_t01: RuntimeError # Issue 22026
+LayoutTests/fast/canvas/webgl/gl-vertexattribpointer_t01: RuntimeError # Issue 22026
+LayoutTests/fast/canvas/webgl/glsl-conformance_t01: RuntimeError # Issue 22026
+LayoutTests/fast/canvas/webgl/index-validation-copies-indices_t01: RuntimeError # Issue 22026
+LayoutTests/fast/canvas/webgl/index-validation-crash-with-buffer-sub-data_t01: RuntimeError # Issue 22026
+LayoutTests/fast/canvas/webgl/index-validation-verifies-too-many-indices_t01: RuntimeError # Issue 22026
+LayoutTests/fast/canvas/webgl/index-validation-with-resized-buffer_t01: RuntimeError # Issue 22026
+LayoutTests/fast/canvas/webgl/index-validation_t01: RuntimeError # Issue 22026
+LayoutTests/fast/canvas/webgl/invalid-UTF-16_t01: RuntimeError # Issue 22026
+LayoutTests/fast/canvas/webgl/invalid-passed-params_t01: RuntimeError # Issue 22026
+LayoutTests/fast/canvas/webgl/null-uniform-location_t01: RuntimeError # Issue 22026
+LayoutTests/fast/canvas/webgl/object-deletion-behaviour_t01: RuntimeError # Issue 22026
+LayoutTests/fast/canvas/webgl/oes-element-index-uint_t01: RuntimeError # Issue 22026
+LayoutTests/fast/canvas/webgl/oes-vertex-array-object_t01: RuntimeError # Issue 22026
+LayoutTests/fast/canvas/webgl/point-size_t01: RuntimeError # Issue 22026
+LayoutTests/fast/canvas/webgl/program-test_t01: RuntimeError # Issue 22026
+LayoutTests/fast/canvas/webgl/read-pixels-pack-alignment_t01: RuntimeError # Issue 22026
+LayoutTests/fast/canvas/webgl/read-pixels-test_t01: RuntimeError # Issue 22026
+LayoutTests/fast/canvas/webgl/renderer-and-vendor-strings_t01: RuntimeError # Issue 22026
+LayoutTests/fast/canvas/webgl/shader-precision-format_t01: RuntimeError # Issue 22026
+LayoutTests/fast/canvas/webgl/tex-image-and-sub-image-2d-with-array-buffer-view_t01: RuntimeError # Issue 22026
+LayoutTests/fast/canvas/webgl/tex-image-and-sub-image-2d-with-canvas-rgb565_t01: RuntimeError # Issue 22026
+LayoutTests/fast/canvas/webgl/tex-image-and-sub-image-2d-with-canvas-rgba4444_t01: RuntimeError # Issue 22026
+LayoutTests/fast/canvas/webgl/tex-image-and-sub-image-2d-with-canvas-rgba5551_t01: RuntimeError # Issue 22026
+LayoutTests/fast/canvas/webgl/tex-image-and-sub-image-2d-with-canvas_t01: RuntimeError # Issue 22026
+LayoutTests/fast/canvas/webgl/tex-image-and-sub-image-2d-with-image-data-rgb565_t01: RuntimeError # Issue 22026
+LayoutTests/fast/canvas/webgl/tex-image-and-sub-image-2d-with-image-data-rgba4444_t01: RuntimeError # Issue 22026
+LayoutTests/fast/canvas/webgl/tex-image-and-sub-image-2d-with-image-data-rgba5551_t01: RuntimeError # Issue 22026
+LayoutTests/fast/canvas/webgl/tex-image-and-sub-image-2d-with-image-data_t01: RuntimeError # Issue 22026
+LayoutTests/fast/canvas/webgl/tex-image-and-sub-image-2d-with-image-rgb565_t01: RuntimeError # Issue 22026
+LayoutTests/fast/canvas/webgl/tex-image-and-sub-image-2d-with-image-rgba4444_t01: RuntimeError # Issue 22026
+LayoutTests/fast/canvas/webgl/tex-image-and-sub-image-2d-with-image-rgba5551_t01: RuntimeError # Issue 22026
+LayoutTests/fast/canvas/webgl/tex-image-and-sub-image-2d-with-image_t01: RuntimeError # Issue 22026
+LayoutTests/fast/canvas/webgl/tex-image-and-uniform-binding-bugs_t01: RuntimeError # Issue 22026
+LayoutTests/fast/canvas/webgl/tex-image-webgl_t01: RuntimeError # Issue 22026
+LayoutTests/fast/canvas/webgl/tex-input-validation_t01: RuntimeError # Issue 22026
+LayoutTests/fast/canvas/webgl/tex-sub-image-2d-bad-args_t01: RuntimeError # Issue 22026
+LayoutTests/fast/canvas/webgl/tex-sub-image-2d_t01: RuntimeError # Issue 22026
+LayoutTests/fast/canvas/webgl/tex-sub-image-cube-maps_t01: RuntimeError # Issue 22026
+LayoutTests/fast/canvas/webgl/texImage2DImageDataTest_t01: RuntimeError # Issue 22026
+LayoutTests/fast/canvas/webgl/texImageTest_t01: RuntimeError # Issue 22026
+LayoutTests/fast/canvas/webgl/texture-active-bind_t01: RuntimeError # Issue 22026
+LayoutTests/fast/canvas/webgl/texture-bindings-uneffected-on-resize_t01: RuntimeError # Issue 22026
+LayoutTests/fast/canvas/webgl/texture-color-profile_t01: RuntimeError # Issue 22026
+LayoutTests/fast/canvas/webgl/texture-complete_t01: RuntimeError # Issue 22026
+LayoutTests/fast/canvas/webgl/texture-npot_t01: RuntimeError # Issue 22026
+LayoutTests/fast/canvas/webgl/texture-transparent-pixels-initialized_t01: RuntimeError # Issue 22026
+LayoutTests/fast/canvas/webgl/uniform-location-length-limits_t01: RuntimeError # Issue 22026
+LayoutTests/fast/canvas/webgl/uninitialized-test_t01: RuntimeError # Issue 22026
+LayoutTests/fast/canvas/webgl/viewport-unchanged-upon-resize_t01: RuntimeError # Issue 22026
+LayoutTests/fast/canvas/webgl/webgl-composite-modes-repaint_t01: RuntimeError # Issue 22026
+LayoutTests/fast/canvas/webgl/webgl-composite-modes_t01: RuntimeError # Issue 22026
+LayoutTests/fast/canvas/webgl/webgl-exceptions_t01: RuntimeError # Issue 22026
+LayoutTests/fast/canvas/webgl/webgl-large-texture_t01: RuntimeError # Issue 22026
+LayoutTests/fast/canvas/webgl/webgl-layer-update_t01: RuntimeError # Issue 22026
+LayoutTests/fast/canvas/webgl/webgl-specific_t01: RuntimeError # Issue 22026
+LayoutTests/fast/canvas/webgl/webgl-texture-binding-preserved_t01: RuntimeError # Issue 22026
+LayoutTests/fast/canvas/webgl/webgl-unprefixed-context-id_t01: RuntimeError # Issue 22026
+LayoutTests/fast/canvas/webgl/webgl-viewport-parameters-preserved_t01: RuntimeError # Issue 22026
[ $compiler == none && ($runtime == dartium || $runtime == ContentShellOnAndroid) && $system != windows ]
LayoutTests/fast/css/font-face-unicode-range-monospace_t01: RuntimeError # co19-roll r761: Please triage this failure.
diff --git a/tests/co19/co19-runtime.status b/tests/co19/co19-runtime.status
index 32b96fa..62a078c 100644
--- a/tests/co19/co19-runtime.status
+++ b/tests/co19/co19-runtime.status
@@ -25,10 +25,6 @@
Language/13_Statements/15_Assert_A04_t02: skip # co19 issue 734
Language/13_Statements/15_Assert_A04_t05: skip # co19 issue 734
-# re-enable next 3 tests when co19 revision synched to r793
-Language/12_Expressions/20_Logical_Boolean_Expressions_A03_t01: skip # until >= r793
-Language/12_Expressions/27_Unary_Expressions_A02_t03: skip # until >= r793
-Language/13_Statements/06_For/1_For_Loop_A01_t08: skip # until >= r793
LibTest/core/DateTime/parse_A03_t01: fail # Issue 12514
@@ -48,7 +44,8 @@
[ $compiler == none && $runtime == vm ]
LibTest/typed_data/Float32x4/reciprocalSqrt_A01_t01: Pass, Fail # co19 issue 599
LibTest/typed_data/Float32x4/reciprocal_A01_t01: Pass, Fail # co19 issue 599
-
+Language/12_Expressions/12_Instance_Creation/2_Const_A11_t01: MissingCompileTimeError # Issue 22007
+Language/12_Expressions/12_Instance_Creation/2_Const_A11_t03: MissingCompileTimeError # Issue 22007
# With asynchronous loading, the load errors in these tests are no longer recognized as compile errors:
Language/14_Libraries_and_Scripts/1_Imports_A04_t02: Fail
Language/14_Libraries_and_Scripts/2_Exports_A05_t02: Fail
diff --git a/tests/compiler/dart2js/backend_dart/dart_printer_test.dart b/tests/compiler/dart2js/backend_dart/dart_printer_test.dart
index dc6219f..4c51201 100644
--- a/tests/compiler/dart2js/backend_dart/dart_printer_test.dart
+++ b/tests/compiler/dart2js/backend_dart/dart_printer_test.dart
@@ -8,7 +8,7 @@
import 'package:compiler/src/constants/values.dart';
import 'package:compiler/src/dart_backend/backend_ast_nodes.dart';
import 'package:compiler/src/scanner/scannerlib.dart';
-import 'package:compiler/src/source_file.dart';
+import 'package:compiler/src/io/source_file.dart';
import 'package:compiler/src/dart2jslib.dart';
import 'package:compiler/src/tree/tree.dart' show DartString;
import 'dart:mirrors';
diff --git a/tests/compiler/dart2js/deferred_emit_type_checks_test.dart b/tests/compiler/dart2js/deferred_emit_type_checks_test.dart
index e236c69..f4f8295 100644
--- a/tests/compiler/dart2js/deferred_emit_type_checks_test.dart
+++ b/tests/compiler/dart2js/deferred_emit_type_checks_test.dart
@@ -6,21 +6,9 @@
// Files when using deferred loading.
import 'package:expect/expect.dart';
-import "package:async_helper/async_helper.dart";
+import 'package:async_helper/async_helper.dart';
import 'memory_source_file_helper.dart';
-import "dart:async";
-
-import 'package:compiler/src/dart2jslib.dart'
- as dart2js;
-
-class MemoryOutputSink<T> extends EventSink<T> {
- List<T> mem = new List<T>();
- void add(T event) {
- mem.add(event);
- }
- void addError(T event, [StackTrace stackTrace]) {}
- void close() {}
-}
+import 'output_collector.dart';
void main() {
Uri script = currentDirectory.resolveUri(Platform.script);
@@ -30,30 +18,22 @@
var provider = new MemorySourceFileProvider(MEMORY_SOURCE_FILES);
var handler = new FormattingDiagnosticHandler(provider);
- Map<String, MemoryOutputSink> outputs = new Map<String, MemoryOutputSink>();
-
- MemoryOutputSink outputSaver(name, extension) {
- if (name == '') {
- name = 'main';
- extension ='js';
- }
- return outputs.putIfAbsent("$name.$extension", () {
- return new MemoryOutputSink();
- });
- }
+ OutputCollector collector = new OutputCollector();
Compiler compiler = new Compiler(provider.readStringFromUri,
- outputSaver,
+ collector,
handler.diagnosticHandler,
libraryRoot,
packageRoot,
[],
{});
asyncTest(() => compiler.run(Uri.parse('memory:main.dart')).then((_) {
- String mainOutput = outputs['main.js'].mem[0];
- String deferredOutput = outputs['out_1.part.js'].mem[0];
+ String mainOutput = collector.getOutput('', 'js');
+ String deferredOutput = collector.getOutput('out_1', 'part.js');
String isPrefix = compiler.backend.namer.operatorIsPrefix;
- Expect.isTrue(deferredOutput.contains('${isPrefix}A: true'));
+ Expect.isTrue(deferredOutput.contains('${isPrefix}A: true'),
+ "Deferred output doesn't contain '${isPrefix}A: true':\n"
+ "$deferredOutput");
Expect.isFalse(mainOutput.contains('${isPrefix}A: true'));
}));
}
diff --git a/tests/compiler/dart2js/deferred_load_mapping_test.dart b/tests/compiler/dart2js/deferred_load_mapping_test.dart
new file mode 100644
index 0000000..6877f4f
--- /dev/null
+++ b/tests/compiler/dart2js/deferred_load_mapping_test.dart
@@ -0,0 +1,102 @@
+// 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 'memory_source_file_helper.dart';
+import "memory_compiler.dart";
+
+void main() {
+ var collector = new OutputCollector();
+ Compiler compiler = compilerFor(MEMORY_SOURCE_FILES,
+ options: ['--deferred-map=deferred_map.json'],
+ outputProvider: collector);
+ asyncTest(() {
+ return compiler.run(Uri.parse('memory:main.dart')).then((success) {
+ // Ensure a mapping file is output.
+ Expect.isNotNull(
+ collector.getOutput("deferred_map.json", "deferred_map"));
+
+ Map mapping = compiler.deferredLoadTask.computeDeferredMap();
+ // Test structure of mapping.
+ Expect.equals("<unnamed>", mapping["main.dart"]["name"]);
+ Expect.equals(2, mapping["main.dart"]["imports"]["lib1"].length);
+ Expect.equals(2, mapping["main.dart"]["imports"]["lib2"].length);
+ Expect.equals(1, mapping["main.dart"]["imports"]["convert"].length);
+ Expect.equals("lib1", mapping["memory:lib1.dart"]["name"]);
+ Expect.equals(1, mapping["memory:lib1.dart"]["imports"]["lib4_1"].length);
+ Expect.equals(1, mapping["memory:lib2.dart"]["imports"]["lib4_2"].length);
+ });
+ });
+}
+
+const Map MEMORY_SOURCE_FILES = const {
+ "main.dart":"""
+import 'dart:convert' deferred as convert;
+import 'lib1.dart' deferred as lib1;
+import 'lib2.dart' deferred as lib2;
+
+void main() {
+ lib1.loadLibrary().then((_) {
+ lib1.foo1();
+ new lib1.C();
+ lib2.loadLibrary().then((_) {
+ lib2.foo2();
+ });
+ });
+ convert.loadLibrary().then((_) {
+ new convert.JsonCodec();
+ });
+}
+""",
+ "lib1.dart":"""
+library lib1;
+import "dart:async";
+import "dart:html";
+
+import "lib3.dart" as l3;
+import "lib4.dart" deferred as lib4_1;
+
+class C {}
+
+foo1() {
+ new InputElement();
+ lib4_1.loadLibrary().then((_) {
+ lib4_1.bar1();
+ });
+ return () {return 1 + l3.foo3();} ();
+}
+""",
+ "lib2.dart":"""
+library lib2;
+import "dart:async";
+import "lib3.dart" as l3;
+import "lib4.dart" deferred as lib4_2;
+
+foo2() {
+ lib4_2.loadLibrary().then((_) {
+ lib4_2.bar2();
+ });
+ return () {return 2+l3.foo3();} ();
+}
+""",
+ "lib3.dart":"""
+library lib3;
+
+foo3() {
+ return () {return 3;} ();
+}
+""",
+ "lib4.dart":"""
+library lib4;
+
+bar1() {
+ return "hello";
+}
+
+bar2() {
+ return 2;
+}
+""",
+};
diff --git a/tests/compiler/dart2js/exit_code_test.dart b/tests/compiler/dart2js/exit_code_test.dart
index 9b31127..3bf7efe 100644
--- a/tests/compiler/dart2js/exit_code_test.dart
+++ b/tests/compiler/dart2js/exit_code_test.dart
@@ -1,266 +1,267 @@
-// 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.
-
-// Test the exit code of dart2js in case of exceptions, fatal errors, errors,
-// warnings, etc.
-
-
-import 'dart:async';
-import 'dart:io' show Platform;
-
-import 'package:async_helper/async_helper.dart';
-import 'package:expect/expect.dart';
-
-import 'package:compiler/compiler.dart' as api;
-import 'package:compiler/src/dart2js.dart' as entry;
-import 'package:compiler/src/dart2jslib.dart';
-import 'package:compiler/src/apiimpl.dart' as apiimpl;
-import 'package:compiler/src/elements/elements.dart';
-import 'package:compiler/src/library_loader.dart';
-import 'package:compiler/src/resolution/resolution.dart';
-import 'package:compiler/src/scanner/scannerlib.dart';
-import 'package:compiler/src/util/util.dart';
-
-class TestCompiler extends apiimpl.Compiler {
- final String testMarker;
- final String testType;
- final Function onTest;
-
- TestCompiler(api.CompilerInputProvider inputProvider,
- api.CompilerOutputProvider outputProvider,
- api.DiagnosticHandler handler,
- Uri libraryRoot,
- Uri packageRoot,
- List<String> options,
- Map<String, dynamic> environment,
- String this.testMarker,
- String this.testType,
- Function this.onTest)
- : super(inputProvider, outputProvider, handler, libraryRoot,
- packageRoot, options, environment) {
- scanner = new TestScanner(this);
- resolver = new TestResolver(this, backend.constantCompilerTask);
- test('Compiler');
- }
-
- Future<bool> run(Uri uri) {
- test('Compiler.run');
- return super.run(uri);
- }
-
- Future onLibraryScanned(LibraryElement element, LibraryLoader loader) {
- test('Compiler.onLibraryScanned');
- return super.onLibraryScanned(element, loader);
- }
-
- Future onLibrariesLoaded(LoadedLibraries loadedLibraries) {
- test('Compiler.onLibrariesLoaded');
- return super.onLibrariesLoaded(loadedLibraries);
- }
-
- void analyzeElement(Element element) {
- test('Compiler.analyzeElement');
- super.analyzeElement(element);
- }
-
- void codegen(CodegenWorkItem work, CodegenEnqueuer world) {
- test('Compiler.codegen');
- super.codegen(work, world);
- }
-
- withCurrentElement(Element element, f()) {
- return super.withCurrentElement(element, () {
- test('Compiler.withCurrentElement');
- return f();
- });
- }
-
- test(String marker) {
- if (marker == testMarker) {
- switch (testType) {
- case 'assert':
- onTest(testMarker, testType);
- assert(false);
- break;
- case 'invariant':
- onTest(testMarker, testType);
- invariant(NO_LOCATION_SPANNABLE, false, message: marker);
- break;
- case 'warning':
- onTest(testMarker, testType);
- reportWarning(NO_LOCATION_SPANNABLE,
- MessageKind.GENERIC, {'text': marker});
- break;
- case 'error':
- onTest(testMarker, testType);
- reportError(NO_LOCATION_SPANNABLE,
- MessageKind.GENERIC, {'text': marker});
- break;
- case 'fatalError':
- onTest(testMarker, testType);
- reportFatalError(NO_LOCATION_SPANNABLE,
- MessageKind.GENERIC, {'text': marker});
- break;
- case 'internalError':
- onTest(testMarker, testType);
- internalError(NO_LOCATION_SPANNABLE, marker);
- break;
- case 'NoSuchMethodError':
- onTest(testMarker, testType);
- null.foo;
- break;
- case '':
- onTest(testMarker, testType);
- break;
- }
- }
- }
-}
-
-class TestScanner extends ScannerTask {
- TestScanner(TestCompiler compiler) : super(compiler);
-
- TestCompiler get compiler => super.compiler;
-
- void scanElements(CompilationUnitElement compilationUnit) {
- compiler.test('ScannerTask.scanElements');
- super.scanElements(compilationUnit);
- }
-}
-
-class TestResolver extends ResolverTask {
- TestResolver(TestCompiler compiler, ConstantCompiler constantCompiler)
- : super(compiler, constantCompiler);
-
- TestCompiler get compiler => super.compiler;
-
- void computeClassMembers(ClassElement element) {
- compiler.test('ResolverTask.computeClassMembers');
- super.computeClassMembers(element);
- }
-}
-
-int checkedResults = 0;
-
-Future testExitCode(String marker, String type, int expectedExitCode) {
- bool testOccurred = false;
-
- void onTest(String testMarker, String testType) {
- if (testMarker == marker && testType == type) {
- testOccurred = true;
- }
- }
- return new Future(() {
- Future<api.CompilationResult> compile(
- Uri script,
- Uri libraryRoot,
- Uri packageRoot,
- api.CompilerInputProvider inputProvider,
- api.DiagnosticHandler handler,
- [List<String> options = const [],
- api.CompilerOutputProvider outputProvider,
- Map<String, dynamic> environment = const {}]) {
- libraryRoot = Platform.script.resolve('../../../sdk/');
- outputProvider = NullSink.outputProvider;
- // Use this to silence the test when debugging:
- // handler = (uri, begin, end, message, kind) {};
- Compiler compiler = new TestCompiler(inputProvider,
- outputProvider,
- handler,
- libraryRoot,
- packageRoot,
- options,
- environment,
- marker,
- type,
- onTest);
- return compiler.run(script).then((bool success) {
- return new api.CompilationResult(compiler, isSuccess: success);
- });
- }
-
- int foundExitCode;
-
- checkResult() {
- Expect.isTrue(testOccurred, 'testExitCode($marker, $type) did not occur');
- if (foundExitCode == null) foundExitCode = 0;
- print('testExitCode($marker, $type) '
- 'exitCode=$foundExitCode expected=$expectedExitCode');
- Expect.equals(expectedExitCode, foundExitCode,
- 'testExitCode($marker, $type) '
- 'exitCode=$foundExitCode expected=${expectedExitCode}');
- checkedResults++;
- }
-
- void exit(exitCode) {
- if (foundExitCode == null) {
- foundExitCode = exitCode;
- }
- };
-
- entry.exitFunc = exit;
- entry.compileFunc = compile;
-
- Future result = entry.internalMain(
- ["tests/compiler/dart2js/exit_code_helper.dart"]);
- return result.catchError((e, s) {
- // Capture crashes.
- }).whenComplete(checkResult);
- });
-}
-
-Future testExitCodes(String marker, Map<String,int> expectedExitCodes) {
- return Future.forEach(expectedExitCodes.keys, (String type) {
- return testExitCode(marker, type, expectedExitCodes[type]);
- });
-}
-
-void main() {
- bool isCheckedMode = false;
- assert((isCheckedMode = true));
-
- final beforeRun = {
- '': 0,
- 'NoSuchMethodError': 253,
- 'assert': isCheckedMode ? 253 : 0,
- 'invariant': 253
- };
-
- final duringRun = {
- '': 0,
- 'NoSuchMethodError': 253,
- 'assert': isCheckedMode ? 253 : 0,
- 'invariant': 253,
- 'warning': 0,
- 'error': 1,
- 'fatalError': 1,
- 'internalError': 253,
- };
-
- final tests = {
- 'Compiler': beforeRun,
- 'Compiler.run': beforeRun,
- 'Compiler.onLibraryScanned': beforeRun,
- 'Compiler.onLibrariesLoaded': beforeRun,
- 'ScannerTask.scanElements': duringRun,
- 'Compiler.withCurrentElement': duringRun,
- 'Compiler.analyzeElement': duringRun,
- 'Compiler.codegen': duringRun,
- 'ResolverTask.computeClassMembers': duringRun,
- };
-
- 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;
- }
-
- Expect.equals(countResults(beforeRun) + countResults(duringRun),
- checkedResults);
- asyncEnd();
- });
-}
+// 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.
+
+// Test the exit code of dart2js in case of exceptions, fatal errors, errors,
+// warnings, etc.
+
+
+import 'dart:async';
+import 'dart:io' show Platform;
+
+import 'package:async_helper/async_helper.dart';
+import 'package:expect/expect.dart';
+
+import 'package:compiler/compiler.dart' as api;
+import 'package:compiler/src/dart2js.dart' as entry;
+import 'package:compiler/src/dart2jslib.dart';
+import 'package:compiler/src/apiimpl.dart' as apiimpl;
+import 'package:compiler/src/elements/elements.dart';
+import 'package:compiler/src/library_loader.dart';
+import 'package:compiler/src/resolution/resolution.dart';
+import 'package:compiler/src/scanner/scannerlib.dart';
+import 'package:compiler/src/util/util.dart';
+
+class TestCompiler extends apiimpl.Compiler {
+ final String testMarker;
+ final String testType;
+ final Function onTest;
+
+ TestCompiler(api.CompilerInputProvider inputProvider,
+ api.CompilerOutputProvider outputProvider,
+ api.DiagnosticHandler handler,
+ Uri libraryRoot,
+ Uri packageRoot,
+ List<String> options,
+ Map<String, dynamic> environment,
+ String this.testMarker,
+ String this.testType,
+ Function this.onTest)
+ : super(inputProvider, outputProvider, handler, libraryRoot,
+ packageRoot, options, environment) {
+ scanner = new TestScanner(this);
+ resolver = new TestResolver(this, backend.constantCompilerTask);
+ test('Compiler');
+ }
+
+ Future<bool> run(Uri uri) {
+ test('Compiler.run');
+ return super.run(uri);
+ }
+
+ Future onLibraryScanned(LibraryElement element, LibraryLoader loader) {
+ test('Compiler.onLibraryScanned');
+ return super.onLibraryScanned(element, loader);
+ }
+
+ Future onLibrariesLoaded(LoadedLibraries loadedLibraries) {
+ test('Compiler.onLibrariesLoaded');
+ return super.onLibrariesLoaded(loadedLibraries);
+ }
+
+ void analyzeElement(Element element) {
+ test('Compiler.analyzeElement');
+ super.analyzeElement(element);
+ }
+
+ void codegen(CodegenWorkItem work, CodegenEnqueuer world) {
+ test('Compiler.codegen');
+ super.codegen(work, world);
+ }
+
+ withCurrentElement(Element element, f()) {
+ return super.withCurrentElement(element, () {
+ test('Compiler.withCurrentElement');
+ return f();
+ });
+ }
+
+ test(String marker) {
+ if (marker == testMarker) {
+ switch (testType) {
+ case 'assert':
+ onTest(testMarker, testType);
+ assert(false);
+ break;
+ case 'invariant':
+ onTest(testMarker, testType);
+ invariant(NO_LOCATION_SPANNABLE, false, message: marker);
+ break;
+ case 'warning':
+ onTest(testMarker, testType);
+ reportWarning(NO_LOCATION_SPANNABLE,
+ MessageKind.GENERIC, {'text': marker});
+ break;
+ case 'error':
+ onTest(testMarker, testType);
+ reportError(NO_LOCATION_SPANNABLE,
+ MessageKind.GENERIC, {'text': marker});
+ break;
+ case 'fatalError':
+ onTest(testMarker, testType);
+ reportError(NO_LOCATION_SPANNABLE,
+ MessageKind.GENERIC, {'text': marker});
+ throw new CompilerCancelledException(null);
+ break;
+ case 'internalError':
+ onTest(testMarker, testType);
+ internalError(NO_LOCATION_SPANNABLE, marker);
+ break;
+ case 'NoSuchMethodError':
+ onTest(testMarker, testType);
+ null.foo;
+ break;
+ case '':
+ onTest(testMarker, testType);
+ break;
+ }
+ }
+ }
+}
+
+class TestScanner extends ScannerTask {
+ TestScanner(TestCompiler compiler) : super(compiler);
+
+ TestCompiler get compiler => super.compiler;
+
+ void scanElements(CompilationUnitElement compilationUnit) {
+ compiler.test('ScannerTask.scanElements');
+ super.scanElements(compilationUnit);
+ }
+}
+
+class TestResolver extends ResolverTask {
+ TestResolver(TestCompiler compiler, ConstantCompiler constantCompiler)
+ : super(compiler, constantCompiler);
+
+ TestCompiler get compiler => super.compiler;
+
+ void computeClassMembers(ClassElement element) {
+ compiler.test('ResolverTask.computeClassMembers');
+ super.computeClassMembers(element);
+ }
+}
+
+int checkedResults = 0;
+
+Future testExitCode(String marker, String type, int expectedExitCode) {
+ bool testOccurred = false;
+
+ void onTest(String testMarker, String testType) {
+ if (testMarker == marker && testType == type) {
+ testOccurred = true;
+ }
+ }
+ return new Future(() {
+ Future<api.CompilationResult> compile(
+ Uri script,
+ Uri libraryRoot,
+ Uri packageRoot,
+ api.CompilerInputProvider inputProvider,
+ api.DiagnosticHandler handler,
+ [List<String> options = const [],
+ api.CompilerOutputProvider outputProvider,
+ Map<String, dynamic> environment = const {}]) {
+ libraryRoot = Platform.script.resolve('../../../sdk/');
+ outputProvider = NullSink.outputProvider;
+ // Use this to silence the test when debugging:
+ // handler = (uri, begin, end, message, kind) {};
+ Compiler compiler = new TestCompiler(inputProvider,
+ outputProvider,
+ handler,
+ libraryRoot,
+ packageRoot,
+ options,
+ environment,
+ marker,
+ type,
+ onTest);
+ return compiler.run(script).then((bool success) {
+ return new api.CompilationResult(compiler, isSuccess: success);
+ });
+ }
+
+ int foundExitCode;
+
+ checkResult() {
+ Expect.isTrue(testOccurred, 'testExitCode($marker, $type) did not occur');
+ if (foundExitCode == null) foundExitCode = 0;
+ print('testExitCode($marker, $type) '
+ 'exitCode=$foundExitCode expected=$expectedExitCode');
+ Expect.equals(expectedExitCode, foundExitCode,
+ 'testExitCode($marker, $type) '
+ 'exitCode=$foundExitCode expected=${expectedExitCode}');
+ checkedResults++;
+ }
+
+ void exit(exitCode) {
+ if (foundExitCode == null) {
+ foundExitCode = exitCode;
+ }
+ };
+
+ entry.exitFunc = exit;
+ entry.compileFunc = compile;
+
+ Future result = entry.internalMain(
+ ["tests/compiler/dart2js/exit_code_helper.dart"]);
+ return result.catchError((e, s) {
+ // Capture crashes.
+ }).whenComplete(checkResult);
+ });
+}
+
+Future testExitCodes(String marker, Map<String,int> expectedExitCodes) {
+ return Future.forEach(expectedExitCodes.keys, (String type) {
+ return testExitCode(marker, type, expectedExitCodes[type]);
+ });
+}
+
+void main() {
+ bool isCheckedMode = false;
+ assert((isCheckedMode = true));
+
+ final beforeRun = {
+ '': 0,
+ 'NoSuchMethodError': 253,
+ 'assert': isCheckedMode ? 253 : 0,
+ 'invariant': 253
+ };
+
+ final duringRun = {
+ '': 0,
+ 'NoSuchMethodError': 253,
+ 'assert': isCheckedMode ? 253 : 0,
+ 'invariant': 253,
+ 'warning': 0,
+ 'error': 1,
+ 'fatalError': 1,
+ 'internalError': 253,
+ };
+
+ final tests = {
+ 'Compiler': beforeRun,
+ 'Compiler.run': beforeRun,
+ 'Compiler.onLibraryScanned': beforeRun,
+ 'Compiler.onLibrariesLoaded': beforeRun,
+ 'ScannerTask.scanElements': duringRun,
+ 'Compiler.withCurrentElement': duringRun,
+ 'Compiler.analyzeElement': duringRun,
+ 'Compiler.codegen': duringRun,
+ 'ResolverTask.computeClassMembers': duringRun,
+ };
+
+ 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;
+ }
+
+ Expect.equals(countResults(beforeRun) + countResults(duringRun),
+ checkedResults);
+ asyncEnd();
+ });
+}
diff --git a/tests/compiler/dart2js/forloop_box_test.dart b/tests/compiler/dart2js/forloop_box_test.dart
new file mode 100644
index 0000000..25873c0
--- /dev/null
+++ b/tests/compiler/dart2js/forloop_box_test.dart
@@ -0,0 +1,39 @@
+// 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 'compiler_helper.dart';
+
+String TEST = r'''
+main() {
+ var a;
+ for (var i=0; i<10; i++) {
+ a = () => i;
+ }
+ print(a());
+}
+''';
+
+String NEGATIVE_TEST = r'''
+run(f) => f();
+main() {
+ var a;
+ for (var i=0; i<10; run(() => i++)) {
+ a = () => i;
+ }
+ print(a());
+}
+''';
+
+main() {
+ asyncTest(() => compileAll(TEST).then((generated) {
+ Expect.isTrue(generated.contains('main_closure(i)'),
+ 'for-loop variable was boxed');
+ }));
+ asyncTest(() => compileAll(NEGATIVE_TEST).then((generated) {
+ Expect.isFalse(generated.contains('main_closure(i)'),
+ 'for-loop variable was not boxed');
+ }));
+}
diff --git a/tests/compiler/dart2js/js_backend_cps_ir_test.dart b/tests/compiler/dart2js/js_backend_cps_ir.dart
similarity index 78%
rename from tests/compiler/dart2js/js_backend_cps_ir_test.dart
rename to tests/compiler/dart2js/js_backend_cps_ir.dart
index ab7f761..34ccdfe 100644
--- a/tests/compiler/dart2js/js_backend_cps_ir_test.dart
+++ b/tests/compiler/dart2js/js_backend_cps_ir.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
// Test that the CPS IR code generator compiles programs and produces the
// the expected output.
@@ -14,21 +13,8 @@
import 'package:compiler/src/js/js.dart' as js;
import 'package:compiler/src/common.dart' show Element;
-import 'js_backend_cps_ir_basic.dart' as basic;
-import 'js_backend_cps_ir_literals.dart' as literals;
-import 'js_backend_cps_ir_operators.dart' as operators;
-import 'js_backend_cps_ir_control_flow.dart' as control_flow;
-import 'js_backend_cps_ir_interceptors.dart' as interceptors;
-
const String TEST_MAIN_FILE = 'test.dart';
-List<TestEntry> tests = <TestEntry>[]
- ..addAll(basic.tests)
- ..addAll(literals.tests)
- ..addAll(control_flow.tests)
- ..addAll(operators.tests)
- ..addAll(interceptors.tests);
-
class TestEntry {
final String source;
final String expectation;
@@ -45,7 +31,8 @@
return js.prettyPrint(ast, compiler).getText();
}
-main() {
+
+runTests(List<TestEntry> tests) {
Expect.isTrue(const bool.fromEnvironment("USE_CPS_IR"));
for (TestEntry test in tests) {
diff --git a/tests/compiler/dart2js/js_backend_cps_ir_basic.dart b/tests/compiler/dart2js/js_backend_cps_ir_basic_test.dart
similarity index 94%
rename from tests/compiler/dart2js/js_backend_cps_ir_basic.dart
rename to tests/compiler/dart2js/js_backend_cps_ir_basic_test.dart
index d10d2c2..cde5ccc 100644
--- a/tests/compiler/dart2js/js_backend_cps_ir_basic.dart
+++ b/tests/compiler/dart2js/js_backend_cps_ir_basic_test.dart
@@ -1,12 +1,13 @@
// 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.
library basic_tests;
-import 'js_backend_cps_ir_test.dart';
+import 'js_backend_cps_ir.dart';
const List<TestEntry> tests = const [
const TestEntry("""
@@ -101,3 +102,8 @@
return null;
}"""),
];
+
+
+void main() {
+ runTests(tests);
+}
diff --git a/tests/compiler/dart2js/js_backend_cps_ir_closures_test.dart b/tests/compiler/dart2js/js_backend_cps_ir_closures_test.dart
new file mode 100644
index 0000000..068f6d2
--- /dev/null
+++ b/tests/compiler/dart2js/js_backend_cps_ir_closures_test.dart
@@ -0,0 +1,124 @@
+// 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.
+
+library closures_test;
+
+import 'js_backend_cps_ir.dart';
+
+const List<TestEntry> tests = const [
+ const TestEntry("""
+main(x) {
+ a() {
+ return x;
+ }
+ x = x + '1';
+ print(a());
+}
+""",
+r"""
+function(x) {
+ var box_0, a, v0;
+ box_0 = {};
+ box_0.x_0 = x;
+ a = new V.main_a(box_0);
+ x = box_0.x_0;
+ v0 = "1";
+ box_0.x_0 = J.getInterceptor(x).$add(x, v0);
+ P.print(a.call$0());
+ return null;
+}"""),
+
+ const TestEntry("""
+main(x) {
+ a() {
+ return x;
+ }
+ print(a());
+}
+""",
+r"""
+function(x) {
+ P.print(new V.main_a(x).call$0());
+ return null;
+}"""),
+
+ const TestEntry("""
+main() {
+ var x = 122;
+ var a = () => x;
+ x = x + 1;
+ print(a());
+}
+""",
+r"""
+function() {
+ var box_0, a, x, v0;
+ box_0 = {};
+ box_0.x_0 = 122;
+ a = new V.main_closure(box_0);
+ x = box_0.x_0;
+ v0 = 1;
+ box_0.x_0 = J.getInterceptor(x).$add(x, v0);
+ P.print(a.call$0());
+ return null;
+}"""),
+
+ const TestEntry("""
+main() {
+ var x = 122;
+ var a = () {
+ var y = x;
+ return () => y;
+ };
+ x = x + 1;
+ print(a()());
+}
+""",
+r"""
+function() {
+ var box_0, a, x, v0;
+ box_0 = {};
+ box_0.x_0 = 122;
+ a = new V.main_closure(box_0);
+ x = box_0.x_0;
+ v0 = 1;
+ box_0.x_0 = J.getInterceptor(x).$add(x, v0);
+ P.print(a.call$0().call$0());
+ return null;
+}"""),
+
+ const TestEntry("""
+main() {
+ var a;
+ for (var i=0; i<10; i++) {
+ a = () => i;
+ }
+ print(a());
+}
+""",
+r"""
+function() {
+ var a, i, v0, v1;
+ a = null;
+ i = 0;
+ while (true) {
+ v0 = 10;
+ if (P.identical(J.getInterceptor(i).$lt(i, v0), true)) {
+ a = new V.main_closure(i);
+ v1 = 1;
+ i = J.getInterceptor(i).$add(i, v1);
+ } else {
+ P.print(a.call$0());
+ return null;
+ }
+ }
+}"""),
+];
+
+void main() {
+ runTests(tests);
+}
diff --git a/tests/compiler/dart2js/js_backend_cps_ir_control_flow.dart b/tests/compiler/dart2js/js_backend_cps_ir_control_flow_test.dart
similarity index 95%
rename from tests/compiler/dart2js/js_backend_cps_ir_control_flow.dart
rename to tests/compiler/dart2js/js_backend_cps_ir_control_flow_test.dart
index 2695588..9f82e28 100644
--- a/tests/compiler/dart2js/js_backend_cps_ir_control_flow.dart
+++ b/tests/compiler/dart2js/js_backend_cps_ir_control_flow_test.dart
@@ -1,12 +1,13 @@
// 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.
library control_flow_tests;
-import 'js_backend_cps_ir_test.dart';
+import 'js_backend_cps_ir.dart';
const List<TestEntry> tests = const [
const TestEntry("""
@@ -138,3 +139,7 @@
return null;
}"""),
];
+
+void main() {
+ runTests(tests);
+}
diff --git a/tests/compiler/dart2js/js_backend_cps_ir_interceptors.dart b/tests/compiler/dart2js/js_backend_cps_ir_interceptors_test.dart
similarity index 83%
rename from tests/compiler/dart2js/js_backend_cps_ir_interceptors.dart
rename to tests/compiler/dart2js/js_backend_cps_ir_interceptors_test.dart
index 6640b9a..ef56ac0 100644
--- a/tests/compiler/dart2js/js_backend_cps_ir_interceptors.dart
+++ b/tests/compiler/dart2js/js_backend_cps_ir_interceptors_test.dart
@@ -1,12 +1,13 @@
// 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.
library interceptors_tests;
-import 'js_backend_cps_ir_test.dart';
+import 'js_backend_cps_ir.dart';
const List<TestEntry> tests = const [
const TestEntry("""
@@ -25,3 +26,8 @@
return null;
}"""),
];
+
+
+void main() {
+ runTests(tests);
+}
diff --git a/tests/compiler/dart2js/js_backend_cps_ir_literals.dart b/tests/compiler/dart2js/js_backend_cps_ir_literals_test.dart
similarity index 88%
rename from tests/compiler/dart2js/js_backend_cps_ir_literals.dart
rename to tests/compiler/dart2js/js_backend_cps_ir_literals_test.dart
index 02cfefe..ea90c77 100644
--- a/tests/compiler/dart2js/js_backend_cps_ir_literals.dart
+++ b/tests/compiler/dart2js/js_backend_cps_ir_literals_test.dart
@@ -1,12 +1,13 @@
// 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.
library literals_tests;
-import 'js_backend_cps_ir_test.dart';
+import 'js_backend_cps_ir.dart';
const List<TestEntry> tests = const [
const TestEntry("""
@@ -32,3 +33,7 @@
return null;
}"""),
];
+
+void main() {
+ runTests(tests);
+}
diff --git a/tests/compiler/dart2js/js_backend_cps_ir_operators.dart b/tests/compiler/dart2js/js_backend_cps_ir_operators_test.dart
similarity index 91%
rename from tests/compiler/dart2js/js_backend_cps_ir_operators.dart
rename to tests/compiler/dart2js/js_backend_cps_ir_operators_test.dart
index 781dde1..18aa0c5 100644
--- a/tests/compiler/dart2js/js_backend_cps_ir_operators.dart
+++ b/tests/compiler/dart2js/js_backend_cps_ir_operators_test.dart
@@ -1,12 +1,13 @@
// 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.
library operators_tests;
-import 'js_backend_cps_ir_test.dart';
+import 'js_backend_cps_ir.dart';
const List<TestEntry> tests = const [
const TestEntry("main() { return true ? 42 : 'foo'; }"),
@@ -43,3 +44,7 @@
return null;
}"""),
];
+
+void main() {
+ runTests(tests);
+}
diff --git a/tests/compiler/dart2js/library_resolution_test.dart b/tests/compiler/dart2js/library_resolution_test.dart
index 9cd69b2..1a44800 100644
--- a/tests/compiler/dart2js/library_resolution_test.dart
+++ b/tests/compiler/dart2js/library_resolution_test.dart
@@ -21,7 +21,8 @@
LibraryElement;
import 'package:compiler/src/dart2jslib.dart' show
- MessageKind;
+ MessageKind,
+ NullSink;
import 'package:_internal/libraries.dart' show
DART2JS_PLATFORM,
diff --git a/tests/compiler/dart2js/memory_source_file_helper.dart b/tests/compiler/dart2js/memory_source_file_helper.dart
index 6dc0969..827e5c1 100644
--- a/tests/compiler/dart2js/memory_source_file_helper.dart
+++ b/tests/compiler/dart2js/memory_source_file_helper.dart
@@ -13,7 +13,7 @@
export 'package:compiler/src/filenames.dart'
show currentDirectory;
-import 'package:compiler/src/source_file.dart'
+import 'package:compiler/src/io/source_file.dart'
show StringSourceFile;
import 'package:compiler/src/source_file_provider.dart'
diff --git a/tests/compiler/dart2js/mirror_helper_test.dart b/tests/compiler/dart2js/mirror_helper_test.dart
index f9e1647..e454c7e 100644
--- a/tests/compiler/dart2js/mirror_helper_test.dart
+++ b/tests/compiler/dart2js/mirror_helper_test.dart
@@ -43,8 +43,8 @@
DartBackend backend = compiler.backend;
MirrorRenamerImpl mirrorRenamer = backend.mirrorRenamer;
Map<Node, String> renames = backend.placeholderRenamer.renames;
- Set<LibraryElement> imports =
- backend.placeholderRenamer.platformImports;
+ Iterable<LibraryElement> imports =
+ backend.placeholderRenamer.platformImports.keys;
FunctionExpression node = backend.memberNodes.values.first.first;
Block block = node.body;
@@ -65,8 +65,8 @@
DartBackend backend = compiler.backend;
Map<Node, String> renames = backend.placeholderRenamer.renames;
- Set<LibraryElement> imports =
- backend.placeholderRenamer.platformImports;
+ Iterable<LibraryElement> imports =
+ backend.placeholderRenamer.platformImports.keys;
FunctionExpression node = backend.memberNodes.values.first.first;
Block block = node.body;
ExpressionStatement getNameFunctionNode = block.statements.nodes.head;
diff --git a/tests/compiler/dart2js/mirrors_test.dart b/tests/compiler/dart2js/mirrors_test.dart
index 339eb3a..2b5d992 100644
--- a/tests/compiler/dart2js/mirrors_test.dart
+++ b/tests/compiler/dart2js/mirrors_test.dart
@@ -43,13 +43,14 @@
main() {
Uri scriptUri = currentDirectory.resolveUri(Platform.script);
+ Uri packageRoot = scriptUri.resolve('./packages/');
Uri libUri = scriptUri.resolve('../../../sdk/');
Uri inputUri = scriptUri.resolve('mirrors_helper.dart');
var provider = new CompilerSourceFileProvider();
var diagnosticHandler =
new FormattingDiagnosticHandler(provider).diagnosticHandler;
asyncStart();
- var result = analyze([inputUri], libUri, null,
+ var result = analyze([inputUri], libUri, packageRoot,
provider.readStringFromUri, diagnosticHandler,
<String>['--preserve-comments']);
result.then((MirrorSystem mirrors) {
diff --git a/tests/compiler/dart2js/missing_file_test.dart b/tests/compiler/dart2js/missing_file_test.dart
index 69b76da..92c94d5 100644
--- a/tests/compiler/dart2js/missing_file_test.dart
+++ b/tests/compiler/dart2js/missing_file_test.dart
@@ -30,6 +30,7 @@
void runCompiler(Uri main, String expectedMessage) {
Uri script = currentDirectory.resolveUri(Platform.script);
Uri libraryRoot = script.resolve('../../../sdk/');
+ Uri packageRoot = script.resolve('./packages/');
var provider = new MemorySourceFileProvider(MEMORY_SOURCE_FILES);
var handler = new FormattingDiagnosticHandler(provider);
@@ -53,7 +54,7 @@
outputProvider,
diagnosticHandler,
libraryRoot,
- null,
+ packageRoot,
[],
{});
diff --git a/tests/compiler/dart2js/mock_compiler.dart b/tests/compiler/dart2js/mock_compiler.dart
index 7fdad36..136ac76 100644
--- a/tests/compiler/dart2js/mock_compiler.dart
+++ b/tests/compiler/dart2js/mock_compiler.dart
@@ -13,7 +13,7 @@
import 'package:compiler/src/js_backend/js_backend.dart'
show JavaScriptBackend;
import 'package:compiler/src/resolution/resolution.dart';
-import 'package:compiler/src/source_file.dart';
+import 'package:compiler/src/io/source_file.dart';
import 'package:compiler/src/tree/tree.dart';
import 'package:compiler/src/util/util.dart';
import 'parser_helper.dart';
@@ -163,12 +163,6 @@
api.Diagnostic.WARNING);
}
- void reportFatalError(Spannable node,
- MessageKind messageKind,
- [Map arguments = const {}]) {
- reportError(node, messageKind, arguments);
- }
-
void reportDiagnostic(Spannable node,
Message message,
api.Diagnostic kind) {
@@ -218,7 +212,14 @@
if (visitor.scope is LibraryScope) {
visitor.scope = new MethodScope(visitor.scope, element);
}
- visitor.visit(tree);
+ try {
+ visitor.visit(tree);
+ } on CompilerCancelledException catch (_) {
+ // Ignored.
+
+ // TODO(ahe): Don't ignore CompilerCancelledException, instead, fix
+ // pkg/compiler/lib/src/resolution/members.dart.
+ }
visitor.scope = new LibraryScope(element.library);
return visitor.registry.mapping;
}
diff --git a/tests/compiler/dart2js/mock_libraries.dart b/tests/compiler/dart2js/mock_libraries.dart
index 8ef8847..a004239 100644
--- a/tests/compiler/dart2js/mock_libraries.dart
+++ b/tests/compiler/dart2js/mock_libraries.dart
@@ -241,7 +241,6 @@
'getNativeInterceptor': 'getNativeInterceptor(x) {}',
'initializeDispatchProperty': 'initializeDispatchProperty(f,p,i) {}',
'initializeDispatchPropertyCSP': 'initializeDispatchPropertyCSP(f,p,i) {}',
- 'interceptedNames': 'var interceptedNames;',
'Interceptor': r'''
class Interceptor {
toString() {}
@@ -346,7 +345,6 @@
}''',
'JSUInt31': 'class JSUInt31 extends JSUInt32 {}',
'JSUInt32': 'class JSUInt32 extends JSPositiveInt {}',
- 'mapTypeToInterceptor': 'var mapTypeToInterceptor;',
'ObjectInterceptor': 'class ObjectInterceptor {}',
'PlainJavaScriptObject': 'class PlainJavaScriptObject {}',
'UnknownJavaScriptObject': 'class UnknownJavaScriptObject {}',
diff --git a/tests/compiler/dart2js/package_root_test.dart b/tests/compiler/dart2js/package_root_test.dart
index 7a5cce3..93327b3 100644
--- a/tests/compiler/dart2js/package_root_test.dart
+++ b/tests/compiler/dart2js/package_root_test.dart
@@ -30,6 +30,7 @@
void runCompiler(Uri main) {
Uri script = currentDirectory.resolveUri(Platform.script);
Uri libraryRoot = script.resolve('../../../sdk/');
+ Uri packageRoot = script.resolve('./packages/');
var provider = new MemorySourceFileProvider(MEMORY_SOURCE_FILES);
var handler = new FormattingDiagnosticHandler(provider);
@@ -53,15 +54,15 @@
outputProvider,
diagnosticHandler,
libraryRoot,
- null,
+ packageRoot,
[],
{});
asyncTest(() => compiler.run(main).then((_) {
Expect.equals(1, errors.length);
- Expect.equals("Cannot resolve 'package:foo/foo.dart'. "
- "Package root has not been set.",
- errors[0]);
+ Expect.isTrue(
+ errors[0].startsWith(
+ "Can't read 'package:foo/foo.dart' (Error reading "));
}));
}
diff --git a/tests/compiler/dart2js/parser_helper.dart b/tests/compiler/dart2js/parser_helper.dart
index c7678a4..3b07370 100644
--- a/tests/compiler/dart2js/parser_helper.dart
+++ b/tests/compiler/dart2js/parser_helper.dart
@@ -9,7 +9,7 @@
import "package:compiler/src/elements/elements.dart";
import "package:compiler/src/tree/tree.dart";
import "package:compiler/src/scanner/scannerlib.dart";
-import "package:compiler/src/source_file.dart";
+import "package:compiler/src/io/source_file.dart";
import "package:compiler/src/util/util.dart";
import "package:compiler/src/elements/modelx.dart"
diff --git a/tests/compiler/dart2js/private_test.dart b/tests/compiler/dart2js/private_test.dart
index bbe3780..f36513e 100644
--- a/tests/compiler/dart2js/private_test.dart
+++ b/tests/compiler/dart2js/private_test.dart
@@ -6,7 +6,7 @@
import "package:async_helper/async_helper.dart";
import 'mock_compiler.dart';
-import 'package:compiler/src/source_file.dart';
+import 'package:compiler/src/io/source_file.dart';
import 'package:compiler/src/dart2jslib.dart';
const String PRIVATE_SOURCE_URI = 'src:private';
diff --git a/tests/compiler/dart2js/resolver_test.dart b/tests/compiler/dart2js/resolver_test.dart
index 653a12d..cd3d0ff 100644
--- a/tests/compiler/dart2js/resolver_test.dart
+++ b/tests/compiler/dart2js/resolver_test.dart
@@ -919,7 +919,7 @@
"""class A {
A() : this.foo = 1;
}""";
- return resolveConstructor(script, "A a = new A();", "A", "", 0,
+ return resolveConstructor(script, "A a = new A();", "A", "", 1,
expectedWarnings: [],
expectedErrors: [MessageKind.CANNOT_RESOLVE]);
},
diff --git a/tests/compiler/dart2js/source_map_validator_helper.dart b/tests/compiler/dart2js/source_map_validator_helper.dart
index 4083e10..fdd5ac9 100644
--- a/tests/compiler/dart2js/source_map_validator_helper.dart
+++ b/tests/compiler/dart2js/source_map_validator_helper.dart
@@ -15,7 +15,7 @@
CompilationUnitElement,
ClassElement,
AstElement;
-import 'package:compiler/src/source_file.dart' show SourceFile;
+import 'package:compiler/src/io/source_file.dart' show SourceFile;
validateSourceMap(Uri targetUri, [Compiler compiler]) {
Uri mapUri = getMapUri(targetUri);
@@ -174,7 +174,7 @@
Uri getMapUri(Uri targetUri) {
print('Accessing $targetUri');
File targetFile = new File.fromUri(targetUri);
- Expect.isTrue(targetFile.existsSync());
+ Expect.isTrue(targetFile.existsSync(), "File '$targetUri' doesn't exist.");
List<String> target = targetFile.readAsStringSync().split('\n');
String mapReference = target[target.length - 2]; // #sourceMappingURL=<url>
Expect.isTrue(mapReference.startsWith('//# sourceMappingURL='));
diff --git a/tests/compiler/dart2js/source_mapping_test.dart b/tests/compiler/dart2js/source_mapping_test.dart
index 3ff0813..8b5fa4e 100644
--- a/tests/compiler/dart2js/source_mapping_test.dart
+++ b/tests/compiler/dart2js/source_mapping_test.dart
@@ -6,7 +6,7 @@
import "package:expect/expect.dart";
import "package:async_helper/async_helper.dart";
import "package:compiler/src/io/code_output.dart";
-import 'package:compiler/src/source_file.dart';
+import 'package:compiler/src/io/source_file.dart';
import "mock_compiler.dart";
import 'package:compiler/src/js_backend/js_backend.dart';
@@ -16,7 +16,8 @@
compiler.sourceFiles[uri.toString()] = sourceFile;
JavaScriptBackend backend = compiler.backend;
return compiler.runCompiler(uri).then((_) {
- return backend.emitter.oldEmitter.mainBuffer;
+ return backend.emitter.oldEmitter
+ .outputBuffers[compiler.deferredLoadTask.mainOutputUnit];
});
}
@@ -30,9 +31,9 @@
String code = codeWithMarkers.replaceAll('@', '');
SourceFile sourceFile = new StringSourceFile('<test script>', code);
- asyncTest(() => compileAll(sourceFile).then((CodeBuffer buffer) {
+ asyncTest(() => compileAll(sourceFile).then((CodeOutput output) {
Set<int> locations = new Set<int>();
- buffer.forEachSourceLocation((int offset, var sourcePosition) {
+ output.forEachSourceLocation((int offset, var sourcePosition) {
if (sourcePosition != null && sourcePosition.sourceFile == sourceFile) {
locations.add(sourcePosition.token.charOffset);
}
diff --git a/tests/compiler/dart2js/type_checker_test.dart b/tests/compiler/dart2js/type_checker_test.dart
index f00a0d7..7f70d7d 100644
--- a/tests/compiler/dart2js/type_checker_test.dart
+++ b/tests/compiler/dart2js/type_checker_test.dart
@@ -8,7 +8,7 @@
import 'package:compiler/src/elements/elements.dart';
import 'package:compiler/src/tree/tree.dart';
import 'package:compiler/src/util/util.dart';
-import 'package:compiler/src/source_file.dart';
+import 'package:compiler/src/io/source_file.dart';
import 'mock_compiler.dart';
import 'parser_helper.dart';
diff --git a/tests/compiler/dart2js/warnings_checker.dart b/tests/compiler/dart2js/warnings_checker.dart
index cdcd02a..396f6b4 100644
--- a/tests/compiler/dart2js/warnings_checker.dart
+++ b/tests/compiler/dart2js/warnings_checker.dart
@@ -11,7 +11,7 @@
import 'package:async_helper/async_helper.dart';
import 'memory_compiler.dart';
import 'package:compiler/src/filenames.dart';
-import 'package:compiler/src/source_file.dart';
+import 'package:compiler/src/io/source_file.dart';
import 'package:compiler/src/source_file_provider.dart';
import 'package:compiler/src/util/uri_extras.dart';
import 'dart:convert';
diff --git a/tests/compiler/dart2js_extra/compile_time_constant4_test.dart b/tests/compiler/dart2js_extra/compile_time_constant4_test.dart
index 2a7e55a..61c8369 100644
--- a/tests/compiler/dart2js_extra/compile_time_constant4_test.dart
+++ b/tests/compiler/dart2js_extra/compile_time_constant4_test.dart
@@ -7,35 +7,35 @@
const x = "foo";
const y = "foo";
const g1 = x
- + "bar" /// 01: compile-time error
+ + "bar"
;
const g2 = x
- + null /// 02: compile-time error
+ + null /// 01: compile-time error
;
const g3 = x
- + 499 /// 03: compile-time error
+ + 499 /// 02: compile-time error
;
const g4 = x
- + 3.3 /// 04: compile-time error
+ + 3.3 /// 03: compile-time error
;
const g5 = x
- + true /// 05: compile-time error
+ + true /// 04: compile-time error
;
const g6 = x
- + false /// 06: compile-time error
+ + false /// 05: compile-time error
;
const g7 = "foo"
- + x[0] /// 07: compile-time error
+ + x[0] /// 06: compile-time error
;
const g8 = 1
- + x.length /// 08: compile-time error
+ + x.length
;
const g9 = x == y;
use(x) => x;
main() {
- Expect.equals("foo", g1);
+ Expect.equals("foobar", g1);
Expect.isTrue(g9);
use(g1);
use(g2);
diff --git a/tests/corelib/corelib.status b/tests/corelib/corelib.status
index f56ef3b..947bfe2 100644
--- a/tests/corelib/corelib.status
+++ b/tests/corelib/corelib.status
@@ -56,6 +56,7 @@
int_parse_radix_test/01: Pass, Fail # JS implementations disagree on U+0085 being whitespace.
int_parse_radix_test/02: Fail # No bigints.
double_parse_test/01: Pass, Fail # JS implementations disagree on U+0085 being whitespace.
+integer_to_radix_string_test: RuntimeError # issue 22045
# With the exception of 'void', const Symbol() should not accept reserved
# words.
@@ -213,10 +214,6 @@
num_clamp_test: StaticWarning, OK # Test generates errors on purpose.
string_test: StaticWarning, OK # Test generates error on purpose.
-[ $runtime == ie10 ]
-num_parse_test: RuntimeError # Issue 15316
-num_parse_test/01: RuntimeError # Issue 15316
-
[ $system == windows && $arch == x64 ]
stopwatch_test: Skip # Flaky test due to expected performance behaviour.
diff --git a/tests/corelib/integer_to_radix_string_test.dart b/tests/corelib/integer_to_radix_string_test.dart
index 34db6fb..80d30cc 100644
--- a/tests/corelib/integer_to_radix_string_test.dart
+++ b/tests/corelib/integer_to_radix_string_test.dart
@@ -11,7 +11,7 @@
'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j',
'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't',
'u', 'v', 'w', 'x', 'y', 'z'];
- for (var radix = 2; radix < 37; radix++) {
+ for (var radix = 2; radix <= 36; radix++) {
for (var i = 0; i < radix; i++) {
Expect.equals(expected[i], i.toRadixString(radix));
}
@@ -26,4 +26,36 @@
// Nothing to do.
}
}
+
+ // Try large numbers (regression test for issue 15316).
+ var bignums = [
+ 0x80000000,
+ 0x100000000,
+ 0x10000000000000,
+ 0x10000000000001, // 53 significant bits.
+ 0x20000000000000,
+ 0x20000000000002,
+ 0x1000000000000000,
+ 0x1000000000000100,
+ 0x2000000000000000,
+ 0x2000000000000200,
+ 0x8000000000000000,
+ 0x8000000000000800,
+ 0x10000000000000000,
+ 0x10000000000001000,
+ 0x100000000000010000,
+ 0x1000000000000100000,
+ 0x10000000000001000000,
+ 0x100000000000010000000,
+ 0x1000000000000100000000,
+ 0x10000000000001000000000,
+ ];
+ for (var bignum in bignums) {
+ for (int radix = 2; radix <= 36; radix++) {
+ String digits = bignum.toRadixString(radix);
+ int result = int.parse(digits, radix: radix);
+ Expect.equals(bignum, result,
+ "${bignum.toRadixString(16)} -> $digits/$radix");
+ }
+ }
}
diff --git a/tests/html/html.status b/tests/html/html.status
index 25ea826..dc001be 100644
--- a/tests/html/html.status
+++ b/tests/html/html.status
@@ -129,7 +129,7 @@
no_linked_scripts_htmltest: Skip # Times out on IE. Issue 21537
scripts_htmltest: Skip # Times out on IE. Issue 21537
two_scripts_htmltest: Skip # Times out on IE. Issue 21537
-deferred_multi_app_htmltest: Skip # Issue 21537
+deferred_multi_app_htmltest: Skip # Times out on IE. Issue 21537
[$runtime == ie10 ]
# IE10 Feature support statuses-
@@ -350,6 +350,9 @@
[ $compiler == dart2js && ($runtime == drt || $runtime == ff) ]
request_animation_frame_test: Skip # Async test hangs.
+[ $compiler == dart2js && $runtime == ff ]
+history_test/history: Skip # Issue 22050
+
[ $compiler == dart2js && $csp && ($runtime == drt || $runtime == safari || $runtime == ff || $runtime == chrome || $runtime == chromeOnAndroid) ]
# Note: these tests are all injecting scripts by design. This is not allowed under CSP.
event_customevent_test: Fail # Test cannot run under CSP restrictions.
diff --git a/tests/isolate/isolate.status b/tests/isolate/isolate.status
index 17d496b..ab7ade2 100644
--- a/tests/isolate/isolate.status
+++ b/tests/isolate/isolate.status
@@ -49,6 +49,8 @@
[ $compiler == dart2js ]
spawn_uri_vm_test: SkipByDesign # Test uses a ".dart" URI.
spawn_uri_nested_vm_test: SkipByDesign # Test uses a ".dart" URI.
+issue_21398_parent_isolate_test: SkipByDesign # Test uses a ".dart" URI.
+issue_21398_parent_isolate1_test: SkipByDesign # Test uses a ".dart" URI.
message3_test/constList: RuntimeError # Issue 21817
message3_test/constList_identical: RuntimeError # Issue 21817
message3_test/constMap: RuntimeError # Issue 21817
@@ -68,6 +70,8 @@
spawn_uri_nested_vm_test: RuntimeError # Issue 16549
spawn_uri_test: RuntimeError # Issue 16549
spawn_uri_vm_test: RuntimeError # Issue 16549
+issue_21398_parent_isolate_test: RuntimeError # Issue 16549
+issue_21398_parent_isolate1_test: RuntimeError # Issue 16549
[ $compiler == dart2js && ( $runtime == ff || $runtime == safari || $runtime == drt || $runtime == chrome || $runtime == chromeOnAndroid) ]
isolate_stress_test: Pass, Slow # Issue 10697
@@ -93,6 +97,8 @@
[ $compiler == none && ( $runtime == dartium || $runtime == drt || $runtime == ContentShellOnAndroid) ]
compile_time_error_test/none: Fail, OK # Issue 13921 Dom isolates don't support spawnFunction
isolate_import_test/none: Fail, OK # Issue 13921 Dom isolates don't support spawnFunction
+issue_21398_parent_isolate_test: Fail, OK # Issue 13921 Dom isolates don't support spawnFunction
+issue_21398_parent_isolate1_test: Fail, OK # Issue 13921 Dom isolates don't support spawnFunction
isolate_stress_test: Skip # Issue 13921 Dom isolates don't support spawnFunction
message3_test: Fail, OK # Issue 13921 Dom isolates don't support spawnFunction
start_paused_test: Fail, OK # Issue 13921 Dom isolates don't support spawnFunction
diff --git a/tests/isolate/issue_21398_child_isolate.dart b/tests/isolate/issue_21398_child_isolate.dart
new file mode 100644
index 0000000..2d7b23c
--- /dev/null
+++ b/tests/isolate/issue_21398_child_isolate.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 'dart:isolate';
+import "package:expect/expect.dart";
+
+class FromChildIsolate {
+ String toString() => 'from child isolate';
+}
+
+main(List<String> args, message) {
+ var sendPort = message;
+ try {
+ sendPort.send(new FromChildIsolate());
+ } catch(error) {
+ Expect.isTrue(error is ArgumentError);
+ sendPort.send("Invalid Argument(s).");
+ }
+}
diff --git a/tests/isolate/issue_21398_child_isolate1.dart b/tests/isolate/issue_21398_child_isolate1.dart
new file mode 100644
index 0000000..1a720bd
--- /dev/null
+++ b/tests/isolate/issue_21398_child_isolate1.dart
@@ -0,0 +1,12 @@
+// 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:isolate';
+import "package:expect/expect.dart";
+
+main(List<String> args, message) {
+ var sendPort1 = args[0] as SendPort;
+ var sendPort2 = args[1] as SendPort;
+ sendPort2.send(sendPort1);
+}
diff --git a/tests/isolate/issue_21398_child_isolate11.dart b/tests/isolate/issue_21398_child_isolate11.dart
new file mode 100644
index 0000000..f1224dd
--- /dev/null
+++ b/tests/isolate/issue_21398_child_isolate11.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.
+
+import 'dart:isolate';
+import "package:expect/expect.dart";
+
+class FromChildIsolate {
+ String toString() => 'from child isolate';
+}
+
+main(List<String> args, message) {
+ var receivePort = new ReceivePort();
+ var sendPort = message;
+ sendPort.send(receivePort.sendPort);
+ receivePort.listen(
+ (msg) {
+ Expect.isTrue(msg is SendPort);
+ try {
+ msg.send(new FromChildIsolate());
+ } catch(error) {
+ Expect.isTrue(error is ArgumentError);
+ msg.send("Invalid Argument(s).");
+ }
+ },
+ onError: (e) => print('$e')
+ );
+}
diff --git a/tests/isolate/issue_21398_parent_isolate1_test.dart b/tests/isolate/issue_21398_parent_isolate1_test.dart
new file mode 100644
index 0000000..1763e4c
--- /dev/null
+++ b/tests/isolate/issue_21398_parent_isolate1_test.dart
@@ -0,0 +1,164 @@
+// 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:isolate';
+import 'dart:async';
+import "package:expect/expect.dart";
+
+class FromMainIsolate {
+ String toString() => 'from main isolate';
+ int get fld => 10;
+}
+
+func1Child(args) {
+ var receivePort = new ReceivePort();
+ var sendPort = args[0];
+ sendPort.send(receivePort.sendPort);
+ receivePort.listen(
+ (msg) {
+ Expect.isTrue(msg is FromMainIsolate);
+ Expect.equals(10, msg.fld);
+ receivePort.close();
+ },
+ onError: (e) => print('$e')
+ );
+}
+
+
+func2Child(args) {
+ var receivePort = new ReceivePort();
+ var sendPort = args[0];
+ sendPort.send(receivePort.sendPort);
+ receivePort.listen(
+ (msg) {
+ Expect.isTrue(msg is SendPort);
+ msg.send(new FromMainIsolate());
+ receivePort.close();
+ },
+ onError: (e) => print('$e')
+ );
+}
+
+
+spawnFuncTest() {
+ var receive1 = new ReceivePort();
+ var receive2 = new ReceivePort();
+
+ var spawnFunctionIsolate1SendPort;
+ var spawnFunctionIsolate2SendPort;
+
+ // First spawn the first isolate using spawnFunction, this isolate will
+ // create a receivePort and send it's sendPort back and then it will just
+ // sit there listening for a message from the second isolate spawned
+ // using spawnFunction.
+ Isolate.spawn(func1Child, [receive1.sendPort]).then(
+ (isolate) {
+ receive1.listen(
+ (msg) {
+ Expect.isTrue(msg is SendPort);
+ spawnFunctionIsolate1SendPort = msg;
+ receive1.close();
+
+ // Now spawn the second isolate using spawnFunction, this isolate
+ // will create a receivePort and send it's sendPort back and then
+ // wait for the third isolate spawned using spawnUri to send it
+ // a sendPort to which it will try and send a non "literal-like"
+ // object.
+ Isolate.spawn(func2Child, [receive2.sendPort]).then(
+ (isolate) {
+ receive2.listen(
+ (msg) {
+ spawnFunctionIsolate2SendPort = msg;
+ receive2.close();
+
+ // Now spawn an isolate using spawnUri and send these send
+ // ports over to it. This isolate will send one of the
+ // sendports over to the other.
+ Isolate.spawnUri(Uri.parse('issue_21398_child_isolate1.dart'),
+ [spawnFunctionIsolate1SendPort,
+ spawnFunctionIsolate2SendPort], "no-msg");
+ },
+ onError: (e) => print('$e')
+ );
+ }
+ );
+ },
+ onError: (e) => print('$e')
+ );
+ }
+ );
+}
+
+
+uriChild(args) {
+ var receivePort = new ReceivePort();
+ var sendPort = args[0];
+ sendPort.send(receivePort.sendPort);
+ receivePort.listen(
+ (msg) {
+ Expect.isTrue(msg is String);
+ Expect.equals("Invalid Argument(s).", msg);
+ receivePort.close();
+ },
+ onError: (e) => print('$e')
+ );
+}
+
+
+spawnUriTest() {
+ var receive1 = new ReceivePort();
+ var receive2 = new ReceivePort();
+
+ var spawnFunctionIsolateSendPort;
+ var spawnUriIsolateSendPort;
+
+ // First spawn the first isolate using spawnFunction, this isolate will
+ // create a receivePort and send it's sendPort back and then it will just
+ // sit there listening for a message from the second isolate spawned
+ // using spawnFunction.
+ Isolate.spawn(uriChild, [receive1.sendPort]).then(
+ (isolate) {
+ receive1.listen(
+ (msg) {
+ Expect.isTrue(msg is SendPort);
+ spawnFunctionIsolateSendPort = msg;
+ receive1.close();
+
+ // Now spawn the second isolate using spawnUri, this isolate
+ // will create a receivePort and send it's sendPort back and then
+ // wait for the third isolate spawned using spawnUri to send it
+ // a sendPort to which it will try and send a non "literal-like"
+ // object.
+ Isolate.spawnUri(Uri.parse('issue_21398_child_isolate11.dart'),
+ [],
+ receive2.sendPort).then(
+ (isolate) {
+ receive2.listen(
+ (msg) {
+ spawnUriIsolateSendPort = msg;
+ receive2.close();
+
+ // Now spawn an isolate using spawnUri and send these send
+ // ports over to it. This isolate will send one of the
+ // sendports over to the other.
+ Isolate.spawnUri(Uri.parse('issue_21398_child_isolate1.dart'),
+ [spawnFunctionIsolateSendPort,
+ spawnUriIsolateSendPort], "no-msg");
+ },
+ onError: (e) => print('$e')
+ );
+ }
+ );
+ },
+ onError: (e) => print('$e')
+ );
+ }
+ );
+}
+
+
+main() {
+ spawnFuncTest();
+ spawnUriTest();
+}
diff --git a/tests/isolate/issue_21398_parent_isolate_test.dart b/tests/isolate/issue_21398_parent_isolate_test.dart
new file mode 100644
index 0000000..d342497
--- /dev/null
+++ b/tests/isolate/issue_21398_parent_isolate_test.dart
@@ -0,0 +1,65 @@
+// 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:isolate';
+import 'dart:async';
+import "package:expect/expect.dart";
+
+class FromMainIsolate {
+ String toString() => 'from main isolate';
+ int get fld => 10;
+}
+
+funcChild(args) {
+ var reply = args[1];
+ var obj = args[0];
+ Expect.isTrue(obj is FromMainIsolate);
+ Expect.equals(10, obj.fld);
+ reply.send(new FromMainIsolate());
+}
+
+main() {
+ var receive1 = new ReceivePort();
+ var receive2 = new ReceivePort();
+
+ // First spawn an isolate using spawnURI and have it
+ // send back a "non-literal" like object.
+ Isolate.spawnUri(Uri.parse('issue_21398_child_isolate.dart'),
+ [],
+ [new FromMainIsolate(), receive1.sendPort]).catchError(
+ (error) {
+ Expect.isTrue(error is ArgumentError);
+ }
+ );
+ Isolate.spawnUri(Uri.parse('issue_21398_child_isolate.dart'),
+ [],
+ receive1.sendPort).then(
+ (isolate) {
+ receive1.listen(
+ (msg) {
+ Expect.stringEquals(msg, "Invalid Argument(s).");
+ receive1.close();
+ },
+ onError: (e) => print('$e')
+ );
+ }
+ );
+
+ // Now spawn an isolate using spawnFunction and send it a "non-literal"
+ // like object and also have the child isolate send back a "non-literal"
+ // like object.
+ Isolate.spawn(funcChild,
+ [new FromMainIsolate(), receive2.sendPort]).then(
+ (isolate) {
+ receive2.listen(
+ (msg) {
+ Expect.isTrue(msg is FromMainIsolate);
+ Expect.equals(10, msg.fld);
+ receive2.close();
+ },
+ onError: (e) => print('$e')
+ );
+ }
+ );
+}
diff --git a/tests/language/compile_time_constant12_test.dart b/tests/language/compile_time_constant12_test.dart
index 0ae5f57..60a2533 100644
--- a/tests/language/compile_time_constant12_test.dart
+++ b/tests/language/compile_time_constant12_test.dart
@@ -3,11 +3,11 @@
// BSD-style license that can be found in the LICENSE file.
const String s = "foo";
-const int i = s.length; /// 01: compile-time error
+const int i = s.length;
use(x) => x;
main() {
use(s);
- use(i); /// 01: continued
+ use(i);
}
diff --git a/tests/language/compile_time_constant_c_test.dart b/tests/language/compile_time_constant_c_test.dart
index 089da3d..7771ae9 100644
--- a/tests/language/compile_time_constant_c_test.dart
+++ b/tests/language/compile_time_constant_c_test.dart
@@ -6,7 +6,7 @@
499: 400 + 99
};
const m1 = const {
- "foo" + "bar": 42 /// 01: compile-time error
+ "foo" + "bar": 42 /// 01: ok
};
const m2 = const {
"foo" * 4: 42 /// 02: compile-time error
diff --git a/tests/language/for_variable_capture_test.dart b/tests/language/for_variable_capture_test.dart
new file mode 100644
index 0000000..d59fb8f
--- /dev/null
+++ b/tests/language/for_variable_capture_test.dart
@@ -0,0 +1,284 @@
+// 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";
+
+run(callback) => callback();
+
+
+initializer() {
+ var closure;
+ for (var i=0, fn = () => i; i < 3; i++) {
+ i += 1;
+ closure = fn;
+ }
+ Expect.equals(1, closure());
+}
+
+condition() {
+ var closures = [];
+ check(callback) {
+ closures.add(callback);
+ return callback();
+ }
+ var values = [];
+ for (var i=0; check(() => ++i) < 8; ++i) {
+ values.add(i);
+ }
+ Expect.listEquals([1, 3, 5, 7], values);
+ Expect.listEquals([2, 4, 6, 8, 10], closures.map(run).toList());
+}
+
+body() {
+ var closures = [];
+ for (var i=0, j=0; i<3; i++) {
+ j++;
+ closures.add(() => i);
+ closures.add(() => j);
+ }
+ Expect.listEquals([0, 1, 1, 2, 2, 3], closures.map(run).toList());
+}
+
+update() {
+ var closures = [];
+ check(callback) {
+ closures.add(callback);
+ return callback();
+ }
+ var values = [];
+ for (var i=0; i < 4; check(() => ++i)) {
+ values.add(i);
+ }
+ Expect.listEquals([0, 1, 2, 3], values);
+ Expect.listEquals([2, 3, 4, 5], closures.map(run).toList());
+}
+
+initializer_condition() {
+ var values = [];
+ for (var i=0, fn = () => i; run(() => ++i) < 3; ) {
+ values.add(i);
+ values.add(fn());
+ }
+ Expect.listEquals([1, 1, 2, 1], values);
+}
+
+initializer_update() {
+ var update_closures = [];
+ update(callback) {
+ update_closures.add(callback);
+ return callback();
+ }
+ var init_closure;
+ for (var i=0, fn = () => i; i < 4; update(() => ++i)) {
+ init_closure = fn;
+ if (i == 0) {
+ ++i; // Mutate copy of 'i' from first iteration.
+ }
+ }
+ Expect.equals(1, init_closure());
+ Expect.listEquals([3, 4, 5], update_closures.map(run).toList());
+ Expect.equals(1, init_closure());
+}
+
+initializer_body() {
+ var closures = [];
+ for (var i=0, fn = () => i; i < 3; i++) {
+ closures.add(() => i);
+ closures.add(fn);
+ fn = () => i;
+ }
+ Expect.listEquals([0, 0, 1, 0, 2, 1], closures.map(run).toList());
+}
+
+condition_update() {
+ var cond_closures = [];
+ check(callback) {
+ cond_closures.add(callback);
+ return callback();
+ }
+ var update_closures = [];
+ update(callback) {
+ update_closures.add(callback);
+ return callback();
+ }
+ var values = [];
+ for (var i=0; check(() => i) < 4; update(() => ++i)) {
+ values.add(i);
+ }
+ Expect.listEquals([0, 1, 2, 3], values);
+
+ Expect.listEquals([0, 1, 2, 3, 4], cond_closures.map(run).toList());
+ Expect.listEquals( [2, 3, 4, 5], update_closures.map(run).toList());
+ Expect.listEquals([0, 2, 3, 4, 5], cond_closures.map(run).toList());
+}
+
+condition_body() {
+ var cond_closures = [];
+ check(callback) {
+ cond_closures.add(callback);
+ return callback();
+ }
+ var body_closures = [];
+ do_body(callback) {
+ body_closures.add(callback);
+ return callback();
+ }
+ for (var i=0; check(() => i) < 4; ++i) {
+ do_body(() => i);
+ }
+ Expect.listEquals([0, 1, 2, 3, 4], cond_closures.map(run).toList());
+ Expect.listEquals([0, 1, 2, 3], body_closures.map(run).toList());
+}
+
+initializer_condition_update() {
+ var init;
+ var cond_closures = [];
+ check(callback) {
+ cond_closures.add(callback);
+ return callback();
+ }
+ var update_closures = [];
+ update(callback) {
+ update_closures.add(callback);
+ return callback();
+ }
+ var values = [];
+ for (var i=0, fn = () => i; check(() => ++i) < 8; update(() => ++i)) {
+ init = fn;
+ values.add(i);
+ }
+ Expect.listEquals([1, 3, 5, 7], values);
+ Expect.equals(1, init());
+
+ Expect.listEquals([2, 4, 6, 8, 10], cond_closures.map(run).toList());
+ Expect.listEquals( [5, 7, 9, 11], update_closures.map(run).toList());
+}
+
+initializer_condition_body() {
+ var init;
+ var cond_closures = [];
+ check(callback) {
+ cond_closures.add(callback);
+ return callback();
+ }
+ var body_closures = [];
+ do_body(callback) {
+ body_closures.add(callback);
+ return callback();
+ }
+ var values = [];
+ for (var i=0, fn = () => i; check(() => ++i) < 8; ) {
+ init = fn;
+ do_body(() => ++i);
+ values.add(i);
+ }
+ Expect.listEquals([2, 4, 6, 8], values);
+ Expect.equals(2, init());
+
+ Expect.listEquals([3, 5, 7, 9, 10], cond_closures.map(run).toList());
+ Expect.listEquals([4, 6, 8, 10], body_closures.map(run).toList());
+}
+
+initializer_update_body() {
+ var init;
+ var update_closures = [];
+ update(callback) {
+ update_closures.add(callback);
+ return callback();
+ }
+ var body_closures = [];
+ do_body(callback) {
+ body_closures.add(callback);
+ return callback();
+ }
+ var values = [];
+ for (var i=0, fn = () => i; i < 8; update(() => ++i)) {
+ init = fn;
+ do_body(() => ++i);
+ values.add(i);
+ }
+ Expect.listEquals([1, 3, 5, 7], values);
+ Expect.equals(1, init());
+
+ Expect.listEquals( [4, 6, 8, 9], update_closures.map(run).toList());
+ Expect.listEquals([2, 5, 7, 9], body_closures.map(run).toList());
+}
+
+condition_update_body() {
+ var cond_closures = [];
+ check(callback) {
+ cond_closures.add(callback);
+ return callback();
+ }
+ var update_closures = [];
+ update(callback) {
+ update_closures.add(callback);
+ return callback();
+ }
+ var body_closures = [];
+ do_body(callback) {
+ body_closures.add(callback);
+ return callback();
+ }
+ var values = [];
+ for (var i=0; check(() => i) < 8; update(() => ++i)) {
+ do_body(() => ++i);
+ values.add(i);
+ }
+ Expect.listEquals([1, 3, 5, 7], values);
+
+ Expect.listEquals([1, 3, 5, 7, 8], cond_closures.map(run).toList());
+ Expect.listEquals( [4, 6, 8, 9], update_closures.map(run).toList());
+ Expect.listEquals([2, 5, 7, 9], body_closures.map(run).toList());
+ Expect.listEquals([2, 5, 7, 9, 9], cond_closures.map(run).toList());
+}
+
+initializer_condition_update_body() {
+ var init;
+ var cond_closures = [];
+ check(callback) {
+ cond_closures.add(callback);
+ return callback();
+ }
+ var update_closures = [];
+ update(callback) {
+ update_closures.add(callback);
+ return callback();
+ }
+ var body_closures = [];
+ do_body(callback) {
+ body_closures.add(callback);
+ return callback();
+ }
+ var values = [];
+ for (var i=0, fn = () => i; check(() => i) < 8; update(() => ++i)) {
+ init = fn;
+ do_body(() => ++i);
+ values.add(i);
+ }
+ Expect.listEquals([1, 3, 5, 7], values);
+ Expect.equals(1, init());
+
+ Expect.listEquals([1, 3, 5, 7, 8], cond_closures.map(run).toList());
+ Expect.listEquals( [4, 6, 8, 9], update_closures.map(run).toList());
+ Expect.listEquals([2, 5, 7, 9], body_closures.map(run).toList());
+ Expect.listEquals([2, 5, 7, 9, 9], cond_closures.map(run).toList());
+}
+
+main() {
+ initializer();
+ condition();
+ update();
+ body();
+ initializer_condition();
+ initializer_update();
+ initializer_body();
+ condition_update();
+ condition_body();
+ initializer_condition_update();
+ initializer_condition_body();
+ initializer_update_body();
+ condition_update_body();
+ initializer_condition_update_body();
+}
diff --git a/tests/language/generic_instanceof4_test.dart b/tests/language/generic_instanceof4_test.dart
new file mode 100644
index 0000000..15896cb
--- /dev/null
+++ b/tests/language/generic_instanceof4_test.dart
@@ -0,0 +1,28 @@
+// 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.
+// Test that instanceof works correctly with type variables.
+
+import "package:expect/expect.dart";
+
+class A<T> {
+ foo(x) {
+ // Don't inline.
+ if (new DateTime.now().millisecondsSinceEpoch == 42) return foo(x);
+ return x is T;
+ }
+}
+
+class BB {}
+
+class B<T> implements BB {
+ foo() {
+ // Don't inline.
+ if (new DateTime.now().millisecondsSinceEpoch == 42) return foo();
+ return new A<T>().foo(new B());
+ }
+}
+
+main() {
+ Expect.isTrue(new B<BB>().foo());
+}
diff --git a/tests/language/language.status b/tests/language/language.status
index 1091d75..ae6e776 100644
--- a/tests/language/language.status
+++ b/tests/language/language.status
@@ -17,7 +17,6 @@
# Regular bugs which should be fixed.
duplicate_export_negative_test: Fail # Issue 6134
-
[ $runtime != vm ]
# Async/await is currently only supported by the vm.
async_test/*: Skip
@@ -64,6 +63,9 @@
cyclic_type2_test: Fail, OK
least_upper_bound_expansive_test/*: Fail, OK
+compile_time_constant_c_test/01: Fail # Issue 21000
+compile_time_constant12_test: Fail # Issue 21000
+
[ $compiler == none && $runtime == vm ]
class_keyword_test/02: MissingCompileTimeError # Issue 13627
unicode_bom_test: Fail # Issue 16067
diff --git a/tests/language/language_analyzer.status b/tests/language/language_analyzer.status
index 1392f0d..6f96ea6 100644
--- a/tests/language/language_analyzer.status
+++ b/tests/language/language_analyzer.status
@@ -6,6 +6,9 @@
# Runtime negative test. No static errors or warnings.
closure_call_wrong_argument_count_negative_test: skip
+compile_time_constant_c_test/01: Fail # Issue 21000
+compile_time_constant12_test: Fail # Issue 21000
+
enum_syntax_test/02: Fail # 21649
enum_syntax_test/03: Fail # 21649
enum_syntax_test/04: Fail # 21649
diff --git a/tests/language/language_analyzer2.status b/tests/language/language_analyzer2.status
index b27091a..0c2ad1d 100644
--- a/tests/language/language_analyzer2.status
+++ b/tests/language/language_analyzer2.status
@@ -12,6 +12,9 @@
enum_syntax_test/05: Fail # 21649
enum_syntax_test/06: Fail # 21649
+compile_time_constant_c_test/01: Fail # Issue 21000
+compile_time_constant12_test: Fail # Issue 21000
+
# 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
diff --git a/tests/language/language_dart2js.status b/tests/language/language_dart2js.status
index f20ef65..dd32757 100644
--- a/tests/language/language_dart2js.status
+++ b/tests/language/language_dart2js.status
@@ -18,7 +18,6 @@
stacktrace_test: Pass, RuntimeError # # Issue 12698
stacktrace_rethrow_nonerror_test: Pass, RuntimeError # Issue 12698
stacktrace_rethrow_error_test: Pass, RuntimeError # Issue 12698
-illegal_invocation_test/01: CompileTimeError # Issue 13630
instantiate_type_variable_test/01: CompileTimeError # Issue 13631
library_ambiguous_test/00: CompileTimeError # Issue 13632
library_ambiguous_test/01: CompileTimeError # Issue 13632
@@ -72,9 +71,6 @@
[ $compiler == dart2js && $unchecked ]
type_checks_in_factory_method_test: RuntimeError # Issue 12746
assertion_test: RuntimeError # Issue 12748
-double_to_string_as_exponential2_test: RuntimeError # Issue 12749
-double_to_string_as_fixed2_test: RuntimeError # Issue 12749
-double_to_string_as_precision2_test: RuntimeError # Issue 12749
generic_test: RuntimeError, OK
map_literal4_test: RuntimeError, OK # Checked mode required.
named_parameters_type_test/01: MissingRuntimeError, OK
@@ -84,7 +80,7 @@
positional_parameters_type_test/02: MissingRuntimeError, OK
issue13474_test: RuntimeError, OK
generic_field_mixin3_test: Crash # Issue 18651
-
+generic_instanceof4_test: RuntimeError # Issue 21969
[ $compiler == dart2js && $minified ]
cyclic_type_test/0*: Fail # Issue 12605
@@ -258,6 +254,7 @@
[ $minified ]
stack_trace_test: Fail, OK # Stack trace not preserved in minified code.
+regress_21795_test: RuntimeError # Issue 12605
[ $compiler == dart2js && $runtime == d8 && $system == windows ]
*deferred*: Skip # Issue 17458
diff --git a/tests/language/regress_21795_test.dart b/tests/language/regress_21795_test.dart
new file mode 100644
index 0000000..91506c7
--- /dev/null
+++ b/tests/language/regress_21795_test.dart
@@ -0,0 +1,46 @@
+// 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 issue 21795.
+
+foo(t) {
+ try {
+ if (t == 123) throw 42;
+ } finally { }
+}
+
+bar() {
+ try {
+ return 42;
+ } finally { }
+}
+
+
+class A {
+ test(t) {
+ try {
+ foo(t);
+ } finally {
+ if (t == 0) {
+ try {
+ } catch (err, st) {
+ }
+ }
+ }
+ }
+}
+
+
+main() {
+ var a = new A();
+ for (var i=0; i<10000; ++i) a.test(0);
+ try {
+ a.test(123);
+ } catch (e, s) {
+ if (s.toString().indexOf("foo") == -1) {
+ print(s);
+ throw "Expected foo in stacktrace!";
+ }
+ }
+}
diff --git a/tests/language/regress_21998_1_test.dart b/tests/language/regress_21998_1_test.dart
new file mode 100644
index 0000000..3237f33
--- /dev/null
+++ b/tests/language/regress_21998_1_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.
+
+import 'dart:math' as Math;
+import 'package:expect/expect.dart';
+
+main() {
+ Expect.equals(4, new C().m());
+}
+
+class C {
+ max(a) => a;
+
+ m() {
+ return max(Math.max(2, 4));
+ }
+}
\ No newline at end of file
diff --git a/tests/language/regress_21998_2_test.dart b/tests/language/regress_21998_2_test.dart
new file mode 100644
index 0000000..53cace0
--- /dev/null
+++ b/tests/language/regress_21998_2_test.dart
@@ -0,0 +1,19 @@
+// 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:math' as Math;
+import 'package:expect/expect.dart';
+import 'regress_21998_lib1.dart' as lib1;
+
+main() {
+ Expect.equals(4, new C().m());
+}
+
+class C {
+ max(a) => a;
+
+ m() {
+ return max(Math.max(2, lib1.max('a', 'b', 'cd').length));
+ }
+}
\ No newline at end of file
diff --git a/tests/language/regress_21998_3_test.dart b/tests/language/regress_21998_3_test.dart
new file mode 100644
index 0000000..2eac880
--- /dev/null
+++ b/tests/language/regress_21998_3_test.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 'dart:math' as Math;
+import 'package:expect/expect.dart';
+import 'regress_21998_lib1.dart' as lib1;
+import 'regress_21998_lib2.dart';
+
+main() {
+ Expect.equals(4, new C().m());
+}
+
+class C {
+ max(a) => a;
+
+ m() {
+ return max(Math.max(lib2_max(1, 2), lib1.max('a', 'b', 'cd').length));
+ }
+}
\ No newline at end of file
diff --git a/tests/language/regress_21998_4_test.dart b/tests/language/regress_21998_4_test.dart
new file mode 100644
index 0000000..7afe1ac
--- /dev/null
+++ b/tests/language/regress_21998_4_test.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.
+
+import 'dart:math' as Math;
+import 'package:expect/expect.dart';
+import 'regress_21998_lib1.dart' as lib1;
+import 'regress_21998_lib2.dart';
+import 'regress_21998_lib3.dart';
+
+main() {
+ Expect.equals(4, new C().m());
+}
+
+class C {
+ max(a) => a;
+
+ m() {
+ return max(Math.max(
+ lib3_max(0, lib2_max(1, 2)), lib1.max('a', 'b', 'cd').length));
+ }
+}
\ No newline at end of file
diff --git a/tests/language/regress_21998_lib1.dart b/tests/language/regress_21998_lib1.dart
new file mode 100644
index 0000000..ef3d869
--- /dev/null
+++ b/tests/language/regress_21998_lib1.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 regress_21998_lib1;
+
+String max(String a, String b, String c) => '$a$b$c';
\ No newline at end of file
diff --git a/tests/language/regress_21998_lib2.dart b/tests/language/regress_21998_lib2.dart
new file mode 100644
index 0000000..8d1ac893
--- /dev/null
+++ b/tests/language/regress_21998_lib2.dart
@@ -0,0 +1,9 @@
+// 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 regress_21998_lib2;
+
+import 'dart:math';
+
+lib2_max(a, b) => max(a, b);
\ No newline at end of file
diff --git a/tests/language/regress_21998_lib3.dart b/tests/language/regress_21998_lib3.dart
new file mode 100644
index 0000000..a18f2ff
--- /dev/null
+++ b/tests/language/regress_21998_lib3.dart
@@ -0,0 +1,9 @@
+// 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 regress_21998_lib3;
+
+import 'dart:math' as math;
+
+lib3_max(a, b) => math.max(a, b);
\ No newline at end of file
diff --git a/tests/lib/async/future_test.dart b/tests/lib/async/future_test.dart
index 12cc53b..108cbcd 100644
--- a/tests/lib/async/future_test.dart
+++ b/tests/lib/async/future_test.dart
@@ -749,6 +749,133 @@
});
}
+void testWaitCleanUp() {
+ asyncStart();
+ // Creates three futures with different completion times, and where some fail.
+ // The `mask` specifies which futures fail (values 1-7),
+ // and `permute` defines the order of completion. values 0-5.
+ void doTest(int mask, int permute) {
+ asyncStart();
+ String stringId = "waitCleanup-$mask-$permute";
+ List futures = new List(3);
+ List cleanup = new List(3);
+ int permuteTmp = permute;
+ for (int i = 0; i < 3; i++) {
+ bool throws = (mask & (1 << i)) != 0;
+ var future = new Future.delayed(
+ new Duration(milliseconds: 100 * (i + 1)),
+ () => (throws ? throw "Error $i($mask-$permute)" : i));
+ int mod = 3 - i;
+ int position = permuteTmp % mod;
+ permuteTmp = permuteTmp ~/ mod;
+ while (futures[position] != null) position++;
+ futures[position] = future;
+ cleanup[i] = throws;
+ }
+ void cleanUp(index) {
+ Expect.isFalse(cleanup[index]);
+ cleanup[index] = true;
+ }
+ Future.wait(futures, cleanUp: cleanUp)
+ .then((_) { Expect.fail("No error: $stringId"); },
+ onError: (e, s) {
+ Expect.listEquals([true, true, true], cleanup);
+ asyncEnd();
+ });
+ }
+
+ for (int i = 1; i < 8; i++) {
+ for (int j = 0; j < 6; j++) {
+ doTest(i, j);
+ }
+ }
+ asyncEnd();
+}
+
+void testWaitCleanUpEager() {
+ asyncStart();
+ // Creates three futures with different completion times, and where some fail.
+ // The `mask` specifies which futures fail (values 1-7),
+ // and `permute` defines the order of completion. values 0-5.
+ void doTest(int mask, int permute) {
+ asyncStart();
+ asyncStart();
+ bool done = false;
+ String stringId = "waitCleanup-$mask-$permute";
+ List futures = new List(3);
+ List cleanup = new List(3);
+ int permuteTmp = permute;
+ for (int i = 0; i < 3; i++) {
+ bool throws = (mask & (1 << i)) != 0;
+ var future = new Future.delayed(
+ new Duration(milliseconds: 100 * (i + 1)),
+ () => (throws ? throw "Error $i($mask-$permute)" : i));
+ int mod = 3 - i;
+ int position = permuteTmp % mod;
+ permuteTmp = permuteTmp ~/ mod;
+ while (futures[position] != null) position++;
+ futures[position] = future;
+ cleanup[i] = throws;
+ }
+ void checkDone() {
+ if (done) return;
+ if (cleanup.every((v) => v)) {
+ done = true;
+ asyncEnd();
+ }
+ }
+ void cleanUp(index) {
+ Expect.isFalse(cleanup[index]);
+ cleanup[index] = true;
+ // Cleanup might happen before and after the wait().then() callback.
+ checkDone();
+ }
+ Future.wait(futures, eagerError: true, cleanUp: cleanUp)
+ .then((_) { Expect.fail("No error: $stringId"); },
+ onError: (e, s) {
+ asyncEnd();
+ checkDone();
+ });
+ }
+
+ for (int i = 1; i < 8; i++) {
+ for (int j = 0; j < 6; j++) {
+ doTest(i, j);
+ }
+ }
+ asyncEnd();
+}
+
+void testWaitCleanUpError() {
+ var cms = const Duration(milliseconds: 100);
+ var cleanups = new List.filled(3, false);
+ var uncaughts = new List.filled(3, false);
+ asyncStart();
+ asyncStart();
+ asyncStart();
+ runZoned(() {
+ Future.wait([new Future.delayed(cms, () => 0),
+ new Future.delayed(cms * 2, ()=> throw 1),
+ new Future.delayed(cms * 3, () => 2)],
+ cleanUp: (index) {
+ Expect.isTrue(index == 0 || index == 2, "$index");
+ Expect.isFalse(cleanups[index]);
+ cleanups[index] = true;
+ throw index;
+ })
+ .catchError((e) {
+ Expect.equals(e, 1);
+ asyncEnd();
+ });
+
+ }, onError: (int index, s) {
+ Expect.isTrue(index == 0 || index == 2, "$index");
+ Expect.isFalse(uncaughts[index]);
+ uncaughts[index] = true;
+ asyncEnd();
+ });
+}
+
main() {
asyncStart();
@@ -805,6 +932,9 @@
testSyncFuture_i13368();
+ testWaitCleanUp();
+ testWaitCleanUpError();
+
asyncEnd();
}
diff --git a/tests/lib/lib.status b/tests/lib/lib.status
index 54fef3d..2322396 100644
--- a/tests/lib/lib.status
+++ b/tests/lib/lib.status
@@ -206,9 +206,15 @@
[ $runtime == ff ]
# FF setTimeout can fire early: https://bugzilla.mozilla.org/show_bug.cgi?id=291386
convert/streamed_conversion_utf8_decode_test: Pass, Slow # Issue 12029
-convert/streamed_conversion_utf8_encode_test: Pass, Slow # Issue 12029
mirrors/mirrors_reader_test: Timeout, Slow, RuntimeError # Issue 16589
+[ $runtime == chrome || $runtime == ff || $runtime == ContentShellOnAndroid ]
+convert/streamed_conversion_utf8_encode_test: Skip # Times out. Issue 22050
+convert/streamed_conversion_json_utf8_encode_test: Skip # Times out. Issue 22050
+convert/streamed_conversion_json_utf8_decode_test: Skip # Times out. Issue 22050
+async/slow_consumer2_test: Skip # Times out. Issue 22050
+async/stream_timeout_test: Skip # Times out. Issue 22050
+
[ $compiler == dart2js ]
typed_data/typed_data_hierarchy_int64_test: RuntimeError # Issue 10275
typed_data/int32x4_bigint_test: RuntimeError # Issue 1533
diff --git a/tests/lib/mirrors/invocation_fuzz_test.dart b/tests/lib/mirrors/invocation_fuzz_test.dart
index 392740c..404353a 100644
--- a/tests/lib/mirrors/invocation_fuzz_test.dart
+++ b/tests/lib/mirrors/invocation_fuzz_test.dart
@@ -14,9 +14,6 @@
// Methods to be skipped, by qualified name.
var blacklist = [
- // TODO(regis): investigate.
- 'dart.core._Montgomery._invDigitPair',
-
// Don't recurse on this test.
'test.invoke_natives',
@@ -45,6 +42,8 @@
// These either cause the VM to segfault or throw uncatchable API errors.
// TODO(15274): Fix them and remove from blacklist.
'dart.io._IOService.dispatch',
+ 'dart.io._IOService._initialize',
+ 'dart.io._IOService._finalize',
'dart.io._StdIOUtils._socketType',
'dart.io._StdIOUtils._getStdioOutputStream',
'dart.io._Filter.newZLibInflateFilter',
diff --git a/tests/standalone/io/file_lock_script.dart b/tests/standalone/io/file_lock_script.dart
new file mode 100644
index 0000000..162323a
--- /dev/null
+++ b/tests/standalone/io/file_lock_script.dart
@@ -0,0 +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.
+//
+// Script used by the file_lock_test.dart test.
+
+import "dart:io";
+
+main(List<String> args) {
+ File file = new File(args[0]);
+ int start = null;
+ int end = null;
+ var mode = FileLock.EXCLUSIVE;
+ if (args[1] == 'SHARED') {
+ mode = FileLock.SHARED;
+ }
+ if (args[2] != 'null') {
+ start = int.parse(args[2]);
+ }
+ if (args[3] != 'null') {
+ end = int.parse(args[3]);
+ }
+ var raf = file.openSync(mode: WRITE);
+ try {
+ raf.lockSync(mode, start, end);
+ print('LOCK SUCCEEDED');
+ } catch (e) {
+ print('LOCK FAILED');
+ } finally {
+ raf.closeSync();
+ }
+}
diff --git a/tests/standalone/io/file_lock_test.dart b/tests/standalone/io/file_lock_test.dart
new file mode 100644
index 0000000..d84ca2b
--- /dev/null
+++ b/tests/standalone/io/file_lock_test.dart
@@ -0,0 +1,325 @@
+// 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 'dart:io';
+
+import "package:async_helper/async_helper.dart";
+import "package:expect/expect.dart";
+import "package:path/path.dart";
+
+// Check whether the file is locked or not.
+check(String path, int start, int end, FileLock mode, {bool locked}) {
+ // Client process returns either 'LOCK FAILED' or 'LOCK SUCCEEDED'.
+ var expected = locked ? 'LOCK FAILED' : 'LOCK SUCCEEDED';
+ var arguments = []
+ ..addAll(Platform.executableArguments)
+ ..add(Platform.script.resolve('file_lock_script.dart').toFilePath())
+ ..add(path)
+ ..add(mode == FileLock.EXCLUSIVE ? 'EXCLUSIVE' : 'SHARED')
+ ..add('$start')
+ ..add('$end');
+ return Process.run(Platform.executable, arguments)
+ .then((ProcessResult result) {
+ if (result.exitCode != 0 || !result.stdout.contains(expected)) {
+ print("Client failed, exit code ${result.exitCode}");
+ print(" stdout:");
+ print(result.stdout);
+ print(" stderr:");
+ print(result.stderr);
+ print(" arguments:");
+ print(arguments);
+ Expect.fail('Client subprocess exit code: ${result.exitCode}');
+ }
+ });
+}
+
+checkLocked(String path,
+ [int start, int end, FileLock mode = FileLock.EXCLUSIVE]) =>
+ check(path, start, end, mode, locked: true);
+
+checkNotLocked(String path,
+ [int start, int end, FileLock mode = FileLock.EXCLUSIVE]) =>
+ check(path, start, end, mode, locked: false);
+
+void testLockWholeFile() {
+ Directory directory = Directory.systemTemp.createTempSync('dart_file_lock');
+ File file = new File(join(directory.path, "file"));
+ file.writeAsBytesSync(new List.filled(10, 0));
+ var raf = file.openSync(mode: WRITE);
+ raf.lockSync();
+ asyncStart();
+ checkLocked(file.path).then((_) {
+ return checkLocked(file.path, 0, 2).then((_) {
+ raf.unlockSync();
+ return checkNotLocked(file.path).then((_) {
+ });
+ });
+ }).whenComplete(() {
+ raf.closeSync();
+ directory.deleteSync(recursive: true);
+ asyncEnd();
+ });
+}
+
+void testLockWholeFileAsync() {
+ Directory directory = Directory.systemTemp.createTempSync('dart_file_lock');
+ File file = new File(join(directory.path, "file"));
+ file.writeAsBytesSync(new List.filled(10, 0));
+ var raf = file.openSync(mode: WRITE);
+ asyncStart();
+ Future.forEach([
+ () => raf.lock(),
+ () => checkLocked(file.path, 0, 2),
+ () => checkLocked(file.path),
+ () => raf.unlock(),
+ () => checkNotLocked(file.path),
+ ],
+ (f) => f()).whenComplete(() {
+ raf.closeSync();
+ directory.deleteSync(recursive: true);
+ asyncEnd();
+ });
+}
+
+void testLockRange() {
+ Directory directory = Directory.systemTemp.createTempSync('dart_file_lock');
+ File file = new File(join(directory.path, "file"));
+ file.writeAsBytesSync(new List.filled(10, 0));
+ var raf1 = file.openSync(mode: WRITE);
+ var raf2 = file.openSync(mode: WRITE);
+ asyncStart();
+ var tests = [
+ () => raf1.lockSync(FileLock.EXCLUSIVE, 2, 3),
+ () => raf2.lockSync(FileLock.EXCLUSIVE, 5, 7),
+ () => checkNotLocked(file.path, 0, 2),
+ () => checkLocked(file.path, 0, 3),
+ () => checkNotLocked(file.path, 4, 5),
+ () => checkLocked(file.path, 4, 6),
+ () => checkLocked(file.path, 6),
+ () => checkNotLocked(file.path, 7),
+ () => raf1.unlockSync(2, 3),
+ () => checkNotLocked(file.path, 0, 5),
+ () => checkLocked(file.path, 4, 6),
+ () => checkLocked(file.path, 6),
+ () => checkNotLocked(file.path, 7),
+ ];
+ // On Windows regions unlocked must match regions locked.
+ if (!Platform.isWindows) {
+ tests.addAll([
+ () => raf1.unlockSync(5, 6),
+ () => checkNotLocked(file.path, 0, 6),
+ () => checkLocked(file.path, 6),
+ () => checkNotLocked(file.path, 7),
+ () => raf2.unlockSync(6, 7),
+ () => checkNotLocked(file.path)
+ ]);
+ } else {
+ tests.addAll([
+ () => raf2.unlockSync(5, 7),
+ () => checkNotLocked(file.path)
+ ]);
+ }
+ Future.forEach(tests, (f) => f()).whenComplete(() {
+ raf1.closeSync();
+ raf2.closeSync();
+ directory.deleteSync(recursive: true);
+ asyncEnd();
+ });
+}
+
+void testLockRangeAsync() {
+ Directory directory = Directory.systemTemp.createTempSync('dart_file_lock');
+ File file = new File(join(directory.path, "file"));
+ file.writeAsBytesSync(new List.filled(10, 0));
+ var raf1 = file.openSync(mode: WRITE);
+ var raf2 = file.openSync(mode: WRITE);
+ asyncStart();
+ var tests = [
+ () => raf1.lock(FileLock.EXCLUSIVE, 2, 3),
+ () => raf2.lock(FileLock.EXCLUSIVE, 5, 7),
+ () => checkNotLocked(file.path, 0, 2),
+ () => checkLocked(file.path, 0, 3),
+ () => checkNotLocked(file.path, 4, 5),
+ () => checkLocked(file.path, 4, 6),
+ () => checkLocked(file.path, 6),
+ () => checkNotLocked(file.path, 7),
+ () => raf1.unlock(2, 3),
+ () => checkNotLocked(file.path, 0, 5),
+ () => checkLocked(file.path, 4, 6),
+ () => checkLocked(file.path, 6),
+ () => checkNotLocked(file.path, 7),
+ ];
+ // On Windows regions unlocked must match regions locked.
+ if (!Platform.isWindows) {
+ tests.addAll([
+ () => raf1.unlock(5, 6),
+ () => checkNotLocked(file.path, 0, 6),
+ () => checkLocked(file.path, 6),
+ () => checkNotLocked(file.path, 7),
+ () => raf2.unlock(6, 7),
+ () => checkNotLocked(file.path)
+ ]);
+ } else {
+ tests.addAll([
+ () => raf2.unlock(5, 7),
+ () => checkNotLocked(file.path)
+ ]);
+ }
+ Future.forEach(tests, (f) => f()).whenComplete(() {
+ raf1.closeSync();
+ raf2.closeSync();
+ directory.deleteSync(recursive: true);
+ asyncEnd();
+ });
+}
+
+void testLockEnd() {
+ Directory directory = Directory.systemTemp.createTempSync('dart_file_lock');
+ File file = new File(join(directory.path, "file"));
+ file.writeAsBytesSync(new List.filled(10, 0));
+ var raf = file.openSync(mode: APPEND);
+ asyncStart();
+ Future.forEach([
+ () => raf.lockSync(FileLock.EXCLUSIVE, 2),
+ () => checkNotLocked(file.path, 0, 2),
+ () => checkLocked(file.path, 0, 3),
+ () => checkLocked(file.path, 9),
+ () => raf.writeFromSync(new List.filled(10, 0)),
+ () => checkLocked(file.path, 10),
+ () => checkLocked(file.path, 19),
+ () => raf.unlockSync(2),
+ () => checkNotLocked(file.path)
+ ],
+ (f) => f()).whenComplete(() {
+ raf.closeSync();
+ directory.deleteSync(recursive: true);
+ asyncEnd();
+ });
+}
+
+void testLockEndAsync() {
+ Directory directory = Directory.systemTemp.createTempSync('dart_file_lock');
+ File file = new File(join(directory.path, "file"));
+ file.writeAsBytesSync(new List.filled(10, 0));
+ var raf = file.openSync(mode: APPEND);
+ asyncStart();
+ Future.forEach([
+ () => raf.lock(FileLock.EXCLUSIVE, 2),
+ () => checkNotLocked(file.path, 0, 2),
+ () => checkLocked(file.path, 0, 3),
+ () => checkLocked(file.path, 9),
+ () => raf.writeFromSync(new List.filled(10, 0)),
+ () => checkLocked(file.path, 10),
+ () => checkLocked(file.path, 19),
+ () => raf.unlock(2),
+ () => checkNotLocked(file.path)
+ ],
+ (f) => f()).whenComplete(() {
+ raf.closeSync();
+ directory.deleteSync(recursive: true);
+ asyncEnd();
+ });
+}
+
+void testLockShared() {
+ Directory directory = Directory.systemTemp.createTempSync('dart_file_lock');
+ File file = new File(join(directory.path, "file"));
+ file.writeAsBytesSync(new List.filled(10, 0));
+ var raf = file.openSync();
+ asyncStart();
+ Future.forEach([
+ () => raf.lock(FileLock.SHARED),
+ () => checkLocked(file.path),
+ () => checkLocked(file.path, 0, 2),
+ () => checkNotLocked(file.path, 0, 2, FileLock.SHARED)
+ ],
+ (f) => f()).then((_) {
+ raf.closeSync();
+ directory.deleteSync(recursive: true);
+ asyncEnd();
+ });
+}
+
+void testLockSharedAsync() {
+ Directory directory = Directory.systemTemp.createTempSync('dart_file_lock');
+ File file = new File(join(directory.path, "file"));
+ file.writeAsBytesSync(new List.filled(10, 0));
+ var raf = file.openSync();
+ asyncStart();
+ Future.forEach([
+ () => raf.lock(FileLock.SHARED),
+ () => checkLocked(file.path),
+ () => checkLocked(file.path, 0, 2),
+ () => checkNotLocked(file.path, 0, 2, FileLock.SHARED)
+ ],
+ (f) => f()).whenComplete(() {
+ raf.closeSync();
+ directory.deleteSync(recursive: true);
+ asyncEnd();
+ });
+}
+
+void testLockAfterLength() {
+ Directory directory = Directory.systemTemp.createTempSync('dart_file_lock');
+ File file = new File(join(directory.path, "file"));
+ file.writeAsBytesSync(new List.filled(10, 0));
+ var raf = file.openSync(mode: APPEND);
+ asyncStart();
+ Future.forEach([
+ () => raf.lockSync(FileLock.EXCLUSIVE, 2, 15),
+ () => checkNotLocked(file.path, 0, 2),
+ () => checkLocked(file.path, 0, 3),
+ () => checkLocked(file.path, 9),
+ () => checkLocked(file.path, 14),
+ () => raf.writeFromSync(new List.filled(10, 0)),
+ () => checkLocked(file.path, 10),
+ () => checkNotLocked(file.path, 15),
+ () => raf.unlockSync(2, 15),
+ () => checkNotLocked(file.path)
+ ],
+ (f) => f()).whenComplete(() {
+ raf.closeSync();
+ directory.deleteSync(recursive: true);
+ asyncEnd();
+ });
+}
+
+void testLockAfterLengthAsync() {
+ Directory directory = Directory.systemTemp.createTempSync('dart_file_lock');
+ File file = new File(join(directory.path, "file"));
+ file.writeAsBytesSync(new List.filled(10, 0));
+ var raf = file.openSync(mode: APPEND);
+ asyncStart();
+ Future.forEach([
+ () => raf.lock(FileLock.EXCLUSIVE, 2, 15),
+ () => checkNotLocked(file.path, 0, 2),
+ () => checkLocked(file.path, 0, 3),
+ () => checkLocked(file.path, 9),
+ () => checkLocked(file.path, 14),
+ () => raf.writeFromSync(new List.filled(10, 0)),
+ () => checkLocked(file.path, 10),
+ () => checkNotLocked(file.path, 15),
+ () => raf.unlock(2, 15),
+ () => checkNotLocked(file.path)
+ ],
+ (f) => f()).whenComplete(() {
+ raf.closeSync();
+ directory.deleteSync(recursive: true);
+ asyncEnd();
+ });
+}
+
+void main() {
+ testLockWholeFile();
+ testLockWholeFileAsync();
+ testLockRange();
+ testLockRangeAsync();
+ testLockEnd();
+ testLockEndAsync();
+ testLockShared();
+ testLockSharedAsync();
+ testLockAfterLength();
+ testLockAfterLengthAsync();
+}
diff --git a/tests/try/poi/apply_updates_test.dart b/tests/try/poi/apply_updates_test.dart
index 41bdff7..c26d283 100644
--- a/tests/try/poi/apply_updates_test.dart
+++ b/tests/try/poi/apply_updates_test.dart
@@ -17,7 +17,7 @@
import 'package:compiler/src/dart2jslib.dart' show
Script;
-import 'package:compiler/src/source_file.dart' show
+import 'package:compiler/src/io/source_file.dart' show
StringSourceFile;
import 'compiler_test_case.dart';
diff --git a/tests/try/poi/diff_test.dart b/tests/try/poi/diff_test.dart
index 6e99cd9..eaf9c1c 100644
--- a/tests/try/poi/diff_test.dart
+++ b/tests/try/poi/diff_test.dart
@@ -18,7 +18,7 @@
Compiler,
Script;
-import 'package:compiler/src/source_file.dart' show
+import 'package:compiler/src/io/source_file.dart' show
StringSourceFile;
import 'package:compiler/src/elements/elements.dart' show
diff --git a/tests/try/poi/library_updater_test.dart b/tests/try/poi/library_updater_test.dart
index 5d35d83..dbaea15e 100644
--- a/tests/try/poi/library_updater_test.dart
+++ b/tests/try/poi/library_updater_test.dart
@@ -13,7 +13,7 @@
import 'package:compiler/src/dart2jslib.dart' show
Script;
-import 'package:compiler/src/source_file.dart' show
+import 'package:compiler/src/io/source_file.dart' show
StringSourceFile;
import 'compiler_test_case.dart';
diff --git a/tools/VERSION b/tools/VERSION
index 53a0b59..ca9a130 100644
--- a/tools/VERSION
+++ b/tools/VERSION
@@ -27,5 +27,5 @@
MAJOR 1
MINOR 9
PATCH 0
-PRERELEASE 3
+PRERELEASE 4
PRERELEASE_PATCH 0
diff --git a/tools/testing/dart/browser_controller.dart b/tools/testing/dart/browser_controller.dart
index 01c5aec..006e56d 100644
--- a/tools/testing/dart/browser_controller.dart
+++ b/tools/testing/dart/browser_controller.dart
@@ -148,6 +148,7 @@
{Map<String,String> environment}) {
return Process.start(command, arguments, environment: environment)
.then((startedProcess) {
+ _logEvent("Started browser using $command ${arguments.join(' ')}");
process = startedProcess;
// Used to notify when exiting, and as a return value on calls to
// close().
diff --git a/tools/testing/dart/status_reporter.dart b/tools/testing/dart/status_reporter.dart
new file mode 100644
index 0000000..80d0ef7
--- /dev/null
+++ b/tools/testing/dart/status_reporter.dart
@@ -0,0 +1,187 @@
+// 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:io';
+import 'dart:convert';
+
+List<Map> LINUX_COMBINATIONS = [
+ {
+ 'runtimes' : ['none'],
+ 'modes' : ['release'],
+ 'archs' : ['ia32'],
+ 'compiler' : 'dartanalyzer'
+ },
+ {
+ 'runtimes' : ['vm'],
+ 'modes' : ['debug', 'release'],
+ 'archs' : ['ia32', 'x64', 'simarm', 'simmips'],
+ 'compiler' : 'none'
+ },
+ {
+ 'runtimes' : ['vm'],
+ 'modes' : ['release'],
+ 'archs' : ['ia32', 'x64'],
+ 'compiler' : 'dart2dart'
+ },
+ {
+ 'runtimes' : ['d8', 'jsshell', 'chrome', 'ff'],
+ 'modes' : ['release'],
+ 'archs' : ['ia32'],
+ 'compiler' : 'dart2js'
+ },
+ {
+ 'runtimes' : ['dartium'],
+ 'modes' : ['release', 'debug'],
+ 'archs' : ['ia32'],
+ 'compiler' : 'none'
+ },
+];
+
+List<Map> MACOS_COMBINATIONS = [
+ {
+ 'runtimes' : ['vm'],
+ 'modes' : ['debug', 'release'],
+ 'archs' : ['ia32', 'x64'],
+ 'compiler' : 'none'
+ },
+ {
+ 'runtimes' : ['safari', 'safarimobilesim'],
+ 'modes' : ['release'],
+ 'archs' : ['ia32'],
+ 'compiler' : 'dart2js'
+ },
+ {
+ 'runtimes' : ['dartium'],
+ 'modes' : ['release', 'debug'],
+ 'archs' : ['ia32'],
+ 'compiler' : 'none'
+ },
+];
+
+List<Map> WINDOWS_COMBINATIONS = [
+ {
+ 'runtimes' : ['vm'],
+ 'modes' : ['debug', 'release'],
+ 'archs' : ['ia32', 'x64'],
+ 'compiler' : 'none'
+ },
+ {
+ 'runtimes' : ['chrome', 'ff', 'ie11', 'ie10'],
+ 'modes' : ['release'],
+ 'archs' : ['ia32'],
+ 'compiler' : 'dart2js'
+ },
+ {
+ 'runtimes' : ['dartium'],
+ 'modes' : ['release', 'debug'],
+ 'archs' : ['ia32'],
+ 'compiler' : 'none'
+ },
+];
+
+Map<String, List<Map>> COMBINATIONS = {
+ 'linux' : LINUX_COMBINATIONS,
+ 'windows' : WINDOWS_COMBINATIONS,
+ 'macos' : MACOS_COMBINATIONS
+};
+
+List<Map> getCombinations() {
+ return COMBINATIONS[Platform.operatingSystem];
+}
+
+void ensureBuild() {
+ print('Building many platforms. Please be patient.');
+ var archs = Platform.operatingSystem == 'linux'
+ ? '-aia32,x64,simarm,simmips'
+ : '-aia32,x64';
+
+ var result = Process.runSync('python',
+ ['tools/build.py', '-mrelease,debug', archs, 'create_sdk',
+ // We build runtime to be able to list cc tests
+ 'runtime']);
+
+ if (result.exitCode != 0) {
+ print('ERROR');
+ print(result.stderr);
+ throw new Exception('Error while building.');
+ }
+ print('Done building.');
+}
+
+void sanityCheck(String output) {
+ LineSplitter splitter = new LineSplitter();
+ var lines = splitter.convert(output);
+ // Looks like this:
+ // Total: 15556 tests
+ var total = int.parse(lines[0].split(' ')[1].trim());
+ var count = 0;
+ for (var i = 1; i < lines.length; i++) {
+ if (lines[i] == '') continue;
+ // Looks like this:
+ // * 3218 tests will be skipped (3047 skipped by design)
+ count += int.parse(lines[i].split(' ')[2].trim());
+ }
+ if (count != total) {
+ print('Count: $count, total: $total');
+ throw new Exception(
+ 'Count and total do not align. Please validate manually.');
+ }
+}
+
+void main(List<String> args) {
+ ensureBuild();
+
+ List<String> keys;
+ for (var combination in getCombinations()) {
+ for (var mode in combination['modes']) {
+ for (var arch in combination['archs']) {
+ for (var runtime in combination['runtimes']) {
+ var compiler = combination['compiler'];
+
+ var args = ['tools/test.py', '-m$mode', '-c$compiler', '-r$runtime',
+ '-a$arch', '--report-in-json', '--use-sdk'];
+ var result = Process.runSync('python', args);
+ if (result.exitCode != 0) {
+ print(result.stdout);
+ print(result.stderr);
+ throw new Exception("Error running: ${args.join(" ")}");
+ }
+
+ // Find Total: 15063 tests
+ // Everything after this will be the report.
+ var totalIndex = result.stdout.indexOf('JSON:');
+ var report = result.stdout.substring(totalIndex + 5);
+
+ var map = JSON.decode(report) as Map;
+
+ if (keys == null) {
+ keys = map.keys.toList();
+ var firstKey = keys.removeAt(0);
+ if (firstKey != 'total') {
+ throw '"total" should be the first key';
+ }
+
+ var headers = ['compiler', 'runtime', 'arch', 'mode', 'total'];
+ for (var k in keys) {
+ headers.addAll([k, '${k}_pct']);
+ }
+ print(headers.join(','));
+ }
+
+ var total = map['total'];
+ var values = [compiler, runtime, arch, mode, total];
+
+ for (var key in keys) {
+ var value = map[key];
+ values.add(value);
+ var pct = 100*(value/total);
+ values.add('${pct.toStringAsFixed(3)}%');
+ }
+
+ print(values.join(','));
+ }
+ }
+ }
+ }
+}
diff --git a/tools/testing/dart/summary_report.dart b/tools/testing/dart/summary_report.dart
new file mode 100644
index 0000000..d6db9a9
--- /dev/null
+++ b/tools/testing/dart/summary_report.dart
@@ -0,0 +1,133 @@
+// 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 summary_report;
+
+import "status_file_parser.dart";
+import "test_runner.dart";
+
+final summaryReport = new SummaryReport();
+
+class SummaryReport {
+ int _total = 0;
+ int _skipped = 0;
+ int _skippedByDesign = 0;
+ int _noCrash = 0;
+ int _flakyCrash = 0;
+ int _pass = 0;
+ int _failOk = 0;
+ int _fail = 0;
+ int _crash = 0;
+ int _timeout = 0;
+ int _compileErrorSkip = 0;
+
+ int get total => _total;
+
+ int get skippedOther => _skipped - _skippedByDesign;
+
+ int get bogus => _nonStandardTestCases.length;
+
+ final List<TestCase> _nonStandardTestCases = <TestCase>[];
+
+ void add(TestCase testCase) {
+ var expectations = testCase.expectedOutcomes;
+
+ bool containsFail = expectations
+ .any((expectation) => expectation.canBeOutcomeOf(Expectation.FAIL));
+ bool containsPass = expectations.contains(Expectation.PASS);
+ bool containsSkip = expectations.contains(Expectation.SKIP);
+ bool containsSkipByDesign =
+ expectations.contains(Expectation.SKIP_BY_DESIGN);
+ bool containsCrash = expectations.contains(Expectation.CRASH);
+ bool containsOK = expectations.contains(Expectation.OK);
+ bool containsSlow = expectations.contains(Expectation.SLOW);
+ bool containsTimeout = expectations.contains(Expectation.TIMEOUT);
+
+ ++_total;
+ if (containsSkip) {
+ ++_skipped;
+ } else if (containsSkipByDesign) {
+ ++_skipped;
+ ++_skippedByDesign;
+ } else {
+ // We don't do if-else below because the buckets should be exclusive.
+ // We keep a count around to guarantee that
+ int markers = 0;
+
+ // Counts the number of flaky tests.
+ if (containsFail && containsPass && !containsCrash && !containsOK) {
+ ++_noCrash;
+ ++markers;
+ }
+ if (containsCrash && !containsOK && expectations.length > 1) {
+ ++_flakyCrash;
+ ++markers;
+ }
+ if ((containsPass && expectations.length == 1) ||
+ (containsPass && containsSlow && expectations.length == 2)) {
+ ++_pass;
+ ++markers;
+ }
+ if (containsFail && containsOK) {
+ ++_failOk;
+ ++markers;
+ }
+ if ((containsFail && expectations.length == 1) ||
+ (containsFail && containsSlow && expectations.length == 2)) {
+ ++_fail;
+ ++markers;
+ }
+ if ((containsCrash && expectations.length == 1) ||
+ (containsCrash && containsSlow && expectations.length == 2)) {
+ ++_crash;
+ ++markers;
+ }
+ if (containsTimeout && expectations.length == 1) {
+ ++_timeout;
+ ++markers;
+ }
+ if (markers != 1) {
+ _nonStandardTestCases.add(testCase);
+ }
+ }
+ }
+
+ void addCompileErrorSkipTest() {
+ _total++;
+ _compileErrorSkip++;
+ }
+
+ Map<String, int> get values => {
+ 'total': _total,
+ 'skippedOther': skippedOther,
+ 'skippedByDesign': _skippedByDesign,
+ 'pass': _pass,
+ 'noCrash': _noCrash,
+ 'flakyCrash': _flakyCrash,
+ 'failOk': _failOk,
+ 'fail': _fail,
+ 'crash': _crash,
+ 'timeout': _timeout,
+ 'compileErrorSkip': _compileErrorSkip,
+ 'bogus': bogus
+ };
+
+ String get report => """Total: $_total tests
+ * $_skipped tests will be skipped ($_skippedByDesign skipped by design)
+ * $_noCrash tests are expected to be flaky but not crash
+ * $_flakyCrash tests are expected to flaky crash
+ * $_pass tests are expected to pass
+ * $_failOk tests are expected to fail that we won't fix
+ * $_fail tests are expected to fail that we should fix
+ * $_crash tests are expected to crash that we should fix
+ * $_timeout tests are allowed to timeout
+ * $_compileErrorSkip tests are skipped on browsers due to compile-time error
+ * $bogus could not be categorized or are in multiple categories
+""";
+
+ void printReport() {
+ if (_total == 0) return;
+ print(report);
+ }
+}
diff --git a/tools/testing/dart/test_configurations.dart b/tools/testing/dart/test_configurations.dart
index 091e477..6edd93c 100644
--- a/tools/testing/dart/test_configurations.dart
+++ b/tools/testing/dart/test_configurations.dart
@@ -62,6 +62,8 @@
var printTiming = firstConf['time'];
var listTests = firstConf['list'];
+ var reportInJson = firstConf['report_in_json'];
+
var recordingPath = firstConf['record_to_file'];
var recordingOutputPath = firstConf['replay_from_file'];
@@ -224,7 +226,9 @@
}
var eventListener = [];
- if (progressIndicator != 'silent') {
+
+ // We don't print progress if we list tests.
+ if (progressIndicator != 'silent' && !listTests) {
var printFailures = true;
var formatter = new Formatter();
if (progressIndicator == 'color') {
@@ -261,7 +265,13 @@
eventListener.add(new UnexpectedCrashDumpArchiver());
}
- eventListener.add(new ExitCodeSetter());
+ // The only progress indicator when listing tests should be the
+ // the summary printer.
+ if (listTests) {
+ eventListener.add(new SummaryPrinter(jsonOnly: reportInJson));
+ } else {
+ eventListener.add(new ExitCodeSetter());
+ }
void startProcessQueue() {
// [firstConf] is needed here, since the ProcessQueue needs to know the
diff --git a/tools/testing/dart/test_options.dart b/tools/testing/dart/test_options.dart
index 940c5cc..c004ee6 100644
--- a/tools/testing/dart/test_options.dart
+++ b/tools/testing/dart/test_options.dart
@@ -222,6 +222,13 @@
false,
type: 'bool'),
new _TestOptionSpecification(
+ 'report_in_json',
+ 'When doing list, output result summary in json only.',
+ ['--report-in-json'],
+ [],
+ false,
+ type: 'bool'),
+ new _TestOptionSpecification(
'time',
'Print timing information after running tests',
['--time'],
@@ -681,6 +688,11 @@
configuration['mode'] = 'debug,release';
}
+ if (configuration['report_in_json']) {
+ configuration['list'] = true;
+ configuration['report'] = true;
+ }
+
// Use verbose progress indication for verbose output unless buildbot
// progress indication is requested.
if (configuration['verbose'] && configuration['progress'] != 'buildbot') {
diff --git a/tools/testing/dart/test_progress.dart b/tools/testing/dart/test_progress.dart
index bb31d29..0fbb767 100644
--- a/tools/testing/dart/test_progress.dart
+++ b/tools/testing/dart/test_progress.dart
@@ -10,6 +10,7 @@
import "dart:convert" show JSON;
import "path.dart";
import "status_file_parser.dart";
+import "summary_report.dart";
import "test_runner.dart";
import "test_suite.dart";
import "utils.dart";
@@ -307,9 +308,17 @@
class SummaryPrinter extends EventListener {
+ final bool jsonOnly;
+
+ SummaryPrinter({bool jsonOnly})
+ : jsonOnly = (jsonOnly == null) ? false : jsonOnly;
+
void allTestsKnown() {
- if (SummaryReport.total > 0) {
- SummaryReport.printReport();
+ if (jsonOnly) {
+ print("JSON:");
+ print(JSON.encode(summaryReport.values));
+ } else {
+ summaryReport.printReport();
}
}
}
diff --git a/tools/testing/dart/test_runner.dart b/tools/testing/dart/test_runner.dart
index 68013f6..1bdf34e 100644
--- a/tools/testing/dart/test_runner.dart
+++ b/tools/testing/dart/test_runner.dart
@@ -2793,15 +2793,18 @@
print("\nGenerating all matching test cases ....\n");
for (TestCase testCase in testCases) {
+ eventFinishedTestCase(testCase);
print("${testCase.displayName} "
"Expectations: ${testCase.expectedOutcomes.join(', ')} "
"Configuration: '${testCase.configurationString}'");
}
+ eventAllTestsKnown();
});
}
var testCaseEnqueuer;
CommandQueue commandQueue;
+
void setupForRunning(TestCaseEnqueuer testCaseEnqueuer) {
Timer _debugTimer;
// If we haven't seen a single test finishing during a 10 minute period
diff --git a/tools/testing/dart/test_suite.dart b/tools/testing/dart/test_suite.dart
index 7253aec..bf79c8e 100644
--- a/tools/testing/dart/test_suite.dart
+++ b/tools/testing/dart/test_suite.dart
@@ -21,6 +21,7 @@
import "path.dart";
import "multitest.dart";
import "status_file_parser.dart";
+import "summary_report.dart";
import "test_runner.dart";
import "utils.dart";
import "http_server.dart" show PREFIX_BUILDDIR, PREFIX_DARTDIR;
@@ -279,10 +280,10 @@
if (testCase.expectCompileError &&
TestUtils.isBrowserRuntime(configuration['runtime']) &&
new CompilerConfiguration(configuration).hasCompiler) {
- SummaryReport.addCompileErrorSkipTest();
+ summaryReport.addCompileErrorSkipTest();
return;
} else {
- SummaryReport.add(expectations);
+ summaryReport.add(testCase);
}
}
@@ -2406,74 +2407,3 @@
return path;
}
}
-
-
-class SummaryReport {
- static int total = 0;
- static int skipped = 0;
- static int skippedByDesign = 0;
- static int noCrash = 0;
- static int pass = 0;
- static int failOk = 0;
- static int fail = 0;
- static int crash = 0;
- static int timeout = 0;
- static int compileErrorSkip = 0;
-
- static void add(Set<Expectation> expectations) {
- bool containsFail = expectations.any(
- (expectation) => expectation.canBeOutcomeOf(Expectation.FAIL));
- ++total;
- if (expectations.contains(Expectation.SKIP)) {
- ++skipped;
- } else if (expectations.contains(Expectation.SKIP_BY_DESIGN)) {
- ++skipped;
- ++skippedByDesign;
- } else {
- // Counts the number of flaky tests.
- if (expectations.contains(Expectation.PASS) &&
- containsFail &&
- !expectations.contains(Expectation.CRASH) &&
- !expectations.contains(Expectation.OK)) {
- ++noCrash;
- }
- if (expectations.contains(Expectation.PASS) && expectations.length == 1) {
- ++pass;
- }
- if (expectations.containsAll([Expectation.FAIL, Expectation.OK]) &&
- expectations.length == 2) {
- ++failOk;
- }
- if (containsFail && expectations.length == 1) {
- ++fail;
- }
- if (expectations.contains(Expectation.CRASH) &&
- expectations.length == 1) {
- ++crash;
- }
- if (expectations.contains(Expectation.TIMEOUT)) {
- ++timeout;
- }
- }
- }
-
- static void addCompileErrorSkipTest() {
- total++;
- compileErrorSkip++;
- }
-
- static void printReport() {
- if (total == 0) return;
- String report = """Total: $total tests
- * $skipped tests will be skipped ($skippedByDesign skipped by design)
- * $noCrash tests are expected to be flaky but not crash
- * $pass tests are expected to pass
- * $failOk tests are expected to fail that we won't fix
- * $fail tests are expected to fail that we should fix
- * $crash tests are expected to crash that we should fix
- * $timeout tests are allowed to timeout
- * $compileErrorSkip tests are skipped on browsers due to compile-time error
-""";
- print(report);
- }
-}