in contract parser replace jquery dependency with native js

pull/3094/head
Iuri Matias 7 years ago
parent 2ba338cf0a
commit a1fc6fa4db
  1. 14
      src/app/contract/contractParser.js

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

Loading…
Cancel
Save