Javascript行号映射 [英] Javascript line number mapping
问题描述
格式错误的评论会改变某些浏览器中报告的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屋!