Maybe this comment belongs in `removeScope()` and not here in `removeFromScopeOrder()`, but I think it's still valid.

The case I was thinking about is if `addToScopeOrder` is called and scope is added to `_pendingScopes` (not `defaultScopeOrder`), and then `removeScope()` gets called while it's still in `_pendingScopes` (i.e. *before* it gets moved to `defaultScopeOrder`). In that case, it will never be removed from `_pendingScopes`. This is a memory leak at best, and could cause name conflicts later.