Skip to content

Correctly wrap JS globals when rewriting JS code #329

Description

@benoit74

When rewriting JS code, wabac uses a JS parser (acorn) to parse JS and correctly detect all JS variables.

For now, our Python equivalent in python-scraperlib is not correctly rewriting these globals in all situations due to the fact that we miss a JS parser and code equivalent to wabac.JS

This is wabac code for which we miss an equivalent in Python scraperlib:

https://github.com/webrecorder/wabac.js/blob/0564e36993f4044f17119e71dd7b2892512ee59c/src/rewrite/jsrewriter.ts#L394-L452

I don't know yet if we can include a JS parser (equivalent to acorn) in the scraperlib or do things differently.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions