Playground: serialize errors in AST (#10548)
This commit is contained in:
1 parent
527ff95354
commit
770ed280cf
1 file changed
+5
-1
@@ -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
|
||||
);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user