resolve props: fix json heuristic (missing tab/new-line as valid 1st char)

This commit is contained in:
jean-emmanuel 2018-10-19 09:07:30 +02:00
parent a62faaa27b
commit dc3578e9cc

View file

@ -493,7 +493,7 @@ class Widget extends EventEmitter {
// if the string doesn't starts with one of these chars
// it's going to fail
// ref in source: https://github.com/douglascrockford/JSON-js
if (' +-eE{([0123456789tfn"'.indexOf(propValue[0]) !== -1) {
if (' \n+-eE{([0123456789tfn"'.indexOf(propValue[0]) !== -1) {
try {
propValue = JSON.parse(propValue)
} catch (err) {}