| Index: src/runtime.cc
|
| diff --git a/src/runtime.cc b/src/runtime.cc
|
| index 134fddf114d0f22dab922198cbb6b4d5c94b8015..940c89d6c76f6e86e8b8a4a6ccd72cf02c9c741d 100644
|
| --- a/src/runtime.cc
|
| +++ b/src/runtime.cc
|
| @@ -4484,8 +4484,19 @@ static Object* Runtime_DateParseString(Arguments args) {
|
| CONVERT_CHECKED(String, string_object, args[0]);
|
|
|
| Handle<String> str(string_object);
|
| + FlattenString(str);
|
| Handle<FixedArray> output = Factory::NewFixedArray(DateParser::OUTPUT_SIZE);
|
| - if (DateParser::Parse(*str, *output)) {
|
| + bool result;
|
| + {
|
| + AssertNoAllocation no_allocation;
|
| + if (StringShape(*str).IsAsciiRepresentation()) {
|
| + result = DateParser::Parse(str->ToAsciiVector(), *output);
|
| + } else {
|
| + ASSERT(StringShape(*str).IsTwoByteRepresentation());
|
| + result = DateParser::Parse(str->ToUC16Vector(), *output);
|
| + }
|
| + }
|
| + if (result) {
|
| return *Factory::NewJSArrayWithElements(output);
|
| } else {
|
| return *Factory::null_value();
|
|
|