-
-
Notifications
You must be signed in to change notification settings - Fork 453
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
Fix nodelist readonly length #349
Conversation
childNodes.length is readonly, and is also updated live when the DOM is updated. See: https://developer.mozilla.org/en-US/docs/Web/API/NodeList In strict mode attempting to set `childNodes.length` throws an error.
Thanks! We still need to remove all the children from the gradient tag though. I'll update your PR to handle that. |
haha, ye, I was just about to say hang on a second... I've got a failing case that's not yet tested. Still evaluating the issue... but looks like a gradient is not being applied. Will follow up once I figure out what's going on. |
I think it should work now. But, if there are additional things you want to add I'll wait to merge. Thanks for the PR! |
cool, I'm gonna merge these changes back into my branch, and see what's going on with the issue I'm experiencing in my project. Hopefully a quick fix, but I'll likely get back to you tomorrow :) |
alright, your commits fixed my issues! Good to go to merge. Thanks @jonobr1 |
Fix nodelist readonly length
When running Two.js in an environment where
use strict;
is used, settingchildNodes.length
to anything throws an error because it's actually a read-only property.Also,
childNodes
is live, so updates to the DOM will be reflected in thelength
property automatically.All tests are passing with this update.