Skip to content

Feature request to access source file name #278

Closed
@shibukawa

Description

@shibukawa

I can access to module information by using JSX.require() function from JS code, but there is no way to get primary source file name (it was passed to JSX compiler).

If I can get primary source file name, I can write custom bootstrap code easily.

For example, just import following code, you can export all export classes and use as standard CommonJS code.

native class CommonJSExporter {
} = '''
var module = JSX.require(JSX.getPrimarySourceFile());
for (var key in module)
{
    if (key.match(/^[a-zA-Z0-9]+$/))
    {
        exports[key] = module[key];
    }
}
'''

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions