diff options
author | Bernhard Posselt <dev@bernhard-posselt.com> | 2015-01-21 10:20:52 +0100 |
---|---|---|
committer | Bernhard Posselt <dev@bernhard-posselt.com> | 2015-01-21 10:20:52 +0100 |
commit | e739ce597908262fbff165c8c08a4ae733ce1138 (patch) | |
tree | 172f161cab81985917e4bbc4de7cd3351f8f06eb /js/vendor/angular-mocks/angular-mocks.js | |
parent | e0642ebca49f70749dfa3eff7d4d8d39cd355c16 (diff) |
update angularjs
Diffstat (limited to 'js/vendor/angular-mocks/angular-mocks.js')
-rw-r--r-- | js/vendor/angular-mocks/angular-mocks.js | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/js/vendor/angular-mocks/angular-mocks.js b/js/vendor/angular-mocks/angular-mocks.js index e7f775dbe..da617179e 100644 --- a/js/vendor/angular-mocks/angular-mocks.js +++ b/js/vendor/angular-mocks/angular-mocks.js @@ -1,5 +1,5 @@ /** - * @license AngularJS v1.3.8 + * @license AngularJS v1.3.10 * (c) 2010-2014 Google, Inc. http://angularjs.org * License: MIT */ @@ -250,31 +250,31 @@ angular.mock.$ExceptionHandlerProvider = function() { * * @param {string} mode Mode of operation, defaults to `rethrow`. * - * - `rethrow`: If any errors are passed to the handler in tests, it typically means that there - * is a bug in the application or test, so this mock will make these tests fail. * - `log`: Sometimes it is desirable to test that an error is thrown, for this case the `log` * mode stores an array of errors in `$exceptionHandler.errors`, to allow later * assertion of them. See {@link ngMock.$log#assertEmpty assertEmpty()} and * {@link ngMock.$log#reset reset()} + * - `rethrow`: If any errors are passed to the handler in tests, it typically means that there + * is a bug in the application or test, so this mock will make these tests fail. + * For any implementations that expect exceptions to be thrown, the `rethrow` mode + * will also maintain a log of thrown errors. */ this.mode = function(mode) { + switch (mode) { - case 'rethrow': - handler = function(e) { - throw e; - }; - break; case 'log': + case 'rethrow': var errors = []; - handler = function(e) { if (arguments.length == 1) { errors.push(e); } else { errors.push([].slice.call(arguments, 0)); } + if (mode === "rethrow") { + throw e; + } }; - handler.errors = errors; break; default: |