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.
This commit is contained in:
Vincent Vanackere
2016-10-03 12:01:45 +02:00
parent 3a75eb466e
commit 9227310494

View File

@@ -1,7 +1,7 @@
import { ComponentRef, ElementRef, EventEmitter, Output, Renderer } from '@angular/core';
import { Footer, Header } from '../components/toolbar/toolbar';
import { isPresent, merge } from '../util/util';
import { isPresent, assign } from '../util/util';
import { Navbar } from '../components/navbar/navbar';
import { NavControllerBase } from './nav-controller-base';
import { NavOptions, ViewState } from './nav-util';
@@ -184,7 +184,7 @@ export class ViewController {
return Promise.resolve(false);
}
let options = merge({}, this._leavingOpts, navOptions);
let options = assign({}, this._leavingOpts, navOptions);
this._onWillDismiss && this._onWillDismiss(data, role);
return this._nav.remove(this._nav.indexOf(this), 1, options).then(() => {
this._onDidDismiss && this._onDidDismiss(data, role);