Skip to main content
Create new
Introduction
Reactivity
Props
Logic
Events
Bindings
Lifecycle
Stores
Motion
Transitions
Animations
Easing
SVG
Actions
Classes
Component composition
Context API
Special elements
Module context
Debugging
7GUIs
Miscellaneous
App.svelte
<script>
let num = 100_000 ** 2;
function first(node){
console.log(node)
}

</script>

{num}

<div use:first></div>

Error compiling component

WebAssembly.instantiateStreaming(): value type opcode @+13
/* App.svelte generated by Svelte v3.26.0 */
import {
SvelteComponent,
action_destroyer,
detach,
element,
init,
insert,
noop,
safe_not_equal,
space,
text
} from "svelte/internal";

function create_fragment(ctx) {
let t0;
let t1;
let div;
let first_action;
let mounted;
let dispose;

return {
c() {
t0 = text(/*num*/ ctx[0]);
t1 = space();
div = element("div");
},
m(target, anchor) {
insert(target, t0, anchor);
insert(target, t1, anchor);
insert(target, div, anchor);

if (!mounted) {
dispose = action_destroyer(first_action = first.call(null, div));
mounted = true;
result = svelte.compile(source, {
generate: ,
});
/* Add a <style> tag to see the CSS output */
		
			
				
  • {
    • html: Fragment {...}
      • start: 94
      • end: 122
      • type: "Fragment"
      • children: [...] (4)
        • Text {...}
          • start: 92
          • end: 94
          • type: "Text"
          • raw: "\n\n"
          • data: "\n\n"
          }
        • MustacheTag {...}
          • start: 94
          • end: 99
          • type: "MustacheTag"
          • expression: Identifier {...}
            • type: "Identifier"
            • start: 95
            • end: 98
            • loc: {...}
              • start: {...}
                • line: 10
                • column: 1
                }
              • end: {...}
                • line: 10
                • column: 4
                }
              }
            • name: "num"
            }
          }
        • Text {...}
          • start: 99
          • end: 101
          • type: "Text"
          • raw: "\n\n"
          • data: "\n\n"
          }
        • Element {...}
          • start: 101
          • end: 122
          • type: "Element"
          • name: "div"
          • attributes: [...] (1)
            • Action {...}
              • start: 106
              • end: 115
              • type: "Action"
              • name: "first"
              • modifiers: []
              • expression: null
              }
            ]
          • children: []
          }
        ]
      }
    • css: undefined
    • instance: Script {...}
      • type: "Script"
      • start: 0
      • end: 92
      • context: "default"
      • content: Program {...}
        • type: "Program"
        • start: 8
        • end: 83
        • loc: {...}
          • start: {...}
            • line: 1
            • column: 0
            }
          • end: {...}
            • line: 8
            • column: 0
            }
          }
        • body: [...] (2)
          • VariableDeclaration {...}
            • type: "VariableDeclaration"
            • start: 10
            • end: 33
            • loc: {...}
              • start: {...}
                • line: 2
                • column: 1
                }
              • end: {...}
                • line: 2
                • column: 24
                }
              }
            • declarations: [...] (1)
              • VariableDeclarator {...}
                • type: "VariableDeclarator"
                • start: 14
                • end: 32
                • loc: {...}
                  • start: {...}
                    • line: 2
                    • column: 5
                    }
                  • end: {...}
                    • line: 2
                    • column: 23
                    }
                  }
                • id: Identifier {...}
                  • type: "Identifier"
                  • start: 14
                  • end: 17
                  • loc: {...}
                    • start: {...}
                      • line: 2
                      • column: 5
                      }
                    • end: {...}
                      • line: 2
                      • column: 8
                      }
                    }
                  • name: "num"
                  }
                • init: BinaryExpression {...}
                  • type: "BinaryExpression"
                  • start: 20
                  • end: 32
                  • loc: {...}
                    • start: {...}
                      • line: 2
                      • column: 11
                      }
                    • end: {...}
                      • line: 2
                      • column: 23
                      }
                    }
                  • left: Literal {...}
                    • type: "Literal"
                    • start: 20
                    • end: 27
                    • loc: {...}
                      • start: {...}
                        • line: 2
                        • column: 11
                        }
                      • end: {...}
                        • line: 2
                        • column: 18
                        }
                      }
                    • value: 100000
                    • raw: "100_000"
                    }
                  • operator: "**"
                  • right: Literal {...}
                    • type: "Literal"
                    • start: 31
                    • end: 32
                    • loc: {...}
                      • start: {...}
                        • line: 2
                        • column: 22
                        }
                      • end: {...}
                        • line: 2
                        • column: 23
                        }
                      }
                    • value: 2
                    • raw: "2"
                    }
                  }
                }
              ]
            • kind: "let"
            }
          • FunctionDeclaration {...}
            • type: "FunctionDeclaration"
            • start: 37
            • end: 81
            • loc: {...}
              • start: {...}
                • line: 4
                • column: 1
                }
              • end: {...}
                • line: 6
                • column: 2
                }
              }
            • id: Identifier {...}
              • type: "Identifier"
              • start: 46
              • end: 51
              • loc: {...}
                • start: {...}
                  • line: 4
                  • column: 10
                  }
                • end: {...}
                  • line: 4
                  • column: 15
                  }
                }
              • name: "first"
              }
            • expression: false
            • generator: false
            • async: false
            • params: [...] (1)
              • Identifier {...}
                • type: "Identifier"
                • start: 52
                • end: 56
                • loc: {...}
                  • start: {...}
                    • line: 4
                    • column: 16
                    }
                  • end: {...}
                    • line: 4
                    • column: 20
                    }
                  }
                • name: "node"
                }
              ]
            • body: BlockStatement {...}
              • type: "BlockStatement"
              • start: 57
              • end: 81
              • loc: {...}
                • start: {...}
                  • line: 4
                  • column: 21
                  }
                • end: {...}
                  • line: 6
                  • column: 2
                  }
                }
              • body: [...] (1)
                • ExpressionStatement {...}
                  • type: "ExpressionStatement"
                  • start: 61
                  • end: 78
                  • loc: {...}
                    • start: {...}
                      • line: 5
                      • column: 2
                      }
                    • end: {...}
                      • line: 5
                      • column: 19
                      }
                    }
                  • expression: CallExpression {...}
                    • type: "CallExpression"
                    • start: 61
                    • end: 78
                    • loc: {...}
                      • start: {...}
                        • line: 5
                        • column: 2
                        }
                      • end: {...}
                        • line: 5
                        • column: 19
                        }
                      }
                    • callee: MemberExpression {...}
                      • type: "MemberExpression"
                      • start: 61
                      • end: 72
                      • loc: {...}
                        • start: {...}
                          • line: 5
                          • column: 2
                          }
                        • end: {...}
                          • line: 5
                          • column: 13
                          }
                        }
                      • object: Identifier {...}
                        • type: "Identifier"
                        • start: 61
                        • end: 68
                        • loc: {...}
                          • start: {...}
                            • line: 5
                            • column: 2
                            }
                          • end: {...}
                            • line: 5
                            • column: 9
                            }
                          }
                        • name: "console"
                        }
                      • property: Identifier {...}
                        • type: "Identifier"
                        • start: 69
                        • end: 72
                        • loc: {...}
                          • start: {...}
                            • line: 5
                            • column: 10
                            }
                          • end: {...}
                            • line: 5
                            • column: 13
                            }
                          }
                        • name: "log"
                        }
                      • computed: false
                      • optional: false
                      }
                    • arguments: [...] (1)
                      • Identifier {...}
                        • type: "Identifier"
                        • start: 73
                        • end: 77
                        • loc: {...}
                          • start: {...}
                            • line: 5
                            • column: 14
                            }
                          • end: {...}
                            • line: 5
                            • column: 18
                            }
                          }
                        • name: "node"
                        }
                      ]
                    • optional: false
                    }
                  }
                ]
              }
            }
          ]
        • sourceType: "module"
        }
      }
    • module: undefined
    }
The AST is not public API and may change at any point in time