mirror of
https://github.com/zhigang1992/angular.js.git
synced 2026-04-24 03:55:49 +08:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user