-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge ee5881b into dev
- Loading branch information
Showing
22 changed files
with
270 additions
and
81 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# Experiment flags | ||
|
||
If you're implementing a language feature, then it needs to have an accompanying | ||
experiment flag. (Or multiple experiments if it's going to be enabled over the | ||
course of multiple releases.) | ||
|
||
## Adding an experiment flag | ||
|
||
Experiment flags are shared across all of the tools, so they are defined in a | ||
single location. To add a new flag, edit | ||
[`experimental_features.yaml`](https://github.com/dart-lang/sdk/blob/main/tools/experimental_features.yaml). | ||
The initial commit is only required to define the name and to include a `help:` | ||
key. | ||
|
||
To generate the declarations used by the analyzer, run | ||
`dart pkg/analyzer/tool/experiments/generate.dart`. | ||
|
||
To generate the declarations used by the front-end, run | ||
`dart pkg/front_end/tool/fasta.dart generate-experimental-flags`. | ||
|
||
## Summary representation | ||
|
||
The set of (the indexes of) enabled experiments is used to build the hash for | ||
[summary files](summaries.md). If defining the new experiment flag changes the | ||
indexes of existing experiment flags, then the value of the static field | ||
`AnalysisDriver.DATA_VERSION` needs to be incremented. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
// Copyright (c) 2024, 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:convert'; | ||
import 'dart:developer'; | ||
import 'dart:io'; | ||
|
||
import 'package:test/test.dart'; | ||
import 'package:vm_service/vm_service.dart'; | ||
import 'package:vm_service/vm_service_io.dart'; | ||
|
||
void main() { | ||
HttpClient? client; | ||
VmService? service; | ||
|
||
tearDown(() async { | ||
client?.close(); | ||
await service?.dispose(); | ||
}); | ||
|
||
test('Enabling the VM service starts DDS and serves DevTools', () async { | ||
var serviceInfo = await Service.getInfo(); | ||
expect(serviceInfo.serverUri, isNull); | ||
|
||
serviceInfo = await Service.controlWebServer( | ||
enable: true, | ||
silenceOutput: true, | ||
); | ||
expect(serviceInfo.serverUri, isNotNull); | ||
expect(serviceInfo.serverWebSocketUri, isNotNull); | ||
service = await vmServiceConnectUri( | ||
serviceInfo.serverWebSocketUri!.toString(), | ||
); | ||
|
||
// Check that DDS has been launched. | ||
final supportedProtocols = | ||
(await service!.getSupportedProtocols()).protocols!; | ||
expect(supportedProtocols.length, 2); | ||
expect(supportedProtocols.map((e) => e.protocolName), contains('DDS')); | ||
|
||
// Check that DevTools assets are accessible. | ||
client = HttpClient(); | ||
final devtoolsRequest = await client!.getUrl(serviceInfo.serverUri!); | ||
final devtoolsResponse = await devtoolsRequest.close(); | ||
expect(devtoolsResponse.statusCode, 200); | ||
final devtoolsContent = | ||
await devtoolsResponse.transform(utf8.decoder).join(); | ||
expect(devtoolsContent, startsWith('<!DOCTYPE html>')); | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
// Copyright (c) 2024, 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 https://github.com/dart-lang/sdk/issues/56051. | ||
|
||
// VMOptions=--compiler-passes=-Inlining | ||
|
||
import 'package:expect/expect.dart'; | ||
|
||
class Foo { | ||
covariant late num a; | ||
} | ||
|
||
class Bar extends Foo { | ||
@override | ||
late int a; | ||
} | ||
|
||
void main() { | ||
Foo bar = Bar(); | ||
bar.a = 2; | ||
Expect.equals(2, bar.a); | ||
Expect.throws(() { | ||
bar.a = 3.14 as dynamic; | ||
print('bar.a is now ${bar.a}'); | ||
}); | ||
print("success!"); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.