@@ -40,7 +40,6 @@ import '../builder/type_variable_builder.dart';
40
40
import '../builder/void_type_declaration_builder.dart' ;
41
41
import '../compiler_context.dart' show CompilerContext;
42
42
import '../crash.dart' show withCrashReporting;
43
- import '../dill/dill_library_builder.dart' show DillLibraryBuilder;
44
43
import '../dill/dill_member_builder.dart' show DillMemberBuilder;
45
44
import '../dill/dill_target.dart' show DillTarget;
46
45
import '../kernel/constructor_tearoff_lowering.dart' ;
@@ -50,16 +49,11 @@ import '../messages.dart'
50
49
FormattedMessage,
51
50
LocatedMessage,
52
51
Message,
53
- messageAgnosticWithStrongDillLibrary,
54
- messageAgnosticWithWeakDillLibrary,
55
52
messageConstConstructorLateFinalFieldCause,
56
53
messageConstConstructorLateFinalFieldError,
57
54
messageConstConstructorNonFinalField,
58
55
messageConstConstructorNonFinalFieldCause,
59
56
messageConstConstructorRedirectionToNonConst,
60
- messageInvalidNnbdDillLibrary,
61
- messageStrongWithWeakDillLibrary,
62
- messageWeakWithStrongDillLibrary,
63
57
noLength,
64
58
templateFieldNonNullableNotInitializedByConstructorError,
65
59
templateFieldNonNullableWithoutInitializerError,
@@ -72,8 +66,7 @@ import '../problems.dart' show unhandled;
72
66
import '../scope.dart' show AmbiguousBuilder;
73
67
import '../source/name_scheme.dart' ;
74
68
import '../source/source_class_builder.dart' show SourceClassBuilder;
75
- import '../source/source_library_builder.dart'
76
- show LanguageVersion, SourceLibraryBuilder;
69
+ import '../source/source_library_builder.dart' show SourceLibraryBuilder;
77
70
import '../source/source_loader.dart' show SourceLoader;
78
71
import '../target_implementation.dart' show TargetImplementation;
79
72
import '../ticker.dart' show Ticker;
@@ -368,90 +361,6 @@ class KernelTarget extends TargetImplementation {
368
361
return entryPoint;
369
362
}
370
363
371
- /// Creates a [LibraryBuilder] corresponding to [uri] , if one doesn't exist
372
- /// already.
373
- ///
374
- /// [fileUri] must not be null and is a URI that can be passed to FileSystem
375
- /// to locate the corresponding file.
376
- ///
377
- /// [origin] is non-null if the created library is a patch to [origin] .
378
- ///
379
- /// [packageUri] is the base uri for the package which the library belongs to.
380
- /// For instance 'package:foo'.
381
- ///
382
- /// This is used to associate libraries in for instance the 'bin' and 'test'
383
- /// folders of a package source with the package uri of the 'lib' folder.
384
- ///
385
- /// If the [packageUri] is `null` the package association of this library is
386
- /// based on its [importUri] .
387
- ///
388
- /// For libraries with a 'package:' [importUri] , the package path must match
389
- /// the path in the [importUri] . For libraries with a 'dart:' [importUri] the
390
- /// [packageUri] must be `null` .
391
- ///
392
- /// [packageLanguageVersion] is the language version defined by the package
393
- /// which the library belongs to, or the current sdk version if the library
394
- /// doesn't belong to a package.
395
- LibraryBuilder createLibraryBuilder (
396
- Uri uri,
397
- Uri fileUri,
398
- Uri ? packageUri,
399
- LanguageVersion packageLanguageVersion,
400
- SourceLibraryBuilder ? origin,
401
- Library ? referencesFrom,
402
- bool ? referenceIsPartOwner) {
403
- if (dillTarget.isLoaded) {
404
- DillLibraryBuilder ? builder = dillTarget.loader.lookupLibraryBuilder (uri);
405
- if (builder != null ) {
406
- if (! builder.isNonNullableByDefault &&
407
- (loader.nnbdMode == NnbdMode .Strong ||
408
- loader.nnbdMode == NnbdMode .Agnostic )) {
409
- loader.registerStrongOptOutLibrary (builder);
410
- } else {
411
- NonNullableByDefaultCompiledMode libraryMode =
412
- builder.library.nonNullableByDefaultCompiledMode;
413
- if (libraryMode == NonNullableByDefaultCompiledMode .Invalid ) {
414
- loader.registerNnbdMismatchLibrary (
415
- builder, messageInvalidNnbdDillLibrary);
416
- } else {
417
- switch (loader.nnbdMode) {
418
- case NnbdMode .Weak :
419
- if (libraryMode != NonNullableByDefaultCompiledMode .Agnostic &&
420
- libraryMode != NonNullableByDefaultCompiledMode .Weak ) {
421
- loader.registerNnbdMismatchLibrary (
422
- builder, messageWeakWithStrongDillLibrary);
423
- }
424
- break ;
425
- case NnbdMode .Strong :
426
- if (libraryMode != NonNullableByDefaultCompiledMode .Agnostic &&
427
- libraryMode != NonNullableByDefaultCompiledMode .Strong ) {
428
- loader.registerNnbdMismatchLibrary (
429
- builder, messageStrongWithWeakDillLibrary);
430
- }
431
- break ;
432
- case NnbdMode .Agnostic :
433
- if (libraryMode != NonNullableByDefaultCompiledMode .Agnostic ) {
434
- if (libraryMode == NonNullableByDefaultCompiledMode .Strong ) {
435
- loader.registerNnbdMismatchLibrary (
436
- builder, messageAgnosticWithStrongDillLibrary);
437
- } else {
438
- loader.registerNnbdMismatchLibrary (
439
- builder, messageAgnosticWithWeakDillLibrary);
440
- }
441
- }
442
- break ;
443
- }
444
- }
445
- }
446
- return builder;
447
- }
448
- }
449
- return new SourceLibraryBuilder (
450
- uri, fileUri, packageUri, packageLanguageVersion, loader, origin,
451
- referencesFrom: referencesFrom,
452
- referenceIsPartOwner: referenceIsPartOwner);
453
- }
454
-
455
364
/// Returns classes defined in libraries in [loader] .
456
365
List <SourceClassBuilder > collectMyClasses () {
457
366
List <SourceClassBuilder > result = < SourceClassBuilder > [];
0 commit comments