# HG changeset patch # User Dmitry Volyntsev # Date 1584542677 -10800 # Node ID b194552fcc2154cfe01f52851d4ed7f1b5e49992 # Parent 3ff92feb99d1b4f7750b2f49c4b786f89a503790 Tests: adapted js_subrequests.t to njs changes after 0.4.0. Since 0.4.0, external objects support implicit convertion to string. To cope with that, they are replaced with a symbol value which does not support implicit conversion to string. diff --git a/js_subrequests.t b/js_subrequests.t --- a/js_subrequests.t +++ b/js_subrequests.t @@ -307,8 +307,7 @@ EOF function sr_options_method_head(r) { r.subrequest('/p/method', {method:'HEAD'}, reply => { - r.return(200, JSON.stringify({c:reply.status, - s:reply.responseBody.length})); + r.return(200, JSON.stringify({c:reply.status})); }); } @@ -462,7 +461,7 @@ EOF } function sr_except_failed_to_convert_arg(r) { - r.subrequest('/sub1', r.args, ()=>{}); + r.subrequest('/sub1', Symbol.toStringTag, ()=>{}); } function sr_except_failed_to_convert_options_arg(r) { @@ -470,7 +469,7 @@ EOF } function sr_uri_except(r) { - r.subrequest(r, 'a=1', 'b'); + r.subrequest(Symbol.toStringTag, 'a=1', 'b'); } function body_fwd_cb(r) { @@ -496,8 +495,7 @@ is(get_json('/sr_options_args'), '{"h":" is(get_json('/sr_options_method?m=POST'), '["POST"]', 'sr method POST'); is(get_json('/sr_options_method?m=PURGE'), '["PURGE"]', 'sr method PURGE'); is(get_json('/sr_options_body'), '["REQ-BODY"]', 'sr_options_body'); -is(get_json('/sr_options_method_head'), '{"c":200,"s":0}', - 'sr_options_method_head'); +is(get_json('/sr_options_method_head'), '{"c":200}', 'sr_options_method_head'); is(get_json('/sr_body'), '{"a":{"b":1}}', 'sr_body'); is(get_json('/sr_body_special'), '{"e":"msg"}', 'sr_body_special'); is(get_json('/sr_in_variable_handler'), '["CB-VAR"]', 'sr_in_variable_handler');