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

removeData doesn't properly remove the id on Chrome #1858

Closed
wants to merge 1 commit into from
Closed

removeData doesn't properly remove the id on Chrome #1858

wants to merge 1 commit into from

Conversation

chikathreesix
Copy link
Contributor

After updated to 4.11.4, I saw the error below many times.

Uncaught TypeError: Cannot read property 'handlers' of undefined

This is because getData returns null in vjs.on and prior to that, 'removeData' failed to delete the id with delete el[vjs.expando].

  try {
    delete el[vjs.expando];
  } catch(e) {
    if (el.removeAttribute) {
      el.removeAttribute(vjs.expando);
    } else {
      // IE doesn't appear to support removeAttribute on the document element
      el[vjs.expando] = null;
    }
  }

So far this happens only on Chrome(40.0.2214.111) and only when el is object element.
I tested delete syntax itself with object element on Chrome, but it actually failed to delete the property even though it returns true.

So I guess it should be Chrome's bug but I would suggest to make a change to getData to make sure it doesn't return null all the time.

…ser fails to delete the id with 'delete el[vjs.expando]'
@heff
Copy link
Member

heff commented Feb 11, 2015

Good find, thanks! Interesting bug.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants