Skip to content

Consider making Zone.ROOT private. #30780

Open
@lrhn

Description

@lrhn

If the only zones code has access to is Zone.current and any zone it was given access to (e.g., by creating a new one), then zone encapsulation is total. Code can ensure that a function runs entirely inside a specific zone by just using zone.run of that zone.

With access to Zone.ROOT, any code can escape the zone it was supposed to run in. While this is an escape hatch, it also makes it impossible for framework code to properly encapsulate foreign code, and a test framework can't properly test code that uses Zone.ROOT for anything.

Same thing goes for Zone.errorZone. The only necessary functionality is bool Zone.isSameErrorZone(Zone other). (We should still be careful about which arguments that function is called with).

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-core-librarySDK core library issues (core, async, ...); use area-vm or area-web for platform specific libraries.core-llibrary-asynctype-enhancementA request for a change that isn't a bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions