Playground: serialize errors in AST (#10548)

This commit is contained in:
Georgii Dolzhykov authored and GitHub committed 2021-03-16 17:53:05 +02:00
1 parent 527ff95354
commit 770ed280cf
1 file changed
+5 -1
+5 -1
View File
@@ -41,7 +41,11 @@ function serializeAst(ast) {
return JSON.stringify(
ast,
(_, value) =>
typeof value === "bigint" ? `BigInt('${String(value)}')` : value,
value instanceof Error
? { name: value.name, message: value.message, ...value }
: typeof value === "bigint"
? `BigInt('${String(value)}')`
: value,
2
);
}