Title: [88761] branches/chromium/782/Source

Diff

Modified: branches/chromium/782/Source/_javascript_Core/_javascript_Core.exp (88760 => 88761)


--- branches/chromium/782/Source/_javascript_Core/_javascript_Core.exp	2011-06-14 04:02:28 UTC (rev 88760)
+++ branches/chromium/782/Source/_javascript_Core/_javascript_Core.exp	2011-06-14 04:05:56 UTC (rev 88761)
@@ -571,7 +571,9 @@
 __ZNK3JSC9HashTable11deleteTableEv
 __ZNK3WTF12AtomicString5lowerEv
 __ZNK3WTF13DecimalNumber15toStringDecimalEPtj
+__ZNK3WTF13DecimalNumber19toStringExponentialEPtj
 __ZNK3WTF13DecimalNumber28bufferLengthForStringDecimalEv
+__ZNK3WTF13DecimalNumber32bufferLengthForStringExponentialEv
 __ZNK3WTF6String11toIntStrictEPbi
 __ZNK3WTF6String12toUIntStrictEPbi
 __ZNK3WTF6String13toInt64StrictEPbi

Modified: branches/chromium/782/Source/_javascript_Core/_javascript_Core.vcproj/_javascript_Core/_javascript_Core.def (88760 => 88761)


--- branches/chromium/782/Source/_javascript_Core/_javascript_Core.vcproj/_javascript_Core/_javascript_Core.def	2011-06-14 04:02:28 UTC (rev 88760)
+++ branches/chromium/782/Source/_javascript_Core/_javascript_Core.vcproj/_javascript_Core/_javascript_Core.def	2011-06-14 04:05:56 UTC (rev 88761)
@@ -65,6 +65,7 @@
     ?attach@Debugger@JSC@@QAEXPAVJSGlobalObject@2@@Z
     ?broadcast@ThreadCondition@WTF@@QAEXXZ
     ?bufferLengthForStringDecimal@DecimalNumber@WTF@@QBEIXZ
+    ?bufferLengthForStringExponential@DecimalNumber@WTF@@QBEIXZ
     ?byteCompile@Yarr@JSC@@YA?AV?$PassOwnPtr@UBytecodePattern@Yarr@JSC@@@WTF@@AAUYarrPattern@12@PAVBumpPointerAllocator@4@@Z
     ?byteSize@SourceProviderCache@JSC@@QBEIXZ
     ?calculateDSTOffset@WTF@@YANNN@Z
@@ -348,6 +349,7 @@
     ?toString@JSObject@JSC@@UBE?AVUString@2@PAVExecState@2@@Z
     ?toString@JSString@JSC@@EBE?AVUString@2@PAVExecState@2@@Z
     ?toStringDecimal@DecimalNumber@WTF@@QBEIPA_WI@Z
+    ?toStringExponential@DecimalNumber@WTF@@QBEIPA_WI@Z
     ?toThisObject@JSCell@JSC@@UBEPAVJSObject@2@PAVExecState@2@@Z
     ?toThisObject@JSObject@JSC@@UBEPAV12@PAVExecState@2@@Z
     ?toThisObject@JSString@JSC@@EBEPAVJSObject@2@PAVExecState@2@@Z

Modified: branches/chromium/782/Source/WebCore/inspector/InspectorValues.cpp (88760 => 88761)


--- branches/chromium/782/Source/WebCore/inspector/InspectorValues.cpp	2011-06-14 04:02:28 UTC (rev 88760)
+++ branches/chromium/782/Source/WebCore/inspector/InspectorValues.cpp	2011-06-14 04:05:56 UTC (rev 88761)
@@ -620,7 +620,18 @@
             output->append(falseString, 5);
     } else if (type() == TypeNumber) {
         NumberToStringBuffer buffer;
-        unsigned length = DecimalNumber(m_doubleValue).toStringDecimal(buffer, WTF::NumberToStringBufferLength);
+        DecimalNumber decimal = m_doubleValue;
+        unsigned length = 0;
+        if (decimal.bufferLengthForStringDecimal() > WTF::NumberToStringBufferLength) {
+            // Not enough room for decimal. Use exponential format.
+            if (decimal.bufferLengthForStringExponential() > WTF::NumberToStringBufferLength) {
+                // Fallback for an abnormal case if it's too little even for exponential.
+                output->append("NaN", 3);
+                return;
+            }
+            length = decimal.toStringExponential(buffer, WTF::NumberToStringBufferLength);
+        } else
+            length = decimal.toStringDecimal(buffer, WTF::NumberToStringBufferLength);
         output->append(buffer, length);
     }
 }
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to