Merge pull request #4564 from dongjoon-hyun/rename_const_persist_prefix

Rename constant `PERSIST_PERFIX` to `PERSIST_PREFIX` in `session.js`.
This commit is contained in:
Cheng Zhao 2016-02-21 21:53:41 +08:00
commit 361b9cad0f

View file

@ -1,6 +1,6 @@
const EventEmitter = require('events').EventEmitter;
const bindings = process.atomBinding('session');
const PERSIST_PERFIX = 'persist:';
const PERSIST_PREFIX = 'persist:';
// Returns the Session from |partition| string.
exports.fromPartition = function(partition) {
@ -10,8 +10,8 @@ exports.fromPartition = function(partition) {
if (partition === '') {
return exports.defaultSession;
}
if (partition.startsWith(PERSIST_PERFIX)) {
return bindings.fromPartition(partition.substr(PERSIST_PERFIX.length), false);
if (partition.startsWith(PERSIST_PREFIX)) {
return bindings.fromPartition(partition.substr(PERSIST_PREFIX.length), false);
} else {
return bindings.fromPartition(partition, true);
}