aboutsummaryrefslogtreecommitdiffstats
path: root/development/sourcemap-validator.js
diff options
context:
space:
mode:
authorEsteban MIno <efmino@uc.cl>2018-07-04 01:23:15 +0800
committerEsteban MIno <efmino@uc.cl>2018-07-04 01:23:15 +0800
commit0494b2fc8a84a533227d25e869a95226f99734af (patch)
treeda39134cf8d82c4e208f9461a9f4391b8f47fd28 /development/sourcemap-validator.js
parent03fd4355af8ceae9a1d2cad04e12a4f86a9f36b7 (diff)
parent1f0cf11af1c94e750bbc4c5238c3ee028350a6c6 (diff)
downloadtangerine-wallet-browser-0494b2fc8a84a533227d25e869a95226f99734af.tar
tangerine-wallet-browser-0494b2fc8a84a533227d25e869a95226f99734af.tar.gz
tangerine-wallet-browser-0494b2fc8a84a533227d25e869a95226f99734af.tar.bz2
tangerine-wallet-browser-0494b2fc8a84a533227d25e869a95226f99734af.tar.lz
tangerine-wallet-browser-0494b2fc8a84a533227d25e869a95226f99734af.tar.xz
tangerine-wallet-browser-0494b2fc8a84a533227d25e869a95226f99734af.tar.zst
tangerine-wallet-browser-0494b2fc8a84a533227d25e869a95226f99734af.zip
Merge branch 'develop' into detectTokenFeature
Diffstat (limited to 'development/sourcemap-validator.js')
-rw-r--r--development/sourcemap-validator.js21
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
}