Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
scilla-declare-generator
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
劳工
scilla-declare-generator
Commits
6eb7fbc0
Commit
6eb7fbc0
authored
May 09, 2019
by
rockyl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修复负数没有默认值的问题
parent
23c636b8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
index.js
src/index.js
+3
-3
No files found.
src/index.js
View file @
6eb7fbc0
...
@@ -190,12 +190,12 @@ function addProp(dataContainer, name, valueDeclaration, checker) {
...
@@ -190,12 +190,12 @@ function addProp(dataContainer, name, valueDeclaration, checker) {
}
else
if
(
initializer
.
arguments
)
{
}
else
if
(
initializer
.
arguments
)
{
defaultValue
=
[];
defaultValue
=
[];
for
(
let
argument
of
initializer
.
arguments
)
{
for
(
let
argument
of
initializer
.
arguments
)
{
let
typeDef
=
checker
.
getTypeAtLocation
(
argument
);
let
value
=
argument
.
text
||
(
argument
.
name
&&
argument
.
name
.
escapedText
);
let
value
=
argument
.
text
||
(
argument
.
name
&&
argument
.
name
.
escapedText
);
defaultValue
.
push
(
value
);
defaultValue
.
push
(
value
);
}
}
}
else
{
}
else
if
(
typeName
===
'number'
){
defaultValue
=
initializer
&&
(
initializer
.
text
?
parseFloat
(
initializer
.
text
)
:
(
initializer
.
operand
?
-
parseFloat
(
initializer
.
operand
.
text
)
:
undefined
))
}
else
{
defaultValue
=
initializer
&&
(
initializer
.
text
||
(
initializer
.
name
&&
initializer
.
name
.
escapedText
));
defaultValue
=
initializer
&&
(
initializer
.
text
||
(
initializer
.
name
&&
initializer
.
name
.
escapedText
));
}
}
}
}
...
...
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