string literal error
This commit is contained in:
@@ -8255,12 +8255,17 @@ static JSValue js_cell_text_format (JSContext *ctx, JSValue this_val, int argc,
|
||||
if (!result) { FMT_CLEANUP(); return JS_EXCEPTION; }
|
||||
res_ref.val = JS_MKPTR (result);
|
||||
} else {
|
||||
JSValue orig = js_sub_string_val (ctx, text_ref.val, brace_start, brace_end + 1);
|
||||
if (JS_IsException (orig)) { FMT_CLEANUP(); return JS_EXCEPTION; }
|
||||
/* No substitution — treat the '{' as a literal character and rescan
|
||||
from brace_start + 1 so that real placeholders like {0} inside
|
||||
the skipped range are still found. */
|
||||
JSValue ch = js_sub_string_val (ctx, text_ref.val, brace_start, brace_start + 1);
|
||||
if (JS_IsException (ch)) { FMT_CLEANUP(); return JS_EXCEPTION; }
|
||||
result = (JSText *)chase (res_ref.val);
|
||||
result = pretext_concat_value (ctx, result, orig);
|
||||
result = pretext_concat_value (ctx, result, ch);
|
||||
if (!result) { FMT_CLEANUP(); return JS_EXCEPTION; }
|
||||
res_ref.val = JS_MKPTR (result);
|
||||
pos = brace_start + 1;
|
||||
continue;
|
||||
}
|
||||
|
||||
pos = brace_end + 1;
|
||||
|
||||
Reference in New Issue
Block a user