开发者

Why they use reserved keyword 'continue' to name a function in IndexedDB's Cursor object?

According to http://www.w3.org/TR/IndexedDB/#widl-IDBCursor-continue, t开发者_JAVA技巧he IDBCursor object has methods named "continue" and "delete". Aren't those reserved keywords? Why would they use these names in the specs?

My javascript compiler keeps warning me about the reserved keyword and its really annoying.


If you just want to "shut the compiler up" you can use string based property access instead:

obj['continue']

is the same as

obj.continue


The presence of .continue() will make IE8 bark with "SCRIPT1010: Expected identifier" even if that part of the code is never run. So it is probably a good thing that your compiler warns you.

missingnos solution solved this problem.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜