inspect: add Temporal support#63154
Draft
Renegade334 wants to merge 1 commit into
Draft
Conversation
Member
|
i'm confused, why would it need to be lazily accessed instead of using primordials? |
ljharb
reviewed
May 6, 2026
aduh95
reviewed
May 8, 2026
Member
|
the subsystem should be "util". |
dc57ba9 to
85e728e
Compare
Member
Author
|
Alternative approach to the "how to Temporal" problem. This hooks into the pre-execution initializers and creates some typechecking functions and saves the constructor and prototype properties, primordial-ish, if Temporal exists. We don't use this approach for any other ES builtins, only Node.js APIs, so does need consideration as to whether this is kosher. However, it does also provide for if we want to create or manipulate Temporal objects elsewhere in the API. |
85e728e to
925fe74
Compare
Signed-off-by: Renegade334 <contact.9a5d6388@renegade334.me.uk>
925fe74 to
3f3868a
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Example output:
The Temporal global obviously has to be lazily accessed, and there's no way to do it that's immune from potential user tampering. The approach taken here is just to fetch it from the global object every time, since the output of
inspect()is inherently aimed at the human reader, so it doesn't really need to be particularly hardened.WIP: tests