Skip to content

Commit

Permalink
Version 3.3.0-184.0.dev
Browse files Browse the repository at this point in the history
Merge 24fafa3 into dev
  • Loading branch information
Dart CI committed Dec 3, 2023
2 parents f5216bb + 24fafa3 commit c7f18da
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 17 deletions.
18 changes: 12 additions & 6 deletions pkg/analyzer/test/verify_docs_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ class SnippetTester {
final Folder docFolder;
final String snippetDirPath;
final String snippetPath;
final AnalysisContextCollection collection;

final StringBuffer output = StringBuffer();

Expand All @@ -41,7 +42,9 @@ class SnippetTester {
}

SnippetTester._(
this.provider, this.docFolder, this.snippetDirPath, this.snippetPath);
this.provider, this.docFolder, this.snippetDirPath, this.snippetPath)
: collection = AnalysisContextCollection(
resourceProvider: provider, includedPaths: [snippetPath]);

/// Return `true` if the given error is a diagnostic produced by a lint that
/// is allowed to occur in documentation.
Expand Down Expand Up @@ -91,7 +94,7 @@ class SnippetTester {
if (output.isNotEmpty) {
fail(output.toString());
}
}, timeout: Timeout.factor(6));
}, timeout: Timeout.factor(4));
}
} else if (child is Folder) {
await verifyFolder(child);
Expand All @@ -103,7 +106,7 @@ class SnippetTester {
// TODO(brianwilkerson): When the files outside of 'src' contain only public
// API, write code to compute the list of imports so that new public API
// will automatically be allowed.
String imports = '''
const String imports = '''
import 'dart:math' as math;
import 'package:analyzer/dart/analysis/analysis_context.dart';
Expand All @@ -127,13 +130,16 @@ $snippet
''',
modificationStamp: 1);
try {
AnalysisContextCollection collection = AnalysisContextCollection(
includedPaths: <String>[snippetDirPath], resourceProvider: provider);
List<AnalysisContext> contexts = collection.contexts;
if (contexts.length != 1) {
fail('The snippets directory contains multiple analysis contexts.');
}
var results = await contexts[0].currentSession.getErrors(snippetPath);
var context = contexts[0];
// Mark the snippet as changed since we reuse the same path
// for each snippet found.
context.changeFile(snippetPath);
await context.applyPendingFileChanges();
var results = await context.currentSession.getErrors(snippetPath);
if (results is ErrorsResult) {
Iterable<AnalysisError> errors = results.errors.where((error) {
ErrorCode errorCode = error.errorCode;
Expand Down
20 changes: 10 additions & 10 deletions pkg/dart2js_info/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,12 @@ together your own tool.

[AllInfo][AllInfo] exposes a Dart representation of all of the collected
information. There are deserialization libraries in this package to decode any
info file produced by the `dart2js` `--dump-info` option. See
`lib/binary_serialization.dart` and `lib/json_info_codec.dart` to find the
binary and JSON decoders respectively. For convenience,
`package:dart2js_info/src/io.dart` also exposes a helper method that can choose,
depending on the extension of the info file, whether to deserialize it using the
binary or JSON decoder. For example:
info file produced by the `dart compile js` (before Dart 2.18, `dart2js`)
`--dump-info` option. See `lib/binary_serialization.dart` and
`lib/json_info_codec.dart` to find the binary and JSON decoders respectively.
For convenience, `package:dart2js_info/src/io.dart` also exposes a helper
method that can choose, depending on the extension of the info file, whether to
deserialize it using the binary or JSON decoder. For example:

```dart
import 'dart:convert';
Expand Down Expand Up @@ -102,7 +102,7 @@ The following tools are a available today:
* [`deferred_check`][deferred_check]: a tool that verifies that code
was split into deferred parts as expected. This tool takes a specification
of the expected layout of code into deferred parts, and checks that the
output from `dart2js` meets the specification.
output from `dart compile js` meets the specification.

* [`deferred_size`][deferred_size]: a tool that gives a breakdown of
the sizes of the deferred parts of the program. This can show how much of
Expand Down Expand Up @@ -501,7 +501,7 @@ steps are as follows:
`--experiment-call-instrumentation`

```console
$ dart2js --dump-info --experiment-call-instrumentation main.dart
$ dart compile js --dump-info --experiment-call-instrumentation main.dart
```

The flag only works dart2js version 2.2.0 or newer.
Expand Down Expand Up @@ -536,14 +536,14 @@ Runtime code analysis requires both an info file and a runtime data file.
The info file is emitted by compiling a dart2js app with `--dump-info`:

```console
$ dart2js --dump-info main.dart
$ dart compile js --dump-info main.dart
```

Enable the collection of runtime data by compiling a dart2js app with an
experimental flag:

```console
$ dart2js --experimental-track-allocations main.dart
$ dart compile js --experimental-track-allocations main.dart
```

After using your app (manually or via integration tests), dump the top-level
Expand Down
2 changes: 1 addition & 1 deletion tools/VERSION
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,5 @@ CHANNEL dev
MAJOR 3
MINOR 3
PATCH 0
PRERELEASE 183
PRERELEASE 184
PRERELEASE_PATCH 0

0 comments on commit c7f18da

Please sign in to comment.