From 875b6593ecf38d2679bbdebcf65a30c97f99c7b8 Mon Sep 17 00:00:00 2001 From: Infocatcher Date: Tue, 12 Aug 2014 19:17:02 +0400 Subject: [PATCH] Add notes about shallowCopy() usage (#146) --- bootstrap.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bootstrap.js b/bootstrap.js index 1f823d8..e098bc3 100644 --- a/bootstrap.js +++ b/bootstrap.js @@ -1595,7 +1595,7 @@ var privateTab = { var logPrefix = "dontSaveClosedPrivateTabs(" + dontSave + "): "; if(dontSave) { var _this = this; - var shallowCopy = "assign" in Object + var shallowCopy = "assign" in Object // Firefox 34+ ? function(o) { return Object.assign({}, o); } @@ -1619,6 +1619,7 @@ var privateTab = { return !isPrivate; }); if(windowChanged) { + // Note: we can't modify original windowState object (will change real undo close history) var clonedWindowState = shallowCopy(windowState); clonedWindowState._closedTabs = closedTabs; windows[i] = clonedWindowState;