Title: [283435] trunk
Revision
283435
Author
[email protected]
Date
2021-10-01 23:51:34 -0700 (Fri, 01 Oct 2021)

Log Message

Unreviewed, reverting r283293.
https://bugs.webkit.org/show_bug.cgi?id=231116

changing print() broke a lot of random things

Reverted changeset:

"Print values in a nicer way in the jsc shell"
https://bugs.webkit.org/show_bug.cgi?id=230931
https://commits.webkit.org/r283293

Modified Paths

Diff

Modified: trunk/JSTests/ChakraCore/test/jsc-lib.js (283434 => 283435)


--- trunk/JSTests/ChakraCore/test/jsc-lib.js	2021-10-02 06:22:54 UTC (rev 283434)
+++ trunk/JSTests/ChakraCore/test/jsc-lib.js	2021-10-02 06:51:34 UTC (rev 283435)
@@ -1,5 +1,3 @@
-print = legacyPrint;
-
 WScript = {
     _jscGC: gc,
     _jscLoad: load,

Modified: trunk/JSTests/ChangeLog (283434 => 283435)


--- trunk/JSTests/ChangeLog	2021-10-02 06:22:54 UTC (rev 283434)
+++ trunk/JSTests/ChangeLog	2021-10-02 06:51:34 UTC (rev 283435)
@@ -1,3 +1,16 @@
+2021-10-01  Commit Queue  <[email protected]>
+
+        Unreviewed, reverting r283293.
+        https://bugs.webkit.org/show_bug.cgi?id=231116
+
+        changing print() broke a lot of random things
+
+        Reverted changeset:
+
+        "Print values in a nicer way in the jsc shell"
+        https://bugs.webkit.org/show_bug.cgi?id=230931
+        https://commits.webkit.org/r283293
+
 2021-09-30  Saam Barati  <[email protected]>
 
         The DFG/FTL need to be aware that Proxy's can produce "function" for typeof and might be callable

Modified: trunk/JSTests/exceptionFuzz/3d-cube.js (283434 => 283435)


--- trunk/JSTests/exceptionFuzz/3d-cube.js	2021-10-02 06:22:54 UTC (rev 283434)
+++ trunk/JSTests/exceptionFuzz/3d-cube.js	2021-10-02 06:51:34 UTC (rev 283435)
@@ -358,5 +358,5 @@
 
 })();
 } catch (e) {
-    legacyPrint("JSC EXCEPTION FUZZ: Caught exception: " + e);
+    print("JSC EXCEPTION FUZZ: Caught exception: " + e);
 }

Modified: trunk/JSTests/exceptionFuzz/date-format-xparb.js (283434 => 283435)


--- trunk/JSTests/exceptionFuzz/date-format-xparb.js	2021-10-02 06:22:54 UTC (rev 283434)
+++ trunk/JSTests/exceptionFuzz/date-format-xparb.js	2021-10-02 06:51:34 UTC (rev 283435)
@@ -424,5 +424,5 @@
 
 })();
 } catch (e) {
-    legacyPrint("JSC EXCEPTION FUZZ: Caught exception: " + e);
+    print("JSC EXCEPTION FUZZ: Caught exception: " + e);
 }

Modified: trunk/JSTests/exceptionFuzz/earley-boyer.js (283434 => 283435)


--- trunk/JSTests/exceptionFuzz/earley-boyer.js	2021-10-02 06:22:54 UTC (rev 283434)
+++ trunk/JSTests/exceptionFuzz/earley-boyer.js	2021-10-02 06:51:34 UTC (rev 283435)
@@ -4684,6 +4684,6 @@
 }
 })();
 } catch (e) {
-    legacyPrint("JSC EXCEPTION FUZZ: Caught exception: " + e);
+    print("JSC EXCEPTION FUZZ: Caught exception: " + e);
 }
 

Modified: trunk/LayoutTests/ChangeLog (283434 => 283435)


--- trunk/LayoutTests/ChangeLog	2021-10-02 06:22:54 UTC (rev 283434)
+++ trunk/LayoutTests/ChangeLog	2021-10-02 06:51:34 UTC (rev 283435)
@@ -1,3 +1,16 @@
+2021-10-01  Commit Queue  <[email protected]>
+
+        Unreviewed, reverting r283293.
+        https://bugs.webkit.org/show_bug.cgi?id=231116
+
+        changing print() broke a lot of random things
+
+        Reverted changeset:
+
+        "Print values in a nicer way in the jsc shell"
+        https://bugs.webkit.org/show_bug.cgi?id=230931
+        https://commits.webkit.org/r283293
+
 2021-10-01  Ayumi Kojima  <[email protected]>
 
         [ macOS wk2 Release ] http/tests/loading/preload-slow-loading.py is a flaky failure.

Modified: trunk/LayoutTests/resources/standalone-pre.js (283434 => 283435)


--- trunk/LayoutTests/resources/standalone-pre.js	2021-10-02 06:22:54 UTC (rev 283434)
+++ trunk/LayoutTests/resources/standalone-pre.js	2021-10-02 06:51:34 UTC (rev 283435)
@@ -13,8 +13,6 @@
 didPassSomeTestsSilently = false;
 didFailSomeTests = false;
 
-print = legacyPrint;
-
 function description(msg)
 {
     print(msg);

Modified: trunk/Source/_javascript_Core/ChangeLog (283434 => 283435)


--- trunk/Source/_javascript_Core/ChangeLog	2021-10-02 06:22:54 UTC (rev 283434)
+++ trunk/Source/_javascript_Core/ChangeLog	2021-10-02 06:51:34 UTC (rev 283435)
@@ -1,3 +1,16 @@
+2021-10-01  Commit Queue  <[email protected]>
+
+        Unreviewed, reverting r283293.
+        https://bugs.webkit.org/show_bug.cgi?id=231116
+
+        changing print() broke a lot of random things
+
+        Reverted changeset:
+
+        "Print values in a nicer way in the jsc shell"
+        https://bugs.webkit.org/show_bug.cgi?id=230931
+        https://commits.webkit.org/r283293
+
 2021-10-01  Yusuke Suzuki  <[email protected]>
 
         Disable new incumbent-window until it is fully implemented

Modified: trunk/Source/_javascript_Core/jsc.cpp (283434 => 283435)


--- trunk/Source/_javascript_Core/jsc.cpp	2021-10-02 06:22:54 UTC (rev 283434)
+++ trunk/Source/_javascript_Core/jsc.cpp	2021-10-02 06:51:34 UTC (rev 283435)
@@ -278,7 +278,6 @@
 
 static JSC_DECLARE_HOST_FUNCTION(functionPrintStdOut);
 static JSC_DECLARE_HOST_FUNCTION(functionPrintStdErr);
-static JSC_DECLARE_HOST_FUNCTION(functionLegacyPrint);
 static JSC_DECLARE_HOST_FUNCTION(functionDebug);
 static JSC_DECLARE_HOST_FUNCTION(functionDescribe);
 static JSC_DECLARE_HOST_FUNCTION(functionDescribeArray);
@@ -528,7 +527,6 @@
         addFunction(vm, "describeArray", functionDescribeArray, 1);
         addFunction(vm, "print", functionPrintStdOut, 1);
         addFunction(vm, "printErr", functionPrintStdErr, 1);
-        addFunction(vm, "legacyPrint", functionLegacyPrint, 1);
         addFunction(vm, "quit", functionQuit, 0);
         addFunction(vm, "gc", functionGCAndSweep, 0);
         addFunction(vm, "fullGC", functionFullGC, 0);
@@ -1240,10 +1238,9 @@
     return metaProperties;
 }
 
-template <typename T>
-static CString toCString(JSGlobalObject* globalObject, ThrowScope& scope, T& string)
+static CString cStringFromViewWithString(JSGlobalObject* globalObject, ThrowScope& scope, StringViewWithUnderlyingString& viewWithString)
 {
-    Expected<CString, UTF8ConversionError> expectedString = string.tryGetUtf8();
+    Expected<CString, UTF8ConversionError> expectedString = viewWithString.view.tryGetUtf8();
     if (expectedString)
         return expectedString.value();
     switch (expectedString.error()) {
@@ -1262,7 +1259,7 @@
     return { };
 }
 
-static EncodedJSValue printInternal(JSGlobalObject* globalObject, CallFrame* callFrame, FILE* out, bool legacy)
+static EncodedJSValue printInternal(JSGlobalObject* globalObject, CallFrame* callFrame, FILE* out)
 {
     VM& vm = globalObject->vm();
     auto scope = DECLARE_THROW_SCOPE(vm);
@@ -1280,11 +1277,13 @@
             if (EOF == fputc(' ', out))
                 goto fail;
 
-        String string = legacy ? callFrame->uncheckedArgument(i).toWTFString(globalObject) : callFrame->uncheckedArgument(i).toWTFStringForConsole(globalObject);
+        auto* jsString = callFrame->uncheckedArgument(i).toString(globalObject);
         RETURN_IF_EXCEPTION(scope, { });
-        auto cString = toCString(globalObject, scope, string);
+        auto viewWithString = jsString->viewWithUnderlyingString(globalObject);
         RETURN_IF_EXCEPTION(scope, { });
-        fwrite(cString.data(), sizeof(char), cString.length(), out);
+        auto string = cStringFromViewWithString(globalObject, scope, viewWithString);
+        RETURN_IF_EXCEPTION(scope, { });
+        fwrite(string.data(), sizeof(char), string.length(), out);
         if (ferror(out))
             goto fail;
     }
@@ -1297,19 +1296,14 @@
 
 JSC_DEFINE_HOST_FUNCTION(functionPrintStdOut, (JSGlobalObject* globalObject, CallFrame* callFrame))
 {
-    return printInternal(globalObject, callFrame, stdout, false);
+    return printInternal(globalObject, callFrame, stdout);
 }
 
 JSC_DEFINE_HOST_FUNCTION(functionPrintStdErr, (JSGlobalObject* globalObject, CallFrame* callFrame))
 {
-    return printInternal(globalObject, callFrame, stderr, false);
+    return printInternal(globalObject, callFrame, stderr);
 }
 
-JSC_DEFINE_HOST_FUNCTION(functionLegacyPrint, (JSGlobalObject* globalObject, CallFrame* callFrame))
-{
-    return printInternal(globalObject, callFrame, stdout, true);
-}
-
 JSC_DEFINE_HOST_FUNCTION(functionDebug, (JSGlobalObject* globalObject, CallFrame* callFrame))
 {
     VM& vm = globalObject->vm();
@@ -1318,7 +1312,7 @@
     RETURN_IF_EXCEPTION(scope, { });
     auto viewWithString = jsString->viewWithUnderlyingString(globalObject);
     RETURN_IF_EXCEPTION(scope, { });
-    auto string = toCString(globalObject, scope, viewWithString.view);
+    auto string = cStringFromViewWithString(globalObject, scope, viewWithString);
     RETURN_IF_EXCEPTION(scope, { });
     fputs("--> ", stderr);
     fwrite(string.data(), sizeof(char), string.length(), stderr);
@@ -3277,7 +3271,7 @@
             fputs("Exception: ", stdout);
             utf8 = evaluationException->value().toWTFString(globalObject).tryGetUtf8();
         } else
-            utf8 = returnValue.toWTFStringForConsole(globalObject).tryGetUtf8();
+            utf8 = returnValue.toWTFString(globalObject).tryGetUtf8();
 
         CString result;
         if (utf8)

Modified: trunk/Source/_javascript_Core/runtime/JSCJSValue.cpp (283434 => 283435)


--- trunk/Source/_javascript_Core/runtime/JSCJSValue.cpp	2021-10-02 06:22:54 UTC (rev 283434)
+++ trunk/Source/_javascript_Core/runtime/JSCJSValue.cpp	2021-10-02 06:51:34 UTC (rev 283435)
@@ -471,19 +471,4 @@
 }
 #endif
 
-WTF::String JSValue::toWTFStringForConsole(JSGlobalObject* globalObject) const
-{
-    VM& vm = globalObject->vm();
-    auto scope = DECLARE_THROW_SCOPE(vm);
-    JSString* string = toString(globalObject);
-    RETURN_IF_EXCEPTION(scope, { });
-    String result = string->value(globalObject);
-    RETURN_IF_EXCEPTION(scope, { });
-    if (isString())
-        return makeString("\"", result, "\"");
-    if (jsDynamicCast<JSArray*>(vm, *this))
-        return makeString("[", result, "]");
-    return result;
-}
-
 } // namespace JSC

Modified: trunk/Source/_javascript_Core/runtime/JSCJSValue.h (283434 => 283435)


--- trunk/Source/_javascript_Core/runtime/JSCJSValue.h	2021-10-02 06:22:54 UTC (rev 283434)
+++ trunk/Source/_javascript_Core/runtime/JSCJSValue.h	2021-10-02 06:51:34 UTC (rev 283435)
@@ -289,7 +289,6 @@
     Identifier toPropertyKey(JSGlobalObject*) const;
     JSValue toPropertyKeyValue(JSGlobalObject*) const;
     WTF::String toWTFString(JSGlobalObject*) const;
-    JS_EXPORT_PRIVATE WTF::String toWTFStringForConsole(JSGlobalObject*) const;
     JSObject* toObject(JSGlobalObject*) const;
 
     // Integer conversions.
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to