Angular 4 app using IE 11, “Can't execute code from a freed script”

前端 未结 6 1751
失恋的感觉
失恋的感觉 2021-02-05 04:48

I have an Angular app which I think is version 4. IE 11 crashes during a login sequence in this app: \"Can\'t execute code from a freed script\". According to the IE console the

6条回答
  •  耶瑟儿~
    2021-02-05 05:50

    One solution is to set the variable isEnableCrossContextCheck to true, so that IE should run the code containing a try/catch block, which can handle the error.

            if (isEnableCrossContextCheck) {
                try {
                    var testString = delegate.toString();
                    if ((testString === FUNCTION_WRAPPER || testString == BROWSER_TOOLS)) {
                        nativeDelegate.apply(target, args);
                        return false;
                    }
                }
                catch (error) {
                    nativeDelegate.apply(target, args);
                    return false;
                }
            }
            else {
                var testString = delegate.toString(); 
                if ((testString === FUNCTION_WRAPPER || testString == BROWSER_TOOLS)) {
                    nativeDelegate.apply(target, args);
                    return false;
                }
            }
    

    This post shows how to to that:

    Angular 4 put a global constant available to zone.js

提交回复
热议问题