Skip to content

Commit 211201f

Browse files
committed
easysync: add clear method to stringAssembler
1 parent 1ef577a commit 211201f

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

src/static/js/Changeset.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -587,9 +587,11 @@ exports.stringAssembler = () => {
587587
};
588588

589589
const toString = () => pieces.join('');
590+
const clear = () => pieces.length = 0;
590591
return {
591592
append,
592593
toString,
594+
clear,
593595
};
594596
};
595597

src/tests/frontend/specs/easysync-assembler.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ describe('easysync', function () {
171171
expect(assem.toString()).to.equal('*3*4*5|3+f*1*4*5|1+1*1*4*5+4');
172172
});
173173

174-
xit('smartOpAssembler clear should empty internal assemblers', async function () {
174+
it('smartOpAssembler clear should empty internal assemblers', async function () {
175175
const x = '-c*3*4+6|3=az*asdf0*1*2*3+1=1-1+1*0+1=1-1+1|c=c-1';
176176
const iter = Changeset.opIterator(x);
177177
const assem = Changeset.smartOpAssembler();

0 commit comments

Comments
 (0)