Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
B
baas-ide
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
guxukai
baas-ide
Commits
a8451b7b
Commit
a8451b7b
authored
Apr 22, 2015
by
chriseth
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Show assembly.
parent
575fbc81
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
3 deletions
+30
-3
index.html
index.html
+30
-3
No files found.
index.html
View file @
a8451b7b
...
@@ -149,7 +149,7 @@ var compile = function() {
...
@@ -149,7 +149,7 @@ var compile = function() {
if
(
data
[
'error'
]
!==
undefined
)
if
(
data
[
'error'
]
!==
undefined
)
renderError
(
data
[
'error'
]);
renderError
(
data
[
'error'
]);
else
else
renderContracts
(
data
);
renderContracts
(
data
,
input
);
}
}
var
compileTimeout
=
null
;
var
compileTimeout
=
null
;
var
onChange
=
function
()
{
var
onChange
=
function
()
{
...
@@ -169,7 +169,7 @@ document.querySelector('#optimize').addEventListener('change', compile);
...
@@ -169,7 +169,7 @@ document.querySelector('#optimize').addEventListener('change', compile);
var
renderError
=
function
(
message
)
{
var
renderError
=
function
(
message
)
{
$
(
'#output'
).
empty
().
append
(
$
(
'<pre></pre>'
).
text
(
message
));
$
(
'#output'
).
empty
().
append
(
$
(
'<pre></pre>'
).
text
(
message
));
};
};
var
renderContracts
=
function
(
data
)
{
var
renderContracts
=
function
(
data
,
source
)
{
$
(
'#output'
).
empty
();
$
(
'#output'
).
empty
();
for
(
var
contractName
in
data
.
contracts
)
{
for
(
var
contractName
in
data
.
contracts
)
{
var
contract
=
data
.
contracts
[
contractName
];
var
contract
=
data
.
contracts
[
contractName
];
...
@@ -179,7 +179,8 @@ var renderContracts = function(data) {
...
@@ -179,7 +179,8 @@ var renderContracts = function(data) {
.
append
(
tableRow
(
'Bytecode'
,
contract
.
bytecode
))
.
append
(
tableRow
(
'Bytecode'
,
contract
.
bytecode
))
.
append
(
tableRow
(
'Interface'
,
contract
[
'interface'
]))
.
append
(
tableRow
(
'Interface'
,
contract
[
'interface'
]))
.
append
(
tableRow
(
'Solidity Interface'
,
contract
.
solidity_interface
))
.
append
(
tableRow
(
'Solidity Interface'
,
contract
.
solidity_interface
))
.
append
(
tableRow
(
'Opcodes'
,
contract
.
opcodes
));
.
append
(
tableRow
(
'Opcodes'
,
contract
.
opcodes
))
.
append
(
formatAssembly
(
contract
.
assembly
,
source
));
$
(
'#output'
).
append
(
contractOutput
);
$
(
'#output'
).
append
(
contractOutput
);
}
}
};
};
...
@@ -188,6 +189,32 @@ var tableRow = function(description, data) {
...
@@ -188,6 +189,32 @@ var tableRow = function(description, data) {
.
append
(
$
(
'<span class="col1">'
).
text
(
description
))
.
append
(
$
(
'<span class="col1">'
).
text
(
description
))
.
append
(
$
(
'<input readonly="readonly" class="col2">'
).
val
(
data
));
.
append
(
$
(
'<input readonly="readonly" class="col2">'
).
val
(
data
));
};
};
var
formatAssembly
=
function
(
asm
,
source
)
{
var
button
=
$
(
'<button>Assembly</button>'
);
var
text
=
$
(
'<pre style="display: none;"/>'
).
text
(
formatAssemblyText
(
asm
,
''
,
source
));
button
.
click
(
function
()
{
text
.
toggle
();
});
return
$
(
'<div/>'
).
append
(
button
).
append
(
text
);
};
var
formatAssemblyText
=
function
(
asm
,
prefix
,
source
)
{
var
text
=
''
;
text
+=
prefix
+
'.code
\
n'
;
$
.
each
(
asm
[
'.code'
],
function
(
i
,
item
)
{
var
v
=
item
.
value
===
undefined
?
''
:
item
.
value
;
var
src
=
''
;
if
(
item
.
begin
!==
undefined
&&
item
.
end
!=
undefined
)
src
=
source
.
slice
(
item
.
begin
,
item
.
end
).
replace
(
'
\
n'
,
'
\\
n'
,
'g'
);
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
);
});
return
text
;
};
$
(
'.asmOutput button'
).
click
(
function
()
{
$
(
this
).
parent
().
find
(
'pre'
).
toggle
();
}
)
</script>
</script>
</body>
</body>
</html>
</html>
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment