Tuesday, 18 April 2017

nodejs json_parse crash on asteriks

I listen on a websocket for some data that will be in the following format:

'{"mode": "test", "code": "' + editor.getValue() + '", "testTeam": "basic"}'

The users will write some code that we then will run in a sandbox.

When i parse the data with data = JSON.parse(message); it crash if it get the character * asterisk.

What is so special with * that makes it crash? I though of just removing them but that will destroy user comments in the code.



via Olof

No comments:

Post a Comment