Open ahaoboy opened 11 months ago
Trailing commas in function calls are not valid ES5 syntax. These were introduced in a much later revision of the language.
Trailing commas in function calls are not valid ES5 syntax. These were introduced in a much later revision of the language.
Have you considered supporting trailing comma syntax? Some formatting tools may generate code like this:
print(
1,
2,
3,
)
Some formatting tools may generate code like this
Transpile your code to ES5 before running with MuJS. If you use TypeScript, it's just --target es5
option.
More issues arise in bundle tools. Library providers will use any available tools to build code, and bundle tools will directly use the code they have built. While some settings or formatting adjustments can be made after bundle, it undoubtedly adds complexity. For Mujs, this functionality indeed goes beyond the scope of ES5. So, feel free to close this issue.