Fix parseFloat mistaken uses of "radix"
Summary: It doesn't take a radix. https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/parseFloat Reviewed By: yungsters Differential Revision: D5000954 fbshipit-source-id: fe13896196f0369b1dce132cd4f30d086638740e
This commit is contained in:
parent
f5056f844d
commit
37f3ce1f2c
|
@ -1138,12 +1138,12 @@ class AnimatedInterpolation extends AnimatedWithChildren {
|
|||
return value;
|
||||
}
|
||||
if (/deg$/.test(value)) {
|
||||
const degrees = parseFloat(value, 10) || 0;
|
||||
const degrees = parseFloat(value) || 0;
|
||||
const radians = degrees * Math.PI / 180.0;
|
||||
return radians;
|
||||
} else {
|
||||
// Assume radians
|
||||
return parseFloat(value, 10) || 0;
|
||||
return parseFloat(value) || 0;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
|
@ -180,7 +180,7 @@ function parse1(str: string): number {
|
|||
|
||||
function parsePercentage(str: string): number {
|
||||
// parseFloat conveniently ignores the final %
|
||||
var int = parseFloat(str, 10);
|
||||
var int = parseFloat(str);
|
||||
if (int < 0) {
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -111,7 +111,7 @@ function _multiplyTransform(
|
|||
* Note that validation on the string is done in `_validateTransform()`.
|
||||
*/
|
||||
function _convertToRadians(value: string): number {
|
||||
var floatValue = parseFloat(value, 10);
|
||||
var floatValue = parseFloat(value);
|
||||
return value.indexOf('rad') > -1 ? floatValue : floatValue * Math.PI / 180;
|
||||
}
|
||||
|
||||
|
|
|
@ -39,7 +39,7 @@ function getAssetDataFromName(filename: string, platforms: Set<string>): AssetDa
|
|||
if (!(match && match[1])) {
|
||||
resolution = 1;
|
||||
} else {
|
||||
resolution = parseFloat(match[1], 10);
|
||||
resolution = parseFloat(match[1]);
|
||||
if (isNaN(resolution)) {
|
||||
resolution = 1;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue