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

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

Issue 1058283006: Update pubspecs and dependencies to get pkgbuild tests working. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 8 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_calls.dart
diff --git a/third_party/pkg/angular/lib/core/parser/eval_calls.dart b/third_party/pkg/angular/lib/core/parser/eval_calls.dart
deleted file mode 100644
index c7c152a6a966bd14c049994fd6ce5d1e60cfac37..0000000000000000000000000000000000000000
--- a/third_party/pkg/angular/lib/core/parser/eval_calls.dart
+++ /dev/null
@@ -1,125 +0,0 @@
-library angular.core.parser.eval_calls;
-
-import 'dart:mirrors';
-import 'package:angular/core/parser/syntax.dart' as syntax;
-import 'package:angular/core/parser/utils.dart';
-import 'package:angular/core/module.dart';
-
-class CallScope extends syntax.CallScope with CallReflective {
- final Symbol symbol;
- CallScope(name, arguments)
- : super(name, arguments)
- , symbol = newSymbol(name);
- eval(scope, [FilterMap filters]) => _eval(scope, scope);
-}
-
-class CallMember extends syntax.CallMember with CallReflective {
- final Symbol symbol;
- CallMember(object, name, arguments)
- : super(object, name, arguments)
- , symbol = newSymbol(name);
- eval(scope, [FilterMap filters]) => _eval(scope, object.eval(scope, filters));
-}
-
-class CallScopeFast0 extends syntax.CallScope with CallFast {
- final Function function;
- CallScopeFast0(name, arguments, this.function) : super(name, arguments);
- eval(scope, [FilterMap filters]) => _evaluate0(scope);
-}
-
-class CallScopeFast1 extends syntax.CallScope with CallFast {
- final Function function;
- CallScopeFast1(name, arguments, this.function) : super(name, arguments);
- eval(scope, [FilterMap filters]) => _evaluate1(scope, arguments[0].eval(scope, filters));
-}
-
-class CallMemberFast0 extends syntax.CallMember with CallFast {
- final Function function;
- CallMemberFast0(object, name, arguments, this.function)
- : super(object, name, arguments);
- eval(scope, [FilterMap filters]) => _evaluate0(object.eval(scope, filters));
-}
-
-class CallMemberFast1 extends syntax.CallMember with CallFast {
- final Function function;
- CallMemberFast1(object, name, arguments, this.function)
- : super(object, name, arguments);
- eval(scope, [FilterMap filters]) => _evaluate1(object.eval(scope, filters),
- arguments[0].eval(scope, filters));
-}
-
-class CallFunction extends syntax.CallFunction {
- CallFunction(function, arguments) : super(function, arguments);
- eval(scope, [FilterMap filters]) {
- var function = this.function.eval(scope, filters);
- if (function is !Function) {
- throw new EvalError('${this.function} is not a function');
- } else {
- return relaxFnApply(function, evalList(scope, arguments, filters));
- }
- }
-}
-
-
-/**
- * The [CallReflective] mixin is used to share code between call expressions
- * where we need to use reflection to do the invocation. We optimize for the
- * case where we invoke a method on the same holder repeatedly through caching.
- */
-abstract class CallReflective {
- static const int CACHED_MAP = 0;
- static const int CACHED_FUNCTION = 1;
-
- int _cachedKind = 0;
- var _cachedHolder = UNINITIALIZED;
- var _cachedValue;
-
- String get name;
- Symbol get symbol;
- List get arguments;
-
- _eval(scope, holder) {
- List arguments = evalList(scope, this.arguments);
- if (!identical(holder, _cachedHolder)) {
- return _evaluteUncached(holder, arguments);
- }
- return (_cachedKind == CACHED_MAP)
- ? relaxFnApply(ensureFunctionFromMap(holder, name), arguments)
- : _cachedValue.invoke(symbol, arguments).reflectee;
- }
-
- _evaluteUncached(holder, arguments) {
- _cachedHolder = holder;
- if (holder is Map) {
- _cachedKind = CACHED_MAP;
- _cachedValue = null;
- return relaxFnApply(ensureFunctionFromMap(holder, name), arguments);
- } else if (symbol == null) {
- _cachedHolder = UNINITIALIZED;
- throw new EvalError("Undefined function $name");
- } else {
- InstanceMirror mirror = reflect(holder);
- _cachedKind = CACHED_FUNCTION;
- _cachedValue = mirror;
- return mirror.invoke(symbol, arguments).reflectee;
- }
- }
-}
-
-
-/**
- * The [CallFast] mixin is used to share code between call expressions
- * where we have a pre-compiled helper function that we use to do the
- * function invocation.
- */
-abstract class CallFast {
- String get name;
- Function get function;
-
- _evaluate0(holder) => (holder is Map)
- ? ensureFunctionFromMap(holder, name)()
- : function(holder);
- _evaluate1(holder, a0) => (holder is Map)
- ? ensureFunctionFromMap(holder, name)(a0)
- : function(holder, a0);
-}
« no previous file with comments | « third_party/pkg/angular/lib/core/parser/eval_access.dart ('k') | third_party/pkg/angular/lib/core/parser/lexer.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698