Javascript Getters and Setters

Bug Reports and Fixes
Post Reply
obender
Posts: 2
Joined: Thu Jun 28, 2007 10:27 pm

Javascript Getters and Setters

Post by obender » Sun Nov 09, 2008 12:06 pm

The following Javascript 1.5 code generates syntax errors:

Code: Select all

var o = {
  a:7,
  get b() { return this.a+1; },
  set c(x) { this.a = x/2; }
};

Post Reply

Who is online

Users browsing this forum: No registered users and 4 guests