From bd445e7612318666c8068f0900b9153be4e309a1 Mon Sep 17 00:00:00 2001 From: johnlenz Date: Mon, 20 May 2019 11:15:47 -0700 Subject: [PATCH] Fix polyfill tests so that they pass on Edge 15. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=249087910 --- .../runtime_tests/polyfill_tests/string_padend_test.js | 6 +++++- .../runtime_tests/polyfill_tests/string_padstart_test.js | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/test/com/google/javascript/jscomp/runtime_tests/polyfill_tests/string_padend_test.js b/test/com/google/javascript/jscomp/runtime_tests/polyfill_tests/string_padend_test.js index 451bd020497..febee0995e2 100644 --- a/test/com/google/javascript/jscomp/runtime_tests/polyfill_tests/string_padend_test.js +++ b/test/com/google/javascript/jscomp/runtime_tests/polyfill_tests/string_padend_test.js @@ -67,6 +67,10 @@ testSuite({ /** @suppress {checkTypes} */ testPadStart_errors() { - assertFails(RangeError, () => 'a'.padEnd(Infinity)); + if (userAgent.EDGE) { + assertFails(Error, () => 'a'.padEnd(Infinity)); // Out of Memory + } else { + assertFails(RangeError, () => 'a'.padEnd(Infinity)); + } }, }); diff --git a/test/com/google/javascript/jscomp/runtime_tests/polyfill_tests/string_padstart_test.js b/test/com/google/javascript/jscomp/runtime_tests/polyfill_tests/string_padstart_test.js index ef91506a054..79260caad7c 100644 --- a/test/com/google/javascript/jscomp/runtime_tests/polyfill_tests/string_padstart_test.js +++ b/test/com/google/javascript/jscomp/runtime_tests/polyfill_tests/string_padstart_test.js @@ -67,6 +67,10 @@ testSuite({ /** @suppress {checkTypes} */ testPadStart_errors() { - assertFails(RangeError, () => 'a'.padStart(Infinity)); + if (userAgent.EDGE) { + assertFails(Error, () => 'a'.padEnd(Infinity)); // Out of Memory + } else { + assertFails(RangeError, () => 'a'.padStart(Infinity)); + } }, });