You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
children: "const a = 1;\nconsole.log(a); // 1\n\n{// <- start of a block scope\n const a = 2;\n console.log(a); // 2\n} // <- end of a block scope\n"
116
+
children: "const a = 1;\nconsole.log(a); // 1\n\n{\n // <- start of a block scope\n const a = 2;\n console.log(a); // 2\n} // <- end of a block scope\n"
children: ["In this example, our two variables have different identifiers.\nNotice that when we access the variable ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.code,{
@@ -143,7 +143,7 @@ function _createMdxContent(props) {
children: "const a = 1;\nconsole.log(a); // 1\n\nfunction f() {// <- start of a function scope\n var a = 2;\n console.log(a); // 2\n\n { // <- start of a block scope\n let a = 3;\n console.log(a); // 3\n } // <- end of a block scope\n\n console.log(a); // 2\n} // <- end of a function scope\n\nf();\n\nconsole.log(a); // 1\n"
146
+
children: "const a = 1;\nconsole.log(a); // 1\n\nfunction f() {\n // <- start of a function scope\n var a = 2;\n console.log(a); // 2\n\n {\n // <- start of a block scope\n let a = 3;\n console.log(a); // 3\n } // <- end of a block scope\n\n console.log(a); // 2\n} // <- end of a function scope\n\nf();\n\nconsole.log(a); // 1\n"
children: ["You can see that variables are tied to their scopes.\nAll three variables ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.code,{
@@ -222,7 +222,7 @@ function _createMdxContent(props) {
children: "You can see how each variable has a set of two unique indices.\nThe scope index increases with each nested scope.\nThe variable index increases with each variable in one specific scope."
@@ -231,7 +231,7 @@ function _createMdxContent(props) {
children: "While running the code, depending on the implementation, we might get a panic, a wrong result or even an unsafe memory access.\nLet's try to understand what is going on here:"
@@ -409,7 +409,7 @@ function _createMdxContent(props) {
children: "These are our scopes before the scope analysis.\nNotice that we start from the scope of the arrow function, since we work our way out from the most nested scope:"
@@ -451,7 +451,7 @@ function _createMdxContent(props) {
children: ["The solution here is to mark every argument variable that might be accessed through a mapped ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.code,{
@@ -474,7 +474,7 @@ function _createMdxContent(props) {
children: ["Our solution is this case is to mark every variable in the scopes where the direct ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.code,{
@@ -493,7 +493,7 @@ function _createMdxContent(props) {
0 commit comments