2013-01-08 37 views
2

我有以下的错误5次:未捕获的ReferenceError:无效的左侧表达

Uncaught ReferenceError: Invalid left - hand side expression in postfix operation

。你们看到,为什么?感谢你的帮助 !

toQueryParams: function (string, separator) { 
    var match = _(string).strip().match(/([^?#]*)(#.*)?$/); 
    if (!match) return {}; 
    return _(match[1].split(separator || '&')).reduce(function (hash, pair) { 
    if ((pair = pair.split('='))[0]) { 
     var key = decodeURIComponent(pair.shift()), 
     value = pair.length > 1 ? pair.join('=') : pair[0]; 
     if (value != undefined) value = decodeURIComponent(value); 
     if (key in hash) { 
     if (!_.isArray(hash[key])) hash[key] = [hash[key]]; 
     hash[key].push(value); 
     } 
     // Uncaught ReferenceError: Invalid left - hand side expression in postfix operation 
     // Uncaught ReferenceError: Invalid left - hand side expression in postfix operation 
     // Uncaught ReferenceError: Invalid left - hand side expression in postfix operation 
     // Uncaught ReferenceError: Invalid left - hand side expression in postfix operation 
     // Uncaught ReferenceError: Invalid left - hand side expression in postfix operation 
     else hash[key] = value; 
    } 
    return hash; 
    }, {}); 
}, 
+0

请创建一个http://jsfiddle.net/演示。 –

+0

以及它是一个非常大的JS文件的一部分。我会错过依赖关系...我会看看我能做些什么 –

+0

这里是http://jsfiddle.net/YcN4F/我已经更新了代码来尝试一些东西,但在生产中不起作用。 –

回答

1

我想清楚发生了什么事。这是不是这个代码,但努力来缩小underscore.js使用旧版本JSMin的......当

我现在搬到uglyfier;)

THX。

相关问题