Skip to content

Commit

Permalink
Add notes about shallowCopy() usage
Browse files Browse the repository at this point in the history
  • Loading branch information
Infocatcher committed Aug 12, 2014
1 parent 2316ff9 commit 875b659
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion bootstrap.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand All @@ -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;
Expand Down

0 comments on commit 875b659

Please sign in to comment.