Skip to content

look up tag names and keywords as own properties - #2631

Open
Arawoof06 wants to merge 1 commit into
knockout:masterfrom
Arawoof06:own-property-tag-lookups
Open

look up tag names and keywords as own properties#2631
Arawoof06 wants to merge 1 commit into
knockout:masterfrom
Arawoof06:own-property-tag-lookups

Conversation

@Arawoof06

Copy link
Copy Markdown

getWrap, normaliseVirtualElementDomStructure, applyBindingsToNodeAndDescendantsInternal and parseObjectLiteral index object literals with names taken straight from parsed markup or binding text, so anything that resolves through Object.prototype counts as a table entry. lowercased tag names only match one of them, but it is enough: ko.utils.parseHtmlFragment('hi') picks Object as the table wrapper and returns two stray "undefined" text nodes around the element (same through the html binding), descendants of such an element are silently left unbound, and the ul/ol comment-moving workaround runs on it. the same thing in the tokenizer costs a binding: "text: a.constructor/2, css: b/3" fails the division-vs-regex check, so the slash starts a regex literal and everything up to the next slash is swallowed, dropping the css binding. guarded each lookup with hasOwnProperty the way the component loader and template rewriting already do, plus specs for the three visible cases.

a <constructor> element or an expression ending in .constructor before a slash resolved through Object.prototype in four lookup tables, so parseHtmlFragment emitted stray undefined text nodes, descendants went unbound, and a following binding was swallowed.
@mbest mbest added this to the 3.5.4 milestone Jul 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants