繁体   English   中英

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

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

使用asm.js代码时,某些浏览器会发出编译消息。 这个:

成功编译asm.js代码(在201ms内从缓存加载)

有没有办法压制这条消息?

消息本身在这里: 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})") 

它在这里发出: 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()); } 

这里称之为: 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); } 

在这一行中没有明显的“可选性”,即使评论说它将进入控制台,期间。

否则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. 

确实如此,JSEXN_WARN的大多数检查是关于跳过实际异常的抛出,在if ( ... || exnType == JSEXN_WARN || ... ) do nothing ,就像这里 (只有一个,ad-)特别的例子)。

我不确定你真正需要什么,但是

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

通过构建自己的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