Merge branch 'main' into copilot/fix-61714-2

This commit is contained in:
Wesley Wigham 2025-07-31 17:15:28 -07:00 committed by GitHub
commit 606bc4bbac
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
290 changed files with 26112 additions and 6085 deletions

View File

@ -1,4 +1,4 @@
# TypeScript Test Writing Guide for Copilot
# Guide for Copilot
This document provides a concise guide for writing TypeScript fourslash tests and compiler tests, along with build instructions.
@ -6,23 +6,22 @@ This document provides a concise guide for writing TypeScript fourslash tests an
### Setup
1. Install Node.js (current or LTS)
2. Install hereby: `npm install -g hereby`
3. Clone the repository: `git clone --depth=1 https://github.com/microsoft/TypeScript`
4. Install dependencies: `npm ci`
2. Clone the repository: `git clone --depth=1 https://github.com/microsoft/TypeScript`
3. Install dependencies: `npm ci`
### Common Build Tasks
```bash
hereby local # Build the compiler into built/local
hereby clean # Delete the built compiler
hereby tests # Build the test infrastructure
hereby runtests # Run all tests
hereby runtests-parallel # Run tests in parallel (recommended)
hereby runtests --runner=fourslash # Run only fourslash tests
hereby runtests --runner=compiler # Run only compiler tests
hereby runtests --tests=<testPath> # Run specific test
hereby baseline-accept # Accept new test baselines
hereby lint # Run eslint
hereby format # Run code formatting
npx hereby local # Build the compiler into built/local
npx hereby clean # Delete the built compiler
npx hereby tests # Build the test infrastructure
npx hereby runtests # Run all tests
npx hereby runtests-parallel # Run tests in parallel 🚨 MANDATORY BEFORE FINISHING!
npx hereby runtests --runner=fourslash # Run only fourslash tests
npx hereby runtests --runner=compiler # Run only compiler tests
npx hereby runtests --tests=<testPath> # Run specific test
npx hereby baseline-accept # Accept new test baselines
npx hereby lint # Run eslint 🚨 MANDATORY BEFORE FINISHING!
npx hereby format # Run code formatting 🚨 MANDATORY BEFORE FINISHING!
```
## Fourslash Test Syntax Guide
@ -248,30 +247,69 @@ const config3: Config = { optional: 42 }; // Should error - missing required
```bash
# Run a specific fourslash test
hereby runtests --tests=tests/cases/fourslash/completionForObjectProperty.ts
npx hereby runtests --tests=tests/cases/fourslash/completionForObjectProperty.ts
# Run a specific compiler test
hereby runtests --tests=tests/cases/compiler/abstractClassUnionInstantiation.ts
npx hereby runtests --tests=tests/cases/compiler/abstractClassUnionInstantiation.ts
# Run tests matching a pattern
hereby runtests --tests=tests/cases/fourslash/completion*.ts
npx hereby runtests --tests=tests/cases/fourslash/completion*.ts
```
## Important Guidelines
### 🚨 CRITICAL: Before Finishing Your Work 🚨
**THESE STEPS ARE MANDATORY BEFORE COMMITTING/PUSHING ANY CHANGES:**
1. **MUST RUN:** `npx hereby runtests-parallel` (even though it takes 10-15 minutes)
2. **MUST RUN:** `npx hereby lint` and fix ALL lint issues
3. **MUST RUN:** `npx hereby format` as the final step
**❌ PRs that fail these checks will be rejected without review.**
### Keeping Things Tidy
- You can assume lint, tests, and formatting are clean on a fresh clone
- Only run these verification steps AFTER making changes to code
- Run `npx hereby lint` and fix ALL issues after making changes
- Run `npx hereby format` as your final step after making changes
### Test Locations
- Only add testcases in `tests/cases/compiler` or `tests/cases/fourslash`
- Filenames in `tests/cases/compiler` must always end with `.ts`, not `.d.ts`
- Do not write direct unit tests as they are almost never the correct test format for our repo
### Performance Expectations
- Running a set of tests may take up to 4 minutes
- A full test run may take up to 15 minutes
- Always run `hereby lint` and `hereby format` before you're done
### Working with Issues
- Maintainer comments in the issue should generally take priority over OP's comments
- Maintainers might give you hints on where to start. They are not always right, but a good place to start
### Debugging Tips
printf debugging is going to be very useful as you are figuring things out.
To do this, use `console.log`, but you'll need to `ts-ignore` it.
Write something like this:
```ts,diff
function checkSomething(n: Node) {
doSomething(n);
+ // @ts-ignore DEBUG CODE ONLY, REMOVE ME WHEN DONE
+ console.log(`Got node with pos = ${n.pos}`);
doSomethingElse(n);
}
```
We have a lot of enums so you might want to print back their symbolic name, to do this, index back into the name of the enum
```ts
// @ts-ignore DEBUG CODE ONLY, REMOVE ME WHEN DONE
console.log(`Got node with kind = ${SyntaxKind[n.kind]}`);
```
## Recommended Workflow
When fixing bugs or implementing features, follow this workflow:
@ -287,6 +325,18 @@ When fixing bugs or implementing features, follow this workflow:
- Ensure the baselines change in a way that demonstrates that the bug is fixed
- Put this baseline diff in its own commit
4. **Run all other tests to ensure you didn't break anything**
- Some collateral baseline changes are normal
4. **Add more testing**
- Once you've got the basics figured out, enhance your test to cover edge cases and other variations
- Run the test again and commit the baseline diff along with the test edit
5. **🚨 MANDATORY: Run all other tests to ensure you didn't break anything**
- **REQUIRED:** Run `npx hereby runtests-parallel` and wait for it to finish (10-15 minutes is normal!)
- **THIS STEP CANNOT BE SKIPPED** - patience is essential!
- Some collateral baseline changes are normal, but review for correctness
- Put these diffs in another commit
6. **🚨 MANDATORY: Lint and format your changes**
- **REQUIRED:** Run `npx hereby lint` and fix ALL issues
- **REQUIRED:** Run `npx hereby format` before you're done
- **YOU CANNOT FINISH WITHOUT THESE STEPS**
- Double-check your line endings. Source files in this repo typically use CRLF line endings. Fix all line endings to be consistent before you wrap up

View File

@ -1,4 +1,4 @@
name: Accept Baselines and Fix Lints
name: Accept Baselines, Fix Lints, and Format
on:
workflow_dispatch: {}
@ -32,8 +32,9 @@ jobs:
git rm -r --quiet tests/baselines/reference
npx hereby runtests-parallel --ci --fix || true
npx hereby baseline-accept
npx hereby format
git add ./src
git add ./tests/baselines/reference
git diff --cached
git commit -m "Update Baselines and/or Applied Lint Fixes"
git commit -m "Update Baselines, Applied Lint Fixes, and/or Formatted"
git push

View File

@ -9,6 +9,10 @@ on:
branches:
- main
- release-*
merge_group:
branches:
- main
# - release-*
permissions:
contents: read
@ -24,43 +28,107 @@ jobs:
strategy:
fail-fast: false
matrix:
os:
- ubuntu-latest
- windows-latest
- macos-latest
node-version:
- '22'
- '20'
- '18'
- '16'
- '14'
bundle:
- 'true'
include:
- node-version: 'lts/*'
bundle: false
os: ubuntu-latest
exclude:
# No Node 14 on ARM macOS
- node-version: '14'
os: macos-latest
config:
# Main builds
- os: ubuntu-latest
node-version: '24'
bundle: true
runs-on: ${{ matrix.os }}
name: Test Node ${{ matrix.node-version }} on ${{ matrix.os }}${{ (!matrix.bundle && ' with --no-bundle') || '' }}
# Other builds (skipped in merge queues)
- os: windows-latest
node-version: '24'
bundle: true
skip: ${{ github.event_name == 'merge_group' }}
- os: macos-latest
node-version: '24'
bundle: true
skip: ${{ github.event_name == 'merge_group' }}
- os: ubuntu-latest
node-version: '22'
bundle: true
- os: windows-latest
node-version: '22'
bundle: true
skip: ${{ github.event_name == 'merge_group' }}
# Skip macOS for this version; resources are limited.
# - os: macos-latest
# node-version: '22'
# bundle: true
# skip: ${{ github.event_name == 'merge_group' }}
- os: ubuntu-latest
node-version: '20'
bundle: true
- os: windows-latest
node-version: '20'
bundle: true
skip: ${{ github.event_name == 'merge_group' }}
# Skip macOS for this version; resources are limited.
# - os: macos-latest
# node-version: '20'
# bundle: true
# skip: ${{ github.event_name == 'merge_group' }}
- os: ubuntu-latest
node-version: '18'
bundle: true
- os: windows-latest
node-version: '18'
bundle: true
skip: ${{ github.event_name == 'merge_group' }}
# Skip macOS for this version; resources are limited.
# - os: macos-latest
# node-version: '18'
# bundle: true
# skip: ${{ github.event_name == 'merge_group' }}
- os: ubuntu-latest
node-version: '16'
bundle: true
- os: windows-latest
node-version: '16'
bundle: true
skip: ${{ github.event_name == 'merge_group' }}
- os: macos-latest
node-version: '16'
bundle: true
skip: ${{ github.event_name == 'merge_group' }}
- os: ubuntu-latest
node-version: '14'
bundle: true
skip: ${{ github.event_name == 'merge_group' }}
- os: windows-latest
node-version: '14'
bundle: true
skip: ${{ github.event_name == 'merge_group' }}
# No Node 14 on ARM macOS
# - os: macos-latest
# node-version: '14'
# bundle: true
# skip: ${{ github.event_name == 'merge_group' }}
- os: ubuntu-latest
node-version: 'lts/*'
bundle: false
skip: ${{ github.event_name == 'merge_group' }}
exclude:
- config:
skip: true
runs-on: ${{ matrix.config.os }}
name: Test Node ${{ matrix.config.node-version }} on ${{ matrix.config.os }}${{ (!matrix.config.bundle && ' with --no-bundle') || '' }}
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Use node version ${{ matrix.node-version }}
- name: Use node version ${{ matrix.config.node-version }}
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
with:
node-version: ${{ matrix.node-version }}
node-version: ${{ matrix.config.node-version }}
check-latest: true
- run: npm ci
- name: Tests
id: test
# run tests, but lint separately
run: npm run test -- --no-lint --bundle=${{ matrix.bundle }}
run: npm run test -- --no-lint --bundle=${{ matrix.config.bundle }}
- name: Print baseline diff on failure
if: ${{ failure() && steps.test.conclusion == 'failure' }}
@ -70,6 +138,8 @@ jobs:
git diff --staged --exit-code
coverage:
if: ${{ github.event_name != 'merge_group' }}
runs-on:
- 'self-hosted'
- '1ES.Pool=TypeScript-1ES-GitHub-Large'
@ -95,7 +165,7 @@ jobs:
name: coverage
path: coverage
- uses: codecov/codecov-action@ad3126e916f78f00edff4ed0317cf185271ccc2d # v5.4.2
- uses: codecov/codecov-action@18283e04ce6e62d37312384ff67231eb8fd56d24 # v5.4.3
with:
use_oidc: ${{ !(github.event_name == 'pull_request' && github.event.pull_request.head.repo.fork) }}
disable_search: true
@ -294,6 +364,8 @@ jobs:
run: npx hereby build-src --built
baselines:
if: ${{ github.event_name != 'merge_group' }}
runs-on: ubuntu-latest
steps:
@ -338,3 +410,27 @@ jobs:
with:
name: fix_baselines.patch
path: fix_baselines.patch
required:
runs-on: ubuntu-latest
if: ${{ always() }}
needs:
- test
- coverage
- lint
- knip
- format
- browser-integration
- typecheck
- smoke
- package-size
- misc
- self-check
- baselines
steps:
- name: Check required jobs
env:
NEEDS: ${{ toJson(needs) }}
run: |
! echo $NEEDS | jq -e 'to_entries[] | { job: .key, result: .value.result } | select((.result == "success" or .result == "skipped") | not)'

View File

@ -46,7 +46,7 @@ jobs:
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@45775bd8235c68ba998cffa5171334d58593da47 # v3.28.15
uses: github/codeql-action/init@39edc492dbe16b1465b0cafca41432d857bdb31a # v3.29.1
with:
config-file: ./.github/codeql/codeql-configuration.yml
# Override language selection by uncommenting this and choosing your languages
@ -56,7 +56,7 @@ jobs:
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below).
- name: Autobuild
uses: github/codeql-action/autobuild@45775bd8235c68ba998cffa5171334d58593da47 # v3.28.15
uses: github/codeql-action/autobuild@39edc492dbe16b1465b0cafca41432d857bdb31a # v3.29.1
# Command-line programs to run using the OS shell.
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
@ -70,4 +70,4 @@ jobs:
# make release
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@45775bd8235c68ba998cffa5171334d58593da47 # v3.28.15
uses: github/codeql-action/analyze@39edc492dbe16b1465b0cafca41432d857bdb31a # v3.29.1

View File

@ -0,0 +1,22 @@
name: 'Copilot Setup Steps'
on: workflow_dispatch
jobs:
# The job MUST be called `copilot-setup-steps` or it will not be picked up by Copilot.
copilot-setup-steps:
runs-on: ubuntu-latest
# Set the permissions to the lowest permissions possible needed for your steps.
# Copilot will be given its own token for its operations.
permissions:
# If you want to clone the repository as part of your setup steps, for example to install dependencies, you'll need the `contents: read` permission. If you don't clone the repository in your setup steps, Copilot will do this for you automatically after the steps complete.
contents: read
# You can define any steps you want, and they will run before the agent starts.
# If you do not check out your code, Copilot will do this for you.
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
- run: npm ci
# pull dprint caches before network access is blocked
- run: npx hereby check-format || true

View File

@ -30,7 +30,7 @@ jobs:
# corepack enable npm
npm install -g $(jq -r '.packageManager' < package.json)
npm --version
- name: Setup and publish nightly
- name: Setup and test nightly
run: |
npm ci
npx hereby configure-nightly

View File

@ -34,7 +34,7 @@ jobs:
persist-credentials: false
- name: 'Run analysis'
uses: ossf/scorecard-action@f49aabe0b5af0936a0987cfb85d86b75731b0186 # v2.4.1
uses: ossf/scorecard-action@05b42c624433fc40578a4040d5cf5e36ddca8cde # v2.4.2
with:
results_file: results.sarif
results_format: sarif
@ -55,6 +55,6 @@ jobs:
# Upload the results to GitHub's code scanning dashboard.
- name: 'Upload to code-scanning'
uses: github/codeql-action/upload-sarif@45775bd8235c68ba998cffa5171334d58593da47 # v3.28.15
uses: github/codeql-action/upload-sarif@39edc492dbe16b1465b0cafca41432d857bdb31a # v3.29.1
with:
sarif_file: results.sarif

View File

@ -3,6 +3,8 @@ name: Twoslash Code Sample Repros
on:
schedule:
- cron: '0 8 * * *'
repository_dispatch:
types: [run-twoslash-repros]
workflow_dispatch:
inputs:
issue:

View File

@ -3,17 +3,25 @@ pr: none
parameters:
- name: _REMINDER
default: Review & undraft the release at https://github.com/microsoft/TypeScript/releases once it appears!
displayName: Review & undraft the release at https://github.com/microsoft/TypeScript/releases once it appears!
type: boolean
default: true
- name: PUBLISH_TAG
displayName: npm publish tag
default: dev
values:
- dev
- beta
- rc
- latest
- name: RELEASE_TITLE_NAME
displayName: GitHub release title name
default: 0.0.0 Test
- name: TAG_NAME
displayName: Git tag name
default: v0.0.0-SetMe
variables:
- name: _REMINDER
value: ${{ parameters._REMINDER }}
- name: PUBLISH_TAG
value: ${{ parameters.PUBLISH_TAG }}
- name: RELEASE_TITLE_NAME
@ -47,11 +55,11 @@ extends:
os: windows
stages:
- stage: Stage_1
displayName: Publish tarball
- stage: Publish
displayName: Publish
jobs:
- job: Job_1
displayName: Agent job
- job: tarball
displayName: Publish tarball
condition: succeeded()
timeoutInMinutes: 0
templateContext:
@ -66,12 +74,12 @@ extends:
steps:
- checkout: none
- task: CmdLine@2
displayName: Rename versioned drop to typescript.tgz
displayName: Copy versioned drop to typescript.tgz
inputs:
script: |
pushd $(Pipeline.Workspace)/tgz
ls -lhR
mv typescript-*.tgz typescript.tgz
cp typescript-*.tgz typescript.tgz
- task: Npm@1
displayName: npm publish tarball
inputs:
@ -79,16 +87,13 @@ extends:
workingDir: $(Pipeline.Workspace)/tgz
verbose: false
customCommand: publish $(Pipeline.Workspace)/tgz/typescript.tgz --tag $(PUBLISH_TAG)
# This must match the service connection.
# This must match the service connection name.
customEndpoint: Typescript NPM
publishEndpoint: Typescript NPM
- stage: Stage_2
displayName: Publish git tag
dependsOn: Stage_1
jobs:
- job: Job_1
displayName: Agent job
- job: github
displayName: Create github release
dependsOn: tarball
condition: succeeded()
timeoutInMinutes: 0
templateContext:
@ -104,7 +109,7 @@ extends:
- task: GitHubRelease@1
displayName: GitHub release (create)
inputs:
# This must match the service connection.
# This must match the service connection name.
gitHubConnection: typescript-bot connection
repositoryName: microsoft/TypeScript
tagSource: userSpecifiedTag
@ -112,12 +117,14 @@ extends:
title: TypeScript $(RELEASE_TITLE_NAME)
releaseNotesSource: inline
releaseNotesInline: |
<!---
For release notes, check out the [release announcement]().
For new features, check out the [What's new in TypeScript $(TAG_NAME)]().
For the complete list of fixed issues, check out the
* [fixed issues query for TypeScript $(TAG_NAME)](https://github.com/microsoft/TypeScript/issues?utf8=%E2%9C%93&q=is%3Aissue+milestone%3A%22TypeScript+3.3%22+is%3Aclosed+).
Downloads are available on:
* [npm](https://www.npmjs.com/package/typescript)
-->
assets: $(Pipeline.Workspace)/tgz/**/typescript-*.tgz
isDraft: true
isDraft: ${{ not(eq(parameters.PUBLISH_TAG, 'latest')) }}
addChangeLog: false

4
package-lock.json generated
View File

@ -1,12 +1,12 @@
{
"name": "typescript",
"version": "5.9.0",
"version": "6.0.0",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "typescript",
"version": "5.9.0",
"version": "6.0.0",
"license": "Apache-2.0",
"bin": {
"tsc": "bin/tsc",

View File

@ -2,7 +2,7 @@
"name": "typescript",
"author": "Microsoft Corp.",
"homepage": "https://www.typescriptlang.org/",
"version": "5.9.0",
"version": "6.0.0",
"license": "Apache-2.0",
"description": "TypeScript is a language for application scale JavaScript development",
"keywords": [

View File

@ -467,6 +467,7 @@ import {
IntroducesNewScopeNode,
isAccessExpression,
isAccessor,
isAccessorModifier,
isAliasableExpression,
isAmbientModule,
isArray,
@ -709,6 +710,7 @@ import {
isPrivateIdentifier,
isPrivateIdentifierClassElementDeclaration,
isPrivateIdentifierPropertyAccessExpression,
isPrivateIdentifierSymbol,
isPropertyAccessEntityNameExpression,
isPropertyAccessExpression,
isPropertyAccessOrQualifiedName,
@ -2180,6 +2182,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
};
var anyIterationTypes = createIterationTypes(anyType, anyType, anyType);
var silentNeverIterationTypes = createIterationTypes(silentNeverType, silentNeverType, silentNeverType);
var asyncIterationTypesResolver: IterationTypesResolver = {
iterableCacheKey: "iterationTypesOfAsyncIterable",
@ -2526,6 +2529,20 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
return diagnostic;
}
function getVerbatimModuleSyntaxErrorMessage(node: Node): DiagnosticMessage {
const sourceFile = getSourceFileOfNode(node);
const fileName = sourceFile.fileName;
// Check if the file is .cts or .cjs (CommonJS-specific extensions)
if (fileExtensionIsOneOf(fileName, [Extension.Cts, Extension.Cjs])) {
return Diagnostics.ECMAScript_imports_and_exports_cannot_be_written_in_a_CommonJS_file_under_verbatimModuleSyntax;
}
else {
// For .ts, .tsx, .js, etc.
return Diagnostics.ECMAScript_imports_and_exports_cannot_be_written_in_a_CommonJS_file_under_verbatimModuleSyntax_Adjust_the_type_field_in_the_nearest_package_json_to_make_this_file_an_ECMAScript_module_or_adjust_your_verbatimModuleSyntax_module_and_moduleResolution_settings_in_TypeScript;
}
}
function addErrorOrSuggestion(isError: boolean, diagnostic: Diagnostic) {
if (isError) {
diagnostics.add(diagnostic);
@ -5981,7 +5998,14 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
return addVisibleAlias(declaration, declaration.parent.parent.parent.parent);
}
else if (symbol.flags & SymbolFlags.BlockScopedVariable) {
const variableStatement = findAncestor(declaration, isVariableStatement)!;
const rootDeclaration = walkUpBindingElementsAndPatterns(declaration);
if (rootDeclaration.kind === SyntaxKind.Parameter) {
return false;
}
const variableStatement = rootDeclaration.parent.parent;
if (variableStatement.kind !== SyntaxKind.VariableStatement) {
return false;
}
if (hasSyntacticModifier(variableStatement, ModifierFlags.Export)) {
return true;
}
@ -6147,7 +6171,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
verbosityLevel?: number,
out?: WriterContextOut,
): string {
const noTruncation = compilerOptions.noErrorTruncation ||
const noTruncation = !maximumLength && compilerOptions.noErrorTruncation ||
flags & TypeFormatFlags.NoTruncation;
const typeNode = nodeBuilder.typeToTypeNode(
type,
@ -7587,6 +7611,9 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
if (getDeclarationModifierFlagsFromSymbol(propertySymbol) & (ModifierFlags.Private | ModifierFlags.Protected) && context.tracker.reportPrivateInBaseOfClassExpression) {
context.tracker.reportPrivateInBaseOfClassExpression(unescapeLeadingUnderscores(propertySymbol.escapedName));
}
if (isPrivateIdentifierSymbol(propertySymbol) && context.tracker.reportPrivateInBaseOfClassExpression) {
context.tracker.reportPrivateInBaseOfClassExpression(idText((propertySymbol.valueDeclaration! as NamedDeclaration).name! as PrivateIdentifier));
}
}
if (checkTruncationLength(context) && (i + 2 < properties.length - 1)) {
context.out.truncated = true;
@ -7682,27 +7709,51 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
if (propertySymbol.flags & SymbolFlags.Accessor) {
const writeType = getWriteTypeOfSymbol(propertySymbol);
if (propertyType !== writeType && !isErrorType(propertyType) && !isErrorType(writeType)) {
if (!isErrorType(propertyType) && !isErrorType(writeType)) {
const symbolMapper = getSymbolLinks(propertySymbol).mapper;
const getterDeclaration = getDeclarationOfKind<GetAccessorDeclaration>(propertySymbol, SyntaxKind.GetAccessor)!;
const getterSignature = getSignatureFromDeclaration(getterDeclaration);
typeElements.push(
setCommentRange(
context,
signatureToSignatureDeclarationHelper(symbolMapper ? instantiateSignature(getterSignature, symbolMapper) : getterSignature, SyntaxKind.GetAccessor, context, { name: propertyName }) as GetAccessorDeclaration,
getterDeclaration,
),
);
const setterDeclaration = getDeclarationOfKind<SetAccessorDeclaration>(propertySymbol, SyntaxKind.SetAccessor)!;
const setterSignature = getSignatureFromDeclaration(setterDeclaration);
typeElements.push(
setCommentRange(
context,
signatureToSignatureDeclarationHelper(symbolMapper ? instantiateSignature(setterSignature, symbolMapper) : setterSignature, SyntaxKind.SetAccessor, context, { name: propertyName }) as SetAccessorDeclaration,
setterDeclaration,
),
);
return;
const propDeclaration = getDeclarationOfKind<PropertyDeclaration>(propertySymbol, SyntaxKind.PropertyDeclaration);
if (propertyType !== writeType || propertySymbol.parent!.flags & SymbolFlags.Class && !propDeclaration) {
const getterDeclaration = getDeclarationOfKind<GetAccessorDeclaration>(propertySymbol, SyntaxKind.GetAccessor);
if (getterDeclaration) {
const getterSignature = getSignatureFromDeclaration(getterDeclaration);
typeElements.push(
setCommentRange(
context,
signatureToSignatureDeclarationHelper(symbolMapper ? instantiateSignature(getterSignature, symbolMapper) : getterSignature, SyntaxKind.GetAccessor, context, { name: propertyName }) as GetAccessorDeclaration,
getterDeclaration,
),
);
}
const setterDeclaration = getDeclarationOfKind<SetAccessorDeclaration>(propertySymbol, SyntaxKind.SetAccessor);
if (setterDeclaration) {
const setterSignature = getSignatureFromDeclaration(setterDeclaration);
typeElements.push(
setCommentRange(
context,
signatureToSignatureDeclarationHelper(symbolMapper ? instantiateSignature(setterSignature, symbolMapper) : setterSignature, SyntaxKind.SetAccessor, context, { name: propertyName }) as SetAccessorDeclaration,
setterDeclaration,
),
);
}
return;
}
if (propertySymbol.parent!.flags & SymbolFlags.Class && propDeclaration && find(propDeclaration.modifiers, isAccessorModifier)) {
const fakeGetterSignature = createSignature(/*declaration*/ undefined, /*typeParameters*/ undefined, /*thisParameter*/ undefined, emptyArray, propertyType, /*resolvedTypePredicate*/ undefined, 0, SignatureFlags.None);
typeElements.push(
setCommentRange(
context,
signatureToSignatureDeclarationHelper(fakeGetterSignature, SyntaxKind.GetAccessor, context, { name: propertyName }) as GetAccessorDeclaration,
propDeclaration,
),
);
const setterParam = createSymbol(SymbolFlags.FunctionScopedVariable, "arg" as __String);
setterParam.links.type = writeType;
const fakeSetterSignature = createSignature(/*declaration*/ undefined, /*typeParameters*/ undefined, /*thisParameter*/ undefined, [setterParam], voidType, /*resolvedTypePredicate*/ undefined, 0, SignatureFlags.None);
typeElements.push(
signatureToSignatureDeclarationHelper(fakeSetterSignature, SyntaxKind.SetAccessor, context, { name: propertyName }) as SetAccessorDeclaration,
);
return;
}
}
}
@ -12808,13 +12859,14 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
*/
function getWriteTypeOfSymbol(symbol: Symbol): Type {
const checkFlags = getCheckFlags(symbol);
if (checkFlags & CheckFlags.SyntheticProperty) {
return checkFlags & CheckFlags.DeferredType ?
getWriteTypeOfSymbolWithDeferredType(symbol) || getTypeOfSymbolWithDeferredType(symbol) :
// NOTE: cast to TransientSymbol should be safe because only TransientSymbols can have CheckFlags.SyntheticProperty
(symbol as TransientSymbol).links.writeType || (symbol as TransientSymbol).links.type!;
}
if (symbol.flags & SymbolFlags.Property) {
return checkFlags & CheckFlags.SyntheticProperty ?
checkFlags & CheckFlags.DeferredType ?
getWriteTypeOfSymbolWithDeferredType(symbol) || getTypeOfSymbolWithDeferredType(symbol) :
// NOTE: cast to TransientSymbol should be safe because only TransientSymbols can have CheckFlags.SyntheticProperty
(symbol as TransientSymbol).links.writeType || (symbol as TransientSymbol).links.type! :
removeMissingType(getTypeOfSymbol(symbol), !!(symbol.flags & SymbolFlags.Optional));
return removeMissingType(getTypeOfSymbol(symbol), !!(symbol.flags & SymbolFlags.Optional));
}
if (symbol.flags & SymbolFlags.Accessor) {
return checkFlags & CheckFlags.Instantiated ?
@ -15431,6 +15483,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
}
function createUnionOrIntersectionProperty(containingType: UnionOrIntersectionType, name: __String, skipObjectFunctionPropertyAugment?: boolean): Symbol | undefined {
let propFlags = SymbolFlags.None;
let singleProp: Symbol | undefined;
let propSet: Map<SymbolId, Symbol> | undefined;
let indexTypes: Type[] | undefined;
@ -15457,6 +15510,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
}
if (!singleProp) {
singleProp = prop;
propFlags = (prop.flags & SymbolFlags.Accessor) || SymbolFlags.Property;
}
else if (prop !== singleProp) {
const isInstantiation = (getTargetSymbol(prop) || prop) === (getTargetSymbol(singleProp) || singleProp);
@ -15479,6 +15533,13 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
propSet.set(id, prop);
}
}
// classes created by mixins are represented as intersections
// and overriding a property in a derived class redefines it completely at runtime
// so a get accessor can't be merged with a set accessor in a base class,
// for that reason the accessor flags are only used when they are the same in all constituents
if (propFlags & SymbolFlags.Accessor && (prop.flags & SymbolFlags.Accessor) !== (propFlags & SymbolFlags.Accessor)) {
propFlags = (propFlags & ~SymbolFlags.Accessor) | SymbolFlags.Property;
}
}
if (isUnion && isReadonlySymbol(prop)) {
checkFlags |= CheckFlags.Readonly;
@ -15497,6 +15558,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
else if (isUnion) {
const indexInfo = !isLateBoundName(name) && getApplicableIndexInfoForName(type, name);
if (indexInfo) {
propFlags = (propFlags & ~SymbolFlags.Accessor) | SymbolFlags.Property;
checkFlags |= CheckFlags.WritePartial | (indexInfo.isReadonly ? CheckFlags.Readonly : 0);
indexTypes = append(indexTypes, isTupleType(type) ? getRestTypeOfTupleType(type) || undefinedType : indexInfo.type);
}
@ -15575,7 +15637,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
propTypes.push(type);
}
addRange(propTypes, indexTypes);
const result = createSymbol(SymbolFlags.Property | (optionalFlag ?? 0), name, syntheticFlag | checkFlags);
const result = createSymbol(propFlags | (optionalFlag ?? 0), name, syntheticFlag | checkFlags);
result.links.containingType = containingType;
if (!hasNonUniformValueDeclaration && firstValueDeclaration) {
result.valueDeclaration = firstValueDeclaration;
@ -25340,11 +25402,21 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
// right is a supertype.
const superTypeOrUnion = literalTypesWithSameBaseType(primaryTypes) ?
getUnionType(primaryTypes) :
reduceLeft(primaryTypes, (s, t) => isTypeSubtypeOf(s, t) ? t : s)!;
getSingleCommonSupertype(primaryTypes);
// Add any nullable types that occurred in the candidates back to the result.
return primaryTypes === types ? superTypeOrUnion : getNullableType(superTypeOrUnion, getCombinedTypeFlags(types) & TypeFlags.Nullable);
}
function getSingleCommonSupertype(types: Type[]) {
// First, find the leftmost type for which no type to the right is a strict supertype, and if that
// type is a strict supertype of all other candidates, return it. Otherwise, return the leftmost type
// for which no type to the right is a (regular) supertype.
const candidate = reduceLeft(types, (s, t) => isTypeStrictSubtypeOf(s, t) ? t : s)!;
return every(types, t => t === candidate || isTypeStrictSubtypeOf(t, candidate)) ?
candidate :
reduceLeft(types, (s, t) => isTypeSubtypeOf(s, t) ? t : s)!;
}
// Return the leftmost type for which no type to the right is a subtype.
function getCommonSubtype(types: Type[]) {
return reduceLeft(types, (s, t) => isTypeSubtypeOf(t, s) ? t : s)!;
@ -32687,6 +32759,10 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
function popContextualType() {
contextualTypeCount--;
// Clear out the popped element's referenced objects.
contextualTypeNodes[contextualTypeCount] = undefined!;
contextualTypes[contextualTypeCount] = undefined;
contextualIsCache[contextualTypeCount] = undefined!;
}
function findContextualNode(node: Node, includeCaches: boolean) {
@ -32706,6 +32782,8 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
function popInferenceContext() {
inferenceContextCount--;
inferenceContextNodes[inferenceContextCount] = undefined!;
inferenceContexts[inferenceContextCount] = undefined;
}
function getInferenceContext(node: Node) {
@ -32718,12 +32796,15 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
function pushActiveMapper(mapper: TypeMapper) {
activeTypeMappers[activeTypeMappersCount] = mapper;
activeTypeMappersCaches[activeTypeMappersCount] = new Map();
activeTypeMappersCaches[activeTypeMappersCount] ??= new Map();
activeTypeMappersCount++;
}
function popActiveMapper() {
activeTypeMappersCount--;
// Clear out the popped element's referenced objects.
activeTypeMappers[activeTypeMappersCount] = undefined!;
activeTypeMappersCaches[activeTypeMappersCount].clear();
}
function findActiveMapper(mapper: TypeMapper) {
@ -36404,7 +36485,12 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
// reorderCandidates fills up the candidates array directly
reorderCandidates(signatures, candidates, callChainFlags);
if (!isJsxOpenFragment) {
Debug.assert(candidates.length, "Revert #54442 and add a testcase with whatever triggered this");
if (!candidates.length) {
if (reportErrors) {
diagnostics.add(getDiagnosticForCallNode(node, Diagnostics.Call_target_does_not_contain_any_signatures));
}
return resolveErrorCall(node);
}
}
const args = getEffectiveCallArguments(node);
@ -39142,6 +39228,9 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
}
function getYieldedTypeOfYieldExpression(node: YieldExpression, expressionType: Type, sentType: Type, isAsync: boolean): Type | undefined {
if (expressionType === silentNeverType) {
return silentNeverType;
}
const errorNode = node.expression || node;
// A `yield*` expression effectively yields everything that its operand yields
const yieldedType = node.asteriskToken ? checkIteratedTypeOrElementType(isAsync ? IterationUse.AsyncYieldStar : IterationUse.YieldStar, expressionType, sentType, errorNode) : expressionType;
@ -40410,18 +40499,29 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
}
function checkNullishCoalesceOperands(node: BinaryExpression) {
const { left, operatorToken, right } = node;
if (operatorToken.kind === SyntaxKind.QuestionQuestionToken) {
if (isBinaryExpression(left) && (left.operatorToken.kind === SyntaxKind.BarBarToken || left.operatorToken.kind === SyntaxKind.AmpersandAmpersandToken)) {
grammarErrorOnNode(left, Diagnostics._0_and_1_operations_cannot_be_mixed_without_parentheses, tokenToString(left.operatorToken.kind), tokenToString(operatorToken.kind));
}
if (isBinaryExpression(right) && (right.operatorToken.kind === SyntaxKind.BarBarToken || right.operatorToken.kind === SyntaxKind.AmpersandAmpersandToken)) {
grammarErrorOnNode(right, Diagnostics._0_and_1_operations_cannot_be_mixed_without_parentheses, tokenToString(right.operatorToken.kind), tokenToString(operatorToken.kind));
}
checkNullishCoalesceOperandLeft(node);
checkNullishCoalesceOperandRight(node);
if (node.operatorToken.kind !== SyntaxKind.QuestionQuestionToken) {
return;
}
if (isBinaryExpression(node.parent)) {
const { left, operatorToken } = node.parent;
if (isBinaryExpression(left) && operatorToken.kind === SyntaxKind.BarBarToken) {
grammarErrorOnNode(left, Diagnostics._0_and_1_operations_cannot_be_mixed_without_parentheses, tokenToString(SyntaxKind.QuestionQuestionToken), tokenToString(operatorToken.kind));
}
}
else if (isBinaryExpression(node.left)) {
const { operatorToken } = node.left;
if (operatorToken.kind === SyntaxKind.BarBarToken || operatorToken.kind === SyntaxKind.AmpersandAmpersandToken) {
grammarErrorOnNode(node.left, Diagnostics._0_and_1_operations_cannot_be_mixed_without_parentheses, tokenToString(operatorToken.kind), tokenToString(SyntaxKind.QuestionQuestionToken));
}
}
else if (isBinaryExpression(node.right)) {
const { operatorToken } = node.right;
if (operatorToken.kind === SyntaxKind.AmpersandAmpersandToken) {
grammarErrorOnNode(node.right, Diagnostics._0_and_1_operations_cannot_be_mixed_without_parentheses, tokenToString(SyntaxKind.QuestionQuestionToken), tokenToString(operatorToken.kind));
}
}
checkNullishCoalesceOperandLeft(node);
checkNullishCoalesceOperandRight(node);
}
function checkNullishCoalesceOperandLeft(node: BinaryExpression) {
@ -45641,6 +45741,9 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
* the `[Symbol.asyncIterator]()` method first, and then the `[Symbol.iterator]()` method.
*/
function getIterationTypesOfIterable(type: Type, use: IterationUse, errorNode: Node | undefined) {
if (type === silentNeverType) {
return silentNeverIterationTypes;
}
if (isTypeAny(type)) {
return anyIterationTypes;
}
@ -46569,7 +46672,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
languageVersion >= ScriptTarget.ES5 && name.escapedText === "Object"
&& host.getEmitModuleFormatOfFile(getSourceFileOfNode(name)) < ModuleKind.ES2015
) {
error(name, Diagnostics.Class_name_cannot_be_Object_when_targeting_ES5_with_module_0, ModuleKind[moduleKind]); // https://github.com/Microsoft/TypeScript/issues/17494
error(name, Diagnostics.Class_name_cannot_be_Object_when_targeting_ES5_and_above_with_module_0, ModuleKind[moduleKind]); // https://github.com/Microsoft/TypeScript/issues/17494
}
}
@ -48240,7 +48343,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
!isInJSFile(node) &&
host.getEmitModuleFormatOfFile(getSourceFileOfNode(node)) === ModuleKind.CommonJS
) {
error(node, Diagnostics.ESM_syntax_is_not_allowed_in_a_CommonJS_module_when_verbatimModuleSyntax_is_enabled);
error(node, getVerbatimModuleSyntaxErrorMessage(node));
}
else if (
moduleKind === ModuleKind.Preserve &&
@ -48252,7 +48355,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
// when we look at the `impliedNodeFormat` of this file and decide it's CommonJS (i.e., currently,
// only if the file extension is .cjs/.cts). To avoid that inconsistency, we disallow ESM syntax
// in files that are unambiguously CommonJS in this mode.
error(node, Diagnostics.ESM_syntax_is_not_allowed_in_a_CommonJS_module_when_module_is_set_to_preserve);
error(node, Diagnostics.ECMAScript_module_syntax_is_not_allowed_in_a_CommonJS_module_when_module_is_set_to_preserve);
}
if (
@ -48684,7 +48787,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
}
if (isIllegalExportDefaultInCJS) {
error(node, Diagnostics.ESM_syntax_is_not_allowed_in_a_CommonJS_module_when_verbatimModuleSyntax_is_enabled);
error(node, getVerbatimModuleSyntaxErrorMessage(node));
}
checkExternalModuleExports(container);
@ -53029,7 +53132,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
if (languageVersion < ScriptTarget.ES2015 && isPrivateIdentifier(node.name)) {
return grammarErrorOnNode(node.name, Diagnostics.Private_identifiers_are_only_available_when_targeting_ECMAScript_2015_and_higher);
}
if (languageVersion < ScriptTarget.ES2015 && isAutoAccessorPropertyDeclaration(node)) {
if (languageVersion < ScriptTarget.ES2015 && isAutoAccessorPropertyDeclaration(node) && !(node.flags & NodeFlags.Ambient)) {
return grammarErrorOnNode(node.name, Diagnostics.Properties_with_the_accessor_modifier_are_only_available_when_targeting_ECMAScript_2015_and_higher);
}
if (isAutoAccessorPropertyDeclaration(node) && checkGrammarForInvalidQuestionMark(node.questionToken, Diagnostics.An_accessor_property_cannot_be_declared_optional)) {
@ -53178,7 +53281,8 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
const literalType = isLiteralTypeNode(node.parent) ||
isPrefixUnaryExpression(node.parent) && isLiteralTypeNode(node.parent.parent);
if (!literalType) {
if (languageVersion < ScriptTarget.ES2020) {
// Don't error on BigInt literals in ambient contexts
if (!(node.flags & NodeFlags.Ambient) && languageVersion < ScriptTarget.ES2020) {
if (grammarErrorOnNode(node, Diagnostics.BigInt_literals_are_not_available_when_targeting_lower_than_ES2020)) {
return true;
}
@ -53248,7 +53352,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
function checkGrammarImportCallExpression(node: ImportCall): boolean {
if (compilerOptions.verbatimModuleSyntax && moduleKind === ModuleKind.CommonJS) {
return grammarErrorOnNode(node, Diagnostics.ESM_syntax_is_not_allowed_in_a_CommonJS_module_when_verbatimModuleSyntax_is_enabled);
return grammarErrorOnNode(node, getVerbatimModuleSyntaxErrorMessage(node));
}
if (node.expression.kind === SyntaxKind.MetaProperty) {

View File

@ -697,7 +697,7 @@ const commandOptionsWithoutBuild: CommandLineOption[] = [
affectsBuildInfo: true,
showInSimplifiedHelpView: true,
category: Diagnostics.JavaScript_Support,
description: Diagnostics.Allow_JavaScript_files_to_be_a_part_of_your_program_Use_the_checkJS_option_to_get_errors_from_these_files,
description: Diagnostics.Allow_JavaScript_files_to_be_a_part_of_your_program_Use_the_checkJs_option_to_get_errors_from_these_files,
defaultValueDescription: false,
},
{

View File

@ -1,6 +1,6 @@
// WARNING: The script `configurePrerelease.ts` uses a regexp to parse out these values.
// If changing the text in this section, be sure to test `configurePrerelease` too.
export const versionMajorMinor = "5.9";
export const versionMajorMinor = "6.0";
// The following is baselined as a literal template type without intervention
/** The version of the TypeScript compiler release */
export const version: string = `${versionMajorMinor}.0-dev`;

View File

@ -939,7 +939,7 @@
"category": "Error",
"code": 1285
},
"ESM syntax is not allowed in a CommonJS module when 'verbatimModuleSyntax' is enabled.": {
"ECMAScript imports and exports cannot be written in a CommonJS file under 'verbatimModuleSyntax'.": {
"category": "Error",
"code": 1286
},
@ -967,7 +967,7 @@
"category": "Error",
"code": 1292
},
"ESM syntax is not allowed in a CommonJS module when 'module' is set to 'preserve'.": {
"ECMAScript module syntax is not allowed in a CommonJS module when 'module' is set to 'preserve'.": {
"category": "Error",
"code": 1293
},
@ -975,6 +975,10 @@
"category": "Error",
"code": 1294
},
"ECMAScript imports and exports cannot be written in a CommonJS file under 'verbatimModuleSyntax'. Adjust the 'type' field in the nearest 'package.json' to make this file an ECMAScript module, or adjust your 'verbatimModuleSyntax', 'module', and 'moduleResolution' settings in TypeScript.": {
"category": "Error",
"code": 1295
},
"'with' statements are not allowed in an async function block.": {
"category": "Error",
"code": 1300
@ -2080,6 +2084,10 @@
"category": "Error",
"code": 2345
},
"Call target does not contain any signatures.": {
"category": "Error",
"code": 2346
},
"Untyped function calls may not accept type arguments.": {
"category": "Error",
"code": 2347
@ -3419,7 +3427,7 @@
"category": "Error",
"code": 2724
},
"Class name cannot be 'Object' when targeting ES5 with module {0}.": {
"Class name cannot be 'Object' when targeting ES5 and above with module {0}.": {
"category": "Error",
"code": 2725
},
@ -6058,7 +6066,7 @@
"category": "Message",
"code": 6506
},
"Allow JavaScript files to be a part of your program. Use the 'checkJS' option to get errors from these files.": {
"Allow JavaScript files to be a part of your program. Use the 'checkJs' option to get errors from these files.": {
"category": "Message",
"code": 6600
},

View File

@ -1113,7 +1113,7 @@ export function createSyntacticTypeNodeBuilder(
function ensureParameter(p: ParameterDeclaration, context: SyntacticTypeNodeBuilderContext) {
return factory.updateParameterDeclaration(
p,
[],
/*modifiers*/ undefined,
reuseNode(context, p.dotDotDotToken),
resolver.serializeNameOfParameter(context, p),
resolver.isOptionalParameter(p) ? factory.createToken(SyntaxKind.QuestionToken) : undefined,

View File

@ -4564,6 +4564,7 @@ namespace Parser {
}
parseExpected(SyntaxKind.ColonToken);
attributes = parseImportAttributes(currentToken as SyntaxKind.WithKeyword | SyntaxKind.AssertKeyword, /*skipKeyword*/ true);
parseOptional(SyntaxKind.CommaToken);
if (!parseExpected(SyntaxKind.CloseBraceToken)) {
const lastError = lastOrUndefined(parseDiagnostics);
if (lastError && lastError.code === Diagnostics._0_expected.code) {
@ -5558,12 +5559,15 @@ namespace Parser {
return parseFunctionBlock(SignatureFlags.IgnoreMissingOpenBrace | (isAsync ? SignatureFlags.Await : SignatureFlags.None));
}
const savedYieldContext = inYieldContext();
setYieldContext(false);
const savedTopLevel = topLevel;
topLevel = false;
const node = isAsync
? doInAwaitContext(() => parseAssignmentExpressionOrHigher(allowReturnTypeInArrowFunction))
: doOutsideOfAwaitContext(() => parseAssignmentExpressionOrHigher(allowReturnTypeInArrowFunction));
topLevel = savedTopLevel;
setYieldContext(savedYieldContext);
return node;
}

View File

@ -4288,6 +4288,7 @@ export interface SourceFileLike {
lineMap?: readonly number[];
/** @internal */
getPositionOfLineAndCharacter?(line: number, character: number, allowEdits?: true): number;
languageVariant?: LanguageVariant;
}
/** @internal */

View File

@ -5675,17 +5675,17 @@ export const enum OperatorPrecedence {
// CoalesceExpression
Conditional,
// LogicalORExpression:
// LogicalANDExpression
// LogicalORExpression `||` LogicalANDExpression
LogicalOR,
// CoalesceExpression:
// CoalesceExpressionHead `??` BitwiseORExpression
// CoalesceExpressionHead:
// CoalesceExpression
// BitwiseORExpression
Coalesce = Conditional, // NOTE: This is wrong
// LogicalORExpression:
// LogicalANDExpression
// LogicalORExpression `||` LogicalANDExpression
LogicalOR,
Coalesce = LogicalOR,
// LogicalANDExpression:
// BitwiseORExpression
@ -7715,9 +7715,18 @@ export function base64decode(host: { base64decode?(input: string): string; } | u
export function readJsonOrUndefined(path: string, hostOrText: { readFile(fileName: string): string | undefined; } | string): object | undefined {
const jsonText = isString(hostOrText) ? hostOrText : hostOrText.readFile(path);
if (!jsonText) return undefined;
// gracefully handle if readFile fails or returns not JSON
const result = parseConfigFileTextToJson(path, jsonText);
return !result.error ? result.config : undefined;
// Try strictly parsing first, then fall back to our (slower)
// parser that is resilient to comments/trailing commas.
// package.json files should never have these, but we
// have no way to communicate these issues in the first place.
let result = tryParseJson(jsonText);
if (result === undefined) {
const looseResult = parseConfigFileTextToJson(path, jsonText);
if (!looseResult.error) {
result = looseResult.config;
}
}
return result;
}
/** @internal */
@ -9533,7 +9542,7 @@ const wildcardCharCodes = [CharacterCodes.asterisk, CharacterCodes.question];
const commonPackageFolders: readonly string[] = ["node_modules", "bower_components", "jspm_packages"];
const implicitExcludePathRegexPattern = `(?!(${commonPackageFolders.join("|")})(/|$))`;
const implicitExcludePathRegexPattern = `(?!(?:${commonPackageFolders.join("|")})(?:/|$))`;
/** @internal */
export interface WildcardMatcher {
@ -9549,12 +9558,12 @@ const filesMatcher: WildcardMatcher = {
* [^./] # matches everything up to the first . character (excluding directory separators)
* (\\.(?!min\\.js$))? # matches . characters but not if they are part of the .min.js file extension
*/
singleAsteriskRegexFragment: "([^./]|(\\.(?!min\\.js$))?)*",
singleAsteriskRegexFragment: "(?:[^./]|(?:\\.(?!min\\.js$))?)*",
/**
* Regex for the ** wildcard. Matches any number of subdirectories. When used for including
* files or directories, does not match subdirectories that start with a . character
*/
doubleAsteriskRegexFragment: `(/${implicitExcludePathRegexPattern}[^/.][^/]*)*?`,
doubleAsteriskRegexFragment: `(?:/${implicitExcludePathRegexPattern}[^/.][^/]*)*?`,
replaceWildcardCharacter: match => replaceWildcardCharacter(match, filesMatcher.singleAsteriskRegexFragment),
};
@ -9564,13 +9573,13 @@ const directoriesMatcher: WildcardMatcher = {
* Regex for the ** wildcard. Matches any number of subdirectories. When used for including
* files or directories, does not match subdirectories that start with a . character
*/
doubleAsteriskRegexFragment: `(/${implicitExcludePathRegexPattern}[^/.][^/]*)*?`,
doubleAsteriskRegexFragment: `(?:/${implicitExcludePathRegexPattern}[^/.][^/]*)*?`,
replaceWildcardCharacter: match => replaceWildcardCharacter(match, directoriesMatcher.singleAsteriskRegexFragment),
};
const excludeMatcher: WildcardMatcher = {
singleAsteriskRegexFragment: "[^/]*",
doubleAsteriskRegexFragment: "(/.+?)?",
doubleAsteriskRegexFragment: "(?:/.+?)?",
replaceWildcardCharacter: match => replaceWildcardCharacter(match, excludeMatcher.singleAsteriskRegexFragment),
};
@ -9587,10 +9596,10 @@ export function getRegularExpressionForWildcard(specs: readonly string[] | undef
return undefined;
}
const pattern = patterns.map(pattern => `(${pattern})`).join("|");
const pattern = patterns.map(pattern => `(?:${pattern})`).join("|");
// If excluding, match "foo/bar/baz...", but if including, only allow "foo".
const terminator = usage === "exclude" ? "($|/)" : "$";
return `^(${pattern})${terminator}`;
const terminator = usage === "exclude" ? "(?:$|/)" : "$";
return `^(?:${pattern})${terminator}`;
}
/** @internal */
@ -9615,7 +9624,7 @@ export function isImplicitGlob(lastPathComponent: string): boolean {
/** @internal */
export function getPatternFromSpec(spec: string, basePath: string, usage: "files" | "directories" | "exclude"): string | undefined {
const pattern = spec && getSubPatternFromSpec(spec, basePath, usage, wildcardMatchers[usage]);
return pattern && `^(${pattern})${usage === "exclude" ? "($|/)" : "$"}`;
return pattern && `^(?:${pattern})${usage === "exclude" ? "(?:$|/)" : "$"}`;
}
/** @internal */
@ -9648,7 +9657,7 @@ export function getSubPatternFromSpec(
}
else {
if (usage === "directories") {
subpattern += "(";
subpattern += "(?:";
optionalCount++;
}
@ -9662,7 +9671,7 @@ export function getSubPatternFromSpec(
// appear first in a component. Dotted directories and files can be included explicitly
// like so: **/.*/.*
if (component.charCodeAt(0) === CharacterCodes.asterisk) {
componentPattern += "([^./]" + singleAsteriskRegexFragment + ")?";
componentPattern += "(?:[^./]" + singleAsteriskRegexFragment + ")?";
component = component.substr(1);
}
else if (component.charCodeAt(0) === CharacterCodes.question) {

View File

@ -436,7 +436,7 @@ export function getMatchedIncludeSpec(program: Program, fileName: string): strin
const index = findIndex(configFile?.configFileSpecs?.validatedIncludeSpecs, includeSpec => {
if (isJsonFile && !endsWith(includeSpec, Extension.Json)) return false;
const pattern = getPatternFromSpec(includeSpec, basePath, "files");
return !!pattern && getRegexFromPattern(`(${pattern})$`, useCaseSensitiveFileNames).test(fileName);
return !!pattern && getRegexFromPattern(`(?:${pattern})$`, useCaseSensitiveFileNames).test(fileName);
});
return index !== -1 ? configFile.configFileSpecs.validatedIncludeSpecsBeforeSubstitution![index] : undefined;
}

File diff suppressed because it is too large Load Diff

View File

@ -1,125 +0,0 @@
/// <reference lib="dom" />
interface DOMTokenList {
[Symbol.iterator](): ArrayIterator<string>;
}
interface HeadersIterator<T> extends IteratorObject<T, BuiltinIteratorReturn, unknown> {
[Symbol.iterator](): HeadersIterator<T>;
}
interface Headers {
[Symbol.iterator](): HeadersIterator<[string, string]>;
/**
* Returns an iterator allowing to go through all key/value pairs contained in this object.
*/
entries(): HeadersIterator<[string, string]>;
/**
* Returns an iterator allowing to go through all keys f the key/value pairs contained in this object.
*/
keys(): HeadersIterator<string>;
/**
* Returns an iterator allowing to go through all values of the key/value pairs contained in this object.
*/
values(): HeadersIterator<string>;
}
interface NodeList {
/**
* Returns an array of key, value pairs for every entry in the list
*/
entries(): ArrayIterator<[number, Node]>;
/**
* Performs the specified action for each node in an list.
* @param callbackfn A function that accepts up to three arguments. forEach calls the callbackfn function one time for each element in the list.
* @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value.
*/
forEach(callbackfn: (value: Node, index: number, listObj: NodeList) => void, thisArg?: any): void;
/**
* Returns an list of keys in the list
*/
keys(): ArrayIterator<number>;
/**
* Returns an list of values in the list
*/
values(): ArrayIterator<Node>;
[Symbol.iterator](): ArrayIterator<Node>;
}
interface NodeListOf<TNode extends Node> {
/**
* Returns an array of key, value pairs for every entry in the list
*/
entries(): ArrayIterator<[number, TNode]>;
/**
* Performs the specified action for each node in an list.
* @param callbackfn A function that accepts up to three arguments. forEach calls the callbackfn function one time for each element in the list.
* @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value.
*/
forEach(callbackfn: (value: TNode, index: number, listObj: NodeListOf<TNode>) => void, thisArg?: any): void;
/**
* Returns an list of keys in the list
*/
keys(): ArrayIterator<number>;
/**
* Returns an list of values in the list
*/
values(): ArrayIterator<TNode>;
[Symbol.iterator](): ArrayIterator<TNode>;
}
interface HTMLCollectionBase {
[Symbol.iterator](): ArrayIterator<Element>;
}
interface HTMLCollectionOf<T extends Element> {
[Symbol.iterator](): ArrayIterator<T>;
}
interface FormDataIterator<T> extends IteratorObject<T, BuiltinIteratorReturn, unknown> {
[Symbol.iterator](): FormDataIterator<T>;
}
interface FormData {
/**
* Returns an array of key, value pairs for every entry in the list
*/
entries(): FormDataIterator<[string, string | File]>;
/**
* Returns a list of keys in the list
*/
keys(): FormDataIterator<string>;
/**
* Returns a list of values in the list
*/
values(): FormDataIterator<string | File>;
[Symbol.iterator](): FormDataIterator<string | File>;
}
interface URLSearchParamsIterator<T> extends IteratorObject<T, BuiltinIteratorReturn, unknown> {
[Symbol.iterator](): URLSearchParamsIterator<T>;
}
interface URLSearchParams {
/**
* Returns an array of key, value pairs for every entry in the search params
*/
entries(): URLSearchParamsIterator<[string, string]>;
/**
* Returns a list of keys in the search params
*/
keys(): URLSearchParamsIterator<string>;
/**
* Returns a list of values in the search params
*/
values(): URLSearchParamsIterator<string>;
/**
* iterate over key/value pairs
*/
[Symbol.iterator](): URLSearchParamsIterator<[string, string]>;
}

View File

@ -3,7 +3,11 @@
/////////////////////////////
interface AudioParam {
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AudioParam/setValueCurveAtTime) */
/**
* The **`setValueCurveAtTime()`** method of the following a curve defined by a list of values.
*
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/AudioParam/setValueCurveAtTime)
*/
setValueCurveAtTime(values: Iterable<number>, startTime: number, duration: number): AudioParam;
}
@ -11,9 +15,17 @@ interface AudioParamMap extends ReadonlyMap<string, AudioParam> {
}
interface BaseAudioContext {
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/BaseAudioContext/createIIRFilter) */
/**
* The **`createIIRFilter()`** method of the BaseAudioContext interface creates an IIRFilterNode, which represents a general **infinite impulse response** (IIR) filter which can be configured to serve as various types of filter.
*
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/BaseAudioContext/createIIRFilter)
*/
createIIRFilter(feedforward: Iterable<number>, feedback: Iterable<number>): IIRFilterNode;
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/BaseAudioContext/createPeriodicWave) */
/**
* The `createPeriodicWave()` method of the BaseAudioContext interface is used to create a PeriodicWave.
*
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/BaseAudioContext/createPeriodicWave)
*/
createPeriodicWave(real: Iterable<number>, imag: Iterable<number>, constraints?: PeriodicWaveConstraints): PeriodicWave;
}
@ -51,7 +63,11 @@ interface CSSUnparsedValue {
}
interface Cache {
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Cache/addAll) */
/**
* The **`addAll()`** method of the Cache interface takes an array of URLs, retrieves them, and adds the resulting response objects to the given cache.
*
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Cache/addAll)
*/
addAll(requests: Iterable<RequestInfo>): Promise<void>;
}
@ -65,6 +81,21 @@ interface CanvasPathDrawingStyles {
setLineDash(segments: Iterable<number>): void;
}
interface CookieStoreManager {
/**
* The **`subscribe()`** method of the CookieStoreManager interface subscribes a ServiceWorkerRegistration to cookie change events.
*
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/CookieStoreManager/subscribe)
*/
subscribe(subscriptions: Iterable<CookieStoreGetOptions>): Promise<void>;
/**
* The **`unsubscribe()`** method of the CookieStoreManager interface stops the ServiceWorkerRegistration from receiving previously subscribed events.
*
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/CookieStoreManager/unsubscribe)
*/
unsubscribe(subscriptions: Iterable<CookieStoreGetOptions>): Promise<void>;
}
interface CustomStateSet extends Set<string> {
}
@ -153,7 +184,7 @@ interface HighlightRegistry extends Map<string, Highlight> {
interface IDBDatabase {
/**
* Returns a new transaction with the given mode ("readonly" or "readwrite") and scope which can be a single object store name or an array of names.
* The **`transaction`** method of the IDBDatabase interface immediately returns a transaction object (IDBTransaction) containing the IDBTransaction.objectStore method, which you can use to access your object store.
*
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/IDBDatabase/transaction)
*/
@ -162,9 +193,7 @@ interface IDBDatabase {
interface IDBObjectStore {
/**
* Creates a new index in store with the given name, keyPath and options and returns a new IDBIndex. If the keyPath and options define constraints that cannot be satisfied with the data already in store the upgrade transaction will abort with a "ConstraintError" DOMException.
*
* Throws an "InvalidStateError" DOMException if not called within an upgrade transaction.
* The **`createIndex()`** method of the field/column defining a new data point for each database record to contain.
*
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/IDBObjectStore/createIndex)
*/
@ -179,7 +208,11 @@ interface MIDIInputMap extends ReadonlyMap<string, MIDIInput> {
}
interface MIDIOutput {
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/MIDIOutput/send) */
/**
* The **`send()`** method of the MIDIOutput interface queues messages for the corresponding MIDI port.
*
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/MIDIOutput/send)
*/
send(data: Iterable<number>, timestamp?: DOMHighResTimeStamp): void;
}
@ -216,12 +249,17 @@ interface NamedNodeMap {
interface Navigator {
/**
* The **`requestMediaKeySystemAccess()`** method of the Navigator interface returns a Promise which delivers a MediaKeySystemAccess object that can be used to access a particular media key system, which can in turn be used to create keys for decrypting a media stream.
* Available only in secure contexts.
*
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Navigator/requestMediaKeySystemAccess)
*/
requestMediaKeySystemAccess(keySystem: string, supportedConfigurations: Iterable<MediaKeySystemConfiguration>): Promise<MediaKeySystemAccess>;
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Navigator/vibrate) */
/**
* The **`vibrate()`** method of the Navigator interface pulses the vibration hardware on the device, if such hardware exists.
*
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Navigator/vibrate)
*/
vibrate(pattern: Iterable<number>): boolean;
}
@ -254,7 +292,11 @@ interface PluginArray {
}
interface RTCRtpTransceiver {
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/RTCRtpTransceiver/setCodecPreferences) */
/**
* The **`setCodecPreferences()`** method of the RTCRtpTransceiver interface is used to set the codecs that the transceiver allows for decoding _received_ data, in order of decreasing preference.
*
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/RTCRtpTransceiver/setCodecPreferences)
*/
setCodecPreferences(codecs: Iterable<RTCRtpCodec>): void;
}
@ -309,17 +351,33 @@ interface StyleSheetList {
}
interface SubtleCrypto {
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/deriveKey) */
/**
* The **`deriveKey()`** method of the SubtleCrypto interface can be used to derive a secret key from a master key.
*
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/deriveKey)
*/
deriveKey(algorithm: AlgorithmIdentifier | EcdhKeyDeriveParams | HkdfParams | Pbkdf2Params, baseKey: CryptoKey, derivedKeyType: AlgorithmIdentifier | AesDerivedKeyParams | HmacImportParams | HkdfParams | Pbkdf2Params, extractable: boolean, keyUsages: Iterable<KeyUsage>): Promise<CryptoKey>;
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/generateKey) */
/**
* The **`generateKey()`** method of the SubtleCrypto interface is used to generate a new key (for symmetric algorithms) or key pair (for public-key algorithms).
*
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/generateKey)
*/
generateKey(algorithm: "Ed25519" | { name: "Ed25519" }, extractable: boolean, keyUsages: ReadonlyArray<"sign" | "verify">): Promise<CryptoKeyPair>;
generateKey(algorithm: RsaHashedKeyGenParams | EcKeyGenParams, extractable: boolean, keyUsages: ReadonlyArray<KeyUsage>): Promise<CryptoKeyPair>;
generateKey(algorithm: AesKeyGenParams | HmacKeyGenParams | Pbkdf2Params, extractable: boolean, keyUsages: ReadonlyArray<KeyUsage>): Promise<CryptoKey>;
generateKey(algorithm: AlgorithmIdentifier, extractable: boolean, keyUsages: Iterable<KeyUsage>): Promise<CryptoKeyPair | CryptoKey>;
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/importKey) */
/**
* The **`importKey()`** method of the SubtleCrypto interface imports a key: that is, it takes as input a key in an external, portable format and gives you a CryptoKey object that you can use in the Web Crypto API.
*
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/importKey)
*/
importKey(format: "jwk", keyData: JsonWebKey, algorithm: AlgorithmIdentifier | RsaHashedImportParams | EcKeyImportParams | HmacImportParams | AesKeyAlgorithm, extractable: boolean, keyUsages: ReadonlyArray<KeyUsage>): Promise<CryptoKey>;
importKey(format: Exclude<KeyFormat, "jwk">, keyData: BufferSource, algorithm: AlgorithmIdentifier | RsaHashedImportParams | EcKeyImportParams | HmacImportParams | AesKeyAlgorithm, extractable: boolean, keyUsages: Iterable<KeyUsage>): Promise<CryptoKey>;
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/unwrapKey) */
/**
* The **`unwrapKey()`** method of the SubtleCrypto interface 'unwraps' a key.
*
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/unwrapKey)
*/
unwrapKey(format: KeyFormat, wrappedKey: BufferSource, unwrappingKey: CryptoKey, unwrapAlgorithm: AlgorithmIdentifier | RsaOaepParams | AesCtrParams | AesCbcParams | AesGcmParams, unwrappedKeyAlgorithm: AlgorithmIdentifier | RsaHashedImportParams | EcKeyImportParams | HmacImportParams | AesKeyAlgorithm, extractable: boolean, keyUsages: Iterable<KeyUsage>): Promise<CryptoKey>;
}
@ -353,18 +411,38 @@ interface ViewTransitionTypeSet extends Set<string> {
}
interface WEBGL_draw_buffers {
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/WEBGL_draw_buffers/drawBuffersWEBGL) */
/**
* The **`WEBGL_draw_buffers.drawBuffersWEBGL()`** method is part of the WebGL API and allows you to define the draw buffers to which all fragment colors are written.
*
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WEBGL_draw_buffers/drawBuffersWEBGL)
*/
drawBuffersWEBGL(buffers: Iterable<GLenum>): void;
}
interface WEBGL_multi_draw {
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/WEBGL_multi_draw/multiDrawArraysInstancedWEBGL) */
/**
* The **`WEBGL_multi_draw.multiDrawArraysInstancedWEBGL()`** method of the WebGL API renders multiple primitives from array data.
*
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WEBGL_multi_draw/multiDrawArraysInstancedWEBGL)
*/
multiDrawArraysInstancedWEBGL(mode: GLenum, firstsList: Int32Array<ArrayBufferLike> | Iterable<GLint>, firstsOffset: number, countsList: Int32Array<ArrayBufferLike> | Iterable<GLsizei>, countsOffset: number, instanceCountsList: Int32Array<ArrayBufferLike> | Iterable<GLsizei>, instanceCountsOffset: number, drawcount: GLsizei): void;
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/WEBGL_multi_draw/multiDrawArraysWEBGL) */
/**
* The **`WEBGL_multi_draw.multiDrawArraysWEBGL()`** method of the WebGL API renders multiple primitives from array data.
*
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WEBGL_multi_draw/multiDrawArraysWEBGL)
*/
multiDrawArraysWEBGL(mode: GLenum, firstsList: Int32Array<ArrayBufferLike> | Iterable<GLint>, firstsOffset: number, countsList: Int32Array<ArrayBufferLike> | Iterable<GLsizei>, countsOffset: number, drawcount: GLsizei): void;
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/WEBGL_multi_draw/multiDrawElementsInstancedWEBGL) */
/**
* The **`WEBGL_multi_draw.multiDrawElementsInstancedWEBGL()`** method of the WebGL API renders multiple primitives from array data.
*
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WEBGL_multi_draw/multiDrawElementsInstancedWEBGL)
*/
multiDrawElementsInstancedWEBGL(mode: GLenum, countsList: Int32Array<ArrayBufferLike> | Iterable<GLsizei>, countsOffset: number, type: GLenum, offsetsList: Int32Array<ArrayBufferLike> | Iterable<GLsizei>, offsetsOffset: number, instanceCountsList: Int32Array<ArrayBufferLike> | Iterable<GLsizei>, instanceCountsOffset: number, drawcount: GLsizei): void;
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/WEBGL_multi_draw/multiDrawElementsWEBGL) */
/**
* The **`WEBGL_multi_draw.multiDrawElementsWEBGL()`** method of the WebGL API renders multiple primitives from array data.
*
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WEBGL_multi_draw/multiDrawElementsWEBGL)
*/
multiDrawElementsWEBGL(mode: GLenum, countsList: Int32Array<ArrayBufferLike> | Iterable<GLsizei>, countsOffset: number, type: GLenum, offsetsList: Int32Array<ArrayBufferLike> | Iterable<GLsizei>, offsetsOffset: number, drawcount: GLsizei): void;
}
@ -380,7 +458,7 @@ interface WebGL2RenderingContextBase {
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebGL2RenderingContext/getActiveUniforms) */
getActiveUniforms(program: WebGLProgram, uniformIndices: Iterable<GLuint>, pname: GLenum): any;
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebGL2RenderingContext/getUniformIndices) */
getUniformIndices(program: WebGLProgram, uniformNames: Iterable<string>): Iterable<GLuint> | null;
getUniformIndices(program: WebGLProgram, uniformNames: Iterable<string>): GLuint[] | null;
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebGL2RenderingContext/invalidateFramebuffer) */
invalidateFramebuffer(target: GLenum, attachments: Iterable<GLenum>): void;
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebGL2RenderingContext/invalidateSubFramebuffer) */

View File

@ -11,15 +11,27 @@ declare namespace Intl {
granularity?: "grapheme" | "word" | "sentence" | undefined;
}
/**
* The `Intl.Segmenter` object enables locale-sensitive text segmentation, enabling you to get meaningful items (graphemes, words or sentences) from a string.
*
* [MDN](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/Segmenter)
*/
interface Segmenter {
/**
* Returns `Segments` object containing the segments of the input string, using the segmenter's locale and granularity.
*
* [MDN](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/Segmenter/segment)
*
* @param input - The text to be segmented as a `string`.
*
* @returns A new iterable Segments object containing the segments of the input string, using the segmenter's locale and granularity.
*/
segment(input: string): Segments;
/**
* The `resolvedOptions()` method of `Intl.Segmenter` instances returns a new object with properties reflecting the options computed during initialization of this `Segmenter` object.
*
* [MDN](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/Segmenter/resolvedOptions)
*/
resolvedOptions(): ResolvedSegmenterOptions;
}
@ -32,13 +44,20 @@ declare namespace Intl {
[Symbol.iterator](): SegmentIterator<T>;
}
/**
* A `Segments` object is an iterable collection of the segments of a text string. It is returned by a call to the `segment()` method of an `Intl.Segmenter` object.
*
* [MDN](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/Segmenter/segment/Segments)
*/
interface Segments {
/**
* Returns an object describing the segment in the original string that includes the code unit at a specified index.
*
* [MDN](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/Segmenter/segment/Segments/containing)
*
* @param codeUnitIndex - A number specifying the index of the code unit in the original input string. If the value is omitted, it defaults to `0`.
*/
containing(codeUnitIndex?: number): SegmentData;
containing(codeUnitIndex?: number): SegmentData | undefined;
/** Returns an iterator to iterate over the segments. */
[Symbol.iterator](): SegmentIterator<SegmentData>;
@ -58,6 +77,11 @@ declare namespace Intl {
isWordLike?: boolean;
}
/**
* The `Intl.Segmenter` object enables locale-sensitive text segmentation, enabling you to get meaningful items (graphemes, words or sentences) from a string.
*
* [MDN](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/Segmenter)
*/
const Segmenter: {
prototype: Segmenter;

8
src/lib/es5.d.ts vendored
View File

@ -1378,14 +1378,18 @@ interface Array<T> {
/**
* Removes elements from an array and, if necessary, inserts new elements in their place, returning the deleted elements.
* @param start The zero-based location in the array from which to start removing elements.
* @param deleteCount The number of elements to remove.
* @param deleteCount The number of elements to remove. Omitting this argument will remove all elements from the start
* paramater location to end of the array. If value of this argument is either a negative number, zero, undefined, or a type
* that cannot be converted to an integer, the function will evaluate the argument as zero and not remove any elements.
* @returns An array containing the elements that were deleted.
*/
splice(start: number, deleteCount?: number): T[];
/**
* Removes elements from an array and, if necessary, inserts new elements in their place, returning the deleted elements.
* @param start The zero-based location in the array from which to start removing elements.
* @param deleteCount The number of elements to remove.
* @param deleteCount The number of elements to remove. If value of this argument is either a negative number, zero,
* undefined, or a type that cannot be converted to an integer, the function will evaluate the argument as zero and
* not remove any elements.
* @param items Elements to insert into the array in place of the deleted elements.
* @returns An array containing the elements that were deleted.
*/

File diff suppressed because it is too large Load Diff

View File

@ -24,7 +24,11 @@ interface CSSUnparsedValue {
}
interface Cache {
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Cache/addAll) */
/**
* The **`addAll()`** method of the Cache interface takes an array of URLs, retrieves them, and adds the resulting response objects to the given cache.
*
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Cache/addAll)
*/
addAll(requests: Iterable<RequestInfo>): Promise<void>;
}
@ -38,6 +42,21 @@ interface CanvasPathDrawingStyles {
setLineDash(segments: Iterable<number>): void;
}
interface CookieStoreManager {
/**
* The **`subscribe()`** method of the CookieStoreManager interface subscribes a ServiceWorkerRegistration to cookie change events.
*
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/CookieStoreManager/subscribe)
*/
subscribe(subscriptions: Iterable<CookieStoreGetOptions>): Promise<void>;
/**
* The **`unsubscribe()`** method of the CookieStoreManager interface stops the ServiceWorkerRegistration from receiving previously subscribed events.
*
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/CookieStoreManager/unsubscribe)
*/
unsubscribe(subscriptions: Iterable<CookieStoreGetOptions>): Promise<void>;
}
interface DOMStringList {
[Symbol.iterator](): ArrayIterator<string>;
}
@ -79,7 +98,7 @@ interface Headers {
interface IDBDatabase {
/**
* Returns a new transaction with the given mode ("readonly" or "readwrite") and scope which can be a single object store name or an array of names.
* The **`transaction`** method of the IDBDatabase interface immediately returns a transaction object (IDBTransaction) containing the IDBTransaction.objectStore method, which you can use to access your object store.
*
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/IDBDatabase/transaction)
*/
@ -88,9 +107,7 @@ interface IDBDatabase {
interface IDBObjectStore {
/**
* Creates a new index in store with the given name, keyPath and options and returns a new IDBIndex. If the keyPath and options define constraints that cannot be satisfied with the data already in store the upgrade transaction will abort with a "ConstraintError" DOMException.
*
* Throws an "InvalidStateError" DOMException if not called within an upgrade transaction.
* The **`createIndex()`** method of the field/column defining a new data point for each database record to contain.
*
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/IDBObjectStore/createIndex)
*/
@ -118,17 +135,33 @@ interface StylePropertyMapReadOnly {
}
interface SubtleCrypto {
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/deriveKey) */
/**
* The **`deriveKey()`** method of the SubtleCrypto interface can be used to derive a secret key from a master key.
*
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/deriveKey)
*/
deriveKey(algorithm: AlgorithmIdentifier | EcdhKeyDeriveParams | HkdfParams | Pbkdf2Params, baseKey: CryptoKey, derivedKeyType: AlgorithmIdentifier | AesDerivedKeyParams | HmacImportParams | HkdfParams | Pbkdf2Params, extractable: boolean, keyUsages: Iterable<KeyUsage>): Promise<CryptoKey>;
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/generateKey) */
/**
* The **`generateKey()`** method of the SubtleCrypto interface is used to generate a new key (for symmetric algorithms) or key pair (for public-key algorithms).
*
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/generateKey)
*/
generateKey(algorithm: "Ed25519" | { name: "Ed25519" }, extractable: boolean, keyUsages: ReadonlyArray<"sign" | "verify">): Promise<CryptoKeyPair>;
generateKey(algorithm: RsaHashedKeyGenParams | EcKeyGenParams, extractable: boolean, keyUsages: ReadonlyArray<KeyUsage>): Promise<CryptoKeyPair>;
generateKey(algorithm: AesKeyGenParams | HmacKeyGenParams | Pbkdf2Params, extractable: boolean, keyUsages: ReadonlyArray<KeyUsage>): Promise<CryptoKey>;
generateKey(algorithm: AlgorithmIdentifier, extractable: boolean, keyUsages: Iterable<KeyUsage>): Promise<CryptoKeyPair | CryptoKey>;
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/importKey) */
/**
* The **`importKey()`** method of the SubtleCrypto interface imports a key: that is, it takes as input a key in an external, portable format and gives you a CryptoKey object that you can use in the Web Crypto API.
*
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/importKey)
*/
importKey(format: "jwk", keyData: JsonWebKey, algorithm: AlgorithmIdentifier | RsaHashedImportParams | EcKeyImportParams | HmacImportParams | AesKeyAlgorithm, extractable: boolean, keyUsages: ReadonlyArray<KeyUsage>): Promise<CryptoKey>;
importKey(format: Exclude<KeyFormat, "jwk">, keyData: BufferSource, algorithm: AlgorithmIdentifier | RsaHashedImportParams | EcKeyImportParams | HmacImportParams | AesKeyAlgorithm, extractable: boolean, keyUsages: Iterable<KeyUsage>): Promise<CryptoKey>;
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/unwrapKey) */
/**
* The **`unwrapKey()`** method of the SubtleCrypto interface 'unwraps' a key.
*
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/unwrapKey)
*/
unwrapKey(format: KeyFormat, wrappedKey: BufferSource, unwrappingKey: CryptoKey, unwrapAlgorithm: AlgorithmIdentifier | RsaOaepParams | AesCtrParams | AesCbcParams | AesGcmParams, unwrappedKeyAlgorithm: AlgorithmIdentifier | RsaHashedImportParams | EcKeyImportParams | HmacImportParams | AesKeyAlgorithm, extractable: boolean, keyUsages: Iterable<KeyUsage>): Promise<CryptoKey>;
}
@ -147,18 +180,38 @@ interface URLSearchParams {
}
interface WEBGL_draw_buffers {
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/WEBGL_draw_buffers/drawBuffersWEBGL) */
/**
* The **`WEBGL_draw_buffers.drawBuffersWEBGL()`** method is part of the WebGL API and allows you to define the draw buffers to which all fragment colors are written.
*
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WEBGL_draw_buffers/drawBuffersWEBGL)
*/
drawBuffersWEBGL(buffers: Iterable<GLenum>): void;
}
interface WEBGL_multi_draw {
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/WEBGL_multi_draw/multiDrawArraysInstancedWEBGL) */
/**
* The **`WEBGL_multi_draw.multiDrawArraysInstancedWEBGL()`** method of the WebGL API renders multiple primitives from array data.
*
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WEBGL_multi_draw/multiDrawArraysInstancedWEBGL)
*/
multiDrawArraysInstancedWEBGL(mode: GLenum, firstsList: Int32Array<ArrayBufferLike> | Iterable<GLint>, firstsOffset: number, countsList: Int32Array<ArrayBufferLike> | Iterable<GLsizei>, countsOffset: number, instanceCountsList: Int32Array<ArrayBufferLike> | Iterable<GLsizei>, instanceCountsOffset: number, drawcount: GLsizei): void;
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/WEBGL_multi_draw/multiDrawArraysWEBGL) */
/**
* The **`WEBGL_multi_draw.multiDrawArraysWEBGL()`** method of the WebGL API renders multiple primitives from array data.
*
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WEBGL_multi_draw/multiDrawArraysWEBGL)
*/
multiDrawArraysWEBGL(mode: GLenum, firstsList: Int32Array<ArrayBufferLike> | Iterable<GLint>, firstsOffset: number, countsList: Int32Array<ArrayBufferLike> | Iterable<GLsizei>, countsOffset: number, drawcount: GLsizei): void;
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/WEBGL_multi_draw/multiDrawElementsInstancedWEBGL) */
/**
* The **`WEBGL_multi_draw.multiDrawElementsInstancedWEBGL()`** method of the WebGL API renders multiple primitives from array data.
*
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WEBGL_multi_draw/multiDrawElementsInstancedWEBGL)
*/
multiDrawElementsInstancedWEBGL(mode: GLenum, countsList: Int32Array<ArrayBufferLike> | Iterable<GLsizei>, countsOffset: number, type: GLenum, offsetsList: Int32Array<ArrayBufferLike> | Iterable<GLsizei>, offsetsOffset: number, instanceCountsList: Int32Array<ArrayBufferLike> | Iterable<GLsizei>, instanceCountsOffset: number, drawcount: GLsizei): void;
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/WEBGL_multi_draw/multiDrawElementsWEBGL) */
/**
* The **`WEBGL_multi_draw.multiDrawElementsWEBGL()`** method of the WebGL API renders multiple primitives from array data.
*
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WEBGL_multi_draw/multiDrawElementsWEBGL)
*/
multiDrawElementsWEBGL(mode: GLenum, countsList: Int32Array<ArrayBufferLike> | Iterable<GLsizei>, countsOffset: number, type: GLenum, offsetsList: Int32Array<ArrayBufferLike> | Iterable<GLsizei>, offsetsOffset: number, drawcount: GLsizei): void;
}
@ -174,7 +227,7 @@ interface WebGL2RenderingContextBase {
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebGL2RenderingContext/getActiveUniforms) */
getActiveUniforms(program: WebGLProgram, uniformIndices: Iterable<GLuint>, pname: GLenum): any;
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebGL2RenderingContext/getUniformIndices) */
getUniformIndices(program: WebGLProgram, uniformNames: Iterable<string>): Iterable<GLuint> | null;
getUniformIndices(program: WebGLProgram, uniformNames: Iterable<string>): GLuint[] | null;
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebGL2RenderingContext/invalidateFramebuffer) */
invalidateFramebuffer(target: GLenum, attachments: Iterable<GLenum>): void;
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebGL2RenderingContext/invalidateSubFramebuffer) */

View File

@ -1890,15 +1890,12 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Allow_JavaScript_files_to_be_a_part_of_your_program_Use_the_checkJS_option_to_get_errors_from_these__6600" ItemType="0" PsrId="306" Leaf="true">
<Item ItemId=";Allow_JavaScript_files_to_be_a_part_of_your_program_Use_the_checkJs_option_to_get_errors_from_these__6600" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Allow JavaScript files to be a part of your program. Use the 'checkJS' option to get errors from these files.]]></Val>
<Val><![CDATA[Allow JavaScript files to be a part of your program. Use the 'checkJs' option to get errors from these files.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[允许 JavaScript 文件成为程序的一部分。使用 “checkJS” 选项从这些文件中获取错误。]]></Val>
<Val><![CDATA[允许 JavaScript 文件成为程序的一部分。使用 ''checkJs'' 选项来获取这些文件中的错误。]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Allow JavaScript files to be a part of your program. Use the `checkJS` option to get errors from these files.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
@ -3042,6 +3039,15 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Call_target_does_not_contain_any_signatures_2346" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Call target does not contain any signatures.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[调用目标不包含任何签名。]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Can_only_convert_logical_AND_access_chains_95142" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Can only convert logical AND access chains]]></Val>
@ -4068,11 +4074,11 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Class_name_cannot_be_Object_when_targeting_ES5_with_module_0_2725" ItemType="0" PsrId="306" Leaf="true">
<Item ItemId=";Class_name_cannot_be_Object_when_targeting_ES5_and_above_with_module_0_2725" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Class name cannot be 'Object' when targeting ES5 with module {0}.]]></Val>
<Val><![CDATA[Class name cannot be 'Object' when targeting ES5 and above with module {0}.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[使用模块 {0} 将目标设置为 ES5 时,类名不能为 "Object"。]]></Val>
<Val><![CDATA[使用模块 {0} 将目标设置为 ES5 及更高版本时,类名不能为 "Object"。]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />

View File

@ -1890,15 +1890,12 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Allow_JavaScript_files_to_be_a_part_of_your_program_Use_the_checkJS_option_to_get_errors_from_these__6600" ItemType="0" PsrId="306" Leaf="true">
<Item ItemId=";Allow_JavaScript_files_to_be_a_part_of_your_program_Use_the_checkJs_option_to_get_errors_from_these__6600" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Allow JavaScript files to be a part of your program. Use the 'checkJS' option to get errors from these files.]]></Val>
<Val><![CDATA[Allow JavaScript files to be a part of your program. Use the 'checkJs' option to get errors from these files.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[允許 JavaScript 檔案成為您程式的一部分。使用 'checkJS' 選項可從這些檔案取得錯誤。]]></Val>
<Val><![CDATA[允許 JavaScript 檔案成為您程式的一部分。使用 'checkJs' 選項可從這些檔案取得錯誤。]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Allow JavaScript files to be a part of your program. Use the `checkJS` option to get errors from these files.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
@ -3042,6 +3039,15 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Call_target_does_not_contain_any_signatures_2346" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Call target does not contain any signatures.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[呼叫目標未包含任何特徵標記。]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Can_only_convert_logical_AND_access_chains_95142" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Can only convert logical AND access chains]]></Val>
@ -4068,11 +4074,11 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Class_name_cannot_be_Object_when_targeting_ES5_with_module_0_2725" ItemType="0" PsrId="306" Leaf="true">
<Item ItemId=";Class_name_cannot_be_Object_when_targeting_ES5_and_above_with_module_0_2725" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Class name cannot be 'Object' when targeting ES5 with module {0}.]]></Val>
<Val><![CDATA[Class name cannot be 'Object' when targeting ES5 and above with module {0}.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[當目標為具有模組 {0} 的 ES5 時,類別名稱不可為 'Object'。]]></Val>
<Val><![CDATA[當目標為具有模組 {0} 的 ES5 和更新版本時,類別名稱不可為 'Object'。]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />

View File

@ -1899,15 +1899,12 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Allow_JavaScript_files_to_be_a_part_of_your_program_Use_the_checkJS_option_to_get_errors_from_these__6600" ItemType="0" PsrId="306" Leaf="true">
<Item ItemId=";Allow_JavaScript_files_to_be_a_part_of_your_program_Use_the_checkJs_option_to_get_errors_from_these__6600" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Allow JavaScript files to be a part of your program. Use the 'checkJS' option to get errors from these files.]]></Val>
<Val><![CDATA[Allow JavaScript files to be a part of your program. Use the 'checkJs' option to get errors from these files.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Povolte, aby se soubory JavaScriptu staly součástí programu. K získání informací o chybách v těchto souborech použít možnost checkJS.]]></Val>
<Val><![CDATA[Povolte, aby se soubory JavaScriptu staly součástí programu. K získání informací o chybách v těchto souborech použít možnost checkJs.]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Allow JavaScript files to be a part of your program. Use the `checkJS` option to get errors from these files.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
@ -3051,6 +3048,15 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Call_target_does_not_contain_any_signatures_2346" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Call target does not contain any signatures.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Cíl volání neobsahuje žádné signatury.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Can_only_convert_logical_AND_access_chains_95142" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Can only convert logical AND access chains]]></Val>
@ -4077,11 +4083,11 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Class_name_cannot_be_Object_when_targeting_ES5_with_module_0_2725" ItemType="0" PsrId="306" Leaf="true">
<Item ItemId=";Class_name_cannot_be_Object_when_targeting_ES5_and_above_with_module_0_2725" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Class name cannot be 'Object' when targeting ES5 with module {0}.]]></Val>
<Val><![CDATA[Class name cannot be 'Object' when targeting ES5 and above with module {0}.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Když se cílí na ES5 s modulem {0}, název třídy nemůže být Object.]]></Val>
<Val><![CDATA[Když se cílí na ES5 a výše s modulem {0}, název třídy nemůže být Object.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />

View File

@ -1887,15 +1887,12 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Allow_JavaScript_files_to_be_a_part_of_your_program_Use_the_checkJS_option_to_get_errors_from_these__6600" ItemType="0" PsrId="306" Leaf="true">
<Item ItemId=";Allow_JavaScript_files_to_be_a_part_of_your_program_Use_the_checkJs_option_to_get_errors_from_these__6600" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Allow JavaScript files to be a part of your program. Use the 'checkJS' option to get errors from these files.]]></Val>
<Val><![CDATA[Allow JavaScript files to be a part of your program. Use the 'checkJs' option to get errors from these files.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Lassen Sie zu, dass JavaScript-Dateien Teil Ihres Programms werden. Verwenden Sie die Option „checkJS“, um Fehler aus diesen Dateien abzurufen.]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Allow JavaScript files to be a part of your program. Use the `checkJS` option to get errors from these files.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
@ -3039,6 +3036,15 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Call_target_does_not_contain_any_signatures_2346" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Call target does not contain any signatures.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Das Aufrufziel enthält keine Signaturen.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Can_only_convert_logical_AND_access_chains_95142" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Can only convert logical AND access chains]]></Val>
@ -4065,11 +4071,11 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Class_name_cannot_be_Object_when_targeting_ES5_with_module_0_2725" ItemType="0" PsrId="306" Leaf="true">
<Item ItemId=";Class_name_cannot_be_Object_when_targeting_ES5_and_above_with_module_0_2725" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Class name cannot be 'Object' when targeting ES5 with module {0}.]]></Val>
<Val><![CDATA[Class name cannot be 'Object' when targeting ES5 and above with module {0}.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Der Klassenname darf nicht "Object" lauten, wenn ES5 mit Modul "{0}" als Ziel verwendet wird.]]></Val>
<Val><![CDATA[Der Klassenname darf nicht „Object“ lauten, wenn ES5 und höher mit Modul „{0}“ als Ziel verwendet wird.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />

View File

@ -1902,15 +1902,12 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Allow_JavaScript_files_to_be_a_part_of_your_program_Use_the_checkJS_option_to_get_errors_from_these__6600" ItemType="0" PsrId="306" Leaf="true">
<Item ItemId=";Allow_JavaScript_files_to_be_a_part_of_your_program_Use_the_checkJs_option_to_get_errors_from_these__6600" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Allow JavaScript files to be a part of your program. Use the 'checkJS' option to get errors from these files.]]></Val>
<Val><![CDATA[Allow JavaScript files to be a part of your program. Use the 'checkJs' option to get errors from these files.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Permita que los archivos JavaScript formen parte del programa. Use la opción "checkJS" para obtener errores de estos archivos.]]></Val>
<Val><![CDATA[Permitir que los archivos JavaScript formen parte del programa. Use la opción "checkJS" para obtener errores de estos archivos.]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Allow JavaScript files to be a part of your program. Use the `checkJS` option to get errors from these files.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
@ -3054,6 +3051,15 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Call_target_does_not_contain_any_signatures_2346" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Call target does not contain any signatures.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[El destino de llamada no contiene signaturas.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Can_only_convert_logical_AND_access_chains_95142" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Can only convert logical AND access chains]]></Val>
@ -4080,11 +4086,11 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Class_name_cannot_be_Object_when_targeting_ES5_with_module_0_2725" ItemType="0" PsrId="306" Leaf="true">
<Item ItemId=";Class_name_cannot_be_Object_when_targeting_ES5_and_above_with_module_0_2725" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Class name cannot be 'Object' when targeting ES5 with module {0}.]]></Val>
<Val><![CDATA[Class name cannot be 'Object' when targeting ES5 and above with module {0}.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[El nombre de clase no puede ser "Object" cuando el destino es ES5 con un módulo {0}.]]></Val>
<Val><![CDATA[El nombre de clase no puede ser 'Object' cuando el destino es ES5 y versiones posteriores con el módulo {0}.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />

View File

@ -1902,15 +1902,12 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Allow_JavaScript_files_to_be_a_part_of_your_program_Use_the_checkJS_option_to_get_errors_from_these__6600" ItemType="0" PsrId="306" Leaf="true">
<Item ItemId=";Allow_JavaScript_files_to_be_a_part_of_your_program_Use_the_checkJs_option_to_get_errors_from_these__6600" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Allow JavaScript files to be a part of your program. Use the 'checkJS' option to get errors from these files.]]></Val>
<Val><![CDATA[Allow JavaScript files to be a part of your program. Use the 'checkJs' option to get errors from these files.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Autorisez les fichiers JavaScript à faire partie de votre programme. Utilisez loption « checkJS » pour obtenir des erreurs à partir de ces fichiers.]]></Val>
<Val><![CDATA[Autorisez les fichiers JavaScript à faire partie de votre programme. Utilisez loption « checkJS » pour obtenir des erreurs à partir de ces fichiers.]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Allow JavaScript files to be a part of your program. Use the `checkJS` option to get errors from these files.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
@ -3054,6 +3051,15 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Call_target_does_not_contain_any_signatures_2346" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Call target does not contain any signatures.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[La cible de l'appel ne contient aucune signature.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Can_only_convert_logical_AND_access_chains_95142" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Can only convert logical AND access chains]]></Val>
@ -4080,11 +4086,11 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Class_name_cannot_be_Object_when_targeting_ES5_with_module_0_2725" ItemType="0" PsrId="306" Leaf="true">
<Item ItemId=";Class_name_cannot_be_Object_when_targeting_ES5_and_above_with_module_0_2725" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Class name cannot be 'Object' when targeting ES5 with module {0}.]]></Val>
<Val><![CDATA[Class name cannot be 'Object' when targeting ES5 and above with module {0}.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Le nom de la classe ne peut pas être 'Object' quand ES5 est ciblé avec le module {0}.]]></Val>
<Val><![CDATA[Le nom de la classe ne peut pas être « Object » quand ES5 et ses versions ultérieures sont ciblées avec le module {0}.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />

View File

@ -1890,15 +1890,12 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Allow_JavaScript_files_to_be_a_part_of_your_program_Use_the_checkJS_option_to_get_errors_from_these__6600" ItemType="0" PsrId="306" Leaf="true">
<Item ItemId=";Allow_JavaScript_files_to_be_a_part_of_your_program_Use_the_checkJs_option_to_get_errors_from_these__6600" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Allow JavaScript files to be a part of your program. Use the 'checkJS' option to get errors from these files.]]></Val>
<Val><![CDATA[Allow JavaScript files to be a part of your program. Use the 'checkJs' option to get errors from these files.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Consente l'uso di file JavaScript nel programma. Usare l'opzione 'checkJS' per ottenere gli errori da questi file.]]></Val>
<Val><![CDATA[Acconsenti che i file JavaScript facciano parte del tuo programma. Usa l'opzione 'checkJs' per acquisire gli errori da questi file.]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Allow JavaScript files to be a part of your program. Use the `checkJS` option to get errors from these files.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
@ -3042,6 +3039,15 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Call_target_does_not_contain_any_signatures_2346" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Call target does not contain any signatures.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[La destinazione della chiamata non contiene alcuna firma.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Can_only_convert_logical_AND_access_chains_95142" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Can only convert logical AND access chains]]></Val>
@ -4068,11 +4074,11 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Class_name_cannot_be_Object_when_targeting_ES5_with_module_0_2725" ItemType="0" PsrId="306" Leaf="true">
<Item ItemId=";Class_name_cannot_be_Object_when_targeting_ES5_and_above_with_module_0_2725" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Class name cannot be 'Object' when targeting ES5 with module {0}.]]></Val>
<Val><![CDATA[Class name cannot be 'Object' when targeting ES5 and above with module {0}.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Il nome della classe non può essere 'Object' quando la destinazione è ES5 con il modulo {0}.]]></Val>
<Val><![CDATA[Il nome della classe non può essere 'Object' quando la destinazione è ES5 o superiore con il modulo {0}.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />

View File

@ -1890,15 +1890,12 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Allow_JavaScript_files_to_be_a_part_of_your_program_Use_the_checkJS_option_to_get_errors_from_these__6600" ItemType="0" PsrId="306" Leaf="true">
<Item ItemId=";Allow_JavaScript_files_to_be_a_part_of_your_program_Use_the_checkJs_option_to_get_errors_from_these__6600" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Allow JavaScript files to be a part of your program. Use the 'checkJS' option to get errors from these files.]]></Val>
<Val><![CDATA[Allow JavaScript files to be a part of your program. Use the 'checkJs' option to get errors from these files.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[JavaScript ファイルをプログラムの一部として使用することを許可します。'checkJS' オプションを使用して、これらのファイルからエラーを取得してください。]]></Val>
<Val><![CDATA[JavaScript ファイルをプログラムの一部として使用することを許可します。'checkJs' オプションを使用して、これらのファイルからエラーを取得してください。]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Allow JavaScript files to be a part of your program. Use the `checkJS` option to get errors from these files.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
@ -3042,6 +3039,15 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Call_target_does_not_contain_any_signatures_2346" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Call target does not contain any signatures.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[呼び出しターゲットにシグネチャが含まれていません。]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Can_only_convert_logical_AND_access_chains_95142" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Can only convert logical AND access chains]]></Val>
@ -4068,11 +4074,11 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Class_name_cannot_be_Object_when_targeting_ES5_with_module_0_2725" ItemType="0" PsrId="306" Leaf="true">
<Item ItemId=";Class_name_cannot_be_Object_when_targeting_ES5_and_above_with_module_0_2725" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Class name cannot be 'Object' when targeting ES5 with module {0}.]]></Val>
<Val><![CDATA[Class name cannot be 'Object' when targeting ES5 and above with module {0}.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[モジュール {0} を使用して ES5 をターゲットとするときに、クラス名を 'オブジェクト' にすることはできません。]]></Val>
<Val><![CDATA[モジュール {0} で ES5 以降を対象とする場合、クラス名を 'Object' にすることはできません。]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />

View File

@ -1890,15 +1890,12 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Allow_JavaScript_files_to_be_a_part_of_your_program_Use_the_checkJS_option_to_get_errors_from_these__6600" ItemType="0" PsrId="306" Leaf="true">
<Item ItemId=";Allow_JavaScript_files_to_be_a_part_of_your_program_Use_the_checkJs_option_to_get_errors_from_these__6600" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Allow JavaScript files to be a part of your program. Use the 'checkJS' option to get errors from these files.]]></Val>
<Val><![CDATA[Allow JavaScript files to be a part of your program. Use the 'checkJs' option to get errors from these files.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[JavaScript 파일이 프로그램의 일부가 되도록 허용합니다. 이러한 파일에서 오류를 가져오려면 'checkJS' 옵션을 사용하세요.]]></Val>
<Val><![CDATA[JavaScript 파일이 프로그램의 일부가 되도록 허용합니다. 이러한 파일에서 오류를 가져오려면 'checkJs' 옵션을 사용하세요.]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Allow JavaScript files to be a part of your program. Use the `checkJS` option to get errors from these files.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
@ -3042,6 +3039,15 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Call_target_does_not_contain_any_signatures_2346" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Call target does not contain any signatures.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[호출 대상에 시그니처가 포함되어 있지 않습니다.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Can_only_convert_logical_AND_access_chains_95142" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Can only convert logical AND access chains]]></Val>
@ -4068,9 +4074,9 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Class_name_cannot_be_Object_when_targeting_ES5_with_module_0_2725" ItemType="0" PsrId="306" Leaf="true">
<Item ItemId=";Class_name_cannot_be_Object_when_targeting_ES5_and_above_with_module_0_2725" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Class name cannot be 'Object' when targeting ES5 with module {0}.]]></Val>
<Val><![CDATA[Class name cannot be 'Object' when targeting ES5 and above with module {0}.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[{0} 모듈을 사용하는 ES5를 대상으로 하는 경우 클래스 이름은 'Object'일 수 없습니다.]]></Val>
</Tgt>

View File

@ -1880,15 +1880,12 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Allow_JavaScript_files_to_be_a_part_of_your_program_Use_the_checkJS_option_to_get_errors_from_these__6600" ItemType="0" PsrId="306" Leaf="true">
<Item ItemId=";Allow_JavaScript_files_to_be_a_part_of_your_program_Use_the_checkJs_option_to_get_errors_from_these__6600" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Allow JavaScript files to be a part of your program. Use the 'checkJS' option to get errors from these files.]]></Val>
<Val><![CDATA[Allow JavaScript files to be a part of your program. Use the 'checkJs' option to get errors from these files.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Zezwalaj plikom JavaScript na udział w programie. Użyj opcji „checkJS”, aby uzyskać błędy z tych plików.]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Allow JavaScript files to be a part of your program. Use the `checkJS` option to get errors from these files.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
@ -3032,6 +3029,15 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Call_target_does_not_contain_any_signatures_2346" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Call target does not contain any signatures.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Cel wywołania nie zawiera żadnych podpisów.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Can_only_convert_logical_AND_access_chains_95142" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Can only convert logical AND access chains]]></Val>
@ -4058,11 +4064,11 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Class_name_cannot_be_Object_when_targeting_ES5_with_module_0_2725" ItemType="0" PsrId="306" Leaf="true">
<Item ItemId=";Class_name_cannot_be_Object_when_targeting_ES5_and_above_with_module_0_2725" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Class name cannot be 'Object' when targeting ES5 with module {0}.]]></Val>
<Val><![CDATA[Class name cannot be 'Object' when targeting ES5 and above with module {0}.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Nazwą klasy nie może być słowo „Object”, gdy docelowym językiem jest ES5 z modułem {0}.]]></Val>
<Val><![CDATA[Nazwa klasy nie może być identyczna z „Object” w przypadku modułu ES5 i nowszych {0}.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />

View File

@ -1883,15 +1883,12 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Allow_JavaScript_files_to_be_a_part_of_your_program_Use_the_checkJS_option_to_get_errors_from_these__6600" ItemType="0" PsrId="306" Leaf="true">
<Item ItemId=";Allow_JavaScript_files_to_be_a_part_of_your_program_Use_the_checkJs_option_to_get_errors_from_these__6600" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Allow JavaScript files to be a part of your program. Use the 'checkJS' option to get errors from these files.]]></Val>
<Val><![CDATA[Allow JavaScript files to be a part of your program. Use the 'checkJs' option to get errors from these files.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Permitir que arquivos JavaScript façam parte do seu programa. Use a opção 'checkJS' para obter erros desses arquivos.]]></Val>
<Val><![CDATA[Permitir que arquivos JavaScript façam parte do seu programa. Use a opção "checkJs" para obter erros desses arquivos.]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Allow JavaScript files to be a part of your program. Use the `checkJS` option to get errors from these files.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
@ -3035,6 +3032,15 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Call_target_does_not_contain_any_signatures_2346" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Call target does not contain any signatures.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[O destino da chamada não contém nenhuma assinatura.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Can_only_convert_logical_AND_access_chains_95142" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Can only convert logical AND access chains]]></Val>
@ -4061,11 +4067,11 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Class_name_cannot_be_Object_when_targeting_ES5_with_module_0_2725" ItemType="0" PsrId="306" Leaf="true">
<Item ItemId=";Class_name_cannot_be_Object_when_targeting_ES5_and_above_with_module_0_2725" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Class name cannot be 'Object' when targeting ES5 with module {0}.]]></Val>
<Val><![CDATA[Class name cannot be 'Object' when targeting ES5 and above with module {0}.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[O nome da classe não pode ser 'Object' ao direcionar ES5 com módulo {0}.]]></Val>
<Val><![CDATA[O nome da classe não pode ser 'Object' ao direcionar para ES5 e superior com o módulo {0}.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />

View File

@ -1889,15 +1889,12 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Allow_JavaScript_files_to_be_a_part_of_your_program_Use_the_checkJS_option_to_get_errors_from_these__6600" ItemType="0" PsrId="306" Leaf="true">
<Item ItemId=";Allow_JavaScript_files_to_be_a_part_of_your_program_Use_the_checkJs_option_to_get_errors_from_these__6600" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Allow JavaScript files to be a part of your program. Use the 'checkJS' option to get errors from these files.]]></Val>
<Val><![CDATA[Allow JavaScript files to be a part of your program. Use the 'checkJs' option to get errors from these files.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Разрешите файлам JavaScript быть частью программы. Используйте параметр "checkJS" для получения ошибок из этих файлов.]]></Val>
<Val><![CDATA[Разрешите файлам JavaScript быть частью программы. Используйте параметр "checkJs" для получения ошибок из этих файлов.]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Allow JavaScript files to be a part of your program. Use the `checkJS` option to get errors from these files.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
@ -3041,6 +3038,15 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Call_target_does_not_contain_any_signatures_2346" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Call target does not contain any signatures.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Объект вызова не содержит сигнатуры.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Can_only_convert_logical_AND_access_chains_95142" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Can only convert logical AND access chains]]></Val>
@ -4067,11 +4073,11 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Class_name_cannot_be_Object_when_targeting_ES5_with_module_0_2725" ItemType="0" PsrId="306" Leaf="true">
<Item ItemId=";Class_name_cannot_be_Object_when_targeting_ES5_and_above_with_module_0_2725" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Class name cannot be 'Object' when targeting ES5 with module {0}.]]></Val>
<Val><![CDATA[Class name cannot be 'Object' when targeting ES5 and above with module {0}.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Класс не может иметь имя "Object" при выборе ES5 с модулем {0} в качестве целевого.]]></Val>
<Val><![CDATA[Класс не может иметь имя Object при выборе в качестве цели версии ES5 и более поздней с модулем {0}.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />

View File

@ -1883,15 +1883,12 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Allow_JavaScript_files_to_be_a_part_of_your_program_Use_the_checkJS_option_to_get_errors_from_these__6600" ItemType="0" PsrId="306" Leaf="true">
<Item ItemId=";Allow_JavaScript_files_to_be_a_part_of_your_program_Use_the_checkJs_option_to_get_errors_from_these__6600" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Allow JavaScript files to be a part of your program. Use the 'checkJS' option to get errors from these files.]]></Val>
<Val><![CDATA[Allow JavaScript files to be a part of your program. Use the 'checkJs' option to get errors from these files.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[JavaScript dosyalarının programınızın bir parçası olmasına izin verin. Bu dosyalardan hata almak için 'checkJS' seçeneğini kullanın.]]></Val>
<Val><![CDATA[JavaScript dosyalarının programınızın bir parçası olmasına izin verin. Bu dosyalardan hata almak için 'checkJs' seçeneğini kullanın.]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Allow JavaScript files to be a part of your program. Use the `checkJS` option to get errors from these files.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
@ -3035,6 +3032,15 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Call_target_does_not_contain_any_signatures_2346" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Call target does not contain any signatures.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Çağrı hedefi imza içermiyor.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Can_only_convert_logical_AND_access_chains_95142" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Can only convert logical AND access chains]]></Val>
@ -4061,11 +4067,11 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Class_name_cannot_be_Object_when_targeting_ES5_with_module_0_2725" ItemType="0" PsrId="306" Leaf="true">
<Item ItemId=";Class_name_cannot_be_Object_when_targeting_ES5_and_above_with_module_0_2725" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Class name cannot be 'Object' when targeting ES5 with module {0}.]]></Val>
<Val><![CDATA[Class name cannot be 'Object' when targeting ES5 and above with module {0}.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Modül {0} ile ES5 hedeflendiğinde sınıf adı 'Object' olamaz.]]></Val>
<Val><![CDATA[{0} modülüyle ES5 ve üzeri hedeflendiğinde sınıf adı 'Object' olamaz.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />

View File

@ -7,7 +7,6 @@ import {
createSignatureDeclarationFromSignature,
createStubbedBody,
eachDiagnostic,
getAllSupers,
ImportAdder,
registerCodeFix,
} from "../_namespaces/ts.codefix.js";
@ -40,6 +39,7 @@ import {
firstOrUndefinedIterator,
FunctionExpression,
getCheckFlags,
getClassExtendsHeritageElement,
getClassLikeDeclarationOfSymbol,
getEmitScriptTarget,
getEscapedTextOfJsxAttributeName,
@ -797,3 +797,18 @@ function findScope(node: Node) {
}
return getSourceFileOfNode(node);
}
function getAllSupers(decl: ClassLikeDeclaration | InterfaceDeclaration | undefined, checker: TypeChecker): readonly ClassLikeDeclaration[] {
const res: ClassLikeDeclaration[] = [];
while (decl) {
const superElement = getClassExtendsHeritageElement(decl);
const superSymbol = superElement && checker.getSymbolAtLocation(superElement.expression);
if (!superSymbol) break;
const symbol = superSymbol.flags & SymbolFlags.Alias ? checker.getAliasedSymbol(superSymbol) : superSymbol;
const superDecl = symbol.declarations && find(symbol.declarations, isClassLike);
if (!superDecl) break;
res.push(superDecl);
decl = superDecl;
}
return res;
}

View File

@ -2,7 +2,6 @@ import {
codeFixAll,
createCodeFixAction,
generateAccessorFromProperty,
getAllSupers,
registerCodeFix,
} from "../_namespaces/ts.codefix.js";
import {
@ -10,12 +9,15 @@ import {
CodeFixContext,
Debug,
Diagnostics,
getEffectiveBaseTypeNode,
getSourceFileOfNode,
getTextOfPropertyName,
getTokenAtPosition,
isAccessor,
isClassExpression,
isClassLike,
singleOrUndefined,
isComputedPropertyName,
skipParentheses,
SourceFile,
unescapeLeadingUnderscores,
} from "../_namespaces/ts.js";
@ -56,15 +58,20 @@ function doChange(file: SourceFile, start: number, length: number, code: number,
else if (code === Diagnostics._0_is_defined_as_a_property_in_class_1_but_is_overridden_here_in_2_as_an_accessor.code) {
const checker = context.program.getTypeChecker();
const node = getTokenAtPosition(file, start).parent;
if (isComputedPropertyName(node)) {
return;
}
Debug.assert(isAccessor(node), "error span of fixPropertyOverrideAccessor should only be on an accessor");
const containingClass = node.parent;
Debug.assert(isClassLike(containingClass), "erroneous accessors should only be inside classes");
const base = singleOrUndefined(getAllSupers(containingClass, checker));
if (!base) return [];
const name = unescapeLeadingUnderscores(getTextOfPropertyName(node.name));
const baseProp = checker.getPropertyOfType(checker.getTypeAtLocation(base), name);
if (!baseProp || !baseProp.valueDeclaration) return [];
const baseTypeNode = getEffectiveBaseTypeNode(containingClass);
if (!baseTypeNode) return;
const expression = skipParentheses(baseTypeNode.expression);
const base = isClassExpression(expression) ? expression.symbol : checker.getSymbolAtLocation(expression);
if (!base) return;
const baseType = checker.getDeclaredTypeOfSymbol(base);
const baseProp = checker.getPropertyOfType(baseType, unescapeLeadingUnderscores(getTextOfPropertyName(node.name)));
if (!baseProp || !baseProp.valueDeclaration) return;
startPosition = baseProp.valueDeclaration.pos;
endPosition = baseProp.valueDeclaration.end;

View File

@ -9,9 +9,7 @@ import {
Diagnostics,
factory,
FileTextChanges,
find,
findAncestor,
getClassExtendsHeritageElement,
getDecorators,
getEffectiveModifierFlags,
getFirstConstructorWithBody,
@ -22,7 +20,6 @@ import {
hasEffectiveReadonlyModifier,
hasStaticModifier,
Identifier,
InterfaceDeclaration,
isClassLike,
isElementAccessExpression,
isFunctionLike,
@ -50,10 +47,8 @@ import {
startsWithUnderscore,
StringLiteral,
suppressLeadingAndTrailingTrivia,
SymbolFlags,
SyntaxKind,
textChanges,
TypeChecker,
TypeNode,
} from "../_namespaces/ts.js";
@ -321,22 +316,3 @@ function getDeclarationType(declaration: AcceptedDeclaration, program: Program):
}
return typeNode;
}
/** @internal */
export function getAllSupers(decl: ClassOrInterface | undefined, checker: TypeChecker): readonly ClassOrInterface[] {
const res: ClassLikeDeclaration[] = [];
while (decl) {
const superElement = getClassExtendsHeritageElement(decl);
const superSymbol = superElement && checker.getSymbolAtLocation(superElement.expression);
if (!superSymbol) break;
const symbol = superSymbol.flags & SymbolFlags.Alias ? checker.getAliasedSymbol(superSymbol) : superSymbol;
const superDecl = symbol.declarations && find(symbol.declarations, isClassLike);
if (!superDecl) break;
res.push(superDecl);
decl = superDecl;
}
return res;
}
/** @internal */
export type ClassOrInterface = ClassLikeDeclaration | InterfaceDeclaration;

View File

@ -1595,7 +1595,7 @@ function getJsxClosingTagCompletion(location: Node | undefined, sourceFile: Sour
switch (node.kind) {
case SyntaxKind.JsxClosingElement:
return true;
case SyntaxKind.SlashToken:
case SyntaxKind.LessThanSlashToken:
case SyntaxKind.GreaterThanToken:
case SyntaxKind.Identifier:
case SyntaxKind.PropertyAccessExpression:
@ -3508,7 +3508,7 @@ function getCompletionData(
}
break;
case SyntaxKind.SlashToken:
case SyntaxKind.LessThanSlashToken:
if (currentToken.parent.kind === SyntaxKind.JsxSelfClosingElement) {
location = currentToken;
}
@ -3518,7 +3518,7 @@ function getCompletionData(
switch (parent.kind) {
case SyntaxKind.JsxClosingElement:
if (contextToken.kind === SyntaxKind.SlashToken) {
if (contextToken.kind === SyntaxKind.LessThanSlashToken) {
isStartingCloseTag = true;
location = contextToken;
}
@ -3851,6 +3851,10 @@ function getCompletionData(
if (firstAccessibleSymbolId && addToSeen(seenPropertySymbols, firstAccessibleSymbolId)) {
const index = symbols.length;
symbols.push(firstAccessibleSymbol);
// Symbol completions should have lower priority since they represent computed property access
symbolToSortTextMap[getSymbolId(firstAccessibleSymbol)] = SortText.GlobalsOrKeywords;
const moduleSymbol = firstAccessibleSymbol.parent;
if (
!moduleSymbol ||
@ -5805,7 +5809,7 @@ function isValidTrigger(sourceFile: SourceFile, triggerCharacter: CompletionsTri
case "/":
return !!contextToken && (isStringLiteralLike(contextToken)
? !!tryGetImportFromModuleSpecifier(contextToken)
: contextToken.kind === SyntaxKind.SlashToken && isJsxClosingElement(contextToken.parent));
: contextToken.kind === SyntaxKind.LessThanSlashToken && isJsxClosingElement(contextToken.parent));
case " ":
return !!contextToken && isImportKeyword(contextToken) && contextToken.parent.kind === SyntaxKind.SourceFile;
default:

View File

@ -51,6 +51,7 @@ import {
isClassExpression,
isClassLike,
isClassStaticBlockDeclaration,
isComputedPropertyName,
isConstructorDeclaration,
isDeclarationFileName,
isDefaultClause,
@ -64,6 +65,7 @@ import {
isJSDocOverrideTag,
isJsxOpeningLikeElement,
isJumpStatementTarget,
isKnownSymbol,
isModifier,
isModuleSpecifierLike,
isNamedDeclaration,
@ -328,14 +330,29 @@ function getDefinitionFromOverriddenMember(typeChecker: TypeChecker, node: Node)
const expression = skipParentheses(baseTypeNode.expression);
const base = isClassExpression(expression) ? expression.symbol : typeChecker.getSymbolAtLocation(expression);
if (!base) return;
const baseType = hasStaticModifier(classElement) ? typeChecker.getTypeOfSymbol(base) : typeChecker.getDeclaredTypeOfSymbol(base);
let baseProp: Symbol | undefined;
const name = unescapeLeadingUnderscores(getTextOfPropertyName(classElement.name));
const symbol = hasStaticModifier(classElement)
? typeChecker.getPropertyOfType(typeChecker.getTypeOfSymbol(base), name)
: typeChecker.getPropertyOfType(typeChecker.getDeclaredTypeOfSymbol(base), name);
if (!symbol) return;
if (isComputedPropertyName(classElement.name)) {
const prop = typeChecker.getSymbolAtLocation(classElement.name);
return getDefinitionFromSymbol(typeChecker, symbol, node);
if (!prop) {
return;
}
if (isKnownSymbol(prop)) {
baseProp = find(typeChecker.getPropertiesOfType(baseType), s => s.escapedName === prop.escapedName);
}
else {
baseProp = typeChecker.getPropertyOfType(baseType, unescapeLeadingUnderscores(prop.escapedName));
}
}
else {
baseProp = typeChecker.getPropertyOfType(baseType, unescapeLeadingUnderscores(getTextOfPropertyName(classElement.name)));
}
if (!baseProp) return;
return getDefinitionFromSymbol(typeChecker, baseProp, node);
}
/** @internal */

View File

@ -42,8 +42,10 @@ import {
isBindingPattern,
isCallExpression,
isCallSignatureDeclaration,
isComputedPropertyName,
isConditionalTypeNode,
isConstructorTypeNode,
isConstructSignatureDeclaration,
isEnumMember,
isExpressionWithTypeArguments,
isFunctionDeclaration,
@ -825,6 +827,15 @@ export function provideInlayHints(context: InlayHintsContext): InlayHint[] {
visitForDisplayParts(node.type);
}
break;
case SyntaxKind.ConstructSignature:
Debug.assertNode(node, isConstructSignatureDeclaration);
parts.push({ text: "new " });
visitParametersAndTypeParameters(node);
if (node.type) {
parts.push({ text: ": " });
visitForDisplayParts(node.type);
}
break;
case SyntaxKind.ArrayBindingPattern:
Debug.assertNode(node, isArrayBindingPattern);
parts.push({ text: "[" });
@ -876,6 +887,12 @@ export function provideInlayHints(context: InlayHintsContext): InlayHint[] {
Debug.assertNode(node, isThisTypeNode);
parts.push({ text: "this" });
break;
case SyntaxKind.ComputedPropertyName:
Debug.assertNode(node, isComputedPropertyName);
parts.push({ text: "[" });
visitForDisplayParts(node.expression);
parts.push({ text: "]" });
break;
default:
Debug.failBadSyntaxKind(node);
}

View File

@ -67,8 +67,7 @@ export function collectElements(sourceFile: SourceFile, cancellationToken: Cance
function addNodeOutliningSpans(sourceFile: SourceFile, cancellationToken: CancellationToken, out: OutliningSpan[]): void {
let depthRemaining = 40;
let current = 0;
// Includes the EOF Token so that comments which aren't attached to statements are included
const statements = [...sourceFile.statements, sourceFile.endOfFileToken];
const statements = sourceFile.statements;
const n = statements.length;
while (current < n) {
while (current < n && !isAnyImportSyntax(statements[current])) {
@ -87,6 +86,9 @@ function addNodeOutliningSpans(sourceFile: SourceFile, cancellationToken: Cancel
}
}
// Visit the EOF Token so that comments which aren't attached to statements are included.
visitNode(sourceFile.endOfFileToken);
function visitNode(n: Node) {
if (depthRemaining === 0) return;
cancellationToken.throwIfCancellationRequested();

View File

@ -504,8 +504,9 @@ function createChildren(node: Node, sourceFile: SourceFileLike | undefined): rea
});
return children;
}
const languageVariant = sourceFile?.languageVariant ?? LanguageVariant.Standard;
scanner.setText((sourceFile || node.getSourceFile()).text);
scanner.setLanguageVariant(languageVariant);
let pos = node.pos;
const processNode = (child: Node) => {
addSyntheticNodes(children, pos, child.pos, node);
@ -526,6 +527,7 @@ function createChildren(node: Node, sourceFile: SourceFileLike | undefined): rea
node.forEachChild(processNode, processNodes);
addSyntheticNodes(children, pos, node.end, node);
scanner.setText(undefined);
scanner.setLanguageVariant(LanguageVariant.Standard);
return children;
}
@ -3546,6 +3548,7 @@ function getContainingObjectLiteralElementWorker(node: Node): ObjectLiteralEleme
// falls through
case SyntaxKind.Identifier:
case SyntaxKind.JsxNamespacedName:
return isObjectLiteralElement(node.parent) &&
(node.parent.parent.kind === SyntaxKind.ObjectLiteralExpression || node.parent.parent.kind === SyntaxKind.JsxAttributes) &&
node.parent.name === node ? node.parent : undefined;

View File

@ -50,6 +50,7 @@ import {
isFunctionLike,
isIdentifier,
isInExpressionContext,
isInJSDoc,
isJsxOpeningLikeElement,
isLet,
isModuleWithStringLiteralName,
@ -797,7 +798,7 @@ function getSymbolDisplayPartsDocumentationAndSymbolKindWorker(
}
}
if (tags.length === 0 && !hasMultipleSignatures) {
if (tags.length === 0 && !hasMultipleSignatures && !isInJSDoc(location)) {
tags = symbol.getContextualJsDocTags(enclosingDeclaration, typeChecker);
}

View File

@ -1889,7 +1889,7 @@ export function isInsideJsxElementOrAttribute(sourceFile: SourceFile, position:
}
// <div>|</div>
if (token.kind === SyntaxKind.LessThanToken && token.parent.kind === SyntaxKind.JsxClosingElement) {
if (token.kind === SyntaxKind.LessThanSlashToken && token.parent.kind === SyntaxKind.JsxClosingElement) {
return true;
}
@ -1934,6 +1934,7 @@ export function isInsideJsxElement(sourceFile: SourceFile, position: number): bo
|| node.kind === SyntaxKind.CloseBraceToken
|| node.kind === SyntaxKind.OpenBraceToken
|| node.kind === SyntaxKind.SlashToken
|| node.kind === SyntaxKind.LessThanSlashToken
) {
node = node.parent;
}

View File

@ -366,5 +366,62 @@ describe("unittests:: PrinterAPI", () => {
ts.factory.createNoSubstitutionTemplateLiteral("\n"),
ts.createSourceFile("source.ts", "", ts.ScriptTarget.ESNext),
));
printsCorrectly("binaryBarBarExpressionWithLeftConditionalExpression", {}, printer =>
printer.printNode(
ts.EmitHint.Unspecified,
ts.factory.createExpressionStatement(
ts.factory.createBinaryExpression(
ts.factory.createConditionalExpression(
ts.factory.createIdentifier("a"),
ts.factory.createToken(ts.SyntaxKind.QuestionToken),
ts.factory.createIdentifier("b"),
ts.factory.createToken(ts.SyntaxKind.ColonToken),
ts.factory.createIdentifier("c"),
),
ts.factory.createToken(ts.SyntaxKind.BarBarToken),
ts.factory.createIdentifier("d"),
),
),
ts.createSourceFile("source.ts", "", ts.ScriptTarget.ESNext),
));
printsCorrectly("binaryAmpersandAmpersandExpressionWithLeftConditionalExpression", {}, printer =>
printer.printNode(
ts.EmitHint.Unspecified,
ts.factory.createExpressionStatement(
ts.factory.createBinaryExpression(
ts.factory.createConditionalExpression(
ts.factory.createIdentifier("a"),
ts.factory.createToken(ts.SyntaxKind.QuestionToken),
ts.factory.createIdentifier("b"),
ts.factory.createToken(ts.SyntaxKind.ColonToken),
ts.factory.createIdentifier("c"),
),
ts.factory.createToken(ts.SyntaxKind.AmpersandAmpersandToken),
ts.factory.createIdentifier("d"),
),
),
ts.createSourceFile("source.ts", "", ts.ScriptTarget.ESNext),
));
printsCorrectly("binaryQuestionQuestionExpressionWithLeftConditionalExpression", {}, printer =>
printer.printNode(
ts.EmitHint.Unspecified,
ts.factory.createExpressionStatement(
ts.factory.createBinaryExpression(
ts.factory.createConditionalExpression(
ts.factory.createIdentifier("a"),
ts.factory.createToken(ts.SyntaxKind.QuestionToken),
ts.factory.createIdentifier("b"),
ts.factory.createToken(ts.SyntaxKind.ColonToken),
ts.factory.createIdentifier("c"),
),
ts.factory.createToken(ts.SyntaxKind.QuestionQuestionToken),
ts.factory.createIdentifier("d"),
),
),
ts.createSourceFile("source.ts", "", ts.ScriptTarget.ESNext),
));
});
});

View File

@ -0,0 +1,12 @@
YieldExpression20_es6.ts(3,8): error TS1163: A 'yield' expression is only allowed in a generator body.
==== YieldExpression20_es6.ts (1 errors) ====
function* test() {
return () => ({
b: yield 2, // error
~~~~~
!!! error TS1163: A 'yield' expression is only allowed in a generator body.
});
}

View File

@ -0,0 +1,16 @@
//// [tests/cases/conformance/es6/yieldExpressions/YieldExpression20_es6.ts] ////
//// [YieldExpression20_es6.ts]
function* test() {
return () => ({
b: yield 2, // error
});
}
//// [YieldExpression20_es6.js]
function* test() {
return () => ({
b: yield 2, // error
});
}

View File

@ -0,0 +1,13 @@
//// [tests/cases/conformance/es6/yieldExpressions/YieldExpression20_es6.ts] ////
=== YieldExpression20_es6.ts ===
function* test() {
>test : Symbol(test, Decl(YieldExpression20_es6.ts, 0, 0))
return () => ({
b: yield 2, // error
>b : Symbol(b, Decl(YieldExpression20_es6.ts, 1, 17))
});
}

View File

@ -0,0 +1,26 @@
//// [tests/cases/conformance/es6/yieldExpressions/YieldExpression20_es6.ts] ////
=== YieldExpression20_es6.ts ===
function* test() {
>test : () => Generator<never, () => { b: any; }, unknown>
> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
return () => ({
>() => ({ b: yield 2, // error }) : () => { b: any; }
> : ^^^^^^^^^^^^^^^^^
>({ b: yield 2, // error }) : { b: any; }
> : ^^^^^^^^^^^
>{ b: yield 2, // error } : { b: any; }
> : ^^^^^^^^^^^
b: yield 2, // error
>b : any
> : ^^^
>yield 2 : any
> : ^^^
>2 : 2
> : ^
});
}

View File

@ -0,0 +1,32 @@
accessorInAmbientContextES5.ts(25,14): error TS18045: Properties with the 'accessor' modifier are only available when targeting ECMAScript 2015 and higher.
==== accessorInAmbientContextES5.ts (1 errors) ====
// Should allow accessor in ambient contexts even when targeting ES5
declare class AmbientClass {
accessor prop1: string;
static accessor prop2: number;
private accessor prop3: boolean;
private static accessor prop4: symbol;
}
declare namespace AmbientNamespace {
class C {
accessor prop: string;
}
}
// Should also work in .d.ts files (simulated with declare)
declare module "some-module" {
export class ExportedClass {
accessor value: any;
}
}
// Regular class should still error when targeting ES5
class RegularClass {
accessor shouldError: string; // Should still error
~~~~~~~~~~~
!!! error TS18045: Properties with the 'accessor' modifier are only available when targeting ECMAScript 2015 and higher.
}

View File

@ -0,0 +1,81 @@
//// [tests/cases/compiler/accessorInAmbientContextES5.ts] ////
//// [accessorInAmbientContextES5.ts]
// Should allow accessor in ambient contexts even when targeting ES5
declare class AmbientClass {
accessor prop1: string;
static accessor prop2: number;
private accessor prop3: boolean;
private static accessor prop4: symbol;
}
declare namespace AmbientNamespace {
class C {
accessor prop: string;
}
}
// Should also work in .d.ts files (simulated with declare)
declare module "some-module" {
export class ExportedClass {
accessor value: any;
}
}
// Regular class should still error when targeting ES5
class RegularClass {
accessor shouldError: string; // Should still error
}
//// [accessorInAmbientContextES5.js]
// Should allow accessor in ambient contexts even when targeting ES5
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
};
var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
if (kind === "m") throw new TypeError("Private method is not writable");
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
};
var _RegularClass_shouldError_accessor_storage;
// Regular class should still error when targeting ES5
var RegularClass = /** @class */ (function () {
function RegularClass() {
_RegularClass_shouldError_accessor_storage.set(this, void 0);
}
Object.defineProperty(RegularClass.prototype, "shouldError", {
get: function () { return __classPrivateFieldGet(this, _RegularClass_shouldError_accessor_storage, "f"); } // Should still error
,
set: function (value) { __classPrivateFieldSet(this, _RegularClass_shouldError_accessor_storage, value, "f"); },
enumerable: false,
configurable: true
});
return RegularClass;
}());
_RegularClass_shouldError_accessor_storage = new WeakMap();
//// [accessorInAmbientContextES5.d.ts]
declare class AmbientClass {
accessor prop1: string;
static accessor prop2: number;
private accessor prop3;
private static accessor prop4;
}
declare namespace AmbientNamespace {
class C {
accessor prop: string;
}
}
declare module "some-module" {
class ExportedClass {
accessor value: any;
}
}
declare class RegularClass {
accessor shouldError: string;
}

View File

@ -0,0 +1,51 @@
//// [tests/cases/compiler/accessorInAmbientContextES5.ts] ////
=== accessorInAmbientContextES5.ts ===
// Should allow accessor in ambient contexts even when targeting ES5
declare class AmbientClass {
>AmbientClass : Symbol(AmbientClass, Decl(accessorInAmbientContextES5.ts, 0, 0))
accessor prop1: string;
>prop1 : Symbol(AmbientClass.prop1, Decl(accessorInAmbientContextES5.ts, 2, 28))
static accessor prop2: number;
>prop2 : Symbol(AmbientClass.prop2, Decl(accessorInAmbientContextES5.ts, 3, 27))
private accessor prop3: boolean;
>prop3 : Symbol(AmbientClass.prop3, Decl(accessorInAmbientContextES5.ts, 4, 34))
private static accessor prop4: symbol;
>prop4 : Symbol(AmbientClass.prop4, Decl(accessorInAmbientContextES5.ts, 5, 36))
}
declare namespace AmbientNamespace {
>AmbientNamespace : Symbol(AmbientNamespace, Decl(accessorInAmbientContextES5.ts, 7, 1))
class C {
>C : Symbol(C, Decl(accessorInAmbientContextES5.ts, 9, 36))
accessor prop: string;
>prop : Symbol(C.prop, Decl(accessorInAmbientContextES5.ts, 10, 13))
}
}
// Should also work in .d.ts files (simulated with declare)
declare module "some-module" {
>"some-module" : Symbol("some-module", Decl(accessorInAmbientContextES5.ts, 13, 1))
export class ExportedClass {
>ExportedClass : Symbol(ExportedClass, Decl(accessorInAmbientContextES5.ts, 16, 30))
accessor value: any;
>value : Symbol(ExportedClass.value, Decl(accessorInAmbientContextES5.ts, 17, 32))
}
}
// Regular class should still error when targeting ES5
class RegularClass {
>RegularClass : Symbol(RegularClass, Decl(accessorInAmbientContextES5.ts, 20, 1))
accessor shouldError: string; // Should still error
>shouldError : Symbol(RegularClass.shouldError, Decl(accessorInAmbientContextES5.ts, 23, 20))
}

View File

@ -0,0 +1,64 @@
//// [tests/cases/compiler/accessorInAmbientContextES5.ts] ////
=== accessorInAmbientContextES5.ts ===
// Should allow accessor in ambient contexts even when targeting ES5
declare class AmbientClass {
>AmbientClass : AmbientClass
> : ^^^^^^^^^^^^
accessor prop1: string;
>prop1 : string
> : ^^^^^^
static accessor prop2: number;
>prop2 : number
> : ^^^^^^
private accessor prop3: boolean;
>prop3 : boolean
> : ^^^^^^^
private static accessor prop4: symbol;
>prop4 : symbol
> : ^^^^^^
}
declare namespace AmbientNamespace {
>AmbientNamespace : typeof AmbientNamespace
> : ^^^^^^^^^^^^^^^^^^^^^^^
class C {
>C : C
> : ^
accessor prop: string;
>prop : string
> : ^^^^^^
}
}
// Should also work in .d.ts files (simulated with declare)
declare module "some-module" {
>"some-module" : typeof import("some-module")
> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
export class ExportedClass {
>ExportedClass : ExportedClass
> : ^^^^^^^^^^^^^
accessor value: any;
>value : any
> : ^^^
}
}
// Regular class should still error when targeting ES5
class RegularClass {
>RegularClass : RegularClass
> : ^^^^^^^^^^^^
accessor shouldError: string; // Should still error
>shouldError : string
> : ^^^^^^
}

View File

@ -0,0 +1,16 @@
accessorsOverrideProperty10.ts(6,7): error TS2611: 'x' is defined as a property in class 'B', but is overridden here in 'C' as an accessor.
==== accessorsOverrideProperty10.ts (1 errors) ====
class A {
x = 1;
}
class B extends A {}
class C extends B {
get x() {
~
!!! error TS2611: 'x' is defined as a property in class 'B', but is overridden here in 'C' as an accessor.
return 2;
}
}

View File

@ -0,0 +1,24 @@
//// [tests/cases/conformance/classes/propertyMemberDeclarations/accessorsOverrideProperty10.ts] ////
=== accessorsOverrideProperty10.ts ===
class A {
>A : Symbol(A, Decl(accessorsOverrideProperty10.ts, 0, 0))
x = 1;
>x : Symbol(A.x, Decl(accessorsOverrideProperty10.ts, 0, 9))
}
class B extends A {}
>B : Symbol(B, Decl(accessorsOverrideProperty10.ts, 2, 1))
>A : Symbol(A, Decl(accessorsOverrideProperty10.ts, 0, 0))
class C extends B {
>C : Symbol(C, Decl(accessorsOverrideProperty10.ts, 3, 20))
>B : Symbol(B, Decl(accessorsOverrideProperty10.ts, 2, 1))
get x() {
>x : Symbol(C.x, Decl(accessorsOverrideProperty10.ts, 4, 19))
return 2;
}
}

View File

@ -0,0 +1,35 @@
//// [tests/cases/conformance/classes/propertyMemberDeclarations/accessorsOverrideProperty10.ts] ////
=== accessorsOverrideProperty10.ts ===
class A {
>A : A
> : ^
x = 1;
>x : number
> : ^^^^^^
>1 : 1
> : ^
}
class B extends A {}
>B : B
> : ^
>A : A
> : ^
class C extends B {
>C : C
> : ^
>B : B
> : ^
get x() {
>x : number
> : ^^^^^^
return 2;
>2 : 2
> : ^
}
}

View File

@ -0,0 +1,66 @@
//// [tests/cases/conformance/declarationEmit/anonymousClassAccessorsDeclarationEmit1.ts] ////
//// [anonymousClassAccessorsDeclarationEmit1.ts]
export abstract class Base {
accessor a = 1;
}
export function middle(Super = Base) {
abstract class Middle extends Super {}
return Middle;
}
class A {
constructor(...args: any[]) {}
}
export function Mixin<T extends typeof A>(Super: T) {
return class B extends Super {
get myName(): string {
return "B";
}
set myName(arg: string) {}
};
}
//// [anonymousClassAccessorsDeclarationEmit1.js]
export class Base {
accessor a = 1;
}
export function middle(Super = Base) {
class Middle extends Super {
}
return Middle;
}
class A {
constructor(...args) { }
}
export function Mixin(Super) {
return class B extends Super {
get myName() {
return "B";
}
set myName(arg) { }
};
}
//// [anonymousClassAccessorsDeclarationEmit1.d.ts]
export declare abstract class Base {
accessor a: number;
}
export declare function middle(Super?: typeof Base): abstract new () => {
get a(): number;
set a(arg: number);
};
declare class A {
constructor(...args: any[]);
}
export declare function Mixin<T extends typeof A>(Super: T): {
new (...args: any[]): {
get myName(): string;
set myName(arg: string);
};
} & T;
export {};

View File

@ -0,0 +1,53 @@
//// [tests/cases/conformance/declarationEmit/anonymousClassAccessorsDeclarationEmit1.ts] ////
=== anonymousClassAccessorsDeclarationEmit1.ts ===
export abstract class Base {
>Base : Symbol(Base, Decl(anonymousClassAccessorsDeclarationEmit1.ts, 0, 0))
accessor a = 1;
>a : Symbol(Base.a, Decl(anonymousClassAccessorsDeclarationEmit1.ts, 0, 28))
}
export function middle(Super = Base) {
>middle : Symbol(middle, Decl(anonymousClassAccessorsDeclarationEmit1.ts, 2, 1))
>Super : Symbol(Super, Decl(anonymousClassAccessorsDeclarationEmit1.ts, 4, 23))
>Base : Symbol(Base, Decl(anonymousClassAccessorsDeclarationEmit1.ts, 0, 0))
abstract class Middle extends Super {}
>Middle : Symbol(Middle, Decl(anonymousClassAccessorsDeclarationEmit1.ts, 4, 38))
>Super : Symbol(Super, Decl(anonymousClassAccessorsDeclarationEmit1.ts, 4, 23))
return Middle;
>Middle : Symbol(Middle, Decl(anonymousClassAccessorsDeclarationEmit1.ts, 4, 38))
}
class A {
>A : Symbol(A, Decl(anonymousClassAccessorsDeclarationEmit1.ts, 7, 1))
constructor(...args: any[]) {}
>args : Symbol(args, Decl(anonymousClassAccessorsDeclarationEmit1.ts, 10, 14))
}
export function Mixin<T extends typeof A>(Super: T) {
>Mixin : Symbol(Mixin, Decl(anonymousClassAccessorsDeclarationEmit1.ts, 11, 1))
>T : Symbol(T, Decl(anonymousClassAccessorsDeclarationEmit1.ts, 13, 22))
>A : Symbol(A, Decl(anonymousClassAccessorsDeclarationEmit1.ts, 7, 1))
>Super : Symbol(Super, Decl(anonymousClassAccessorsDeclarationEmit1.ts, 13, 42))
>T : Symbol(T, Decl(anonymousClassAccessorsDeclarationEmit1.ts, 13, 22))
return class B extends Super {
>B : Symbol(B, Decl(anonymousClassAccessorsDeclarationEmit1.ts, 14, 8))
>Super : Symbol(Super, Decl(anonymousClassAccessorsDeclarationEmit1.ts, 13, 42))
get myName(): string {
>myName : Symbol(B.myName, Decl(anonymousClassAccessorsDeclarationEmit1.ts, 14, 32), Decl(anonymousClassAccessorsDeclarationEmit1.ts, 17, 5))
return "B";
}
set myName(arg: string) {}
>myName : Symbol(B.myName, Decl(anonymousClassAccessorsDeclarationEmit1.ts, 14, 32), Decl(anonymousClassAccessorsDeclarationEmit1.ts, 17, 5))
>arg : Symbol(arg, Decl(anonymousClassAccessorsDeclarationEmit1.ts, 18, 15))
};
}

View File

@ -0,0 +1,75 @@
//// [tests/cases/conformance/declarationEmit/anonymousClassAccessorsDeclarationEmit1.ts] ////
=== anonymousClassAccessorsDeclarationEmit1.ts ===
export abstract class Base {
>Base : Base
> : ^^^^
accessor a = 1;
>a : number
> : ^^^^^^
>1 : 1
> : ^
}
export function middle(Super = Base) {
>middle : (Super?: typeof Base) => typeof Middle
> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>Super : typeof Base
> : ^^^^^^^^^^^
>Base : typeof Base
> : ^^^^^^^^^^^
abstract class Middle extends Super {}
>Middle : Middle
> : ^^^^^^
>Super : Base
> : ^^^^
return Middle;
>Middle : typeof Middle
> : ^^^^^^^^^^^^^
}
class A {
>A : A
> : ^
constructor(...args: any[]) {}
>args : any[]
> : ^^^^^
}
export function Mixin<T extends typeof A>(Super: T) {
>Mixin : <T extends typeof A>(Super: T) => { new (...args: any[]): B; prototype: Mixin<any>.B; } & T
> : ^ ^^^^^^^^^ ^^ ^^ ^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>A : typeof A
> : ^^^^^^^^
>Super : T
> : ^
return class B extends Super {
>class B extends Super { get myName(): string { return "B"; } set myName(arg: string) {} } : { new (...args: any[]): B; prototype: Mixin<any>.B; } & T
> : ^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>B : { new (...args: any[]): B; prototype: Mixin<any>.B; } & T
> : ^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>Super : A
> : ^
get myName(): string {
>myName : string
> : ^^^^^^
return "B";
>"B" : "B"
> : ^^^
}
set myName(arg: string) {}
>myName : string
> : ^^^^^^
>arg : string
> : ^^^^^^
};
}

View File

@ -3646,7 +3646,7 @@ declare namespace ts {
readDirectory(rootDir: string, extensions: readonly string[], excludes: readonly string[] | undefined, includes: readonly string[] | undefined, depth?: number): string[];
}
}
const versionMajorMinor = "5.9";
const versionMajorMinor = "6.0";
/** The version of the TypeScript compiler release */
const version: string;
/**
@ -5907,6 +5907,7 @@ declare namespace ts {
*/
interface SourceFileLike {
readonly text: string;
languageVariant?: LanguageVariant;
}
interface SourceFileLike {
getLineAndCharacterOfPosition(pos: number): LineAndCharacter;

View File

@ -45,7 +45,9 @@ declare class C2 {
}
declare function f(): {
new (): {
a: any;
get a(): any;
set a(arg: any);
};
b: any;
get b(): any;
set b(arg: any);
};

View File

@ -0,0 +1,17 @@
/main.ts(5,17): error TS2737: BigInt literals are not available when targeting lower than ES2020.
==== /ambient.d.ts (0 errors) ====
declare const fromDts = 789n;
declare namespace Lib {
const value = 999n;
}
==== /main.ts (1 errors) ====
// Minimal repro from issue
declare const n = 123n;
// Non-ambient for comparison
const regular = 456n;
~~~~
!!! error TS2737: BigInt literals are not available when targeting lower than ES2020.

View File

@ -0,0 +1,18 @@
//// [tests/cases/compiler/bigintAmbientMinimal.ts] ////
//// [ambient.d.ts]
declare const fromDts = 789n;
declare namespace Lib {
const value = 999n;
}
//// [main.ts]
// Minimal repro from issue
declare const n = 123n;
// Non-ambient for comparison
const regular = 456n;
//// [main.js]
// Non-ambient for comparison
var regular = 456n;

View File

@ -0,0 +1,22 @@
//// [tests/cases/compiler/bigintAmbientMinimal.ts] ////
=== /ambient.d.ts ===
declare const fromDts = 789n;
>fromDts : Symbol(fromDts, Decl(ambient.d.ts, 0, 13))
declare namespace Lib {
>Lib : Symbol(Lib, Decl(ambient.d.ts, 0, 29))
const value = 999n;
>value : Symbol(value, Decl(ambient.d.ts, 2, 9))
}
=== /main.ts ===
// Minimal repro from issue
declare const n = 123n;
>n : Symbol(n, Decl(main.ts, 1, 13))
// Non-ambient for comparison
const regular = 456n;
>regular : Symbol(regular, Decl(main.ts, 4, 5))

View File

@ -0,0 +1,35 @@
//// [tests/cases/compiler/bigintAmbientMinimal.ts] ////
=== /ambient.d.ts ===
declare const fromDts = 789n;
>fromDts : 789n
> : ^^^^
>789n : 789n
> : ^^^^
declare namespace Lib {
>Lib : typeof Lib
> : ^^^^^^^^^^
const value = 999n;
>value : 999n
> : ^^^^
>999n : 999n
> : ^^^^
}
=== /main.ts ===
// Minimal repro from issue
declare const n = 123n;
>n : 123n
> : ^^^^
>123n : 123n
> : ^^^^
// Non-ambient for comparison
const regular = 456n;
>regular : 456n
> : ^^^^
>456n : 456n
> : ^^^^

View File

@ -1,4 +1,4 @@
checkForObjectTooStrict.ts(3,18): error TS2725: Class name cannot be 'Object' when targeting ES5 with module CommonJS.
checkForObjectTooStrict.ts(3,18): error TS2725: Class name cannot be 'Object' when targeting ES5 and above with module CommonJS.
==== checkForObjectTooStrict.ts (1 errors) ====
@ -6,7 +6,7 @@ checkForObjectTooStrict.ts(3,18): error TS2725: Class name cannot be 'Object' wh
export class Object {
~~~~~~
!!! error TS2725: Class name cannot be 'Object' when targeting ES5 with module CommonJS.
!!! error TS2725: Class name cannot be 'Object' when targeting ES5 and above with module CommonJS.
}

View File

@ -4404,7 +4404,7 @@
"kind": "space"
},
{
"text": "The number of elements to remove.",
"text": "The number of elements to remove. Omitting this argument will remove all elements from the start\nparamater location to end of the array. If value of this argument is either a negative number, zero, undefined, or a type\nthat cannot be converted to an integer, the function will evaluate the argument as zero and not remove any elements.",
"kind": "text"
}
]

View File

@ -56,7 +56,7 @@
"name": "a",
"kind": "const",
"kindModifiers": "",
"sortText": "11",
"sortText": "15",
"insertText": "[a]",
"replacementSpan": {
"start": 344,
@ -210,7 +210,7 @@
"name": "b",
"kind": "const",
"kindModifiers": "",
"sortText": "11",
"sortText": "15",
"insertText": "[b]",
"replacementSpan": {
"start": 344,

View File

@ -0,0 +1,28 @@
computedPropertyBindingElementDeclarationNoCrash1.ts(12,21): error TS2345: Argument of type '{ [x: string]: unknown; }' is not assignable to parameter of type 'State'.
Type '{ [x: string]: unknown; }' is missing the following properties from type 'State': a, b
==== computedPropertyBindingElementDeclarationNoCrash1.ts (1 errors) ====
// https://github.com/microsoft/TypeScript/issues/61351
export type State = {
a: number;
b: string;
};
export class Test {
setState(state: State) {}
test = (e: any) => {
for (const [key, value] of Object.entries(e)) {
this.setState({
~
[key]: value,
~~~~~~~~~~~~~~~~~~~~~
});
~~~~~~~
!!! error TS2345: Argument of type '{ [x: string]: unknown; }' is not assignable to parameter of type 'State'.
!!! error TS2345: Type '{ [x: string]: unknown; }' is missing the following properties from type 'State': a, b
}
};
}

View File

@ -0,0 +1,51 @@
//// [tests/cases/compiler/computedPropertyBindingElementDeclarationNoCrash1.ts] ////
=== computedPropertyBindingElementDeclarationNoCrash1.ts ===
// https://github.com/microsoft/TypeScript/issues/61351
export type State = {
>State : Symbol(State, Decl(computedPropertyBindingElementDeclarationNoCrash1.ts, 0, 0))
a: number;
>a : Symbol(a, Decl(computedPropertyBindingElementDeclarationNoCrash1.ts, 2, 21))
b: string;
>b : Symbol(b, Decl(computedPropertyBindingElementDeclarationNoCrash1.ts, 3, 12))
};
export class Test {
>Test : Symbol(Test, Decl(computedPropertyBindingElementDeclarationNoCrash1.ts, 5, 2))
setState(state: State) {}
>setState : Symbol(Test.setState, Decl(computedPropertyBindingElementDeclarationNoCrash1.ts, 7, 19))
>state : Symbol(state, Decl(computedPropertyBindingElementDeclarationNoCrash1.ts, 8, 11))
>State : Symbol(State, Decl(computedPropertyBindingElementDeclarationNoCrash1.ts, 0, 0))
test = (e: any) => {
>test : Symbol(Test.test, Decl(computedPropertyBindingElementDeclarationNoCrash1.ts, 8, 27))
>e : Symbol(e, Decl(computedPropertyBindingElementDeclarationNoCrash1.ts, 9, 10))
for (const [key, value] of Object.entries(e)) {
>key : Symbol(key, Decl(computedPropertyBindingElementDeclarationNoCrash1.ts, 10, 16))
>value : Symbol(value, Decl(computedPropertyBindingElementDeclarationNoCrash1.ts, 10, 20))
>Object.entries : Symbol(ObjectConstructor.entries, Decl(lib.es2017.object.d.ts, --, --), Decl(lib.es2017.object.d.ts, --, --))
>Object : Symbol(Object, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --))
>entries : Symbol(ObjectConstructor.entries, Decl(lib.es2017.object.d.ts, --, --), Decl(lib.es2017.object.d.ts, --, --))
>e : Symbol(e, Decl(computedPropertyBindingElementDeclarationNoCrash1.ts, 9, 10))
this.setState({
>this.setState : Symbol(Test.setState, Decl(computedPropertyBindingElementDeclarationNoCrash1.ts, 7, 19))
>this : Symbol(Test, Decl(computedPropertyBindingElementDeclarationNoCrash1.ts, 5, 2))
>setState : Symbol(Test.setState, Decl(computedPropertyBindingElementDeclarationNoCrash1.ts, 7, 19))
[key]: value,
>[key] : Symbol([key], Decl(computedPropertyBindingElementDeclarationNoCrash1.ts, 11, 21))
>key : Symbol(key, Decl(computedPropertyBindingElementDeclarationNoCrash1.ts, 10, 16))
>value : Symbol(value, Decl(computedPropertyBindingElementDeclarationNoCrash1.ts, 10, 20))
});
}
};
}

View File

@ -0,0 +1,78 @@
//// [tests/cases/compiler/computedPropertyBindingElementDeclarationNoCrash1.ts] ////
=== computedPropertyBindingElementDeclarationNoCrash1.ts ===
// https://github.com/microsoft/TypeScript/issues/61351
export type State = {
>State : State
> : ^^^^^
a: number;
>a : number
> : ^^^^^^
b: string;
>b : string
> : ^^^^^^
};
export class Test {
>Test : Test
> : ^^^^
setState(state: State) {}
>setState : (state: State) => void
> : ^ ^^ ^^^^^^^^^
>state : State
> : ^^^^^
test = (e: any) => {
>test : (e: any) => void
> : ^ ^^ ^^^^^^^^^
>(e: any) => { for (const [key, value] of Object.entries(e)) { this.setState({ [key]: value, }); } } : (e: any) => void
> : ^ ^^ ^^^^^^^^^
>e : any
> : ^^^
for (const [key, value] of Object.entries(e)) {
>key : string
> : ^^^^^^
>value : unknown
> : ^^^^^^^
>Object.entries(e) : [string, unknown][]
> : ^^^^^^^^^^^^^^^^^^^
>Object.entries : { <T>(o: { [s: string]: T; } | ArrayLike<T>): [string, T][]; (o: {}): [string, any][]; }
> : ^^^ ^^ ^^ ^^^ ^^^ ^^ ^^^ ^^^
>Object : ObjectConstructor
> : ^^^^^^^^^^^^^^^^^
>entries : { <T>(o: { [s: string]: T; } | ArrayLike<T>): [string, T][]; (o: {}): [string, any][]; }
> : ^^^ ^^ ^^ ^^^ ^^^ ^^ ^^^ ^^^
>e : any
> : ^^^
this.setState({
>this.setState({ [key]: value, }) : void
> : ^^^^
>this.setState : (state: State) => void
> : ^ ^^ ^^^^^^^^^
>this : this
> : ^^^^
>setState : (state: State) => void
> : ^ ^^ ^^^^^^^^^
>{ [key]: value, } : { [x: string]: unknown; }
> : ^^^^^^^^^^^^^^^^^^^^^^^^^
[key]: value,
>[key] : unknown
> : ^^^^^^^
>key : string
> : ^^^^^^
>value : unknown
> : ^^^^^^^
});
}
};
}

View File

@ -10,7 +10,7 @@ error TS5110: Option 'module' must be set to 'Node16' when option 'moduleResolut
".": {
"import": "./dist/index.mjs",
"require": "./dist/index.js",
"types": "./dist/index.d.ts",
"types": "./dist/index.d.ts"
}
}
}
@ -26,4 +26,5 @@ error TS5110: Option 'module' must be set to 'Node16' when option 'moduleResolut
// Should be an untyped resolution to dep/dist/index.mjs,
// but the first search is only for TS files, and when
// there's no dist/index.d.mts, it continues looking for
// matching conditions and resolves via `types`.
// matching conditions and resolves via `types`.

View File

@ -10,7 +10,7 @@ error TS5110: Option 'module' must be set to 'NodeNext' when option 'moduleResol
".": {
"import": "./dist/index.mjs",
"require": "./dist/index.js",
"types": "./dist/index.d.ts",
"types": "./dist/index.d.ts"
}
}
}
@ -26,4 +26,5 @@ error TS5110: Option 'module' must be set to 'NodeNext' when option 'moduleResol
// Should be an untyped resolution to dep/dist/index.mjs,
// but the first search is only for TS files, and when
// there's no dist/index.d.mts, it continues looking for
// matching conditions and resolves via `types`.
// matching conditions and resolves via `types`.

View File

@ -529,7 +529,7 @@ declare function createEventListener<K extends keyof DocumentEventMap>({ name, o
declare const clickEvent: {
readonly name: "click";
readonly once?: boolean;
readonly callback: (ev: MouseEvent) => void;
readonly callback: (ev: PointerEvent) => void;
};
declare const scrollEvent: {
readonly name: "scroll";

View File

@ -611,14 +611,14 @@ function createEventListener<K extends keyof DocumentEventMap>({ name, once = fa
}
const clickEvent = createEventListener({
>clickEvent : { readonly name: "click"; readonly once?: boolean; readonly callback: (ev: MouseEvent) => void; }
> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^ ^^^
>createEventListener({ name: "click", callback: ev => console.log(ev),}) : { readonly name: "click"; readonly once?: boolean; readonly callback: (ev: MouseEvent) => void; }
> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^ ^^^
>clickEvent : { readonly name: "click"; readonly once?: boolean; readonly callback: (ev: PointerEvent) => void; }
> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^ ^^^
>createEventListener({ name: "click", callback: ev => console.log(ev),}) : { readonly name: "click"; readonly once?: boolean; readonly callback: (ev: PointerEvent) => void; }
> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^ ^^^
>createEventListener : <K extends keyof DocumentEventMap>({ name, once, callback }: Ev<K>) => Ev<K>
> : ^ ^^^^^^^^^ ^^ ^^ ^^^^^
>{ name: "click", callback: ev => console.log(ev),} : { name: "click"; callback: (ev: MouseEvent) => void; }
> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^
>{ name: "click", callback: ev => console.log(ev),} : { name: "click"; callback: (ev: PointerEvent) => void; }
> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^
name: "click",
>name : "click"
@ -627,12 +627,12 @@ const clickEvent = createEventListener({
> : ^^^^^^^
callback: ev => console.log(ev),
>callback : (ev: MouseEvent) => void
> : ^ ^^^^^^^^^^^^^^^^^^^^^
>ev => console.log(ev) : (ev: MouseEvent) => void
> : ^ ^^^^^^^^^^^^^^^^^^^^^
>ev : MouseEvent
> : ^^^^^^^^^^
>callback : (ev: PointerEvent) => void
> : ^ ^^^^^^^^^^^^^^^^^^^^^^^
>ev => console.log(ev) : (ev: PointerEvent) => void
> : ^ ^^^^^^^^^^^^^^^^^^^^^^^
>ev : PointerEvent
> : ^^^^^^^^^^^^
>console.log(ev) : void
> : ^^^^
>console.log : (...data: any[]) => void
@ -641,8 +641,8 @@ const clickEvent = createEventListener({
> : ^^^^^^^
>log : (...data: any[]) => void
> : ^^^^ ^^ ^^^^^
>ev : MouseEvent
> : ^^^^^^^^^^
>ev : PointerEvent
> : ^^^^^^^^^^^^
});
@ -687,10 +687,10 @@ processEvents([clickEvent, scrollEvent]);
> : ^^^^
>processEvents : <K extends keyof DocumentEventMap>(events: Ev<K>[]) => void
> : ^ ^^^^^^^^^ ^^ ^^ ^^^^^^^^^
>[clickEvent, scrollEvent] : ({ readonly name: "click"; readonly once?: boolean; readonly callback: (ev: MouseEvent) => void; } | { readonly name: "scroll"; readonly once?: boolean; readonly callback: (ev: Event) => void; })[]
> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^ ^^^^^^
>clickEvent : { readonly name: "click"; readonly once?: boolean; readonly callback: (ev: MouseEvent) => void; }
> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^ ^^^
>[clickEvent, scrollEvent] : ({ readonly name: "click"; readonly once?: boolean; readonly callback: (ev: PointerEvent) => void; } | { readonly name: "scroll"; readonly once?: boolean; readonly callback: (ev: Event) => void; })[]
> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^ ^^^^^^
>clickEvent : { readonly name: "click"; readonly once?: boolean; readonly callback: (ev: PointerEvent) => void; }
> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^ ^^^
>scrollEvent : { readonly name: "scroll"; readonly once?: boolean; readonly callback: (ev: Event) => void; }
> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^ ^^^
@ -699,22 +699,22 @@ processEvents([
> : ^^^^
>processEvents : <K extends keyof DocumentEventMap>(events: Ev<K>[]) => void
> : ^ ^^^^^^^^^ ^^ ^^ ^^^^^^^^^
>[ { name: "click", callback: ev => console.log(ev) }, { name: "scroll", callback: ev => console.log(ev) },] : ({ name: "click"; callback: (ev: MouseEvent) => void; } | { name: "scroll"; callback: (ev: Event) => void; })[]
> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^
>[ { name: "click", callback: ev => console.log(ev) }, { name: "scroll", callback: ev => console.log(ev) },] : ({ name: "click"; callback: (ev: PointerEvent) => void; } | { name: "scroll"; callback: (ev: Event) => void; })[]
> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^
{ name: "click", callback: ev => console.log(ev) },
>{ name: "click", callback: ev => console.log(ev) } : { name: "click"; callback: (ev: MouseEvent) => void; }
> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^
>{ name: "click", callback: ev => console.log(ev) } : { name: "click"; callback: (ev: PointerEvent) => void; }
> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^
>name : "click"
> : ^^^^^^^
>"click" : "click"
> : ^^^^^^^
>callback : (ev: MouseEvent) => void
> : ^ ^^^^^^^^^^^^^^^^^^^^^
>ev => console.log(ev) : (ev: MouseEvent) => void
> : ^ ^^^^^^^^^^^^^^^^^^^^^
>ev : MouseEvent
> : ^^^^^^^^^^
>callback : (ev: PointerEvent) => void
> : ^ ^^^^^^^^^^^^^^^^^^^^^^^
>ev => console.log(ev) : (ev: PointerEvent) => void
> : ^ ^^^^^^^^^^^^^^^^^^^^^^^
>ev : PointerEvent
> : ^^^^^^^^^^^^
>console.log(ev) : void
> : ^^^^
>console.log : (...data: any[]) => void
@ -723,8 +723,8 @@ processEvents([
> : ^^^^^^^
>log : (...data: any[]) => void
> : ^^^^ ^^ ^^^^^
>ev : MouseEvent
> : ^^^^^^^^^^
>ev : PointerEvent
> : ^^^^^^^^^^^^
{ name: "scroll", callback: ev => console.log(ev) },
>{ name: "scroll", callback: ev => console.log(ev) } : { name: "scroll"; callback: (ev: Event) => void; }

View File

@ -0,0 +1,48 @@
//// [tests/cases/compiler/declarationEmitGenericTypeParamerSerialization3.ts] ////
//// [declarationEmitGenericTypeParamerSerialization3.ts]
function mixin<T extends { new (...args: any[]): {} }>(superclass: T) {
return class extends superclass {};
}
export function wrapper<T>(value: T) {
class BaseClass {
accessor name = value;
}
return class MyClass extends mixin(BaseClass) {
accessor name = value;
}
}
export const Cls = wrapper("test");
//// [declarationEmitGenericTypeParamerSerialization3.js]
function mixin(superclass) {
return class extends superclass {
};
}
export function wrapper(value) {
class BaseClass {
accessor name = value;
}
return class MyClass extends mixin(BaseClass) {
accessor name = value;
};
}
export const Cls = wrapper("test");
//// [declarationEmitGenericTypeParamerSerialization3.d.ts]
export declare function wrapper<T>(value: T): {
new (): {
get name(): T;
set name(arg: T);
};
};
export declare const Cls: {
new (): {
get name(): string;
set name(arg: string);
};
};

View File

@ -0,0 +1,42 @@
//// [tests/cases/compiler/declarationEmitGenericTypeParamerSerialization3.ts] ////
=== declarationEmitGenericTypeParamerSerialization3.ts ===
function mixin<T extends { new (...args: any[]): {} }>(superclass: T) {
>mixin : Symbol(mixin, Decl(declarationEmitGenericTypeParamerSerialization3.ts, 0, 0))
>T : Symbol(T, Decl(declarationEmitGenericTypeParamerSerialization3.ts, 0, 15))
>args : Symbol(args, Decl(declarationEmitGenericTypeParamerSerialization3.ts, 0, 32))
>superclass : Symbol(superclass, Decl(declarationEmitGenericTypeParamerSerialization3.ts, 0, 55))
>T : Symbol(T, Decl(declarationEmitGenericTypeParamerSerialization3.ts, 0, 15))
return class extends superclass {};
>superclass : Symbol(superclass, Decl(declarationEmitGenericTypeParamerSerialization3.ts, 0, 55))
}
export function wrapper<T>(value: T) {
>wrapper : Symbol(wrapper, Decl(declarationEmitGenericTypeParamerSerialization3.ts, 2, 1))
>T : Symbol(T, Decl(declarationEmitGenericTypeParamerSerialization3.ts, 4, 24))
>value : Symbol(value, Decl(declarationEmitGenericTypeParamerSerialization3.ts, 4, 27))
>T : Symbol(T, Decl(declarationEmitGenericTypeParamerSerialization3.ts, 4, 24))
class BaseClass {
>BaseClass : Symbol(BaseClass, Decl(declarationEmitGenericTypeParamerSerialization3.ts, 4, 38))
accessor name = value;
>name : Symbol(BaseClass.name, Decl(declarationEmitGenericTypeParamerSerialization3.ts, 5, 19))
>value : Symbol(value, Decl(declarationEmitGenericTypeParamerSerialization3.ts, 4, 27))
}
return class MyClass extends mixin(BaseClass) {
>MyClass : Symbol(MyClass, Decl(declarationEmitGenericTypeParamerSerialization3.ts, 8, 8))
>mixin : Symbol(mixin, Decl(declarationEmitGenericTypeParamerSerialization3.ts, 0, 0))
>BaseClass : Symbol(BaseClass, Decl(declarationEmitGenericTypeParamerSerialization3.ts, 4, 38))
accessor name = value;
>name : Symbol(MyClass.name, Decl(declarationEmitGenericTypeParamerSerialization3.ts, 8, 49))
>value : Symbol(value, Decl(declarationEmitGenericTypeParamerSerialization3.ts, 4, 27))
}
}
export const Cls = wrapper("test");
>Cls : Symbol(Cls, Decl(declarationEmitGenericTypeParamerSerialization3.ts, 13, 12))
>wrapper : Symbol(wrapper, Decl(declarationEmitGenericTypeParamerSerialization3.ts, 2, 1))

View File

@ -0,0 +1,64 @@
//// [tests/cases/compiler/declarationEmitGenericTypeParamerSerialization3.ts] ////
=== declarationEmitGenericTypeParamerSerialization3.ts ===
function mixin<T extends { new (...args: any[]): {} }>(superclass: T) {
>mixin : <T extends { new (...args: any[]): {}; }>(superclass: T) => { new (...args: any[]): (Anonymous class); prototype: mixin<any>.(Anonymous class); } & T
> : ^ ^^^^^^^^^ ^^ ^^ ^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>args : any[]
> : ^^^^^
>superclass : T
> : ^
return class extends superclass {};
>class extends superclass {} : { new (...args: any[]): (Anonymous class); prototype: mixin<any>.(Anonymous class); } & T
> : ^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>superclass : {}
> : ^^
}
export function wrapper<T>(value: T) {
>wrapper : <T>(value: T) => typeof MyClass
> : ^ ^^ ^^ ^^^^^^^^^^^^^^^^^^^
>value : T
> : ^
class BaseClass {
>BaseClass : BaseClass
> : ^^^^^^^^^
accessor name = value;
>name : T
> : ^
>value : T
> : ^
}
return class MyClass extends mixin(BaseClass) {
>class MyClass extends mixin(BaseClass) { accessor name = value; } : typeof MyClass
> : ^^^^^^^^^^^^^^
>MyClass : typeof MyClass
> : ^^^^^^^^^^^^^^
>mixin(BaseClass) : mixin<typeof BaseClass>.(Anonymous class) & BaseClass
> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>mixin : <T_1 extends { new (...args: any[]): {}; }>(superclass: T_1) => { new (...args: any[]): (Anonymous class); prototype: mixin<any>.(Anonymous class); } & T_1
> : ^^^^^^^^^^^^^ ^^ ^^ ^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>BaseClass : typeof BaseClass
> : ^^^^^^^^^^^^^^^^
accessor name = value;
>name : T
> : ^
>value : T
> : ^
}
}
export const Cls = wrapper("test");
>Cls : typeof MyClass
> : ^^^^^^^^^^^^^^
>wrapper("test") : typeof MyClass
> : ^^^^^^^^^^^^^^
>wrapper : <T>(value: T) => typeof MyClass
> : ^ ^^ ^^ ^^^^^^^^^^^^^^^^^^^
>"test" : "test"
> : ^^^^^^

View File

@ -1,8 +1,8 @@
exportClassNameWithObjectAMD.ts(1,14): error TS2725: Class name cannot be 'Object' when targeting ES5 with module AMD.
exportClassNameWithObjectAMD.ts(1,14): error TS2725: Class name cannot be 'Object' when targeting ES5 and above with module AMD.
==== exportClassNameWithObjectAMD.ts (1 errors) ====
export class Object {}
~~~~~~
!!! error TS2725: Class name cannot be 'Object' when targeting ES5 with module AMD.
!!! error TS2725: Class name cannot be 'Object' when targeting ES5 and above with module AMD.

View File

@ -1,8 +1,8 @@
exportClassNameWithObjectCommonJS.ts(1,14): error TS2725: Class name cannot be 'Object' when targeting ES5 with module CommonJS.
exportClassNameWithObjectCommonJS.ts(1,14): error TS2725: Class name cannot be 'Object' when targeting ES5 and above with module CommonJS.
==== exportClassNameWithObjectCommonJS.ts (1 errors) ====
export class Object {}
~~~~~~
!!! error TS2725: Class name cannot be 'Object' when targeting ES5 with module CommonJS.
!!! error TS2725: Class name cannot be 'Object' when targeting ES5 and above with module CommonJS.

View File

@ -1,8 +1,8 @@
exportClassNameWithObjectSystem.ts(1,14): error TS2725: Class name cannot be 'Object' when targeting ES5 with module System.
exportClassNameWithObjectSystem.ts(1,14): error TS2725: Class name cannot be 'Object' when targeting ES5 and above with module System.
==== exportClassNameWithObjectSystem.ts (1 errors) ====
export class Object {}
~~~~~~
!!! error TS2725: Class name cannot be 'Object' when targeting ES5 with module System.
!!! error TS2725: Class name cannot be 'Object' when targeting ES5 and above with module System.

View File

@ -1,8 +1,8 @@
exportClassNameWithObjectUMD.ts(1,14): error TS2725: Class name cannot be 'Object' when targeting ES5 with module UMD.
exportClassNameWithObjectUMD.ts(1,14): error TS2725: Class name cannot be 'Object' when targeting ES5 and above with module UMD.
==== exportClassNameWithObjectUMD.ts (1 errors) ====
export class Object {}
~~~~~~
!!! error TS2725: Class name cannot be 'Object' when targeting ES5 with module UMD.
!!! error TS2725: Class name cannot be 'Object' when targeting ES5 and above with module UMD.

View File

@ -1,8 +1,8 @@
exportDefaultClassNameWithObject.ts(1,22): error TS2725: Class name cannot be 'Object' when targeting ES5 with module CommonJS.
exportDefaultClassNameWithObject.ts(1,22): error TS2725: Class name cannot be 'Object' when targeting ES5 and above with module CommonJS.
==== exportDefaultClassNameWithObject.ts (1 errors) ====
export default class Object {}
~~~~~~
!!! error TS2725: Class name cannot be 'Object' when targeting ES5 with module CommonJS.
!!! error TS2725: Class name cannot be 'Object' when targeting ES5 and above with module CommonJS.

View File

@ -0,0 +1,34 @@
genericCallAtYieldExpressionInGenericCall1.ts(26,25): error TS2488: Type '() => T' must have a '[Symbol.iterator]()' method that returns an iterator.
==== genericCallAtYieldExpressionInGenericCall1.ts (1 errors) ====
declare const inner: {
<A>(value: A): {
(): A;
[Symbol.iterator](): {
next(...args: ReadonlyArray<any>): IteratorResult<any, A>;
};
};
};
declare function outer<A>(body: (value: A) => Generator<any, any, any>): void;
outer(function* <T>(value: T) {
const result = yield* inner(value); // ok
});
outer(function* <T>(value: T) {
const x = inner(value);
const result = yield* x; // ok
});
declare const inner2: {
<A>(value: A): () => A;
};
outer(function* <T>(value: T) {
const result = yield* inner2(value); // error
~~~~~~~~~~~~~
!!! error TS2488: Type '() => T' must have a '[Symbol.iterator]()' method that returns an iterator.
});

View File

@ -0,0 +1,93 @@
//// [tests/cases/compiler/genericCallAtYieldExpressionInGenericCall1.ts] ////
=== genericCallAtYieldExpressionInGenericCall1.ts ===
declare const inner: {
>inner : Symbol(inner, Decl(genericCallAtYieldExpressionInGenericCall1.ts, 0, 13))
<A>(value: A): {
>A : Symbol(A, Decl(genericCallAtYieldExpressionInGenericCall1.ts, 1, 3))
>value : Symbol(value, Decl(genericCallAtYieldExpressionInGenericCall1.ts, 1, 6))
>A : Symbol(A, Decl(genericCallAtYieldExpressionInGenericCall1.ts, 1, 3))
(): A;
>A : Symbol(A, Decl(genericCallAtYieldExpressionInGenericCall1.ts, 1, 3))
[Symbol.iterator](): {
>[Symbol.iterator] : Symbol([Symbol.iterator], Decl(genericCallAtYieldExpressionInGenericCall1.ts, 2, 10))
>Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --))
>Symbol : Symbol(Symbol, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2019.symbol.d.ts, --, --))
>iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --))
next(...args: ReadonlyArray<any>): IteratorResult<any, A>;
>next : Symbol(next, Decl(genericCallAtYieldExpressionInGenericCall1.ts, 3, 26))
>args : Symbol(args, Decl(genericCallAtYieldExpressionInGenericCall1.ts, 4, 11))
>ReadonlyArray : Symbol(ReadonlyArray, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2016.array.include.d.ts, --, --) ... and 3 more)
>IteratorResult : Symbol(IteratorResult, Decl(lib.es2015.iterable.d.ts, --, --))
>A : Symbol(A, Decl(genericCallAtYieldExpressionInGenericCall1.ts, 1, 3))
};
};
};
declare function outer<A>(body: (value: A) => Generator<any, any, any>): void;
>outer : Symbol(outer, Decl(genericCallAtYieldExpressionInGenericCall1.ts, 7, 2))
>A : Symbol(A, Decl(genericCallAtYieldExpressionInGenericCall1.ts, 9, 23))
>body : Symbol(body, Decl(genericCallAtYieldExpressionInGenericCall1.ts, 9, 26))
>value : Symbol(value, Decl(genericCallAtYieldExpressionInGenericCall1.ts, 9, 33))
>A : Symbol(A, Decl(genericCallAtYieldExpressionInGenericCall1.ts, 9, 23))
>Generator : Symbol(Generator, Decl(lib.es2015.generator.d.ts, --, --))
outer(function* <T>(value: T) {
>outer : Symbol(outer, Decl(genericCallAtYieldExpressionInGenericCall1.ts, 7, 2))
>T : Symbol(T, Decl(genericCallAtYieldExpressionInGenericCall1.ts, 11, 17))
>value : Symbol(value, Decl(genericCallAtYieldExpressionInGenericCall1.ts, 11, 20))
>T : Symbol(T, Decl(genericCallAtYieldExpressionInGenericCall1.ts, 11, 17))
const result = yield* inner(value); // ok
>result : Symbol(result, Decl(genericCallAtYieldExpressionInGenericCall1.ts, 12, 7))
>inner : Symbol(inner, Decl(genericCallAtYieldExpressionInGenericCall1.ts, 0, 13))
>value : Symbol(value, Decl(genericCallAtYieldExpressionInGenericCall1.ts, 11, 20))
});
outer(function* <T>(value: T) {
>outer : Symbol(outer, Decl(genericCallAtYieldExpressionInGenericCall1.ts, 7, 2))
>T : Symbol(T, Decl(genericCallAtYieldExpressionInGenericCall1.ts, 15, 17))
>value : Symbol(value, Decl(genericCallAtYieldExpressionInGenericCall1.ts, 15, 20))
>T : Symbol(T, Decl(genericCallAtYieldExpressionInGenericCall1.ts, 15, 17))
const x = inner(value);
>x : Symbol(x, Decl(genericCallAtYieldExpressionInGenericCall1.ts, 16, 7))
>inner : Symbol(inner, Decl(genericCallAtYieldExpressionInGenericCall1.ts, 0, 13))
>value : Symbol(value, Decl(genericCallAtYieldExpressionInGenericCall1.ts, 15, 20))
const result = yield* x; // ok
>result : Symbol(result, Decl(genericCallAtYieldExpressionInGenericCall1.ts, 17, 7))
>x : Symbol(x, Decl(genericCallAtYieldExpressionInGenericCall1.ts, 16, 7))
});
declare const inner2: {
>inner2 : Symbol(inner2, Decl(genericCallAtYieldExpressionInGenericCall1.ts, 20, 13))
<A>(value: A): () => A;
>A : Symbol(A, Decl(genericCallAtYieldExpressionInGenericCall1.ts, 21, 3))
>value : Symbol(value, Decl(genericCallAtYieldExpressionInGenericCall1.ts, 21, 6))
>A : Symbol(A, Decl(genericCallAtYieldExpressionInGenericCall1.ts, 21, 3))
>A : Symbol(A, Decl(genericCallAtYieldExpressionInGenericCall1.ts, 21, 3))
};
outer(function* <T>(value: T) {
>outer : Symbol(outer, Decl(genericCallAtYieldExpressionInGenericCall1.ts, 7, 2))
>T : Symbol(T, Decl(genericCallAtYieldExpressionInGenericCall1.ts, 24, 17))
>value : Symbol(value, Decl(genericCallAtYieldExpressionInGenericCall1.ts, 24, 20))
>T : Symbol(T, Decl(genericCallAtYieldExpressionInGenericCall1.ts, 24, 17))
const result = yield* inner2(value); // error
>result : Symbol(result, Decl(genericCallAtYieldExpressionInGenericCall1.ts, 25, 7))
>inner2 : Symbol(inner2, Decl(genericCallAtYieldExpressionInGenericCall1.ts, 20, 13))
>value : Symbol(value, Decl(genericCallAtYieldExpressionInGenericCall1.ts, 24, 20))
});

View File

@ -0,0 +1,132 @@
//// [tests/cases/compiler/genericCallAtYieldExpressionInGenericCall1.ts] ////
=== Performance Stats ===
Type Count: 1,000
Instantiation count: 2,500
=== genericCallAtYieldExpressionInGenericCall1.ts ===
declare const inner: {
>inner : <A>(value: A) => { (): A; [Symbol.iterator](): { next(...args: ReadonlyArray<any>): IteratorResult<any, A>; }; }
> : ^ ^^ ^^ ^^^^^
<A>(value: A): {
>value : A
> : ^
(): A;
[Symbol.iterator](): {
>[Symbol.iterator] : () => { next(...args: ReadonlyArray<any>): IteratorResult<any, A>; }
> : ^^^^^^
>Symbol.iterator : unique symbol
> : ^^^^^^^^^^^^^
>Symbol : SymbolConstructor
> : ^^^^^^^^^^^^^^^^^
>iterator : unique symbol
> : ^^^^^^^^^^^^^
next(...args: ReadonlyArray<any>): IteratorResult<any, A>;
>next : (...args: ReadonlyArray<any>) => IteratorResult<any, A>
> : ^^^^ ^^ ^^^^^
>args : readonly any[]
> : ^^^^^^^^^^^^^^
};
};
};
declare function outer<A>(body: (value: A) => Generator<any, any, any>): void;
>outer : <A>(body: (value: A) => Generator<any, any, any>) => void
> : ^ ^^ ^^ ^^^^^
>body : (value: A) => Generator<any, any, any>
> : ^ ^^ ^^^^^
>value : A
> : ^
outer(function* <T>(value: T) {
>outer(function* <T>(value: T) { const result = yield* inner(value); // ok}) : void
> : ^^^^
>outer : <A>(body: (value: A) => Generator<any, any, any>) => void
> : ^ ^^ ^^ ^^^^^
>function* <T>(value: T) { const result = yield* inner(value); // ok} : <T>(value: T) => Generator<never, void, never>
> : ^ ^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>value : T
> : ^
const result = yield* inner(value); // ok
>result : T
> : ^
>yield* inner(value) : T
> : ^
>inner(value) : { (): T; [Symbol.iterator](): { next(...args: ReadonlyArray<any>): IteratorResult<any, T>; }; }
> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>inner : <A>(value: A) => { (): A; [Symbol.iterator](): { next(...args: ReadonlyArray<any>): IteratorResult<any, A>; }; }
> : ^ ^^ ^^ ^^^^^
>value : T
> : ^
});
outer(function* <T>(value: T) {
>outer(function* <T>(value: T) { const x = inner(value); const result = yield* x; // ok}) : void
> : ^^^^
>outer : <A>(body: (value: A) => Generator<any, any, any>) => void
> : ^ ^^ ^^ ^^^^^
>function* <T>(value: T) { const x = inner(value); const result = yield* x; // ok} : <T>(value: T) => Generator<any, void, any>
> : ^ ^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>value : T
> : ^
const x = inner(value);
>x : { (): T; [Symbol.iterator](): { next(...args: ReadonlyArray<any>): IteratorResult<any, T>; }; }
> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>inner(value) : { (): T; [Symbol.iterator](): { next(...args: ReadonlyArray<any>): IteratorResult<any, T>; }; }
> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>inner : <A>(value: A) => { (): A; [Symbol.iterator](): { next(...args: ReadonlyArray<any>): IteratorResult<any, A>; }; }
> : ^ ^^ ^^ ^^^^^
>value : T
> : ^
const result = yield* x; // ok
>result : T
> : ^
>yield* x : T
> : ^
>x : { (): T; [Symbol.iterator](): { next(...args: ReadonlyArray<any>): IteratorResult<any, T>; }; }
> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
});
declare const inner2: {
>inner2 : <A>(value: A) => () => A
> : ^ ^^ ^^ ^^^^^
<A>(value: A): () => A;
>value : A
> : ^
};
outer(function* <T>(value: T) {
>outer(function* <T>(value: T) { const result = yield* inner2(value); // error}) : void
> : ^^^^
>outer : <A>(body: (value: A) => Generator<any, any, any>) => void
> : ^ ^^ ^^ ^^^^^
>function* <T>(value: T) { const result = yield* inner2(value); // error} : <T>(value: T) => Generator<never, void, never>
> : ^ ^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>value : T
> : ^
const result = yield* inner2(value); // error
>result : any
> : ^^^
>yield* inner2(value) : any
> : ^^^
>inner2(value) : () => T
> : ^^^^^^^
>inner2 : <A>(value: A) => () => A
> : ^ ^^ ^^ ^^^^^
>value : T
> : ^
});

View File

@ -0,0 +1,111 @@
//// [tests/cases/compiler/genericCallAtYieldExpressionInGenericCall2.ts] ////
=== genericCallAtYieldExpressionInGenericCall2.ts ===
interface Effect {
>Effect : Symbol(Effect, Decl(genericCallAtYieldExpressionInGenericCall2.ts, 0, 0))
[Symbol.iterator](): {
>[Symbol.iterator] : Symbol(Effect[Symbol.iterator], Decl(genericCallAtYieldExpressionInGenericCall2.ts, 0, 18))
>Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --))
>Symbol : Symbol(Symbol, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2019.symbol.d.ts, --, --))
>iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --))
next(...args: ReadonlyArray<any>): IteratorResult<any, any>;
>next : Symbol(next, Decl(genericCallAtYieldExpressionInGenericCall2.ts, 1, 24))
>args : Symbol(args, Decl(genericCallAtYieldExpressionInGenericCall2.ts, 2, 9))
>ReadonlyArray : Symbol(ReadonlyArray, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2016.array.include.d.ts, --, --) ... and 3 more)
>IteratorResult : Symbol(IteratorResult, Decl(lib.es2015.iterable.d.ts, --, --))
};
}
interface Enqueue<A> {
>Enqueue : Symbol(Enqueue, Decl(genericCallAtYieldExpressionInGenericCall2.ts, 4, 1))
>A : Symbol(A, Decl(genericCallAtYieldExpressionInGenericCall2.ts, 6, 18))
offer: (value: A) => Effect;
>offer : Symbol(Enqueue.offer, Decl(genericCallAtYieldExpressionInGenericCall2.ts, 6, 22))
>value : Symbol(value, Decl(genericCallAtYieldExpressionInGenericCall2.ts, 7, 10))
>A : Symbol(A, Decl(genericCallAtYieldExpressionInGenericCall2.ts, 6, 18))
>Effect : Symbol(Effect, Decl(genericCallAtYieldExpressionInGenericCall2.ts, 0, 0))
}
declare const offer: {
>offer : Symbol(offer, Decl(genericCallAtYieldExpressionInGenericCall2.ts, 10, 13))
<A>(value: A): (self: Enqueue<A>) => Effect;
>A : Symbol(A, Decl(genericCallAtYieldExpressionInGenericCall2.ts, 11, 3))
>value : Symbol(value, Decl(genericCallAtYieldExpressionInGenericCall2.ts, 11, 6))
>A : Symbol(A, Decl(genericCallAtYieldExpressionInGenericCall2.ts, 11, 3))
>self : Symbol(self, Decl(genericCallAtYieldExpressionInGenericCall2.ts, 11, 18))
>Enqueue : Symbol(Enqueue, Decl(genericCallAtYieldExpressionInGenericCall2.ts, 4, 1))
>A : Symbol(A, Decl(genericCallAtYieldExpressionInGenericCall2.ts, 11, 3))
>Effect : Symbol(Effect, Decl(genericCallAtYieldExpressionInGenericCall2.ts, 0, 0))
<A>(self: Enqueue<A>, value: A): Effect;
>A : Symbol(A, Decl(genericCallAtYieldExpressionInGenericCall2.ts, 12, 3))
>self : Symbol(self, Decl(genericCallAtYieldExpressionInGenericCall2.ts, 12, 6))
>Enqueue : Symbol(Enqueue, Decl(genericCallAtYieldExpressionInGenericCall2.ts, 4, 1))
>A : Symbol(A, Decl(genericCallAtYieldExpressionInGenericCall2.ts, 12, 3))
>value : Symbol(value, Decl(genericCallAtYieldExpressionInGenericCall2.ts, 12, 23))
>A : Symbol(A, Decl(genericCallAtYieldExpressionInGenericCall2.ts, 12, 3))
>Effect : Symbol(Effect, Decl(genericCallAtYieldExpressionInGenericCall2.ts, 0, 0))
};
declare function fn<Eff extends Effect, AEff, Args extends Array<any>>(
>fn : Symbol(fn, Decl(genericCallAtYieldExpressionInGenericCall2.ts, 13, 2))
>Eff : Symbol(Eff, Decl(genericCallAtYieldExpressionInGenericCall2.ts, 15, 20))
>Effect : Symbol(Effect, Decl(genericCallAtYieldExpressionInGenericCall2.ts, 0, 0))
>AEff : Symbol(AEff, Decl(genericCallAtYieldExpressionInGenericCall2.ts, 15, 39))
>Args : Symbol(Args, Decl(genericCallAtYieldExpressionInGenericCall2.ts, 15, 45))
>Array : Symbol(Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --) ... and 4 more)
body: (...args: Args) => Generator<Eff, AEff, any>,
>body : Symbol(body, Decl(genericCallAtYieldExpressionInGenericCall2.ts, 15, 71))
>args : Symbol(args, Decl(genericCallAtYieldExpressionInGenericCall2.ts, 16, 9))
>Args : Symbol(Args, Decl(genericCallAtYieldExpressionInGenericCall2.ts, 15, 45))
>Generator : Symbol(Generator, Decl(lib.es2015.generator.d.ts, --, --))
>Eff : Symbol(Eff, Decl(genericCallAtYieldExpressionInGenericCall2.ts, 15, 20))
>AEff : Symbol(AEff, Decl(genericCallAtYieldExpressionInGenericCall2.ts, 15, 39))
): (...args: Args) => any;
>args : Symbol(args, Decl(genericCallAtYieldExpressionInGenericCall2.ts, 17, 4))
>Args : Symbol(Args, Decl(genericCallAtYieldExpressionInGenericCall2.ts, 15, 45))
fn(function* <T>(queue: Enqueue<T>, value: T) {
>fn : Symbol(fn, Decl(genericCallAtYieldExpressionInGenericCall2.ts, 13, 2))
>T : Symbol(T, Decl(genericCallAtYieldExpressionInGenericCall2.ts, 19, 14))
>queue : Symbol(queue, Decl(genericCallAtYieldExpressionInGenericCall2.ts, 19, 17))
>Enqueue : Symbol(Enqueue, Decl(genericCallAtYieldExpressionInGenericCall2.ts, 4, 1))
>T : Symbol(T, Decl(genericCallAtYieldExpressionInGenericCall2.ts, 19, 14))
>value : Symbol(value, Decl(genericCallAtYieldExpressionInGenericCall2.ts, 19, 35))
>T : Symbol(T, Decl(genericCallAtYieldExpressionInGenericCall2.ts, 19, 14))
yield* offer(queue, value);
>offer : Symbol(offer, Decl(genericCallAtYieldExpressionInGenericCall2.ts, 10, 13))
>queue : Symbol(queue, Decl(genericCallAtYieldExpressionInGenericCall2.ts, 19, 17))
>value : Symbol(value, Decl(genericCallAtYieldExpressionInGenericCall2.ts, 19, 35))
});
fn(function* <T>(queue: Enqueue<T>, value: T) {
>fn : Symbol(fn, Decl(genericCallAtYieldExpressionInGenericCall2.ts, 13, 2))
>T : Symbol(T, Decl(genericCallAtYieldExpressionInGenericCall2.ts, 23, 14))
>queue : Symbol(queue, Decl(genericCallAtYieldExpressionInGenericCall2.ts, 23, 17))
>Enqueue : Symbol(Enqueue, Decl(genericCallAtYieldExpressionInGenericCall2.ts, 4, 1))
>T : Symbol(T, Decl(genericCallAtYieldExpressionInGenericCall2.ts, 23, 14))
>value : Symbol(value, Decl(genericCallAtYieldExpressionInGenericCall2.ts, 23, 35))
>T : Symbol(T, Decl(genericCallAtYieldExpressionInGenericCall2.ts, 23, 14))
const x = offer(queue, value);
>x : Symbol(x, Decl(genericCallAtYieldExpressionInGenericCall2.ts, 24, 7))
>offer : Symbol(offer, Decl(genericCallAtYieldExpressionInGenericCall2.ts, 10, 13))
>queue : Symbol(queue, Decl(genericCallAtYieldExpressionInGenericCall2.ts, 23, 17))
>value : Symbol(value, Decl(genericCallAtYieldExpressionInGenericCall2.ts, 23, 35))
yield* x;
>x : Symbol(x, Decl(genericCallAtYieldExpressionInGenericCall2.ts, 24, 7))
});

View File

@ -0,0 +1,123 @@
//// [tests/cases/compiler/genericCallAtYieldExpressionInGenericCall2.ts] ////
=== Performance Stats ===
Type Count: 1,000
Instantiation count: 2,500
=== genericCallAtYieldExpressionInGenericCall2.ts ===
interface Effect {
[Symbol.iterator](): {
>[Symbol.iterator] : () => { next(...args: ReadonlyArray<any>): IteratorResult<any, any>; }
> : ^^^^^^
>Symbol.iterator : unique symbol
> : ^^^^^^^^^^^^^
>Symbol : SymbolConstructor
> : ^^^^^^^^^^^^^^^^^
>iterator : unique symbol
> : ^^^^^^^^^^^^^
next(...args: ReadonlyArray<any>): IteratorResult<any, any>;
>next : (...args: ReadonlyArray<any>) => IteratorResult<any, any>
> : ^^^^ ^^ ^^^^^
>args : readonly any[]
> : ^^^^^^^^^^^^^^
};
}
interface Enqueue<A> {
offer: (value: A) => Effect;
>offer : (value: A) => Effect
> : ^ ^^ ^^^^^
>value : A
> : ^
}
declare const offer: {
>offer : { <A>(value: A): (self: Enqueue<A>) => Effect; <A>(self: Enqueue<A>, value: A): Effect; }
> : ^^^ ^^ ^^ ^^^ ^^^ ^^ ^^ ^^ ^^ ^^^ ^^^
<A>(value: A): (self: Enqueue<A>) => Effect;
>value : A
> : ^
>self : Enqueue<A>
> : ^^^^^^^^^^
<A>(self: Enqueue<A>, value: A): Effect;
>self : Enqueue<A>
> : ^^^^^^^^^^
>value : A
> : ^
};
declare function fn<Eff extends Effect, AEff, Args extends Array<any>>(
>fn : <Eff extends Effect, AEff, Args extends Array<any>>(body: (...args: Args) => Generator<Eff, AEff, any>) => (...args: Args) => any
> : ^ ^^^^^^^^^ ^^ ^^ ^^^^^^^^^ ^^ ^^ ^^^^^
body: (...args: Args) => Generator<Eff, AEff, any>,
>body : (...args: Args) => Generator<Eff, AEff, any>
> : ^^^^ ^^ ^^^^^
>args : Args
> : ^^^^
): (...args: Args) => any;
>args : Args
> : ^^^^
fn(function* <T>(queue: Enqueue<T>, value: T) {
>fn(function* <T>(queue: Enqueue<T>, value: T) { yield* offer(queue, value);}) : <T>(queue: Enqueue<T>, value: T) => any
> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>fn : <Eff extends Effect, AEff, Args extends Array<any>>(body: (...args: Args) => Generator<Eff, AEff, any>) => (...args: Args) => any
> : ^ ^^^^^^^^^ ^^ ^^ ^^^^^^^^^ ^^ ^^ ^^^^^
>function* <T>(queue: Enqueue<T>, value: T) { yield* offer(queue, value);} : <T>(queue: Enqueue<T>, value: T) => Generator<never, void, never>
> : ^ ^^ ^^ ^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>queue : Enqueue<T>
> : ^^^^^^^^^^
>value : T
> : ^
yield* offer(queue, value);
>yield* offer(queue, value) : any
>offer(queue, value) : Effect
> : ^^^^^^
>offer : { <A>(value: A): (self: Enqueue<A>) => Effect; <A>(self: Enqueue<A>, value: A): Effect; }
> : ^^^ ^^ ^^ ^^^ ^^^ ^^ ^^ ^^ ^^ ^^^ ^^^
>queue : Enqueue<T>
> : ^^^^^^^^^^
>value : T
> : ^
});
fn(function* <T>(queue: Enqueue<T>, value: T) {
>fn(function* <T>(queue: Enqueue<T>, value: T) { const x = offer(queue, value); yield* x;}) : <T>(queue: Enqueue<T>, value: T) => any
> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>fn : <Eff extends Effect, AEff, Args extends Array<any>>(body: (...args: Args) => Generator<Eff, AEff, any>) => (...args: Args) => any
> : ^ ^^^^^^^^^ ^^ ^^ ^^^^^^^^^ ^^ ^^ ^^^^^
>function* <T>(queue: Enqueue<T>, value: T) { const x = offer(queue, value); yield* x;} : <T>(queue: Enqueue<T>, value: T) => Generator<any, void, any>
> : ^ ^^ ^^ ^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>queue : Enqueue<T>
> : ^^^^^^^^^^
>value : T
> : ^
const x = offer(queue, value);
>x : Effect
> : ^^^^^^
>offer(queue, value) : Effect
> : ^^^^^^
>offer : { <A>(value: A): (self: Enqueue<A>) => Effect; <A>(self: Enqueue<A>, value: A): Effect; }
> : ^^^ ^^ ^^ ^^^ ^^^ ^^ ^^ ^^ ^^ ^^^ ^^^
>queue : Enqueue<T>
> : ^^^^^^^^^^
>value : T
> : ^
yield* x;
>yield* x : any
>x : Effect
> : ^^^^^^
});

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,23 @@
// === goToDefinition ===
// === /tests/cases/fourslash/goToDefinitionOverriddenMember17.ts ===
// const entityKind = Symbol.for("drizzle:entityKind");
//
// abstract class MySqlColumn {
// <|static readonly [|[entityKind]|]: string = "MySqlColumn";|>
// }
//
// export class MySqlVarBinary extends MySqlColumn {
// static /*GOTO DEF*/override readonly [entityKind]: string = "MySqlVarBinary";
// }
// === Details ===
[
{
"kind": "property",
"name": "[entityKind]",
"containerName": "MySqlColumn",
"isLocal": true,
"isAmbient": false,
"unverified": false
}
]

View File

@ -0,0 +1,23 @@
// === goToDefinition ===
// === /tests/cases/fourslash/goToDefinitionOverriddenMember18.ts ===
// const entityKind = Symbol.for("drizzle:entityKind");
//
// abstract class MySqlColumn {
// <|readonly [|[entityKind]|]: string = "MySqlColumn";|>
// }
//
// export class MySqlVarBinary extends MySqlColumn {
// /*GOTO DEF*/override readonly [entityKind]: string = "MySqlVarBinary";
// }
// === Details ===
[
{
"kind": "property",
"name": "[entityKind]",
"containerName": "MySqlColumn",
"isLocal": true,
"isAmbient": false,
"unverified": false
}
]

View File

@ -0,0 +1,23 @@
// === goToDefinition ===
// === /tests/cases/fourslash/goToDefinitionOverriddenMember19.ts ===
// const prop = "foo" as const;
//
// abstract class A {
// <|static readonly [|[prop]|] = "A";|>
// }
//
// export class B extends A {
// static /*GOTO DEF*/override readonly [prop] = "B";
// }
// === Details ===
[
{
"kind": "property",
"name": "[prop]",
"containerName": "A",
"isLocal": true,
"isAmbient": false,
"unverified": false
}
]

View File

@ -0,0 +1,23 @@
// === goToDefinition ===
// === /tests/cases/fourslash/goToDefinitionOverriddenMember20.ts ===
// const prop = "foo" as const;
//
// abstract class A {
// <|readonly [|[prop]|] = "A";|>
// }
//
// export class B extends A {
// /*GOTO DEF*/override readonly [prop] = "B";
// }
// === Details ===
[
{
"kind": "property",
"name": "[prop]",
"containerName": "A",
"isLocal": true,
"isAmbient": false,
"unverified": false
}
]

View File

@ -0,0 +1,22 @@
// === goToDefinition ===
// === /tests/cases/fourslash/goToDefinitionOverriddenMember21.ts ===
// const prop = "foo" as const;
//
// abstract class A {}
//
// export class B extends A {
// <|static /*GOTO DEF*/override readonly [|[prop]|] = "B";|>
// }
// === Details ===
[
{
"kind": "property",
"name": "[prop]",
"containerName": "B",
"isLocal": false,
"isAmbient": false,
"unverified": false,
"failedAliasResolution": false
}
]

Some files were not shown because too many files have changed in this diff Show More