| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -71,6 +71,8 @@ rules: | |||
| 71 | 71 | message: "Use `const { WeakMap } = primordials;` instead of the global." | |
| 72 | 72 | - name: WeakSet | |
| 73 | 73 | message: "Use `const { WeakSet } = primordials;` instead of the global." | |
| 74 | + - name: parseFloat | ||
| 75 | + message: "Use `const { NumberParseFloat } = primordials;` instead of the global." | ||
| 74 | 76 | - name: parseInt | |
| 75 | 77 | message: "Use `const { NumberParseInt } = primordials;` instead of the global." | |
| 76 | 78 | no-restricted-syntax: | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -29,6 +29,7 @@ const { | |||
| 29 | 29 | MathSqrt, | |
| 30 | 30 | Number, | |
| 31 | 31 | NumberIsNaN, | |
| 32 | + NumberParseFloat, | ||
| 32 | 33 | NumberParseInt, | |
| 33 | 34 | NumberPrototypeValueOf, | |
| 34 | 35 | Object, | |
@@ -1960,7 +1961,8 @@ function formatWithOptionsInternal(inspectOptions, ...args) { | |||
| 1960 | 1961 | if (typeof tempFloat === 'symbol') { | |
| 1961 | 1962 | tempStr = 'NaN'; | |
| 1962 | 1963 | } else { | |
| 1963 | - tempStr = formatNumber(stylizeNoColor, parseFloat(tempFloat)); | ||
| 1964 | + tempStr = formatNumber(stylizeNoColor, | ||
| 1965 | + NumberParseFloat(tempFloat)); | ||
| 1964 | 1966 | } | |
| 1965 | 1967 | break; | |
| 1966 | 1968 | case 99: // 'c' | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -46,6 +46,7 @@ const { | |||
| 46 | 46 | Error, | |
| 47 | 47 | MathMax, | |
| 48 | 48 | NumberIsNaN, | |
| 49 | + NumberParseFloat, | ||
| 49 | 50 | ObjectAssign, | |
| 50 | 51 | ObjectCreate, | |
| 51 | 52 | ObjectDefineProperty, | |
@@ -768,7 +769,7 @@ function REPLServer(prompt, | |||
| 768 | 769 | // display next prompt and return. | |
| 769 | 770 | if (trimmedCmd) { | |
| 770 | 771 | if (trimmedCmd.charAt(0) === '.' && trimmedCmd.charAt(1) !== '.' && | |
| 771 | - NumberIsNaN(parseFloat(trimmedCmd))) { | ||
| 772 | + NumberIsNaN(NumberParseFloat(trimmedCmd))) { | ||
| 772 | 773 | const matches = trimmedCmd.match(/^\.([^\s]+)\s*(.*)$/); | |
| 773 | 774 | const keyword = matches && matches[1]; | |
| 774 | 775 | const rest = matches && matches[2]; | |
| Back | FazBrowse Home | New Git URL |
0 commit comments