Index: src/bootstrapper.cc |
diff --git a/src/bootstrapper.cc b/src/bootstrapper.cc |
index 3ec9bb3711ec0d79066140a0f01900edf8de1361..086a48f280fdeb560d84d81ed80466450eadbbe9 100644 |
--- a/src/bootstrapper.cc |
+++ b/src/bootstrapper.cc |
@@ -2549,47 +2549,101 @@ bool Genesis::InstallNatives(ContextType context_type) { |
JSObject::AddProperty(prototype, factory()->constructor_string(), date_fun, |
DONT_ENUM); |
- // Install the toISOString and valueOf functions. |
+ // Install the Date.prototype methods. |
+ SimpleInstallFunction(prototype, "toString", |
+ Builtins::kDatePrototypeToString, 0, false); |
+ SimpleInstallFunction(prototype, "toDateString", |
+ 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); |
SimpleInstallFunction(prototype, "getDate", Builtins::kDatePrototypeGetDate, |
0, true); |
+ SimpleInstallFunction(prototype, "setDate", Builtins::kDatePrototypeSetDate, |
+ 1, false); |
SimpleInstallFunction(prototype, "getDay", Builtins::kDatePrototypeGetDay, |
0, true); |
SimpleInstallFunction(prototype, "getFullYear", |
Builtins::kDatePrototypeGetFullYear, 0, true); |
+ SimpleInstallFunction(prototype, "setFullYear", |
+ Builtins::kDatePrototypeSetFullYear, 3, false); |
SimpleInstallFunction(prototype, "getHours", |
Builtins::kDatePrototypeGetHours, 0, true); |
+ SimpleInstallFunction(prototype, "setHours", |
+ Builtins::kDatePrototypeSetHours, 4, false); |
SimpleInstallFunction(prototype, "getMilliseconds", |
Builtins::kDatePrototypeGetMilliseconds, 0, true); |
+ SimpleInstallFunction(prototype, "setMilliseconds", |
+ Builtins::kDatePrototypeSetMilliseconds, 1, false); |
SimpleInstallFunction(prototype, "getMinutes", |
Builtins::kDatePrototypeGetMinutes, 0, true); |
+ SimpleInstallFunction(prototype, "setMinutes", |
+ Builtins::kDatePrototypeSetMinutes, 3, false); |
SimpleInstallFunction(prototype, "getMonth", |
Builtins::kDatePrototypeGetMonth, 0, true); |
+ SimpleInstallFunction(prototype, "setMonth", |
+ Builtins::kDatePrototypeSetMonth, 2, false); |
SimpleInstallFunction(prototype, "getSeconds", |
Builtins::kDatePrototypeGetSeconds, 0, true); |
+ SimpleInstallFunction(prototype, "setSeconds", |
+ Builtins::kDatePrototypeSetSeconds, 2, false); |
SimpleInstallFunction(prototype, "getTime", Builtins::kDatePrototypeGetTime, |
0, true); |
+ SimpleInstallFunction(prototype, "setTime", Builtins::kDatePrototypeSetTime, |
+ 1, false); |
SimpleInstallFunction(prototype, "getTimezoneOffset", |
Builtins::kDatePrototypeGetTimezoneOffset, 0, true); |
SimpleInstallFunction(prototype, "getUTCDate", |
Builtins::kDatePrototypeGetUTCDate, 0, true); |
+ SimpleInstallFunction(prototype, "setUTCDate", |
+ Builtins::kDatePrototypeSetUTCDate, 1, false); |
SimpleInstallFunction(prototype, "getUTCDay", |
Builtins::kDatePrototypeGetUTCDay, 0, true); |
SimpleInstallFunction(prototype, "getUTCFullYear", |
Builtins::kDatePrototypeGetUTCFullYear, 0, true); |
+ SimpleInstallFunction(prototype, "setUTCFullYear", |
+ Builtins::kDatePrototypeSetUTCFullYear, 3, false); |
SimpleInstallFunction(prototype, "getUTCHours", |
Builtins::kDatePrototypeGetUTCHours, 0, true); |
+ SimpleInstallFunction(prototype, "setUTCHours", |
+ Builtins::kDatePrototypeSetUTCHours, 4, false); |
SimpleInstallFunction(prototype, "getUTCMilliseconds", |
Builtins::kDatePrototypeGetUTCMilliseconds, 0, true); |
+ SimpleInstallFunction(prototype, "setUTCMilliseconds", |
+ Builtins::kDatePrototypeSetUTCMilliseconds, 1, false); |
SimpleInstallFunction(prototype, "getUTCMinutes", |
Builtins::kDatePrototypeGetUTCMinutes, 0, true); |
+ SimpleInstallFunction(prototype, "setUTCMinutes", |
+ Builtins::kDatePrototypeSetUTCMinutes, 3, false); |
SimpleInstallFunction(prototype, "getUTCMonth", |
Builtins::kDatePrototypeGetUTCMonth, 0, true); |
+ SimpleInstallFunction(prototype, "setUTCMonth", |
+ Builtins::kDatePrototypeSetUTCMonth, 2, false); |
SimpleInstallFunction(prototype, "getUTCSeconds", |
Builtins::kDatePrototypeGetUTCSeconds, 0, true); |
+ SimpleInstallFunction(prototype, "setUTCSeconds", |
+ Builtins::kDatePrototypeSetUTCSeconds, 2, false); |
SimpleInstallFunction(prototype, "valueOf", Builtins::kDatePrototypeValueOf, |
0, false); |
+ SimpleInstallFunction(prototype, "getYear", Builtins::kDatePrototypeGetYear, |
+ 0, true); |
+ SimpleInstallFunction(prototype, "setYear", Builtins::kDatePrototypeSetYear, |
+ 1, false); |
+ |
+#ifndef V8_I18N_SUPPORT |
+ // Install i18n fallback functions. |
+ SimpleInstallFunction(prototype, "toLocaleString", |
+ Builtins::kDatePrototypeToString, 0, false); |
+ SimpleInstallFunction(prototype, "toLocaleDateString", |
+ Builtins::kDatePrototypeToDateString, 0, false); |
+ SimpleInstallFunction(prototype, "toLocaleTimeString", |
+ Builtins::kDatePrototypeToTimeString, 0, false); |
+#endif // V8_I18N_SUPPORT |
// Install the @@toPrimitive function. |
Handle<JSFunction> to_primitive = InstallFunction( |