You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Object.create(null) creates an object with no constructor set. estimateSerializedSize recurses json and tests if one is object with value.constructor.name === 'Object', throwing TypeError: Cannot read properties of undefined (reading 'name') on such objects.
Good point! There is a utility function isObject that tries to identify whether something is a plain object (and not a Date or Map or class or something). We'll have to refine that function to cater for this case.
Code to reproduce
Cause
Object.create(null)
creates an object with noconstructor
set.estimateSerializedSize
recurses json and tests if one is object withvalue.constructor.name === 'Object'
, throwingTypeError: Cannot read properties of undefined (reading 'name')
on such objects.svelte-jsoneditor/src/lib/utils/typeUtils.ts
Lines 9 to 13 in 278dac5
(Related issue: #321)
Parse function of json-bigint creates object with
Object.create(null)
, causing the error when used as a custom parser of jsoneditor.The text was updated successfully, but these errors were encountered: