From 2fcef8e4f39e5c71474fbea7a874df8558b3d502 Mon Sep 17 00:00:00 2001 From: Iuri Matias Date: Tue, 6 Feb 2018 14:15:47 -0500 Subject: [PATCH] in contract parser replace jquery dependency with native js --- src/app/contract/contractParser.js | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/src/app/contract/contractParser.js b/src/app/contract/contractParser.js index 5f45cea55a..743cc7828c 100644 --- a/src/app/contract/contractParser.js +++ b/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 }