Skip to content

Commit

Permalink
Inline anonymous function invocation
Browse files Browse the repository at this point in the history
Some minifiers aren’t smart enough to notice they can safely inline
a function call when supportsUnknownElements was checked so go ahead
and do that for them.
  • Loading branch information
mina86 committed Jul 30, 2016
1 parent 20290cc commit f07f29d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions src/html5shiv-printshiv.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,10 @@
//if the hidden property is implemented we can assume, that the browser supports basic HTML5 Styles
supportsHtml5Styles = ('hidden' in a);

supportsUnknownElements = a.childNodes.length == 1 || (function() {
a = document.createDocumentFragment();
return !(a.cloneNode && a.createDocumentFragment && a.createElement);
}());
supportsUnknownElements = a.childNodes.length == 1 || (
(a = document.createDocumentFragment()),
!(a.cloneNode && a.createDocumentFragment && a.createElement)
);
} catch(e) {
// assign a false positive if detection fails => unable to shiv
supportsHtml5Styles = true;
Expand Down
8 changes: 4 additions & 4 deletions src/html5shiv.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,10 @@
//if the hidden property is implemented we can assume, that the browser supports basic HTML5 Styles
supportsHtml5Styles = ('hidden' in a);

supportsUnknownElements = a.childNodes.length == 1 || (function() {
a = document.createDocumentFragment();
return !(a.cloneNode && a.createDocumentFragment && a.createElement);
}());
supportsUnknownElements = a.childNodes.length == 1 || (
(a = document.createDocumentFragment()),
!(a.cloneNode && a.createDocumentFragment && a.createElement)
);
} catch(e) {
// assign a false positive if detection fails => unable to shiv
supportsHtml5Styles = true;
Expand Down

0 comments on commit f07f29d

Please sign in to comment.