Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add promise.any #33844

Merged
merged 6 commits into from
Mar 11, 2020
Merged

add promise.any #33844

merged 6 commits into from
Mar 11, 2020

Conversation

Kingwl
Copy link
Contributor

@Kingwl Kingwl commented Oct 7, 2019

Fixes #33843

BTW: #31085

@Kingwl Kingwl force-pushed the promise-prototype-any branch from 7ee1d7f to 708449f Compare October 7, 2019 09:35
@Kingwl Kingwl force-pushed the promise-prototype-any branch from 708449f to d5160d1 Compare October 7, 2019 09:56
@Kingwl Kingwl force-pushed the promise-prototype-any branch from 20c3784 to 0f8f9f0 Compare October 16, 2019 09:08
@Kingwl Kingwl changed the title add promise.prototype.any add promise.any Oct 28, 2019
@sandersn sandersn added the For Milestone Bug PRs that fix a bug with a specific milestone label Feb 1, 2020
Copy link
Member

@sandersn sandersn left a comment

Choose a reason for hiding this comment

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

@Kingwl This looks good; I'll merge it as soon as you update the jsdoc. (I'm not sure my suggestion is the best -- it might be possible to condense the wording overall.)

@sandersn
Copy link
Member

A baseline needed to be updated after the merge from master. I'll merge this after CI finishes running.

@sandersn sandersn merged commit 20625a9 into microsoft:master Mar 11, 2020
@mt-yannick
Copy link

mt-yannick commented Jun 8, 2020

Hi, I am able to compile successfully but at runtime, I receive a Promise.any is undefined error. I am using typescript 3.9.5 in my project. This is my tsconfig:

{
  "compilerOptions": {
    "target": "ES6",
    "module": "commonjs",
    "strict": true,
    "esModuleInterop": true,
    "outDir": "dist",
    "lib": [
      "dom",
      "esnext",
      "esnext.promise"
    ],
    "noUnusedLocals": true,
    "noUnusedParameters": true,
    "noImplicitReturns": true,
    "noFallthroughCasesInSwitch": true,
    "forceConsistentCasingInFileNames": true,
    "inlineSourceMap": true,
  }
}

Any feedback would be much appreciated.

@alt1o
Copy link

alt1o commented Aug 10, 2020

Hi, I am able to compile successfully but at runtime, I receive a Promise.any is undefined error. I am using typescript 3.9.5 in my project. This is my tsconfig:

{
  "compilerOptions": {
    "target": "ES6",
    "module": "commonjs",
    "strict": true,
    "esModuleInterop": true,
    "outDir": "dist",
    "lib": [
      "dom",
      "esnext",
      "esnext.promise"
    ],
    "noUnusedLocals": true,
    "noUnusedParameters": true,
    "noImplicitReturns": true,
    "noFallthroughCasesInSwitch": true,
    "forceConsistentCasingInFileNames": true,
    "inlineSourceMap": true,
  }
}

Any feedback would be much appreciated.

same with me. typescript 3.9.7

@sandersn
Copy link
Member

@mt-yannick @alongite what VM are you using? I looked at https://caniuse.com/#search=Promise.any and it's only on recent versions of Chrome and Firefox as far as I can tell. It's not in Node 14 yet.

@mt-yannick
Copy link

@sandersn Oh! Thank you for clarifying!! So if I understand correctly, this PR implements the types for Promise.any, and specifying "esnext.promise" in compilerOptions.libs will make the compiler aware that Promise.any exists, but we are still responsible for assuring that an implementation exists!

sandersn added a commit that referenced this pull request Oct 7, 2020
sandersn added a commit that referenced this pull request Oct 7, 2020
@sandersn
Copy link
Member

sandersn commented Oct 7, 2020

@mt-yannick yes, that's exactly right. Stuff in "esnext" is going to be very new, so you may need to provide your own polyfill.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
For Milestone Bug PRs that fix a bug with a specific milestone
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

proposal-promise-any
5 participants