Skip to content

Commit

Permalink
Fixes #1498. Don't remove await
Browse files Browse the repository at this point in the history
Signed-off-by: Prabhu Subramanian <prabhu@appthreat.com>
  • Loading branch information
prabhu committed Dec 22, 2024
1 parent bc98665 commit 3e791fd
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions lib/evinser/evinser.js
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ export async function createSlice(
options = {},
) {
if (!filePath) {
return;
return undefined;
}
const firstLanguage = Array.isArray(purlOrLanguages)
? purlOrLanguages[0]
Expand All @@ -227,7 +227,7 @@ export async function createSlice(
PROJECT_TYPE_ALIASES.swift.includes(language) &&
sliceType !== "semantics"
) {
return;
return undefined;
}

let sliceOutputDir = fs.mkdtempSync(
Expand Down Expand Up @@ -388,7 +388,7 @@ export async function analyzeProject(dbObjMap, options) {
fs.readFileSync(options.reachablesSlicesFile, "utf-8"),
);
} else {
retMap = createSlice(language, dirPath, "reachables", options);
retMap = await createSlice(language, dirPath, "reachables", options);
if (retMap?.slicesFile && fs.existsSync(retMap.slicesFile)) {
reachablesSlicesFile = retMap.slicesFile;
reachablesSlice = JSON.parse(
Expand All @@ -409,7 +409,7 @@ export async function analyzeProject(dbObjMap, options) {
usagesSlicesFile = options.usagesSlicesFile;
} else {
// Generate our own slices
retMap = createSlice(language, dirPath, "usages", options);
retMap = await createSlice(language, dirPath, "usages", options);
if (retMap?.slicesFile && fs.existsSync(retMap.slicesFile)) {
usageSlice = JSON.parse(fs.readFileSync(retMap.slicesFile, "utf-8"));
usagesSlicesFile = retMap.slicesFile;
Expand All @@ -428,7 +428,7 @@ export async function analyzeProject(dbObjMap, options) {
semanticsSlicesFile = options.semanticsSlicesFile;
} else {
// Generate our own slices
retMap = createSlice(language, dirPath, "semantics", options);
retMap = await createSlice(language, dirPath, "semantics", options);
if (retMap?.slicesFile && fs.existsSync(retMap.slicesFile)) {
semanticsSlice = JSON.parse(
fs.readFileSync(retMap.slicesFile, "utf-8"),
Expand Down Expand Up @@ -471,7 +471,7 @@ export async function analyzeProject(dbObjMap, options) {
fs.readFileSync(options.dataFlowSlicesFile, "utf-8"),
);
} else {
retMap = createSlice(language, dirPath, "data-flow", options);
retMap = await createSlice(language, dirPath, "data-flow", options);
if (retMap?.slicesFile && fs.existsSync(retMap.slicesFile)) {
dataFlowSlicesFile = retMap.slicesFile;
dataFlowSlice = JSON.parse(fs.readFileSync(retMap.slicesFile, "utf-8"));
Expand Down

0 comments on commit 3e791fd

Please sign in to comment.