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
2dcb41a8
Commit
2dcb41a8
authored
Aug 25, 2017
by
yann300
Committed by
GitHub
Aug 25, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #720 from ethereum/viewPure
Also treat view and pure functions as constant.
parents
1ea66f16
da1f2434
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
2 deletions
+6
-2
staticAnalysisCommon.js
src/app/staticanalysis/modules/staticAnalysisCommon.js
+6
-2
No files found.
src/app/staticanalysis/modules/staticAnalysisCommon.js
View file @
2dcb41a8
...
@@ -32,7 +32,7 @@ var basicRegex = {
...
@@ -32,7 +32,7 @@ var basicRegex = {
CONTRACTTYPE
:
'^contract '
,
CONTRACTTYPE
:
'^contract '
,
FUNCTIONTYPE
:
'^function
\\
('
,
FUNCTIONTYPE
:
'^function
\\
('
,
EXTERNALFUNCTIONTYPE
:
'^function
\\
(.*
\\
).* external'
,
EXTERNALFUNCTIONTYPE
:
'^function
\\
(.*
\\
).* external'
,
CONSTANTFUNCTIONTYPE
:
'^function
\\
(.*
\\
).*
constant
'
,
CONSTANTFUNCTIONTYPE
:
'^function
\\
(.*
\\
).*
(constant|view|pure)
'
,
REFTYPE
:
'( storage )|(mapping
\\
()|(
\\
[
\\
])'
,
REFTYPE
:
'( storage )|(mapping
\\
()|(
\\
[
\\
])'
,
FUNCTIONSIGNATURE
:
'^function
\\
(([^
\\
(]*)
\\
)'
,
FUNCTIONSIGNATURE
:
'^function
\\
(([^
\\
(]*)
\\
)'
,
LIBRARYTYPE
:
'^type
\\
(library (.*)
\\
)'
LIBRARYTYPE
:
'^type
\\
(library (.*)
\\
)'
...
@@ -442,7 +442,11 @@ function isStateVariable (name, stateVariables) {
...
@@ -442,7 +442,11 @@ function isStateVariable (name, stateVariables) {
* @return {bool}
* @return {bool}
*/
*/
function
isConstantFunction
(
node
)
{
function
isConstantFunction
(
node
)
{
return
isFunctionDefinition
(
node
)
&&
node
.
attributes
.
constant
===
true
return
isFunctionDefinition
(
node
)
&&
(
node
.
attributes
.
constant
===
true
||
node
.
attributes
.
stateMutability
===
'view'
||
node
.
attributes
.
stateMutability
===
'pure'
)
}
}
/**
/**
...
...
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