| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 329be5c commit 3012d31
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -28,6 +28,7 @@ const { | |||
| 28 | 28 | MathFloor, | |
| 29 | 29 | MathMin, | |
| 30 | 30 | MathTrunc, | |
| 31 | + NumberIsInteger, | ||
| 31 | 32 | NumberIsNaN, | |
| 32 | 33 | NumberMAX_SAFE_INTEGER, | |
| 33 | 34 | NumberMIN_SAFE_INTEGER, | |
@@ -208,23 +209,23 @@ function _copy(source, target, targetStart, sourceStart, sourceEnd) { | |||
| 208 | 209 | if (targetStart === undefined) { | |
| 209 | 210 | targetStart = 0; | |
| 210 | 211 | } else { | |
| 211 | - targetStart = toInteger(targetStart, 0); | ||
| 212 | + targetStart = NumberIsInteger(targetStart) ? targetStart : toInteger(targetStart, 0); | ||
| 212 | 213 | if (targetStart < 0) | |
| 213 | 214 | throw new ERR_OUT_OF_RANGE('targetStart', '>= 0', targetStart); | |
| 214 | 215 | } | |
| 215 | 216 | ||
| 216 | 217 | if (sourceStart === undefined) { | |
| 217 | 218 | sourceStart = 0; | |
| 218 | 219 | } else { | |
| 219 | - sourceStart = toInteger(sourceStart, 0); | ||
| 220 | + sourceStart = NumberIsInteger(sourceStart) ? sourceStart : toInteger(sourceStart, 0); | ||
| 220 | 221 | if (sourceStart < 0 || sourceStart > source.length) | |
| 221 | 222 | throw new ERR_OUT_OF_RANGE('sourceStart', `>= 0 && <= ${source.length}`, sourceStart); | |
| 222 | 223 | } | |
| 223 | 224 | ||
| 224 | 225 | if (sourceEnd === undefined) { | |
| 225 | 226 | sourceEnd = source.length; | |
| 226 | 227 | } else { | |
| 227 | - sourceEnd = toInteger(sourceEnd, 0); | ||
| 228 | + sourceEnd = NumberIsInteger(sourceEnd) ? sourceEnd : toInteger(sourceEnd, 0); | ||
| 228 | 229 | if (sourceEnd < 0) | |
| 229 | 230 | throw new ERR_OUT_OF_RANGE('sourceEnd', '>= 0', sourceEnd); | |
| 230 | 231 | } | |
| Back | FazBrowse Home | New Git URL |
0 commit comments