-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Open
Description
🐞 Describe the Bug
Check the repro.
🔬 Minimal Reproduction
import TemplateCompiler from '@ember/template-compiler/runtime';
...
test('asd', async function (assert) {
this.cls = 'asd';
await render(TemplateCompiler.template('<div>{{this.cls}}</div>', { scope: () => ({ this: this }) }));
assert.dom().hasText('asd');
});😕 Actual Behavior
SyntaxError: Unexpected token 'this'
at new Function (<anonymous>)
🤔 Expected Behavior
No error.
🌍 Environment
- Ember: 6.10.1
- Ember-CLI: 6.10.2
- Node.js/npm: v25.6.1
- OS: Linux
- Browser: Any
➕ Additional Context
The problem is on this line:
return new Function(...argNames, `return (${source})`)(...argValues);Can't create a function with this as an argument name.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels