mirror of
https://github.com/Hopiu/angular.js.git
synced 2026-03-16 23:30:23 +00:00
chore(dump): fix our karma.dump bridge
previously it didn't work for dumping multiple objects
This commit is contained in:
parent
af731354b0
commit
d1cdd4d026
3 changed files with 6 additions and 3 deletions
|
|
@ -577,7 +577,7 @@ function $RootScopeProvider(){
|
|||
*
|
||||
* @description
|
||||
* Broadcasted when a scope and its children are being destroyed.
|
||||
*
|
||||
*
|
||||
* Note that, in AngularJS, there is also a `$destroy` jQuery event, which can be used to
|
||||
* clean up DOM bindings before an element is removed from the DOM.
|
||||
*/
|
||||
|
|
@ -601,7 +601,7 @@ function $RootScopeProvider(){
|
|||
* Just before a scope is destroyed a `$destroy` event is broadcasted on this scope.
|
||||
* Application code can register a `$destroy` event handler that will give it chance to
|
||||
* perform any necessary cleanup.
|
||||
*
|
||||
*
|
||||
* Note that, in AngularJS, there is also a `$destroy` jQuery event, which can be used to
|
||||
* clean up DOM bindings before an element is removed from the DOM.
|
||||
*/
|
||||
|
|
|
|||
1
src/ngMock/angular-mocks.js
vendored
1
src/ngMock/angular-mocks.js
vendored
|
|
@ -787,6 +787,7 @@ angular.mock.dump = function(object) {
|
|||
} else if (object instanceof Error) {
|
||||
out = object.stack || ('' + object.name + ': ' + object.message);
|
||||
} else {
|
||||
// TODO(i): this prevents methods to be logged, we should have a better way to serialize objects
|
||||
out = angular.toJson(object, true);
|
||||
}
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -291,5 +291,7 @@ function trace(name) {
|
|||
|
||||
var karmaDump = dump;
|
||||
window.dump = function () {
|
||||
karmaDump(angular.mock.dump.apply(undefined, arguments));
|
||||
karmaDump.apply(undefined, map(arguments, function(arg) {
|
||||
return angular.mock.dump(arg);
|
||||
}));
|
||||
};
|
||||
|
|
|
|||
Loading…
Reference in a new issue