Closed Nykakin closed 4 years ago
Error raised if undefined keyword is present in JavaScript object:
undefined
>>> chompjs.parse_js_object('{"a": undefined}') Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/home/mariusz/Documents/Praca/venv/local/lib/python2.7/site-packages/chompjs/chompjs.py", line 27, in parse_js_object raise ValueError('Parser error: ... {}'.format(repr(str(exception))[1:-1])) ValueError: Parser error: ... undefined}
Resolved by quoting unrecognised values instead automatically reporting an error:
>>> import chompjs >>> chompjs.parse_js_object('{"a": undefined}') {'a': 'undefined'}
Error raised if
undefined
keyword is present in JavaScript object:Resolved by quoting unrecognised values instead automatically reporting an error: