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 11import { castToBrowser } from '@glimmer/debug-util' ;
2- import { jitSuite , RenderTest , test } from '@glimmer-workspace/integration-tests' ;
2+ import {
3+ GlimmerishComponent ,
4+ jitSuite ,
5+ RenderTest ,
6+ test ,
7+ } from '@glimmer-workspace/integration-tests' ;
38
49import { template } from '@ember/template-compiler/runtime' ;
510
@@ -45,6 +50,25 @@ class KeywordOn extends RenderTest {
4550 castToBrowser ( this . element , 'div' ) . querySelector ( 'button' ) ! . click ( ) ;
4651 assert . verifySteps ( [ 'success' ] ) ;
4752 }
53+
54+ @test
55+ 'no eval and no scope' ( assert : Assert ) {
56+ class Foo extends GlimmerishComponent {
57+ static {
58+ template ( '<button {{on "click" this.handleClick}}>Click</button>' , {
59+ strictMode : true ,
60+ component : this ,
61+ } ) ;
62+ }
63+
64+ handleClick = ( ) => assert . step ( 'success' ) ;
65+ }
66+
67+ this . renderComponent ( Foo ) ;
68+
69+ castToBrowser ( this . element , 'div' ) . querySelector ( 'button' ) ! . click ( ) ;
70+ assert . verifySteps ( [ 'success' ] ) ;
71+ }
4872}
4973
5074jitSuite ( KeywordOn ) ;
You can’t perform that action at this time.
0 commit comments