| 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();
|
| }
|
|
|