mirror of
				https://github.com/janet-lang/janet
				synced 2025-11-04 01:23:04 +00:00 
			
		
		
		
	More gracefully handle.
This commit is contained in:
		@@ -570,7 +570,7 @@ static int json_encode(DstArgs args) {
 | 
			
		||||
        if (args.n >= 3) {
 | 
			
		||||
            DST_ARG_BYTES(e.newline, e.newlinelen, args, 2);
 | 
			
		||||
        } else {
 | 
			
		||||
            e.newline = (const uint8_t *)"\n";
 | 
			
		||||
            e.newline = (const uint8_t *)"\r\n";
 | 
			
		||||
            e.newlinelen = 1;
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 
 | 
			
		||||
@@ -80,7 +80,14 @@ DstSignal dst_continue(DstFiber *fiber, Dst in, Dst *out) {
 | 
			
		||||
    dst_gcroot(in);
 | 
			
		||||
    if (startstatus == DST_STATUS_NEW) {
 | 
			
		||||
        dst_fiber_push(fiber, in);
 | 
			
		||||
        dst_fiber_funcframe(fiber, fiber->root);
 | 
			
		||||
        if (dst_fiber_funcframe(fiber, fiber->root)) {
 | 
			
		||||
            dst_gcunroot(dst_wrap_fiber(fiber));
 | 
			
		||||
            dst_gcunroot(in);
 | 
			
		||||
            *out = dst_wrap_string(dst_formatc(
 | 
			
		||||
                        "Could not start fiber with function of arity %d",
 | 
			
		||||
                        fiber->root->def->arity));
 | 
			
		||||
            return DST_SIGNAL_ERROR;
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
    dst_fiber_set_status(fiber, DST_STATUS_ALIVE);
 | 
			
		||||
    stack = fiber->data + fiber->frame;
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user