mirror of
https://github.com/microsoft/TypeScript.git
synced 2025-11-18 17:21:48 +00:00
Merge branch 'main' into copilot/fix-61944
This commit is contained in:
@@ -15,13 +15,13 @@ 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 (recommended)
|
||||
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
|
||||
npx hereby format # Run code formatting
|
||||
npx hereby lint # Run eslint 🚨 MANDATORY BEFORE FINISHING!
|
||||
npx hereby format # Run code formatting 🚨 MANDATORY BEFORE FINISHING!
|
||||
```
|
||||
|
||||
## Fourslash Test Syntax Guide
|
||||
@@ -258,10 +258,22 @@ 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
|
||||
|
||||
- Once you think you're done, run `npx hereby lint` and fix any issues
|
||||
- Then always run `npx hereby format` as your last step
|
||||
- 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
|
||||
|
||||
@@ -317,11 +329,14 @@ When fixing bugs or implementing features, follow this workflow:
|
||||
- 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. **Run all other tests to ensure you didn't break anything**
|
||||
- Run `npx hereby runtests-parallel` and wait for it to finish (10-15 minutes is normal!)
|
||||
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. **Always format and lint**
|
||||
- Don't forget to run `npx hereby lint` and `npx hereby format` before you're done
|
||||
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
|
||||
|
||||
@@ -95,7 +95,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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -3,6 +3,8 @@ name: Twoslash Code Sample Repros
|
||||
on:
|
||||
schedule:
|
||||
- cron: '0 8 * * *'
|
||||
repository_dispatch:
|
||||
types: [run-twoslash-repros]
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
issue:
|
||||
|
||||
@@ -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
|
||||
|
||||
+117
-42
@@ -467,6 +467,7 @@ import {
|
||||
IntroducesNewScopeNode,
|
||||
isAccessExpression,
|
||||
isAccessor,
|
||||
isAccessorModifier,
|
||||
isAliasableExpression,
|
||||
isAmbientModule,
|
||||
isArray,
|
||||
@@ -2180,6 +2181,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
|
||||
};
|
||||
|
||||
var anyIterationTypes = createIterationTypes(anyType, anyType, anyType);
|
||||
var silentNeverIterationTypes = createIterationTypes(silentNeverType, silentNeverType, silentNeverType);
|
||||
|
||||
var asyncIterationTypesResolver: IterationTypesResolver = {
|
||||
iterableCacheKey: "iterationTypesOfAsyncIterable",
|
||||
@@ -5981,7 +5983,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;
|
||||
}
|
||||
@@ -7682,27 +7691,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 +12841,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 +15465,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 +15492,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 +15515,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 +15540,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 +15619,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;
|
||||
@@ -32697,6 +32741,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) {
|
||||
@@ -32716,6 +32764,8 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
|
||||
|
||||
function popInferenceContext() {
|
||||
inferenceContextCount--;
|
||||
inferenceContextNodes[inferenceContextCount] = undefined!;
|
||||
inferenceContexts[inferenceContextCount] = undefined;
|
||||
}
|
||||
|
||||
function getInferenceContext(node: Node) {
|
||||
@@ -32728,12 +32778,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) {
|
||||
@@ -36414,7 +36467,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);
|
||||
|
||||
@@ -39152,6 +39210,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;
|
||||
@@ -40420,18 +40481,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) {
|
||||
@@ -45651,6 +45723,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;
|
||||
}
|
||||
@@ -46579,7 +46654,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
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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,
|
||||
},
|
||||
{
|
||||
|
||||
@@ -2080,6 +2080,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 +3423,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 +6062,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
|
||||
},
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -5559,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;
|
||||
}
|
||||
|
||||
|
||||
+17
-17
@@ -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
|
||||
@@ -9542,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 {
|
||||
@@ -9558,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),
|
||||
};
|
||||
|
||||
@@ -9573,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),
|
||||
};
|
||||
|
||||
@@ -9596,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 */
|
||||
@@ -9624,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 */
|
||||
@@ -9657,7 +9657,7 @@ export function getSubPatternFromSpec(
|
||||
}
|
||||
else {
|
||||
if (usage === "directories") {
|
||||
subpattern += "(";
|
||||
subpattern += "(?:";
|
||||
optionalCount++;
|
||||
}
|
||||
|
||||
@@ -9671,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) {
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
Vendored
+12673
-4211
File diff suppressed because it is too large
Load Diff
Vendored
+99
-21
@@ -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) */
|
||||
|
||||
Vendored
+25
-1
@@ -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;
|
||||
|
||||
|
||||
Vendored
+6
-2
@@ -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.
|
||||
*/
|
||||
|
||||
Vendored
+3715
-1028
File diff suppressed because it is too large
Load Diff
+68
-15
@@ -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) */
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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 l’option « checkJS » pour obtenir des erreurs à partir de ces fichiers.]]></Val>
|
||||
<Val><![CDATA[Autorisez les fichiers JavaScript à faire partie de votre programme. Utilisez l’option « 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>
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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 ||
|
||||
|
||||
@@ -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 */
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -3548,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;
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -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),
|
||||
));
|
||||
});
|
||||
});
|
||||
|
||||
@@ -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.
|
||||
});
|
||||
}
|
||||
|
||||
@@ -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
|
||||
});
|
||||
}
|
||||
@@ -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))
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
@@ -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
|
||||
> : ^
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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
|
||||
> : ^
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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 {};
|
||||
@@ -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))
|
||||
|
||||
};
|
||||
}
|
||||
|
||||
@@ -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
|
||||
> : ^^^^^^
|
||||
|
||||
};
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
};
|
||||
|
||||
@@ -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.
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -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"
|
||||
}
|
||||
]
|
||||
|
||||
@@ -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,
|
||||
|
||||
+28
@@ -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
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
@@ -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))
|
||||
|
||||
});
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
@@ -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
|
||||
> : ^^^^^^^
|
||||
|
||||
});
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
@@ -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";
|
||||
|
||||
@@ -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; }
|
||||
|
||||
@@ -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);
|
||||
};
|
||||
};
|
||||
@@ -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))
|
||||
|
||||
@@ -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"
|
||||
> : ^^^^^^
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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.
|
||||
});
|
||||
|
||||
@@ -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))
|
||||
|
||||
});
|
||||
|
||||
@@ -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
|
||||
> : ^
|
||||
|
||||
});
|
||||
|
||||
@@ -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))
|
||||
|
||||
});
|
||||
|
||||
@@ -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
@@ -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
|
||||
}
|
||||
]
|
||||
@@ -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
|
||||
}
|
||||
]
|
||||
@@ -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
|
||||
}
|
||||
]
|
||||
@@ -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
|
||||
}
|
||||
]
|
||||
@@ -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
|
||||
}
|
||||
]
|
||||
@@ -0,0 +1,22 @@
|
||||
// === goToDefinition ===
|
||||
// === /tests/cases/fourslash/goToDefinitionOverriddenMember22.ts ===
|
||||
// const prop = "foo" as const;
|
||||
//
|
||||
// abstract class A {}
|
||||
//
|
||||
// export class B extends A {
|
||||
// /*GOTO DEF*/<|override readonly [|[prop]|] = "B";|>
|
||||
// }
|
||||
|
||||
// === Details ===
|
||||
[
|
||||
{
|
||||
"kind": "property",
|
||||
"name": "[prop]",
|
||||
"containerName": "B",
|
||||
"isLocal": false,
|
||||
"isAmbient": false,
|
||||
"unverified": false,
|
||||
"failedAliasResolution": false
|
||||
}
|
||||
]
|
||||
@@ -0,0 +1,21 @@
|
||||
// === goToDefinition ===
|
||||
// === /tests/cases/fourslash/goToDefinitionOverriddenMember23.ts ===
|
||||
// --- (line: 4) skipped ---
|
||||
// }
|
||||
//
|
||||
// export class B extends A {
|
||||
// <|static /*GOTO DEF*/override [|[prop]|]() {}|>
|
||||
// }
|
||||
|
||||
// === Details ===
|
||||
[
|
||||
{
|
||||
"kind": "method",
|
||||
"name": "[prop]",
|
||||
"containerName": "B",
|
||||
"isLocal": false,
|
||||
"isAmbient": false,
|
||||
"unverified": false,
|
||||
"failedAliasResolution": false
|
||||
}
|
||||
]
|
||||
@@ -0,0 +1,21 @@
|
||||
// === goToDefinition ===
|
||||
// === /tests/cases/fourslash/goToDefinitionOverriddenMember24.ts ===
|
||||
// --- (line: 4) skipped ---
|
||||
// }
|
||||
//
|
||||
// export class B extends A {
|
||||
// /*GOTO DEF*/<|override [|[prop]|]() {}|>
|
||||
// }
|
||||
|
||||
// === Details ===
|
||||
[
|
||||
{
|
||||
"kind": "method",
|
||||
"name": "[prop]",
|
||||
"containerName": "B",
|
||||
"isLocal": false,
|
||||
"isAmbient": false,
|
||||
"unverified": false,
|
||||
"failedAliasResolution": false
|
||||
}
|
||||
]
|
||||
@@ -0,0 +1,22 @@
|
||||
// === goToDefinition ===
|
||||
// === /tests/cases/fourslash/goToDefinitionOverriddenMember25.ts ===
|
||||
// const prop: symbol = Symbol();
|
||||
//
|
||||
// abstract class A {}
|
||||
//
|
||||
// export class B extends A {
|
||||
// <|static /*GOTO DEF*/override [|[prop]|]() {}|>
|
||||
// }
|
||||
|
||||
// === Details ===
|
||||
[
|
||||
{
|
||||
"kind": "method",
|
||||
"name": "[prop]",
|
||||
"containerName": "B",
|
||||
"isLocal": false,
|
||||
"isAmbient": false,
|
||||
"unverified": false,
|
||||
"failedAliasResolution": false
|
||||
}
|
||||
]
|
||||
@@ -0,0 +1,22 @@
|
||||
// === goToDefinition ===
|
||||
// === /tests/cases/fourslash/goToDefinitionOverriddenMember26.ts ===
|
||||
// const prop: symbol = Symbol();
|
||||
//
|
||||
// abstract class A {}
|
||||
//
|
||||
// export class B extends A {
|
||||
// /*GOTO DEF*/<|override [|[prop]|]() {}|>
|
||||
// }
|
||||
|
||||
// === Details ===
|
||||
[
|
||||
{
|
||||
"kind": "method",
|
||||
"name": "[prop]",
|
||||
"containerName": "B",
|
||||
"isLocal": false,
|
||||
"isAmbient": false,
|
||||
"unverified": false,
|
||||
"failedAliasResolution": false
|
||||
}
|
||||
]
|
||||
@@ -87,14 +87,18 @@
|
||||
// /**
|
||||
// * 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.
|
||||
// */
|
||||
@@ -340,14 +344,18 @@
|
||||
// /**
|
||||
// * 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.
|
||||
// */
|
||||
|
||||
@@ -0,0 +1,46 @@
|
||||
// === Inlay Hints ===
|
||||
test((state) => {});
|
||||
^
|
||||
{
|
||||
"text": "",
|
||||
"displayParts": [
|
||||
{
|
||||
"text": ": "
|
||||
},
|
||||
{
|
||||
"text": "{"
|
||||
},
|
||||
{
|
||||
"text": " "
|
||||
},
|
||||
{
|
||||
"text": "["
|
||||
},
|
||||
{
|
||||
"text": "STATE_SIGNAL",
|
||||
"span": {
|
||||
"start": 14,
|
||||
"length": 12
|
||||
},
|
||||
"file": "/tests/cases/fourslash/inlayHintsFunctionParameterTypes5.ts"
|
||||
},
|
||||
{
|
||||
"text": "]"
|
||||
},
|
||||
{
|
||||
"text": ": "
|
||||
},
|
||||
{
|
||||
"text": "unknown"
|
||||
},
|
||||
{
|
||||
"text": " "
|
||||
},
|
||||
{
|
||||
"text": "}"
|
||||
}
|
||||
],
|
||||
"position": 143,
|
||||
"kind": "Type",
|
||||
"whitespaceBefore": true
|
||||
}
|
||||
@@ -0,0 +1,69 @@
|
||||
// === Inlay Hints ===
|
||||
const div = getCtor("div");
|
||||
^
|
||||
{
|
||||
"text": "",
|
||||
"displayParts": [
|
||||
{
|
||||
"text": ": "
|
||||
},
|
||||
{
|
||||
"text": "{"
|
||||
},
|
||||
{
|
||||
"text": " "
|
||||
},
|
||||
{
|
||||
"text": "new "
|
||||
},
|
||||
{
|
||||
"text": "("
|
||||
},
|
||||
{
|
||||
"text": ")"
|
||||
},
|
||||
{
|
||||
"text": ": "
|
||||
},
|
||||
{
|
||||
"text": "DivElement",
|
||||
"span": {
|
||||
"start": 10,
|
||||
"length": 10
|
||||
},
|
||||
"file": "/tests/cases/fourslash/inlayHintsVariableTypes3.ts"
|
||||
},
|
||||
{
|
||||
"text": "; "
|
||||
},
|
||||
{
|
||||
"text": "prototype"
|
||||
},
|
||||
{
|
||||
"text": ": "
|
||||
},
|
||||
{
|
||||
"text": "DivElement",
|
||||
"span": {
|
||||
"start": 10,
|
||||
"length": 10
|
||||
},
|
||||
"file": "/tests/cases/fourslash/inlayHintsVariableTypes3.ts"
|
||||
},
|
||||
{
|
||||
"text": " "
|
||||
},
|
||||
{
|
||||
"text": "}"
|
||||
},
|
||||
{
|
||||
"text": " | "
|
||||
},
|
||||
{
|
||||
"text": "undefined"
|
||||
}
|
||||
],
|
||||
"position": 260,
|
||||
"kind": "Type",
|
||||
"whitespaceBefore": true
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
instanceofOperator.ts(7,11): error TS2725: Class name cannot be 'Object' when targeting ES5 with module CommonJS.
|
||||
instanceofOperator.ts(7,11): error TS2725: Class name cannot be 'Object' when targeting ES5 and above with module CommonJS.
|
||||
instanceofOperator.ts(12,5): error TS2358: The left-hand side of an 'instanceof' expression must be of type 'any', an object type or a type parameter.
|
||||
instanceofOperator.ts(15,20): error TS2359: The right-hand side of an 'instanceof' expression must be either of type 'any', a class, function, or other type assignable to the 'Function' interface type, or an object type with a 'Symbol.hasInstance' method.
|
||||
instanceofOperator.ts(16,23): error TS2359: The right-hand side of an 'instanceof' expression must be either of type 'any', a class, function, or other type assignable to the 'Function' interface type, or an object type with a 'Symbol.hasInstance' method.
|
||||
@@ -15,7 +15,7 @@ instanceofOperator.ts(21,5): error TS2358: The left-hand side of an 'instanceof'
|
||||
module test {
|
||||
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.
|
||||
var obj: Object;
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
interfaceMergeWithNonGenericTypeArguments.ts(4,34): error TS2315: Type 'SomeBaseClass' is not generic.
|
||||
interfaceMergeWithNonGenericTypeArguments.ts(6,3): error TS2346: Call target does not contain any signatures.
|
||||
|
||||
|
||||
==== interfaceMergeWithNonGenericTypeArguments.ts (2 errors) ====
|
||||
export class SomeBaseClass { }
|
||||
export interface SomeInterface { }
|
||||
export interface MergedClass extends SomeInterface { }
|
||||
export class MergedClass extends SomeBaseClass<any> {
|
||||
~~~~~~~~~~~~~~~~~~
|
||||
!!! error TS2315: Type 'SomeBaseClass' is not generic.
|
||||
public constructor() {
|
||||
super();
|
||||
~~~~~
|
||||
!!! error TS2346: Call target does not contain any signatures.
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
//// [tests/cases/compiler/interfaceMergeWithNonGenericTypeArguments.ts] ////
|
||||
|
||||
//// [interfaceMergeWithNonGenericTypeArguments.ts]
|
||||
export class SomeBaseClass { }
|
||||
export interface SomeInterface { }
|
||||
export interface MergedClass extends SomeInterface { }
|
||||
export class MergedClass extends SomeBaseClass<any> {
|
||||
public constructor() {
|
||||
super();
|
||||
}
|
||||
}
|
||||
|
||||
//// [interfaceMergeWithNonGenericTypeArguments.js]
|
||||
"use strict";
|
||||
var __extends = (this && this.__extends) || (function () {
|
||||
var extendStatics = function (d, b) {
|
||||
extendStatics = Object.setPrototypeOf ||
|
||||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
||||
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
||||
return extendStatics(d, b);
|
||||
};
|
||||
return function (d, b) {
|
||||
if (typeof b !== "function" && b !== null)
|
||||
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
||||
extendStatics(d, b);
|
||||
function __() { this.constructor = d; }
|
||||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
||||
};
|
||||
})();
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.MergedClass = exports.SomeBaseClass = void 0;
|
||||
var SomeBaseClass = /** @class */ (function () {
|
||||
function SomeBaseClass() {
|
||||
}
|
||||
return SomeBaseClass;
|
||||
}());
|
||||
exports.SomeBaseClass = SomeBaseClass;
|
||||
var MergedClass = /** @class */ (function (_super) {
|
||||
__extends(MergedClass, _super);
|
||||
function MergedClass() {
|
||||
return _super.call(this) || this;
|
||||
}
|
||||
return MergedClass;
|
||||
}(SomeBaseClass));
|
||||
exports.MergedClass = MergedClass;
|
||||
@@ -0,0 +1,22 @@
|
||||
//// [tests/cases/compiler/interfaceMergeWithNonGenericTypeArguments.ts] ////
|
||||
|
||||
=== interfaceMergeWithNonGenericTypeArguments.ts ===
|
||||
export class SomeBaseClass { }
|
||||
>SomeBaseClass : Symbol(SomeBaseClass, Decl(interfaceMergeWithNonGenericTypeArguments.ts, 0, 0))
|
||||
|
||||
export interface SomeInterface { }
|
||||
>SomeInterface : Symbol(SomeInterface, Decl(interfaceMergeWithNonGenericTypeArguments.ts, 0, 30))
|
||||
|
||||
export interface MergedClass extends SomeInterface { }
|
||||
>MergedClass : Symbol(MergedClass, Decl(interfaceMergeWithNonGenericTypeArguments.ts, 1, 34), Decl(interfaceMergeWithNonGenericTypeArguments.ts, 2, 54))
|
||||
>SomeInterface : Symbol(SomeInterface, Decl(interfaceMergeWithNonGenericTypeArguments.ts, 0, 30))
|
||||
|
||||
export class MergedClass extends SomeBaseClass<any> {
|
||||
>MergedClass : Symbol(MergedClass, Decl(interfaceMergeWithNonGenericTypeArguments.ts, 1, 34), Decl(interfaceMergeWithNonGenericTypeArguments.ts, 2, 54))
|
||||
>SomeBaseClass : Symbol(SomeBaseClass, Decl(interfaceMergeWithNonGenericTypeArguments.ts, 0, 0))
|
||||
|
||||
public constructor() {
|
||||
super();
|
||||
>super : Symbol(SomeBaseClass, Decl(interfaceMergeWithNonGenericTypeArguments.ts, 0, 0))
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
//// [tests/cases/compiler/interfaceMergeWithNonGenericTypeArguments.ts] ////
|
||||
|
||||
=== interfaceMergeWithNonGenericTypeArguments.ts ===
|
||||
export class SomeBaseClass { }
|
||||
>SomeBaseClass : SomeBaseClass
|
||||
> : ^^^^^^^^^^^^^
|
||||
|
||||
export interface SomeInterface { }
|
||||
export interface MergedClass extends SomeInterface { }
|
||||
export class MergedClass extends SomeBaseClass<any> {
|
||||
>MergedClass : MergedClass
|
||||
> : ^^^^^^^^^^^
|
||||
>SomeBaseClass : SomeInterface
|
||||
> : ^^^^^^^^^^^^^
|
||||
|
||||
public constructor() {
|
||||
super();
|
||||
>super() : void
|
||||
> : ^^^^
|
||||
>super : typeof SomeBaseClass
|
||||
> : ^^^^^^^^^^^^^^^^^^^^
|
||||
}
|
||||
}
|
||||
@@ -291,16 +291,16 @@ export function Point2D(x, y) {
|
||||
}
|
||||
|
||||
Point2D.prototype = {
|
||||
>Point2D.prototype = { __proto__: Vec, get x() { return this.storage[0]; }, /** * @param {number} x */ set x(x) { this.storage[0] = x; }, get y() { return this.storage[1]; }, /** * @param {number} y */ set y(y) { this.storage[1] = y; }} : { __proto__: typeof Vec; x: number; y: number; }
|
||||
> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^ ^^^
|
||||
>Point2D.prototype : { __proto__: typeof Vec; x: number; y: number; }
|
||||
> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^ ^^^
|
||||
>Point2D.prototype = { __proto__: Vec, get x() { return this.storage[0]; }, /** * @param {number} x */ set x(x) { this.storage[0] = x; }, get y() { return this.storage[1]; }, /** * @param {number} y */ set y(y) { this.storage[1] = y; }} : { __proto__: typeof Vec; get x(): number; set x(x: number); get y(): number; set y(y: number); }
|
||||
> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^ ^^ ^^^^^^^^^^^^ ^^^^^^^^ ^^ ^^^^
|
||||
>Point2D.prototype : { __proto__: typeof Vec; get x(): number; set x(x: number); get y(): number; set y(y: number); }
|
||||
> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^ ^^ ^^^^^^^^^^^^ ^^^^^^^^ ^^ ^^^^
|
||||
>Point2D : typeof Point2D
|
||||
> : ^^^^^^^^^^^^^^
|
||||
>prototype : { __proto__: typeof Vec; x: number; y: number; }
|
||||
> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^ ^^^
|
||||
>{ __proto__: Vec, get x() { return this.storage[0]; }, /** * @param {number} x */ set x(x) { this.storage[0] = x; }, get y() { return this.storage[1]; }, /** * @param {number} y */ set y(y) { this.storage[1] = y; }} : { __proto__: typeof Vec; x: number; y: number; }
|
||||
> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^ ^^^
|
||||
>prototype : { __proto__: typeof Vec; get x(): number; set x(x: number); get y(): number; set y(y: number); }
|
||||
> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^ ^^ ^^^^^^^^^^^^ ^^^^^^^^ ^^ ^^^^
|
||||
>{ __proto__: Vec, get x() { return this.storage[0]; }, /** * @param {number} x */ set x(x) { this.storage[0] = x; }, get y() { return this.storage[1]; }, /** * @param {number} y */ set y(y) { this.storage[1] = y; }} : { __proto__: typeof Vec; get x(): number; set x(x: number); get y(): number; set y(y: number); }
|
||||
> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^ ^^ ^^^^^^^^^^^^ ^^^^^^^^ ^^ ^^^^
|
||||
|
||||
__proto__: Vec,
|
||||
>__proto__ : typeof Vec
|
||||
@@ -315,8 +315,8 @@ Point2D.prototype = {
|
||||
return this.storage[0];
|
||||
>this.storage[0] : any
|
||||
>this.storage : any
|
||||
>this : { __proto__: typeof Vec; x: number; y: number; }
|
||||
> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^ ^^^
|
||||
>this : { __proto__: typeof Vec; get x(): number; set x(x: number); get y(): number; set y(y: number); }
|
||||
> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^ ^^ ^^^^^^^^^^^^ ^^^^^^^^ ^^ ^^^^
|
||||
>storage : any
|
||||
> : ^^^
|
||||
>0 : 0
|
||||
@@ -337,8 +337,8 @@ Point2D.prototype = {
|
||||
> : ^^^^^^
|
||||
>this.storage[0] : any
|
||||
>this.storage : any
|
||||
>this : { __proto__: typeof Vec; x: number; y: number; }
|
||||
> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^ ^^^
|
||||
>this : { __proto__: typeof Vec; get x(): number; set x(x: number); get y(): number; set y(y: number); }
|
||||
> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^ ^^ ^^^^^^^^^^^^ ^^^^^^^^ ^^ ^^^^
|
||||
>storage : any
|
||||
> : ^^^
|
||||
>0 : 0
|
||||
@@ -354,8 +354,8 @@ Point2D.prototype = {
|
||||
return this.storage[1];
|
||||
>this.storage[1] : any
|
||||
>this.storage : any
|
||||
>this : { __proto__: typeof Vec; x: number; y: number; }
|
||||
> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^ ^^^
|
||||
>this : { __proto__: typeof Vec; get x(): number; set x(x: number); get y(): number; set y(y: number); }
|
||||
> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^ ^^ ^^^^^^^^^^^^ ^^^^^^^^ ^^ ^^^^
|
||||
>storage : any
|
||||
> : ^^^
|
||||
>1 : 1
|
||||
@@ -376,8 +376,8 @@ Point2D.prototype = {
|
||||
> : ^^^^^^
|
||||
>this.storage[1] : any
|
||||
>this.storage : any
|
||||
>this : { __proto__: typeof Vec; x: number; y: number; }
|
||||
> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^ ^^^
|
||||
>this : { __proto__: typeof Vec; get x(): number; set x(x: number); get y(): number; set y(y: number); }
|
||||
> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^ ^^ ^^^^^^^^^^^^ ^^^^^^^^ ^^ ^^^^
|
||||
>storage : any
|
||||
> : ^^^
|
||||
>1 : 1
|
||||
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -0,0 +1,66 @@
|
||||
//// [tests/cases/conformance/classes/mixinAccessors1.ts] ////
|
||||
|
||||
//// [mixinAccessors1.ts]
|
||||
// https://github.com/microsoft/TypeScript/issues/58790
|
||||
|
||||
function mixin<T extends { new (...args: any[]): {} }>(superclass: T) {
|
||||
return class extends superclass {
|
||||
get validationTarget(): HTMLElement {
|
||||
return document.createElement("input");
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
class BaseClass {
|
||||
get validationTarget(): HTMLElement {
|
||||
return document.createElement("div");
|
||||
}
|
||||
}
|
||||
|
||||
class MyClass extends mixin(BaseClass) {
|
||||
get validationTarget(): HTMLElement {
|
||||
return document.createElement("select");
|
||||
}
|
||||
}
|
||||
|
||||
//// [mixinAccessors1.js]
|
||||
"use strict";
|
||||
// https://github.com/microsoft/TypeScript/issues/58790
|
||||
function mixin(superclass) {
|
||||
return class extends superclass {
|
||||
get validationTarget() {
|
||||
return document.createElement("input");
|
||||
}
|
||||
};
|
||||
}
|
||||
class BaseClass {
|
||||
get validationTarget() {
|
||||
return document.createElement("div");
|
||||
}
|
||||
}
|
||||
class MyClass extends mixin(BaseClass) {
|
||||
get validationTarget() {
|
||||
return document.createElement("select");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//// [mixinAccessors1.d.ts]
|
||||
declare function mixin<T extends {
|
||||
new (...args: any[]): {};
|
||||
}>(superclass: T): {
|
||||
new (...args: any[]): {
|
||||
get validationTarget(): HTMLElement;
|
||||
};
|
||||
} & T;
|
||||
declare class BaseClass {
|
||||
get validationTarget(): HTMLElement;
|
||||
}
|
||||
declare const MyClass_base: {
|
||||
new (...args: any[]): {
|
||||
get validationTarget(): HTMLElement;
|
||||
};
|
||||
} & typeof BaseClass;
|
||||
declare class MyClass extends MyClass_base {
|
||||
get validationTarget(): HTMLElement;
|
||||
}
|
||||
@@ -0,0 +1,56 @@
|
||||
//// [tests/cases/conformance/classes/mixinAccessors1.ts] ////
|
||||
|
||||
=== mixinAccessors1.ts ===
|
||||
// https://github.com/microsoft/TypeScript/issues/58790
|
||||
|
||||
function mixin<T extends { new (...args: any[]): {} }>(superclass: T) {
|
||||
>mixin : Symbol(mixin, Decl(mixinAccessors1.ts, 0, 0))
|
||||
>T : Symbol(T, Decl(mixinAccessors1.ts, 2, 15))
|
||||
>args : Symbol(args, Decl(mixinAccessors1.ts, 2, 32))
|
||||
>superclass : Symbol(superclass, Decl(mixinAccessors1.ts, 2, 55))
|
||||
>T : Symbol(T, Decl(mixinAccessors1.ts, 2, 15))
|
||||
|
||||
return class extends superclass {
|
||||
>superclass : Symbol(superclass, Decl(mixinAccessors1.ts, 2, 55))
|
||||
|
||||
get validationTarget(): HTMLElement {
|
||||
>validationTarget : Symbol((Anonymous class).validationTarget, Decl(mixinAccessors1.ts, 3, 35))
|
||||
>HTMLElement : Symbol(HTMLElement, Decl(lib.dom.d.ts, --, --), Decl(lib.dom.d.ts, --, --))
|
||||
|
||||
return document.createElement("input");
|
||||
>document.createElement : Symbol(Document.createElement, Decl(lib.dom.d.ts, --, --), Decl(lib.dom.d.ts, --, --), Decl(lib.dom.d.ts, --, --))
|
||||
>document : Symbol(document, Decl(lib.dom.d.ts, --, --))
|
||||
>createElement : Symbol(Document.createElement, Decl(lib.dom.d.ts, --, --), Decl(lib.dom.d.ts, --, --), Decl(lib.dom.d.ts, --, --))
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
class BaseClass {
|
||||
>BaseClass : Symbol(BaseClass, Decl(mixinAccessors1.ts, 8, 1))
|
||||
|
||||
get validationTarget(): HTMLElement {
|
||||
>validationTarget : Symbol(BaseClass.validationTarget, Decl(mixinAccessors1.ts, 10, 17))
|
||||
>HTMLElement : Symbol(HTMLElement, Decl(lib.dom.d.ts, --, --), Decl(lib.dom.d.ts, --, --))
|
||||
|
||||
return document.createElement("div");
|
||||
>document.createElement : Symbol(Document.createElement, Decl(lib.dom.d.ts, --, --), Decl(lib.dom.d.ts, --, --), Decl(lib.dom.d.ts, --, --))
|
||||
>document : Symbol(document, Decl(lib.dom.d.ts, --, --))
|
||||
>createElement : Symbol(Document.createElement, Decl(lib.dom.d.ts, --, --), Decl(lib.dom.d.ts, --, --), Decl(lib.dom.d.ts, --, --))
|
||||
}
|
||||
}
|
||||
|
||||
class MyClass extends mixin(BaseClass) {
|
||||
>MyClass : Symbol(MyClass, Decl(mixinAccessors1.ts, 14, 1))
|
||||
>mixin : Symbol(mixin, Decl(mixinAccessors1.ts, 0, 0))
|
||||
>BaseClass : Symbol(BaseClass, Decl(mixinAccessors1.ts, 8, 1))
|
||||
|
||||
get validationTarget(): HTMLElement {
|
||||
>validationTarget : Symbol(MyClass.validationTarget, Decl(mixinAccessors1.ts, 16, 40))
|
||||
>HTMLElement : Symbol(HTMLElement, Decl(lib.dom.d.ts, --, --), Decl(lib.dom.d.ts, --, --))
|
||||
|
||||
return document.createElement("select");
|
||||
>document.createElement : Symbol(Document.createElement, Decl(lib.dom.d.ts, --, --), Decl(lib.dom.d.ts, --, --), Decl(lib.dom.d.ts, --, --))
|
||||
>document : Symbol(document, Decl(lib.dom.d.ts, --, --))
|
||||
>createElement : Symbol(Document.createElement, Decl(lib.dom.d.ts, --, --), Decl(lib.dom.d.ts, --, --), Decl(lib.dom.d.ts, --, --))
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,87 @@
|
||||
//// [tests/cases/conformance/classes/mixinAccessors1.ts] ////
|
||||
|
||||
=== mixinAccessors1.ts ===
|
||||
// https://github.com/microsoft/TypeScript/issues/58790
|
||||
|
||||
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 { get validationTarget(): HTMLElement { return document.createElement("input"); } } : { new (...args: any[]): (Anonymous class); prototype: mixin<any>.(Anonymous class); } & T
|
||||
> : ^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
>superclass : {}
|
||||
> : ^^
|
||||
|
||||
get validationTarget(): HTMLElement {
|
||||
>validationTarget : HTMLElement
|
||||
> : ^^^^^^^^^^^
|
||||
|
||||
return document.createElement("input");
|
||||
>document.createElement("input") : HTMLInputElement
|
||||
> : ^^^^^^^^^^^^^^^^
|
||||
>document.createElement : { <K extends keyof HTMLElementTagNameMap>(tagName: K, options?: ElementCreationOptions): HTMLElementTagNameMap[K]; <K extends keyof HTMLElementDeprecatedTagNameMap>(tagName: K, options?: ElementCreationOptions): HTMLElementDeprecatedTagNameMap[K]; (tagName: string, options?: ElementCreationOptions): HTMLElement; }
|
||||
> : ^^^ ^^^^^^^^^ ^^ ^^ ^^ ^^^ ^^^ ^^^ ^^^^^^^^^ ^^ ^^ ^^ ^^^ ^^^ ^^^ ^^ ^^ ^^^ ^^^ ^^^
|
||||
>document : Document
|
||||
> : ^^^^^^^^
|
||||
>createElement : { <K extends keyof HTMLElementTagNameMap>(tagName: K, options?: ElementCreationOptions): HTMLElementTagNameMap[K]; <K extends keyof HTMLElementDeprecatedTagNameMap>(tagName: K, options?: ElementCreationOptions): HTMLElementDeprecatedTagNameMap[K]; (tagName: string, options?: ElementCreationOptions): HTMLElement; }
|
||||
> : ^^^ ^^^^^^^^^ ^^ ^^ ^^ ^^^ ^^^ ^^^ ^^^^^^^^^ ^^ ^^ ^^ ^^^ ^^^ ^^^ ^^ ^^ ^^^ ^^^ ^^^
|
||||
>"input" : "input"
|
||||
> : ^^^^^^^
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
class BaseClass {
|
||||
>BaseClass : BaseClass
|
||||
> : ^^^^^^^^^
|
||||
|
||||
get validationTarget(): HTMLElement {
|
||||
>validationTarget : HTMLElement
|
||||
> : ^^^^^^^^^^^
|
||||
|
||||
return document.createElement("div");
|
||||
>document.createElement("div") : HTMLDivElement
|
||||
> : ^^^^^^^^^^^^^^
|
||||
>document.createElement : { <K extends keyof HTMLElementTagNameMap>(tagName: K, options?: ElementCreationOptions): HTMLElementTagNameMap[K]; <K extends keyof HTMLElementDeprecatedTagNameMap>(tagName: K, options?: ElementCreationOptions): HTMLElementDeprecatedTagNameMap[K]; (tagName: string, options?: ElementCreationOptions): HTMLElement; }
|
||||
> : ^^^ ^^^^^^^^^ ^^ ^^ ^^ ^^^ ^^^ ^^^ ^^^^^^^^^ ^^ ^^ ^^ ^^^ ^^^ ^^^ ^^ ^^ ^^^ ^^^ ^^^
|
||||
>document : Document
|
||||
> : ^^^^^^^^
|
||||
>createElement : { <K extends keyof HTMLElementTagNameMap>(tagName: K, options?: ElementCreationOptions): HTMLElementTagNameMap[K]; <K extends keyof HTMLElementDeprecatedTagNameMap>(tagName: K, options?: ElementCreationOptions): HTMLElementDeprecatedTagNameMap[K]; (tagName: string, options?: ElementCreationOptions): HTMLElement; }
|
||||
> : ^^^ ^^^^^^^^^ ^^ ^^ ^^ ^^^ ^^^ ^^^ ^^^^^^^^^ ^^ ^^ ^^ ^^^ ^^^ ^^^ ^^ ^^ ^^^ ^^^ ^^^
|
||||
>"div" : "div"
|
||||
> : ^^^^^
|
||||
}
|
||||
}
|
||||
|
||||
class MyClass extends mixin(BaseClass) {
|
||||
>MyClass : MyClass
|
||||
> : ^^^^^^^
|
||||
>mixin(BaseClass) : mixin<typeof BaseClass>.(Anonymous class) & BaseClass
|
||||
> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
>mixin : <T extends { new (...args: any[]): {}; }>(superclass: T) => { new (...args: any[]): (Anonymous class); prototype: mixin<any>.(Anonymous class); } & T
|
||||
> : ^ ^^^^^^^^^ ^^ ^^ ^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
>BaseClass : typeof BaseClass
|
||||
> : ^^^^^^^^^^^^^^^^
|
||||
|
||||
get validationTarget(): HTMLElement {
|
||||
>validationTarget : HTMLElement
|
||||
> : ^^^^^^^^^^^
|
||||
|
||||
return document.createElement("select");
|
||||
>document.createElement("select") : HTMLSelectElement
|
||||
> : ^^^^^^^^^^^^^^^^^
|
||||
>document.createElement : { <K extends keyof HTMLElementTagNameMap>(tagName: K, options?: ElementCreationOptions): HTMLElementTagNameMap[K]; <K extends keyof HTMLElementDeprecatedTagNameMap>(tagName: K, options?: ElementCreationOptions): HTMLElementDeprecatedTagNameMap[K]; (tagName: string, options?: ElementCreationOptions): HTMLElement; }
|
||||
> : ^^^ ^^^^^^^^^ ^^ ^^ ^^ ^^^ ^^^ ^^^ ^^^^^^^^^ ^^ ^^ ^^ ^^^ ^^^ ^^^ ^^ ^^ ^^^ ^^^ ^^^
|
||||
>document : Document
|
||||
> : ^^^^^^^^
|
||||
>createElement : { <K extends keyof HTMLElementTagNameMap>(tagName: K, options?: ElementCreationOptions): HTMLElementTagNameMap[K]; <K extends keyof HTMLElementDeprecatedTagNameMap>(tagName: K, options?: ElementCreationOptions): HTMLElementDeprecatedTagNameMap[K]; (tagName: string, options?: ElementCreationOptions): HTMLElement; }
|
||||
> : ^^^ ^^^^^^^^^ ^^ ^^ ^^ ^^^ ^^^ ^^^ ^^^^^^^^^ ^^ ^^ ^^ ^^^ ^^^ ^^^ ^^ ^^ ^^^ ^^^ ^^^
|
||||
>"select" : "select"
|
||||
> : ^^^^^^^^
|
||||
}
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user