diff --git a/src/api/XRInputSourceEvent.js b/src/api/XRInputSourceEvent.js index f934bd9..93f5f01 100644 --- a/src/api/XRInputSourceEvent.js +++ b/src/api/XRInputSourceEvent.js @@ -26,6 +26,9 @@ export default class XRInputSourceEvent extends Event { frame: eventInitDict.frame, inputSource: eventInitDict.inputSource }; + + // safari bug: super() seems to return object of type Event, with Event as prototype + Object.setPrototypeOf(this, XRInputSourceEvent.prototype); } /** diff --git a/src/api/XRInputSourcesChangeEvent.js b/src/api/XRInputSourcesChangeEvent.js index a03a65c..f87a3a4 100644 --- a/src/api/XRInputSourcesChangeEvent.js +++ b/src/api/XRInputSourcesChangeEvent.js @@ -27,6 +27,8 @@ export default class XRInputSourcesChangeEvent extends Event { added: eventInitDict.added, removed: eventInitDict.removed }; + // safari bug: super() seems to return object of type Event, with Event as prototype + Object.setPrototypeOf(this, XRInputSourcesChangeEvent.prototype); } /** diff --git a/src/api/XRReferenceSpaceEvent.js b/src/api/XRReferenceSpaceEvent.js index 3d7398b..49905ed 100644 --- a/src/api/XRReferenceSpaceEvent.js +++ b/src/api/XRReferenceSpaceEvent.js @@ -26,6 +26,8 @@ export default class XRReferenceSpaceEvent extends Event { referenceSpace: eventInitDict.referenceSpace, transform: eventInitDict.transform || null }; + // safari bug: super() seems to return object of type Event, with Event as prototype + Object.setPrototypeOf(this, XRReferenceSpaceEvent.prototype); } /** diff --git a/src/api/XRSessionEvent.js b/src/api/XRSessionEvent.js index c093d8b..8428a81 100644 --- a/src/api/XRSessionEvent.js +++ b/src/api/XRSessionEvent.js @@ -25,6 +25,9 @@ export default class XRSessionEvent extends Event { this[PRIVATE] = { session: eventInitDict.session }; + + // safari bug: super() seems to return object of type Event, with Event as prototype + Object.setPrototypeOf(this, XRSessionEvent.prototype); } /**