Skip to content

Commit

Permalink
Fixed bug in transpile function.
Browse files Browse the repository at this point in the history
  • Loading branch information
TwitchBronBron committed May 7, 2020
1 parent 0c96f8e commit 3ab1c47
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/Program.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1288,6 +1288,7 @@ describe('Program', () => {
});

it('creates sourcemap for brs and xml files', async () => {
fsExtra.ensureDirSync(program.options.stagingFolderPath);
await program.addOrReplaceFile('source/main.brs', `
sub main()
end sub
Expand Down
3 changes: 1 addition & 2 deletions src/Program.ts
Original file line number Diff line number Diff line change
Expand Up @@ -627,8 +627,7 @@ export class Program {
if (await fsExtra.pathExists(outputCodePath)) {
throw new Error(`Error while transpiling "${filePath}". A file already exists at "${outputCodePath}" and will not be overwritten.`);
}

let writeMapPromise = result.map ? fsExtra.writeFile(outputCodeMapPath, result.map) : null;
let writeMapPromise = result.map ? fsExtra.writeFile(outputCodeMapPath, result.map.toString()) : null;
await Promise.all([
fsExtra.writeFile(outputCodePath, result.code),
writeMapPromise
Expand Down

0 comments on commit 3ab1c47

Please sign in to comment.