Fix: Replace ES6 getters/setters with ES5-compatible functions in HTML5 runtime (Closure Compiler error) #27
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This PR fixes a critical issue preventing Clickteam Fusion 2.5 HTML5 builds when using extensions created with the DarkEdif SDK (SDK v20).
The Fusion HTML5 exporter uses the Google Closure Compiler, which does not support ES6 getters/setters and fails to transpile them to ES5.
Because of this, any extension using DarkEdif v20 cannot be exported as HTML5.
Problem
During HTML5 build, Fusion throws:
This comes from auto-generated code in
RuntimePropSet, inside the DarkEdif HTML5 runtime:Closure Compiler cannot convert ES6 getters/setters → ES5, so the entire HTML5 build fails.
Solution
Replaced the ES6 getter/setter with ES5-safe functions:
Before (ES6, incompatible)
After (ES5-compatible)
Additionally, all internal references were updated:
obj.setIndexSelected = x→obj.setSetIndexSelected(x)obj.setIndexSelected(read) →obj.getSetIndexSelected()Why this fix is necessary
✔ Restores HTML5 export support
✔ Keeps full compatibility with Smart Properties
✔ No behavior changes
✔ Only removes ES6 syntax that Closure cannot handle
Impact
Ready to merge
This PR contains the minimal and necessary change to re-enable HTML5 compatibility in DarkEdif SDK v20.