sourceMappingDecoder not a class

pull/697/head
aniket-engg 4 years ago committed by Aniket
parent 8b1df55fff
commit 9c628105bf
  1. 5
      apps/remix-ide/src/app/editor/contextView.js
  2. 5
      apps/remix-ide/src/app/editor/contextualListener.js
  3. 4
      apps/remix-ide/src/lib/offsetToLineColumnConverter.js
  4. 4
      libs/remix-debug/src/index.ts
  5. 6
      libs/remix-debug/test/sourceMappingDecoder.ts

@ -1,7 +1,6 @@
'use strict'
const yo = require('yo-yo')
const remixDebug = require('@remix-project/remix-debug')
const SourceMappingDecoder = remixDebug.SourceMappingDecoder
import { sourceMappingDecoder } from '@remix-project/remix-debug'
const globalRegistry = require('../../global/registry')
const css = require('./styles/contextView-styles')
@ -28,7 +27,7 @@ class ContextView {
this._view = null
this._nodes = null
this._current = null
this.sourceMappingDecoder = SourceMappingDecoder
this.sourceMappingDecoder = sourceMappingDecoder
this.previousElement = null
this.contextualListener.event.register('contextChanged', nodes => {
this.show()

@ -2,10 +2,9 @@
import { Plugin } from '@remixproject/engine'
import * as packageJson from '../../../../../package.json'
const remixdebug = require('@remix-project/remix-debug')
import { sourceMappingDecoder } from '@remix-project/remix-debug'
const { AstWalker } = require('@remix-project/remix-astwalker')
const csjs = require('csjs-inject')
const SourceMappingDecoder = remixdebug.SourceMappingDecoder
const EventManager = require('../../lib/events')
const globalRegistry = require('../../global/registry')
@ -39,7 +38,7 @@ class ContextualListener extends Plugin {
this._activeHighlights = []
this.editor.event.register('contentChanged', () => { this._stopHighlighting() })
this.sourceMappingDecoder = SourceMappingDecoder
this.sourceMappingDecoder = sourceMappingDecoder
this.astWalker = new AstWalker()
}

@ -1,7 +1,7 @@
'use strict'
import { Plugin } from '@remixproject/engine'
import * as packageJson from '../../../../package.json'
var SourceMappingDecoder = require('@remix-project/remix-debug').SourceMappingDecoder
import { sourceMappingDecoder } from '@remix-project/remix-debug'
const profile = {
name: 'offsetToLineColumnConverter',
@ -14,7 +14,7 @@ export class OffsetToLineColumnConverter extends Plugin {
constructor () {
super(profile)
this.lineBreakPositionsByContent = {}
this.sourceMappingDecoder = SourceMappingDecoder
this.sourceMappingDecoder = sourceMappingDecoder
}
/**

@ -7,7 +7,7 @@ import { StorageViewer } from './storage/storageViewer'
import { StorageResolver } from './storage/storageResolver'
import * as SolidityDecoder from './solidity-decoder'
import { BreakpointManager } from './code/breakpointManager'
import * as SourceMappingDecoder from './source/sourceMappingDecoder'
import * as sourceMappingDecoder from './source/sourceMappingDecoder'
import * as traceHelper from './trace/traceHelper'
/*
@ -21,7 +21,7 @@ import * as traceHelper from './trace/traceHelper'
export = {
init,
traceHelper,
SourceMappingDecoder,
sourceMappingDecoder,
EthDebugger,
TransactionDebugger,
/**

@ -5,11 +5,10 @@ import * as sourceMappingDecoder from '../src/source/sourceMappingDecoder'
const compiler = require('solc')
const compilerInput = require('./helpers/compilerHelper').compilerInput
tape('SourceMappingDecoder', function (t) {
t.test('SourceMappingDecoder.findNodeAtInstructionIndex', function (st) {
tape('sourceMappingDecoder', function (t) {
t.test('sourceMappingDecoder.findNodeAtInstructionIndex', function (st) {
let output = compiler.compile(compilerInput(contracts))
output = JSON.parse(output)
// const sourceMappingDecoder = new SourceMappingDecoder()
let node = sourceMappingDecoder.findNodeAtInstructionIndex('FunctionDefinition', 2, output.contracts['test.sol']['test'].evm.deployedBytecode.sourceMap, output.sources['test.sol'])
st.equal(node, null)
node = sourceMappingDecoder.findNodeAtInstructionIndex('FunctionDefinition', 80, output.contracts['test.sol']['test'].evm.deployedBytecode.sourceMap, output.sources['test.sol'])
@ -23,7 +22,6 @@ tape('SourceMappingDecoder', function (t) {
const testSourceMapping = {}
t.test('sourceMappingDecoder', function (st) {
st.plan(36)
// const sourceMappingDecoder = new SourceMappingDecoder()
console.log('test decompressAll')
let result = sourceMappingDecoder.decompressAll(sourceMapping.mapping)
st.equal(result[0].start, 0)

Loading…
Cancel
Save