Commit 44f9c6a6 authored by littledan's avatar littledan Committed by Commit bot

Make Date.prototype.toGMTString an alias for Date.prototype.toUTCString

In ES2015, Date.prototype.toGMTString is simply an alias of
Date.prototype.toUTCString, so it has the same identity as a function and
doesn't have its own name. Firefox has already shipped this behavior.
Previously, we copied JSC behavior by making it a separate function.
This change makes an addition test262 test pass.

BUG=v8:4708
LOG=Y
R=adamk

Review URL: https://codereview.chromium.org/1709373002

Cr-Commit-Position: refs/heads/master@{#34131}
parent 3cf56fe0
......@@ -1339,12 +1339,13 @@ void Genesis::InitializeGlobal(Handle<JSGlobalObject> global_object,
Builtins::kDatePrototypeToDateString, 0, false);
SimpleInstallFunction(prototype, "toTimeString",
Builtins::kDatePrototypeToTimeString, 0, false);
SimpleInstallFunction(prototype, "toGMTString",
Builtins::kDatePrototypeToUTCString, 0, false);
SimpleInstallFunction(prototype, "toISOString",
Builtins::kDatePrototypeToISOString, 0, false);
SimpleInstallFunction(prototype, "toUTCString",
Builtins::kDatePrototypeToUTCString, 0, false);
Handle<JSFunction> to_utc_string =
SimpleInstallFunction(prototype, "toUTCString",
Builtins::kDatePrototypeToUTCString, 0, false);
InstallFunction(prototype, to_utc_string,
factory->InternalizeUtf8String("toGMTString"), DONT_ENUM);
SimpleInstallFunction(prototype, "getDate", Builtins::kDatePrototypeGetDate,
0, true);
SimpleInstallFunction(prototype, "setDate", Builtins::kDatePrototypeSetDate,
......
......@@ -65,10 +65,11 @@ var datePrototypeFunctions = [
"getTimezoneOffset", "setTime", "setMilliseconds",
"setUTCMilliseconds", "setSeconds", "setUTCSeconds", "setMinutes",
"setUTCMinutes", "setHours", "setUTCHours", "setDate", "setUTCDate",
"setMonth", "setUTCMonth", "setFullYear", "setUTCFullYear", "toGMTString",
"setMonth", "setUTCMonth", "setFullYear", "setUTCFullYear",
"toUTCString", "getYear", "setYear"];
TestFunctionNames(Date.prototype, datePrototypeFunctions);
assertEquals(Date.prototype.toGMTString, Date.prototype.toUTCString);
// Function.prototype functions.
......
......@@ -263,9 +263,6 @@
'built-ins/Object/entries/*': [SKIP],
'built-ins/Object/values/*': [SKIP],
# https://bugs.chromium.org/p/v8/issues/detail?id=4708
'annexB/Date/prototype/toGMTString/name': [FAIL],
######################## NEEDS INVESTIGATION ###########################
# These test failures are specific to the intl402 suite and need investigation
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment