Explorar el Código

fix: try catch process

DaiQiangReal hace 3 años
padre
commit
75b0e54f71
Se han modificado 1 ficheros con 9 adiciones y 5 borrados
  1. 9 5
      packages/semi-ui/_utils/index.ts

+ 9 - 5
packages/semi-ui/_utils/index.ts

@@ -47,12 +47,16 @@ export function cloneDeep(value: any, customizer?: (value: any) => void) {
                     set(newArray, key, v[key]);
                 });
                 // internal-issues:887
-                warning(
-                    get(process, 'env.NODE_ENV') !== 'production',
-                    `[Semi] You may use an out-of-bounds array. In some cases, your program may not behave as expected.
+                try {
+                    warning(
+                        get(process, 'env.NODE_ENV') !== 'production',
+                        `[Semi] You may use an out-of-bounds array. In some cases, your program may not behave as expected.
                     The maximum length of an array is 4294967295.
                     Please check whether the array subscript in your data exceeds the maximum value of the JS array subscript`
-                );
+                    );
+                } catch (e){
+
+                }
                 return newArray;
             } else {
                 return undefined;
@@ -191,4 +195,4 @@ export function getFocusableElements(node: HTMLElement) {
     // we are not filtered elements which are invisible
     const focusableElements = Array.from(node.querySelectorAll<HTMLElement>(focusableSelectorsStr));
     return focusableElements;
-}
+}