@@ -242,7 +242,7 @@ export abstract class RemoteObject {
242242
243243 callFunctionJSON < T , U > (
244244 _functionDeclaration : ( this : U , ...args : any [ ] ) => T ,
245- _args : Protocol . Runtime . CallArgument [ ] | undefined ) : Promise < T > {
245+ _args : Protocol . Runtime . CallArgument [ ] | undefined ) : Promise < T | null > {
246246 throw new Error ( 'Not implemented' ) ;
247247 }
248248
@@ -568,7 +568,7 @@ export class RemoteObjectImpl extends RemoteObject {
568568
569569 override async callFunctionJSON < T , U > (
570570 functionDeclaration : ( this : U , ...args : any [ ] ) => T ,
571- args : Protocol . Runtime . CallArgument [ ] | undefined ) : Promise < T > {
571+ args : Protocol . Runtime . CallArgument [ ] | undefined ) : Promise < T | null > {
572572 const response = await this . #runtimeAgent. invoke_callFunctionOn ( {
573573 objectId : this . #objectIdInternal,
574574 functionDeclaration : functionDeclaration . toString ( ) ,
@@ -577,7 +577,7 @@ export class RemoteObjectImpl extends RemoteObject {
577577 returnByValue : true ,
578578 } ) ;
579579 if ( response . getError ( ) || response . exceptionDetails ) {
580- return null as T ;
580+ return null ;
581581 }
582582
583583 return response . result . value ;
@@ -973,7 +973,7 @@ export class RemoteArrayBuffer {
973973 return this . #objectInternal. arrayBufferByteLength ( ) ;
974974 }
975975
976- async bytes ( start = 0 , end = this . byteLength ( ) ) : Promise < number [ ] > {
976+ async bytes ( start = 0 , end = this . byteLength ( ) ) : Promise < number [ ] | null > {
977977 if ( start < 0 || start >= this . byteLength ( ) ) {
978978 throw new RangeError ( 'start is out of range' ) ;
979979 }
0 commit comments