From 1bb7ecee5b6a12bc291332dc65f5333f83d8ecad Mon Sep 17 00:00:00 2001 From: Philip Chimento Date: Wed, 28 Sep 2022 16:42:40 -0700 Subject: [PATCH] Harness: Account for Symbols being thrown in async tests It's possible for an async test to throw a Symbol (harness/async-gc.js does this.) The Symbol ends up getting passed to $DONE in a .then($DONE, $DONE) call. Previously, $DONE would then throw an exception due to not being able to convert the Symbol to a string. --- harness/doneprintHandle.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/harness/doneprintHandle.js b/harness/doneprintHandle.js index e9681240a9..334d19ec8e 100644 --- a/harness/doneprintHandle.js +++ b/harness/doneprintHandle.js @@ -14,7 +14,7 @@ function $DONE(error) { if(typeof error === 'object' && error !== null && 'name' in error) { __consolePrintHandle__('Test262:AsyncTestFailure:' + error.name + ': ' + error.message); } else { - __consolePrintHandle__('Test262:AsyncTestFailure:Test262Error: ' + error); + __consolePrintHandle__('Test262:AsyncTestFailure:Test262Error: ' + String(error)); } } else { __consolePrintHandle__('Test262:AsyncTestComplete');