Index: src/runtime/runtime-i18n.cc |
diff --git a/src/runtime/runtime-i18n.cc b/src/runtime/runtime-i18n.cc |
index 0eca8fadaec9f12758017a80464983aa16e5a36c..faf67e0ac7cb819de11d057077e6536d3dfa712b 100644 |
--- a/src/runtime/runtime-i18n.cc |
+++ b/src/runtime/runtime-i18n.cc |
@@ -569,18 +569,22 @@ RUNTIME_FUNCTION(Runtime_InternalCompare) { |
string1 = String::Flatten(string1); |
string2 = String::Flatten(string2); |
- DisallowHeapAllocation no_gc; |
- int32_t length1 = string1->length(); |
- int32_t length2 = string2->length(); |
- String::FlatContent flat1 = string1->GetFlatContent(); |
- String::FlatContent flat2 = string2->GetFlatContent(); |
- base::SmartArrayPointer<uc16> sap1; |
- base::SmartArrayPointer<uc16> sap2; |
- const UChar* string_val1 = GetUCharBufferFromFlat(flat1, &sap1, length1); |
- const UChar* string_val2 = GetUCharBufferFromFlat(flat2, &sap2, length2); |
+ |
+ UCollationResult result; |
UErrorCode status = U_ZERO_ERROR; |
- UCollationResult result = |
- collator->compare(string_val1, length1, string_val2, length2, status); |
+ { |
+ DisallowHeapAllocation no_gc; |
+ int32_t length1 = string1->length(); |
+ int32_t length2 = string2->length(); |
+ String::FlatContent flat1 = string1->GetFlatContent(); |
+ String::FlatContent flat2 = string2->GetFlatContent(); |
+ base::SmartArrayPointer<uc16> sap1; |
+ base::SmartArrayPointer<uc16> sap2; |
+ const UChar* string_val1 = GetUCharBufferFromFlat(flat1, &sap1, length1); |
+ const UChar* string_val2 = GetUCharBufferFromFlat(flat2, &sap2, length2); |
+ result = |
+ collator->compare(string_val1, length1, string_val2, length2, status); |
+ } |
if (U_FAILURE(status)) return isolate->ThrowIllegalOperation(); |
return *isolate->factory()->NewNumberFromInt(result); |