3 ms·
Here’s the function that evaluates the template: with (this.state) { return eval(`(function ${this.template.toString().replace(/^\s*function\s+/,'')}())`
by evan_ 3y ago
Here’s the function that evaluates the template:
with (this.state) {
return eval(`(function ${this.template.toString().replace(/^\s*function\s+/,'')}())`);
}
So it’s effectively turning everything in `this.state` into a local var and evaluating the code in the template function in that context.
- spankalee 3y agoThat's so difficult for humans and tools to reason about. It would completely break intellisense and lots of lint rules. What's the reason for this?