michael@0: /* Any copyright is dedicated to the Public Domain.
michael@0: http://creativecommons.org/publicdomain/zero/1.0/ */
michael@0:
michael@0: /**
michael@0: * Check that JS code containing strings that might look like ');",
michael@0: "a.push('');",
michael@0: "a.push('');"
michael@0: ].join("\n");
michael@0: let parser = new Parser();
michael@0: let parsed = parser.get(source);
michael@0:
michael@0: ok(parsed,
michael@0: "The javascript code should be parsed correctly.");
michael@0: is(parser.errors.length, 0,
michael@0: "There should be no errors logged when parsing.");
michael@0:
michael@0: is(parsed.scriptCount, 1,
michael@0: "There should be 1 script parsed in the parent source.");
michael@0:
michael@0: is(parsed.getScriptInfo(source.indexOf("let a")).toSource(), "({start:0, length:261, index:0})",
michael@0: "The script location is correct (1).");
michael@0: is(parsed.getScriptInfo(source.indexOf("")).toSource(), "({start:0, length:261, index:0})",
michael@0: "The script location is correct (3).");
michael@0:
michael@0: finish();
michael@0: }