diff options
Diffstat (limited to 'src/angular-mocks.js')
| -rw-r--r-- | src/angular-mocks.js | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/src/angular-mocks.js b/src/angular-mocks.js index fe0fb011..71a18d06 100644 --- a/src/angular-mocks.js +++ b/src/angular-mocks.js @@ -239,10 +239,10 @@ angular.service('$exceptionHandler', function(e) { */ angular.service('$log', function() { var $log = { - log: function(){ $log.logs.push(arguments) }, - warn: function(){ $log.logs.push(arguments) }, - info: function(){ $log.logs.push(arguments) }, - error: function(){ $log.logs.push(arguments) } + log: function(){ $log.logs.push(arguments); }, + warn: function(){ $log.logs.push(arguments); }, + info: function(){ $log.logs.push(arguments); }, + error: function(){ $log.logs.push(arguments); } }; $log.log.logs = []; @@ -265,6 +265,15 @@ angular.service('$log', function() { * @param {(number|string)} timestamp Timestamp representing the desired time in *UTC* * * @example + * !!!! WARNING !!!!! + * This is not a complete Date object so only methods that were implemented can be called safely. + * To make matters worse, TzDate instances inherit stuff from Date via a prototype. + * + * We do our best to intercept calls to "unimplemented" methods, but since the list of methods is + * incomplete we might be missing some non-standard methods. This can result in errors like: + * "Date.prototype.foo called on incompatible Object". + * + * <pre> * var newYearInBratislava = new TzDate(-1, '2009-12-31T23:00:00Z'); * newYearInBratislava.getTimezoneOffset() => -60; * newYearInBratislava.getFullYear() => 2010; @@ -272,15 +281,8 @@ angular.service('$log', function() { * newYearInBratislava.getDate() => 1; * newYearInBratislava.getHours() => 0; * newYearInBratislava.getMinutes() => 0; + * </pre> * - * - * !!!! WARNING !!!!! - * This is not a complete Date object so only methods that were implemented can be called safely. - * To make matters worse, TzDate instances inherit stuff from Date via a prototype. - * - * We do our best to intercept calls to "unimplemented" methods, but since the list of methods is - * incomplete we might be missing some non-standard methods. This can result in errors like: - * "Date.prototype.foo called on incompatible Object". */ function TzDate(offset, timestamp) { if (angular.isString(timestamp)) { |
