look up tag names and keywords as own properties - #2631
Open
Arawoof06 wants to merge 1 commit into
Open
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.