d3x0r / JSON6

JSON for Humans (ES6)
Other
236 stars 14 forks source link

require a broken JSON6 does not throw an error #51

Closed BananaAcid closed 3 years ago

BananaAcid commented 3 years ago

Is that wanted behaviour?

Version 1.1.1

test string required and parsed:

{

throws no error.

Testet with JSON6.parse('{');

... it seems, there is no error, if an object is not closed.


2nd;

Getting it to trigger error with require, there is no filename included.

"fault while parsing; character unexpected 'v' unexpected at 342 (near '   [v]ersion: "0') [2:6]"

If a module fails with require, it mentions what file it is.

d3x0r commented 3 years ago

:) interesting. I will add a test case for this and fix it; I need a few hours...

d3x0r commented 3 years ago

Added test which passed without any additional modifications; updated version and published 1.1.2. Please let me know if there's additional issues. (I'm not sure about the reporting of which file failed.)

BananaAcid commented 3 years ago

Hm? That means, that is expected behavior?

d3x0r commented 3 years ago

that means it was fixed already in the meantime, and really just requires publishing...