Javascript行号映射 [英] Javascript line number mapping

查看:58
本文介绍了Javascript行号映射的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

格式错误的评论会改变某些浏览器中报告的javascript错误行数;它们看起来像这样:

Magically formatted comments will change the reported line number of javascript errors in some browsers; They look like this:

//@line n "f"

n 是行号, f 是文件名。很遗憾, // @ line 似乎是不可访问的。有谁知道这个功能的文档在哪里,哪些浏览器支持它?

n is the line number and f is the file name. Unfortunately, //@line appears to be ungoogleable. Does anyone know where there is documentation on this feature, and which browsers support it?

(我发现它的引用这里这里。)

(I found references to it here and here.)

推荐答案

从我能找到它只是在基于Mozilla的浏览器中可用。

From what I can find it is only available in Mozilla based browsers.

它使用JS_SetOptions命令,可以根据传递的值打开或关闭这些选项。

It is using the JS_SetOptions command which can turn these options on or off depending on the values passed.

https://developer.mozilla.org/en/JS_SetOptions

这篇关于Javascript行号映射的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆