Procházet zdrojové kódy

fix: try catch process

DaiQiangReal před 3 roky
rodič
revize
75b0e54f71
1 změnil soubory, kde provedl 9 přidání a 5 odebrání
  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;
-}
+}