Skip to content

Commit

Permalink
Don't get stuck on an initial syntax error
Browse files Browse the repository at this point in the history
Reviewed By: cpojer

Differential Revision: D16073386

fbshipit-source-id: f65f13118332613331eafd5ff01268d32865d0e8
  • Loading branch information
gaearon authored and facebook-github-bot committed Jul 1, 2019
1 parent f34987e commit 721cbe2
Showing 1 changed file with 19 additions and 13 deletions.
32 changes: 19 additions & 13 deletions packages/metro/src/IncrementalBundler.js
Original file line number Diff line number Diff line change
Expand Up @@ -208,19 +208,25 @@ class IncrementalBundler {

this._revisionsById.set(revisionId, revisionPromise);
this._revisionsByGraphId.set(graphId, revisionPromise);
const revision = await revisionPromise;

const delta = {
added: revision.graph.dependencies,
modified: new Map(),
deleted: new Set(),
reset: true,
};

return {
revision,
delta,
};
try {
const revision = await revisionPromise;
const delta = {
added: revision.graph.dependencies,
modified: new Map(),
deleted: new Set(),
reset: true,
};
return {
revision,
delta,
};
} catch (err) {
// Evict a bad revision from the cache since otherwise
// we'll keep getting it even after the build is fixed.
this._revisionsById.delete(revisionId);
this._revisionsByGraphId.delete(graphId);
throw err;
}
}

async updateGraph(
Expand Down

0 comments on commit 721cbe2

Please sign in to comment.