Skip to content

Commit

Permalink
Replace OR with AND operator
Browse files Browse the repository at this point in the history
  • Loading branch information
tintin1343 committed Mar 7, 2016
1 parent 39230ed commit 8d6d61b
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion modules/plugins/flexboxIE.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ const properties = Object.keys(alternativeProps).reduce((result, prop) => {

export default function flexboxIE({ property, value, styles, browserInfo: { browser, version }, prefix: { css }, keepUnprefixed }) {
if (
(properties[property] && property === 'display' && value.indexOf('flex') > -1) &&
(properties[property] || property === 'display' && typeof value==='string' && value.indexOf('flex') > -1) &&
(
(browser === 'ie_mob' || browser === 'ie') && version == 10)
) {
Expand Down
2 changes: 1 addition & 1 deletion modules/plugins/flexboxOld.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ const properties = Object.keys(alternativeProps).concat(otherProps).reduce((resu

export default function flexboxOld({ property, value, styles, browserInfo: { browser, version }, prefix: { css }, keepUnprefixed }) {
if (
(properties[property] && property === 'display' && value.indexOf('flex') > -1) &&
(properties[property] || property === 'display' && typeof value==='string' && value.indexOf('flex') > -1) &&
(
browser === 'firefox' && version < 22 ||
browser === 'chrome' && version < 21 ||
Expand Down
8 changes: 8 additions & 0 deletions test/prefixer-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -340,6 +340,14 @@ describe('Prefixing display', () => {
display: 'block'
})).to.eql({ display: 'block' })
})
it('should not throw if display is null or undefined', () => {
expect(new Prefixer({ userAgent: Chrome45 }).prefix({
display: null
})).to.eql({ display: null })
expect(new Prefixer({ userAgent: Chrome45 }).prefix({
display: undefined
})).to.eql({ display: undefined })
})
})

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

0 comments on commit 8d6d61b

Please sign in to comment.