diff options
| author | Igor Minar | 2013-10-09 09:54:10 -0700 | 
|---|---|---|
| committer | Igor Minar | 2013-10-09 15:15:43 -0700 | 
| commit | b6a37d112b3e1478f4d14a5f82faabf700443748 (patch) | |
| tree | 3e04ad33ff5a2d4c8711901c3fd9b9ab3ac95127 | |
| parent | 5dc35b527b3c99f6544b8cb52e93c6510d3ac577 (diff) | |
| download | angular.js-b6a37d112b3e1478f4d14a5f82faabf700443748.tar.bz2 | |
revert: fix($parse): handle promises returned from parsed function calls
This reverts commit 3a65822023119b71deab5e298c7ef2de204caa13.
The change cased regressions in third party components that require
promises from getter functions not to be unwrapped.
Since we have deprecated the promise unwrapping support in $parse it
doesn't make much sense to fix this issue and deal with regressions in
third party code.
Closes #4158
| -rw-r--r-- | src/ng/parse.js | 10 | ||||
| -rw-r--r-- | test/ng/parseSpec.js | 12 | 
2 files changed, 0 insertions, 22 deletions
| diff --git a/src/ng/parse.js b/src/ng/parse.js index aad740e2..40344256 100644 --- a/src/ng/parse.js +++ b/src/ng/parse.js @@ -761,16 +761,6 @@ Parser.prototype = {              ? fnPtr.apply(context, args)              : fnPtr(args[0], args[1], args[2], args[3], args[4]); -      // Check for promise -      if (v && v.then && parser.options.unwrapPromises) { -        var p = v; -        if (!('$$v' in v)) { -          p.$$v = undefined; -          p.then(function(val) { p.$$v = val; }); -        } -        v = v.$$v; -      } -        return ensureSafeObject(v, parser.text);      };    }, diff --git a/test/ng/parseSpec.js b/test/ng/parseSpec.js index 277178a1..940bd6d6 100644 --- a/test/ng/parseSpec.js +++ b/test/ng/parseSpec.js @@ -1129,18 +1129,6 @@ describe('parser', function() {              expect(scope.$eval('greeting')).toBe(undefined);            }); -          it('should evaluate a function call returning a promise and eventually get its return value', function() { -            scope.greetingFn = function() { return promise; }; -            expect(scope.$eval('greetingFn()')).toBe(undefined); - -            scope.$digest(); -            expect(scope.$eval('greetingFn()')).toBe(undefined); - -            deferred.resolve('hello!'); -            expect(scope.$eval('greetingFn()')).toBe(undefined); -            scope.$digest(); -            expect(scope.$eval('greetingFn()')).toBe('hello!'); -          });            describe('assignment into promises', function() {              // This behavior is analogous to assignments to non-promise values | 
