Skip to content

Commit 9227310

Browse files
committed
fix(ViewController): avoid deep copy in dismiss() that can turn into an infinite loop
For some reason, apparently related to the NavOptions.ev field, this deep copy was turning into an infinite loop on a Nexus 7 / android 5.1.1 webview. Replace with a non-deep copy since the deep copy is unnecessary in this case.
1 parent 3a75eb4 commit 9227310

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/navigation/view-controller.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { ComponentRef, ElementRef, EventEmitter, Output, Renderer } from '@angular/core';
22

33
import { Footer, Header } from '../components/toolbar/toolbar';
4-
import { isPresent, merge } from '../util/util';
4+
import { isPresent, assign } from '../util/util';
55
import { Navbar } from '../components/navbar/navbar';
66
import { NavControllerBase } from './nav-controller-base';
77
import { NavOptions, ViewState } from './nav-util';
@@ -184,7 +184,7 @@ export class ViewController {
184184
return Promise.resolve(false);
185185
}
186186

187-
let options = merge({}, this._leavingOpts, navOptions);
187+
let options = assign({}, this._leavingOpts, navOptions);
188188
this._onWillDismiss && this._onWillDismiss(data, role);
189189
return this._nav.remove(this._nav.indexOf(this), 1, options).then(() => {
190190
this._onDidDismiss && this._onDidDismiss(data, role);

0 commit comments

Comments
 (0)