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
6763d28a
Commit
6763d28a
authored
Jun 25, 2014
by
zelig
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
repl.Stop() to only if running, fixes panic after js> exit followed by interrupt
parent
bf57e960
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
15 deletions
+23
-15
repl.go
ethereum/repl.go
+23
-15
No files found.
ethereum/repl.go
View file @
6763d28a
...
@@ -23,6 +23,8 @@ type JSRepl struct {
...
@@ -23,6 +23,8 @@ type JSRepl struct {
prompt
string
prompt
string
history
*
os
.
File
history
*
os
.
File
running
bool
}
}
func
NewJSRepl
(
ethereum
*
eth
.
Ethereum
)
*
JSRepl
{
func
NewJSRepl
(
ethereum
*
eth
.
Ethereum
)
*
JSRepl
{
...
@@ -35,26 +37,32 @@ func NewJSRepl(ethereum *eth.Ethereum) *JSRepl {
...
@@ -35,26 +37,32 @@ func NewJSRepl(ethereum *eth.Ethereum) *JSRepl {
}
}
func
(
self
*
JSRepl
)
Start
()
{
func
(
self
*
JSRepl
)
Start
()
{
logger
.
Infoln
(
"init JS Console"
)
if
!
self
.
running
{
reader
:=
bufio
.
NewReader
(
self
.
history
)
self
.
running
=
true
for
{
logger
.
Infoln
(
"init JS Console"
)
line
,
err
:=
reader
.
ReadString
(
'\n'
)
reader
:=
bufio
.
NewReader
(
self
.
history
)
if
err
!=
nil
&&
err
==
io
.
EOF
{
for
{
break
line
,
err
:=
reader
.
ReadString
(
'\n'
)
}
else
if
err
!=
nil
{
if
err
!=
nil
&&
err
==
io
.
EOF
{
fmt
.
Println
(
"error reading history"
,
err
)
break
break
}
else
if
err
!=
nil
{
fmt
.
Println
(
"error reading history"
,
err
)
break
}
addHistory
(
line
[
:
len
(
line
)
-
1
])
}
}
self
.
read
()
addHistory
(
line
[
:
len
(
line
)
-
1
])
}
}
self
.
read
()
}
}
func
(
self
*
JSRepl
)
Stop
()
{
func
(
self
*
JSRepl
)
Stop
()
{
self
.
re
.
Stop
()
if
self
.
running
{
logger
.
Infoln
(
"exit JS Console"
)
self
.
running
=
false
self
.
history
.
Close
()
self
.
re
.
Stop
()
logger
.
Infoln
(
"exit JS Console"
)
self
.
history
.
Close
()
}
}
}
func
(
self
*
JSRepl
)
parseInput
(
code
string
)
{
func
(
self
*
JSRepl
)
parseInput
(
code
string
)
{
...
...
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