From 45db29b06317ca8635edb7c53fb0f7469e26073e Mon Sep 17 00:00:00 2001 From: "mccabe%netscape.com" Date: Wed, 29 Nov 2000 03:03:05 +0000 Subject: [PATCH] Fix to 58673. Alias Date.prototype.toGMTString to Date.prototype.toUTCString (rather than defining seperate function objects for each). ECMA conformance. r=rogerl --- js/src/jsdate.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/js/src/jsdate.c b/js/src/jsdate.c index e66a5c3353ac..2a87cbe34c37 100644 --- a/js/src/jsdate.c +++ b/js/src/jsdate.c @@ -1826,7 +1826,6 @@ static JSFunctionSpec date_methods[] = { {"setUTCSeconds", date_setUTCSeconds, 2,0,0 }, {"setMilliseconds", date_setMilliseconds, 1,0,0 }, {"setUTCMilliseconds", date_setUTCMilliseconds,1,0,0 }, - {"toGMTString", date_toGMTString, 0,0,0 }, {"toUTCString", date_toGMTString, 0,0,0 }, {js_toLocaleString_str, date_toLocaleString, 0,0,0 }, {"toLocaleDateString", date_toLocaleDateString,0,0,0 }, @@ -1974,6 +1973,10 @@ js_InitDateClass(JSContext *cx, JSObject *obj) if (!proto) return NULL; + /* Alias toUTCString with toGMTString. (ECMA B.2.6) */ + if (!JS_AliasProperty(cx, proto, "toUTCString", "toGMTString")) + return NULL; + /* Set the value of the Date.prototype date to NaN */ proto_date = date_constructor(cx, proto); if (!proto_date)