in contract parser replace jquery dependency with native js

pull/1/head
Iuri Matias 7 years ago
parent 82344f222c
commit 2fcef8e4f3
  1. 14
      src/app/contract/contractParser.js

@ -1,6 +1,5 @@
'use strict'
var $ = require('jquery')
var txHelper = require('../execution/txHelper')
module.exports = (contractName, contract, compiledSource) => {
@ -63,7 +62,7 @@ var formatAssemblyText = function (asm, prefix, source) {
return prefix + asm + '\n'
}
var text = prefix + '.code\n'
$.each(asm['.code'], function (i, item) {
asm['.code'].forEach(function (item, _i) {
var v = item.value === undefined ? '' : item.value
var src = ''
if (item.begin !== undefined && item.end !== undefined) {
@ -78,12 +77,11 @@ var formatAssemblyText = function (asm, prefix, source) {
text += prefix + item.name + ' ' + v + '\t\t\t' + src + '\n'
})
text += prefix + '.data\n'
if (asm['.data']) {
$.each(asm['.data'], function (i, item) {
text += ' ' + prefix + '' + i + ':\n'
text += formatAssemblyText(item, prefix + ' ', source)
})
}
let asmData = (asm['.data'] || [])
asmData.forEach(function (item, i) {
text += ' ' + prefix + '' + i + ':\n'
text += formatAssemblyText(item, prefix + ' ', source)
})
return text
}

Loading…
Cancel
Save