Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Event subclass fix ios #133

3 changes: 3 additions & 0 deletions src/api/XRInputSourceEvent.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

/**
Expand Down
2 changes: 2 additions & 0 deletions src/api/XRInputSourcesChangeEvent.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

/**
Expand Down
2 changes: 2 additions & 0 deletions src/api/XRReferenceSpaceEvent.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

/**
Expand Down
3 changes: 3 additions & 0 deletions src/api/XRSessionEvent.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

/**
Expand Down