mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-05 08:11:30 -06:00
Baseline accept and reorder program logic so common source dir is right
This commit is contained in:
parent
f0e3ebe37d
commit
58b11b631f
@ -1019,6 +1019,8 @@ namespace ts {
|
||||
const filesByNameIgnoreCase = host.useCaseSensitiveFileNames() ? createFileMap<SourceFile>(fileName => fileName.toLowerCase()) : undefined;
|
||||
|
||||
if (!tryReuseStructureFromOldProgram()) {
|
||||
forEach(rootNames, name => processRootFile(name, /*isDefaultLib*/ false));
|
||||
|
||||
// load type declarations specified via 'types' argument
|
||||
let typeReferences: string[];
|
||||
if (options.types) {
|
||||
@ -1027,7 +1029,10 @@ namespace ts {
|
||||
else {
|
||||
// or load all types from the automatic type import fields
|
||||
if (host.getDefaultTypeDirectiveNames) {
|
||||
typeReferences = host.getDefaultTypeDirectiveNames(getCommonSourceDirectory());
|
||||
const commonRoot = getCommonSourceDirectory();
|
||||
if (commonRoot) {
|
||||
typeReferences = host.getDefaultTypeDirectiveNames(commonRoot);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -1038,7 +1043,6 @@ namespace ts {
|
||||
}
|
||||
}
|
||||
|
||||
forEach(rootNames, name => processRootFile(name, /*isDefaultLib*/ false));
|
||||
// Do not process the default library if:
|
||||
// - The '--noLib' flag is used.
|
||||
// - A 'no-default-lib' reference comment is encountered in
|
||||
|
||||
@ -1,19 +0,0 @@
|
||||
tests/cases/compiler/moduleA/a.js(2,17): error TS2656: Exported external package typings file 'tests/cases/compiler/node_modules/b.ts' is not a module. Please contact the package author to update the package definition.
|
||||
|
||||
|
||||
==== tests/cases/compiler/moduleA/a.js (1 errors) ====
|
||||
|
||||
import {a} from "b";
|
||||
~~~
|
||||
!!! error TS2656: Exported external package typings file 'b.ts' is not a module. Please contact the package author to update the package definition.
|
||||
a++;
|
||||
import {c} from "c";
|
||||
c++;
|
||||
|
||||
==== tests/cases/compiler/node_modules/b.ts (0 errors) ====
|
||||
var a = 10;
|
||||
|
||||
==== tests/cases/compiler/node_modules/c.js (0 errors) ====
|
||||
exports.a = 10;
|
||||
c = 10;
|
||||
|
||||
@ -0,0 +1,25 @@
|
||||
=== tests/cases/compiler/moduleA/a.js ===
|
||||
|
||||
import {a} from "b";
|
||||
>a : Symbol(a, Decl(a.js, 1, 8))
|
||||
|
||||
a++;
|
||||
>a : Symbol(a, Decl(a.js, 1, 8))
|
||||
|
||||
import {c} from "c";
|
||||
>c : Symbol(c, Decl(a.js, 3, 8))
|
||||
|
||||
c++;
|
||||
>c : Symbol(c, Decl(a.js, 3, 8))
|
||||
|
||||
=== tests/cases/compiler/node_modules/b.ts ===
|
||||
var a = 10;
|
||||
>a : Symbol(a, Decl(b.ts, 0, 3))
|
||||
|
||||
=== tests/cases/compiler/node_modules/c.js ===
|
||||
exports.a = 10;
|
||||
>exports : Symbol(a, Decl(c.js, 0, 0))
|
||||
>a : Symbol(a, Decl(c.js, 0, 0))
|
||||
|
||||
c = 10;
|
||||
|
||||
@ -0,0 +1,34 @@
|
||||
=== tests/cases/compiler/moduleA/a.js ===
|
||||
|
||||
import {a} from "b";
|
||||
>a : any
|
||||
|
||||
a++;
|
||||
>a++ : number
|
||||
>a : any
|
||||
|
||||
import {c} from "c";
|
||||
>c : any
|
||||
|
||||
c++;
|
||||
>c++ : number
|
||||
>c : any
|
||||
|
||||
=== tests/cases/compiler/node_modules/b.ts ===
|
||||
var a = 10;
|
||||
>a : number
|
||||
>10 : number
|
||||
|
||||
=== tests/cases/compiler/node_modules/c.js ===
|
||||
exports.a = 10;
|
||||
>exports.a = 10 : number
|
||||
>exports.a : any
|
||||
>exports : any
|
||||
>a : any
|
||||
>10 : number
|
||||
|
||||
c = 10;
|
||||
>c = 10 : number
|
||||
>c : any
|
||||
>10 : number
|
||||
|
||||
@ -1,6 +1,14 @@
|
||||
[
|
||||
"======== Resolving type reference directive 'jquery', containing file '/a/b/consumer.ts', root directory not set. ========",
|
||||
"Root directory cannot be determined, skipping primary search paths.",
|
||||
"======== Resolving type reference directive 'jquery', containing file '/a/b/consumer.ts', root directory 'C:\\github\\TypeScript'. ========",
|
||||
"Resolving with primary search path 'C:\\github\\TypeScript/types/'",
|
||||
"File 'C:\\github\\TypeScript/types/jquery/package.json' does not exist.",
|
||||
"File 'C:\\github\\TypeScript/types/jquery/index.d.ts' does not exist.",
|
||||
"Resolving with primary search path 'C:\\github\\TypeScript/node_modules/'",
|
||||
"File 'C:\\github\\TypeScript/node_modules/jquery/package.json' does not exist.",
|
||||
"File 'C:\\github\\TypeScript/node_modules/jquery/index.d.ts' does not exist.",
|
||||
"Resolving with primary search path 'C:\\github\\TypeScript/node_modules/@types/'",
|
||||
"File 'C:\\github\\TypeScript/node_modules/@types/jquery/package.json' does not exist.",
|
||||
"File 'C:\\github\\TypeScript/node_modules/@types/jquery/index.d.ts' does not exist.",
|
||||
"Looking up in 'node_modules' folder, initial location '/a/b'",
|
||||
"File '/a/b/node_modules/jquery.ts' does not exist.",
|
||||
"File '/a/b/node_modules/jquery.d.ts' does not exist.",
|
||||
|
||||
@ -1,6 +1,14 @@
|
||||
[
|
||||
"======== Resolving type reference directive 'jquery', containing file '/a/b/consumer.ts', root directory not set. ========",
|
||||
"Root directory cannot be determined, skipping primary search paths.",
|
||||
"======== Resolving type reference directive 'jquery', containing file '/a/b/consumer.ts', root directory 'C:\\github\\TypeScript'. ========",
|
||||
"Resolving with primary search path 'C:\\github\\TypeScript/types/'",
|
||||
"File 'C:\\github\\TypeScript/types/jquery/package.json' does not exist.",
|
||||
"File 'C:\\github\\TypeScript/types/jquery/index.d.ts' does not exist.",
|
||||
"Resolving with primary search path 'C:\\github\\TypeScript/node_modules/'",
|
||||
"File 'C:\\github\\TypeScript/node_modules/jquery/package.json' does not exist.",
|
||||
"File 'C:\\github\\TypeScript/node_modules/jquery/index.d.ts' does not exist.",
|
||||
"Resolving with primary search path 'C:\\github\\TypeScript/node_modules/@types/'",
|
||||
"File 'C:\\github\\TypeScript/node_modules/@types/jquery/package.json' does not exist.",
|
||||
"File 'C:\\github\\TypeScript/node_modules/@types/jquery/index.d.ts' does not exist.",
|
||||
"Looking up in 'node_modules' folder, initial location '/a/b'",
|
||||
"File '/a/b/node_modules/jquery.ts' does not exist.",
|
||||
"File '/a/b/node_modules/jquery.d.ts' does not exist.",
|
||||
|
||||
@ -1,5 +1,44 @@
|
||||
[
|
||||
"======== Resolving type reference directive 'jquery', containing file not set, root directory not set. ========",
|
||||
"Root directory cannot be determined, skipping primary search paths.",
|
||||
"Containing file is not specified and root directory cannot be determined, skipping lookup in 'node_modules' folder."
|
||||
"======== Resolving type reference directive 'jquery', containing file not set, root directory 'C:\\github\\TypeScript'. ========",
|
||||
"Resolving with primary search path 'C:\\github\\TypeScript/types/'",
|
||||
"File 'C:\\github\\TypeScript/types/jquery/package.json' does not exist.",
|
||||
"File 'C:\\github\\TypeScript/types/jquery/index.d.ts' does not exist.",
|
||||
"Resolving with primary search path 'C:\\github\\TypeScript/node_modules/'",
|
||||
"File 'C:\\github\\TypeScript/node_modules/jquery/package.json' does not exist.",
|
||||
"File 'C:\\github\\TypeScript/node_modules/jquery/index.d.ts' does not exist.",
|
||||
"Resolving with primary search path 'C:\\github\\TypeScript/node_modules/@types/'",
|
||||
"File 'C:\\github\\TypeScript/node_modules/@types/jquery/package.json' does not exist.",
|
||||
"File 'C:\\github\\TypeScript/node_modules/@types/jquery/index.d.ts' does not exist.",
|
||||
"Looking up in 'node_modules' folder, initial location 'C:\\github\\TypeScript'",
|
||||
"File 'C:/github/TypeScript/node_modules/jquery.ts' does not exist.",
|
||||
"File 'C:/github/TypeScript/node_modules/jquery.d.ts' does not exist.",
|
||||
"File 'C:/github/TypeScript/node_modules/jquery/package.json' does not exist.",
|
||||
"File 'C:/github/TypeScript/node_modules/jquery/index.ts' does not exist.",
|
||||
"File 'C:/github/TypeScript/node_modules/jquery/index.d.ts' does not exist.",
|
||||
"File 'C:/github/TypeScript/node_modules/@types/jquery.ts' does not exist.",
|
||||
"File 'C:/github/TypeScript/node_modules/@types/jquery.d.ts' does not exist.",
|
||||
"File 'C:/github/TypeScript/node_modules/@types/jquery/package.json' does not exist.",
|
||||
"File 'C:/github/TypeScript/node_modules/@types/jquery/index.ts' does not exist.",
|
||||
"File 'C:/github/TypeScript/node_modules/@types/jquery/index.d.ts' does not exist.",
|
||||
"File 'C:/github/node_modules/jquery.ts' does not exist.",
|
||||
"File 'C:/github/node_modules/jquery.d.ts' does not exist.",
|
||||
"File 'C:/github/node_modules/jquery/package.json' does not exist.",
|
||||
"File 'C:/github/node_modules/jquery/index.ts' does not exist.",
|
||||
"File 'C:/github/node_modules/jquery/index.d.ts' does not exist.",
|
||||
"File 'C:/github/node_modules/@types/jquery.ts' does not exist.",
|
||||
"File 'C:/github/node_modules/@types/jquery.d.ts' does not exist.",
|
||||
"File 'C:/github/node_modules/@types/jquery/package.json' does not exist.",
|
||||
"File 'C:/github/node_modules/@types/jquery/index.ts' does not exist.",
|
||||
"File 'C:/github/node_modules/@types/jquery/index.d.ts' does not exist.",
|
||||
"File 'C:/node_modules/jquery.ts' does not exist.",
|
||||
"File 'C:/node_modules/jquery.d.ts' does not exist.",
|
||||
"File 'C:/node_modules/jquery/package.json' does not exist.",
|
||||
"File 'C:/node_modules/jquery/index.ts' does not exist.",
|
||||
"File 'C:/node_modules/jquery/index.d.ts' does not exist.",
|
||||
"File 'C:/node_modules/@types/jquery.ts' does not exist.",
|
||||
"File 'C:/node_modules/@types/jquery.d.ts' does not exist.",
|
||||
"File 'C:/node_modules/@types/jquery/package.json' does not exist.",
|
||||
"File 'C:/node_modules/@types/jquery/index.ts' does not exist.",
|
||||
"File 'C:/node_modules/@types/jquery/index.d.ts' does not exist.",
|
||||
"======== Type reference directive 'jquery' was not resolved. ========"
|
||||
]
|
||||
@ -1,6 +1,14 @@
|
||||
[
|
||||
"======== Resolving type reference directive 'foo', containing file '/src/root.ts', root directory not set. ========",
|
||||
"Root directory cannot be determined, skipping primary search paths.",
|
||||
"======== Resolving type reference directive 'foo', containing file '/src/root.ts', root directory 'C:\\github\\TypeScript'. ========",
|
||||
"Resolving with primary search path 'C:\\github\\TypeScript/types/'",
|
||||
"File 'C:\\github\\TypeScript/types/foo/package.json' does not exist.",
|
||||
"File 'C:\\github\\TypeScript/types/foo/index.d.ts' does not exist.",
|
||||
"Resolving with primary search path 'C:\\github\\TypeScript/node_modules/'",
|
||||
"File 'C:\\github\\TypeScript/node_modules/foo/package.json' does not exist.",
|
||||
"File 'C:\\github\\TypeScript/node_modules/foo/index.d.ts' does not exist.",
|
||||
"Resolving with primary search path 'C:\\github\\TypeScript/node_modules/@types/'",
|
||||
"File 'C:\\github\\TypeScript/node_modules/@types/foo/package.json' does not exist.",
|
||||
"File 'C:\\github\\TypeScript/node_modules/@types/foo/index.d.ts' does not exist.",
|
||||
"Looking up in 'node_modules' folder, initial location '/src'",
|
||||
"File '/src/node_modules/foo.ts' does not exist.",
|
||||
"File '/src/node_modules/foo.d.ts' does not exist.",
|
||||
@ -18,8 +26,16 @@
|
||||
"File '/node_modules/foo/index.ts' does not exist.",
|
||||
"File '/node_modules/foo/index.d.ts' exist - use it as a name resolution result.",
|
||||
"======== Type reference directive 'foo' was successfully resolved to '/node_modules/foo/index.d.ts', primary: false. ========",
|
||||
"======== Resolving type reference directive 'bar', containing file '/src/root.ts', root directory not set. ========",
|
||||
"Root directory cannot be determined, skipping primary search paths.",
|
||||
"======== Resolving type reference directive 'bar', containing file '/src/root.ts', root directory 'C:\\github\\TypeScript'. ========",
|
||||
"Resolving with primary search path 'C:\\github\\TypeScript/types/'",
|
||||
"File 'C:\\github\\TypeScript/types/bar/package.json' does not exist.",
|
||||
"File 'C:\\github\\TypeScript/types/bar/index.d.ts' does not exist.",
|
||||
"Resolving with primary search path 'C:\\github\\TypeScript/node_modules/'",
|
||||
"File 'C:\\github\\TypeScript/node_modules/bar/package.json' does not exist.",
|
||||
"File 'C:\\github\\TypeScript/node_modules/bar/index.d.ts' does not exist.",
|
||||
"Resolving with primary search path 'C:\\github\\TypeScript/node_modules/@types/'",
|
||||
"File 'C:\\github\\TypeScript/node_modules/@types/bar/package.json' does not exist.",
|
||||
"File 'C:\\github\\TypeScript/node_modules/@types/bar/index.d.ts' does not exist.",
|
||||
"Looking up in 'node_modules' folder, initial location '/src'",
|
||||
"File '/src/node_modules/bar.ts' does not exist.",
|
||||
"File '/src/node_modules/bar.d.ts' does not exist.",
|
||||
@ -37,8 +53,16 @@
|
||||
"File '/node_modules/bar/index.ts' does not exist.",
|
||||
"File '/node_modules/bar/index.d.ts' exist - use it as a name resolution result.",
|
||||
"======== Type reference directive 'bar' was successfully resolved to '/node_modules/bar/index.d.ts', primary: false. ========",
|
||||
"======== Resolving type reference directive 'alpha', containing file '/node_modules/foo/index.d.ts', root directory not set. ========",
|
||||
"Root directory cannot be determined, skipping primary search paths.",
|
||||
"======== Resolving type reference directive 'alpha', containing file '/node_modules/foo/index.d.ts', root directory 'C:\\github\\TypeScript'. ========",
|
||||
"Resolving with primary search path 'C:\\github\\TypeScript/types/'",
|
||||
"File 'C:\\github\\TypeScript/types/alpha/package.json' does not exist.",
|
||||
"File 'C:\\github\\TypeScript/types/alpha/index.d.ts' does not exist.",
|
||||
"Resolving with primary search path 'C:\\github\\TypeScript/node_modules/'",
|
||||
"File 'C:\\github\\TypeScript/node_modules/alpha/package.json' does not exist.",
|
||||
"File 'C:\\github\\TypeScript/node_modules/alpha/index.d.ts' does not exist.",
|
||||
"Resolving with primary search path 'C:\\github\\TypeScript/node_modules/@types/'",
|
||||
"File 'C:\\github\\TypeScript/node_modules/@types/alpha/package.json' does not exist.",
|
||||
"File 'C:\\github\\TypeScript/node_modules/@types/alpha/index.d.ts' does not exist.",
|
||||
"Looking up in 'node_modules' folder, initial location '/node_modules/foo'",
|
||||
"File '/node_modules/foo/node_modules/alpha.ts' does not exist.",
|
||||
"File '/node_modules/foo/node_modules/alpha.d.ts' does not exist.",
|
||||
@ -46,8 +70,16 @@
|
||||
"File '/node_modules/foo/node_modules/alpha/index.ts' does not exist.",
|
||||
"File '/node_modules/foo/node_modules/alpha/index.d.ts' exist - use it as a name resolution result.",
|
||||
"======== Type reference directive 'alpha' was successfully resolved to '/node_modules/foo/node_modules/alpha/index.d.ts', primary: false. ========",
|
||||
"======== Resolving type reference directive 'alpha', containing file '/node_modules/bar/index.d.ts', root directory not set. ========",
|
||||
"Root directory cannot be determined, skipping primary search paths.",
|
||||
"======== Resolving type reference directive 'alpha', containing file '/node_modules/bar/index.d.ts', root directory 'C:\\github\\TypeScript'. ========",
|
||||
"Resolving with primary search path 'C:\\github\\TypeScript/types/'",
|
||||
"File 'C:\\github\\TypeScript/types/alpha/package.json' does not exist.",
|
||||
"File 'C:\\github\\TypeScript/types/alpha/index.d.ts' does not exist.",
|
||||
"Resolving with primary search path 'C:\\github\\TypeScript/node_modules/'",
|
||||
"File 'C:\\github\\TypeScript/node_modules/alpha/package.json' does not exist.",
|
||||
"File 'C:\\github\\TypeScript/node_modules/alpha/index.d.ts' does not exist.",
|
||||
"Resolving with primary search path 'C:\\github\\TypeScript/node_modules/@types/'",
|
||||
"File 'C:\\github\\TypeScript/node_modules/@types/alpha/package.json' does not exist.",
|
||||
"File 'C:\\github\\TypeScript/node_modules/@types/alpha/index.d.ts' does not exist.",
|
||||
"Looking up in 'node_modules' folder, initial location '/node_modules/bar'",
|
||||
"File '/node_modules/bar/node_modules/alpha.ts' does not exist.",
|
||||
"File '/node_modules/bar/node_modules/alpha.d.ts' does not exist.",
|
||||
|
||||
@ -1,6 +1,14 @@
|
||||
[
|
||||
"======== Resolving type reference directive 'jquery', containing file '/src/consumer.ts', root directory not set. ========",
|
||||
"Root directory cannot be determined, skipping primary search paths.",
|
||||
"======== Resolving type reference directive 'jquery', containing file '/src/consumer.ts', root directory 'C:\\github\\TypeScript'. ========",
|
||||
"Resolving with primary search path 'C:\\github\\TypeScript/types/'",
|
||||
"File 'C:\\github\\TypeScript/types/jquery/package.json' does not exist.",
|
||||
"File 'C:\\github\\TypeScript/types/jquery/index.d.ts' does not exist.",
|
||||
"Resolving with primary search path 'C:\\github\\TypeScript/node_modules/'",
|
||||
"File 'C:\\github\\TypeScript/node_modules/jquery/package.json' does not exist.",
|
||||
"File 'C:\\github\\TypeScript/node_modules/jquery/index.d.ts' does not exist.",
|
||||
"Resolving with primary search path 'C:\\github\\TypeScript/node_modules/@types/'",
|
||||
"File 'C:\\github\\TypeScript/node_modules/@types/jquery/package.json' does not exist.",
|
||||
"File 'C:\\github\\TypeScript/node_modules/@types/jquery/index.d.ts' does not exist.",
|
||||
"Looking up in 'node_modules' folder, initial location '/src'",
|
||||
"File '/src/node_modules/jquery.ts' does not exist.",
|
||||
"File '/src/node_modules/jquery.d.ts' does not exist.",
|
||||
|
||||
@ -1,14 +0,0 @@
|
||||
tests/cases/compiler/b.ts(1,20): error TS2656: Exported external package typings file 'tests/cases/compiler/node_modules/a.d.ts' is not a module. Please contact the package author to update the package definition.
|
||||
|
||||
|
||||
==== tests/cases/compiler/b.ts (1 errors) ====
|
||||
import y = require("a");
|
||||
~~~
|
||||
!!! error TS2656: Exported external package typings file 'a.d.ts' is not a module. Please contact the package author to update the package definition.
|
||||
|
||||
==== tests/cases/compiler/node_modules/a.d.ts (0 errors) ====
|
||||
|
||||
declare module "a" {
|
||||
var x: number;
|
||||
}
|
||||
|
||||
11
tests/baselines/reference/nodeResolution5.symbols
Normal file
11
tests/baselines/reference/nodeResolution5.symbols
Normal file
@ -0,0 +1,11 @@
|
||||
=== tests/cases/compiler/b.ts ===
|
||||
import y = require("a");
|
||||
>y : Symbol(y, Decl(b.ts, 0, 0))
|
||||
|
||||
=== tests/cases/compiler/node_modules/a.d.ts ===
|
||||
|
||||
declare module "a" {
|
||||
var x: number;
|
||||
>x : Symbol(x, Decl(a.d.ts, 2, 7))
|
||||
}
|
||||
|
||||
11
tests/baselines/reference/nodeResolution5.types
Normal file
11
tests/baselines/reference/nodeResolution5.types
Normal file
@ -0,0 +1,11 @@
|
||||
=== tests/cases/compiler/b.ts ===
|
||||
import y = require("a");
|
||||
>y : typeof y
|
||||
|
||||
=== tests/cases/compiler/node_modules/a.d.ts ===
|
||||
|
||||
declare module "a" {
|
||||
var x: number;
|
||||
>x : number
|
||||
}
|
||||
|
||||
@ -1,17 +0,0 @@
|
||||
tests/cases/compiler/node_modules/a.d.ts(1,1): error TS2654: Exported external package typings file cannot contain tripleslash references. Please contact the package author to update the package definition.
|
||||
|
||||
|
||||
==== tests/cases/compiler/b.ts (0 errors) ====
|
||||
import y = require("a");
|
||||
|
||||
==== tests/cases/compiler/node_modules/ref.ts (0 errors) ====
|
||||
|
||||
var x = 1;
|
||||
|
||||
==== tests/cases/compiler/node_modules/a.d.ts (1 errors) ====
|
||||
/// <reference path="ref.ts"/>
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
!!! error TS2654: Exported external package typings file cannot contain tripleslash references. Please contact the package author to update the package definition.
|
||||
export declare var y;
|
||||
|
||||
|
||||
15
tests/baselines/reference/nodeResolution6.symbols
Normal file
15
tests/baselines/reference/nodeResolution6.symbols
Normal file
@ -0,0 +1,15 @@
|
||||
=== tests/cases/compiler/b.ts ===
|
||||
import y = require("a");
|
||||
>y : Symbol(y, Decl(b.ts, 0, 0))
|
||||
|
||||
=== tests/cases/compiler/node_modules/ref.ts ===
|
||||
|
||||
var x = 1;
|
||||
>x : Symbol(x, Decl(ref.ts, 1, 3))
|
||||
|
||||
=== tests/cases/compiler/node_modules/a.d.ts ===
|
||||
/// <reference path="ref.ts"/>
|
||||
export declare var y;
|
||||
>y : Symbol(y, Decl(a.d.ts, 1, 18))
|
||||
|
||||
|
||||
16
tests/baselines/reference/nodeResolution6.types
Normal file
16
tests/baselines/reference/nodeResolution6.types
Normal file
@ -0,0 +1,16 @@
|
||||
=== tests/cases/compiler/b.ts ===
|
||||
import y = require("a");
|
||||
>y : typeof y
|
||||
|
||||
=== tests/cases/compiler/node_modules/ref.ts ===
|
||||
|
||||
var x = 1;
|
||||
>x : number
|
||||
>1 : number
|
||||
|
||||
=== tests/cases/compiler/node_modules/a.d.ts ===
|
||||
/// <reference path="ref.ts"/>
|
||||
export declare var y;
|
||||
>y : any
|
||||
|
||||
|
||||
@ -1,14 +0,0 @@
|
||||
tests/cases/compiler/b.ts(1,20): error TS2656: Exported external package typings file 'tests/cases/compiler/node_modules/a/index.d.ts' is not a module. Please contact the package author to update the package definition.
|
||||
|
||||
|
||||
==== tests/cases/compiler/b.ts (1 errors) ====
|
||||
import y = require("a");
|
||||
~~~
|
||||
!!! error TS2656: Exported external package typings file 'index.d.ts' is not a module. Please contact the package author to update the package definition.
|
||||
|
||||
==== tests/cases/compiler/node_modules/a/index.d.ts (0 errors) ====
|
||||
|
||||
declare module "a" {
|
||||
var x: number;
|
||||
}
|
||||
|
||||
11
tests/baselines/reference/nodeResolution7.symbols
Normal file
11
tests/baselines/reference/nodeResolution7.symbols
Normal file
@ -0,0 +1,11 @@
|
||||
=== tests/cases/compiler/b.ts ===
|
||||
import y = require("a");
|
||||
>y : Symbol(y, Decl(b.ts, 0, 0))
|
||||
|
||||
=== tests/cases/compiler/node_modules/a/index.d.ts ===
|
||||
|
||||
declare module "a" {
|
||||
var x: number;
|
||||
>x : Symbol(x, Decl(index.d.ts, 2, 7))
|
||||
}
|
||||
|
||||
11
tests/baselines/reference/nodeResolution7.types
Normal file
11
tests/baselines/reference/nodeResolution7.types
Normal file
@ -0,0 +1,11 @@
|
||||
=== tests/cases/compiler/b.ts ===
|
||||
import y = require("a");
|
||||
>y : typeof y
|
||||
|
||||
=== tests/cases/compiler/node_modules/a/index.d.ts ===
|
||||
|
||||
declare module "a" {
|
||||
var x: number;
|
||||
>x : number
|
||||
}
|
||||
|
||||
@ -1,16 +0,0 @@
|
||||
tests/cases/compiler/node_modules/a/index.d.ts(1,1): error TS2654: Exported external package typings file cannot contain tripleslash references. Please contact the package author to update the package definition.
|
||||
|
||||
|
||||
==== tests/cases/compiler/b.ts (0 errors) ====
|
||||
import y = require("a");
|
||||
==== tests/cases/compiler/node_modules/a/ref.ts (0 errors) ====
|
||||
|
||||
var x = 1;
|
||||
|
||||
==== tests/cases/compiler/node_modules/a/index.d.ts (1 errors) ====
|
||||
/// <reference path="ref.ts"/>
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
!!! error TS2654: Exported external package typings file cannot contain tripleslash references. Please contact the package author to update the package definition.
|
||||
export declare var y;
|
||||
|
||||
|
||||
15
tests/baselines/reference/nodeResolution8.symbols
Normal file
15
tests/baselines/reference/nodeResolution8.symbols
Normal file
@ -0,0 +1,15 @@
|
||||
=== tests/cases/compiler/b.ts ===
|
||||
import y = require("a");
|
||||
>y : Symbol(y, Decl(b.ts, 0, 0))
|
||||
|
||||
=== tests/cases/compiler/node_modules/a/ref.ts ===
|
||||
|
||||
var x = 1;
|
||||
>x : Symbol(x, Decl(ref.ts, 1, 3))
|
||||
|
||||
=== tests/cases/compiler/node_modules/a/index.d.ts ===
|
||||
/// <reference path="ref.ts"/>
|
||||
export declare var y;
|
||||
>y : Symbol(y, Decl(index.d.ts, 1, 18))
|
||||
|
||||
|
||||
16
tests/baselines/reference/nodeResolution8.types
Normal file
16
tests/baselines/reference/nodeResolution8.types
Normal file
@ -0,0 +1,16 @@
|
||||
=== tests/cases/compiler/b.ts ===
|
||||
import y = require("a");
|
||||
>y : typeof y
|
||||
|
||||
=== tests/cases/compiler/node_modules/a/ref.ts ===
|
||||
|
||||
var x = 1;
|
||||
>x : number
|
||||
>1 : number
|
||||
|
||||
=== tests/cases/compiler/node_modules/a/index.d.ts ===
|
||||
/// <reference path="ref.ts"/>
|
||||
export declare var y;
|
||||
>y : any
|
||||
|
||||
|
||||
@ -1,12 +1,12 @@
|
||||
[
|
||||
"======== Resolving type reference directive 'lib', containing file not set, root directory '/'. ========",
|
||||
"Resolving with primary search path '/types/'",
|
||||
"File '/types/lib/package.json' does not exist.",
|
||||
"File '/types/lib/index.d.ts' exist - use it as a name resolution result.",
|
||||
"======== Type reference directive 'lib' was successfully resolved to '/types/lib/index.d.ts', primary: true. ========",
|
||||
"======== Resolving module './mod1' from '/mod2.ts'. ========",
|
||||
"Module resolution kind is not specified, using 'NodeJs'.",
|
||||
"Loading module as file / folder, candidate module location '/mod1'.",
|
||||
"File '/mod1.ts' exist - use it as a name resolution result.",
|
||||
"======== Module name './mod1' was successfully resolved to '/mod1.ts'. ========"
|
||||
"======== Module name './mod1' was successfully resolved to '/mod1.ts'. ========",
|
||||
"======== Resolving type reference directive 'lib', containing file not set, root directory '/'. ========",
|
||||
"Resolving with primary search path '/types/'",
|
||||
"File '/types/lib/package.json' does not exist.",
|
||||
"File '/types/lib/index.d.ts' exist - use it as a name resolution result.",
|
||||
"======== Type reference directive 'lib' was successfully resolved to '/types/lib/index.d.ts', primary: true. ========"
|
||||
]
|
||||
@ -1,12 +1,12 @@
|
||||
[
|
||||
"======== Resolving type reference directive 'lib', containing file not set, root directory '/'. ========",
|
||||
"Resolving with primary search path '/types/'",
|
||||
"File '/types/lib/package.json' does not exist.",
|
||||
"File '/types/lib/index.d.ts' exist - use it as a name resolution result.",
|
||||
"======== Type reference directive 'lib' was successfully resolved to '/types/lib/index.d.ts', primary: true. ========",
|
||||
"======== Resolving module './mod1' from '/mod2.ts'. ========",
|
||||
"Module resolution kind is not specified, using 'NodeJs'.",
|
||||
"Loading module as file / folder, candidate module location '/mod1'.",
|
||||
"File '/mod1.ts' exist - use it as a name resolution result.",
|
||||
"======== Module name './mod1' was successfully resolved to '/mod1.ts'. ========"
|
||||
"======== Module name './mod1' was successfully resolved to '/mod1.ts'. ========",
|
||||
"======== Resolving type reference directive 'lib', containing file not set, root directory '/'. ========",
|
||||
"Resolving with primary search path '/types/'",
|
||||
"File '/types/lib/package.json' does not exist.",
|
||||
"File '/types/lib/index.d.ts' exist - use it as a name resolution result.",
|
||||
"======== Type reference directive 'lib' was successfully resolved to '/types/lib/index.d.ts', primary: true. ========"
|
||||
]
|
||||
11
tests/baselines/reference/typingsLookup1.js
Normal file
11
tests/baselines/reference/typingsLookup1.js
Normal file
@ -0,0 +1,11 @@
|
||||
//// [tests/cases/conformance/typings/typingsLookup1.ts] ////
|
||||
|
||||
//// [index.d.ts]
|
||||
declare var $: { x: any };
|
||||
|
||||
//// [a.ts]
|
||||
$.x;
|
||||
|
||||
|
||||
//// [a.js]
|
||||
$.x;
|
||||
11
tests/baselines/reference/typingsLookup1.symbols
Normal file
11
tests/baselines/reference/typingsLookup1.symbols
Normal file
@ -0,0 +1,11 @@
|
||||
=== tests/cases/conformance/typings/a.ts ===
|
||||
$.x;
|
||||
>$.x : Symbol(x, Decl(index.d.ts, 0, 16))
|
||||
>$ : Symbol($, Decl(index.d.ts, 0, 11))
|
||||
>x : Symbol(x, Decl(index.d.ts, 0, 16))
|
||||
|
||||
=== tests/cases/conformance/typings/node_modules/@types/jquery/index.d.ts ===
|
||||
declare var $: { x: any };
|
||||
>$ : Symbol($, Decl(index.d.ts, 0, 11))
|
||||
>x : Symbol(x, Decl(index.d.ts, 0, 16))
|
||||
|
||||
11
tests/baselines/reference/typingsLookup1.types
Normal file
11
tests/baselines/reference/typingsLookup1.types
Normal file
@ -0,0 +1,11 @@
|
||||
=== tests/cases/conformance/typings/a.ts ===
|
||||
$.x;
|
||||
>$.x : any
|
||||
>$ : { x: any; }
|
||||
>x : any
|
||||
|
||||
=== tests/cases/conformance/typings/node_modules/@types/jquery/index.d.ts ===
|
||||
declare var $: { x: any };
|
||||
>$ : { x: any; }
|
||||
>x : any
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user