45 name = arguments[1]; |
45 name = arguments[1]; |
46 case 1: |
46 case 1: |
47 code = arguments[0]; |
47 code = arguments[0]; |
48 } |
48 } |
49 |
49 |
50 var jsonStr = Packages.jdk.nashorn.internal.ir.debug.JSONWriter.parse(code, name, location); |
50 var jsonStr = Packages.jdk.nashorn.internal.runtime.ScriptRuntime.parse(code, name, location); |
51 return JSON.parse(jsonStr, |
51 return JSON.parse(jsonStr, |
52 function (prop, value) { |
52 function (prop, value) { |
53 if (typeof(value) == 'string' && prop == "value") { |
53 if (typeof(value) == 'string' && prop == "value") { |
54 // handle regexps and strings - both are encoded as strings but strings |
54 // handle regexps and strings - both are encoded as strings but strings |
55 // do not start with '/'. If regexp, then eval it to make RegExp object |
55 // do not start with '/'. If regexp, then eval it to make RegExp object |