rip-lang 3.10.11 → 3.10.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rip-lang",
3
- "version": "3.10.11",
3
+ "version": "3.10.12",
4
4
  "description": "A modern language that compiles to JavaScript",
5
5
  "type": "module",
6
6
  "main": "src/compiler.js",
package/src/components.js CHANGED
@@ -688,8 +688,14 @@ export function installComponentSupport(CodeGenerator, Lexer) {
688
688
  // Effects
689
689
  for (const effect of effects) {
690
690
  const effectBody = effect[2];
691
- const effectCode = this.generateInComponent(effectBody, 'value');
692
- lines.push(` __effect(() => { ${effectCode}; });`);
691
+ if (this.is(effectBody, 'block') && effectBody.length > 2) {
692
+ const transformed = this.transformComponentMembers(effectBody);
693
+ const body = this.generateFunctionBody(transformed, [], true);
694
+ lines.push(` __effect(() => ${body});`);
695
+ } else {
696
+ const effectCode = this.generateInComponent(effectBody, 'value');
697
+ lines.push(` __effect(() => { ${effectCode}; });`);
698
+ }
693
699
  }
694
700
 
695
701
  lines.push(' }');