Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
frama-c
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
pub
frama-c
Commits
c739ee9f
Commit
c739ee9f
authored
4 years ago
by
Michele Alberti
Browse files
Options
Downloads
Patches
Plain Diff
[Ivette/server] Use undefined instead of null.
parent
956db744
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
ivette/src/frama-c/server.ts
+12
-12
12 additions, 12 deletions
ivette/src/frama-c/server.ts
ivette/src/frama-c/states.ts
+3
-3
3 additions, 3 deletions
ivette/src/frama-c/states.ts
with
15 additions
and
15 deletions
ivette/src/frama-c/server.ts
+
12
−
12
View file @
c739ee9f
...
@@ -153,20 +153,20 @@ let queueId: string[] = [];
...
@@ -153,20 +153,20 @@ let queueId: string[] = [];
/** Polling timeout and timer. */
/** Polling timeout and timer. */
const
pollingTimeout
=
50
;
const
pollingTimeout
=
50
;
let
pollingTimer
:
NodeJS
.
Timeout
|
null
=
null
;
let
pollingTimer
:
NodeJS
.
Timeout
|
undefined
;
/** Flushing timer. */
/** Flushing timer. */
let
flushingTimer
:
NodeJS
.
Immediate
|
null
=
null
;
let
flushingTimer
:
NodeJS
.
Immediate
|
undefined
;
/** Server process. */
/** Server process. */
let
process
:
ChildProcess
|
null
=
null
;
let
process
:
ChildProcess
|
undefined
;
/** Killing timeout and timer for server process hard kill. */
/** Killing timeout and timer for server process hard kill. */
const
killingTimeout
=
300
;
const
killingTimeout
=
300
;
let
killingTimer
:
NodeJS
.
Timeout
|
null
=
null
;
let
killingTimer
:
NodeJS
.
Timeout
|
undefined
;
/** ZMQ (REQ) socket. */
/** ZMQ (REQ) socket. */
let
zmqSocket
:
ZmqRequest
|
null
=
null
;
let
zmqSocket
:
ZmqRequest
|
undefined
;
/** Flag on whether ZMQ socket is busy. */
/** Flag on whether ZMQ socket is busy. */
let
zmqIsBusy
=
false
;
let
zmqIsBusy
=
false
;
...
@@ -543,15 +543,15 @@ function _reset() {
...
@@ -543,15 +543,15 @@ function _reset() {
pending
=
{};
pending
=
{};
if
(
flushingTimer
)
{
if
(
flushingTimer
)
{
clearImmediate
(
flushingTimer
);
clearImmediate
(
flushingTimer
);
flushingTimer
=
null
;
flushingTimer
=
undefined
;
}
}
if
(
pollingTimer
)
{
if
(
pollingTimer
)
{
clearTimeout
(
pollingTimer
);
clearTimeout
(
pollingTimer
);
pollingTimer
=
null
;
pollingTimer
=
undefined
;
}
}
if
(
killingTimer
)
{
if
(
killingTimer
)
{
clearTimeout
(
killingTimer
);
clearTimeout
(
killingTimer
);
killingTimer
=
null
;
killingTimer
=
undefined
;
}
}
}
}
...
@@ -588,10 +588,10 @@ function _exit(error?: Error) {
...
@@ -588,10 +588,10 @@ function _exit(error?: Error) {
_reset
();
_reset
();
if
(
zmqSocket
)
{
if
(
zmqSocket
)
{
zmqSocket
.
close
();
zmqSocket
.
close
();
zmqSocket
=
null
;
zmqSocket
=
undefined
;
}
}
zmqIsBusy
=
false
;
zmqIsBusy
=
false
;
process
=
null
;
process
=
undefined
;
if
(
status
.
stage
===
Stage
.
RESTARTING
)
{
if
(
status
.
stage
===
Stage
.
RESTARTING
)
{
setImmediate
(
start
);
setImmediate
(
start
);
}
else
if
(
error
)
{
}
else
if
(
error
)
{
...
@@ -846,7 +846,7 @@ function _waiting() {
...
@@ -846,7 +846,7 @@ function _waiting() {
function
_flush
()
{
function
_flush
()
{
if
(
!
flushingTimer
)
{
if
(
!
flushingTimer
)
{
flushingTimer
=
setImmediate
(()
=>
{
flushingTimer
=
setImmediate
(()
=>
{
flushingTimer
=
null
;
flushingTimer
=
undefined
;
_send
();
_send
();
});
});
}
}
...
@@ -856,7 +856,7 @@ function _poll() {
...
@@ -856,7 +856,7 @@ function _poll() {
if
(
!
pollingTimer
)
{
if
(
!
pollingTimer
)
{
const
delay
=
(
config
&&
config
.
polling
)
||
pollingTimeout
;
const
delay
=
(
config
&&
config
.
polling
)
||
pollingTimeout
;
pollingTimer
=
setTimeout
(()
=>
{
pollingTimer
=
setTimeout
(()
=>
{
pollingTimer
=
null
;
pollingTimer
=
undefined
;
_send
();
_send
();
},
delay
);
},
delay
);
}
}
...
...
This diff is collapsed.
Click to expand it.
ivette/src/frama-c/states.ts
+
3
−
3
View file @
c739ee9f
...
@@ -46,7 +46,7 @@ class PP {
...
@@ -46,7 +46,7 @@ class PP {
// --- Synchronized Current Project
// --- Synchronized Current Project
// --------------------------------------------------------------------------
// --------------------------------------------------------------------------
let
currentProject
:
string
|
null
=
null
;
let
currentProject
:
string
|
undefined
;
let
states
:
any
=
{};
let
states
:
any
=
{};
const
stateDefaults
:
any
=
{};
const
stateDefaults
:
any
=
{};
...
@@ -107,12 +107,12 @@ export async function setProject(project: string) {
...
@@ -107,12 +107,12 @@ export async function setProject(project: string) {
// --- Projectified State
// --- Projectified State
// --------------------------------------------------------------------------
// --------------------------------------------------------------------------
function
getValue
(
id
:
string
,
project
:
string
|
null
)
{
function
getValue
(
id
:
string
,
project
?
:
string
)
{
if
(
!
project
)
return
undefined
;
if
(
!
project
)
return
undefined
;
return
_
.
get
(
states
,
[
project
,
id
],
stateDefaults
[
id
]);
return
_
.
get
(
states
,
[
project
,
id
],
stateDefaults
[
id
]);
}
}
function
setValue
(
id
:
string
,
project
:
string
|
null
,
value
:
any
)
{
function
setValue
(
id
:
string
,
project
:
string
|
undefined
,
value
:
any
)
{
if
(
!
project
)
return
;
if
(
!
project
)
return
;
_
.
set
(
states
,
[
project
,
id
],
value
);
_
.
set
(
states
,
[
project
,
id
],
value
);
Dome
.
emit
(
STATE
+
id
,
value
);
Dome
.
emit
(
STATE
+
id
,
value
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment