Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
[JSC] String#toWellFormed should return stringified value
https://bugs.webkit.org/show_bug.cgi?id=251757 rdar://problem/105104668 Reviewed by Justin Michaud and Mark Lam. We should return stringified value instead of original thisValue for the fast path. * JSTests/stress/string-to-well-formed-number.js: Added. (shouldBe): * Source/JavaScriptCore/runtime/StringPrototype.cpp: (JSC::JSC_DEFINE_HOST_FUNCTION): Canonical link: https://commits.webkit.org/260043@main
- Loading branch information
1 parent
5cf63af
commit aa30faf
Showing
2 changed files
with
14 additions
and
4 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
function shouldBe(actual, expected) { | ||
if (actual !== expected) | ||
throw new Error('bad value: ' + actual); | ||
} | ||
|
||
shouldBe(String.prototype.toWellFormed.call(1), '1'); | ||
shouldBe(String.prototype.toWellFormed.call(42.5), '42.5'); |
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