haikuwebkit/LayoutTests/js/string-padstart.html

12 lines
253 B
HTML
Raw Permalink Normal View History

padStart/padEnd with Infinity produces unexpected result https://bugs.webkit.org/show_bug.cgi?id=159543 Patch by Joseph Pecoraro <pecoraro@apple.com> on 2016-07-07 Reviewed by Benjamin Poulain. Source/JavaScriptCore: * builtins/GlobalOperations.js: (globalPrivate.toLength): Fix style. * builtins/StringPrototype.js: (padStart): (padEnd): After all observable operations, and after empty string has been handled, throw an out of memory error if the resulting string would be greater than the maximum string size. * tests/es6/Object_static_methods_Object.getOwnPropertyDescriptors-proxy.js: (shouldThrow): Deleted. * tests/es6/Object_static_methods_Object.getOwnPropertyDescriptors.js: (shouldThrow): (testMeta): * tests/es6/String.prototype_methods_String.prototype.padEnd.js: (shouldThrow): (TestToLength): (TestMemoryLimits): (TestMeta): Deleted. * tests/es6/String.prototype_methods_String.prototype.padStart.js: (shouldThrow): (TestToLength): (TestMemoryLimits): Replace incorrect shouldThrow(..., errorType) with explicit shouldThrow(..., errorMessage). The old shouldThrow would incorrectly succeed if the expected error type was just "Error". Now we explicitly check the error message. LayoutTests: * js/script-tests/string-padend.js: Added. (thisObject.toString): (lengthObject.valueOf): (fillObject.toString): * js/script-tests/string-padstart.js: Added. (thisObject.toString): (lengthObject.valueOf): (fillObject.toString): * js/string-padend-expected.txt: Added. * js/string-padend.html: Added. * js/string-padstart-expected.txt: Added. * js/string-padstart.html: Added. Add some basic String.prototype.padStart/padEnd test coverage that is not just in the JavaScriptCore/tests/es6 directory. Canonical link: https://commits.webkit.org/177687@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@202966 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-07-08 06:25:34 +00:00
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<script src="../resources/js-test-pre.js"></script>
</head>
<body>
<script src="script-tests/string-padstart.js"></script>
<script src="../resources/js-test-post.js"></script>
</body>
</html>