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 @@
* 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 match;
var m,d,y;
......@@ -17,4 +17,4 @@ User.prototype.birthDate getter=function() {
if(this.age + y < (new Date()).getYear()-2)
y+=100;
return new Date(y,m,d);
};
});
......@@ -168,8 +168,8 @@ function parse_news_header(hdr, line)
hdr.field_list=new Array();
hdr[line.toLowerCase()]=
{ type: RFC822HEADER,
data getter: function() { return(this.hdr_name+': '+this.hdr_data); },
data setter: function(v) {
get data() { return(this.hdr_name+': '+this.hdr_data); },
set data(v) {
var m=v.split(/:\s*/,2);
if(m.length==1)
this.hdr_data=v;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment