Skip to content

Fix: [for cherry-picking] Added a dedicated Date constructor capability - #202

Closed
qodo-code-review[bot] wants to merge 1 commit into
feat/demand-activation-wavefrom
fix/remediation-263b8c60-1eac17
Closed

qodo-code-review[bot] wants to merge 1 commit into
feat/demand-activation-wavefrom
fix/remediation-263b8c60-1eac17

Conversation

@qodo-code-review

@qodo-code-review qodo-code-review Bot commented Sep 7, 2026 •

Copy link
Copy Markdown

Fixed Findings

  • Track Date core constructor capability separately

Automated fix from agentic review of #201

Qodo Logo

Summary by Sourcery

Separate the ES2015 Date constructor capability from the broader ES2015 library to preserve accurate Date typings under scoped library configurations.

Bug Fixes:

  • Track the ES2015 Date constructor capability independently so Date(value) receives the correct parameter types when only the core library is enabled.

Enhancements:

  • Extend library target and name resolution to include the dedicated ES2015 Date core capability.

Tests:

  • Add coverage for Date constructor typing with the ES5 and ES2015 core libraries enabled.

Summary by cubic

Tracks the ES2015 Date constructor capability separately from the broader ES2015 library so Date(value) gets correct parameter types when only the core library is enabled.

Written for commit 424cd78. Summary will update on new commits.

Review in cubic

@qodo-code-review qodo-code-review Bot closed this Sep 7, 2026
@codeant-ai

codeant-ai Bot commented Sep 7, 2026

Copy link
Copy Markdown

Skipping PR review because a bot author is detected.

If you want to trigger CodeAnt AI, comment @codeant-ai review to trigger a manual review.

@sourcery-ai

sourcery-ai Bot commented Sep 7, 2026

Copy link
Copy Markdown

Reviewer's Guide

The PR separates the ES2015 core Date constructor capability from the broader ES2015 library, wires it through target and lib-name resolution, and verifies that Date(value) receives the correct instance-inclusive union when only the core fragment is enabled.

Flow diagram for Date constructor capability resolution

flowchart LR
    Input["Target or lib name"] --> Resolve[LibSet resolution]
    Resolve --> Core[Es2015DateCore]
    Resolve --> Broad[Es2015]
    Core --> Binder[Date binder]
    Broad --> Binder
    Binder --> Value["Date(value) parameter"]
    Value --> Union["number | string | Date instance"]
Loading

File-Level Changes

Change Details Files
Introduces a dedicated capability for the ES2015 core Date constructor overload and uses it when constructing Date call signatures.
  • Adds Es2015DateCore as a separate library capability and updates the complete capability mask.
  • Enables the capability for ES2015+ targets and recognized lib aliases, including es2015.core.
  • Changes Date value-call typing to expose the instance overload when the dedicated capability is present.
  • Adds coverage for es5 plus es2015.core without enabling unrelated ES2015 globals.
crates/bamts-compiler/src/checker/intrinsic_environment.rs
crates/bamts-compiler/src/checker/binder/date.rs

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@codeant-ai

codeant-ai Bot commented Sep 7, 2026 •

Copy link
Copy Markdown

🏁 CodeAnt Quality Gate Results

Commit: 424cd784
Scan Time: 2026-09-07 19:15:21 UTC

✅ Overall Status: PASSED

Quality Gate Details

Quality Gate Status Details
Secrets ✅ PASSED 0 secrets found
Duplicate Code ✅ PASSED 23.5% duplicated
SAST ✅ PASSED No security issues
Bugs ✅ PASSED Rating S: No bugs
IAC ✅ PASSED No IAC issues

View Full Results

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - I've reviewed your changes and they look great!

Sourcery assessment

Approved.


Sourcery is free for open source - if you like our reviews please consider sharing them ✨

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.

0 participants