diff --git a/packages/@glimmer/integration-tests/lib/render-test.ts b/packages/@glimmer/integration-tests/lib/render-test.ts
index 1d5d378ea3..25e3883ec2 100644
--- a/packages/@glimmer/integration-tests/lib/render-test.ts
+++ b/packages/@glimmer/integration-tests/lib/render-test.ts
@@ -307,9 +307,9 @@ export class RenderTest implements IRenderTest {
let invocation: string | string[] = [];
if (template) {
- invocation.push('{{#component componentName');
+ invocation.push('{{#component this.componentName');
} else {
- invocation.push('{{component componentName');
+ invocation.push('{{component this.componentName');
}
let componentArgs = this.buildArgs(args);
diff --git a/packages/@glimmer/integration-tests/lib/suites/components.ts b/packages/@glimmer/integration-tests/lib/suites/components.ts
index a94df7b374..ea72abe67f 100644
--- a/packages/@glimmer/integration-tests/lib/suites/components.ts
+++ b/packages/@glimmer/integration-tests/lib/suites/components.ts
@@ -19,7 +19,7 @@ export class TemplateOnlyComponents extends RenderTest {
name: 'MyComponent',
layout: '{{yield}} - {{@color}}',
template: 'hello!',
- args: { color: 'color' },
+ args: { color: 'this.color' },
},
{ color: 'red' }
);
@@ -45,8 +45,8 @@ export class TemplateOnlyComponents extends RenderTest {
name: 'MyComponent',
layout: '
diff --git a/packages/@glimmer/integration-tests/lib/suites/debugger.ts b/packages/@glimmer/integration-tests/lib/suites/debugger.ts
index 1e9fe8fc76..3963ee861e 100644
--- a/packages/@glimmer/integration-tests/lib/suites/debugger.ts
+++ b/packages/@glimmer/integration-tests/lib/suites/debugger.ts
@@ -25,7 +25,10 @@ export class DebuggerSuite extends RenderTest {
this.assert.equal(get('foo'), expectedContext.foo);
});
- this.render('{{#if a.b}}true{{debugger}}{{else}}false{{debugger}}{{/if}}', expectedContext);
+ this.render(
+ '{{#if this.a.b}}true{{debugger}}{{else}}false{{debugger}}{{/if}}',
+ expectedContext
+ );
this.assert.equal(callbackExecuted, 1);
this.assertHTML('true');
this.assertStableRerender();
@@ -71,7 +74,7 @@ export class DebuggerSuite extends RenderTest {
});
this.render(
- '{{#with foo as |bar|}}{{#if a.b}}true{{debugger}}{{else}}false{{debugger}}{{/if}}{{/with}}',
+ '{{#with this.foo as |bar|}}{{#if this.a.b}}true{{debugger}}{{else}}false{{debugger}}{{/if}}{{/with}}',
expectedContext
);
this.assert.equal(callbackExecuted, 1);
diff --git a/packages/@glimmer/integration-tests/lib/suites/each.ts b/packages/@glimmer/integration-tests/lib/suites/each.ts
index 871f949530..e782794fac 100644
--- a/packages/@glimmer/integration-tests/lib/suites/each.ts
+++ b/packages/@glimmer/integration-tests/lib/suites/each.ts
@@ -23,7 +23,7 @@ export class EachSuite extends RenderTest {
@test
'basic #each'() {
let list = [1, 2, 3, 4];
- this.render('{{#each list key="@index" as |item|}}{{item}}{{else}}Empty{{/each}}', {
+ this.render('{{#each this.list key="@index" as |item|}}{{item}}{{else}}Empty{{/each}}', {
list,
});
this.assertHTML('1234');
@@ -71,7 +71,7 @@ export class EachSuite extends RenderTest {
this.arr.splice(0, this.arr.length);
},
};
- this.render('{{#each list key="@index" as |item|}}{{item}}{{else}}Empty{{/each}}', {
+ this.render('{{#each this.list key="@index" as |item|}}{{item}}{{else}}Empty{{/each}}', {
list,
});
this.assertHTML('1234');
@@ -96,7 +96,7 @@ export class EachSuite extends RenderTest {
@test
'keyed #each'() {
let list = [{ text: 'hello' }];
- this.render('{{#each list key="text" as |item|}}{{item.text}}{{else}}Empty{{/each}}', {
+ this.render('{{#each this.list key="text" as |item|}}{{item.text}}{{else}}Empty{{/each}}', {
list,
});
this.assertHTML('hello');
@@ -122,9 +122,12 @@ export class EachSuite extends RenderTest {
@test
'receives the index as the second parameter'() {
let list = [1, 2, 3, 4];
- this.render('{{#each list key="@index" as |item i|}}{{item}}-{{i}}:{{else}}Empty{{/each}}', {
- list,
- });
+ this.render(
+ '{{#each this.list key="@index" as |item i|}}{{item}}-{{i}}:{{else}}Empty{{/each}}',
+ {
+ list,
+ }
+ );
this.assertHTML('1-0:2-1:3-2:4-3:');
this.assertStableRerender();
@@ -155,7 +158,7 @@ export class EachSuite extends RenderTest {
let list = [v1, v2, v3, v4];
this.render(
- '{{#each list key="@identity" as |item i|}}{{item.val}}-{{i}}{{else}}Empty{{/each}}',
+ '{{#each this.list key="@identity" as |item i|}}{{item.val}}-{{i}}{{else}}Empty{{/each}}',
{
list,
}
@@ -187,7 +190,7 @@ export class EachSuite extends RenderTest {
@test
'it can render duplicate primitive items'() {
let list = ['a', 'a', 'a'];
- this.render('{{#each list key="@index" as |item|}}{{item}}{{/each}}', {
+ this.render('{{#each this.list key="@index" as |item|}}{{item}}{{/each}}', {
list,
});
this.assertHTML('aaa');
@@ -208,7 +211,7 @@ export class EachSuite extends RenderTest {
'it can render duplicate objects'() {
let dup = { text: 'dup' };
let list = [dup, dup, { text: 'uniq' }];
- this.render('{{#each list key="@index" as |item|}}{{item.text}}{{/each}}', {
+ this.render('{{#each this.list key="@index" as |item|}}{{item.text}}{{/each}}', {
list,
});
this.assertHTML('dupdupuniq');
@@ -237,7 +240,7 @@ export class EachSuite extends RenderTest {
let list = [new Item('Hello'), new Item('Hello'), new Item('Hello')];
- this.render(`{{#each list key="text" as |item|}}{{item.text}}{{/each}}`, {
+ this.render(`{{#each this.list key="text" as |item|}}{{item.text}}{{/each}}`, {
list,
});
@@ -269,7 +272,7 @@ export class EachSuite extends RenderTest {
let list = [new Item('Hello'), new Item('Hello'), new Item('Hello')];
- this.render(`{{#each list key="@identity" as |item|}}{{item.text}}{{/each}}`, {
+ this.render(`{{#each this.list key="@identity" as |item|}}{{item.text}}{{/each}}`, {
list,
});
@@ -293,7 +296,7 @@ export class EachSuite extends RenderTest {
'it does not update items if their key has not changed, and the items are not tracked'() {
let list = [{ text: 'Hello' }, { text: 'Hello' }, { text: 'Hello' }];
- this.render(`{{#each list key="@identity" as |item|}}{{item.text}}{{/each}}`, {
+ this.render(`{{#each this.list key="@identity" as |item|}}{{item.text}}{{/each}}`, {
list,
});
@@ -311,10 +314,13 @@ export class EachSuite extends RenderTest {
'scoped variable not available outside list'() {
let list = ['Wycats'];
- this.render(`{{name}}-{{#each list key="@index" as |name|}}{{name}}{{/each}}-{{name}}`, {
- list,
- name: 'Stef',
- });
+ this.render(
+ `{{this.name}}-{{#each this.list key="@index" as |name|}}{{name}}{{/each}}-{{this.name}}`,
+ {
+ list,
+ name: 'Stef',
+ }
+ );
this.assertHTML('Stef-Wycats-Stef');
this.assertStableRerender();
@@ -340,7 +346,7 @@ export class EachSuite extends RenderTest {
let list: string[] = [];
this.render(
- `{{#each list key="@index" as |name|}}Has thing{{else}}No thing {{otherThing}}{{/each}}`,
+ `{{#each this.list key="@index" as |name|}}Has thing{{else}}No thing {{this.otherThing}}{{/each}}`,
{
list,
otherThing: 'Chad',
@@ -369,7 +375,7 @@ export class EachSuite extends RenderTest {
if (!LOCAL_DEBUG) return;
let arr = [1, 2, 3, 4, 5, 6, 7, 8];
- this.render(`{{#each arr as |item|}}{{item}}{{/each}}`, { arr });
+ this.render(`{{#each this.arr as |item|}}{{item}}{{/each}}`, { arr });
let a = arr[1];
let b = arr[7];
@@ -399,7 +405,7 @@ export class EachSuite extends RenderTest {
if (!LOCAL_DEBUG) return;
let arr = [1, 2, 3, 4, 5, 6, 7, 8];
- this.render(`{{#each arr as |item|}}{{item}}{{/each}}`, { arr });
+ this.render(`{{#each this.arr as |item|}}{{item}}{{/each}}`, { arr });
let a = arr[0];
let b = arr[7];
@@ -429,7 +435,7 @@ export class EachSuite extends RenderTest {
if (!LOCAL_DEBUG) return;
let arr = [1, 2, 3, 4, 5, 6, 7, 8];
- this.render(`{{#each arr as |item|}}{{item}}{{/each}}`, { arr });
+ this.render(`{{#each this.arr as |item|}}{{item}}{{/each}}`, { arr });
let a = arr[0];
let b = arr[6];
@@ -459,7 +465,7 @@ export class EachSuite extends RenderTest {
if (!LOCAL_DEBUG) return;
let arr = [1, 2, 3, 4, 5, 6, 7, 8];
- this.render(`{{#each arr as |item|}}{{item}}{{/each}}`, { arr });
+ this.render(`{{#each this.arr as |item|}}{{item}}{{/each}}`, { arr });
let a = arr[1];
let b = arr[3];
@@ -493,7 +499,7 @@ export class EachSuite extends RenderTest {
if (!LOCAL_DEBUG) return;
let arr = [1, 2, 3, 4, 5, 6, 7, 8];
- this.render(`{{#each arr as |item|}}{{item}}{{/each}}`, { arr });
+ this.render(`{{#each this.arr as |item|}}{{item}}{{/each}}`, { arr });
let a = arr[1];
let b = arr[3];
@@ -525,7 +531,7 @@ export class EachSuite extends RenderTest {
if (!LOCAL_DEBUG) return;
let arr = [1, 2, 3, 4, 5, 6, 7, 8];
- this.render(`{{#each arr as |item|}}{{item}}{{/each}}`, { arr });
+ this.render(`{{#each this.arr as |item|}}{{item}}{{/each}}`, { arr });
let a = arr[1];
let b = arr[6];
@@ -558,7 +564,7 @@ export class EachSuite extends RenderTest {
if (!LOCAL_DEBUG) return;
let arr = [1, 2, 3, 4, 5, 6, 7, 8];
- this.render(`{{#each arr as |item|}}{{item}}{{/each}}`, { arr });
+ this.render(`{{#each this.arr as |item|}}{{item}}{{/each}}`, { arr });
arr.shift();
arr.splice(2, 0, 9);
@@ -587,7 +593,7 @@ export class EachSuite extends RenderTest {
if (!LOCAL_DEBUG) return;
let arr = [1, 2, 3, 4, 5, 6, 7, 8];
- this.render(`{{#each arr as |item|}}{{item}}{{/each}}`, { arr });
+ this.render(`{{#each this.arr as |item|}}{{item}}{{/each}}`, { arr });
let shifted = [8, 1, 2, 3, 4, 5, 6, 7];
@@ -614,7 +620,7 @@ export class EachSuite extends RenderTest {
if (!LOCAL_DEBUG) return;
let arr = [1, 2, 3, 4, 5, 6, 7, 8];
- this.render(`{{#each arr as |item|}}{{item}}{{/each}}`, { arr });
+ this.render(`{{#each this.arr as |item|}}{{item}}{{/each}}`, { arr });
let shifted = [2, 3, 4, 5, 6, 7, 8, 1];
@@ -641,7 +647,7 @@ export class EachSuite extends RenderTest {
if (!LOCAL_DEBUG) return;
let arr = [1, 2, 3, 4, 5, 6, 7, 8];
- this.render(`{{#each arr as |item|}}{{item}}{{/each}}`, { arr });
+ this.render(`{{#each this.arr as |item|}}{{item}}{{/each}}`, { arr });
for (let i = 0; i < 100; i++) {
shuffleArray(arr);
@@ -666,7 +672,7 @@ export class EachSuite extends RenderTest {
if (!LOCAL_DEBUG) return;
let arr = [1, 2, 3, 4, 5, 6, 7, 8];
- this.render(`{{#each arr as |item|}}{{item}}{{/each}}`, { arr });
+ this.render(`{{#each this.arr as |item|}}{{item}}{{/each}}`, { arr });
for (let i = 0; i < 100; i++) {
let newArr = arr.slice();
@@ -693,7 +699,7 @@ export class EachSuite extends RenderTest {
if (!LOCAL_DEBUG) return;
let arr = [1, 2, 3, 4, 5, 6, 7, 8];
- this.render(`{{#each arr as |item|}}{{item}}{{/each}}`, { arr });
+ this.render(`{{#each this.arr as |item|}}{{item}}{{/each}}`, { arr });
for (let i = 0; i < 100; i++) {
let newArr = arr.slice();
@@ -722,7 +728,9 @@ export class EachSuite extends RenderTest {
[4, 5, 6, 7, 8],
[5, 6, 7, 8, 9],
];
- this.render(`{{#each arr as |sub|}}{{#each sub as |item|}}{{item}}{{/each}}{{/each}}`, { arr });
+ this.render(`{{#each this.arr as |sub|}}{{#each sub as |item|}}{{item}}{{/each}}{{/each}}`, {
+ arr,
+ });
for (let i = 0; i < 100; i++) {
for (let sub of arr) {
diff --git a/packages/@glimmer/integration-tests/lib/suites/emberish-components.ts b/packages/@glimmer/integration-tests/lib/suites/emberish-components.ts
index 367524daa1..e3f965dc37 100644
--- a/packages/@glimmer/integration-tests/lib/suites/emberish-components.ts
+++ b/packages/@glimmer/integration-tests/lib/suites/emberish-components.ts
@@ -33,7 +33,7 @@ export class EmberishComponentTests extends RenderTest {
}
);
- this.render('{{#if ok}}
{{/if}}', {
+ this.render('{{#if this.ok}}
{{/if}}', {
bar: 'bar',
ok: true,
});
@@ -69,7 +69,7 @@ export class EmberishComponentTests extends RenderTest {
{
layout: 'In layout -- {{#if @predicate}}{{yield}}{{/if}}',
template: 'In template',
- args: { predicate: 'predicate' },
+ args: { predicate: 'this.predicate' },
},
{ predicate: true }
);
diff --git a/packages/@glimmer/integration-tests/lib/suites/in-element.ts b/packages/@glimmer/integration-tests/lib/suites/in-element.ts
index b35a0a6c4c..2ccda2374e 100644
--- a/packages/@glimmer/integration-tests/lib/suites/in-element.ts
+++ b/packages/@glimmer/integration-tests/lib/suites/in-element.ts
@@ -30,7 +30,7 @@ export class InElementSuite extends RenderTest {
}));
let externalElement = this.delegate.createElement('div');
- this.render('{{#maybe-in-element externalElement}}[{{foo}}]{{/maybe-in-element}}', {
+ this.render('{{#maybe-in-element this.externalElement}}[{{this.foo}}]{{/maybe-in-element}}', {
externalElement,
foo: 'Yippie!',
});
@@ -50,7 +50,7 @@ export class InElementSuite extends RenderTest {
@test
'Renders curlies into external element'() {
let externalElement = this.delegate.createElement('div');
- this.render('{{#in-element externalElement}}[{{foo}}]{{/in-element}}', {
+ this.render('{{#in-element this.externalElement}}[{{this.foo}}]{{/in-element}}', {
externalElement,
foo: 'Yippie!',
});
@@ -73,7 +73,7 @@ export class InElementSuite extends RenderTest {
let initialContent = '
Hello there!
';
replaceHTML(externalElement, initialContent);
- this.render('{{#in-element externalElement}}[{{foo}}]{{/in-element}}', {
+ this.render('{{#in-element this.externalElement}}[{{this.foo}}]{{/in-element}}', {
externalElement,
foo: 'Yippie!',
});
@@ -97,9 +97,9 @@ export class InElementSuite extends RenderTest {
this.render(
stripTight`
- |{{foo}}|
- {{#in-element first}}[1{{foo}}]{{/in-element}}
- {{#in-element second}}[2{{foo}}]{{/in-element}}
+ |{{this.foo}}|
+ {{#in-element this.first}}[1{{this.foo}}]{{/in-element}}
+ {{#in-element this.second}}[2{{this.foo}}]{{/in-element}}
`,
{ first, second: null, foo: 'Yippie!' }
);
@@ -141,7 +141,7 @@ export class InElementSuite extends RenderTest {
replaceHTML(externalElement, initialContent);
this.render(
- stripTight`{{#in-element externalElement insertBefore=null}}[{{foo}}]{{/in-element}}`,
+ stripTight`{{#in-element this.externalElement insertBefore=null}}[{{this.foo}}]{{/in-element}}`,
{
externalElement,
foo: 'Yippie!',
@@ -174,7 +174,7 @@ export class InElementSuite extends RenderTest {
replaceHTML(externalElement, '
Hello there! ');
this.render(
- stripTight`{{#in-element externalElement insertBefore=insertBefore}}[{{foo}}]{{/in-element}}`,
+ stripTight`{{#in-element this.externalElement insertBefore=this.insertBefore}}[{{this.foo}}]{{/in-element}}`,
{ externalElement, insertBefore: externalElement.lastChild, foo: 'Yippie!' }
);
@@ -208,7 +208,7 @@ export class InElementSuite extends RenderTest {
let first = this.delegate.createElement('div');
let second = this.delegate.createElement('div');
- this.render(stripTight`{{#in-element externalElement}}[{{foo}}]{{/in-element}}`, {
+ this.render(stripTight`{{#in-element this.externalElement}}[{{this.foo}}]{{/in-element}}`, {
externalElement: first,
foo: 'Yippie!',
});
@@ -262,11 +262,11 @@ export class InElementSuite extends RenderTest {
this.render(
stripTight`
- {{#if showFirst}}
- {{#in-element first}}[{{foo}}]{{/in-element}}
+ {{#if this.showFirst}}
+ {{#in-element this.first}}[{{this.foo}}]{{/in-element}}
{{/if}}
- {{#if showSecond}}
- {{#in-element second}}[{{foo}}]{{/in-element}}
+ {{#if this.showSecond}}
+ {{#in-element this.second}}[{{this.foo}}]{{/in-element}}
{{/if}}
`,
{
@@ -349,11 +349,11 @@ export class InElementSuite extends RenderTest {
this.render(
stripTight`
- {{#in-element firstElement}}
- [{{foo}}]
+ {{#in-element this.firstElement}}
+ [{{this.foo}}]
{{/in-element}}
- {{#in-element secondElement}}
- [{{bar}}]
+ {{#in-element this.secondElement}}
+ [{{this.bar}}]
{{/in-element}}
`,
{
@@ -464,10 +464,10 @@ export class InElementSuite extends RenderTest {
this.render(
stripTight`
- {{#in-element firstElement}}
- [{{foo}}]
- {{#in-element secondElement}}
- [{{bar}}]
+ {{#in-element this.firstElement}}
+ [{{this.foo}}]
+ {{#in-element this.secondElement}}
+ [{{this.bar}}]
{{/in-element}}
{{/in-element}}
`,
@@ -525,8 +525,8 @@ export class InElementSuite extends RenderTest {
this.render(
stripTight`
- {{#if showExternal}}
- {{#in-element externalElement}}[
]{{/in-element}}
+ {{#if this.showExternal}}
+ {{#in-element this.externalElement}}[
]{{/in-element}}
{{/if}}
`,
{
diff --git a/packages/@glimmer/integration-tests/lib/suites/initial-render.ts b/packages/@glimmer/integration-tests/lib/suites/initial-render.ts
index a192853219..ef0facc148 100644
--- a/packages/@glimmer/integration-tests/lib/suites/initial-render.ts
+++ b/packages/@glimmer/integration-tests/lib/suites/initial-render.ts
@@ -131,7 +131,7 @@ export class InitialRenderSuite extends RenderTest {
@test
'Custom Elements with dynamic attributes'() {
this.render(
- "
",
+ "
",
{ someDynamicBits: 'things' }
);
this.assertHTML("
");
@@ -140,14 +140,14 @@ export class InitialRenderSuite extends RenderTest {
@test
'Custom Elements with dynamic content'() {
- this.render('
{{derp}} ', { derp: 'stuff' });
+ this.render('
{{this.derp}} ', { derp: 'stuff' });
this.assertHTML('
stuff ');
this.assertStableRerender();
}
@test
'Dynamic content within single custom element'() {
- this.render('
{{#if derp}}Content Here{{/if}} ', { derp: 'stuff' });
+ this.render('
{{#if this.derp}}Content Here{{/if}} ', { derp: 'stuff' });
this.assertHTML('
Content Here ');
this.assertStableRerender();
@@ -217,7 +217,7 @@ export class InitialRenderSuite extends RenderTest {
@test
'Quoted attribute null values do not disable'() {
- this.render('
', { isDisabled: null });
+ this.render('
', { isDisabled: null });
this.assertHTML('
');
this.assertStableRerender();
@@ -240,7 +240,7 @@ export class InitialRenderSuite extends RenderTest {
@test
'Unquoted attribute null values do not disable'() {
- this.render('
', { isDisabled: null });
+ this.render('
', { isDisabled: null });
this.assertHTML('
');
this.assertStableRerender();
@@ -262,7 +262,7 @@ export class InitialRenderSuite extends RenderTest {
@test
'Quoted attribute string values'() {
- this.render("
", { src: 'image.png' });
+ this.render("
", { src: 'image.png' });
this.assertHTML("
");
this.assertStableRerender();
@@ -281,7 +281,7 @@ export class InitialRenderSuite extends RenderTest {
@test
'Unquoted attribute string values'() {
- this.render('
', { src: 'image.png' });
+ this.render('
', { src: 'image.png' });
this.assertHTML("
");
this.assertStableRerender();
@@ -300,7 +300,7 @@ export class InitialRenderSuite extends RenderTest {
@test
'Unquoted img src attribute is not rendered when set to `null`'() {
- this.render("
", { src: null });
+ this.render("
", { src: null });
this.assertHTML('
');
this.assertStableRerender();
@@ -319,7 +319,7 @@ export class InitialRenderSuite extends RenderTest {
@test
'Unquoted img src attribute is not rendered when set to `undefined`'() {
- this.render("
", { src: undefined });
+ this.render("
", { src: undefined });
this.assertHTML('
');
this.assertStableRerender();
@@ -338,7 +338,7 @@ export class InitialRenderSuite extends RenderTest {
@test
'Unquoted a href attribute is not rendered when set to `null`'() {
- this.render('
', { href: null });
+ this.render('
', { href: null });
this.assertHTML('
');
this.assertStableRerender();
@@ -357,7 +357,7 @@ export class InitialRenderSuite extends RenderTest {
@test
'Unquoted a href attribute is not rendered when set to `undefined`'() {
- this.render('
', { href: undefined });
+ this.render('
', { href: undefined });
this.assertHTML('
');
this.assertStableRerender();
@@ -376,7 +376,7 @@ export class InitialRenderSuite extends RenderTest {
@test
'Attribute expression can be followed by another attribute'() {
- this.render("
", { funstuff: 'oh my' });
+ this.render("
", { funstuff: 'oh my' });
this.assertHTML("
");
this.assertStableRerender();
@@ -399,7 +399,7 @@ export class InitialRenderSuite extends RenderTest {
strip`
1
- 2
+ 2
3
`,
@@ -469,11 +469,11 @@ export class InitialRenderSuite extends RenderTest {
strip`
0
- 1
- 2
- 3
- 4
- 5
+ 1
+ 2
+ 3
+ 4
+ 5
`,
{
somethingTrue: true,
@@ -531,39 +531,39 @@ export class InitialRenderSuite extends RenderTest {
@test
'Curlies in HTML comments'() {
- this.render('
', { foo: 'foo' });
- this.assertHTML('
');
+ this.render('
', { foo: 'foo' });
+ this.assertHTML('
');
this.assertStableRerender();
this.rerender({ foo: 'bar' });
- this.assertHTML('
');
+ this.assertHTML('
');
this.assertStableNodes();
this.rerender({ foo: '' });
- this.assertHTML('
');
+ this.assertHTML('
');
this.assertStableNodes();
this.rerender({ foo: 'foo' });
- this.assertHTML('
');
+ this.assertHTML('
');
this.assertStableNodes();
}
@test
'Complex Curlies in HTML comments'() {
- this.render('
', { foo: 'foo' });
- this.assertHTML('
');
+ this.render('
', { foo: 'foo' });
+ this.assertHTML('
');
this.assertStableRerender();
this.rerender({ foo: 'bar' });
- this.assertHTML('
');
+ this.assertHTML('
');
this.assertStableNodes();
this.rerender({ foo: '' });
- this.assertHTML('
');
+ this.assertHTML('
');
this.assertStableNodes();
this.rerender({ foo: 'foo' });
- this.assertHTML('
');
+ this.assertHTML('
');
this.assertStableNodes();
}
@@ -576,8 +576,8 @@ export class InitialRenderSuite extends RenderTest {
@test
'Top level comments'() {
- this.render('');
- this.assertHTML('');
+ this.render('');
+ this.assertHTML('');
this.assertStableRerender();
}
@@ -598,7 +598,7 @@ export class InitialRenderSuite extends RenderTest {
@test
'svg href attribute with quotation marks'() {
this.render(
- `
`,
+ `
`,
{ iconLink: 'home' }
);
this.assertHTML(
@@ -616,7 +616,7 @@ export class InitialRenderSuite extends RenderTest {
@test
'svg href attribute without quotation marks'() {
this.render(
- `
`,
+ `
`,
{ iconLink: 'home' }
);
this.assertHTML(
@@ -760,7 +760,7 @@ export class InitialRenderSuite extends RenderTest {
@test
'Text curlies'() {
- this.render('
{{title}}{{title}}
', { title: 'hello' });
+ this.render('
{{this.title}}{{this.title}}
', { title: 'hello' });
this.assertHTML('
hellohello
');
this.assertStableRerender();
@@ -779,28 +779,33 @@ export class InitialRenderSuite extends RenderTest {
@test
'Repaired text nodes are ensured in the right place Part 1'() {
- this.render('{{a}} {{b}}', { a: 'A', b: 'B', c: 'C', d: 'D' });
+ this.render('{{this.a}} {{this.b}}', { a: 'A', b: 'B', c: 'C', d: 'D' });
this.assertHTML('A B');
this.assertStableRerender();
}
@test
'Repaired text nodes are ensured in the right place Part 2'() {
- this.render('
{{a}}{{b}}{{c}}wat{{d}}
', { a: 'A', b: 'B', c: 'C', d: 'D' });
+ this.render('
{{this.a}}{{this.b}}{{this.c}}wat{{this.d}}
', {
+ a: 'A',
+ b: 'B',
+ c: 'C',
+ d: 'D',
+ });
this.assertHTML('
ABCwatD
');
this.assertStableRerender();
}
@test
'Repaired text nodes are ensured in the right place Part 3'() {
- this.render('{{a}}{{b}}
', { a: 'A', b: 'B', c: 'C', d: 'D' });
+ this.render('{{this.a}}{{this.b}}
', { a: 'A', b: 'B', c: 'C', d: 'D' });
this.assertHTML('AB
');
this.assertStableRerender();
}
@test
'Path expressions'() {
- this.render('
{{model.foo.bar}}{{model.foo.bar}}
', {
+ this.render('
{{this.model.foo.bar}}{{this.model.foo.bar}}
', {
model: { foo: { bar: 'hello' } },
});
this.assertHTML('
hellohello
');
@@ -821,7 +826,9 @@ export class InitialRenderSuite extends RenderTest {
@test
'Text curlies perform escaping'() {
- this.render('
{{title}}{{title}}
', { title: '
hello ' });
+ this.render('
{{this.title}}{{this.title}}
', {
+ title: '
hello ',
+ });
this.assertHTML(
'
<strong>hello</strong><strong>hello</strong>
'
);
@@ -844,7 +851,7 @@ export class InitialRenderSuite extends RenderTest {
@test
'Rerender respects whitespace'() {
- this.render('Hello {{ foo }} ', { foo: 'bar' });
+ this.render('Hello {{ this.foo }} ', { foo: 'bar' });
this.assertHTML('Hello bar ');
this.assertStableRerender();
@@ -868,7 +875,7 @@ export class InitialRenderSuite extends RenderTest {
return '
hello world ';
},
};
- this.render('
{{title}}
', { title });
+ this.render('
{{this.title}}
', { title });
this.assertHTML('
hello world
');
this.assertStableRerender();
}
@@ -876,7 +883,7 @@ export class InitialRenderSuite extends RenderTest {
@test
'Triple curlies'() {
let title = '
hello world ';
- this.render('
{{{title}}}
', { title });
+ this.render('
{{{this.title}}}
', { title });
this.assertHTML('
hello world
');
this.assertStableRerender();
}
@@ -893,7 +900,7 @@ export class InitialRenderSuite extends RenderTest {
@test
'Top level triple curlies'() {
let title = '
hello world ';
- this.render('{{{title}}}', { title });
+ this.render('{{{this.title}}}', { title });
this.assertHTML('
hello world ');
this.assertStableRerender();
}
@@ -901,14 +908,14 @@ export class InitialRenderSuite extends RenderTest {
@test
'Top level unescaped tr'() {
let title = '
Yo ';
- this.render('
', { title });
+ this.render('
', { title });
this.assertHTML('
');
this.assertStableRerender();
}
@test
'The compiler can handle top-level unescaped td inside tr contextualElement'() {
- this.render('{{{html}}}', { html: '
Yo ' });
+ this.render('{{{this.html}}}', { html: '
Yo ' });
this.assertHTML('
Yo ');
this.assertStableRerender();
}
@@ -916,7 +923,7 @@ export class InitialRenderSuite extends RenderTest {
@test
'Extreme nesting'() {
this.render(
- '{{foo}}
{{bar}}{{baz}}{{boo}}{{brew}} {{bat}} {{flute}} {{argh}}',
+ '{{this.foo}}
{{this.bar}}{{this.baz}}{{this.boo}}{{this.brew}} {{this.bat}} {{this.flute}} {{this.argh}}',
{
foo: 'FOO',
bar: 'BAR',
@@ -936,7 +943,7 @@ export class InitialRenderSuite extends RenderTest {
@test
'Simple blocks'() {
- this.render('
{{#if admin}}
{{user}}
{{/if}}!
', {
+ this.render('
{{#if this.admin}}
{{this.user}}
{{/if}}!
', {
admin: true,
user: 'chancancode',
});
@@ -958,11 +965,14 @@ export class InitialRenderSuite extends RenderTest {
@test
'Nested blocks'() {
- this.render('
{{#if admin}}{{#if access}}
{{user}}
{{/if}}{{/if}}!
', {
- admin: true,
- access: true,
- user: 'chancancode',
- });
+ this.render(
+ '
{{#if this.admin}}{{#if this.access}}
{{this.user}}
{{/if}}{{/if}}!
',
+ {
+ admin: true,
+ access: true,
+ user: 'chancancode',
+ }
+ );
this.assertHTML('
');
this.assertStableRerender();
@@ -988,7 +998,7 @@ export class InitialRenderSuite extends RenderTest {
@test
Loops() {
this.render(
- '
{{#each people key="handle" as |p|}}{{p.handle}} - {{p.name}}{{/each}}
',
+ '
{{#each this.people key="handle" as |p|}}{{p.handle}} - {{p.name}}{{/each}}
',
{
people: [
{ handle: 'tomdale', name: 'Tom Dale' },
@@ -1018,7 +1028,7 @@ export class InitialRenderSuite extends RenderTest {
@test
'Simple helpers'() {
this.registerHelper('testing', ([id]) => id);
- this.render('
{{testing title}}
', { title: 'hello' });
+ this.render('
{{testing this.title}}
', { title: 'hello' });
this.assertHTML('
hello
');
this.assertStableRerender();
}
@@ -1223,11 +1233,14 @@ export class InitialRenderSuite extends RenderTest {
return '' + params[0] + params[1];
});
- this.render('
{{testing (testing "hello" foo) (testing (testing bar "lol") baz)}}
', {
- foo: 'FOO',
- bar: 'BAR',
- baz: 'BAZ',
- });
+ this.render(
+ '
{{testing (testing "hello" this.foo) (testing (testing this.bar "lol") this.baz)}}
',
+ {
+ foo: 'FOO',
+ bar: 'BAR',
+ baz: 'BAZ',
+ }
+ );
this.assertHTML('
helloFOOBARlolBAZ
');
this.assertStableRerender();
}
@@ -1249,7 +1262,7 @@ export class InitialRenderSuite extends RenderTest {
return params[0];
});
- this.render('
linky ', { url: 'linky.html' });
+ this.render('
linky ', { url: 'linky.html' });
this.assertHTML('
linky ');
this.assertStableRerender();
}
@@ -1260,7 +1273,7 @@ export class InitialRenderSuite extends RenderTest {
return hash['path'];
});
- this.render('
linky ', { url: 'linky.html' });
+ this.render('
linky ', { url: 'linky.html' });
this.assertHTML('
linky ');
this.assertStableRerender();
}
@@ -1271,7 +1284,7 @@ export class InitialRenderSuite extends RenderTest {
return params[0];
});
- this.render('
linky ', {
+ this.render('
linky ', {
foo: 'foo.com',
bar: 'bar',
});
diff --git a/packages/@glimmer/integration-tests/lib/suites/shadowing.ts b/packages/@glimmer/integration-tests/lib/suites/shadowing.ts
index a1ecfbd944..ba15fc771a 100644
--- a/packages/@glimmer/integration-tests/lib/suites/shadowing.ts
+++ b/packages/@glimmer/integration-tests/lib/suites/shadowing.ts
@@ -33,7 +33,7 @@ export class ShadowingSuite extends RenderTest {
this.render(
{
layout: 'In layout - someProp: {{@someProp}}',
- args: { someProp: 'someProp' },
+ args: { someProp: 'this.someProp' },
},
{ someProp: 'something here' }
);
@@ -60,7 +60,7 @@ export class ShadowingSuite extends RenderTest {
{
layoutAttributes: { 'data-name': 'Godfrey', 'data-foo': 'foo' },
layout: 'Hello!',
- attributes: { 'data-name': '"{{name}}"', 'data-foo': '"{{foo}}-bar"' },
+ attributes: { 'data-name': '"{{this.name}}"', 'data-foo': '"{{this.foo}}-bar"' },
},
{ name: 'Godhuda', foo: 'foo' }
);
@@ -87,7 +87,7 @@ export class ShadowingSuite extends RenderTest {
{
layoutAttributes: { 'data-name': '{{@name}}', 'data-foo': '"{{@foo}}-bar"' },
layout: 'Hello!',
- args: { name: 'name', foo: 'foo' },
+ args: { name: 'this.name', foo: 'this.foo' },
attributes: { 'data-name': '"Godhuda"', 'data-foo': '"foo-bar"' },
},
{ name: 'Godfrey', foo: 'foo' }
diff --git a/packages/@glimmer/integration-tests/lib/suites/ssr.ts b/packages/@glimmer/integration-tests/lib/suites/ssr.ts
index 7ce4684794..ee769b17b4 100644
--- a/packages/@glimmer/integration-tests/lib/suites/ssr.ts
+++ b/packages/@glimmer/integration-tests/lib/suites/ssr.ts
@@ -44,19 +44,19 @@ export class ServerSideSuite extends AbstractNodeTest {
@test
'Quoted attribute expression is removed when null'() {
- this.render('
', { isDisabled: null });
+ this.render('
', { isDisabled: null });
this.assertHTML('
');
}
@test
'Unquoted attribute expression with null value is not coerced'() {
- this.render('
', { isDisabled: null });
+ this.render('
', { isDisabled: null });
this.assertHTML('
');
}
@test
'Attribute expression can be followed by another attribute'() {
- this.render('
', { funstuff: 'oh my' });
+ this.render('
', { funstuff: 'oh my' });
this.assertHTML('
');
}
@@ -111,19 +111,19 @@ export class ServerSideSuite extends AbstractNodeTest {
@test
'The compiler can handle simple handlebars'() {
- this.render('
{{title}}
', { title: 'hello' });
+ this.render('
{{this.title}}
', { title: 'hello' });
this.assertHTML('
hello
');
}
@test
'The compiler can handle escaping HTML'() {
- this.render('
{{title}}
', { title: '
hello ' });
+ this.render('
{{this.title}}
', { title: '
hello ' });
this.assertHTML('
<strong>hello</strong>
');
}
@test
'The compiler can handle unescaped HTML'() {
- this.render('
{{{title}}}
', { title: '
hello ' });
+ this.render('
{{{this.title}}}
', { title: '
hello ' });
this.assertHTML('
hello
');
}
@@ -146,7 +146,7 @@ export class ServerSideSuite extends AbstractNodeTest {
return params[0];
});
- this.render('
linky ', { url: 'linky.html' });
+ this.render('
linky ', { url: 'linky.html' });
this.assertHTML('
linky ');
}
@@ -215,7 +215,7 @@ export class ServerSideComponentSuite extends AbstractNodeTest {
{
layout: '
Hello {{@place}}! ',
template: 'World',
- args: { place: 'place' },
+ args: { place: 'this.place' },
},
{ place: 'World' }
);
@@ -228,7 +228,7 @@ export class ServerSideComponentSuite extends AbstractNodeTest {
{
layout: '
Hello {{yield @place}}! ',
template: '{{place}}',
- args: { place: 'place' },
+ args: { place: 'this.place' },
blockParams: ['place'],
},
{ place: 'World' }
diff --git a/packages/@glimmer/integration-tests/lib/suites/with-dynamic-vars.ts b/packages/@glimmer/integration-tests/lib/suites/with-dynamic-vars.ts
index 603b060bbf..7608fcddf8 100644
--- a/packages/@glimmer/integration-tests/lib/suites/with-dynamic-vars.ts
+++ b/packages/@glimmer/integration-tests/lib/suites/with-dynamic-vars.ts
@@ -9,7 +9,7 @@ export class WithDynamicVarsSuite extends RenderTest {
{
layout: '{{#-with-dynamic-vars myKeyword=@value}}{{yield}}{{/-with-dynamic-vars}}',
template: '{{-get-dynamic-var "myKeyword"}}',
- args: { value: 'value' },
+ args: { value: 'this.value' },
},
{ value: 'hello' }
);
@@ -32,8 +32,8 @@ export class WithDynamicVarsSuite extends RenderTest {
{
layout:
'{{#-with-dynamic-vars myKeyword=@value1 secondKeyword=@value2}}{{yield}}{{/-with-dynamic-vars}}',
- template: '{{keyword}}-{{-get-dynamic-var keyword}}',
- args: { value1: 'value1', value2: 'value2' },
+ template: '{{this.keyword}}-{{-get-dynamic-var this.keyword}}',
+ args: { value1: 'this.value1', value2: 'this.value2' },
},
{ value1: 'hello', value2: 'goodbye', keyword: 'myKeyword' }
);
@@ -61,7 +61,7 @@ export class WithDynamicVarsSuite extends RenderTest {
layout:
'{{#-with-dynamic-vars myKeyword=@outer}}
{{-get-dynamic-var "myKeyword"}}
{{#-with-dynamic-vars myKeyword=@inner}}{{yield}}{{/-with-dynamic-vars}}
{{-get-dynamic-var "myKeyword"}}
{{/-with-dynamic-vars}}',
template: '
{{-get-dynamic-var "myKeyword"}}
',
- args: { outer: 'outer', inner: 'inner' },
+ args: { outer: 'this.outer', inner: 'this.inner' },
},
{ outer: 'original', inner: 'shadowed' }
);
diff --git a/packages/@glimmer/integration-tests/lib/suites/yield.ts b/packages/@glimmer/integration-tests/lib/suites/yield.ts
index e5078f73ca..c4cb9df324 100644
--- a/packages/@glimmer/integration-tests/lib/suites/yield.ts
+++ b/packages/@glimmer/integration-tests/lib/suites/yield.ts
@@ -10,10 +10,10 @@ export class YieldSuite extends RenderTest {
{
layout:
'{{#if @predicate}}Yes:{{yield @someValue}}{{else}}No:{{yield to="inverse"}}{{/if}}',
- args: { predicate: 'activated', someValue: '42' },
+ args: { predicate: 'this.activated', someValue: '42' },
blockParams: ['result'],
- template: 'Hello{{result}}{{outer}}',
- else: 'Goodbye{{outer}}',
+ template: 'Hello{{result}}{{this.outer}}',
+ else: 'Goodbye{{this.outer}}',
},
{ activated: true, outer: 'outer' }
);
@@ -30,10 +30,10 @@ export class YieldSuite extends RenderTest {
{
layout:
'{{#if @predicate}}Yes:{{yield @someValue}}{{else}}No:{{yield to="inverse"}}{{/if}}',
- args: { predicate: 'activated', someValue: '42' },
+ args: { predicate: 'this.activated', someValue: '42' },
blockParams: ['result'],
- template: 'Hello{{result}}{{outer}}',
- else: 'Goodbye{{outer}}',
+ template: 'Hello{{result}}{{this.outer}}',
+ else: 'Goodbye{{this.outer}}',
},
{ activated: false, outer: 'outer' }
);
@@ -49,10 +49,10 @@ export class YieldSuite extends RenderTest {
this.render(
{
layout: '{{#if @predicate}}Yes:{{yield @someValue}}{{else}}No:{{yield to="else"}}{{/if}}',
- args: { predicate: 'activated', someValue: '42' },
+ args: { predicate: 'this.activated', someValue: '42' },
blockParams: ['result'],
- template: 'Hello{{result}}{{outer}}',
- else: 'Goodbye{{outer}}',
+ template: 'Hello{{result}}{{this.outer}}',
+ else: 'Goodbye{{this.outer}}',
},
{ activated: false, outer: 'outer' }
);
@@ -88,7 +88,7 @@ export class YieldSuite extends RenderTest {
})
'use a non-existent block param'() {
this.render({
- layout: '{{yield someValue}}',
+ layout: '{{yield this.someValue}}',
args: { someValue: '42' },
blockParams: ['val1', 'val2'],
template: '{{val1}} - {{val2}}',
@@ -199,7 +199,7 @@ export class YieldSuite extends RenderTest {
{
layout: 'In layout -- {{#if @predicate}}{{yield}}{{/if}}',
template: 'In template',
- args: { predicate: 'predicate' },
+ args: { predicate: 'this.predicate' },
},
{ predicate: true }
);
diff --git a/packages/@glimmer/integration-tests/test/attributes-test.ts b/packages/@glimmer/integration-tests/test/attributes-test.ts
index 1b1e092cec..20408169aa 100644
--- a/packages/@glimmer/integration-tests/test/attributes-test.ts
+++ b/packages/@glimmer/integration-tests/test/attributes-test.ts
@@ -50,7 +50,7 @@ export class AttributesTests extends RenderTest {
@test
'disable updates properly'() {
- this.render('
', { enabled: true });
+ this.render('
', { enabled: true });
this.assertHTML('
');
this.assertStableRerender();
@@ -81,7 +81,7 @@ export class AttributesTests extends RenderTest {
@test
'Quoted disabled is always disabled if a not-null, not-undefined value is given'() {
- this.render('
', { enabled: true });
+ this.render('
', { enabled: true });
this.assertHTML('
');
this.assertStableRerender();
@@ -122,7 +122,7 @@ export class AttributesTests extends RenderTest {
@test
'div[href] is not marked as unsafe'() {
- this.render('
', { foo: 'javascript:foo()' });
+ this.render('
', { foo: 'javascript:foo()' });
this.assertHTML('
');
this.assertStableRerender();
@@ -137,7 +137,7 @@ export class AttributesTests extends RenderTest {
@test
'triple curlies in attribute position'() {
- this.render('
Hello
', {
+ this.render('
Hello
', {
rawString: 'TRIPLE',
});
this.assertHTML('
Hello
');
@@ -182,7 +182,7 @@ export class AttributesTests extends RenderTest {
@test
'can set attributes on form properties'() {
- this.render('
', { foo: 'bar' });
+ this.render('
', { foo: 'bar' });
let outputElement = assertElement(this.element.lastChild);
@@ -195,7 +195,7 @@ export class AttributesTests extends RenderTest {
@test
'handles null input values'() {
- this.render('
', { isNull: null });
+ this.render('
', { isNull: null });
this.assert.equal(this.readDOMAttr('value'), '');
this.assertStableRerender();
@@ -210,7 +210,7 @@ export class AttributesTests extends RenderTest {
@test
'handles undefined input values'() {
- this.render('
', { isUndefined: null });
+ this.render('
', { isUndefined: null });
this.assert.equal(this.readDOMAttr('value'), '');
this.assertStableRerender();
@@ -226,7 +226,7 @@ export class AttributesTests extends RenderTest {
@test
'handles undefined `toString` input values'() {
let obj = Object.create(null);
- this.render('
', { obj });
+ this.render('
', { obj });
this.assert.equal(this.readDOMAttr('value'), '');
this.assertStableRerender();
@@ -249,7 +249,7 @@ export class AttributesTests extends RenderTest {
}
});
- this.render('
', { foo: true });
+ this.render('
', { foo: true });
this.assert.equal(this.readDOMAttr('checked'), true);
this.assertStableRerender();
@@ -264,7 +264,7 @@ export class AttributesTests extends RenderTest {
@test
'input[checked] prop updates when set to null'() {
- this.render('
', { foo: true });
+ this.render('
', { foo: true });
this.assert.equal(this.readDOMAttr('checked'), true);
this.assertStableRerender();
@@ -281,7 +281,7 @@ export class AttributesTests extends RenderTest {
'select[value] prop updates when set to undefined'() {
// setting `select[value]` only works after initial render, just use
this.render(
- '
us ',
+ '
us ',
{ foo: undefined }
);
this.assert.equal(this.readDOMAttr('value'), 'us');
@@ -299,7 +299,7 @@ export class AttributesTests extends RenderTest {
@test
'handles empty string textarea values'() {
- this.render('
', { name: '' });
+ this.render('
', { name: '' });
this.assert.equal(this.readDOMAttr('value'), '');
this.assertStableRerender();
@@ -314,7 +314,7 @@ export class AttributesTests extends RenderTest {
@test
'handles empty string input placeholders'() {
- this.render('
', { name: '' });
+ this.render('
', { name: '' });
this.assert.equal(this.readDOMAttr('placeholder'), '');
this.assertStableRerender();
@@ -338,7 +338,7 @@ export class AttributesTests extends RenderTest {
@test
'does not set undefined attributes'() {
- this.render('
', {
+ this.render('
', {
isUndefined: undefined,
isNotUndefined: 'hello',
});
@@ -374,7 +374,7 @@ export class AttributesTests extends RenderTest {
@test
'does not set null attributes'() {
- this.render('
', {
+ this.render('
', {
isNull: null,
isNotNull: 'hello',
});
@@ -414,7 +414,7 @@ export class AttributesTests extends RenderTest {
@test
'does not set undefined properties initially'() {
- this.render('
', {
+ this.render('
', {
isUndefined: undefined,
isNotUndefined: 'hello',
});
@@ -451,7 +451,7 @@ export class AttributesTests extends RenderTest {
@test
'does not set null properties initially'() {
- this.render('
', {
+ this.render('
', {
isNull: undefined,
isNotNull: 'hello',
});
@@ -488,7 +488,7 @@ export class AttributesTests extends RenderTest {
@test
'input list attribute updates properly'() {
- this.render('
', { foo: 'bar' });
+ this.render('
', { foo: 'bar' });
this.assertHTML('
');
this.assertStableRerender();
@@ -503,7 +503,7 @@ export class AttributesTests extends RenderTest {
@test
'normalizes lowercase dynamic properties correctly'() {
- this.render('
', { foo: 'bar' });
+ this.render('
', { foo: 'bar' });
this.assertHTML('
');
this.assertStableRerender();
@@ -518,7 +518,7 @@ export class AttributesTests extends RenderTest {
@test
'normalizes mix-case dynamic properties correctly'() {
- this.render('
', { foo: '0 0 100 100' });
+ this.render('
', { foo: '0 0 100 100' });
this.assertHTML('
');
this.assertStableRerender();
@@ -542,7 +542,7 @@ abstract class BoundValuesToSpecialAttributeTests extends RenderTest {
@test
'marks javascript: protocol as unsafe'() {
- this.render(this.tmplt('{{foo}}'), {
+ this.render(this.tmplt('{{this.foo}}'), {
foo: 'javascript:foo()',
});
this.assertHTML(this.tmplt('unsafe:javascript:foo()'));
@@ -559,7 +559,7 @@ abstract class BoundValuesToSpecialAttributeTests extends RenderTest {
@test
'marks javascript: protocol as unsafe, http as safe'() {
- this.render(this.tmplt('{{foo}}'), { foo: 'javascript:foo()' });
+ this.render(this.tmplt('{{this.foo}}'), { foo: 'javascript:foo()' });
this.assertHTML(this.tmplt('unsafe:javascript:foo()'));
this.assertStableRerender();
@@ -574,7 +574,7 @@ abstract class BoundValuesToSpecialAttributeTests extends RenderTest {
@test
'marks javascript: protocol as unsafe on updates'() {
- this.render(this.tmplt('{{foo}}'), { foo: 'http://foo.bar' });
+ this.render(this.tmplt('{{this.foo}}'), { foo: 'http://foo.bar' });
this.assertHTML(this.tmplt('http://foo.bar', true));
this.assertStableRerender();
@@ -589,7 +589,7 @@ abstract class BoundValuesToSpecialAttributeTests extends RenderTest {
@test
'marks vbscript: protocol as unsafe'() {
- this.render(this.tmplt('{{foo}}'), { foo: 'vbscript:foo()' });
+ this.render(this.tmplt('{{this.foo}}'), { foo: 'vbscript:foo()' });
this.assertHTML(this.tmplt('unsafe:vbscript:foo()', true));
this.assertStableRerender();
@@ -604,7 +604,7 @@ abstract class BoundValuesToSpecialAttributeTests extends RenderTest {
@test
'can be removed by setting to `null`'() {
- this.render(this.tmplt('{{foo}}', false), { foo: 'http://foo.bar/derp.jpg' });
+ this.render(this.tmplt('{{this.foo}}', false), { foo: 'http://foo.bar/derp.jpg' });
this.assertHTML(this.tmplt('http://foo.bar/derp.jpg'));
this.assertStableRerender();
@@ -619,7 +619,7 @@ abstract class BoundValuesToSpecialAttributeTests extends RenderTest {
@test
'can be removed by setting to `undefined`'() {
- this.render(this.tmplt('{{foo}}', false), { foo: 'http://foo.bar/derp.jpg' });
+ this.render(this.tmplt('{{this.foo}}', false), { foo: 'http://foo.bar/derp.jpg' });
this.assertHTML(this.tmplt('http://foo.bar/derp.jpg'));
this.assertStableRerender();
diff --git a/packages/@glimmer/integration-tests/test/chaos-rehydration-test.ts b/packages/@glimmer/integration-tests/test/chaos-rehydration-test.ts
index 9ab3656781..3c990b947a 100644
--- a/packages/@glimmer/integration-tests/test/chaos-rehydration-test.ts
+++ b/packages/@glimmer/integration-tests/test/chaos-rehydration-test.ts
@@ -203,7 +203,7 @@ class ChaosMonkeyRehydration extends AbstractChaosMonkeyTest {
@test
'adjacent text nodes'() {
- let template = '
a {{b}}{{c}}{{d}}
';
+ let template = '
a {{this.b}}{{this.c}}{{this.d}}
';
let context = { b: '', c: '', d: '' };
this.renderServerSide(template, context);
@@ -218,7 +218,7 @@ class ChaosMonkeyRehydration extends AbstractChaosMonkeyTest {
@test
'
invoking a block which emits a
'() {
- let template = '
hello {{#if show}}
world!
{{/if}}';
+ let template = '
hello {{#if this.show}}
world!
{{/if}}';
let context = { show: true };
this.renderServerSide(template, context);
diff --git a/packages/@glimmer/integration-tests/test/ember-component-test.ts b/packages/@glimmer/integration-tests/test/ember-component-test.ts
index 38a3311cac..0133309296 100644
--- a/packages/@glimmer/integration-tests/test/ember-component-test.ts
+++ b/packages/@glimmer/integration-tests/test/ember-component-test.ts
@@ -191,7 +191,7 @@ class CurlyCreateTest extends CurlyTest {
tagName = 'div';
}
- this.registerComponent('Curly', 'foo-bar', `{{HAS_BLOCK}}`, FooBar);
+ this.registerComponent('Curly', 'foo-bar', `{{this.HAS_BLOCK}}`, FooBar);
this.render(`{{foo-bar}}`);
@@ -204,7 +204,7 @@ class CurlyCreateTest extends CurlyTest {
tagName = 'div';
}
- this.registerComponent('Curly', 'foo-bar', `{{HAS_BLOCK}}`, FooBar);
+ this.registerComponent('Curly', 'foo-bar', `{{this.HAS_BLOCK}}`, FooBar);
this.render(`{{#foo-bar}}{{/foo-bar}}`);
@@ -222,7 +222,7 @@ class CurlyDynamicComponentTest extends CurlyTest {
this.render(
stripTight`
- {{component something arg1="hello"}}
+ {{component this.something arg1="hello"}}
`,
{
@@ -245,7 +245,7 @@ class CurlyDynamicComponentTest extends CurlyTest {
this.render(
stripTight`
- {{component something}}
+ {{component this.something}}
`,
{
something: 'FooBar',
@@ -344,7 +344,7 @@ class CurlyArgsTest extends CurlyTest {
this.registerComponent('Curly', 'foo-bar', `{{@blah}}`, FooBar);
- this.render(`{{foo-bar first blah="derp"}}`);
+ this.render(`{{foo-bar this.first blah="derp"}}`);
this.assertEmberishElement('div', {}, `derp`);
}
@@ -358,18 +358,18 @@ class CurlyScopeTest extends CurlyTest {
this.registerComponent(
'TemplateOnly',
'FooBar',
- `
[Layout: {{zomg}}][Layout: {{lol}}][Layout: {{@foo}}]{{yield}}
`
+ `
[Layout: {{this.zomg}}][Layout: {{this.lol}}][Layout: {{@foo}}]{{yield}}
`
);
this.render(
stripTight`
- [Outside: {{zomg}}]
- {{#with zomg as |lol|}}
- [Inside: {{zomg}}]
+ [Outside: {{this.zomg}}]
+ {{#with this.zomg as |lol|}}
+ [Inside: {{this.zomg}}]
[Inside: {{lol}}]
-
- [Block: {{zomg}}]
+
+ [Block: {{this.zomg}}]
[Block: {{lol}}]
{{/with}}
@@ -404,19 +404,19 @@ class CurlyScopeTest extends CurlyTest {
this.registerComponent(
'Curly',
'foo-bar',
- `[Layout: {{zomg}}][Layout: {{lol}}][Layout: {{foo}}]{{yield}}`,
+ `[Layout: {{this.zomg}}][Layout: {{this.lol}}][Layout: {{this.foo}}]{{yield}}`,
FooBar
);
this.render(
stripTight`
- [Outside: {{zomg}}]
- {{#with zomg as |lol|}}
- [Inside: {{zomg}}]
+ [Outside: {{this.zomg}}]
+ {{#with this.zomg as |lol|}}
+ [Inside: {{this.zomg}}]
[Inside: {{lol}}]
- {{#foo-bar foo=zomg}}
- [Block: {{zomg}}]
+ {{#foo-bar foo=this.zomg}}
+ [Block: {{this.zomg}}]
[Block: {{lol}}]
{{/foo-bar}}
{{/with}}
@@ -458,11 +458,11 @@ class CurlyScopeTest extends CurlyTest {
'Curly',
'foo-bar',
stripTight`
- [Name: {{name}} | Target: {{targetObject.name}}]
+ [Name: {{this.name}} | Target: {{this.targetObject.name}}]
{{#qux-derp}}
- [Name: {{name}} | Target: {{targetObject.name}}]
+ [Name: {{this.name}} | Target: {{this.targetObject.name}}]
{{/qux-derp}}
- [Name: {{name}} | Target: {{targetObject.name}}]
+ [Name: {{this.name}} | Target: {{this.targetObject.name}}]
`,
FooBar
);
@@ -470,7 +470,7 @@ class CurlyScopeTest extends CurlyTest {
this.registerComponent(
'Curly',
'qux-derp',
- `[Name: {{name}} | Target: {{targetObject.name}}]{{yield}}`,
+ `[Name: {{this.name}} | Target: {{this.targetObject.name}}]{{yield}}`,
QuxDerp
);
@@ -492,25 +492,25 @@ class CurlyScopeTest extends CurlyTest {
@test
'`false` class name do not render'() {
- this.render('
FALSE
', { isFalse: false });
+ this.render('
FALSE
', { isFalse: false });
this.assertHTML('
FALSE
');
}
@test
'`null` class name do not render'() {
- this.render('
NULL
', { isNull: null });
+ this.render('
NULL
', { isNull: null });
this.assertHTML('
NULL
');
}
@test
'`undefined` class name do not render'() {
- this.render('
UNDEFINED
', { isUndefined: undefined });
+ this.render('
UNDEFINED
', { isUndefined: undefined });
this.assertHTML('
UNDEFINED
');
}
@test
'`0` class names do render'() {
- this.render('
ZERO
', { isZero: 0 });
+ this.render('
ZERO
', { isZero: 0 });
this.assertHTML('
ZERO
');
}
@@ -531,7 +531,7 @@ class CurlyScopeTest extends CurlyTest {
this.render(
stripTight`
- {{#each items key="id" as |item|}}
+ {{#each this.items key="id" as |item|}}
{{/each}}
`,
@@ -550,8 +550,9 @@ class CurlyScopeTest extends CurlyTest {
this.render(
stripTight`
- {{#each items key="id" as |item|}}
+ {{#each this.items key="id" as |item|}}
+ {{! Intentional property fallback to test self lookup }}
{{/each}}
@@ -611,7 +612,7 @@ class CurlyScopeTest extends CurlyTest {
this.render(
stripTight`
-
{{#each items key="id" as |item|}}
+ {{#each this.items key="id" as |item|}}
{{/each}}
`,
@@ -636,7 +637,7 @@ class CurlyScopeTest extends CurlyTest {
'item-list',
stripTight`
- {{#each items key="id" as |item|}}
+ {{#each this.items key="id" as |item|}}
{{item.id}}: {{yield item}}
{{/each}}
@@ -700,7 +701,7 @@ class CurlyScopeTest extends CurlyTest {
stripTight`
-
+
`,
{ zomg: 'zomg' }
);
@@ -725,7 +726,7 @@ class CurlyDynamicScopeSmokeTest extends CurlyTest {
static fromDynamicScope = ['theme'];
}
- this.registerComponent('Curly', 'sample-component', '{{theme}}', SampleComponent);
+ this.registerComponent('Curly', 'sample-component', '{{this.theme}}', SampleComponent);
this.render('{{#-with-dynamic-vars theme="light"}}{{sample-component}}{{/-with-dynamic-vars}}');
@@ -742,7 +743,12 @@ class CurlyPositionalArgsTest extends CurlyTest {
static positionalParams = ['person', 'age'];
}
- this.registerComponent('Curly', 'sample-component', '{{person}}{{age}}', SampleComponent);
+ this.registerComponent(
+ 'Curly',
+ 'sample-component',
+ '{{this.person}}{{this.age}}',
+ SampleComponent
+ );
this.render('{{sample-component "Quint" 4}}');
@@ -755,9 +761,14 @@ class CurlyPositionalArgsTest extends CurlyTest {
static positionalParams = ['person', 'age'];
}
- this.registerComponent('Curly', 'sample-component', '{{person}}{{age}}', SampleComponent);
+ this.registerComponent(
+ 'Curly',
+ 'sample-component',
+ '{{this.person}}{{this.age}}',
+ SampleComponent
+ );
- this.render('{{sample-component myName myAge}}', {
+ this.render('{{sample-component this.myName this.myAge}}', {
myName: 'Quint',
myAge: 4,
});
@@ -778,10 +789,10 @@ class CurlyPositionalArgsTest extends CurlyTest {
static positionalParams = ['name'];
}
- this.registerComponent('Curly', 'sample-component', '{{name}}', SampleComponent);
+ this.registerComponent('Curly', 'sample-component', '{{this.name}}', SampleComponent);
assert.throws(() => {
- this.render('{{sample-component notMyName name=myName}}', {
+ this.render('{{sample-component this.notMyName name=this.myName}}', {
myName: 'Quint',
notMyName: 'Sergio',
});
@@ -797,7 +808,7 @@ class CurlyPositionalArgsTest extends CurlyTest {
this.registerComponent(
'Curly',
'sample-component',
- '{{#each names key="@index" as |name|}}{{name}}{{/each}}',
+ '{{#each this.names key="@index" as |name|}}{{name}}{{/each}}',
SampleComponent
);
@@ -824,12 +835,12 @@ class CurlyPositionalArgsTest extends CurlyTest {
this.registerComponent(
'Curly',
'sample-component',
- '{{#each attrs.names key="@index" as |name|}}{{name}}{{/each}}',
+ '{{#each this.attrs.names key="@index" as |name|}}{{name}}{{/each}}',
SampleComponent
);
assert.throws(() => {
- this.render('{{sample-component "Foo" 4 "Bar" names=numbers id="args-3"}}', {
+ this.render('{{sample-component "Foo" 4 "Bar" names=this.numbers id="args-3"}}', {
numbers: [1, 2, 3],
});
}, `You cannot specify positional parameters and the hash argument \`names\`.`);
@@ -844,11 +855,11 @@ class CurlyPositionalArgsTest extends CurlyTest {
this.registerComponent(
'Curly',
'sample-component',
- '{{#each names key="@index" as |name|}}{{name}}{{/each}}',
+ '{{#each this.names key="@index" as |name|}}{{name}}{{/each}}',
SampleComponent
);
- this.render('{{sample-component names=things}}', {
+ this.render('{{sample-component names=this.things}}', {
things: ['Foo', 4, 'Bar'],
});
@@ -861,7 +872,12 @@ class CurlyPositionalArgsTest extends CurlyTest {
static positionalParams = ['first', 'second'];
}
- this.registerComponent('Curly', 'sample-component', '{{first}} - {{second}}', SampleComponent);
+ this.registerComponent(
+ 'Curly',
+ 'sample-component',
+ '{{this.first}} - {{this.second}}',
+ SampleComponent
+ );
this.render(
stripTight`
@@ -892,11 +908,11 @@ class CurlyPositionalArgsTest extends CurlyTest {
this.registerComponent(
'Curly',
'sample-component',
- '{{#each attrs.n key="@index" as |name|}}{{name}}{{/each}}',
+ '{{#each this.attrs.n key="@index" as |name|}}{{name}}{{/each}}',
SampleComponent
);
- this.render('{{sample-component user1 user2}}', {
+ this.render('{{sample-component this.user1 this.user2}}', {
user1: 'Foo',
user2: 4,
});
@@ -926,11 +942,11 @@ class CurlyPositionalArgsTest extends CurlyTest {
this.registerComponent(
'Curly',
'sample-component',
- `{{attrs.name}}{{attrs.age}}`,
+ `{{this.attrs.name}}{{this.attrs.age}}`,
SampleComponent
);
- this.render(`{{component "sample-component" myName myAge}}`, {
+ this.render(`{{component "sample-component" this.myName this.myAge}}`, {
myName: 'Quint',
myAge: 4,
});
@@ -959,7 +975,7 @@ class CurlyClosureComponentsTest extends CurlyTest {
@test
'component helper can handle aliased block components with args'() {
this.registerHelper('hash', (_positional, named) => named);
- this.registerComponent('Curly', 'foo-bar', 'Hello {{arg1}} {{yield}}');
+ this.registerComponent('Curly', 'foo-bar', 'Hello {{this.arg1}} {{yield}}');
this.render(
stripTight`
@@ -991,7 +1007,7 @@ class CurlyClosureComponentsTest extends CurlyTest {
@test
'component helper can handle aliased inline components with args'() {
this.registerHelper('hash', (_positional, named) => named);
- this.registerComponent('Curly', 'foo-bar', 'Hello {{arg1}}');
+ this.registerComponent('Curly', 'foo-bar', 'Hello {{this.arg1}}');
this.render(
stripTight`
@@ -1024,7 +1040,7 @@ class CurlyClosureComponentsTest extends CurlyTest {
'component helper can handle higher order inline components with args'() {
this.registerHelper('hash', (_positional, named) => named);
this.registerComponent('Curly', 'foo-bar', '{{yield (hash comp=(component "baz-bar"))}}');
- this.registerComponent('Curly', 'baz-bar', 'Hello {{arg1}}');
+ this.registerComponent('Curly', 'baz-bar', 'Hello {{this.arg1}}');
this.render(
stripTight`
@@ -1062,7 +1078,7 @@ class CurlyClosureComponentsTest extends CurlyTest {
'component helper can handle higher order block components with args'() {
this.registerHelper('hash', (_positional, named) => named);
this.registerComponent('Curly', 'foo-bar', '{{yield (hash comp=(component "baz-bar"))}}');
- this.registerComponent('Curly', 'baz-bar', 'Hello {{arg1}} {{yield}}');
+ this.registerComponent('Curly', 'baz-bar', 'Hello {{this.arg1}} {{yield}}');
this.render(
stripTight`
@@ -1081,7 +1097,7 @@ class CurlyClosureComponentsTest extends CurlyTest {
'component helper can handle higher order block components without args'() {
this.registerHelper('hash', (_positional, named) => named);
this.registerComponent('Curly', 'foo-bar', '{{yield (hash comp=(component "baz-bar"))}}');
- this.registerComponent('Curly', 'baz-bar', 'Hello {{arg1}} {{yield}}');
+ this.registerComponent('Curly', 'baz-bar', 'Hello {{this.arg1}} {{yield}}');
this.render(
stripTight`
@@ -1141,21 +1157,21 @@ class CurlyClosureComponentsTest extends CurlyTest {
'Curly',
'foo-bar',
stripTight`
- 1. [{{one}}]
- 2. [{{two}}]
- 3. [{{three}}]
- 4. [{{four}}]
- 5. [{{five}}]
- 6. [{{six}}]
+ 1. [{{this.one}}]
+ 2. [{{this.two}}]
+ 3. [{{this.three}}]
+ 4. [{{this.four}}]
+ 5. [{{this.five}}]
+ 6. [{{this.six}}]
{{yield}}
- a. [{{a}}]
- b. [{{b}}]
- c. [{{c}}]
- d. [{{d}}]
- e. [{{e}}]
- f. [{{f}}]
+ a. [{{this.a}}]
+ b. [{{this.b}}]
+ c. [{{this.c}}]
+ d. [{{this.d}}]
+ e. [{{this.e}}]
+ f. [{{this.f}}]
`,
FooBarComponent
);
@@ -1201,19 +1217,19 @@ class CurlyClosureComponentsTest extends CurlyTest {
'Curly',
'foo-bar',
stripTight`
- 1. [{{one}}]
- 2. [{{two}}]
- 3. [{{three}}]
- 4. [{{four}}]
- 5. [{{five}}]
- 6. [{{six}}]
+ 1. [{{this.one}}]
+ 2. [{{this.two}}]
+ 3. [{{this.three}}]
+ 4. [{{this.four}}]
+ 5. [{{this.five}}]
+ 6. [{{this.six}}]
`,
FooBarComponent
);
this.render(
stripTight`
- {{component (component (component 'foo-bar' foo.first foo.second) 'inner 1') 'invocation 1' 'invocation 2'}}
+ {{component (component (component 'foo-bar' this.foo.first this.foo.second) 'inner 1') 'invocation 1' 'invocation 2'}}
`,
{
foo: {
@@ -1331,7 +1347,7 @@ class CurlyGlimmerComponentTest extends CurlyTest {
'In layout '
);
- this.render(' ', { stability: 'stability' });
+ this.render(' ', { stability: 'stability' });
this.assertHTML('In layout ');
this.rerender({
@@ -1376,7 +1392,7 @@ class CurlyGlimmerComponentTest extends CurlyTest {
inspectHooks((NonBlock as unknown) as EmberishCurlyComponentFactory)
);
- this.render('{{non-block someProp=someProp}}', { someProp: 'wycats' });
+ this.render('{{non-block someProp=this.someProp}}', { someProp: 'wycats' });
assert.ok(instance, 'instance is created');
@@ -1425,11 +1441,11 @@ class CurlyGlimmerComponentTest extends CurlyTest {
this.registerComponent(
'Curly',
'non-block',
- 'In layout - someProp: {{someProp}}',
+ 'In layout - someProp: {{this.someProp}}',
inspectHooks(NonBlock as any)
);
- this.render('{{non-block someProp=someProp}}', { someProp: 'wycats' });
+ this.render('{{non-block someProp=this.someProp}}', { someProp: 'wycats' });
assert.ok(instance, 'instance is created');
@@ -1484,7 +1500,7 @@ class CurlyGlimmerComponentTest extends CurlyTest {
inspectHooks(InputComponent as any)
);
- this.render('{{input-component value=someProp}}', { someProp: null });
+ this.render('{{input-component value=this.someProp}}', { someProp: null });
assert.ok(instance, 'instance is created');
@@ -1522,7 +1538,7 @@ class CurlyGlimmerComponentTest extends CurlyTest {
this.registerComponent('Curly', 'foo-bar', 'FOO BAR', FooBarComponent);
- this.render('{{foo-bar class=classes}}', { classes: 'foo bar' });
+ this.render('{{foo-bar class=this.classes}}', { classes: 'foo bar' });
assert.ok(instance, 'instance is created');
@@ -1659,7 +1675,7 @@ class CurlyTeardownTest extends CurlyTest {
this.registerComponent('Curly', 'destroy-me', 'destroy me!', DestroyMeComponent);
- this.render(`{{#if cond}}{{destroy-me}}{{/if}}`, { cond: true });
+ this.render(`{{#if this.cond}}{{destroy-me}}{{/if}}`, { cond: true });
assert.strictEqual(willDestroy, 0, 'destroy should not be called');
assert.strictEqual(destroyed, 0, 'destroy should not be called');
@@ -1688,7 +1704,7 @@ class CurlyTeardownTest extends CurlyTest {
DestroyMeComponent
);
- this.render(`{{#if cond}} {{/if}}`, { cond: true });
+ this.render(`{{#if this.cond}} {{/if}}`, { cond: true });
assert.strictEqual(destroyed, 0, 'destroy should not be called');
@@ -1714,7 +1730,7 @@ class CurlyTeardownTest extends CurlyTest {
this.registerComponent('Curly', 'another-component', 'another thing!', AnotherComponent);
- this.render(`{{component componentName}}`, { componentName: 'destroy-me' });
+ this.render(`{{component this.componentName}}`, { componentName: 'destroy-me' });
assert.strictEqual(destroyed, 0, 'destroy should not be called');
@@ -1736,7 +1752,7 @@ class CurlyTeardownTest extends CurlyTest {
this.registerComponent('Curly', 'DestroyMe', 'destroy me!
', DestroyMeComponent);
- this.render(`{{#each list as |item|}} {{/each}}`, {
+ this.render(`{{#each this.list as |item|}} {{/each}}`, {
list: [1, 2, 3, 4, 5],
});
@@ -1774,9 +1790,12 @@ class CurlyTeardownTest extends CurlyTest {
let val4 = { val: 4 };
let val5 = { val: 5 };
- this.render(`{{#each list key='@identity' as |item|}} {{/each}}`, {
- list: [val1, val2, val3, val4, val5],
- });
+ this.render(
+ `{{#each this.list key='@identity' as |item|}} {{/each}}`,
+ {
+ list: [val1, val2, val3, val4, val5],
+ }
+ );
assert.strictEqual(destroyed.length, 0, 'destroy should not be called');
@@ -1823,7 +1842,7 @@ class CurlyTeardownTest extends CurlyTest {
);
this.registerComponent('Curly', 'destroy-me-inner', 'inner', DestroyMe2Component);
- this.render(`{{#if cond}}{{destroy-me from="root" cond=child.cond}}{{/if}}`, {
+ this.render(`{{#if this.cond}}{{destroy-me from="root" cond=this.child.cond}}{{/if}}`, {
cond: true,
child: { cond: true },
});
@@ -1866,7 +1885,7 @@ class CurlyTeardownTest extends CurlyTest {
this.registerComponent('Curly', 'destroy-me2', 'Destroy me! {{yield}}', DestroyMe2Component);
this.render(
- `{{#each list key='@identity' as |item|}}{{#destroy-me2 from="root" item=item}}{{/destroy-me2}} {{/each}}`,
+ `{{#each this.list key='@identity' as |item|}}{{#destroy-me2 from="root" item=item}}{{/destroy-me2}} {{/each}}`,
{ list: [1, 2, 3, 4, 5] }
);
@@ -2010,7 +2029,7 @@ class CurlyAppendableTest extends CurlyTest {
let definition = this.delegate.createCurriedComponent('foo-bar');
- this.render('{{foo}}', { foo: definition });
+ this.render('{{this.foo}}', { foo: definition });
this.assertEmberishElement('div', {}, 'foo bar');
this.assertStableRerender();
@@ -2027,7 +2046,7 @@ class CurlyAppendableTest extends CurlyTest {
let definition = this.delegate.createCurriedComponent('foo-bar');
- this.render('{{foo.bar}}', { foo: { bar: definition } });
+ this.render('{{this.foo.bar}}', { foo: { bar: definition } });
this.assertEmberishElement('div', {}, 'foo bar');
this.assertStableRerender();
@@ -2069,7 +2088,7 @@ class CurlyAppendableTest extends CurlyTest {
let definition = this.delegate.createCurriedComponent('foo-bar');
- this.render('{{foo.bar}}', { foo: { bar: 'lol' } });
+ this.render('{{this.foo.bar}}', { foo: { bar: 'lol' } });
this.assertHTML('lol');
this.assertStableRerender();
diff --git a/packages/@glimmer/integration-tests/test/helpers/array-test.ts b/packages/@glimmer/integration-tests/test/helpers/array-test.ts
index cace123e08..3889cae574 100644
--- a/packages/@glimmer/integration-tests/test/helpers/array-test.ts
+++ b/packages/@glimmer/integration-tests/test/helpers/array-test.ts
@@ -34,7 +34,7 @@ class ArrayTest extends RenderTest {
@test
'binds values when variables are used'() {
this.render(
- strip`{{#with (array personOne) as |people|}}
+ strip`{{#with (array this.personOne) as |people|}}
{{#each people as |personName|}}
{{personName}}
{{/each}}
@@ -58,7 +58,7 @@ class ArrayTest extends RenderTest {
@test
'binds multiple values when variables are used'() {
this.render(
- strip`{{#with (array personOne personTwo) as |people|}}
+ strip`{{#with (array this.personOne this.personTwo) as |people|}}
{{#each people as |personName|}}
{{personName}},
{{/each}}
@@ -89,7 +89,7 @@ class ArrayTest extends RenderTest {
'array helpers can be nested'() {
this.render(
strip`
- {{#let (array (array personOne personTwo)) as |listOfPeople|}}
+ {{#let (array (array this.personOne this.personTwo)) as |listOfPeople|}}
{{#each listOfPeople as |people|}}
List:
{{#each people as |personName|}}
@@ -226,7 +226,7 @@ class ArrayTest extends RenderTest {
`
);
- this.render(strip` `, { personTwo: 'Chad' });
+ this.render(strip` `, { personTwo: 'Chad' });
this.assertHTML('Tom,Chad,');
@@ -265,7 +265,7 @@ class ArrayTest extends RenderTest {
FooBar
);
- this.render(strip` `, { personTwo: 'Chad' });
+ this.render(strip` `, { personTwo: 'Chad' });
let firstArray = fooBarInstance!.args.people;
@@ -286,7 +286,7 @@ class ArrayTest extends RenderTest {
return 'captured';
});
- this.render(`{{capture (array 'Tom' personTwo)}}`, { personTwo: 'Godfrey' });
+ this.render(`{{capture (array 'Tom' this.personTwo)}}`, { personTwo: 'Godfrey' });
this.assert.deepEqual(captured, ['Tom', 'Godfrey']);
diff --git a/packages/@glimmer/integration-tests/test/helpers/get-test.ts b/packages/@glimmer/integration-tests/test/helpers/get-test.ts
index 7878fc9aa8..ac2620c50c 100644
--- a/packages/@glimmer/integration-tests/test/helpers/get-test.ts
+++ b/packages/@glimmer/integration-tests/test/helpers/get-test.ts
@@ -4,7 +4,7 @@ class GetTest extends RenderTest {
static suiteName = 'Helpers test: {{get}}';
@test
'should be able to get an object value with a static key'() {
- this.render(`[{{get colors 'apple'}}] [{{if true (get colors 'apple')}}]`, {
+ this.render(`[{{get this.colors 'apple'}}] [{{if true (get this.colors 'apple')}}]`, {
colors: { apple: 'red' },
});
@@ -20,7 +20,7 @@ class GetTest extends RenderTest {
@test
'should be able to get an object value with nested static key'() {
- this.render(`[{{get colors "apple.gala"}}] [{{if true (get colors "apple.gala")}}]`, {
+ this.render(`[{{get this.colors "apple.gala"}}] [{{if true (get this.colors "apple.gala")}}]`, {
colors: {
apple: {
gala: 'red and yellow',
@@ -52,7 +52,7 @@ class GetTest extends RenderTest {
@test
'should be able to get an object value with a number'() {
- this.render(`[{{get items 1}}][{{get items 2}}][{{get items 3}}]`, {
+ this.render(`[{{get this.items 1}}][{{get this.items 2}}][{{get this.items 3}}]`, {
items: {
1: 'First',
2: 'Second',
@@ -72,7 +72,7 @@ class GetTest extends RenderTest {
@test
'should be able to get an array value with a number'() {
- this.render(`[{{get numbers 0}}][{{get numbers 1}}][{{get numbers 2}}]`, {
+ this.render(`[{{get this.numbers 0}}][{{get this.numbers 1}}][{{get this.numbers 2}}]`, {
numbers: [1, 2, 3],
});
@@ -88,7 +88,7 @@ class GetTest extends RenderTest {
@test
'should be able to get an object value with a path evaluating to a number'() {
- this.render(`{{#each indexes as |index|}}[{{get items index}}]{{/each}}`, {
+ this.render(`{{#each this.indexes as |index|}}[{{get this.items index}}]{{/each}}`, {
indexes: [1, 2, 3],
items: {
1: 'First',
@@ -109,7 +109,7 @@ class GetTest extends RenderTest {
@test
'should be able to get an array value with a path evaluating to a number'() {
- this.render(`{{#each numbers as |num index|}}[{{get numbers index}}]{{/each}}`, {
+ this.render(`{{#each this.numbers as |num index|}}[{{get this.numbers index}}]{{/each}}`, {
numbers: [1, 2, 3],
});
@@ -122,7 +122,7 @@ class GetTest extends RenderTest {
@test
'should be able to get an object value with a bound/dynamic key'() {
- this.render(`[{{get colors key}}] [{{if true (get colors key)}}]`, {
+ this.render(`[{{get this.colors this.key}}] [{{if true (get this.colors this.key)}}]`, {
colors: { apple: 'red', banana: 'yellow' },
key: 'apple',
});
@@ -142,7 +142,7 @@ class GetTest extends RenderTest {
@test
'should be able to get an object value with nested dynamic key'() {
- this.render(`[{{get colors key}}] [{{if true (get colors key)}}]`, {
+ this.render(`[{{get this.colors this.key}}] [{{if true (get this.colors this.key)}}]`, {
colors: {
apple: {
gala: 'red and yellow',
@@ -169,7 +169,7 @@ class GetTest extends RenderTest {
@test
'should be able to get an object value with subexpression returning nested key'() {
this.render(
- `[{{get colors (concat 'apple' '.' 'gala')}}] [{{if true (get colors (concat 'apple' '.' 'gala'))}}]`,
+ `[{{get this.colors (concat 'apple' '.' 'gala')}}] [{{if true (get this.colors (concat 'apple' '.' 'gala'))}}]`,
{
colors: {
apple: {
@@ -206,7 +206,7 @@ class GetTest extends RenderTest {
@test
'should be able to get an object value with a get helper as the key'() {
this.render(
- `[{{get colors (get possibleKeys key)}}] [{{if true (get colors (get possibleKeys key))}}]`,
+ `[{{get this.colors (get this.possibleKeys this.key)}}] [{{if true (get this.colors (get this.possibleKeys this.key))}}]`,
{
colors: { apple: 'red', banana: 'yellow' },
key: 'key1',
@@ -233,7 +233,7 @@ class GetTest extends RenderTest {
@test
'should be able to get an object value with a get helper value as a bound/dynamic key'() {
this.render(
- `[{{get (get possibleValues objectKey) key}}] [{{if true (get (get possibleValues objectKey) key)}}]`,
+ `[{{get (get this.possibleValues this.objectKey) this.key}}] [{{if true (get (get this.possibleValues this.objectKey) this.key)}}]`,
{
possibleValues: {
colors1: { apple: 'red', banana: 'yellow' },
@@ -266,7 +266,7 @@ class GetTest extends RenderTest {
@test
'should be able to get an object value with a get helper as the value and a get helper as the key'() {
this.render(
- `[{{get (get possibleValues objectKey) (get possibleKeys key)}}] [{{if true (get (get possibleValues objectKey) (get possibleKeys key))}}]`,
+ `[{{get (get this.possibleValues this.objectKey) (get this.possibleKeys this.key)}}] [{{if true (get (get this.possibleValues this.objectKey) (get this.possibleKeys this.key))}}]`,
{
possibleValues: {
colors1: { apple: 'red', banana: 'yellow' },
@@ -335,7 +335,7 @@ class GetTest extends RenderTest {
@test
'should handle object values as nulls'() {
- this.render(`[{{get colors 'apple'}}] [{{if true (get colors 'apple')}}]`, {
+ this.render(`[{{get this.colors 'apple'}}] [{{if true (get this.colors 'apple')}}]`, {
colors: null,
});
@@ -354,7 +354,7 @@ class GetTest extends RenderTest {
@test
'should handle object keys as nulls'() {
- this.render(`[{{get colors key}}] [{{if true (get colors key)}}]`, {
+ this.render(`[{{get this.colors this.key}}] [{{if true (get this.colors this.key)}}]`, {
colors: {
apple: 'red',
banana: 'yellow',
@@ -374,7 +374,7 @@ class GetTest extends RenderTest {
@test
'should handle object values and keys as nulls'() {
- this.render(`[{{get colors 'apple'}}] [{{if true (get colors key)}}]`, {
+ this.render(`[{{get this.colors 'apple'}}] [{{if true (get this.colors this.key)}}]`, {
colors: null,
key: null,
});
@@ -395,7 +395,7 @@ class GetTest extends RenderTest {
PersonComponent
);
- this.render(' ', {
+ this.render(' ', {
first: 'miguel',
last: 'andrade',
});
diff --git a/packages/@glimmer/integration-tests/test/initial-render-test.ts b/packages/@glimmer/integration-tests/test/initial-render-test.ts
index 597e3270d5..585b51e60d 100644
--- a/packages/@glimmer/integration-tests/test/initial-render-test.ts
+++ b/packages/@glimmer/integration-tests/test/initial-render-test.ts
@@ -102,7 +102,7 @@ class Rehydration extends AbstractRehydrationTests {
@test
'handles non-empty trusted content (triple-curlies)'() {
- let template = '{{{value}}}
';
+ let template = '{{{this.value}}}
';
let obj: { value: string } = { value: 'foo' };
this.renderServerSide(template, obj);
this.renderClientSide(template, obj);
@@ -111,7 +111,7 @@ class Rehydration extends AbstractRehydrationTests {
@test
'handles empty trusted content (triple-curlies)'() {
- let template = '{{{value}}}
';
+ let template = '{{{this.value}}}
';
let obj: { value: string } = { value: '' };
this.renderServerSide(template, obj);
this.renderClientSide(template, obj);
@@ -120,7 +120,7 @@ class Rehydration extends AbstractRehydrationTests {
@test
'handles empty trusted content (html safe string)'() {
- let template = '{{value}}
';
+ let template = '{{this.value}}
';
let safeString: SafeString = {
toHTML() {
@@ -169,7 +169,7 @@ class Rehydration extends AbstractRehydrationTests {
@test
'mismatched text nodes'() {
- let template = '{{content}}';
+ let template = '{{this.content}}';
this.renderServerSide(template, { content: 'hello' });
this.assertServerOutput(OPEN, 'hello', CLOSE);
@@ -182,7 +182,7 @@ class Rehydration extends AbstractRehydrationTests {
@test
'mismatched text nodes (server-render empty)'() {
- let template = '{{content}} world';
+ let template = '{{this.content}} world';
this.renderServerSide(template, { content: '' });
this.assertServerOutput(OPEN, EMPTY, CLOSE, ' world');
@@ -198,7 +198,7 @@ class Rehydration extends AbstractRehydrationTests {
@test
'missing closing block within multiple text nodes'() {
- let template = 'a {{b}}{{c}}{{d}}
';
+ let template = 'a {{this.b}}{{this.c}}{{this.d}}
';
let context = { b: '', c: '', d: '' };
this.renderServerSide(template, context);
@@ -227,9 +227,9 @@ class Rehydration extends AbstractRehydrationTests {
'resumes correct block after reenabling rehydration'() {
let template = strip`
- {{#if a}}
- {{#if b}}
- {{#if c}}
+ {{#if this.a}}
+ {{#if this.b}}
+ {{#if this.c}}
{{/if}}
@@ -259,7 +259,7 @@ class Rehydration extends AbstractRehydrationTests {
@test
'mismatched elements'() {
- let template = '{{#if admin}}
hi admin
{{else}}
HAXOR
{{/if}}';
+ let template = '{{#if this.admin}}
hi admin
{{else}}
HAXOR
{{/if}}';
this.renderServerSide(template, { admin: true });
this.assertServerOutput(OPEN, '
hi admin
', CLOSE);
@@ -307,7 +307,8 @@ class Rehydration extends AbstractRehydrationTests {
@test
'extra nodes at the end'() {
- let template = '{{#if admin}}
hi admin
{{else}}
HAXOR{{stopHaxing}}
{{/if}}';
+ let template =
+ '{{#if this.admin}}
hi admin
{{else}}
HAXOR{{this.stopHaxing}}
{{/if}}';
this.renderServerSide(template, { admin: false, stopHaxing: 'stahp' });
this.assertServerOutput(OPEN, '
HAXOR', OPEN, 'stahp', CLOSE, '
', CLOSE);
@@ -394,7 +395,7 @@ class Rehydration extends AbstractRehydrationTests {
@test
'Node curlies'() {
- let template = '
{{node}}
';
+ let template = '
{{this.node}}
';
let doc = this.delegate.serverDoc;
let node = doc.createTextNode('hello');
@@ -423,7 +424,7 @@ class Rehydration extends AbstractRehydrationTests {
'in-element can rehydrate'() {
let template = strip`
- {{#in-element remote}}Wat Wat {{/in-element}}
+ {{#in-element this.remote}}Wat Wat {{/in-element}}
`;
let doc = this.delegate.serverDoc;
@@ -462,7 +463,7 @@ class Rehydration extends AbstractRehydrationTests {
'in-element with insertBefore=null can rehydrate'() {
let template = strip`
- {{#in-element remote insertBefore=null}}Wat Wat {{/in-element}}
+ {{#in-element this.remote insertBefore=null}}Wat Wat {{/in-element}}
`;
let doc = this.delegate.serverDoc;
@@ -504,7 +505,7 @@ class Rehydration extends AbstractRehydrationTests {
'in-element with insertBefore=element can rehydrate'() {
let template = strip`
- {{#in-element remote insertBefore=prefix}}Wat Wat {{/in-element}}
+ {{#in-element this.remote insertBefore=this.prefix}}Wat Wat {{/in-element}}
`;
let doc = this.delegate.serverDoc;
@@ -549,7 +550,7 @@ class Rehydration extends AbstractRehydrationTests {
'in-element can rehydrate into pre-existing content'() {
let template = strip`
- {{#in-element remote insertBefore=undefined}}Wat Wat {{/in-element}}
+ {{#in-element this.remote insertBefore=undefined}}Wat Wat {{/in-element}}
`;
let doc = this.delegate.serverDoc;
@@ -575,7 +576,7 @@ class Rehydration extends AbstractRehydrationTests {
'in-element with insertBefore=null can rehydrate into pre-existing content'() {
let template = strip`
- {{#in-element remote insertBefore=null}}Wat Wat {{/in-element}}
+ {{#in-element this.remote insertBefore=null}}Wat Wat {{/in-element}}
`;
let doc = this.delegate.serverDoc;
@@ -606,7 +607,7 @@ class Rehydration extends AbstractRehydrationTests {
'in-element with insertBefore=element can rehydrate into pre-existing content'() {
let template = strip`
- {{#in-element remote insertBefore=preexisting}}Wat Wat {{/in-element}}
+ {{#in-element this.remote insertBefore=this.preexisting}}Wat Wat {{/in-element}}
`;
let doc = this.delegate.serverDoc;
@@ -644,8 +645,8 @@ class Rehydration extends AbstractRehydrationTests {
'nested in-element can rehydrate'() {
let template = strip`
- {{#in-element remoteParent}}
- {{#in-element remoteChild}}Wat Wat{{/in-element}}
+ {{#in-element this.remoteParent}}
+ {{#in-element this.remoteChild}}Wat Wat{{/in-element}}
{{/in-element}}
`;
@@ -697,7 +698,7 @@ class Rehydration extends AbstractRehydrationTests {
@test
'svg elements'() {
- let template = '
{{#if isTrue}} {{/if}} Hello
';
+ let template = '
{{#if this.isTrue}} {{/if}} Hello
';
this.renderServerSide(template, { isTrue: true });
let b = blockStack();
this.assertHTML(strip`
@@ -723,7 +724,8 @@ class Rehydration extends AbstractRehydrationTests {
@test
'title tag'() {
- let template = '
{{pageTitle}} some {{{other}}}{{thing}} hey! ';
+ let template =
+ '
{{this.pageTitle}} some {{{this.other}}}{{this.thing}} hey! ';
this.renderServerSide(template, { pageTitle: 'kiwi', other: 'other', thing: 'thing' });
let b = blockStack();
this.assertHTML(strip`
@@ -746,8 +748,8 @@ class Rehydration extends AbstractRehydrationTests {
@test
'script tag'() {
let template = strip`
-
-
+
+
`;
this.renderServerSide(template, { data: '{ "status": "ok" }', otherData: '{ "code": 200 }' });
let b = blockStack();
@@ -778,7 +780,7 @@ class Rehydration extends AbstractRehydrationTests {
@test
'style tag'() {
- let template = '';
+ let template = '';
this.renderServerSide(template, { selector: 'div' });
let b = blockStack();
this.assertHTML(strip`
@@ -801,8 +803,8 @@ class Rehydration extends AbstractRehydrationTests {
@test
'clearing bounds'() {
let template = strip`
- {{#if isTrue}}
- {{#each items key="id" as |item i|}}
+ {{#if this.isTrue}}
+ {{#each this.items key="id" as |item i|}}
{{item}}-{{i}}
{{/each}}
{{/if}}
@@ -853,16 +855,16 @@ class Rehydration extends AbstractRehydrationTests {
'top-level clearing bounds'() {
let template = strip`
- {{#if isTrue}}
+ {{#if this.isTrue}}
- {{#each items key="id" as |item i|}}
+ {{#each this.items key="id" as |item i|}}
{{item}}-{{i}}
{{/each}}
{{/if}}
- {{#if isFalse}}
- {{#each items key="id" as |item i|}}
+ {{#if this.isFalse}}
+ {{#each this.items key="id" as |item i|}}
{{item}}-{{i}}
{{/each}}
{{/if}}
@@ -918,7 +920,7 @@ class Rehydration extends AbstractRehydrationTests {
@test
'#each rehydration'() {
- let template = "{{#each items key='id' as |item|}}
{{item}}
{{/each}}";
+ let template = "{{#each this.items key='id' as |item|}}
{{item}}
{{/each}}";
this.renderServerSide(template, { items: [1, 2, 3] });
let b = blockStack();
this.assertHTML(strip`
@@ -997,7 +999,7 @@ class RehydratingComponents extends AbstractRehydrationTests {
@test
'Component invocations'() {
let layout = 'Hello {{@name}}';
- let args = { name: 'name' };
+ let args = { name: 'this.name' };
this.renderServerSide(
{
layout,
@@ -1024,7 +1026,7 @@ class RehydratingComponents extends AbstractRehydrationTests {
@test
'Mismatched Component invocations'() {
let layout = 'Hello {{@name}}';
- let args = { name: 'name' };
+ let args = { name: 'this.name' };
this.renderServerSide(
{
layout,
@@ -1052,7 +1054,7 @@ class RehydratingComponents extends AbstractRehydrationTests {
'
invoking a block which emits a
'() {
let componentToRender = {
layout: '
hello {{#if @show}}
world!
{{/if}}',
- args: { show: 'show' },
+ args: { show: 'this.show' },
};
this.renderServerSide(componentToRender, { show: true });
@@ -1078,9 +1080,9 @@ class RehydratingComponents extends AbstractRehydrationTests {
@test
'Component invocations with block params'() {
let layout = 'Hello {{yield @name}}';
- let template = '{{name}}';
+ let template = '{{this.name}}';
let blockParams = ['name'];
- let args = { name: 'name' };
+ let args = { name: 'this.name' };
this.renderServerSide(
{
@@ -1112,9 +1114,9 @@ class RehydratingComponents extends AbstractRehydrationTests {
@test
'Mismatched Component invocations with block params'() {
let layout = 'Hello {{yield @name}}';
- let template = '{{name}}';
+ let template = '{{this.name}}';
let blockParams = ['name'];
- let args = { name: 'name' };
+ let args = { name: 'this.name' };
this.renderServerSide(
{
@@ -1309,7 +1311,7 @@ class RehydratingComponents extends AbstractRehydrationTests {
let template = '{{#if (even i)}}
{{/if}}';
this.registerComponent('TemplateOnly', 'FooBar', '
{{@count}} ');
let blockParams = ['i'];
- let args = { items: 'items' };
+ let args = { items: 'this.items' };
this.renderServerSide(
{
@@ -1409,7 +1411,7 @@ class RehydratingComponents extends AbstractRehydrationTests {
let template = '{{#if (even i)}}
{{/if}}';
this.registerComponent('TemplateOnly', 'FooBar', '
{{@count}} ');
let blockParams = ['i'];
- let args = { items: 'items' };
+ let args = { items: 'this.items' };
this.renderServerSide(
{
@@ -1518,7 +1520,7 @@ class RehydratingComponents extends AbstractRehydrationTests {
let template = '{{#if (even i)}}
{{/if}}';
this.registerComponent('TemplateOnly', 'FooBar', '
{{@count}} ');
let blockParams = ['i'];
- let args = { items: 'items', things: 'things' };
+ let args = { items: 'this.items', things: 'this.things' };
this.renderServerSide(
{
diff --git a/packages/@glimmer/integration-tests/test/input-range-test.ts b/packages/@glimmer/integration-tests/test/input-range-test.ts
index 46bfc135a0..9dbfbf662b 100644
--- a/packages/@glimmer/integration-tests/test/input-range-test.ts
+++ b/packages/@glimmer/integration-tests/test/input-range-test.ts
@@ -63,9 +63,9 @@ class TemplateRangeTests extends RangeTests {
jitSuite(
class extends TemplateRangeTests {
- static suiteName = `[emberjs/ember.js#15675] Template
`;
+ static suiteName = `[emberjs/ember.js#15675] Template
`;
- attrs = 'type="range" value={{value}} min={{min}} max={{max}}';
+ attrs = 'type="range" value={{this.value}} min={{this.min}} max={{this.max}}';
}
);
@@ -88,7 +88,7 @@ jitSuite(
renderRange(value: number): void {
this.registerComponent('Curly', 'range-input', '', this.component());
- this.render(`{{range-input max=max min=min value=value}}`, {
+ this.render(`{{range-input max=this.max min=this.min value=this.value}}`, {
max: this.max,
min: this.min,
value,
diff --git a/packages/@glimmer/integration-tests/test/invocation-generation-test.ts b/packages/@glimmer/integration-tests/test/invocation-generation-test.ts
index 7ae9cc0b46..3ebfd8b353 100644
--- a/packages/@glimmer/integration-tests/test/invocation-generation-test.ts
+++ b/packages/@glimmer/integration-tests/test/invocation-generation-test.ts
@@ -205,7 +205,7 @@ module(
layout: 'Hello',
});
- assert.equal(invocation, '{{component componentName}}');
+ assert.equal(invocation, '{{component this.componentName}}');
});
test('Can build dynamic invocation with template', (assert) => {
@@ -215,7 +215,7 @@ module(
template: 'World',
});
- assert.equal(invocation, '{{#component componentName}}World{{/component}}');
+ assert.equal(invocation, '{{#component this.componentName}}World{{/component}}');
});
test('Can build dynamic invocation with args', (assert) => {
@@ -228,7 +228,7 @@ module(
assert.equal(
invocation,
- '{{#component componentName foo=bar baz=1 bar=null}}World{{/component}}'
+ '{{#component this.componentName foo=bar baz=1 bar=null}}World{{/component}}'
);
});
@@ -243,7 +243,7 @@ module(
assert.equal(
invocation,
- `{{#component componentName foo=bar baz=1 bar=null data-foo="bar" id="wat"}}World{{/component}}`
+ `{{#component this.componentName foo=bar baz=1 bar=null data-foo="bar" id="wat"}}World{{/component}}`
);
});
@@ -259,7 +259,7 @@ module(
assert.equal(
invocation,
- `{{#component componentName foo=bar baz=1 bar=null data-foo="bar" id="wat" as |a b c|}}World{{/component}}`
+ `{{#component this.componentName foo=bar baz=1 bar=null data-foo="bar" id="wat" as |a b c|}}World{{/component}}`
);
});
@@ -276,7 +276,7 @@ module(
assert.equal(
invocation,
- `{{#component componentName foo=bar baz=1 bar=null data-foo="bar" id="wat" as |a b c|}}World{{else}}ELSE{{/component}}`
+ `{{#component this.componentName foo=bar baz=1 bar=null data-foo="bar" id="wat" as |a b c|}}World{{else}}ELSE{{/component}}`
);
});
diff --git a/packages/@glimmer/integration-tests/test/keywords/log-test.ts b/packages/@glimmer/integration-tests/test/keywords/log-test.ts
index 6c3af7db89..565e4c3f69 100644
--- a/packages/@glimmer/integration-tests/test/keywords/log-test.ts
+++ b/packages/@glimmer/integration-tests/test/keywords/log-test.ts
@@ -39,7 +39,7 @@ class LogTest extends RenderTest {
@test
['correctly logs a property']() {
- this.render(`{{log value}}`, {
+ this.render(`{{log this.value}}`, {
value: 'one',
});
@@ -48,7 +48,7 @@ class LogTest extends RenderTest {
@test
['correctly logs multiple arguments']() {
- this.render(`{{log "my variable:" value}}`, {
+ this.render(`{{log "my variable:" this.value}}`, {
value: 'one',
});
diff --git a/packages/@glimmer/integration-tests/test/modifiers-test.ts b/packages/@glimmer/integration-tests/test/modifiers-test.ts
index 770951f133..6c84179ee5 100644
--- a/packages/@glimmer/integration-tests/test/modifiers-test.ts
+++ b/packages/@glimmer/integration-tests/test/modifiers-test.ts
@@ -45,7 +45,7 @@ class ModifierTests extends RenderTest {
}
);
- this.render('{{#if ok}}
{{/if}}', {
+ this.render('{{#if this.ok}}
{{/if}}', {
bar: 'bar',
ok: true,
});
@@ -74,7 +74,7 @@ class ModifierTests extends RenderTest {
}
);
- this.render('{{#if ok}}
{{/if}}{{ok}}', {
+ this.render('{{#if this.ok}}
{{/if}}{{this.ok}}', {
ok: true,
data: 'ok',
});
@@ -342,7 +342,7 @@ class ModifierTests extends RenderTest {
this.registerModifier('bar', Bar);
this.registerModifier('foo', Foo);
- this.render('{{#if nuke}}
{{/if}}', { nuke: true });
+ this.render('{{#if this.nuke}}
{{/if}}', { nuke: true });
assert.deepEqual(destructionOrder, []);
this.rerender({ nuke: false });
assert.deepEqual(destructionOrder, ['foo', 'bar']);
@@ -388,7 +388,7 @@ class ModifierTests extends RenderTest {
this.registerModifier('bar', Bar);
this.registerModifier('foo', Foo);
- this.render('{{#if nuke}}
{{/if}}', { nuke: true });
+ this.render('{{#if this.nuke}}
{{/if}}', { nuke: true });
assert.deepEqual(destructionOrder, []);
this.rerender({ nuke: false });
assert.deepEqual(destructionOrder, ['bar', 'foo']);
@@ -448,9 +448,12 @@ class ModifierTests extends RenderTest {
this.registerModifier('foo', Foo);
this.registerModifier('baz', Baz);
- this.render('{{#if nuke}}
{{/if}}', {
- nuke: true,
- });
+ this.render(
+ '{{#if this.nuke}}
{{/if}}',
+ {
+ nuke: true,
+ }
+ );
assert.deepEqual(destructionOrder, []);
this.rerender({ nuke: false });
assert.deepEqual(destructionOrder, ['bar', 'baz', 'foo']);
@@ -469,7 +472,7 @@ class ModifierTests extends RenderTest {
}
}
this.registerModifier('foo', Foo);
- this.render('
', { bar: 'bar' });
+ this.render('
', { bar: 'bar' });
this.rerender({ bar: 'foo' });
}
@@ -486,7 +489,7 @@ class ModifierTests extends RenderTest {
}
}
this.registerModifier('foo', Foo);
- this.render('
', { bar: 'bar' });
+ this.render('
', { bar: 'bar' });
this.rerender({ bar: 'foo' });
}
@@ -505,7 +508,7 @@ class ModifierTests extends RenderTest {
}
}
this.registerModifier('foo', Foo);
- this.render('
', { bar: 'bar', baz: 'baz' });
+ this.render('
', { bar: 'bar', baz: 'baz' });
this.rerender({ bar: 'foo', baz: 'foo' });
}
}
diff --git a/packages/@glimmer/integration-tests/test/modifiers/on-test.ts b/packages/@glimmer/integration-tests/test/modifiers/on-test.ts
index a2aa7e50db..a7d012a988 100644
--- a/packages/@glimmer/integration-tests/test/modifiers/on-test.ts
+++ b/packages/@glimmer/integration-tests/test/modifiers/on-test.ts
@@ -202,7 +202,7 @@ if (hasDom) {
) {
let count = 0;
- this.render('
Click Me ', {
+ this.render('
Click Me ', {
callback() {
count++;
},
diff --git a/packages/@glimmer/integration-tests/test/partial-test.ts b/packages/@glimmer/integration-tests/test/partial-test.ts
index 737399a0c8..0e176f3387 100644
--- a/packages/@glimmer/integration-tests/test/partial-test.ts
+++ b/packages/@glimmer/integration-tests/test/partial-test.ts
@@ -49,7 +49,7 @@ class PartialTest extends RenderTest {
@test
'static partial with local reference'() {
this.registerPartial('test', `You {{quality.value}}`);
- this.render(`{{#each qualities key='id' as |quality|}}{{partial 'test'}}. {{/each}}`, {
+ this.render(`{{#each this.qualities key='id' as |quality|}}{{partial 'test'}}. {{/each}}`, {
qualities: [
{ id: 1, value: 'smaht' },
{ id: 2, value: 'loyal' },
@@ -72,7 +72,7 @@ class PartialTest extends RenderTest {
@test
'static partial with local reference (unknown)'() {
this.registerPartial('test', `You {{quality}}`);
- this.render(`{{#each qualities key='@index' as |quality|}}{{partial 'test'}}. {{/each}}`, {
+ this.render(`{{#each this.qualities key='@index' as |quality|}}{{partial 'test'}}. {{/each}}`, {
qualities: ['smaht', 'loyal'],
});
@@ -89,7 +89,7 @@ class PartialTest extends RenderTest {
this.registerComponent('Glimmer', 'FooBar', `
{{@foo}}-{{partial 'test'}}
`);
this.registerPartial('test', `{{@foo}}-{{@bar}}`);
- this.render(`
`, { foo: 'foo', bar: 'bar' });
+ this.render(`
`, { foo: 'foo', bar: 'bar' });
this.assertHTML(`
foo-foo-bar
`);
this.assertStableRerender();
@@ -340,7 +340,7 @@ class PartialTest extends RenderTest {
@test
'dynamic partial with static content'() {
this.registerPartial('test', `
Testing
`);
- this.render(`Before {{partial name}} After`, { name: 'test' });
+ this.render(`Before {{partial this.name}} After`, { name: 'test' });
this.assertHTML(`Before
Testing
After`);
this.rerender({ name: 'test' });
@@ -350,10 +350,10 @@ class PartialTest extends RenderTest {
@test
'nested dynamic partial with dynamic content'() {
- this.registerPartial('test', `
Testing {{wat}} {{partial nest}}
`);
- this.registerPartial('nested', `
Nested {{lol}}
`);
+ this.registerPartial('test', `
Testing {{this.wat}} {{partial this.nest}}
`);
+ this.registerPartial('nested', `
Nested {{this.lol}}
`);
- this.render(`Before {{partial name}} After`, {
+ this.render(`Before {{partial this.name}} After`, {
name: 'test',
nest: 'nested',
wat: 'wat are',
@@ -382,7 +382,7 @@ class PartialTest extends RenderTest {
);
this.render(
- `Hi {{person1}}. {{#with 'Sophie' as |person1|}}Hi {{person1}} (aged {{age}}), {{person2}}, {{person3}} and {{person4}}. {{partial 'person2-partial'}}{{/with}}`,
+ `Hi {{this.person1}}. {{#with 'Sophie' as |person1|}}Hi {{person1}} (aged {{this.age}}), {{this.person2}}, {{this.person3}} and {{this.person4}}. {{partial 'person2-partial'}}{{/with}}`,
{
person1: 'Context1',
person2: 'Context2',
@@ -436,7 +436,7 @@ class PartialTest extends RenderTest {
@test
'dynamic partial with falsy value does not render'() {
- this.render(`Before {{partial name}} After`, { name: false });
+ this.render(`Before {{partial this.name}} After`, { name: false });
this.assertHTML(`Before After`);
this.rerender({ name: false });
@@ -454,7 +454,7 @@ class PartialTest extends RenderTest {
@test
'dynamic partial that does not exist does not render'() {
assert.throws(() => {
- this.render(`Before {{partial name}} After`, { name: 'illuminati' });
+ this.render(`Before {{partial this.name}} After`, { name: 'illuminati' });
}, /Could not find a partial named "illuminati"/);
}
@@ -462,7 +462,7 @@ class PartialTest extends RenderTest {
'dynamic partial with can change from falsy to real template'() {
this.registerPartial('test', `
Testing
`);
- this.render(`Before {{partial name}} After`, { name: false });
+ this.render(`Before {{partial this.name}} After`, { name: false });
this.assertHTML(`Before After`);
this.rerender({ name: false });
@@ -490,7 +490,7 @@ class PartialTest extends RenderTest {
@test
'dynamic partial with self reference'() {
this.registerPartial('test', `I know {{item}}. I have the best {{item}}s.`);
- this.render(`{{partial name}}`, { name: 'test', item: 'partial' });
+ this.render(`{{partial this.name}}`, { name: 'test', item: 'partial' });
this.assertHTML(`I know partial. I have the best partials.`);
this.rerender({ name: 'test', item: 'partial' });
@@ -505,7 +505,7 @@ class PartialTest extends RenderTest {
'birdman',
`Respeck my {{item}}. When my {{item}} come up put some respeck on it.`
);
- this.render(`{{partial name}}`, { name: 'weezy', item: 'name' });
+ this.render(`{{partial this.name}}`, { name: 'weezy', item: 'name' });
this.assertHTML(`Ain't my birthday but I got my name on the cake.`);
this.rerender({ name: 'birdman', item: 'name' });
@@ -522,7 +522,7 @@ class PartialTest extends RenderTest {
'birdman',
`Respeck my {{item}}. When my {{item}} come up put some respeck on it.`
);
- this.render(`{{partial name}}`, { name: 'weezy', item: 'partial' });
+ this.render(`{{partial this.name}}`, { name: 'weezy', item: 'partial' });
this.assertHTML(`Ain't my birthday but I got my partial on the cake.`);
this.rerender({ name: 'birdman', item: 'name' });
@@ -539,7 +539,7 @@ class PartialTest extends RenderTest {
'birdman',
`Respeck my {{noun}}. When my {{noun}} come up put some respeck on it.`
);
- this.render(`{{partial name}}`, { name: 'weezy', item: 'partial' });
+ this.render(`{{partial this.name}}`, { name: 'weezy', item: 'partial' });
this.assertHTML(`Ain't my birthday but I got my partial on the cake.`);
this.rerender({ name: 'birdman', noun: 'name' });
@@ -552,7 +552,7 @@ class PartialTest extends RenderTest {
@test
'dynamic partial with local reference'() {
this.registerPartial('test', `You {{quality.value}}`);
- this.render(`{{#each qualities key='id' as |quality|}}{{partial name}}. {{/each}}`, {
+ this.render(`{{#each this.qualities key='id' as |quality|}}{{partial this.name}}. {{/each}}`, {
name: 'test',
qualities: [
{ id: 1, value: 'smaht' },
@@ -577,10 +577,13 @@ class PartialTest extends RenderTest {
@test
'dynamic partial with local reference (unknown)'() {
this.registerPartial('test', `You {{quality}}`);
- this.render(`{{#each qualities key='@index' as |quality|}}{{partial name}}. {{/each}}`, {
- name: 'test',
- qualities: ['smaht', 'loyal'],
- });
+ this.render(
+ `{{#each this.qualities key='@index' as |quality|}}{{partial this.name}}. {{/each}}`,
+ {
+ name: 'test',
+ qualities: ['smaht', 'loyal'],
+ }
+ );
this.assertStableRerender();
@@ -593,10 +596,13 @@ class PartialTest extends RenderTest {
@test
'partial with if statement on a simple local reference works as expected'() {
this.registerPartial('test', `{{#if quality}}You {{quality}}{{else}}No quality{{/if}}`);
- this.render(`{{#each qualities key='@index' as |quality|}}{{partial name}}. {{/each}}`, {
- name: 'test',
- qualities: ['smaht', 'loyal', undefined],
- });
+ this.render(
+ `{{#each this.qualities key='@index' as |quality|}}{{partial this.name}}. {{/each}}`,
+ {
+ name: 'test',
+ qualities: ['smaht', 'loyal', undefined],
+ }
+ );
this.assertStableRerender();
@@ -612,10 +618,13 @@ class PartialTest extends RenderTest {
'test',
`{{#if quality.name}}You {{quality.name}}{{else}}No quality{{/if}}`
);
- this.render(`{{#each qualities key='@index' as |quality|}}{{partial name}}. {{/each}}`, {
- name: 'test',
- qualities: [{ name: 'smaht' }, { name: 'loyal' }, { name: undefined }],
- });
+ this.render(
+ `{{#each this.qualities key='@index' as |quality|}}{{partial this.name}}. {{/each}}`,
+ {
+ name: 'test',
+ qualities: [{ name: 'smaht' }, { name: 'loyal' }, { name: undefined }],
+ }
+ );
this.assertStableRerender();
diff --git a/packages/@glimmer/integration-tests/test/style-warnings-test.ts b/packages/@glimmer/integration-tests/test/style-warnings-test.ts
index 01fe35a967..b2f4cc979b 100644
--- a/packages/@glimmer/integration-tests/test/style-warnings-test.ts
+++ b/packages/@glimmer/integration-tests/test/style-warnings-test.ts
@@ -32,7 +32,9 @@ class StyleWarningsTest extends RenderTest {
@test
'Standard element with dynamic style and element modifier gives you 1 warning'() {
this.registerModifier('foo', class {});
- this.render('
click me ', { dynAttr: 'display:flex' });
+ this.render('
click me ', {
+ dynAttr: 'display:flex',
+ });
assert.strictEqual(warnings, 1);
}
@@ -47,7 +49,9 @@ class StyleWarningsTest extends RenderTest {
@test
'triple curlies are trusted'() {
- this.render(`
Thing
`, { styles: 'background: red' });
+ this.render(`
Thing
`, {
+ styles: 'background: red',
+ });
assert.strictEqual(warnings, 0);
this.assertHTML('
Thing
', 'initial render');
diff --git a/packages/@glimmer/integration-tests/test/updating-content-matrix-test.ts b/packages/@glimmer/integration-tests/test/updating-content-matrix-test.ts
index 94ce843f70..61c1049862 100644
--- a/packages/@glimmer/integration-tests/test/updating-content-matrix-test.ts
+++ b/packages/@glimmer/integration-tests/test/updating-content-matrix-test.ts
@@ -175,7 +175,7 @@ function generateContentTestCase(
generateContentTestCase(ContentTest, {
name: 'double curlies',
- template: '{{value}}',
+ template: '{{this.value}}',
values: [
{
input: 'hello',
diff --git a/packages/@glimmer/integration-tests/test/updating-modifiers-test.ts b/packages/@glimmer/integration-tests/test/updating-modifiers-test.ts
index a3e1c94952..8282b1ad5d 100644
--- a/packages/@glimmer/integration-tests/test/updating-modifiers-test.ts
+++ b/packages/@glimmer/integration-tests/test/updating-modifiers-test.ts
@@ -30,7 +30,7 @@ class UpdatingModifiers extends RenderTest {
this.registerModifier('foo', makeSyncDataAttrModifier(hooks));
- this.render('
', {
+ this.render('
', {
bar: 'Super Metroid',
});
@@ -75,7 +75,7 @@ class UpdatingModifiers extends RenderTest {
this.registerModifier('foo', makeSyncDataAttrModifier(hooks));
- this.render('{{#if bar}}
{{else}}
{{/if}}', {
+ this.render('{{#if this.bar}}
{{else}}
{{/if}}', {
bar: true,
});
diff --git a/packages/@glimmer/integration-tests/test/updating-svg-test.ts b/packages/@glimmer/integration-tests/test/updating-svg-test.ts
index a3397bbfad..032a0a82be 100644
--- a/packages/@glimmer/integration-tests/test/updating-svg-test.ts
+++ b/packages/@glimmer/integration-tests/test/updating-svg-test.ts
@@ -52,7 +52,7 @@ class UpdatingSvgTest extends RenderTest {
}
};
- this.render('{{#if hasForeignObject}}
{{/if}}', {
+ this.render('{{#if this.hasForeignObject}}
{{/if}}', {
hasForeignObject: true,
});
@@ -187,7 +187,7 @@ class UpdatingSvgTest extends RenderTest {
@test
'unsafe expression nested inside a namespace'() {
- this.render('
{{{content}}}
', {
+ this.render('
{{{this.content}}}
', {
content: '
',
});
@@ -281,7 +281,7 @@ class UpdatingSvgTest extends RenderTest {
@test
'expression nested inside a namespace'() {
- this.render('
{{content}}
', {
+ this.render('
{{this.content}}
', {
content: 'Milly',
});
@@ -311,7 +311,7 @@ class UpdatingSvgTest extends RenderTest {
@test
'expression nested inside a namespaced context.root element'() {
- this.render('
{{content}} ', { content: 'Maurice' });
+ this.render('
{{this.content}} ', { content: 'Maurice' });
let assertSvg = (callback?: (svg: SVGSVGElement) => void) => {
if (assertNodeTagName(this.element.firstChild, 'svg')) {
@@ -338,7 +338,9 @@ class UpdatingSvgTest extends RenderTest {
@test
'HTML namespace is created in child templates'() {
- this.render('{{#if isTrue}}
{{else}}
{{/if}}', { isTrue: true });
+ this.render('{{#if this.isTrue}}
{{else}}
{{/if}}', {
+ isTrue: true,
+ });
let assertNamespaces = (isTrue: boolean) => {
if (isTrue) {
@@ -372,7 +374,7 @@ class UpdatingSvgTest extends RenderTest {
@test
'HTML namespace is continued to child templates'() {
- this.render('
{{#if isTrue}} {{/if}}
', { isTrue: true });
+ this.render('
{{#if this.isTrue}} {{/if}}
', { isTrue: true });
let assertNamespaces = (isTrue: boolean) => {
if (assertNodeTagName(this.element.firstChild, 'div')) {
diff --git a/packages/@glimmer/integration-tests/test/updating-test.ts b/packages/@glimmer/integration-tests/test/updating-test.ts
index 1abbcbf731..ad29c4e8dc 100644
--- a/packages/@glimmer/integration-tests/test/updating-test.ts
+++ b/packages/@glimmer/integration-tests/test/updating-test.ts
@@ -101,23 +101,23 @@ class UpdatingTest extends RenderTest {
this.render(
stripTight`
- [{{[]}}]
- [{{[1]}}]
- [{{[undefined]}}]
- [{{[null]}}]
- [{{[true]}}]
- [{{[false]}}]
- [{{[this]}}]
- [{{[foo.bar]}}]
-
- [{{nested.[]}}]
- [{{nested.[1]}}]
- [{{nested.[undefined]}}]
- [{{nested.[null]}}]
- [{{nested.[true]}}]
- [{{nested.[false]}}]
- [{{nested.[this]}}]
- [{{nested.[foo.bar]}}]
+ [{{this.[]}}]
+ [{{this.[1]}}]
+ [{{this.[undefined]}}]
+ [{{this.[null]}}]
+ [{{this.[true]}}]
+ [{{this.[false]}}]
+ [{{this.[this]}}]
+ [{{this.[foo.bar]}}]
+
+ [{{this.nested.[]}}]
+ [{{this.nested.[1]}}]
+ [{{this.nested.[undefined]}}]
+ [{{this.nested.[null]}}]
+ [{{this.nested.[true]}}]
+ [{{this.nested.[false]}}]
+ [{{this.nested.[this]}}]
+ [{{this.nested.[foo.bar]}}]
`,
state
@@ -893,7 +893,7 @@ class UpdatingTest extends RenderTest {
const person = { name: new Name('Godfrey', 'Chan') };
- this.render('
{{#with person.name.first as |f|}}{{f}}{{/with}}
', {
+ this.render('
{{#with this.person.name.first as |f|}}{{f}}{{/with}}
', {
person,
});
@@ -920,6 +920,7 @@ class UpdatingTest extends RenderTest {
@test
'block arguments should have higher precedence than helpers'() {
+ // Note: This test intentionally tests property fallback
this.registerHelper('foo', () => 'foo-helper');
this.registerHelper('bar', () => 'bar-helper');
this.registerHelper('echo', (args) => args[0]);
@@ -931,17 +932,17 @@ class UpdatingTest extends RenderTest {
value: "{{this.value}}";
echo foo: "{{echo foo}}";
echo bar: "{{echo bar}}";
- echo value: "{{echo value}}";
+ echo value: "{{echo this.value}}";
-----
- {{#with value as |foo|}}
+ {{#with this.value as |foo|}}
foo: "{{foo}}";
bar: "{{bar}}";
value: "{{this.value}}";
echo foo: "{{echo foo}}";
echo bar: "{{echo bar}}";
- echo value: "{{echo value}}";
+ echo value: "{{echo this.value}}";
-----
@@ -951,19 +952,19 @@ class UpdatingTest extends RenderTest {
value: "{{this.value}}";
echo foo: "{{echo foo}}";
echo bar: "{{echo bar}}";
- echo value: "{{echo value}}";
+ echo value: "{{echo this.value}}";
{{/with}}
{{/with}}
-----
- {{#with value as |bar|}}
+ {{#with this.value as |bar|}}
foo: "{{foo}}";
bar: "{{bar}}";
value: "{{this.value}}";
echo foo: "{{echo foo}}";
echo bar: "{{echo bar}}";
- echo value: "{{echo value}}";
+ echo value: "{{echo this.value}}";
{{/with}}
`;
@@ -1100,7 +1101,7 @@ class UpdatingTest extends RenderTest {
@test
'block arguments (ensure balanced push/pop)'() {
let person = { name: { first: 'Godfrey', last: 'Chan' } };
- this.render('
{{#with person.name.first as |f|}}{{f}}{{/with}}{{f}}
', {
+ this.render('
{{#with this.person.name.first as |f|}}{{f}}{{/with}}{{f}}
', {
person,
f: 'Outer',
});
@@ -1120,9 +1121,9 @@ class UpdatingTest extends RenderTest {
this.render(
stripTight`
- [{{#with person as |name|}}{{this.name}}{{/with}}]
- [{{#with person as |name|}}{{#with this.name as |test|}}{{test}}{{/with}}{{/with}}]
- [{{#with person as |name|}}{{#with (noop this.name) as |test|}}{{test}}{{/with}}{{/with}}]
+ [{{#with this.person as |name|}}{{this.name}}{{/with}}]
+ [{{#with this.person as |name|}}{{#with this.name as |test|}}{{test}}{{/with}}{{/with}}]
+ [{{#with this.person as |name|}}{{#with (noop this.name) as |test|}}{{test}}{{/with}}{{/with}}]
`,
{ person: 'Yehuda', name: 'Godfrey' }
@@ -1140,7 +1141,7 @@ class UpdatingTest extends RenderTest {
@test
'The with helper should consider an empty array truthy'() {
- this.render('
{{#with condition as |c|}}{{c.length}}{{/with}}
', {
+ this.render('
{{#with this.condition as |c|}}{{c.length}}{{/with}}
', {
condition: [],
});
@@ -1202,7 +1203,7 @@ class UpdatingTest extends RenderTest {
return;
});
- this.render('
{{capitalize value}}
', { value: 'hello' });
+ this.render('
{{capitalize this.value}}
', { value: 'hello' });
this.assertHTML('
HELLO
');
this.rerender({
@@ -1374,7 +1375,7 @@ class UpdatingTest extends RenderTest {
@test
'non-standard namespaced attribute nodes follow the normal dirtying rules'() {
- this.render("
hello
", { type: 'dedication' });
+ this.render("
hello
", { type: 'dedication' });
this.assertHTML("
hello
", 'Initial render');
this.rerender({ type: 'backmatter' });
@@ -1384,7 +1385,7 @@ class UpdatingTest extends RenderTest {
@test
'non-standard namespaced attribute nodes w/ concat follow the normal dirtying rules'() {
- this.render("
hello
", { type: 'backmatter' });
+ this.render("
hello
", { type: 'backmatter' });
this.assertHTML("
hello
", 'Initial render');
this.assertStableRerender();
@@ -1419,11 +1420,11 @@ class UpdatingTest extends RenderTest {
let template = stripTight`
0
- 1
- 2
- 3
- 4
- 5
+ 1
+ 2
+ 3
+ 4
+ 5
`;
@@ -1516,7 +1517,7 @@ class UpdatingTest extends RenderTest {
let tom = { key: '1', name: 'Tom Dale', class: 'tomdale' };
let yehuda = { key: '2', name: 'Yehuda Katz', class: 'wycats' };
- this.render("{{#each list key='key' as |item|}}{{item.name}}{{/each}}", {
+ this.render("{{#each this.list key='key' as |item|}}{{item.name}}{{/each}}", {
list: [tom, yehuda],
});
this.assertInvariants('initial render');
@@ -1539,7 +1540,7 @@ class UpdatingTest extends RenderTest {
let tom = { name: 'Tom Dale' };
let yehuda = { name: 'Yehuda Katz' };
- this.render('{{#if item}}{{item.name}}{{/if}}', { item: tom });
+ this.render('{{#if this.item}}{{this.item.name}}{{/if}}', { item: tom });
this.assertInvariants('initial render');
this.rerender();
@@ -1573,7 +1574,7 @@ class UpdatingTest extends RenderTest {
let yehuda = { key: '2', name: 'Yehuda Katz', class: 'wycats' };
this.render(
- "
{{#each list key='key' as |item|}}{{item.name}} {{/each}} ",
+ "
{{#each this.list key='key' as |item|}}{{item.name}} {{/each}} ",
{ list: [tom, yehuda] }
);
@@ -1622,9 +1623,12 @@ class UpdatingTest extends RenderTest {
@test
'The each helper with empty string items'() {
- this.render(`
{{#each list key='@identity' as |item|}}{{item}} {{/each}} `, {
- list: [''],
- });
+ this.render(
+ `
{{#each this.list key='@identity' as |item|}}{{item}} {{/each}} `,
+ {
+ list: [''],
+ }
+ );
let items = getElementsByTagName(this.element, 'li');
let lastNode = items[items.length - 1];
@@ -1647,7 +1651,7 @@ class UpdatingTest extends RenderTest {
@test
'The each helper with else'() {
this.render(
- `
{{#each list key='name' as |item|}}{{item.name}} {{else}}none {{/each}} `,
+ `
{{#each this.list key='name' as |item|}}{{item.name}} {{else}}none {{/each}} `,
{
list: [],
}
@@ -1687,7 +1691,7 @@ class UpdatingTest extends RenderTest {
let yehuda = { name: 'Yehuda Katz', class: 'wycats' };
this.render(
- "
{{#each list key='@index' as |item index|}}{{item.name}}{{index}}
{{/each}} ",
+ "
{{#each this.list key='@index' as |item index|}}{{item.name}}{{index}}
{{/each}} ",
{ list: [tom, yehuda] }
);
@@ -1846,7 +1850,7 @@ class UpdatingTest extends RenderTest {
let yehuda = { key: '2', name: 'Yehuda Katz', class: 'wycats' };
this.render(
- "
{{#each list key='key' as |item index|}}{{item.name}}{{index}}
{{/each}} ",
+ "
{{#each this.list key='key' as |item index|}}{{item.name}}{{index}}
{{/each}} ",
{ list: [tom, yehuda] }
);
diff --git a/packages/@glimmer/syntax/test/traversal/visiting-node-test.ts b/packages/@glimmer/syntax/test/traversal/visiting-node-test.ts
index 8fb38e46bb..22da2377a0 100644
--- a/packages/@glimmer/syntax/test/traversal/visiting-node-test.ts
+++ b/packages/@glimmer/syntax/test/traversal/visiting-node-test.ts
@@ -36,7 +36,9 @@ function traversalEqual(node: AST.Node, expectedTraversal: Array<[string, AST.Ba
QUnit.module('[glimmer-syntax] Traversal - visiting');
test('Elements and attributes', function () {
- let ast = parse(`
`);
+ let ast = parse(
+ `
`
+ );
let el = ast.body[0] as AST.ElementNode;
let concat = el.attributes[1].value as AST.ConcatStatement;
let concatMustache = concat.parts[1] as AST.MustacheStatement;