facebook / facebook/flow

Catch name_mapper exceptions

Open
#3,889 0 comments 0 reactions 0 assignees View on GitHub
Crash Effort: easy
Dominant language
Rust
Stars
22.3k
Forks
1.9k
PR merge metrics
No merged PRs in 30d

Description

You can write name mappers like

module.name_mapper='foo\(bar\)?' -> '\1'

which will error since the matching group might not exist. This leads to an uncaught exception. This should be easy to fix - we should wrap the `Str.global_replace` calls in https://github.com/facebook/flow/blob/master/src/services/inference/module_js.ml with `try/with` blocks, emit an error, and soldier on.

Thanks @billschaller for the report!

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.