You need to wrap the object expression (it's not a valid statement alone):
var s = "{ a: 3, b: 7 }";
var obj = eval('(' + s + ')');
Needless to say that eval is not secure, but if you have no choice... Just be aware that this will execute any code the server sends to you. c.f. Why is using the JavaScript eval function a bad idea? for a more thorough discussion on the matter
Extra fun: try entering both { a: 3, b: 7 }
and ({ a: 3, b: 7 })
in the online esprima parser :) http://esprima.org/demo/parse.html