File tree Expand file tree Collapse file tree 2 files changed +16
-7
lines changed Expand file tree Collapse file tree 2 files changed +16
-7
lines changed Original file line number Diff line number Diff line change @@ -45,9 +45,6 @@ fn parse_json_visitor<'a, 'reg>(
4545 for path_seg in relative_path {
4646 match path_seg {
4747 PathSeg :: Named ( the_path) => {
48- // FIXME: partial block params resolution for 495
49- // we should not search whole block stack for the
50- // param, if there is a same name in current block
5148 if let Some ( ( holder, base_path) ) = get_in_block_params ( block_contexts, the_path) {
5249 with_block_param = Some ( ( holder, base_path) ) ;
5350 }
Original file line number Diff line number Diff line change @@ -500,7 +500,7 @@ name: there
500500 fn test_partial_context_issue_495 ( ) {
501501 let mut hb = Registry :: new ( ) ;
502502 hb. register_template_string (
503- "t " ,
503+ "t1 " ,
504504 r#"{{~#*inline "displayName"~}}
505505Template:{{name}}
506506{{/inline}}
@@ -511,17 +511,29 @@ Name:{{name}}
511511 )
512512 . unwrap ( ) ;
513513
514+ hb. register_template_string (
515+ "t1" ,
516+ r#"{{~#*inline "displayName"~}}
517+ Template:{{this}}
518+ {{/inline}}
519+ {{#each data as |name|}}
520+ Name:{{name}}
521+ {{>displayName}}
522+ {{/each}}"# ,
523+ )
524+ . unwrap ( ) ;
525+
514526 let data = json ! ( {
515527 "data" : [ "hudel" , "test" ]
516528 } ) ;
517529
518530 assert_eq ! (
519531 r#"Name:hudel
520- Template:aaaa
532+ Template:hudel
521533Name:test
522- Template:aaaa
534+ Template:test
523535"# ,
524- hb. render( "t " , & data) . unwrap( )
536+ hb. render( "t1 " , & data) . unwrap( )
525537 ) ;
526538 }
527539}
You can’t perform that action at this time.
0 commit comments