diff options
| author | Misko Hevery | 2010-05-30 16:45:35 -0700 | 
|---|---|---|
| committer | Misko Hevery | 2010-05-30 16:45:35 -0700 | 
| commit | ad18fe144263b966f8930edb672e08b9926e00a1 (patch) | |
| tree | cd46078c014463ab84323f2f9da7c7a59fc7b9a2 /src/Scope.js | |
| parent | c7d64f6d124f10c66309042c2d77896215ed43b8 (diff) | |
| download | angular.js-ad18fe144263b966f8930edb672e08b9926e00a1.tar.bz2 | |
compiler exposos both self and this function calling convention
Diffstat (limited to 'src/Scope.js')
| -rw-r--r-- | src/Scope.js | 14 | 
1 files changed, 7 insertions, 7 deletions
diff --git a/src/Scope.js b/src/Scope.js index 6d68eeed..bed0ff6d 100644 --- a/src/Scope.js +++ b/src/Scope.js @@ -46,16 +46,16 @@ function setter(instance, path, value){  var compileCache = {};  function expressionCompile(exp){    if (isFunction(exp)) return exp; -  var expFn = compileCache[exp]; -  if (!expFn) { +  var fn = compileCache[exp]; +  if (!fn) {      var parser = new Parser(exp); -    expFn = parser.statements(); +    var fnSelf = parser.statements();      parser.assertAllConsumed(); -    compileCache[exp] = expFn; +    fn = compileCache[exp] = extend( +      function(){ return fnSelf(this);}, +      {fnSelf: fnSelf});    } -  return function(){ -    return expFn(this); -  }; +  return fn;  }  function rethrow(e) { throw e; }  | 
