12 bool DateParser::DayComposer::Write(FixedArray* output) {
13 if (index_ < 1)
return false;
15 while (index_ < kSize) {
23 if (named_month_ == kNone) {
24 if (is_iso_date_ || (index_ == 3 && !IsDay(comp_[0]))) {
33 if (index_ == 3) year = comp_[2];
40 }
else if (!IsDay(comp_[0])) {
52 if (
Between(year, 0, 49)) year += 2000;
53 else if (
Between(year, 50, 99)) year += 1900;
56 if (!
Smi::IsValid(year) || !IsMonth(month) || !IsDay(day))
return false;
65 bool DateParser::TimeComposer::Write(FixedArray* output) {
67 while (index_ < kSize) {
72 int& minute = comp_[1];
73 int& second = comp_[2];
74 int& millisecond = comp_[3];
76 if (hour_offset_ != kNone) {
77 if (!IsHour12(hour))
return false;
82 if (!IsHour(hour) || !IsMinute(minute) ||
83 !IsSecond(second) || !IsMillisecond(millisecond))
return false;
93 bool DateParser::TimeZoneComposer::Write(FixedArray* output) {
95 if (hour_ == kNone) hour_ = 0;
96 if (minute_ == kNone) minute_ = 0;
97 int total_seconds = sign_ * (hour_ * 3600 + minute_ * 60);
101 output->set_null(UTC_OFFSET);
106 const int8_t DateParser::KeywordTable::
164 int number = token.
number();
165 int length = token.
length();
171 }
else if (length == 2) {
174 }
else if (length > 3) {
180 DCHECK(factor <= 100000000);
183 }
while (length > 3);
static const int kPrefixLength
static int Lookup(const uint32_t *pre, int len)
static const int kEntrySize
static const int kTypeOffset
static const int8_t array[][kEntrySize]
static const int kMaxSignificantDigits
static int ReadMilliseconds(DateToken number)
static Smi * FromInt(int value)
static bool IsValid(intptr_t value)
#define DCHECK(condition)
static bool Between(uint32_t character, uint32_t from, uint32_t to)
Debugger support for the V8 JavaScript engine.