Skip to content

Commit

Permalink
Allow loose mode to use lexical scope
Browse files Browse the repository at this point in the history
  • Loading branch information
ef4 committed Oct 21, 2021
1 parent 8a81d94 commit 5ea7772
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
17 changes: 17 additions & 0 deletions packages/@glimmer/integration-tests/test/lexical-scope-test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import { RenderTest, test, jitSuite, defineComponent } from '..';

class LexicalScopeTest extends RenderTest {
static suiteName = 'loose mode: lexical scope';

@test
'Can use a component in scope'() {
const Foo = defineComponent({}, 'Hello, world!', { strictMode: false });
const Bar = defineComponent({ Foo }, '<Foo/>', { strictMode: false });

this.renderComponent(Bar);
this.assertHTML('Hello, world!');
this.assertStableRerender();
}
}

jitSuite(LexicalScopeTest);
2 changes: 1 addition & 1 deletion packages/@glimmer/syntax/lib/v2-a/normalize.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export function normalize(
);

let top = SymbolTable.top(
normalizeOptions.strictMode ? normalizeOptions.locals : [],
normalizeOptions.locals,
// eslint-disable-next-line @typescript-eslint/unbound-method
options.customizeComponentName ?? ((name) => name)
);
Expand Down

0 comments on commit 5ea7772

Please sign in to comment.