GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Add at method by Kingwl · Pull Request #40697 · microsoft/TypeScript

Conversation

@Kingwl

@Kingwl Wenlu Wang (Kingwl) commented Sep 22, 2020

Copy link
Copy Markdown
Contributor

Fixes #40695

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Wenlu Wang (Kingwl) added 2 commits September 22, 2020 17:29
@Kingwl
Add item method
ec5f634
@Kingwl
fix jsdoc
b3daf96
@typescript-bot TypeScript Bot (typescript-bot) added the For Uncommitted Bug PR for untriaged, rejected, closed or missing bug label Sep 22, 2020
@Kingwl
accept baseline
b44a007
Jack-Works
Jack Works (Jack-Works) reviewed Sep 23, 2020
View reviewed changes
Comment thread src/lib/esnext.array.d.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

@sandersn
Nathan Shively-Sanders (sandersn) requested a review from Ron Buckton (rbuckton) October 5, 2020 18:44
@typescript-bot TypeScript Bot (typescript-bot) assigned Ron Buckton (rbuckton) Oct 5, 2020
@typescript-bot TypeScript Bot (typescript-bot) added For Milestone Bug PRs that fix a bug with a specific milestone and removed For Uncommitted Bug PR for untriaged, rejected, closed or missing bug labels Oct 5, 2020
@Kingwl

Wenlu Wang (Kingwl) commented Nov 12, 2020

Copy link
Copy Markdown
Contributor Author

Up.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@Jack-Works

Jack Works (Jack-Works) commented Nov 12, 2020

Copy link
Copy Markdown
Contributor

This proposal has web combability problem so it's need to be renamed.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@Kingwl

Wenlu Wang (Kingwl) commented Nov 12, 2020

Copy link
Copy Markdown
Contributor Author

Well... tc39/proposal-relative-indexing-method#34

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

ghost
Deleted user (ghost) reviewed Jan 13, 2021
View reviewed changes
Comment thread src/lib/esnext.array.d.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

@rbuckton

Ron Buckton (rbuckton) commented Jan 13, 2021

Copy link
Copy Markdown
Contributor

FYI, per the linked issue, item could not be used in ECMAScript due to web compatibility issues. See #40695 (comment)

Kingwl and saschanaz reacted with eyes emoji
All reactions
  • 👀 2 reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Wenlu Wang (Kingwl) added 2 commits June 9, 2021 11:45
@Kingwl
Merge branch 'master' into item_method_new
f5878f1
@Kingwl
Rename item method
93ee38f
@typescript-bot

TypeScript Bot (typescript-bot) commented Jun 9, 2021

Copy link
Copy Markdown
Contributor

The TypeScript team hasn't accepted the linked issue #40695. If you can get it accepted, this PR will have a better chance of being reviewed.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Wenlu Wang (Kingwl) added 2 commits June 9, 2021 12:07
@Kingwl
Add bigint64 array
76e5e03
@Kingwl
Add whitespace
aadb17d
Kingwl
Wenlu Wang (Kingwl) commented Jun 9, 2021
View reviewed changes
Comment thread src/lib/esnext.string.d.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread src/compiler/commandLineParser.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread src/lib/esnext.array.d.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread src/testRunner/unittests/config/convertCompilerOptionsFromJson.ts
start: 0,
length: 0,
messageText: "Argument for '--lib' option must be: 'es5', 'es6', 'es2015', 'es7', 'es2016', 'es2017', 'es2018', 'esnext', 'dom', 'dom.iterable', 'webworker', 'webworker.importscripts', 'scripthost', 'es2015.core', 'es2015.collection', 'es2015.generator', 'es2015.iterable', 'es2015.promise', 'es2015.proxy', 'es2015.reflect', 'es2015.symbol', 'es2015.symbol.wellknown', 'es2016.array.include', 'es2017.object', 'es2017.sharedmemory', 'es2017.string', 'es2017.intl', 'es2017.typedarrays', 'es2018.asynciterable', 'es2018.intl', 'es2018.promise', 'es2018.regexp', 'esnext.array', 'esnext.symbol', 'esnext.intl', 'esnext.bigint', 'esnext.bigint', 'esnext.string', 'esnext.promise'.",
messageText: "Argument for '--lib' option must be: 'es5', 'es6', 'es2015', 'es7', 'es2016', 'es2017', 'es2018', 'esnext', 'dom', 'dom.iterable', 'webworker', " +

@Kingwl Wenlu Wang (Kingwl) Jun 9, 2021

Copy link
Copy Markdown
Contributor Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

It's painful when you edit something on a very very very long line.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@rbuckton Ron Buckton (rbuckton) Jul 8, 2021

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

We should convert these into baseline/snapshot tests. Not necessary for you to do in this PR, so I've filed #44950 to keep track of the issue.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@Kingwl Wenlu Wang (Kingwl) Jul 9, 2021

Copy link
Copy Markdown
Contributor Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Should I revert these changes?...

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@Kingwl Wenlu Wang (Kingwl) changed the title Add item method Add at method Jun 9, 2021
ghost
Deleted user (ghost) reviewed Jun 9, 2021
View reviewed changes
Comment thread src/lib/esnext.string.d.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

Wenlu Wang (Kingwl) and others added 2 commits June 9, 2021 14:07
@Kingwl Anonymous
Update src/lib/esnext.string.d.ts
33df981
Co-authored-by: Anonymous <[email protected]>
@Kingwl
Avoid whitespace
7ee9c40
rbuckton
Ron Buckton (rbuckton) approved these changes Jul 8, 2021
View reviewed changes

@rbuckton Ron Buckton (rbuckton) left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Assuming there are no further web compatibility issues with .at, this looks good to me. The feature is shipping in both v8 and SpiderMonkey, so it seems fairly stable.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread src/compiler/commandLineParser.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread src/lib/esnext.array.d.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread src/lib/esnext.string.d.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread src/testRunner/unittests/config/convertCompilerOptionsFromJson.ts
start: 0,
length: 0,
messageText: "Argument for '--lib' option must be: 'es5', 'es6', 'es2015', 'es7', 'es2016', 'es2017', 'es2018', 'esnext', 'dom', 'dom.iterable', 'webworker', 'webworker.importscripts', 'scripthost', 'es2015.core', 'es2015.collection', 'es2015.generator', 'es2015.iterable', 'es2015.promise', 'es2015.proxy', 'es2015.reflect', 'es2015.symbol', 'es2015.symbol.wellknown', 'es2016.array.include', 'es2017.object', 'es2017.sharedmemory', 'es2017.string', 'es2017.intl', 'es2017.typedarrays', 'es2018.asynciterable', 'es2018.intl', 'es2018.promise', 'es2018.regexp', 'esnext.array', 'esnext.symbol', 'esnext.intl', 'esnext.bigint', 'esnext.bigint', 'esnext.string', 'esnext.promise'.",
messageText: "Argument for '--lib' option must be: 'es5', 'es6', 'es2015', 'es7', 'es2016', 'es2017', 'es2018', 'esnext', 'dom', 'dom.iterable', 'webworker', " +

@rbuckton Ron Buckton (rbuckton) Jul 8, 2021

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

We should convert these into baseline/snapshot tests. Not necessary for you to do in this PR, so I've filed #44950 to keep track of the issue.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
rbuckton
Ron Buckton (rbuckton) suggested changes Jul 8, 2021
View reviewed changes

@rbuckton Ron Buckton (rbuckton) left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

That was supposed to be a request changes, sorry.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Wenlu Wang (Kingwl) added 2 commits July 9, 2021 14:06
@Kingwl
Merge branch 'main' into item_method_new
25d33e5
@Kingwl
Fix lib reference
0e27ccb
felipeplets
Felipe Plets (felipeplets) approved these changes Jul 17, 2021
View reviewed changes

@felipeplets Felipe Plets (felipeplets) left a comment

Copy link
Copy Markdown

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

LGTM

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@lucacasonato Luca Casonato (lucacasonato) mentioned this pull request Jul 18, 2021
Array.at and friends not available for typechecking denoland/deno#11441
Closed
@sandersn

Nathan Shively-Sanders (sandersn) commented Aug 20, 2021 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

We discussed this in the design meeting and concluded:

  1. at should return T | undefined, as this PR does.
  2. The compiler should add support for negative indices on tuples, along with special support for at to work the same way. Something like
declare let t: [string, number]
let n = t.at(-1) // n: number
type TN = (typeof t)[-1] // also number?
// and perhaps even
declare let t2: [...string, number]
let n2 = t.at(-1)

Though the second example would require adding quite a bit more code to the checker.

I expect Daniel Rosenwasser (@DanielRosenwasser) will link the notes when he's done preparing them.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

sandersn
Nathan Shively-Sanders (sandersn) approved these changes Aug 20, 2021
View reviewed changes
@sandersn

Nathan Shively-Sanders (sandersn) commented Aug 20, 2021

Copy link
Copy Markdown
Member

Ron Buckton (@rbuckton) Can you take another look and merge if all your comments have been addressed?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@rbuckton

Ron Buckton (rbuckton) commented Feb 1, 2022

Copy link
Copy Markdown
Contributor

It looks like a different PR was merged that already addressed this: #46291

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@rbuckton Ron Buckton (rbuckton) closed this Feb 1, 2022
@microsoft Microsoft (microsoft) locked as resolved and limited conversation to collaborators Oct 21, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Reviewers

@sandersn Nathan Shively-Sanders (sandersn) sandersn approved these changes
+4 more reviewers
@Jack-Works Jack Works (Jack-Works) Jack-Works left review comments
@rbuckton Ron Buckton (rbuckton) rbuckton requested changes
@felipeplets Felipe Plets (felipeplets) felipeplets approved these changes
Reviewers whose approvals may not affect merge requirements

Uh oh!

There was an error while loading. Please reload this page.

Assignees

@rbuckton Ron Buckton (rbuckton)

Labels

For Milestone Bug PRs that fix a bug with a specific milestone

Projects

PR Backlog
Archived in project

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Add support of Item method (stage 3)

Uh oh!

There was an error while loading. Please reload this page.

6 participants

@Kingwl @Jack-Works @rbuckton @typescript-bot @sandersn @felipeplets
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.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.