src/jdk/nashorn/internal/runtime/resources/parser.js

changeset 82
abea4ba28901
parent 7
5a1b0714df0e
child 136
c54e218333be
equal deleted inserted replaced
81:5ead5333fa59 82:abea4ba28901
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

mercurial