Skip to content
This repository has been archived by the owner on May 19, 2022. It is now read-only.

以回复/评论区域内 输入 @我 (注意在我的后面有个空格) JS报错的问题 #260

Open
xqin opened this issue Jan 6, 2016 · 3 comments
Labels

Comments

@xqin
Copy link

xqin commented Jan 6, 2016

image

注意在输入@我之后, 立马按空格, 不要等那个提示出来.

另外该问题我在IE10下试了一下, 更神奇, 请看截图:
image

IE的控制台在不停的输出这个错误, 因为在 onerror 中又产生了错误, 然后就又调用了 onerror, 然后一直......
出错的原因见截图.

@Integ Integ self-assigned this Jan 6, 2016
@Integ Integ added the bug label Jan 6, 2016
@xqin
Copy link
Author

xqin commented Jan 6, 2016

关于 IE10 下的这个问题,下面是一个简单的 POC.

  <script type="text/javascript">
    "use strict";
    //其他在 strict 下的代码
    function xyz(v){
        v();
    }
  </script>

  <script type="text/javascript">
    //window.onerror
    xyz(function(){
        console.log(arguments.callee);
        console.log(arguments.callee.caller);
    });
  </script>

保存之后在IE10下打开.

image

即当你出错的代码是运行在 严格模式下 时, 你在 onerror 中捕获到代码出错, 然后往上找的时候,
IE10是 禁止你找在 严格模式下 运行的代码的.

@xqin
Copy link
Author

xqin commented Feb 19, 2017

这个bug已经过去一年了, 现在还存在着 ╮(╯_╰)╭

image

@xqin xqin unassigned Integ Feb 19, 2017
@sunshineg
Copy link
Member

@joyqi @segmentfault-dev 跟进看一下

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants