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

Unified Diff: third_party/pkg/angular/lib/core/parser/eval.dart

Issue 176943008: Update the Angular/DI tests to latest from github. (Closed) Base URL: https://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/lib/core/parser/eval.dart
diff --git a/third_party/pkg/angular/lib/core/parser/eval.dart b/third_party/pkg/angular/lib/core/parser/eval.dart
index 0bd1fe2b366a196ab6c896864c3b013f5d4e32fe..aa0e1aef7ebe5c1a85bb16930dba01f0f573c830 100644
--- a/third_party/pkg/angular/lib/core/parser/eval.dart
+++ b/third_party/pkg/angular/lib/core/parser/eval.dart
@@ -2,16 +2,17 @@ library angular.core.parser.eval;
import 'package:angular/core/parser/syntax.dart' as syntax;
import 'package:angular/core/parser/utils.dart';
+import 'package:angular/core/module.dart';
export 'package:angular/core/parser/eval_access.dart';
export 'package:angular/core/parser/eval_calls.dart';
class Chain extends syntax.Chain {
Chain(List<syntax.Expression> expressions) : super(expressions);
- eval(scope) {
+ eval(scope, [FilterMap filters]) {
var result;
- for (int i = 0, length = expressions.length; i < length; i++) {
- var last = expressions[i].eval(scope);
+ for (int i = 0; i < expressions.length; i++) {
+ var last = expressions[i].eval(scope, filters);
if (last != null) result = last;
}
return result;
@@ -19,36 +20,38 @@ class Chain extends syntax.Chain {
}
class Filter extends syntax.Filter {
- final Function function;
final List allArguments;
Filter(syntax.Expression expression, String name, List<syntax.Expression> arguments,
- Function this.function, List<syntax.Expression> this.allArguments)
+ List<syntax.Expression> this.allArguments)
: super(expression, name, arguments);
- eval(scope) => Function.apply(function, evalList(scope, allArguments));
+
+ eval(scope, [FilterMap filters]) =>
+ Function.apply(filters(name), evalList(scope, allArguments, filters));
}
class Assign extends syntax.Assign {
Assign(syntax.Expression target, value) : super(target, value);
- eval(scope) => target.assign(scope, value.eval(scope));
+ eval(scope, [FilterMap filters]) =>
+ target.assign(scope, value.eval(scope, filters));
}
class Conditional extends syntax.Conditional {
Conditional(syntax.Expression condition,
syntax.Expression yes, syntax.Expression no): super(condition, yes, no);
- eval(scope) => toBool(condition.eval(scope))
+ eval(scope, [FilterMap filters]) => toBool(condition.eval(scope))
? yes.eval(scope)
: no.eval(scope);
}
class PrefixNot extends syntax.Prefix {
PrefixNot(syntax.Expression expression) : super('!', expression);
- eval(scope) => !toBool(expression.eval(scope));
+ eval(scope, [FilterMap filters]) => !toBool(expression.eval(scope));
}
class Binary extends syntax.Binary {
Binary(String operation, syntax.Expression left, syntax.Expression right):
super(operation, left, right);
- eval(scope) {
+ eval(scope, [FilterMap filters]) {
var left = this.left.eval(scope);
switch (operation) {
case '&&': return toBool(left) && toBool(this.right.eval(scope));
@@ -77,20 +80,22 @@ class Binary extends syntax.Binary {
class LiteralPrimitive extends syntax.LiteralPrimitive {
LiteralPrimitive(dynamic value) : super(value);
- eval(scope) => value;
+ eval(scope, [FilterMap filters]) => value;
}
class LiteralString extends syntax.LiteralString {
LiteralString(String value) : super(value);
- eval(scope) => value;
+ eval(scope, [FilterMap filters]) => value;
}
class LiteralArray extends syntax.LiteralArray {
LiteralArray(List<syntax.Expression> elements) : super(elements);
- eval(scope) => elements.map((e) => e.eval(scope)).toList();
+ eval(scope, [FilterMap filters]) =>
+ elements.map((e) => e.eval(scope, filters)).toList();
}
class LiteralObject extends syntax.LiteralObject {
LiteralObject(List<String> keys, List<syntax.Expression>values) : super(keys, values);
- eval(scope) => new Map.fromIterables(keys, values.map((e) => e.eval(scope)));
+ eval(scope, [FilterMap filters]) =>
+ new Map.fromIterables(keys, values.map((e) => e.eval(scope, filters)));
}

Powered by Google App Engine
This is Rietveld 408576698