Skip to content

Commit 08c015f

Browse files
committed
Replace OR with AND operator
Changed the operators in flexboxIE.js and flexboxOld.js
1 parent ae4a0d7 commit 08c015f

File tree

3 files changed

+10
-2
lines changed

3 files changed

+10
-2
lines changed

modules/plugins/flexboxIE.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ const properties = Object.keys(alternativeProps).reduce((result, prop) => {
2626

2727
export default function flexboxIE({ property, value, styles, browserInfo: { browser, version }, prefix: { css }, keepUnprefixed }) {
2828
if (
29-
(properties[property] || property === 'display' && value.indexOf('flex') > -1) &&
29+
(properties[property] || property === 'display' && typeof value==='string' && value.indexOf('flex') > -1) &&
3030
(
3131
(browser === 'ie_mob' || browser === 'ie') && version == 10)
3232
) {

modules/plugins/flexboxOld.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ const properties = Object.keys(alternativeProps).concat(otherProps).reduce((resu
2626

2727
export default function flexboxOld({ property, value, styles, browserInfo: { browser, version }, prefix: { css }, keepUnprefixed }) {
2828
if (
29-
(properties[property] || property === 'display' && value.indexOf('flex') > -1) &&
29+
(properties[property] || property === 'display' && typeof value==='string' && value.indexOf('flex') > -1) &&
3030
(
3131
browser === 'firefox' && version < 22 ||
3232
browser === 'chrome' && version < 21 ||

test/prefixer-test.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -340,6 +340,14 @@ describe('Prefixing display', () => {
340340
display: 'block'
341341
})).to.eql({ display: 'block' })
342342
})
343+
it('should not throw if display is null or undefined', () => {
344+
expect(new Prefixer({ userAgent: Chrome45 }).prefix({
345+
display: null
346+
})).to.eql({ display: null })
347+
expect(new Prefixer({ userAgent: Chrome45 }).prefix({
348+
display: undefined
349+
})).to.eql({ display: undefined })
350+
})
343351
})
344352

345353
describe('Using Prefixer.prefixAll', () => {

0 commit comments

Comments
 (0)