Permalink
Show file tree
Hide file tree
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Print values in a nicer way in the jsc shell
https://bugs.webkit.org/show_bug.cgi?id=230931 Reviewed by Tadeu Zagallo. JSTests: * ChakraCore/test/jsc-lib.js: Source/JavaScriptCore: Currently, print(1), print("1"), and print([1]) all print to stdout simply as "1" (without the quotes). Same for values when running the REPL. This isn't super helpful. Let's print quotes for strings, and brackets for arrays. Some tests rely on the old print behavior. Those tests now use the legacyPrint instead. * jsc.cpp: (toCString): (printInternal): (JSC_DEFINE_HOST_FUNCTION): (runInteractive): (cStringFromViewWithString): Deleted. * runtime/JSCJSValue.cpp: (JSC::JSValue::toWTFStringForConsole const): * runtime/JSCJSValue.h: LayoutTests: * resources/standalone-pre.js: Canonical link: https://commits.webkit.org/242318@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@283293 268f45cc-cd09-0410-ab3c-d52691b4dbfc
- Loading branch information
Showing
11 changed files
with
84 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@@ -1,3 +1,5 @@ | ||
print = legacyPrint; | ||
|
||
WScript = { | ||
_jscGC: gc, | ||
_jscLoad: load, | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@@ -358,5 +358,5 @@ DisplArea = null; | ||
|
||
})(); | ||
} catch (e) { | ||
print("JSC EXCEPTION FUZZ: Caught exception: " + e); | ||
legacyPrint("JSC EXCEPTION FUZZ: Caught exception: " + e); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@@ -424,5 +424,5 @@ for (i = 0; i < 4000; ++i) { | ||
|
||
})(); | ||
} catch (e) { | ||
print("JSC EXCEPTION FUZZ: Caught exception: " + e); | ||
legacyPrint("JSC EXCEPTION FUZZ: Caught exception: " + e); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@@ -4684,6 +4684,6 @@ for (var i = 0; i < 4; ++i) { | ||
} | ||
})(); | ||
} catch (e) { | ||
print("JSC EXCEPTION FUZZ: Caught exception: " + e); | ||
legacyPrint("JSC EXCEPTION FUZZ: Caught exception: " + e); | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@@ -13,6 +13,8 @@ silentTestPass = false; | ||
didPassSomeTestsSilently = false; | ||
didFailSomeTests = false; | ||
|
||
print = legacyPrint; | ||
|
||
function description(msg) | ||
{ | ||
print(msg); | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters