Skip to content

Commit 9280e26

Browse files
committed
spelling fixes
1 parent 04d8f7b commit 9280e26

File tree

3 files changed

+14
-12
lines changed

3 files changed

+14
-12
lines changed

lib/generators/json_serializable.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ class JsonSerializable {
1818

1919
/// Customizes the name of the JSON key for a field.
2020
///
21-
/// If ommitted, the resulting JSON key will be the
21+
/// If omitted, the resulting JSON key will be the
2222
/// name of the field defined on the class.
2323
class JsonKey {
2424
final String jsonName;

lib/src/annotation.dart

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,8 @@ dynamic instantiateAnnotation(ElementAnnotation annotation) {
4343
return _createFromConstructor(element, annotationObject);
4444
}
4545

46-
var valueDeclaration = _getDeclMirrorFromType(annotation.constantValue.type);
46+
var valueDeclaration =
47+
_getDeclarationMirrorFromType(annotation.constantValue.type);
4748

4849
throw "No clue how to create $valueDeclaration of type ${valueDeclaration.runtimeType}";
4950
}
@@ -77,7 +78,8 @@ dynamic _getValue(DartObject object, TypeProvider typeProvider) {
7778
var typeData = object.toTypeValue();
7879

7980
if (typeData is InterfaceType) {
80-
var declarationMirror = _getDeclMirrorFromType(typeData) as ClassMirror;
81+
var declarationMirror =
82+
_getDeclarationMirrorFromType(typeData) as ClassMirror;
8183

8284
return declarationMirror.reflectedType;
8385
}
@@ -134,11 +136,11 @@ final _cannotCreate = new Object();
134136

135137
dynamic _createFromConstructor(
136138
ConstructorElementImpl ctor, DartObjectImpl obj) {
137-
var ctorDecl = ctor.computeNode();
139+
var ctorDeclaration = ctor.computeNode();
138140

139141
var positionalArgs = [];
140142
var namedArgs = <Symbol, dynamic>{};
141-
for (var p in ctorDecl.parameters.parameterElements) {
143+
for (var p in ctorDeclaration.parameters.parameterElements) {
142144
var paramName = p.name;
143145
String fieldName;
144146
if (p is FieldFormalParameterElement) {
@@ -177,22 +179,22 @@ dynamic _createFromConstructor(
177179
}
178180

179181
Symbol ctorName;
180-
if (ctorDecl.name == null) {
182+
if (ctorDeclaration.name == null) {
181183
ctorName = const Symbol('');
182184
} else {
183-
ctorName = new Symbol(ctorDecl.name.name);
185+
ctorName = new Symbol(ctorDeclaration.name.name);
184186
}
185187

186-
var declMirror =
187-
_getDeclMirrorFromType(ctor.enclosingElement.type) as ClassMirror;
188+
var declarationMirror =
189+
_getDeclarationMirrorFromType(ctor.enclosingElement.type) as ClassMirror;
188190

189191
// figure out which ctor was used!
190192
var instanceMirror =
191-
declMirror.newInstance(ctorName, positionalArgs, namedArgs);
193+
declarationMirror.newInstance(ctorName, positionalArgs, namedArgs);
192194
return instanceMirror.reflectee;
193195
}
194196

195-
DeclarationMirror _getDeclMirrorFromType(InterfaceType type) {
197+
DeclarationMirror _getDeclarationMirrorFromType(InterfaceType type) {
196198
var system = currentMirrorSystem();
197199

198200
// find library

pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: source_gen
2-
version: 0.5.0+3
2+
version: 0.5.1-dev
33
author: Dart Team <[email protected]>
44
description: Automatic sourcecode generation for Dart
55
homepage: https://github.com/dart-lang/source_gen

0 commit comments

Comments
 (0)