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
Function and variable macros are currently expanded like this in Core.ts:
case '#':
{
// Return the result of the named function call
let functionName = macro.substring(1);
let fn = window[functionName];
if(typeof fn === "function") { result = fn(); }
else { console.log(functionName + " is not a function"); }
break;
}
case '$':
{
// Return the value of the named variable
result = window[macro.substring(1)];
break;
}
This restricts Fractive's access only to variables and functions in the global scope. Properties and functions of objects cannot be accessed, but the code could be modified to allow this:
Split the macro using . as a delimiter
Loop through, starting with window, and [] accessing each property from the successive object that's found, until no more .'s are there.
The text was updated successfully, but these errors were encountered:
Function and variable macros are currently expanded like this in Core.ts:
This restricts Fractive's access only to variables and functions in the global scope. Properties and functions of objects cannot be accessed, but the code could be modified to allow this:
.
as a delimiter.
's are there.The text was updated successfully, but these errors were encountered: