Skip to content

js-flatten and @:expose #3142

Closed
Closed
@andyli

Description

Given a class foo.Foo with @:expose, I suppose it is accessible from external by foo.Foo. However with -D js-flatten, it is exposed as foo_Foo.
Example:

package foo;
@:expose
class Foo {
    static function main():Void {}
}

Gives:

(function ($hx_exports) { "use strict";
var foo_Foo = $hx_exports.foo_Foo = function() { };
foo_Foo.main = function() {
};
foo_Foo.main();
})(typeof window != "undefined" ? window : exports);

I can't find a way to use -D js-flatten while maintaining the exposed package object and name. Adding @:native("foo.Foo") gives exactly the same result.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions