From b4592ea03da7c4c75938e79b7fe43c90cd3845a6 Mon Sep 17 00:00:00 2001 From: David Greenspan Date: Wed, 3 Sep 2014 15:18:41 -0700 Subject: [PATCH] swap order of if cases --- packages/reactive-dict/reactive-dict.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/reactive-dict/reactive-dict.js b/packages/reactive-dict/reactive-dict.js index 0c442dc56a..7d0e546144 100644 --- a/packages/reactive-dict/reactive-dict.js +++ b/packages/reactive-dict/reactive-dict.js @@ -15,14 +15,14 @@ var parse = function (serialized) { ReactiveDict = function (dictName) { // this.keys: key -> value if (dictName) { - if (typeof dictName === 'object') { - // back-compat case: dictName is actually migrationData - this.keys = dictName; - } else if (typeof dictName === 'string') { + if (typeof dictName === 'string') { // the normal case, argument is a string name. // _registerDictForMigrate will throw an error on duplicate name. ReactiveDict._registerDictForMigrate(dictName, this); this.keys = ReactiveDict._loadMigratedDict(dictName) || {}; + } else if (typeof dictName === 'object') { + // back-compat case: dictName is actually migrationData + this.keys = dictName; } else { throw new Error("Invalid ReactiveDict argument: " + dictName); }