revert: fix($parse): handle promises returned from parsed function calls

This reverts commit 3a65822023.

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
This commit is contained in:
Igor Minar 2013-10-09 09:54:10 -07:00
parent 5dc35b527b
commit b6a37d112b
2 changed files with 0 additions and 22 deletions

View file

@ -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);
};
},

View file

@ -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