Report errors due to legacy tuples in hashchange.operators_to_hash.

(imported from commit f639ba52f85bf103afdd26dc4f279e1f03570119)
This commit is contained in:
Steve Howell 2014-02-10 17:32:44 -05:00
parent 92b249a0a1
commit c87b77e52e
1 changed files with 8 additions and 2 deletions

View File

@ -39,8 +39,14 @@ exports.operators_to_hash = function (operators) {
hash = '#narrow';
_.each(operators, function (elem) {
// Support legacy tuples.
var operator = elem.operator || elem[0];
var operand = elem.operand || elem[1];
var operator = elem.operator;
var operand = elem.operand;
if (operator === undefined) {
blueslip.error("Legacy tuple syntax passed into operators_to_hash.");
operator = elem[0];
operand = elem[1];
}
hash += '/' + hashchange.encodeHashComponent(operator)
+ '/' + hashchange.encodeHashComponent(operand);