| Index: pkg/kernel/lib/analyzer/ast_from_analyzer.dart
|
| diff --git a/pkg/kernel/lib/analyzer/ast_from_analyzer.dart b/pkg/kernel/lib/analyzer/ast_from_analyzer.dart
|
| index 88efc20918f323b9e82b694e15bb9c0543a404a6..034decdcc4abdbdb4be84669cdc9658bccf4f7d2 100644
|
| --- a/pkg/kernel/lib/analyzer/ast_from_analyzer.dart
|
| +++ b/pkg/kernel/lib/analyzer/ast_from_analyzer.dart
|
| @@ -754,14 +754,11 @@ class ExpressionScope extends TypeScope {
|
| return new ast.Throw(new ast.StringLiteral(message));
|
| }
|
|
|
| - ast.Expression buildThrowCompileTimeErrorFromCode(ErrorCode code,
|
| - [List arguments]) {
|
| - return buildThrowCompileTimeError(makeErrorMessage(code, arguments));
|
| - }
|
| -
|
| static final RegExp _errorMessagePattern = new RegExp(r'\{(\d+)\}');
|
|
|
| - String makeErrorMessage(ErrorCode error, [List arguments]) {
|
| + /// Throws an exception that will be caught at the function level, to replace
|
| + /// the entire function with a throw.
|
| + emitCompileTimeError(ErrorCode error, [List arguments]) {
|
| String message = error.message;
|
| if (arguments != null) {
|
| message = message.replaceAllMapped(_errorMessagePattern, (m) {
|
| @@ -770,13 +767,7 @@ class ExpressionScope extends TypeScope {
|
| return arguments[index];
|
| });
|
| }
|
| - return message;
|
| - }
|
| -
|
| - /// Throws an exception that will be caught at the function level, to replace
|
| - /// the entire function with a throw.
|
| - emitCompileTimeError(ErrorCode error, [List arguments]) {
|
| - throw new _CompilationError(makeErrorMessage(error, arguments));
|
| + throw new _CompilationError(message);
|
| }
|
|
|
| ast.Expression buildThrowAbstractClassInstantiationError(String name) {
|
| @@ -1702,9 +1693,6 @@ class ExpressionBuilder
|
| if (isTopLevelFunction(function)) {
|
| return scope.staticAccess(node.name, function);
|
| }
|
| - if (function == function.library.loadLibraryFunction) {
|
| - return scope.unsupportedFeature('Deferred loading');
|
| - }
|
| return new VariableAccessor(scope.getVariableReference(function));
|
|
|
| case ElementKind.LOCAL_VARIABLE:
|
| @@ -2749,18 +2737,9 @@ class MemberBodyBuilder extends GeneralizingAstVisitor<Null> {
|
| }
|
| for (var parameter in node.parameters.parameterElements) {
|
| if (parameter is FieldFormalParameterElement) {
|
| - ast.Initializer initializer;
|
| - if (parameter.field == null) {
|
| - initializer = new ast.LocalInitializer(
|
| - new ast.VariableDeclaration.forValue(scope
|
| - .buildThrowCompileTimeErrorFromCode(
|
| - CompileTimeErrorCode.INITIALIZER_FOR_NON_EXISTENT_FIELD,
|
| - [parameter.name])));
|
| - } else {
|
| - initializer = new ast.FieldInitializer(
|
| - scope.getMemberReference(parameter.field),
|
| - new ast.VariableGet(scope.getVariableReference(parameter)));
|
| - }
|
| + var initializer = new ast.FieldInitializer(
|
| + scope.getMemberReference(parameter.field),
|
| + new ast.VariableGet(scope.getVariableReference(parameter)));
|
| constructor.initializers.add(initializer..parent = constructor);
|
| }
|
| }
|
|
|