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

Unified Diff: third_party/pkg/angular/test/filter/filter_spec.dart

Issue 180843004: Revert revision 33053 (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 10 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: third_party/pkg/angular/test/filter/filter_spec.dart
===================================================================
--- third_party/pkg/angular/test/filter/filter_spec.dart (revision 33054)
+++ third_party/pkg/angular/test/filter/filter_spec.dart (working copy)
@@ -1,28 +1,27 @@
library filter_spec;
+import 'dart:mirrors';
+import 'dart:collection';
import '../_specs.dart';
// Helper to simulate some real objects. Purposefully doesn't implement Map.
class DynamicObject {
- final Map<Symbol, dynamic> _map = {};
- DynamicObject([Map init]) {
- init.forEach((key, value) => _map[new Symbol(key)] = value);
- }
- toString() => "$_map";
+ Map<String, dynamic> __map__;
+ DynamicObject([Map init]): __map__ = (init == null) ? {} : init;
+ toString() => Maps.mapToString(__map__);
operator ==(DynamicObject other) {
- return (_map.length == other._map.length &&
- _map.keys.toSet().difference(other._map.keys.toSet()).length == 0 &&
- _map.keys.every((key) => _map[key] == other._map[key]));
+ return (__map__.length == other.__map__.length &&
+ __map__.keys.toSet().difference(other.__map__.keys.toSet()).length == 0 &&
+ __map__.keys.every((key) => __map__[key] == other.__map__[key]));
}
- int get hashCode => 0;
noSuchMethod(Invocation invocation) {
- Symbol name = invocation.memberName;
+ String name = MirrorSystem.getName(invocation.memberName);
if (invocation.isGetter) {
- return _map[name];
+ return __map__[name];
} else if (invocation.isSetter) {
- return _map[name] = invocation.positionalArguments[0];
+ return __map__[name.substring(0, name.length - 1)] = invocation.positionalArguments[0];
} else if (invocation.isMethod) {
- return Function.apply(_map[name],
+ return (reflect(__map__[name]) as ClosureMirror).apply(
invocation.positionalArguments, invocation.namedArguments);
} else {
throw "DynamicObject: Unexpected invocation.";
« no previous file with comments | « third_party/pkg/angular/test/filter/date_spec.dart ('k') | third_party/pkg/angular/test/filter/json_spec.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698