yare-io / bugs

3 stars 0 forks source link

Cannot declare js class, triggers error afer 1 tick #2

Open borrel opened 3 years ago

borrel commented 3 years ago

hi,

after declaring a class i get the following error SyntaxError: Identifier 'Pos' has already been declared

here is some test code

class Pos {

}
my_spirits[1].shout('OK');
console.log('PASSED');

the test only passes once, and then throws the error until the class is renamed

andyleap commented 3 years ago

This is due to how the sandbox execution is currently set up. For now, a simple fix is to wrap your code in a {} block. We'll look into a proper fix.