Chromium Code Reviews| Index: src/runtime.cc |
| diff --git a/src/runtime.cc b/src/runtime.cc |
| index b14cdbdfc3e5b2fa5bd5261bc36c4943da089f47..55555ab73a9d5dcce45036073987c1b608525886 100644 |
| --- a/src/runtime.cc |
| +++ b/src/runtime.cc |
| @@ -5140,7 +5140,9 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_TruncateString) { |
| NoHandleAllocation ha(isolate); |
| CONVERT_ARG_CHECKED(SeqString, string, 0); |
| CONVERT_SMI_ARG_CHECKED(new_length, 1); |
| - return string->Truncate(new_length); |
| + if (new_length == 0) return isolate->heap()->empty_string(); |
|
Hannes Payer (out of office)
2013/03/21 12:48:30
Again, this could be handled in Truncate().
|
| + string->Truncate(new_length); |
| + return string; |
| } |