mirror of
https://github.com/zhigang1992/angular.js.git
synced 2026-04-24 03:55:49 +08:00
refactor($interpolate): attempt to remove hacky code due to $interpolation perf improvements
This commit is contained in:
@@ -167,30 +167,6 @@ describe('Binder', function() {
|
||||
expect(element[0].childNodes.length).toEqual(1);
|
||||
}));
|
||||
|
||||
it('IfTextBindingThrowsErrorDecorateTheSpan', function() {
|
||||
module(function($exceptionHandlerProvider){
|
||||
$exceptionHandlerProvider.mode('log');
|
||||
});
|
||||
inject(function($rootScope, $exceptionHandler, $compile) {
|
||||
element = $compile('<div>{{error.throw()}}</div>', null, true)($rootScope);
|
||||
var errorLogs = $exceptionHandler.errors;
|
||||
|
||||
$rootScope.error = {
|
||||
'throw': function() {throw 'ErrorMsg1';}
|
||||
};
|
||||
$rootScope.$apply();
|
||||
|
||||
$rootScope.error['throw'] = function() {throw 'MyError';};
|
||||
errorLogs.length = 0;
|
||||
$rootScope.$apply();
|
||||
expect(errorLogs.shift().message).toMatch(/^\[\$interpolate:interr\] Can't interpolate: \{\{error.throw\(\)\}\}\nMyError/);
|
||||
|
||||
$rootScope.error['throw'] = function() {return 'ok';};
|
||||
$rootScope.$apply();
|
||||
expect(errorLogs.length).toBe(0);
|
||||
});
|
||||
});
|
||||
|
||||
it('IfAttrBindingThrowsErrorDecorateTheAttribute', function() {
|
||||
module(function($exceptionHandlerProvider){
|
||||
$exceptionHandlerProvider.mode('log');
|
||||
|
||||
Reference in New Issue
Block a user