Skip to content

Commit

Permalink
[WebXR] Fix closure compiler mangling XRSession.enabledFeatures
Browse files Browse the repository at this point in the history
  • Loading branch information
dsnopek committed Jun 25, 2024
1 parent 6b281c0 commit 9b42333
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
3 changes: 2 additions & 1 deletion modules/webxr/native/library_godot_webxr.js
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,8 @@ const GodotWebXR = {
// next reference space.
window.setTimeout(function () {
const reference_space_c_str = GodotRuntime.allocString(reference_space_type);
const enabled_features_c_str = GodotRuntime.allocString(Array.from(session.enabledFeatures).join(','));
const enabled_features = 'enabledFeatures' in session ? Array.from(session.enabledFeatures) : [];
const enabled_features_c_str = GodotRuntime.allocString(enabled_features.join(','));
onstarted(reference_space_c_str, enabled_features_c_str);
GodotRuntime.free(reference_space_c_str);
GodotRuntime.free(enabled_features_c_str);
Expand Down
5 changes: 5 additions & 0 deletions modules/webxr/native/webxr.externs.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,11 @@ XRSession.prototype.frameRate;
*/
XRSession.prototype.supportedFrameRates;

/**
* @type {Array<string>}
*/
XRSession.prototype.enabledFeatures;

/**
* @type {?function (Event)}
*/
Expand Down

0 comments on commit 9b42333

Please sign in to comment.