Skip to content

Replace JavaScript String scanner in Agent#every_javascript_string with a real JavaScript lexer/parser #25

@postmodern

Description

@postmodern

The JavaScript String scanner logic in Agent#every_javascript_string is very naive and cannot handle tested template literals (ex: `foo ${`bar ${1+1}`}`). It should eventually be replaced with a real JavaScript lexer or parser. It must support >= ES6 (inline regexes, template literals, async/await keywords, etc). Ideally the lexer or parser should be pure-Ruby for JRuby compatibility.

If no suitable JavaScript lexer or parser exists, then we could build one using parslet. If we only need to extract JavaScript String literals and comments, but not fully parse template literals, then we could write a JavaScript lexer using StringScanner.

See ECMA 9.0 spec for a description of the ECMA 9.0 syntax and grammar.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestfutureFuture featurehelp-wantedExtra attention is needed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions