mirror of
https://github.com/motajs/template.git
synced 2026-11-24 14:54:30 +08:00
fix(replay): enable recording guard; update tests for replay refactor
This commit is contained in:
1 parent
17d7c8f46a
commit
c08f3f8484
7 files changed
+58
-70
No files matched your search
@@ -390,7 +390,7 @@ export class ReplayArray implements IReplayArray {
|
||||
}
|
||||
|
||||
add(command: number, params: ReplayParamValue[]): void {
|
||||
if (this.disabled >= 0) return;
|
||||
if (this.disabled > 0) return;
|
||||
const normalized = this.normalizeParamList(params);
|
||||
const length = this.calculateParamsLength(normalized);
|
||||
this.checkBufferExpand(length);
|
||||
@@ -410,7 +410,7 @@ export class ReplayArray implements IReplayArray {
|
||||
}
|
||||
|
||||
insert(index: number, command: number, params: ReplayParamValue[]): void {
|
||||
if (this.disabled >= 0) return;
|
||||
if (this.disabled > 0) return;
|
||||
const normalized = this.normalizeParamList(params);
|
||||
const length = this.calculateParamsLength(normalized);
|
||||
this.checkBufferExpand(length);
|
||||
@@ -440,7 +440,7 @@ export class ReplayArray implements IReplayArray {
|
||||
}
|
||||
|
||||
delete(index: number): void {
|
||||
if (this.disabled >= 0) return;
|
||||
if (this.disabled > 0) return;
|
||||
const commandSize = this.getCommandSize();
|
||||
const commandStart = index * commandSize;
|
||||
const paramStart = this.indexArray[index];
|
||||
@@ -474,7 +474,7 @@ export class ReplayArray implements IReplayArray {
|
||||
}
|
||||
|
||||
set(index: number, command: number, params: ReplayParamValue[]): void {
|
||||
if (this.disabled >= 0) return;
|
||||
if (this.disabled > 0) return;
|
||||
const normalized = this.normalizeParamList(params);
|
||||
const length = this.calculateParamsLength(normalized);
|
||||
const paramStart = this.indexArray[index];
|
||||
|
||||
Reference in new issue
Block a user