-
Notifications
You must be signed in to change notification settings - Fork 903
Open
Description
Rhino 1.8.0 (I haven't checked older versions)
PoC:
public static void main(String[] args) {
try {
CompilerEnvirons env = new CompilerEnvirons();
env.setRecordingComments(true);
Parser parser = new Parser(env, env.getErrorReporter());
String comment = "// comment";
System.out.println(comment);
AstRoot ast = parser.parse(comment, null, 1);
System.out.println(comment.length());
System.out.println(ast.debugPrint());
ast.getComments().forEach(comm -> System.out.println(comm.getValue()));
} catch (EvaluatorException ee) {
// nothing to do
}
}Output:
// comment
10
0 SCRIPT 0 9
0 COMMENT 0 9
0 COMMENT 0 9
// commenMetadata
Metadata
Assignees
Labels
No labels