@@ -243,18 +243,22 @@ function copyImpl(source, target, targetStart, sourceStart, sourceEnd) {
243
243
244
244
function _copyActual ( source , target , targetStart , sourceStart , sourceEnd ) {
245
245
// Enforce: 0 <= sourceStart <= sourceEnd
246
- if ( ! ( 0 <= sourceStart && sourceStart <= sourceEnd ) )
247
- throw new ERR_BUFFER_OUT_OF_BOUNDS ( ) ;
246
+ if ( ! ( 0 <= sourceStart && sourceStart <= sourceEnd ) ) {
247
+ throw new ERR_BUFFER_OUT_OF_BOUNDS ( 'expected 0 <= sourceStart <= sourceEnd' +
248
+ ' but got 0 <= ' + sourceStart + ' <= ' + sourceEnd ) ;
249
+ }
248
250
249
- sourceEnd = Math . min ( sourceEnd , source . byteLength ) ;
251
+ sourceEnd = MathMin ( sourceEnd , source . byteLength ) ;
250
252
251
253
// Enforce: 0 <= targetStart <= target.byteLength;
252
- if ( ! ( 0 <= targetStart && targetStart <= target . byteLength ) )
253
- throw new ERR_BUFFER_OUT_OF_BOUNDS ( ) ;
254
+ if ( ! ( 0 <= targetStart && targetStart <= target . byteLength ) ) {
255
+ throw new ERR_BUFFER_OUT_OF_BOUNDS ( 'expected 0 <= targetStart <= target.byteLength' +
256
+ ' but got 0 <= ' + targetStart + ' <= ' + target . byteLength ) ;
257
+ }
254
258
255
- let sourceLength = sourceEnd - sourceStart ;
256
- let targetLength = target . byteLength - targetStart ;
257
- let copyLength = Math . min ( sourceLength , targetLength ) ;
259
+ const sourceLength = sourceEnd - sourceStart ;
260
+ const targetLength = target . byteLength - targetStart ;
261
+ const copyLength = MathMin ( sourceLength , targetLength ) ;
258
262
259
263
_copy ( source , target , targetStart , sourceStart , copyLength ) ;
260
264
0 commit comments