fix(dart/transform): Use `var` instead of `bool` in generated files
If a source file hides `bool` (explicitly or implicitly via `show`), a generated file using `bool` may not resolve. Closes #1455
This commit is contained in:
parent
2827ca1559
commit
99fdb9ac41
|
@ -91,7 +91,7 @@ class CreateNgDepsVisitor extends Object with SimpleAstVisitor<Object> {
|
|||
|
||||
void _openFunctionWrapper() {
|
||||
_maybeWriteImport();
|
||||
writer.print('bool _visited = false;'
|
||||
writer.print('var _visited = false;'
|
||||
'void ${SETUP_METHOD_NAME}(${REFLECTOR_VAR_NAME}) {'
|
||||
'if (_visited) return; _visited = true;');
|
||||
}
|
||||
|
|
|
@ -3,7 +3,7 @@ library bar.ng_deps.dart;
|
|||
import 'bar.dart';
|
||||
import 'package:angular2/src/core/annotations/annotations.dart';
|
||||
|
||||
bool _visited = false;
|
||||
var _visited = false;
|
||||
void initReflector(reflector) {
|
||||
if (_visited) return;
|
||||
_visited = true;
|
||||
|
|
|
@ -3,7 +3,7 @@ library bar.ng_deps.dart;
|
|||
import 'bar.dart';
|
||||
import 'package:angular2/src/core/annotations/annotations.dart';
|
||||
|
||||
bool _visited = false;
|
||||
var _visited = false;
|
||||
void initReflector(reflector) {
|
||||
if (_visited) return;
|
||||
_visited = true;
|
||||
|
|
|
@ -3,7 +3,7 @@ library dinner.soup.ng_deps.dart;
|
|||
import 'package:angular2/src/core/annotations/annotations.dart';
|
||||
import 'soup.dart';
|
||||
|
||||
bool _visited = false;
|
||||
var _visited = false;
|
||||
void initReflector(reflector) {
|
||||
if (_visited) return;
|
||||
_visited = true;
|
||||
|
|
|
@ -3,7 +3,7 @@ library dinner.soup.ng_deps.dart;
|
|||
import 'package:angular2/src/core/annotations/annotations.dart';
|
||||
import 'soup.dart';
|
||||
|
||||
bool _visited = false;
|
||||
var _visited = false;
|
||||
void initReflector(reflector) {
|
||||
if (_visited) return;
|
||||
_visited = true;
|
||||
|
|
|
@ -4,7 +4,7 @@ import 'bar.dart';
|
|||
import 'package:angular2/src/core/annotations/annotations.dart';
|
||||
export 'foo.dart';
|
||||
|
||||
bool _visited = false;
|
||||
var _visited = false;
|
||||
void initReflector(reflector) {
|
||||
if (_visited) return;
|
||||
_visited = true;
|
||||
|
|
|
@ -5,7 +5,7 @@ import 'package:angular2/src/core/annotations/annotations.dart';
|
|||
export 'foo.dart';
|
||||
import 'foo.ng_deps.dart' as i0;
|
||||
|
||||
bool _visited = false;
|
||||
var _visited = false;
|
||||
void initReflector(reflector) {
|
||||
if (_visited) return;
|
||||
_visited = true;
|
||||
|
|
|
@ -3,7 +3,7 @@ library foo.ng_deps.dart;
|
|||
import 'foo.dart';
|
||||
import 'package:angular2/src/core/annotations/annotations.dart';
|
||||
|
||||
bool _visited = false;
|
||||
var _visited = false;
|
||||
void initReflector(reflector) {
|
||||
if (_visited) return;
|
||||
_visited = true;
|
||||
|
|
|
@ -5,7 +5,7 @@ import 'package:angular2/src/reflection/reflection_capabilities.dart';
|
|||
import 'bar.dart';
|
||||
import 'bar.ng_deps.dart' as i0;
|
||||
|
||||
bool _visited = false;
|
||||
var _visited = false;
|
||||
void initReflector(reflector) {
|
||||
if (_visited) return;
|
||||
_visited = true;
|
||||
|
|
|
@ -3,7 +3,7 @@ library foo.ng_deps.dart;
|
|||
import 'foo.dart';
|
||||
import 'package:angular2/src/core/annotations/annotations.dart';
|
||||
|
||||
bool _visited = false;
|
||||
var _visited = false;
|
||||
void initReflector(reflector) {
|
||||
if (_visited) return;
|
||||
_visited = true;
|
||||
|
|
|
@ -4,7 +4,7 @@ import 'package:angular2/src/core/application.dart';
|
|||
import 'package:angular2/src/reflection/reflection_capabilities.dart';
|
||||
import 'bar.dart';
|
||||
|
||||
bool _visited = false;
|
||||
var _visited = false;
|
||||
void initReflector(reflector) {
|
||||
if (_visited) return;
|
||||
_visited = true;
|
||||
|
|
|
@ -4,7 +4,7 @@ import 'bar.dart';
|
|||
import 'package:angular2/src/core/annotations/annotations.dart';
|
||||
import 'foo.dart' as dep;
|
||||
|
||||
bool _visited = false;
|
||||
var _visited = false;
|
||||
void initReflector(reflector) {
|
||||
if (_visited) return;
|
||||
_visited = true;
|
||||
|
|
|
@ -5,7 +5,7 @@ import 'package:angular2/src/core/annotations/annotations.dart';
|
|||
import 'foo.dart' as dep;
|
||||
import 'foo.ng_deps.dart' as i0;
|
||||
|
||||
bool _visited = false;
|
||||
var _visited = false;
|
||||
void initReflector(reflector) {
|
||||
if (_visited) return;
|
||||
_visited = true;
|
||||
|
|
|
@ -3,7 +3,7 @@ library foo.ng_deps.dart;
|
|||
import 'foo.dart';
|
||||
import 'package:angular2/src/core/annotations/annotations.dart';
|
||||
|
||||
bool _visited = false;
|
||||
var _visited = false;
|
||||
void initReflector(reflector) {
|
||||
if (_visited) return;
|
||||
_visited = true;
|
||||
|
|
|
@ -5,7 +5,7 @@ import 'package:angular2/src/reflection/reflection_capabilities.dart';
|
|||
import 'bar.dart';
|
||||
import 'bar.ng_deps.dart' as i0;
|
||||
|
||||
bool _visited = false;
|
||||
var _visited = false;
|
||||
void initReflector(reflector) {
|
||||
if (_visited) return;
|
||||
_visited = true;
|
||||
|
|
|
@ -3,7 +3,7 @@ library foo.ng_deps.dart;
|
|||
import 'foo.dart';
|
||||
import 'package:angular2/src/core/annotations/annotations.dart';
|
||||
|
||||
bool _visited = false;
|
||||
var _visited = false;
|
||||
void initReflector(reflector) {
|
||||
if (_visited) return;
|
||||
_visited = true;
|
||||
|
|
|
@ -4,7 +4,7 @@ import 'package:angular2/src/core/application.dart';
|
|||
import 'package:angular2/src/reflection/reflection_capabilities.dart';
|
||||
import 'bar.dart';
|
||||
|
||||
bool _visited = false;
|
||||
var _visited = false;
|
||||
void initReflector(reflector) {
|
||||
if (_visited) return;
|
||||
_visited = true;
|
||||
|
|
|
@ -4,7 +4,7 @@ import 'chicken_soup.dart';
|
|||
import 'package:angular2/di.dart' show Injectable;
|
||||
import 'package:angular2/src/facade/lang.dart' show CONST;
|
||||
|
||||
bool _visited = false;
|
||||
var _visited = false;
|
||||
void initReflector(reflector) {
|
||||
if (_visited) return;
|
||||
_visited = true;
|
||||
|
|
|
@ -4,7 +4,7 @@ import 'split_pea_soup.dart';
|
|||
import 'package:angular2/di.dart' show Injectable;
|
||||
import 'package:angular2/src/facade/lang.dart' show CONST;
|
||||
|
||||
bool _visited = false;
|
||||
var _visited = false;
|
||||
void initReflector(reflector) {
|
||||
if (_visited) return;
|
||||
_visited = true;
|
||||
|
|
|
@ -4,7 +4,7 @@ import 'tortilla_soup.dart';
|
|||
import 'package:angular2/di.dart' show Injectable;
|
||||
import 'package:angular2/src/facade/lang.dart' show CONST;
|
||||
|
||||
bool _visited = false;
|
||||
var _visited = false;
|
||||
void initReflector(reflector) {
|
||||
if (_visited) return;
|
||||
_visited = true;
|
||||
|
|
|
@ -3,7 +3,7 @@ library dinner.soup.ng_deps.dart;
|
|||
import 'soup.dart';
|
||||
import 'package:angular2/src/core/annotations/annotations.dart';
|
||||
|
||||
bool _visited = false;
|
||||
var _visited = false;
|
||||
void initReflector(reflector) {
|
||||
if (_visited) return;
|
||||
_visited = true;
|
||||
|
|
|
@ -6,7 +6,7 @@ import 'package:angular2/src/core/annotations/annotations.ng_deps.dart' as i0;
|
|||
import 'foo.dart';
|
||||
import 'foo.ng_deps.dart' as i1;
|
||||
|
||||
bool _visited = false;
|
||||
var _visited = false;
|
||||
void initReflector(reflector) {
|
||||
if (_visited) return;
|
||||
_visited = true;
|
||||
|
|
|
@ -4,7 +4,7 @@ import 'bar.dart';
|
|||
import 'package:angular2/src/core/annotations/annotations.dart';
|
||||
import 'package:angular2/src/core/annotations/annotations.ng_deps.dart' as i0;
|
||||
|
||||
bool _visited = false;
|
||||
var _visited = false;
|
||||
void initReflector(reflector) {
|
||||
if (_visited) return;
|
||||
_visited = true;
|
||||
|
|
|
@ -8,7 +8,7 @@ import 'index.ng_deps.dart' as ngStaticInit0;
|
|||
import 'bar.dart';
|
||||
import 'bar.ng_deps.dart' as i1;
|
||||
|
||||
bool _visited = false;
|
||||
var _visited = false;
|
||||
void initReflector(reflector) {
|
||||
if (_visited) return;
|
||||
_visited = true;
|
||||
|
|
|
@ -4,7 +4,7 @@ import 'bar.dart';
|
|||
import 'package:angular2/src/core/annotations/annotations.dart';
|
||||
import 'package:angular2/src/core/annotations/annotations.ng_deps.dart' as i0;
|
||||
|
||||
bool _visited = false;
|
||||
var _visited = false;
|
||||
void initReflector(reflector) {
|
||||
if (_visited) return;
|
||||
_visited = true;
|
||||
|
|
|
@ -6,7 +6,7 @@ import 'package:angular2/src/core/annotations/annotations.ng_deps.dart' as i0;
|
|||
import 'package:angular2/src/core/annotations/view.dart';
|
||||
import 'package:angular2/src/core/annotations/view.ng_deps.dart' as i1;
|
||||
|
||||
bool _visited = false;
|
||||
var _visited = false;
|
||||
void initReflector(reflector) {
|
||||
if (_visited) return;
|
||||
_visited = true;
|
||||
|
|
|
@ -6,7 +6,7 @@ import 'package:angular2/src/core/annotations/annotations.ng_deps.dart' as i0;
|
|||
import 'foo.dart' as prefix;
|
||||
import 'foo.ng_deps.dart' as i1;
|
||||
|
||||
bool _visited = false;
|
||||
var _visited = false;
|
||||
void initReflector(reflector) {
|
||||
if (_visited) return;
|
||||
_visited = true;
|
||||
|
|
|
@ -3,7 +3,7 @@ library examples.hello_world.index_common_dart.ng_deps.dart;
|
|||
import 'hello.dart';
|
||||
import 'package:angular2/angular2.dart';
|
||||
|
||||
bool _visited = false;
|
||||
var _visited = false;
|
||||
void initReflector(reflector) {
|
||||
if (_visited) return;
|
||||
_visited = true;
|
||||
|
|
|
@ -4,7 +4,7 @@ import 'hello.dart';
|
|||
import 'package:angular2/angular2.dart'
|
||||
show bootstrap, Component, Decorator, View, NgElement;
|
||||
|
||||
bool _visited = false;
|
||||
var _visited = false;
|
||||
void initReflector(reflector) {
|
||||
if (_visited) return;
|
||||
_visited = true;
|
||||
|
|
|
@ -4,7 +4,7 @@ import 'hello.dart';
|
|||
import 'package:angular2/angular2.dart'
|
||||
show bootstrap, Component, Decorator, View, NgElement;
|
||||
|
||||
bool _visited = false;
|
||||
var _visited = false;
|
||||
void initReflector(reflector) {
|
||||
if (_visited) return;
|
||||
_visited = true;
|
||||
|
|
|
@ -4,7 +4,7 @@ import 'hello.dart';
|
|||
import 'package:angular2/angular2.dart'
|
||||
show bootstrap, Component, Decorator, View, NgElement;
|
||||
|
||||
bool _visited = false;
|
||||
var _visited = false;
|
||||
void initReflector(reflector) {
|
||||
if (_visited) return;
|
||||
_visited = true;
|
||||
|
|
|
@ -4,7 +4,7 @@ import 'hello.dart';
|
|||
import 'package:angular2/angular2.dart'
|
||||
show bootstrap, Component, Decorator, View, NgElement;
|
||||
|
||||
bool _visited = false;
|
||||
var _visited = false;
|
||||
void initReflector(reflector) {
|
||||
if (_visited) return;
|
||||
_visited = true;
|
||||
|
|
|
@ -4,7 +4,7 @@ import 'hello.dart';
|
|||
import 'package:angular2/angular2.dart'
|
||||
show bootstrap, Component, Decorator, View, NgElement;
|
||||
|
||||
bool _visited = false;
|
||||
var _visited = false;
|
||||
void initReflector(reflector) {
|
||||
if (_visited) return;
|
||||
_visited = true;
|
||||
|
|
|
@ -4,7 +4,7 @@ import 'hello.dart';
|
|||
import 'package:angular2/angular2.dart'
|
||||
show bootstrap, Component, Decorator, View, NgElement;
|
||||
|
||||
bool _visited = false;
|
||||
var _visited = false;
|
||||
void initReflector(reflector) {
|
||||
if (_visited) return;
|
||||
_visited = true;
|
||||
|
|
|
@ -4,7 +4,7 @@ import 'hello.dart';
|
|||
import 'package:angular2/angular2.dart'
|
||||
show bootstrap, Component, Decorator, View, NgElement;
|
||||
|
||||
bool _visited = false;
|
||||
var _visited = false;
|
||||
void initReflector(reflector) {
|
||||
if (_visited) return;
|
||||
_visited = true;
|
||||
|
|
|
@ -4,7 +4,7 @@ import 'hello.dart';
|
|||
import 'package:angular2/angular2.dart'
|
||||
show bootstrap, Component, Decorator, View, NgElement;
|
||||
|
||||
bool _visited = false;
|
||||
var _visited = false;
|
||||
void initReflector(reflector) {
|
||||
if (_visited) return;
|
||||
_visited = true;
|
||||
|
|
|
@ -4,7 +4,7 @@ import 'hello.dart';
|
|||
import 'package:angular2/angular2.dart'
|
||||
show bootstrap, Component, Decorator, View, NgElement;
|
||||
|
||||
bool _visited = false;
|
||||
var _visited = false;
|
||||
void initReflector(reflector) {
|
||||
if (_visited) return;
|
||||
_visited = true;
|
||||
|
|
|
@ -4,7 +4,7 @@ import 'hello.dart';
|
|||
import 'package:angular2/angular2.dart'
|
||||
show bootstrap, Component, Decorator, View, NgElement;
|
||||
|
||||
bool _visited = false;
|
||||
var _visited = false;
|
||||
void initReflector(reflector) {
|
||||
if (_visited) return;
|
||||
_visited = true;
|
||||
|
|
|
@ -4,7 +4,7 @@ import 'hello.dart';
|
|||
import 'package:angular2/angular2.dart'
|
||||
show bootstrap, Component, Decorator, View, NgElement;
|
||||
|
||||
bool _visited = false;
|
||||
var _visited = false;
|
||||
void initReflector(reflector) {
|
||||
if (_visited) return;
|
||||
_visited = true;
|
||||
|
|
|
@ -4,7 +4,7 @@ import 'hello.dart';
|
|||
import 'package:angular2/angular2.dart'
|
||||
show bootstrap, Component, Decorator, View, NgElement;
|
||||
|
||||
bool _visited = false;
|
||||
var _visited = false;
|
||||
void initReflector(reflector) {
|
||||
if (_visited) return;
|
||||
_visited = true;
|
||||
|
|
Loading…
Reference in New Issue