immersive-web / webxr-polyfill

Use the WebXR Device API today, providing fallbacks to native WebVR 1.1 and Cardboard
Apache License 2.0
381 stars 84 forks source link

Fix return values from XR.supportsSession() #79

Closed takahirox closed 5 years ago

takahirox commented 5 years ago

This PR lets the return values from XR.supportsSession() follow the specification.

Currently it returns Promise.resolve(null) when succeeded and returns Promise.reject(null) when failed. But the specification mentions that the return type is Promise<void> when succeeded and reject promise with a "NotSupportedError" DOMException when failed.

takahirox commented 5 years ago

The Travis CI build fails but it fails with the same error even without this PR. I don't think the error is from this PR.

jsantell commented 5 years ago

Great find @takahirox, thanks! The tests have not yet been updated since the merging of the webxr-2019 branch