Skip to content

fix: normalize constructor parameters to prevent native/polyfill mixing#101

Merged
ggaabe merged 1 commit intoggaabe:mainfrom
KristjanESPERANTO:temporal-mixing
Jan 23, 2026
Merged

fix: normalize constructor parameters to prevent native/polyfill mixing#101
ggaabe merged 1 commit intoggaabe:mainfrom
KristjanESPERANTO:temporal-mixing

Conversation

@KristjanESPERANTO
Copy link
Contributor

Upon further investigation, I discovered that #100 did not cover all cases. So this completes the fix from #100 by addressing constructor parameters.

The Issue

The previous fix normalized Temporal objects during between() execution, but external libraries can pass native Temporal objects directly as constructor parameters. These were stored without normalization, causing type mismatches later during comparisons and until() operations.

The Solution

  • Added normalizeToPolyfill() helper method for clarity and reusability
  • Normalize dtstart in both constructor branches (ICS and manual)
  • Normalize until parameter when provided

The previous fix normalized Temporal objects during execution but missed
constructor parameters. External libraries can pass native Temporal objects
which were stored without normalization, causing type mismatches later.

This adds a normalizeToPolyfill helper and applies it to dtstart and until
in the constructor, ensuring consistent polyfill usage throughout the
instance lifecycle.
@ggaabe ggaabe merged commit e2bffd3 into ggaabe:main Jan 23, 2026
1 check passed
@KristjanESPERANTO
Copy link
Contributor Author

@ggaabe Thanks for the super quick responses! 🙂 The new release now unblocks our migration to Electron v40.

@KristjanESPERANTO KristjanESPERANTO deleted the temporal-mixing branch January 24, 2026 01:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants