简体   繁体   English

如何压缩asm.js编译消息?

[英]How to suppress asm.js compilation message?

When using asm.js code some browsers emit a compilation message. 使用asm.js代码时,某些浏览器会发出编译消息。 This one: 这个:

Successfully compiled asm.js code (loaded from cache in 201ms) 成功编译asm.js代码(在201ms内从缓存加载)

Is there a way to suppress this message? 有没有办法压制这条消息?

The message itself is here: https://hg.mozilla.org/mozilla-central/file/tip/js/src/js.msg#l357 消息本身在这里: https//hg.mozilla.org/mozilla-central/file/tip/js/src/js.msg#l357

 MSG_DEF(JSMSG_USE_ASM_TYPE_OK, 1, JSEXN_WARN, "Successfully compiled asm.js code ({0})") 

And it is emitted here: https://hg.mozilla.org/mozilla-central/file/tip/js/src/wasm/AsmJS.cpp#l8718 它在这里发出: https//hg.mozilla.org/mozilla-central/file/tip/js/src/wasm/AsmJS.cpp#l8718

 static bool SuccessfulValidation(AsmJSParser& parser, UniqueChars str) { return parser.warningNoOffset(JSMSG_USE_ASM_TYPE_OK, str.get()); } 

Which is called here: https://hg.mozilla.org/mozilla-central/file/tip/js/src/wasm/AsmJS.cpp#l8877 这里称之为: https//hg.mozilla.org/mozilla-central/file/tip/js/src/wasm/AsmJS.cpp#l8877

  // Success! Write to the console with a "warning" message. *validated = true; SuccessfulValidation(parser, Move(message)); return NoExceptionPending(cx); } 

There is no apparent "optionality" in that line, even the comment says that it is going to the console, period. 在这一行中没有明显的“可选性”,即使评论说它将进入控制台,期间。

Otherwise JSEXN_WARN has a couple real occurrences only (in jsexn.h , jsexn.cpp and in jsapi.h ), the latter one descibes it as it is practically an exception type which does not break execution and does not have a scary part ("Error:..."): https://hg.mozilla.org/mozilla-central/file/tip/js/src/jsapi.h#l580 否则JSEXN_WARN只有几个实际出现(在jsexn.hjsexn.cppjsapi.h中 ),后者描述它,因为它实际上是一个异常类型,它不会破坏执行并且没有可怕的部分(“错误:...“): https//hg.mozilla.org/mozilla-central/file/tip/js/src/jsapi.h#l580

 * JSEXN_WARN is used for warnings in js.msg files (for instance because we * don't want to prepend 'Error:' to warning messages). This value can go away * if we ever decide to use an entirely separate mechanism for warnings. 

And it is true, most checks for JSEXN_WARN are about skipping the throw of an actual exception, in a if ( ... || exnType == JSEXN_WARN || ... ) do nothing fashion, like here (just one, ad-hoc example). 确实如此,JSEXN_WARN的大多数检查是关于跳过实际异常的抛出,在if ( ... || exnType == JSEXN_WARN || ... ) do nothing ,就像这里 (只有一个,ad-)特别的例子)。

I am not sure what you really need, but 我不确定你真正需要什么,但是

How to supress asm.js compilation message? 如何压制asm.js编译消息?

Via building your own copy of Firefox: https://developer.mozilla.org/en-US/docs/Mozilla/Developer_guide/Build_Instructions/Simple_Firefox_build 通过构建自己的Firefox副本: https//developer.mozilla.org/en-US/docs/Mozilla/Developer_guide/Build_Instructions/Simple_Firefox_build

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM