1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-15 19:14:58 +00:00
serenity/Userland/Libraries/LibJS/Tests/syntax
Ali Mohammad Pur 3194177dce LibJS: Correctly parse yield-from expressions
This commit implements parsing for `yield *expr`, and the multiple
ways something can or can't be parsed like that.
Also makes yield-from a TODO in the bytecode generator.
Behold, the glory of javascript syntax:
```js
// 'yield' = expression in generators.
function* foo() {
    yield
    *bar; // <- Syntax error here, expression can't start with *
}

// 'yield' = identifier anywhere else.
function foo() {
    yield
    *bar; // Perfectly fine, this is just `yield * bar`
}
```
2021-06-14 13:06:08 +01:00
..
destructuring-assignment.js LibJS: Add tests for destructuring assignments and function parameters 2021-05-29 23:02:23 +04:30
generators.js LibJS: Correctly parse yield-from expressions 2021-06-14 13:06:08 +01:00