Skip to content

Commit c8eddbb

Browse files
committed
Cleanup -- add test in implicit shadowing
1 parent 7ee05f9 commit c8eddbb

2 files changed

Lines changed: 23 additions & 1 deletion

File tree

packages/@glimmer-workspace/integration-tests/test/keywords/hash-runtime-test.ts

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff 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;

packages/@glimmer-workspace/integration-tests/test/keywords/hash-test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { castToBrowser } from '@glimmer/debug-util';
22
import { jitSuite, RenderTest, test } from '@glimmer-workspace/integration-tests';
33

4-
import { template } from '@ember/template-compiler/runtime';
4+
import { template } from '@ember/template-compiler';
55
import { fn, hash } from '@ember/helper';
66
import { on } from '@ember/modifier';
77

0 commit comments

Comments
 (0)