File tree 2 files changed +9
-1
lines changed
2 files changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -570,7 +570,7 @@ class Table extends ServiceObject {
570
570
'BigQueryTimestamp' ,
571
571
'Geography' ,
572
572
] ;
573
- const constructorName = value . constructor . name ;
573
+ const constructorName = value . constructor ? .name ;
574
574
const isCustomType =
575
575
customTypeConstructorNames . indexOf ( constructorName ) > - 1 ;
576
576
Original file line number Diff line number Diff line change @@ -434,6 +434,14 @@ describe('BigQuery/Table', () => {
434
434
'-99999999999999999999999999999.999999999'
435
435
) ;
436
436
} ) ;
437
+
438
+ it ( 'should return properly encode objects with null prototype' , ( ) => {
439
+ const obj = Object . create ( null ) ;
440
+ obj [ 'name' ] = 'Test' ;
441
+ assert . deepStrictEqual ( Table . encodeValue_ ( obj ) , {
442
+ name : 'Test' ,
443
+ } ) ;
444
+ } ) ;
437
445
} ) ;
438
446
439
447
describe ( 'formatMetadata_' , ( ) => {
You can’t perform that action at this time.
0 commit comments