Using `yield` hangs IDE
Closed this issue · 1 comments
dungwinux commented
Version
{
elementaryJS: "c122f37",
ocelot: "6887ff2"
}
Problem
When explicitly using yield
in a generator function, ElementaryJS detects this as SyntaxError (SyntaxError: Unexpected strict mode reserved word
). However, Ocelot hangs due to the error being uncaught.
Interestingly, using yield
in an anonymous generator function works fine, and ElementaryJS doesn't detect as error.
Step to reproduce
- Input the below javascript code:
function* generator() {
yield 1;
yield 2;
}
const range = generator();
Expected behavior
Print error in Ocelot console
Actual behavior
Ocelot IDE hangs. In developer console, it prints out error as below:
arjunguha commented
Closing, same as the other error.