| Index: lib/src/compiler/compiler.dart
|
| diff --git a/lib/src/compiler/compiler.dart b/lib/src/compiler/compiler.dart
|
| index fa6ea22859aacc776736e5cc1df44dbabc3fba21..7f0db169609c93e60f713f00b0ddf50d5cac8030 100644
|
| --- a/lib/src/compiler/compiler.dart
|
| +++ b/lib/src/compiler/compiler.dart
|
| @@ -42,9 +42,18 @@ import 'error_helpers.dart' show errorSeverity, formatError, sortErrors;
|
| /// about them.
|
| class ModuleCompiler {
|
| final AnalysisContext context;
|
| - final _extensionTypes = new ExtensionTypeSet();
|
| + final ExtensionTypeSet _extensionTypes;
|
|
|
| - ModuleCompiler.withContext(this.context);
|
| + ModuleCompiler.withContext(AnalysisContext context)
|
| + : context = context,
|
| + _extensionTypes = new ExtensionTypeSet(context) {
|
| + if (!context.analysisOptions.strongMode) {
|
| + throw new ArgumentError('AnalysisContext must be strong mode');
|
| + }
|
| + if (!context.sourceFactory.dartSdk.context.analysisOptions.strongMode) {
|
| + throw new ArgumentError('AnalysisContext must have strong mode SDK');
|
| + }
|
| + }
|
|
|
| ModuleCompiler(AnalyzerOptions analyzerOptions)
|
| : this.withContext(createAnalysisContextWithSources(analyzerOptions));
|
|
|