让dstore Filter运算符抛出编译器错误

时间:2016-03-27 13:58:30

标签: javascript dojo google-closure-compiler dgrid dstore

我的项目中使用dstore和dgrid有以下代码。当我使用过滤器操作符时,我在eclipse中遇到编译错误以及Dojo构建附带的Closure编译器。

storeFilter =  new origStore.Filter().or(new origStore.Filter().in('category', ['Action', 'Thriller', 'Comedy']), new origStore.Filter().eq('newRelease', true));

grid.set('collection', origStore.filter(storeFilter));

Eclispe错误:令牌'。'上的语法错误,此令牌后预期的标识符。

Closure编译器:'。''错误,标识符预期。

使用闭包编译器编译dgrid和dstore包很顺利。但是当我使用上面的代码编译我的包时导致错误。

我还要注意,代码在所有浏览器中都按预期工作。

你们任何人都可以在这里说清楚。

谢谢!

1 个答案:

答案 0 :(得分:0)

尝试将.in替换为['in'],因为in是保留字。