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
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 14 additions & 11 deletions src/html5shiv-printshiv.js
Original file line number Diff line number Diff line change
Expand Up @@ -201,17 +201,20 @@
return createElement(nodeName, ownerDocument, data);
};

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

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.

})
);
return n;
};
}(html5, data.frag);
Comment on lines -204 to +217

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.

}

/*--------------------------------------------------------------------------*/
Expand Down
25 changes: 14 additions & 11 deletions src/html5shiv.js
Original file line number Diff line number Diff line change
Expand Up @@ -201,17 +201,20 @@
return createElement(nodeName, ownerDocument, data);
};

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

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.

})
);
return n;
};
}(html5, data.frag);
Comment on lines -204 to +217

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.

}

/*--------------------------------------------------------------------------*/
Expand Down