Skip to content
Snippets Groups Projects
Commit 89da8503 authored by deuce's avatar deuce
Browse files

New getter/setter syntax.

parent a030d13d
No related branches found
No related tags found
No related merge requests found
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
* which is a JavaScript Date object representing the birthdate. * which is a JavaScript Date object representing the birthdate.
*/ */
User.prototype.birthDate getter=function() { User.prototype.__defineGetter("birthDate", function() {
var mfirst=system.datestr(1728000).substr(0,2)=='01'; var mfirst=system.datestr(1728000).substr(0,2)=='01';
var match; var match;
var m,d,y; var m,d,y;
...@@ -17,4 +17,4 @@ User.prototype.birthDate getter=function() { ...@@ -17,4 +17,4 @@ User.prototype.birthDate getter=function() {
if(this.age + y < (new Date()).getYear()-2) if(this.age + y < (new Date()).getYear()-2)
y+=100; y+=100;
return new Date(y,m,d); return new Date(y,m,d);
}; });
...@@ -168,8 +168,8 @@ function parse_news_header(hdr, line) ...@@ -168,8 +168,8 @@ function parse_news_header(hdr, line)
hdr.field_list=new Array(); hdr.field_list=new Array();
hdr[line.toLowerCase()]= hdr[line.toLowerCase()]=
{ type: RFC822HEADER, { type: RFC822HEADER,
data getter: function() { return(this.hdr_name+': '+this.hdr_data); }, get data() { return(this.hdr_name+': '+this.hdr_data); },
data setter: function(v) { set data(v) {
var m=v.split(/:\s*/,2); var m=v.split(/:\s*/,2);
if(m.length==1) if(m.length==1)
this.hdr_data=v; this.hdr_data=v;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment