diff options
author | frankiebee <frankie.diamond@gmail.com> | 2018-07-11 02:32:05 +0800 |
---|---|---|
committer | frankiebee <frankie.diamond@gmail.com> | 2018-07-11 02:32:05 +0800 |
commit | 28c509914bf09850dd9aaef52b212f6271633e93 (patch) | |
tree | 049373cf51ae16580a5f18dd29e195e68d4f7b53 /development/sourcemap-validator.js | |
parent | 94a4f99115cf549a3014d29d828e7a432bf36a62 (diff) | |
parent | f6de948e42ae633d40aef72595a01caa622a280d (diff) | |
download | tangerine-wallet-browser-28c509914bf09850dd9aaef52b212f6271633e93.tar tangerine-wallet-browser-28c509914bf09850dd9aaef52b212f6271633e93.tar.gz tangerine-wallet-browser-28c509914bf09850dd9aaef52b212f6271633e93.tar.bz2 tangerine-wallet-browser-28c509914bf09850dd9aaef52b212f6271633e93.tar.lz tangerine-wallet-browser-28c509914bf09850dd9aaef52b212f6271633e93.tar.xz tangerine-wallet-browser-28c509914bf09850dd9aaef52b212f6271633e93.tar.zst tangerine-wallet-browser-28c509914bf09850dd9aaef52b212f6271633e93.zip |
Merge branch 'develop' of https://github.com/MetaMask/metamask-extension into i#3896
Diffstat (limited to 'development/sourcemap-validator.js')
-rw-r--r-- | development/sourcemap-validator.js | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/development/sourcemap-validator.js b/development/sourcemap-validator.js index edc97667a..143888128 100644 --- a/development/sourcemap-validator.js +++ b/development/sourcemap-validator.js @@ -1,6 +1,6 @@ const fs = require('fs') const { SourceMapConsumer } = require('source-map') - +const path = require('path') // // Utility to help check if sourcemaps are working // @@ -11,9 +11,11 @@ const { SourceMapConsumer } = require('source-map') start() -async function start() { - const rawBuild = fs.readFileSync(__dirname + '/../dist/chrome/inpage.js', 'utf8') - const rawSourceMap = fs.readFileSync(__dirname + '/../dist/sourcemaps/inpage.js.map', 'utf8') + +async function start () { + const rawBuild = fs.readFileSync(path.join(__dirname, '/../dist/chrome/', 'inpage.js') + , 'utf8') + const rawSourceMap = fs.readFileSync(path.join(__dirname, '/../dist/sourcemaps/', 'inpage.js.map'), 'utf8') const consumer = await new SourceMapConsumer(rawSourceMap) console.log('hasContentsOfAllSources:', consumer.hasContentsOfAllSources(), '\n') @@ -34,7 +36,7 @@ async function start() { if (result.source === 'node_modules/web3/dist/web3.min.js') return // minified mess const sourceContent = consumer.sourceContentFor(result.source) const sourceLines = sourceContent.split('\n') - const line = sourceLines[result.line-1] + const line = sourceLines[result.line - 1] console.log(`\n========================== ${result.source} ====================================\n`) console.log(line) console.log(`\n==============================================================================\n`) @@ -42,8 +44,9 @@ async function start() { }) } -function indicesOf(substring, string) { - var a=[],i=-1; - while((i=string.indexOf(substring,i+1)) >= 0) a.push(i); - return a; +function indicesOf (substring, string) { + var a = [] + var i = -1 + while ((i = string.indexOf(substring, i + 1)) >= 0) a.push(i) + return a } |