| 07:24 | <bendtherules> | Do iterators have a implicit contract that it shouldn't return more value (done: false) after saying done:true? |
| 07:26 | <bendtherules> | The in-built array iterator seems to delete the reference back to the array once it has finished. Is it for the above reason or to clean up references? |
| 13:51 | <devsnek> | where's the rule that says functions can't be declared except for top level and inside blocks |
| 14:12 | <jmdyck> | devsnek: you mean in a non-annex-B world? |
| 14:12 | <devsnek> | jmdyck: yes |
| 14:22 | <jmdyck> | devsnek: I think it's mostly just the grammar. Start at FunctionDeclaration and work your way "up", and you find (with a few exceptions) that it can only occur in a StatementList, which (with a few exceptions) can only occur at "top level" or within a Block (or a FunctionBody, which I'm guessing you're including) |
| 14:25 | <devsnek> | jmdyck: its something else |
| 14:25 | <devsnek> | Statement : ExpressionStatement |
| 14:25 | <devsnek> | ExpressionStatement : FunctionExpression |
| 14:25 | <devsnek> | that production is disallowed too |
| 14:25 | <devsnek> | for example `while (true) function() {}` |
| 14:26 | <jmdyck> | Ah, wasn't sure if you were talking about FuncExprs too |
| 14:26 | <devsnek> | i already separated statements/declarations |
| 14:26 | <devsnek> | so its just the expression forms that are confusing me now |
| 14:32 | <jmdyck> | https://tc39.es/ecma262/#sec-expression-statement : start of ExpressionStatement disallows 'function' keyword as lookahead |
| 14:33 | <devsnek> | oh that seems kind of obvious |
| 14:33 | <devsnek> | lol |
| 14:34 | <jmdyck> | mind you, what about `while (true) (function() {})` |
| 14:35 | <devsnek> | that one is allowed |
| 14:35 | <devsnek> | so no problem |