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
e4d0d7a6
Commit
e4d0d7a6
authored
Aug 12, 2020
by
yann300
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remove remix-lib dep from remix-solidity
parent
710dcbfd
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
72 additions
and
2 deletions
+72
-2
package.json
libs/remix-solidity/package.json
+0
-1
compiler.ts
libs/remix-solidity/src/compiler/compiler.ts
+1
-1
eventManager.js
libs/remix-solidity/src/lib/eventManager.js
+71
-0
No files found.
libs/remix-solidity/package.json
View file @
e4d0d7a6
...
...
@@ -16,7 +16,6 @@
],
"dependencies"
:
{
"eslint-scope"
:
"^5.0.0"
,
"@remix-project/remix-lib"
:
"0.4.30"
,
"solc"
:
"^0.6.0"
,
"webworkify-webpack"
:
"^2.1.5"
},
...
...
libs/remix-solidity/src/compiler/compiler.ts
View file @
e4d0d7a6
...
...
@@ -3,7 +3,7 @@
import
{
update
}
from
'solc/abi'
import
*
as
webworkify
from
'webworkify-webpack'
import
compilerInput
from
'./compiler-input'
import
{
EventManager
}
from
'
@remix-project/remix-lib
'
import
{
EventManager
}
from
'
../lib/eventManager
'
import
{
default
as
txHelper
}
from
'./txHelper'
;
import
{
Source
,
SourceWithTarget
,
MessageFromWorker
,
CompilerState
,
CompilationResult
,
visitContractsCallbackParam
,
visitContractsCallbackInterface
,
CompilationError
,
...
...
libs/remix-solidity/src/lib/eventManager.js
0 → 100644
View file @
e4d0d7a6
'use strict'
function
eventManager
()
{
this
.
registered
=
{}
this
.
anonymous
=
{}
}
/*
* 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
*/
eventManager
.
prototype
.
unregister
=
function
(
eventName
,
obj
,
func
)
{
if
(
!
this
.
registered
[
eventName
])
{
return
}
if
(
obj
instanceof
Function
)
{
func
=
obj
obj
=
this
.
anonymous
}
for
(
let
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
*/
eventManager
.
prototype
.
register
=
function
(
eventName
,
obj
,
func
)
{
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.
*/
eventManager
.
prototype
.
trigger
=
function
(
eventName
,
args
)
{
if
(
!
this
.
registered
[
eventName
])
{
return
}
for
(
let
listener
in
this
.
registered
[
eventName
])
{
const
l
=
this
.
registered
[
eventName
][
listener
]
l
.
func
.
apply
(
l
.
obj
===
this
.
anonymous
?
{}
:
l
.
obj
,
args
)
}
}
module
.
exports
=
eventManager
\ No newline at end of file
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