Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
15 changed files
with
115 additions
and
67 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
const generate = require('generate-source-map'); | ||
const convert = require('convert-source-map'); | ||
const fs = require('fs'); | ||
const path = require('path'); | ||
|
||
const EOL = `\n`; | ||
|
||
const destinationDirectory = path.resolve(__dirname, '../data'); | ||
|
||
function getSourceMapComment(source, sourceFile) { | ||
const map = generate({ source, sourceFile }); | ||
|
||
return convert.fromJSON(map.toString()).toComment(); | ||
} | ||
|
||
function getFileContent(file) { | ||
return fs.readFileSync(file).toString(); | ||
} | ||
|
||
function generateInvalidSourceMapLine() { | ||
const filename = 'invalid-map-line.js'; | ||
|
||
const source = getFileContent('./src/invalid-map-line.1.js'); | ||
const invalidSource = getFileContent('./src/invalid-map-line.2.js'); | ||
|
||
const sourceMapComment = getSourceMapComment(source, filename); | ||
|
||
const content = `${invalidSource}${EOL}${sourceMapComment}`; | ||
|
||
fs.writeFileSync(path.join(destinationDirectory, filename), content); | ||
} | ||
|
||
function generateInvalidMapColumn() { | ||
const filename = 'invalid-map-column.js'; | ||
|
||
const source = getFileContent('./src/invalid-map-column.1.js'); | ||
const invalidSource = getFileContent('./src/invalid-map-column.2.js'); | ||
|
||
const sourceMapComment = getSourceMapComment(source, filename); | ||
|
||
const content = `${invalidSource}${EOL}${sourceMapComment}`; | ||
|
||
fs.writeFileSync(path.join(destinationDirectory, filename), content); | ||
} | ||
|
||
generateInvalidSourceMapLine(); | ||
generateInvalidMapColumn(); |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
console.log('goodbye cruel world'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
console.log('hello joyful world'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
console.log('hello happy world'); | ||
console.log('hello man'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
console.log('hello happy world'); |