| Index: src/api.cc
|
| ===================================================================
|
| --- src/api.cc (revision 6095)
|
| +++ src/api.cc (working copy)
|
| @@ -3127,14 +3127,15 @@
|
| // using StringInputBuffer or Get(i) to access the characters.
|
| str->TryFlatten();
|
| }
|
| - int end = length;
|
| - if ( (length == -1) || (length > str->length() - start) )
|
| - end = str->length() - start;
|
| + int end = start + length;
|
| + if ((length == -1) || (length > str->length() - start) )
|
| + end = str->length();
|
| if (end < 0) return 0;
|
| i::String::WriteToFlat(*str, buffer, start, end);
|
| - if (length == -1 || end < length)
|
| - buffer[end] = '\0';
|
| - return end;
|
| + if (length == -1 || end - start < length) {
|
| + buffer[end - start] = '\0';
|
| + }
|
| + return end - start;
|
| }
|
|
|
|
|
| @@ -3801,6 +3802,35 @@
|
| }
|
|
|
|
|
| +void v8::Date::DateTimeConfigurationChangeNotification() {
|
| + ON_BAILOUT("v8::Date::DateTimeConfigurationChangeNotification()", return);
|
| + LOG_API("Date::DateTimeConfigurationChangeNotification");
|
| + ENTER_V8;
|
| +
|
| + HandleScope scope;
|
| +
|
| + // Get the function ResetDateCache (defined in date-delay.js).
|
| + i::Handle<i::String> func_name_str =
|
| + i::Factory::LookupAsciiSymbol("ResetDateCache");
|
| + i::MaybeObject* result = i::Top::builtins()->GetProperty(*func_name_str);
|
| + i::Object* object_func;
|
| + if (!result->ToObject(&object_func)) {
|
| + return;
|
| + }
|
| +
|
| + if (object_func->IsJSFunction()) {
|
| + i::Handle<i::JSFunction> func =
|
| + i::Handle<i::JSFunction>(i::JSFunction::cast(object_func));
|
| +
|
| + // Call ResetDateCache(0 but expect no exceptions:
|
| + bool caught_exception = false;
|
| + i::Handle<i::Object> result =
|
| + i::Execution::TryCall(func, i::Top::builtins(), 0, NULL,
|
| + &caught_exception);
|
| + }
|
| +}
|
| +
|
| +
|
| static i::Handle<i::String> RegExpFlagsToString(RegExp::Flags flags) {
|
| char flags_buf[3];
|
| int num_flags = 0;
|
| @@ -4978,6 +5008,7 @@
|
| }
|
|
|
| int Testing::GetStressRuns() {
|
| + if (internal::FLAG_stress_runs != 0) return internal::FLAG_stress_runs;
|
| #ifdef DEBUG
|
| // In debug mode the code runs much slower so stressing will only make two
|
| // runs.
|
|
|