Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
P
ParaEncode
Project
Project
Details
Activity
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
Linshizhi
ParaEncode
Commits
e599e52c
Commit
e599e52c
authored
May 17, 2022
by
Linshizhi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add exception to Channel.
parent
f648fb83
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
2 deletions
+9
-2
channel.js
src/channel.js
+9
-2
No files found.
src/channel.js
View file @
e599e52c
import
{
assert
,
NEED_TO_IMPLEMENT
}
from
'./utils.js'
;
import
{
assert
,
NEED_TO_IMPLEMENT
}
from
'./utils.js'
;
class
ChnlStepConflictError
extends
Error
{
constructor
()
{
super
(
"Channel Step error"
);
}
}
class
CpySchedule
{
class
CpySchedule
{
first
=
{
pos
:
0
,
size
:
0
};
first
=
{
pos
:
0
,
size
:
0
};
second
=
{
pos
:
0
,
size
:
0
};
second
=
{
pos
:
0
,
size
:
0
};
...
@@ -406,7 +413,7 @@ export class Channel {
...
@@ -406,7 +413,7 @@ export class Channel {
}
}
if
(
this
.
#
writePhase
!=
WRITE_PHASE
.
NO_STEP_WRITE
)
if
(
this
.
#
writePhase
!=
WRITE_PHASE
.
NO_STEP_WRITE
)
throw
new
Error
(
"Unable to call multiple writeStep1()"
);
throw
new
ChnlStepConflictError
(
);
this
.
#
writePhase
=
WRITE_PHASE
.
WAIT_CALLER_WRITE
;
this
.
#
writePhase
=
WRITE_PHASE
.
WAIT_CALLER_WRITE
;
let
schedule
=
this
.
#
cpySchedule
(
size
);
let
schedule
=
this
.
#
cpySchedule
(
size
);
...
@@ -437,7 +444,7 @@ export class Channel {
...
@@ -437,7 +444,7 @@ export class Channel {
writeStep2
()
{
writeStep2
()
{
if
(
this
.
#
writePhase
!=
WRITE_PHASE
.
WAIT_CALLER_WRITE
)
if
(
this
.
#
writePhase
!=
WRITE_PHASE
.
WAIT_CALLER_WRITE
)
throw
new
Error
(
"Have to call writeStep1() first"
)
throw
new
ChnlStepConflictError
();
this
.
#
writePointerUpdate
(
this
.
#
writePhaseEndPos
);
this
.
#
writePointerUpdate
(
this
.
#
writePhaseEndPos
);
this
.
#
writePhase
=
WRITE_PHASE
.
NO_STEP_WRITE
;
this
.
#
writePhase
=
WRITE_PHASE
.
NO_STEP_WRITE
;
}
}
...
...
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