Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
Geth-Modification
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
张蕾
Geth-Modification
Commits
351d6b0d
Commit
351d6b0d
authored
May 07, 2015
by
obscuren
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
jsre, cmd/geth: updated web3.js and altered settimeout
parent
03473d48
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
13 deletions
+7
-13
js.go
cmd/geth/js.go
+0
-6
ethereum_js.go
jsre/ethereum_js.go
+2
-2
jsre.go
jsre/jsre.go
+5
-5
No files found.
cmd/geth/js.go
View file @
351d6b0d
...
...
@@ -117,12 +117,6 @@ func (js *jsre) apiBindings(f xeth.Frontend) {
utils
.
Fatalf
(
"Error loading bignumber.js: %v"
,
err
)
}
// we need to declare a dummy setTimeout. Otto does not support it
_
,
err
=
js
.
re
.
Eval
(
"setTimeout = function(cb, delay) {};"
)
if
err
!=
nil
{
utils
.
Fatalf
(
"Error defining setTimeout: %v"
,
err
)
}
err
=
js
.
re
.
Compile
(
"ethereum.js"
,
re
.
Ethereum_JS
)
if
err
!=
nil
{
utils
.
Fatalf
(
"Error loading ethereum.js: %v"
,
err
)
...
...
jsre/ethereum_js.go
View file @
351d6b0d
This diff is collapsed.
Click to expand it.
jsre/jsre.go
View file @
351d6b0d
...
...
@@ -143,6 +143,10 @@ func (self *JSRE) runEventLoop() {
}
return
otto
.
UndefinedValue
()
}
self
.
vm
.
Set
(
"setTimeout"
,
setTimeout
)
self
.
vm
.
Set
(
"setInterval"
,
setInterval
)
self
.
vm
.
Set
(
"clearTimeout"
,
clearTimeout
)
self
.
vm
.
Set
(
"clearInterval"
,
clearTimeout
)
var
waitForCallbacks
bool
...
...
@@ -165,7 +169,7 @@ loop:
_
,
err
:=
self
.
vm
.
Call
(
`Function.call.call`
,
nil
,
arguments
...
)
if
err
!=
nil
{
break
loop
fmt
.
Println
(
"js error:"
,
err
,
arguments
)
}
if
timer
.
interval
{
timer
.
timer
.
Reset
(
timer
.
duration
)
...
...
@@ -177,10 +181,6 @@ loop:
}
case
evalReq
:=
<-
self
.
evalQueue
:
// run the code, send the result back
self
.
vm
.
Set
(
"setTimeout"
,
setTimeout
)
self
.
vm
.
Set
(
"setInterval"
,
setInterval
)
self
.
vm
.
Set
(
"clearTimeout"
,
clearTimeout
)
self
.
vm
.
Set
(
"clearInterval"
,
clearTimeout
)
evalReq
.
fn
(
&
evalReq
.
res
)
close
(
evalReq
.
done
)
if
waitForCallbacks
&&
(
len
(
registry
)
==
0
)
{
...
...
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