Add source locations to AST

Summary:
Release note: none

Debugging is more painful with debug-fb-ww than it needs to be, because the AST that goes into the abstract interpreter does not have source locations.

This little change fixes that. Please be so kind as to bless it.
Closes https://github.com/facebook/prepack/pull/1604

Differential Revision: D7305670

Pulled By: hermanventer

fbshipit-source-id: fea20e987278ba45be79a29c7d0e84bb4b20ddc4
This commit is contained in:
Herman Venter 2018-03-16 11:41:50 -07:00 committed by Facebook Github Bot
parent 35ba27fa6c
commit 3fcfa3d12d

View File

@ -59,7 +59,7 @@ let uniqueEvaluatedComponents = 0;
function compileSource(source) {
let serialized;
try {
serialized = prepackSources([{ filePath: "", fileContents: source, sourceMapContents: "" }], prepackOptions);
serialized = prepackSources([{ filePath: inputPath, fileContents: source, sourceMapContents: "" }], prepackOptions);
} catch (e) {
errorsCaptured.forEach(error => {
console.error(error);