зеркало из https://github.com/mozilla/gecko-dev.git
Fix to 58673. Alias Date.prototype.toGMTString to Date.prototype.toUTCString (rather than defining seperate function objects for each). ECMA conformance.
r=rogerl
This commit is contained in:
Родитель
c531ce2be5
Коммит
45db29b063
|
@ -1826,7 +1826,6 @@ static JSFunctionSpec date_methods[] = {
|
||||||
{"setUTCSeconds", date_setUTCSeconds, 2,0,0 },
|
{"setUTCSeconds", date_setUTCSeconds, 2,0,0 },
|
||||||
{"setMilliseconds", date_setMilliseconds, 1,0,0 },
|
{"setMilliseconds", date_setMilliseconds, 1,0,0 },
|
||||||
{"setUTCMilliseconds", date_setUTCMilliseconds,1,0,0 },
|
{"setUTCMilliseconds", date_setUTCMilliseconds,1,0,0 },
|
||||||
{"toGMTString", date_toGMTString, 0,0,0 },
|
|
||||||
{"toUTCString", date_toGMTString, 0,0,0 },
|
{"toUTCString", date_toGMTString, 0,0,0 },
|
||||||
{js_toLocaleString_str, date_toLocaleString, 0,0,0 },
|
{js_toLocaleString_str, date_toLocaleString, 0,0,0 },
|
||||||
{"toLocaleDateString", date_toLocaleDateString,0,0,0 },
|
{"toLocaleDateString", date_toLocaleDateString,0,0,0 },
|
||||||
|
@ -1974,6 +1973,10 @@ js_InitDateClass(JSContext *cx, JSObject *obj)
|
||||||
if (!proto)
|
if (!proto)
|
||||||
return NULL;
|
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 */
|
/* Set the value of the Date.prototype date to NaN */
|
||||||
proto_date = date_constructor(cx, proto);
|
proto_date = date_constructor(cx, proto);
|
||||||
if (!proto_date)
|
if (!proto_date)
|
||||||
|
|
Загрузка…
Ссылка в новой задаче