From 53f607e19f79fa9d7aa82d611e6ef5e85be621f6 Mon Sep 17 00:00:00 2001 From: Christopher Jeffrey Date: Wed, 1 Mar 2017 11:39:14 -0800 Subject: [PATCH] hostlist: minor. --- lib/net/hostlist.js | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/lib/net/hostlist.js b/lib/net/hostlist.js index e8937503..a70e70aa 100644 --- a/lib/net/hostlist.js +++ b/lib/net/hostlist.js @@ -69,6 +69,14 @@ function HostList(options) { this._init(); } +/** + * Serialization version. + * @const {Number} + * @default + */ + +HostList.VERSION = 0; + /** * Initialize options. * @private @@ -972,7 +980,7 @@ HostList.prototype.toJSON = function toJSON() { } return { - version: 1, + version: HostList.VERSION, addrs: addrs, fresh: fresh, used: used @@ -996,7 +1004,9 @@ HostList.prototype.fromJSON = function fromJSON(json) { var i, j, bucket, keys, key, addr, entry, src; assert(json && typeof json === 'object'); - assert(json.version === 1, 'Bad address serialization version.'); + + assert(json.version === HostList.VERSION, + 'Bad address serialization version.'); assert(Array.isArray(json.addrs));