File tree 2 files changed +11
-1
lines changed
2 files changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -140,7 +140,12 @@ class DefaultSerializer extends Serializer {
140
140
if ( abView . constructor === Buffer ) {
141
141
i = bufferConstructorIndex ;
142
142
} else {
143
- i = arrayBufferViewTypeToIndex . get ( objectToString ( abView ) ) ;
143
+ const tag = objectToString ( abView ) ;
144
+ i = arrayBufferViewTypeToIndex . get ( tag ) ;
145
+
146
+ if ( i === undefined ) {
147
+ throw this . _getDataCloneError ( `Unknown host object type: ${ tag } ` ) ;
148
+ }
144
149
}
145
150
this . writeUint32 ( i ) ;
146
151
this . writeUint32 ( abView . byteLength ) ;
Original file line number Diff line number Diff line change @@ -99,6 +99,11 @@ const objects = [
99
99
} , / f o o b a r / ) ;
100
100
}
101
101
102
+ {
103
+ assert . throws ( ( ) => v8 . serialize ( process . stdin . _handle ) ,
104
+ / ^ E r r o r : U n k n o w n h o s t o b j e c t t y p e : \[ o b j e c t .* \] $ / ) ;
105
+ }
106
+
102
107
{
103
108
const buf = Buffer . from ( 'ff0d6f2203666f6f5e007b01' , 'hex' ) ;
104
109
You can’t perform that action at this time.
0 commit comments