mirror of
https://github.com/leporello-js/leporello-js
synced 2026-01-13 13:04:30 -08:00
fix toJSON calls from value explorer
This commit is contained in:
@@ -5,6 +5,7 @@
|
||||
// content
|
||||
|
||||
import {el, stringify, scrollIntoViewIfNeeded} from './domutils.js'
|
||||
import {with_code_execution} from '../index.js'
|
||||
|
||||
|
||||
// We test both for Object and globalThis.run_window.Object because objects may
|
||||
@@ -31,7 +32,9 @@ const isDate = object =>
|
||||
|
||||
const toJSON_safe = object => {
|
||||
try {
|
||||
return object.toJSON()
|
||||
return with_code_execution(() => {
|
||||
return object.toJSON()
|
||||
})
|
||||
} catch(e) {
|
||||
return object
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user