Community
Participate
Working Groups
Build Identifier: 20100917-0705 Syntax error on token "get", : expected after this token (JSDT with object getter setter) when using this syntax to define getter and setters; get name() { return this.aName }, the javascript validator doesn't like the syntax with this message; Syntax error on token "get", : expected after this token Here is the full file; http://pastebin.com/axaNZDJC However this syntax is used for developing XPCOM objects for firefox plugins. any suggestions on how to fix that? It looks like the validator does not support this operator; https://developer.mozilla.org/en/JavaScript/Reference/Operat ors/Special/get Reproducible: Always Steps to Reproduce: define a getter on some object value; var o = { get latest () { if (this.log.length > 0) { return this.log[this.log.length - 1]; } else { return null; } }, log: [] }
*** This bug has been marked as a duplicate of bug 245785 ***