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

Unified Diff: third_party/pkg/angular/lib/core/parser/eval.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/lib/core/parser/eval.dart
===================================================================
--- third_party/pkg/angular/lib/core/parser/eval.dart (revision 33054)
+++ third_party/pkg/angular/lib/core/parser/eval.dart (working copy)
@@ -2,17 +2,16 @@
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, [FilterMap filters]) {
+ eval(scope) {
var result;
- for (int i = 0; i < expressions.length; i++) {
- var last = expressions[i].eval(scope, filters);
+ for (int i = 0, length = expressions.length; i < length; i++) {
+ var last = expressions[i].eval(scope);
if (last != null) result = last;
}
return result;
@@ -20,38 +19,36 @@
}
class Filter extends syntax.Filter {
+ final Function function;
final List allArguments;
Filter(syntax.Expression expression, String name, List<syntax.Expression> arguments,
- List<syntax.Expression> this.allArguments)
+ Function this.function, List<syntax.Expression> this.allArguments)
: super(expression, name, arguments);
-
- eval(scope, [FilterMap filters]) =>
- Function.apply(filters(name), evalList(scope, allArguments, filters));
+ eval(scope) => Function.apply(function, evalList(scope, allArguments));
}
class Assign extends syntax.Assign {
Assign(syntax.Expression target, value) : super(target, value);
- eval(scope, [FilterMap filters]) =>
- target.assign(scope, value.eval(scope, filters));
+ eval(scope) => target.assign(scope, value.eval(scope));
}
class Conditional extends syntax.Conditional {
Conditional(syntax.Expression condition,
syntax.Expression yes, syntax.Expression no): super(condition, yes, no);
- eval(scope, [FilterMap filters]) => toBool(condition.eval(scope))
+ eval(scope) => toBool(condition.eval(scope))
? yes.eval(scope)
: no.eval(scope);
}
class PrefixNot extends syntax.Prefix {
PrefixNot(syntax.Expression expression) : super('!', expression);
- eval(scope, [FilterMap filters]) => !toBool(expression.eval(scope));
+ eval(scope) => !toBool(expression.eval(scope));
}
class Binary extends syntax.Binary {
Binary(String operation, syntax.Expression left, syntax.Expression right):
super(operation, left, right);
- eval(scope, [FilterMap filters]) {
+ eval(scope) {
var left = this.left.eval(scope);
switch (operation) {
case '&&': return toBool(left) && toBool(this.right.eval(scope));
@@ -80,22 +77,20 @@
class LiteralPrimitive extends syntax.LiteralPrimitive {
LiteralPrimitive(dynamic value) : super(value);
- eval(scope, [FilterMap filters]) => value;
+ eval(scope) => value;
}
class LiteralString extends syntax.LiteralString {
LiteralString(String value) : super(value);
- eval(scope, [FilterMap filters]) => value;
+ eval(scope) => value;
}
class LiteralArray extends syntax.LiteralArray {
LiteralArray(List<syntax.Expression> elements) : super(elements);
- eval(scope, [FilterMap filters]) =>
- elements.map((e) => e.eval(scope, filters)).toList();
+ eval(scope) => elements.map((e) => e.eval(scope)).toList();
}
class LiteralObject extends syntax.LiteralObject {
LiteralObject(List<String> keys, List<syntax.Expression>values) : super(keys, values);
- eval(scope, [FilterMap filters]) =>
- new Map.fromIterables(keys, values.map((e) => e.eval(scope, filters)));
+ eval(scope) => new Map.fromIterables(keys, values.map((e) => e.eval(scope)));
}

Powered by Google App Engine
This is Rietveld 408576698