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
156f9ae2
Commit
156f9ae2
authored
Sep 07, 2021
by
aniket-engg
Committed by
Aniket
Sep 08, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
eventManager removed
parent
3ead354c
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
4 additions
and
72 deletions
+4
-72
test-tab.js
apps/remix-ide/src/app/tabs/test-tab.js
+1
-1
compiler.ts
libs/remix-tests/src/compiler.ts
+1
-1
eventManager.ts
libs/remix-tests/src/lib/eventManager.ts
+0
-68
runTestSources.ts
libs/remix-tests/src/runTestSources.ts
+2
-2
No files found.
apps/remix-ide/src/app/tabs/test-tab.js
View file @
156f9ae2
...
...
@@ -98,7 +98,7 @@ module.exports = class TestTab extends ViewPlugin {
this
.
setCurrentPath
(
this
.
defaultPath
)
})
this
.
testRunner
.
event
.
register
(
'compilationFinished'
,
(
success
,
data
,
source
)
=>
{
this
.
testRunner
.
event
.
on
(
'compilationFinished'
,
(
success
,
data
,
source
)
=>
{
if
(
success
)
{
this
.
allFilesInvolved
=
Object
.
keys
(
data
.
sources
)
// forwarding the event to the appManager infra
...
...
libs/remix-tests/src/compiler.ts
View file @
156f9ae2
...
...
@@ -205,7 +205,7 @@ export function compileContractSources (sources: SrcIfc, compilerConfig: Compile
function
doCompilation
(
next
)
{
// @ts-ignore
compiler
.
event
.
register
(
'compilationFinished'
,
this
,
(
success
,
data
,
source
)
=>
{
if
(
opts
&&
opts
.
event
)
opts
.
event
.
trigger
(
'compilationFinished'
,
[
success
,
data
,
source
]
)
if
(
opts
&&
opts
.
event
)
opts
.
event
.
emit
(
'compilationFinished'
,
success
,
data
,
source
)
next
(
null
,
data
)
})
compiler
.
compile
(
sources
,
filepath
)
...
...
libs/remix-tests/src/lib/eventManager.ts
deleted
100644 → 0
View file @
3ead354c
'use strict'
export
default
class
EventManager
{
registered
:
any
=
{}
// eslint-disable-line
anonymous
:
any
=
{}
// eslint-disable-line
/*
* Unregister a listener.
* Note that if obj is a function. the unregistration will be applied to the dummy obj {}.
*
* @param {String} eventName - the event name
* @param {Object or Func} obj - object that will listen on this event
* @param {Func} func - function of the listeners that will be executed
*/
unregister
(
eventName
:
any
,
obj
:
any
,
func
:
any
):
void
{
// eslint-disable-line
if
(
!
this
.
registered
[
eventName
])
{
return
}
if
(
obj
instanceof
Function
)
{
func
=
obj
obj
=
this
.
anonymous
}
for
(
const
reg
in
this
.
registered
[
eventName
])
{
if
(
this
.
registered
[
eventName
][
reg
].
obj
===
obj
&&
this
.
registered
[
eventName
][
reg
].
func
===
func
)
{
this
.
registered
[
eventName
].
splice
(
reg
,
1
)
}
}
}
/*
* Register a new listener.
* Note that if obj is a function, the function registration will be associated with the dummy object {}
*
* @param {String} eventName - the event name
* @param {Object or Func} obj - object that will listen on this event
* @param {Func} func - function of the listeners that will be executed
*/
register
(
eventName
:
any
,
obj
:
any
,
func
:
any
):
void
{
// eslint-disable-line
if
(
!
this
.
registered
[
eventName
])
{
this
.
registered
[
eventName
]
=
[]
}
if
(
obj
instanceof
Function
)
{
func
=
obj
obj
=
this
.
anonymous
}
this
.
registered
[
eventName
].
push
({
obj
:
obj
,
func
:
func
})
}
/*
* trigger event.
* Every listener have their associated function executed
*
* @param {String} eventName - the event name
* @param {Array}j - argument that will be passed to the executed function.
*/
trigger
(
eventName
:
any
,
args
:
any
):
void
{
// eslint-disable-line
if
(
!
this
.
registered
[
eventName
])
{
return
}
for
(
const
listener
in
this
.
registered
[
eventName
])
{
const
l
=
this
.
registered
[
eventName
][
listener
]
if
(
l
.
func
)
l
.
func
.
apply
(
l
.
obj
===
this
.
anonymous
?
{}
:
l
.
obj
,
args
)
}
}
}
libs/remix-tests/src/runTestSources.ts
View file @
156f9ae2
...
...
@@ -5,7 +5,7 @@ import { deployAll } from './deployer'
import
{
runTest
}
from
'./testRunner'
import
Web3
from
'web3'
import
EventManager
from
'./lib/eventManager
'
import
{
EventEmitter
}
from
'events
'
import
{
Provider
,
extend
}
from
'@remix-project/remix-simulator'
import
{
FinalResult
,
SrcIfc
,
compilationInterface
,
ASTInterface
,
Options
,
...
...
@@ -17,7 +17,7 @@ export class UnitTestRunner {
event
constructor
()
{
this
.
event
=
new
Event
Manag
er
()
this
.
event
=
new
Event
Emitt
er
()
}
async
createWeb3Provider
()
{
...
...
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