@@ -33,7 +33,7 @@ import 'package:front_end/src/fasta/severity.dart' show Severity;
33
33
import 'package:kernel/binary/ast_from_binary.dart' show BinaryBuilder;
34
34
35
35
import 'package:kernel/kernel.dart'
36
- show Class, Component, Field, Library, Procedure;
36
+ show Class, Component, EmptyStatement, Field, Library, Procedure;
37
37
38
38
import 'package:kernel/target/targets.dart' show TargetFlags;
39
39
@@ -405,13 +405,14 @@ Future<Null> newWorldTest(
405
405
entries.add (base .resolve (entry));
406
406
}
407
407
}
408
+ bool outlineOnly = world["outlineOnly" ] == true ;
408
409
if (brandNewWorld) {
409
410
if (world["fromComponent" ] == true ) {
410
411
compiler = new TestIncrementalCompiler .fromComponent (
411
- options, entries.first, newestWholeComponent);
412
+ options, entries.first, newestWholeComponent, outlineOnly );
412
413
} else {
413
- compiler =
414
- new TestIncrementalCompiler ( options, entries.first, initializeFrom);
414
+ compiler = new TestIncrementalCompiler (
415
+ options, entries.first, initializeFrom, outlineOnly );
415
416
}
416
417
}
417
418
@@ -434,6 +435,18 @@ Future<Null> newWorldTest(
434
435
entryPoints: entries,
435
436
fullComponent:
436
437
brandNewWorld ? false : (noFullComponent ? false : true ));
438
+ if (outlineOnly) {
439
+ for (Library lib in component.libraries) {
440
+ for (Class c in lib.classes) {
441
+ for (Procedure p in c.procedures) {
442
+ if (p.function.body is ! EmptyStatement ) throw "Got body" ;
443
+ }
444
+ }
445
+ for (Procedure p in lib.procedures) {
446
+ if (p.function.body is ! EmptyStatement ) throw "Got body" ;
447
+ }
448
+ }
449
+ }
437
450
performErrorAndWarningCheck (
438
451
world, gotError, formattedErrors, gotWarning, formattedWarnings);
439
452
util.throwOnEmptyMixinBodies (component);
@@ -808,18 +821,20 @@ class TestIncrementalCompiler extends IncrementalCompiler {
808
821
}
809
822
810
823
TestIncrementalCompiler (CompilerOptions options, this .entryPoint,
811
- [Uri initializeFrom])
824
+ [Uri initializeFrom, bool outlineOnly ])
812
825
: super (
813
826
new CompilerContext (
814
827
new ProcessedOptions (options: options, inputs: [entryPoint])),
815
- initializeFrom);
828
+ initializeFrom,
829
+ outlineOnly);
816
830
817
831
TestIncrementalCompiler .fromComponent (CompilerOptions options,
818
- this .entryPoint, Component componentToInitializeFrom)
832
+ this .entryPoint, Component componentToInitializeFrom, [ bool outlineOnly] )
819
833
: super .fromComponent (
820
834
new CompilerContext (
821
835
new ProcessedOptions (options: options, inputs: [entryPoint])),
822
- componentToInitializeFrom);
836
+ componentToInitializeFrom,
837
+ outlineOnly);
823
838
824
839
@override
825
840
void recordInvalidatedImportUrisForTesting (List <Uri > uris) {
0 commit comments