mirror of
https://github.com/microsoft/TypeScript.git
synced 2025-11-18 17:21:48 +00:00
Merge branch 'main' into rootDir
This commit is contained in:
@@ -20,7 +20,7 @@ jobs:
|
||||
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
|
||||
with:
|
||||
token: ${{ secrets.TS_BOT_GITHUB_TOKEN }}
|
||||
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
|
||||
- uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5.0.0
|
||||
with:
|
||||
node-version: 'lts/*'
|
||||
|
||||
|
||||
+14
-14
@@ -119,7 +119,7 @@ jobs:
|
||||
steps:
|
||||
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
|
||||
- name: Use node version ${{ matrix.config.node-version }}
|
||||
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
|
||||
uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5.0.0
|
||||
with:
|
||||
node-version: ${{ matrix.config.node-version }}
|
||||
check-latest: true
|
||||
@@ -151,7 +151,7 @@ jobs:
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
|
||||
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
|
||||
- uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5.0.0
|
||||
with:
|
||||
node-version: 'lts/*'
|
||||
- run: npm ci
|
||||
@@ -165,7 +165,7 @@ jobs:
|
||||
name: coverage
|
||||
path: coverage
|
||||
|
||||
- uses: codecov/codecov-action@18283e04ce6e62d37312384ff67231eb8fd56d24 # v5.4.3
|
||||
- uses: codecov/codecov-action@5a1091511ad55cbe89839c7260b706298ca349f7 # v5.5.1
|
||||
with:
|
||||
use_oidc: ${{ !(github.event_name == 'pull_request' && github.event.pull_request.head.repo.fork) }}
|
||||
disable_search: true
|
||||
@@ -176,7 +176,7 @@ jobs:
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
|
||||
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
|
||||
- uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5.0.0
|
||||
with:
|
||||
node-version: 'lts/*'
|
||||
- run: npm ci
|
||||
@@ -189,7 +189,7 @@ jobs:
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
|
||||
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
|
||||
- uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5.0.0
|
||||
with:
|
||||
node-version: 'lts/*'
|
||||
- run: npm ci
|
||||
@@ -202,12 +202,12 @@ jobs:
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
|
||||
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
|
||||
- uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5.0.0
|
||||
with:
|
||||
node-version: 'lts/*'
|
||||
- run: npm ci
|
||||
|
||||
- uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4
|
||||
- uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
|
||||
with:
|
||||
path: ~/.cache/dprint
|
||||
key: ${{ runner.os }}-dprint-${{ hashFiles('package-lock.json', '.dprint.jsonc') }}
|
||||
@@ -222,7 +222,7 @@ jobs:
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
|
||||
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
|
||||
- uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5.0.0
|
||||
with:
|
||||
node-version: 'lts/*'
|
||||
- run: npm ci
|
||||
@@ -238,7 +238,7 @@ jobs:
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
|
||||
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
|
||||
- uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5.0.0
|
||||
with:
|
||||
node-version: 'lts/*'
|
||||
- run: npm ci
|
||||
@@ -252,7 +252,7 @@ jobs:
|
||||
steps:
|
||||
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
|
||||
|
||||
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
|
||||
- uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5.0.0
|
||||
with:
|
||||
node-version: 'lts/*'
|
||||
- run: |
|
||||
@@ -300,7 +300,7 @@ jobs:
|
||||
path: base
|
||||
ref: ${{ github.base_ref }}
|
||||
|
||||
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
|
||||
- uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5.0.0
|
||||
with:
|
||||
node-version: 'lts/*'
|
||||
- run: |
|
||||
@@ -333,7 +333,7 @@ jobs:
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
|
||||
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
|
||||
- uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5.0.0
|
||||
with:
|
||||
node-version: 'lts/*'
|
||||
- run: npm ci
|
||||
@@ -349,7 +349,7 @@ jobs:
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
|
||||
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
|
||||
- uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5.0.0
|
||||
with:
|
||||
node-version: 'lts/*'
|
||||
- run: npm ci
|
||||
@@ -370,7 +370,7 @@ jobs:
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
|
||||
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
|
||||
- uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5.0.0
|
||||
with:
|
||||
node-version: 'lts/*'
|
||||
- run: npm ci
|
||||
|
||||
@@ -46,7 +46,7 @@ jobs:
|
||||
|
||||
# Initializes the CodeQL tools for scanning.
|
||||
- name: Initialize CodeQL
|
||||
uses: github/codeql-action/init@df559355d593797519d70b90fc8edd5db049e7a2 # v3.29.5
|
||||
uses: github/codeql-action/init@3599b3baa15b485a2e49ef411a7a4bb2452e7f93 # v3.30.5
|
||||
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@df559355d593797519d70b90fc8edd5db049e7a2 # v3.29.5
|
||||
uses: github/codeql-action/autobuild@3599b3baa15b485a2e49ef411a7a4bb2452e7f93 # v3.30.5
|
||||
|
||||
# ℹ️ 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@df559355d593797519d70b90fc8edd5db049e7a2 # v3.29.5
|
||||
uses: github/codeql-action/analyze@3599b3baa15b485a2e49ef411a7a4bb2452e7f93 # v3.30.5
|
||||
|
||||
@@ -16,7 +16,7 @@ jobs:
|
||||
# If you do not check out your code, Copilot will do this for you.
|
||||
steps:
|
||||
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
|
||||
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
|
||||
- uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5.0.0
|
||||
- run: npm ci
|
||||
# pull dprint caches before network access is blocked
|
||||
- run: npx hereby check-format || true
|
||||
|
||||
@@ -53,7 +53,7 @@ jobs:
|
||||
fetch-depth: 0 # Default is 1; need to set to 0 to get the benefits of blob:none.
|
||||
token: ${{ secrets.TS_BOT_GITHUB_TOKEN }}
|
||||
|
||||
- uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
|
||||
- uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
|
||||
id: open-pr
|
||||
env:
|
||||
PR: ${{ inputs.pr }}
|
||||
|
||||
@@ -21,7 +21,7 @@ jobs:
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
|
||||
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
|
||||
- uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5.0.0
|
||||
with:
|
||||
node-version: 'lts/*'
|
||||
- run: |
|
||||
@@ -43,7 +43,7 @@ jobs:
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
|
||||
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
|
||||
- uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5.0.0
|
||||
with:
|
||||
node-version: 'lts/*'
|
||||
# Use NODE_AUTH_TOKEN environment variable to authenticate to this registry.
|
||||
|
||||
@@ -31,7 +31,7 @@ jobs:
|
||||
with:
|
||||
ref: ${{ inputs.branch_name }}
|
||||
token: ${{ secrets.TS_BOT_GITHUB_TOKEN }}
|
||||
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
|
||||
- uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5.0.0
|
||||
with:
|
||||
node-version: 'lts/*'
|
||||
- run: |
|
||||
|
||||
@@ -55,7 +55,7 @@ jobs:
|
||||
filter: blob:none # https://github.blog/2020-12-21-get-up-to-speed-with-partial-clone-and-shallow-clone/
|
||||
fetch-depth: 0 # Default is 1; need to set to 0 to get the benefits of blob:none.
|
||||
token: ${{ secrets.TS_BOT_GITHUB_TOKEN }}
|
||||
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
|
||||
- uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5.0.0
|
||||
with:
|
||||
node-version: 'lts/*'
|
||||
- run: |
|
||||
|
||||
@@ -22,7 +22,7 @@ jobs:
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
|
||||
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
|
||||
- uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5.0.0
|
||||
with:
|
||||
node-version: 'lts/*'
|
||||
- run: |
|
||||
@@ -43,7 +43,7 @@ jobs:
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
|
||||
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
|
||||
- uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5.0.0
|
||||
with:
|
||||
node-version: 'lts/*'
|
||||
# Use NODE_AUTH_TOKEN environment variable to authenticate to this registry.
|
||||
|
||||
@@ -20,7 +20,7 @@ jobs:
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
|
||||
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
|
||||
- uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5.0.0
|
||||
with:
|
||||
node-version: 'lts/*'
|
||||
- run: |
|
||||
|
||||
@@ -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@df559355d593797519d70b90fc8edd5db049e7a2 # v3.29.5
|
||||
uses: github/codeql-action/upload-sarif@3599b3baa15b485a2e49ef411a7a4bb2452e7f93 # v3.30.5
|
||||
with:
|
||||
sarif_file: results.sarif
|
||||
|
||||
@@ -53,7 +53,7 @@ jobs:
|
||||
with:
|
||||
ref: ${{ inputs.branch_name }}
|
||||
token: ${{ secrets.TS_BOT_GITHUB_TOKEN }}
|
||||
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
|
||||
- uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5.0.0
|
||||
with:
|
||||
node-version: 'lts/*'
|
||||
- run: |
|
||||
|
||||
@@ -42,7 +42,7 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
|
||||
- uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5.0.0
|
||||
with:
|
||||
node-version: 'lts/*'
|
||||
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
|
||||
|
||||
@@ -57,7 +57,7 @@ jobs:
|
||||
fetch-depth: 0 # Default is 1; need to set to 0 to get the benefits of blob:none.
|
||||
- if: ${{ !github.event.inputs.bisect }}
|
||||
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
|
||||
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
|
||||
- uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5.0.0
|
||||
with:
|
||||
node-version: 'lts/*'
|
||||
- uses: microsoft/TypeScript-Twoslash-Repro-Action@master
|
||||
|
||||
@@ -25,7 +25,7 @@ jobs:
|
||||
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
|
||||
with:
|
||||
token: ${{ secrets.TS_BOT_GITHUB_TOKEN }}
|
||||
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
|
||||
- uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5.0.0
|
||||
with:
|
||||
node-version: 'lts/*'
|
||||
- run: |
|
||||
|
||||
+1
-1
@@ -52,7 +52,7 @@ const libs = memoize(() => {
|
||||
/** @type {{ libs: string[]; paths: Record<string, string | undefined>; }} */
|
||||
const libraries = readJson("./src/lib/libs.json");
|
||||
const libs = libraries.libs.map(lib => {
|
||||
const relativeSources = ["header.d.ts", lib + ".d.ts"];
|
||||
const relativeSources = [lib + ".d.ts"];
|
||||
const relativeTarget = libraries.paths && libraries.paths[lib] || ("lib." + lib + ".d.ts");
|
||||
const sources = relativeSources.map(s => path.posix.join("src/lib", s));
|
||||
const target = `built/local/${relativeTarget}`;
|
||||
|
||||
@@ -412,7 +412,7 @@ function createBuilderProgramState(
|
||||
|
||||
if (canCopySemanticDiagnostics) {
|
||||
if (sourceFile.isDeclarationFile && !copyDeclarationFileDiagnostics) return;
|
||||
if (sourceFile.hasNoDefaultLib && !copyLibFileDiagnostics) return;
|
||||
if (newProgram.isSourceFileDefaultLibrary(sourceFile) && !copyLibFileDiagnostics) return;
|
||||
|
||||
// Unchanged file copy diagnostics
|
||||
const diagnostics = oldState!.semanticDiagnosticsPerFile.get(sourceFilePath);
|
||||
|
||||
+125
-37
@@ -421,6 +421,7 @@ import {
|
||||
hasSyntacticModifier,
|
||||
hasSyntacticModifiers,
|
||||
hasType,
|
||||
hasTypeArguments,
|
||||
HeritageClause,
|
||||
hostGetCanonicalFileName,
|
||||
Identifier,
|
||||
@@ -1531,7 +1532,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
|
||||
var noImplicitThis = getStrictOptionValue(compilerOptions, "noImplicitThis");
|
||||
var useUnknownInCatchVariables = getStrictOptionValue(compilerOptions, "useUnknownInCatchVariables");
|
||||
var exactOptionalPropertyTypes = compilerOptions.exactOptionalPropertyTypes;
|
||||
var noUncheckedSideEffectImports = !!compilerOptions.noUncheckedSideEffectImports;
|
||||
var noUncheckedSideEffectImports = compilerOptions.noUncheckedSideEffectImports !== false;
|
||||
|
||||
var checkBinaryExpression = createCheckBinaryExpression();
|
||||
var emitResolver = createResolver();
|
||||
@@ -4684,9 +4685,9 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
|
||||
}
|
||||
}
|
||||
|
||||
function resolveExternalModuleName(location: Node, moduleReferenceExpression: Expression, ignoreErrors?: boolean): Symbol | undefined {
|
||||
function resolveExternalModuleName(location: Node, moduleReferenceExpression: Expression, ignoreErrors?: boolean, errorMessage?: DiagnosticMessage): Symbol | undefined {
|
||||
const isClassic = getEmitModuleResolutionKind(compilerOptions) === ModuleResolutionKind.Classic;
|
||||
const errorMessage = isClassic ?
|
||||
errorMessage ??= isClassic ?
|
||||
Diagnostics.Cannot_find_module_0_Did_you_mean_to_set_the_moduleResolution_option_to_nodenext_or_to_add_aliases_to_the_paths_option
|
||||
: Diagnostics.Cannot_find_module_0_or_its_corresponding_type_declarations;
|
||||
return resolveExternalModuleNameWorker(location, moduleReferenceExpression, ignoreErrors ? undefined : errorMessage, ignoreErrors);
|
||||
@@ -21504,7 +21505,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
|
||||
let issuedElaboration = false;
|
||||
if (!targetProp) {
|
||||
const indexInfo = getApplicableIndexInfo(target, nameType);
|
||||
if (indexInfo && indexInfo.declaration && !getSourceFileOfNode(indexInfo.declaration).hasNoDefaultLib) {
|
||||
if (indexInfo && indexInfo.declaration && !host.isSourceFileDefaultLibrary(getSourceFileOfNode(indexInfo.declaration))) {
|
||||
issuedElaboration = true;
|
||||
addRelatedInfo(reportedDiag, createDiagnosticForNode(indexInfo.declaration, Diagnostics.The_expected_type_comes_from_this_index_signature));
|
||||
}
|
||||
@@ -21512,7 +21513,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
|
||||
|
||||
if (!issuedElaboration && (targetProp && length(targetProp.declarations) || target.symbol && length(target.symbol.declarations))) {
|
||||
const targetNode = targetProp && length(targetProp.declarations) ? targetProp.declarations![0] : target.symbol.declarations![0];
|
||||
if (!getSourceFileOfNode(targetNode).hasNoDefaultLib) {
|
||||
if (!host.isSourceFileDefaultLibrary(getSourceFileOfNode(targetNode))) {
|
||||
addRelatedInfo(
|
||||
reportedDiag,
|
||||
createDiagnosticForNode(
|
||||
@@ -24460,13 +24461,10 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
|
||||
if (isObjectLiteralType(target)) {
|
||||
for (const sourceProp of excludeProperties(getPropertiesOfType(source), excludedProperties)) {
|
||||
if (!getPropertyOfObjectType(target, sourceProp.escapedName)) {
|
||||
const sourceType = getTypeOfSymbol(sourceProp);
|
||||
if (!(sourceType.flags & TypeFlags.Undefined)) {
|
||||
if (reportErrors) {
|
||||
reportError(Diagnostics.Property_0_does_not_exist_on_type_1, symbolToString(sourceProp), typeToString(target));
|
||||
}
|
||||
return Ternary.False;
|
||||
if (reportErrors) {
|
||||
reportError(Diagnostics.Property_0_does_not_exist_on_type_1, symbolToString(sourceProp), typeToString(target));
|
||||
}
|
||||
return Ternary.False;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -25275,7 +25273,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
|
||||
if (isReadonlySymbol(sourceProp) !== isReadonlySymbol(targetProp)) {
|
||||
return Ternary.False;
|
||||
}
|
||||
return compareTypes(getTypeOfSymbol(sourceProp), getTypeOfSymbol(targetProp));
|
||||
return compareTypes(getNonMissingTypeOfSymbol(sourceProp), getNonMissingTypeOfSymbol(targetProp));
|
||||
}
|
||||
|
||||
function isMatchingSignature(source: Signature, target: Signature, partialMatch: boolean) {
|
||||
@@ -27888,24 +27886,22 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
|
||||
for (const type of types) {
|
||||
if (type.flags & (TypeFlags.Object | TypeFlags.Intersection | TypeFlags.InstantiableNonPrimitive)) {
|
||||
const discriminant = getTypeOfPropertyOfType(type, name);
|
||||
if (discriminant) {
|
||||
if (!isLiteralType(discriminant)) {
|
||||
return undefined;
|
||||
}
|
||||
let duplicate = false;
|
||||
forEachType(discriminant, t => {
|
||||
const id = getTypeId(getRegularTypeOfLiteralType(t));
|
||||
const existing = map.get(id);
|
||||
if (!existing) {
|
||||
map.set(id, type);
|
||||
}
|
||||
else if (existing !== unknownType) {
|
||||
map.set(id, unknownType);
|
||||
duplicate = true;
|
||||
}
|
||||
});
|
||||
if (!duplicate) count++;
|
||||
if (!discriminant || !isLiteralType(discriminant)) {
|
||||
return undefined;
|
||||
}
|
||||
let duplicate = false;
|
||||
forEachType(discriminant, t => {
|
||||
const id = getTypeId(getRegularTypeOfLiteralType(t));
|
||||
const existing = map.get(id);
|
||||
if (!existing) {
|
||||
map.set(id, type);
|
||||
}
|
||||
else if (existing !== unknownType) {
|
||||
map.set(id, unknownType);
|
||||
duplicate = true;
|
||||
}
|
||||
});
|
||||
if (!duplicate) count++;
|
||||
}
|
||||
}
|
||||
return count >= 10 && count * 2 >= types.length ? map : undefined;
|
||||
@@ -38003,7 +37999,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
|
||||
const exprType = checkExpression(expression, checkMode);
|
||||
if (isConstTypeReference(type)) {
|
||||
if (!isValidConstAssertionArgument(expression)) {
|
||||
error(expression, Diagnostics.A_const_assertions_can_only_be_applied_to_references_to_enum_members_or_string_number_boolean_array_or_object_literals);
|
||||
error(expression, Diagnostics.A_const_assertion_can_only_be_applied_to_references_to_enum_members_or_string_number_boolean_array_or_object_literals);
|
||||
}
|
||||
return getRegularTypeOfLiteralType(exprType);
|
||||
}
|
||||
@@ -42625,6 +42621,51 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets generic signatures from the function's/constructor's type.
|
||||
*/
|
||||
function getUninstantiatedSignatures(node: CallLikeExpression): readonly Signature[] {
|
||||
switch (node.kind) {
|
||||
case SyntaxKind.CallExpression:
|
||||
case SyntaxKind.Decorator:
|
||||
return getSignaturesOfType(
|
||||
getTypeOfExpression(node.expression),
|
||||
SignatureKind.Call,
|
||||
);
|
||||
case SyntaxKind.NewExpression:
|
||||
return getSignaturesOfType(
|
||||
getTypeOfExpression(node.expression),
|
||||
SignatureKind.Construct,
|
||||
);
|
||||
case SyntaxKind.JsxSelfClosingElement:
|
||||
case SyntaxKind.JsxOpeningElement:
|
||||
if (isJsxIntrinsicTagName(node.tagName)) return [];
|
||||
return getSignaturesOfType(
|
||||
getTypeOfExpression(node.tagName),
|
||||
SignatureKind.Call,
|
||||
);
|
||||
case SyntaxKind.TaggedTemplateExpression:
|
||||
return getSignaturesOfType(
|
||||
getTypeOfExpression(node.tag),
|
||||
SignatureKind.Call,
|
||||
);
|
||||
case SyntaxKind.BinaryExpression:
|
||||
case SyntaxKind.JsxOpeningFragment:
|
||||
return [];
|
||||
}
|
||||
}
|
||||
|
||||
function getTypeParameterConstraintForPositionAcrossSignatures(signatures: readonly Signature[], position: number) {
|
||||
const relevantTypeParameterConstraints = flatMap(signatures, signature => {
|
||||
const relevantTypeParameter = signature.typeParameters?.[position];
|
||||
if (relevantTypeParameter === undefined) return [];
|
||||
const relevantConstraint = getConstraintOfTypeParameter(relevantTypeParameter);
|
||||
if (relevantConstraint === undefined) return [];
|
||||
return [relevantConstraint];
|
||||
});
|
||||
return getUnionType(relevantTypeParameterConstraints);
|
||||
}
|
||||
|
||||
function checkTypeReferenceNode(node: TypeReferenceNode | ExpressionWithTypeArguments) {
|
||||
checkGrammarTypeArguments(node, node.typeArguments);
|
||||
if (node.kind === SyntaxKind.TypeReference && !isInJSFile(node) && !isInJSDoc(node) && node.typeArguments && node.typeName.end !== node.typeArguments.pos) {
|
||||
@@ -42663,12 +42704,59 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
|
||||
}
|
||||
|
||||
function getTypeArgumentConstraint(node: TypeNode): Type | undefined {
|
||||
const typeReferenceNode = tryCast(node.parent, isTypeReferenceType);
|
||||
if (!typeReferenceNode) return undefined;
|
||||
const typeParameters = getTypeParametersForTypeReferenceOrImport(typeReferenceNode);
|
||||
if (!typeParameters) return undefined;
|
||||
const constraint = getConstraintOfTypeParameter(typeParameters[typeReferenceNode.typeArguments!.indexOf(node)]);
|
||||
return constraint && instantiateType(constraint, createTypeMapper(typeParameters, getEffectiveTypeArguments(typeReferenceNode, typeParameters)));
|
||||
let typeArgumentPosition;
|
||||
if (hasTypeArguments(node.parent) && Array.isArray(node.parent.typeArguments)) {
|
||||
typeArgumentPosition = node.parent.typeArguments.indexOf(node);
|
||||
}
|
||||
|
||||
if (typeArgumentPosition !== undefined) {
|
||||
// The node could be a type argument of a call, a `new` expression, a decorator, an
|
||||
// instantiation expression, or a generic type instantiation.
|
||||
|
||||
if (isCallLikeExpression(node.parent)) {
|
||||
return getTypeParameterConstraintForPositionAcrossSignatures(
|
||||
getUninstantiatedSignatures(node.parent),
|
||||
typeArgumentPosition,
|
||||
);
|
||||
}
|
||||
|
||||
if (isDecorator(node.parent.parent)) {
|
||||
return getTypeParameterConstraintForPositionAcrossSignatures(
|
||||
getUninstantiatedSignatures(node.parent.parent),
|
||||
typeArgumentPosition,
|
||||
);
|
||||
}
|
||||
|
||||
if (isExpressionWithTypeArguments(node.parent) && isExpressionStatement(node.parent.parent)) {
|
||||
const uninstantiatedType = checkExpression(node.parent.expression);
|
||||
|
||||
const callConstraint = getTypeParameterConstraintForPositionAcrossSignatures(
|
||||
getSignaturesOfType(uninstantiatedType, SignatureKind.Call),
|
||||
typeArgumentPosition,
|
||||
);
|
||||
const constructConstraint = getTypeParameterConstraintForPositionAcrossSignatures(
|
||||
getSignaturesOfType(uninstantiatedType, SignatureKind.Construct),
|
||||
typeArgumentPosition,
|
||||
);
|
||||
|
||||
// An instantiation expression instantiates both call and construct signatures, so
|
||||
// if both exist type arguments must be assignable to both constraints.
|
||||
if (constructConstraint.flags & TypeFlags.Never) return callConstraint;
|
||||
if (callConstraint.flags & TypeFlags.Never) return constructConstraint;
|
||||
return getIntersectionType([callConstraint, constructConstraint]);
|
||||
}
|
||||
|
||||
if (isTypeReferenceType(node.parent)) {
|
||||
const typeParameters = getTypeParametersForTypeReferenceOrImport(node.parent);
|
||||
if (!typeParameters) return undefined;
|
||||
const relevantTypeParameter = typeParameters[typeArgumentPosition];
|
||||
const constraint = getConstraintOfTypeParameter(relevantTypeParameter);
|
||||
return constraint && instantiateType(
|
||||
constraint,
|
||||
createTypeMapper(typeParameters, getEffectiveTypeArguments(node.parent, typeParameters)),
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function checkTypeQuery(node: TypeQueryNode) {
|
||||
@@ -48516,7 +48604,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
|
||||
}
|
||||
}
|
||||
else if (noUncheckedSideEffectImports && !importClause) {
|
||||
void resolveExternalModuleName(node, node.moduleSpecifier);
|
||||
void resolveExternalModuleName(node, node.moduleSpecifier, /*ignoreErrors*/ undefined, Diagnostics.Cannot_find_module_or_type_declarations_for_side_effect_import_of_0);
|
||||
}
|
||||
}
|
||||
checkImportAttributes(node);
|
||||
|
||||
@@ -873,7 +873,7 @@ const commandOptionsWithoutBuild: CommandLineOption[] = [
|
||||
affectsProgramStructure: true,
|
||||
category: Diagnostics.Language_and_Environment,
|
||||
description: Diagnostics.Enable_lib_replacement,
|
||||
defaultValueDescription: true,
|
||||
defaultValueDescription: false,
|
||||
},
|
||||
|
||||
// Strict Type Checks
|
||||
@@ -1243,7 +1243,7 @@ const commandOptionsWithoutBuild: CommandLineOption[] = [
|
||||
affectsBuildInfo: true,
|
||||
category: Diagnostics.Modules,
|
||||
description: Diagnostics.Check_side_effect_imports,
|
||||
defaultValueDescription: false,
|
||||
defaultValueDescription: true,
|
||||
},
|
||||
|
||||
// Source Maps
|
||||
|
||||
@@ -1155,7 +1155,7 @@
|
||||
"category": "Error",
|
||||
"code": 1354
|
||||
},
|
||||
"A 'const' assertions can only be applied to references to enum members, or string, number, boolean, array, or object literals.": {
|
||||
"A 'const' assertion can only be applied to references to enum members, or string, number, boolean, array, or object literals.": {
|
||||
"category": "Error",
|
||||
"code": 1355
|
||||
},
|
||||
|
||||
@@ -4303,18 +4303,14 @@ export function createPrinter(printerOptions: PrinterOptions = {}, handlers: Pri
|
||||
}
|
||||
|
||||
function emitSyntheticTripleSlashReferencesIfNeeded(node: Bundle) {
|
||||
emitTripleSlashDirectives(!!node.hasNoDefaultLib, node.syntheticFileReferences || [], node.syntheticTypeReferences || [], node.syntheticLibReferences || []);
|
||||
emitTripleSlashDirectives(node.syntheticFileReferences || [], node.syntheticTypeReferences || [], node.syntheticLibReferences || []);
|
||||
}
|
||||
|
||||
function emitTripleSlashDirectivesIfNeeded(node: SourceFile) {
|
||||
if (node.isDeclarationFile) emitTripleSlashDirectives(node.hasNoDefaultLib, node.referencedFiles, node.typeReferenceDirectives, node.libReferenceDirectives);
|
||||
if (node.isDeclarationFile) emitTripleSlashDirectives(node.referencedFiles, node.typeReferenceDirectives, node.libReferenceDirectives);
|
||||
}
|
||||
|
||||
function emitTripleSlashDirectives(hasNoDefaultLib: boolean, files: readonly FileReference[], types: readonly FileReference[], libs: readonly FileReference[]) {
|
||||
if (hasNoDefaultLib) {
|
||||
writeComment(`/// <reference no-default-lib="true"/>`);
|
||||
writeLine();
|
||||
}
|
||||
function emitTripleSlashDirectives(files: readonly FileReference[], types: readonly FileReference[], libs: readonly FileReference[]) {
|
||||
if (currentSourceFile && currentSourceFile.moduleName) {
|
||||
writeComment(`/// <amd-module name="${currentSourceFile.moduleName}" />`);
|
||||
writeLine();
|
||||
|
||||
@@ -6181,16 +6181,15 @@ export function createNodeFactory(flags: NodeFactoryFlags, baseFactory: BaseNode
|
||||
isDeclarationFile = node.isDeclarationFile,
|
||||
referencedFiles = node.referencedFiles,
|
||||
typeReferenceDirectives = node.typeReferenceDirectives,
|
||||
hasNoDefaultLib = node.hasNoDefaultLib,
|
||||
_hasNoDefaultLib = false,
|
||||
libReferenceDirectives = node.libReferenceDirectives,
|
||||
) {
|
||||
return node.statements !== statements
|
||||
|| node.isDeclarationFile !== isDeclarationFile
|
||||
|| node.referencedFiles !== referencedFiles
|
||||
|| node.typeReferenceDirectives !== typeReferenceDirectives
|
||||
|| node.hasNoDefaultLib !== hasNoDefaultLib
|
||||
|| node.libReferenceDirectives !== libReferenceDirectives
|
||||
? update(cloneSourceFileWithChanges(node, statements, isDeclarationFile, referencedFiles, typeReferenceDirectives, hasNoDefaultLib, libReferenceDirectives), node)
|
||||
? update(cloneSourceFileWithChanges(node, statements, isDeclarationFile, referencedFiles, typeReferenceDirectives, /*hasNoDefaultLib*/ false, libReferenceDirectives), node)
|
||||
: node;
|
||||
}
|
||||
|
||||
@@ -6201,7 +6200,6 @@ export function createNodeFactory(flags: NodeFactoryFlags, baseFactory: BaseNode
|
||||
node.syntheticFileReferences = undefined;
|
||||
node.syntheticTypeReferences = undefined;
|
||||
node.syntheticLibReferences = undefined;
|
||||
node.hasNoDefaultLib = undefined;
|
||||
return node;
|
||||
}
|
||||
|
||||
|
||||
@@ -112,6 +112,16 @@ export function createParenthesizerRules(factory: NodeFactory): ParenthesizerRul
|
||||
return parenthesizerRule;
|
||||
}
|
||||
|
||||
function mixingBinaryOperatorsRequiresParentheses(a: SyntaxKind, b: SyntaxKind) {
|
||||
if (a === SyntaxKind.QuestionQuestionToken) {
|
||||
return b === SyntaxKind.AmpersandAmpersandToken || b === SyntaxKind.BarBarToken;
|
||||
}
|
||||
if (b === SyntaxKind.QuestionQuestionToken) {
|
||||
return a === SyntaxKind.AmpersandAmpersandToken || a === SyntaxKind.BarBarToken;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Determines whether the operand to a BinaryExpression needs to be parenthesized.
|
||||
*
|
||||
@@ -121,6 +131,10 @@ export function createParenthesizerRules(factory: NodeFactory): ParenthesizerRul
|
||||
* BinaryExpression.
|
||||
*/
|
||||
function binaryOperandNeedsParentheses(binaryOperator: SyntaxKind, operand: Expression, isLeftSideOfBinary: boolean, leftOperand: Expression | undefined) {
|
||||
const emittedOperand = skipPartiallyEmittedExpressions(operand);
|
||||
if (isBinaryExpression(emittedOperand) && mixingBinaryOperatorsRequiresParentheses(binaryOperator, emittedOperand.operatorToken.kind)) {
|
||||
return true;
|
||||
}
|
||||
// If the operand has lower precedence, then it needs to be parenthesized to preserve the
|
||||
// intent of the expression. For example, if the operand is `a + b` and the operator is
|
||||
// `*`, then we need to parenthesize the operand to preserve the intended order of
|
||||
@@ -140,7 +154,6 @@ export function createParenthesizerRules(factory: NodeFactory): ParenthesizerRul
|
||||
// the intended order of operations: `(a ** b) ** c`
|
||||
const binaryOperatorPrecedence = getOperatorPrecedence(SyntaxKind.BinaryExpression, binaryOperator);
|
||||
const binaryOperatorAssociativity = getOperatorAssociativity(SyntaxKind.BinaryExpression, binaryOperator);
|
||||
const emittedOperand = skipPartiallyEmittedExpressions(operand);
|
||||
if (!isLeftSideOfBinary && operand.kind === SyntaxKind.ArrowFunction && binaryOperatorPrecedence > OperatorPrecedence.Assignment) {
|
||||
// We need to parenthesize arrow functions on the right side to avoid it being
|
||||
// parsed as parenthesized expression: `a && (() => {})`
|
||||
|
||||
@@ -2812,7 +2812,9 @@ function getLoadModuleFromTargetExportOrImport(extensions: Extensions, state: Mo
|
||||
const subTarget = (target as MapLike<unknown>)[condition];
|
||||
const result = loadModuleFromTargetExportOrImport(subTarget, subpath, pattern, key);
|
||||
if (result) {
|
||||
traceIfEnabled(state, Diagnostics.Resolved_under_condition_0, condition);
|
||||
if (result.value) {
|
||||
traceIfEnabled(state, Diagnostics.Resolved_under_condition_0, condition);
|
||||
}
|
||||
traceIfEnabled(state, Diagnostics.Exiting_conditional_exports);
|
||||
return result;
|
||||
}
|
||||
@@ -2846,7 +2848,7 @@ function getLoadModuleFromTargetExportOrImport(extensions: Extensions, state: Mo
|
||||
if (state.traceEnabled) {
|
||||
trace(state.host, Diagnostics.package_json_scope_0_explicitly_maps_specifier_1_to_null, scope.packageDirectory, moduleName);
|
||||
}
|
||||
return toSearchResult(/*value*/ undefined);
|
||||
return { value: undefined };
|
||||
}
|
||||
if (state.traceEnabled) {
|
||||
trace(state.host, Diagnostics.package_json_scope_0_has_invalid_type_for_target_of_specifier_1, scope.packageDirectory, moduleName);
|
||||
|
||||
@@ -10617,7 +10617,6 @@ export function processPragmasIntoFields(context: PragmaContext, reportDiagnosti
|
||||
context.typeReferenceDirectives = [];
|
||||
context.libReferenceDirectives = [];
|
||||
context.amdDependencies = [];
|
||||
context.hasNoDefaultLib = false;
|
||||
context.pragmas!.forEach((entryOrList, key) => { // TODO: GH#18217
|
||||
// TODO: The below should be strongly type-guarded and not need casts/explicit annotations, since entryOrList is related to
|
||||
// key and key is constrained to a union; but it's not (see GH#21483 for at least partial fix) :(
|
||||
@@ -10630,7 +10629,7 @@ export function processPragmasIntoFields(context: PragmaContext, reportDiagnosti
|
||||
const { types, lib, path, ["resolution-mode"]: res, preserve: _preserve } = arg.arguments;
|
||||
const preserve = _preserve === "true" ? true : undefined;
|
||||
if (arg.arguments["no-default-lib"] === "true") {
|
||||
context.hasNoDefaultLib = true;
|
||||
// This has been removed; parse but ignore it.
|
||||
}
|
||||
else if (types) {
|
||||
const parsed = parseResolutionMode(res, types.pos, types.end, reportDiagnostic);
|
||||
|
||||
+44
-72
@@ -71,8 +71,6 @@ import {
|
||||
EmitResult,
|
||||
emptyArray,
|
||||
ensureTrailingDirectorySeparator,
|
||||
equateStringsCaseInsensitive,
|
||||
equateStringsCaseSensitive,
|
||||
exclusivelyPrefixedNodeCoreModules,
|
||||
ExportAssignment,
|
||||
ExportDeclaration,
|
||||
@@ -1578,7 +1576,6 @@ export function createProgram(_rootNamesOrOptions: readonly string[] | CreatePro
|
||||
const host = createProgramOptionsHost || createCompilerHost(options);
|
||||
const configParsingHost = parseConfigHostFromCompilerHostLike(host);
|
||||
|
||||
let skipDefaultLib = options.noLib;
|
||||
const getDefaultLibraryFileName = memoize(() => host.getDefaultLibFileName(options));
|
||||
const defaultLibraryPath = host.getDefaultLibLocation ? host.getDefaultLibLocation() : getDirectoryPath(getDefaultLibraryFileName());
|
||||
|
||||
@@ -1709,6 +1706,7 @@ export function createProgram(_rootNamesOrOptions: readonly string[] | CreatePro
|
||||
* - undefined otherwise
|
||||
*/
|
||||
const filesByName = new Map<Path, SourceFile | false | undefined>();
|
||||
const libFiles = new Set<Path>();
|
||||
let missingFileNames = new Map<Path, string>();
|
||||
// stores 'filename -> file association' ignoring case
|
||||
// used to track cases when two file names differ only in casing
|
||||
@@ -1780,7 +1778,7 @@ export function createProgram(_rootNamesOrOptions: readonly string[] | CreatePro
|
||||
}
|
||||
|
||||
tracing?.push(tracing.Phase.Program, "processRootFiles", { count: rootNames.length });
|
||||
forEach(rootNames, (name, index) => processRootFile(name, /*isDefaultLib*/ false, /*ignoreNoDefaultLib*/ false, { kind: FileIncludeKind.RootFile, index }));
|
||||
forEach(rootNames, (name, index) => processRootFile(name, /*isDefaultLib*/ false, { kind: FileIncludeKind.RootFile, index }));
|
||||
tracing?.pop();
|
||||
|
||||
// load type declarations specified via 'types' argument or implicitly from types/ and node_modules/@types folders
|
||||
@@ -1809,20 +1807,17 @@ export function createProgram(_rootNamesOrOptions: readonly string[] | CreatePro
|
||||
tracing?.pop();
|
||||
}
|
||||
|
||||
// Do not process the default library if:
|
||||
// - The '--noLib' flag is used.
|
||||
// - A 'no-default-lib' reference comment is encountered in
|
||||
// processing the root files.
|
||||
if (rootNames.length && !skipDefaultLib) {
|
||||
if (rootNames.length && !options.noLib) {
|
||||
// If '--lib' is not specified, include default library file according to '--target'
|
||||
// otherwise, using options specified in '--lib' instead of '--target' default library file
|
||||
const defaultLibraryFileName = getDefaultLibraryFileName();
|
||||
if (!options.lib && defaultLibraryFileName) {
|
||||
processRootFile(defaultLibraryFileName, /*isDefaultLib*/ true, /*ignoreNoDefaultLib*/ false, { kind: FileIncludeKind.LibFile });
|
||||
libFiles.add(toPath(defaultLibraryFileName));
|
||||
processRootFile(defaultLibraryFileName, /*isDefaultLib*/ true, { kind: FileIncludeKind.LibFile });
|
||||
}
|
||||
else {
|
||||
forEach(options.lib, (libFileName, index) => {
|
||||
processRootFile(pathForLibFile(libFileName), /*isDefaultLib*/ true, /*ignoreNoDefaultLib*/ false, { kind: FileIncludeKind.LibFile, index });
|
||||
processRootFile(pathForLibFile(libFileName), /*isDefaultLib*/ true, { kind: FileIncludeKind.LibFile, index });
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -2454,11 +2449,6 @@ export function createProgram(_rootNamesOrOptions: readonly string[] | CreatePro
|
||||
// 'lib' references has changed. Matches behavior in changesAffectModuleResolution
|
||||
structureIsReused = StructureIsReused.SafeModules;
|
||||
}
|
||||
else if (oldSourceFile.hasNoDefaultLib !== newSourceFile.hasNoDefaultLib) {
|
||||
// value of no-default-lib has changed
|
||||
// this will affect if default library is injected into the list of files
|
||||
structureIsReused = StructureIsReused.SafeModules;
|
||||
}
|
||||
// check tripleslash references
|
||||
else if (!arrayIsEqualTo(oldSourceFile.referencedFiles, newSourceFile.referencedFiles, fileReferenceIsEqualTo)) {
|
||||
// tripleslash references has changed
|
||||
@@ -2684,31 +2674,7 @@ export function createProgram(_rootNamesOrOptions: readonly string[] | CreatePro
|
||||
}
|
||||
|
||||
function isSourceFileDefaultLibrary(file: SourceFile): boolean {
|
||||
if (!file.isDeclarationFile) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (file.hasNoDefaultLib) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (options.noLib) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// If '--lib' is not specified, include default library file according to '--target'
|
||||
// otherwise, using options specified in '--lib' instead of '--target' default library file
|
||||
const equalityComparer = host.useCaseSensitiveFileNames() ? equateStringsCaseSensitive : equateStringsCaseInsensitive;
|
||||
if (!options.lib) {
|
||||
return equalityComparer(file.fileName, getDefaultLibraryFileName());
|
||||
}
|
||||
else {
|
||||
return some(options.lib, libFileName => {
|
||||
// We might not have resolved lib if one of the root file included contained no-default-lib = true
|
||||
const resolvedLib = resolvedLibReferences!.get(libFileName);
|
||||
return !!resolvedLib && equalityComparer(file.fileName, resolvedLib.actual);
|
||||
});
|
||||
}
|
||||
return libFiles.has(file.path);
|
||||
}
|
||||
|
||||
function getTypeChecker() {
|
||||
@@ -3318,8 +3284,8 @@ export function createProgram(_rootNamesOrOptions: readonly string[] | CreatePro
|
||||
return configFileParsingDiagnostics || emptyArray;
|
||||
}
|
||||
|
||||
function processRootFile(fileName: string, isDefaultLib: boolean, ignoreNoDefaultLib: boolean, reason: FileIncludeReason) {
|
||||
processSourceFile(normalizePath(fileName), isDefaultLib, ignoreNoDefaultLib, /*packageId*/ undefined, reason);
|
||||
function processRootFile(fileName: string, isDefaultLib: boolean, reason: FileIncludeReason) {
|
||||
processSourceFile(normalizePath(fileName), isDefaultLib, /*packageId*/ undefined, reason);
|
||||
}
|
||||
|
||||
function fileReferenceIsEqualTo(a: FileReference, b: FileReference): boolean {
|
||||
@@ -3513,17 +3479,17 @@ export function createProgram(_rootNamesOrOptions: readonly string[] | CreatePro
|
||||
}
|
||||
|
||||
/** This has side effects through `findSourceFile`. */
|
||||
function processSourceFile(fileName: string, isDefaultLib: boolean, ignoreNoDefaultLib: boolean, packageId: PackageId | undefined, reason: FileIncludeReason): void {
|
||||
function processSourceFile(fileName: string, isDefaultLib: boolean, packageId: PackageId | undefined, reason: FileIncludeReason): void {
|
||||
getSourceFileFromReferenceWorker(
|
||||
fileName,
|
||||
fileName => findSourceFile(fileName, isDefaultLib, ignoreNoDefaultLib, reason, packageId), // TODO: GH#18217
|
||||
fileName => findSourceFile(fileName, isDefaultLib, reason, packageId), // TODO: GH#18217
|
||||
(diagnostic, ...args) => addFilePreprocessingFileExplainingDiagnostic(/*file*/ undefined, reason, diagnostic, args),
|
||||
reason,
|
||||
);
|
||||
}
|
||||
|
||||
function processProjectReferenceFile(fileName: string, reason: ProjectReferenceFile) {
|
||||
return processSourceFile(fileName, /*isDefaultLib*/ false, /*ignoreNoDefaultLib*/ false, /*packageId*/ undefined, reason);
|
||||
return processSourceFile(fileName, /*isDefaultLib*/ false, /*packageId*/ undefined, reason);
|
||||
}
|
||||
|
||||
function reportFileNamesDifferOnlyInCasingError(fileName: string, existingFile: SourceFile, reason: FileIncludeReason): void {
|
||||
@@ -3549,13 +3515,13 @@ export function createProgram(_rootNamesOrOptions: readonly string[] | CreatePro
|
||||
}
|
||||
|
||||
// Get source file from normalized fileName
|
||||
function findSourceFile(fileName: string, isDefaultLib: boolean, ignoreNoDefaultLib: boolean, reason: FileIncludeReason, packageId: PackageId | undefined): SourceFile | undefined {
|
||||
function findSourceFile(fileName: string, isDefaultLib: boolean, reason: FileIncludeReason, packageId: PackageId | undefined): SourceFile | undefined {
|
||||
tracing?.push(tracing.Phase.Program, "findSourceFile", {
|
||||
fileName,
|
||||
isDefaultLib: isDefaultLib || undefined,
|
||||
fileIncludeKind: (FileIncludeKind as any)[reason.kind],
|
||||
});
|
||||
const result = findSourceFileWorker(fileName, isDefaultLib, ignoreNoDefaultLib, reason, packageId);
|
||||
const result = findSourceFileWorker(fileName, isDefaultLib, reason, packageId);
|
||||
tracing?.pop();
|
||||
return result;
|
||||
}
|
||||
@@ -3572,7 +3538,7 @@ export function createProgram(_rootNamesOrOptions: readonly string[] | CreatePro
|
||||
{ languageVersion, impliedNodeFormat: result, setExternalModuleIndicator, jsDocParsingMode: host.jsDocParsingMode };
|
||||
}
|
||||
|
||||
function findSourceFileWorker(fileName: string, isDefaultLib: boolean, ignoreNoDefaultLib: boolean, reason: FileIncludeReason, packageId: PackageId | undefined): SourceFile | undefined {
|
||||
function findSourceFileWorker(fileName: string, isDefaultLib: boolean, reason: FileIncludeReason, packageId: PackageId | undefined): SourceFile | undefined {
|
||||
const path = toPath(fileName);
|
||||
if (useSourceOfProjectReferenceRedirect) {
|
||||
let source = getRedirectFromOutput(path);
|
||||
@@ -3591,7 +3557,7 @@ export function createProgram(_rootNamesOrOptions: readonly string[] | CreatePro
|
||||
if (realPath !== path) source = getRedirectFromOutput(realPath);
|
||||
}
|
||||
if (source?.source) {
|
||||
const file = findSourceFile(source.source, isDefaultLib, ignoreNoDefaultLib, reason, packageId);
|
||||
const file = findSourceFile(source.source, isDefaultLib, reason, packageId);
|
||||
if (file) addFileToFilesByName(file, path, fileName, /*redirectedPath*/ undefined);
|
||||
return file;
|
||||
}
|
||||
@@ -3713,8 +3679,6 @@ export function createProgram(_rootNamesOrOptions: readonly string[] | CreatePro
|
||||
}
|
||||
}
|
||||
|
||||
skipDefaultLib = skipDefaultLib || (file.hasNoDefaultLib && !ignoreNoDefaultLib);
|
||||
|
||||
if (!options.noResolve) {
|
||||
processReferencedFiles(file, isDefaultLib);
|
||||
processTypeReferenceDirectives(file);
|
||||
@@ -3794,7 +3758,6 @@ export function createProgram(_rootNamesOrOptions: readonly string[] | CreatePro
|
||||
processSourceFile(
|
||||
resolveTripleslashReference(ref.fileName, file.fileName),
|
||||
isDefaultLib,
|
||||
/*ignoreNoDefaultLib*/ false,
|
||||
/*packageId*/ undefined,
|
||||
{ kind: FileIncludeKind.ReferenceFile, file: file.path, index },
|
||||
);
|
||||
@@ -3847,7 +3810,7 @@ export function createProgram(_rootNamesOrOptions: readonly string[] | CreatePro
|
||||
if (resolvedTypeReferenceDirective.isExternalLibraryImport) currentNodeModulesDepth++;
|
||||
|
||||
// resolved from the primary path
|
||||
processSourceFile(resolvedTypeReferenceDirective.resolvedFileName!, /*isDefaultLib*/ false, /*ignoreNoDefaultLib*/ false, resolvedTypeReferenceDirective.packageId, reason); // TODO: GH#18217
|
||||
processSourceFile(resolvedTypeReferenceDirective.resolvedFileName!, /*isDefaultLib*/ false, resolvedTypeReferenceDirective.packageId, reason); // TODO: GH#18217
|
||||
|
||||
if (resolvedTypeReferenceDirective.isExternalLibraryImport) currentNodeModulesDepth--;
|
||||
}
|
||||
@@ -3861,6 +3824,7 @@ export function createProgram(_rootNamesOrOptions: readonly string[] | CreatePro
|
||||
if (existing) return existing.actual;
|
||||
const result = pathForLibFileWorker(libFileName);
|
||||
(resolvedLibReferences ??= new Map()).set(libFileName, result);
|
||||
libFiles.add(toPath(result.actual));
|
||||
return result.actual;
|
||||
}
|
||||
|
||||
@@ -3868,7 +3832,7 @@ export function createProgram(_rootNamesOrOptions: readonly string[] | CreatePro
|
||||
const existing = resolvedLibProcessing?.get(libFileName);
|
||||
if (existing) return existing;
|
||||
|
||||
if (options.libReplacement === false) {
|
||||
if (!options.libReplacement) {
|
||||
const result: LibResolution = {
|
||||
resolution: {
|
||||
resolvedModule: undefined,
|
||||
@@ -3925,8 +3889,7 @@ export function createProgram(_rootNamesOrOptions: readonly string[] | CreatePro
|
||||
forEach(file.libReferenceDirectives, (libReference, index) => {
|
||||
const libFileName = getLibFileNameFromLibReference(libReference);
|
||||
if (libFileName) {
|
||||
// we ignore any 'no-default-lib' reference set on this file.
|
||||
processRootFile(pathForLibFile(libFileName), /*isDefaultLib*/ true, /*ignoreNoDefaultLib*/ true, { kind: FileIncludeKind.LibReferenceDirective, file: file.path, index });
|
||||
processRootFile(pathForLibFile(libFileName), /*isDefaultLib*/ true, { kind: FileIncludeKind.LibReferenceDirective, file: file.path, index });
|
||||
}
|
||||
else {
|
||||
programDiagnostics.addFileProcessingDiagnostic({
|
||||
@@ -3996,7 +3959,6 @@ export function createProgram(_rootNamesOrOptions: readonly string[] | CreatePro
|
||||
findSourceFile(
|
||||
resolvedFileName,
|
||||
/*isDefaultLib*/ false,
|
||||
/*ignoreNoDefaultLib*/ false,
|
||||
{ kind: FileIncludeKind.Import, file: file.path, index },
|
||||
resolution.packageId,
|
||||
);
|
||||
@@ -4084,10 +4046,9 @@ export function createProgram(_rootNamesOrOptions: readonly string[] | CreatePro
|
||||
}
|
||||
const getCommonSourceDirectory = memoize(() => getCommonSourceDirectoryOfConfig(resolvedRef.commandLine, !host.useCaseSensitiveFileNames()));
|
||||
commandLine.fileNames.forEach(fileName => {
|
||||
if (isDeclarationFileName(fileName)) return;
|
||||
const path = toPath(fileName);
|
||||
let outputDts;
|
||||
if (!fileExtensionIs(fileName, Extension.Json)) {
|
||||
if (!isDeclarationFileName(fileName) && !fileExtensionIs(fileName, Extension.Json)) {
|
||||
if (!commandLine.options.outFile) {
|
||||
outputDts = getOutputDeclarationFileName(fileName, resolvedRef.commandLine, !host.useCaseSensitiveFileNames(), getCommonSourceDirectory);
|
||||
mapOutputFileToResolvedRef!.set(toPath(outputDts), { resolvedRef, source: fileName });
|
||||
@@ -4469,8 +4430,8 @@ export function createProgram(_rootNamesOrOptions: readonly string[] | CreatePro
|
||||
function checkDeprecations(
|
||||
deprecatedIn: string,
|
||||
removedIn: string,
|
||||
createDiagnostic: (name: string, value: string | undefined, useInstead: string | undefined, message: DiagnosticMessage, ...args: DiagnosticArguments) => void,
|
||||
fn: (createDeprecatedDiagnostic: (name: string, value?: string, useInstead?: string) => void) => void,
|
||||
createDiagnostic: (name: string, value: string | undefined, useInstead: string | undefined, related: DiagnosticMessage | undefined, message: DiagnosticMessage, ...args: DiagnosticArguments) => void,
|
||||
fn: (createDeprecatedDiagnostic: (name: string, value?: string, useInstead?: string, related?: DiagnosticMessage) => void) => void,
|
||||
) {
|
||||
const deprecatedInVersion = new Version(deprecatedIn);
|
||||
const removedInVersion = new Version(removedIn);
|
||||
@@ -4481,21 +4442,21 @@ export function createProgram(_rootNamesOrOptions: readonly string[] | CreatePro
|
||||
const canBeSilenced = !mustBeRemoved && ignoreDeprecationsVersion.compareTo(deprecatedInVersion) === Comparison.LessThan;
|
||||
|
||||
if (mustBeRemoved || canBeSilenced) {
|
||||
fn((name, value, useInstead) => {
|
||||
fn((name, value, useInstead, related) => {
|
||||
if (mustBeRemoved) {
|
||||
if (value === undefined) {
|
||||
createDiagnostic(name, value, useInstead, Diagnostics.Option_0_has_been_removed_Please_remove_it_from_your_configuration, name);
|
||||
createDiagnostic(name, value, useInstead, related, Diagnostics.Option_0_has_been_removed_Please_remove_it_from_your_configuration, name);
|
||||
}
|
||||
else {
|
||||
createDiagnostic(name, value, useInstead, Diagnostics.Option_0_1_has_been_removed_Please_remove_it_from_your_configuration, name, value);
|
||||
createDiagnostic(name, value, useInstead, related, Diagnostics.Option_0_1_has_been_removed_Please_remove_it_from_your_configuration, name, value);
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (value === undefined) {
|
||||
createDiagnostic(name, value, useInstead, Diagnostics.Option_0_is_deprecated_and_will_stop_functioning_in_TypeScript_1_Specify_compilerOption_ignoreDeprecations_Colon_2_to_silence_this_error, name, removedIn, deprecatedIn);
|
||||
createDiagnostic(name, value, useInstead, related, Diagnostics.Option_0_is_deprecated_and_will_stop_functioning_in_TypeScript_1_Specify_compilerOption_ignoreDeprecations_Colon_2_to_silence_this_error, name, removedIn, deprecatedIn);
|
||||
}
|
||||
else {
|
||||
createDiagnostic(name, value, useInstead, Diagnostics.Option_0_1_is_deprecated_and_will_stop_functioning_in_TypeScript_2_Specify_compilerOption_ignoreDeprecations_Colon_3_to_silence_this_error, name, value, removedIn, deprecatedIn);
|
||||
createDiagnostic(name, value, useInstead, related, Diagnostics.Option_0_1_is_deprecated_and_will_stop_functioning_in_TypeScript_2_Specify_compilerOption_ignoreDeprecations_Colon_3_to_silence_this_error, name, value, removedIn, deprecatedIn);
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -4503,14 +4464,22 @@ export function createProgram(_rootNamesOrOptions: readonly string[] | CreatePro
|
||||
}
|
||||
|
||||
function verifyDeprecatedCompilerOptions() {
|
||||
function createDiagnostic(name: string, value: string | undefined, useInstead: string | undefined, message: DiagnosticMessage, ...args: DiagnosticArguments) {
|
||||
function createDiagnostic(name: string, value: string | undefined, useInstead: string | undefined, related: DiagnosticMessage | undefined, message: DiagnosticMessage, ...args: DiagnosticArguments) {
|
||||
if (useInstead) {
|
||||
const details = chainDiagnosticMessages(/*details*/ undefined, Diagnostics.Use_0_instead, useInstead);
|
||||
let details = chainDiagnosticMessages(/*details*/ undefined, Diagnostics.Use_0_instead, useInstead);
|
||||
if (related) {
|
||||
details = chainDiagnosticMessages(details, related);
|
||||
}
|
||||
const chain = chainDiagnosticMessages(details, message, ...args);
|
||||
createDiagnosticForOption(/*onKey*/ !value, name, /*option2*/ undefined, chain);
|
||||
}
|
||||
else {
|
||||
createDiagnosticForOption(/*onKey*/ !value, name, /*option2*/ undefined, message, ...args);
|
||||
let details: DiagnosticMessageChain | undefined;
|
||||
if (related) {
|
||||
details = chainDiagnosticMessages(/*details*/ undefined, related);
|
||||
}
|
||||
const chain = chainDiagnosticMessages(details, message, ...args);
|
||||
createDiagnosticForOption(/*onKey*/ !value, name, /*option2*/ undefined, chain);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4549,13 +4518,16 @@ export function createProgram(_rootNamesOrOptions: readonly string[] | CreatePro
|
||||
|
||||
checkDeprecations("6.0", "7.0", createDiagnostic, createDeprecatedDiagnostic => {
|
||||
if (options.moduleResolution === ModuleResolutionKind.Node10) {
|
||||
createDeprecatedDiagnostic("moduleResolution", "node10");
|
||||
createDeprecatedDiagnostic("moduleResolution", "node10", /*useInstead*/ undefined, Diagnostics.Visit_https_Colon_Slash_Slashaka_ms_Slashts6_for_migration_information);
|
||||
}
|
||||
if (options.baseUrl !== undefined) {
|
||||
createDeprecatedDiagnostic("baseUrl", /*value*/ undefined, /*useInstead*/ undefined, Diagnostics.Visit_https_Colon_Slash_Slashaka_ms_Slashts6_for_migration_information);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function verifyDeprecatedProjectReference(ref: ProjectReference, parentFile: JsonSourceFile | undefined, index: number) {
|
||||
function createDiagnostic(_name: string, _value: string | undefined, _useInstead: string | undefined, message: DiagnosticMessage, ...args: DiagnosticArguments) {
|
||||
function createDiagnostic(_name: string, _value: string | undefined, _useInstead: string | undefined, _related: DiagnosticMessage | undefined, message: DiagnosticMessage, ...args: DiagnosticArguments) {
|
||||
createDiagnosticForReference(parentFile, index, message, ...args);
|
||||
}
|
||||
|
||||
|
||||
@@ -462,11 +462,9 @@ export function transformDeclarations(context: TransformationContext): Transform
|
||||
rawReferencedFiles = [];
|
||||
rawTypeReferenceDirectives = [];
|
||||
rawLibReferenceDirectives = [];
|
||||
let hasNoDefaultLib = false;
|
||||
const bundle = factory.createBundle(
|
||||
map(node.sourceFiles, sourceFile => {
|
||||
if (sourceFile.isDeclarationFile) return undefined!; // Omit declaration files from bundle results, too // TODO: GH#18217
|
||||
hasNoDefaultLib = hasNoDefaultLib || sourceFile.hasNoDefaultLib;
|
||||
currentSourceFile = sourceFile;
|
||||
enclosingDeclaration = sourceFile;
|
||||
lateMarkedStatements = undefined;
|
||||
@@ -504,7 +502,6 @@ export function transformDeclarations(context: TransformationContext): Transform
|
||||
bundle.syntheticFileReferences = getReferencedFiles(outputFilePath);
|
||||
bundle.syntheticTypeReferences = getTypeReferences();
|
||||
bundle.syntheticLibReferences = getLibReferences();
|
||||
bundle.hasNoDefaultLib = hasNoDefaultLib;
|
||||
return bundle;
|
||||
}
|
||||
|
||||
@@ -536,7 +533,7 @@ export function transformDeclarations(context: TransformationContext): Transform
|
||||
}
|
||||
}
|
||||
const outputFilePath = getDirectoryPath(normalizeSlashes(getOutputPathsFor(node, host, /*forceDtsPaths*/ true).declarationFilePath!));
|
||||
return factory.updateSourceFile(node, combinedStatements, /*isDeclarationFile*/ true, getReferencedFiles(outputFilePath), getTypeReferences(), node.hasNoDefaultLib, getLibReferences());
|
||||
return factory.updateSourceFile(node, combinedStatements, /*isDeclarationFile*/ true, getReferencedFiles(outputFilePath), getTypeReferences(), /*hasNoDefaultLib*/ false, getLibReferences());
|
||||
|
||||
function collectFileReferences(sourceFile: SourceFile) {
|
||||
rawReferencedFiles = concatenate(rawReferencedFiles, map(sourceFile.referencedFiles, f => [sourceFile, f]));
|
||||
|
||||
+2
-11
@@ -4288,7 +4288,6 @@ export interface SourceFileLike {
|
||||
lineMap?: readonly number[];
|
||||
/** @internal */
|
||||
getPositionOfLineAndCharacter?(line: number, character: number, allowEdits?: true): number;
|
||||
languageVariant?: LanguageVariant;
|
||||
}
|
||||
|
||||
/** @internal */
|
||||
@@ -4363,14 +4362,7 @@ export interface SourceFile extends Declaration, LocalsContainer {
|
||||
/** @internal */
|
||||
renamedDependencies?: ReadonlyMap<string, string>;
|
||||
|
||||
/**
|
||||
* lib.d.ts should have a reference comment like
|
||||
*
|
||||
* /// <reference no-default-lib="true"/>
|
||||
*
|
||||
* If any other file has this comment, it signals not to include lib.d.ts
|
||||
* because this containing file is intended to act as a default library.
|
||||
*/
|
||||
/** @deprecated Always false. Use a Program to determine if a file is a lib file. */
|
||||
hasNoDefaultLib: boolean;
|
||||
|
||||
languageVersion: ScriptTarget;
|
||||
@@ -4471,7 +4463,6 @@ export interface ReadonlyPragmaContext {
|
||||
typeReferenceDirectives: readonly FileReference[];
|
||||
libReferenceDirectives: readonly FileReference[];
|
||||
amdDependencies: readonly AmdDependency[];
|
||||
hasNoDefaultLib?: boolean;
|
||||
moduleName?: string;
|
||||
}
|
||||
|
||||
@@ -4505,7 +4496,6 @@ export interface Bundle extends Node {
|
||||
/** @internal */ syntheticFileReferences?: readonly FileReference[];
|
||||
/** @internal */ syntheticTypeReferences?: readonly FileReference[];
|
||||
/** @internal */ syntheticLibReferences?: readonly FileReference[];
|
||||
/** @internal */ hasNoDefaultLib?: boolean;
|
||||
}
|
||||
|
||||
export interface JsonSourceFile extends SourceFile {
|
||||
@@ -7410,6 +7400,7 @@ export interface CompilerOptions {
|
||||
allowUnreachableCode?: boolean;
|
||||
allowUnusedLabels?: boolean;
|
||||
alwaysStrict?: boolean; // Always combine with strict property
|
||||
/** @deprecated */
|
||||
baseUrl?: string;
|
||||
/**
|
||||
* An error if set - this should only go through the -b pipeline and not actually be observed
|
||||
|
||||
@@ -10339,6 +10339,7 @@ export function rangeOfTypeParameters(sourceFile: SourceFile, typeParameters: No
|
||||
/** @internal */
|
||||
export interface HostWithIsSourceOfProjectReferenceRedirect {
|
||||
isSourceOfProjectReferenceRedirect(fileName: string): boolean;
|
||||
isSourceFileDefaultLibrary(file: SourceFile): boolean;
|
||||
}
|
||||
/** @internal */
|
||||
export function skipTypeChecking(
|
||||
@@ -10365,10 +10366,9 @@ function skipTypeCheckingWorker(
|
||||
ignoreNoCheck: boolean,
|
||||
) {
|
||||
// If skipLibCheck is enabled, skip reporting errors if file is a declaration file.
|
||||
// If skipDefaultLibCheck is enabled, skip reporting errors if file contains a
|
||||
// '/// <reference no-default-lib="true"/>' directive.
|
||||
// If skipDefaultLibCheck is enabled, skip reporting errors if file is a lib.
|
||||
return (options.skipLibCheck && sourceFile.isDeclarationFile ||
|
||||
options.skipDefaultLibCheck && sourceFile.hasNoDefaultLib) ||
|
||||
options.skipDefaultLibCheck && host.isSourceFileDefaultLibrary(sourceFile)) ||
|
||||
(!ignoreNoCheck && options.noCheck) ||
|
||||
host.isSourceOfProjectReferenceRedirect(sourceFile.fileName) ||
|
||||
!canIncludeBindAndCheckDiagnostics(sourceFile, options);
|
||||
|
||||
@@ -423,26 +423,23 @@ export class TestState {
|
||||
this.addMatchedInputFile(importedFilePath, exts);
|
||||
});
|
||||
|
||||
// Check if no-default-lib flag is false and if so add default library
|
||||
if (!resolvedResult.isLibFile) {
|
||||
this.languageServiceAdapterHost.addScript(
|
||||
libName(Harness.Compiler.defaultLibFileName),
|
||||
Harness.Compiler.getDefaultLibrarySourceFile()!.text,
|
||||
/*isRootFile*/ false,
|
||||
);
|
||||
this.languageServiceAdapterHost.addScript(
|
||||
libName(Harness.Compiler.defaultLibFileName),
|
||||
Harness.Compiler.getDefaultLibrarySourceFile()!.text,
|
||||
/*isRootFile*/ false,
|
||||
);
|
||||
|
||||
compilationOptions.lib?.forEach(fileName => {
|
||||
const libFile = Harness.Compiler.getDefaultLibrarySourceFile(fileName);
|
||||
ts.Debug.assertIsDefined(libFile, `Could not find lib file '${fileName}'`);
|
||||
if (libFile) {
|
||||
this.languageServiceAdapterHost.addScript(
|
||||
libName(fileName),
|
||||
libFile.text,
|
||||
/*isRootFile*/ false,
|
||||
);
|
||||
}
|
||||
});
|
||||
}
|
||||
compilationOptions.lib?.forEach(fileName => {
|
||||
const libFile = Harness.Compiler.getDefaultLibrarySourceFile(fileName);
|
||||
ts.Debug.assertIsDefined(libFile, `Could not find lib file '${fileName}'`);
|
||||
if (libFile) {
|
||||
this.languageServiceAdapterHost.addScript(
|
||||
libName(fileName),
|
||||
libFile.text,
|
||||
/*isRootFile*/ false,
|
||||
);
|
||||
}
|
||||
});
|
||||
}
|
||||
else {
|
||||
// resolveReference file-option is not specified then do not resolve any files and include all inputFiles
|
||||
|
||||
@@ -233,7 +233,7 @@ export namespace Compiler {
|
||||
export const es2015DefaultLibFileName = "lib.es2015.d.ts";
|
||||
|
||||
// Cache of lib files from "built/local"
|
||||
export let libFileNameSourceFileMap: Map<string, ts.SourceFile> | undefined;
|
||||
export let libFileNameSourceFileMap: Map<string, { file: ts.SourceFile; stringified: string; }> | undefined;
|
||||
|
||||
export function getDefaultLibrarySourceFile(fileName: string = defaultLibFileName): ts.SourceFile | undefined {
|
||||
if (!isDefaultLibraryFile(fileName)) {
|
||||
@@ -241,16 +241,19 @@ export namespace Compiler {
|
||||
}
|
||||
|
||||
if (!libFileNameSourceFileMap) {
|
||||
const file = createSourceFileAndAssertInvariants(defaultLibFileName, IO.readFile(libFolder + "lib.es5.d.ts")!, /*languageVersion*/ ts.ScriptTarget.Latest);
|
||||
libFileNameSourceFileMap = new Map(Object.entries({
|
||||
[defaultLibFileName]: createSourceFileAndAssertInvariants(defaultLibFileName, IO.readFile(libFolder + "lib.es5.d.ts")!, /*languageVersion*/ ts.ScriptTarget.Latest),
|
||||
[defaultLibFileName]: { file, stringified: JSON.stringify(file.text) },
|
||||
}));
|
||||
}
|
||||
|
||||
let sourceFile = libFileNameSourceFileMap.get(fileName);
|
||||
if (!sourceFile) {
|
||||
libFileNameSourceFileMap.set(fileName, sourceFile = createSourceFileAndAssertInvariants(fileName, IO.readFile(libFolder + fileName)!, ts.ScriptTarget.Latest));
|
||||
const file = createSourceFileAndAssertInvariants(fileName, IO.readFile(libFolder + fileName)!, ts.ScriptTarget.Latest);
|
||||
sourceFile = { file, stringified: JSON.stringify(file.text) };
|
||||
libFileNameSourceFileMap.set(fileName, sourceFile);
|
||||
}
|
||||
return sourceFile;
|
||||
return sourceFile.file;
|
||||
}
|
||||
|
||||
export function getDefaultLibFileName(options: ts.CompilerOptions): string {
|
||||
@@ -418,6 +421,10 @@ export namespace Compiler {
|
||||
// Files from tests\lib that are requested by "@libFiles"
|
||||
if (options.libFiles) {
|
||||
for (const fileName of options.libFiles.split(",")) {
|
||||
if (fileName === "lib.d.ts" && !options.noLib) {
|
||||
// Hack from Corsa.
|
||||
continue;
|
||||
}
|
||||
programFileNames.push(vpath.combine(vfs.testLibFolder, fileName));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -144,8 +144,8 @@ function sanitizeHarnessLSException(s: string) {
|
||||
|
||||
export function sanitizeLibFileText(s: string): string {
|
||||
Compiler.libFileNameSourceFileMap?.forEach((lib, fileName) => {
|
||||
s = replaceAll(s, JSON.stringify(lib.text), `${fileName}-Text`);
|
||||
s = replaceAll(s, lib.text, `${fileName}-Text`);
|
||||
s = replaceAll(s, lib.stringified, `${fileName}-Text`);
|
||||
s = replaceAll(s, lib.file.text, `${fileName}-Text`);
|
||||
});
|
||||
return s;
|
||||
}
|
||||
|
||||
Vendored
+2
@@ -356,6 +356,8 @@ interface Float16ArrayConstructor {
|
||||
new (length?: number): Float16Array<ArrayBuffer>;
|
||||
new (array: ArrayLike<number> | Iterable<number>): Float16Array<ArrayBuffer>;
|
||||
new <TArrayBuffer extends ArrayBufferLike = ArrayBuffer>(buffer: TArrayBuffer, byteOffset?: number, length?: number): Float16Array<TArrayBuffer>;
|
||||
new (buffer: ArrayBuffer, byteOffset?: number, length?: number): Float16Array<ArrayBuffer>;
|
||||
new (array: ArrayLike<number> | ArrayBuffer): Float16Array<ArrayBuffer>;
|
||||
|
||||
/**
|
||||
* The size in bytes of each element in the array.
|
||||
|
||||
Vendored
-1
@@ -1 +0,0 @@
|
||||
/// <reference no-default-lib="true"/>
|
||||
@@ -6060,20 +6060,29 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";ESM_syntax_is_not_allowed_in_a_CommonJS_module_when_module_is_set_to_preserve_1293" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Item ItemId=";ECMAScript_imports_and_exports_cannot_be_written_in_a_CommonJS_file_under_verbatimModuleSyntax_1286" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[ESM syntax is not allowed in a CommonJS module when 'module' is set to 'preserve'.]]></Val>
|
||||
<Val><![CDATA[ECMAScript imports and exports cannot be written in a CommonJS file under 'verbatimModuleSyntax'.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[当“module”设置为“preserve”时,CommonJS 模块中不允许使用 ESM 语法。]]></Val>
|
||||
<Val><![CDATA[ECMAScript 导入和导出不能写入 "verbatimModuleSyntax" 下的 CommonJS 文件中。]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";ESM_syntax_is_not_allowed_in_a_CommonJS_module_when_verbatimModuleSyntax_is_enabled_1286" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Item ItemId=";ECMAScript_imports_and_exports_cannot_be_written_in_a_CommonJS_file_under_verbatimModuleSyntax_Adjus_1295" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[ESM syntax is not allowed in a CommonJS module when 'verbatimModuleSyntax' is enabled.]]></Val>
|
||||
<Val><![CDATA[ECMAScript imports and exports cannot be written in a CommonJS file under 'verbatimModuleSyntax'. Adjust the 'type' field in the nearest 'package.json' to make this file an ECMAScript module, or adjust your 'verbatimModuleSyntax', 'module', and 'moduleResolution' settings in TypeScript.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[启用“verbatimModuleSyntax”时,CommonJS 模块中不允许使用 ESM 语法。]]></Val>
|
||||
<Val><![CDATA[ECMAScript 导入和导出不能写入 "verbatimModuleSyntax" 下的 CommonJS 文件中。调整最近的 "package.json" 中的 "type" 字段,将此文件设置为 ECMAScript 模块,或调整 TypeScript 中的 "verbatimModuleSyntax"、"module" 和 "moduleResolution" 设置。]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";ECMAScript_module_syntax_is_not_allowed_in_a_CommonJS_module_when_module_is_set_to_preserve_1293" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[ECMAScript module syntax is not allowed in a CommonJS module when 'module' is set to 'preserve'.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[当 "module" 设置为 "preserve" 时,CommonJS 模块中不允许使用 ECMAScript 模块语法。]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
@@ -10545,11 +10554,11 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Option_0_can_only_be_used_when_module_is_set_to_preserve_or_to_es2015_or_later_5095" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Item ItemId=";Option_0_can_only_be_used_when_module_is_set_to_preserve_commonjs_or_es2015_or_later_5095" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Option '{0}' can only be used when 'module' is set to 'preserve' or to 'es2015' or later.]]></Val>
|
||||
<Val><![CDATA[Option '{0}' can only be used when 'module' is set to 'preserve', 'commonjs', or 'es2015' or later.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[只有在“module”设置为“preserve”或“es2015”或更高版本时,才能使用选项“{0}”。]]></Val>
|
||||
<Val><![CDATA[只有在 "module" 设置为 "preserve"、"commonjs"、"es2015" 或更高版本时,才能使用选项“{0}”。]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
|
||||
@@ -6060,20 +6060,29 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";ESM_syntax_is_not_allowed_in_a_CommonJS_module_when_module_is_set_to_preserve_1293" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Item ItemId=";ECMAScript_imports_and_exports_cannot_be_written_in_a_CommonJS_file_under_verbatimModuleSyntax_1286" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[ESM syntax is not allowed in a CommonJS module when 'module' is set to 'preserve'.]]></Val>
|
||||
<Val><![CDATA[ECMAScript imports and exports cannot be written in a CommonJS file under 'verbatimModuleSyntax'.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[當 'module' 設定為 'preserve' 時,CommonJS 模組中不允許 ESM 語法。]]></Val>
|
||||
<Val><![CDATA[無法在 'verbatimModuleSyntax' 底下的 CommonJS 檔案中撰寫 ECMAScript 匯入和匯出。]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";ESM_syntax_is_not_allowed_in_a_CommonJS_module_when_verbatimModuleSyntax_is_enabled_1286" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Item ItemId=";ECMAScript_imports_and_exports_cannot_be_written_in_a_CommonJS_file_under_verbatimModuleSyntax_Adjus_1295" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[ESM syntax is not allowed in a CommonJS module when 'verbatimModuleSyntax' is enabled.]]></Val>
|
||||
<Val><![CDATA[ECMAScript imports and exports cannot be written in a CommonJS file under 'verbatimModuleSyntax'. Adjust the 'type' field in the nearest 'package.json' to make this file an ECMAScript module, or adjust your 'verbatimModuleSyntax', 'module', and 'moduleResolution' settings in TypeScript.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[啟用 'verbatimModuleSyntax' 時,CommonJS 模組中不允許 ESM 語法。]]></Val>
|
||||
<Val><![CDATA[無法在 'verbatimModuleSyntax' 底下的 CommonJS 檔案中撰寫 ECMAScript 匯入和匯出。請調整最近的 'package.json' 中的 'type' 欄位,將此檔案設為 ECMAScript 模組,或調整 TypeScript 中的 'verbatimModuleSyntax'、'module' 和 'moduleResolution' 設定。]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";ECMAScript_module_syntax_is_not_allowed_in_a_CommonJS_module_when_module_is_set_to_preserve_1293" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[ECMAScript module syntax is not allowed in a CommonJS module when 'module' is set to 'preserve'.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[當 'module' 設定為 'preserve' 時,CommonJS 模組中不允許 ECMAScript 模組語法。]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
@@ -10545,11 +10554,11 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Option_0_can_only_be_used_when_module_is_set_to_preserve_or_to_es2015_or_later_5095" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Item ItemId=";Option_0_can_only_be_used_when_module_is_set_to_preserve_commonjs_or_es2015_or_later_5095" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Option '{0}' can only be used when 'module' is set to 'preserve' or to 'es2015' or later.]]></Val>
|
||||
<Val><![CDATA[Option '{0}' can only be used when 'module' is set to 'preserve', 'commonjs', or 'es2015' or later.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[只有當 'module' 設定為 'preserve'、'es2015' 或更新版本時,才能使用 '{0}' 選項。]]></Val>
|
||||
<Val><![CDATA[只有當 'module' 設定為 'preserve'、'commonjs' 或 'es2015' 或更新版本時,才能使用選項 '{0}'。]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
|
||||
@@ -6069,20 +6069,29 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";ESM_syntax_is_not_allowed_in_a_CommonJS_module_when_module_is_set_to_preserve_1293" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Item ItemId=";ECMAScript_imports_and_exports_cannot_be_written_in_a_CommonJS_file_under_verbatimModuleSyntax_1286" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[ESM syntax is not allowed in a CommonJS module when 'module' is set to 'preserve'.]]></Val>
|
||||
<Val><![CDATA[ECMAScript imports and exports cannot be written in a CommonJS file under 'verbatimModuleSyntax'.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Když je možnost „module“ nastavená na „preserve“, v modulu CommonJS se nepovoluje syntaxe ESM.]]></Val>
|
||||
<Val><![CDATA[Importy a exporty ECMAScript nelze zapsat do souboru CommonJS v části verbatimModuleSyntax.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";ESM_syntax_is_not_allowed_in_a_CommonJS_module_when_verbatimModuleSyntax_is_enabled_1286" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Item ItemId=";ECMAScript_imports_and_exports_cannot_be_written_in_a_CommonJS_file_under_verbatimModuleSyntax_Adjus_1295" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[ESM syntax is not allowed in a CommonJS module when 'verbatimModuleSyntax' is enabled.]]></Val>
|
||||
<Val><![CDATA[ECMAScript imports and exports cannot be written in a CommonJS file under 'verbatimModuleSyntax'. Adjust the 'type' field in the nearest 'package.json' to make this file an ECMAScript module, or adjust your 'verbatimModuleSyntax', 'module', and 'moduleResolution' settings in TypeScript.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Když je povolená syntaxe „verbatimModuleSyntax“, není v modulu CommonJS povolená syntaxe ESM.]]></Val>
|
||||
<Val><![CDATA[Importy a exporty ECMAScript nelze zapsat do souboru CommonJS v části verbatimModuleSyntax. Upravte pole type v nejbližším souboru package.json tak, aby tento soubor byl modulem ECMAScript, případně upravte nastavení verbatimModuleSyntax, module a moduleResolution v TypeScriptu.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";ECMAScript_module_syntax_is_not_allowed_in_a_CommonJS_module_when_module_is_set_to_preserve_1293" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[ECMAScript module syntax is not allowed in a CommonJS module when 'module' is set to 'preserve'.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Syntaxe modulu ECMAScript není v modulu CommonJS povolená, pokud je možnost module nastavená na preserve.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
@@ -10554,11 +10563,11 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Option_0_can_only_be_used_when_module_is_set_to_preserve_or_to_es2015_or_later_5095" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Item ItemId=";Option_0_can_only_be_used_when_module_is_set_to_preserve_commonjs_or_es2015_or_later_5095" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Option '{0}' can only be used when 'module' is set to 'preserve' or to 'es2015' or later.]]></Val>
|
||||
<Val><![CDATA[Option '{0}' can only be used when 'module' is set to 'preserve', 'commonjs', or 'es2015' or later.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Možnost „{0}“ se dá použít jenom v případě, že je možnost „modul“ nastavená na „preserve“ nebo na „es2015“ a novější.]]></Val>
|
||||
<Val><![CDATA[Možnost „{0}“ se dá použít jenom v případě, že je možnost „modul“ nastavená na „preserve“, „commonjs“ nebo na „es2015“ a novější.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
|
||||
@@ -6057,20 +6057,29 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";ESM_syntax_is_not_allowed_in_a_CommonJS_module_when_module_is_set_to_preserve_1293" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Item ItemId=";ECMAScript_imports_and_exports_cannot_be_written_in_a_CommonJS_file_under_verbatimModuleSyntax_1286" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[ESM syntax is not allowed in a CommonJS module when 'module' is set to 'preserve'.]]></Val>
|
||||
<Val><![CDATA[ECMAScript imports and exports cannot be written in a CommonJS file under 'verbatimModuleSyntax'.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Die ESM-Syntax ist in einem CommonJS-Modul nicht zulässig, wenn "module" auf "preserve" festgelegt ist.]]></Val>
|
||||
<Val><![CDATA[ECMAScript-Importe und -Exporte können nicht in eine CommonJS-Datei unter „verbatimModuleSyntax“ geschrieben werden.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";ESM_syntax_is_not_allowed_in_a_CommonJS_module_when_verbatimModuleSyntax_is_enabled_1286" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Item ItemId=";ECMAScript_imports_and_exports_cannot_be_written_in_a_CommonJS_file_under_verbatimModuleSyntax_Adjus_1295" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[ESM syntax is not allowed in a CommonJS module when 'verbatimModuleSyntax' is enabled.]]></Val>
|
||||
<Val><![CDATA[ECMAScript imports and exports cannot be written in a CommonJS file under 'verbatimModuleSyntax'. Adjust the 'type' field in the nearest 'package.json' to make this file an ECMAScript module, or adjust your 'verbatimModuleSyntax', 'module', and 'moduleResolution' settings in TypeScript.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Die ESM-Syntax ist in einem CommonJS-Modul nicht zulässig, wenn "verbatimModuleSyntax" aktiviert ist.]]></Val>
|
||||
<Val><![CDATA[ECMAScript-Importe und -Exporte können nicht in eine CommonJS-Datei unter „verbatimModuleSyntax“ geschrieben werden. Passen Sie das Feld „type“ im nächsten „package.json“ an, um diese Datei zu einem ECMAScript-Modul zu machen, oder passen Sie die Einstellungen „verbatimModuleSyntax“, „module“ und „moduleResolution“ in TypeScript an.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";ECMAScript_module_syntax_is_not_allowed_in_a_CommonJS_module_when_module_is_set_to_preserve_1293" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[ECMAScript module syntax is not allowed in a CommonJS module when 'module' is set to 'preserve'.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Die ECMAScript-Modulsyntax ist in einem CommonJS-Modul nicht zulässig, wenn „module“ auf „preserve“ festgelegt ist.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
@@ -10542,11 +10551,11 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Option_0_can_only_be_used_when_module_is_set_to_preserve_or_to_es2015_or_later_5095" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Item ItemId=";Option_0_can_only_be_used_when_module_is_set_to_preserve_commonjs_or_es2015_or_later_5095" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Option '{0}' can only be used when 'module' is set to 'preserve' or to 'es2015' or later.]]></Val>
|
||||
<Val><![CDATA[Option '{0}' can only be used when 'module' is set to 'preserve', 'commonjs', or 'es2015' or later.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Die Option "{0}" kann nur verwendet werden, wenn "module" auf "preserve" oder auf "es2015" oder höher festgelegt ist.]]></Val>
|
||||
<Val><![CDATA[Die Option „{0}“ kann nur verwendet werden, wenn „module“ auf „preserve“, „commonjs“, „es2015“ oder höher festgelegt ist.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
|
||||
@@ -6072,20 +6072,29 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";ESM_syntax_is_not_allowed_in_a_CommonJS_module_when_module_is_set_to_preserve_1293" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Item ItemId=";ECMAScript_imports_and_exports_cannot_be_written_in_a_CommonJS_file_under_verbatimModuleSyntax_1286" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[ESM syntax is not allowed in a CommonJS module when 'module' is set to 'preserve'.]]></Val>
|
||||
<Val><![CDATA[ECMAScript imports and exports cannot be written in a CommonJS file under 'verbatimModuleSyntax'.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[No se permite la sintaxis ESM en un módulo CommonJS cuando "module" está establecido en "preserve".]]></Val>
|
||||
<Val><![CDATA[Las importaciones y exportaciones de ECMAScript no se pueden escribir en un archivo CommonJS en "verbatimModuleSyntax".]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";ESM_syntax_is_not_allowed_in_a_CommonJS_module_when_verbatimModuleSyntax_is_enabled_1286" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Item ItemId=";ECMAScript_imports_and_exports_cannot_be_written_in_a_CommonJS_file_under_verbatimModuleSyntax_Adjus_1295" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[ESM syntax is not allowed in a CommonJS module when 'verbatimModuleSyntax' is enabled.]]></Val>
|
||||
<Val><![CDATA[ECMAScript imports and exports cannot be written in a CommonJS file under 'verbatimModuleSyntax'. Adjust the 'type' field in the nearest 'package.json' to make this file an ECMAScript module, or adjust your 'verbatimModuleSyntax', 'module', and 'moduleResolution' settings in TypeScript.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[No se permite la sintaxis ESM en un módulo CommonJS cuando "verbatimModuleSyntax" está habilitado.]]></Val>
|
||||
<Val><![CDATA[Las importaciones y exportaciones de ECMAScript no se pueden escribir en un archivo CommonJS en "verbatimModuleSyntax". Ajuste el campo "type" en el "package.json" más cercano para convertir este archivo en un módulo ECMAScript o ajuste la configuración "verbatimModuleSyntax", "module" y "moduleResolution" en TypeScript.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";ECMAScript_module_syntax_is_not_allowed_in_a_CommonJS_module_when_module_is_set_to_preserve_1293" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[ECMAScript module syntax is not allowed in a CommonJS module when 'module' is set to 'preserve'.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[No se permite la sintaxis del módulo ECMAScript en un módulo CommonJS cuando "module" está establecido en "preserve".]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
@@ -10557,11 +10566,11 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Option_0_can_only_be_used_when_module_is_set_to_preserve_or_to_es2015_or_later_5095" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Item ItemId=";Option_0_can_only_be_used_when_module_is_set_to_preserve_commonjs_or_es2015_or_later_5095" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Option '{0}' can only be used when 'module' is set to 'preserve' or to 'es2015' or later.]]></Val>
|
||||
<Val><![CDATA[Option '{0}' can only be used when 'module' is set to 'preserve', 'commonjs', or 'es2015' or later.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[La opción “{0}” solo se puede usar cuando “module” está establecido en “preserve” o en “es2015” o posterior.]]></Val>
|
||||
<Val><![CDATA[La opción "{0}" solo se puede usar cuando "module" está establecido en "preserve", en "commonjs" o en "es2015" o posterior.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
|
||||
@@ -6072,20 +6072,29 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";ESM_syntax_is_not_allowed_in_a_CommonJS_module_when_module_is_set_to_preserve_1293" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Item ItemId=";ECMAScript_imports_and_exports_cannot_be_written_in_a_CommonJS_file_under_verbatimModuleSyntax_1286" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[ESM syntax is not allowed in a CommonJS module when 'module' is set to 'preserve'.]]></Val>
|
||||
<Val><![CDATA[ECMAScript imports and exports cannot be written in a CommonJS file under 'verbatimModuleSyntax'.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[La syntaxe ESM n’est pas autorisée dans un module CommonJS quand « module » a la valeur « preserve ».]]></Val>
|
||||
<Val><![CDATA[Les importations et exportations ECMAScript ne peuvent pas être écrites dans un fichier CommonJS sous 'verbatimModuleSyntax'.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";ESM_syntax_is_not_allowed_in_a_CommonJS_module_when_verbatimModuleSyntax_is_enabled_1286" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Item ItemId=";ECMAScript_imports_and_exports_cannot_be_written_in_a_CommonJS_file_under_verbatimModuleSyntax_Adjus_1295" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[ESM syntax is not allowed in a CommonJS module when 'verbatimModuleSyntax' is enabled.]]></Val>
|
||||
<Val><![CDATA[ECMAScript imports and exports cannot be written in a CommonJS file under 'verbatimModuleSyntax'. Adjust the 'type' field in the nearest 'package.json' to make this file an ECMAScript module, or adjust your 'verbatimModuleSyntax', 'module', and 'moduleResolution' settings in TypeScript.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[La syntaxe ESM n'est pas autorisée dans un module CommonJS lorsque « verbatimModuleSyntax » est activé.]]></Val>
|
||||
<Val><![CDATA[Les importations et exportations ECMAScript ne peuvent pas être écrites dans un fichier CommonJS sous 'verbatimModuleSyntax'. Ajustez le champ 'type' dans le 'package.json' le plus proche pour faire de ce fichier un module ECMAScript, ou ajustez vos paramètres 'verbatimModuleSyntax', 'module' et 'moduleResolution' dans TypeScript.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";ECMAScript_module_syntax_is_not_allowed_in_a_CommonJS_module_when_module_is_set_to_preserve_1293" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[ECMAScript module syntax is not allowed in a CommonJS module when 'module' is set to 'preserve'.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[La syntaxe du module ECMAScript n’est pas autorisée dans un module CommonJS quand 'module' est défini sur 'preserve'.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
@@ -10557,11 +10566,11 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Option_0_can_only_be_used_when_module_is_set_to_preserve_or_to_es2015_or_later_5095" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Item ItemId=";Option_0_can_only_be_used_when_module_is_set_to_preserve_commonjs_or_es2015_or_later_5095" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Option '{0}' can only be used when 'module' is set to 'preserve' or to 'es2015' or later.]]></Val>
|
||||
<Val><![CDATA[Option '{0}' can only be used when 'module' is set to 'preserve', 'commonjs', or 'es2015' or later.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[L’option '{0}' ne peut être utilisée que lorsque 'module' a la valeur 'preserve' ou 'es2015' ou version ultérieure.]]></Val>
|
||||
<Val><![CDATA[L’option « {0} » ne peut être utilisée que lorsque « module » a la valeur « preserve », « commonjs » ou « es2015 » ou une version ultérieure.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
|
||||
@@ -6060,20 +6060,29 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";ESM_syntax_is_not_allowed_in_a_CommonJS_module_when_module_is_set_to_preserve_1293" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Item ItemId=";ECMAScript_imports_and_exports_cannot_be_written_in_a_CommonJS_file_under_verbatimModuleSyntax_1286" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[ESM syntax is not allowed in a CommonJS module when 'module' is set to 'preserve'.]]></Val>
|
||||
<Val><![CDATA[ECMAScript imports and exports cannot be written in a CommonJS file under 'verbatimModuleSyntax'.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Sintassi ESM non consentita in un modulo CommonJS quando 'module' è impostato su 'preserve'.]]></Val>
|
||||
<Val><![CDATA[Le importazioni e le esportazioni di ECMAScript non possono essere scritte in un file CommonJS in "verbatimModuleSyntax".]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";ESM_syntax_is_not_allowed_in_a_CommonJS_module_when_verbatimModuleSyntax_is_enabled_1286" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Item ItemId=";ECMAScript_imports_and_exports_cannot_be_written_in_a_CommonJS_file_under_verbatimModuleSyntax_Adjus_1295" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[ESM syntax is not allowed in a CommonJS module when 'verbatimModuleSyntax' is enabled.]]></Val>
|
||||
<Val><![CDATA[ECMAScript imports and exports cannot be written in a CommonJS file under 'verbatimModuleSyntax'. Adjust the 'type' field in the nearest 'package.json' to make this file an ECMAScript module, or adjust your 'verbatimModuleSyntax', 'module', and 'moduleResolution' settings in TypeScript.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Sintassi ESM non consentita in un modulo CommonJS quando 'verbatimModuleSyntax' è abilitato.]]></Val>
|
||||
<Val><![CDATA[Le importazioni e le esportazioni di ECMAScript non possono essere scritte in un file CommonJS in "verbatimModuleSyntax". Modificare il campo "type" nel "package.json" più vicino per rendere questo file un modulo ECMAScript oppure modificare le impostazioni "verbatimModuleSyntax", "module" e "moduleResolution" in TypeScript.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";ECMAScript_module_syntax_is_not_allowed_in_a_CommonJS_module_when_module_is_set_to_preserve_1293" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[ECMAScript module syntax is not allowed in a CommonJS module when 'module' is set to 'preserve'.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[La sintassi del modulo ECMAScript non è consentita in un modulo CommonJS quando "module" è impostato su "preserve".]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
@@ -10545,9 +10554,9 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Option_0_can_only_be_used_when_module_is_set_to_preserve_or_to_es2015_or_later_5095" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Item ItemId=";Option_0_can_only_be_used_when_module_is_set_to_preserve_commonjs_or_es2015_or_later_5095" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Option '{0}' can only be used when 'module' is set to 'preserve' or to 'es2015' or later.]]></Val>
|
||||
<Val><![CDATA[Option '{0}' can only be used when 'module' is set to 'preserve', 'commonjs', or 'es2015' or later.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[L'opzione '{0}' può essere usata solo quando 'module' è impostato su 'preserve' o 'es2015' o versione successiva.]]></Val>
|
||||
</Tgt>
|
||||
|
||||
@@ -6060,20 +6060,29 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";ESM_syntax_is_not_allowed_in_a_CommonJS_module_when_module_is_set_to_preserve_1293" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Item ItemId=";ECMAScript_imports_and_exports_cannot_be_written_in_a_CommonJS_file_under_verbatimModuleSyntax_1286" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[ESM syntax is not allowed in a CommonJS module when 'module' is set to 'preserve'.]]></Val>
|
||||
<Val><![CDATA[ECMAScript imports and exports cannot be written in a CommonJS file under 'verbatimModuleSyntax'.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA['module' が 'preserve' に設定されている場合、CommonJS モジュールでは ESM 構文を使用できません。]]></Val>
|
||||
<Val><![CDATA[ECMAScript のインポートとエクスポートは、CommonJS ファイルの 'verbatimModuleSyntax' の下に書き込むことができません。]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";ESM_syntax_is_not_allowed_in_a_CommonJS_module_when_verbatimModuleSyntax_is_enabled_1286" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Item ItemId=";ECMAScript_imports_and_exports_cannot_be_written_in_a_CommonJS_file_under_verbatimModuleSyntax_Adjus_1295" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[ESM syntax is not allowed in a CommonJS module when 'verbatimModuleSyntax' is enabled.]]></Val>
|
||||
<Val><![CDATA[ECMAScript imports and exports cannot be written in a CommonJS file under 'verbatimModuleSyntax'. Adjust the 'type' field in the nearest 'package.json' to make this file an ECMAScript module, or adjust your 'verbatimModuleSyntax', 'module', and 'moduleResolution' settings in TypeScript.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA['verbatimModuleSyntax' が有効である場合、CommonJS モジュールで ESM 構文は許可されません。]]></Val>
|
||||
<Val><![CDATA[ECMAScript のインポートとエクスポートは、CommonJS ファイルの 'verbatimModuleSyntax' の下に書き込むことができません。最も近い 'package.json' の 'type' フィールドを調整してこのファイルを ECMAScript モジュールにするか、TypeScript で 'verbatimModuleSyntax'、'module'、'moduleResolution' の設定を調整します。]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";ECMAScript_module_syntax_is_not_allowed_in_a_CommonJS_module_when_module_is_set_to_preserve_1293" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[ECMAScript module syntax is not allowed in a CommonJS module when 'module' is set to 'preserve'.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA['module' が 'preserve' に設定されている場合、CommonJS モジュールでは ECMAScript モジュール構文を使用できません。]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
@@ -10545,11 +10554,11 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Option_0_can_only_be_used_when_module_is_set_to_preserve_or_to_es2015_or_later_5095" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Item ItemId=";Option_0_can_only_be_used_when_module_is_set_to_preserve_commonjs_or_es2015_or_later_5095" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Option '{0}' can only be used when 'module' is set to 'preserve' or to 'es2015' or later.]]></Val>
|
||||
<Val><![CDATA[Option '{0}' can only be used when 'module' is set to 'preserve', 'commonjs', or 'es2015' or later.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[オプション '{0}' は、'module' が 'preserve' または 'es2015' 以降に設定されている場合にのみ使用できます。]]></Val>
|
||||
<Val><![CDATA[オプション '{0}' は、'module' が 'preserve'、'commonjs'、または 'es2015' 以降に設定されている場合にのみ使用できます。]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
|
||||
@@ -6060,20 +6060,29 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";ESM_syntax_is_not_allowed_in_a_CommonJS_module_when_module_is_set_to_preserve_1293" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Item ItemId=";ECMAScript_imports_and_exports_cannot_be_written_in_a_CommonJS_file_under_verbatimModuleSyntax_1286" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[ESM syntax is not allowed in a CommonJS module when 'module' is set to 'preserve'.]]></Val>
|
||||
<Val><![CDATA[ECMAScript imports and exports cannot be written in a CommonJS file under 'verbatimModuleSyntax'.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA['module'이 'preserve'로 설정된 경우 CommonJS 모듈에서는 ESM 구문을 사용할 수 없습니다.]]></Val>
|
||||
<Val><![CDATA[ECMAScript 가져오기 및 내보내기를 'verbatimModuleSyntax' 아래의 CommonJS 파일에 쓸 수 없습니다.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";ESM_syntax_is_not_allowed_in_a_CommonJS_module_when_verbatimModuleSyntax_is_enabled_1286" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Item ItemId=";ECMAScript_imports_and_exports_cannot_be_written_in_a_CommonJS_file_under_verbatimModuleSyntax_Adjus_1295" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[ESM syntax is not allowed in a CommonJS module when 'verbatimModuleSyntax' is enabled.]]></Val>
|
||||
<Val><![CDATA[ECMAScript imports and exports cannot be written in a CommonJS file under 'verbatimModuleSyntax'. Adjust the 'type' field in the nearest 'package.json' to make this file an ECMAScript module, or adjust your 'verbatimModuleSyntax', 'module', and 'moduleResolution' settings in TypeScript.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA['verbatimModuleSyntax'를 사용하도록 설정한 경우 CommonJS 모듈에서는 ESM 구문을 사용할 수 없습니다.]]></Val>
|
||||
<Val><![CDATA[ECMAScript 가져오기 및 내보내기를 'verbatimModuleSyntax' 아래의 CommonJS 파일에 쓸 수 없습니다. 가장 가까운 'package.json'에서 'type' 필드를 조정하여 이 파일을 ECMAScript 모듈로 만들거나 TypeScript에서 'verbatimModuleSyntax', 'module' 및 'moduleResolution' 설정을 조정합니다.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";ECMAScript_module_syntax_is_not_allowed_in_a_CommonJS_module_when_module_is_set_to_preserve_1293" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[ECMAScript module syntax is not allowed in a CommonJS module when 'module' is set to 'preserve'.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA['module'이 'preserve'로 설정된 경우 CommonJS 모듈에서는 ECMAScript 모듈 구문을 사용할 수 없습니다.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
@@ -10545,11 +10554,11 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Option_0_can_only_be_used_when_module_is_set_to_preserve_or_to_es2015_or_later_5095" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Item ItemId=";Option_0_can_only_be_used_when_module_is_set_to_preserve_commonjs_or_es2015_or_later_5095" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Option '{0}' can only be used when 'module' is set to 'preserve' or to 'es2015' or later.]]></Val>
|
||||
<Val><![CDATA[Option '{0}' can only be used when 'module' is set to 'preserve', 'commonjs', or 'es2015' or later.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA['{0}' 옵션은 'module'이 'preserve' 또는 'es2015' 이상으로 설정된 경우에만 사용할 수 있습니다.]]></Val>
|
||||
<Val><![CDATA['{0}' 옵션은 'module'이 'preserve', 'commonjs', 또는 'es2015' 이상으로 설정된 경우에만 사용할 수 있습니다.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
|
||||
@@ -6050,20 +6050,29 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";ESM_syntax_is_not_allowed_in_a_CommonJS_module_when_module_is_set_to_preserve_1293" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Item ItemId=";ECMAScript_imports_and_exports_cannot_be_written_in_a_CommonJS_file_under_verbatimModuleSyntax_1286" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[ESM syntax is not allowed in a CommonJS module when 'module' is set to 'preserve'.]]></Val>
|
||||
<Val><![CDATA[ECMAScript imports and exports cannot be written in a CommonJS file under 'verbatimModuleSyntax'.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Składnia ESM jest niedozwolona w module CommonJS, gdy element „module” jest ustawiony na wartość „preserve”.]]></Val>
|
||||
<Val><![CDATA[Importów i eksportów ECMAScript nie można zapisać w pliku CommonJS w obszarze „verbatimModuleSyntax”.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";ESM_syntax_is_not_allowed_in_a_CommonJS_module_when_verbatimModuleSyntax_is_enabled_1286" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Item ItemId=";ECMAScript_imports_and_exports_cannot_be_written_in_a_CommonJS_file_under_verbatimModuleSyntax_Adjus_1295" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[ESM syntax is not allowed in a CommonJS module when 'verbatimModuleSyntax' is enabled.]]></Val>
|
||||
<Val><![CDATA[ECMAScript imports and exports cannot be written in a CommonJS file under 'verbatimModuleSyntax'. Adjust the 'type' field in the nearest 'package.json' to make this file an ECMAScript module, or adjust your 'verbatimModuleSyntax', 'module', and 'moduleResolution' settings in TypeScript.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Składnia ESM jest niedozwolona w module CommonJS, gdy jest włączona opcja „verbatimModuleSyntax”.]]></Val>
|
||||
<Val><![CDATA[Importów i eksportów ECMAScript nie można zapisać w pliku CommonJS w obszarze „verbatimModuleSyntax”. Dostosuj pole „type” w najbliższej lokalizacji „package.json”, aby ustawić ten plik jako moduł ECMAScript, lub dostosuj ustawienia „verbatimModuleSyntax”, „module” i „moduleResolution” w języku TypeScript.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";ECMAScript_module_syntax_is_not_allowed_in_a_CommonJS_module_when_module_is_set_to_preserve_1293" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[ECMAScript module syntax is not allowed in a CommonJS module when 'module' is set to 'preserve'.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Składnia modułu ECMAScript jest niedozwolona w module CommonJS, gdy element „module” jest ustawiony na wartość „preserve”.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
@@ -10535,11 +10544,11 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Option_0_can_only_be_used_when_module_is_set_to_preserve_or_to_es2015_or_later_5095" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Item ItemId=";Option_0_can_only_be_used_when_module_is_set_to_preserve_commonjs_or_es2015_or_later_5095" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Option '{0}' can only be used when 'module' is set to 'preserve' or to 'es2015' or later.]]></Val>
|
||||
<Val><![CDATA[Option '{0}' can only be used when 'module' is set to 'preserve', 'commonjs', or 'es2015' or later.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Opcji „{0}” można używać tylko wtedy, gdy element „module” ma wartość „preserve” lub „es2015” lub nowszą.]]></Val>
|
||||
<Val><![CDATA[Opcji „{0}” można używać tylko wtedy, gdy element „module” ma wartość „preserve”, „commonjs” lub „es2015” lub nowszą.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
|
||||
@@ -6053,20 +6053,29 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";ESM_syntax_is_not_allowed_in_a_CommonJS_module_when_module_is_set_to_preserve_1293" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Item ItemId=";ECMAScript_imports_and_exports_cannot_be_written_in_a_CommonJS_file_under_verbatimModuleSyntax_1286" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[ESM syntax is not allowed in a CommonJS module when 'module' is set to 'preserve'.]]></Val>
|
||||
<Val><![CDATA[ECMAScript imports and exports cannot be written in a CommonJS file under 'verbatimModuleSyntax'.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[A sintaxe ESM não é permitida em um módulo CommonJS quando 'module' estiver definido como 'preserve'.]]></Val>
|
||||
<Val><![CDATA[Importações e exportações ECMAScript não podem ser gravadas em um arquivo CommonJS em "texttimModuleSyntax".]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";ESM_syntax_is_not_allowed_in_a_CommonJS_module_when_verbatimModuleSyntax_is_enabled_1286" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Item ItemId=";ECMAScript_imports_and_exports_cannot_be_written_in_a_CommonJS_file_under_verbatimModuleSyntax_Adjus_1295" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[ESM syntax is not allowed in a CommonJS module when 'verbatimModuleSyntax' is enabled.]]></Val>
|
||||
<Val><![CDATA[ECMAScript imports and exports cannot be written in a CommonJS file under 'verbatimModuleSyntax'. Adjust the 'type' field in the nearest 'package.json' to make this file an ECMAScript module, or adjust your 'verbatimModuleSyntax', 'module', and 'moduleResolution' settings in TypeScript.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[A sintaxe ESM não é permitida em um módulo CommonJS quando a opção "verbatimModuleSyntax" estiver habilitada.]]></Val>
|
||||
<Val><![CDATA[Importações e exportações ECMAScript não podem ser gravadas em um arquivo CommonJS em "texttimModuleSyntax". Ajuste o campo "type" no "package.json" mais próximo para tornar esse arquivo um módulo ECMAScript ou ajuste as configurações "texttimModuleSyntax", "module" e "moduleResolution" no TypeScript.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";ECMAScript_module_syntax_is_not_allowed_in_a_CommonJS_module_when_module_is_set_to_preserve_1293" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[ECMAScript module syntax is not allowed in a CommonJS module when 'module' is set to 'preserve'.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[A sintaxe do módulo ECMAScript não é permitida em um módulo CommonJS quando "module" está definido como "preserve".]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
@@ -10538,11 +10547,11 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Option_0_can_only_be_used_when_module_is_set_to_preserve_or_to_es2015_or_later_5095" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Item ItemId=";Option_0_can_only_be_used_when_module_is_set_to_preserve_commonjs_or_es2015_or_later_5095" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Option '{0}' can only be used when 'module' is set to 'preserve' or to 'es2015' or later.]]></Val>
|
||||
<Val><![CDATA[Option '{0}' can only be used when 'module' is set to 'preserve', 'commonjs', or 'es2015' or later.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[A opção '{0}' só pode ser usada quando 'module' está definido como 'preserve' ou 'es2015' ou posterior.]]></Val>
|
||||
<Val><![CDATA[A opção "{0}" só pode ser usada quando "module" estiver definido como "preserve", "commonjs" ou "es2015" ou posterior.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
|
||||
@@ -6059,20 +6059,29 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";ESM_syntax_is_not_allowed_in_a_CommonJS_module_when_module_is_set_to_preserve_1293" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Item ItemId=";ECMAScript_imports_and_exports_cannot_be_written_in_a_CommonJS_file_under_verbatimModuleSyntax_1286" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[ESM syntax is not allowed in a CommonJS module when 'module' is set to 'preserve'.]]></Val>
|
||||
<Val><![CDATA[ECMAScript imports and exports cannot be written in a CommonJS file under 'verbatimModuleSyntax'.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Синтаксис ESM не разрешен в модуле CommonJS, если для параметра "модуль" установлено значение "сохранить".]]></Val>
|
||||
<Val><![CDATA[Импорты и экспорты ECMAScript невозможно записать в файл CommonJS в разделе "verbatimModuleSyntax".]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";ESM_syntax_is_not_allowed_in_a_CommonJS_module_when_verbatimModuleSyntax_is_enabled_1286" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Item ItemId=";ECMAScript_imports_and_exports_cannot_be_written_in_a_CommonJS_file_under_verbatimModuleSyntax_Adjus_1295" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[ESM syntax is not allowed in a CommonJS module when 'verbatimModuleSyntax' is enabled.]]></Val>
|
||||
<Val><![CDATA[ECMAScript imports and exports cannot be written in a CommonJS file under 'verbatimModuleSyntax'. Adjust the 'type' field in the nearest 'package.json' to make this file an ECMAScript module, or adjust your 'verbatimModuleSyntax', 'module', and 'moduleResolution' settings in TypeScript.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Синтаксис ESM не разрешен в модуле CommonJS, если включен "verbatimModuleSyntax".]]></Val>
|
||||
<Val><![CDATA[Импорты и экспорты ECMAScript невозможно записать в файл CommonJS в разделе "verbatimModuleSyntax". Измените поле "type" в ближайшем файле "package.json", чтобы сделать этот файл модулем ECMAScript, или настройте параметры "verbatimModuleSyntax", "module" и "moduleResolution" в TypeScript.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";ECMAScript_module_syntax_is_not_allowed_in_a_CommonJS_module_when_module_is_set_to_preserve_1293" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[ECMAScript module syntax is not allowed in a CommonJS module when 'module' is set to 'preserve'.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Синтаксис модуля ECMAScript не разрешен в модуле CommonJS, если для параметра "module" установлено значение "preserve".]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
@@ -10544,11 +10553,11 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Option_0_can_only_be_used_when_module_is_set_to_preserve_or_to_es2015_or_later_5095" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Item ItemId=";Option_0_can_only_be_used_when_module_is_set_to_preserve_commonjs_or_es2015_or_later_5095" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Option '{0}' can only be used when 'module' is set to 'preserve' or to 'es2015' or later.]]></Val>
|
||||
<Val><![CDATA[Option '{0}' can only be used when 'module' is set to 'preserve', 'commonjs', or 'es2015' or later.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Параметр "{0}" можно использовать только в том случае, если для параметра "module" установлено значение "preserve" или "es2015" или более поздней версии.]]></Val>
|
||||
<Val><![CDATA[Опцию "{0}" можно использовать только в том случае, если для параметра "module" установлено значение "preserve", "commonjs", "es2015" или более поздней версии.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
|
||||
@@ -6053,20 +6053,29 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";ESM_syntax_is_not_allowed_in_a_CommonJS_module_when_module_is_set_to_preserve_1293" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Item ItemId=";ECMAScript_imports_and_exports_cannot_be_written_in_a_CommonJS_file_under_verbatimModuleSyntax_1286" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[ESM syntax is not allowed in a CommonJS module when 'module' is set to 'preserve'.]]></Val>
|
||||
<Val><![CDATA[ECMAScript imports and exports cannot be written in a CommonJS file under 'verbatimModuleSyntax'.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA['Module', 'preserve' olarak ayarlandığında CommonJS modülünde ESM sözdizimine izin verilmez.]]></Val>
|
||||
<Val><![CDATA[ECMAScript içeri ve dışarı aktarma işlemleri, 'verbatimModuleSyntax' altında bir CommonJS dosyasına yazılamaz.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";ESM_syntax_is_not_allowed_in_a_CommonJS_module_when_verbatimModuleSyntax_is_enabled_1286" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Item ItemId=";ECMAScript_imports_and_exports_cannot_be_written_in_a_CommonJS_file_under_verbatimModuleSyntax_Adjus_1295" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[ESM syntax is not allowed in a CommonJS module when 'verbatimModuleSyntax' is enabled.]]></Val>
|
||||
<Val><![CDATA[ECMAScript imports and exports cannot be written in a CommonJS file under 'verbatimModuleSyntax'. Adjust the 'type' field in the nearest 'package.json' to make this file an ECMAScript module, or adjust your 'verbatimModuleSyntax', 'module', and 'moduleResolution' settings in TypeScript.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA['verbatimModuleSyntax' etkinleştirildiğinde CommonJS modülünde ESM söz dizimi kullanılamaz.]]></Val>
|
||||
<Val><![CDATA[ECMAScript içeri ve dışarı aktarma işlemleri, 'verbatimModuleSyntax' altında bir CommonJS dosyasına yazılamaz. Bu dosyayı ECMAScript modülü yapmak için en yakın 'package.json' dosyasındaki 'type' alanını düzenleyin veya TypeScript'teki 'verbatimModuleSyntax', 'module' ve 'moduleResolution' ayarlarınızı düzenleyin.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";ECMAScript_module_syntax_is_not_allowed_in_a_CommonJS_module_when_module_is_set_to_preserve_1293" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[ECMAScript module syntax is not allowed in a CommonJS module when 'module' is set to 'preserve'.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA['Module', 'preserve' olarak ayarlandığında CommonJS modülünde ECMAScript modülü sözdizimine izin verilmez.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
@@ -10538,11 +10547,11 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Option_0_can_only_be_used_when_module_is_set_to_preserve_or_to_es2015_or_later_5095" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Item ItemId=";Option_0_can_only_be_used_when_module_is_set_to_preserve_commonjs_or_es2015_or_later_5095" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Option '{0}' can only be used when 'module' is set to 'preserve' or to 'es2015' or later.]]></Val>
|
||||
<Val><![CDATA[Option '{0}' can only be used when 'module' is set to 'preserve', 'commonjs', or 'es2015' or later.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA['{0}' seçeneği, yalnızca 'module' değeri 'preserve', 'es2015' veya üzeri olarak ayarlandığında kullanılabilir.]]></Val>
|
||||
<Val><![CDATA['{0}' seçeneği yalnızca 'module' 'preserve', 'commonjs' veya 'es2015' ya da daha yeni bir değere ayarlandığında kullanılabilir.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
|
||||
+24
-11
@@ -256,7 +256,6 @@ import {
|
||||
isTypeOnlyImportDeclaration,
|
||||
isTypeOnlyImportOrExportDeclaration,
|
||||
isTypeParameterDeclaration,
|
||||
isTypeReferenceType,
|
||||
isValidTypeOnlyAliasUseSite,
|
||||
isVariableDeclaration,
|
||||
isVariableLike,
|
||||
@@ -1595,7 +1594,7 @@ function getJsxClosingTagCompletion(location: Node | undefined, sourceFile: Sour
|
||||
switch (node.kind) {
|
||||
case SyntaxKind.JsxClosingElement:
|
||||
return true;
|
||||
case SyntaxKind.LessThanSlashToken:
|
||||
case SyntaxKind.SlashToken:
|
||||
case SyntaxKind.GreaterThanToken:
|
||||
case SyntaxKind.Identifier:
|
||||
case SyntaxKind.PropertyAccessExpression:
|
||||
@@ -3508,7 +3507,7 @@ function getCompletionData(
|
||||
}
|
||||
break;
|
||||
|
||||
case SyntaxKind.LessThanSlashToken:
|
||||
case SyntaxKind.SlashToken:
|
||||
if (currentToken.parent.kind === SyntaxKind.JsxSelfClosingElement) {
|
||||
location = currentToken;
|
||||
}
|
||||
@@ -3518,7 +3517,7 @@ function getCompletionData(
|
||||
|
||||
switch (parent.kind) {
|
||||
case SyntaxKind.JsxClosingElement:
|
||||
if (contextToken.kind === SyntaxKind.LessThanSlashToken) {
|
||||
if (contextToken.kind === SyntaxKind.SlashToken) {
|
||||
isStartingCloseTag = true;
|
||||
location = contextToken;
|
||||
}
|
||||
@@ -3626,17 +3625,20 @@ function getCompletionData(
|
||||
}
|
||||
|
||||
log("getCompletionData: Semantic work: " + (timestamp() - semanticStart));
|
||||
const contextualType = previousToken && getContextualType(previousToken, position, sourceFile, typeChecker);
|
||||
const contextualTypeOrConstraint = previousToken && (
|
||||
getContextualType(previousToken, position, sourceFile, typeChecker) ??
|
||||
getConstraintOfTypeArgumentProperty(previousToken, typeChecker)
|
||||
);
|
||||
|
||||
// exclude literal suggestions after <input type="text" [||] /> (#51667) and after closing quote (#52675)
|
||||
// for strings getStringLiteralCompletions handles completions
|
||||
const isLiteralExpected = !tryCast(previousToken, isStringLiteralLike) && !isJsxIdentifierExpected;
|
||||
const literals = !isLiteralExpected ? [] : mapDefined(
|
||||
contextualType && (contextualType.isUnion() ? contextualType.types : [contextualType]),
|
||||
contextualTypeOrConstraint && (contextualTypeOrConstraint.isUnion() ? contextualTypeOrConstraint.types : [contextualTypeOrConstraint]),
|
||||
t => t.isLiteral() && !(t.flags & TypeFlags.EnumLiteral) ? t.value : undefined,
|
||||
);
|
||||
|
||||
const recommendedCompletion = previousToken && contextualType && getRecommendedCompletion(previousToken, contextualType, typeChecker);
|
||||
const recommendedCompletion = previousToken && contextualTypeOrConstraint && getRecommendedCompletion(previousToken, contextualTypeOrConstraint, typeChecker);
|
||||
return {
|
||||
kind: CompletionDataKind.Data,
|
||||
symbols,
|
||||
@@ -5766,11 +5768,13 @@ function tryGetTypeLiteralNode(node: Node): TypeLiteralNode | undefined {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
function getConstraintOfTypeArgumentProperty(node: Node, checker: TypeChecker): Type | undefined {
|
||||
/** @internal */
|
||||
export function getConstraintOfTypeArgumentProperty(node: Node, checker: TypeChecker): Type | undefined {
|
||||
if (!node) return undefined;
|
||||
|
||||
if (isTypeNode(node) && isTypeReferenceType(node.parent)) {
|
||||
return checker.getTypeArgumentConstraint(node);
|
||||
if (isTypeNode(node)) {
|
||||
const constraint = checker.getTypeArgumentConstraint(node);
|
||||
if (constraint) return constraint;
|
||||
}
|
||||
|
||||
const t = getConstraintOfTypeArgumentProperty(node.parent, checker);
|
||||
@@ -5779,10 +5783,19 @@ function getConstraintOfTypeArgumentProperty(node: Node, checker: TypeChecker):
|
||||
switch (node.kind) {
|
||||
case SyntaxKind.PropertySignature:
|
||||
return checker.getTypeOfPropertyOfContextualType(t, (node as PropertySignature).symbol.escapedName);
|
||||
case SyntaxKind.ColonToken:
|
||||
if (node.parent.kind === SyntaxKind.PropertySignature) {
|
||||
// The cursor is at a property value location like `Foo<{ x: | }`.
|
||||
// `t` already refers to the appropriate property type.
|
||||
return t;
|
||||
}
|
||||
break;
|
||||
case SyntaxKind.IntersectionType:
|
||||
case SyntaxKind.TypeLiteral:
|
||||
case SyntaxKind.UnionType:
|
||||
return t;
|
||||
case SyntaxKind.OpenBracketToken:
|
||||
return checker.getElementTypeOfArrayType(t);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5809,7 +5822,7 @@ function isValidTrigger(sourceFile: SourceFile, triggerCharacter: CompletionsTri
|
||||
case "/":
|
||||
return !!contextToken && (isStringLiteralLike(contextToken)
|
||||
? !!tryGetImportFromModuleSpecifier(contextToken)
|
||||
: contextToken.kind === SyntaxKind.LessThanSlashToken && isJsxClosingElement(contextToken.parent));
|
||||
: contextToken.kind === SyntaxKind.SlashToken && isJsxClosingElement(contextToken.parent));
|
||||
case " ":
|
||||
return !!contextToken && isImportKeyword(contextToken) && contextToken.parent.kind === SyntaxKind.SourceFile;
|
||||
default:
|
||||
|
||||
@@ -23,6 +23,7 @@ import {
|
||||
Node,
|
||||
PatternMatcher,
|
||||
PatternMatchKind,
|
||||
Program,
|
||||
ScriptElementKind,
|
||||
SourceFile,
|
||||
SyntaxKind,
|
||||
@@ -38,7 +39,7 @@ interface RawNavigateToItem {
|
||||
}
|
||||
|
||||
/** @internal */
|
||||
export function getNavigateToItems(sourceFiles: readonly SourceFile[], checker: TypeChecker, cancellationToken: CancellationToken, searchValue: string, maxResultCount: number | undefined, excludeDtsFiles: boolean, excludeLibFiles?: boolean): NavigateToItem[] {
|
||||
export function getNavigateToItems(sourceFiles: readonly SourceFile[], checker: TypeChecker, cancellationToken: CancellationToken, searchValue: string, maxResultCount: number | undefined, excludeDtsFiles: boolean, excludeLibFiles: boolean | undefined, program: Program): NavigateToItem[] {
|
||||
const patternMatcher = createPatternMatcher(searchValue);
|
||||
if (!patternMatcher) return emptyArray;
|
||||
const rawItems: RawNavigateToItem[] = [];
|
||||
@@ -51,12 +52,12 @@ export function getNavigateToItems(sourceFiles: readonly SourceFile[], checker:
|
||||
continue;
|
||||
}
|
||||
|
||||
if (shouldExcludeFile(sourceFile, !!excludeLibFiles, singleCurrentFile)) {
|
||||
if (shouldExcludeFile(sourceFile, !!excludeLibFiles, singleCurrentFile, program)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
sourceFile.getNamedDeclarations().forEach((declarations, name) => {
|
||||
getItemsFromNamedDeclaration(patternMatcher, name, declarations, checker, sourceFile.fileName, !!excludeLibFiles, singleCurrentFile, rawItems);
|
||||
getItemsFromNamedDeclaration(patternMatcher, name, declarations, checker, sourceFile.fileName, !!excludeLibFiles, singleCurrentFile, rawItems, program);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -68,8 +69,8 @@ export function getNavigateToItems(sourceFiles: readonly SourceFile[], checker:
|
||||
* Exclude 'node_modules/' files and standard library files if 'excludeLibFiles' is true.
|
||||
* If we're in current file only mode, we don't exclude the current file, even if it is a library file.
|
||||
*/
|
||||
function shouldExcludeFile(file: SourceFile, excludeLibFiles: boolean, singleCurrentFile: SourceFile | undefined): boolean {
|
||||
return file !== singleCurrentFile && excludeLibFiles && (isInsideNodeModules(file.path) || file.hasNoDefaultLib);
|
||||
function shouldExcludeFile(file: SourceFile, excludeLibFiles: boolean, singleCurrentFile: SourceFile | undefined, program: Program): boolean {
|
||||
return file !== singleCurrentFile && excludeLibFiles && (isInsideNodeModules(file.path) || program.isSourceFileDefaultLibrary(file));
|
||||
}
|
||||
|
||||
function getItemsFromNamedDeclaration(
|
||||
@@ -81,6 +82,7 @@ function getItemsFromNamedDeclaration(
|
||||
excludeLibFiles: boolean,
|
||||
singleCurrentFile: SourceFile | undefined,
|
||||
rawItems: RawNavigateToItem[],
|
||||
program: Program,
|
||||
): void {
|
||||
// First do a quick check to see if the name of the declaration matches the
|
||||
// last portion of the (possibly) dotted name they're searching for.
|
||||
@@ -90,7 +92,7 @@ function getItemsFromNamedDeclaration(
|
||||
}
|
||||
|
||||
for (const declaration of declarations) {
|
||||
if (!shouldKeepItem(declaration, checker, excludeLibFiles, singleCurrentFile)) continue;
|
||||
if (!shouldKeepItem(declaration, checker, excludeLibFiles, singleCurrentFile, program)) continue;
|
||||
|
||||
if (patternMatcher.patternContainsDots) {
|
||||
// If the pattern has dots in it, then also see if the declaration container matches as well.
|
||||
@@ -110,6 +112,7 @@ function shouldKeepItem(
|
||||
checker: TypeChecker,
|
||||
excludeLibFiles: boolean,
|
||||
singleCurrentFile: SourceFile | undefined,
|
||||
program: Program,
|
||||
): boolean {
|
||||
switch (declaration.kind) {
|
||||
case SyntaxKind.ImportClause:
|
||||
@@ -118,7 +121,7 @@ function shouldKeepItem(
|
||||
const importer = checker.getSymbolAtLocation((declaration as ImportClause | ImportSpecifier | ImportEqualsDeclaration).name!)!; // TODO: GH#18217
|
||||
const imported = checker.getAliasedSymbol(importer);
|
||||
return importer.escapedName !== imported.escapedName
|
||||
&& !imported.declarations?.every(d => shouldExcludeFile(d.getSourceFile(), excludeLibFiles, singleCurrentFile));
|
||||
&& !imported.declarations?.every(d => shouldExcludeFile(d.getSourceFile(), excludeLibFiles, singleCurrentFile, program));
|
||||
default:
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -22,7 +22,6 @@ export function preProcessFile(sourceText: string, readImportFiles = true, detec
|
||||
typeReferenceDirectives: [],
|
||||
libReferenceDirectives: [],
|
||||
amdDependencies: [],
|
||||
hasNoDefaultLib: undefined,
|
||||
moduleName: undefined,
|
||||
};
|
||||
const importedFiles: FileReference[] = [];
|
||||
@@ -429,7 +428,7 @@ export function preProcessFile(sourceText: string, readImportFiles = true, detec
|
||||
importedFiles.push(decl.ref);
|
||||
}
|
||||
}
|
||||
return { referencedFiles: pragmaContext.referencedFiles, typeReferenceDirectives: pragmaContext.typeReferenceDirectives, libReferenceDirectives: pragmaContext.libReferenceDirectives, importedFiles, isLibFile: !!pragmaContext.hasNoDefaultLib, ambientExternalModules: undefined };
|
||||
return { referencedFiles: pragmaContext.referencedFiles, typeReferenceDirectives: pragmaContext.typeReferenceDirectives, libReferenceDirectives: pragmaContext.libReferenceDirectives, importedFiles, isLibFile: false, ambientExternalModules: undefined };
|
||||
}
|
||||
else {
|
||||
// for global scripts ambient modules still can have augmentations - look for ambient modules with depth > 0
|
||||
@@ -447,6 +446,6 @@ export function preProcessFile(sourceText: string, readImportFiles = true, detec
|
||||
}
|
||||
}
|
||||
}
|
||||
return { referencedFiles: pragmaContext.referencedFiles, typeReferenceDirectives: pragmaContext.typeReferenceDirectives, libReferenceDirectives: pragmaContext.libReferenceDirectives, importedFiles, isLibFile: !!pragmaContext.hasNoDefaultLib, ambientExternalModules: ambientModuleNames };
|
||||
return { referencedFiles: pragmaContext.referencedFiles, typeReferenceDirectives: pragmaContext.typeReferenceDirectives, libReferenceDirectives: pragmaContext.libReferenceDirectives, importedFiles, isLibFile: false, ambientExternalModules: ambientModuleNames };
|
||||
}
|
||||
}
|
||||
|
||||
@@ -504,9 +504,8 @@ function createChildren(node: Node, sourceFile: SourceFileLike | undefined): rea
|
||||
});
|
||||
return children;
|
||||
}
|
||||
const languageVariant = sourceFile?.languageVariant ?? LanguageVariant.Standard;
|
||||
|
||||
scanner.setText((sourceFile || node.getSourceFile()).text);
|
||||
scanner.setLanguageVariant(languageVariant);
|
||||
let pos = node.pos;
|
||||
const processNode = (child: Node) => {
|
||||
addSyntheticNodes(children, pos, child.pos, node);
|
||||
@@ -527,7 +526,6 @@ function createChildren(node: Node, sourceFile: SourceFileLike | undefined): rea
|
||||
node.forEachChild(processNode, processNodes);
|
||||
addSyntheticNodes(children, pos, node.end, node);
|
||||
scanner.setText(undefined);
|
||||
scanner.setLanguageVariant(LanguageVariant.Standard);
|
||||
return children;
|
||||
}
|
||||
|
||||
@@ -2484,7 +2482,7 @@ export function createLanguageService(
|
||||
function getNavigateToItems(searchValue: string, maxResultCount?: number, fileName?: string, excludeDtsFiles = false, excludeLibFiles = false): NavigateToItem[] {
|
||||
synchronizeHostData();
|
||||
const sourceFiles = fileName ? [getValidSourceFile(fileName)] : program.getSourceFiles();
|
||||
return NavigateTo.getNavigateToItems(sourceFiles, program.getTypeChecker(), cancellationToken, searchValue, maxResultCount, excludeDtsFiles, excludeLibFiles);
|
||||
return NavigateTo.getNavigateToItems(sourceFiles, program.getTypeChecker(), cancellationToken, searchValue, maxResultCount, excludeDtsFiles, excludeLibFiles, program);
|
||||
}
|
||||
|
||||
function getEmitOutput(fileName: string, emitOnlyDtsFiles?: boolean, forceDtsEmit?: boolean) {
|
||||
|
||||
@@ -3,6 +3,7 @@ import {
|
||||
createCompletionDetails,
|
||||
createCompletionDetailsForSymbol,
|
||||
getCompletionEntriesFromSymbols,
|
||||
getConstraintOfTypeArgumentProperty,
|
||||
getDefaultCommitCharacters,
|
||||
getPropertiesForObjectExpression,
|
||||
Log,
|
||||
@@ -509,7 +510,12 @@ function getStringLiteralCompletionEntries(sourceFile: SourceFile, node: StringL
|
||||
|
||||
function fromUnionableLiteralType(grandParent: Node): StringLiteralCompletionsFromTypes | StringLiteralCompletionsFromProperties | undefined {
|
||||
switch (grandParent.kind) {
|
||||
case SyntaxKind.CallExpression:
|
||||
case SyntaxKind.ExpressionWithTypeArguments:
|
||||
case SyntaxKind.JsxOpeningElement:
|
||||
case SyntaxKind.JsxSelfClosingElement:
|
||||
case SyntaxKind.NewExpression:
|
||||
case SyntaxKind.TaggedTemplateExpression:
|
||||
case SyntaxKind.TypeReference: {
|
||||
const typeArgument = findAncestor(parent, n => n.parent === grandParent) as LiteralTypeNode;
|
||||
if (typeArgument) {
|
||||
@@ -529,6 +535,8 @@ function getStringLiteralCompletionEntries(sourceFile: SourceFile, node: StringL
|
||||
return undefined;
|
||||
}
|
||||
return stringLiteralCompletionsFromProperties(typeChecker.getTypeFromTypeNode(objectType));
|
||||
case SyntaxKind.PropertySignature:
|
||||
return { kind: StringLiteralCompletionKind.Types, types: getStringLiteralTypes(getConstraintOfTypeArgumentProperty(grandParent, typeChecker)), isNewIdentifier: false };
|
||||
case SyntaxKind.UnionType: {
|
||||
const result = fromUnionableLiteralType(walkUpParentheses(grandParent.parent));
|
||||
if (!result) {
|
||||
|
||||
@@ -89,8 +89,7 @@ export function transpileDeclaration(input: string, transpileOptions: TranspileO
|
||||
// at least a minimal `lib` available, since the checker will `any` their types without these defined.
|
||||
// Late bound symbol names, in particular, are impossible to define without `Symbol` at least partially defined.
|
||||
// TODO: This should *probably* just load the full, real `lib` for the `target`.
|
||||
const barebonesLibContent = `/// <reference no-default-lib="true"/>
|
||||
interface Boolean {}
|
||||
const barebonesLibContent = `interface Boolean {}
|
||||
interface Function {}
|
||||
interface CallableFunction {}
|
||||
interface NewableFunction {}
|
||||
@@ -152,6 +151,10 @@ function transpileWorker(input: string, transpileOptions: TranspileOptions, decl
|
||||
options.declarationMap = false;
|
||||
}
|
||||
|
||||
// When transpiling declartions, we need libs.
|
||||
// getDefaultLibFileName will cause barebonesLib to be used.
|
||||
options.noLib = !declaration;
|
||||
|
||||
const newLine = getNewLineCharacter(options);
|
||||
// Create a compilerHost object to allow the compiler to read and write files
|
||||
const compilerHost: CompilerHost = {
|
||||
@@ -201,8 +204,7 @@ function transpileWorker(input: string, transpileOptions: TranspileOptions, decl
|
||||
let outputText: string | undefined;
|
||||
let sourceMapText: string | undefined;
|
||||
|
||||
const inputs = declaration ? [inputFileName, barebonesLibName] : [inputFileName];
|
||||
const program = createProgram(inputs, options, compilerHost);
|
||||
const program = createProgram([inputFileName], options, compilerHost);
|
||||
|
||||
if (transpileOptions.reportDiagnostics) {
|
||||
addRange(/*to*/ diagnostics, /*from*/ program.getSyntacticDiagnostics(sourceFile));
|
||||
|
||||
@@ -248,6 +248,7 @@ export interface PreProcessedFileInfo {
|
||||
libReferenceDirectives: FileReference[];
|
||||
importedFiles: FileReference[];
|
||||
ambientExternalModules?: string[];
|
||||
/** @deprecated Always false. Use a Program to determine if a file is a lib file. */
|
||||
isLibFile: boolean;
|
||||
}
|
||||
|
||||
|
||||
@@ -1889,7 +1889,7 @@ export function isInsideJsxElementOrAttribute(sourceFile: SourceFile, position:
|
||||
}
|
||||
|
||||
// <div>|</div>
|
||||
if (token.kind === SyntaxKind.LessThanSlashToken && token.parent.kind === SyntaxKind.JsxClosingElement) {
|
||||
if (token.kind === SyntaxKind.LessThanToken && token.parent.kind === SyntaxKind.JsxClosingElement) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -1934,7 +1934,6 @@ export function isInsideJsxElement(sourceFile: SourceFile, position: number): bo
|
||||
|| node.kind === SyntaxKind.CloseBraceToken
|
||||
|| node.kind === SyntaxKind.OpenBraceToken
|
||||
|| node.kind === SyntaxKind.SlashToken
|
||||
|| node.kind === SyntaxKind.LessThanSlashToken
|
||||
) {
|
||||
node = node.parent;
|
||||
}
|
||||
|
||||
@@ -126,7 +126,7 @@ export function createTestCompilerHost(texts: readonly NamedSourceText[], target
|
||||
getTrace: () => trace,
|
||||
clearTrace: () => trace.length = 0,
|
||||
getSourceFile: fileName => filesByPath.get(ts.toPath(fileName, currentDirectory, getCanonicalFileName)),
|
||||
getDefaultLibFileName: () => "lib.d.ts",
|
||||
getDefaultLibFileName: () => "",
|
||||
writeFile: ts.notImplemented,
|
||||
getCurrentDirectory: () => currentDirectory,
|
||||
getDirectories: () => [],
|
||||
|
||||
@@ -72,8 +72,7 @@ import {
|
||||
|
||||
export const libFile: File = {
|
||||
path: getPathForTypeScriptTestLocation("lib.d.ts"),
|
||||
content: `/// <reference no-default-lib="true"/>
|
||||
interface Boolean {}
|
||||
content: `interface Boolean {}
|
||||
interface Function {}
|
||||
interface CallableFunction {}
|
||||
interface NewableFunction {}
|
||||
|
||||
@@ -423,5 +423,311 @@ describe("unittests:: PrinterAPI", () => {
|
||||
),
|
||||
ts.createSourceFile("source.ts", "", ts.ScriptTarget.ESNext),
|
||||
));
|
||||
|
||||
printsCorrectly("binaryBarBarExpressionWithLeftBinaryQuestionQuestionExpression", {}, printer =>
|
||||
printer.printNode(
|
||||
ts.EmitHint.Unspecified,
|
||||
ts.factory.createExpressionStatement(
|
||||
ts.factory.createBinaryExpression(
|
||||
ts.factory.createBinaryExpression(
|
||||
ts.factory.createIdentifier("a"),
|
||||
ts.factory.createToken(ts.SyntaxKind.QuestionQuestionToken),
|
||||
ts.factory.createIdentifier("b"),
|
||||
),
|
||||
ts.factory.createToken(ts.SyntaxKind.BarBarToken),
|
||||
ts.factory.createIdentifier("c"),
|
||||
),
|
||||
),
|
||||
ts.createSourceFile("source.ts", "", ts.ScriptTarget.ESNext),
|
||||
));
|
||||
|
||||
printsCorrectly("binaryAmpersandAmpersandExpressionWithLeftBinaryQuestionQuestionExpression", {}, printer =>
|
||||
printer.printNode(
|
||||
ts.EmitHint.Unspecified,
|
||||
ts.factory.createExpressionStatement(
|
||||
ts.factory.createBinaryExpression(
|
||||
ts.factory.createBinaryExpression(
|
||||
ts.factory.createIdentifier("a"),
|
||||
ts.factory.createToken(ts.SyntaxKind.QuestionQuestionToken),
|
||||
ts.factory.createIdentifier("b"),
|
||||
),
|
||||
ts.factory.createToken(ts.SyntaxKind.AmpersandAmpersandToken),
|
||||
ts.factory.createIdentifier("c"),
|
||||
),
|
||||
),
|
||||
ts.createSourceFile("source.ts", "", ts.ScriptTarget.ESNext),
|
||||
));
|
||||
|
||||
printsCorrectly("binaryBarBarExpressionWithRightBinaryQuestionQuestionExpression", {}, printer =>
|
||||
printer.printNode(
|
||||
ts.EmitHint.Unspecified,
|
||||
ts.factory.createExpressionStatement(
|
||||
ts.factory.createBinaryExpression(
|
||||
ts.factory.createIdentifier("a"),
|
||||
ts.factory.createToken(ts.SyntaxKind.BarBarToken),
|
||||
ts.factory.createBinaryExpression(
|
||||
ts.factory.createIdentifier("b"),
|
||||
ts.factory.createToken(ts.SyntaxKind.QuestionQuestionToken),
|
||||
ts.factory.createIdentifier("c"),
|
||||
),
|
||||
),
|
||||
),
|
||||
ts.createSourceFile("source.ts", "", ts.ScriptTarget.ESNext),
|
||||
));
|
||||
|
||||
printsCorrectly("binaryAmpersandAmpersandExpressionWithRightBinaryQuestionQuestionExpression", {}, printer =>
|
||||
printer.printNode(
|
||||
ts.EmitHint.Unspecified,
|
||||
ts.factory.createExpressionStatement(
|
||||
ts.factory.createBinaryExpression(
|
||||
ts.factory.createIdentifier("a"),
|
||||
ts.factory.createToken(ts.SyntaxKind.AmpersandAmpersandToken),
|
||||
ts.factory.createBinaryExpression(
|
||||
ts.factory.createIdentifier("b"),
|
||||
ts.factory.createToken(ts.SyntaxKind.QuestionQuestionToken),
|
||||
ts.factory.createIdentifier("c"),
|
||||
),
|
||||
),
|
||||
),
|
||||
ts.createSourceFile("source.ts", "", ts.ScriptTarget.ESNext),
|
||||
));
|
||||
|
||||
printsCorrectly("binaryQuestionQuestionExpressionWithLeftBinaryBarBarExpression", {}, printer =>
|
||||
printer.printNode(
|
||||
ts.EmitHint.Unspecified,
|
||||
ts.factory.createExpressionStatement(
|
||||
ts.factory.createBinaryExpression(
|
||||
ts.factory.createBinaryExpression(
|
||||
ts.factory.createIdentifier("a"),
|
||||
ts.factory.createToken(ts.SyntaxKind.BarBarToken),
|
||||
ts.factory.createIdentifier("b"),
|
||||
),
|
||||
ts.factory.createToken(ts.SyntaxKind.QuestionQuestionToken),
|
||||
ts.factory.createIdentifier("c"),
|
||||
),
|
||||
),
|
||||
ts.createSourceFile("source.ts", "", ts.ScriptTarget.ESNext),
|
||||
));
|
||||
|
||||
printsCorrectly("binaryQuestionQuestionExpressionWithLeftBinaryAmpersandAmpersandExpression", {}, printer =>
|
||||
printer.printNode(
|
||||
ts.EmitHint.Unspecified,
|
||||
ts.factory.createExpressionStatement(
|
||||
ts.factory.createBinaryExpression(
|
||||
ts.factory.createBinaryExpression(
|
||||
ts.factory.createIdentifier("a"),
|
||||
ts.factory.createToken(ts.SyntaxKind.AmpersandAmpersandToken),
|
||||
ts.factory.createIdentifier("b"),
|
||||
),
|
||||
ts.factory.createToken(ts.SyntaxKind.QuestionQuestionToken),
|
||||
ts.factory.createIdentifier("c"),
|
||||
),
|
||||
),
|
||||
ts.createSourceFile("source.ts", "", ts.ScriptTarget.ESNext),
|
||||
));
|
||||
|
||||
printsCorrectly("binaryQuestionQuestionExpressionWithRightBinaryBarBarExpression", {}, printer =>
|
||||
printer.printNode(
|
||||
ts.EmitHint.Unspecified,
|
||||
ts.factory.createExpressionStatement(
|
||||
ts.factory.createBinaryExpression(
|
||||
ts.factory.createIdentifier("a"),
|
||||
ts.factory.createToken(ts.SyntaxKind.QuestionQuestionToken),
|
||||
ts.factory.createBinaryExpression(
|
||||
ts.factory.createIdentifier("b"),
|
||||
ts.factory.createToken(ts.SyntaxKind.BarBarToken),
|
||||
ts.factory.createIdentifier("c"),
|
||||
),
|
||||
),
|
||||
),
|
||||
ts.createSourceFile("source.ts", "", ts.ScriptTarget.ESNext),
|
||||
));
|
||||
|
||||
printsCorrectly("binaryQuestionQuestionExpressionWithRightBinaryAmpersandAmpersandExpression", {}, printer =>
|
||||
printer.printNode(
|
||||
ts.EmitHint.Unspecified,
|
||||
ts.factory.createExpressionStatement(
|
||||
ts.factory.createBinaryExpression(
|
||||
ts.factory.createIdentifier("a"),
|
||||
ts.factory.createToken(ts.SyntaxKind.QuestionQuestionToken),
|
||||
ts.factory.createBinaryExpression(
|
||||
ts.factory.createIdentifier("b"),
|
||||
ts.factory.createToken(ts.SyntaxKind.AmpersandAmpersandToken),
|
||||
ts.factory.createIdentifier("c"),
|
||||
),
|
||||
),
|
||||
),
|
||||
ts.createSourceFile("source.ts", "", ts.ScriptTarget.ESNext),
|
||||
));
|
||||
|
||||
printsCorrectly("binaryQuestionQuestionExpressionWithLeftBinaryQuestionQuestionExpression", {}, printer =>
|
||||
printer.printNode(
|
||||
ts.EmitHint.Unspecified,
|
||||
ts.factory.createExpressionStatement(
|
||||
ts.factory.createBinaryExpression(
|
||||
ts.factory.createBinaryExpression(
|
||||
ts.factory.createIdentifier("a"),
|
||||
ts.factory.createToken(ts.SyntaxKind.QuestionQuestionToken),
|
||||
ts.factory.createIdentifier("b"),
|
||||
),
|
||||
ts.factory.createToken(ts.SyntaxKind.QuestionQuestionToken),
|
||||
ts.factory.createIdentifier("c"),
|
||||
),
|
||||
),
|
||||
ts.createSourceFile("source.ts", "", ts.ScriptTarget.ESNext),
|
||||
));
|
||||
|
||||
printsCorrectly("binaryQuestionQuestionExpressionWithRightBinaryQuestionQuestionExpression", {}, printer =>
|
||||
printer.printNode(
|
||||
ts.EmitHint.Unspecified,
|
||||
ts.factory.createExpressionStatement(
|
||||
ts.factory.createBinaryExpression(
|
||||
ts.factory.createIdentifier("a"),
|
||||
ts.factory.createToken(ts.SyntaxKind.QuestionQuestionToken),
|
||||
ts.factory.createBinaryExpression(
|
||||
ts.factory.createIdentifier("b"),
|
||||
ts.factory.createToken(ts.SyntaxKind.QuestionQuestionToken),
|
||||
ts.factory.createIdentifier("c"),
|
||||
),
|
||||
),
|
||||
),
|
||||
ts.createSourceFile("source.ts", "", ts.ScriptTarget.ESNext),
|
||||
));
|
||||
|
||||
printsCorrectly("binaryCommaExpressionWithLeftBinaryQuestionQuestionExpression", {}, printer =>
|
||||
printer.printNode(
|
||||
ts.EmitHint.Unspecified,
|
||||
ts.factory.createExpressionStatement(
|
||||
ts.factory.createBinaryExpression(
|
||||
ts.factory.createBinaryExpression(
|
||||
ts.factory.createIdentifier("a"),
|
||||
ts.factory.createToken(ts.SyntaxKind.QuestionQuestionToken),
|
||||
ts.factory.createIdentifier("b"),
|
||||
),
|
||||
ts.factory.createToken(ts.SyntaxKind.CommaToken),
|
||||
ts.factory.createIdentifier("c"),
|
||||
),
|
||||
),
|
||||
ts.createSourceFile("source.ts", "", ts.ScriptTarget.ESNext),
|
||||
));
|
||||
|
||||
printsCorrectly("binaryCommaExpressionWithRightBinaryQuestionQuestionExpression", {}, printer =>
|
||||
printer.printNode(
|
||||
ts.EmitHint.Unspecified,
|
||||
ts.factory.createExpressionStatement(
|
||||
ts.factory.createBinaryExpression(
|
||||
ts.factory.createIdentifier("a"),
|
||||
ts.factory.createToken(ts.SyntaxKind.CommaToken),
|
||||
ts.factory.createBinaryExpression(
|
||||
ts.factory.createIdentifier("b"),
|
||||
ts.factory.createToken(ts.SyntaxKind.QuestionQuestionToken),
|
||||
ts.factory.createIdentifier("c"),
|
||||
),
|
||||
),
|
||||
),
|
||||
ts.createSourceFile("source.ts", "", ts.ScriptTarget.ESNext),
|
||||
));
|
||||
|
||||
printsCorrectly("binaryEqualsEqualsExpressionWithLeftBinaryQuestionQuestionExpression", {}, printer =>
|
||||
printer.printNode(
|
||||
ts.EmitHint.Unspecified,
|
||||
ts.factory.createExpressionStatement(
|
||||
ts.factory.createBinaryExpression(
|
||||
ts.factory.createBinaryExpression(
|
||||
ts.factory.createIdentifier("a"),
|
||||
ts.factory.createToken(ts.SyntaxKind.QuestionQuestionToken),
|
||||
ts.factory.createIdentifier("b"),
|
||||
),
|
||||
ts.factory.createToken(ts.SyntaxKind.EqualsEqualsToken),
|
||||
ts.factory.createIdentifier("c"),
|
||||
),
|
||||
),
|
||||
ts.createSourceFile("source.ts", "", ts.ScriptTarget.ESNext),
|
||||
));
|
||||
|
||||
printsCorrectly("binaryEqualsEqualsExpressionWithRightBinaryQuestionQuestionExpression", {}, printer =>
|
||||
printer.printNode(
|
||||
ts.EmitHint.Unspecified,
|
||||
ts.factory.createExpressionStatement(
|
||||
ts.factory.createBinaryExpression(
|
||||
ts.factory.createIdentifier("a"),
|
||||
ts.factory.createToken(ts.SyntaxKind.EqualsEqualsToken),
|
||||
ts.factory.createBinaryExpression(
|
||||
ts.factory.createIdentifier("b"),
|
||||
ts.factory.createToken(ts.SyntaxKind.QuestionQuestionToken),
|
||||
ts.factory.createIdentifier("c"),
|
||||
),
|
||||
),
|
||||
),
|
||||
ts.createSourceFile("source.ts", "", ts.ScriptTarget.ESNext),
|
||||
));
|
||||
|
||||
printsCorrectly("binaryQuestionQuestionExpressionWithLeftBinaryCommaExpression", {}, printer =>
|
||||
printer.printNode(
|
||||
ts.EmitHint.Unspecified,
|
||||
ts.factory.createExpressionStatement(
|
||||
ts.factory.createBinaryExpression(
|
||||
ts.factory.createBinaryExpression(
|
||||
ts.factory.createIdentifier("a"),
|
||||
ts.factory.createToken(ts.SyntaxKind.CommaToken),
|
||||
ts.factory.createIdentifier("b"),
|
||||
),
|
||||
ts.factory.createToken(ts.SyntaxKind.QuestionQuestionToken),
|
||||
ts.factory.createIdentifier("c"),
|
||||
),
|
||||
),
|
||||
ts.createSourceFile("source.ts", "", ts.ScriptTarget.ESNext),
|
||||
));
|
||||
|
||||
printsCorrectly("binaryQuestionQuestionExpressionWithRightBinaryCommaExpression", {}, printer =>
|
||||
printer.printNode(
|
||||
ts.EmitHint.Unspecified,
|
||||
ts.factory.createExpressionStatement(
|
||||
ts.factory.createBinaryExpression(
|
||||
ts.factory.createIdentifier("a"),
|
||||
ts.factory.createToken(ts.SyntaxKind.QuestionQuestionToken),
|
||||
ts.factory.createBinaryExpression(
|
||||
ts.factory.createIdentifier("b"),
|
||||
ts.factory.createToken(ts.SyntaxKind.CommaToken),
|
||||
ts.factory.createIdentifier("c"),
|
||||
),
|
||||
),
|
||||
),
|
||||
ts.createSourceFile("source.ts", "", ts.ScriptTarget.ESNext),
|
||||
));
|
||||
|
||||
printsCorrectly("binaryQuestionQuestionExpressionWithLeftBinaryEqualsEqualsExpression", {}, printer =>
|
||||
printer.printNode(
|
||||
ts.EmitHint.Unspecified,
|
||||
ts.factory.createExpressionStatement(
|
||||
ts.factory.createBinaryExpression(
|
||||
ts.factory.createBinaryExpression(
|
||||
ts.factory.createIdentifier("a"),
|
||||
ts.factory.createToken(ts.SyntaxKind.EqualsEqualsToken),
|
||||
ts.factory.createIdentifier("b"),
|
||||
),
|
||||
ts.factory.createToken(ts.SyntaxKind.QuestionQuestionToken),
|
||||
ts.factory.createIdentifier("c"),
|
||||
),
|
||||
),
|
||||
ts.createSourceFile("source.ts", "", ts.ScriptTarget.ESNext),
|
||||
));
|
||||
|
||||
printsCorrectly("binaryQuestionQuestionExpressionWithRightBinaryEqualsEqualsExpression", {}, printer =>
|
||||
printer.printNode(
|
||||
ts.EmitHint.Unspecified,
|
||||
ts.factory.createExpressionStatement(
|
||||
ts.factory.createBinaryExpression(
|
||||
ts.factory.createIdentifier("a"),
|
||||
ts.factory.createToken(ts.SyntaxKind.QuestionQuestionToken),
|
||||
ts.factory.createBinaryExpression(
|
||||
ts.factory.createIdentifier("b"),
|
||||
ts.factory.createToken(ts.SyntaxKind.EqualsEqualsToken),
|
||||
ts.factory.createIdentifier("c"),
|
||||
),
|
||||
),
|
||||
),
|
||||
ts.createSourceFile("source.ts", "", ts.ScriptTarget.ESNext),
|
||||
));
|
||||
});
|
||||
});
|
||||
|
||||
@@ -358,9 +358,7 @@ describe("unittests:: reuseProgramStructure:: General", () => {
|
||||
const baselines: string[] = [];
|
||||
baselineProgram(baselines, initialProgram);
|
||||
|
||||
const afterNpmInstallProgram = updateProgram(initialProgram, rootFiles.map(f => f.name), options, f => {
|
||||
f[1].text = f[1].text.updateReferences(`/// <reference no-default-lib="true"/>`);
|
||||
}, filesAfterNpmInstall);
|
||||
const afterNpmInstallProgram = updateProgram(initialProgram, rootFiles.map(f => f.name), options, ts.noop, filesAfterNpmInstall);
|
||||
baselineProgram(baselines, afterNpmInstallProgram);
|
||||
|
||||
runBaseline("fetches imports after npm install", baselines);
|
||||
@@ -400,7 +398,7 @@ describe("unittests:: reuseProgramStructure:: General", () => {
|
||||
{
|
||||
name: "f1.ts",
|
||||
text: SourceText.New(
|
||||
`/// <reference path="a1.ts"/>${newLine}/// <reference types="typerefs1"/>${newLine}/// <reference no-default-lib="true"/>`,
|
||||
`/// <reference path="a1.ts"/>${newLine}/// <reference types="typerefs1"/>`,
|
||||
`import { B } from './b1';${newLine}export let BB = B;`,
|
||||
"declare module './b1' { interface B { y: string; } }",
|
||||
),
|
||||
|
||||
@@ -14,8 +14,7 @@ import {
|
||||
|
||||
const libFile: File = {
|
||||
path: vfsWatch_LibFile.path,
|
||||
content: `/// <reference no-default-lib="true"/>
|
||||
interface Boolean {}
|
||||
content: `interface Boolean {}
|
||||
interface Function {}
|
||||
interface IArguments {}
|
||||
interface Number { toExponential: any; }
|
||||
|
||||
@@ -2,7 +2,7 @@ import * as Harness from "../../../_namespaces/Harness.js";
|
||||
import * as ts from "../../../_namespaces/ts.js";
|
||||
|
||||
describe("unittests:: services:: extract:: Symbol Walker", () => {
|
||||
function test(description: string, source: string, verifier: (file: ts.SourceFile, checker: ts.TypeChecker) => void) {
|
||||
function test(description: string, source: string, verifier: (file: ts.SourceFile, checker: ts.TypeChecker, program: ts.Program) => void) {
|
||||
it(description, () => {
|
||||
const result = Harness.Compiler.compileFiles(
|
||||
[{
|
||||
@@ -16,7 +16,7 @@ describe("unittests:: services:: extract:: Symbol Walker", () => {
|
||||
);
|
||||
const file = result.program!.getSourceFile("main.ts")!;
|
||||
const checker = result.program!.getTypeChecker();
|
||||
verifier(file, checker);
|
||||
verifier(file, checker, result.program!);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -29,13 +29,13 @@ interface Bar {
|
||||
history: Bar[];
|
||||
}
|
||||
export default function foo(a: number, b: Bar): void {}`,
|
||||
(file, checker) => {
|
||||
(file, checker, program) => {
|
||||
let foundCount = 0;
|
||||
let stdLibRefSymbols = 0;
|
||||
const expectedSymbols = ["default", "a", "b", "Bar", "x", "y", "history"];
|
||||
const walker = checker.getSymbolWalker(symbol => {
|
||||
const isStdLibSymbol = ts.forEach(symbol.declarations, d => {
|
||||
return ts.getSourceFileOfNode(d).hasNoDefaultLib;
|
||||
return program.isSourceFileDefaultLibrary(ts.getSourceFileOfNode(d));
|
||||
});
|
||||
if (isStdLibSymbol) {
|
||||
stdLibRefSymbols++;
|
||||
|
||||
@@ -91,6 +91,68 @@ describe("unittests:: tsbuild:: moduleResolution:: handles the modules and optio
|
||||
}),
|
||||
commandLineArgs: ["-b", "packages/pkg1.tsconfig.json", "packages/pkg2.tsconfig.json", "--verbose", "--traceResolution"],
|
||||
});
|
||||
|
||||
verifyTsc({
|
||||
scenario: "moduleResolution",
|
||||
subScenario: "resolution from d.ts of referenced project",
|
||||
sys: () =>
|
||||
TestServerHost.createWatchedSystem({
|
||||
"/home/src/workspaces/project/common.d.ts": "export type OnValue = (value: number) => void",
|
||||
"/home/src/workspaces/project/producer/index.ts": dedent`
|
||||
export { ValueProducerDeclaration } from "./in-js"
|
||||
import { OnValue } from "@common"
|
||||
export interface ValueProducerFromTs {
|
||||
onValue: OnValue;
|
||||
}
|
||||
`,
|
||||
"/home/src/workspaces/project/producer/in-js.d.ts": dedent`
|
||||
import { OnValue } from "@common"
|
||||
export interface ValueProducerDeclaration {
|
||||
onValue: OnValue;
|
||||
}
|
||||
`,
|
||||
"/home/src/workspaces/project/producer/tsconfig.json": jsonToReadableText({
|
||||
compilerOptions: {
|
||||
strict: true,
|
||||
composite: true,
|
||||
module: "nodenext",
|
||||
moduleResolution: "nodenext",
|
||||
paths: {
|
||||
"@common": ["../common.d.ts"],
|
||||
},
|
||||
libReplacement: false,
|
||||
},
|
||||
}),
|
||||
"/home/src/workspaces/project/consumer/index.ts": dedent`
|
||||
import { ValueProducerDeclaration, ValueProducerFromTs } from "@producer"
|
||||
declare let v: ValueProducerDeclaration;
|
||||
// n is implicitly any because onValue is actually any (despite what the tooltip says)
|
||||
v.onValue = (n) => {
|
||||
|
||||
}
|
||||
|
||||
// n is implicitly number as expected
|
||||
declare let v2: ValueProducerFromTs;
|
||||
v2.onValue = (n) => {
|
||||
|
||||
}`,
|
||||
"/home/src/workspaces/project/consumer/tsconfig.json": jsonToReadableText({
|
||||
compilerOptions: {
|
||||
strict: true,
|
||||
module: "nodenext",
|
||||
moduleResolution: "nodenext",
|
||||
paths: {
|
||||
"@producer": ["../producer/index"],
|
||||
},
|
||||
libReplacement: false,
|
||||
},
|
||||
references: [
|
||||
{ path: "../producer" },
|
||||
],
|
||||
}),
|
||||
}),
|
||||
commandLineArgs: ["--b", "consumer", "--traceResolution", "-v"],
|
||||
});
|
||||
});
|
||||
|
||||
describe("unittests:: tsbuild:: moduleResolution:: impliedNodeFormat differs between projects for shared file", () => {
|
||||
|
||||
@@ -504,13 +504,11 @@ class someClass2 { }`,
|
||||
modifySystem: sys => {
|
||||
sys.writeFile(
|
||||
getTypeScriptLibTestLocation("esnext.full"),
|
||||
`/// <reference no-default-lib="true"/>
|
||||
/// <reference lib="esnext" />`,
|
||||
`/// <reference lib="esnext" />`,
|
||||
);
|
||||
sys.writeFile(
|
||||
libFile.path,
|
||||
`/// <reference no-default-lib="true"/>
|
||||
/// <reference lib="esnext" />`,
|
||||
`/// <reference lib="esnext" />`,
|
||||
);
|
||||
sys.writeFile(
|
||||
"core/tsconfig.json",
|
||||
|
||||
@@ -297,34 +297,6 @@ declare global {
|
||||
edits: noChangeOnlyRuns,
|
||||
});
|
||||
|
||||
verifyTsc({
|
||||
scenario: "incremental",
|
||||
subScenario: "ts file with no-default-lib that augments the global scope",
|
||||
sys: () =>
|
||||
TestServerHost.createWatchedSystem({
|
||||
"/home/src/workspaces/project/src/main.ts": dedent`
|
||||
/// <reference no-default-lib="true"/>
|
||||
/// <reference lib="esnext" />
|
||||
|
||||
declare global {
|
||||
interface Test {
|
||||
}
|
||||
}
|
||||
|
||||
export {};
|
||||
`,
|
||||
"/home/src/workspaces/project/tsconfig.json": jsonToReadableText({
|
||||
compilerOptions: {
|
||||
target: "ESNext",
|
||||
module: "ESNext",
|
||||
incremental: true,
|
||||
outDir: "dist",
|
||||
},
|
||||
}),
|
||||
}),
|
||||
commandLineArgs: ["--rootDir", "src"],
|
||||
});
|
||||
|
||||
verifyTsc({
|
||||
scenario: "incremental",
|
||||
subScenario: "change to type that gets used as global through export in another file",
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import { emptyArray } from "../../_namespaces/ts.js";
|
||||
import { dedent } from "../../_namespaces/Utils.js";
|
||||
import { jsonToReadableText } from "../helpers.js";
|
||||
import {
|
||||
forEachLibResolutionScenario,
|
||||
@@ -58,25 +57,4 @@ describe("unittests:: tsc:: libraryResolution:: library file resolution", () =>
|
||||
],
|
||||
baselinePrograms: true,
|
||||
});
|
||||
|
||||
verifyTsc({
|
||||
scenario: "libraryResolution",
|
||||
subScenario: "when one of the file skips default lib inclusion",
|
||||
sys: () =>
|
||||
TestServerHost.createWatchedSystem({
|
||||
"/home/src/workspaces/project/a.d.ts": dedent`
|
||||
/// <reference no-default-lib="true"/>
|
||||
/// <reference lib="es6"/>
|
||||
declare const a = "hello";
|
||||
`,
|
||||
"/home/src/workspaces/project/b.d.ts": `export const b = 10;`,
|
||||
"/home/src/workspaces/project/tsconfig.json": jsonToReadableText({
|
||||
compilerOptions: {
|
||||
lib: ["es6", "dom"],
|
||||
},
|
||||
}),
|
||||
}),
|
||||
commandLineArgs: ["-i", "--explainFiles"],
|
||||
baselinePrograms: true,
|
||||
});
|
||||
});
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
+1
-1
@@ -1,7 +1,7 @@
|
||||
//// [tests/cases/conformance/internalModules/DeclarationMerging/AmbientModuleAndAmbientFunctionWithTheSameNameAndCommonRoot.ts] ////
|
||||
|
||||
//// [module.d.ts]
|
||||
declare module Point {
|
||||
declare namespace Point {
|
||||
export var Origin: { x: number; y: number; }
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
//// [tests/cases/conformance/internalModules/DeclarationMerging/AmbientModuleAndAmbientFunctionWithTheSameNameAndCommonRoot.ts] ////
|
||||
|
||||
=== module.d.ts ===
|
||||
declare module Point {
|
||||
declare namespace Point {
|
||||
>Point : Symbol(Point, Decl(module.d.ts, 0, 0), Decl(function.d.ts, 0, 0))
|
||||
|
||||
export var Origin: { x: number; y: number; }
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
//// [tests/cases/conformance/internalModules/DeclarationMerging/AmbientModuleAndAmbientFunctionWithTheSameNameAndCommonRoot.ts] ////
|
||||
|
||||
=== module.d.ts ===
|
||||
declare module Point {
|
||||
declare namespace Point {
|
||||
>Point : typeof Point
|
||||
> : ^^^^^^^^^^^^
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
//// [tests/cases/conformance/internalModules/DeclarationMerging/AmbientModuleAndAmbientWithSameNameAndCommonRoot.ts] ////
|
||||
|
||||
//// [module.d.ts]
|
||||
declare module A {
|
||||
export module Point {
|
||||
declare namespace A {
|
||||
export namespace Point {
|
||||
export var Origin: {
|
||||
x: number;
|
||||
y: number;
|
||||
@@ -11,7 +11,7 @@ declare module A {
|
||||
}
|
||||
|
||||
//// [class.d.ts]
|
||||
declare module A {
|
||||
declare namespace A {
|
||||
export class Point {
|
||||
constructor(x: number, y: number);
|
||||
x: number;
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
//// [tests/cases/conformance/internalModules/DeclarationMerging/AmbientModuleAndAmbientWithSameNameAndCommonRoot.ts] ////
|
||||
|
||||
=== module.d.ts ===
|
||||
declare module A {
|
||||
declare namespace A {
|
||||
>A : Symbol(A, Decl(module.d.ts, 0, 0), Decl(class.d.ts, 0, 0))
|
||||
|
||||
export module Point {
|
||||
>Point : Symbol(Point, Decl(module.d.ts, 0, 18), Decl(class.d.ts, 0, 18))
|
||||
export namespace Point {
|
||||
>Point : Symbol(Point, Decl(module.d.ts, 0, 21), Decl(class.d.ts, 0, 21))
|
||||
|
||||
export var Origin: {
|
||||
>Origin : Symbol(Origin, Decl(module.d.ts, 2, 18))
|
||||
@@ -20,11 +20,11 @@ declare module A {
|
||||
}
|
||||
|
||||
=== class.d.ts ===
|
||||
declare module A {
|
||||
declare namespace A {
|
||||
>A : Symbol(A, Decl(module.d.ts, 0, 0), Decl(class.d.ts, 0, 0))
|
||||
|
||||
export class Point {
|
||||
>Point : Symbol(Point, Decl(module.d.ts, 0, 18), Decl(class.d.ts, 0, 18))
|
||||
>Point : Symbol(Point, Decl(module.d.ts, 0, 21), Decl(class.d.ts, 0, 21))
|
||||
|
||||
constructor(x: number, y: number);
|
||||
>x : Symbol(x, Decl(class.d.ts, 2, 20))
|
||||
@@ -47,14 +47,14 @@ var p: { x: number; y: number; }
|
||||
var p = A.Point.Origin;
|
||||
>p : Symbol(p, Decl(test.ts, 0, 3), Decl(test.ts, 1, 3), Decl(test.ts, 2, 3))
|
||||
>A.Point.Origin : Symbol(A.Point.Origin, Decl(module.d.ts, 2, 18))
|
||||
>A.Point : Symbol(A.Point, Decl(module.d.ts, 0, 18), Decl(class.d.ts, 0, 18))
|
||||
>A.Point : Symbol(A.Point, Decl(module.d.ts, 0, 21), Decl(class.d.ts, 0, 21))
|
||||
>A : Symbol(A, Decl(module.d.ts, 0, 0), Decl(class.d.ts, 0, 0))
|
||||
>Point : Symbol(A.Point, Decl(module.d.ts, 0, 18), Decl(class.d.ts, 0, 18))
|
||||
>Point : Symbol(A.Point, Decl(module.d.ts, 0, 21), Decl(class.d.ts, 0, 21))
|
||||
>Origin : Symbol(A.Point.Origin, Decl(module.d.ts, 2, 18))
|
||||
|
||||
var p = new A.Point(0, 0); // unexpected error here, bug 840000
|
||||
>p : Symbol(p, Decl(test.ts, 0, 3), Decl(test.ts, 1, 3), Decl(test.ts, 2, 3))
|
||||
>A.Point : Symbol(A.Point, Decl(module.d.ts, 0, 18), Decl(class.d.ts, 0, 18))
|
||||
>A.Point : Symbol(A.Point, Decl(module.d.ts, 0, 21), Decl(class.d.ts, 0, 21))
|
||||
>A : Symbol(A, Decl(module.d.ts, 0, 0), Decl(class.d.ts, 0, 0))
|
||||
>Point : Symbol(A.Point, Decl(module.d.ts, 0, 18), Decl(class.d.ts, 0, 18))
|
||||
>Point : Symbol(A.Point, Decl(module.d.ts, 0, 21), Decl(class.d.ts, 0, 21))
|
||||
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
//// [tests/cases/conformance/internalModules/DeclarationMerging/AmbientModuleAndAmbientWithSameNameAndCommonRoot.ts] ////
|
||||
|
||||
=== module.d.ts ===
|
||||
declare module A {
|
||||
declare namespace A {
|
||||
>A : typeof A
|
||||
> : ^^^^^^^^
|
||||
|
||||
export module Point {
|
||||
export namespace Point {
|
||||
>Point : typeof Point
|
||||
> : ^^^^^^^^^^^^
|
||||
|
||||
@@ -25,7 +25,7 @@ declare module A {
|
||||
}
|
||||
|
||||
=== class.d.ts ===
|
||||
declare module A {
|
||||
declare namespace A {
|
||||
>A : typeof A
|
||||
> : ^^^^^^^^
|
||||
|
||||
|
||||
+3
-3
@@ -1,8 +1,8 @@
|
||||
//// [tests/cases/conformance/internalModules/DeclarationMerging/AmbientModuleAndNonAmbientClassWithSameNameAndCommonRoot.ts] ////
|
||||
|
||||
//// [module.d.ts]
|
||||
declare module A {
|
||||
export module Point {
|
||||
declare namespace A {
|
||||
export namespace Point {
|
||||
export var Origin: {
|
||||
x: number;
|
||||
y: number;
|
||||
@@ -11,7 +11,7 @@ declare module A {
|
||||
}
|
||||
|
||||
//// [classPoint.ts]
|
||||
module A {
|
||||
namespace A {
|
||||
export class Point {
|
||||
constructor(public x: number, public y: number) { }
|
||||
}
|
||||
|
||||
+9
-9
@@ -1,11 +1,11 @@
|
||||
//// [tests/cases/conformance/internalModules/DeclarationMerging/AmbientModuleAndNonAmbientClassWithSameNameAndCommonRoot.ts] ////
|
||||
|
||||
=== module.d.ts ===
|
||||
declare module A {
|
||||
declare namespace A {
|
||||
>A : Symbol(A, Decl(module.d.ts, 0, 0), Decl(classPoint.ts, 0, 0))
|
||||
|
||||
export module Point {
|
||||
>Point : Symbol(Point, Decl(module.d.ts, 0, 18), Decl(classPoint.ts, 0, 10))
|
||||
export namespace Point {
|
||||
>Point : Symbol(Point, Decl(module.d.ts, 0, 21), Decl(classPoint.ts, 0, 13))
|
||||
|
||||
export var Origin: {
|
||||
>Origin : Symbol(Origin, Decl(module.d.ts, 2, 18))
|
||||
@@ -20,11 +20,11 @@ declare module A {
|
||||
}
|
||||
|
||||
=== classPoint.ts ===
|
||||
module A {
|
||||
namespace A {
|
||||
>A : Symbol(A, Decl(module.d.ts, 0, 0), Decl(classPoint.ts, 0, 0))
|
||||
|
||||
export class Point {
|
||||
>Point : Symbol(Point, Decl(module.d.ts, 0, 18), Decl(classPoint.ts, 0, 10))
|
||||
>Point : Symbol(Point, Decl(module.d.ts, 0, 21), Decl(classPoint.ts, 0, 13))
|
||||
|
||||
constructor(public x: number, public y: number) { }
|
||||
>x : Symbol(Point.x, Decl(classPoint.ts, 2, 20))
|
||||
@@ -41,14 +41,14 @@ var p: { x: number; y: number; }
|
||||
var p = A.Point.Origin;
|
||||
>p : Symbol(p, Decl(test.ts, 0, 3), Decl(test.ts, 1, 3), Decl(test.ts, 2, 3))
|
||||
>A.Point.Origin : Symbol(A.Point.Origin, Decl(module.d.ts, 2, 18))
|
||||
>A.Point : Symbol(A.Point, Decl(module.d.ts, 0, 18), Decl(classPoint.ts, 0, 10))
|
||||
>A.Point : Symbol(A.Point, Decl(module.d.ts, 0, 21), Decl(classPoint.ts, 0, 13))
|
||||
>A : Symbol(A, Decl(module.d.ts, 0, 0), Decl(classPoint.ts, 0, 0))
|
||||
>Point : Symbol(A.Point, Decl(module.d.ts, 0, 18), Decl(classPoint.ts, 0, 10))
|
||||
>Point : Symbol(A.Point, Decl(module.d.ts, 0, 21), Decl(classPoint.ts, 0, 13))
|
||||
>Origin : Symbol(A.Point.Origin, Decl(module.d.ts, 2, 18))
|
||||
|
||||
var p = new A.Point(0, 0); // unexpected error here, bug 840000
|
||||
>p : Symbol(p, Decl(test.ts, 0, 3), Decl(test.ts, 1, 3), Decl(test.ts, 2, 3))
|
||||
>A.Point : Symbol(A.Point, Decl(module.d.ts, 0, 18), Decl(classPoint.ts, 0, 10))
|
||||
>A.Point : Symbol(A.Point, Decl(module.d.ts, 0, 21), Decl(classPoint.ts, 0, 13))
|
||||
>A : Symbol(A, Decl(module.d.ts, 0, 0), Decl(classPoint.ts, 0, 0))
|
||||
>Point : Symbol(A.Point, Decl(module.d.ts, 0, 18), Decl(classPoint.ts, 0, 10))
|
||||
>Point : Symbol(A.Point, Decl(module.d.ts, 0, 21), Decl(classPoint.ts, 0, 13))
|
||||
|
||||
|
||||
+3
-3
@@ -1,11 +1,11 @@
|
||||
//// [tests/cases/conformance/internalModules/DeclarationMerging/AmbientModuleAndNonAmbientClassWithSameNameAndCommonRoot.ts] ////
|
||||
|
||||
=== module.d.ts ===
|
||||
declare module A {
|
||||
declare namespace A {
|
||||
>A : typeof A
|
||||
> : ^^^^^^^^
|
||||
|
||||
export module Point {
|
||||
export namespace Point {
|
||||
>Point : typeof Point
|
||||
> : ^^^^^^^^^^^^
|
||||
|
||||
@@ -25,7 +25,7 @@ declare module A {
|
||||
}
|
||||
|
||||
=== classPoint.ts ===
|
||||
module A {
|
||||
namespace A {
|
||||
>A : typeof A
|
||||
> : ^^^^^^^^
|
||||
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
//// [tests/cases/conformance/internalModules/DeclarationMerging/AmbientModuleAndNonAmbientFunctionWithTheSameNameAndCommonRoot.ts] ////
|
||||
|
||||
//// [module.d.ts]
|
||||
declare module Point {
|
||||
declare namespace Point {
|
||||
export var Origin: { x: number; y: number; }
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
//// [tests/cases/conformance/internalModules/DeclarationMerging/AmbientModuleAndNonAmbientFunctionWithTheSameNameAndCommonRoot.ts] ////
|
||||
|
||||
=== module.d.ts ===
|
||||
declare module Point {
|
||||
declare namespace Point {
|
||||
>Point : Symbol(Point, Decl(module.d.ts, 0, 0), Decl(function.ts, 0, 0))
|
||||
|
||||
export var Origin: { x: number; y: number; }
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
//// [tests/cases/conformance/internalModules/DeclarationMerging/AmbientModuleAndNonAmbientFunctionWithTheSameNameAndCommonRoot.ts] ////
|
||||
|
||||
=== module.d.ts ===
|
||||
declare module Point {
|
||||
declare namespace Point {
|
||||
>Point : typeof Point
|
||||
> : ^^^^^^^^^^^^
|
||||
|
||||
|
||||
+4
-4
@@ -14,7 +14,7 @@ ClassAndModuleThatMergeWithModuleMemberThatUsesClassTypeParameter.ts(46,15): err
|
||||
value: T;
|
||||
}
|
||||
|
||||
module clodule1 {
|
||||
namespace clodule1 {
|
||||
function f(x: T) { }
|
||||
~
|
||||
!!! error TS2304: Cannot find name 'T'.
|
||||
@@ -26,7 +26,7 @@ ClassAndModuleThatMergeWithModuleMemberThatUsesClassTypeParameter.ts(46,15): err
|
||||
value: T;
|
||||
}
|
||||
|
||||
module clodule2 {
|
||||
namespace clodule2 {
|
||||
var x: T;
|
||||
~
|
||||
!!! error TS2304: Cannot find name 'T'.
|
||||
@@ -45,7 +45,7 @@ ClassAndModuleThatMergeWithModuleMemberThatUsesClassTypeParameter.ts(46,15): err
|
||||
value: T;
|
||||
}
|
||||
|
||||
module clodule3 {
|
||||
namespace clodule3 {
|
||||
export var y = { id: T };
|
||||
~
|
||||
!!! error TS2304: Cannot find name 'T'.
|
||||
@@ -57,7 +57,7 @@ ClassAndModuleThatMergeWithModuleMemberThatUsesClassTypeParameter.ts(46,15): err
|
||||
value: T;
|
||||
}
|
||||
|
||||
module clodule4 {
|
||||
namespace clodule4 {
|
||||
class D {
|
||||
name: T;
|
||||
~
|
||||
|
||||
+4
-4
@@ -9,7 +9,7 @@ class clodule1<T>{
|
||||
value: T;
|
||||
}
|
||||
|
||||
module clodule1 {
|
||||
namespace clodule1 {
|
||||
function f(x: T) { }
|
||||
}
|
||||
|
||||
@@ -19,7 +19,7 @@ class clodule2<T>{
|
||||
value: T;
|
||||
}
|
||||
|
||||
module clodule2 {
|
||||
namespace clodule2 {
|
||||
var x: T;
|
||||
|
||||
class D<U extends T>{
|
||||
@@ -34,7 +34,7 @@ class clodule3<T>{
|
||||
value: T;
|
||||
}
|
||||
|
||||
module clodule3 {
|
||||
namespace clodule3 {
|
||||
export var y = { id: T };
|
||||
}
|
||||
|
||||
@@ -44,7 +44,7 @@ class clodule4<T>{
|
||||
value: T;
|
||||
}
|
||||
|
||||
module clodule4 {
|
||||
namespace clodule4 {
|
||||
class D {
|
||||
name: T;
|
||||
}
|
||||
|
||||
+6
-6
@@ -15,11 +15,11 @@ class clodule1<T>{
|
||||
>T : Symbol(T, Decl(ClassAndModuleThatMergeWithModuleMemberThatUsesClassTypeParameter.ts, 2, 15))
|
||||
}
|
||||
|
||||
module clodule1 {
|
||||
namespace clodule1 {
|
||||
>clodule1 : Symbol(clodule1, Decl(ClassAndModuleThatMergeWithModuleMemberThatUsesClassTypeParameter.ts, 0, 0), Decl(ClassAndModuleThatMergeWithModuleMemberThatUsesClassTypeParameter.ts, 6, 1))
|
||||
|
||||
function f(x: T) { }
|
||||
>f : Symbol(f, Decl(ClassAndModuleThatMergeWithModuleMemberThatUsesClassTypeParameter.ts, 8, 17))
|
||||
>f : Symbol(f, Decl(ClassAndModuleThatMergeWithModuleMemberThatUsesClassTypeParameter.ts, 8, 20))
|
||||
>x : Symbol(x, Decl(ClassAndModuleThatMergeWithModuleMemberThatUsesClassTypeParameter.ts, 9, 15))
|
||||
>T : Symbol(T)
|
||||
}
|
||||
@@ -36,7 +36,7 @@ class clodule2<T>{
|
||||
>T : Symbol(T, Decl(ClassAndModuleThatMergeWithModuleMemberThatUsesClassTypeParameter.ts, 12, 15))
|
||||
}
|
||||
|
||||
module clodule2 {
|
||||
namespace clodule2 {
|
||||
>clodule2 : Symbol(clodule2, Decl(ClassAndModuleThatMergeWithModuleMemberThatUsesClassTypeParameter.ts, 10, 1), Decl(ClassAndModuleThatMergeWithModuleMemberThatUsesClassTypeParameter.ts, 16, 1))
|
||||
|
||||
var x: T;
|
||||
@@ -69,7 +69,7 @@ class clodule3<T>{
|
||||
>T : Symbol(T, Decl(ClassAndModuleThatMergeWithModuleMemberThatUsesClassTypeParameter.ts, 27, 15))
|
||||
}
|
||||
|
||||
module clodule3 {
|
||||
namespace clodule3 {
|
||||
>clodule3 : Symbol(clodule3, Decl(ClassAndModuleThatMergeWithModuleMemberThatUsesClassTypeParameter.ts, 25, 1), Decl(ClassAndModuleThatMergeWithModuleMemberThatUsesClassTypeParameter.ts, 31, 1))
|
||||
|
||||
export var y = { id: T };
|
||||
@@ -89,11 +89,11 @@ class clodule4<T>{
|
||||
>T : Symbol(T, Decl(ClassAndModuleThatMergeWithModuleMemberThatUsesClassTypeParameter.ts, 37, 15))
|
||||
}
|
||||
|
||||
module clodule4 {
|
||||
namespace clodule4 {
|
||||
>clodule4 : Symbol(clodule4, Decl(ClassAndModuleThatMergeWithModuleMemberThatUsesClassTypeParameter.ts, 35, 1), Decl(ClassAndModuleThatMergeWithModuleMemberThatUsesClassTypeParameter.ts, 41, 1))
|
||||
|
||||
class D {
|
||||
>D : Symbol(D, Decl(ClassAndModuleThatMergeWithModuleMemberThatUsesClassTypeParameter.ts, 43, 17))
|
||||
>D : Symbol(D, Decl(ClassAndModuleThatMergeWithModuleMemberThatUsesClassTypeParameter.ts, 43, 20))
|
||||
|
||||
name: T;
|
||||
>name : Symbol(D.name, Decl(ClassAndModuleThatMergeWithModuleMemberThatUsesClassTypeParameter.ts, 44, 13))
|
||||
|
||||
+4
-4
@@ -16,7 +16,7 @@ class clodule1<T>{
|
||||
> : ^
|
||||
}
|
||||
|
||||
module clodule1 {
|
||||
namespace clodule1 {
|
||||
>clodule1 : typeof clodule1
|
||||
> : ^^^^^^^^^^^^^^^
|
||||
|
||||
@@ -40,7 +40,7 @@ class clodule2<T>{
|
||||
> : ^
|
||||
}
|
||||
|
||||
module clodule2 {
|
||||
namespace clodule2 {
|
||||
>clodule2 : typeof clodule2
|
||||
> : ^^^^^^^^^^^^^^^
|
||||
|
||||
@@ -75,7 +75,7 @@ class clodule3<T>{
|
||||
> : ^
|
||||
}
|
||||
|
||||
module clodule3 {
|
||||
namespace clodule3 {
|
||||
>clodule3 : typeof clodule3
|
||||
> : ^^^^^^^^^^^^^^^
|
||||
|
||||
@@ -103,7 +103,7 @@ class clodule4<T>{
|
||||
> : ^
|
||||
}
|
||||
|
||||
module clodule4 {
|
||||
namespace clodule4 {
|
||||
>clodule4 : typeof clodule4
|
||||
> : ^^^^^^^^^^^^^^^
|
||||
|
||||
|
||||
+1
-1
@@ -12,7 +12,7 @@ ClassAndModuleThatMergeWithModulesExportedGenericFunctionAndGenericClassStaticFu
|
||||
!!! error TS2300: Duplicate identifier 'fn'.
|
||||
}
|
||||
|
||||
module clodule {
|
||||
namespace clodule {
|
||||
// error: duplicate identifier expected
|
||||
export function fn<T>(x: T, y: T): T {
|
||||
~~
|
||||
|
||||
+1
-1
@@ -8,7 +8,7 @@ class clodule<T> {
|
||||
static fn<U>(id: U) { }
|
||||
}
|
||||
|
||||
module clodule {
|
||||
namespace clodule {
|
||||
// error: duplicate identifier expected
|
||||
export function fn<T>(x: T, y: T): T {
|
||||
return x;
|
||||
|
||||
+2
-2
@@ -19,12 +19,12 @@ class clodule<T> {
|
||||
>U : Symbol(U, Decl(ClassAndModuleThatMergeWithModulesExportedGenericFunctionAndGenericClassStaticFunctionOfTheSameName.ts, 4, 14))
|
||||
}
|
||||
|
||||
module clodule {
|
||||
namespace clodule {
|
||||
>clodule : Symbol(clodule, Decl(ClassAndModuleThatMergeWithModulesExportedGenericFunctionAndGenericClassStaticFunctionOfTheSameName.ts, 0, 0), Decl(ClassAndModuleThatMergeWithModulesExportedGenericFunctionAndGenericClassStaticFunctionOfTheSameName.ts, 5, 1))
|
||||
|
||||
// error: duplicate identifier expected
|
||||
export function fn<T>(x: T, y: T): T {
|
||||
>fn : Symbol(fn, Decl(ClassAndModuleThatMergeWithModulesExportedGenericFunctionAndGenericClassStaticFunctionOfTheSameName.ts, 7, 16))
|
||||
>fn : Symbol(fn, Decl(ClassAndModuleThatMergeWithModulesExportedGenericFunctionAndGenericClassStaticFunctionOfTheSameName.ts, 7, 19))
|
||||
>T : Symbol(T, Decl(ClassAndModuleThatMergeWithModulesExportedGenericFunctionAndGenericClassStaticFunctionOfTheSameName.ts, 9, 23))
|
||||
>x : Symbol(x, Decl(ClassAndModuleThatMergeWithModulesExportedGenericFunctionAndGenericClassStaticFunctionOfTheSameName.ts, 9, 26))
|
||||
>T : Symbol(T, Decl(ClassAndModuleThatMergeWithModulesExportedGenericFunctionAndGenericClassStaticFunctionOfTheSameName.ts, 9, 23))
|
||||
|
||||
+1
-1
@@ -20,7 +20,7 @@ class clodule<T> {
|
||||
> : ^
|
||||
}
|
||||
|
||||
module clodule {
|
||||
namespace clodule {
|
||||
>clodule : typeof clodule
|
||||
> : ^^^^^^^^^^^^^^
|
||||
|
||||
|
||||
+1
-1
@@ -12,7 +12,7 @@ ClassAndModuleThatMergeWithModulesExportedGenericFunctionAndNonGenericClassStati
|
||||
!!! error TS2300: Duplicate identifier 'fn'.
|
||||
}
|
||||
|
||||
module clodule {
|
||||
namespace clodule {
|
||||
// error: duplicate identifier expected
|
||||
export function fn<T>(x: T, y: T): T {
|
||||
~~
|
||||
|
||||
+1
-1
@@ -8,7 +8,7 @@ class clodule<T> {
|
||||
static fn(id: string) { }
|
||||
}
|
||||
|
||||
module clodule {
|
||||
namespace clodule {
|
||||
// error: duplicate identifier expected
|
||||
export function fn<T>(x: T, y: T): T {
|
||||
return x;
|
||||
|
||||
+2
-2
@@ -17,12 +17,12 @@ class clodule<T> {
|
||||
>id : Symbol(id, Decl(ClassAndModuleThatMergeWithModulesExportedGenericFunctionAndNonGenericClassStaticFunctionOfTheSameName.ts, 4, 14))
|
||||
}
|
||||
|
||||
module clodule {
|
||||
namespace clodule {
|
||||
>clodule : Symbol(clodule, Decl(ClassAndModuleThatMergeWithModulesExportedGenericFunctionAndNonGenericClassStaticFunctionOfTheSameName.ts, 0, 0), Decl(ClassAndModuleThatMergeWithModulesExportedGenericFunctionAndNonGenericClassStaticFunctionOfTheSameName.ts, 5, 1))
|
||||
|
||||
// error: duplicate identifier expected
|
||||
export function fn<T>(x: T, y: T): T {
|
||||
>fn : Symbol(fn, Decl(ClassAndModuleThatMergeWithModulesExportedGenericFunctionAndNonGenericClassStaticFunctionOfTheSameName.ts, 7, 16))
|
||||
>fn : Symbol(fn, Decl(ClassAndModuleThatMergeWithModulesExportedGenericFunctionAndNonGenericClassStaticFunctionOfTheSameName.ts, 7, 19))
|
||||
>T : Symbol(T, Decl(ClassAndModuleThatMergeWithModulesExportedGenericFunctionAndNonGenericClassStaticFunctionOfTheSameName.ts, 9, 23))
|
||||
>x : Symbol(x, Decl(ClassAndModuleThatMergeWithModulesExportedGenericFunctionAndNonGenericClassStaticFunctionOfTheSameName.ts, 9, 26))
|
||||
>T : Symbol(T, Decl(ClassAndModuleThatMergeWithModulesExportedGenericFunctionAndNonGenericClassStaticFunctionOfTheSameName.ts, 9, 23))
|
||||
|
||||
+1
-1
@@ -20,7 +20,7 @@ class clodule<T> {
|
||||
> : ^^^^^^
|
||||
}
|
||||
|
||||
module clodule {
|
||||
namespace clodule {
|
||||
>clodule : typeof clodule
|
||||
> : ^^^^^^^^^^^^^^
|
||||
|
||||
|
||||
+1
-1
@@ -9,7 +9,7 @@ ClassAndModuleThatMergeWithModulesExportedStaticFunctionUsingClassPrivateStatics
|
||||
private static sfn(id: string) { return 42; }
|
||||
}
|
||||
|
||||
module clodule {
|
||||
namespace clodule {
|
||||
// error: duplicate identifier expected
|
||||
export function fn<T>(x: T, y: T): number {
|
||||
return clodule.sfn('a');
|
||||
|
||||
+1
-1
@@ -8,7 +8,7 @@ class clodule<T> {
|
||||
private static sfn(id: string) { return 42; }
|
||||
}
|
||||
|
||||
module clodule {
|
||||
namespace clodule {
|
||||
// error: duplicate identifier expected
|
||||
export function fn<T>(x: T, y: T): number {
|
||||
return clodule.sfn('a');
|
||||
|
||||
+2
-2
@@ -17,12 +17,12 @@ class clodule<T> {
|
||||
>id : Symbol(id, Decl(ClassAndModuleThatMergeWithModulesExportedStaticFunctionUsingClassPrivateStatics.ts, 4, 23))
|
||||
}
|
||||
|
||||
module clodule {
|
||||
namespace clodule {
|
||||
>clodule : Symbol(clodule, Decl(ClassAndModuleThatMergeWithModulesExportedStaticFunctionUsingClassPrivateStatics.ts, 0, 0), Decl(ClassAndModuleThatMergeWithModulesExportedStaticFunctionUsingClassPrivateStatics.ts, 5, 1))
|
||||
|
||||
// error: duplicate identifier expected
|
||||
export function fn<T>(x: T, y: T): number {
|
||||
>fn : Symbol(fn, Decl(ClassAndModuleThatMergeWithModulesExportedStaticFunctionUsingClassPrivateStatics.ts, 7, 16))
|
||||
>fn : Symbol(fn, Decl(ClassAndModuleThatMergeWithModulesExportedStaticFunctionUsingClassPrivateStatics.ts, 7, 19))
|
||||
>T : Symbol(T, Decl(ClassAndModuleThatMergeWithModulesExportedStaticFunctionUsingClassPrivateStatics.ts, 9, 23))
|
||||
>x : Symbol(x, Decl(ClassAndModuleThatMergeWithModulesExportedStaticFunctionUsingClassPrivateStatics.ts, 9, 26))
|
||||
>T : Symbol(T, Decl(ClassAndModuleThatMergeWithModulesExportedStaticFunctionUsingClassPrivateStatics.ts, 9, 23))
|
||||
|
||||
+1
-1
@@ -22,7 +22,7 @@ class clodule<T> {
|
||||
> : ^^
|
||||
}
|
||||
|
||||
module clodule {
|
||||
namespace clodule {
|
||||
>clodule : typeof clodule
|
||||
> : ^^^^^^^^^^^^^^
|
||||
|
||||
|
||||
+3
-3
@@ -13,14 +13,14 @@ ClassAndModuleThatMergeWithStaticFunctionAndExportedFunctionThatShareAName.ts(20
|
||||
!!! error TS2300: Duplicate identifier 'Origin'.
|
||||
}
|
||||
|
||||
module Point {
|
||||
namespace Point {
|
||||
export function Origin() { return null; } //expected duplicate identifier error
|
||||
~~~~~~
|
||||
!!! error TS2300: Duplicate identifier 'Origin'.
|
||||
}
|
||||
|
||||
|
||||
module A {
|
||||
namespace A {
|
||||
export class Point {
|
||||
constructor(public x: number, public y: number) { }
|
||||
|
||||
@@ -29,7 +29,7 @@ ClassAndModuleThatMergeWithStaticFunctionAndExportedFunctionThatShareAName.ts(20
|
||||
!!! error TS2300: Duplicate identifier 'Origin'.
|
||||
}
|
||||
|
||||
export module Point {
|
||||
export namespace Point {
|
||||
export function Origin() { return ""; }//expected duplicate identifier error
|
||||
~~~~~~
|
||||
!!! error TS2300: Duplicate identifier 'Origin'.
|
||||
|
||||
+3
-3
@@ -7,19 +7,19 @@ class Point {
|
||||
static Origin(): Point { return { x: 0, y: 0 }; } // unexpected error here bug 840246
|
||||
}
|
||||
|
||||
module Point {
|
||||
namespace Point {
|
||||
export function Origin() { return null; } //expected duplicate identifier error
|
||||
}
|
||||
|
||||
|
||||
module A {
|
||||
namespace A {
|
||||
export class Point {
|
||||
constructor(public x: number, public y: number) { }
|
||||
|
||||
static Origin(): Point { return { x: 0, y: 0 }; } // unexpected error here bug 840246
|
||||
}
|
||||
|
||||
export module Point {
|
||||
export namespace Point {
|
||||
export function Origin() { return ""; }//expected duplicate identifier error
|
||||
}
|
||||
}
|
||||
|
||||
+8
-8
@@ -15,19 +15,19 @@ class Point {
|
||||
>y : Symbol(y, Decl(ClassAndModuleThatMergeWithStaticFunctionAndExportedFunctionThatShareAName.ts, 3, 43))
|
||||
}
|
||||
|
||||
module Point {
|
||||
namespace Point {
|
||||
>Point : Symbol(Point, Decl(ClassAndModuleThatMergeWithStaticFunctionAndExportedFunctionThatShareAName.ts, 0, 0), Decl(ClassAndModuleThatMergeWithStaticFunctionAndExportedFunctionThatShareAName.ts, 4, 1))
|
||||
|
||||
export function Origin() { return null; } //expected duplicate identifier error
|
||||
>Origin : Symbol(Origin, Decl(ClassAndModuleThatMergeWithStaticFunctionAndExportedFunctionThatShareAName.ts, 6, 14))
|
||||
>Origin : Symbol(Origin, Decl(ClassAndModuleThatMergeWithStaticFunctionAndExportedFunctionThatShareAName.ts, 6, 17))
|
||||
}
|
||||
|
||||
|
||||
module A {
|
||||
namespace A {
|
||||
>A : Symbol(A, Decl(ClassAndModuleThatMergeWithStaticFunctionAndExportedFunctionThatShareAName.ts, 8, 1))
|
||||
|
||||
export class Point {
|
||||
>Point : Symbol(Point, Decl(ClassAndModuleThatMergeWithStaticFunctionAndExportedFunctionThatShareAName.ts, 11, 10), Decl(ClassAndModuleThatMergeWithStaticFunctionAndExportedFunctionThatShareAName.ts, 16, 5))
|
||||
>Point : Symbol(Point, Decl(ClassAndModuleThatMergeWithStaticFunctionAndExportedFunctionThatShareAName.ts, 11, 13), Decl(ClassAndModuleThatMergeWithStaticFunctionAndExportedFunctionThatShareAName.ts, 16, 5))
|
||||
|
||||
constructor(public x: number, public y: number) { }
|
||||
>x : Symbol(Point.x, Decl(ClassAndModuleThatMergeWithStaticFunctionAndExportedFunctionThatShareAName.ts, 13, 20))
|
||||
@@ -35,15 +35,15 @@ module A {
|
||||
|
||||
static Origin(): Point { return { x: 0, y: 0 }; } // unexpected error here bug 840246
|
||||
>Origin : Symbol(Point.Origin, Decl(ClassAndModuleThatMergeWithStaticFunctionAndExportedFunctionThatShareAName.ts, 13, 59))
|
||||
>Point : Symbol(Point, Decl(ClassAndModuleThatMergeWithStaticFunctionAndExportedFunctionThatShareAName.ts, 11, 10), Decl(ClassAndModuleThatMergeWithStaticFunctionAndExportedFunctionThatShareAName.ts, 16, 5))
|
||||
>Point : Symbol(Point, Decl(ClassAndModuleThatMergeWithStaticFunctionAndExportedFunctionThatShareAName.ts, 11, 13), Decl(ClassAndModuleThatMergeWithStaticFunctionAndExportedFunctionThatShareAName.ts, 16, 5))
|
||||
>x : Symbol(x, Decl(ClassAndModuleThatMergeWithStaticFunctionAndExportedFunctionThatShareAName.ts, 15, 41))
|
||||
>y : Symbol(y, Decl(ClassAndModuleThatMergeWithStaticFunctionAndExportedFunctionThatShareAName.ts, 15, 47))
|
||||
}
|
||||
|
||||
export module Point {
|
||||
>Point : Symbol(Point, Decl(ClassAndModuleThatMergeWithStaticFunctionAndExportedFunctionThatShareAName.ts, 11, 10), Decl(ClassAndModuleThatMergeWithStaticFunctionAndExportedFunctionThatShareAName.ts, 16, 5))
|
||||
export namespace Point {
|
||||
>Point : Symbol(Point, Decl(ClassAndModuleThatMergeWithStaticFunctionAndExportedFunctionThatShareAName.ts, 11, 13), Decl(ClassAndModuleThatMergeWithStaticFunctionAndExportedFunctionThatShareAName.ts, 16, 5))
|
||||
|
||||
export function Origin() { return ""; }//expected duplicate identifier error
|
||||
>Origin : Symbol(Origin, Decl(ClassAndModuleThatMergeWithStaticFunctionAndExportedFunctionThatShareAName.ts, 18, 25))
|
||||
>Origin : Symbol(Origin, Decl(ClassAndModuleThatMergeWithStaticFunctionAndExportedFunctionThatShareAName.ts, 18, 28))
|
||||
}
|
||||
}
|
||||
|
||||
+3
-3
@@ -26,7 +26,7 @@ class Point {
|
||||
> : ^
|
||||
}
|
||||
|
||||
module Point {
|
||||
namespace Point {
|
||||
>Point : typeof Point
|
||||
> : ^^^^^^^^^^^^
|
||||
|
||||
@@ -36,7 +36,7 @@ module Point {
|
||||
}
|
||||
|
||||
|
||||
module A {
|
||||
namespace A {
|
||||
>A : typeof A
|
||||
> : ^^^^^^^^
|
||||
|
||||
@@ -65,7 +65,7 @@ module A {
|
||||
> : ^
|
||||
}
|
||||
|
||||
export module Point {
|
||||
export namespace Point {
|
||||
>Point : typeof Point
|
||||
> : ^^^^^^^^^^^^
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user