Skip to content

Design Meeting Notes, 8/20/2021 #45551

Closed
Closed
@DanielRosenwasser

Description

@DanielRosenwasser

Track Source and Target Stack Depths Separately

#41821

Array.prototype.at Returning undefined

#45512

  • Can still index outside the range, just also works with negative indexes.
    • Could make that work on tuples, but need more special support.
    • Or, could just bake a hack in for tuples.
      • ...unless you have rests and spreads!
        • ...unless those are front-loaded! (e.g. [...some, ...stuff, 123, true, 'a'].at(-1) could return string)
    • Unclear if we would want to get into the domain of adding type notation support for it.
  • We're fans of making sure this thing has undefined in the return type.
  • Do we need to have the special tuple support before we ship this?
    • Possibly.
  • Seems strange - in Python, experience was using regular arrays, and -1 was the argument that was passed in 99% of the time.
  • 2 things we should do
    • Ship the thing that returns T | undefined in lib.d.ts.
    • Bake in some support for negative indexes when we know better.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Design NotesNotes from our design meetings

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions