Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(229)

Unified Diff: pkg/dartdoc/lib/src/mirrors/dart2js_mirror.dart

Issue 11339056: Cleanup run on DartDoc from Dart Editor. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: pkg/dartdoc/lib/src/mirrors/dart2js_mirror.dart
diff --git a/pkg/dartdoc/lib/src/mirrors/dart2js_mirror.dart b/pkg/dartdoc/lib/src/mirrors/dart2js_mirror.dart
index 146d5e03e3ded8b18c8abf8e5d62c5e3468599e9..96254684d6d8876f80ab9fbffbc0a17e70fc2b0d 100644
--- a/pkg/dartdoc/lib/src/mirrors/dart2js_mirror.dart
+++ b/pkg/dartdoc/lib/src/mirrors/dart2js_mirror.dart
@@ -59,10 +59,10 @@ Dart2JsTypeMirror _convertTypeToTypeMirror(
DartType type,
InterfaceType defaultType,
[FunctionSignature functionSignature]) {
- if (type === null) {
+ if (type == null) {
return new Dart2JsInterfaceTypeMirror(system, defaultType);
} else if (type is InterfaceType) {
- if (type === system.compiler.types.dynamicType) {
+ if (type == system.compiler.types.dynamicType) {
return new Dart2JsDynamicMirror(system, type);
} else {
return new Dart2JsInterfaceTypeMirror(system, type);
@@ -89,10 +89,10 @@ Collection<Dart2JsMemberMirror> _convertElementMemberToMemberMirrors(
return <Dart2JsMemberMirror>[new Dart2JsMethodMirror(library, element)];
} else if (element is AbstractFieldElement) {
var members = <Dart2JsMemberMirror>[];
- if (element.getter !== null) {
+ if (element.getter != null) {
members.add(new Dart2JsMethodMirror(library, element.getter));
}
- if (element.setter !== null) {
+ if (element.setter != null) {
members.add(new Dart2JsMethodMirror(library, element.setter));
}
return members;
@@ -151,7 +151,7 @@ String _getOperatorFromOperatorName(String name) {
'or': '|',
};
String newName = mapping[name];
- if (newName === null) {
+ if (newName == null) {
throw new Exception('Unhandled operator name: $name');
}
return newName;
@@ -317,9 +317,9 @@ class Dart2JsCompilation implements Compilation {
String message, diagnostics.Diagnostic kind) {
if (isAborting) return;
bool fatal =
- kind === diagnostics.Diagnostic.CRASH ||
- kind === diagnostics.Diagnostic.ERROR;
- if (uri === null) {
+ kind == diagnostics.Diagnostic.CRASH ||
+ kind == diagnostics.Diagnostic.ERROR;
+ if (uri == null) {
if (!fatal) {
return;
}
@@ -337,7 +337,7 @@ class Dart2JsCompilation implements Compilation {
: cwd = getCurrentDirectory(), sourceFiles = <String, SourceFile>{} {
var libraryUri = cwd.resolve(libraryRoot.toString());
var packageUri;
- if (packageRoot !== null) {
+ if (packageRoot != null) {
packageUri = cwd.resolve(packageRoot.toString());
} else {
packageUri = libraryUri;
@@ -354,7 +354,7 @@ class Dart2JsCompilation implements Compilation {
: cwd = getCurrentDirectory(), sourceFiles = <String, SourceFile>{} {
var libraryUri = cwd.resolve(libraryRoot.toString());
var packageUri;
- if (packageRoot !== null) {
+ if (packageRoot != null) {
packageUri = cwd.resolve(packageRoot.toString());
} else {
packageUri = libraryUri;
@@ -407,8 +407,8 @@ abstract class Dart2JsElementMirror extends Dart2JsDeclarationMirror {
final Element _element;
Dart2JsElementMirror(this.system, this._element) {
- assert (system !== null);
- assert (_element !== null);
+ assert (system != null);
+ assert (_element != null);
}
String get simpleName => _element.name.slowToString();
@@ -506,10 +506,10 @@ class Dart2JsLibraryMirror extends Dart2JsObjectMirror
* provide a 'library name' for scripts, to use for instance in dartdoc.
*/
String get simpleName {
- if (_library.libraryTag !== null) {
+ if (_library.libraryTag != null) {
// TODO(ahe): Remove StringNode check when old syntax is removed.
StringNode name = _library.libraryTag.name.asStringNode();
- if (name !== null) {
+ if (name != null) {
return name.dartString.slowToString();
} else {
return _library.libraryTag.name.toString();
@@ -665,7 +665,7 @@ class Dart2JsParameterMirror extends Dart2JsElementMirror
return null;
}
bool get hasDefaultValue {
- return _variableElement.cachedNode !== null &&
+ return _variableElement.cachedNode != null &&
_variableElement.cachedNode is SendSet;
}
@@ -685,7 +685,7 @@ class Dart2JsFieldParameterMirror extends Dart2JsParameterMirror {
FieldParameterElement get _fieldParameterElement => _element;
TypeMirror get type {
- if (_fieldParameterElement.variables.cachedNode.type !== null) {
+ if (_fieldParameterElement.variables.cachedNode.type != null) {
return super.type;
}
return _convertTypeToTypeMirror(system,
@@ -727,7 +727,7 @@ class Dart2JsClassMirror extends Dart2JsObjectMirror
SourceLocation get location {
if (_class is PartialClassElement) {
var node = _class.parseNode(system.compiler);
- if (node !== null) {
+ if (node != null) {
var script = _class.getCompilationUnit().script;
var span = system.compiler.spanFromNode(node, script.uri);
return new Dart2JsLocation(script, span);
@@ -848,7 +848,7 @@ class Dart2JsClassMirror extends Dart2JsObjectMirror
}
bool operator ==(Object other) {
- if (this === other) {
+ if (identical(this, other)) {
return true;
}
if (other is! ClassMirror) {
@@ -857,7 +857,7 @@ class Dart2JsClassMirror extends Dart2JsObjectMirror
if (library != other.library) {
return false;
}
- if (isOriginalDeclaration !== other.isOriginalDeclaration) {
+ if (!identical(isOriginalDeclaration, other.isOriginalDeclaration)) {
return false;
}
return qualifiedName == other.qualifiedName;
@@ -885,7 +885,7 @@ class Dart2JsTypedefMirror extends Dart2JsTypeElementMirror
SourceLocation get location {
var node = _typedef.element.parseNode(_diagnosticListener);
- if (node !== null) {
+ if (node != null) {
var script = _typedef.element.getCompilationUnit().script;
var span = system.compiler.spanFromNode(node, script.uri);
return new Dart2JsLocation(script, span);
@@ -914,7 +914,7 @@ class Dart2JsTypedefMirror extends Dart2JsTypeElementMirror
}
TypeMirror get definition {
- if (_definition === null) {
+ if (_definition == null) {
// TODO(johnniwinther): Should be [ensureResolved].
system.compiler.resolveTypedef(_typedef.element);
_definition = _convertTypeToTypeMirror(
@@ -951,14 +951,14 @@ class Dart2JsTypeVariableMirror extends Dart2JsTypeElementMirror
TypeVariableType typeVariableType)
: this._typeVariableType = typeVariableType,
super(system, typeVariableType) {
- assert(_typeVariableType !== null);
+ assert(_typeVariableType != null);
}
String get qualifiedName => '${declarer.qualifiedName}.${simpleName}';
ClassMirror get declarer {
- if (_declarer === null) {
+ if (_declarer == null) {
if (_typeVariableType.element.enclosingElement.isClass()) {
_declarer = new Dart2JsClassMirror(system,
_typeVariableType.element.enclosingElement);
@@ -981,7 +981,7 @@ class Dart2JsTypeVariableMirror extends Dart2JsTypeElementMirror
system.compiler.objectClass.computeType(system.compiler));
bool operator ==(Object other) {
- if (this === other) {
+ if (identical(this, other)) {
return true;
}
if (other is! TypeVariableMirror) {
@@ -1125,7 +1125,7 @@ class Dart2JsInterfaceTypeMirror extends Dart2JsTypeElementMirror
ClassMirror get defaultFactory => originalDeclaration.defaultFactory;
bool operator ==(Object other) {
- if (this === other) {
+ if (identical(this, other)) {
return true;
}
if (other is! ClassMirror) {
@@ -1157,7 +1157,7 @@ class Dart2JsFunctionTypeMirror extends Dart2JsTypeElementMirror
Dart2JsFunctionTypeMirror(Dart2JsMirrorSystem system,
FunctionType functionType, this._functionSignature)
: super(system, functionType) {
- assert (_functionSignature !== null);
+ assert (_functionSignature != null);
}
FunctionType get _functionType => _type;
@@ -1168,7 +1168,7 @@ class Dart2JsFunctionTypeMirror extends Dart2JsTypeElementMirror
// TODO(johnniwinther): Substitute type arguments for type variables.
Map<String, MemberMirror> get declaredMembers {
var method = callMethod;
- if (method !== null) {
+ if (method != null) {
var map = new Map<String, MemberMirror>.from(
originalDeclaration.declaredMembers);
var name = method.qualifiedName;
@@ -1215,7 +1215,7 @@ class Dart2JsFunctionTypeMirror extends Dart2JsTypeElementMirror
}
List<ParameterMirror> get parameters {
- if (_parameters === null) {
+ if (_parameters == null) {
_parameters = _parametersFromFunctionSignature(system, callMethod,
_functionSignature);
}
@@ -1245,7 +1245,7 @@ class Dart2JsVoidMirror extends Dart2JsTypeElementMirror {
bool get isVoid => true;
bool operator ==(Object other) {
- if (this === other) {
+ if (identical(this, other)) {
return true;
}
if (other is! TypeMirror) {
@@ -1277,7 +1277,7 @@ class Dart2JsDynamicMirror extends Dart2JsTypeElementMirror {
bool get isDynamic => true;
bool operator ==(Object other) {
- if (this === other) {
+ if (identical(this, other)) {
return true;
}
if (other is! TypeMirror) {
@@ -1414,7 +1414,7 @@ class Dart2JsMethodMirror extends Dart2JsElementMirror
SourceLocation get location {
var node = _function.parseNode(_diagnosticListener);
- if (node !== null) {
+ if (node != null) {
var script = _function.getCompilationUnit().script;
var span = system.compiler.spanFromNode(node, script.uri);
return new Dart2JsLocation(script, span);
@@ -1461,7 +1461,7 @@ class Dart2JsFieldMirror extends Dart2JsElementMirror
SourceLocation get location {
var script = _variable.getCompilationUnit().script;
var node = _variable.variables.parseNode(_diagnosticListener);
- if (node !== null) {
+ if (node != null) {
var span = system.compiler.spanFromNode(node, script.uri);
return new Dart2JsLocation(script, span);
} else {

Powered by Google App Engine
This is Rietveld 408576698