-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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 #202 #203
base: master
Are you sure you want to change the base?
fix #202 #203
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would suggest to reject this pull request.
ownerDocument.createDocumentFragment = Function('h,f', 'return function(){' + | ||
'var n=f.cloneNode(),c=n.createElement;' + | ||
'h.shivMethods&&(' + | ||
// unroll the `createElement` calls | ||
getElements().join().replace(/[\w\-:]+/g, function(nodeName) { | ||
data.createElem(nodeName); | ||
data.frag.createElement(nodeName); | ||
return 'c("' + nodeName + '")'; | ||
}) + | ||
');return n}' | ||
)(html5, data.frag); | ||
ownerDocument.createDocumentFragment = function(h,f){ | ||
return function(){ | ||
var n=f.cloneNode(),c=n.createElement; | ||
h.shivMethods&&( | ||
// unroll the `createElement` calls | ||
getElements().join().replace(/[\w\-:]+/g, function(nodeName) { | ||
data.createElem(nodeName); | ||
data.frag.createElement(nodeName); | ||
return c("' + nodeName + '"); | ||
}) | ||
); | ||
return n; | ||
}; | ||
}(html5, data.frag); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is no caching or memoization as in the previous and current versions of the function.
ownerDocument.createDocumentFragment = Function('h,f', 'return function(){' + | ||
'var n=f.cloneNode(),c=n.createElement;' + | ||
'h.shivMethods&&(' + | ||
// unroll the `createElement` calls | ||
getElements().join().replace(/[\w\-:]+/g, function(nodeName) { | ||
data.createElem(nodeName); | ||
data.frag.createElement(nodeName); | ||
return 'c("' + nodeName + '")'; | ||
}) + | ||
');return n}' | ||
)(html5, data.frag); | ||
ownerDocument.createDocumentFragment = function(h,f){ | ||
return function(){ | ||
var n=f.cloneNode(),c=n.createElement; | ||
h.shivMethods&&( | ||
// unroll the `createElement` calls | ||
getElements().join().replace(/[\w\-:]+/g, function(nodeName) { | ||
data.createElem(nodeName); | ||
data.frag.createElement(nodeName); | ||
return c("' + nodeName + '"); | ||
}) | ||
); | ||
return n; | ||
}; | ||
}(html5, data.frag); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is no caching or memoization as in the previous and current versions of the function.
getElements().join().replace(/[\w\-:]+/g, function(nodeName) { | ||
data.createElem(nodeName); | ||
data.frag.createElement(nodeName); | ||
return c("' + nodeName + '"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This calls c()
with the literal argument ' + nodeName + '
instead of the contents of the nodeName variable.
getElements().join().replace(/[\w\-:]+/g, function(nodeName) { | ||
data.createElem(nodeName); | ||
data.frag.createElement(nodeName); | ||
return c("' + nodeName + '"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This calls c()
with the literal argument ' + nodeName + '
instead of the contents of the nodeName variable.
For more info look at the issue 202.