Eval function execution leads to internal error

让人想犯罪 __ 提交于 2020-01-24 17:57:09

问题


I am doing analysis of our application with IE Edge browser, while doing so I found a strange behaviour. Execution of eval function leads to the below error. Even tried sample one like:

eval("2");

Error: SCRIPT51: Internal error

Please help me overcome this problem, in other browsers I am not facing this issue.


回答1:


I'm afraid that this seems to be a browser issue of IE Edge. You can't do anything to work around this issue except of getting rid of all your eval calls.

Since your application uses many eval functions (which is a bad idea), getting rid of them might be not an option. You'll have to wait until Microsoft fixes it's browser.

However, as eval is still used by many webpages, I'm sure that the bug will get a high priority and might be fixed before official release.




回答2:


Seems to be I found the root cause, the below trick solves my problem.

eval function needs to be specifically called with window context (though actually not requires)

Edge browser seems to be having some issue with context during evaluation.



来源:https://stackoverflow.com/questions/31512040/eval-function-execution-leads-to-internal-error

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!