为什么 在开发者工具上能拿到 函数本身的 命名, 但是 在真机上 不行 。为啥?

小程序 文章 2022-01-26 19:00 292 0 全屏看文

AI助手支持GPT4.0

为什么 在开发者工具上能拿到 函数本身的 命名, 但是 在真机上 不行 。为啥?Why can I get the name of the function itself on the developer tools, but not on the real machine. why?

为什么 在开发者工具上能拿到 函数本身的 命名, 但是 在真机上 不行 。为啥?

为什么 在开发者工具上能拿到 函数本身的 命名, 但是 在真机上 不行 。为啥?

代码片段

https://developers.weixin.qq.com/s/FPhmzBma78wU

Why can we get the name of the function itself on the developer tool, but not on the real machine. Why? Code snippet https://developers.weixin.qq.com/s/FPhmzBma78wU

回答:

RedHood:

实现原理不同,真机调试 2.0 代码是全部跑在真机上了,上传时代码被压缩导致获取不到正确的函数名。非要这么做的话,可以在详情里将压缩脚本的选项关闭掉。

穿着校服拽天下:你加我一下,打起麻将
圣殿骑士:

首先你需要拿到这个做什么?

其次,真机测试你这样,你切换1.0 看下,就和IDE工具一致了

2.0之所以不一致,我猜测是function的原型修改,在构造函数之前和谐了某些“挂件”

刨顶怪:上传到 体验版 后 手机上 是拿不到 函数名

-EOF-

AI助手支持GPT4.0