瀏覽代碼

change instanceof to typeof for number check

Kacey Coley 7 年之前
父節點
當前提交
eafc512929
共有 2 個文件被更改,包括 3 次插入3 次删除
  1. 1 1
      serializers/src/glTF/2.0/babylon.glTFAnimation.ts
  2. 2 2
      src/Tools/babylon.tools.ts

+ 1 - 1
serializers/src/glTF/2.0/babylon.glTFAnimation.ts

@@ -428,7 +428,7 @@ module BABYLON.GLTF2 {
             const animationType = animation.dataType;
             let cacheValue: Vector3 | Quaternion;
             inputs.push(time);
-            if (value instanceof Number) {
+            if (typeof value === "number") {
                 value = this._ConvertFactorToVector3OrQuaternion(value as number, babylonMesh, animation, animationType, animationChannelTargetPath, convertToRightHandedSystem, useQuaternion);
             }
             if (value) {

+ 2 - 2
src/Tools/babylon.tools.ts

@@ -149,8 +149,8 @@
         private static _tmpFloatArray = new Float32Array(1);
         /**
          * Returns the nearest 32-bit single precision float representation of a Number
-         * @param value A Number.  IF the parameter is of a different type, it will get converted
-         * to a number or to NAN if it cannot be converted
+         * @param value A Number.  If the parameter is of a different type, it will get converted
+         * to a number or to NaN if it cannot be converted
          * @returns number
          */
         public static FloatRound(value: number): number {