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
973907b8
Commit
973907b8
authored
Oct 02, 2018
by
Iuri Matias
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
move global vars out of debugger logic
parent
e82ef923
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
13 deletions
+25
-13
debugger.js
src/app/debugger/debugger.js
+12
-13
debuggerUI.js
src/app/debugger/debuggerUI.js
+13
-0
No files found.
src/app/debugger/debugger.js
View file @
973907b8
...
@@ -2,20 +2,18 @@
...
@@ -2,20 +2,18 @@
var
Ethdebugger
=
require
(
'remix-debug'
).
EthDebugger
var
Ethdebugger
=
require
(
'remix-debug'
).
EthDebugger
var
remixLib
=
require
(
'remix-lib'
)
var
remixLib
=
require
(
'remix-lib'
)
var
EventManager
=
remixLib
.
EventManager
var
EventManager
=
remixLib
.
EventManager
var
executionContext
=
require
(
'../../execution-context'
)
var
globalRegistry
=
require
(
'../../global/registry'
)
function
Debugger
()
{
function
Debugger
(
options
)
{
var
self
=
this
var
self
=
this
this
.
event
=
new
EventManager
()
this
.
event
=
new
EventManager
()
this
.
registry
=
globalRegistry
this
.
executionContext
=
options
.
executionContext
this
.
offsetToLineColumnConverter
=
this
.
registry
.
get
(
'offsettolinecolumnconverter'
).
api
this
.
offsetToLineColumnConverter
=
options
.
offsetToLineColumnConverter
this
.
compiler
=
this
.
registry
.
get
(
'compiler'
).
api
this
.
compiler
=
options
.
compiler
this
.
debugger
=
new
Ethdebugger
(
this
.
debugger
=
new
Ethdebugger
(
{
{
executionContext
:
executionContext
,
executionContext
:
this
.
executionContext
,
compilationResult
:
()
=>
{
compilationResult
:
()
=>
{
var
compilationResult
=
this
.
compiler
.
lastCompilationResult
var
compilationResult
=
this
.
compiler
.
lastCompilationResult
if
(
compilationResult
)
{
if
(
compilationResult
)
{
...
@@ -33,8 +31,9 @@ function Debugger () {
...
@@ -33,8 +31,9 @@ function Debugger () {
this
.
debugger
.
setBreakpointManager
(
this
.
breakPointManager
)
this
.
debugger
.
setBreakpointManager
(
this
.
breakPointManager
)
executionContext
.
event
.
register
(
'contextChanged'
,
this
,
function
(
context
)
{
this
.
executionContext
.
event
.
register
(
'contextChanged'
,
this
,
function
(
context
)
{
self
.
switchProvider
(
context
)
// TODO: was already broken
//self.switchProvider(context)
})
})
this
.
debugger
.
event
.
register
(
'newTraceLoaded'
,
this
,
function
()
{
this
.
debugger
.
event
.
register
(
'newTraceLoaded'
,
this
,
function
()
{
...
@@ -45,10 +44,10 @@ function Debugger () {
...
@@ -45,10 +44,10 @@ function Debugger () {
self
.
event
.
trigger
(
'debuggerStatus'
,
[
false
])
self
.
event
.
trigger
(
'debuggerStatus'
,
[
false
])
})
})
this
.
debugger
.
addProvider
(
'vm'
,
executionContext
.
vm
())
this
.
debugger
.
addProvider
(
'vm'
,
this
.
executionContext
.
vm
())
this
.
debugger
.
addProvider
(
'injected'
,
executionContext
.
internalWeb3
())
this
.
debugger
.
addProvider
(
'injected'
,
this
.
executionContext
.
internalWeb3
())
this
.
debugger
.
addProvider
(
'web3'
,
executionContext
.
internalWeb3
())
this
.
debugger
.
addProvider
(
'web3'
,
this
.
executionContext
.
internalWeb3
())
this
.
debugger
.
switchProvider
(
executionContext
.
getProvider
())
this
.
debugger
.
switchProvider
(
this
.
executionContext
.
getProvider
())
}
}
Debugger
.
prototype
.
registerAndHighlightCodeItem
=
function
(
index
)
{
Debugger
.
prototype
.
registerAndHighlightCodeItem
=
function
(
index
)
{
...
...
src/app/debugger/debuggerUI.js
View file @
973907b8
...
@@ -12,6 +12,7 @@ var EventManager = remixLib.EventManager
...
@@ -12,6 +12,7 @@ var EventManager = remixLib.EventManager
var
executionContext
=
require
(
'../../execution-context'
)
var
executionContext
=
require
(
'../../execution-context'
)
var
globalRegistry
=
require
(
'../../global/registry'
)
var
globalRegistry
=
require
(
'../../global/registry'
)
var
executionContext
=
require
(
'../../execution-context'
)
var
globalRegistry
=
require
(
'../../global/registry'
)
var
globalRegistry
=
require
(
'../../global/registry'
)
var
yo
=
require
(
'yo-yo'
)
var
yo
=
require
(
'yo-yo'
)
...
@@ -57,6 +58,18 @@ class DebuggerUI {
...
@@ -57,6 +58,18 @@ class DebuggerUI {
this
.
listenToEvents
()
this
.
listenToEvents
()
}
}
setupExecutionContext
()
{
this
.
executionContext
.
event
.
register
(
'contextChanged'
,
this
,
function
(
context
)
{
// TODO: was already broken
//self.switchProvider(context)
})
this
.
debugger
.
addProvider
(
'vm'
,
this
.
executionContext
.
vm
())
this
.
debugger
.
addProvider
(
'injected'
,
this
.
executionContext
.
internalWeb3
())
this
.
debugger
.
addProvider
(
'web3'
,
this
.
executionContext
.
internalWeb3
())
this
.
debugger
.
switchProvider
(
this
.
executionContext
.
getProvider
())
}
setEditor
()
{
setEditor
()
{
const
self
=
this
const
self
=
this
this
.
editor
=
this
.
registry
.
get
(
'editor'
).
api
this
.
editor
=
this
.
registry
.
get
(
'editor'
).
api
...
...
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