-
@rigor_colonialis Line 103 references "injectedFunction" inside the scope of initializeCanvas but is set outside that scope in Line 144. In JavaScript, variables declared with let and const are hoisted to the top of their enclosing block, but they cannot be accessed until the execution reaches the line where they are defined. This period from the start of the block until the variable declaration is known as the temporal dead zone. The function initializeCanvas makes a call to injectedFunction. However, initializeCanvas is called (at the end of the code and inside loadState) before injectedFunction is defined. This leads to the reference error because injectedFunction is in the TDZ at the time it's being called. I can fix it if someone gives me access to the code.
Please register or sign in to comment