fix pattern checks for minified code
This commit is contained in:
parent
ef75590853
commit
9458faf5b0
7 changed files with 1359 additions and 22 deletions
|
|
@ -49,7 +49,8 @@ export const evaluate = async (code) => {
|
|||
drawHelpers.cleanup();
|
||||
uiHelpers.cleanup();
|
||||
let evaluated = await eval(shapeshifted);
|
||||
if (evaluated?.constructor?.name !== 'Pattern') {
|
||||
if (!isPattern(evaluated)) {
|
||||
console.log('evaluated', evaluated);
|
||||
const message = `got "${typeof evaluated}" instead of pattern`;
|
||||
throw new Error(message + (typeof evaluated === 'function' ? ', did you forget to call a function?' : '.'));
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue