简体   繁体   中英

Haxe 3.2 javascript package names

I'm working on upgrading a project from haxe 2.10 to haxe 3.2 having previously done a similar upgrade from haxe 2.10 to 3.1.3.

However there is a new complication since the project interfaces with haxe compiled javascript from pure javascript.

Previously a class Test with "package name1.name2" would result in javascript code that had the full name "name1.name2.Test";

Since haxe 3.2 however this same code now yields

name1_name2_Test

Is this really intended and why ?

It's really annoying to debug all the places where it's wrong ..

Currently, Haxe/JS package and class names are indeed "flattened" by default. It's a micro-optimization, I guess to make less object allocations and less name lookups.

You can disabled this feature by adding the js-unflatten flag to your compilation command, for example:

haxe -D js-unflatten -js out.js -main Main

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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