Sizzle.attr TypeError #2055

Closed
rafaelchavesfreitas opened this Issue Feb 3, 2015 · 4 comments

Comments

Projects
None yet
4 participants
@rafaelchavesfreitas

The code below throws an Uncaught TypeError Exception because Sizzle.attr tries to call getAttribute of a comment element but comments does not have this function.

$(function(){
    $('body').on('DOMNodeInserted', '*[data-test]', function () { 
        console.log(this); 
    }).append('<!-- new comment -->');
});

rafaelchavesfreitas added a commit to rafaelchavesfreitas/jquery that referenced this issue Feb 3, 2015

@gibson042

This comment has been minimized.

Show comment
Hide comment
@gibson042

gibson042 Feb 3, 2015

Member

Related: jquery/sizzle#256 (comment)

We could punt on this, but it's so small that we might as well come up with a valid test and cherry-pick fc2ba2e from compat (where it somewhat indirectly prevents this issue from surfacing).

Member

gibson042 commented Feb 3, 2015

Related: jquery/sizzle#256 (comment)

We could punt on this, but it's so small that we might as well come up with a valid test and cherry-pick fc2ba2e from compat (where it somewhat indirectly prevents this issue from surfacing).

@gibson042 gibson042 added this to the 3.0.0 milestone Feb 3, 2015

@timmywil

This comment has been minimized.

Show comment
Hide comment
@timmywil

timmywil Feb 3, 2015

Member

👍 for nodeType check.

Member

timmywil commented Feb 3, 2015

👍 for nodeType check.

@timmywil timmywil self-assigned this May 5, 2015

@timmywil

This comment has been minimized.

Show comment
Hide comment
@timmywil

timmywil Oct 18, 2015

Member

It looks like we already cherry-picked that commit.

Member

timmywil commented Oct 18, 2015

It looks like we already cherry-picked that commit.

@timmywil

This comment has been minimized.

Show comment
Hide comment
Member

timmywil commented Oct 18, 2015

timmywil added a commit to timmywil/jquery that referenced this issue Oct 18, 2015

timmywil added a commit to timmywil/jquery that referenced this issue Nov 4, 2015

timmywil added a commit to timmywil/jquery that referenced this issue Nov 4, 2015

timmywil added a commit to timmywil/jquery that referenced this issue Nov 4, 2015

timmywil added a commit to timmywil/jquery that referenced this issue Nov 4, 2015

timmywil added a commit to timmywil/jquery that referenced this issue Nov 4, 2015

@timmywil timmywil closed this in #2659 Nov 4, 2015

@dmethvin dmethvin modified the milestones: 1.12/2.2, 3.0.0 Jan 7, 2016

@cssmagic cssmagic referenced this issue in cssmagic/ChangeLog May 18, 2016

Open

jQuery #5

@jquery jquery locked as resolved and limited conversation to collaborators Jun 19, 2018

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.