Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 336665

Summary: [language support] JSDT not support the Javascript "get" operator
Product: [WebTools] JSDT Reporter: Tom H <tom>
Component: GeneralAssignee: Project Inbox <jsdt.javascript-inbox>
Status: CLOSED DUPLICATE QA Contact: Nitin Dahyabhai <thatnitind>
Severity: normal    
Priority: P3    
Version: unspecified   
Target Milestone: Future   
Hardware: PC   
OS: Windows XP   
Whiteboard:

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 ***