diff options
author | Анна <anna@MacBook-Air-Anna.local> | 2018-07-05 11:15:28 +0800 |
---|---|---|
committer | Анна <anna@MacBook-Air-Anna.local> | 2018-07-05 11:15:28 +0800 |
commit | 90934bca46cf990554cbf9be9e302ab5e2fc8041 (patch) | |
tree | ee68fa3d98e8c0e072980fd07397b3a9bd40d640 /development/sourcemap-validator.js | |
parent | 1f6bf0a80d43252d7b84e8e0247a524b77569810 (diff) | |
parent | fd218142acb6dab0b2f921b9729f17ff90cffc2d (diff) | |
download | tangerine-wallet-browser-90934bca46cf990554cbf9be9e302ab5e2fc8041.tar tangerine-wallet-browser-90934bca46cf990554cbf9be9e302ab5e2fc8041.tar.gz tangerine-wallet-browser-90934bca46cf990554cbf9be9e302ab5e2fc8041.tar.bz2 tangerine-wallet-browser-90934bca46cf990554cbf9be9e302ab5e2fc8041.tar.lz tangerine-wallet-browser-90934bca46cf990554cbf9be9e302ab5e2fc8041.tar.xz tangerine-wallet-browser-90934bca46cf990554cbf9be9e302ab5e2fc8041.tar.zst tangerine-wallet-browser-90934bca46cf990554cbf9be9e302ab5e2fc8041.zip |
Merge branch 'develop' into to-autocomplete
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 } |