Closed
Description
Hello,
I'm using js-yaml in a code editor that supports json and yaml user input and then transforms the content (if it is valid) into javascript objects for further manipulation.
I've encountered the following bug: If an array contains an extra comma ,
, instead of throwing an exception for invalid yaml or json, the parser transforms the value into null
. Although I include several other options, this is the simplest case in which the error occurs.
Code snippet:
var yaml = require('js-yaml');
var result = yaml.safeLoad('[,,]');
Expected:
YAMLException is thrown
Actual:
result === [null, null]