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
e7c18fdd
Commit
e7c18fdd
authored
Dec 16, 2019
by
Iuri Matias
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update remix-analyzer syntax to use const, let and this
parent
d70f5f6e
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
13 deletions
+12
-13
index.js
remix-analyzer/index.js
+1
-1
index.js
remix-analyzer/src/solidity-analyzer/index.js
+11
-12
No files found.
remix-analyzer/index.js
View file @
e7c18fdd
var
CodeAnalysis
=
require
(
'./src/solidity-analyzer'
)
const
CodeAnalysis
=
require
(
'./src/solidity-analyzer'
)
module
.
exports
=
{
module
.
exports
=
{
CodeAnalysis
:
CodeAnalysis
CodeAnalysis
:
CodeAnalysis
...
...
remix-analyzer/src/solidity-analyzer/index.js
View file @
e7c18fdd
'use strict'
'use strict'
var
AstWalker
=
require
(
'remix-lib'
).
AstWalker
const
AstWalker
=
require
(
'remix-lib'
).
AstWalker
var
list
=
require
(
'./modules/list'
)
const
list
=
require
(
'./modules/list'
)
function
staticAnalysisRunner
()
{
function
staticAnalysisRunner
()
{
}
}
staticAnalysisRunner
.
prototype
.
run
=
function
(
compilationResult
,
toRun
,
callback
)
{
staticAnalysisRunner
.
prototype
.
run
=
function
(
compilationResult
,
toRun
,
callback
)
{
var
self
=
this
const
modules
=
toRun
.
map
((
i
)
=>
{
var
modules
=
toRun
.
map
(
function
(
i
)
{
const
m
=
this
.
modules
()[
i
]
var
m
=
self
.
modules
()[
i
]
return
{
'name'
:
m
.
name
,
'mod'
:
new
m
.
Module
()
}
return
{
'name'
:
m
.
name
,
'mod'
:
new
m
.
Module
()
}
})
})
...
@@ -16,12 +15,12 @@ staticAnalysisRunner.prototype.run = function (compilationResult, toRun, callbac
...
@@ -16,12 +15,12 @@ staticAnalysisRunner.prototype.run = function (compilationResult, toRun, callbac
}
}
staticAnalysisRunner
.
prototype
.
runWithModuleList
=
function
(
compilationResult
,
modules
,
callback
)
{
staticAnalysisRunner
.
prototype
.
runWithModuleList
=
function
(
compilationResult
,
modules
,
callback
)
{
var
reports
=
[]
let
reports
=
[]
// Also provide convenience analysis via the AST walker.
// Also provide convenience analysis via the AST walker.
var
walker
=
new
AstWalker
()
const
walker
=
new
AstWalker
()
for
(
var
k
in
compilationResult
.
sources
)
{
for
(
let
k
in
compilationResult
.
sources
)
{
walker
.
walk
(
compilationResult
.
sources
[
k
].
legacyAST
,
{
'*'
:
function
(
node
)
{
walker
.
walk
(
compilationResult
.
sources
[
k
].
legacyAST
,
{
'*'
:
(
node
)
=>
{
modules
.
map
(
function
(
item
,
i
)
{
modules
.
map
(
(
item
,
i
)
=>
{
if
(
item
.
mod
.
visit
!==
undefined
)
{
if
(
item
.
mod
.
visit
!==
undefined
)
{
try
{
try
{
item
.
mod
.
visit
(
node
)
item
.
mod
.
visit
(
node
)
...
@@ -38,8 +37,8 @@ staticAnalysisRunner.prototype.runWithModuleList = function (compilationResult,
...
@@ -38,8 +37,8 @@ staticAnalysisRunner.prototype.runWithModuleList = function (compilationResult,
// Here, modules can just collect the results from the AST walk,
// Here, modules can just collect the results from the AST walk,
// but also perform new analysis.
// but also perform new analysis.
reports
=
reports
.
concat
(
modules
.
map
(
function
(
item
,
i
)
{
reports
=
reports
.
concat
(
modules
.
map
(
(
item
,
i
)
=>
{
var
report
=
null
let
report
=
null
try
{
try
{
report
=
item
.
mod
.
report
(
compilationResult
)
report
=
item
.
mod
.
report
(
compilationResult
)
}
catch
(
e
)
{
}
catch
(
e
)
{
...
...
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