mirror of
https://github.com/dart-lang/sdk
synced 2024-09-05 16:41:07 +00:00
[dart2js] migrate ir/modular.dart
Change-Id: Ica0332ccd9aebfa32ded6a4c17dd49f9573633b4 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/260300 Reviewed-by: Nate Biggs <natebiggs@google.com> Reviewed-by: Mayank Patke <fishythefish@google.com>
This commit is contained in:
parent
bba48857a6
commit
9d8ea01862
|
@ -28,8 +28,8 @@ class ImpactBuilder extends StaticTypeVisitor implements ImpactRegistry {
|
|||
final ImpactData _data = ImpactData();
|
||||
final KernelToElementMapForImpactData _elementMap;
|
||||
|
||||
@override
|
||||
final VariableScopeModel variableScopeModel;
|
||||
// Note: this may be null for builders associated with abstract methods.
|
||||
final VariableScopeModel? _variableScopeModel;
|
||||
|
||||
@override
|
||||
final ir.StaticTypeContext staticTypeContext;
|
||||
|
@ -45,12 +45,15 @@ class ImpactBuilder extends StaticTypeVisitor implements ImpactRegistry {
|
|||
this.staticTypeContext,
|
||||
StaticTypeCacheImpl staticTypeCache,
|
||||
ir.ClassHierarchy classHierarchy,
|
||||
this.variableScopeModel,
|
||||
this._variableScopeModel,
|
||||
{this.useAsserts = false,
|
||||
this.inferEffectivelyFinalVariableTypes = true})
|
||||
: super(
|
||||
staticTypeContext.typeEnvironment, classHierarchy, staticTypeCache);
|
||||
|
||||
@override
|
||||
VariableScopeModel get variableScopeModel => _variableScopeModel!;
|
||||
|
||||
CommonElements get _commonElements => _elementMap.commonElements;
|
||||
|
||||
DiagnosticReporter get _reporter => _elementMap.reporter;
|
||||
|
|
|
@ -2,8 +2,6 @@
|
|||
// 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.
|
||||
|
||||
// @dart = 2.10
|
||||
|
||||
import 'package:kernel/ast.dart' as ir;
|
||||
import 'package:kernel/type_environment.dart' as ir;
|
||||
|
||||
|
@ -49,7 +47,7 @@ class ModuleData {
|
|||
// TODO(joshualitt) Support serializing ModularMemberData;
|
||||
final Map<Uri, Map<ir.Member, ImpactBuilderData>> impactData;
|
||||
|
||||
ModuleData([Map<Uri, Map<ir.Member, ImpactBuilderData>> impactData])
|
||||
ModuleData([Map<Uri, Map<ir.Member, ImpactBuilderData>>? impactData])
|
||||
: this.impactData = impactData ?? {};
|
||||
|
||||
factory ModuleData.fromImpactData(
|
||||
|
@ -118,7 +116,7 @@ void reportLocatedMessage(DiagnosticReporter reporter,
|
|||
DiagnosticMessage _createDiagnosticMessage(
|
||||
DiagnosticReporter reporter, ir.LocatedMessage message) {
|
||||
var sourceSpan = SourceSpan(
|
||||
message.uri, message.charOffset, message.charOffset + message.length);
|
||||
message.uri!, message.charOffset, message.charOffset + message.length);
|
||||
return reporter.createMessage(
|
||||
sourceSpan, MessageKind.GENERIC, {'text': message.problemMessage});
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue