Maybe a bug? Function.name

When building my cocos creator 3.8 project to web the .name variable of function returns wrong answer. (“t”/“e” instead of the real function name).

It works ok when debugging. (editor/browser/simulator) but stop working when building it. (build)

In the build settings “Erase module structure” is selected. (Otherwise it doesn’t work for me).

Any ideas?

Release mode will just obfuscate the function names to have smaller package size. It applies to local functions, all function names that have been exported in a class or a module would remain the same though, so you can try to tweak your code to work around

Thank for the info! I thought it may be something like that, I would try your suggestion.

It seem that also exported function in module are obscured, if someone has a solution, I would be glad to know…

BTW, I am using the “Erase module structure” option in the build system, maybe it’s related to this topic.

It’s not advised to use Function.name, which is not reliable expecially building with release mode. The function would be renamed to be minified.

Erase module structure is an option to reduce package size, that is not related to this topic