Skip to content

Commit 644b7d4

Browse files
committed
Inline anonymous function invocation
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.
1 parent 8aa763a commit 644b7d4

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

src/html5shiv-printshiv.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,10 @@
3636
//if the hidden property is implemented we can assume, that the browser supports basic HTML5 Styles
3737
supportsHtml5Styles = ('hidden' in a);
3838

39-
supportsUnknownElements = a.childNodes.length == 1 || (function() {
40-
a = document.createDocumentFragment();
41-
return !(a.cloneNode && a.createDocumentFragment && a.createElement);
42-
}());
39+
supportsUnknownElements = a.childNodes.length == 1 || (
40+
(a = document.createDocumentFragment()),
41+
!(a.cloneNode && a.createDocumentFragment && a.createElement)
42+
);
4343
} catch(e) {
4444
// assign a false positive if detection fails => unable to shiv
4545
supportsHtml5Styles = true;

src/html5shiv.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,10 @@
3636
//if the hidden property is implemented we can assume, that the browser supports basic HTML5 Styles
3737
supportsHtml5Styles = ('hidden' in a);
3838

39-
supportsUnknownElements = a.childNodes.length == 1 || (function() {
40-
a = document.createDocumentFragment();
41-
return !(a.cloneNode && a.createDocumentFragment && a.createElement);
42-
}());
39+
supportsUnknownElements = a.childNodes.length == 1 || (
40+
(a = document.createDocumentFragment()),
41+
!(a.cloneNode && a.createDocumentFragment && a.createElement)
42+
);
4343
} catch(e) {
4444
// assign a false positive if detection fails => unable to shiv
4545
supportsHtml5Styles = true;

0 commit comments

Comments
 (0)