Skip to content

Commit 619edd0

Browse files
kfigielaluite
authored andcommitted
Fix Data.Text.Lazy macros
1 parent 18afd47 commit 619edd0

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

jsbits/text.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,12 @@ function h$textFromString(s) {
3737

3838
function h$lazyTextToString(txt) {
3939
var s = '';
40-
while(CONSTR_TAG(txt) === 2) {
41-
var h = LAZY_TEXT_CHUNK_HEAD(txt);
42-
s += h$textToString(TEXT_ARR(h), TEXT_OFF(h), TEXT_LEN(h));
43-
txt = LAZY_TEXT_CHUNK_TAIL(txt);
40+
while(LAZY_TEXT_IS_CHUNK(txt)) {
41+
var head = LAZY_TEXT_CHUNK_HEAD(txt);
42+
s += h$textToString(DATA_TEXT_ARRAY(head), DATA_TEXT_OFFSET(head), DATA_TEXT_LENGTH(head));
43+
txt = LAZY_TEXT_CHUNK_TAIL(txt);
4444
}
45+
return s;
4546
}
4647

4748
function h$safeTextFromString(x) {

0 commit comments

Comments
 (0)