New issue
Advanced search Search tips

Issue 678718 link

Starred by 1 user

Issue metadata

Status: WontFix
Owner: ----
Closed: Jan 2017
Components:
EstimatedDays: ----
NextAction: ----
OS: All
Pri: 3
Type: Bug
Proj-XR
Proj-XR-VR



Sign in to add a comment

WebVR's VRFieldOfView object doesn't support keys

Project Member Reported by bsheedy@chromium.org, Jan 5 2017

Issue description

Javascript objects support both keys and dot operators for accessing attributes, e.g. some_object[key] and some_object.key should result in the same thing.

For whatever reason, WebVR's VRFieldOfView object does not support this - fov.key works, but fov[key] does not, and Object.keys(fov) returns an empty array.

What this means is that you can't use a loop to iterate over all of the attributes, which isn't a huge deal since there are only four, but it's strange since I was under the impression that this was supported in absolutely all Javascript objects.
 
I tested it on the android chromiium canary. And it seems that VRFieldOfView object support both fov.key and fov["key"]. And it seems the statement like:
for (var prop in fov) {console.log(prop)} could output all four attribute name successfully.
I'm now getting the same behavior as you - Object.keys still returns an empty array, but the following works to log all the values:

for (var prop in fieldOfView) { console.log(fieldOfView[prop]); }

Also, fieldOfView.upDegrees and fieldOfView["upDegrees"] now return the same float. Not quite sure why that's working now - I swear I checked multiple times that it didn't work before, but AFAIK, there aren't any changes that should have fixed it.
Yes, I also don't find any changes which fixed it. However, good to know it works :)
Status: WontFix (was: Untriaged)
Closing for now, as the issue seems to have automagically solved itself and is no longer reproducible.

Sign in to add a comment