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

Unified Diff: packages/yaml/lib/src/loader.dart

Issue 2989763002: Update charted to 0.4.8 and roll (Closed)
Patch Set: Removed Cutch from list of reviewers Created 3 years, 5 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
« no previous file with comments | « packages/yaml/lib/src/event.dart ('k') | packages/yaml/lib/src/null_span.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: packages/yaml/lib/src/loader.dart
diff --git a/packages/yaml/lib/src/loader.dart b/packages/yaml/lib/src/loader.dart
index 07ae43051f8d8825341ab5e7c257a047a5f5f19e..a2d681b928cbd871bad17daaa1eb040f0c2fbc99 100644
--- a/packages/yaml/lib/src/loader.dart
+++ b/packages/yaml/lib/src/loader.dart
@@ -2,8 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-library yaml.loader;
-
import 'package:charcode/ascii.dart';
import 'package:source_span/source_span.dart';
@@ -149,7 +147,7 @@ class Loader {
throw new YamlException("Invalid tag for mapping.", firstEvent.span);
}
- var children = deepEqualsMap();
+ var children = deepEqualsMap/*<dynamic, YamlNode>*/();
var node = new YamlMap.internal(
children, firstEvent.span, firstEvent.style);
_registerAnchor(firstEvent.anchor, node);
@@ -158,6 +156,10 @@ class Loader {
while (event.type != EventType.MAPPING_END) {
var key = _loadNode(event);
var value = _loadNode(_parser.parse());
+ if (children.containsKey(key)) {
+ throw new YamlException("Duplicate mapping key.", key.span);
+ }
+
children[key] = value;
event = _parser.parse();
}
« no previous file with comments | « packages/yaml/lib/src/event.dart ('k') | packages/yaml/lib/src/null_span.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698