krakenjs / spud

A content store parser, reading a java .properties-like format
Other
14 stars 9 forks source link

Update parse.js. checking type of tail, before adding property on it. #27

Closed XueliYue closed 6 years ago

XueliYue commented 8 years ago

I raised a related issue: https://github.com/krakenjs/spud/issues/25.

apamal commented 8 years ago

Hi Aria,

Can you help with merging this PR? I am facing this problem too.

Thanks, Amal John.

grawk commented 8 years ago

I can help you with this. Let me familiarize myself with the request. My first inclination is to ask for a unit test with this which would fail in the existing code and pass with the change.

XueliYue commented 8 years ago

i added two test case.

But there is an issue about the following case t.equal(typeof data.baseKey.sub, 'function');

in my opinion, the value of data.baseKey.sub should be 'undefined', however, it is function in both version 0.10 and 4.2.3

grawk commented 7 years ago

This change would silently ignore an invalid property file. I'm not sure this is the correct behavior. The current behavior will indicate the invalid KVP and allow you to address it.