Skip to content

Commit 95c9eca

Browse files
author
Tim Blasi
committed
style(dart/transform): Change quote character for consistency.
Use ' as a quote character in generated output instead of ".
1 parent 3025359 commit 95c9eca

File tree

15 files changed

+41
-43
lines changed

15 files changed

+41
-43
lines changed

modules/angular2/src/transform/bind_generator/generator.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ class _ExtractSettersVisitor extends Object
7171
// TODO(kegluneq): Remove this restriction
7272
if (entry.key is SimpleStringLiteral) {
7373
var propName = entry.key.value;
74-
bindPieces.add('"${propName}": ('
74+
bindPieces.add('\'${propName}\': ('
7575
'${currentName} o, String value) => o.${propName} = value');
7676
} else {
7777
logger.error('`bind` currently only supports string literals');

modules/angular2/src/transform/directive_processor/rewriter.dart

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -150,19 +150,19 @@ class CreateNgDepsVisitor extends Object
150150
}
151151
writer.print('..registerType(');
152152
visitNode(node.name);
153-
writer.print(', {"factory": ');
153+
writer.print(', {\'factory\': ');
154154
if (ctor == null) {
155155
_generateEmptyFactory(node.name.toString());
156156
} else {
157157
ctor.accept(_factoryVisitor);
158158
}
159-
writer.print(', "parameters": ');
159+
writer.print(', \'parameters\': ');
160160
if (ctor == null) {
161161
_generateEmptyParams();
162162
} else {
163163
ctor.accept(_paramsVisitor);
164164
}
165-
writer.print(', "annotations": ');
165+
writer.print(', \'annotations\': ');
166166
node.accept(_metaVisitor);
167167
writer.print('})');
168168

modules/angular2/test/transform/directive_processor/all_tests.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import '../common/read_file.dart';
1515
var formatter = new DartFormatter();
1616

1717
void allTests() {
18-
test('should preserve parameter annotations as const instances', () {
18+
test('should preserve parameter annotations as const instances.', () {
1919
var inputPath = 'parameter_metadata/soup.dart';
2020
var expected = _readFile('parameter_metadata/expected/soup.ngDeps.dart');
2121
var output =

modules/angular2/test/transform/directive_processor/parameter_metadata/expected/soup.ngDeps.dart

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ void setupReflection(reflector) {
99
_visited = true;
1010
reflector
1111
..registerType(SoupComponent, {
12-
"factory":
12+
'factory':
1313
(String description, salt) => new SoupComponent(description, salt),
14-
"parameters": const [const [Tasty, String], const [const Inject(Salt)]],
15-
"annotations": const [const Component(selector: '[soup]')]
14+
'parameters': const [const [Tasty, String], const [const Inject(Salt)]],
15+
'annotations': const [const Component(selector: '[soup]')]
1616
});
1717
} // {"version":1,"importOffset":104,"registerOffset":451,"imports":["package:angular2/src/core/annotations/annotations.dart"]}

modules/angular2/test/transform/integration/basic_bind_files/expected/bar.ngDeps.dart

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,19 +9,19 @@ void setupReflection(reflector) {
99
_visited = true;
1010
reflector
1111
..registerType(MyComponent, {
12-
"factory": () => new MyComponent(),
13-
"parameters": const [],
14-
"annotations": const [
12+
'factory': () => new MyComponent(),
13+
'parameters': const [],
14+
'annotations': const [
1515
const Component(selector: 'soup', services: const [ToolTip])
1616
]
1717
})
1818
..registerType(ToolTip, {
19-
"factory": () => new ToolTip(),
20-
"parameters": const [],
21-
"annotations": const [
19+
'factory': () => new ToolTip(),
20+
'parameters': const [],
21+
'annotations': const [
2222
const Decorator(
2323
selector: '[tool-tip]', bind: const {'text': 'tool-tip'})
2424
]
2525
})
26-
..registerSetters({"text": (ToolTip o, String value) => o.text = value});
26+
..registerSetters({'text': (ToolTip o, String value) => o.text = value});
2727
}

modules/angular2/test/transform/integration/chained_deps_files/bar.dart

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@ library bar;
33
import 'package:angular2/src/core/annotations/annotations.dart';
44
import 'foo.dart' as dep;
55

6-
@Component(
7-
selector: '[soup]', services: const [dep.DependencyComponent])
6+
@Component(selector: '[soup]', services: const [dep.DependencyComponent])
87
class MyComponent {
98
MyComponent();
109
}

modules/angular2/test/transform/integration/chained_deps_files/expected/bar.ngDeps.dart

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,11 @@ void setupReflection(reflector) {
1111
_visited = true;
1212
reflector
1313
..registerType(MyComponent, {
14-
"factory": () => new MyComponent(),
15-
"parameters": const [],
16-
"annotations": const [
14+
'factory': () => new MyComponent(),
15+
'parameters': const [],
16+
'annotations': const [
1717
const Component(
18-
selector: '[soup]',
19-
services: const [dep.DependencyComponent])
18+
selector: '[soup]', services: const [dep.DependencyComponent])
2019
]
2120
});
2221
i0.setupReflection(reflector);

modules/angular2/test/transform/integration/chained_deps_files/expected/foo.ngDeps.dart

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ void setupReflection(reflector) {
99
_visited = true;
1010
reflector
1111
..registerType(DependencyComponent, {
12-
"factory": () => new DependencyComponent(),
13-
"parameters": const [],
14-
"annotations": const [const Component(selector: '[salad]')]
12+
'factory': () => new DependencyComponent(),
13+
'parameters': const [],
14+
'annotations': const [const Component(selector: '[salad]')]
1515
});
1616
}

modules/angular2/test/transform/integration/list_of_types_files/bar.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ library bar;
33
import 'package:angular2/src/core/annotations/annotations.dart';
44
import 'foo.dart';
55

6-
@Component(services: const [MyContext])
6+
@Component(componentServices: const [MyContext])
77
class MyComponent {
88
final MyContext c;
99
MyComponent(this.c);

modules/angular2/test/transform/integration/list_of_types_files/expected/bar.ngDeps.dart

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ void setupReflection(reflector) {
1010
_visited = true;
1111
reflector
1212
..registerType(MyComponent, {
13-
"factory": (MyContext c) => new MyComponent(c),
14-
"parameters": const [const [MyContext]],
15-
"annotations": const [
16-
const Component(services: const [MyContext])
13+
'factory': (MyContext c) => new MyComponent(c),
14+
'parameters': const [const [MyContext]],
15+
'annotations': const [
16+
const Component(componentServices: const [MyContext])
1717
]
1818
});
1919
}

0 commit comments

Comments
 (0)