Skip to content

[BUG] Brython doesn't find attributes when a JS instance inherit from HTMLElement #2549

Open
@denis-migdal

Description

@denis-migdal

Be 2 JS classes having both a content property :

class A extends HTMLElement {
    get content() { return "ok" }
}
customElements.define("a-a", A)
window.A = new A()

class B {
    get content() { return "ok" }
}
window.B = new B() 

Python "content" in operator will work for class B but not for class A :

from browser import window

print( "content" in window.A, type(window.A) )
print( "content" in window.B, type(window.B) )
False <class 'DOMNode'>
True <class 'JSObject'>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions