mirror of https://github.com/boa-dev/boa.git
Browse Source
<!---
Thank you for contributing to Boa! Please fill out the template below, and remove or add any
information as you feel neccesary.
--->
This Pull Request fixes [x-after-break-to-label](dc1dc28aa4/test/language/block-scope/leave/x-after-break-to-label.js
)
### Example
```js
{
let x = 2;
L: {
let x = 3;
console.log(x === 3);
break L;
console.log(false);
}
console.log(x === 2);
}
```
### Previously
> Uncaught "SyntaxError": "Cannot use the undeclared label 'L'"
### Now
> true <br> true
### What did I do
1. add `lable` to `Node::Block`
2. push labelled-block's `control info` to `jump_info` list
3. pop it before `Opcode::PopEnvironment`
Co-authored-by: creampnx_x <2270436024@qq.com>
pull/2288/head
creampnx_x
2 years ago
4 changed files with 71 additions and 1 deletions
Loading…
Reference in new issue