File tree Expand file tree Collapse file tree
packages/@glimmer-workspace/integration-tests/test/keywords Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -65,6 +65,28 @@ class KeywordHashRuntime extends RenderTest {
6565 assert . strictEqual ( receivedData ?. [ 'greeting' ] , 'hello' ) ;
6666 }
6767
68+ @test
69+ 'implicit scope (shadowing)' ( assert : Assert ) {
70+ let receivedData : string | undefined ;
71+
72+ const hash = ( data : string ) => {
73+ receivedData = data ;
74+ } ;
75+
76+ hide ( hash ) ;
77+
78+ const compiled = template ( '{{hash "hello"}}' , {
79+ strictMode : true ,
80+ eval ( ) {
81+ return eval ( arguments [ 0 ] ) ;
82+ } ,
83+ } ) ;
84+
85+ this . renderComponent ( compiled ) ;
86+
87+ assert . strictEqual ( receivedData , 'hello' ) ;
88+ }
89+
6890 @test
6991 'MustacheStatement with explicit scope' ( assert : Assert ) {
7092 let receivedData : Record < string , unknown > | undefined ;
Original file line number Diff line number Diff line change 11import { castToBrowser } from '@glimmer/debug-util' ;
22import { jitSuite , RenderTest , test } from '@glimmer-workspace/integration-tests' ;
33
4- import { template } from '@ember/template-compiler/runtime ' ;
4+ import { template } from '@ember/template-compiler' ;
55import { fn , hash } from '@ember/helper' ;
66import { on } from '@ember/modifier' ;
77
You can’t perform that action at this time.
0 commit comments