Bug in gradient.coffee, array out bounds
https://github.com/postcss/autoprefixer/blob/master/lib/hacks/gradient.coffee#L78
# Replace `to top left` to `bottom right`
fixDirection: (params) ->
params.splice(0, 2)
for i in [0..params.length - 1] #!!!!!FIX
if params[i].type == 'div'
break
if params[i].type == 'word'
params[i].value = @revertDirection(params[i].value)
http://coffeescript.org/#try:params%20%3D%20%5B1%2C2%2C3%5D%0Afor%20i%20in%20%5B0..params.length%5D%0A%20%20console.log(%22PRINT%22%2C%20params%5Bi%5D)
Output:
PRINT 1
PRINT 2
PRINT 3
PRINT undefined
for i in [0..params.length] → for i in [0...params.length] is nicer than adding - 1 :)
@lydell Sorry but you write the same, but this bug crush my workflow
ERROR in ./~/css-loader?sourceMap!./~/postcss-loader!./~/sass-loader?outputStyle=expanded&includePaths[]=%2FUsers%2Flexich%2Fcode%2Favi%2F24slash6%2Fapp%2Fstyles&includePaths[]=%2FUsers%2Flexich%2Fcode%2Favi%2F24slash6%2Fbower_components!./bower_components/card/src/scss/card.scss
Module build failed: TypeError: Cannot read property 'type' of undefined
at Gradient.fixDirection (.../node_modules/autoprefixer/lib/hacks/gradient.js:115:22)
.....
@lexich No, I've added an extra . ;)
Very tricky dots, didn't see :)
Continue in #572
Release in 6.1.2