Buffer: Drop point information in unexpected circumstances.
martinfrances107 opened this issue · comments
While working out a bug in my own code. I came across some unexpected behaviour from
src/clip/buffer.js
Admittedly the mistake was on my side... but I was expecting a different response from the library.
My error .. I was calling
buffer.point()
before a call to
buffer.lineStart()
My own thinking about this bad senario is that we should silently drop the input.
The current behaviour we generate a TYPE error
line is undefined so this method blow up.
point: function(x, y, m) {
line.push([x, y, m]);
},
I will write a patch soon ... but I just wanted to canvas opinion before I change the behaviour.
I don't think we want to add tests here, at least in the JS version; and it's rather convenient to have an error if the API is not consumed correctly?
Fair enough.