Index: pkg/dev_compiler/lib/src/compiler/code_generator.dart |
diff --git a/pkg/dev_compiler/lib/src/compiler/code_generator.dart b/pkg/dev_compiler/lib/src/compiler/code_generator.dart |
index 4b39975c66c49fe9309fcda37f04b2db61b0f018..e622041f0cfb706bbedff7101b4c3c67295f347b 100644 |
--- a/pkg/dev_compiler/lib/src/compiler/code_generator.dart |
+++ b/pkg/dev_compiler/lib/src/compiler/code_generator.dart |
@@ -8,6 +8,7 @@ import 'dart:math' show min, max; |
import 'package:analyzer/analyzer.dart' hide ConstantEvaluator; |
import 'package:analyzer/dart/ast/ast.dart'; |
+import 'package:analyzer/dart/ast/standard_ast_factory.dart'; |
import 'package:analyzer/dart/ast/token.dart' show Token, TokenType; |
import 'package:analyzer/dart/element/element.dart'; |
import 'package:analyzer/dart/element/type.dart'; |
@@ -1314,7 +1315,7 @@ class CodeGenerator extends GeneralizingAstVisitor |
jsMethods.add(new JS.Method( |
_propertyName('constructor'), |
js.call('function(...args) { return this.new.apply(this, args); }') |
- as JS.Fun)); |
+ as JS.Fun)); |
} else if (ctors.isEmpty) { |
jsMethods.add(_emitImplicitConstructor(node, fields, virtualFields)); |
} |
@@ -3967,7 +3968,7 @@ class CodeGenerator extends GeneralizingAstVisitor |
new JS.Method( |
access, |
js.call('function() { return #; }', _visitInitializer(node)) |
- as JS.Fun, |
+ as JS.Fun, |
isGetter: true), |
node, |
_findAccessor(element, getter: true))); |
@@ -4453,8 +4454,8 @@ class CodeGenerator extends GeneralizingAstVisitor |
// LocalVariableElementImpl, so we could repurpose to mean "temp". |
// * add a new property to LocalVariableElementImpl. |
// * create a new subtype of LocalVariableElementImpl to mark a temp. |
- var id = |
- new SimpleIdentifier(new StringToken(TokenType.IDENTIFIER, name, -1)); |
+ var id = astFactory |
+ .simpleIdentifier(new StringToken(TokenType.IDENTIFIER, name, -1)); |
variable ??= new JS.TemporaryId(name); |
@@ -4509,14 +4510,14 @@ class CodeGenerator extends GeneralizingAstVisitor |
Expression result; |
if (expr is IndexExpression) { |
IndexExpression index = expr; |
- result = new IndexExpression.forTarget( |
+ result = astFactory.indexExpressionForTarget( |
_bindValue(scope, 'o', index.target, context: context), |
index.leftBracket, |
_bindValue(scope, 'i', index.index, context: context), |
index.rightBracket); |
} else if (expr is PropertyAccess) { |
PropertyAccess prop = expr; |
- result = new PropertyAccess( |
+ result = astFactory.propertyAccess( |
_bindValue(scope, 'o', _getTarget(prop), context: context), |
prop.operator, |
prop.propertyName); |
@@ -4525,9 +4526,9 @@ class CodeGenerator extends GeneralizingAstVisitor |
if (isLibraryPrefix(ident.prefix)) { |
return expr; |
} |
- result = new PrefixedIdentifier( |
+ result = astFactory.prefixedIdentifier( |
_bindValue(scope, 'o', ident.prefix, context: context) |
- as SimpleIdentifier, |
+ as SimpleIdentifier, |
ident.period, |
ident.identifier); |
} else { |