From 4314e2cab3730db8ffe6d1c4274826f7817c3e04 Mon Sep 17 00:00:00 2001 From: Rick Waldron Date: Wed, 25 Jul 2018 20:06:52 -0400 Subject: [PATCH] Make doneprinthandle.js accept the input and produce the output expected by test262-harness. (#1650) This is not a breaking change, it simply adds explicit handling to the function --- harness/doneprintHandle.js | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/harness/doneprintHandle.js b/harness/doneprintHandle.js index 2b4ab88a03..a6ea799eeb 100644 --- a/harness/doneprintHandle.js +++ b/harness/doneprintHandle.js @@ -5,13 +5,18 @@ description: | ---*/ -function __consolePrintHandle__(msg){ +function __consolePrintHandle__(msg) { print(msg); } -function $DONE(){ - if(!arguments[0]) +function $DONE(error) { + if (error) { + if(typeof error === 'object' && error !== null && 'name' in error) { + __consolePrintHandle__('Test262:AsyncTestFailure:' + error.name + ': ' + error.message); + } else { + __consolePrintHandle__('Test262:AsyncTestFailure:Test262Error: ' + error); + } + } else { __consolePrintHandle__('Test262:AsyncTestComplete'); - else - __consolePrintHandle__('Test262:AsyncTestFailure:' + arguments[0]); + } }