Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(104)

Side by Side Diff: src/runtime/runtime-date.cc

Issue 1130073005: Revert of Migrate error messages, part 10. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/runtime/runtime-classes.cc ('k') | src/runtime/runtime-i18n.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/v8.h" 5 #include "src/v8.h"
6 6
7 #include "src/arguments.h" 7 #include "src/arguments.h"
8 #include "src/date.h" 8 #include "src/date.h"
9 #include "src/dateparser-inl.h" 9 #include "src/dateparser-inl.h"
10 #include "src/messages.h"
11 #include "src/runtime/runtime-utils.h" 10 #include "src/runtime/runtime-utils.h"
12 11
13 namespace v8 { 12 namespace v8 {
14 namespace internal { 13 namespace internal {
15 14
16 RUNTIME_FUNCTION(Runtime_DateMakeDay) { 15 RUNTIME_FUNCTION(Runtime_DateMakeDay) {
17 SealHandleScope shs(isolate); 16 SealHandleScope shs(isolate);
18 DCHECK(args.length() == 2); 17 DCHECK(args.length() == 2);
19 18
20 CONVERT_SMI_ARG_CHECKED(year, 0); 19 CONVERT_SMI_ARG_CHECKED(year, 0);
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 } 55 }
57 } 56 }
58 date->SetValue(*value, is_value_nan); 57 date->SetValue(*value, is_value_nan);
59 return *value; 58 return *value;
60 } 59 }
61 60
62 61
63 RUNTIME_FUNCTION(Runtime_ThrowNotDateError) { 62 RUNTIME_FUNCTION(Runtime_ThrowNotDateError) {
64 HandleScope scope(isolate); 63 HandleScope scope(isolate);
65 DCHECK(args.length() == 0); 64 DCHECK(args.length() == 0);
66 THROW_NEW_ERROR_RETURN_FAILURE(isolate, 65 THROW_NEW_ERROR_RETURN_FAILURE(
67 NewTypeError(MessageTemplate::kNotDateObject)); 66 isolate, NewTypeError("not_date_object", HandleVector<Object>(NULL, 0)));
68 } 67 }
69 68
70 69
71 RUNTIME_FUNCTION(Runtime_DateCurrentTime) { 70 RUNTIME_FUNCTION(Runtime_DateCurrentTime) {
72 HandleScope scope(isolate); 71 HandleScope scope(isolate);
73 DCHECK(args.length() == 0); 72 DCHECK(args.length() == 0);
74 if (FLAG_log_timer_events || FLAG_prof_cpp) LOG(isolate, CurrentTimeEvent()); 73 if (FLAG_log_timer_events || FLAG_prof_cpp) LOG(isolate, CurrentTimeEvent());
75 74
76 // According to ECMA-262, section 15.9.1, page 117, the precision of 75 // According to ECMA-262, section 15.9.1, page 117, the precision of
77 // the number in a Date object representing a particular instant in 76 // the number in a Date object representing a particular instant in
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
173 172
174 173
175 RUNTIME_FUNCTION(Runtime_DateField) { 174 RUNTIME_FUNCTION(Runtime_DateField) {
176 SealHandleScope shs(isolate); 175 SealHandleScope shs(isolate);
177 DCHECK(args.length() == 2); 176 DCHECK(args.length() == 2);
178 CONVERT_ARG_CHECKED(Object, obj, 0); 177 CONVERT_ARG_CHECKED(Object, obj, 0);
179 CONVERT_SMI_ARG_CHECKED(index, 1); 178 CONVERT_SMI_ARG_CHECKED(index, 1);
180 if (!obj->IsJSDate()) { 179 if (!obj->IsJSDate()) {
181 HandleScope scope(isolate); 180 HandleScope scope(isolate);
182 THROW_NEW_ERROR_RETURN_FAILURE( 181 THROW_NEW_ERROR_RETURN_FAILURE(
183 isolate, NewTypeError(MessageTemplate::kNotDateObject)); 182 isolate,
183 NewTypeError("not_date_object", HandleVector<Object>(NULL, 0)));
184 } 184 }
185 JSDate* date = JSDate::cast(obj); 185 JSDate* date = JSDate::cast(obj);
186 if (index == 0) return date->value(); 186 if (index == 0) return date->value();
187 return JSDate::GetField(date, Smi::FromInt(index)); 187 return JSDate::GetField(date, Smi::FromInt(index));
188 } 188 }
189 } 189 }
190 } // namespace v8::internal 190 } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/runtime/runtime-classes.cc ('k') | src/runtime/runtime-i18n.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698