remove usage of deprecated ClassHierarchy constructor in DDK

Change-Id: I619d44a8dabb9cf2a06f687c4c4ec202e297b3bf
Reviewed-on: https://dart-review.googlesource.com/35420
Reviewed-by: Vijay Menon <vsm@google.com>
Commit-Queue: Jenny Messerly <jmesserly@google.com>
This commit is contained in:
Jenny Messerly 2018-01-17 22:45:58 +00:00 committed by commit-bot@chromium.org
parent 7bd5093f83
commit a6c5bb2875
2 changed files with 22 additions and 15 deletions

View file

@ -19,7 +19,6 @@ import '../compiler/js_names.dart' as JS;
import '../compiler/module_builder.dart';
import '../js_ast/js_ast.dart' as JS;
import 'compiler.dart';
import 'native_types.dart';
import 'source_map_printer.dart';
const _binaryName = 'dartdevk';
@ -221,8 +220,7 @@ Future<CompilerResult> _compile(List<String> args,
JS.Program compileToJSModule(Program p, List<Program> summaries,
List<Uri> summaryUris, Map<String, String> declaredVariables) {
var compiler = new ProgramCompiler(new NativeTypeSet(p),
declaredVariables: declaredVariables);
var compiler = new ProgramCompiler(p, declaredVariables: declaredVariables);
return compiler.emitProgram(p, summaries, summaryUris);
}

View file

@ -115,7 +115,7 @@ class ProgramCompiler
/// unit.
final virtualFields = new VirtualFieldModel();
JSTypeRep _typeRep;
final JSTypeRep _typeRep;
bool _superAllowed = true;
@ -188,17 +188,28 @@ class ProgramCompiler
final ConstantVisitor _constants;
NullableInference _nullableInference;
final NullableInference _nullableInference;
ProgramCompiler(NativeTypeSet nativeTypes,
{this.emitMetadata: true,
this.replCompile: false,
this.declaredVariables: const {}})
factory ProgramCompiler(Program program,
{bool emitMetadata: true,
bool replCompile: false,
Map<String, String> declaredVariables: const {}}) {
var nativeTypes = new NativeTypeSet(program);
var types = new TypeSchemaEnvironment(
nativeTypes.coreTypes, new ClassHierarchy(program), true);
return new ProgramCompiler._(
nativeTypes, new JSTypeRep(types, nativeTypes.sdk),
emitMetadata: emitMetadata,
replCompile: replCompile,
declaredVariables: declaredVariables);
}
ProgramCompiler._(NativeTypeSet nativeTypes, this._typeRep,
{this.emitMetadata, this.replCompile, this.declaredVariables})
: _extensionTypes = nativeTypes,
types = _typeRep.types,
coreTypes = nativeTypes.coreTypes,
_constants = new ConstantVisitor(nativeTypes.coreTypes),
types = new TypeSchemaEnvironment(nativeTypes.coreTypes,
new ClassHierarchy.deprecated_incremental(), true),
_jsArrayClass =
nativeTypes.sdk.getClass('dart:_interceptors', 'JSArray'),
_asyncStreamIteratorClass =
@ -214,10 +225,8 @@ class ProgramCompiler
identityHashSetImplClass =
nativeTypes.sdk.getClass('dart:collection', '_IdentityHashSet'),
syncIterableClass =
nativeTypes.sdk.getClass('dart:_js_helper', 'SyncIterable') {
_typeRep = new JSTypeRep(types, nativeTypes.sdk);
_nullableInference = new NullableInference(_typeRep);
}
nativeTypes.sdk.getClass('dart:_js_helper', 'SyncIterable'),
_nullableInference = new NullableInference(_typeRep);
ClassHierarchy get hierarchy => types.hierarchy;