From: Cheng Zhao Date: Sat, 12 Dec 2015 07:47:15 +0000 (+0800) Subject: Passing '' to fromPartiion should return default partition X-Git-Tag: v0.36.1~29^2 X-Git-Url: http://git.khamidou.com/?a=commitdiff_plain;h=10cad5d9ec75a3034bd0684722aabd98aad21abf;p=electron.git Passing '' to fromPartiion should return default partition --- diff --git a/atom/browser/api/lib/session.coffee b/atom/browser/api/lib/session.coffee index 7fc3c2df..5c65aa29 100644 --- a/atom/browser/api/lib/session.coffee +++ b/atom/browser/api/lib/session.coffee @@ -6,6 +6,7 @@ PERSIST_PERFIX = 'persist:' # Returns the Session from |partition| string. exports.fromPartition = (partition='') -> + return exports.defaultSession if partition is '' if partition.startsWith PERSIST_PERFIX bindings.fromPartition partition.substr(PERSIST_PERFIX.length), false else @@ -14,7 +15,7 @@ exports.fromPartition = (partition='') -> # Returns the default session. Object.defineProperty exports, 'defaultSession', enumerable: true - get: -> exports.fromPartition 'persist:' + get: -> bindings.fromPartition '', false wrapSession = (session) -> # session is an EventEmitter.