Skip to content

ES5 bundle produces ES6 code in runtime #242

@victor-wm

Description

@victor-wm

The template parser generates a series of javascript instructions to be executed by new Function() and the code present there can contain the const keyword which is not valid ES5.

See:
https://github.com/rdkcentral/Lightning/blob/master/src/application/Component.mjs#L122
https://github.com/rdkcentral/Lightning/blob/master/src/application/Component.mjs#L125
https://github.com/rdkcentral/Lightning/blob/master/src/application/Component.mjs#L142
https://github.com/rdkcentral/Lightning/blob/master/src/application/Component.mjs#L149

Even when the code is transpiled to es5 (in lightning.es5.min.js) the strings are left intact.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions