From 6cc90c46ed5212cfe5bbbaa2c05f35989aef9aed Mon Sep 17 00:00:00 2001 From: Anatoli Date: Wed, 8 Mar 2017 17:37:22 -0300 Subject: [PATCH] Make an option to *always* restore the last session, no matter how Atom is invoked (#9643), part3: use _.cloneDeep from lodash instead of own clone function --- src/main-process/atom-application.coffee | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/src/main-process/atom-application.coffee b/src/main-process/atom-application.coffee index d0595ba32..382caef6c 100644 --- a/src/main-process/atom-application.coffee +++ b/src/main-process/atom-application.coffee @@ -112,7 +112,7 @@ class AtomApplication launch: (options) -> if options.pathsToOpen?.length > 0 or options.urlsToOpen?.length > 0 or options.test or options.benchmark or options.benchmarkTest if @config.get('core.restorePreviousWindowsOnStart') is 'always' - @loadState(clone(options)) + @loadState(_.cloneDeep(options)) @openWithOptions(options) else @loadState(options) or @openPath(options) @@ -814,10 +814,3 @@ class AtomApplication args.push("--resource-path=#{@resourcePath}") app.relaunch({args}) app.quit() - - clone = (obj) -> - return obj if obj is null or typeof (obj) isnt "object" - temp = new obj.constructor() - for key of obj - temp[key] = clone(obj[key]) - temp