Skip to content

Add a lifetime bound to (Safe)JSContext #658

@gmorenz

Description

@gmorenz

JSContext::from_ptr requires that

/// - only one [JSContext] can be alive and it should not outlive [Runtime].

Currently this unsafe function is the only way to construct one, but if we're looking forward to a future where we expose a safe API we should imagine there will be a safe way to derive one from a runtime at some point... which would then require a lifetime to make sure it doesn't live to long.

It's probably a lot easier to add that now then to do the refactoring later.

(This probably should have been a review comment on #638 but too late now)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions