From 89632f4d8e6460b64324ebda065f014308fce1b2 Mon Sep 17 00:00:00 2001 From: Hixie Date: Wed, 18 Feb 2015 15:00:18 -0800 Subject: [PATCH] Specs: add that we assume library.declarations to be in source order to the list of (currently unwarranted) assumptions we are making Review URL: https://codereview.chromium.org/935113002 --- specs/script.md | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/specs/script.md b/specs/script.md index 15c4dba252f..6bb5c28cc26 100644 --- a/specs/script.md +++ b/specs/script.md @@ -27,7 +27,7 @@ abstract class AutomaticMetadata { void init(DeclarationMirror target, Module module); static void runLibrary(LibraryMirror library, Module module) { - library.declarations.values.toList()..sort((DeclarationMirror a, DeclarationMirror b) { + library.declarations.values.toList() /* ..sort((DeclarationMirror a, DeclarationMirror b) { bool aHasLocation; try { aHasLocation = a.location != null; @@ -49,7 +49,7 @@ abstract class AutomaticMetadata { if (a.location.line != b.location.line) return a.location.line - b.location.line; return a.location.column - b.location.column; - }) + }) */ ..forEach((DeclarationMirror d) { d.metadata.forEach((InstanceMirror i) { if (i.reflectee is AutomaticMetadata) @@ -93,3 +93,6 @@ assumed to exist: ClassName = SuperclassName; ClassName.namedConstructor = SuperclassName.otherNamedConstructor; ``` + +* The reflection APIs (`dart:mirrors`) are assumed to reflect a + library's declarations in source order.