Skip to content
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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

fix #202 #203

wants to merge 1 commit into from

Conversation

prakash-patel
Copy link

For more info look at the issue 202.

Copy link

@aborkowski aborkowski left a 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.

Comment on lines -204 to +217
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);

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.

Comment on lines -204 to +217
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);

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 + '");

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 + '");

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.

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