Skip to content

Commit

Permalink
Treat an empty source map string as missing
Browse files Browse the repository at this point in the history
Summary:
Currently, an empty string will be treated as a source map, while nullptr will
treat it as missing. For easier JS interop, treat these the same.

Reviewed By: ArchDev

Differential Revision: D21621982

fbshipit-source-id: c408b3889ce368ce4bad5b4529deca8c1eeb9c40
  • Loading branch information
willholen authored and facebook-github-bot committed May 18, 2020
1 parent b6530ae commit 826580a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tools/emhermesc/emhermesc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ extern "C" CompileResult *hermesCompileToBytecode(
return compileRes.release();
}

if (sourceMapData != nullptr) {
if (sourceMapData != nullptr && sourceMapData[0] != '\0') {
if (sourceMapData[sourceMapSize - 1] != 0) {
compileRes->error_ = "Input sourcemap must be zero-terminated";
return compileRes.release();
Expand Down

0 comments on commit 826580a

Please sign in to comment.