File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed
Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change 44 ArrayPrototypePush,
55 FunctionPrototypeCall,
66 MathMin,
7+ TypedArrayPrototypeSlice,
78} = primordials ;
89
910const {
@@ -36,7 +37,7 @@ function readFileAfterRead(err, bytesRead) {
3637 if ( context . size === 0 ) {
3738 // Unknown size, just read until we don't get bytes.
3839 const buffer = bytesRead === kReadFileUnknownBufferLength ?
39- context . buffer : context . buffer . slice ( 0 , bytesRead ) ;
40+ context . buffer : TypedArrayPrototypeSlice ( context . buffer , 0 , bytesRead ) ;
4041 ArrayPrototypePush ( context . buffers , buffer ) ;
4142 }
4243 context . read ( ) ;
@@ -55,7 +56,7 @@ function readFileAfterClose(err) {
5556 if ( context . size === 0 )
5657 buffer = Buffer . concat ( context . buffers , context . pos ) ;
5758 else if ( context . pos < context . size )
58- buffer = context . buffer . slice ( 0 , context . pos ) ;
59+ buffer = TypedArrayPrototypeSlice ( context . buffer , 0 , context . pos ) ;
5960 else
6061 buffer = context . buffer ;
6162
You can’t perform that action at this time.
0 commit comments