Title: [182577] trunk/Source/_javascript_Core
Revision
182577
Author
[email protected]
Date
2015-04-08 18:37:50 -0700 (Wed, 08 Apr 2015)

Log Message

Use jsNontrivialString in more places if the string is guaranteed to be 2 or more characters
https://bugs.webkit.org/show_bug.cgi?id=143430

Reviewed by Darin Adler.

* runtime/ExceptionHelpers.cpp:
(JSC::errorDescriptionForValue):
* runtime/NumberPrototype.cpp:
(JSC::numberProtoFuncToExponential):
(JSC::numberProtoFuncToPrecision):
(JSC::numberProtoFuncToString):
* runtime/SymbolPrototype.cpp:
(JSC::symbolProtoFuncToString):

Modified Paths

Diff

Modified: trunk/Source/_javascript_Core/ChangeLog (182576 => 182577)


--- trunk/Source/_javascript_Core/ChangeLog	2015-04-09 01:02:14 UTC (rev 182576)
+++ trunk/Source/_javascript_Core/ChangeLog	2015-04-09 01:37:50 UTC (rev 182577)
@@ -1,3 +1,19 @@
+2015-04-08  Joseph Pecoraro  <[email protected]>
+
+        Use jsNontrivialString in more places if the string is guaranteed to be 2 or more characters
+        https://bugs.webkit.org/show_bug.cgi?id=143430
+
+        Reviewed by Darin Adler.
+
+        * runtime/ExceptionHelpers.cpp:
+        (JSC::errorDescriptionForValue):
+        * runtime/NumberPrototype.cpp:
+        (JSC::numberProtoFuncToExponential):
+        (JSC::numberProtoFuncToPrecision):
+        (JSC::numberProtoFuncToString):
+        * runtime/SymbolPrototype.cpp:
+        (JSC::symbolProtoFuncToString):
+
 2015-04-08  Filip Pizlo  <[email protected]>
 
         JSArray::sortNumeric should handle ArrayWithUndecided

Modified: trunk/Source/_javascript_Core/runtime/ExceptionHelpers.cpp (182576 => 182577)


--- trunk/Source/_javascript_Core/runtime/ExceptionHelpers.cpp	2015-04-09 01:02:14 UTC (rev 182576)
+++ trunk/Source/_javascript_Core/runtime/ExceptionHelpers.cpp	2015-04-09 01:37:50 UTC (rev 182577)
@@ -101,7 +101,7 @@
     if (v.isFalse())
         return vm.smallStrings.falseString();
     if (v.isString())
-        return jsString(&vm, makeString('"',  asString(v)->value(exec), '"'));
+        return jsNontrivialString(&vm, makeString('"',  asString(v)->value(exec), '"'));
     if (v.isObject()) {
         CallData callData;
         JSObject* object = asObject(v);

Modified: trunk/Source/_javascript_Core/runtime/NumberPrototype.cpp (182576 => 182577)


--- trunk/Source/_javascript_Core/runtime/NumberPrototype.cpp	2015-04-09 01:02:14 UTC (rev 182576)
+++ trunk/Source/_javascript_Core/runtime/NumberPrototype.cpp	2015-04-09 01:37:50 UTC (rev 182577)
@@ -378,7 +378,7 @@
 
     // Handle NaN and Infinity.
     if (!std::isfinite(x))
-        return JSValue::encode(jsString(exec, String::numberToStringECMAScript(x)));
+        return JSValue::encode(jsNontrivialString(exec, String::numberToStringECMAScript(x)));
 
     // Round if the argument is not undefined, always format as exponential.
     char buffer[WTF::NumberToStringBufferLength];
@@ -446,7 +446,7 @@
 
     // Handle NaN and Infinity.
     if (!std::isfinite(x))
-        return JSValue::encode(jsString(exec, String::numberToStringECMAScript(x)));
+        return JSValue::encode(jsNontrivialString(exec, String::numberToStringECMAScript(x)));
 
     NumberToStringBuffer buffer;
     return JSValue::encode(jsString(exec, String(numberToFixedPrecisionString(x, significantFigures, buffer))));
@@ -540,7 +540,7 @@
     }
 
     if (!std::isfinite(doubleValue))
-        return JSValue::encode(jsString(exec, String::numberToStringECMAScript(doubleValue)));
+        return JSValue::encode(jsNontrivialString(exec, String::numberToStringECMAScript(doubleValue)));
 
     RadixBuffer s;
     return JSValue::encode(jsString(exec, toStringWithRadix(s, doubleValue, radix)));

Modified: trunk/Source/_javascript_Core/runtime/SymbolPrototype.cpp (182576 => 182577)


--- trunk/Source/_javascript_Core/runtime/SymbolPrototype.cpp	2015-04-09 01:02:14 UTC (rev 182576)
+++ trunk/Source/_javascript_Core/runtime/SymbolPrototype.cpp	2015-04-09 01:37:50 UTC (rev 182577)
@@ -83,7 +83,7 @@
         symbol = asSymbol(jsCast<SymbolObject*>(thisObject)->internalValue());
     }
 
-    return JSValue::encode(jsString(exec, symbol->descriptiveString()));
+    return JSValue::encode(jsNontrivialString(exec, symbol->descriptiveString()));
 }
 
 EncodedJSValue JSC_HOST_CALL symbolProtoFuncValueOf(ExecState* exec)
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to