Skip to content

swc/tests/source_map_inline.js -> atob needs to be replaced with Buffer.from ? #2715

@schacker

Description

@schacker

Describe the bug

After I follow the steps in the document(CONTRIBUTING.md#getting-your-development-environment-set-up,cd ecmascript/transforms; yarn install shouldn't be needed anymore? ),
run cargo test, got

running 2 tests
test issue_622 ... ok
test issue_706 ... FAILED

failures:

---- issue_706 stdout ----
thread 'issue_706' panicked at 'Validation failed: 

[eval]:13
atob(re.exec(jsContent)[1]);
^

ReferenceError: atob is not defined
    at [eval]:13:1
    at Script.runInThisContext (vm.js:116:20)
    at Object.runInThisContext (vm.js:306:38)
    at Object.<anonymous> ([eval]-wrapper:9:26)
    at Module._compile (internal/modules/cjs/loader.js:959:30)
    at evalScript (internal/process/execution.js:80:25)
    at internal/main/eval_string.js:23:3
', crates/swc/tests/source_map.rs:112:9

Input code

No response

Config

No response

Playground link

No response

Expected behavior

The cargo test script runs normally

Version

the latest code

Additional context

os: mac
node: 14.17.0
deno: 1.15.3
rustc: 1.58.0-nightly (46b8e7488 2021-11-07)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions