Exception thrown when YAML string does not terminate with a newline
Opened this issue · 4 comments
jeffwatkins commented
var Yaml= require('yaml');
Yaml.eval('port:3000\nserver: foo')
Will throw the following exception:
TypeError: Cannot read property '1' of undefined
at Parser.expect (node_modules/.npm/yaml/0.1.1/package/lib/yaml.js:173:51)
at Parser.parseHash (node_modules/.npm/yaml/0.1.1/package/lib/yaml.js:268:10)
at Parser.parse (node_modules/.npm/yaml/0.1.1/package/lib/yaml.js:233:19)
at Parser.parseHash (node_modules/.npm/yaml/0.1.1/package/lib/yaml.js:274:23)
at Parser.parse (node_modules/.npm/yaml/0.1.1/package/lib/yaml.js:233:19)
at Object.eval (node_modules/.npm/yaml/0.1.1/package/lib/yaml.js:349:46)
at [object Context]:1:6
at Interface.<anonymous> (repl:96:19)
at Interface.emit (events:31:17)
at Interface._ttyWrite (readline:309:12)
CrypticSwarm commented
Specifically unquoted strings caused the error.
Fixed in my branch
https://github.com/CrypticSwarm/js-yaml/commits/dev-improved-unquoted-strings
thinkjson commented
+1
tanertopal commented
+1
zorji commented
+1