Skip to content

fix #202#203

Open
prakash-patel wants to merge 1 commit into
aFarkas:masterfrom
prakash-patel:issues/202
Open

fix #202#203
prakash-patel wants to merge 1 commit into
aFarkas:masterfrom
prakash-patel:issues/202

Conversation

@prakash-patel

Copy link
Copy Markdown

For more info look at the issue 202.

@aborkowski aborkowski left a comment

Copy link
Copy Markdown

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);

Copy link
Copy Markdown

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 thread src/html5shiv.js
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);

Copy link
Copy Markdown

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 thread src/html5shiv.js
getElements().join().replace(/[\w\-:]+/g, function(nodeName) {
data.createElem(nodeName);
data.frag.createElement(nodeName);
return c("' + nodeName + '");

Copy link
Copy Markdown

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

Copy link
Copy Markdown

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