Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 336665 - [language support] JSDT not support the Javascript "get" operator
Summary: [language support] JSDT not support the Javascript "get" operator
Status: CLOSED DUPLICATE of bug 245785
Alias: None
Product: JSDT
Classification: WebTools
Component: General (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: Future   Edit
Assignee: Project Inbox CLA
QA Contact: Nitin Dahyabhai CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-02-08 17:48 EST by Tom H CLA
Modified: 2011-06-30 15:48 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Tom H CLA 2011-02-08 17:48:05 EST
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: []
}
Comment 1 Nitin Dahyabhai CLA 2011-06-30 15:48:44 EDT

*** This bug has been marked as a duplicate of bug 245785 ***