diff options
author | bors-servo <lbergstrom+bors@mozilla.com> | 2019-11-25 23:27:33 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-11-25 23:27:33 -0500 |
commit | 74bf0ce5c2e993eab0e34aa00a9449e612e5a6d9 (patch) | |
tree | f9be87961ff560ee523c165ff3041a64b34ed3dc /components/script/dom/bindings/codegen/parser/tests/test_enum.py | |
parent | f1aa5d8dbdc32f6f474b09234558652b9bead686 (diff) | |
parent | 38a666742fbfcd5b392d8644622af890c0ff25cd (diff) | |
download | servo-74bf0ce5c2e993eab0e34aa00a9449e612e5a6d9.tar.gz servo-74bf0ce5c2e993eab0e34aa00a9449e612e5a6d9.zip |
Auto merge of #24866 - Manishearth:iterator-invalidation, r=jdm
Fix iterator invalidation in our forEach implementation.
Currently we iterate over iterables in forEach based on the length they report when we start iterating, however the inner callback is able to change this.
```js
let params = new URLSearchParams("foo=bar&baz=qux");
params.forEach((p) => {
console.log(p);
params.delete("baz");
})
```
This causes us to panic [here](https://github.com/servo/servo/blob/f1aa5d8dbdc32f6f474b09234558652b9bead686/components/script/dom/bindings/codegen/CodegenRust.py#L7412) over an attempt to access out of bounds.
Relevant spec: https://heycam.github.io/webidl/#es-forEach
r? @jdm
Diffstat (limited to 'components/script/dom/bindings/codegen/parser/tests/test_enum.py')
0 files changed, 0 insertions, 0 deletions