diff --git a/packages/ckeditor5-dev-web-crawler/lib/runcrawler.js b/packages/ckeditor5-dev-web-crawler/lib/runcrawler.js index ea27f4f13..97c75863a 100644 --- a/packages/ckeditor5-dev-web-crawler/lib/runcrawler.js +++ b/packages/ckeditor5-dev-web-crawler/lib/runcrawler.js @@ -561,25 +561,7 @@ function registerErrorHandlers( page, { link, onError } ) { return; } - const serializeArgumentInPageContext = argument => { - // Since errors are not serializable, return the message with the call stack as the output text. - if ( argument instanceof Error ) { - return argument.stack; - } - - // Cast non-string iterable argument to an array. - if ( typeof argument !== 'string' && argument[ Symbol.iterator ] ) { - return [ ...argument ]; - } - - // Return argument right away. Since we use `executionContext().evaluate()`, it'll return JSON value of the - // argument if possible, or `undefined` if it fails to stringify it. - return argument; - }; - - const serializeArguments = argument => { - return argument.evaluate( serializeArgumentInPageContext, argument ); - }; + const serializeArguments = argument => argument.jsonValue(); const serializedArguments = await Promise.all( message.args().map( serializeArguments ) );