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

Unified Diff: pkg/docgen/lib/src/mdn.dart

Issue 242363004: pkg/docgen: moved model classes into minilibs (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: cl nits Created 6 years, 8 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/docgen/lib/src/mdn.dart
diff --git a/pkg/docgen/lib/src/mdn.dart b/pkg/docgen/lib/src/mdn.dart
index 073dbdd34165a7101d2e42a394f02a49b98a23c4..f5fd69b59cb259b089ca48c02a70930363616aec 100644
--- a/pkg/docgen/lib/src/mdn.dart
+++ b/pkg/docgen/lib/src/mdn.dart
@@ -17,24 +17,24 @@ Map<String, dynamic> _mdn;
/// Generates MDN comments from database.json.
String mdnComment(String root, Logger logger, String domName) {
- //Check if MDN is loaded.
- if (_mdn == null) {
- // Reading in MDN related json file.
- var mdnPath = p.join(root, 'utils/apidoc/mdn/database.json');
- var mdnFile = new File(mdnPath);
- if (mdnFile.existsSync()) {
- _mdn = JSON.decode(mdnFile.readAsStringSync());
- } else {
- logger.warning("Cannot find MDN docs expected at $mdnPath");
- _mdn = {};
- }
- }
+ //Check if MDN is loaded.
+ if (_mdn == null) {
+ // Reading in MDN related json file.
+ var mdnPath = p.join(root, 'utils/apidoc/mdn/database.json');
+ var mdnFile = new File(mdnPath);
+ if (mdnFile.existsSync()) {
+ _mdn = JSON.decode(mdnFile.readAsStringSync());
+ } else {
+ logger.warning("Cannot find MDN docs expected at $mdnPath");
+ _mdn = {};
+ }
+ }
- var parts = domName.split('.');
- if (parts.length == 2) return _mdnMemberComment(parts[0], parts[1]);
- if (parts.length == 1) return _mdnTypeComment(parts[0]);
+ var parts = domName.split('.');
+ if (parts.length == 2) return _mdnMemberComment(parts[0], parts[1]);
+ if (parts.length == 1) return _mdnTypeComment(parts[0]);
- throw new StateError('More than two items is not supported: $parts');
+ throw new StateError('More than two items is not supported: $parts');
}
/// Generates the MDN Comment for variables and method DOM elements.

Powered by Google App Engine
This is Rietveld 408576698