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

Fix #1881 + related ospec bug #2492

Merged
merged 2 commits into from Jul 26, 2019

Conversation

@isiahmeadows
Copy link
Collaborator

commented Jul 26, 2019

Description

Motivation and Context

Fixes #1881

Also fixes a related ospec bug, but I can't seem to find it. (Maybe on Gitter?)

How Has This Been Tested?

Ran the usual tests. Had to update the mocks so the fuzzer would be seeing an accurate, albeit incomplete, view of the world. (Browsers know how to batch changes in fragments, so the extra removals aren't critical.)

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation change

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.
  • I have updated docs/change-log.md

@project-bot project-bot bot added this to Needs triage in Triage/bugs Jul 26, 2019

@isiahmeadows isiahmeadows marked this pull request as ready for review Jul 26, 2019

@isiahmeadows isiahmeadows merged commit 39fa2b3 into MithrilJS:next Jul 26, 2019

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

Triage/bugs automation moved this from Needs triage to Closed Jul 26, 2019

@isiahmeadows isiahmeadows deleted the isiahmeadows:fix-remove branch Jul 26, 2019

@rhinoman

This comment has been minimized.

Copy link

commented Aug 1, 2019

This fix seems to have broken me. Since updating, I've been getting errors stemming from:

function removeHTML(parent, vnode) {
	for (var i = 0; i < vnode.instance.length; i++) {
		parent.removeChild(vnode.instance[i])
	}
}

Where sometimes vnode.instance is undefined and thus an exception is being thrown (Can't read property 'length' of undefined).

@knupska

This comment has been minimized.

Copy link

commented Aug 2, 2019

I recently upgraded to v2.0.3 and was receiving precisely the same error as @rhinoman above, originating from the removeHTML function in render/render.js.

TypeError: Cannot read property 'length' of undefined

By checking if the vnode.instance === undefined I was able to determine that it was occuring on the only remaining m.trust that I had in the entire application.

Luckily in my case I didn't actually need the m.trust, so removed it to return m( 'div', text ), instead of m( 'div', m.trust( text ) ), and that has seemingly resolved the issue for me.

@isiahmeadows

This comment has been minimized.

Copy link
Collaborator Author

commented Aug 3, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
3 participants
You can’t perform that action at this time.