Skip to content

Commit

Permalink
Fix code scanning alert no. 279: Disallow lexical declarations in cas…
Browse files Browse the repository at this point in the history
…e clauses
  • Loading branch information
tolauwae committed Dec 6, 2024
1 parent 7cfc8a2 commit d22ebb6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/sourcemap/SourceMapFactory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,11 @@ export class SourceMapFactory {
}

public async map(source: string, tmpdir?: string): Promise<SourceMap.Mapping> {
let compiled: CompileOutput;
switch (getFileExtension(source)) {
case 'wast' :
case 'wat' :
const compiled: CompileOutput = await this.compilerFactory.pickCompiler(source).compile(source);
compiled = await this.compilerFactory.pickCompiler(source).compile(source);
return new WatMapper(compiled.out ?? '', tmpdir ?? path.dirname(compiled.file), WABT).mapping();
case 'ts' :
return new AsScriptMapper(source ?? '', tmpdir ?? path.dirname(source)).mapping();
Expand Down

0 comments on commit d22ebb6

Please sign in to comment.