I don't remember but I think I wrote so as an attempt to deal with usage scenario like this:
```ruby
begin
  within_window w1 do
    within_window w2 do
    end
  end
rescue StandardError
end
# I would like `scopes` to be `[nil]` here. If scope will be popped, it will be `[]` instead
```

So I think it's more correct to have `@scopes = [nil]` here than `@scopes.pop`.

However, I've now thought out another usage scenario:
```ruby
begin
  within_frame f do
    within_window w do
    end
  end
rescue StandardError
end
# I think `scopes` here is `[]` even in current version of code. It should be `[nil]` instead
```

Probably the better fix for both usage scenarios would be to do the following in `within_window`/`within_frame`/`within`'s `ensure`.:
```ruby
scopes.pop unless scopes.size == 1
```

But such fix won't work for the following usage scenario:
```ruby
within el do
  begin
    within_window w do
    end
  rescue StandardError
  end
  # `scopes` is `[nil]` here but it should be `[nil, el]`
end
```
WDYT @twalpole?