File tree 2 files changed +10
-1
lines changed
2 files changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -503,6 +503,14 @@ function testInstanceOf() {
503
503
const obj = { }
504
504
isEq ( obj instanceof Object , true )
505
505
isEq ( obj instanceof Error , false )
506
+
507
+ const json = JSON . parse ( "{}" )
508
+ isEq ( json instanceof Object , true )
509
+ isEq ( json instanceof Error , false )
510
+
511
+ const foo = new Foo ( 12 )
512
+ isEq ( foo instanceof Object , true )
513
+ isEq ( foo instanceof Foo , true )
506
514
}
507
515
508
516
class Foo {
Original file line number Diff line number Diff line change @@ -270,7 +270,8 @@ static value_t parse_array(parser_t *state) {
270
270
271
271
static value_t parse_object (parser_t * state ) {
272
272
devs_ctx_t * ctx = state -> ctx ;
273
- devs_map_t * arr = devs_map_try_alloc (ctx , 0 );
273
+ devs_map_t * arr =
274
+ devs_map_try_alloc (ctx , devs_get_builtin_object (ctx , DEVS_BUILTIN_OBJECT_OBJECT_PROTOTYPE ));
274
275
if (!arr )
275
276
return devs_undefined ;
276
277
value_t ret = devs_value_from_gc_obj (ctx , arr );
You can’t perform that action at this time.
0 commit comments