@@ -31,8 +31,8 @@ import 'package:dev_compiler/src/utils.dart';
31
31
32
32
import 'code_generator.dart' ;
33
33
import 'js_field_storage.dart' ;
34
- import 'js_names.dart' show JSTemporary, invalidJSStaticMethodName ;
35
- import 'js_metalet.dart' ;
34
+ import 'js_names.dart' as JS ;
35
+ import 'js_metalet.dart' as JS ;
36
36
import 'js_printer.dart' show writeJsLibrary;
37
37
import 'side_effect_analysis.dart' ;
38
38
@@ -71,17 +71,17 @@ class JSCodegenVisitor extends GeneralizingAstVisitor with ConversionVisitor {
71
71
final _exports = new Set <String >();
72
72
final _lazyFields = < VariableDeclaration > [];
73
73
final _properties = < FunctionDeclaration > [];
74
- final _privateNames = new HashMap <String , JSTemporary >();
74
+ final _privateNames = new HashMap <String , JS . TemporaryId >();
75
75
final _extensionMethodNames = new HashSet <String >();
76
76
final _pendingStatements = < JS .Statement > [];
77
- final _temps = new HashMap <Element , JSTemporary >();
77
+ final _temps = new HashMap <Element , JS . TemporaryId >();
78
78
79
79
/// The name for the library's exports inside itself.
80
80
/// This much be a constant because we interpolate it into template strings,
81
81
/// and otherwise it would break caching for them.
82
82
/// `exports` was chosen as the most similar to ES module patterns.
83
- final JSTemporary _exportsVar = new JSTemporary ('exports' );
84
- final JSTemporary _namedArgTemp = new JSTemporary ('opts' );
83
+ final _exportsVar = new JS . TemporaryId ('exports' );
84
+ final _namedArgTemp = new JS . TemporaryId ('opts' );
85
85
86
86
/// Classes we have not emitted yet. Values can be [ClassDeclaration] or
87
87
/// [ClassTypeAlias] .
@@ -1097,8 +1097,8 @@ class JSCodegenVisitor extends GeneralizingAstVisitor with ConversionVisitor {
1097
1097
return new JS .Identifier (name);
1098
1098
}
1099
1099
1100
- JSTemporary _getTemp (Object key, String name) =>
1101
- _temps.putIfAbsent (key, () => new JSTemporary (name));
1100
+ JS . TemporaryId _getTemp (Object key, String name) =>
1101
+ _temps.putIfAbsent (key, () => new JS . TemporaryId (name));
1102
1102
1103
1103
JS .ArrayInitializer _emitTypeNames (List <DartType > types) {
1104
1104
return new JS .ArrayInitializer (types.map (_emitTypeName).toList ());
@@ -1197,7 +1197,7 @@ class JSCodegenVisitor extends GeneralizingAstVisitor with ConversionVisitor {
1197
1197
context: node);
1198
1198
}
1199
1199
1200
- JSMetaLet _emitOpAssign (
1200
+ JS . MetaLet _emitOpAssign (
1201
1201
Expression left, Expression right, String op, ExecutableElement element,
1202
1202
{Expression context}) {
1203
1203
// Desugar `x += y` as `x = x + y`, ensuring that if `x` has subexpressions
@@ -1207,7 +1207,7 @@ class JSCodegenVisitor extends GeneralizingAstVisitor with ConversionVisitor {
1207
1207
var inc = AstBuilder .binaryExpression (lhs, op, right);
1208
1208
inc.staticElement = element;
1209
1209
inc.staticType = getStaticType (left);
1210
- return new JSMetaLet (vars, [_emitSet (lhs, inc)]);
1210
+ return new JS . MetaLet (vars, [_emitSet (lhs, inc)]);
1211
1211
}
1212
1212
1213
1213
JS .Expression _emitSet (Expression lhs, Expression rhs) {
@@ -1778,7 +1778,7 @@ class JSCodegenVisitor extends GeneralizingAstVisitor with ConversionVisitor {
1778
1778
/// // psuedocode mix of Scheme and JS:
1779
1779
/// (let* (x1=expr1, x2=expr2, t=expr1[expr2]) { x1[x2] = t + 1; t })
1780
1780
///
1781
- /// The [JSMetaLet ] nodes automatically simplify themselves if they can.
1781
+ /// The [JS.JS.MetaLet ] nodes automatically simplify themselves if they can.
1782
1782
/// For example, if the result value is not used, then `t` goes away.
1783
1783
@override
1784
1784
JS .Expression visitPostfixExpression (PostfixExpression node) {
@@ -1809,7 +1809,7 @@ class JSCodegenVisitor extends GeneralizingAstVisitor with ConversionVisitor {
1809
1809
..staticType = getStaticType (expr);
1810
1810
1811
1811
var body = [_emitSet (left, increment), _visit (x)];
1812
- return new JSMetaLet (vars, body, statelessResult: true );
1812
+ return new JS . MetaLet (vars, body, statelessResult: true );
1813
1813
}
1814
1814
1815
1815
@override
@@ -1827,7 +1827,7 @@ class JSCodegenVisitor extends GeneralizingAstVisitor with ConversionVisitor {
1827
1827
var vars = {};
1828
1828
var x = _bindLeftHandSide (vars, expr, context: expr);
1829
1829
var body = js.call ('# = # $mathop 1' , [_visit (x), notNull (x)]);
1830
- return new JSMetaLet (vars, [body]);
1830
+ return new JS . MetaLet (vars, [body]);
1831
1831
} else {
1832
1832
return js.call ('$op #' , notNull (expr));
1833
1833
}
@@ -1856,7 +1856,7 @@ class JSCodegenVisitor extends GeneralizingAstVisitor with ConversionVisitor {
1856
1856
_cascadeTarget = _bindValue (vars, '_' , node.target, context: node);
1857
1857
var sections = _visitList (node.cascadeSections);
1858
1858
sections.add (_visit (_cascadeTarget));
1859
- var result = new JSMetaLet (vars, sections, statelessResult: true );
1859
+ var result = new JS . MetaLet (vars, sections, statelessResult: true );
1860
1860
_cascadeTarget = savedCascadeTemp;
1861
1861
return result;
1862
1862
}
@@ -2360,7 +2360,7 @@ class JSCodegenVisitor extends GeneralizingAstVisitor with ConversionVisitor {
2360
2360
{DartType type, bool unary: false , bool isStatic: false }) {
2361
2361
if (name.startsWith ('_' )) {
2362
2362
return _privateNames.putIfAbsent (
2363
- name, () => _initSymbol (new JSTemporary (name)));
2363
+ name, () => _initSymbol (new JS . TemporaryId (name)));
2364
2364
}
2365
2365
2366
2366
// Check for extension method:
@@ -2374,7 +2374,7 @@ class JSCodegenVisitor extends GeneralizingAstVisitor with ConversionVisitor {
2374
2374
name = 'unary-' ;
2375
2375
}
2376
2376
2377
- if (isStatic && invalidJSStaticMethodName (name)) {
2377
+ if (isStatic && JS . invalidStaticMethodName (name)) {
2378
2378
// Choose an string name. Use an invalid identifier so it won't conflict
2379
2379
// with any valid member names.
2380
2380
// TODO(jmesserly): this works around the problem, but I'm pretty sure we
0 commit comments