@@ -567,8 +567,6 @@ Future<void> main() async {
567567 computePlatformBinariesLocation ().resolve ('vm_platform_strong.dill' );
568568 final Uri ddcPlatformKernel =
569569 computePlatformBinariesLocation ().resolve ('ddc_outline.dill' );
570- final Uri ddcPlatformKernelWeak =
571- computePlatformBinariesLocation ().resolve ('ddc_outline_unsound.dill' );
572570 final Uri sdkRoot = computePlatformBinariesLocation ();
573571
574572 late Directory tempDir;
@@ -2078,52 +2076,7 @@ void main(List<String> arguments, SendPort sendPort) {
20782076 final List <String > args = < String > [
20792077 '--sdk-root=${sdkRoot .toFilePath ()}' ,
20802078 '--incremental' ,
2081- '--platform=${ddcPlatformKernelWeak .path }' ,
2082- '--output-dill=${dillFile .path }' ,
2083- '--target=dartdevc' ,
2084- '--dartdevc-module-format=$moduleFormat ' ,
2085- if (canary) '--dartdevc-canary' ,
2086- '--packages=${packages .path }' ,
2087- 'package:hello/foo.dart'
2088- ];
2089-
2090- expect (await starter (args), 0 );
2091- }
2092-
2093- test ('AMD module format' , () async {
2094- await runTests (moduleFormat: 'amd' );
2095- });
2096-
2097- test ('DDC module format and canary' , () async {
2098- await runTests (moduleFormat: 'ddc' , canary: true );
2099- });
2100- }, skip: 'https://github.com/dart-lang/sdk/issues/43959' );
2101-
2102- group ('compile to JavaScript weak null safety' , () {
2103- Future <void > runTests (
2104- {required String moduleFormat, bool canary = false }) async {
2105- File file = new File ('${tempDir .path }/foo.dart' )..createSync ();
2106- file.writeAsStringSync ("main() {\n }\n " );
2107- File packages =
2108- new File ('${tempDir .path }/.dart_tool/package_config.json' )
2109- ..createSync ()
2110- ..writeAsStringSync (jsonEncode ({
2111- "configVersion" : 2 ,
2112- "packages" : [
2113- {
2114- "name" : "hello" ,
2115- "rootUri" : "${tempDir .uri }" ,
2116- },
2117- ],
2118- }));
2119- File dillFile = new File ('${tempDir .path }/app.dill' );
2120-
2121- expect (dillFile.existsSync (), false );
2122-
2123- final List <String > args = < String > [
2124- '--sdk-root=${sdkRoot .toFilePath ()}' ,
2125- '--incremental' ,
2126- '--platform=${ddcPlatformKernelWeak .path }' ,
2079+ '--platform=${ddcPlatformKernel .path }' ,
21272080 '--output-dill=${dillFile .path }' ,
21282081 '--target=dartdevc' ,
21292082 '--dartdevc-module-format=$moduleFormat ' ,
@@ -2144,77 +2097,6 @@ void main(List<String> arguments, SendPort sendPort) {
21442097 });
21452098 }, skip: 'https://github.com/dart-lang/sdk/issues/43959' );
21462099
2147- group ('compile to JavaScript weak null safety then nonexistent file' , () {
2148- Future <void > runTests (
2149- {required String moduleFormat, bool canary = false }) async {
2150- File file = new File ('${tempDir .path }/foo.dart' )..createSync ();
2151- file.writeAsStringSync ("main() {\n }\n " );
2152- File packages =
2153- new File ('${tempDir .path }/.dart_tool/package_config.json' )
2154- ..createSync ()
2155- ..writeAsStringSync (jsonEncode ({
2156- "configVersion" : 2 ,
2157- "packages" : [
2158- {
2159- "name" : "hello" ,
2160- "rootUri" : "${tempDir .uri }" ,
2161- },
2162- ],
2163- }));
2164- File dillFile = new File ('${tempDir .path }/app.dill' );
2165-
2166- expect (dillFile.existsSync (), false );
2167-
2168- String library = 'package:hello/foo.dart' ;
2169-
2170- final List <String > args = < String > [
2171- '--sdk-root=${sdkRoot .toFilePath ()}' ,
2172- '--incremental' ,
2173- '--platform=${ddcPlatformKernelWeak .path }' ,
2174- '--output-dill=${dillFile .path }' ,
2175- '--target=dartdevc' ,
2176- '--dartdevc-module-format=$moduleFormat ' ,
2177- if (canary) '--dartdevc-canary' ,
2178- '--packages=${packages .path }' ,
2179- ];
2180-
2181- FrontendServer frontendServer = new FrontendServer ();
2182- Future <int > result = frontendServer.open (args);
2183- frontendServer.compile (library);
2184- int count = 0 ;
2185- frontendServer.listen ((Result compiledResult) {
2186- CompilationResult result =
2187- new CompilationResult .parse (compiledResult.status);
2188- count++ ;
2189- if (count == 1 ) {
2190- // First request is to 'compile', which results in full JavaScript
2191- expect (result.errorsCount, equals (0 ));
2192- expect (result.filename, dillFile.path);
2193- frontendServer.accept ();
2194- frontendServer.compile ('foo.bar' );
2195- } else {
2196- expect (count, 2 );
2197- // Second request is to 'compile' nonexistent file, that should
2198- // fail.
2199- expect (result.errorsCount, greaterThan (0 ));
2200- frontendServer.quit ();
2201- }
2202- });
2203-
2204- expect (await result, 0 );
2205- expect (count, 2 );
2206- frontendServer.close ();
2207- }
2208-
2209- test ('AMD module format' , () async {
2210- await runTests (moduleFormat: 'amd' );
2211- });
2212-
2213- test ('DDC module format and canary' , () async {
2214- await runTests (moduleFormat: 'ddc' , canary: true );
2215- });
2216- }, skip: 'https://github.com/dart-lang/sdk/issues/43959' );
2217-
22182100 group ('compile to JavaScript with no metadata' , () {
22192101 Future <void > runTests (
22202102 {required String moduleFormat, bool canary = false }) async {
@@ -2719,97 +2601,6 @@ e() {
27192601 });
27202602 });
27212603
2722- group ('compile to JavaScript all library bundles with unsound null safety' ,
2723- () {
2724- Future <void > runTests (
2725- {required String moduleFormat, bool canary = false }) async {
2726- File file = new File ('${tempDir .path }/foo.dart' )..createSync ();
2727- file.writeAsStringSync ("import 'bar.dart'; "
2728- "typedef myType = void Function(int); main() { fn is myType; }\n " );
2729- file = new File ('${tempDir .path }/bar.dart' )..createSync ();
2730- file.writeAsStringSync ("void Function(int) fn = (int i) => null;\n " );
2731- String library = 'package:hello/foo.dart' ;
2732-
2733- File dillFile = new File ('${tempDir .path }/app.dill' );
2734- File sourceFile = new File ('${dillFile .path }.sources' );
2735-
2736- File packageConfig =
2737- new File ('${tempDir .path }/.dart_tool/package_config.json' )
2738- ..createSync (recursive: true )
2739- ..writeAsStringSync ('''
2740- {
2741- "configVersion": 2,
2742- "packages": [
2743- {
2744- "name": "hello",
2745- "rootUri": "../",
2746- "packageUri": "./",
2747- "languageVersion": "2.9"
2748- }
2749- ]
2750- }
2751- ''' );
2752-
2753- final List <String > args = < String > [
2754- '--verbose' ,
2755- '--no-sound-null-safety' ,
2756- '--sdk-root=${sdkRoot .toFilePath ()}' ,
2757- '--incremental' ,
2758- '--platform=${ddcPlatformKernelWeak .path }' ,
2759- '--output-dill=${dillFile .path }' ,
2760- '--target=dartdevc' ,
2761- '--dartdevc-module-format=$moduleFormat ' ,
2762- if (canary) '--dartdevc-canary' ,
2763- '--packages=${packageConfig .path }'
2764- ];
2765-
2766- FrontendServer frontendServer = new FrontendServer ();
2767- Future <int > result = frontendServer.open (args);
2768- frontendServer.compile (library);
2769- int count = 0 ;
2770- Completer <bool > expectationCompleter = new Completer <bool >();
2771- frontendServer.listen ((Result compiledResult) {
2772- CompilationResult result =
2773- new CompilationResult .parse (compiledResult.status);
2774- count++ ;
2775- // Request to 'compile', which results in full JavaScript and no
2776- // metadata.
2777- expect (result.errorsCount, equals (0 ));
2778- expect (sourceFile.existsSync (), equals (true ));
2779- expect (result.filename, dillFile.path);
2780-
2781- String source = sourceFile.readAsStringSync ();
2782- // Split on the comment at the end of each library bundle.
2783- List <String > jsLibraryBundles =
2784- source.split (new RegExp ("//# sourceMappingURL=.*.map" ));
2785-
2786- // Both library bundles should include the unsound null safety check.
2787- expect (jsLibraryBundles[0 ],
2788- contains ('dart._checkModuleNullSafetyMode(false);' ));
2789- expect (jsLibraryBundles[1 ],
2790- contains ('dart._checkModuleNullSafetyMode(false);' ));
2791- frontendServer.accept ();
2792- frontendServer.quit ();
2793- expectationCompleter.complete (true );
2794- });
2795-
2796- await expectationCompleter.future;
2797- expect (await result, 0 );
2798- expect (count, 1 );
2799- frontendServer.close ();
2800- }
2801-
2802- test ('AMD module format' , () async {
2803- await runTests (moduleFormat: 'amd' );
2804- });
2805-
2806- test ('DDC module format and canary' , () async {
2807- await runTests (moduleFormat: 'ddc' , canary: true );
2808- });
2809- },
2810- timeout: Timeout .none,
2811- skip: 'https://github.com/dart-lang/sdk/issues/52775' );
2812-
28132604 group ('compile to JavaScript, all library bundles with sound null safety' ,
28142605 () {
28152606 Future <void > runTests (
0 commit comments