Repository navigation
[TS] Preserve native Date constructor identity - #537
Merged
Merged
Conversation
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.
Native
Datevalues had no stable constructor identity when the SDK was absent from the input scene.date-fns-styledate instanceof Datetherefore stopped on an unknown RHS, while aliases andnew date.constructor(...)could not preserve native construction semantics.Add nominal Date identity from JacoDB's bundled standard library and retain the existing unknown-call boundary for Date APIs. Direct and aliased native construction,
instanceof, and the inheritedDate.prototype.constructorvalue now share one identity. Own constructor overrides take precedence; deleting the override restores the inherited constructor. Source bindings named Date remain ordinary application values, and plain objects/primitive/nullish values do not become native Dates.A native Date constructor completed through FRESH retains its allocated receiver and gets an unconstrained internal timestamp. This preserves the known
[[Construct]]object identity in EMPTY and FROZEN while keeping missing timestamp semantics explicitly approximate/FRESH. Unknown arbitrary functions retain the existing unsupported constructor behavior. MutableDate.prototypeaccess remains explicitly unsupported.Validation:
:usvm-ts:detektMain,:usvm-ts:detektTest, andgit diff --checkpass.No JacoDB change or Date model arithmetic rewrite is included. Full suites and the 200-class diagnostic campaign remain part of the combined integration validation. Constructor dispatch PR #529 is independently reviewable; its dynamic-new follow-up preserves the same alias paths.