diff --git a/.gitmodules b/.gitmodules
index bd4620625cf..fdf474a693d 100644
--- a/.gitmodules
+++ b/.gitmodules
@@ -18,3 +18,19 @@
path = tests/cases/user/TypeScript-WeChat-Starter/TypeScript-WeChat-Starter
url = https://github.com/Microsoft/TypeScript-WeChat-Starter.git
ignore = all
+[submodule "tests/cases/user/create-react-app/create-react-app"]
+ path = tests/cases/user/create-react-app/create-react-app
+ url = https://github.com/facebook/create-react-app.git
+ ignore = all
+[submodule "tests/cases/user/webpack/webpack"]
+ path = tests/cases/user/webpack/webpack
+ url = https://github.com/webpack/webpack.git
+ ignore = all
+[submodule "tests/cases/user/puppeteer/puppeteer"]
+ path = tests/cases/user/puppeteer/puppeteer
+ url = https://github.com/GoogleChrome/puppeteer.git
+ ignore = all
+[submodule "tests/cases/user/axios-src/axios-src"]
+ path = tests/cases/user/axios-src/axios-src
+ url = https://github.com/axios/axios.git
+ ignore = all
diff --git a/Gulpfile.ts b/Gulpfile.js
similarity index 85%
rename from Gulpfile.ts
rename to Gulpfile.js
index 1c6cfdd7ed1..afa7e775dcd 100644
--- a/Gulpfile.ts
+++ b/Gulpfile.js
@@ -1,35 +1,27 @@
///
-import * as cp from "child_process";
-import * as path from "path";
-import * as fs from "fs";
-import child_process = require("child_process");
-import originalGulp = require("gulp");
-import helpMaker = require("gulp-help");
-import runSequence = require("run-sequence");
-import concat = require("gulp-concat");
-import clone = require("gulp-clone");
-import newer = require("gulp-newer");
-import tsc = require("gulp-typescript");
-declare module "gulp-typescript" {
- interface Settings {
- pretty?: boolean;
- newLine?: string;
- noImplicitThis?: boolean;
- stripInternal?: boolean;
- types?: string[];
- }
-}
-import * as insert from "gulp-insert";
-import * as sourcemaps from "gulp-sourcemaps";
-import Q = require("q");
-import del = require("del");
-import mkdirP = require("mkdirp");
-import minimist = require("minimist");
-import browserify = require("browserify");
-import through2 = require("through2");
-import merge2 = require("merge2");
-import * as os from "os";
-import fold = require("travis-fold");
+// @ts-check
+const cp = require("child_process");
+const path = require("path");
+const fs = require("fs");
+const child_process = require("child_process");
+const originalGulp = require("gulp");
+const helpMaker = require("gulp-help");
+const runSequence = require("run-sequence");
+const concat = require("gulp-concat");
+const clone = require("gulp-clone");
+const newer = require("gulp-newer");
+const tsc = require("gulp-typescript");
+const insert = require("gulp-insert");
+const sourcemaps = require("gulp-sourcemaps");
+const Q = require("q");
+const del = require("del");
+const mkdirP = require("mkdirp");
+const minimist = require("minimist");
+const browserify = require("browserify");
+const through2 = require("through2");
+const merge2 = require("merge2");
+const os = require("os");
+const fold = require("travis-fold");
const gulp = helpMaker(originalGulp);
Error.stackTraceLimit = 1000;
@@ -73,17 +65,26 @@ const cmdLineOptions = minimist(process.argv.slice(2), {
});
const noop = () => {}; // tslint:disable-line no-empty
-function exec(cmd: string, args: string[], complete: () => void = noop, error: (e: any, status: number) => void = noop) {
+/**
+ * @param {string} cmd
+ * @param {string[]} args
+ * @param {() => void} complete
+ * @param {(e: *, status: number) => void} error
+ */
+function exec(cmd, args, complete = noop, error = noop) {
console.log(`${cmd} ${args.join(" ")}`);
// TODO (weswig): Update child_process types to add windowsVerbatimArguments to the type definition
const subshellFlag = isWin ? "/c" : "-c";
const command = isWin ? [possiblyQuote(cmd), ...args] : [`${cmd} ${args.join(" ")}`];
- const ex = cp.spawn(isWin ? "cmd" : "/bin/sh", [subshellFlag, ...command], { stdio: "inherit", windowsVerbatimArguments: true } as any);
+ const ex = cp.spawn(isWin ? "cmd" : "/bin/sh", [subshellFlag, ...command], { stdio: "inherit", windowsVerbatimArguments: true });
ex.on("exit", (code) => code === 0 ? complete() : error(/*e*/ undefined, code));
ex.on("error", error);
}
-function possiblyQuote(cmd: string) {
+/**
+ * @param {string} cmd
+ */
+function possiblyQuote(cmd) {
return cmd.indexOf(" ") >= 0 ? `"${cmd}"` : cmd;
}
@@ -215,12 +216,17 @@ for (const i in libraryTargets) {
.pipe(gulp.dest(".")));
}
-const configureNightlyJs = path.join(scriptsDirectory, "configureNightly.js");
-const configureNightlyTs = path.join(scriptsDirectory, "configureNightly.ts");
+const configurePreleleaseJs = path.join(scriptsDirectory, "configurePrerelease.js");
+const configurePreleleaseTs = path.join(scriptsDirectory, "configurePrerelease.ts");
const packageJson = "package.json";
const versionFile = path.join(compilerDirectory, "core.ts");
-function needsUpdate(source: string | string[], dest: string | string[]): boolean {
+/**
+ * @param {string | string[]} source
+ * @param {string | string[]} dest
+ * @returns {boolean}
+ */
+function needsUpdate(source, dest) {
if (typeof source === "string" && typeof dest === "string") {
if (fs.existsSync(dest)) {
const {mtime: outTime} = fs.statSync(dest);
@@ -283,8 +289,13 @@ function needsUpdate(source: string | string[], dest: string | string[]): boolea
return true;
}
-function getCompilerSettings(base: tsc.Settings, useBuiltCompiler?: boolean): tsc.Settings {
- const copy: tsc.Settings = {};
+/**
+ * @param {tsc.Settings} base
+ * @param {boolean=} useBuiltCompiler
+ * @returns {tsc.Settings}
+ */
+function getCompilerSettings(base, useBuiltCompiler) {
+ const copy = /** @type {tsc.Settings} */ ({});
for (const key in base) {
copy[key] = base[key];
}
@@ -293,32 +304,34 @@ function getCompilerSettings(base: tsc.Settings, useBuiltCompiler?: boolean): ts
}
copy.newLine = "lf";
if (useBuiltCompiler === true) {
- copy.typescript = require("./built/local/typescript.js");
+ copy.typescript = /** @type {*} */ (require("./built/local/typescript.js"));
}
else if (useBuiltCompiler === false) {
- copy.typescript = require("./lib/typescript.js");
+ copy.typescript = /** @type {*} */ (require("./lib/typescript.js"));
}
return copy;
}
-gulp.task(configureNightlyJs, /*help*/ false, [], () => {
- const settings: tsc.Settings = {
+gulp.task(configurePreleleaseJs, /*help*/ false, [], () => {
+ /** @type {tsc.Settings} */
+ const settings = {
declaration: false,
removeComments: true,
noResolve: false,
stripInternal: false,
+ module: "commonjs"
};
- return gulp.src(configureNightlyTs)
+ return gulp.src(configurePreleleaseTs)
.pipe(sourcemaps.init())
.pipe(tsc(settings))
- .pipe(sourcemaps.write(path.dirname(configureNightlyJs)))
- .pipe(gulp.dest(path.dirname(configureNightlyJs)));
+ .pipe(sourcemaps.write("."))
+ .pipe(gulp.dest("./scripts"));
});
// Nightly management tasks
-gulp.task("configure-nightly", "Runs scripts/configureNightly.ts to prepare a build for nightly publishing", [configureNightlyJs], (done) => {
- exec(host, [configureNightlyJs, packageJson, versionFile], done, done);
+gulp.task("configure-nightly", "Runs scripts/configurePrerelease.ts to prepare a build for nightly publishing", [configurePreleleaseJs], (done) => {
+ exec(host, [configurePreleleaseJs, "dev", packageJson, versionFile], done, done);
});
gulp.task("publish-nightly", "Runs `npm publish --tag next` to create a new nightly build on npm", ["LKG"], () => {
return runSequence("clean", "useDebugMode", "runtests-parallel", (done) => {
@@ -331,7 +344,8 @@ const importDefinitelyTypedTestsJs = path.join(importDefinitelyTypedTestsDirecto
const importDefinitelyTypedTestsTs = path.join(importDefinitelyTypedTestsDirectory, "importDefinitelyTypedTests.ts");
gulp.task(importDefinitelyTypedTestsJs, /*help*/ false, [], () => {
- const settings: tsc.Settings = getCompilerSettings({
+ /** @type {tsc.Settings} */
+ const settings = getCompilerSettings({
declaration: false,
removeComments: true,
noResolve: false,
@@ -362,20 +376,11 @@ const builtGeneratedDiagnosticMessagesJSON = path.join(builtLocalDirectory, "dia
// processDiagnosticMessages script
gulp.task(processDiagnosticMessagesJs, /*help*/ false, [], () => {
- const settings: tsc.Settings = getCompilerSettings({
- target: "es5",
- declaration: false,
- removeComments: true,
- noResolve: false,
- stripInternal: false,
- outFile: processDiagnosticMessagesJs
- }, /*useBuiltCompiler*/ false);
- return gulp.src(processDiagnosticMessagesTs)
+ const diagsProject = tsc.createProject('./scripts/processDiagnosticMessages.tsconfig.json');
+ return diagsProject.src()
.pipe(newer(processDiagnosticMessagesJs))
- .pipe(sourcemaps.init())
- .pipe(tsc(settings))
- .pipe(sourcemaps.write("."))
- .pipe(gulp.dest("."));
+ .pipe(diagsProject())
+ .pipe(gulp.dest(scriptsDirectory));
});
// The generated diagnostics map; built for the compiler and for the "generate-diagnostics" task
@@ -402,7 +407,8 @@ const generateLocalizedDiagnosticMessagesJs = path.join(scriptsDirectory, "gener
const generateLocalizedDiagnosticMessagesTs = path.join(scriptsDirectory, "generateLocalizedDiagnosticMessages.ts");
gulp.task(generateLocalizedDiagnosticMessagesJs, /*help*/ false, [], () => {
- const settings: tsc.Settings = getCompilerSettings({
+ /** @type {tsc.Settings} */
+ const settings = getCompilerSettings({
target: "es5",
declaration: false,
removeComments: true,
@@ -433,8 +439,12 @@ const nodePackageFile = path.join(builtLocalDirectory, "typescript.js");
const nodeDefinitionsFile = path.join(builtLocalDirectory, "typescript.d.ts");
const nodeStandaloneDefinitionsFile = path.join(builtLocalDirectory, "typescript_standalone.d.ts");
-let copyrightContent: string;
-function prependCopyright(outputCopyright: boolean = !useDebugMode) {
+/** @type {string} */
+let copyrightContent;
+/**
+ * @param {boolean} outputCopyright
+ */
+function prependCopyright(outputCopyright = !useDebugMode) {
return insert.prepend(outputCopyright ? (copyrightContent || (copyrightContent = fs.readFileSync(copyright).toString())) : "");
}
@@ -526,9 +536,10 @@ const tsserverLibraryDefinitionFile = path.join(builtLocalDirectory, "tsserverli
gulp.task(tsserverLibraryFile, /*help*/ false, [servicesFile, typesMapJson], (done) => {
const serverLibraryProject = tsc.createProject("src/server/tsconfig.library.json", getCompilerSettings({ removeComments: false }, /*useBuiltCompiler*/ true));
- const {js, dts}: { js: NodeJS.ReadableStream, dts: NodeJS.ReadableStream } = serverLibraryProject.src()
+ /** @type {{ js: NodeJS.ReadableStream, dts: NodeJS.ReadableStream }} */
+ const {js, dts} = serverLibraryProject.src()
.pipe(sourcemaps.init())
- .pipe(newer({ dest: tsserverLibraryFile, extra: ["src/compiler/**/*.ts", "src/services/**/*.ts"] }))
+ .pipe(newer(/** @type {*} */({ dest: tsserverLibraryFile, extra: ["src/compiler/**/*.ts", "src/services/**/*.ts"] })))
.pipe(serverLibraryProject());
return merge2([
@@ -563,7 +574,8 @@ const specWord = path.join(docDirectory, "TypeScript Language Specification.docx
const specMd = path.join(docDirectory, "spec.md");
gulp.task(word2mdJs, /*help*/ false, [], () => {
- const settings: tsc.Settings = getCompilerSettings({
+ /** @type {tsc.Settings} */
+ const settings = getCompilerSettings({
outFile: word2mdJs
}, /*useBuiltCompiler*/ false);
return gulp.src(word2mdTs)
@@ -642,7 +654,8 @@ function deleteTemporaryProjectOutput() {
return del(path.join(localBaseline, "projectOutput/"));
}
-let savedNodeEnv: string;
+/** @type {string} */
+let savedNodeEnv;
function setNodeEnvToDevelopment() {
savedNodeEnv = process.env.NODE_ENV;
process.env.NODE_ENV = "development";
@@ -652,7 +665,12 @@ function restoreSavedNodeEnv() {
process.env.NODE_ENV = savedNodeEnv;
}
-function runConsoleTests(defaultReporter: string, runInParallel: boolean, done: (e?: any) => void) {
+/**
+ * @param {string} defaultReporter
+ * @param {boolean} runInParallel
+ * @param {(e?: any) => void} done
+ */
+function runConsoleTests(defaultReporter, runInParallel, done) {
const lintFlag = cmdLineOptions.lint;
cleanTestDirs((err) => {
if (err) { console.error(err); failWithStatus(err, 1); }
@@ -727,7 +745,11 @@ function runConsoleTests(defaultReporter: string, runInParallel: boolean, done:
}
});
- function failWithStatus(err?: any, status?: number) {
+ /**
+ * @param {any=} err
+ * @param {number=} status
+ */
+ function failWithStatus(err, status) {
if (err || status) {
process.exit(typeof status === "number" ? status : 2);
}
@@ -743,7 +765,11 @@ function runConsoleTests(defaultReporter: string, runInParallel: boolean, done:
}
}
- function finish(error?: any, errorStatus?: number) {
+ /**
+ * @param {any=} error
+ * @param {number=} errorStatus
+ */
+ function finish(error, errorStatus) {
restoreSavedNodeEnv();
deleteTestConfig().then(deleteTemporaryProjectOutput).then(() => {
if (error !== undefined || errorStatus !== undefined) {
@@ -773,7 +799,8 @@ gulp.task("runtests",
const nodeServerOutFile = "tests/webTestServer.js";
const nodeServerInFile = "tests/webTestServer.ts";
gulp.task(nodeServerOutFile, /*help*/ false, [servicesFile], () => {
- const settings: tsc.Settings = getCompilerSettings({ module: "commonjs" }, /*useBuiltCompiler*/ true);
+ /** @type {tsc.Settings} */
+ const settings = getCompilerSettings({ module: "commonjs" }, /*useBuiltCompiler*/ true);
return gulp.src(nodeServerInFile)
.pipe(newer(nodeServerOutFile))
.pipe(sourcemaps.init())
@@ -782,16 +809,18 @@ gulp.task(nodeServerOutFile, /*help*/ false, [servicesFile], () => {
.pipe(gulp.dest(path.dirname(nodeServerOutFile)));
});
-import convertMap = require("convert-source-map");
-import sorcery = require("sorcery");
-import Vinyl = require("vinyl");
+const convertMap = require("convert-source-map");
+const sorcery = require("sorcery");
+const Vinyl = require("vinyl");
const bundlePath = path.resolve("built/local/bundle.js");
gulp.task("browserify", "Runs browserify on run.js to produce a file suitable for running tests in the browser", [servicesFile], (done) => {
const testProject = tsc.createProject("src/harness/tsconfig.json", getCompilerSettings({ outFile: bundlePath, inlineSourceMap: true }, /*useBuiltCompiler*/ true));
- let originalMap: any;
- let prebundledContent: string;
+ /** @type {*} */
+ let originalMap;
+ /** @type {string} */
+ let prebundledContent;
browserify(testProject.src()
.pipe(newer(bundlePath))
.pipe(sourcemaps.init())
@@ -855,8 +884,10 @@ gulp.task("browserify", "Runs browserify on run.js to produce a file suitable fo
});
});
-
-function cleanTestDirs(done: (e?: any) => void) {
+/**
+ * @param {(e?: any) => void} done
+ */
+function cleanTestDirs(done) {
// Clean the local baselines & Rwc baselines directories
del([
localBaseline,
@@ -872,8 +903,17 @@ function cleanTestDirs(done: (e?: any) => void) {
});
}
-// used to pass data from jake command line directly to run.js
-function writeTestConfigFile(tests: string, runners: string, light: boolean, taskConfigsFolder?: string, workerCount?: number, stackTraceLimit?: string, timeout?: number) {
+/**
+ * used to pass data from jake command line directly to run.js
+ * @param {string} tests
+ * @param {string} runners
+ * @param {boolean} light
+ * @param {string=} taskConfigsFolder
+ * @param {number=} workerCount
+ * @param {string=} stackTraceLimit
+ * @param {number=} timeout
+ */
+function writeTestConfigFile(tests, runners, light, taskConfigsFolder, workerCount, stackTraceLimit, timeout) {
const testConfigContents = JSON.stringify({
test: tests ? [tests] : undefined,
runner: runners ? runners.split(",") : undefined,
@@ -974,7 +1014,7 @@ gulp.task("baseline-accept-test262", "Makes the most recent test262 test results
const webhostPath = "tests/webhost/webtsc.ts";
const webhostJsPath = "tests/webhost/webtsc.js";
gulp.task(webhostJsPath, /*help*/ false, [servicesFile], () => {
- const settings: tsc.Settings = getCompilerSettings({
+ const settings = getCompilerSettings({
outFile: webhostJsPath
}, /*useBuiltCompiler*/ true);
return gulp.src(webhostPath)
@@ -994,7 +1034,7 @@ gulp.task("webhost", "Builds the tsc web host", [webhostJsPath], () => {
const perftscPath = "tests/perftsc.ts";
const perftscJsPath = "built/local/perftsc.js";
gulp.task(perftscJsPath, /*help*/ false, [servicesFile], () => {
- const settings: tsc.Settings = getCompilerSettings({
+ const settings = getCompilerSettings({
outFile: perftscJsPath
}, /*useBuiltCompiler*/ true);
return gulp.src(perftscPath)
@@ -1025,7 +1065,7 @@ gulp.task(loggedIOJsPath, /*help*/ false, [], (done) => {
const instrumenterPath = path.join(harnessDirectory, "instrumenter.ts");
const instrumenterJsPath = path.join(builtLocalDirectory, "instrumenter.js");
gulp.task(instrumenterJsPath, /*help*/ false, [servicesFile], () => {
- const settings: tsc.Settings = getCompilerSettings({
+ const settings = getCompilerSettings({
module: "commonjs",
target: "es5",
lib: [
@@ -1052,7 +1092,7 @@ gulp.task("update-sublime", "Updates the sublime plugin's tsserver", ["local", s
});
gulp.task("build-rules", "Compiles tslint rules to js", () => {
- const settings: tsc.Settings = getCompilerSettings({ module: "commonjs", lib: ["es6"] }, /*useBuiltCompiler*/ false);
+ const settings = getCompilerSettings({ module: "commonjs", lib: ["es6"] }, /*useBuiltCompiler*/ false);
const dest = path.join(builtLocalDirectory, "tslint");
return gulp.src("scripts/tslint/**/*.ts")
.pipe(newer({
@@ -1065,51 +1105,6 @@ gulp.task("build-rules", "Compiles tslint rules to js", () => {
.pipe(gulp.dest(dest));
});
-const lintTargets = [
- "Gulpfile.ts",
- "src/compiler/**/*.ts",
- "src/harness/**/*.ts",
- "!src/harness/unittests/services/formatting/**/*.ts",
- "src/server/**/*.ts",
- "scripts/tslint/**/*.ts",
- "src/services/**/*.ts",
- "tests/*.ts", "tests/webhost/*.ts" // Note: does *not* descend recursively
-];
-
-function sendNextFile(files: {path: string}[], child: cp.ChildProcess, callback: (failures: number) => void, failures: number) {
- const file = files.pop();
- if (file) {
- console.log(`Linting '${file.path}'.`);
- child.send({ kind: "file", name: file.path });
- }
- else {
- child.send({ kind: "close" });
- callback(failures);
- }
-}
-
-function spawnLintWorker(files: {path: string}[], callback: (failures: number) => void) {
- const child = cp.fork("./scripts/parallel-lint");
- let failures = 0;
- child.on("message", data => {
- switch (data.kind) {
- case "result":
- if (data.failures > 0) {
- failures += data.failures;
- console.log(data.output);
- }
- sendNextFile(files, child, callback, failures);
- break;
- case "error":
- console.error(data.error);
- failures++;
- sendNextFile(files, child, callback, failures);
- break;
- }
- });
- sendNextFile(files, child, callback, failures);
-}
-
gulp.task("lint", "Runs tslint on the compiler sources. Optional arguments are: --f[iles]=regex", ["build-rules"], () => {
if (fold.isTravis()) console.log(fold.start("lint"));
for (const project of ["scripts/tslint/tsconfig.json", "src/tsconfig-base.json"]) {
diff --git a/Jakefile.js b/Jakefile.js
index d570a7cfc3d..3eb8736445b 100644
--- a/Jakefile.js
+++ b/Jakefile.js
@@ -87,93 +87,10 @@ var typingsInstallerSources = filesFromConfig(path.join(serverDirectory, "typing
var watchGuardSources = filesFromConfig(path.join(serverDirectory, "watchGuard/tsconfig.json"));
var serverSources = filesFromConfig(path.join(serverDirectory, "tsconfig.json"));
var languageServiceLibrarySources = filesFromConfig(path.join(serverDirectory, "tsconfig.library.json"));
+var harnessSources = filesFromConfig("./src/harness/tsconfig.json");
var typesMapOutputPath = path.join(builtLocalDirectory, 'typesMap.json');
-var harnessCoreSources = [
- "harness.ts",
- "virtualFileSystem.ts",
- "virtualFileSystemWithWatch.ts",
- "sourceMapRecorder.ts",
- "harnessLanguageService.ts",
- "fourslash.ts",
- "runnerbase.ts",
- "compilerRunner.ts",
- "typeWriter.ts",
- "fourslashRunner.ts",
- "projectsRunner.ts",
- "loggedIO.ts",
- "rwcRunner.ts",
- "externalCompileRunner.ts",
- "test262Runner.ts",
- "./parallel/shared.ts",
- "./parallel/host.ts",
- "./parallel/worker.ts",
- "runner.ts"
-].map(function (f) {
- return path.join(harnessDirectory, f);
-});
-
-var harnessSources = harnessCoreSources.concat([
- "base64.ts",
- "incrementalParser.ts",
- "jsDocParsing.ts",
- "services/colorization.ts",
- "services/documentRegistry.ts",
- "services/preProcessFile.ts",
- "services/patternMatcher.ts",
- "session.ts",
- "versionCache.ts",
- "convertToBase64.ts",
- "transpile.ts",
- "reuseProgramStructure.ts",
- "textStorage.ts",
- "moduleResolution.ts",
- "tsconfigParsing.ts",
- "asserts.ts",
- "builder.ts",
- "commandLineParsing.ts",
- "configurationExtension.ts",
- "convertCompilerOptionsFromJson.ts",
- "convertTypeAcquisitionFromJson.ts",
- "tsserverProjectSystem.ts",
- "tscWatchMode.ts",
- "compileOnSave.ts",
- "typingsInstaller.ts",
- "projectErrors.ts",
- "matchFiles.ts",
- "organizeImports.ts",
- "initializeTSConfig.ts",
- "extractConstants.ts",
- "extractFunctions.ts",
- "extractRanges.ts",
- "extractTestHelpers.ts",
- "printer.ts",
- "textChanges.ts",
- "telemetry.ts",
- "transform.ts",
- "customTransforms.ts",
- "programMissingFiles.ts",
- "programNoParseFalsyFileNames.ts",
- "symbolWalker.ts",
- "languageService.ts",
- "publicApi.ts",
- "hostNewLineSupport.ts",
-].map(function (f) {
- return path.join(unittestsDirectory, f);
-})).concat([
- "protocol.ts",
- "utilities.ts",
- "scriptVersionCache.ts",
- "scriptInfo.ts",
- "project.ts",
- "typingsCache.ts",
- "editorServices.ts",
- "session.ts",
-].map(function (f) {
- return path.join(serverDirectory, f);
-}));
-
var es2015LibrarySources = [
"es2015.core.d.ts",
"es2015.collection.d.ts",
@@ -451,6 +368,8 @@ task("lib", libraryTargets);
// Generate diagnostics
var processDiagnosticMessagesJs = path.join(scriptsDirectory, "processDiagnosticMessages.js");
var processDiagnosticMessagesTs = path.join(scriptsDirectory, "processDiagnosticMessages.ts");
+var processDiagnosticMessagesSources = filesFromConfig("./scripts/processDiagnosticMessages.tsconfig.json");
+
var diagnosticMessagesJson = path.join(compilerDirectory, "diagnosticMessages.json");
var diagnosticInfoMapTs = path.join(compilerDirectory, "diagnosticInformationMap.generated.ts");
var generatedDiagnosticMessagesJSON = path.join(compilerDirectory, "diagnosticMessages.generated.json");
@@ -460,8 +379,8 @@ file(processDiagnosticMessagesTs);
// processDiagnosticMessages script
compileFile(processDiagnosticMessagesJs,
- [processDiagnosticMessagesTs],
- [processDiagnosticMessagesTs],
+ processDiagnosticMessagesSources,
+ processDiagnosticMessagesSources,
[],
/*useBuiltCompiler*/ false);
@@ -572,7 +491,7 @@ compileFile(/*outfile*/configurePrereleaseJs,
/*prereqs*/[configurePrereleaseTs],
/*prefixes*/[],
/*useBuiltCompiler*/ false,
- { noOutFile: false, generateDeclarations: false, keepComments: false, noResolve: false, stripInternal: false });
+ { noOutFile: true, generateDeclarations: false, keepComments: false, noResolve: false, stripInternal: false });
task("setDebugMode", function () {
useDebugMode = true;
diff --git a/package-lock.json b/package-lock.json
index 990d3fbcb5a..265d4233ad8 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -1,33 +1,16 @@
{
"name": "typescript",
- "version": "2.8.0",
+ "version": "2.9.0",
"lockfileVersion": 1,
"requires": true,
"dependencies": {
- "@browserify/acorn5-object-spread": {
- "version": "5.0.1",
- "resolved": "https://registry.npmjs.org/@browserify/acorn5-object-spread/-/acorn5-object-spread-5.0.1.tgz",
- "integrity": "sha512-sFCUPzgeEjdq3rinwy4TFXtak2YZdhqpj6MdNusxkdTFr9TXAUEYK4YQSamR8Joqt/yii1drgl5hk8q/AtJDKA==",
- "dev": true,
- "requires": {
- "acorn": "5.3.0"
- },
- "dependencies": {
- "acorn": {
- "version": "5.3.0",
- "resolved": "https://registry.npmjs.org/acorn/-/acorn-5.3.0.tgz",
- "integrity": "sha512-Yej+zOJ1Dm/IMZzzj78OntP/r3zHEaKcyNoU2lAaxPtrseM6rF0xwqoz5Q5ysAiED9hTjI2hgtvLXitlCN1/Ug==",
- "dev": true
- }
- }
- },
"@gulp-sourcemaps/identity-map": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/@gulp-sourcemaps/identity-map/-/identity-map-1.0.1.tgz",
"integrity": "sha1-z6I7xYQPkQTOMqZedNt+epdLvuE=",
"dev": true,
"requires": {
- "acorn": "5.3.0",
+ "acorn": "5.5.3",
"css": "2.2.1",
"normalize-path": "2.1.1",
"source-map": "0.5.7",
@@ -35,9 +18,9 @@
},
"dependencies": {
"acorn": {
- "version": "5.3.0",
- "resolved": "https://registry.npmjs.org/acorn/-/acorn-5.3.0.tgz",
- "integrity": "sha512-Yej+zOJ1Dm/IMZzzj78OntP/r3zHEaKcyNoU2lAaxPtrseM6rF0xwqoz5Q5ysAiED9hTjI2hgtvLXitlCN1/Ug==",
+ "version": "5.5.3",
+ "resolved": "https://registry.npmjs.org/acorn/-/acorn-5.5.3.tgz",
+ "integrity": "sha512-jd5MkIUlbbmb07nXH0DT3y7rDVtkzDi4XZOUVWAer8ajmF/DTSSbl5oNFyDOl/OXA33Bl79+ypHhl2pN20VeOQ==",
"dev": true
}
}
@@ -63,9 +46,9 @@
}
},
"@types/chai": {
- "version": "4.1.2",
- "resolved": "https://registry.npmjs.org/@types/chai/-/chai-4.1.2.tgz",
- "integrity": "sha512-D8uQwKYUw2KESkorZ27ykzXgvkDJYXVEihGklgfp5I4HUP8D6IxtcdLTMB1emjQiWzV7WZ5ihm1cxIzVwjoleQ==",
+ "version": "4.1.3",
+ "resolved": "https://registry.npmjs.org/@types/chai/-/chai-4.1.3.tgz",
+ "integrity": "sha512-f5dXGzOJycyzSMdaXVhiBhauL4dYydXwVpavfQ1mVCaGjR56a9QfklXObUxlIY9bGTmCPHEEZ04I16BZ/8w5ww==",
"dev": true
},
"@types/convert-source-map": {
@@ -75,18 +58,18 @@
"dev": true
},
"@types/del": {
- "version": "3.0.0",
- "resolved": "https://registry.npmjs.org/@types/del/-/del-3.0.0.tgz",
- "integrity": "sha512-18mSs54BvzV8+TTQxt0ancig6tsuPZySnhp3cQkWFFDmDMavU4pmWwR+bHHqRBWODYqpzIzVkqKLuk/fP6yypQ==",
+ "version": "3.0.1",
+ "resolved": "https://registry.npmjs.org/@types/del/-/del-3.0.1.tgz",
+ "integrity": "sha512-y6qRq6raBuu965clKgx6FHuiPu3oHdtmzMPXi8Uahsjdq1L6DL5fS/aY5/s71YwM7k6K1QIWvem5vNwlnNGIkQ==",
"dev": true,
"requires": {
"@types/glob": "5.0.35"
}
},
"@types/events": {
- "version": "1.1.0",
- "resolved": "https://registry.npmjs.org/@types/events/-/events-1.1.0.tgz",
- "integrity": "sha512-y3bR98mzYOo0pAZuiLari+cQyiKk3UXRuT45h1RjhfeCzqkjaVsfZJNaxdgtk7/3tzOm1ozLTqEqMP3VbI48jw==",
+ "version": "1.2.0",
+ "resolved": "https://registry.npmjs.org/@types/events/-/events-1.2.0.tgz",
+ "integrity": "sha512-KEIlhXnIutzKwRbQkGWb/I4HFqBuUykAdHgDED6xqwXJfONCjF5VoE0cXEiurh3XauygxzeDzgtXUqvLkxFzzA==",
"dev": true
},
"@types/glob": {
@@ -95,7 +78,7 @@
"integrity": "sha512-wc+VveszMLyMWFvXLkloixT4n0harUIVZjnpzztaZ0nKLuul7Z32iMt2fUFGAaZ4y1XWjFRMtCI5ewvyh4aIeg==",
"dev": true,
"requires": {
- "@types/events": "1.1.0",
+ "@types/events": "1.2.0",
"@types/minimatch": "3.0.3",
"@types/node": "8.5.5"
}
@@ -189,9 +172,9 @@
}
},
"@types/mocha": {
- "version": "5.0.0",
- "resolved": "https://registry.npmjs.org/@types/mocha/-/mocha-5.0.0.tgz",
- "integrity": "sha512-ZS0vBV7Jn5Z/Q4T3VXauEKMDCV8nWOtJJg90OsDylkYJiQwcWtKuLzohWzrthBkerUF7DLMmJcwOPEP0i/AOXw==",
+ "version": "5.2.0",
+ "resolved": "https://registry.npmjs.org/@types/mocha/-/mocha-5.2.0.tgz",
+ "integrity": "sha512-YeDiSEzznwZwwp766SJ6QlrTyBYUGPSIwmREHVTmktUYiT/WADdWtpt9iH0KuUSf8lZLdI4lP0X6PBzPo5//JQ==",
"dev": true
},
"@types/node": {
@@ -207,13 +190,13 @@
"dev": true,
"requires": {
"@types/node": "8.5.5",
- "@types/q": "1.0.7"
+ "@types/q": "1.5.0"
}
},
"@types/q": {
- "version": "1.0.7",
- "resolved": "https://registry.npmjs.org/@types/q/-/q-1.0.7.tgz",
- "integrity": "sha512-0WS7XU7sXzQ7J1nbnMKKYdjrrFoO3YtZYgUzeV8JFXffPnHfvSJQleR70I8BOAsOm14i4dyaAZ3YzqIl1YhkXQ==",
+ "version": "1.5.0",
+ "resolved": "https://registry.npmjs.org/@types/q/-/q-1.5.0.tgz",
+ "integrity": "sha512-sWj7AMiG0fYmta6ug1ublLjtj/tqn+CnCZeo7yswR1ykxel0FOWFGdWviTcGSNAMmtLbycDqbg6w98VPFKJmbw==",
"dev": true
},
"@types/run-sequence": {
@@ -235,6 +218,12 @@
"@types/node": "8.5.5"
}
},
+ "@types/travis-fold": {
+ "version": "0.1.0",
+ "resolved": "https://registry.npmjs.org/@types/travis-fold/-/travis-fold-0.1.0.tgz",
+ "integrity": "sha512-qrXB0Div8vIzA8P809JRlh9lD4mSOYwRBJbU1zcj0BWhULP15Zx0oQyJtjaOnkNR5RZcYQDbgimj40M1GDmhcQ==",
+ "dev": true
+ },
"@types/vinyl": {
"version": "2.0.2",
"resolved": "https://registry.npmjs.org/@types/vinyl/-/vinyl-2.0.2.tgz",
@@ -275,6 +264,24 @@
"integrity": "sha1-EFSVrlNh1pe9GVyCUZLhrX8lN4c=",
"dev": true
},
+ "acorn-node": {
+ "version": "1.3.0",
+ "resolved": "https://registry.npmjs.org/acorn-node/-/acorn-node-1.3.0.tgz",
+ "integrity": "sha512-efP54n3d1aLfjL2UMdaXa6DsswwzJeI5rqhbFvXMrKiJ6eJFpf+7R0zN7t8IC+XKn2YOAFAv6xbBNgHUkoHWLw==",
+ "dev": true,
+ "requires": {
+ "acorn": "5.5.3",
+ "xtend": "4.0.1"
+ },
+ "dependencies": {
+ "acorn": {
+ "version": "5.5.3",
+ "resolved": "https://registry.npmjs.org/acorn/-/acorn-5.5.3.tgz",
+ "integrity": "sha512-jd5MkIUlbbmb07nXH0DT3y7rDVtkzDi4XZOUVWAer8ajmF/DTSSbl5oNFyDOl/OXA33Bl79+ypHhl2pN20VeOQ==",
+ "dev": true
+ }
+ }
+ },
"align-text": {
"version": "0.1.4",
"resolved": "https://registry.npmjs.org/align-text/-/align-text-0.1.4.tgz",
@@ -345,6 +352,15 @@
"integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=",
"dev": true
},
+ "ansi-styles": {
+ "version": "3.2.1",
+ "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz",
+ "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==",
+ "dev": true,
+ "requires": {
+ "color-convert": "1.9.1"
+ }
+ },
"ansi-wrap": {
"version": "0.1.0",
"resolved": "https://registry.npmjs.org/ansi-wrap/-/ansi-wrap-0.1.0.tgz",
@@ -367,9 +383,9 @@
"dev": true
},
"argparse": {
- "version": "1.0.9",
- "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.9.tgz",
- "integrity": "sha1-c9g7wmP4bpf4zE9rrhsOkKfSLIY=",
+ "version": "1.0.10",
+ "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz",
+ "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==",
"dev": true,
"requires": {
"sprintf-js": "1.0.3"
@@ -450,21 +466,15 @@
"integrity": "sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg=",
"dev": true
},
- "arrify": {
- "version": "1.0.1",
- "resolved": "https://registry.npmjs.org/arrify/-/arrify-1.0.1.tgz",
- "integrity": "sha1-iYUI2iIm84DfkEcoRWhJwVAaSw0=",
- "dev": true
- },
"asn1.js": {
- "version": "4.9.2",
- "resolved": "https://registry.npmjs.org/asn1.js/-/asn1.js-4.9.2.tgz",
- "integrity": "sha512-b/OsSjvWEo8Pi8H0zsDd2P6Uqo2TK2pH8gNLSJtNLM2Db0v2QaAZ0pBQJXVjAn4gBuugeVDr7s63ZogpUIwWDg==",
+ "version": "4.10.1",
+ "resolved": "https://registry.npmjs.org/asn1.js/-/asn1.js-4.10.1.tgz",
+ "integrity": "sha512-p32cOF5q0Zqs9uBiONKYLm6BClCoBCM5O9JfeUSlnQLBTxYdTK+pW+nXflm8UkKd2UYlEbYz5qEi0JuZR9ckSw==",
"dev": true,
"requires": {
"bn.js": "4.11.8",
"inherits": "2.0.3",
- "minimalistic-assert": "1.0.0"
+ "minimalistic-assert": "1.0.1"
}
},
"assert": {
@@ -504,9 +514,9 @@
"dev": true
},
"atob": {
- "version": "2.0.3",
- "resolved": "https://registry.npmjs.org/atob/-/atob-2.0.3.tgz",
- "integrity": "sha1-GcenYEc3dEaPILLS0DNyrX1Mv10=",
+ "version": "2.1.0",
+ "resolved": "https://registry.npmjs.org/atob/-/atob-2.1.0.tgz",
+ "integrity": "sha512-SuiKH8vbsOyCALjA/+EINmt/Kdl+TQPrtFgW7XZZcwtryFu9e5kQoX3bjCW6mIvGH1fbeAZZuvwGR5IlBRznGw==",
"dev": true
},
"babel-code-frame": {
@@ -560,18 +570,58 @@
"dev": true,
"requires": {
"cache-base": "1.0.1",
- "class-utils": "0.3.5",
+ "class-utils": "0.3.6",
"component-emitter": "1.2.1",
"define-property": "1.0.0",
"isobject": "3.0.1",
- "mixin-deep": "1.3.0",
+ "mixin-deep": "1.3.1",
"pascalcase": "0.1.1"
+ },
+ "dependencies": {
+ "define-property": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz",
+ "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=",
+ "dev": true,
+ "requires": {
+ "is-descriptor": "1.0.2"
+ }
+ },
+ "is-accessor-descriptor": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz",
+ "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==",
+ "dev": true,
+ "requires": {
+ "kind-of": "6.0.2"
+ }
+ },
+ "is-data-descriptor": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz",
+ "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==",
+ "dev": true,
+ "requires": {
+ "kind-of": "6.0.2"
+ }
+ },
+ "is-descriptor": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz",
+ "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==",
+ "dev": true,
+ "requires": {
+ "is-accessor-descriptor": "1.0.0",
+ "is-data-descriptor": "1.0.0",
+ "kind-of": "6.0.2"
+ }
+ }
}
},
"base64-js": {
- "version": "1.2.1",
- "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.2.1.tgz",
- "integrity": "sha512-dwVUVIXsBZXwTuwnXI9RK8sBmgq09NDHzyR9SAph9eqk76gKK2JSQmZARC2zRC81JC2QTtxD0ARU5qTS25gIGw==",
+ "version": "1.3.0",
+ "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.3.0.tgz",
+ "integrity": "sha512-ccav/yGvoa80BQDljCxsmmQ3Xvx60/UpBIij5QN21W3wBi/hhIC9OoO+KLpu9IJTS9j4DRVJ3aDDF9cMSoa2lw==",
"dev": true
},
"beeper": {
@@ -587,9 +637,9 @@
"dev": true
},
"brace-expansion": {
- "version": "1.1.8",
- "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.8.tgz",
- "integrity": "sha1-wHshHHyVLsH479Uad+8NHTmQopI=",
+ "version": "1.1.11",
+ "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz",
+ "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==",
"dev": true,
"requires": {
"balanced-match": "1.0.0",
@@ -597,22 +647,32 @@
}
},
"braces": {
- "version": "2.3.0",
- "resolved": "https://registry.npmjs.org/braces/-/braces-2.3.0.tgz",
- "integrity": "sha512-P4O8UQRdGiMLWSizsApmXVQDBS6KCt7dSexgLKBmH5Hr1CZq7vsnscFh8oR1sP1ab1Zj0uCHCEzZeV6SfUf3rA==",
+ "version": "2.3.2",
+ "resolved": "https://registry.npmjs.org/braces/-/braces-2.3.2.tgz",
+ "integrity": "sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w==",
"dev": true,
"requires": {
"arr-flatten": "1.1.0",
"array-unique": "0.3.2",
- "define-property": "1.0.0",
"extend-shallow": "2.0.1",
"fill-range": "4.0.0",
"isobject": "3.0.1",
"repeat-element": "1.1.2",
- "snapdragon": "0.8.1",
+ "snapdragon": "0.8.2",
"snapdragon-node": "2.1.1",
"split-string": "3.1.0",
- "to-regex": "3.0.1"
+ "to-regex": "3.0.2"
+ },
+ "dependencies": {
+ "extend-shallow": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz",
+ "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=",
+ "dev": true,
+ "requires": {
+ "is-extendable": "0.1.1"
+ }
+ }
}
},
"brorand": {
@@ -622,16 +682,17 @@
"dev": true
},
"browser-pack": {
- "version": "6.0.2",
- "resolved": "https://registry.npmjs.org/browser-pack/-/browser-pack-6.0.2.tgz",
- "integrity": "sha1-+GzWzvT1MAyOY+B6TVEvZfv/RTE=",
+ "version": "6.1.0",
+ "resolved": "https://registry.npmjs.org/browser-pack/-/browser-pack-6.1.0.tgz",
+ "integrity": "sha512-erYug8XoqzU3IfcU8fUgyHqyOXqIE4tUTTQ+7mqUjQlvnXkOO6OlT9c/ZoJVHYoAaqGxr09CN53G7XIsO4KtWA==",
"dev": true,
"requires": {
"JSONStream": "1.3.2",
- "combine-source-map": "0.7.2",
+ "combine-source-map": "0.8.0",
"defined": "1.0.0",
+ "safe-buffer": "5.1.2",
"through2": "2.0.3",
- "umd": "3.0.1"
+ "umd": "3.0.3"
}
},
"browser-resolve": {
@@ -643,18 +704,24 @@
"resolve": "1.1.7"
}
},
+ "browser-stdout": {
+ "version": "1.3.1",
+ "resolved": "https://registry.npmjs.org/browser-stdout/-/browser-stdout-1.3.1.tgz",
+ "integrity": "sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw==",
+ "dev": true
+ },
"browserify": {
- "version": "16.1.1",
- "resolved": "https://registry.npmjs.org/browserify/-/browserify-16.1.1.tgz",
- "integrity": "sha512-iSH21jK0+IApV8YHOfmGt1qsGd74oflQ1Ko/28JOkWLFNBngAQfKb6WYIJ9CufH8vycqKX1sYU3y7ZrVhwevAg==",
+ "version": "16.2.0",
+ "resolved": "https://registry.npmjs.org/browserify/-/browserify-16.2.0.tgz",
+ "integrity": "sha512-yotdAkp/ZbgDesHQBYU37zjc29JDH4iXT8hjzM1fdUVWogjARX0S1cKeX24Ci6zZ+jG+ADmCTRt6xvtmJnI+BQ==",
"dev": true,
"requires": {
"JSONStream": "1.3.2",
"assert": "1.4.1",
- "browser-pack": "6.0.2",
+ "browser-pack": "6.1.0",
"browser-resolve": "1.11.2",
"browserify-zlib": "0.2.0",
- "buffer": "5.0.8",
+ "buffer": "5.1.0",
"cached-path-relative": "1.0.1",
"concat-stream": "1.6.2",
"console-browserify": "1.1.0",
@@ -670,10 +737,10 @@
"htmlescape": "1.1.1",
"https-browserify": "1.0.0",
"inherits": "2.0.3",
- "insert-module-globals": "7.0.1",
- "labeled-stream-splicer": "2.0.0",
+ "insert-module-globals": "7.0.6",
+ "labeled-stream-splicer": "2.0.1",
"mkdirp": "0.5.1",
- "module-deps": "6.0.0",
+ "module-deps": "6.0.2",
"os-browserify": "0.3.0",
"parents": "1.0.1",
"path-browserify": "0.0.0",
@@ -681,119 +748,53 @@
"punycode": "1.4.1",
"querystring-es3": "0.2.1",
"read-only-stream": "2.0.0",
- "readable-stream": "2.3.3",
+ "readable-stream": "2.3.6",
"resolve": "1.1.7",
"shasum": "1.0.2",
"shell-quote": "1.6.1",
"stream-browserify": "2.0.1",
- "stream-http": "2.7.2",
- "string_decoder": "1.0.3",
+ "stream-http": "2.8.1",
+ "string_decoder": "1.1.1",
"subarg": "1.0.0",
- "syntax-error": "1.3.0",
+ "syntax-error": "1.4.0",
"through2": "2.0.3",
"timers-browserify": "1.4.2",
"tty-browserify": "0.0.1",
"url": "0.11.0",
"util": "0.10.3",
- "vm-browserify": "0.0.4",
+ "vm-browserify": "1.0.1",
"xtend": "4.0.1"
- },
- "dependencies": {
- "concat-stream": {
- "version": "1.6.2",
- "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.6.2.tgz",
- "integrity": "sha512-27HBghJxjiZtIk3Ycvn/4kbJk/1uZuJFfuPEns6LaEvpvG1f0hTea8lilrouyo9mVc2GWdcEZ8OLoGmSADlrCw==",
- "dev": true,
- "requires": {
- "buffer-from": "1.0.0",
- "inherits": "2.0.3",
- "readable-stream": "2.3.3",
- "typedarray": "0.0.6"
- }
- },
- "domain-browser": {
- "version": "1.2.0",
- "resolved": "https://registry.npmjs.org/domain-browser/-/domain-browser-1.2.0.tgz",
- "integrity": "sha512-jnjyiM6eRyZl2H+W8Q/zLMA481hzi0eszAaBUzIVnmYVDBbnLxVNnfu1HgEBvCbL+71FrxMl3E6lpKH7Ge3OXA==",
- "dev": true
- },
- "events": {
- "version": "2.0.0",
- "resolved": "https://registry.npmjs.org/events/-/events-2.0.0.tgz",
- "integrity": "sha512-r/M5YkNg9zwI8QbSf7tsDWWJvO3PGwZXyG7GpFAxtMASnHL2eblFd7iHiGPtyGKKFPZ59S63NeX10Ws6WqGDcg==",
- "dev": true
- },
- "module-deps": {
- "version": "6.0.0",
- "resolved": "https://registry.npmjs.org/module-deps/-/module-deps-6.0.0.tgz",
- "integrity": "sha512-BKsMhJJENEM4dTgqq2MDTTHXRHcNUFegoAwlG4HO4VMdUyMcJDKgfgI+MOv6tR5Iv8G3MKZFgsSiyP3ZoosRMw==",
- "dev": true,
- "requires": {
- "JSONStream": "1.3.2",
- "browser-resolve": "1.11.2",
- "cached-path-relative": "1.0.1",
- "concat-stream": "1.6.2",
- "defined": "1.0.0",
- "detective": "5.0.2",
- "duplexer2": "0.1.4",
- "inherits": "2.0.3",
- "parents": "1.0.1",
- "readable-stream": "2.3.3",
- "resolve": "1.6.0",
- "stream-combiner2": "1.1.1",
- "subarg": "1.0.0",
- "through2": "2.0.3",
- "xtend": "4.0.1"
- },
- "dependencies": {
- "resolve": {
- "version": "1.6.0",
- "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.6.0.tgz",
- "integrity": "sha512-mw7JQNu5ExIkcw4LPih0owX/TZXjD/ZUF/ZQ/pDnkw3ZKhDcZZw5klmBlj6gVMwjQ3Pz5Jgu7F3d0jcDVuEWdw==",
- "dev": true,
- "requires": {
- "path-parse": "1.0.5"
- }
- }
- }
- },
- "tty-browserify": {
- "version": "0.0.1",
- "resolved": "https://registry.npmjs.org/tty-browserify/-/tty-browserify-0.0.1.tgz",
- "integrity": "sha512-C3TaO7K81YvjCgQH9Q1S3R3P3BtN3RIM8n+OvX4il1K1zgE8ZhI0op7kClgkxtutIE8hQrcrHBXvIheqKUUCxw==",
- "dev": true
- }
}
},
"browserify-aes": {
- "version": "1.1.1",
- "resolved": "https://registry.npmjs.org/browserify-aes/-/browserify-aes-1.1.1.tgz",
- "integrity": "sha512-UGnTYAnB2a3YuYKIRy1/4FB2HdM866E0qC46JXvVTYKlBlZlnvfpSfY6OKfXZAkv70eJ2a1SqzpAo5CRhZGDFg==",
+ "version": "1.2.0",
+ "resolved": "https://registry.npmjs.org/browserify-aes/-/browserify-aes-1.2.0.tgz",
+ "integrity": "sha512-+7CHXqGuspUn/Sl5aO7Ea0xWGAtETPXNSAjHo48JfLdPWcMng33Xe4znFvQweqc/uzk5zSOI3H52CYnjCfb5hA==",
"dev": true,
"requires": {
"buffer-xor": "1.0.3",
"cipher-base": "1.0.4",
- "create-hash": "1.1.3",
+ "create-hash": "1.2.0",
"evp_bytestokey": "1.0.3",
"inherits": "2.0.3",
- "safe-buffer": "5.1.1"
+ "safe-buffer": "5.1.2"
}
},
"browserify-cipher": {
- "version": "1.0.0",
- "resolved": "https://registry.npmjs.org/browserify-cipher/-/browserify-cipher-1.0.0.tgz",
- "integrity": "sha1-mYgkSHS/XtTijalWZtzWasj8Njo=",
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/browserify-cipher/-/browserify-cipher-1.0.1.tgz",
+ "integrity": "sha512-sPhkz0ARKbf4rRQt2hTpAHqn47X3llLkUGn+xEJzLjwY8LRs2p0v7ljvI5EyoRO/mexrNunNECisZs+gw2zz1w==",
"dev": true,
"requires": {
- "browserify-aes": "1.1.1",
- "browserify-des": "1.0.0",
+ "browserify-aes": "1.2.0",
+ "browserify-des": "1.0.1",
"evp_bytestokey": "1.0.3"
}
},
"browserify-des": {
- "version": "1.0.0",
- "resolved": "https://registry.npmjs.org/browserify-des/-/browserify-des-1.0.0.tgz",
- "integrity": "sha1-2qJ3cXRwki7S/hhZQRihdUOXId0=",
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/browserify-des/-/browserify-des-1.0.1.tgz",
+ "integrity": "sha512-zy0Cobe3hhgpiOM32Tj7KQ3Vl91m0njwsjzZQK1L+JDf11dzP9qIvjreVinsvXrgfjhStXwUWAEpB9D7Gwmayw==",
"dev": true,
"requires": {
"cipher-base": "1.0.4",
@@ -808,7 +809,7 @@
"dev": true,
"requires": {
"bn.js": "4.11.8",
- "randombytes": "2.0.5"
+ "randombytes": "2.0.6"
}
},
"browserify-sign": {
@@ -819,11 +820,11 @@
"requires": {
"bn.js": "4.11.8",
"browserify-rsa": "4.0.1",
- "create-hash": "1.1.3",
- "create-hmac": "1.1.6",
+ "create-hash": "1.2.0",
+ "create-hmac": "1.1.7",
"elliptic": "6.4.0",
"inherits": "2.0.3",
- "parse-asn1": "5.1.0"
+ "parse-asn1": "5.1.1"
}
},
"browserify-zlib": {
@@ -836,13 +837,13 @@
}
},
"buffer": {
- "version": "5.0.8",
- "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.0.8.tgz",
- "integrity": "sha512-xXvjQhVNz50v2nPeoOsNqWCLGfiv4ji/gXZM28jnVwdLJxH4mFyqgqCKfaK9zf1KUbG6zTkjLOy7ou+jSMarGA==",
+ "version": "5.1.0",
+ "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.1.0.tgz",
+ "integrity": "sha512-YkIRgwsZwJWTnyQrsBTWefizHh+8GYj3kbL1BTiAQ/9pwpino0G7B2gp5tx/FUBqUlvtxV85KNR3mwfAtv15Yw==",
"dev": true,
"requires": {
- "base64-js": "1.2.1",
- "ieee754": "1.1.8"
+ "base64-js": "1.3.0",
+ "ieee754": "1.1.11"
}
},
"buffer-crc32": {
@@ -920,15 +921,6 @@
"requires": {
"align-text": "0.1.4",
"lazy-cache": "1.0.4"
- },
- "dependencies": {
- "lazy-cache": {
- "version": "1.0.4",
- "resolved": "https://registry.npmjs.org/lazy-cache/-/lazy-cache-1.0.4.tgz",
- "integrity": "sha1-odePw6UEdMuAhF07O24dpJpEbo4=",
- "dev": true,
- "optional": true
- }
}
},
"chai": {
@@ -942,44 +934,18 @@
"deep-eql": "3.0.1",
"get-func-name": "2.0.0",
"pathval": "1.1.0",
- "type-detect": "4.0.5"
+ "type-detect": "4.0.8"
}
},
"chalk": {
- "version": "2.3.2",
- "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.3.2.tgz",
- "integrity": "sha512-ZM4j2/ld/YZDc3Ma8PgN7gyAk+kHMMMyzLNryCPGhWrsfAuDVeuid5bpRFTDgMH9JBK2lA4dyyAkkZYF/WcqDQ==",
+ "version": "2.4.0",
+ "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.0.tgz",
+ "integrity": "sha512-Wr/w0f4o9LuE7K53cD0qmbAMM+2XNLzR29vFn5hqko4sxGlUsyy363NvmyGIyk5tpe9cjTr9SJYbysEyPkRnFw==",
"dev": true,
"requires": {
"ansi-styles": "3.2.1",
"escape-string-regexp": "1.0.5",
- "supports-color": "5.3.0"
- },
- "dependencies": {
- "ansi-styles": {
- "version": "3.2.1",
- "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz",
- "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==",
- "dev": true,
- "requires": {
- "color-convert": "1.9.1"
- }
- },
- "has-flag": {
- "version": "3.0.0",
- "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz",
- "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=",
- "dev": true
- },
- "supports-color": {
- "version": "5.3.0",
- "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.3.0.tgz",
- "integrity": "sha512-0aP01LLIskjKs3lq52EC0aGBAJhLq7B2Rd8HC/DR/PtNNpcLilNmHC12O+hu0usQpo7wtHNRqtrhBwtDb0+dNg==",
- "dev": true,
- "requires": {
- "has-flag": "3.0.0"
- }
- }
+ "supports-color": "5.4.0"
}
},
"check-error": {
@@ -995,19 +961,18 @@
"dev": true,
"requires": {
"inherits": "2.0.3",
- "safe-buffer": "5.1.1"
+ "safe-buffer": "5.1.2"
}
},
"class-utils": {
- "version": "0.3.5",
- "resolved": "https://registry.npmjs.org/class-utils/-/class-utils-0.3.5.tgz",
- "integrity": "sha1-F+eTEDdQ+WJ7IXbqNM/RtWWQPIA=",
+ "version": "0.3.6",
+ "resolved": "https://registry.npmjs.org/class-utils/-/class-utils-0.3.6.tgz",
+ "integrity": "sha512-qOhPa/Fj7s6TY8H8esGu5QNpMMQxz79h+urzrNYN6mn+9BnxlDGf5QZ+XeCDsxSjPqsSR56XOZOJmpeurnLMeg==",
"dev": true,
"requires": {
"arr-union": "3.1.0",
"define-property": "0.2.5",
"isobject": "3.0.1",
- "lazy-cache": "2.0.2",
"static-extend": "0.1.2"
},
"dependencies": {
@@ -1019,63 +984,6 @@
"requires": {
"is-descriptor": "0.1.6"
}
- },
- "is-accessor-descriptor": {
- "version": "0.1.6",
- "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz",
- "integrity": "sha1-qeEss66Nh2cn7u84Q/igiXtcmNY=",
- "dev": true,
- "requires": {
- "kind-of": "3.2.2"
- },
- "dependencies": {
- "kind-of": {
- "version": "3.2.2",
- "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz",
- "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=",
- "dev": true,
- "requires": {
- "is-buffer": "1.1.6"
- }
- }
- }
- },
- "is-data-descriptor": {
- "version": "0.1.4",
- "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz",
- "integrity": "sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y=",
- "dev": true,
- "requires": {
- "kind-of": "3.2.2"
- },
- "dependencies": {
- "kind-of": {
- "version": "3.2.2",
- "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz",
- "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=",
- "dev": true,
- "requires": {
- "is-buffer": "1.1.6"
- }
- }
- }
- },
- "is-descriptor": {
- "version": "0.1.6",
- "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz",
- "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==",
- "dev": true,
- "requires": {
- "is-accessor-descriptor": "0.1.6",
- "is-data-descriptor": "0.1.4",
- "kind-of": "5.1.0"
- }
- },
- "kind-of": {
- "version": "5.1.0",
- "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz",
- "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==",
- "dev": true
}
}
},
@@ -1101,9 +1009,9 @@
}
},
"clone": {
- "version": "1.0.3",
- "resolved": "https://registry.npmjs.org/clone/-/clone-1.0.3.tgz",
- "integrity": "sha1-KY1+IjFmD0DAA8LtMUDezz9TCF8=",
+ "version": "1.0.4",
+ "resolved": "https://registry.npmjs.org/clone/-/clone-1.0.4.tgz",
+ "integrity": "sha1-2jCcwmPfFZlMaIypAheco8fNfH4=",
"dev": true
},
"clone-buffer": {
@@ -1119,14 +1027,14 @@
"dev": true
},
"cloneable-readable": {
- "version": "1.0.0",
- "resolved": "https://registry.npmjs.org/cloneable-readable/-/cloneable-readable-1.0.0.tgz",
- "integrity": "sha1-pikNQT8hemEjL5XkWP84QYz7ARc=",
+ "version": "1.1.2",
+ "resolved": "https://registry.npmjs.org/cloneable-readable/-/cloneable-readable-1.1.2.tgz",
+ "integrity": "sha512-Bq6+4t+lbM8vhTs/Bef5c5AdEMtapp/iFb6+s4/Hh9MVTt8OLKH7ZOOZSCT+Ys7hsHvqv0GuMPJ1lnQJVHvxpg==",
"dev": true,
"requires": {
"inherits": "2.0.3",
- "process-nextick-args": "1.0.7",
- "through2": "2.0.3"
+ "process-nextick-args": "2.0.0",
+ "readable-stream": "2.3.6"
}
},
"collection-visit": {
@@ -1161,9 +1069,9 @@
"dev": true
},
"combine-source-map": {
- "version": "0.7.2",
- "resolved": "https://registry.npmjs.org/combine-source-map/-/combine-source-map-0.7.2.tgz",
- "integrity": "sha1-CHAxKFazB6h8xKxIbzqaYq7MwJ4=",
+ "version": "0.8.0",
+ "resolved": "https://registry.npmjs.org/combine-source-map/-/combine-source-map-0.8.0.tgz",
+ "integrity": "sha1-pY0N8ELBhvz4IqjoAV9UUNLXmos=",
"dev": true,
"requires": {
"convert-source-map": "1.1.3",
@@ -1199,45 +1107,32 @@
"dev": true
},
"concat-stream": {
- "version": "1.5.2",
- "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.5.2.tgz",
- "integrity": "sha1-cIl4Yk2FavQaWnQd790mHadSwmY=",
+ "version": "1.6.2",
+ "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.6.2.tgz",
+ "integrity": "sha512-27HBghJxjiZtIk3Ycvn/4kbJk/1uZuJFfuPEns6LaEvpvG1f0hTea8lilrouyo9mVc2GWdcEZ8OLoGmSADlrCw==",
"dev": true,
"requires": {
+ "buffer-from": "1.0.0",
"inherits": "2.0.3",
- "readable-stream": "2.0.6",
+ "readable-stream": "2.3.6",
"typedarray": "0.0.6"
- },
- "dependencies": {
- "readable-stream": {
- "version": "2.0.6",
- "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.0.6.tgz",
- "integrity": "sha1-j5A0HmilPMySh4jaz80Rs265t44=",
- "dev": true,
- "requires": {
- "core-util-is": "1.0.2",
- "inherits": "2.0.3",
- "isarray": "1.0.0",
- "process-nextick-args": "1.0.7",
- "string_decoder": "0.10.31",
- "util-deprecate": "1.0.2"
- }
- },
- "string_decoder": {
- "version": "0.10.31",
- "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz",
- "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=",
- "dev": true
- }
}
},
"concat-with-sourcemaps": {
- "version": "1.0.4",
- "resolved": "https://registry.npmjs.org/concat-with-sourcemaps/-/concat-with-sourcemaps-1.0.4.tgz",
- "integrity": "sha1-9Vs74q60dgGxCi1SWcz7cP0vHdY=",
+ "version": "1.0.5",
+ "resolved": "https://registry.npmjs.org/concat-with-sourcemaps/-/concat-with-sourcemaps-1.0.5.tgz",
+ "integrity": "sha512-YtnS0VEY+e2Khzsey/6mra9EoM6h/5gxaC0e3mcHpA5yfDxafhygytNmcJWodvUgyXzSiL5MSkPO6bQGgfliHw==",
"dev": true,
"requires": {
- "source-map": "0.5.7"
+ "source-map": "0.6.1"
+ },
+ "dependencies": {
+ "source-map": {
+ "version": "0.6.1",
+ "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
+ "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==",
+ "dev": true
+ }
}
},
"console-browserify": {
@@ -1274,9 +1169,9 @@
"dev": true
},
"create-ecdh": {
- "version": "4.0.0",
- "resolved": "https://registry.npmjs.org/create-ecdh/-/create-ecdh-4.0.0.tgz",
- "integrity": "sha1-iIxyNZbN92EvZJgjPuvXo1MBc30=",
+ "version": "4.0.1",
+ "resolved": "https://registry.npmjs.org/create-ecdh/-/create-ecdh-4.0.1.tgz",
+ "integrity": "sha512-iZvCCg8XqHQZ1ioNBTzXS/cQSkqkqcPs8xSX4upNB+DAk9Ht3uzQf2J32uAHNCne8LDmKr29AgZrEs4oIrwLuQ==",
"dev": true,
"requires": {
"bn.js": "4.11.8",
@@ -1284,29 +1179,30 @@
}
},
"create-hash": {
- "version": "1.1.3",
- "resolved": "https://registry.npmjs.org/create-hash/-/create-hash-1.1.3.tgz",
- "integrity": "sha1-YGBCrIuSYnUPSDyt2rD1gZFy2P0=",
+ "version": "1.2.0",
+ "resolved": "https://registry.npmjs.org/create-hash/-/create-hash-1.2.0.tgz",
+ "integrity": "sha512-z00bCGNHDG8mHAkP7CtT1qVu+bFQUPjYq/4Iv3C3kWjTFV10zIjfSoeqXo9Asws8gwSHDGj/hl2u4OGIjapeCg==",
"dev": true,
"requires": {
"cipher-base": "1.0.4",
"inherits": "2.0.3",
- "ripemd160": "2.0.1",
- "sha.js": "2.4.9"
+ "md5.js": "1.3.4",
+ "ripemd160": "2.0.2",
+ "sha.js": "2.4.11"
}
},
"create-hmac": {
- "version": "1.1.6",
- "resolved": "https://registry.npmjs.org/create-hmac/-/create-hmac-1.1.6.tgz",
- "integrity": "sha1-rLniIaThe9sHbpBlfEK5PjcmzwY=",
+ "version": "1.1.7",
+ "resolved": "https://registry.npmjs.org/create-hmac/-/create-hmac-1.1.7.tgz",
+ "integrity": "sha512-MJG9liiZ+ogc4TzUwuvbER1JRdgvUFSB5+VR/g5h82fGaIRWMWddtKBHi7/sVhfjQZ6SehlyhvQYrcYkaUIpLg==",
"dev": true,
"requires": {
"cipher-base": "1.0.4",
- "create-hash": "1.1.3",
+ "create-hash": "1.2.0",
"inherits": "2.0.3",
- "ripemd160": "2.0.1",
- "safe-buffer": "5.1.1",
- "sha.js": "2.4.9"
+ "ripemd160": "2.0.2",
+ "safe-buffer": "5.1.2",
+ "sha.js": "2.4.11"
}
},
"crypto-browserify": {
@@ -1315,17 +1211,17 @@
"integrity": "sha512-fz4spIh+znjO2VjL+IdhEpRJ3YN6sMzITSBijk6FK2UvTqruSQW+/cCZTSNsMiZNvUeq0CqurF+dAbyiGOY6Wg==",
"dev": true,
"requires": {
- "browserify-cipher": "1.0.0",
+ "browserify-cipher": "1.0.1",
"browserify-sign": "4.0.4",
- "create-ecdh": "4.0.0",
- "create-hash": "1.1.3",
- "create-hmac": "1.1.6",
- "diffie-hellman": "5.0.2",
+ "create-ecdh": "4.0.1",
+ "create-hash": "1.2.0",
+ "create-hmac": "1.1.7",
+ "diffie-hellman": "5.0.3",
"inherits": "2.0.3",
- "pbkdf2": "3.0.14",
- "public-encrypt": "4.0.0",
- "randombytes": "2.0.5",
- "randomfill": "1.0.3"
+ "pbkdf2": "3.0.16",
+ "public-encrypt": "4.0.2",
+ "randombytes": "2.0.6",
+ "randomfill": "1.0.4"
}
},
"css": {
@@ -1381,7 +1277,7 @@
"integrity": "sha1-dUu1v+VUUdpppYuU1F9MWwRi1Y8=",
"dev": true,
"requires": {
- "es5-ext": "0.10.37"
+ "es5-ext": "0.10.42"
}
},
"date-now": {
@@ -1406,13 +1302,13 @@
}
},
"debug-fabulous": {
- "version": "1.0.0",
- "resolved": "https://registry.npmjs.org/debug-fabulous/-/debug-fabulous-1.0.0.tgz",
- "integrity": "sha512-dsd50qQ1atDeurcxL7XOjPp4nZCGZzWIONDujDXzl1atSyC3hMbZD+v6440etw+Vt0Pr8ce4TQzHfX3KZM05Mw==",
+ "version": "1.1.0",
+ "resolved": "https://registry.npmjs.org/debug-fabulous/-/debug-fabulous-1.1.0.tgz",
+ "integrity": "sha512-GZqvGIgKNlUnHUPQhepnUZFIMoi3dgZKQBzKDeL2g7oJF9SNAji/AAu36dusFUas0O+pae74lNeoIPHqXWDkLg==",
"dev": true,
"requires": {
"debug": "3.1.0",
- "memoizee": "0.4.11",
+ "memoizee": "0.4.12",
"object-assign": "4.1.1"
},
"dependencies": {
@@ -1446,7 +1342,7 @@
"integrity": "sha512-+QeIQyN5ZuO+3Uk5DYh6/1eKO0m0YmJFGNmFHGACpf1ClL1nmlV/p4gNgbl2pJGxgXb4faqo6UE+M5ACEMyVcw==",
"dev": true,
"requires": {
- "type-detect": "4.0.5"
+ "type-detect": "4.0.8"
}
},
"deep-is": {
@@ -1461,7 +1357,7 @@
"integrity": "sha1-xlYFHpgX2f8I7YgUd/P+QBnz730=",
"dev": true,
"requires": {
- "clone": "1.0.3"
+ "clone": "1.0.4"
}
},
"define-properties": {
@@ -1475,12 +1371,44 @@
}
},
"define-property": {
- "version": "1.0.0",
- "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz",
- "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=",
+ "version": "2.0.2",
+ "resolved": "https://registry.npmjs.org/define-property/-/define-property-2.0.2.tgz",
+ "integrity": "sha512-jwK2UV4cnPpbcG7+VRARKTZPUWowwXA8bzH5NP6ud0oeAxyYPuGZUAC7hMugpCdz4BeSZl2Dl9k66CHJ/46ZYQ==",
"dev": true,
"requires": {
- "is-descriptor": "1.0.2"
+ "is-descriptor": "1.0.2",
+ "isobject": "3.0.1"
+ },
+ "dependencies": {
+ "is-accessor-descriptor": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz",
+ "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==",
+ "dev": true,
+ "requires": {
+ "kind-of": "6.0.2"
+ }
+ },
+ "is-data-descriptor": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz",
+ "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==",
+ "dev": true,
+ "requires": {
+ "kind-of": "6.0.2"
+ }
+ },
+ "is-descriptor": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz",
+ "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==",
+ "dev": true,
+ "requires": {
+ "is-accessor-descriptor": "1.0.0",
+ "is-data-descriptor": "1.0.0",
+ "kind-of": "6.0.2"
+ }
+ }
}
},
"defined": {
@@ -1497,7 +1425,7 @@
"requires": {
"globby": "6.1.0",
"is-path-cwd": "1.0.0",
- "is-path-in-cwd": "1.0.0",
+ "is-path-in-cwd": "1.0.1",
"p-map": "1.2.0",
"pify": "3.0.0",
"rimraf": "2.6.2"
@@ -1528,7 +1456,7 @@
"dev": true,
"requires": {
"inherits": "2.0.3",
- "minimalistic-assert": "1.0.0"
+ "minimalistic-assert": "1.0.1"
}
},
"detect-file": {
@@ -1544,48 +1472,69 @@
"dev": true
},
"detective": {
- "version": "5.0.2",
- "resolved": "https://registry.npmjs.org/detective/-/detective-5.0.2.tgz",
- "integrity": "sha512-NUsLoezj4wb9o7vpxS9F3L5vcO87ceyRBcl48op06YFNwkyIEY997JpSCA5lDlDuDc6JxOtaL5qfK3muoWxpMA==",
+ "version": "5.1.0",
+ "resolved": "https://registry.npmjs.org/detective/-/detective-5.1.0.tgz",
+ "integrity": "sha512-TFHMqfOvxlgrfVzTEkNBSh9SvSNX/HfF4OFI2QFGCyPm02EsyILqnUeb5P6q7JZ3SFNTBL5t2sePRgrN4epUWQ==",
"dev": true,
"requires": {
- "@browserify/acorn5-object-spread": "5.0.1",
- "acorn": "5.3.0",
- "defined": "1.0.0"
- },
- "dependencies": {
- "acorn": {
- "version": "5.3.0",
- "resolved": "https://registry.npmjs.org/acorn/-/acorn-5.3.0.tgz",
- "integrity": "sha512-Yej+zOJ1Dm/IMZzzj78OntP/r3zHEaKcyNoU2lAaxPtrseM6rF0xwqoz5Q5ysAiED9hTjI2hgtvLXitlCN1/Ug==",
- "dev": true
- }
+ "acorn-node": "1.3.0",
+ "defined": "1.0.0",
+ "minimist": "1.2.0"
}
},
"diff": {
- "version": "3.3.1",
- "resolved": "https://registry.npmjs.org/diff/-/diff-3.3.1.tgz",
- "integrity": "sha512-MKPHZDMB0o6yHyDryUOScqZibp914ksXwAMYMTHj6KO8UeKsRYNJD3oNCKjTqZon+V488P7N/HzXF8t7ZR95ww==",
+ "version": "3.5.0",
+ "resolved": "https://registry.npmjs.org/diff/-/diff-3.5.0.tgz",
+ "integrity": "sha512-A46qtFgd+g7pDZinpnwiRJtxbC1hpgf0uzP3iG89scHk0AUC7A1TGxf5OiiOUv/JMZR8GOt8hL900hV0bOy5xA==",
"dev": true
},
"diffie-hellman": {
- "version": "5.0.2",
- "resolved": "https://registry.npmjs.org/diffie-hellman/-/diffie-hellman-5.0.2.tgz",
- "integrity": "sha1-tYNXOScM/ias9jIJn97SoH8gnl4=",
+ "version": "5.0.3",
+ "resolved": "https://registry.npmjs.org/diffie-hellman/-/diffie-hellman-5.0.3.tgz",
+ "integrity": "sha512-kqag/Nl+f3GwyK25fhUMYj81BUOrZ9IuJsjIcDE5icNM9FJHAVm3VcUDxdLPoQtTuUylWm6ZIknYJwwaPxsUzg==",
"dev": true,
"requires": {
"bn.js": "4.11.8",
"miller-rabin": "4.0.1",
- "randombytes": "2.0.5"
+ "randombytes": "2.0.6"
}
},
+ "domain-browser": {
+ "version": "1.2.0",
+ "resolved": "https://registry.npmjs.org/domain-browser/-/domain-browser-1.2.0.tgz",
+ "integrity": "sha512-jnjyiM6eRyZl2H+W8Q/zLMA481hzi0eszAaBUzIVnmYVDBbnLxVNnfu1HgEBvCbL+71FrxMl3E6lpKH7Ge3OXA==",
+ "dev": true
+ },
"duplexer2": {
"version": "0.1.4",
"resolved": "https://registry.npmjs.org/duplexer2/-/duplexer2-0.1.4.tgz",
"integrity": "sha1-ixLauHjA1p4+eJEFFmKjL8a93ME=",
"dev": true,
"requires": {
- "readable-stream": "2.3.3"
+ "readable-stream": "2.3.6"
+ }
+ },
+ "duplexify": {
+ "version": "3.5.4",
+ "resolved": "https://registry.npmjs.org/duplexify/-/duplexify-3.5.4.tgz",
+ "integrity": "sha512-JzYSLYMhoVVBe8+mbHQ4KgpvHpm0DZpJuL8PY93Vyv1fW7jYJ90LoXa1di/CVbJM+TgMs91rbDapE/RNIfnJsA==",
+ "dev": true,
+ "requires": {
+ "end-of-stream": "1.4.1",
+ "inherits": "2.0.3",
+ "readable-stream": "2.3.6",
+ "stream-shift": "1.0.0"
+ },
+ "dependencies": {
+ "end-of-stream": {
+ "version": "1.4.1",
+ "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.1.tgz",
+ "integrity": "sha512-1MkrZNvWTKCaigbn+W15elq2BB/L22nqrSY5DKlo3X6+vclJm8Bb5djXJBmEX6fS3+zCh/F4VBK5Z2KxJt4s2Q==",
+ "dev": true,
+ "requires": {
+ "once": "1.4.0"
+ }
+ }
}
},
"elliptic": {
@@ -1599,7 +1548,7 @@
"hash.js": "1.1.3",
"hmac-drbg": "1.0.1",
"inherits": "2.0.3",
- "minimalistic-assert": "1.0.0",
+ "minimalistic-assert": "1.0.1",
"minimalistic-crypto-utils": "1.0.1"
}
},
@@ -1624,13 +1573,14 @@
}
},
"es5-ext": {
- "version": "0.10.37",
- "resolved": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.37.tgz",
- "integrity": "sha1-DudB0Ui4AGm6J9AgOTdWryV978M=",
+ "version": "0.10.42",
+ "resolved": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.42.tgz",
+ "integrity": "sha512-AJxO1rmPe1bDEfSR6TJ/FgMFYuTBhR5R57KW58iCkYACMyFbrkqVyzXSurYoScDGvgyMpk7uRF/lPUPPTmsRSA==",
"dev": true,
"requires": {
"es6-iterator": "2.0.3",
- "es6-symbol": "3.1.1"
+ "es6-symbol": "3.1.1",
+ "next-tick": "1.0.0"
}
},
"es6-iterator": {
@@ -1640,7 +1590,7 @@
"dev": true,
"requires": {
"d": "1.0.0",
- "es5-ext": "0.10.37",
+ "es5-ext": "0.10.42",
"es6-symbol": "3.1.1"
}
},
@@ -1657,7 +1607,7 @@
"dev": true,
"requires": {
"d": "1.0.0",
- "es5-ext": "0.10.37"
+ "es5-ext": "0.10.42"
}
},
"es6-weak-map": {
@@ -1667,7 +1617,7 @@
"dev": true,
"requires": {
"d": "1.0.0",
- "es5-ext": "0.10.37",
+ "es5-ext": "0.10.42",
"es6-iterator": "2.0.3",
"es6-symbol": "3.1.1"
}
@@ -1728,9 +1678,15 @@
"dev": true,
"requires": {
"d": "1.0.0",
- "es5-ext": "0.10.37"
+ "es5-ext": "0.10.42"
}
},
+ "events": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/events/-/events-2.0.0.tgz",
+ "integrity": "sha512-r/M5YkNg9zwI8QbSf7tsDWWJvO3PGwZXyG7GpFAxtMASnHL2eblFd7iHiGPtyGKKFPZ59S63NeX10Ws6WqGDcg==",
+ "dev": true
+ },
"evp_bytestokey": {
"version": "1.0.3",
"resolved": "https://registry.npmjs.org/evp_bytestokey/-/evp_bytestokey-1.0.3.tgz",
@@ -1738,7 +1694,7 @@
"dev": true,
"requires": {
"md5.js": "1.3.4",
- "safe-buffer": "5.1.1"
+ "safe-buffer": "5.1.2"
}
},
"expand-brackets": {
@@ -1751,9 +1707,9 @@
"define-property": "0.2.5",
"extend-shallow": "2.0.1",
"posix-character-classes": "0.1.1",
- "regex-not": "1.0.0",
- "snapdragon": "0.8.1",
- "to-regex": "3.0.1"
+ "regex-not": "1.0.2",
+ "snapdragon": "0.8.2",
+ "to-regex": "3.0.2"
},
"dependencies": {
"define-property": {
@@ -1765,62 +1721,14 @@
"is-descriptor": "0.1.6"
}
},
- "is-accessor-descriptor": {
- "version": "0.1.6",
- "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz",
- "integrity": "sha1-qeEss66Nh2cn7u84Q/igiXtcmNY=",
+ "extend-shallow": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz",
+ "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=",
"dev": true,
"requires": {
- "kind-of": "3.2.2"
- },
- "dependencies": {
- "kind-of": {
- "version": "3.2.2",
- "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz",
- "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=",
- "dev": true,
- "requires": {
- "is-buffer": "1.1.6"
- }
- }
+ "is-extendable": "0.1.1"
}
- },
- "is-data-descriptor": {
- "version": "0.1.4",
- "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz",
- "integrity": "sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y=",
- "dev": true,
- "requires": {
- "kind-of": "3.2.2"
- },
- "dependencies": {
- "kind-of": {
- "version": "3.2.2",
- "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz",
- "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=",
- "dev": true,
- "requires": {
- "is-buffer": "1.1.6"
- }
- }
- }
- },
- "is-descriptor": {
- "version": "0.1.6",
- "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz",
- "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==",
- "dev": true,
- "requires": {
- "is-accessor-descriptor": "0.1.6",
- "is-data-descriptor": "0.1.4",
- "kind-of": "5.1.0"
- }
- },
- "kind-of": {
- "version": "5.1.0",
- "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz",
- "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==",
- "dev": true
}
}
},
@@ -1840,18 +1748,30 @@
"dev": true
},
"extend-shallow": {
- "version": "2.0.1",
- "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz",
- "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=",
+ "version": "3.0.2",
+ "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-3.0.2.tgz",
+ "integrity": "sha1-Jqcarwc7OfshJxcnRhMcJwQCjbg=",
"dev": true,
"requires": {
- "is-extendable": "0.1.1"
+ "assign-symbols": "1.0.0",
+ "is-extendable": "1.0.1"
+ },
+ "dependencies": {
+ "is-extendable": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz",
+ "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==",
+ "dev": true,
+ "requires": {
+ "is-plain-object": "2.0.4"
+ }
+ }
}
},
"extglob": {
- "version": "2.0.3",
- "resolved": "https://registry.npmjs.org/extglob/-/extglob-2.0.3.tgz",
- "integrity": "sha512-AyptZexgu7qppEPq59DtN/XJGZDrLcVxSHai+4hdgMMS9EpF4GBvygcWWApno8lL9qSjVpYt7Raao28qzJX1ww==",
+ "version": "2.0.4",
+ "resolved": "https://registry.npmjs.org/extglob/-/extglob-2.0.4.tgz",
+ "integrity": "sha512-Nmb6QXkELsuBr24CJSkilo6UHHgbekK5UiZgfE6UHD3Eb27YC6oD+bhcT+tJ6cl8dmsgdQxnWlcry8ksBIBLpw==",
"dev": true,
"requires": {
"array-unique": "0.3.2",
@@ -1859,9 +1779,58 @@
"expand-brackets": "2.1.4",
"extend-shallow": "2.0.1",
"fragment-cache": "0.2.1",
- "regex-not": "1.0.0",
- "snapdragon": "0.8.1",
- "to-regex": "3.0.1"
+ "regex-not": "1.0.2",
+ "snapdragon": "0.8.2",
+ "to-regex": "3.0.2"
+ },
+ "dependencies": {
+ "define-property": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz",
+ "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=",
+ "dev": true,
+ "requires": {
+ "is-descriptor": "1.0.2"
+ }
+ },
+ "extend-shallow": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz",
+ "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=",
+ "dev": true,
+ "requires": {
+ "is-extendable": "0.1.1"
+ }
+ },
+ "is-accessor-descriptor": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz",
+ "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==",
+ "dev": true,
+ "requires": {
+ "kind-of": "6.0.2"
+ }
+ },
+ "is-data-descriptor": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz",
+ "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==",
+ "dev": true,
+ "requires": {
+ "kind-of": "6.0.2"
+ }
+ },
+ "is-descriptor": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz",
+ "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==",
+ "dev": true,
+ "requires": {
+ "is-accessor-descriptor": "1.0.0",
+ "is-data-descriptor": "1.0.0",
+ "kind-of": "6.0.2"
+ }
+ }
}
},
"fancy-log": {
@@ -1909,6 +1878,17 @@
"is-number": "3.0.0",
"repeat-string": "1.6.1",
"to-regex-range": "2.1.1"
+ },
+ "dependencies": {
+ "extend-shallow": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz",
+ "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=",
+ "dev": true,
+ "requires": {
+ "is-extendable": "0.1.1"
+ }
+ }
}
},
"find-index": {
@@ -1925,7 +1905,7 @@
"requires": {
"detect-file": "1.0.0",
"is-glob": "3.1.0",
- "micromatch": "3.1.5",
+ "micromatch": "3.1.10",
"resolve-dir": "1.0.1"
}
},
@@ -1961,7 +1941,7 @@
"dev": true,
"requires": {
"inherits": "2.0.3",
- "readable-stream": "2.3.3"
+ "readable-stream": "2.3.6"
}
},
"for-in": {
@@ -2107,7 +2087,7 @@
"integrity": "sha1-jQh8OcazjAAbl/ynzm0OHoCvusc=",
"dev": true,
"requires": {
- "brace-expansion": "1.1.8"
+ "brace-expansion": "1.1.11"
}
},
"readable-stream": {
@@ -2165,7 +2145,7 @@
"dev": true,
"requires": {
"global-prefix": "1.0.2",
- "is-windows": "1.0.1",
+ "is-windows": "1.0.2",
"resolve-dir": "1.0.1"
}
},
@@ -2178,7 +2158,7 @@
"expand-tilde": "2.0.2",
"homedir-polyfill": "1.0.1",
"ini": "1.3.5",
- "is-windows": "1.0.1",
+ "is-windows": "1.0.2",
"which": "1.3.0"
}
},
@@ -2250,9 +2230,9 @@
}
},
"glogg": {
- "version": "1.0.0",
- "resolved": "https://registry.npmjs.org/glogg/-/glogg-1.0.0.tgz",
- "integrity": "sha1-f+DxmfV6yQbPUS/urY+Q7kooT8U=",
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/glogg/-/glogg-1.0.1.tgz",
+ "integrity": "sha512-ynYqXLoluBKf9XGR1gA59yEJisIL7YHEH4xr3ZziHB5/yl4qWfaK8Js9jGe6gBGCSCKVqiyO30WnRZADvemUNw==",
"dev": true,
"requires": {
"sparkles": "1.0.0"
@@ -2264,7 +2244,7 @@
"integrity": "sha1-dhPHeKGv6mLyXGMKCG1/Osu92Bg=",
"dev": true,
"requires": {
- "natives": "1.1.1"
+ "natives": "1.1.3"
}
},
"growl": {
@@ -2337,7 +2317,7 @@
"integrity": "sha1-Yz0WyV2IUEYorQJmVmPO5aR5M1M=",
"dev": true,
"requires": {
- "concat-with-sourcemaps": "1.0.4",
+ "concat-with-sourcemaps": "1.0.5",
"through2": "2.0.3",
"vinyl": "2.1.0"
}
@@ -2443,7 +2423,7 @@
"acorn": "5.5.3",
"convert-source-map": "1.5.1",
"css": "2.2.1",
- "debug-fabulous": "1.0.0",
+ "debug-fabulous": "1.1.0",
"detect-newline": "2.1.0",
"graceful-fs": "4.1.11",
"source-map": "0.6.1",
@@ -2472,9 +2452,9 @@
}
},
"gulp-typescript": {
- "version": "4.0.1",
- "resolved": "https://registry.npmjs.org/gulp-typescript/-/gulp-typescript-4.0.1.tgz",
- "integrity": "sha512-BGdaBC1R4SJosXEkkEieeZ21qCZHnfSV78k7zzDljqAxvzDeGRTUqF4geckVclKEeiS3EYOBwNlxoHjJtn20vg==",
+ "version": "4.0.2",
+ "resolved": "https://registry.npmjs.org/gulp-typescript/-/gulp-typescript-4.0.2.tgz",
+ "integrity": "sha512-Hhbn5Aa2l3T+tnn0KqsG6RRJmcYEsr3byTL2nBpNBeAK8pqug9Od4AwddU4JEI+hRw7mzZyjRbB8DDWR6paGVA==",
"dev": true,
"requires": {
"ansi-colors": "1.1.0",
@@ -2497,7 +2477,7 @@
"is-negated-glob": "1.0.0",
"ordered-read-streams": "1.0.1",
"pumpify": "1.4.0",
- "readable-stream": "2.3.3",
+ "readable-stream": "2.3.6",
"remove-trailing-separator": "1.1.0",
"to-absolute-glob": "2.0.2",
"unique-stream": "2.2.1"
@@ -2509,12 +2489,6 @@
"integrity": "sha1-Dovf5NHduIVNZOBOp8AOKgJuVlg=",
"dev": true
},
- "is-valid-glob": {
- "version": "1.0.0",
- "resolved": "https://registry.npmjs.org/is-valid-glob/-/is-valid-glob-1.0.0.tgz",
- "integrity": "sha1-Kb8+/3Ab4tTTFdusw5vDn+j2Aao=",
- "dev": true
- },
"json-stable-stringify": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/json-stable-stringify/-/json-stable-stringify-1.0.1.tgz",
@@ -2530,7 +2504,7 @@
"integrity": "sha1-d8DLN8QVJdZBZtmQ/61+xqDhNj4=",
"dev": true,
"requires": {
- "readable-stream": "2.3.3"
+ "readable-stream": "2.3.6"
}
},
"source-map": {
@@ -2539,16 +2513,6 @@
"integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==",
"dev": true
},
- "to-absolute-glob": {
- "version": "2.0.2",
- "resolved": "https://registry.npmjs.org/to-absolute-glob/-/to-absolute-glob-2.0.2.tgz",
- "integrity": "sha1-GGX0PZ50sIItufFFt4z/fQ98hJs=",
- "dev": true,
- "requires": {
- "is-absolute": "1.0.0",
- "is-negated-glob": "1.0.0"
- }
- },
"unique-stream": {
"version": "2.2.1",
"resolved": "https://registry.npmjs.org/unique-stream/-/unique-stream-2.2.1.tgz",
@@ -2573,7 +2537,7 @@
"lead": "1.0.0",
"object.assign": "4.1.0",
"pumpify": "1.4.0",
- "readable-stream": "2.3.3",
+ "readable-stream": "2.3.6",
"remove-bom-buffer": "3.0.0",
"remove-bom-stream": "1.2.0",
"resolve-options": "1.1.0",
@@ -2649,7 +2613,7 @@
"integrity": "sha1-sEVbOPxeDPMNQyUTLkYZcMIJHN4=",
"dev": true,
"requires": {
- "clone": "1.0.3",
+ "clone": "1.0.4",
"clone-stats": "0.0.1",
"replace-ext": "0.0.1"
}
@@ -2662,7 +2626,7 @@
"integrity": "sha1-4oxNRdBey77YGDY86PnFkmIp/+U=",
"dev": true,
"requires": {
- "glogg": "1.0.0"
+ "glogg": "1.0.1"
}
},
"handlebars": {
@@ -2713,9 +2677,9 @@
"dev": true
},
"has-flag": {
- "version": "2.0.0",
- "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-2.0.0.tgz",
- "integrity": "sha1-6CB68cx7MNRGzHC3NLXovhj4jVE=",
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz",
+ "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=",
"dev": true
},
"has-gulplog": {
@@ -2766,12 +2730,13 @@
}
},
"hash-base": {
- "version": "2.0.2",
- "resolved": "https://registry.npmjs.org/hash-base/-/hash-base-2.0.2.tgz",
- "integrity": "sha1-ZuodhW206KVHDK32/OI65SRO8uE=",
+ "version": "3.0.4",
+ "resolved": "https://registry.npmjs.org/hash-base/-/hash-base-3.0.4.tgz",
+ "integrity": "sha1-X8hoaEfs1zSZQDMZprCj8/auSRg=",
"dev": true,
"requires": {
- "inherits": "2.0.3"
+ "inherits": "2.0.3",
+ "safe-buffer": "5.1.2"
}
},
"hash.js": {
@@ -2781,7 +2746,7 @@
"dev": true,
"requires": {
"inherits": "2.0.3",
- "minimalistic-assert": "1.0.0"
+ "minimalistic-assert": "1.0.1"
}
},
"he": {
@@ -2797,7 +2762,7 @@
"dev": true,
"requires": {
"hash.js": "1.1.3",
- "minimalistic-assert": "1.0.0",
+ "minimalistic-assert": "1.0.1",
"minimalistic-crypto-utils": "1.0.1"
}
},
@@ -2823,15 +2788,9 @@
"dev": true
},
"ieee754": {
- "version": "1.1.8",
- "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.1.8.tgz",
- "integrity": "sha1-vjPUCsEO8ZJnAfbwii2G+/0a0+Q=",
- "dev": true
- },
- "indexof": {
- "version": "0.0.1",
- "resolved": "https://registry.npmjs.org/indexof/-/indexof-0.0.1.tgz",
- "integrity": "sha1-gtwzbSMrkGIXnQWrMpOmYFn9Q10=",
+ "version": "1.1.11",
+ "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.1.11.tgz",
+ "integrity": "sha512-VhDzCKN7K8ufStx/CLj5/PDTMgph+qwN5Pkd5i0sGnVwk56zJ0lkT8Qzi1xqWLS0Wp29DgDtNeS7v8/wMoZeHg==",
"dev": true
},
"inflight": {
@@ -2866,16 +2825,17 @@
}
},
"insert-module-globals": {
- "version": "7.0.1",
- "resolved": "https://registry.npmjs.org/insert-module-globals/-/insert-module-globals-7.0.1.tgz",
- "integrity": "sha1-wDv04BywhtW15azorQr+eInWOMM=",
+ "version": "7.0.6",
+ "resolved": "https://registry.npmjs.org/insert-module-globals/-/insert-module-globals-7.0.6.tgz",
+ "integrity": "sha512-R3sidKJr3SsggqQQ5cEwQb3pWG8RNx0UnpyeiOSR6jorRIeAOzH2gkTWnNdMnyRiVbjrG047K7UCtlMkQ1Mo9w==",
"dev": true,
"requires": {
"JSONStream": "1.3.2",
- "combine-source-map": "0.7.2",
- "concat-stream": "1.5.2",
+ "combine-source-map": "0.8.0",
+ "concat-stream": "1.6.2",
"is-buffer": "1.1.6",
"lexical-scope": "1.2.0",
+ "path-is-absolute": "1.0.1",
"process": "0.11.10",
"through2": "2.0.3",
"xtend": "4.0.1"
@@ -2894,16 +2854,27 @@
"dev": true,
"requires": {
"is-relative": "1.0.0",
- "is-windows": "1.0.1"
+ "is-windows": "1.0.2"
}
},
"is-accessor-descriptor": {
- "version": "1.0.0",
- "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz",
- "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==",
+ "version": "0.1.6",
+ "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz",
+ "integrity": "sha1-qeEss66Nh2cn7u84Q/igiXtcmNY=",
"dev": true,
"requires": {
- "kind-of": "6.0.2"
+ "kind-of": "3.2.2"
+ },
+ "dependencies": {
+ "kind-of": {
+ "version": "3.2.2",
+ "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz",
+ "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=",
+ "dev": true,
+ "requires": {
+ "is-buffer": "1.1.6"
+ }
+ }
}
},
"is-buffer": {
@@ -2913,23 +2884,42 @@
"dev": true
},
"is-data-descriptor": {
- "version": "1.0.0",
- "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz",
- "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==",
+ "version": "0.1.4",
+ "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz",
+ "integrity": "sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y=",
"dev": true,
"requires": {
- "kind-of": "6.0.2"
+ "kind-of": "3.2.2"
+ },
+ "dependencies": {
+ "kind-of": {
+ "version": "3.2.2",
+ "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz",
+ "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=",
+ "dev": true,
+ "requires": {
+ "is-buffer": "1.1.6"
+ }
+ }
}
},
"is-descriptor": {
- "version": "1.0.2",
- "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz",
- "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==",
+ "version": "0.1.6",
+ "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz",
+ "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==",
"dev": true,
"requires": {
- "is-accessor-descriptor": "1.0.0",
- "is-data-descriptor": "1.0.0",
- "kind-of": "6.0.2"
+ "is-accessor-descriptor": "0.1.6",
+ "is-data-descriptor": "0.1.4",
+ "kind-of": "5.1.0"
+ },
+ "dependencies": {
+ "kind-of": {
+ "version": "5.1.0",
+ "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz",
+ "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==",
+ "dev": true
+ }
}
},
"is-extendable": {
@@ -2980,12 +2970,20 @@
}
},
"is-odd": {
- "version": "1.0.0",
- "resolved": "https://registry.npmjs.org/is-odd/-/is-odd-1.0.0.tgz",
- "integrity": "sha1-O4qTLrAos3dcObsJ6RdnrM22kIg=",
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/is-odd/-/is-odd-2.0.0.tgz",
+ "integrity": "sha512-OTiixgpZAT1M4NHgS5IguFp/Vz2VI3U7Goh4/HA1adtwyLtSBrxYlcSYkhpAE07s4fKEcjrFxyvtQBND4vFQyQ==",
"dev": true,
"requires": {
- "is-number": "3.0.0"
+ "is-number": "4.0.0"
+ },
+ "dependencies": {
+ "is-number": {
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/is-number/-/is-number-4.0.0.tgz",
+ "integrity": "sha512-rSklcAIlf1OmFdyAqbnWTLVelsQ58uvZ66S/ZyawjWqIviTWCjg2PzVGw8WUA+nNuPTqb4wgA+NszrJ+08LlgQ==",
+ "dev": true
+ }
}
},
"is-path-cwd": {
@@ -2995,9 +2993,9 @@
"dev": true
},
"is-path-in-cwd": {
- "version": "1.0.0",
- "resolved": "https://registry.npmjs.org/is-path-in-cwd/-/is-path-in-cwd-1.0.0.tgz",
- "integrity": "sha1-ZHdYK4IU1gI0YJRWcAO+ip6sBNw=",
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/is-path-in-cwd/-/is-path-in-cwd-1.0.1.tgz",
+ "integrity": "sha512-FjV1RTW48E7CWM7eE/J2NJvAEEVektecDBVBE5Hh3nM1Jd0kvhHtX68Pr3xsDf857xt3Y4AkwVULK1Vku62aaQ==",
"dev": true,
"requires": {
"is-path-inside": "1.0.1"
@@ -3051,10 +3049,16 @@
"integrity": "sha1-Sw2hRCEE0bM2NA6AeX6GXPOffXI=",
"dev": true
},
+ "is-valid-glob": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/is-valid-glob/-/is-valid-glob-1.0.0.tgz",
+ "integrity": "sha1-Kb8+/3Ab4tTTFdusw5vDn+j2Aao=",
+ "dev": true
+ },
"is-windows": {
- "version": "1.0.1",
- "resolved": "https://registry.npmjs.org/is-windows/-/is-windows-1.0.1.tgz",
- "integrity": "sha1-MQ23D3QtJZoWo2kgK1GvhCMzENk=",
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/is-windows/-/is-windows-1.0.2.tgz",
+ "integrity": "sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA==",
"dev": true
},
"isarray": {
@@ -3087,7 +3091,7 @@
"esprima": "2.7.3",
"glob": "5.0.15",
"handlebars": "4.0.11",
- "js-yaml": "3.10.0",
+ "js-yaml": "3.11.0",
"mkdirp": "0.5.1",
"nopt": "3.0.6",
"once": "1.4.0",
@@ -3128,9 +3132,9 @@
}
},
"jake": {
- "version": "8.0.15",
- "resolved": "https://registry.npmjs.org/jake/-/jake-8.0.15.tgz",
- "integrity": "sha1-8Np9WOeQrBqPhubuDxk+XZIw6rs=",
+ "version": "8.0.16",
+ "resolved": "https://registry.npmjs.org/jake/-/jake-8.0.16.tgz",
+ "integrity": "sha512-qUTOVCKFkiz3tHgV1WMy7HTxDZgo+sO4X9GxFLAU+Mks4WsDGe9+ONHK6tPsSp8I3x6sPl0TwGbXHwTOhTyzog==",
"dev": true,
"requires": {
"async": "0.9.2",
@@ -3178,12 +3182,12 @@
"dev": true
},
"js-yaml": {
- "version": "3.10.0",
- "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.10.0.tgz",
- "integrity": "sha512-O2v52ffjLa9VeM43J4XocZE//WT9N0IiwDa3KSHH7Tu8CtH+1qM8SIZvnsTh6v+4yFy5KUY3BHUVwjpfAWsjIA==",
+ "version": "3.11.0",
+ "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.11.0.tgz",
+ "integrity": "sha512-saJstZWv7oNeOyBh3+Dx1qWzhW0+e6/8eDzo7p5rDFqxntSztloLtuKu+Ejhtq82jsilwOIZYsCz+lIjthg1Hw==",
"dev": true,
"requires": {
- "argparse": "1.0.9",
+ "argparse": "1.0.10",
"esprima": "4.0.0"
},
"dependencies": {
@@ -3229,32 +3233,30 @@
"dev": true
},
"labeled-stream-splicer": {
- "version": "2.0.0",
- "resolved": "https://registry.npmjs.org/labeled-stream-splicer/-/labeled-stream-splicer-2.0.0.tgz",
- "integrity": "sha1-pS4dE4AkwAuGscDJH2d5GLiuClk=",
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/labeled-stream-splicer/-/labeled-stream-splicer-2.0.1.tgz",
+ "integrity": "sha512-MC94mHZRvJ3LfykJlTUipBqenZz1pacOZEMhhQ8dMGcDHs0SBE5GbsavUXV7YtP3icBW17W0Zy1I0lfASmo9Pg==",
"dev": true,
"requires": {
"inherits": "2.0.3",
- "isarray": "0.0.1",
+ "isarray": "2.0.4",
"stream-splicer": "2.0.0"
},
"dependencies": {
"isarray": {
- "version": "0.0.1",
- "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz",
- "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=",
+ "version": "2.0.4",
+ "resolved": "https://registry.npmjs.org/isarray/-/isarray-2.0.4.tgz",
+ "integrity": "sha512-GMxXOiUirWg1xTKRipM0Ek07rX+ubx4nNVElTJdNLYmNO/2YrDkgJGw9CljXn+r4EWiDQg/8lsRdHyg2PJuUaA==",
"dev": true
}
}
},
"lazy-cache": {
- "version": "2.0.2",
- "resolved": "https://registry.npmjs.org/lazy-cache/-/lazy-cache-2.0.2.tgz",
- "integrity": "sha1-uRkKT5EzVGlIQIWfio9whNiCImQ=",
+ "version": "1.0.4",
+ "resolved": "https://registry.npmjs.org/lazy-cache/-/lazy-cache-1.0.4.tgz",
+ "integrity": "sha1-odePw6UEdMuAhF07O24dpJpEbo4=",
"dev": true,
- "requires": {
- "set-getter": "0.1.0"
- }
+ "optional": true
},
"lazystream": {
"version": "1.0.0",
@@ -3262,7 +3264,7 @@
"integrity": "sha1-9plf4PggOS9hOWvolGJAe7dxaOQ=",
"dev": true,
"requires": {
- "readable-stream": "2.3.3"
+ "readable-stream": "2.3.6"
}
},
"lead": {
@@ -3458,33 +3460,16 @@
"integrity": "sha1-Jzi9nw089PhEkMVzbEhpmsYyzaM=",
"dev": true,
"requires": {
- "es5-ext": "0.10.37"
+ "es5-ext": "0.10.42"
}
},
- "make-error": {
- "version": "1.3.2",
- "resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.2.tgz",
- "integrity": "sha512-l9ra35l5VWLF24y75Tg8XgfGLX0ueRhph118WKM6H5denx4bB5QF59+4UAm9oJ2qsPQZas/CQUDdtDdfvYHBdQ==",
- "dev": true
- },
"make-iterator": {
- "version": "1.0.0",
- "resolved": "https://registry.npmjs.org/make-iterator/-/make-iterator-1.0.0.tgz",
- "integrity": "sha1-V7713IXSOSO6I3ZzJNjo+PPZaUs=",
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/make-iterator/-/make-iterator-1.0.1.tgz",
+ "integrity": "sha512-pxiuXh0iVEq7VM7KMIhs5gxsfxCux2URptUQaXo4iZZJxBAzTPOLE2BumO5dbfVYq/hBJFBR/a1mFDmOx5AGmw==",
"dev": true,
"requires": {
- "kind-of": "3.2.2"
- },
- "dependencies": {
- "kind-of": {
- "version": "3.2.2",
- "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz",
- "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=",
- "dev": true,
- "requires": {
- "is-buffer": "1.1.6"
- }
- }
+ "kind-of": "6.0.2"
}
},
"map-cache": {
@@ -3510,34 +3495,22 @@
"requires": {
"hash-base": "3.0.4",
"inherits": "2.0.3"
- },
- "dependencies": {
- "hash-base": {
- "version": "3.0.4",
- "resolved": "https://registry.npmjs.org/hash-base/-/hash-base-3.0.4.tgz",
- "integrity": "sha1-X8hoaEfs1zSZQDMZprCj8/auSRg=",
- "dev": true,
- "requires": {
- "inherits": "2.0.3",
- "safe-buffer": "5.1.1"
- }
- }
}
},
"memoizee": {
- "version": "0.4.11",
- "resolved": "https://registry.npmjs.org/memoizee/-/memoizee-0.4.11.tgz",
- "integrity": "sha1-vemBdmPJ5A/bKk6hw2cpYIeujI8=",
+ "version": "0.4.12",
+ "resolved": "https://registry.npmjs.org/memoizee/-/memoizee-0.4.12.tgz",
+ "integrity": "sha512-sprBu6nwxBWBvBOh5v2jcsGqiGLlL2xr2dLub3vR8dnE8YB17omwtm/0NSHl8jjNbcsJd5GMWJAnTSVe/O0Wfg==",
"dev": true,
"requires": {
"d": "1.0.0",
- "es5-ext": "0.10.37",
+ "es5-ext": "0.10.42",
"es6-weak-map": "2.0.2",
"event-emitter": "0.3.5",
"is-promise": "2.1.0",
"lru-queue": "0.1.0",
"next-tick": "1.0.0",
- "timers-ext": "0.1.2"
+ "timers-ext": "0.1.5"
}
},
"merge2": {
@@ -3547,24 +3520,24 @@
"dev": true
},
"micromatch": {
- "version": "3.1.5",
- "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-3.1.5.tgz",
- "integrity": "sha512-ykttrLPQrz1PUJcXjwsTUjGoPJ64StIGNE2lGVD1c9CuguJ+L7/navsE8IcDNndOoCMvYV0qc/exfVbMHkUhvA==",
+ "version": "3.1.10",
+ "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-3.1.10.tgz",
+ "integrity": "sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg==",
"dev": true,
"requires": {
"arr-diff": "4.0.0",
"array-unique": "0.3.2",
- "braces": "2.3.0",
- "define-property": "1.0.0",
- "extend-shallow": "2.0.1",
- "extglob": "2.0.3",
+ "braces": "2.3.2",
+ "define-property": "2.0.2",
+ "extend-shallow": "3.0.2",
+ "extglob": "2.0.4",
"fragment-cache": "0.2.1",
"kind-of": "6.0.2",
- "nanomatch": "1.2.7",
+ "nanomatch": "1.2.9",
"object.pick": "1.3.0",
- "regex-not": "1.0.0",
- "snapdragon": "0.8.1",
- "to-regex": "3.0.1"
+ "regex-not": "1.0.2",
+ "snapdragon": "0.8.2",
+ "to-regex": "3.0.2"
}
},
"miller-rabin": {
@@ -3578,9 +3551,9 @@
}
},
"minimalistic-assert": {
- "version": "1.0.0",
- "resolved": "https://registry.npmjs.org/minimalistic-assert/-/minimalistic-assert-1.0.0.tgz",
- "integrity": "sha1-cCvi3aazf0g2vLP121ZkG2Sh09M=",
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz",
+ "integrity": "sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A==",
"dev": true
},
"minimalistic-crypto-utils": {
@@ -3595,7 +3568,7 @@
"integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==",
"dev": true,
"requires": {
- "brace-expansion": "1.1.8"
+ "brace-expansion": "1.1.11"
}
},
"minimist": {
@@ -3605,9 +3578,9 @@
"dev": true
},
"mixin-deep": {
- "version": "1.3.0",
- "resolved": "https://registry.npmjs.org/mixin-deep/-/mixin-deep-1.3.0.tgz",
- "integrity": "sha512-dgaCvoh6i1nosAUBKb0l0pfJ78K8+S9fluyIR2YvAeUD/QuMahnFnF3xYty5eYXMjhGSsB0DsW6A0uAZyetoAg==",
+ "version": "1.3.1",
+ "resolved": "https://registry.npmjs.org/mixin-deep/-/mixin-deep-1.3.1.tgz",
+ "integrity": "sha512-8ZItLHeEgaqEvd5lYBXfm4EZSFCX29Jb9K+lAHhDKzReKBQKj3R+7NOF6tjqYi9t4oI8VUfaWITJQm86wnXGNQ==",
"dev": true,
"requires": {
"for-in": "1.0.2",
@@ -3643,9 +3616,9 @@
}
},
"mocha": {
- "version": "5.0.4",
- "resolved": "https://registry.npmjs.org/mocha/-/mocha-5.0.4.tgz",
- "integrity": "sha512-nMOpAPFosU1B4Ix1jdhx5e3q7XO55ic5a8cgYvW27CequcEY+BabS0kUVL1Cw1V5PuVHZWeNRWFLmEPexo79VA==",
+ "version": "5.1.1",
+ "resolved": "https://registry.npmjs.org/mocha/-/mocha-5.1.1.tgz",
+ "integrity": "sha512-kKKs/H1KrMMQIEsWNxGmb4/BGsmj0dkeyotEvbrAuQ01FcWRLssUNXCEUZk6SZtyJBi6EE7SL0zDDtItw1rGhw==",
"dev": true,
"requires": {
"browser-stdout": "1.3.1",
@@ -3656,16 +3629,11 @@
"glob": "7.1.2",
"growl": "1.10.3",
"he": "1.1.1",
+ "minimatch": "3.0.4",
"mkdirp": "0.5.1",
"supports-color": "4.4.0"
},
"dependencies": {
- "browser-stdout": {
- "version": "1.3.1",
- "resolved": "https://registry.npmjs.org/browser-stdout/-/browser-stdout-1.3.1.tgz",
- "integrity": "sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw==",
- "dev": true
- },
"debug": {
"version": "3.1.0",
"resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz",
@@ -3675,10 +3643,10 @@
"ms": "2.0.0"
}
},
- "diff": {
- "version": "3.5.0",
- "resolved": "https://registry.npmjs.org/diff/-/diff-3.5.0.tgz",
- "integrity": "sha512-A46qtFgd+g7pDZinpnwiRJtxbC1hpgf0uzP3iG89scHk0AUC7A1TGxf5OiiOUv/JMZR8GOt8hL900hV0bOy5xA==",
+ "has-flag": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-2.0.0.tgz",
+ "integrity": "sha1-6CB68cx7MNRGzHC3NLXovhj4jVE=",
"dev": true
},
"supports-color": {
@@ -3698,6 +3666,40 @@
"integrity": "sha1-zK/w4ckc9Vf+d+B535lUuRt0d1Y=",
"dev": true
},
+ "module-deps": {
+ "version": "6.0.2",
+ "resolved": "https://registry.npmjs.org/module-deps/-/module-deps-6.0.2.tgz",
+ "integrity": "sha512-KWBI3009iRnHjRlxRhe8nJ6kdeBTg4sMi5N6AZgg5f1/v5S7EBCRBOY854I4P5Anl4kx6AJH+4bBBC2Gi3nkvg==",
+ "dev": true,
+ "requires": {
+ "JSONStream": "1.3.2",
+ "browser-resolve": "1.11.2",
+ "cached-path-relative": "1.0.1",
+ "concat-stream": "1.6.2",
+ "defined": "1.0.0",
+ "detective": "5.1.0",
+ "duplexer2": "0.1.4",
+ "inherits": "2.0.3",
+ "parents": "1.0.1",
+ "readable-stream": "2.3.6",
+ "resolve": "1.7.1",
+ "stream-combiner2": "1.1.1",
+ "subarg": "1.0.0",
+ "through2": "2.0.3",
+ "xtend": "4.0.1"
+ },
+ "dependencies": {
+ "resolve": {
+ "version": "1.7.1",
+ "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.7.1.tgz",
+ "integrity": "sha512-c7rwLofp8g1U+h1KNyHL/jicrKg1Ek4q+Lr33AL65uZTinUZHe30D5HlyN5V9NW0JX1D5dXQ4jqW5l7Sy/kGfw==",
+ "dev": true,
+ "requires": {
+ "path-parse": "1.0.5"
+ }
+ }
+ }
+ },
"ms": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz",
@@ -3749,36 +3751,29 @@
}
},
"nanomatch": {
- "version": "1.2.7",
- "resolved": "https://registry.npmjs.org/nanomatch/-/nanomatch-1.2.7.tgz",
- "integrity": "sha512-/5ldsnyurvEw7wNpxLFgjVvBLMta43niEYOy0CJ4ntcYSbx6bugRUTQeFb4BR/WanEL1o3aQgHuVLHQaB6tOqg==",
+ "version": "1.2.9",
+ "resolved": "https://registry.npmjs.org/nanomatch/-/nanomatch-1.2.9.tgz",
+ "integrity": "sha512-n8R9bS8yQ6eSXaV6jHUpKzD8gLsin02w1HSFiegwrs9E098Ylhw5jdyKPaYqvHknHaSCKTPp7C8dGCQ0q9koXA==",
"dev": true,
"requires": {
"arr-diff": "4.0.0",
"array-unique": "0.3.2",
- "define-property": "1.0.0",
- "extend-shallow": "2.0.1",
+ "define-property": "2.0.2",
+ "extend-shallow": "3.0.2",
"fragment-cache": "0.2.1",
- "is-odd": "1.0.0",
- "kind-of": "5.1.0",
+ "is-odd": "2.0.0",
+ "is-windows": "1.0.2",
+ "kind-of": "6.0.2",
"object.pick": "1.3.0",
- "regex-not": "1.0.0",
- "snapdragon": "0.8.1",
- "to-regex": "3.0.1"
- },
- "dependencies": {
- "kind-of": {
- "version": "5.1.0",
- "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz",
- "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==",
- "dev": true
- }
+ "regex-not": "1.0.2",
+ "snapdragon": "0.8.2",
+ "to-regex": "3.0.2"
}
},
"natives": {
- "version": "1.1.1",
- "resolved": "https://registry.npmjs.org/natives/-/natives-1.1.1.tgz",
- "integrity": "sha512-8eRaxn8u/4wN8tGkhlc2cgwwvOLMLUMUn4IYTexMgWd+LyUDfeXVkk2ygQR0hvIHbJQXgHujia3ieUUDwNGkEA==",
+ "version": "1.1.3",
+ "resolved": "https://registry.npmjs.org/natives/-/natives-1.1.3.tgz",
+ "integrity": "sha512-BZGSYV4YOLxzoTK73l0/s/0sH9l8SHs2ocReMH1f8JYSh5FUWu4ZrKCpJdRkWXV6HFR/pZDz7bwWOVAY07q77g==",
"dev": true
},
"next-tick": {
@@ -3840,43 +3835,6 @@
"is-descriptor": "0.1.6"
}
},
- "is-accessor-descriptor": {
- "version": "0.1.6",
- "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz",
- "integrity": "sha1-qeEss66Nh2cn7u84Q/igiXtcmNY=",
- "dev": true,
- "requires": {
- "kind-of": "3.2.2"
- }
- },
- "is-data-descriptor": {
- "version": "0.1.4",
- "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz",
- "integrity": "sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y=",
- "dev": true,
- "requires": {
- "kind-of": "3.2.2"
- }
- },
- "is-descriptor": {
- "version": "0.1.6",
- "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz",
- "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==",
- "dev": true,
- "requires": {
- "is-accessor-descriptor": "0.1.6",
- "is-data-descriptor": "0.1.4",
- "kind-of": "5.1.0"
- },
- "dependencies": {
- "kind-of": {
- "version": "5.1.0",
- "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz",
- "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==",
- "dev": true
- }
- }
- },
"kind-of": {
"version": "3.2.2",
"resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz",
@@ -3934,7 +3892,7 @@
"dev": true,
"requires": {
"for-own": "1.0.0",
- "make-iterator": "1.0.0"
+ "make-iterator": "1.0.1"
}
},
"object.pick": {
@@ -4001,7 +3959,7 @@
"requires": {
"end-of-stream": "0.1.5",
"sequencify": "0.0.7",
- "stream-consume": "0.1.0"
+ "stream-consume": "0.1.1"
}
},
"ordered-read-streams": {
@@ -4044,16 +4002,16 @@
}
},
"parse-asn1": {
- "version": "5.1.0",
- "resolved": "https://registry.npmjs.org/parse-asn1/-/parse-asn1-5.1.0.tgz",
- "integrity": "sha1-N8T5t+06tlx0gXtfJICTf7+XxxI=",
+ "version": "5.1.1",
+ "resolved": "https://registry.npmjs.org/parse-asn1/-/parse-asn1-5.1.1.tgz",
+ "integrity": "sha512-KPx7flKXg775zZpnp9SxJlz00gTd4BmJ2yJufSc44gMCRrRQ7NSzAcSJQfifuOLgW6bEi+ftrALtsgALeB2Adw==",
"dev": true,
"requires": {
- "asn1.js": "4.9.2",
- "browserify-aes": "1.1.1",
- "create-hash": "1.1.3",
+ "asn1.js": "4.10.1",
+ "browserify-aes": "1.2.0",
+ "create-hash": "1.2.0",
"evp_bytestokey": "1.0.3",
- "pbkdf2": "3.0.14"
+ "pbkdf2": "3.0.16"
}
},
"parse-filepath": {
@@ -4137,16 +4095,16 @@
"dev": true
},
"pbkdf2": {
- "version": "3.0.14",
- "resolved": "https://registry.npmjs.org/pbkdf2/-/pbkdf2-3.0.14.tgz",
- "integrity": "sha512-gjsZW9O34fm0R7PaLHRJmLLVfSoesxztjPjE9o6R+qtVJij90ltg1joIovN9GKrRW3t1PzhDDG3UMEMFfZ+1wA==",
+ "version": "3.0.16",
+ "resolved": "https://registry.npmjs.org/pbkdf2/-/pbkdf2-3.0.16.tgz",
+ "integrity": "sha512-y4CXP3thSxqf7c0qmOF+9UeOTrifiVTIM+u7NWlq+PRsHbr7r7dpCmvzrZxa96JJUNi0Y5w9VqG5ZNeCVMoDcA==",
"dev": true,
"requires": {
- "create-hash": "1.1.3",
- "create-hmac": "1.1.6",
- "ripemd160": "2.0.1",
- "safe-buffer": "5.1.1",
- "sha.js": "2.4.9"
+ "create-hash": "1.2.0",
+ "create-hmac": "1.1.7",
+ "ripemd160": "2.0.2",
+ "safe-buffer": "5.1.2",
+ "sha.js": "2.4.11"
}
},
"pify": {
@@ -4247,22 +4205,22 @@
"dev": true
},
"process-nextick-args": {
- "version": "1.0.7",
- "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-1.0.7.tgz",
- "integrity": "sha1-FQ4gt1ZZCtP5EJPyWk8q2L/zC6M=",
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.0.tgz",
+ "integrity": "sha512-MtEC1TqN0EU5nephaJ4rAtThHtC86dNN9qCuEhtshvpVBkAW5ZO7BASN9REnF9eoXGcRub+pFuKEpOHE+HbEMw==",
"dev": true
},
"public-encrypt": {
- "version": "4.0.0",
- "resolved": "https://registry.npmjs.org/public-encrypt/-/public-encrypt-4.0.0.tgz",
- "integrity": "sha1-OfaZ86RlYN1eusvKaTyvfGXBjMY=",
+ "version": "4.0.2",
+ "resolved": "https://registry.npmjs.org/public-encrypt/-/public-encrypt-4.0.2.tgz",
+ "integrity": "sha512-4kJ5Esocg8X3h8YgJsKAuoesBgB7mqH3eowiDzMUPKiRDDE7E/BqqZD1hnTByIaAFiwAw246YEltSq7tdrOH0Q==",
"dev": true,
"requires": {
"bn.js": "4.11.8",
"browserify-rsa": "4.0.1",
- "create-hash": "1.1.3",
- "parse-asn1": "5.1.0",
- "randombytes": "2.0.5"
+ "create-hash": "1.2.0",
+ "parse-asn1": "5.1.1",
+ "randombytes": "2.0.6"
}
},
"pump": {
@@ -4295,29 +4253,6 @@
"duplexify": "3.5.4",
"inherits": "2.0.3",
"pump": "2.0.1"
- },
- "dependencies": {
- "duplexify": {
- "version": "3.5.4",
- "resolved": "https://registry.npmjs.org/duplexify/-/duplexify-3.5.4.tgz",
- "integrity": "sha512-JzYSLYMhoVVBe8+mbHQ4KgpvHpm0DZpJuL8PY93Vyv1fW7jYJ90LoXa1di/CVbJM+TgMs91rbDapE/RNIfnJsA==",
- "dev": true,
- "requires": {
- "end-of-stream": "1.4.1",
- "inherits": "2.0.3",
- "readable-stream": "2.3.3",
- "stream-shift": "1.0.0"
- }
- },
- "end-of-stream": {
- "version": "1.4.1",
- "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.1.tgz",
- "integrity": "sha512-1MkrZNvWTKCaigbn+W15elq2BB/L22nqrSY5DKlo3X6+vclJm8Bb5djXJBmEX6fS3+zCh/F4VBK5Z2KxJt4s2Q==",
- "dev": true,
- "requires": {
- "once": "1.4.0"
- }
- }
}
},
"punycode": {
@@ -4345,22 +4280,22 @@
"dev": true
},
"randombytes": {
- "version": "2.0.5",
- "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.0.5.tgz",
- "integrity": "sha512-8T7Zn1AhMsQ/HI1SjcCfT/t4ii3eAqco3yOcSzS4mozsOz69lHLsoMXmF9nZgnFanYscnSlUSgs8uZyKzpE6kg==",
+ "version": "2.0.6",
+ "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.0.6.tgz",
+ "integrity": "sha512-CIQ5OFxf4Jou6uOKe9t1AOgqpeU5fd70A8NPdHSGeYXqXsPe6peOwI0cUl88RWZ6sP1vPMV3avd/R6cZ5/sP1A==",
"dev": true,
"requires": {
- "safe-buffer": "5.1.1"
+ "safe-buffer": "5.1.2"
}
},
"randomfill": {
- "version": "1.0.3",
- "resolved": "https://registry.npmjs.org/randomfill/-/randomfill-1.0.3.tgz",
- "integrity": "sha512-YL6GrhrWoic0Eq8rXVbMptH7dAxCs0J+mh5Y0euNekPPYaxEmdVGim6GdoxoRzKW2yJoU8tueifS7mYxvcFDEQ==",
+ "version": "1.0.4",
+ "resolved": "https://registry.npmjs.org/randomfill/-/randomfill-1.0.4.tgz",
+ "integrity": "sha512-87lcbR8+MhcWcUiQ+9e+Rwx8MyR2P7qnt15ynUlbm3TU/fjbgz4GsvfSUDTemtCCtVCqb4ZcEFlyPNTh9bBTLw==",
"dev": true,
"requires": {
- "randombytes": "2.0.5",
- "safe-buffer": "5.1.1"
+ "randombytes": "2.0.6",
+ "safe-buffer": "5.1.2"
}
},
"read-only-stream": {
@@ -4369,21 +4304,21 @@
"integrity": "sha1-JyT9aoET1zdkrCiNQ4YnDB2/F/A=",
"dev": true,
"requires": {
- "readable-stream": "2.3.3"
+ "readable-stream": "2.3.6"
}
},
"readable-stream": {
- "version": "2.3.3",
- "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.3.tgz",
- "integrity": "sha512-m+qzzcn7KUxEmd1gMbchF+Y2eIUbieUaxkWtptyHywrX0rE8QEYqPC07Vuy4Wm32/xE16NcdBctb8S0Xe/5IeQ==",
+ "version": "2.3.6",
+ "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz",
+ "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==",
"dev": true,
"requires": {
"core-util-is": "1.0.2",
"inherits": "2.0.3",
"isarray": "1.0.0",
- "process-nextick-args": "1.0.7",
- "safe-buffer": "5.1.1",
- "string_decoder": "1.0.3",
+ "process-nextick-args": "2.0.0",
+ "safe-buffer": "5.1.2",
+ "string_decoder": "1.1.1",
"util-deprecate": "1.0.2"
}
},
@@ -4397,12 +4332,13 @@
}
},
"regex-not": {
- "version": "1.0.0",
- "resolved": "https://registry.npmjs.org/regex-not/-/regex-not-1.0.0.tgz",
- "integrity": "sha1-Qvg+OXcWIt+CawKvF2Ul1qXxV/k=",
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/regex-not/-/regex-not-1.0.2.tgz",
+ "integrity": "sha512-J6SDjUgDxQj5NusnOtdFxDwN/+HWykR8GELwctJ7mdqhcyy1xEc4SRFHUXvxTp661YaVKAjfRLZ9cCqS6tn32A==",
"dev": true,
"requires": {
- "extend-shallow": "2.0.1"
+ "extend-shallow": "3.0.2",
+ "safe-regex": "1.1.0"
}
},
"remove-bom-buffer": {
@@ -4422,7 +4358,7 @@
"dev": true,
"requires": {
"remove-bom-buffer": "3.0.0",
- "safe-buffer": "5.1.1",
+ "safe-buffer": "5.1.2",
"through2": "2.0.3"
}
},
@@ -4481,6 +4417,12 @@
"integrity": "sha1-LGN/53yJOv0qZj/iGqkIAGjiBSo=",
"dev": true
},
+ "ret": {
+ "version": "0.1.15",
+ "resolved": "https://registry.npmjs.org/ret/-/ret-0.1.15.tgz",
+ "integrity": "sha512-TTlYpa+OL+vMMNG24xSlQGEJ3B/RzEfUlLct7b5G/ytav+wPrplCpVMFuwzXbkecJrb6IYo1iFb0S9v37754mg==",
+ "dev": true
+ },
"right-align": {
"version": "0.1.3",
"resolved": "https://registry.npmjs.org/right-align/-/right-align-0.1.3.tgz",
@@ -4501,12 +4443,12 @@
}
},
"ripemd160": {
- "version": "2.0.1",
- "resolved": "https://registry.npmjs.org/ripemd160/-/ripemd160-2.0.1.tgz",
- "integrity": "sha1-D0WEKVxTo2KK9+bXmsohzlfRxuc=",
+ "version": "2.0.2",
+ "resolved": "https://registry.npmjs.org/ripemd160/-/ripemd160-2.0.2.tgz",
+ "integrity": "sha512-ii4iagi25WusVoiC4B4lq7pbXfAp3D9v5CwfkY33vffw2+pkDjY1D8GaN7spsxvCSx8dkPqOZCEZyfxcmJG2IA==",
"dev": true,
"requires": {
- "hash-base": "2.0.2",
+ "hash-base": "3.0.4",
"inherits": "2.0.3"
}
},
@@ -4549,11 +4491,20 @@
}
},
"safe-buffer": {
- "version": "5.1.1",
- "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.1.tgz",
- "integrity": "sha512-kKvNJn6Mm93gAczWVJg7wH+wGYWNrDHdWvpUmHyEsgCtIwwo3bqPtV4tR5tuPaUhTOo/kvhVwd8XwwOllGYkbg==",
+ "version": "5.1.2",
+ "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz",
+ "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==",
"dev": true
},
+ "safe-regex": {
+ "version": "1.1.0",
+ "resolved": "https://registry.npmjs.org/safe-regex/-/safe-regex-1.1.0.tgz",
+ "integrity": "sha1-QKNmnzsHfR6UPURinhV91IAjvy4=",
+ "dev": true,
+ "requires": {
+ "ret": "0.1.15"
+ }
+ },
"sander": {
"version": "0.5.1",
"resolved": "https://registry.npmjs.org/sander/-/sander-0.5.1.tgz",
@@ -4592,15 +4543,6 @@
"integrity": "sha1-kM/xnQLgcCf9dn9erT57ldHnOAw=",
"dev": true
},
- "set-getter": {
- "version": "0.1.0",
- "resolved": "https://registry.npmjs.org/set-getter/-/set-getter-0.1.0.tgz",
- "integrity": "sha1-12nBgsnVpR9AkUXy+6guXoboA3Y=",
- "dev": true,
- "requires": {
- "to-object-path": "0.3.0"
- }
- },
"set-value": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/set-value/-/set-value-2.0.0.tgz",
@@ -4611,16 +4553,27 @@
"is-extendable": "0.1.1",
"is-plain-object": "2.0.4",
"split-string": "3.1.0"
+ },
+ "dependencies": {
+ "extend-shallow": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz",
+ "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=",
+ "dev": true,
+ "requires": {
+ "is-extendable": "0.1.1"
+ }
+ }
}
},
"sha.js": {
- "version": "2.4.9",
- "resolved": "https://registry.npmjs.org/sha.js/-/sha.js-2.4.9.tgz",
- "integrity": "sha512-G8zektVqbiPHrylgew9Zg1VRB1L/DtXNUVAM6q4QLy8NE3qtHlFXTf8VLL4k1Yl6c7NMjtZUTdXV+X44nFaT6A==",
+ "version": "2.4.11",
+ "resolved": "https://registry.npmjs.org/sha.js/-/sha.js-2.4.11.tgz",
+ "integrity": "sha512-QMEp5B7cftE7APOjk5Y6xgrbWu+WkLVQwk8JNjZ8nKRciZaByEW6MubieAiToS7+dwvrjGhH8jRXz3MVd0AYqQ==",
"dev": true,
"requires": {
"inherits": "2.0.3",
- "safe-buffer": "5.1.1"
+ "safe-buffer": "5.1.2"
}
},
"shasum": {
@@ -4630,7 +4583,7 @@
"dev": true,
"requires": {
"json-stable-stringify": "0.0.1",
- "sha.js": "2.4.9"
+ "sha.js": "2.4.11"
}
},
"shell-quote": {
@@ -4652,9 +4605,9 @@
"dev": true
},
"snapdragon": {
- "version": "0.8.1",
- "resolved": "https://registry.npmjs.org/snapdragon/-/snapdragon-0.8.1.tgz",
- "integrity": "sha1-4StUh/re0+PeoKyR6UAL91tAE3A=",
+ "version": "0.8.2",
+ "resolved": "https://registry.npmjs.org/snapdragon/-/snapdragon-0.8.2.tgz",
+ "integrity": "sha512-FtyOnWN/wCHTVXOMwvSv26d+ko5vWlIDD6zoUJ7LW8vh+ZBC8QdljveRP+crNrtBwioEUWy/4dMtbBjA4ioNlg==",
"dev": true,
"requires": {
"base": "0.11.2",
@@ -4664,7 +4617,7 @@
"map-cache": "0.2.2",
"source-map": "0.5.7",
"source-map-resolve": "0.5.1",
- "use": "2.0.2"
+ "use": "3.1.0"
},
"dependencies": {
"define-property": {
@@ -4676,62 +4629,14 @@
"is-descriptor": "0.1.6"
}
},
- "is-accessor-descriptor": {
- "version": "0.1.6",
- "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz",
- "integrity": "sha1-qeEss66Nh2cn7u84Q/igiXtcmNY=",
+ "extend-shallow": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz",
+ "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=",
"dev": true,
"requires": {
- "kind-of": "3.2.2"
- },
- "dependencies": {
- "kind-of": {
- "version": "3.2.2",
- "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz",
- "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=",
- "dev": true,
- "requires": {
- "is-buffer": "1.1.6"
- }
- }
+ "is-extendable": "0.1.1"
}
- },
- "is-data-descriptor": {
- "version": "0.1.4",
- "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz",
- "integrity": "sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y=",
- "dev": true,
- "requires": {
- "kind-of": "3.2.2"
- },
- "dependencies": {
- "kind-of": {
- "version": "3.2.2",
- "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz",
- "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=",
- "dev": true,
- "requires": {
- "is-buffer": "1.1.6"
- }
- }
- }
- },
- "is-descriptor": {
- "version": "0.1.6",
- "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz",
- "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==",
- "dev": true,
- "requires": {
- "is-accessor-descriptor": "0.1.6",
- "is-data-descriptor": "0.1.4",
- "kind-of": "5.1.0"
- }
- },
- "kind-of": {
- "version": "5.1.0",
- "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz",
- "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==",
- "dev": true
}
}
},
@@ -4744,6 +4649,46 @@
"define-property": "1.0.0",
"isobject": "3.0.1",
"snapdragon-util": "3.0.1"
+ },
+ "dependencies": {
+ "define-property": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz",
+ "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=",
+ "dev": true,
+ "requires": {
+ "is-descriptor": "1.0.2"
+ }
+ },
+ "is-accessor-descriptor": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz",
+ "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==",
+ "dev": true,
+ "requires": {
+ "kind-of": "6.0.2"
+ }
+ },
+ "is-data-descriptor": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz",
+ "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==",
+ "dev": true,
+ "requires": {
+ "kind-of": "6.0.2"
+ }
+ },
+ "is-descriptor": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz",
+ "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==",
+ "dev": true,
+ "requires": {
+ "is-accessor-descriptor": "1.0.0",
+ "is-data-descriptor": "1.0.0",
+ "kind-of": "6.0.2"
+ }
+ }
}
},
"snapdragon-util": {
@@ -4775,7 +4720,7 @@
"buffer-crc32": "0.2.13",
"minimist": "1.2.0",
"sander": "0.5.1",
- "sourcemap-codec": "1.3.1"
+ "sourcemap-codec": "1.4.1"
}
},
"source-map": {
@@ -4790,7 +4735,7 @@
"integrity": "sha512-0KW2wvzfxm8NCTb30z0LMNyPqWCdDGE2viwzUaucqJdkTRXtZiSY3I+2A6nVAjmdOy0I4gU8DwnVVGsk9jvP2A==",
"dev": true,
"requires": {
- "atob": "2.0.3",
+ "atob": "2.1.0",
"decode-uri-component": "0.2.0",
"resolve-url": "0.2.1",
"source-map-url": "0.4.0",
@@ -4798,11 +4743,12 @@
}
},
"source-map-support": {
- "version": "0.5.4",
- "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.4.tgz",
- "integrity": "sha512-PETSPG6BjY1AHs2t64vS2aqAgu6dMIMXJULWFBGbh2Gr8nVLbCFDo6i/RMMvviIQ2h1Z8+5gQhVKSn2je9nmdg==",
+ "version": "0.5.5",
+ "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.5.tgz",
+ "integrity": "sha512-mR7/Nd5l1z6g99010shcXJiNEaf3fEtmLhRB/sBcQVJGodcHCULPp2y4Sfa43Kv2zq7T+Izmfp/WHCR6dYkQCA==",
"dev": true,
"requires": {
+ "buffer-from": "1.0.0",
"source-map": "0.6.1"
},
"dependencies": {
@@ -4821,13 +4767,10 @@
"dev": true
},
"sourcemap-codec": {
- "version": "1.3.1",
- "resolved": "https://registry.npmjs.org/sourcemap-codec/-/sourcemap-codec-1.3.1.tgz",
- "integrity": "sha1-mtb5vb1pGTEBbjCTnbyGhnMyMUY=",
- "dev": true,
- "requires": {
- "vlq": "0.2.3"
- }
+ "version": "1.4.1",
+ "resolved": "https://registry.npmjs.org/sourcemap-codec/-/sourcemap-codec-1.4.1.tgz",
+ "integrity": "sha512-hX1eNBNuilj8yfFnECh0DzLgwKpBLMIvmhgEhixXNui8lMLBInTI8Kyxt++RwJnMNu7cAUo635L2+N1TxMJCzA==",
+ "dev": true
},
"sparkles": {
"version": "1.0.0",
@@ -4842,27 +4785,6 @@
"dev": true,
"requires": {
"extend-shallow": "3.0.2"
- },
- "dependencies": {
- "extend-shallow": {
- "version": "3.0.2",
- "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-3.0.2.tgz",
- "integrity": "sha1-Jqcarwc7OfshJxcnRhMcJwQCjbg=",
- "dev": true,
- "requires": {
- "assign-symbols": "1.0.0",
- "is-extendable": "1.0.1"
- }
- },
- "is-extendable": {
- "version": "1.0.1",
- "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz",
- "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==",
- "dev": true,
- "requires": {
- "is-plain-object": "2.0.4"
- }
- }
}
},
"sprintf-js": {
@@ -4889,63 +4811,6 @@
"requires": {
"is-descriptor": "0.1.6"
}
- },
- "is-accessor-descriptor": {
- "version": "0.1.6",
- "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz",
- "integrity": "sha1-qeEss66Nh2cn7u84Q/igiXtcmNY=",
- "dev": true,
- "requires": {
- "kind-of": "3.2.2"
- },
- "dependencies": {
- "kind-of": {
- "version": "3.2.2",
- "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz",
- "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=",
- "dev": true,
- "requires": {
- "is-buffer": "1.1.6"
- }
- }
- }
- },
- "is-data-descriptor": {
- "version": "0.1.4",
- "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz",
- "integrity": "sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y=",
- "dev": true,
- "requires": {
- "kind-of": "3.2.2"
- },
- "dependencies": {
- "kind-of": {
- "version": "3.2.2",
- "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz",
- "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=",
- "dev": true,
- "requires": {
- "is-buffer": "1.1.6"
- }
- }
- }
- },
- "is-descriptor": {
- "version": "0.1.6",
- "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz",
- "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==",
- "dev": true,
- "requires": {
- "is-accessor-descriptor": "0.1.6",
- "is-data-descriptor": "0.1.4",
- "kind-of": "5.1.0"
- }
- },
- "kind-of": {
- "version": "5.1.0",
- "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz",
- "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==",
- "dev": true
}
}
},
@@ -4956,7 +4821,7 @@
"dev": true,
"requires": {
"inherits": "2.0.3",
- "readable-stream": "2.3.3"
+ "readable-stream": "2.3.6"
}
},
"stream-combiner2": {
@@ -4966,24 +4831,24 @@
"dev": true,
"requires": {
"duplexer2": "0.1.4",
- "readable-stream": "2.3.3"
+ "readable-stream": "2.3.6"
}
},
"stream-consume": {
- "version": "0.1.0",
- "resolved": "https://registry.npmjs.org/stream-consume/-/stream-consume-0.1.0.tgz",
- "integrity": "sha1-pB6tGm1ggc63n2WwYZAbbY89HQ8=",
+ "version": "0.1.1",
+ "resolved": "https://registry.npmjs.org/stream-consume/-/stream-consume-0.1.1.tgz",
+ "integrity": "sha512-tNa3hzgkjEP7XbCkbRXe1jpg+ievoa0O4SCFlMOYEscGSS4JJsckGL8swUyAa/ApGU3Ae4t6Honor4HhL+tRyg==",
"dev": true
},
"stream-http": {
- "version": "2.7.2",
- "resolved": "https://registry.npmjs.org/stream-http/-/stream-http-2.7.2.tgz",
- "integrity": "sha512-c0yTD2rbQzXtSsFSVhtpvY/vS6u066PcXOX9kBB3mSO76RiUQzL340uJkGBWnlBg4/HZzqiUXtaVA7wcRcJgEw==",
+ "version": "2.8.1",
+ "resolved": "https://registry.npmjs.org/stream-http/-/stream-http-2.8.1.tgz",
+ "integrity": "sha512-cQ0jo17BLca2r0GfRdZKYAGLU6JRoIWxqSOakUMuKOT6MOK7AAlE856L33QuDmAy/eeOrhLee3dZKX0Uadu93A==",
"dev": true,
"requires": {
"builtin-status-codes": "3.0.0",
"inherits": "2.0.3",
- "readable-stream": "2.3.3",
+ "readable-stream": "2.3.6",
"to-arraybuffer": "1.0.1",
"xtend": "4.0.1"
}
@@ -5001,7 +4866,7 @@
"dev": true,
"requires": {
"inherits": "2.0.3",
- "readable-stream": "2.3.3"
+ "readable-stream": "2.3.6"
}
},
"streamqueue": {
@@ -5040,12 +4905,12 @@
}
},
"string_decoder": {
- "version": "1.0.3",
- "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.0.3.tgz",
- "integrity": "sha512-4AH6Z5fzNNBcH+6XDMfA/BTt87skxqJlO0lAh3Dker5zThcAxG6mKz+iGu308UKoPPQ8Dcqx/4JhujzltRa+hQ==",
+ "version": "1.1.1",
+ "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz",
+ "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==",
"dev": true,
"requires": {
- "safe-buffer": "5.1.1"
+ "safe-buffer": "5.1.2"
}
},
"strip-ansi": {
@@ -5082,13 +4947,22 @@
"minimist": "1.2.0"
}
},
- "syntax-error": {
- "version": "1.3.0",
- "resolved": "https://registry.npmjs.org/syntax-error/-/syntax-error-1.3.0.tgz",
- "integrity": "sha1-HtkmbE1AvnXcVb+bsct3Biu5bKE=",
+ "supports-color": {
+ "version": "5.4.0",
+ "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.4.0.tgz",
+ "integrity": "sha512-zjaXglF5nnWpsq470jSv6P9DwPvgLkuapYmfDm3JWOm0vkNTVF2tI4UrN2r6jH1qM/uc/WtxYY1hYoA2dOKj5w==",
"dev": true,
"requires": {
- "acorn": "4.0.13"
+ "has-flag": "3.0.0"
+ }
+ },
+ "syntax-error": {
+ "version": "1.4.0",
+ "resolved": "https://registry.npmjs.org/syntax-error/-/syntax-error-1.4.0.tgz",
+ "integrity": "sha512-YPPlu67mdnHGTup2A8ff7BC2Pjq0e0Yp/IyTFN03zWO0RcK07uLcbi7C2KpGR2FvWbaB0+bfE27a+sBKebSo7w==",
+ "dev": true,
+ "requires": {
+ "acorn-node": "1.3.0"
}
},
"through": {
@@ -5103,7 +4977,7 @@
"integrity": "sha1-AARWmzfHx0ujnEPzzteNGtlBQL4=",
"dev": true,
"requires": {
- "readable-stream": "2.3.3",
+ "readable-stream": "2.3.6",
"xtend": "4.0.1"
}
},
@@ -5142,15 +5016,25 @@
}
},
"timers-ext": {
- "version": "0.1.2",
- "resolved": "https://registry.npmjs.org/timers-ext/-/timers-ext-0.1.2.tgz",
- "integrity": "sha1-YcxHp2wavTGV8UUn+XjViulMUgQ=",
+ "version": "0.1.5",
+ "resolved": "https://registry.npmjs.org/timers-ext/-/timers-ext-0.1.5.tgz",
+ "integrity": "sha512-tsEStd7kmACHENhsUPaxb8Jf8/+GZZxyNFQbZD07HQOyooOa6At1rQqjffgvg7n+dxscQa9cjjMdWhJtsP2sxg==",
"dev": true,
"requires": {
- "es5-ext": "0.10.37",
+ "es5-ext": "0.10.42",
"next-tick": "1.0.0"
}
},
+ "to-absolute-glob": {
+ "version": "2.0.2",
+ "resolved": "https://registry.npmjs.org/to-absolute-glob/-/to-absolute-glob-2.0.2.tgz",
+ "integrity": "sha1-GGX0PZ50sIItufFFt4z/fQ98hJs=",
+ "dev": true,
+ "requires": {
+ "is-absolute": "1.0.0",
+ "is-negated-glob": "1.0.0"
+ }
+ },
"to-arraybuffer": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/to-arraybuffer/-/to-arraybuffer-1.0.1.tgz",
@@ -5178,82 +5062,15 @@
}
},
"to-regex": {
- "version": "3.0.1",
- "resolved": "https://registry.npmjs.org/to-regex/-/to-regex-3.0.1.tgz",
- "integrity": "sha1-FTWL7kosg712N3uh3ASdDxiDeq4=",
+ "version": "3.0.2",
+ "resolved": "https://registry.npmjs.org/to-regex/-/to-regex-3.0.2.tgz",
+ "integrity": "sha512-FWtleNAtZ/Ki2qtqej2CXTOayOH9bHDQF+Q48VpWyDXjbYxA4Yz8iDB31zXOBUlOHHKidDbqGVrTUvQMPmBGBw==",
"dev": true,
"requires": {
- "define-property": "0.2.5",
- "extend-shallow": "2.0.1",
- "regex-not": "1.0.0"
- },
- "dependencies": {
- "define-property": {
- "version": "0.2.5",
- "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz",
- "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=",
- "dev": true,
- "requires": {
- "is-descriptor": "0.1.6"
- }
- },
- "is-accessor-descriptor": {
- "version": "0.1.6",
- "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz",
- "integrity": "sha1-qeEss66Nh2cn7u84Q/igiXtcmNY=",
- "dev": true,
- "requires": {
- "kind-of": "3.2.2"
- },
- "dependencies": {
- "kind-of": {
- "version": "3.2.2",
- "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz",
- "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=",
- "dev": true,
- "requires": {
- "is-buffer": "1.1.6"
- }
- }
- }
- },
- "is-data-descriptor": {
- "version": "0.1.4",
- "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz",
- "integrity": "sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y=",
- "dev": true,
- "requires": {
- "kind-of": "3.2.2"
- },
- "dependencies": {
- "kind-of": {
- "version": "3.2.2",
- "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz",
- "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=",
- "dev": true,
- "requires": {
- "is-buffer": "1.1.6"
- }
- }
- }
- },
- "is-descriptor": {
- "version": "0.1.6",
- "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz",
- "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==",
- "dev": true,
- "requires": {
- "is-accessor-descriptor": "0.1.6",
- "is-data-descriptor": "0.1.4",
- "kind-of": "5.1.0"
- }
- },
- "kind-of": {
- "version": "5.1.0",
- "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz",
- "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==",
- "dev": true
- }
+ "define-property": "2.0.2",
+ "extend-shallow": "3.0.2",
+ "regex-not": "1.0.2",
+ "safe-regex": "1.1.0"
}
},
"to-regex-range": {
@@ -5281,26 +5098,10 @@
"integrity": "sha1-/sAF+dyqJZo/lFnOWmkGq6TFRdo=",
"dev": true
},
- "ts-node": {
- "version": "5.0.1",
- "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-5.0.1.tgz",
- "integrity": "sha512-XK7QmDcNHVmZkVtkiwNDWiERRHPyU8nBqZB1+iv2UhOG0q3RQ9HsZ2CMqISlFbxjrYFGfG2mX7bW4dAyxBVzUw==",
- "dev": true,
- "requires": {
- "arrify": "1.0.1",
- "chalk": "2.3.2",
- "diff": "3.3.1",
- "make-error": "1.3.2",
- "minimist": "1.2.0",
- "mkdirp": "0.5.1",
- "source-map-support": "0.5.4",
- "yn": "2.0.0"
- }
- },
"tslib": {
- "version": "1.8.1",
- "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.8.1.tgz",
- "integrity": "sha1-aUavLR1lGnsYY7Ux1uWvpBqkTqw=",
+ "version": "1.9.0",
+ "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.9.0.tgz",
+ "integrity": "sha512-f/qGG2tUkrISBlQZEjEqoZ3B2+npJjIf04H1wuAv9iA8i04Icp+61KRXxFdha22670NJopsZCIjhC3SnjPRKrQ==",
"dev": true
},
"tslint": {
@@ -5311,16 +5112,16 @@
"requires": {
"babel-code-frame": "6.26.0",
"builtin-modules": "1.1.1",
- "chalk": "2.3.2",
+ "chalk": "2.4.0",
"commander": "2.15.1",
- "diff": "3.3.1",
+ "diff": "3.5.0",
"glob": "7.1.2",
- "js-yaml": "3.10.0",
+ "js-yaml": "3.11.0",
"minimatch": "3.0.4",
- "resolve": "1.6.0",
+ "resolve": "1.7.1",
"semver": "5.5.0",
- "tslib": "1.8.1",
- "tsutils": "2.16.0"
+ "tslib": "1.9.0",
+ "tsutils": "2.26.1"
},
"dependencies": {
"commander": {
@@ -5330,9 +5131,9 @@
"dev": true
},
"resolve": {
- "version": "1.6.0",
- "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.6.0.tgz",
- "integrity": "sha512-mw7JQNu5ExIkcw4LPih0owX/TZXjD/ZUF/ZQ/pDnkw3ZKhDcZZw5klmBlj6gVMwjQ3Pz5Jgu7F3d0jcDVuEWdw==",
+ "version": "1.7.1",
+ "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.7.1.tgz",
+ "integrity": "sha512-c7rwLofp8g1U+h1KNyHL/jicrKg1Ek4q+Lr33AL65uZTinUZHe30D5HlyN5V9NW0JX1D5dXQ4jqW5l7Sy/kGfw==",
"dev": true,
"requires": {
"path-parse": "1.0.5"
@@ -5347,14 +5148,20 @@
}
},
"tsutils": {
- "version": "2.16.0",
- "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-2.16.0.tgz",
- "integrity": "sha512-9Ier/60O7OZRNPiw+or5QAtAY4kQA+WDiO/r6xOYATEyefH9bdfvTRLCxrYnFhQlZfET2vYXKfpr3Vw2BiArZw==",
+ "version": "2.26.1",
+ "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-2.26.1.tgz",
+ "integrity": "sha512-bnm9bcjOqOr1UljleL94wVCDlpa6KjfGaTkefeLch4GRafgDkROxPizbB/FxTEdI++5JqhxczRy/Qub0syNqZA==",
"dev": true,
"requires": {
- "tslib": "1.8.1"
+ "tslib": "1.9.0"
}
},
+ "tty-browserify": {
+ "version": "0.0.1",
+ "resolved": "https://registry.npmjs.org/tty-browserify/-/tty-browserify-0.0.1.tgz",
+ "integrity": "sha512-C3TaO7K81YvjCgQH9Q1S3R3P3BtN3RIM8n+OvX4il1K1zgE8ZhI0op7kClgkxtutIE8hQrcrHBXvIheqKUUCxw==",
+ "dev": true
+ },
"type-check": {
"version": "0.3.2",
"resolved": "https://registry.npmjs.org/type-check/-/type-check-0.3.2.tgz",
@@ -5365,9 +5172,9 @@
}
},
"type-detect": {
- "version": "4.0.5",
- "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.0.5.tgz",
- "integrity": "sha512-N9IvkQslUGYGC24RkJk1ba99foK6TkwC2FHAEBlQFBP0RxQZS8ZpJuAZcwiY/w9ZJHFQb1aOXBI60OdxhTrwEQ==",
+ "version": "4.0.8",
+ "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz",
+ "integrity": "sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==",
"dev": true
},
"typedarray": {
@@ -5377,9 +5184,9 @@
"dev": true
},
"typescript": {
- "version": "2.8.0-dev.20180322",
- "resolved": "https://registry.npmjs.org/typescript/-/typescript-2.8.0-dev.20180322.tgz",
- "integrity": "sha512-dSYa9IAoj3CRAxtKx9+cSCQLetB7OLtHXhvQWeWY6PPIXvbpAC41ulQWX3TUAkMYU9NS/kGIU8TFM9VFpinJTg==",
+ "version": "2.9.0-dev.20180425",
+ "resolved": "https://registry.npmjs.org/typescript/-/typescript-2.9.0-dev.20180425.tgz",
+ "integrity": "sha512-6t/l13ofVeTSJVD78b20E0rkoOcFPrst5bK9vCGDbbjzx+Ab3HoV7fSTuwB8zMEvpxHwQtR+0kR3XUy06HzwUg==",
"dev": true
},
"uglify-js": {
@@ -5402,9 +5209,9 @@
"optional": true
},
"umd": {
- "version": "3.0.1",
- "resolved": "https://registry.npmjs.org/umd/-/umd-3.0.1.tgz",
- "integrity": "sha1-iuVW4RAR9jwllnCKiDclnwGz1g4=",
+ "version": "3.0.3",
+ "resolved": "https://registry.npmjs.org/umd/-/umd-3.0.3.tgz",
+ "integrity": "sha512-4IcGSufhFshvLNcMCV80UnQVlZ5pMOC8mvNPForqwA4+lzYQuetTESLDQkeLmihq8bRcnpbQa48Wb8Lh16/xow==",
"dev": true
},
"unc-path-regex": {
@@ -5425,6 +5232,15 @@
"set-value": "0.4.3"
},
"dependencies": {
+ "extend-shallow": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz",
+ "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=",
+ "dev": true,
+ "requires": {
+ "is-extendable": "0.1.1"
+ }
+ },
"set-value": {
"version": "0.4.3",
"resolved": "https://registry.npmjs.org/set-value/-/set-value-0.4.3.tgz",
@@ -5510,82 +5326,12 @@
}
},
"use": {
- "version": "2.0.2",
- "resolved": "https://registry.npmjs.org/use/-/use-2.0.2.tgz",
- "integrity": "sha1-riig1y+TvyJCKhii43mZMRLeyOg=",
+ "version": "3.1.0",
+ "resolved": "https://registry.npmjs.org/use/-/use-3.1.0.tgz",
+ "integrity": "sha512-6UJEQM/L+mzC3ZJNM56Q4DFGLX/evKGRg15UJHGB9X5j5Z3AFbgZvjUh2yq/UJUY4U5dh7Fal++XbNg1uzpRAw==",
"dev": true,
"requires": {
- "define-property": "0.2.5",
- "isobject": "3.0.1",
- "lazy-cache": "2.0.2"
- },
- "dependencies": {
- "define-property": {
- "version": "0.2.5",
- "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz",
- "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=",
- "dev": true,
- "requires": {
- "is-descriptor": "0.1.6"
- }
- },
- "is-accessor-descriptor": {
- "version": "0.1.6",
- "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz",
- "integrity": "sha1-qeEss66Nh2cn7u84Q/igiXtcmNY=",
- "dev": true,
- "requires": {
- "kind-of": "3.2.2"
- },
- "dependencies": {
- "kind-of": {
- "version": "3.2.2",
- "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz",
- "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=",
- "dev": true,
- "requires": {
- "is-buffer": "1.1.6"
- }
- }
- }
- },
- "is-data-descriptor": {
- "version": "0.1.4",
- "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz",
- "integrity": "sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y=",
- "dev": true,
- "requires": {
- "kind-of": "3.2.2"
- },
- "dependencies": {
- "kind-of": {
- "version": "3.2.2",
- "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz",
- "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=",
- "dev": true,
- "requires": {
- "is-buffer": "1.1.6"
- }
- }
- }
- },
- "is-descriptor": {
- "version": "0.1.6",
- "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz",
- "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==",
- "dev": true,
- "requires": {
- "is-accessor-descriptor": "0.1.6",
- "is-data-descriptor": "0.1.4",
- "kind-of": "5.1.0"
- }
- },
- "kind-of": {
- "version": "5.1.0",
- "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz",
- "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==",
- "dev": true
- }
+ "kind-of": "6.0.2"
}
},
"user-home": {
@@ -5647,7 +5393,7 @@
"clone": "2.1.2",
"clone-buffer": "1.0.0",
"clone-stats": "1.0.0",
- "cloneable-readable": "1.0.0",
+ "cloneable-readable": "1.1.2",
"remove-trailing-separator": "1.1.0",
"replace-ext": "1.0.0"
},
@@ -5763,20 +5509,11 @@
}
}
},
- "vlq": {
- "version": "0.2.3",
- "resolved": "https://registry.npmjs.org/vlq/-/vlq-0.2.3.tgz",
- "integrity": "sha512-DRibZL6DsNhIgYQ+wNdWDL2SL3bKPlVrRiBqV5yuMm++op8W4kGFtaQfCs4KEJn0wBZcHVHJ3eoywX8983k1ow==",
- "dev": true
- },
"vm-browserify": {
- "version": "0.0.4",
- "resolved": "https://registry.npmjs.org/vm-browserify/-/vm-browserify-0.0.4.tgz",
- "integrity": "sha1-XX6kW7755Kb/ZflUOOCofDV9WnM=",
- "dev": true,
- "requires": {
- "indexof": "0.0.1"
- }
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/vm-browserify/-/vm-browserify-1.0.1.tgz",
+ "integrity": "sha512-EqzLchIMYLBjRPoqVsEkZOa/4Vr2RfOWbd58F+I/Gj79AYTrsseMunxbbSkbYfrqZaXSuPBBXNSOhtJgg0PpmA==",
+ "dev": true
},
"which": {
"version": "1.3.0",
@@ -5813,13 +5550,13 @@
"dev": true,
"requires": {
"sax": "1.2.4",
- "xmlbuilder": "9.0.4"
+ "xmlbuilder": "9.0.7"
}
},
"xmlbuilder": {
- "version": "9.0.4",
- "resolved": "https://registry.npmjs.org/xmlbuilder/-/xmlbuilder-9.0.4.tgz",
- "integrity": "sha1-UZy0ymhtAFqEINNJbz8MruzKWA8=",
+ "version": "9.0.7",
+ "resolved": "https://registry.npmjs.org/xmlbuilder/-/xmlbuilder-9.0.7.tgz",
+ "integrity": "sha1-Ey7mPS7FVlxVfiD0wi35rKaGsQ0=",
"dev": true
},
"xtend": {
@@ -5840,12 +5577,6 @@
"decamelize": "1.2.0",
"window-size": "0.1.0"
}
- },
- "yn": {
- "version": "2.0.0",
- "resolved": "https://registry.npmjs.org/yn/-/yn-2.0.0.tgz",
- "integrity": "sha1-5a2ryKz0CPY4X8dklWhMiOavaJo=",
- "dev": true
}
}
}
diff --git a/package.json b/package.json
index 5837f72317f..3e53a3c67b8 100644
--- a/package.json
+++ b/package.json
@@ -48,11 +48,12 @@
"@types/q": "latest",
"@types/run-sequence": "latest",
"@types/through2": "latest",
+ "@types/travis-fold": "latest",
"@types/xml2js": "^0.4.0",
- "xml2js": "^0.4.19",
"browser-resolve": "^1.11.2",
"browserify": "latest",
"chai": "latest",
+ "chalk": "latest",
"convert-source-map": "latest",
"del": "latest",
"gulp": "3.X",
@@ -76,11 +77,10 @@
"source-map-support": "latest",
"through2": "latest",
"travis-fold": "latest",
- "ts-node": "latest",
"tslint": "latest",
+ "typescript": "next",
"vinyl": "latest",
- "chalk": "latest",
- "typescript": "next"
+ "xml2js": "^0.4.19"
},
"scripts": {
"pretest": "jake tests",
diff --git a/scripts/buildProtocol.ts b/scripts/buildProtocol.ts
index 899ab700bf3..3ea7d703cd3 100644
--- a/scripts/buildProtocol.ts
+++ b/scripts/buildProtocol.ts
@@ -178,7 +178,7 @@ function writeProtocolFile(outputFile: string, protocolTs: string, typeScriptSer
ts.sys.writeFile(outputFile, protocolDts);
if (diagnostics.length) {
- const flattenedDiagnostics = diagnostics.map(d => `${ts.flattenDiagnosticMessageText(d.messageText, "\n")} at ${d.file.fileName} line ${d.start}`).join("\n");
+ const flattenedDiagnostics = diagnostics.map(d => `${ts.flattenDiagnosticMessageText(d.messageText, "\n")} at ${d.file ? d.file.fileName : ""} line ${d.start}`).join("\n");
throw new Error(`Unexpected errors during sanity check: ${flattenedDiagnostics}`);
}
}
diff --git a/scripts/configurePrerelease.ts b/scripts/configurePrerelease.ts
index d17ddb963b1..da1984c13e0 100644
--- a/scripts/configurePrerelease.ts
+++ b/scripts/configurePrerelease.ts
@@ -1,4 +1,9 @@
-///
+///
+import { normalize } from "path";
+import assert = require("assert");
+import { readFileSync, writeFileSync } from "fs";
+const args = process.argv.slice(2);
+
/**
* A minimal description for a parsed package.json object.
@@ -10,28 +15,27 @@ interface PackageJson {
}
function main(): void {
- const sys = ts.sys;
- if (sys.args.length < 3) {
- sys.write("Usage:" + sys.newLine)
- sys.write("\tnode configureNightly.js " + sys.newLine);
+ if (args.length < 3) {
+ console.log("Usage:");
+ console.log("\tnode configureNightly.js ");
return;
}
- const tag = sys.args[0];
+ const tag = args[0];
if (tag !== "dev" && tag !== "insiders") {
throw new Error(`Unexpected tag name '${tag}'.`);
}
// Acquire the version from the package.json file and modify it appropriately.
- const packageJsonFilePath = ts.normalizePath(sys.args[1]);
- const packageJsonValue: PackageJson = JSON.parse(sys.readFile(packageJsonFilePath));
+ const packageJsonFilePath = normalize(args[1]);
+ const packageJsonValue: PackageJson = JSON.parse(readFileSync(packageJsonFilePath).toString());
const { majorMinor, patch } = parsePackageJsonVersion(packageJsonValue.version);
const prereleasePatch = getPrereleasePatch(tag, patch);
// Acquire and modify the source file that exposes the version string.
- const tsFilePath = ts.normalizePath(sys.args[2]);
- const tsFileContents = ts.sys.readFile(tsFilePath);
+ const tsFilePath = normalize(args[2]);
+ const tsFileContents = readFileSync(tsFilePath).toString();
const modifiedTsFileContents = updateTsFile(tsFilePath, tsFileContents, majorMinor, patch, prereleasePatch);
// Ensure we are actually changing something - the user probably wants to know that the update failed.
@@ -44,20 +48,20 @@ function main(): void {
// Finally write the changes to disk.
// Modify the package.json structure
packageJsonValue.version = `${majorMinor}.${prereleasePatch}`;
- sys.writeFile(packageJsonFilePath, JSON.stringify(packageJsonValue, /*replacer:*/ undefined, /*space:*/ 4))
- sys.writeFile(tsFilePath, modifiedTsFileContents);
+ writeFileSync(packageJsonFilePath, JSON.stringify(packageJsonValue, /*replacer:*/ undefined, /*space:*/ 4))
+ writeFileSync(tsFilePath, modifiedTsFileContents);
}
function updateTsFile(tsFilePath: string, tsFileContents: string, majorMinor: string, patch: string, nightlyPatch: string): string {
const majorMinorRgx = /export const versionMajorMinor = "(\d+\.\d+)"/;
const majorMinorMatch = majorMinorRgx.exec(tsFileContents);
- ts.Debug.assert(majorMinorMatch !== null, "", () => `The file seems to no longer have a string matching '${majorMinorRgx}'.`);
+ assert(majorMinorMatch !== null, `The file seems to no longer have a string matching '${majorMinorRgx}'.`);
const parsedMajorMinor = majorMinorMatch[1];
- ts.Debug.assert(parsedMajorMinor === majorMinor, "versionMajorMinor does not match.", () => `${tsFilePath}: '${parsedMajorMinor}'; package.json: '${majorMinor}'`);
+ assert(parsedMajorMinor === majorMinor, `versionMajorMinor does not match. ${tsFilePath}: '${parsedMajorMinor}'; package.json: '${majorMinor}'`);
const versionRgx = /export const version = `\$\{versionMajorMinor\}\.(\d)(-dev)?`;/;
const patchMatch = versionRgx.exec(tsFileContents);
- ts.Debug.assert(patchMatch !== null, "The file seems to no longer have a string matching", () => versionRgx.toString());
+ assert(patchMatch !== null, "The file seems to no longer have a string matching " + versionRgx.toString());
const parsedPatch = patchMatch[1];
if (parsedPatch !== patch) {
throw new Error(`patch does not match. ${tsFilePath}: '${parsedPatch}; package.json: '${patch}'`);
@@ -69,7 +73,7 @@ function updateTsFile(tsFilePath: string, tsFileContents: string, majorMinor: st
function parsePackageJsonVersion(versionString: string): { majorMinor: string, patch: string } {
const versionRgx = /(\d+\.\d+)\.(\d+)($|\-)/;
const match = versionString.match(versionRgx);
- ts.Debug.assert(match !== null, "package.json 'version' should match", () => versionRgx.toString());
+ assert(match !== null, "package.json 'version' should match " + versionRgx.toString());
return { majorMinor: match[1], patch: match[2] };
}
diff --git a/scripts/processDiagnosticMessages.ts b/scripts/processDiagnosticMessages.ts
index dd66564b134..848a60cfb4f 100644
--- a/scripts/processDiagnosticMessages.ts
+++ b/scripts/processDiagnosticMessages.ts
@@ -1,9 +1,7 @@
-///
-///
-
interface DiagnosticDetails {
category: string;
code: number;
+ reportsUnnecessary?: {};
isEarly?: boolean;
}
@@ -56,17 +54,17 @@ function buildInfoFileOutput(messageTable: InputDiagnosticMessageTable, inputFil
let result =
"// \r\n" +
"// generated from '" + inputFilePathRel + "' by '" + thisFilePathRel + "'\r\n" +
- "/// \r\n" +
"/* @internal */\r\n" +
"namespace ts {\r\n" +
- " function diag(code: number, category: DiagnosticCategory, key: string, message: string): DiagnosticMessage {\r\n" +
- " return { code, category, key, message };\r\n" +
+ " function diag(code: number, category: DiagnosticCategory, key: string, message: string, reportsUnnecessary?: {}): DiagnosticMessage {\r\n" +
+ " return { code, category, key, message, reportsUnnecessary };\r\n" +
" }\r\n" +
" // tslint:disable-next-line variable-name\r\n" +
" export const Diagnostics = {\r\n";
- messageTable.forEach(({ code, category }, name) => {
+ messageTable.forEach(({ code, category, reportsUnnecessary }, name) => {
const propName = convertPropertyName(name);
- result += ` ${propName}: diag(${code}, DiagnosticCategory.${category}, "${createKey(propName, code)}", ${JSON.stringify(name)}),\r\n`;
+ const argReportsUnnecessary = reportsUnnecessary ? `, /*reportsUnnecessary*/ ${reportsUnnecessary}` : "";
+ result += ` ${propName}: diag(${code}, DiagnosticCategory.${category}, "${createKey(propName, code)}", ${JSON.stringify(name)}${argReportsUnnecessary}),\r\n`;
});
result += " };\r\n}";
diff --git a/scripts/processDiagnosticMessages.tsconfig.json b/scripts/processDiagnosticMessages.tsconfig.json
new file mode 100644
index 00000000000..5675c8783b9
--- /dev/null
+++ b/scripts/processDiagnosticMessages.tsconfig.json
@@ -0,0 +1,20 @@
+{
+ "compilerOptions": {
+ "removeComments": false,
+ "outFile": "processDiagnosticMessages.js",
+ "target": "es5",
+ "declaration": false,
+ "lib": [
+ "es6",
+ "scripthost"
+ ]
+ },
+ "files": [
+ "../src/compiler/types.ts",
+ "../src/compiler/performance.ts",
+ "../src/compiler/core.ts",
+ "../src/compiler/sys.ts",
+
+ "processDiagnosticMessages.ts"
+ ]
+}
diff --git a/scripts/tslint/rules/booleanTriviaRule.ts b/scripts/tslint/rules/booleanTriviaRule.ts
index dbfdc28438e..0224a0f08d8 100644
--- a/scripts/tslint/rules/booleanTriviaRule.ts
+++ b/scripts/tslint/rules/booleanTriviaRule.ts
@@ -28,13 +28,11 @@ function walk(ctx: Lint.WalkContext): void {
function shouldIgnoreCalledExpression(expression: ts.Expression): boolean {
if (expression.kind === ts.SyntaxKind.PropertyAccessExpression) {
const methodName = (expression as ts.PropertyAccessExpression).name.text;
- if (methodName.indexOf("set") === 0) {
+ if (methodName.startsWith("set") || methodName.startsWith("assert")) {
return true;
}
switch (methodName) {
case "apply":
- case "assert":
- case "assertEqual":
case "call":
case "equal":
case "fail":
@@ -46,11 +44,10 @@ function walk(ctx: Lint.WalkContext): void {
}
else if (expression.kind === ts.SyntaxKind.Identifier) {
const functionName = (expression as ts.Identifier).text;
- if (functionName.indexOf("set") === 0) {
+ if (functionName.startsWith("set") || functionName.startsWith("assert")) {
return true;
}
switch (functionName) {
- case "assert":
case "contains":
case "createAnonymousType":
case "createImportSpecifier":
diff --git a/scripts/types/ambient.d.ts b/scripts/types/ambient.d.ts
index f99bf010198..4f9112d236e 100644
--- a/scripts/types/ambient.d.ts
+++ b/scripts/types/ambient.d.ts
@@ -14,4 +14,3 @@ declare module "gulp-insert" {
}
declare module "sorcery";
-declare module "travis-fold";
diff --git a/src/compiler/binder.ts b/src/compiler/binder.ts
index 9281719b860..2557e3b7078 100644
--- a/src/compiler/binder.ts
+++ b/src/compiler/binder.ts
@@ -1,6 +1,3 @@
-///
-///
-
/* @internal */
namespace ts {
export const enum ModuleInstanceState {
@@ -519,8 +516,9 @@ namespace ts {
const saveReturnTarget = currentReturnTarget;
const saveActiveLabels = activeLabels;
const saveHasExplicitReturn = hasExplicitReturn;
- const isIIFE = containerFlags & ContainerFlags.IsFunctionExpression && !hasModifier(node, ModifierFlags.Async) && !!getImmediatelyInvokedFunctionExpression(node);
- // A non-async IIFE is considered part of the containing control flow. Return statements behave
+ const isIIFE = containerFlags & ContainerFlags.IsFunctionExpression && !hasModifier(node, ModifierFlags.Async) &&
+ !(node).asteriskToken && !!getImmediatelyInvokedFunctionExpression(node);
+ // A non-async, non-generator IIFE is considered part of the containing control flow. Return statements behave
// similarly to break statements that exit to a label just past the statement body.
if (!isIIFE) {
currentFlow = { flags: FlowFlags.Start };
@@ -2222,14 +2220,14 @@ namespace ts {
bindAnonymousDeclaration(file, SymbolFlags.ValueModule, `"${removeFileExtension(file.fileName)}"` as __String);
}
- function bindExportAssignment(node: ExportAssignment | BinaryExpression) {
+ function bindExportAssignment(node: ExportAssignment) {
if (!container.symbol || !container.symbol.exports) {
// Export assignment in some sort of block construct
bindAnonymousDeclaration(node, SymbolFlags.Alias, getDeclarationName(node));
}
else {
const flags = node.kind === SyntaxKind.ExportAssignment && exportAssignmentIsAlias(node)
- // An export default clause with an EntityNameExpression exports all meanings of that identifier
+ // An export default clause with an EntityNameExpression or a class expression exports all meanings of that identifier or expression;
? SymbolFlags.Alias
// An export default clause with any other expression exports a value
: SymbolFlags.Property;
@@ -2324,7 +2322,10 @@ namespace ts {
// 'module.exports = expr' assignment
setCommonJsModuleIndicator(node);
- declareSymbol(file.symbol.exports, file.symbol, node, SymbolFlags.Property | SymbolFlags.ExportValue | SymbolFlags.ValueModule, SymbolFlags.None);
+ const flags = exportAssignmentIsAlias(node)
+ ? SymbolFlags.Alias // An export= with an EntityNameExpression or a ClassExpression exports all meanings of that identifier or class
+ : SymbolFlags.Property | SymbolFlags.ExportValue | SymbolFlags.ValueModule;
+ declareSymbol(file.symbol.exports, file.symbol, node, flags, SymbolFlags.None);
}
function bindThisPropertyAssignment(node: BinaryExpression | PropertyAccessExpression) {
diff --git a/src/compiler/builder.ts b/src/compiler/builder.ts
index cc506852252..92e651061ed 100644
--- a/src/compiler/builder.ts
+++ b/src/compiler/builder.ts
@@ -1,5 +1,3 @@
-///
-
/*@internal*/
namespace ts {
/**
diff --git a/src/compiler/builderState.ts b/src/compiler/builderState.ts
index 581aa05f12c..ac9f36b1258 100644
--- a/src/compiler/builderState.ts
+++ b/src/compiler/builderState.ts
@@ -1,4 +1,3 @@
-///
namespace ts {
export interface EmitOutput {
outputFiles: OutputFile[];
diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts
index aa9bbccffd9..499beb6e87d 100644
--- a/src/compiler/checker.ts
+++ b/src/compiler/checker.ts
@@ -1,7 +1,3 @@
-///
-///
-///
-
/* @internal */
namespace ts {
const ambientModuleSymbolRegex = /^".+"$/;
@@ -71,6 +67,7 @@ namespace ts {
const strictPropertyInitialization = getStrictOptionValue(compilerOptions, "strictPropertyInitialization");
const noImplicitAny = getStrictOptionValue(compilerOptions, "noImplicitAny");
const noImplicitThis = getStrictOptionValue(compilerOptions, "noImplicitThis");
+ const keyofStringsOnly = !!compilerOptions.keyofStringsOnly;
const emitResolver = createResolver();
const nodeBuilder = createNodeBuilder();
@@ -328,6 +325,16 @@ namespace ts {
return diagnostics;
}
},
+
+ runWithCancellationToken: (token, callback) => {
+ try {
+ cancellationToken = token;
+ return callback(checker);
+ }
+ finally {
+ cancellationToken = undefined;
+ }
+ }
};
const tupleTypes: GenericType[] = [];
@@ -360,6 +367,8 @@ namespace ts {
const silentNeverType = createIntrinsicType(TypeFlags.Never, "never");
const implicitNeverType = createIntrinsicType(TypeFlags.Never, "never");
const nonPrimitiveType = createIntrinsicType(TypeFlags.NonPrimitive, "object");
+ const stringNumberSymbolType = getUnionType([stringType, numberType, esSymbolType]);
+ const keyofConstraintType = keyofStringsOnly ? stringType : stringNumberSymbolType;
const emptyObjectType = createAnonymousType(undefined, emptySymbols, emptyArray, emptyArray, undefined, undefined);
@@ -435,6 +444,7 @@ namespace ts {
let deferredGlobalAsyncIterableIteratorType: GenericType;
let deferredGlobalTemplateStringsArrayType: ObjectType;
let deferredGlobalImportMetaType: ObjectType;
+ let deferredGlobalExtractSymbol: Symbol;
let deferredNodes: Node[];
const allPotentiallyUnusedIdentifiers = createMap>(); // key is file name
@@ -1559,7 +1569,8 @@ namespace ts {
function isTypeParameterSymbolDeclaredInContainer(symbol: Symbol, container: Node) {
for (const decl of symbol.declarations) {
- if (decl.kind === SyntaxKind.TypeParameter && decl.parent === container) {
+ const parent = isJSDocTemplateTag(decl.parent) ? getJSDocHost(decl.parent) : decl.parent;
+ if (decl.kind === SyntaxKind.TypeParameter && parent === container) {
return true;
}
}
@@ -1572,7 +1583,7 @@ namespace ts {
return false;
}
- const container = getThisContainer(errorLocation, /*includeArrowFunctions*/ true);
+ const container = getThisContainer(errorLocation, /*includeArrowFunctions*/ false);
let location = container;
while (location) {
if (isClassLike(location.parent)) {
@@ -1845,7 +1856,7 @@ namespace ts {
return valueSymbol;
}
const result = createSymbol(valueSymbol.flags | typeSymbol.flags, valueSymbol.escapedName);
- result.declarations = concatenate(valueSymbol.declarations, typeSymbol.declarations);
+ result.declarations = deduplicate(concatenate(valueSymbol.declarations, typeSymbol.declarations), equateValues);
result.parent = valueSymbol.parent || typeSymbol.parent;
if (valueSymbol.valueDeclaration) result.valueDeclaration = valueSymbol.valueDeclaration;
if (typeSymbol.members) result.members = typeSymbol.members;
@@ -1880,7 +1891,7 @@ namespace ts {
let symbolFromVariable: Symbol;
// First check if module was specified with "export=". If so, get the member from the resolved type
- if (moduleSymbol && moduleSymbol.exports && moduleSymbol.exports.get("export=" as __String)) {
+ if (moduleSymbol && moduleSymbol.exports && moduleSymbol.exports.get(InternalSymbolName.ExportEquals)) {
symbolFromVariable = getPropertyOfType(getTypeOfSymbol(targetSymbol), name.escapedText);
}
else {
@@ -1893,7 +1904,7 @@ namespace ts {
if (!symbolFromModule && allowSyntheticDefaultImports && name.escapedText === InternalSymbolName.Default) {
symbolFromModule = resolveExternalModuleSymbol(moduleSymbol, dontResolveAlias) || resolveSymbol(moduleSymbol, dontResolveAlias);
}
- const symbol = symbolFromModule && symbolFromVariable ?
+ const symbol = symbolFromModule && symbolFromVariable && symbolFromModule !== symbolFromVariable ?
combineValueAndTypeSymbols(symbolFromVariable, symbolFromModule) :
symbolFromModule || symbolFromVariable;
if (!symbol) {
@@ -1926,13 +1937,17 @@ namespace ts {
resolveEntityName(node.propertyName || node.name, meaning, /*ignoreErrors*/ false, dontResolveAlias);
}
- function getTargetOfExportAssignment(node: ExportAssignment, dontResolveAlias: boolean): Symbol | undefined {
- const aliasLike = resolveEntityName(node.expression, SymbolFlags.Value | SymbolFlags.Type | SymbolFlags.Namespace, /*ignoreErrors*/ true, dontResolveAlias);
+ function getTargetOfExportAssignment(node: ExportAssignment | BinaryExpression, dontResolveAlias: boolean): Symbol | undefined {
+ const expression = (isExportAssignment(node) ? node.expression : node.right) as EntityNameExpression | ClassExpression;
+ if (isClassExpression(expression)) {
+ return checkExpression(expression).symbol;
+ }
+ const aliasLike = resolveEntityName(expression, SymbolFlags.Value | SymbolFlags.Type | SymbolFlags.Namespace, /*ignoreErrors*/ true, dontResolveAlias);
if (aliasLike) {
return aliasLike;
}
- checkExpression(node.expression);
- return getNodeLinks(node.expression).resolvedSymbol;
+ checkExpression(expression);
+ return getNodeLinks(expression).resolvedSymbol;
}
function getTargetOfAliasDeclaration(node: Declaration, dontRecursivelyResolve?: boolean): Symbol | undefined {
@@ -1948,7 +1963,8 @@ namespace ts {
case SyntaxKind.ExportSpecifier:
return getTargetOfExportSpecifier(node, SymbolFlags.Value | SymbolFlags.Type | SymbolFlags.Namespace, dontRecursivelyResolve);
case SyntaxKind.ExportAssignment:
- return getTargetOfExportAssignment(node, dontRecursivelyResolve);
+ case SyntaxKind.BinaryExpression:
+ return getTargetOfExportAssignment((node), dontRecursivelyResolve);
case SyntaxKind.NamespaceExportDeclaration:
return getTargetOfNamespaceExportDeclaration(node, dontRecursivelyResolve);
}
@@ -2065,10 +2081,10 @@ namespace ts {
let symbol: Symbol;
if (name.kind === SyntaxKind.Identifier) {
const message = meaning === namespaceMeaning ? Diagnostics.Cannot_find_namespace_0 : Diagnostics.Cannot_find_name_0;
-
- symbol = resolveName(location || name, name.escapedText, meaning, ignoreErrors ? undefined : message, name, /*isUse*/ true);
+ const symbolFromJSPrototype = isInJavaScriptFile(name) ? resolveEntityNameFromJSPrototype(name, meaning) : undefined;
+ symbol = resolveName(location || name, name.escapedText, meaning, ignoreErrors || symbolFromJSPrototype ? undefined : message, name, /*isUse*/ true);
if (!symbol) {
- return undefined;
+ return symbolFromJSPrototype;
}
}
else if (name.kind === SyntaxKind.QualifiedName || name.kind === SyntaxKind.PropertyAccessExpression) {
@@ -2119,6 +2135,26 @@ namespace ts {
return (symbol.flags & meaning) || dontResolveAlias ? symbol : resolveAlias(symbol);
}
+ /**
+ * For prototype-property methods like `A.prototype.m = function () ...`, try to resolve names in the scope of `A` too.
+ * Note that prototype-property assignment to locations outside the current file (eg globals) doesn't work, so
+ * name resolution won't work either.
+ */
+ function resolveEntityNameFromJSPrototype(name: Identifier, meaning: SymbolFlags) {
+ if (isJSDocTypeReference(name.parent) && isJSDocTag(name.parent.parent.parent)) {
+ const host = getJSDocHost(name.parent.parent.parent as JSDocTag);
+ if (isExpressionStatement(host) &&
+ isBinaryExpression(host.expression) &&
+ getSpecialPropertyAssignmentKind(host.expression) === SpecialPropertyAssignmentKind.PrototypeProperty) {
+ const symbol = getSymbolOfNode(host.expression.left);
+ if (symbol) {
+ const secondaryLocation = symbol.parent.valueDeclaration;
+ return resolveName(secondaryLocation, name.escapedText, meaning, /*nameNotFoundMessage*/ undefined, name, /*isUse*/ true);
+ }
+ }
+ }
+ }
+
function resolveExternalModuleName(location: Node, moduleReferenceExpression: Expression): Symbol {
return resolveExternalModuleNameWorker(location, moduleReferenceExpression, Diagnostics.Cannot_find_module_0);
}
@@ -2217,20 +2253,28 @@ namespace ts {
// An external module with an 'export =' declaration resolves to the target of the 'export =' declaration,
// and an external module with no 'export =' declaration resolves to the module itself.
function resolveExternalModuleSymbol(moduleSymbol: Symbol, dontResolveAlias?: boolean): Symbol {
- return moduleSymbol && getMergedSymbol(resolveSymbol(getCommonJsExportEquals(moduleSymbol), dontResolveAlias)) || moduleSymbol;
+ return moduleSymbol && getMergedSymbol(getCommonJsExportEquals(resolveSymbol(moduleSymbol.exports.get(InternalSymbolName.ExportEquals), dontResolveAlias), moduleSymbol)) || moduleSymbol;
}
- function getCommonJsExportEquals(moduleSymbol: Symbol): Symbol {
- const exported = moduleSymbol.exports.get(InternalSymbolName.ExportEquals);
- if (!exported || !exported.exports || moduleSymbol.exports.size === 1) {
+ function getCommonJsExportEquals(exported: Symbol, moduleSymbol: Symbol): Symbol {
+ if (!exported || moduleSymbol.exports.size === 1) {
return exported;
}
const merged = cloneSymbol(exported);
+ if (merged.exports === undefined) {
+ merged.flags = merged.flags | SymbolFlags.ValueModule;
+ merged.exports = createSymbolTable();
+ }
moduleSymbol.exports.forEach((s, name) => {
if (name === InternalSymbolName.ExportEquals) return;
if (!merged.exports.has(name)) {
merged.exports.set(name, s);
}
+ else {
+ const ms = cloneSymbol(merged.exports.get(name));
+ mergeSymbol(ms, s);
+ merged.exports.set(name, ms);
+ }
});
return merged;
}
@@ -2963,6 +3007,9 @@ namespace ts {
}
function typeToTypeNodeHelper(type: Type, context: NodeBuilderContext): TypeNode {
+ if (cancellationToken && cancellationToken.throwIfCancellationRequested) {
+ cancellationToken.throwIfCancellationRequested();
+ }
const inTypeAlias = context.flags & NodeBuilderFlags.InTypeAlias;
context.flags &= ~NodeBuilderFlags.InTypeAlias;
@@ -3851,10 +3898,13 @@ namespace ts {
return "(Anonymous function)";
}
}
- if ((symbol as TransientSymbol).nameType && (symbol as TransientSymbol).nameType.flags & TypeFlags.StringLiteral) {
- const stringValue = ((symbol as TransientSymbol).nameType as StringLiteralType).value;
- if (!isIdentifierText(stringValue, compilerOptions.target)) {
- return `"${escapeString(stringValue, CharacterCodes.doubleQuote)}"`;
+ const nameType = symbol.nameType;
+ if (nameType) {
+ if (nameType.flags & TypeFlags.StringLiteral && !isIdentifierText((nameType).value, compilerOptions.target)) {
+ return `"${escapeString((nameType).value, CharacterCodes.doubleQuote)}"`;
+ }
+ if (nameType && nameType.flags & TypeFlags.UniqueESSymbol) {
+ return `[${getNameOfSymbolAsWritten((nameType).symbol, context)}]`;
}
}
return symbolName(symbol);
@@ -4175,14 +4225,17 @@ namespace ts {
else {
// Use explicitly specified property name ({ p: xxx } form), or otherwise the implied name ({ p } form)
const name = declaration.propertyName || declaration.name;
- if (isComputedNonLiteralName(name)) {
- // computed properties with non-literal names are treated as 'any'
+ const isLate = isLateBindableName(name);
+ const isWellKnown = isComputedPropertyName(name) && isWellKnownSymbolSyntactically(name.expression);
+ if (!isLate && !isWellKnown && isComputedNonLiteralName(name)) {
return anyType;
}
// Use type of the specified property, or otherwise, for a numeric name, the type of the numeric index signature,
// or otherwise the type of the string index signature.
- const text = getTextOfPropertyName(name);
+ const text = isLate ? getLateBoundNameFromType(checkComputedPropertyName(name as ComputedPropertyName) as LiteralType | UniqueESSymbolType) :
+ isWellKnown ? getPropertyNameForKnownSymbolName(idText(((name as ComputedPropertyName).expression as PropertyAccessExpression).name)) :
+ getTextOfPropertyName(name);
// Relax null check on ambient destructuring parameters, since the parameters have no implementation and are just documentation
if (strictNullChecks && declaration.flags & NodeFlags.Ambient && isParameterDeclaration(declaration)) {
@@ -4262,7 +4315,7 @@ namespace ts {
// right hand expression is of a type parameter type.
if (isVariableDeclaration(declaration) && declaration.parent.parent.kind === SyntaxKind.ForInStatement) {
const indexType = getIndexType(checkNonNullExpression(declaration.parent.parent.expression));
- return indexType.flags & (TypeFlags.TypeParameter | TypeFlags.Index) ? indexType : stringType;
+ return indexType.flags & (TypeFlags.TypeParameter | TypeFlags.Index) ? getExtractStringType(indexType) : stringType;
}
if (isVariableDeclaration(declaration) && declaration.parent.parent.kind === SyntaxKind.ForOfStatement) {
@@ -4368,7 +4421,7 @@ namespace ts {
for (const declaration of symbol.declarations) {
let declarationInConstructor = false;
const expression = declaration.kind === SyntaxKind.BinaryExpression ? declaration :
- declaration.kind === SyntaxKind.PropertyAccessExpression ? getAncestor(declaration, SyntaxKind.BinaryExpression) :
+ declaration.kind === SyntaxKind.PropertyAccessExpression ? cast(declaration.parent, isBinaryExpression) :
undefined;
if (!expression) {
@@ -4899,8 +4952,7 @@ namespace ts {
// in-place and returns the same array.
function appendTypeParameters(typeParameters: TypeParameter[], declarations: ReadonlyArray): TypeParameter[] {
for (const declaration of declarations) {
- const tp = getDeclaredTypeOfTypeParameter(getSymbolOfNode(declaration));
- typeParameters = appendIfUnique(typeParameters, tp);
+ typeParameters = appendIfUnique(typeParameters, getDeclaredTypeOfTypeParameter(getSymbolOfNode(declaration)));
}
return typeParameters;
}
@@ -4960,8 +5012,9 @@ namespace ts {
if (node.kind === SyntaxKind.InterfaceDeclaration || node.kind === SyntaxKind.ClassDeclaration ||
node.kind === SyntaxKind.ClassExpression || node.kind === SyntaxKind.TypeAliasDeclaration) {
const declaration = node;
- if (declaration.typeParameters) {
- result = appendTypeParameters(result, declaration.typeParameters);
+ const typeParameters = getEffectiveTypeParameterDeclarations(declaration);
+ if (typeParameters) {
+ result = appendTypeParameters(result, typeParameters);
}
}
}
@@ -5279,6 +5332,16 @@ namespace ts {
return links.declaredType;
}
+ function isStringConcatExpression(expr: Node): boolean {
+ if (expr.kind === SyntaxKind.StringLiteral) {
+ return true;
+ }
+ else if (expr.kind === SyntaxKind.BinaryExpression) {
+ return isStringConcatExpression((expr).left) && isStringConcatExpression((expr).right);
+ }
+ return false;
+ }
+
function isLiteralEnumMember(member: EnumMember) {
const expr = member.initializer;
if (!expr) {
@@ -5293,6 +5356,8 @@ namespace ts {
(expr).operand.kind === SyntaxKind.NumericLiteral;
case SyntaxKind.Identifier:
return nodeIsMissing(expr) || !!getSymbolOfNode(member.parent).exports.get((expr).escapedText);
+ case SyntaxKind.BinaryExpression:
+ return isStringConcatExpression(expr);
default:
return false;
}
@@ -5457,9 +5522,10 @@ namespace ts {
*/
function isThislessFunctionLikeDeclaration(node: FunctionLikeDeclaration): boolean {
const returnType = getEffectiveReturnTypeNode(node);
+ const typeParameters = getEffectiveTypeParameterDeclarations(node);
return (node.kind === SyntaxKind.Constructor || (returnType && isThislessType(returnType))) &&
node.parameters.every(isThislessVariableLikeDeclaration) &&
- (!node.typeParameters || node.typeParameters.every(isThislessTypeParameter));
+ (!typeParameters || typeParameters.every(isThislessTypeParameter));
}
/**
@@ -5653,13 +5719,7 @@ namespace ts {
error(decl.name || decl, Diagnostics.Duplicate_declaration_0, name);
lateSymbol = createSymbol(SymbolFlags.None, memberName, CheckFlags.Late);
}
-
- const symbolLinks = getSymbolLinks(lateSymbol);
- if (!symbolLinks.nameType) {
- // Retain link to name type so that it can be reused later
- symbolLinks.nameType = type;
- }
-
+ lateSymbol.nameType = type;
addDeclarationToLateBoundSymbol(lateSymbol, decl, symbolFlags);
if (lateSymbol.parent) {
Debug.assert(lateSymbol.parent === parent, "Existing symbol parent should match new one");
@@ -6091,6 +6151,7 @@ namespace ts {
const checkFlags = CheckFlags.ReverseMapped | (readonlyMask && isReadonlySymbol(prop) ? CheckFlags.Readonly : 0);
const inferredProp = createSymbol(SymbolFlags.Property | prop.flags & optionalMask, prop.escapedName, checkFlags) as ReverseMappedSymbol;
inferredProp.declarations = prop.declarations;
+ inferredProp.nameType = prop.nameType;
inferredProp.propertyType = getTypeOfSymbol(prop);
inferredProp.mappedType = type.mappedType;
members.set(prop.escapedName, inferredProp);
@@ -6102,6 +6163,7 @@ namespace ts {
function resolveMappedTypeMembers(type: MappedType) {
const members: SymbolTable = createSymbolTable();
let stringIndexInfo: IndexInfo;
+ let numberIndexInfo: IndexInfo;
// Resolve upfront such that recursive references see an empty object type.
setStructuredTypeMembers(type, emptySymbols, emptyArray, emptyArray, undefined, undefined);
// In { [P in K]: T }, we refer to P as the type parameter type, K as the constraint type,
@@ -6112,15 +6174,19 @@ namespace ts {
const modifiersType = getApparentType(getModifiersTypeFromMappedType(type)); // The 'T' in 'keyof T'
const templateModifiers = getMappedTypeModifiers(type);
const constraintDeclaration = type.declaration.typeParameter.constraint;
+ const include = keyofStringsOnly ? TypeFlags.StringLiteral : TypeFlags.StringOrNumberLiteralOrUnique;
if (constraintDeclaration.kind === SyntaxKind.TypeOperator &&
(constraintDeclaration).operator === SyntaxKind.KeyOfKeyword) {
// We have a { [P in keyof T]: X }
- for (const propertySymbol of getPropertiesOfType(modifiersType)) {
- addMemberForKeyType(getLiteralTypeFromPropertyName(propertySymbol), propertySymbol);
+ for (const prop of getPropertiesOfType(modifiersType)) {
+ addMemberForKeyType(getLiteralTypeFromPropertyName(prop, include), /*_index*/ undefined, prop);
}
if (modifiersType.flags & TypeFlags.Any || getIndexInfoOfType(modifiersType, IndexKind.String)) {
addMemberForKeyType(stringType);
}
+ if (!keyofStringsOnly && getIndexInfoOfType(modifiersType, IndexKind.Number)) {
+ addMemberForKeyType(numberType);
+ }
}
else {
// First, if the constraint type is a type parameter, obtain the base constraint. Then,
@@ -6130,16 +6196,9 @@ namespace ts {
const iterationType = keyType.flags & TypeFlags.Index ? getIndexType(getApparentType((keyType).type)) : keyType;
forEachType(iterationType, addMemberForKeyType);
}
- setStructuredTypeMembers(type, members, emptyArray, emptyArray, stringIndexInfo, undefined);
+ setStructuredTypeMembers(type, members, emptyArray, emptyArray, stringIndexInfo, numberIndexInfo);
- function addMemberForKeyType(t: Type, propertySymbolOrIndex?: Symbol | number) {
- let propertySymbol: Symbol;
- // forEachType delegates to forEach, which calls with a numeric second argument
- // the type system currently doesn't catch this incompatibility, so we annotate
- // the function ourselves to indicate the runtime behavior and deal with it here
- if (typeof propertySymbolOrIndex === "object") {
- propertySymbol = propertySymbolOrIndex;
- }
+ function addMemberForKeyType(t: Type, _index?: number, origin?: Symbol) {
// Create a mapper from T to the current iteration type constituent. Then, if the
// mapped type is itself an instantiated type, combine the iteration mapper with the
// instantiation mapper.
@@ -6147,8 +6206,8 @@ namespace ts {
const propType = instantiateType(templateType, templateMapper);
// If the current iteration type constituent is a string literal type, create a property.
// Otherwise, for type string create a string index signature.
- if (t.flags & TypeFlags.StringLiteral) {
- const propName = getLateBoundNameFromType(t as LiteralType | UniqueESSymbolType);
+ if (t.flags & TypeFlags.StringOrNumberLiteralOrUnique) {
+ const propName = getLateBoundNameFromType(t as LiteralType);
const modifiersProp = getPropertyOfType(modifiersType, propName);
const isOptional = !!(templateModifiers & MappedTypeModifiers.IncludeOptional ||
!(templateModifiers & MappedTypeModifiers.ExcludeOptional) && modifiersProp && modifiersProp.flags & SymbolFlags.Optional);
@@ -6161,9 +6220,9 @@ namespace ts {
prop.type = strictNullChecks && isOptional && !isTypeAssignableTo(undefinedType, propType) ? getOptionalType(propType) :
strictNullChecks && !isOptional && modifiersProp && modifiersProp.flags & SymbolFlags.Optional ? getTypeWithFacts(propType, TypeFacts.NEUndefined) :
propType;
- if (propertySymbol) {
- prop.syntheticOrigin = propertySymbol;
- prop.declarations = propertySymbol.declarations;
+ if (origin) {
+ prop.syntheticOrigin = origin;
+ prop.declarations = origin.declarations;
}
prop.nameType = t;
members.set(propName, prop);
@@ -6171,6 +6230,9 @@ namespace ts {
else if (t.flags & (TypeFlags.Any | TypeFlags.String)) {
stringIndexInfo = createIndexInfo(propType, !!(templateModifiers & MappedTypeModifiers.IncludeReadonly));
}
+ else if (t.flags & TypeFlags.Number) {
+ numberIndexInfo = createIndexInfo(propType, !!(templateModifiers & MappedTypeModifiers.IncludeReadonly));
+ }
}
}
@@ -6350,18 +6412,10 @@ namespace ts {
}
function getConstraintOfIndexedAccess(type: IndexedAccessType) {
- const transformed = getSimplifiedIndexedAccessType(type);
- if (transformed) {
- return transformed;
- }
- const baseObjectType = getBaseConstraintOfType(type.objectType);
- const baseIndexType = getBaseConstraintOfType(type.indexType);
- if (baseIndexType === stringType && !getIndexInfoOfType(baseObjectType || type.objectType, IndexKind.String)) {
- // getIndexedAccessType returns `any` for X[string] where X doesn't have an index signature.
- // to avoid this, return `undefined`.
- return undefined;
- }
- return baseObjectType || baseIndexType ? getIndexedAccessType(baseObjectType || type.objectType, baseIndexType || type.indexType) : undefined;
+ const objectType = getBaseConstraintOfType(type.objectType) || type.objectType;
+ const indexType = getBaseConstraintOfType(type.indexType) || type.indexType;
+ const constraint = !isGenericObjectType(objectType) && !isGenericIndexType(indexType) ? getIndexedAccessType(objectType, indexType) : undefined;
+ return constraint && constraint !== unknownType ? constraint : undefined;
}
function getDefaultConstraintOfConditionalType(type: ConditionalType) {
@@ -6408,7 +6462,7 @@ namespace ts {
function getBaseConstraintOfType(type: Type): Type {
const constraint = getBaseConstraintOfInstantiableNonPrimitiveUnionOrIntersection(type);
if (!constraint && type.flags & TypeFlags.Index) {
- return stringType;
+ return keyofConstraintType;
}
return constraint;
}
@@ -6443,7 +6497,7 @@ namespace ts {
circular = true;
return undefined;
}
- const result = computeBaseConstraint(t);
+ const result = computeBaseConstraint(getSimplifiedType(t));
if (!popTypeResolution()) {
circular = true;
return undefined;
@@ -6472,13 +6526,9 @@ namespace ts {
undefined;
}
if (t.flags & TypeFlags.Index) {
- return stringType;
+ return keyofConstraintType;
}
if (t.flags & TypeFlags.IndexedAccess) {
- const transformed = getSimplifiedIndexedAccessType(t);
- if (transformed) {
- return getBaseConstraint(transformed);
- }
const baseObjectType = getBaseConstraint((t).objectType);
const baseIndexType = getBaseConstraint((t).indexType);
const baseIndexedAccess = baseObjectType && baseIndexType ? getIndexedAccessType(baseObjectType, baseIndexType) : undefined;
@@ -6562,6 +6612,7 @@ namespace ts {
t.flags & TypeFlags.BooleanLike ? globalBooleanType :
t.flags & TypeFlags.ESSymbolLike ? getGlobalESSymbolType(/*reportErrors*/ languageVersion >= ScriptTarget.ES2015) :
t.flags & TypeFlags.NonPrimitive ? emptyObjectType :
+ t.flags & TypeFlags.Index ? keyofConstraintType :
t;
}
@@ -6601,25 +6652,30 @@ namespace ts {
if (props.length === 1 && !(checkFlags & CheckFlags.Partial)) {
return props[0];
}
- const propTypes: Type[] = [];
- const declarations: Declaration[] = [];
+ let declarations: Declaration[];
let commonType: Type;
+ let nameType: Type;
+ const propTypes: Type[] = [];
+ let first = true;
for (const prop of props) {
- if (prop.declarations) {
- addRange(declarations, prop.declarations);
- }
+ declarations = addRange(declarations, prop.declarations);
const type = getTypeOfSymbol(prop);
- if (!commonType) {
+ if (first) {
commonType = type;
+ nameType = prop.nameType;
+ first = false;
}
- else if (type !== commonType) {
- checkFlags |= CheckFlags.HasNonUniformType;
+ else {
+ if (type !== commonType) {
+ checkFlags |= CheckFlags.HasNonUniformType;
+ }
}
propTypes.push(type);
}
const result = createSymbol(SymbolFlags.Property | commonFlags, name, syntheticFlag | checkFlags);
result.containingType = containingType;
result.declarations = declarations;
+ result.nameType = nameType;
result.type = isUnion ? getUnionType(propTypes) : getIntersectionType(propTypes);
return result;
}
@@ -6737,8 +6793,7 @@ namespace ts {
function getTypeParametersFromDeclaration(declaration: DeclarationWithTypeParameters): TypeParameter[] {
let result: TypeParameter[];
forEach(getEffectiveTypeParameterDeclarations(declaration), node => {
- const tp = getDeclaredTypeOfTypeParameter(node.symbol);
- result = appendIfUnique(result, tp);
+ result = appendIfUnique(result, getDeclaredTypeOfTypeParameter(node.symbol));
});
return result;
}
@@ -7242,7 +7297,8 @@ namespace ts {
}
function getConstraintDeclaration(type: TypeParameter) {
- return type.symbol && getDeclarationOfKind(type.symbol, SyntaxKind.TypeParameter).constraint;
+ const decl = type.symbol && getDeclarationOfKind(type.symbol, SyntaxKind.TypeParameter);
+ return decl && decl.constraint;
}
function getInferredTypeParameterConstraint(typeParameter: TypeParameter) {
@@ -7549,7 +7605,7 @@ namespace ts {
return constraints ? getSubstitutionType(typeVariable, getIntersectionType(append(constraints, typeVariable))) : typeVariable;
}
- function isJSDocTypeReference(node: NodeWithTypeArguments): node is TypeReferenceNode {
+ function isJSDocTypeReference(node: Node): node is TypeReferenceNode {
return node.flags & NodeFlags.JSDoc && node.kind === SyntaxKind.TypeReference;
}
@@ -7762,6 +7818,10 @@ namespace ts {
return symbol && getTypeOfGlobalSymbol(symbol, arity);
}
+ function getGlobalExtractSymbol(): Symbol {
+ return deferredGlobalExtractSymbol || (deferredGlobalExtractSymbol = getGlobalSymbol("Extract" as __String, SymbolFlags.TypeAlias, Diagnostics.Cannot_find_global_type_0));
+ }
+
/**
* Instantiates a global type that is generic with some element type, and returns that instantiation.
*/
@@ -8196,53 +8256,67 @@ namespace ts {
return links.resolvedType;
}
- function getIndexTypeForGenericType(type: InstantiableType | UnionOrIntersectionType, includeDeclaredTypes?: boolean) {
- const cacheLocation = includeDeclaredTypes ? "resolvedDeclaredIndexType" : "resolvedIndexType";
- if (!type[cacheLocation]) {
- type[cacheLocation] = createType(TypeFlags.Index);
- type[cacheLocation].type = type;
- if (includeDeclaredTypes) {
- type[cacheLocation].isDeclaredType = true;
- }
- }
- return type[cacheLocation];
+ function createIndexType(type: InstantiableType | UnionOrIntersectionType, stringsOnly: boolean) {
+ const result = createType(TypeFlags.Index);
+ result.type = type;
+ result.stringsOnly = stringsOnly;
+ return result;
}
- function getLiteralTypeFromPropertyName(prop: Symbol) {
- const links = getSymbolLinks(getLateBoundSymbol(prop));
- if (!links.nameType) {
- if (links.target && links.target !== unknownSymbol && links.target !== resolvingSymbol && links.target.escapedName === prop.escapedName) {
- links.nameType = getLiteralTypeFromPropertyName(links.target);
- }
- else {
- links.nameType = getDeclarationModifierFlagsFromSymbol(prop) & ModifierFlags.NonPublicAccessibilityModifier || isKnownSymbol(prop) ?
- neverType :
+ function getIndexTypeForGenericType(type: InstantiableType | UnionOrIntersectionType, stringsOnly: boolean) {
+ return stringsOnly ?
+ type.resolvedStringIndexType || (type.resolvedStringIndexType = createIndexType(type, /*stringsOnly*/ true)) :
+ type.resolvedIndexType || (type.resolvedIndexType = createIndexType(type, /*stringsOnly*/ false));
+ }
+
+ function getLiteralTypeFromPropertyName(prop: Symbol, include: TypeFlags) {
+ if (!(getDeclarationModifierFlagsFromSymbol(prop) & ModifierFlags.NonPublicAccessibilityModifier)) {
+ let type = getLateBoundSymbol(prop).nameType;
+ if (!type && !isKnownSymbol(prop)) {
+ const name = getNameOfDeclaration(prop.valueDeclaration);
+ type = name && isNumericLiteral(name) ? getLiteralType(+name.text) :
+ name && name.kind === SyntaxKind.ComputedPropertyName && isNumericLiteral(name.expression) ? getLiteralType(+name.expression.text) :
getLiteralType(symbolName(prop));
}
+ if (type && type.flags & include) {
+ return type;
+ }
}
- return links.nameType;
+ return neverType;
}
- function isTypeString(type: Type) {
- return isTypeAssignableToKind(type, TypeFlags.StringLike);
+ function getLiteralTypeFromPropertyNames(type: Type, include: TypeFlags) {
+ return getUnionType(map(getPropertiesOfType(type), t => getLiteralTypeFromPropertyName(t, include)));
}
- function getLiteralTypeFromPropertyNames(type: Type, includeDeclaredTypes?: boolean) {
- const originalKeys = map(getPropertiesOfType(type), getLiteralTypeFromPropertyName);
- return getUnionType(includeDeclaredTypes ? originalKeys : filter(originalKeys, isTypeString));
+ function getNonEnumNumberIndexInfo(type: Type) {
+ const numberIndexInfo = getIndexInfoOfType(type, IndexKind.Number);
+ return numberIndexInfo !== enumNumberIndexInfo ? numberIndexInfo : undefined;
}
- function getIndexType(type: Type, includeDeclaredTypes?: boolean): Type {
- return type.flags & TypeFlags.Intersection ? getUnionType(map((type).types, t => getIndexType(t, includeDeclaredTypes))) :
- maybeTypeOfKind(type, TypeFlags.InstantiableNonPrimitive) ? getIndexTypeForGenericType(type, includeDeclaredTypes) :
+ function getIndexType(type: Type, stringsOnly = keyofStringsOnly): Type {
+ return type.flags & TypeFlags.Union ? getIntersectionType(map((type).types, t => getIndexType(t, stringsOnly))) :
+ type.flags & TypeFlags.Intersection ? getUnionType(map((type).types, t => getIndexType(t, stringsOnly))) :
+ maybeTypeOfKind(type, TypeFlags.InstantiableNonPrimitive) ? getIndexTypeForGenericType(type, stringsOnly) :
getObjectFlags(type) & ObjectFlags.Mapped ? getConstraintTypeFromMappedType(type) :
type === wildcardType ? wildcardType :
- type.flags & TypeFlags.Any || getIndexInfoOfType(type, IndexKind.String) ? stringType :
- getLiteralTypeFromPropertyNames(type, includeDeclaredTypes);
+ type.flags & TypeFlags.Any ? keyofConstraintType :
+ stringsOnly ? getIndexInfoOfType(type, IndexKind.String) ? stringType : getLiteralTypeFromPropertyNames(type, TypeFlags.StringLiteral) :
+ getIndexInfoOfType(type, IndexKind.String) ? getUnionType([stringType, numberType, getLiteralTypeFromPropertyNames(type, TypeFlags.UniqueESSymbol)]) :
+ getNonEnumNumberIndexInfo(type) ? getUnionType([numberType, getLiteralTypeFromPropertyNames(type, TypeFlags.StringLiteral | TypeFlags.UniqueESSymbol)]) :
+ getLiteralTypeFromPropertyNames(type, TypeFlags.StringOrNumberLiteralOrUnique);
+ }
+
+ function getExtractStringType(type: Type) {
+ if (keyofStringsOnly) {
+ return type;
+ }
+ const extractTypeAlias = getGlobalExtractSymbol();
+ return extractTypeAlias ? getTypeAliasInstantiation(extractTypeAlias, [type, stringType]) : stringType;
}
function getIndexTypeOrString(type: Type): Type {
- const indexType = getIndexType(type);
+ const indexType = getExtractStringType(getIndexType(type));
return indexType.flags & TypeFlags.Never ? stringType : indexType;
}
@@ -8300,7 +8374,11 @@ namespace ts {
getIndexInfoOfType(objectType, IndexKind.String) ||
undefined;
if (indexInfo) {
- if (accessExpression && indexInfo.isReadonly && (isAssignmentTarget(accessExpression) || isDeleteTarget(accessExpression))) {
+ if (accessNode && !isTypeAssignableToKind(indexType, TypeFlags.String | TypeFlags.Number)) {
+ const indexNode = accessNode.kind === SyntaxKind.ElementAccessExpression ? accessNode.argumentExpression : accessNode.indexType;
+ error(indexNode, Diagnostics.Type_0_cannot_be_used_as_an_index_type, typeToString(indexType));
+ }
+ else if (accessExpression && indexInfo.isReadonly && (isAssignmentTarget(accessExpression) || isDeleteTarget(accessExpression))) {
error(accessExpression, Diagnostics.Index_signature_in_type_0_only_permits_reading, typeToString(objectType));
}
return indexInfo.type;
@@ -8331,9 +8409,8 @@ namespace ts {
else {
error(indexNode, Diagnostics.Type_0_cannot_be_used_as_an_index_type, typeToString(indexType));
}
- return unknownType;
}
- return anyType;
+ return unknownType;
}
function isGenericObjectType(type: Type): boolean {
@@ -8360,8 +8437,12 @@ namespace ts {
return getObjectFlags(type) & ObjectFlags.Mapped && getTemplateTypeFromMappedType(type as MappedType) === neverType;
}
+ function getSimplifiedType(type: Type): Type {
+ return type.flags & TypeFlags.IndexedAccess ? getSimplifiedIndexedAccessType(type) : type;
+ }
+
// Transform an indexed access to a simpler form, if possible. Return the simpler form, or return
- // undefined if no transformation is possible.
+ // the type itself if no transformation is possible.
function getSimplifiedIndexedAccessType(type: IndexedAccessType): Type {
const objectType = type.objectType;
if (objectType.flags & TypeFlags.Intersection && isGenericObjectType(objectType)) {
@@ -8381,7 +8462,7 @@ namespace ts {
}
}
return getUnionType([
- getIndexedAccessType(getIntersectionType(regularTypes), type.indexType),
+ getSimplifiedType(getIndexedAccessType(getIntersectionType(regularTypes), type.indexType)),
getIntersectionType(stringIndexTypes)
]);
}
@@ -8391,13 +8472,13 @@ namespace ts {
// eventually anyway, but it easier to reason about.
if (some((objectType).types, isMappedTypeToNever)) {
const nonNeverTypes = filter((objectType).types, t => !isMappedTypeToNever(t));
- return getIndexedAccessType(getIntersectionType(nonNeverTypes), type.indexType);
+ return getSimplifiedType(getIndexedAccessType(getIntersectionType(nonNeverTypes), type.indexType));
}
}
-
// If the object type is a mapped type { [P in K]: E }, where K is generic, instantiate E using a mapper
// that substitutes the index type for P. For example, for an index access { [P in K]: Box }[X], we
- // construct the type Box.
+ // construct the type Box. We do not further simplify the result because mapped types can be recursive
+ // and we might never terminate.
if (isGenericMappedType(objectType)) {
return substituteIndexedMappedType(objectType, type);
}
@@ -8407,7 +8488,7 @@ namespace ts {
return substituteIndexedMappedType(constraint, type);
}
}
- return undefined;
+ return type;
}
function substituteIndexedMappedType(objectType: MappedType, type: IndexedAccessType) {
@@ -8740,7 +8821,7 @@ namespace ts {
if (right.flags & TypeFlags.Union) {
return mapType(right, t => getSpreadType(left, t, symbol, typeFlags, objectFlags));
}
- if (right.flags & (TypeFlags.BooleanLike | TypeFlags.NumberLike | TypeFlags.StringLike | TypeFlags.EnumLike | TypeFlags.NonPrimitive)) {
+ if (right.flags & (TypeFlags.BooleanLike | TypeFlags.NumberLike | TypeFlags.StringLike | TypeFlags.EnumLike | TypeFlags.NonPrimitive | TypeFlags.Index)) {
return left;
}
@@ -8786,6 +8867,7 @@ namespace ts {
result.leftSpread = leftProp;
result.rightSpread = rightProp;
result.declarations = declarations;
+ result.nameType = leftProp.nameType;
members.set(leftProp.escapedName, result);
}
}
@@ -8814,6 +8896,7 @@ namespace ts {
const result = createSymbol(flags, prop.escapedName);
result.type = getTypeOfSymbol(prop);
result.declarations = prop.declarations;
+ result.nameType = prop.nameType;
result.syntheticOrigin = prop;
return result;
}
@@ -9159,8 +9242,13 @@ namespace ts {
if (symbol.valueDeclaration) {
result.valueDeclaration = symbol.valueDeclaration;
}
- if ((symbol as TransientSymbol).isRestParameter) {
- result.isRestParameter = (symbol as TransientSymbol).isRestParameter;
+ if (symbol.nameType) {
+ result.nameType = symbol.nameType;
+ }
+ if (isTransientSymbol(symbol)) {
+ if (symbol.isRestParameter) {
+ result.isRestParameter = symbol.isRestParameter;
+ }
}
return result;
}
@@ -9176,10 +9264,15 @@ namespace ts {
// aren't the right hand side of a generic type alias declaration we optimize by reducing the
// set of type parameters to those that are possibly referenced in the literal.
const declaration = symbol.declarations[0];
- const outerTypeParameters = getOuterTypeParameters(declaration, /*includeThisTypes*/ true) || emptyArray;
+ let outerTypeParameters = getOuterTypeParameters(declaration, /*includeThisTypes*/ true);
+ if (isJavaScriptConstructor(declaration)) {
+ const templateTagParameters = getTypeParametersFromDeclaration(declaration as DeclarationWithTypeParameters);
+ outerTypeParameters = addRange(outerTypeParameters, templateTagParameters);
+ }
+ typeParameters = outerTypeParameters || emptyArray;
typeParameters = symbol.flags & SymbolFlags.TypeLiteral && !target.aliasTypeArguments ?
- filter(outerTypeParameters, tp => isTypeParameterPossiblyReferenced(tp, declaration)) :
- outerTypeParameters;
+ filter(typeParameters, tp => isTypeParameterPossiblyReferenced(tp, declaration)) :
+ typeParameters;
links.outerTypeParameters = typeParameters;
if (typeParameters.length) {
links.instantiations = createMap();
@@ -9961,6 +10054,12 @@ namespace ts {
if (target.flags & TypeFlags.Substitution) {
target = (target).typeVariable;
}
+ if (source.flags & TypeFlags.IndexedAccess) {
+ source = getSimplifiedType(source);
+ }
+ if (target.flags & TypeFlags.IndexedAccess) {
+ target = getSimplifiedType(target);
+ }
// both types are the same - covers 'they are the same primitive type or both are Any' or the same type parameter cases
if (source === target) return Ternary.True;
@@ -10414,15 +10513,15 @@ namespace ts {
// constraint of T.
const constraint = getConstraintForRelation((target).type);
if (constraint) {
- if (result = isRelatedTo(source, getIndexType(constraint, (target as IndexType).isDeclaredType), reportErrors)) {
+ if (result = isRelatedTo(source, getIndexType(constraint, (target as IndexType).stringsOnly), reportErrors)) {
return result;
}
}
}
else if (target.flags & TypeFlags.IndexedAccess) {
- // A type S is related to a type T[K] if S is related to A[K], where K is string-like and
- // A is the apparent type of T.
- const constraint = getConstraintForRelation(target);
+ // A type S is related to a type T[K] if S is related to C, where C is the
+ // constraint of T[K]
+ const constraint = getConstraintForRelation(target);
if (constraint) {
if (result = isRelatedTo(source, constraint, reportErrors)) {
errorInfo = saveErrorInfo;
@@ -10435,21 +10534,21 @@ namespace ts {
const template = getTemplateTypeFromMappedType(target);
const modifiers = getMappedTypeModifiers(target);
if (!(modifiers & MappedTypeModifiers.ExcludeOptional)) {
- if (template.flags & TypeFlags.IndexedAccess && (template).objectType === source &&
- (template).indexType === getTypeParameterFromMappedType(target)) {
- return Ternary.True;
- }
- // A source type T is related to a target type { [P in keyof T]: X } if T[P] is related to X.
- if (!isGenericMappedType(source) && getConstraintTypeFromMappedType(target) === getIndexType(source)) {
- const indexedAccessType = getIndexedAccessType(source, getTypeParameterFromMappedType(target));
- const templateType = getTemplateTypeFromMappedType(target);
- if (result = isRelatedTo(indexedAccessType, templateType, reportErrors)) {
- errorInfo = saveErrorInfo;
- return result;
+ if (template.flags & TypeFlags.IndexedAccess && (template).objectType === source &&
+ (template).indexType === getTypeParameterFromMappedType(target)) {
+ return Ternary.True;
+ }
+ // A source type T is related to a target type { [P in keyof T]: X } if T[P] is related to X.
+ if (!isGenericMappedType(source) && getConstraintTypeFromMappedType(target) === getIndexType(source)) {
+ const indexedAccessType = getIndexedAccessType(source, getTypeParameterFromMappedType(target));
+ const templateType = getTemplateTypeFromMappedType(target);
+ if (result = isRelatedTo(indexedAccessType, templateType, reportErrors)) {
+ errorInfo = saveErrorInfo;
+ return result;
+ }
}
}
}
- }
if (source.flags & TypeFlags.TypeParameter) {
let constraint = getConstraintForRelation(source);
@@ -10467,16 +10566,8 @@ namespace ts {
}
}
else if (source.flags & TypeFlags.IndexedAccess) {
- // A type S[K] is related to a type T if A[K] is related to T, where K is string-like and
- // A is the apparent type of S.
- const constraint = getConstraintForRelation(source);
- if (constraint) {
- if (result = isRelatedTo(constraint, target, reportErrors)) {
- errorInfo = saveErrorInfo;
- return result;
- }
- }
- else if (target.flags & TypeFlags.IndexedAccess) {
+ if (target.flags & TypeFlags.IndexedAccess) {
+ // A type S[K] is related to a type T[J] if S is related to T and K is related to J.
if (result = isRelatedTo((source).objectType, (target).objectType, reportErrors)) {
result &= isRelatedTo((source).indexType, (target).indexType, reportErrors);
}
@@ -10485,6 +10576,21 @@ namespace ts {
return result;
}
}
+ // A type S[K] is related to a type T if C is related to T, where C is the
+ // constraint of S[K].
+ const constraint = getConstraintForRelation(source);
+ if (constraint) {
+ if (result = isRelatedTo(constraint, target, reportErrors)) {
+ errorInfo = saveErrorInfo;
+ return result;
+ }
+ }
+ }
+ else if (source.flags & TypeFlags.Index) {
+ if (result = isRelatedTo(keyofConstraintType, target, reportErrors)) {
+ errorInfo = saveErrorInfo;
+ return result;
+ }
}
else if (source.flags & TypeFlags.Conditional) {
if (target.flags & TypeFlags.Conditional) {
@@ -10877,8 +10983,7 @@ namespace ts {
continue;
}
// Skip over symbol-named members
- const nameType = getLiteralTypeFromPropertyName(prop);
- if (nameType !== undefined && !(isRelatedTo(nameType, stringType) || isRelatedTo(nameType, numberType))) {
+ if (prop.nameType && prop.nameType.flags & TypeFlags.UniqueESSymbol) {
continue;
}
if (kind === IndexKind.String || isNumericLiteralName(prop.escapedName)) {
@@ -11481,6 +11586,9 @@ namespace ts {
if (source.valueDeclaration) {
symbol.valueDeclaration = source.valueDeclaration;
}
+ if (source.nameType) {
+ symbol.nameType = source.nameType;
+ }
return symbol;
}
@@ -11523,7 +11631,7 @@ namespace ts {
}
function createWideningContext(parent: WideningContext, propertyName: __String, siblings: Type[]): WideningContext {
- return { parent, propertyName, siblings, resolvedPropertyNames: undefined };
+ return { parent, propertyName, siblings, resolvedProperties: undefined };
}
function getSiblingsOfContext(context: WideningContext): Type[] {
@@ -11544,19 +11652,19 @@ namespace ts {
return context.siblings;
}
- function getPropertyNamesOfContext(context: WideningContext): __String[] {
- if (!context.resolvedPropertyNames) {
- const names = createMap() as UnderscoreEscapedMap;
+ function getPropertiesOfContext(context: WideningContext): Symbol[] {
+ if (!context.resolvedProperties) {
+ const names = createMap() as UnderscoreEscapedMap;
for (const t of getSiblingsOfContext(context)) {
if (isObjectLiteralType(t) && !(getObjectFlags(t) & ObjectFlags.ContainsSpread)) {
for (const prop of getPropertiesOfType(t)) {
- names.set(prop.escapedName, true);
+ names.set(prop.escapedName, prop);
}
}
}
- context.resolvedPropertyNames = arrayFrom(names.keys());
+ context.resolvedProperties = arrayFrom(names.values());
}
- return context.resolvedPropertyNames;
+ return context.resolvedProperties;
}
function getWidenedProperty(prop: Symbol, context: WideningContext): Symbol {
@@ -11566,18 +11674,14 @@ namespace ts {
return widened === original ? prop : createSymbolWithType(prop, widened);
}
- function getUndefinedProperty(name: __String) {
- const cached = undefinedProperties.get(name);
+ function getUndefinedProperty(prop: Symbol) {
+ const cached = undefinedProperties.get(prop.escapedName);
if (cached) {
return cached;
}
- const result = createSymbol(SymbolFlags.Property | SymbolFlags.Optional, name);
- result.type = undefinedType;
- const associatedKeyType = getLiteralType(unescapeLeadingUnderscores(name));
- if (associatedKeyType.flags & TypeFlags.StringLiteral) {
- result.nameType = associatedKeyType;
- }
- undefinedProperties.set(name, result);
+ const result = createSymbolWithType(prop, undefinedType);
+ result.flags |= SymbolFlags.Optional;
+ undefinedProperties.set(prop.escapedName, result);
return result;
}
@@ -11589,9 +11693,9 @@ namespace ts {
members.set(prop.escapedName, prop.flags & SymbolFlags.Property ? getWidenedProperty(prop, context) : prop);
}
if (context) {
- for (const name of getPropertyNamesOfContext(context)) {
- if (!members.has(name)) {
- members.set(name, getUndefinedProperty(name));
+ for (const prop of getPropertiesOfContext(context)) {
+ if (!members.has(prop.escapedName)) {
+ members.set(prop.escapedName, getUndefinedProperty(prop));
}
}
}
@@ -12348,14 +12452,13 @@ namespace ts {
inferredType = getTypeFromInference(inference);
}
- inferredType = getWidenedUniqueESSymbolType(inferredType);
inference.inferredType = inferredType;
const constraint = getConstraintOfTypeParameter(inference.typeParameter);
if (constraint) {
const instantiatedConstraint = instantiateType(constraint, context);
if (!context.compareTypes(inferredType, getTypeWithThisArgument(instantiatedConstraint, inferredType))) {
- inference.inferredType = inferredType = getWidenedUniqueESSymbolType(instantiatedConstraint);
+ inference.inferredType = inferredType = instantiatedConstraint;
}
}
}
@@ -13884,7 +13987,8 @@ namespace ts {
const assignmentKind = getAssignmentTargetKind(node);
if (assignmentKind) {
- if (!(localOrExportSymbol.flags & SymbolFlags.Variable)) {
+ if (!(localOrExportSymbol.flags & SymbolFlags.Variable) &&
+ !(isInJavaScriptFile(node) && localOrExportSymbol.flags & SymbolFlags.ValueModule)) {
error(node, Diagnostics.Cannot_assign_to_0_because_it_is_not_a_variable, symbolToString(symbol));
return unknownType;
}
@@ -15298,7 +15402,7 @@ namespace ts {
// type, and any union of these types (like string | number).
if (links.resolvedType.flags & TypeFlags.Nullable ||
!isTypeAssignableToKind(links.resolvedType, TypeFlags.StringLike | TypeFlags.NumberLike | TypeFlags.ESSymbolLike) &&
- !isTypeAssignableTo(links.resolvedType, getUnionType([stringType, numberType, esSymbolType]))) {
+ !isTypeAssignableTo(links.resolvedType, stringNumberSymbolType)) {
error(node, Diagnostics.A_computed_property_name_must_be_of_type_string_number_symbol_or_any);
}
else {
@@ -15339,6 +15443,7 @@ namespace ts {
let patternWithComputedProperties = false;
let hasComputedStringProperty = false;
let hasComputedNumberProperty = false;
+
if (isInJSFile && node.properties.length === 0) {
// an empty JS object literal that nonetheless has members is a JS namespace
const symbol = getSymbolOfNode(node);
@@ -15354,47 +15459,28 @@ namespace ts {
for (let i = 0; i < node.properties.length; i++) {
const memberDecl = node.properties[i];
let member = getSymbolOfNode(memberDecl);
- let literalName: __String | undefined;
+ const computedNameType = memberDecl.name && memberDecl.name.kind === SyntaxKind.ComputedPropertyName && !isWellKnownSymbolSyntactically(memberDecl.name.expression) ?
+ checkComputedPropertyName(memberDecl.name) : undefined;
if (memberDecl.kind === SyntaxKind.PropertyAssignment ||
memberDecl.kind === SyntaxKind.ShorthandPropertyAssignment ||
isObjectLiteralMethod(memberDecl)) {
- let jsdocType: Type;
+ let type = memberDecl.kind === SyntaxKind.PropertyAssignment ? checkPropertyAssignment(memberDecl, checkMode) :
+ memberDecl.kind === SyntaxKind.ShorthandPropertyAssignment ? checkExpressionForMutableLocation(memberDecl.name, checkMode) :
+ checkObjectLiteralMethod(memberDecl, checkMode);
if (isInJSFile) {
- jsdocType = getTypeForDeclarationFromJSDocComment(memberDecl);
- }
-
- let type: Type;
- if (memberDecl.kind === SyntaxKind.PropertyAssignment) {
- if (memberDecl.name.kind === SyntaxKind.ComputedPropertyName) {
- const t = checkComputedPropertyName(memberDecl.name);
- if (t.flags & TypeFlags.Literal) {
- literalName = escapeLeadingUnderscores("" + (t as LiteralType).value);
- }
+ const jsDocType = getTypeForDeclarationFromJSDocComment(memberDecl);
+ if (jsDocType) {
+ checkTypeAssignableTo(type, jsDocType, memberDecl);
+ type = jsDocType;
}
- type = checkPropertyAssignment(memberDecl, checkMode);
}
- else if (memberDecl.kind === SyntaxKind.MethodDeclaration) {
- type = checkObjectLiteralMethod(memberDecl, checkMode);
- }
- else {
- Debug.assert(memberDecl.kind === SyntaxKind.ShorthandPropertyAssignment);
- type = checkExpressionForMutableLocation(memberDecl.name, checkMode);
- }
-
- if (jsdocType) {
- checkTypeAssignableTo(type, jsdocType, memberDecl);
- type = jsdocType;
- }
-
typeFlags |= type.flags;
-
- const nameType = hasLateBindableName(memberDecl) ? checkComputedPropertyName(memberDecl.name) : undefined;
- const hasLateBoundName = nameType && isTypeUsableAsLateBoundName(nameType);
- const prop = hasLateBoundName
- ? createSymbol(SymbolFlags.Property | member.flags, getLateBoundNameFromType(nameType as LiteralType | UniqueESSymbolType), CheckFlags.Late)
- : createSymbol(SymbolFlags.Property | member.flags, literalName || member.escapedName);
-
- if (hasLateBoundName) {
+ const nameType = computedNameType && computedNameType.flags & TypeFlags.StringOrNumberLiteralOrUnique ?
+ computedNameType : undefined;
+ const prop = nameType ?
+ createSymbol(SymbolFlags.Property | member.flags, getLateBoundNameFromType(nameType), CheckFlags.Late) :
+ createSymbol(SymbolFlags.Property | member.flags, member.escapedName);
+ if (nameType) {
prop.nameType = nameType;
}
@@ -15407,9 +15493,6 @@ namespace ts {
if (isOptional) {
prop.flags |= SymbolFlags.Optional;
}
- if (!literalName && hasDynamicName(memberDecl)) {
- patternWithComputedProperties = true;
- }
}
else if (contextualTypeHasPattern && !(getObjectFlags(contextualType) & ObjectFlags.ObjectLiteralPatternWithComputedProperties)) {
// If object literal is contextually typed by the implied type of a binding pattern, and if the
@@ -15465,12 +15548,17 @@ namespace ts {
checkNodeDeferred(memberDecl);
}
- if (!literalName && hasNonBindableDynamicName(memberDecl)) {
- if (isNumericName(memberDecl.name)) {
- hasComputedNumberProperty = true;
- }
- else {
- hasComputedStringProperty = true;
+ if (computedNameType && !(computedNameType.flags & TypeFlags.StringOrNumberLiteralOrUnique)) {
+ if (isTypeAssignableTo(computedNameType, stringNumberSymbolType)) {
+ if (isTypeAssignableTo(computedNameType, numberType)) {
+ hasComputedNumberProperty = true;
+ }
+ else {
+ hasComputedStringProperty = true;
+ }
+ if (inDestructuringPattern) {
+ patternWithComputedProperties = true;
+ }
}
}
else {
@@ -17754,11 +17842,11 @@ namespace ts {
let typeArguments: NodeArray;
- if (!isTaggedTemplate && !isDecorator && !isJsxOpeningOrSelfClosingElement) {
+ if (!isDecorator && !isJsxOpeningOrSelfClosingElement) {
typeArguments = (node).typeArguments;
// We already perform checking on the type arguments on the class declaration itself.
- if ((node).expression.kind !== SyntaxKind.SuperKeyword) {
+ if (isTaggedTemplate || (node).expression.kind !== SyntaxKind.SuperKeyword) {
forEach(typeArguments, checkSourceElement);
}
}
@@ -17871,7 +17959,7 @@ namespace ts {
checkApplicableSignature(node, args, candidateForArgumentError, assignableRelation, /*excludeArgument*/ undefined, /*reportErrors*/ true);
}
else if (candidateForTypeArgumentError) {
- checkTypeArguments(candidateForTypeArgumentError, (node as CallExpression).typeArguments, /*reportErrors*/ true, fallbackError);
+ checkTypeArguments(candidateForTypeArgumentError, (node as CallExpression | TaggedTemplateExpression).typeArguments, /*reportErrors*/ true, fallbackError);
}
else if (typeArguments && every(signatures, sig => length(sig.typeParameters) !== typeArguments.length)) {
diagnostics.add(getTypeArgumentArityError(node, signatures, typeArguments));
@@ -18538,7 +18626,7 @@ namespace ts {
}
const type = funcSymbol && getJavaScriptClassType(funcSymbol);
if (type) {
- return type;
+ return signature.target ? instantiateType(type, signature.mapper) : type;
}
if (noImplicitAny) {
error(node, Diagnostics.new_expression_whose_target_lacks_a_construct_signature_implicitly_has_an_any_type);
@@ -18665,6 +18753,7 @@ namespace ts {
}
function checkTaggedTemplateExpression(node: TaggedTemplateExpression): Type {
+ checkGrammarTypeArguments(node, node.typeArguments);
if (languageVersion < ScriptTarget.ES2015) {
checkExternalEmitHelpers(node, ExternalEmitHelpers.MakeTemplateObject);
}
@@ -19116,6 +19205,9 @@ namespace ts {
const links = getNodeLinks(node);
const type = getTypeOfSymbol(node.symbol);
+ if (isTypeAny(type)) {
+ return type;
+ }
// Check if function expression is contextually typed and assign parameter types if so.
if (!(links.flags & NodeCheckFlags.ContextChecked)) {
@@ -19878,8 +19970,9 @@ namespace ts {
// VarExpr = ValueExpr
// requires VarExpr to be classified as a reference
// A compound assignment furthermore requires VarExpr to be classified as a reference (section 4.1)
- // and the type of the non - compound operation to be assignable to the type of VarExpr.
- if (checkReferenceExpression(left, Diagnostics.The_left_hand_side_of_an_assignment_expression_must_be_a_variable_or_a_property_access)) {
+ // and the type of the non-compound operation to be assignable to the type of VarExpr.
+ if (checkReferenceExpression(left, Diagnostics.The_left_hand_side_of_an_assignment_expression_must_be_a_variable_or_a_property_access)
+ && (!isIdentifier(left) || unescapeLeadingUnderscores(left.escapedText) !== "exports")) {
// to avoid cascading errors check assignability only if 'isReference' check succeeded and no errors were reported
checkTypeAssignableTo(valueType, leftType, left, /*headMessage*/ undefined);
}
@@ -20048,6 +20141,15 @@ namespace ts {
return widened;
}
+ function isTypeParameterWithKeyofConstraint(type: Type) {
+ if (type.flags & TypeFlags.TypeParameter) {
+ const constraintDeclaration = getConstraintDeclaration(type);
+ return constraintDeclaration && constraintDeclaration.kind === SyntaxKind.TypeOperator &&
+ (constraintDeclaration).operator === SyntaxKind.KeyOfKeyword;
+ }
+ return false;
+ }
+
function isLiteralOfContextualType(candidateType: Type, contextualType: Type): boolean {
if (contextualType) {
if (contextualType.flags & TypeFlags.UnionOrIntersection) {
@@ -20059,7 +20161,8 @@ namespace ts {
// this a literal context for literals of that primitive type. For example, given a
// type parameter 'T extends string', infer string literal types for T.
const constraint = getBaseConstraintOfType(contextualType) || emptyObjectType;
- return constraint.flags & TypeFlags.String && maybeTypeOfKind(candidateType, TypeFlags.StringLiteral) ||
+ return isTypeParameterWithKeyofConstraint(contextualType) && maybeTypeOfKind(candidateType, TypeFlags.StringLiteral | TypeFlags.NumberLiteral | TypeFlags.UniqueESSymbol) ||
+ constraint.flags & TypeFlags.String && maybeTypeOfKind(candidateType, TypeFlags.StringLiteral) ||
constraint.flags & TypeFlags.Number && maybeTypeOfKind(candidateType, TypeFlags.NumberLiteral) ||
constraint.flags & TypeFlags.Boolean && maybeTypeOfKind(candidateType, TypeFlags.BooleanLiteral) ||
constraint.flags & TypeFlags.ESSymbol && maybeTypeOfKind(candidateType, TypeFlags.UniqueESSymbol) ||
@@ -20988,7 +21091,7 @@ namespace ts {
// Check if the index type is assignable to 'keyof T' for the object type.
const objectType = (type).objectType;
const indexType = (type).indexType;
- if (isTypeAssignableTo(indexType, getIndexType(objectType, /*includeDeclaredTypes*/ true))) {
+ if (isTypeAssignableTo(indexType, getIndexType(objectType, /*stringsOnly*/ false))) {
if (accessNode.kind === SyntaxKind.ElementAccessExpression && isAssignmentTarget(accessNode) &&
getObjectFlags(objectType) & ObjectFlags.Mapped && getMappedTypeModifiers(objectType) & MappedTypeModifiers.IncludeReadonly) {
error(accessNode, Diagnostics.Index_signature_in_type_0_only_permits_reading, typeToString(objectType));
@@ -21020,7 +21123,7 @@ namespace ts {
const type = getTypeFromMappedTypeNode(node);
const constraintType = getConstraintTypeFromMappedType(type);
- checkTypeAssignableTo(constraintType, stringType, node.typeParameter.constraint);
+ checkTypeAssignableTo(constraintType, keyofConstraintType, node.typeParameter.constraint);
}
function checkTypeOperator(node: TypeOperatorNode) {
@@ -21887,6 +21990,11 @@ namespace ts {
// If the node had `@property` tags, `typeExpression` would have been set to the first property tag.
error(node.name, Diagnostics.JSDoc_typedef_tag_should_either_have_a_type_annotation_or_be_followed_by_property_or_member_tags);
}
+
+ if (node.name) {
+ checkTypeNameIsReserved(node.name, Diagnostics.Type_alias_name_cannot_be_0);
+ }
+ checkSourceElement(node.typeExpression);
}
function checkJSDocParameterTag(node: JSDocParameterTag) {
@@ -21897,6 +22005,10 @@ namespace ts {
// and give a better error message when the host function mentions `arguments`
// but the tag doesn't have an array type
if (decl) {
+ const i = getJSDocTags(decl).filter(isJSDocParameterTag).indexOf(node);
+ if (i > -1 && i < decl.parameters.length && isBindingPattern(decl.parameters[i].name)) {
+ return;
+ }
if (!containsArgumentsReference(decl)) {
error(node.name,
Diagnostics.JSDoc_param_tag_has_name_0_but_there_is_no_parameter_with_that_name,
@@ -22120,7 +22232,8 @@ namespace ts {
}
if (!isRemovedPropertyFromObjectSpread(node.kind === SyntaxKind.Identifier ? node.parent : node)) {
- addDiagnostic(UnusedKind.Local, createDiagnosticForNodeSpan(getSourceFileOfNode(declaration), declaration, node, Diagnostics._0_is_declared_but_its_value_is_never_read, name));
+ const message = isTypeDeclaration(declaration) ? Diagnostics._0_is_declared_but_never_used : Diagnostics._0_is_declared_but_its_value_is_never_read;
+ addDiagnostic(UnusedKind.Local, createDiagnosticForNodeSpan(getSourceFileOfNode(declaration), declaration, node, message, name));
}
}
@@ -22173,8 +22286,9 @@ namespace ts {
): void {
// Only report errors on the last declaration for the type parameter container;
// this ensures that all uses have been accounted for.
- if (!(node.flags & NodeFlags.Ambient) && node.typeParameters && last(getSymbolOfNode(node)!.declarations) === node) {
- for (const typeParameter of node.typeParameters) {
+ const typeParameters = getEffectiveTypeParameterDeclarations(node);
+ if (!(node.flags & NodeFlags.Ambient) && typeParameters && last(getSymbolOfNode(node)!.declarations) === node) {
+ for (const typeParameter of typeParameters) {
if (!(getMergedSymbol(typeParameter.symbol).isReferenced & SymbolFlags.TypeParameter) && !isIdentifierThatStartsWithUnderScore(typeParameter.name)) {
addDiagnostic(UnusedKind.Parameter, createDiagnosticForNode(typeParameter.name, Diagnostics._0_is_declared_but_its_value_is_never_read, symbolName(typeParameter.symbol)));
}
@@ -23548,20 +23662,21 @@ namespace ts {
}
}
- function areTypeParametersIdentical(declarations: ReadonlyArray, typeParameters: TypeParameter[]) {
- const maxTypeArgumentCount = length(typeParameters);
- const minTypeArgumentCount = getMinTypeArgumentCount(typeParameters);
+ function areTypeParametersIdentical(declarations: ReadonlyArray, targetParameters: TypeParameter[]) {
+ const maxTypeArgumentCount = length(targetParameters);
+ const minTypeArgumentCount = getMinTypeArgumentCount(targetParameters);
for (const declaration of declarations) {
// If this declaration has too few or too many type parameters, we report an error
- const numTypeParameters = length(declaration.typeParameters);
+ const sourceParameters = getEffectiveTypeParameterDeclarations(declaration);
+ const numTypeParameters = length(sourceParameters);
if (numTypeParameters < minTypeArgumentCount || numTypeParameters > maxTypeArgumentCount) {
return false;
}
for (let i = 0; i < numTypeParameters; i++) {
- const source = declaration.typeParameters[i];
- const target = typeParameters[i];
+ const source = sourceParameters[i];
+ const target = targetParameters[i];
// If the type parameter node does not have the same as the resolved type
// parameter at this position, we report an error.
@@ -23622,7 +23737,7 @@ namespace ts {
checkCollisionWithRequireExportsInGeneratedCode(node, node.name);
checkCollisionWithGlobalPromiseInGeneratedCode(node, node.name);
}
- checkTypeParameters(node.typeParameters);
+ checkTypeParameters(getEffectiveTypeParameterDeclarations(node));
checkExportsOnMergedDeclarations(node);
const symbol = getSymbolOfNode(node);
const type = getDeclaredTypeOfSymbol(symbol);
@@ -24082,6 +24197,9 @@ namespace ts {
case SyntaxKind.AsteriskAsteriskToken: return left ** right;
}
}
+ else if (typeof left === "string" && typeof right === "string" && (expr).operatorToken.kind === SyntaxKind.PlusToken) {
+ return left + right;
+ }
break;
case SyntaxKind.StringLiteral:
return (expr).text;
@@ -24483,7 +24601,10 @@ namespace ts {
checkImportBinding(importClause.namedBindings);
}
else {
- forEach(importClause.namedBindings.elements, checkImportBinding);
+ const moduleExisted = resolveExternalModuleName(node, node.moduleSpecifier);
+ if (moduleExisted) {
+ forEach(importClause.namedBindings.elements, checkImportBinding);
+ }
}
}
}
@@ -24780,6 +24901,7 @@ namespace ts {
case SyntaxKind.JSDocNullableType:
case SyntaxKind.JSDocAllType:
case SyntaxKind.JSDocUnknownType:
+ case SyntaxKind.JSDocTypeLiteral:
checkJSDocTypeIsInJsFile(node);
forEachChild(node, checkSourceElement);
return;
@@ -26854,7 +26976,7 @@ namespace ts {
function checkGrammarClassLikeDeclaration(node: ClassLikeDeclaration): boolean {
const file = getSourceFileOfNode(node);
- return checkGrammarClassDeclarationHeritageClauses(node) || checkGrammarTypeParameterList(node.typeParameters, file);
+ return checkGrammarClassDeclarationHeritageClauses(node) || checkGrammarTypeParameterList(getEffectiveTypeParameterDeclarations(node), file);
}
function checkGrammarArrowFunction(node: Node, file: SourceFile): boolean {
diff --git a/src/compiler/commandLineParser.ts b/src/compiler/commandLineParser.ts
index f386c701dd7..126c1529094 100644
--- a/src/compiler/commandLineParser.ts
+++ b/src/compiler/commandLineParser.ts
@@ -1,9 +1,3 @@
-///
-///
-///
-///
-///
-
namespace ts {
/* @internal */
export const compileOnSaveCommandLineOption: CommandLineOption = { name: "compileOnSave", type: "boolean" };
@@ -678,6 +672,12 @@ namespace ts {
category: Diagnostics.Advanced_Options,
description: Diagnostics.Disable_strict_checking_of_generic_signatures_in_function_types,
},
+ {
+ name: "keyofStringsOnly",
+ type: "boolean",
+ category: Diagnostics.Advanced_Options,
+ description: Diagnostics.Resolve_keyof_to_string_valued_property_names_only_no_numbers_or_symbols,
+ },
{
// A list of plugins to load in the language service
name: "plugins",
diff --git a/src/compiler/comments.ts b/src/compiler/comments.ts
index f26a66701e4..de629cccfe1 100644
--- a/src/compiler/comments.ts
+++ b/src/compiler/comments.ts
@@ -1,5 +1,3 @@
-///
-
/* @internal */
namespace ts {
export interface CommentWriter {
diff --git a/src/compiler/core.ts b/src/compiler/core.ts
index 2d3b2a2a0ce..f0220fb8c93 100644
--- a/src/compiler/core.ts
+++ b/src/compiler/core.ts
@@ -1,6 +1,3 @@
-///
-///
-
namespace ts {
// WARNING: The script `configureNightly.ts` uses a regexp to parse out these values.
// If changing the text in this section, be sure to test `configureNightly` too.
@@ -1268,10 +1265,7 @@ namespace ts {
});
}
- export function assign, T2, T3>(t: T1, arg1: T2, arg2: T3): T1 & T2 & T3;
- export function assign, T2>(t: T1, arg1: T2): T1 & T2;
- export function assign>(t: T1, ...args: any[]): any;
- export function assign>(t: T1, ...args: any[]) {
+ export function assign(t: T, ...args: T[]) {
for (const arg of args) {
for (const p in arg) {
if (hasProperty(arg, p)) {
@@ -1317,12 +1311,13 @@ namespace ts {
* the same key with the given 'makeKey' function, then the element with the higher
* index in the array will be the one associated with the produced key.
*/
- export function arrayToMap(array: ReadonlyArray, makeKey: (value: T) => string): Map;
- export function arrayToMap(array: ReadonlyArray, makeKey: (value: T) => string, makeValue: (value: T) => U): Map;
- export function arrayToMap(array: ReadonlyArray, makeKey: (value: T) => string, makeValue: (value: T) => T | U = identity): Map {
+ export function arrayToMap(array: ReadonlyArray, makeKey: (value: T) => string | undefined): Map;
+ export function arrayToMap(array: ReadonlyArray, makeKey: (value: T) => string | undefined, makeValue: (value: T) => U): Map;
+ export function arrayToMap(array: ReadonlyArray, makeKey: (value: T) => string | undefined, makeValue: (value: T) => T | U = identity): Map {
const result = createMap();
for (const value of array) {
- result.set(makeKey(value), makeValue(value));
+ const key = makeKey(value);
+ if (key !== undefined) result.set(key, makeValue(value));
}
return result;
}
@@ -1343,8 +1338,9 @@ namespace ts {
* @param array the array of input elements.
*/
export function arrayToSet(array: ReadonlyArray): Map;
- export function arrayToSet(array: ReadonlyArray, makeKey: (value: T) => string): Map;
- export function arrayToSet(array: ReadonlyArray, makeKey?: (value: any) => string): Map {
+ export function arrayToSet(array: ReadonlyArray, makeKey: (value: T) => string | undefined): Map;
+ export function arrayToSet(array: ReadonlyArray, makeKey: (value: T) => __String | undefined): UnderscoreEscapedMap;
+ export function arrayToSet(array: ReadonlyArray, makeKey?: (value: any) => string | __String | undefined): Map | UnderscoreEscapedMap {
return arrayToMap(array, makeKey || (s => s), () => true);
}
@@ -1606,7 +1602,7 @@ namespace ts {
messageText: text,
category: message.category,
code: message.code,
- reportsUnnecessary: message.unused,
+ reportsUnnecessary: message.reportsUnnecessary,
};
}
@@ -1637,7 +1633,7 @@ namespace ts {
messageText: text,
category: message.category,
code: message.code,
- reportsUnnecessary: message.unused,
+ reportsUnnecessary: message.reportsUnnecessary,
};
}
@@ -1727,6 +1723,10 @@ namespace ts {
return compareComparableValues(a, b);
}
+ export function min(a: T, b: T, compare: Comparer): T {
+ return compare(a, b) === Comparison.LessThan ? a : b;
+ }
+
/**
* Compare two strings using a case-insensitive ordinal comparison.
*
@@ -2212,6 +2212,15 @@ namespace ts {
return absolutePath;
}
+ export function getRelativePath(path: string, directoryPath: string, getCanonicalFileName: GetCanonicalFileName) {
+ const relativePath = getRelativePathToDirectoryOrUrl(directoryPath, path, directoryPath, getCanonicalFileName, /*isAbsolutePathAnUrl*/ false);
+ return ensurePathIsRelative(relativePath);
+ }
+
+ export function ensurePathIsRelative(path: string): string {
+ return !pathIsRelative(path) ? "./" + path : path;
+ }
+
export function getBaseFileName(path: string) {
if (path === undefined) {
return undefined;
@@ -2987,18 +2996,19 @@ namespace ts {
}
/** Remove the *first* occurrence of `item` from the array. */
- export function unorderedRemoveItem(array: T[], item: T): void {
- unorderedRemoveFirstItemWhere(array, element => element === item);
+ export function unorderedRemoveItem(array: T[], item: T) {
+ return unorderedRemoveFirstItemWhere(array, element => element === item);
}
/** Remove the *first* element satisfying `predicate`. */
- function unorderedRemoveFirstItemWhere(array: T[], predicate: (element: T) => boolean): void {
+ function unorderedRemoveFirstItemWhere(array: T[], predicate: (element: T) => boolean) {
for (let i = 0; i < array.length; i++) {
if (predicate(array[i])) {
unorderedRemoveItemAt(array, i);
- break;
+ return true;
}
}
+ return false;
}
export type GetCanonicalFileName = (fileName: string) => string;
@@ -3122,8 +3132,8 @@ namespace ts {
return (arg: T) => f(arg) && g(arg);
}
- export function or(f: (arg: T) => boolean, g: (arg: T) => boolean) {
- return (arg: T) => f(arg) || g(arg);
+ export function or(f: (arg: T) => boolean, g: (arg: T) => boolean): (arg: T) => boolean {
+ return arg => f(arg) || g(arg);
}
export function assertTypeIsNever(_: never): void { } // tslint:disable-line no-empty
diff --git a/src/compiler/diagnosticMessages.json b/src/compiler/diagnosticMessages.json
index b91165ea17b..46695ab2d75 100644
--- a/src/compiler/diagnosticMessages.json
+++ b/src/compiler/diagnosticMessages.json
@@ -23,6 +23,10 @@
"category": "Error",
"code": 1010
},
+ "An element access expression should take an argument.": {
+ "category": "Error",
+ "code": 1011
+ },
"Unexpected token.": {
"category": "Error",
"code": 1012
@@ -2947,10 +2951,6 @@
"category": "Message",
"code": 6040
},
- "Compilation complete. Watching for file changes.": {
- "category": "Message",
- "code": 6042
- },
"Generates corresponding '.map' file.": {
"category": "Message",
"code": 6043
@@ -3290,7 +3290,7 @@
"'{0}' is declared but its value is never read.": {
"category": "Error",
"code": 6133,
- "unused": true
+ "reportsUnnecessary": true
},
"Report errors on unused locals.": {
"category": "Message",
@@ -3311,7 +3311,7 @@
"Property '{0}' is declared but its value is never read.": {
"category": "Error",
"code": 6138,
- "unused": true
+ "reportsUnnecessary": true
},
"Import emit helpers from 'tslib'.": {
"category": "Message",
@@ -3524,16 +3524,25 @@
"All imports in import declaration are unused.": {
"category": "Error",
"code": 6192,
- "unused": true
+ "reportsUnnecessary": true
},
- "Found 1 error.": {
+ "Found 1 error. Watching for file changes.": {
"category": "Message",
"code": 6193
},
- "Found {0} errors.": {
+ "Found {0} errors. Watching for file changes.": {
"category": "Message",
"code": 6194
},
+ "Resolve 'keyof' to string valued property names only (no numbers or symbols).": {
+ "category": "Message",
+ "code": 6195
+ },
+ "'{0}' is declared but never used.": {
+ "category": "Error",
+ "code": 6196,
+ "reportsUnnecessary": true
+ },
"Variable '{0}' implicitly has an '{1}' type.": {
"category": "Error",
"code": 7005
@@ -3613,7 +3622,7 @@
"Unused label.": {
"category": "Error",
"code": 7028,
- "unused": true
+ "reportsUnnecessary": true
},
"Fallthrough case in switch.": {
"category": "Error",
@@ -3922,7 +3931,7 @@
"category": "Message",
"code": 90007
},
- "Add 'this.' to unresolved variable": {
+ "Add '{0}.' to unresolved variable": {
"category": "Message",
"code": 90008
},
@@ -4130,7 +4139,7 @@
"category": "Message",
"code": 95036
},
- "Add 'this.' to all unresolved variables matching a member name": {
+ "Add qualifier to all unresolved variables matching a member name": {
"category": "Message",
"code": 95037
},
@@ -4165,5 +4174,9 @@
"Convert all constructor functions to classes": {
"category": "Message",
"code": 95045
+ },
+ "Generate 'get' and 'set' accessors": {
+ "category": "Message",
+ "code": 95046
}
}
diff --git a/src/compiler/emitter.ts b/src/compiler/emitter.ts
index 4bd055b1618..53d4e56c301 100644
--- a/src/compiler/emitter.ts
+++ b/src/compiler/emitter.ts
@@ -1,8 +1,3 @@
-///
-///
-///
-///
-
namespace ts {
const brackets = createBracketsMap();
@@ -1446,9 +1441,9 @@ namespace ts {
function emitElementAccessExpression(node: ElementAccessExpression) {
emitExpression(node.expression);
- const openPos = emitTokenWithComment(SyntaxKind.OpenBracketToken, node.expression.end, writePunctuation, node);
+ emitTokenWithComment(SyntaxKind.OpenBracketToken, node.expression.end, writePunctuation, node);
emitExpression(node.argumentExpression);
- emitTokenWithComment(SyntaxKind.CloseBracketToken, node.argumentExpression ? node.argumentExpression.end : openPos, writePunctuation, node);
+ emitTokenWithComment(SyntaxKind.CloseBracketToken, node.argumentExpression.end, writePunctuation, node);
}
function emitCallExpression(node: CallExpression) {
@@ -1467,6 +1462,7 @@ namespace ts {
function emitTaggedTemplateExpression(node: TaggedTemplateExpression) {
emitExpression(node.tag);
+ emitTypeArguments(node, node.typeArguments);
writeSpace();
emitExpression(node.template);
}
diff --git a/src/compiler/factory.ts b/src/compiler/factory.ts
index 82e4782f848..e3191930c0e 100644
--- a/src/compiler/factory.ts
+++ b/src/compiler/factory.ts
@@ -1,6 +1,3 @@
-///
-///
-
namespace ts {
function createSynthesizedNode(kind: SyntaxKind): Node {
const node = createNode(kind, -1, -1);
@@ -1035,17 +1032,32 @@ namespace ts {
: node;
}
- export function createTaggedTemplate(tag: Expression, template: TemplateLiteral) {
+ export function createTaggedTemplate(tag: Expression, template: TemplateLiteral): TaggedTemplateExpression;
+ export function createTaggedTemplate(tag: Expression, typeArguments: ReadonlyArray, template: TemplateLiteral): TaggedTemplateExpression;
+ /** @internal */
+ export function createTaggedTemplate(tag: Expression, typeArgumentsOrTemplate: ReadonlyArray | TemplateLiteral, template?: TemplateLiteral): TaggedTemplateExpression;
+ export function createTaggedTemplate(tag: Expression, typeArgumentsOrTemplate: ReadonlyArray | TemplateLiteral, template?: TemplateLiteral) {
const node = createSynthesizedNode(SyntaxKind.TaggedTemplateExpression);
node.tag = parenthesizeForAccess(tag);
- node.template = template;
+ if (template) {
+ node.typeArguments = asNodeArray(typeArgumentsOrTemplate as ReadonlyArray);
+ node.template = template!;
+ }
+ else {
+ node.typeArguments = undefined;
+ node.template = typeArgumentsOrTemplate as TemplateLiteral;
+ }
return node;
}
- export function updateTaggedTemplate(node: TaggedTemplateExpression, tag: Expression, template: TemplateLiteral) {
+ export function updateTaggedTemplate(node: TaggedTemplateExpression, tag: Expression, template: TemplateLiteral): TaggedTemplateExpression;
+ export function updateTaggedTemplate(node: TaggedTemplateExpression, tag: Expression, typeArguments: ReadonlyArray, template: TemplateLiteral): TaggedTemplateExpression;
+ export function updateTaggedTemplate(node: TaggedTemplateExpression, tag: Expression, typeArgumentsOrTemplate: ReadonlyArray | TemplateLiteral, template?: TemplateLiteral) {
return node.tag !== tag
- || node.template !== template
- ? updateNode(createTaggedTemplate(tag, template), node)
+ || (template
+ ? node.typeArguments !== typeArgumentsOrTemplate || node.template !== template
+ : node.typeArguments !== undefined || node.template !== typeArgumentsOrTemplate)
+ ? updateNode(createTaggedTemplate(tag, typeArgumentsOrTemplate, template), node)
: node;
}
diff --git a/src/compiler/moduleNameResolver.ts b/src/compiler/moduleNameResolver.ts
index d66ab5eb524..81aed522490 100644
--- a/src/compiler/moduleNameResolver.ts
+++ b/src/compiler/moduleNameResolver.ts
@@ -1,6 +1,3 @@
-///
-///
-
namespace ts {
/* @internal */
export function trace(host: ModuleResolutionHost, message: DiagnosticMessage, ...args: any[]): void;
@@ -447,6 +444,12 @@ namespace ts {
}
}
+ export function resolveModuleNameFromCache(moduleName: string, containingFile: string, cache: ModuleResolutionCache): ResolvedModuleWithFailedLookupLocations | undefined {
+ const containingDirectory = getDirectoryPath(containingFile);
+ const perFolderCache = cache && cache.getOrCreateCacheForDirectory(containingDirectory);
+ return perFolderCache && perFolderCache.get(moduleName);
+ }
+
export function resolveModuleName(moduleName: string, containingFile: string, compilerOptions: CompilerOptions, host: ModuleResolutionHost, cache?: ModuleResolutionCache): ResolvedModuleWithFailedLookupLocations {
const traceEnabled = isTraceEnabled(compilerOptions, host);
if (traceEnabled) {
diff --git a/src/compiler/parser.ts b/src/compiler/parser.ts
index d61a57ce5ae..12e498787c8 100644
--- a/src/compiler/parser.ts
+++ b/src/compiler/parser.ts
@@ -1,6 +1,3 @@
-///
-///
-
namespace ts {
const enum SignatureFlags {
None = 0,
@@ -226,6 +223,7 @@ namespace ts {
visitNodes(cbNode, cbNodes, (node).arguments);
case SyntaxKind.TaggedTemplateExpression:
return visitNode(cbNode, (node).tag) ||
+ visitNodes(cbNode, cbNodes, (node).typeArguments) ||
visitNode(cbNode, (node).template);
case SyntaxKind.TypeAssertionExpression:
return visitNode(cbNode, (node).type) ||
@@ -1242,7 +1240,7 @@ namespace ts {
if (reportAtCurrentPosition) {
parseErrorAtPosition(scanner.getStartPos(), 0, diagnosticMessage, arg0);
}
- else {
+ else if (diagnosticMessage) {
parseErrorAtCurrentToken(diagnosticMessage, arg0);
}
@@ -4381,14 +4379,15 @@ namespace ts {
const indexedAccess = createNode(SyntaxKind.ElementAccessExpression, expression.pos);
indexedAccess.expression = expression;
- // It's not uncommon for a user to write: "new Type[]".
- // Check for that common pattern and report a better error message.
- if (token() !== SyntaxKind.CloseBracketToken) {
- indexedAccess.argumentExpression = allowInAnd(parseExpression);
- if (indexedAccess.argumentExpression.kind === SyntaxKind.StringLiteral || indexedAccess.argumentExpression.kind === SyntaxKind.NumericLiteral) {
- const literal = indexedAccess.argumentExpression;
- literal.text = internIdentifier(literal.text);
+ if (token() === SyntaxKind.CloseBracketToken) {
+ indexedAccess.argumentExpression = createMissingNode(SyntaxKind.Identifier, /*reportAtCurrentPosition*/ true, Diagnostics.An_element_access_expression_should_take_an_argument);
+ }
+ else {
+ const argument = allowInAnd(parseExpression);
+ if (isStringOrNumericLiteral(argument)) {
+ argument.text = internIdentifier(argument.text);
}
+ indexedAccess.argumentExpression = argument;
}
parseExpected(SyntaxKind.CloseBracketToken);
@@ -4396,13 +4395,8 @@ namespace ts {
continue;
}
- if (token() === SyntaxKind.NoSubstitutionTemplateLiteral || token() === SyntaxKind.TemplateHead) {
- const tagExpression = createNode(SyntaxKind.TaggedTemplateExpression, expression.pos);
- tagExpression.tag = expression;
- tagExpression.template = token() === SyntaxKind.NoSubstitutionTemplateLiteral
- ? parseLiteralNode()
- : parseTemplateExpression();
- expression = finishNode(tagExpression);
+ if (isTemplateStartOfTaggedTemplate()) {
+ expression = parseTaggedTemplateRest(expression, /*typeArguments*/ undefined);
continue;
}
@@ -4410,6 +4404,20 @@ namespace ts {
}
}
+ function isTemplateStartOfTaggedTemplate() {
+ return token() === SyntaxKind.NoSubstitutionTemplateLiteral || token() === SyntaxKind.TemplateHead;
+ }
+
+ function parseTaggedTemplateRest(tag: LeftHandSideExpression, typeArguments: NodeArray | undefined) {
+ const tagExpression = createNode(SyntaxKind.TaggedTemplateExpression, tag.pos);
+ tagExpression.tag = tag;
+ tagExpression.typeArguments = typeArguments;
+ tagExpression.template = token() === SyntaxKind.NoSubstitutionTemplateLiteral
+ ? parseLiteralNode()
+ : parseTemplateExpression();
+ return finishNode(tagExpression);
+ }
+
function parseCallExpressionRest(expression: LeftHandSideExpression): LeftHandSideExpression {
while (true) {
expression = parseMemberExpressionRest(expression);
@@ -4423,6 +4431,11 @@ namespace ts {
return expression;
}
+ if (isTemplateStartOfTaggedTemplate()) {
+ expression = parseTaggedTemplateRest(expression, typeArguments);
+ continue;
+ }
+
const callExpr = createNode(SyntaxKind.CallExpression, expression.pos);
callExpr.expression = expression;
callExpr.typeArguments = typeArguments;
@@ -4470,8 +4483,10 @@ namespace ts {
function canFollowTypeArgumentsInExpression(): boolean {
switch (token()) {
case SyntaxKind.OpenParenToken: // foo(
- // this case are the only case where this token can legally follow a type argument
- // list. So we definitely want to treat this as a type arg list.
+ case SyntaxKind.NoSubstitutionTemplateLiteral: // foo `...`
+ case SyntaxKind.TemplateHead: // foo `...${100}...`
+ // these are the only tokens can legally follow a type argument
+ // list. So we definitely want to treat them as type arg lists.
case SyntaxKind.DotToken: // foo.
case SyntaxKind.CloseParenToken: // foo)
@@ -4700,9 +4715,23 @@ namespace ts {
return finishNode(node);
}
+ let expression: MemberExpression = parsePrimaryExpression();
+ let typeArguments;
+ while (true) {
+ expression = parseMemberExpressionRest(expression);
+ typeArguments = tryParse(parseTypeArgumentsInExpression);
+ if (isTemplateStartOfTaggedTemplate()) {
+ Debug.assert(!!typeArguments,
+ "Expected a type argument list; all plain tagged template starts should be consumed in 'parseMemberExpressionRest'");
+ expression = parseTaggedTemplateRest(expression, typeArguments);
+ typeArguments = undefined;
+ }
+ break;
+ }
+
const node = createNode(SyntaxKind.NewExpression, fullStart);
- node.expression = parseMemberExpressionOrHigher();
- node.typeArguments = tryParse(parseTypeArgumentsInExpression);
+ node.expression = expression;
+ node.typeArguments = typeArguments;
if (node.typeArguments || token() === SyntaxKind.OpenParenToken) {
node.arguments = parseArgumentList();
}
@@ -7649,7 +7678,7 @@ namespace ts {
const tripleSlashXMLCommentStartRegEx = /^\/\/\/\s*<(\S+)\s.*?\/>/im;
const singleLinePragmaRegEx = /^\/\/\/?\s*@(\S+)\s*(.*)\s*$/im;
function extractPragmas(pragmas: PragmaPsuedoMapEntry[], range: CommentRange, text: string) {
- const tripleSlash = tripleSlashXMLCommentStartRegEx.exec(text);
+ const tripleSlash = range.kind === SyntaxKind.SingleLineCommentTrivia && tripleSlashXMLCommentStartRegEx.exec(text);
if (tripleSlash) {
const name = tripleSlash[1].toLowerCase() as keyof PragmaPsuedoMap; // Technically unsafe cast, but we do it so the below check to make it safe typechecks
const pragma = commentPragmas[name] as PragmaDefinition;
@@ -7686,15 +7715,17 @@ namespace ts {
return;
}
- const singleLine = singleLinePragmaRegEx.exec(text);
+ const singleLine = range.kind === SyntaxKind.SingleLineCommentTrivia && singleLinePragmaRegEx.exec(text);
if (singleLine) {
return addPragmaForMatch(pragmas, range, PragmaKindFlags.SingleLine, singleLine);
}
- const multiLinePragmaRegEx = /\s*@(\S+)\s*(.*)\s*$/gim; // Defined inline since it uses the "g" flag, which keeps a persistent index (for iterating)
- let multiLineMatch: RegExpExecArray;
- while (multiLineMatch = multiLinePragmaRegEx.exec(text)) {
- addPragmaForMatch(pragmas, range, PragmaKindFlags.MultiLine, multiLineMatch);
+ if (range.kind === SyntaxKind.MultiLineCommentTrivia) {
+ const multiLinePragmaRegEx = /\s*@(\S+)\s*(.*)\s*$/gim; // Defined inline since it uses the "g" flag, which keeps a persistent index (for iterating)
+ let multiLineMatch: RegExpExecArray;
+ while (multiLineMatch = multiLinePragmaRegEx.exec(text)) {
+ addPragmaForMatch(pragmas, range, PragmaKindFlags.MultiLine, multiLineMatch);
+ }
}
}
diff --git a/src/compiler/program.ts b/src/compiler/program.ts
index 57c69b77bb9..54dede025b5 100755
--- a/src/compiler/program.ts
+++ b/src/compiler/program.ts
@@ -1,7 +1,3 @@
-///
-///
-///
-
namespace ts {
const ignoreDiagnosticCommentRegEx = /(^\s*$)|(^\s*\/\/\/?\s*(@ts-ignore)?)/;
@@ -577,7 +573,6 @@ namespace ts {
const packageIdToSourceFile = createMap();
// Maps from a SourceFile's `.path` to the name of the package it was imported with.
let sourceFileToPackageName = createMap();
- // See `sourceFileIsRedirectedTo`.
let redirectTargetsSet = createMap();
const filesByName = createMap();
@@ -627,9 +622,6 @@ namespace ts {
Debug.assert(!!missingFilePaths);
- // unconditionally set moduleResolutionCache to undefined to avoid unnecessary leaks
- moduleResolutionCache = undefined;
-
// Release any files we have acquired in the old program but are
// not part of the new program.
if (oldProgram && host.onReleaseOldSourceFile) {
@@ -675,7 +667,8 @@ namespace ts {
sourceFileToPackageName,
redirectTargetsSet,
isEmittedFile,
- getConfigFileParsingDiagnostics
+ getConfigFileParsingDiagnostics,
+ getResolvedModuleWithFailedLookupLocationsFromCache,
};
verifyCompilerOptions();
@@ -684,6 +677,10 @@ namespace ts {
return program;
+ function getResolvedModuleWithFailedLookupLocationsFromCache(moduleName: string, containingFile: string): ResolvedModuleWithFailedLookupLocations {
+ return moduleResolutionCache && resolveModuleNameFromCache(moduleName, containingFile, moduleResolutionCache);
+ }
+
function toPath(fileName: string): Path {
return ts.toPath(fileName, currentDirectory, getCanonicalFileName);
}
@@ -1629,6 +1626,9 @@ namespace ts {
collectDynamicImportOrRequireCalls(node);
}
}
+ if ((file.flags & NodeFlags.PossiblyContainsDynamicImport) || isJavaScriptFile) {
+ collectDynamicImportOrRequireCalls(file.endOfFileToken);
+ }
file.imports = imports || emptyArray;
file.moduleAugmentations = moduleAugmentations || emptyArray;
@@ -2009,7 +2009,8 @@ namespace ts {
&& !options.noResolve
&& i < file.imports.length
&& !elideImport
- && !(isJsFile && !options.allowJs);
+ && !(isJsFile && !options.allowJs)
+ && (isInJavaScriptFile(file.imports[i]) || !(file.imports[i].flags & NodeFlags.JSDoc));
if (elideImport) {
modulesWithElidedImports.set(file.path, true);
diff --git a/src/compiler/resolutionCache.ts b/src/compiler/resolutionCache.ts
index 0946948f43d..35e056546c0 100644
--- a/src/compiler/resolutionCache.ts
+++ b/src/compiler/resolutionCache.ts
@@ -1,7 +1,3 @@
-///
-///
-///
-
/*@internal*/
namespace ts {
/** This is the cache of module/typedirectives resolution that can be retained across program */
@@ -14,6 +10,7 @@ namespace ts {
invalidateResolutionOfFile(filePath: Path): void;
removeResolutionsOfFile(filePath: Path): void;
+ setFilesWithInvalidatedNonRelativeUnresolvedImports(filesWithUnresolvedImports: Map>): void;
createHasInvalidatedResolution(forceAllFilesAsInvalidated?: boolean): HasInvalidatedResolution;
startCachingPerDirectoryResolution(): void;
@@ -78,6 +75,7 @@ namespace ts {
export function createResolutionCache(resolutionHost: ResolutionCacheHost, rootDirForResolution: string, logChangesWhenResolvingModule: boolean): ResolutionCache {
let filesWithChangedSetOfUnresolvedImports: Path[] | undefined;
let filesWithInvalidatedResolutions: Map | undefined;
+ let filesWithInvalidatedNonRelativeUnresolvedImports: Map> | undefined;
let allFilesHaveInvalidatedResolution = false;
const getCurrentDirectory = memoize(() => resolutionHost.getCurrentDirectory());
@@ -126,6 +124,7 @@ namespace ts {
resolveTypeReferenceDirectives,
removeResolutionsOfFile,
invalidateResolutionOfFile,
+ setFilesWithInvalidatedNonRelativeUnresolvedImports,
createHasInvalidatedResolution,
updateTypeRootsWatch,
closeTypeRootsWatch,
@@ -169,6 +168,16 @@ namespace ts {
return collected;
}
+ function isFileWithInvalidatedNonRelativeUnresolvedImports(path: Path) {
+ if (!filesWithInvalidatedNonRelativeUnresolvedImports) {
+ return false;
+ }
+
+ // Invalidated if file has unresolved imports
+ const value = filesWithInvalidatedNonRelativeUnresolvedImports.get(path);
+ return value && !!value.length;
+ }
+
function createHasInvalidatedResolution(forceAllFilesAsInvalidated?: boolean): HasInvalidatedResolution {
if (allFilesHaveInvalidatedResolution || forceAllFilesAsInvalidated) {
// Any file asked would have invalidated resolution
@@ -177,7 +186,8 @@ namespace ts {
}
const collected = filesWithInvalidatedResolutions;
filesWithInvalidatedResolutions = undefined;
- return path => collected && collected.has(path);
+ return path => (collected && collected.has(path)) ||
+ isFileWithInvalidatedNonRelativeUnresolvedImports(path);
}
function clearPerDirectoryResolutions() {
@@ -188,6 +198,7 @@ namespace ts {
function finishCachingPerDirectoryResolution() {
allFilesHaveInvalidatedResolution = false;
+ filesWithInvalidatedNonRelativeUnresolvedImports = undefined;
directoryWatchesOfFailedLookups.forEach((watcher, path) => {
if (watcher.refCount === 0) {
directoryWatchesOfFailedLookups.delete(path);
@@ -241,13 +252,15 @@ namespace ts {
const resolvedModules: R[] = [];
const compilerOptions = resolutionHost.getCompilationSettings();
-
+ const hasInvalidatedNonRelativeUnresolvedImport = logChanges && isFileWithInvalidatedNonRelativeUnresolvedImports(path);
const seenNamesInFile = createMap();
for (const name of names) {
let resolution = resolutionsInFile.get(name);
// Resolution is valid if it is present and not invalidated
if (!seenNamesInFile.has(name) &&
- allFilesHaveInvalidatedResolution || !resolution || resolution.isInvalidated) {
+ allFilesHaveInvalidatedResolution || !resolution || resolution.isInvalidated ||
+ // If the name is unresolved import that was invalidated, recalculate
+ (hasInvalidatedNonRelativeUnresolvedImport && !isExternalModuleNameRelative(name) && !getResolutionWithResolvedFileName(resolution))) {
const existingResolution = resolution;
const resolutionInDirectory = perDirectoryResolution.get(name);
if (resolutionInDirectory) {
@@ -288,7 +301,7 @@ namespace ts {
if (oldResolution === newResolution) {
return true;
}
- if (!oldResolution || !newResolution || oldResolution.isInvalidated) {
+ if (!oldResolution || !newResolution) {
return false;
}
const oldResult = getResolutionWithResolvedFileName(oldResolution);
@@ -581,6 +594,11 @@ namespace ts {
);
}
+ function setFilesWithInvalidatedNonRelativeUnresolvedImports(filesMap: Map>) {
+ Debug.assert(filesWithInvalidatedNonRelativeUnresolvedImports === filesMap || filesWithInvalidatedNonRelativeUnresolvedImports === undefined);
+ filesWithInvalidatedNonRelativeUnresolvedImports = filesMap;
+ }
+
function invalidateResolutionOfFailedLookupLocation(fileOrDirectoryPath: Path, isCreatingWatchedDirectory: boolean) {
let isChangedFailedLookupLocation: (location: string) => boolean;
if (isCreatingWatchedDirectory) {
diff --git a/src/compiler/scanner.ts b/src/compiler/scanner.ts
index 43320b453c4..f2a01d22c24 100644
--- a/src/compiler/scanner.ts
+++ b/src/compiler/scanner.ts
@@ -1,6 +1,3 @@
-///
-///
-
namespace ts {
export type ErrorCallback = (message: DiagnosticMessage, length: number) => void;
diff --git a/src/compiler/sourcemap.ts b/src/compiler/sourcemap.ts
index 2e81da35cfd..6251f1963fa 100644
--- a/src/compiler/sourcemap.ts
+++ b/src/compiler/sourcemap.ts
@@ -1,5 +1,3 @@
-///
-
/* @internal */
namespace ts {
export interface SourceMapWriter {
diff --git a/src/compiler/sys.ts b/src/compiler/sys.ts
index 8c2612155e4..be95e06eb46 100644
--- a/src/compiler/sys.ts
+++ b/src/compiler/sys.ts
@@ -1,5 +1,3 @@
-///
-
declare function setTimeout(handler: (...args: any[]) => void, timeout: number): any;
declare function clearTimeout(handle: any): void;
@@ -430,6 +428,7 @@ namespace ts {
newLine: string;
useCaseSensitiveFileNames: boolean;
write(s: string): void;
+ writeOutputIsTTY?(): boolean;
readFile(path: string, encoding?: string): string | undefined;
getFileSize?(path: string): number;
writeFile(path: string, data: string, writeByteOrderMark?: boolean): void;
@@ -563,6 +562,9 @@ namespace ts {
write(s: string): void {
process.stdout.write(s);
},
+ writeOutputIsTTY() {
+ return process.stdout.isTTY;
+ },
readFile,
writeFile,
watchFile: getWatchFile(),
diff --git a/src/compiler/transformer.ts b/src/compiler/transformer.ts
index c187176d069..8cadba453d8 100644
--- a/src/compiler/transformer.ts
+++ b/src/compiler/transformer.ts
@@ -1,18 +1,3 @@
-///
-///
-///
-///
-///
-///
-///
-///
-///
-///
-///
-///
-///
-///
-
/* @internal */
namespace ts {
function getModuleTransformer(moduleKind: ModuleKind): TransformerFactory {
diff --git a/src/compiler/transformers/declarations.ts b/src/compiler/transformers/declarations.ts
index 7b6b5847753..67e4fa31cb2 100644
--- a/src/compiler/transformers/declarations.ts
+++ b/src/compiler/transformers/declarations.ts
@@ -1,7 +1,3 @@
-///
-///
-///
-
/*@internal*/
namespace ts {
export function getDeclarationDiagnostics(host: EmitHost, resolver: EmitResolver, file: SourceFile | undefined): Diagnostic[] {
diff --git a/src/compiler/transformers/destructuring.ts b/src/compiler/transformers/destructuring.ts
index bafe43b0b15..35101d3be7f 100644
--- a/src/compiler/transformers/destructuring.ts
+++ b/src/compiler/transformers/destructuring.ts
@@ -1,6 +1,3 @@
-///
-///
-
/*@internal*/
namespace ts {
interface FlattenContext {
diff --git a/src/compiler/transformers/es2015.ts b/src/compiler/transformers/es2015.ts
index 72068688f9d..0a607494bb5 100644
--- a/src/compiler/transformers/es2015.ts
+++ b/src/compiler/transformers/es2015.ts
@@ -1,7 +1,3 @@
-///
-///
-///
-
/*@internal*/
namespace ts {
const enum ES2015SubstitutionFlags {
diff --git a/src/compiler/transformers/es2016.ts b/src/compiler/transformers/es2016.ts
index a9468991776..22b2f11b612 100644
--- a/src/compiler/transformers/es2016.ts
+++ b/src/compiler/transformers/es2016.ts
@@ -1,6 +1,3 @@
-///
-///
-
/*@internal*/
namespace ts {
export function transformES2016(context: TransformationContext) {
diff --git a/src/compiler/transformers/es2017.ts b/src/compiler/transformers/es2017.ts
index f2a5aeb35d2..6689f83ed5b 100644
--- a/src/compiler/transformers/es2017.ts
+++ b/src/compiler/transformers/es2017.ts
@@ -1,6 +1,3 @@
-///
-///
-
/*@internal*/
namespace ts {
type SuperContainer = ClassDeclaration | MethodDeclaration | GetAccessorDeclaration | SetAccessorDeclaration | ConstructorDeclaration;
diff --git a/src/compiler/transformers/es5.ts b/src/compiler/transformers/es5.ts
index bc6ee13520f..92ecce6a15c 100644
--- a/src/compiler/transformers/es5.ts
+++ b/src/compiler/transformers/es5.ts
@@ -1,6 +1,3 @@
-///
-///
-
/*@internal*/
namespace ts {
/**
diff --git a/src/compiler/transformers/esnext.ts b/src/compiler/transformers/esnext.ts
index 97fe93e508b..68861a5bb43 100644
--- a/src/compiler/transformers/esnext.ts
+++ b/src/compiler/transformers/esnext.ts
@@ -1,7 +1,3 @@
-///
-///
-///
-
/*@internal*/
namespace ts {
const enum ESNextSubstitutionFlags {
diff --git a/src/compiler/transformers/generators.ts b/src/compiler/transformers/generators.ts
index 82d8bc513f0..15f0d2d0f81 100644
--- a/src/compiler/transformers/generators.ts
+++ b/src/compiler/transformers/generators.ts
@@ -1,6 +1,3 @@
-///
-///
-
// Transforms generator functions into a compatible ES5 representation with similar runtime
// semantics. This is accomplished by first transforming the body of each generator
// function into an intermediate representation that is the compiled into a JavaScript
diff --git a/src/compiler/transformers/jsx.ts b/src/compiler/transformers/jsx.ts
index 07dc8f74db4..4acdf63b275 100644
--- a/src/compiler/transformers/jsx.ts
+++ b/src/compiler/transformers/jsx.ts
@@ -1,7 +1,3 @@
-///
-///
-///
-
/*@internal*/
namespace ts {
export function transformJsx(context: TransformationContext) {
diff --git a/src/compiler/transformers/module/es2015.ts b/src/compiler/transformers/module/es2015.ts
index 4f218e4fdcf..a3315852632 100644
--- a/src/compiler/transformers/module/es2015.ts
+++ b/src/compiler/transformers/module/es2015.ts
@@ -1,6 +1,3 @@
-///
-///
-
/*@internal*/
namespace ts {
export function transformES2015Module(context: TransformationContext) {
diff --git a/src/compiler/transformers/module/module.ts b/src/compiler/transformers/module/module.ts
index 45d13357123..f9fb47f6a27 100644
--- a/src/compiler/transformers/module/module.ts
+++ b/src/compiler/transformers/module/module.ts
@@ -1,7 +1,3 @@
-///
-///
-///
-
/*@internal*/
namespace ts {
export function transformModule(context: TransformationContext) {
diff --git a/src/compiler/transformers/module/system.ts b/src/compiler/transformers/module/system.ts
index ca55cb3a9d1..5cde69e2ef6 100644
--- a/src/compiler/transformers/module/system.ts
+++ b/src/compiler/transformers/module/system.ts
@@ -1,7 +1,3 @@
-///
-///
-///
-
/*@internal*/
namespace ts {
export function transformSystemModule(context: TransformationContext) {
diff --git a/src/compiler/transformers/ts.ts b/src/compiler/transformers/ts.ts
index f22d8f02870..f29829d4607 100644
--- a/src/compiler/transformers/ts.ts
+++ b/src/compiler/transformers/ts.ts
@@ -1,7 +1,3 @@
-///
-///
-///
-
/*@internal*/
namespace ts {
/**
@@ -506,6 +502,9 @@ namespace ts {
case SyntaxKind.NewExpression:
return visitNewExpression(node);
+ case SyntaxKind.TaggedTemplateExpression:
+ return visitTaggedTemplateExpression(node);
+
case SyntaxKind.NonNullExpression:
// TypeScript non-null expressions are removed, but their subtrees are preserved.
return visitNonNullExpression(node);
@@ -2551,6 +2550,14 @@ namespace ts {
visitNodes(node.arguments, visitor, isExpression));
}
+ function visitTaggedTemplateExpression(node: TaggedTemplateExpression) {
+ return updateTaggedTemplate(
+ node,
+ visitNode(node.tag, visitor, isExpression),
+ /*typeArguments*/ undefined,
+ visitNode(node.template, visitor, isExpression));
+ }
+
/**
* Determines whether to emit an enum declaration.
*
diff --git a/src/compiler/tsc.ts b/src/compiler/tsc.ts
index 09b64701988..3c73eba86ef 100644
--- a/src/compiler/tsc.ts
+++ b/src/compiler/tsc.ts
@@ -1,7 +1,3 @@
-///
-///
-///
-
namespace ts {
interface Statistic {
name: string;
@@ -22,12 +18,19 @@ namespace ts {
}
let reportDiagnostic = createDiagnosticReporter(sys);
- function udpateReportDiagnostic(options: CompilerOptions) {
- if (options.pretty) {
+ function updateReportDiagnostic(options: CompilerOptions) {
+ if (shouldBePretty(options)) {
reportDiagnostic = createDiagnosticReporter(sys, /*pretty*/ true);
}
}
+ function shouldBePretty(options: CompilerOptions) {
+ if (typeof options.pretty === "undefined") {
+ return !!sys.writeOutputIsTTY && sys.writeOutputIsTTY();
+ }
+ return options.pretty;
+ }
+
function padLeft(s: string, length: number) {
while (s.length < length) {
s = " " + s;
@@ -111,7 +114,7 @@ namespace ts {
const commandLineOptions = commandLine.options;
if (configFileName) {
const configParseResult = parseConfigFileWithSystem(configFileName, commandLineOptions, sys, reportDiagnostic);
- udpateReportDiagnostic(configParseResult.options);
+ updateReportDiagnostic(configParseResult.options);
if (isWatchSet(configParseResult.options)) {
reportWatchModeWithoutSysSupport();
createWatchOfConfigFile(configParseResult, commandLineOptions);
@@ -121,7 +124,7 @@ namespace ts {
}
}
else {
- udpateReportDiagnostic(commandLineOptions);
+ updateReportDiagnostic(commandLineOptions);
if (isWatchSet(commandLineOptions)) {
reportWatchModeWithoutSysSupport();
createWatchOfFilesAndCompilerOptions(commandLine.fileNames, commandLineOptions);
@@ -163,7 +166,7 @@ namespace ts {
}
function createWatchStatusReporter(options: CompilerOptions) {
- return ts.createWatchStatusReporter(sys, !!options.pretty);
+ return ts.createWatchStatusReporter(sys, shouldBePretty(options));
}
function createWatchOfConfigFile(configParseResult: ParsedCommandLine, optionsToExtend: CompilerOptions) {
diff --git a/src/compiler/tsconfig.json b/src/compiler/tsconfig.json
index 58626f2cdc1..46e5384434a 100644
--- a/src/compiler/tsconfig.json
+++ b/src/compiler/tsconfig.json
@@ -6,36 +6,38 @@
"declaration": true
},
"files": [
- "core.ts",
- "performance.ts",
- "sys.ts",
"types.ts",
+ "performance.ts",
+ "core.ts",
+ "sys.ts",
+ "diagnosticInformationMap.generated.ts",
"scanner.ts",
- "parser.ts",
"utilities.ts",
+ "parser.ts",
"binder.ts",
"symbolWalker.ts",
+ "moduleNameResolver.ts",
"checker.ts",
"factory.ts",
"visitor.ts",
"transformers/utilities.ts",
+ "transformers/destructuring.ts",
"transformers/ts.ts",
- "transformers/jsx.ts",
- "transformers/esnext.ts",
"transformers/es2017.ts",
+ "transformers/esnext.ts",
+ "transformers/jsx.ts",
"transformers/es2016.ts",
"transformers/es2015.ts",
"transformers/es5.ts",
"transformers/generators.ts",
- "transformers/destructuring.ts",
"transformers/module/module.ts",
"transformers/module/system.ts",
"transformers/module/es2015.ts",
"transformers/declarations/diagnostics.ts",
"transformers/declarations.ts",
"transformer.ts",
- "comments.ts",
"sourcemap.ts",
+ "comments.ts",
"emitter.ts",
"watchUtilities.ts",
"program.ts",
@@ -44,7 +46,6 @@
"resolutionCache.ts",
"watch.ts",
"commandLineParser.ts",
- "tsc.ts",
- "diagnosticInformationMap.generated.ts"
+ "tsc.ts"
]
}
diff --git a/src/compiler/types.ts b/src/compiler/types.ts
index 42cf1325551..c678c4dab93 100644
--- a/src/compiler/types.ts
+++ b/src/compiler/types.ts
@@ -886,6 +886,7 @@ namespace ts {
export interface PropertyDeclaration extends ClassElement, JSDocContainer {
kind: SyntaxKind.PropertyDeclaration;
+ parent: ClassLikeDeclaration;
name: PropertyName;
questionToken?: QuestionToken; // Present for use with reporting a grammar error
exclamationToken?: ExclamationToken;
@@ -1691,7 +1692,7 @@ namespace ts {
export interface ElementAccessExpression extends MemberExpression {
kind: SyntaxKind.ElementAccessExpression;
expression: LeftHandSideExpression;
- argumentExpression?: Expression;
+ argumentExpression: Expression;
}
export interface SuperElementAccessExpression extends ElementAccessExpression {
@@ -1733,6 +1734,7 @@ namespace ts {
export interface TaggedTemplateExpression extends MemberExpression {
kind: SyntaxKind.TaggedTemplateExpression;
tag: LeftHandSideExpression;
+ typeArguments?: NodeArray;
template: TemplateLiteral;
}
@@ -1898,7 +1900,7 @@ namespace ts {
kind: SyntaxKind.DebuggerStatement;
}
- export interface MissingDeclaration extends DeclarationStatement, ClassElement, ObjectLiteralElement, TypeElement {
+ export interface MissingDeclaration extends DeclarationStatement {
kind: SyntaxKind.MissingDeclaration;
name?: Identifier;
}
@@ -2337,7 +2339,7 @@ namespace ts {
}
export interface JSDocTag extends Node {
- parent: JSDoc;
+ parent: JSDoc | JSDocTypeLiteral;
atToken: AtToken;
tagName: Identifier;
comment: string | undefined;
@@ -2534,7 +2536,7 @@ namespace ts {
/**
* If two source files are for the same version of the same package, one will redirect to the other.
* (See `createRedirectSourceFile` in program.ts.)
- * The redirect will have this set. The other will not have anything set, but see Program#sourceFileIsRedirectedTo.
+ * The redirect will have this set. The redirected-to source file will be in `redirectTargetsSet`.
*/
/* @internal */ redirectInfo?: RedirectInfo | undefined;
@@ -2730,6 +2732,8 @@ namespace ts {
/* @internal */ redirectTargetsSet: Map;
/** Is the file emitted file */
/* @internal */ isEmittedFile(file: string): boolean;
+
+ /* @internal */ getResolvedModuleWithFailedLookupLocationsFromCache(moduleName: string, containingFile: string): ResolvedModuleWithFailedLookupLocations | undefined;
}
/* @internal */
@@ -3003,6 +3007,13 @@ namespace ts {
* Others are added in computeSuggestionDiagnostics.
*/
/* @internal */ getSuggestionDiagnostics(file: SourceFile): ReadonlyArray;
+
+ /**
+ * Depending on the operation performed, it may be appropriate to throw away the checker
+ * if the cancellation token is triggered. Typically, if it is used for error checking
+ * and the operation is cancelled, then it should be discarded, otherwise it is safe to keep.
+ */
+ runWithCancellationToken(token: CancellationToken, cb: (checker: TypeChecker) => T): T;
}
/* @internal */
@@ -3199,7 +3210,8 @@ namespace ts {
export type AnyValidImportOrReExport =
| (ImportDeclaration | ExportDeclaration) & { moduleSpecifier: StringLiteral }
| ImportEqualsDeclaration & { moduleReference: ExternalModuleReference & { expression: StringLiteral } }
- | RequireOrImportCall;
+ | RequireOrImportCall
+ | ImportTypeNode & { argument: LiteralType };
/* @internal */
export type RequireOrImportCall = CallExpression & { arguments: [StringLiteralLike] };
@@ -3379,6 +3391,7 @@ namespace ts {
/* @internal */ mergeId?: number; // Merge id (used to look up merged symbol)
/* @internal */ parent?: Symbol; // Parent symbol
/* @internal */ exportSymbol?: Symbol; // Exported symbol associated with this symbol
+ /* @internal */ nameType?: Type; // Type associated with a late-bound symbol
/* @internal */ constEnumOnlyModule?: boolean; // True if module contains only const enums or other modules with only const enums
/* @internal */ isReferenced?: SymbolFlags; // True if the symbol is referenced elsewhere. Keeps track of the meaning of a reference in case a symbol is both a type parameter and parameter.
/* @internal */ isReplaceableByMethod?: boolean; // Can this Javascript class property be replaced by a method symbol?
@@ -3413,7 +3426,6 @@ namespace ts {
enumKind?: EnumKind; // Enum declaration classification
originatingImport?: ImportDeclaration | ImportCall; // Import declaration which produced the symbol, present if the symbol is marked as uncallable but had call signatures in `resolveESModuleSymbol`
lateSymbol?: Symbol; // Late-bound symbol for a computed property
- nameType?: Type; // Type associate with a late-bound or mapped type property symbol's name
}
/* @internal */
@@ -3610,7 +3622,7 @@ namespace ts {
Intrinsic = Any | String | Number | Boolean | BooleanLiteral | ESSymbol | Void | Undefined | Null | Never | NonPrimitive,
/* @internal */
Primitive = String | Number | Boolean | Enum | EnumLiteral | ESSymbol | Void | Undefined | Null | Literal | UniqueESSymbol,
- StringLike = String | StringLiteral | Index,
+ StringLike = String | StringLiteral,
NumberLike = Number | NumberLiteral | Enum,
BooleanLike = Boolean | BooleanLiteral,
EnumLike = Enum | EnumLiteral,
@@ -3767,7 +3779,7 @@ namespace ts {
/* @internal */
resolvedIndexType: IndexType;
/* @internal */
- resolvedDeclaredIndexType: IndexType;
+ resolvedStringIndexType: IndexType;
/* @internal */
resolvedBaseConstraint: Type;
/* @internal */
@@ -3856,7 +3868,7 @@ namespace ts {
/* @internal */
resolvedIndexType?: IndexType;
/* @internal */
- resolvedDeclaredIndexType?: IndexType;
+ resolvedStringIndexType?: IndexType;
}
// Type parameters (TypeFlags.TypeParameter)
@@ -3888,9 +3900,9 @@ namespace ts {
// keyof T types (TypeFlags.Index)
export interface IndexType extends InstantiableType {
- /* @internal */
- isDeclaredType?: boolean;
type: InstantiableType | UnionOrIntersectionType;
+ /* @internal */
+ stringsOnly: boolean;
}
export interface ConditionalRoot {
@@ -4049,10 +4061,10 @@ namespace ts {
/* @internal */
export interface WideningContext {
- parent?: WideningContext; // Parent context
- propertyName?: __String; // Name of property in parent
- siblings?: Type[]; // Types of siblings
- resolvedPropertyNames?: __String[]; // Property names occurring in sibling object literals
+ parent?: WideningContext; // Parent context
+ propertyName?: __String; // Name of property in parent
+ siblings?: Type[]; // Types of siblings
+ resolvedProperties?: Symbol[]; // Properties occurring in sibling object literals
}
/* @internal */
@@ -4083,7 +4095,7 @@ namespace ts {
category: DiagnosticCategory;
code: number;
message: string;
- unused?: {};
+ reportsUnnecessary?: {};
}
/**
@@ -4167,6 +4179,7 @@ namespace ts {
inlineSources?: boolean;
isolatedModules?: boolean;
jsx?: JsxEmit;
+ keyofStringsOnly?: boolean;
lib?: string[];
/*@internal*/listEmittedFiles?: boolean;
/*@internal*/listFiles?: boolean;
@@ -4200,7 +4213,7 @@ namespace ts {
preserveSymlinks?: boolean;
/* @internal */ preserveWatchOutput?: boolean;
project?: string;
- /* @internal */ pretty?: DiagnosticStyle;
+ /* @internal */ pretty?: boolean;
reactNamespace?: string;
jsxFactory?: string;
removeComments?: boolean;
@@ -4298,12 +4311,6 @@ namespace ts {
JSX,
}
- /* @internal */
- export const enum DiagnosticStyle {
- Simple,
- Pretty,
- }
-
/** Either a parsed command line or a parsed tsconfig.json */
export interface ParsedCommandLine {
options: CompilerOptions;
diff --git a/src/compiler/utilities.ts b/src/compiler/utilities.ts
index a73efb55eef..c5cb19e876a 100644
--- a/src/compiler/utilities.ts
+++ b/src/compiler/utilities.ts
@@ -1,5 +1,3 @@
-///
-
/* @internal */
namespace ts {
export const resolvingEmptyArray: never[] = [] as never[];
@@ -1712,8 +1710,10 @@ namespace ts {
return (node.parent as ExternalModuleReference).parent as AnyValidImportOrReExport;
case SyntaxKind.CallExpression:
return node.parent as AnyValidImportOrReExport;
+ case SyntaxKind.LiteralType:
+ return cast(node.parent.parent, isImportTypeNode) as ImportTypeNode & { argument: LiteralType };
default:
- return Debug.fail(Debug.showSyntaxKind(node));
+ return Debug.fail(Debug.showSyntaxKind(node.parent));
}
}
@@ -1818,10 +1818,8 @@ namespace ts {
function getJSDocCommentsAndTagsWorker(node: Node): void {
const parent = node.parent;
- if (parent &&
- (parent.kind === SyntaxKind.PropertyAssignment ||
- parent.kind === SyntaxKind.PropertyDeclaration ||
- getNestedModuleDeclaration(parent))) {
+ if (!parent) return;
+ if (parent.kind === SyntaxKind.PropertyAssignment || parent.kind === SyntaxKind.PropertyDeclaration || getNestedModuleDeclaration(parent)) {
getJSDocCommentsAndTagsWorker(parent);
}
// Try to recognize this pattern when node is initializer of variable declaration and JSDoc comments are on containing variable statement.
@@ -1830,16 +1828,18 @@ namespace ts {
// * @returns {number}
// */
// var x = function(name) { return name.length; }
- if (parent && parent.parent &&
+ if (parent.parent &&
(getSingleVariableOfVariableStatement(parent.parent) === node || getSourceOfAssignment(parent.parent))) {
getJSDocCommentsAndTagsWorker(parent.parent);
}
- if (parent && parent.parent && parent.parent.parent &&
- (getSingleInitializerOfVariableStatementOrPropertyDeclaration(parent.parent.parent) === node || getSourceOfDefaultedAssignment(parent.parent.parent))) {
+ if (parent.parent && parent.parent.parent &&
+ (getSingleVariableOfVariableStatement(parent.parent.parent) ||
+ getSingleInitializerOfVariableStatementOrPropertyDeclaration(parent.parent.parent) === node ||
+ getSourceOfDefaultedAssignment(parent.parent.parent))) {
getJSDocCommentsAndTagsWorker(parent.parent.parent);
}
if (isBinaryExpression(node) && getSpecialPropertyAssignmentKind(node) !== SpecialPropertyAssignmentKind.None ||
- parent && isBinaryExpression(parent) && getSpecialPropertyAssignmentKind(parent) !== SpecialPropertyAssignmentKind.None ||
+ isBinaryExpression(parent) && getSpecialPropertyAssignmentKind(parent) !== SpecialPropertyAssignmentKind.None ||
node.kind === SyntaxKind.PropertyAccessExpression && node.parent && node.parent.kind === SyntaxKind.ExpressionStatement) {
getJSDocCommentsAndTagsWorker(parent);
}
@@ -1888,6 +1888,9 @@ namespace ts {
}
export function getJSDocHost(node: JSDocTag): HasJSDoc {
+ while (node.parent.kind === SyntaxKind.JSDocTypeLiteral) {
+ node = node.parent.parent.parent as JSDocParameterTag;
+ }
Debug.assert(node.parent!.kind === SyntaxKind.JSDocComment);
return node.parent!.parent!;
}
@@ -2137,11 +2140,13 @@ namespace ts {
node.kind === SyntaxKind.NamespaceImport ||
node.kind === SyntaxKind.ImportSpecifier ||
node.kind === SyntaxKind.ExportSpecifier ||
- node.kind === SyntaxKind.ExportAssignment && exportAssignmentIsAlias(node);
+ node.kind === SyntaxKind.ExportAssignment && exportAssignmentIsAlias(node) ||
+ isBinaryExpression(node) && getSpecialPropertyAssignmentKind(node) === SpecialPropertyAssignmentKind.ModuleExports;
}
- export function exportAssignmentIsAlias(node: ExportAssignment): boolean {
- return isEntityNameExpression(node.expression);
+ export function exportAssignmentIsAlias(node: ExportAssignment | BinaryExpression): boolean {
+ const e = isExportAssignment(node) ? node.expression : node.right;
+ return isEntityNameExpression(e) || isClassExpression(e);
}
export function getClassExtendsHeritageClauseElement(node: ClassLikeDeclaration | InterfaceDeclaration) {
@@ -2933,11 +2938,7 @@ namespace ts {
}
export function getFirstConstructorWithBody(node: ClassLikeDeclaration): ConstructorDeclaration {
- return forEach(node.members, member => {
- if (member.kind === SyntaxKind.Constructor && nodeIsPresent((member).body)) {
- return member;
- }
- });
+ return find(node.members, (member): member is ConstructorDeclaration => isConstructorDeclaration(member) && nodeIsPresent(member.body));
}
function getSetAccessorValueParameter(accessor: SetAccessorDeclaration): ParameterDeclaration | undefined {
@@ -3039,6 +3040,10 @@ namespace ts {
return (node as HasType).type || (isInJavaScriptFile(node) ? getJSDocType(node) : undefined);
}
+ export function getTypeAnnotationNode(node: Node): TypeNode | undefined {
+ return (node as HasType).type;
+ }
+
/**
* Gets the effective return type annotation of a signature. If the node was parsed in a
* JavaScript file, gets the return type annotation from JSDoc.
@@ -3051,11 +3056,11 @@ namespace ts {
* Gets the effective type parameters. If the node was parsed in a
* JavaScript file, gets the type parameters from the `@template` tag from JSDoc.
*/
- export function getEffectiveTypeParameterDeclarations(node: DeclarationWithTypeParameters): ReadonlyArray | undefined {
+ export function getEffectiveTypeParameterDeclarations(node: DeclarationWithTypeParameters) {
return node.typeParameters || (isInJavaScriptFile(node) ? getJSDocTypeParameterDeclarations(node) : undefined);
}
- export function getJSDocTypeParameterDeclarations(node: DeclarationWithTypeParameters): ReadonlyArray {
+ export function getJSDocTypeParameterDeclarations(node: DeclarationWithTypeParameters) {
const templateTag = getJSDocTemplateTag(node);
return templateTag && templateTag.typeParameters;
}
@@ -4273,8 +4278,9 @@ namespace ts {
}
}
- export function isParameterPropertyDeclaration(node: Node): boolean {
- return hasModifier(node, ModifierFlags.ParameterPropertyModifier) && node.parent.kind === SyntaxKind.Constructor && isClassLike(node.parent.parent);
+ export type ParameterPropertyDeclaration = ParameterDeclaration & { parent: ConstructorDeclaration, name: Identifier };
+ export function isParameterPropertyDeclaration(node: Node): node is ParameterPropertyDeclaration {
+ return hasModifier(node, ModifierFlags.ParameterPropertyModifier) && node.parent.kind === SyntaxKind.Constructor;
}
export function isEmptyBindingPattern(node: BindingName): node is BindingPattern {
@@ -4632,11 +4638,21 @@ namespace ts {
* parameters by name and binding patterns do not have a name.
*/
export function getJSDocParameterTags(param: ParameterDeclaration): ReadonlyArray {
- if (param.name && isIdentifier(param.name)) {
- const name = param.name.escapedText;
- return getJSDocTags(param.parent).filter((tag): tag is JSDocParameterTag => isJSDocParameterTag(tag) && isIdentifier(tag.name) && tag.name.escapedText === name);
+ if (param.name) {
+ if (isIdentifier(param.name)) {
+ const name = param.name.escapedText;
+ return getJSDocTags(param.parent).filter((tag): tag is JSDocParameterTag => isJSDocParameterTag(tag) && isIdentifier(tag.name) && tag.name.escapedText === name);
+ }
+ else {
+ const i = param.parent.parameters.indexOf(param);
+ Debug.assert(i > -1, "Parameters should always be in their parents' parameter list");
+ const paramTags = getJSDocTags(param.parent).filter(isJSDocParameterTag);
+ if (i < paramTags.length) {
+ return [paramTags[i]];
+ }
+ }
}
- // a binding pattern doesn't have a name, so it's not possible to match it a JSDoc parameter, which is identified by name
+ // return empty array for: out-of-order binding patterns and JSDoc function syntax, which has un-named parameters
return emptyArray;
}
@@ -4913,6 +4929,10 @@ namespace ts {
return node.kind === SyntaxKind.LiteralType;
}
+ export function isImportTypeNode(node: Node): node is ImportTypeNode {
+ return node.kind === SyntaxKind.ImportType;
+ }
+
// Binding patterns
export function isObjectBindingPattern(node: Node): node is ObjectBindingPattern {
@@ -5593,8 +5613,7 @@ namespace ts {
|| kind === SyntaxKind.GetAccessor
|| kind === SyntaxKind.SetAccessor
|| kind === SyntaxKind.IndexSignature
- || kind === SyntaxKind.SemicolonClassElement
- || kind === SyntaxKind.MissingDeclaration;
+ || kind === SyntaxKind.SemicolonClassElement;
}
export function isClassLike(node: Node): node is ClassLikeDeclaration {
@@ -5625,8 +5644,11 @@ namespace ts {
|| kind === SyntaxKind.CallSignature
|| kind === SyntaxKind.PropertySignature
|| kind === SyntaxKind.MethodSignature
- || kind === SyntaxKind.IndexSignature
- || kind === SyntaxKind.MissingDeclaration;
+ || kind === SyntaxKind.IndexSignature;
+ }
+
+ export function isClassOrTypeElement(node: Node): node is ClassElement | TypeElement {
+ return isTypeElement(node) || isClassElement(node);
}
export function isObjectLiteralElementLike(node: Node): node is ObjectLiteralElementLike {
@@ -5636,8 +5658,7 @@ namespace ts {
|| kind === SyntaxKind.SpreadAssignment
|| kind === SyntaxKind.MethodDeclaration
|| kind === SyntaxKind.GetAccessor
- || kind === SyntaxKind.SetAccessor
- || kind === SyntaxKind.MissingDeclaration;
+ || kind === SyntaxKind.SetAccessor;
}
// Type
@@ -6311,4 +6332,9 @@ namespace ts {
export function isStringLiteralLike(node: Node): node is StringLiteralLike {
return node.kind === SyntaxKind.StringLiteral || node.kind === SyntaxKind.NoSubstitutionTemplateLiteral;
}
+
+ /** @internal */
+ export function isNamedImportsOrExports(node: Node): node is NamedImportsOrExports {
+ return node.kind === SyntaxKind.NamedImports || node.kind === SyntaxKind.NamedExports;
+ }
}
diff --git a/src/compiler/visitor.ts b/src/compiler/visitor.ts
index 8d8e47a8f4c..284d870caa1 100644
--- a/src/compiler/visitor.ts
+++ b/src/compiler/visitor.ts
@@ -1,7 +1,3 @@
-///
-///
-///
-
namespace ts {
const isTypeNodeOrTypeParameterDeclaration = or(isTypeNode, isTypeParameterDeclaration);
@@ -482,6 +478,7 @@ namespace ts {
case SyntaxKind.TaggedTemplateExpression:
return updateTaggedTemplate(node,
visitNode((node).tag, visitor, isExpression),
+ visitNodes((node).typeArguments, visitor, isExpression),
visitNode((node).template, visitor, isTemplateLiteral));
case SyntaxKind.TypeAssertionExpression:
diff --git a/src/compiler/watch.ts b/src/compiler/watch.ts
index f53f01e3eb2..f0bb151b814 100644
--- a/src/compiler/watch.ts
+++ b/src/compiler/watch.ts
@@ -1,7 +1,3 @@
-///
-///
-///
-
/*@internal*/
namespace ts {
const sysFormatDiagnosticsHost: FormatDiagnosticsHost = sys ? {
@@ -33,19 +29,36 @@ namespace ts {
/** @internal */
export const nonClearingMessageCodes: number[] = [
- Diagnostics.Compilation_complete_Watching_for_file_changes.code,
- Diagnostics.Found_1_error.code,
- Diagnostics.Found_0_errors.code
+ Diagnostics.Found_1_error_Watching_for_file_changes.code,
+ Diagnostics.Found_0_errors_Watching_for_file_changes.code
];
- function clearScreenIfNotWatchingForFileChanges(system: System, diagnostic: Diagnostic, options: CompilerOptions) {
+ /**
+ * @returns Whether the screen was cleared.
+ */
+ function clearScreenIfNotWatchingForFileChanges(system: System, diagnostic: Diagnostic, options: CompilerOptions): boolean {
if (system.clearScreen &&
!options.preserveWatchOutput &&
!options.extendedDiagnostics &&
!options.diagnostics &&
!contains(nonClearingMessageCodes, diagnostic.code)) {
system.clearScreen();
+ return true;
}
+
+ return false;
+ }
+
+ /** @internal */
+ export const screenStartingMessageCodes: number[] = [
+ Diagnostics.Starting_compilation_in_watch_mode.code,
+ Diagnostics.File_change_detected_Starting_incremental_compilation.code,
+ ];
+
+ function getPlainDiagnosticFollowingNewLines(diagnostic: Diagnostic, newLine: string): string {
+ return contains(screenStartingMessageCodes, diagnostic.code)
+ ? newLine + newLine
+ : newLine;
}
/**
@@ -56,13 +69,19 @@ namespace ts {
(diagnostic, newLine, options) => {
clearScreenIfNotWatchingForFileChanges(system, diagnostic, options);
let output = `[${formatColorAndReset(new Date().toLocaleTimeString(), ForegroundColorEscapeSequences.Grey)}] `;
- output += `${flattenDiagnosticMessageText(diagnostic.messageText, system.newLine)}${newLine + newLine + newLine}`;
+ output += `${flattenDiagnosticMessageText(diagnostic.messageText, system.newLine)}${newLine + newLine}`;
system.write(output);
} :
(diagnostic, newLine, options) => {
- clearScreenIfNotWatchingForFileChanges(system, diagnostic, options);
- let output = new Date().toLocaleTimeString() + " - ";
- output += `${flattenDiagnosticMessageText(diagnostic.messageText, system.newLine)}${newLine + newLine + newLine}`;
+ let output = "";
+
+ if (!clearScreenIfNotWatchingForFileChanges(system, diagnostic, options)) {
+ output += newLine;
+ }
+
+ output += `${new Date().toLocaleTimeString()} - `;
+ output += `${flattenDiagnosticMessageText(diagnostic.messageText, system.newLine)}${getPlainDiagnosticFollowingNewLines(diagnostic, newLine)}`;
+
system.write(output);
};
}
@@ -235,10 +254,10 @@ namespace ts {
const reportSummary = (errorCount: number) => {
if (errorCount === 1) {
- onWatchStatusChange(createCompilerDiagnostic(Diagnostics.Found_1_error, errorCount), newLine, compilerOptions);
+ onWatchStatusChange(createCompilerDiagnostic(Diagnostics.Found_1_error_Watching_for_file_changes, errorCount), newLine, compilerOptions);
}
else {
- onWatchStatusChange(createCompilerDiagnostic(Diagnostics.Found_0_errors, errorCount, errorCount), newLine, compilerOptions);
+ onWatchStatusChange(createCompilerDiagnostic(Diagnostics.Found_0_errors_Watching_for_file_changes, errorCount, errorCount), newLine, compilerOptions);
}
};
@@ -648,7 +667,7 @@ namespace ts {
if (host.afterProgramCreate) {
host.afterProgramCreate(builderProgram);
}
- reportWatchDiagnostic(Diagnostics.Compilation_complete_Watching_for_file_changes);
+
return builderProgram;
}
diff --git a/src/compiler/watchUtilities.ts b/src/compiler/watchUtilities.ts
index 12ed9f855df..4fa9b28e162 100644
--- a/src/compiler/watchUtilities.ts
+++ b/src/compiler/watchUtilities.ts
@@ -1,5 +1,3 @@
-///
-
/* @internal */
namespace ts {
/**
diff --git a/src/harness/externalCompileRunner.ts b/src/harness/externalCompileRunner.ts
index 1f945cfcc9c..3d07c69af85 100644
--- a/src/harness/externalCompileRunner.ts
+++ b/src/harness/externalCompileRunner.ts
@@ -66,7 +66,7 @@ abstract class ExternalCompileRunnerBase extends RunnerBase {
if (fs.existsSync(path.join(cwd, "node_modules"))) {
require("del").sync(path.join(cwd, "node_modules"), { force: true });
}
- const install = cp.spawnSync(`npm`, ["i"], { cwd, timeout: timeout / 2, shell: true, stdio }); // NPM shouldn't take the entire timeout - if it takes a long time, it should be terminated and we should log the failure
+ const install = cp.spawnSync(`npm`, ["i", "--ignore-scripts"], { cwd, timeout: timeout / 2, shell: true, stdio }); // NPM shouldn't take the entire timeout - if it takes a long time, it should be terminated and we should log the failure
if (install.status !== 0) throw new Error(`NPM Install for ${directoryName} failed: ${install.stderr.toString()}`);
}
const args = [path.join(__dirname, "tsc.js")];
diff --git a/src/harness/fourslash.ts b/src/harness/fourslash.ts
index 8c71a385d58..7dfff7dd189 100644
--- a/src/harness/fourslash.ts
+++ b/src/harness/fourslash.ts
@@ -276,14 +276,10 @@ namespace FourSlash {
if (configFileName) {
const baseDir = ts.normalizePath(ts.getDirectoryPath(configFileName));
const host = new Utils.MockParseConfigHost(baseDir, /*ignoreCase*/ false, this.inputFiles);
-
- const configJsonObj = ts.parseConfigFileTextToJson(configFileName, this.inputFiles.get(configFileName));
- assert.isTrue(configJsonObj.config !== undefined);
-
- compilationOptions = ts.parseJsonConfigFileContent(configJsonObj.config, host, baseDir, compilationOptions, configFileName).options;
+ const jsonSourceFile = ts.parseJsonText(configFileName, this.inputFiles.get(configFileName));
+ compilationOptions = ts.parseJsonSourceFileConfigFileContent(jsonSourceFile, host, baseDir, compilationOptions, configFileName).options;
}
-
if (compilationOptions.typeRoots) {
compilationOptions.typeRoots = compilationOptions.typeRoots.map(p => ts.getNormalizedAbsolutePath(p, this.basePath));
}
@@ -842,6 +838,7 @@ namespace FourSlash {
const actualCompletions = this.getCompletionListAtCaret(options);
if (!actualCompletions) {
+ if (expected === undefined) return;
this.raiseError(`No completions at position '${this.currentCaretPosition}'.`);
}
@@ -1081,8 +1078,20 @@ namespace FourSlash {
}
}
+ private verifyDocumentHighlightsRespectFilesList(files: ReadonlyArray): void {
+ const startFile = this.activeFile.fileName;
+ for (const fileName of files) {
+ const searchFileNames = startFile === fileName ? [startFile] : [startFile, fileName];
+ const highlights = this.getDocumentHighlightsAtCurrentPosition(searchFileNames);
+ if (!highlights.every(dh => ts.contains(searchFileNames, dh.fileName))) {
+ this.raiseError(`When asking for document highlights only in files ${searchFileNames}, got document highlights in ${unique(highlights, dh => dh.fileName)}`);
+ }
+ }
+ }
+
public verifyReferencesOf(range: Range, references: Range[]) {
this.goToRangeStart(range);
+ this.verifyDocumentHighlightsRespectFilesList(unique(references, e => e.fileName));
this.verifyReferencesAre(references);
}
@@ -1094,7 +1103,7 @@ namespace FourSlash {
}
}
- public verifyReferenceGroups(starts: string | string[] | Range | Range[], parts: FourSlashInterface.ReferenceGroup[]): void {
+ public verifyReferenceGroups(starts: string | string[] | Range | Range[], parts: FourSlashInterface.ReferenceGroup[] | undefined): void {
interface ReferenceGroupJson {
definition: string | { text: string, range: ts.TextSpan };
references: ts.ReferenceEntry[];
@@ -1128,6 +1137,10 @@ namespace FourSlash {
};
});
this.assertObjectsEqual(fullActual, fullExpected);
+
+ if (parts) {
+ this.verifyDocumentHighlightsRespectFilesList(unique(ts.flatMap(parts, p => p.ranges), r => r.fileName));
+ }
}
}
@@ -2087,14 +2100,11 @@ Actual: ${stringify(fullActual)}`);
this.raiseError("verifyRangesInImplementationList failed - expected to find at least one implementation location but got 0");
}
- for (let i = 0; i < implementations.length; i++) {
- for (let j = 0; j < implementations.length; j++) {
- if (i !== j && implementationsAreEqual(implementations[i], implementations[j])) {
- const { textSpan, fileName } = implementations[i];
- const end = textSpan.start + textSpan.length;
- this.raiseError(`Duplicate implementations returned for range (${textSpan.start}, ${end}) in ${fileName}`);
- }
- }
+ const duplicate = findDuplicatedElement(implementations, implementationsAreEqual);
+ if (duplicate) {
+ const { textSpan, fileName } = duplicate;
+ const end = textSpan.start + textSpan.length;
+ this.raiseError(`Duplicate implementations returned for range (${textSpan.start}, ${end}) in ${fileName}`);
}
const ranges = this.getRanges();
@@ -2409,14 +2419,7 @@ Actual: ${stringify(fullActual)}`);
public applyCodeActionFromCompletion(markerName: string, options: FourSlashInterface.VerifyCompletionActionOptions) {
this.goToMarker(markerName);
- const actualCompletion = this.getCompletionListAtCaret({ ...ts.defaultPreferences, includeCompletionsForModuleExports: true }).entries.find(e =>
- e.name === options.name && e.source === options.source);
-
- if (!actualCompletion.hasAction) {
- this.raiseError(`Completion for ${options.name} does not have an associated action.`);
- }
-
- const details = this.getCompletionEntryDetails(options.name, actualCompletion.source, options.preferences);
+ const details = this.getCompletionEntryDetails(options.name, options.source, options.preferences);
if (details.codeActions.length !== 1) {
this.raiseError(`Expected one code action, got ${details.codeActions.length}`);
}
@@ -2894,6 +2897,7 @@ Actual: ${stringify(fullActual)}`);
}
private verifyDocumentHighlights(expectedRanges: Range[], fileNames: ReadonlyArray = [this.activeFile.fileName]) {
+ fileNames = ts.map(fileNames, ts.normalizePath);
const documentHighlights = this.getDocumentHighlightsAtCurrentPosition(fileNames) || [];
for (const dh of documentHighlights) {
@@ -2903,7 +2907,7 @@ Actual: ${stringify(fullActual)}`);
}
for (const fileName of fileNames) {
- const expectedRangesInFile = expectedRanges.filter(r => r.fileName === fileName);
+ const expectedRangesInFile = expectedRanges.filter(r => ts.normalizePath(r.fileName) === fileName);
const highlights = ts.find(documentHighlights, dh => dh.fileName === fileName);
const spansInFile = highlights ? highlights.highlightSpans.sort((s1, s2) => s1.textSpan.start - s2.textSpan.start) : [];
@@ -3203,14 +3207,14 @@ Actual: ${stringify(fullActual)}`);
}
}
else if (ts.isString(indexOrName)) {
- let name = indexOrName;
+ let name = ts.normalizePath(indexOrName);
// names are stored in the compiler with this relative path, this allows people to use goTo.file on just the fileName
name = name.indexOf("/") === -1 ? (this.basePath + "/" + name) : name;
const availableNames: string[] = [];
const result = ts.forEach(this.testData.files, file => {
- const fn = file.fileName;
+ const fn = ts.normalizePath(file.fileName);
if (fn) {
if (fn === name) {
return file;
@@ -3265,6 +3269,15 @@ Actual: ${stringify(fullActual)}`);
private static textSpansEqual(a: ts.TextSpan, b: ts.TextSpan) {
return a && b && a.start === b.start && a.length === b.length;
}
+
+ public getEditsForFileRename(options: FourSlashInterface.GetEditsForFileRenameOptions): void {
+ const changes = this.languageService.getEditsForFileRename(options.oldPath, options.newPath, this.formatCodeSettings);
+ this.applyChanges(changes);
+ for (const fileName in options.newFileContents) {
+ this.openFile(fileName);
+ this.verifyCurrentFileContent(options.newFileContents[fileName]);
+ }
+ }
}
export function runFourSlashTest(basePath: string, testType: FourSlashTestType, fileName: string) {
@@ -3739,6 +3752,16 @@ ${code}
function stripWhitespace(s: string): string {
return s.replace(/\s/g, "");
}
+
+ function findDuplicatedElement(a: ReadonlyArray, equal: (a: T, b: T) => boolean): T {
+ for (let i = 0; i < a.length; i++) {
+ for (let j = i + 1; j < a.length; j++) {
+ if (equal(a[i], a[j])) {
+ return a[i];
+ }
+ }
+ }
+ }
}
namespace FourSlashInterface {
@@ -4346,6 +4369,10 @@ namespace FourSlashInterface {
public allRangesAppearInImplementationList(markerName: string) {
this.state.verifyRangesInImplementationList(markerName);
}
+
+ public getEditsForFileRename(options: GetEditsForFileRenameOptions) {
+ this.state.getEditsForFileRename(options);
+ }
}
export class Edit {
@@ -4629,10 +4656,12 @@ namespace FourSlashInterface {
export type ExpectedCompletionEntry = string | { name: string, insertText?: string, replacementSpan?: FourSlash.Range };
export interface CompletionsAtOptions extends Partial {
+ triggerCharacter?: string;
isNewIdentifierLocation?: boolean;
}
export interface VerifyCompletionListContainsOptions extends ts.UserPreferences {
+ triggerCharacter?: string;
sourceDisplay: string;
isRecommended?: true;
insertText?: string;
@@ -4686,4 +4715,10 @@ namespace FourSlashInterface {
range?: FourSlash.Range;
code: number;
}
+
+ export interface GetEditsForFileRenameOptions {
+ readonly oldPath: string;
+ readonly newPath: string;
+ readonly newFileContents: { readonly [fileName: string]: string };
+ }
}
diff --git a/src/harness/harness.ts b/src/harness/harness.ts
index 9e6978f2a15..9fe26ed51c3 100644
--- a/src/harness/harness.ts
+++ b/src/harness/harness.ts
@@ -304,14 +304,13 @@ namespace Utils {
o.containsParseError = true;
}
- ts.forEach(Object.getOwnPropertyNames(n), propertyName => {
+ for (const propertyName of Object.getOwnPropertyNames(n) as ReadonlyArray) {
switch (propertyName) {
case "parent":
case "symbol":
case "locals":
case "localSymbol":
case "kind":
- case "semanticDiagnostics":
case "id":
case "nodeCount":
case "symbolCount":
@@ -334,7 +333,6 @@ namespace Utils {
}
break;
- case "referenceDiagnostics":
case "parseDiagnostics":
o[propertyName] = convertDiagnostics((n)[propertyName]);
break;
@@ -355,9 +353,7 @@ namespace Utils {
default:
o[propertyName] = (n)[propertyName];
}
-
- return undefined;
- });
+ }
return o;
}
diff --git a/src/harness/harnessLanguageService.ts b/src/harness/harnessLanguageService.ts
index 17788f6251d..0063a4730f1 100644
--- a/src/harness/harnessLanguageService.ts
+++ b/src/harness/harnessLanguageService.ts
@@ -528,6 +528,9 @@ namespace Harness.LanguageService {
organizeImports(_scope: ts.OrganizeImportsScope, _formatOptions: ts.FormatCodeSettings): ReadonlyArray {
throw new Error("Not supported on the shim.");
}
+ getEditsForFileRename(): ReadonlyArray {
+ throw new Error("Not supported on the shim.");
+ }
getEmitOutput(fileName: string): ts.EmitOutput {
return unwrapJSONCallResult(this.shim.getEmitOutput(fileName));
}
diff --git a/src/harness/tsconfig.json b/src/harness/tsconfig.json
index fe4b066c5e7..a4ad8cb3797 100644
--- a/src/harness/tsconfig.json
+++ b/src/harness/tsconfig.json
@@ -13,132 +13,146 @@
]
},
"files": [
- "../compiler/core.ts",
- "../compiler/performance.ts",
- "../compiler/sys.ts",
"../compiler/types.ts",
+ "../compiler/performance.ts",
+ "../compiler/core.ts",
+ "../compiler/sys.ts",
+ "../compiler/diagnosticInformationMap.generated.ts",
"../compiler/scanner.ts",
- "../compiler/parser.ts",
"../compiler/utilities.ts",
+ "../compiler/parser.ts",
"../compiler/binder.ts",
"../compiler/symbolWalker.ts",
+ "../compiler/moduleNameResolver.ts",
"../compiler/checker.ts",
"../compiler/factory.ts",
"../compiler/visitor.ts",
"../compiler/transformers/utilities.ts",
+ "../compiler/transformers/destructuring.ts",
"../compiler/transformers/ts.ts",
- "../compiler/transformers/jsx.ts",
- "../compiler/transformers/esnext.ts",
"../compiler/transformers/es2017.ts",
+ "../compiler/transformers/esnext.ts",
+ "../compiler/transformers/jsx.ts",
"../compiler/transformers/es2016.ts",
"../compiler/transformers/es2015.ts",
"../compiler/transformers/es5.ts",
"../compiler/transformers/generators.ts",
- "../compiler/transformers/es5.ts",
- "../compiler/transformers/destructuring.ts",
"../compiler/transformers/module/module.ts",
"../compiler/transformers/module/system.ts",
"../compiler/transformers/module/es2015.ts",
"../compiler/transformers/declarations/diagnostics.ts",
"../compiler/transformers/declarations.ts",
"../compiler/transformer.ts",
- "../compiler/comments.ts",
"../compiler/sourcemap.ts",
+ "../compiler/comments.ts",
"../compiler/emitter.ts",
+ "../compiler/watchUtilities.ts",
"../compiler/program.ts",
+ "../compiler/builderState.ts",
"../compiler/builder.ts",
+ "../compiler/resolutionCache.ts",
+ "../compiler/watch.ts",
"../compiler/commandLineParser.ts",
- "../compiler/diagnosticInformationMap.generated.ts",
- "../services/breakpoints.ts",
- "../services/navigateTo.ts",
- "../services/navigationBar.ts",
- "../services/outliningElementsCollector.ts",
- "../services/patternMatcher.ts",
+
+ "../services/types.ts",
+ "../services/utilities.ts",
+ "../services/classifier.ts",
"../services/pathCompletions.ts",
"../services/completions.ts",
- "../services/services.ts",
- "../services/shims.ts",
- "../services/signatureHelp.ts",
- "../services/utilities.ts",
+ "../services/documentHighlights.ts",
+ "../services/documentRegistry.ts",
+ "../services/importTracker.ts",
+ "../services/findAllReferences.ts",
+ "../services/goToDefinition.ts",
+ "../services/jsDoc.ts",
+ "../services/semver.ts",
"../services/jsTyping.ts",
- "../services/formatting/formatting.ts",
+ "../services/navigateTo.ts",
+ "../services/navigationBar.ts",
+ "../services/organizeImports.ts",
+ "../services/getEditsForFileRename.ts",
+ "../services/outliningElementsCollector.ts",
+ "../services/patternMatcher.ts",
+ "../services/preProcess.ts",
+ "../services/rename.ts",
+ "../services/signatureHelp.ts",
+ "../services/suggestionDiagnostics.ts",
+ "../services/symbolDisplay.ts",
+ "../services/transpile.ts",
"../services/formatting/formattingContext.ts",
"../services/formatting/formattingScanner.ts",
"../services/formatting/rule.ts",
"../services/formatting/rules.ts",
"../services/formatting/rulesMap.ts",
+ "../services/formatting/formatting.ts",
"../services/formatting/smartIndenter.ts",
+ "../services/textChanges.ts",
"../services/codeFixProvider.ts",
- "../services/codefixes/fixes.ts",
- "../services/codefixes/helpers.ts",
+ "../services/refactorProvider.ts",
+ "../services/codefixes/addMissingInvocationForDecorator.ts",
+ "../services/codefixes/annotateWithTypeFromJSDoc.ts",
+ "../services/codefixes/convertFunctionToEs6Class.ts",
+ "../services/codefixes/convertToEs6Module.ts",
+ "../services/codefixes/correctQualifiedNameToIndexedAccessType.ts",
+ "../services/codefixes/fixClassIncorrectlyImplementsInterface.ts",
"../services/codefixes/importFixes.ts",
+ "../services/codefixes/fixSpelling.ts",
+ "../services/codefixes/fixAddMissingMember.ts",
+ "../services/codefixes/fixCannotFindModule.ts",
+ "../services/codefixes/fixClassDoesntImplementInheritedAbstractMember.ts",
+ "../services/codefixes/fixClassSuperMustPrecedeThisAccess.ts",
+ "../services/codefixes/fixConstructorForDerivedNeedSuperCall.ts",
+ "../services/codefixes/fixExtendsInterfaceBecomesImplements.ts",
+ "../services/codefixes/fixForgottenThisPropertyAccess.ts",
"../services/codefixes/fixUnusedIdentifier.ts",
+ "../services/codefixes/fixJSDocTypes.ts",
+ "../services/codefixes/fixAwaitInSyncFunction.ts",
"../services/codefixes/disableJsDiagnostics.ts",
+ "../services/codefixes/helpers.ts",
+ "../services/codefixes/inferFromUsage.ts",
+ "../services/codefixes/fixInvalidImportSyntax.ts",
+ "../services/codefixes/fixStrictClassInitialization.ts",
+ "../services/codefixes/useDefaultImport.ts",
+ "../services/refactors/extractSymbol.ts",
+ "../services/refactors/generateGetAccessorAndSetAccessor.ts",
+ "../services/sourcemaps.ts",
+ "../services/services.ts",
+ "../services/breakpoints.ts",
+ "../services/transform.ts",
+ "../services/shims.ts",
+
+ "../server/typingsInstaller/typingsInstaller.ts",
+
+ "../server/types.ts",
+ "../server/shared.ts",
+ "../server/utilities.ts",
+ "../server/protocol.ts",
+ "../server/scriptInfo.ts",
+ "../server/typingsCache.ts",
+ "../server/project.ts",
+ "../server/editorServices.ts",
+ "../server/session.ts",
+ "../server/scriptVersionCache.ts",
- "harness.ts",
"sourceMapRecorder.ts",
- "harnessLanguageService.ts",
- "fourslash.ts",
"runnerbase.ts",
- "compilerRunner.ts",
- "typeWriter.ts",
+ "virtualFileSystem.ts",
+ "harness.ts",
+ "virtualFileSystemWithWatch.ts",
+ "harnessLanguageService.ts",
"fourslashRunner.ts",
+ "fourslash.ts",
+ "typeWriter.ts",
+ "compilerRunner.ts",
"projectsRunner.ts",
"loggedIO.ts",
"rwcRunner.ts",
"externalCompileRunner.ts",
"test262Runner.ts",
- "./parallel/shared.ts",
- "./parallel/host.ts",
- "./parallel/worker.ts",
- "runner.ts",
- "virtualFileSystemWithWatch.ts",
- "../server/protocol.ts",
- "../server/session.ts",
- "../server/client.ts",
- "../server/editorServices.ts",
- "./unittests/base64.ts",
- "./unittests/incrementalParser.ts",
- "./unittests/jsDocParsing.ts",
- "./unittests/services/colorization.ts",
- "./unittests/services/documentRegistry.ts",
- "./unittests/services/preProcessFile.ts",
- "./unittests/services/patternMatcher.ts",
- "./unittests/session.ts",
- "./unittests/symbolWalker.ts",
- "./unittests/versionCache.ts",
- "./unittests/convertToBase64.ts",
- "./unittests/transpile.ts",
- "./unittests/reuseProgramStructure.ts",
- "./unittests/moduleResolution.ts",
- "./unittests/tsconfigParsing.ts",
- "./unittests/asserts.ts",
- "./unittests/builder.ts",
- "./unittests/commandLineParsing.ts",
- "./unittests/configurationExtension.ts",
- "./unittests/convertCompilerOptionsFromJson.ts",
- "./unittests/convertTypeAcquisitionFromJson.ts",
- "./unittests/tsserverProjectSystem.ts",
- "./unittests/tscWatchMode.ts",
- "./unittests/matchFiles.ts",
- "./unittests/organizeImports.ts",
- "./unittests/initializeTSConfig.ts",
- "./unittests/compileOnSave.ts",
- "./unittests/typingsInstaller.ts",
- "./unittests/projectErrors.ts",
- "./unittests/printer.ts",
- "./unittests/transform.ts",
- "./unittests/customTransforms.ts",
- "./unittests/extractConstants.ts",
- "./unittests/extractFunctions.ts",
- "./unittests/extractRanges.ts",
- "./unittests/extractTestHelpers.ts",
- "./unittests/textChanges.ts",
- "./unittests/telemetry.ts",
- "./unittests/languageService.ts",
- "./unittests/programMissingFiles.ts",
- "./unittests/programNoParseFalsyFileNames.ts",
- "./unittests/publicApi.ts",
- "./unittests/hostNewLineSupport.ts"
- ]
+ "parallel/host.ts",
+ "parallel/worker.ts",
+ "parallel/shared.ts",
+ "runner.ts"
+ ],
+ "include": ["unittests/**.ts"]
}
diff --git a/src/harness/unittests/cancellableLanguageServiceOperations.ts b/src/harness/unittests/cancellableLanguageServiceOperations.ts
new file mode 100644
index 00000000000..7ae85ce2cba
--- /dev/null
+++ b/src/harness/unittests/cancellableLanguageServiceOperations.ts
@@ -0,0 +1,95 @@
+///
+
+namespace ts {
+ describe("cancellableLanguageServiceOperations", () => {
+ const file = `
+ function foo(): void;
+ function foo(x: T): T;
+ function foo(x?: T): T | void {}
+ foo(f);
+ `;
+ it("can cancel signature help mid-request", () => {
+ verifyOperationCancelledAfter(file, 4, service => // Two calls are top-level in services, one is the root type, and the second should be for the parameter type
+ service.getSignatureHelpItems("file.ts", file.lastIndexOf("f")),
+ r => assert.exists(r.items[0])
+ );
+ });
+
+ it("can cancel find all references mid-request", () => {
+ verifyOperationCancelledAfter(file, 3, service => // Two calls are top-level in services, one is the root type
+ service.findReferences("file.ts", file.lastIndexOf("o")),
+ r => assert.exists(r[0].definition)
+ );
+ });
+
+ it("can cancel quick info mid-request", () => {
+ verifyOperationCancelledAfter(file, 1, service => // The LS doesn't do any top-level checks on the token for quickinfo, so the first check is within the checker
+ service.getQuickInfoAtPosition("file.ts", file.lastIndexOf("o")),
+ r => assert.exists(r.displayParts)
+ );
+ });
+
+ it("can cancel completion entry details mid-request", () => {
+ const options: FormatCodeSettings = {
+ indentSize: 4,
+ tabSize: 4,
+ newLineCharacter: "\n",
+ convertTabsToSpaces: true,
+ indentStyle: IndentStyle.Smart,
+ insertSpaceAfterConstructor: false,
+ insertSpaceAfterCommaDelimiter: true,
+ insertSpaceAfterSemicolonInForStatements: true,
+ insertSpaceBeforeAndAfterBinaryOperators: true,
+ insertSpaceAfterKeywordsInControlFlowStatements: true,
+ insertSpaceAfterFunctionKeywordForAnonymousFunctions: false,
+ insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis: false,
+ insertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets: false,
+ insertSpaceAfterOpeningAndBeforeClosingNonemptyBraces: true,
+ insertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces: false,
+ insertSpaceAfterOpeningAndBeforeClosingJsxExpressionBraces: false,
+ insertSpaceBeforeFunctionParenthesis: false,
+ placeOpenBraceOnNewLineForFunctions: false,
+ placeOpenBraceOnNewLineForControlBlocks: false,
+ };
+ verifyOperationCancelledAfter(file, 1, service => // The LS doesn't do any top-level checks on the token for completion entry details, so the first check is within the checker
+ service.getCompletionEntryDetails("file.ts", file.lastIndexOf("f"), "foo", options, /*content*/ undefined, {}),
+ r => assert.exists(r.displayParts)
+ );
+ });
+ });
+
+ function verifyOperationCancelledAfter(content: string, cancelAfter: number, operation: (service: LanguageService) => T, validator: (arg: T) => void) {
+ let checks = 0;
+ const token: HostCancellationToken = {
+ isCancellationRequested() {
+ checks++;
+ const result = checks >= cancelAfter;
+ if (result) {
+ checks = -Infinity; // Cancel just once, then disable cancellation, effectively
+ }
+ return result;
+ }
+ };
+ const adapter = new Harness.LanguageService.NativeLanguageServiceAdapter(token);
+ const host = adapter.getHost();
+ host.addScript("file.ts", content, /*isRootFile*/ true);
+ const service = adapter.getLanguageService();
+ assertCancelled(() => operation(service));
+ validator(operation(service));
+ }
+
+ /**
+ * We don't just use `assert.throws` because it doesn't validate instances for thrown objects which do not inherit from `Error`
+ */
+ function assertCancelled(cb: () => void) {
+ let caught: any;
+ try {
+ cb();
+ }
+ catch (e) {
+ caught = e;
+ }
+ assert.exists(caught, "Expected operation to be cancelled, but was not");
+ assert.instanceOf(caught, OperationCanceledException);
+ }
+}
\ No newline at end of file
diff --git a/src/harness/unittests/organizeImports.ts b/src/harness/unittests/organizeImports.ts
index 3de5588af8e..7d496b97d99 100644
--- a/src/harness/unittests/organizeImports.ts
+++ b/src/harness/unittests/organizeImports.ts
@@ -247,6 +247,24 @@ import D from "lib";
},
libFile);
+ testOrganizeImports("Unused_false_positive_shorthand_assignment",
+ {
+ path: "/test.ts",
+ content: `
+import { x } from "a";
+const o = { x };
+`
+ });
+
+ testOrganizeImports("Unused_false_positive_export_shorthand",
+ {
+ path: "/test.ts",
+ content: `
+import { x } from "a";
+export { x };
+`
+ });
+
testOrganizeImports("MoveToTop",
{
path: "/test.ts",
diff --git a/src/harness/unittests/services/patternMatcher.ts b/src/harness/unittests/services/patternMatcher.ts
index a3e2d1d5cff..64de3557da4 100644
--- a/src/harness/unittests/services/patternMatcher.ts
+++ b/src/harness/unittests/services/patternMatcher.ts
@@ -95,376 +95,245 @@ describe("PatternMatcher", () => {
describe("SingleWordPattern", () => {
it("PreferCaseSensitiveExact", () => {
- const match = getFirstMatch("Foo", "Foo");
-
- assert.equal(ts.PatternMatchKind.exact, match.kind);
- assert.equal(true, match.isCaseSensitive);
+ assertSegmentMatch("Foo", "Foo", { kind: ts.PatternMatchKind.exact, isCaseSensitive: true });
});
it("PreferCaseSensitiveExactInsensitive", () => {
- const match = getFirstMatch("foo", "Foo");
-
- assert.equal(ts.PatternMatchKind.exact, match.kind);
- assert.equal(false, match.isCaseSensitive);
+ assertSegmentMatch("foo", "Foo", { kind: ts.PatternMatchKind.exact, isCaseSensitive: false });
});
it("PreferCaseSensitivePrefix", () => {
- const match = getFirstMatch("Foo", "Fo");
-
- assert.equal(ts.PatternMatchKind.prefix, match.kind);
- assert.equal(true, match.isCaseSensitive);
+ assertSegmentMatch("Foo", "Fo", { kind: ts.PatternMatchKind.prefix, isCaseSensitive: true });
});
it("PreferCaseSensitivePrefixCaseInsensitive", () => {
- const match = getFirstMatch("Foo", "fo");
-
- assert.equal(ts.PatternMatchKind.prefix, match.kind);
- assert.equal(false, match.isCaseSensitive);
+ assertSegmentMatch("Foo", "fo", { kind: ts.PatternMatchKind.prefix, isCaseSensitive: false });
});
it("PreferCaseSensitiveCamelCaseMatchSimple", () => {
- const match = getFirstMatch("FogBar", "FB");
-
- assert.equal(ts.PatternMatchKind.camelCase, match.kind);
- assert.equal(true, match.isCaseSensitive);
+ assertSegmentMatch("FogBar", "FB", { kind: ts.PatternMatchKind.camelCase, isCaseSensitive: true });
});
it("PreferCaseSensitiveCamelCaseMatchPartialPattern", () => {
- const match = getFirstMatch("FogBar", "FoB");
-
- assert.equal(ts.PatternMatchKind.camelCase, match.kind);
- assert.equal(true, match.isCaseSensitive);
+ assertSegmentMatch("FogBar", "FoB", { kind: ts.PatternMatchKind.camelCase, isCaseSensitive: true });
});
it("PreferCaseSensitiveCamelCaseMatchToLongPattern1", () => {
- const match = getFirstMatch("FogBar", "FBB");
-
- assert.isTrue(match === undefined);
+ assertSegmentMatch("FogBar", "FBB", undefined);
});
it("PreferCaseSensitiveCamelCaseMatchToLongPattern2", () => {
- const match = getFirstMatch("FogBar", "FoooB");
-
- assert.isTrue(match === undefined);
+ assertSegmentMatch("FogBar", "FoooB", undefined);
});
it("CamelCaseMatchPartiallyUnmatched", () => {
- const match = getFirstMatch("FogBarBaz", "FZ");
-
- assert.isTrue(match === undefined);
+ assertSegmentMatch("FogBarBaz", "FZ", undefined);
});
it("CamelCaseMatchCompletelyUnmatched", () => {
- const match = getFirstMatch("FogBarBaz", "ZZ");
-
- assert.isTrue(match === undefined);
+ assertSegmentMatch("FogBarBaz", "ZZ", undefined);
});
it("TwoUppercaseCharacters", () => {
- const match = getFirstMatch("SimpleUIElement", "SiUI");
-
- assert.equal(ts.PatternMatchKind.camelCase, match.kind);
- assert.equal(true, match.isCaseSensitive);
+ assertSegmentMatch("SimpleUIElement", "SiUI", { kind: ts.PatternMatchKind.camelCase, isCaseSensitive: true });
});
it("PreferCaseSensitiveLowercasePattern", () => {
- const match = getFirstMatch("FogBar", "b");
-
- assert.equal(ts.PatternMatchKind.substring, match.kind);
- assert.equal(false, match.isCaseSensitive);
+ assertSegmentMatch("FogBar", "b", { kind: ts.PatternMatchKind.substring, isCaseSensitive: false });
});
it("PreferCaseSensitiveLowercasePattern2", () => {
- const match = getFirstMatch("FogBar", "fB");
-
- assert.equal(ts.PatternMatchKind.camelCase, match.kind);
- assert.equal(false, match.isCaseSensitive);
+ assertSegmentMatch("FogBar", "fB", { kind: ts.PatternMatchKind.camelCase, isCaseSensitive: false });
});
it("PreferCaseSensitiveTryUnderscoredName", () => {
- const match = getFirstMatch("_fogBar", "_fB");
-
- assert.equal(ts.PatternMatchKind.camelCase, match.kind);
- assert.equal(true, match.isCaseSensitive);
+ assertSegmentMatch("_fogBar", "_fB", { kind: ts.PatternMatchKind.camelCase, isCaseSensitive: true });
});
it("PreferCaseSensitiveTryUnderscoredName2", () => {
- const match = getFirstMatch("_fogBar", "fB");
-
- assert.equal(ts.PatternMatchKind.camelCase, match.kind);
- assert.equal(true, match.isCaseSensitive);
+ assertSegmentMatch("_fogBar", "fB", { kind: ts.PatternMatchKind.camelCase, isCaseSensitive: true });
});
it("PreferCaseSensitiveTryUnderscoredNameInsensitive", () => {
- const match = getFirstMatch("_FogBar", "_fB");
-
- assert.equal(ts.PatternMatchKind.camelCase, match.kind);
- assert.equal(false, match.isCaseSensitive);
+ assertSegmentMatch("_FogBar", "_fB", { kind: ts.PatternMatchKind.camelCase, isCaseSensitive: false });
});
it("PreferCaseSensitiveMiddleUnderscore", () => {
- const match = getFirstMatch("Fog_Bar", "FB");
-
- assert.equal(ts.PatternMatchKind.camelCase, match.kind);
- assert.equal(true, match.isCaseSensitive);
+ assertSegmentMatch("Fog_Bar", "FB", { kind: ts.PatternMatchKind.camelCase, isCaseSensitive: true });
});
it("PreferCaseSensitiveMiddleUnderscore2", () => {
- const match = getFirstMatch("Fog_Bar", "F_B");
-
- assert.equal(ts.PatternMatchKind.camelCase, match.kind);
- assert.equal(true, match.isCaseSensitive);
+ assertSegmentMatch("Fog_Bar", "F_B", { kind: ts.PatternMatchKind.camelCase, isCaseSensitive: true });
});
it("PreferCaseSensitiveMiddleUnderscore3", () => {
- const match = getFirstMatch("Fog_Bar", "F__B");
-
- assert.isTrue(undefined === match);
+ assertSegmentMatch("Fog_Bar", "F__B", undefined);
});
it("PreferCaseSensitiveMiddleUnderscore4", () => {
- const match = getFirstMatch("Fog_Bar", "f_B");
-
- assert.equal(ts.PatternMatchKind.camelCase, match.kind);
- assert.equal(false, match.isCaseSensitive);
+ assertSegmentMatch("Fog_Bar", "f_B", { kind: ts.PatternMatchKind.camelCase, isCaseSensitive: false });
});
it("PreferCaseSensitiveMiddleUnderscore5", () => {
- const match = getFirstMatch("Fog_Bar", "F_b");
-
- assert.equal(ts.PatternMatchKind.camelCase, match.kind);
- assert.equal(false, match.isCaseSensitive);
+ assertSegmentMatch("Fog_Bar", "F_b", { kind: ts.PatternMatchKind.camelCase, isCaseSensitive: false });
});
it("AllLowerPattern1", () => {
- const match = getFirstMatch("FogBarChangedEventArgs", "changedeventargs");
-
- assert.isTrue(undefined !== match);
+ assertSegmentMatch("FogBarChangedEventArgs", "changedeventargs", { kind: ts.PatternMatchKind.substring, isCaseSensitive: false });
});
it("AllLowerPattern2", () => {
- const match = getFirstMatch("FogBarChangedEventArgs", "changedeventarrrgh");
-
- assert.isTrue(undefined === match);
+ assertSegmentMatch("FogBarChangedEventArgs", "changedeventarrrgh", undefined);
});
it("AllLowerPattern3", () => {
- const match = getFirstMatch("ABCDEFGH", "bcd");
-
- assert.isTrue(undefined !== match);
+ assertSegmentMatch("ABCDEFGH", "bcd", { kind: ts.PatternMatchKind.substring, isCaseSensitive: false });
});
it("AllLowerPattern4", () => {
- const match = getFirstMatch("AbcdefghijEfgHij", "efghij");
-
- assert.isTrue(undefined === match);
+ assertSegmentMatch("AbcdefghijEfgHij", "efghij", undefined);
});
});
describe("MultiWordPattern", () => {
it("ExactWithLowercase", () => {
- const matches = getAllMatches("AddMetadataReference", "addmetadatareference");
-
- assertContainsKind(ts.PatternMatchKind.exact, matches);
+ assertSegmentMatch("AddMetadataReference", "addmetadatareference", { kind: ts.PatternMatchKind.exact, isCaseSensitive: false });
});
it("SingleLowercasedSearchWord1", () => {
- const matches = getAllMatches("AddMetadataReference", "add");
-
- assertContainsKind(ts.PatternMatchKind.prefix, matches);
+ assertSegmentMatch("AddMetadataReference", "add", { kind: ts.PatternMatchKind.prefix, isCaseSensitive: false });
});
it("SingleLowercasedSearchWord2", () => {
- const matches = getAllMatches("AddMetadataReference", "metadata");
-
- assertContainsKind(ts.PatternMatchKind.substring, matches);
+ assertSegmentMatch("AddMetadataReference", "metadata", { kind: ts.PatternMatchKind.substring, isCaseSensitive: false });
});
it("SingleUppercaseSearchWord1", () => {
- const matches = getAllMatches("AddMetadataReference", "Add");
-
- assertContainsKind(ts.PatternMatchKind.prefix, matches);
+ assertSegmentMatch("AddMetadataReference", "Add", { kind: ts.PatternMatchKind.prefix, isCaseSensitive: true });
});
it("SingleUppercaseSearchWord2", () => {
- const matches = getAllMatches("AddMetadataReference", "Metadata");
-
- assertContainsKind(ts.PatternMatchKind.substring, matches);
+ assertSegmentMatch("AddMetadataReference", "Metadata", { kind: ts.PatternMatchKind.substring, isCaseSensitive: true });
});
it("SingleUppercaseSearchLetter1", () => {
- const matches = getAllMatches("AddMetadataReference", "A");
-
- assertContainsKind(ts.PatternMatchKind.prefix, matches);
+ assertSegmentMatch("AddMetadataReference", "A", { kind: ts.PatternMatchKind.prefix, isCaseSensitive: true });
});
it("SingleUppercaseSearchLetter2", () => {
- const matches = getAllMatches("AddMetadataReference", "M");
-
- assertContainsKind(ts.PatternMatchKind.substring, matches);
+ assertSegmentMatch("AddMetadataReference", "M", { kind: ts.PatternMatchKind.substring, isCaseSensitive: true });
});
- it("TwoLowercaseWords", () => {
- const matches = getAllMatches("AddMetadataReference", "add metadata");
-
- assertContainsKind(ts.PatternMatchKind.prefix, matches);
- assertContainsKind(ts.PatternMatchKind.substring, matches);
+ it("TwoLowercaseWords0", () => {
+ assertSegmentMatch("AddMetadataReference", "add metadata", { kind: ts.PatternMatchKind.prefix, isCaseSensitive: false });
});
- it("TwoLowercaseWords", () => {
- const matches = getAllMatches("AddMetadataReference", "A M");
-
- assertContainsKind(ts.PatternMatchKind.prefix, matches);
- assertContainsKind(ts.PatternMatchKind.substring, matches);
+ it("TwoLowercaseWords1", () => {
+ assertSegmentMatch("AddMetadataReference", "A M", { kind: ts.PatternMatchKind.prefix, isCaseSensitive: true });
});
- it("TwoLowercaseWords", () => {
- const matches = getAllMatches("AddMetadataReference", "AM");
-
- assertContainsKind(ts.PatternMatchKind.camelCase, matches);
+ it("TwoLowercaseWords2", () => {
+ assertSegmentMatch("AddMetadataReference", "AM", { kind: ts.PatternMatchKind.camelCase, isCaseSensitive: true });
});
- it("TwoLowercaseWords", () => {
- const matches = getAllMatches("AddMetadataReference", "ref Metadata");
-
- assertArrayEquals(ts.map(matches, m => m.kind), [ts.PatternMatchKind.substring, ts.PatternMatchKind.substring]);
+ it("TwoLowercaseWords3", () => {
+ assertSegmentMatch("AddMetadataReference", "ref Metadata", { kind: ts.PatternMatchKind.substring, isCaseSensitive: true });
});
- it("TwoLowercaseWords", () => {
- const matches = getAllMatches("AddMetadataReference", "ref M");
-
- assertArrayEquals(ts.map(matches, m => m.kind), [ts.PatternMatchKind.substring, ts.PatternMatchKind.substring]);
+ it("TwoLowercaseWords4", () => {
+ assertSegmentMatch("AddMetadataReference", "ref M", { kind: ts.PatternMatchKind.substring, isCaseSensitive: true });
});
it("MixedCamelCase", () => {
- const matches = getAllMatches("AddMetadataReference", "AMRe");
-
- assertContainsKind(ts.PatternMatchKind.camelCase, matches);
+ assertSegmentMatch("AddMetadataReference", "AMRe", { kind: ts.PatternMatchKind.camelCase, isCaseSensitive: true });
});
it("BlankPattern", () => {
- const matches = getAllMatches("AddMetadataReference", "");
-
- assert.isTrue(matches === undefined);
+ assertInvalidPattern("");
});
it("WhitespaceOnlyPattern", () => {
- const matches = getAllMatches("AddMetadataReference", " ");
-
- assert.isTrue(matches === undefined);
+ assertInvalidPattern(" ");
});
it("EachWordSeparately1", () => {
- const matches = getAllMatches("AddMetadataReference", "add Meta");
-
- assertContainsKind(ts.PatternMatchKind.prefix, matches);
- assertContainsKind(ts.PatternMatchKind.substring, matches);
+ assertSegmentMatch("AddMetadataReference", "add Meta", { kind: ts.PatternMatchKind.prefix, isCaseSensitive: false });
});
it("EachWordSeparately2", () => {
- const matches = getAllMatches("AddMetadataReference", "Add meta");
-
- assertContainsKind(ts.PatternMatchKind.prefix, matches);
- assertContainsKind(ts.PatternMatchKind.substring, matches);
+ assertSegmentMatch("AddMetadataReference", "Add meta", { kind: ts.PatternMatchKind.prefix, isCaseSensitive: true });
});
it("EachWordSeparately3", () => {
- const matches = getAllMatches("AddMetadataReference", "Add Meta");
-
- assertContainsKind(ts.PatternMatchKind.prefix, matches);
- assertContainsKind(ts.PatternMatchKind.substring, matches);
+ assertSegmentMatch("AddMetadataReference", "Add Meta", { kind: ts.PatternMatchKind.prefix, isCaseSensitive: true });
});
it("MixedCasing", () => {
- const matches = getAllMatches("AddMetadataReference", "mEta");
-
- assert.isTrue(matches === undefined);
+ assertSegmentMatch("AddMetadataReference", "mEta", undefined);
});
it("MixedCasing2", () => {
- const matches = getAllMatches("AddMetadataReference", "Data");
-
- assert.isTrue(matches === undefined);
+ assertSegmentMatch("AddMetadataReference", "Data", undefined);
});
it("AsteriskSplit", () => {
- const matches = getAllMatches("GetKeyWord", "K*W");
-
- assertArrayEquals(ts.map(matches, m => m.kind), [ts.PatternMatchKind.substring, ts.PatternMatchKind.substring]);
+ assertSegmentMatch("GetKeyWord", "K*W", { kind: ts.PatternMatchKind.substring, isCaseSensitive: true });
});
it("LowercaseSubstring1", () => {
- const matches = getAllMatches("Operator", "a");
-
- assert.isTrue(matches === undefined);
+ assertSegmentMatch("Operator", "a", undefined);
});
it("LowercaseSubstring2", () => {
- const matches = getAllMatches("FooAttribute", "a");
- assertContainsKind(ts.PatternMatchKind.substring, matches);
- assert.isFalse(matches[0].isCaseSensitive);
+ assertSegmentMatch("FooAttribute", "a", { kind: ts.PatternMatchKind.substring, isCaseSensitive: false });
});
});
describe("DottedPattern", () => {
it("DottedPattern1", () => {
- const match = getFirstMatchForDottedPattern("Foo.Bar.Baz", "Quux", "B.Q");
-
- assert.equal(ts.PatternMatchKind.prefix, match.kind);
- assert.equal(true, match.isCaseSensitive);
+ assertFullMatch("Foo.Bar.Baz", "Quux", "B.Q", { kind: ts.PatternMatchKind.prefix, isCaseSensitive: true });
});
it("DottedPattern2", () => {
- const match = getFirstMatchForDottedPattern("Foo.Bar.Baz", "Quux", "C.Q");
- assert.isTrue(match === undefined);
+ assertFullMatch("Foo.Bar.Baz", "Quux", "C.Q", undefined);
});
it("DottedPattern3", () => {
- const match = getFirstMatchForDottedPattern("Foo.Bar.Baz", "Quux", "B.B.Q");
- assert.equal(ts.PatternMatchKind.prefix, match.kind);
- assert.equal(true, match.isCaseSensitive);
+ assertFullMatch("Foo.Bar.Baz", "Quux", "B.B.Q", { kind: ts.PatternMatchKind.prefix, isCaseSensitive: true });
});
it("DottedPattern4", () => {
- const match = getFirstMatchForDottedPattern("Foo.Bar.Baz", "Quux", "Baz.Quux");
- assert.equal(ts.PatternMatchKind.exact, match.kind);
- assert.equal(true, match.isCaseSensitive);
+ assertFullMatch("Foo.Bar.Baz", "Quux", "Baz.Quux", { kind: ts.PatternMatchKind.exact, isCaseSensitive: true });
});
it("DottedPattern5", () => {
- const match = getFirstMatchForDottedPattern("Foo.Bar.Baz", "Quux", "F.B.B.Quux");
- assert.equal(ts.PatternMatchKind.exact, match.kind);
- assert.equal(true, match.isCaseSensitive);
+ assertFullMatch("Foo.Bar.Baz", "Quux", "F.B.B.Quux", { kind: ts.PatternMatchKind.prefix, isCaseSensitive: true });
});
it("DottedPattern6", () => {
- const match = getFirstMatchForDottedPattern("Foo.Bar.Baz", "Quux", "F.F.B.B.Quux");
- assert.isTrue(match === undefined);
+ assertFullMatch("Foo.Bar.Baz", "Quux", "F.F.B.B.Quux", undefined);
});
it("DottedPattern7", () => {
- let match = getFirstMatch("UIElement", "UIElement");
- match = getFirstMatch("GetKeyword", "UIElement");
- assert.isTrue(match === undefined);
+ assertSegmentMatch("UIElement", "UIElement", { kind: ts.PatternMatchKind.exact, isCaseSensitive: true });
+ assertSegmentMatch("GetKeyword", "UIElement", undefined);
});
});
- function getFirstMatch(candidate: string, pattern: string): ts.PatternMatch {
- const matches = ts.createPatternMatcher(pattern).getMatchesForLastSegmentOfPattern(candidate);
- return matches ? matches[0] : undefined;
+ function assertSegmentMatch(candidate: string, pattern: string, expected: ts.PatternMatch | undefined): void {
+ assert.deepEqual(ts.createPatternMatcher(pattern).getMatchForLastSegmentOfPattern(candidate), expected);
}
- function getAllMatches(candidate: string, pattern: string): ts.PatternMatch[] {
- return ts.createPatternMatcher(pattern).getMatchesForLastSegmentOfPattern(candidate);
+ function assertInvalidPattern(pattern: string) {
+ assert.equal(ts.createPatternMatcher(pattern), undefined);
}
- function getFirstMatchForDottedPattern(dottedContainer: string, candidate: string, pattern: string): ts.PatternMatch {
- const matches = ts.createPatternMatcher(pattern).getMatches(dottedContainer.split("."), candidate);
- return matches ? matches[0] : undefined;
+ function assertFullMatch(dottedContainer: string, candidate: string, pattern: string, expected: ts.PatternMatch | undefined): void {
+ assert.deepEqual(ts.createPatternMatcher(pattern).getFullMatch(dottedContainer.split("."), candidate), expected);
}
function spanListToSubstrings(identifier: string, spans: ts.TextSpan[]) {
- return ts.map(spans, s => identifier.substr(s.start, s.length));
+ return spans.map(s => identifier.substr(s.start, s.length));
}
function breakIntoCharacterSpans(identifier: string) {
@@ -474,23 +343,12 @@ describe("PatternMatcher", () => {
function breakIntoWordSpans(identifier: string) {
return spanListToSubstrings(identifier, ts.breakIntoWordSpans(identifier));
}
- function assertArrayEquals(array1: T[], array2: T[]) {
- assert.equal(array1.length, array2.length);
-
- for (let i = 0; i < array1.length; i++) {
- assert.equal(array1[i], array2[i]);
- }
- }
function verifyBreakIntoCharacterSpans(original: string, ...parts: string[]): void {
- assertArrayEquals(parts, breakIntoCharacterSpans(original));
+ assert.deepEqual(parts, breakIntoCharacterSpans(original));
}
function verifyBreakIntoWordSpans(original: string, ...parts: string[]): void {
- assertArrayEquals(parts, breakIntoWordSpans(original));
- }
-
- function assertContainsKind(kind: ts.PatternMatchKind, results: ts.PatternMatch[]) {
- assert.isTrue(ts.forEach(results, r => r.kind === kind));
+ assert.deepEqual(parts, breakIntoWordSpans(original));
}
});
diff --git a/src/harness/unittests/services/preProcessFile.ts b/src/harness/unittests/services/preProcessFile.ts
index 1e13bc3e345..76b1e4f05a6 100644
--- a/src/harness/unittests/services/preProcessFile.ts
+++ b/src/harness/unittests/services/preProcessFile.ts
@@ -59,6 +59,32 @@ describe("PreProcessFile:", () => {
});
}),
+ it("Do not return reference path of non-imports", () => {
+ test("Quill.import('delta');",
+ /*readImportFile*/ true,
+ /*detectJavaScriptImports*/ false,
+ {
+ referencedFiles: [],
+ importedFiles: [],
+ typeReferenceDirectives: [],
+ ambientExternalModules: undefined,
+ isLibFile: false
+ });
+ }),
+
+ it("Do not return reference path of nested non-imports", () => {
+ test("a.b.import('c');",
+ /*readImportFile*/ true,
+ /*detectJavaScriptImports*/ false,
+ {
+ referencedFiles: [],
+ importedFiles: [],
+ typeReferenceDirectives: [],
+ ambientExternalModules: undefined,
+ isLibFile: false
+ });
+ }),
+
it("Correctly return imported files", () => {
test("import i1 = require(\"r1.ts\"); import i2 =require(\"r2.ts\"); import i3= require(\"r3.ts\"); import i4=require(\"r4.ts\"); import i5 = require (\"r5.ts\");",
/*readImportFile*/ true,
diff --git a/src/harness/unittests/session.ts b/src/harness/unittests/session.ts
index a892d28808c..25df6f72ea6 100644
--- a/src/harness/unittests/session.ts
+++ b/src/harness/unittests/session.ts
@@ -263,6 +263,8 @@ namespace ts.server {
CommandNames.GetEditsForRefactorFull,
CommandNames.OrganizeImports,
CommandNames.OrganizeImportsFull,
+ CommandNames.GetEditsForFileRename,
+ CommandNames.GetEditsForFileRenameFull,
];
it("should not throw when commands are executed with invalid arguments", () => {
diff --git a/src/harness/unittests/tscWatchMode.ts b/src/harness/unittests/tscWatchMode.ts
index 99bad3e3091..44565c0ddbe 100644
--- a/src/harness/unittests/tscWatchMode.ts
+++ b/src/harness/unittests/tscWatchMode.ts
@@ -124,14 +124,17 @@ namespace ts.tscWatch {
}
function getWatchDiagnosticWithoutDate(diagnostic: Diagnostic) {
- return ` - ${flattenDiagnosticMessageText(diagnostic.messageText, host.newLine)}${host.newLine + host.newLine + host.newLine}`;
+ const newLines = contains(screenStartingMessageCodes, diagnostic.code)
+ ? `${host.newLine}${host.newLine}`
+ : host.newLine;
+ return ` - ${flattenDiagnosticMessageText(diagnostic.messageText, host.newLine)}${newLines}`;
}
}
function createErrorsFoundCompilerDiagnostic(errors: ReadonlyArray) {
return errors.length === 1
- ? createCompilerDiagnostic(Diagnostics.Found_1_error)
- : createCompilerDiagnostic(Diagnostics.Found_0_errors, errors.length);
+ ? createCompilerDiagnostic(Diagnostics.Found_1_error_Watching_for_file_changes)
+ : createCompilerDiagnostic(Diagnostics.Found_0_errors_Watching_for_file_changes, errors.length);
}
function checkOutputErrorsInitial(host: WatchedSystem, errors: ReadonlyArray, disableConsoleClears?: boolean, logsBeforeErrors?: string[]) {
@@ -142,8 +145,7 @@ namespace ts.tscWatch {
logsBeforeErrors,
errors,
disableConsoleClears,
- createErrorsFoundCompilerDiagnostic(errors),
- createCompilerDiagnostic(Diagnostics.Compilation_complete_Watching_for_file_changes));
+ createErrorsFoundCompilerDiagnostic(errors));
}
function checkOutputErrorsIncremental(host: WatchedSystem, errors: ReadonlyArray, disableConsoleClears?: boolean, logsBeforeWatchDiagnostic?: string[], logsBeforeErrors?: string[]) {
@@ -154,8 +156,7 @@ namespace ts.tscWatch {
logsBeforeErrors,
errors,
disableConsoleClears,
- createErrorsFoundCompilerDiagnostic(errors),
- createCompilerDiagnostic(Diagnostics.Compilation_complete_Watching_for_file_changes));
+ createErrorsFoundCompilerDiagnostic(errors));
}
function checkOutputErrorsIncrementalWithExit(host: WatchedSystem, errors: ReadonlyArray, expectedExitCode: ExitStatus, disableConsoleClears?: boolean, logsBeforeWatchDiagnostic?: string[], logsBeforeErrors?: string[]) {
diff --git a/src/harness/unittests/tsserverProjectSystem.ts b/src/harness/unittests/tsserverProjectSystem.ts
index 8170c663b1f..1c0dd0beb5c 100644
--- a/src/harness/unittests/tsserverProjectSystem.ts
+++ b/src/harness/unittests/tsserverProjectSystem.ts
@@ -13,7 +13,9 @@ namespace ts.projectSystem {
export import checkArray = TestFSWithWatch.checkArray;
export import libFile = TestFSWithWatch.libFile;
export import checkWatchedFiles = TestFSWithWatch.checkWatchedFiles;
- import checkWatchedDirectories = TestFSWithWatch.checkWatchedDirectories;
+ export import checkWatchedFilesDetailed = TestFSWithWatch.checkWatchedFilesDetailed;
+ export import checkWatchedDirectories = TestFSWithWatch.checkWatchedDirectories;
+ export import checkWatchedDirectoriesDetailed = TestFSWithWatch.checkWatchedDirectoriesDetailed;
import safeList = TestFSWithWatch.safeList;
export const customTypesMap = {
@@ -478,6 +480,10 @@ namespace ts.projectSystem {
checkNthEvent(session, server.toEvent(eventName, diagnostics), 0, isMostRecent);
}
+ function createDiagnostic(start: protocol.Location, end: protocol.Location, message: DiagnosticMessage, args: ReadonlyArray = [], category = diagnosticCategoryName(message), reportsUnnecessary?: {}): protocol.Diagnostic {
+ return { start, end, text: formatStringFromArgs(message.message, args), code: message.code, category, reportsUnnecessary, source: undefined };
+ }
+
function checkCompleteEvent(session: TestSession, numberOfCurrentEvents: number, expectedSequenceId: number, isMostRecent = true): void {
checkNthEvent(session, server.toEvent("requestCompleted", { request_seq: expectedSequenceId }), numberOfCurrentEvents - 1, isMostRecent);
}
@@ -494,7 +500,7 @@ namespace ts.projectSystem {
function checkNthEvent(session: TestSession, expectedEvent: protocol.Event, index: number, isMostRecent: boolean) {
const events = session.events;
- assert.deepEqual(events[index], expectedEvent);
+ assert.deepEqual(events[index], expectedEvent, `Expected ${JSON.stringify(expectedEvent)} at ${index} in ${JSON.stringify(events)}`);
const outputs = session.host.getOutput();
assert.equal(outputs[index], server.formatMessage(expectedEvent, nullLogger, Utils.byteLength, session.host.newLine));
@@ -3331,6 +3337,89 @@ namespace ts.projectSystem {
checkCompleteEvent(session, 1, expectedSequenceId);
session.clearMessages();
});
+
+ it("Reports errors correctly when file referenced by inferred project root, is opened right after closing the root file", () => {
+ const projectRoot = "/user/username/projects/myproject";
+ const app: FileOrFolder = {
+ path: `${projectRoot}/src/client/app.js`,
+ content: ""
+ };
+ const serverUtilities: FileOrFolder = {
+ path: `${projectRoot}/src/server/utilities.js`,
+ content: `function getHostName() { return "hello"; } export { getHostName };`
+ };
+ const backendTest: FileOrFolder = {
+ path: `${projectRoot}/test/backend/index.js`,
+ content: `import { getHostName } from '../../src/server/utilities';export default getHostName;`
+ };
+ const files = [libFile, app, serverUtilities, backendTest];
+ const host = createServerHost(files);
+ const session = createSession(host, { useInferredProjectPerProjectRoot: true, canUseEvents: true });
+ session.executeCommandSeq({
+ command: protocol.CommandTypes.Open,
+ arguments: {
+ file: app.path,
+ projectRootPath: projectRoot
+ }
+ });
+ const service = session.getProjectService();
+ checkNumberOfProjects(service, { inferredProjects: 1 });
+ const project = service.inferredProjects[0];
+ checkProjectActualFiles(project, [libFile.path, app.path]);
+ session.executeCommandSeq({
+ command: protocol.CommandTypes.Open,
+ arguments: {
+ file: backendTest.path,
+ projectRootPath: projectRoot
+ }
+ });
+ checkNumberOfProjects(service, { inferredProjects: 1 });
+ checkProjectActualFiles(project, files.map(f => f.path));
+ checkErrors([backendTest.path, app.path]);
+ session.executeCommandSeq({
+ command: protocol.CommandTypes.Close,
+ arguments: {
+ file: backendTest.path
+ }
+ });
+ session.executeCommandSeq({
+ command: protocol.CommandTypes.Open,
+ arguments: {
+ file: serverUtilities.path,
+ projectRootPath: projectRoot
+ }
+ });
+ checkErrors([serverUtilities.path, app.path]);
+
+ function checkErrors(openFiles: [string, string]) {
+ const expectedSequenceId = session.getNextSeq();
+ session.executeCommandSeq({
+ command: protocol.CommandTypes.Geterr,
+ arguments: {
+ delay: 0,
+ files: openFiles
+ }
+ });
+
+ for (const openFile of openFiles) {
+ session.clearMessages();
+ host.checkTimeoutQueueLength(3);
+ host.runQueuedTimeoutCallbacks(host.getNextTimeoutId() - 1);
+
+ checkErrorMessage(session, "syntaxDiag", { file: openFile, diagnostics: [] });
+ session.clearMessages();
+
+ host.runQueuedImmediateCallbacks();
+ checkErrorMessage(session, "semanticDiag", { file: openFile, diagnostics: [] });
+ session.clearMessages();
+
+ host.runQueuedImmediateCallbacks(1);
+ checkErrorMessage(session, "suggestionDiag", { file: openFile, diagnostics: [] });
+ }
+ checkCompleteEvent(session, 2, expectedSequenceId);
+ session.clearMessages();
+ }
+ });
});
describe("tsserverProjectSystem autoDiscovery", () => {
@@ -4131,10 +4220,10 @@ namespace ts.projectSystem {
checkErrorMessage(session, "semanticDiag", { file: file1.path, diagnostics: [] });
});
- it("info diagnostics", () => {
+ it("suggestion diagnostics", () => {
const file: FileOrFolder = {
path: "/a.js",
- content: 'require("b")',
+ content: "function f(p) {}",
};
const host = createServerHost([file]);
@@ -4177,13 +4266,64 @@ namespace ts.projectSystem {
checkErrorMessage(session, "suggestionDiag", {
file: file.path,
diagnostics: [
- createDiagnostic({ line: 1, offset: 1 }, { line: 1, offset: 13 }, Diagnostics.File_is_a_CommonJS_module_it_may_be_converted_to_an_ES6_module)
+ createDiagnostic({ line: 1, offset: 12 }, { line: 1, offset: 13 }, Diagnostics._0_is_declared_but_its_value_is_never_read, ["p"], "suggestion", /*reportsUnnecssary*/ true)
],
});
checkCompleteEvent(session, 2, expectedSequenceId);
session.clearMessages();
});
+ it("disable suggestion diagnostics", () => {
+ const file: FileOrFolder = {
+ path: "/a.js",
+ content: 'require("b")',
+ };
+
+ const host = createServerHost([file]);
+ const session = createSession(host, { canUseEvents: true });
+ const service = session.getProjectService();
+
+ session.executeCommandSeq({
+ command: server.CommandNames.Open,
+ arguments: { file: file.path, fileContent: file.content },
+ });
+
+ session.executeCommandSeq({
+ command: server.CommandNames.Configure,
+ arguments: {
+ preferences: { disableSuggestions: true }
+ },
+ });
+
+ checkNumberOfProjects(service, { inferredProjects: 1 });
+ session.clearMessages();
+ const expectedSequenceId = session.getNextSeq();
+ host.checkTimeoutQueueLengthAndRun(2);
+
+ checkProjectUpdatedInBackgroundEvent(session, [file.path]);
+ session.clearMessages();
+
+ session.executeCommandSeq({
+ command: server.CommandNames.Geterr,
+ arguments: {
+ delay: 0,
+ files: [file.path],
+ }
+ });
+
+ host.checkTimeoutQueueLengthAndRun(1);
+
+ checkErrorMessage(session, "syntaxDiag", { file: file.path, diagnostics: [] }, /*isMostRecent*/ true);
+ session.clearMessages();
+
+ host.runQueuedImmediateCallbacks(1);
+
+ checkErrorMessage(session, "semanticDiag", { file: file.path, diagnostics: [] });
+ // No suggestion event, we're done.
+ checkCompleteEvent(session, 2, expectedSequenceId);
+ session.clearMessages();
+ });
+
it("suppressed diagnostic events", () => {
const file: FileOrFolder = {
path: "/a.ts",
@@ -4240,10 +4380,6 @@ namespace ts.projectSystem {
session.clearMessages();
});
-
- function createDiagnostic(start: protocol.Location, end: protocol.Location, message: DiagnosticMessage, args: ReadonlyArray = []): protocol.Diagnostic {
- return { start, end, text: formatStringFromArgs(message.message, args), code: message.code, category: diagnosticCategoryName(message), source: undefined };
- }
});
describe("tsserverProjectSystem Configure file diagnostics events", () => {
@@ -7243,7 +7379,6 @@ namespace ts.projectSystem {
const host = createServerHost(files);
const session = createSession(host);
const projectService = session.getProjectService();
- debugger;
session.executeCommandSeq({
command: protocol.CommandTypes.Open,
arguments: {
@@ -7771,8 +7906,8 @@ namespace ts.projectSystem {
checkWatchedDirectories(host, emptyArray, /*recursive*/ true);
- TestFSWithWatch.checkMultiMapKeyCount("watchedFiles", host.watchedFiles, expectedWatchedFiles);
- TestFSWithWatch.checkMultiMapKeyCount("watchedDirectories", host.watchedDirectories, expectedWatchedDirectories);
+ checkWatchedFilesDetailed(host, expectedWatchedFiles);
+ checkWatchedDirectoriesDetailed(host, expectedWatchedDirectories, /*recursive*/ false);
checkProjectActualFiles(project, fileNames);
}
}
diff --git a/src/harness/unittests/typingsInstaller.ts b/src/harness/unittests/typingsInstaller.ts
index 9b874b2aca6..a8c7d4895d1 100644
--- a/src/harness/unittests/typingsInstaller.ts
+++ b/src/harness/unittests/typingsInstaller.ts
@@ -141,7 +141,19 @@ namespace ts.projectSystem {
checkNumberOfProjects(projectService, { configuredProjects: 1 });
const p = configuredProjectAt(projectService, 0);
checkProjectActualFiles(p, [file1.path, tsconfig.path]);
- checkWatchedFiles(host, [tsconfig.path, libFile.path, packageJson.path, "/a/b/bower_components", "/a/b/node_modules"]);
+
+ const expectedWatchedFiles = createMap();
+ expectedWatchedFiles.set(tsconfig.path, 1); // tsserver
+ expectedWatchedFiles.set(libFile.path, 1); // tsserver
+ expectedWatchedFiles.set(packageJson.path, 1); // typing installer
+ checkWatchedFilesDetailed(host, expectedWatchedFiles);
+
+ checkWatchedDirectories(host, emptyArray, /*recursive*/ false);
+
+ const expectedWatchedDirectoriesRecursive = createMap();
+ expectedWatchedDirectoriesRecursive.set("/a/b", 2); // TypingInstaller and wild card
+ expectedWatchedDirectoriesRecursive.set("/a/b/node_modules/@types", 1); // type root watch
+ checkWatchedDirectoriesDetailed(host, expectedWatchedDirectoriesRecursive, /*recursive*/ true);
installer.installAll(/*expectedCount*/ 1);
@@ -149,7 +161,9 @@ namespace ts.projectSystem {
host.checkTimeoutQueueLengthAndRun(2);
checkProjectActualFiles(p, [file1.path, jquery.path, tsconfig.path]);
// should not watch jquery
- checkWatchedFiles(host, [tsconfig.path, libFile.path, packageJson.path, "/a/b/bower_components", "/a/b/node_modules"]);
+ checkWatchedFilesDetailed(host, expectedWatchedFiles);
+ checkWatchedDirectories(host, emptyArray, /*recursive*/ false);
+ checkWatchedDirectoriesDetailed(host, expectedWatchedDirectoriesRecursive, /*recursive*/ true);
});
it("inferred project (typings installed)", () => {
@@ -827,7 +841,17 @@ namespace ts.projectSystem {
checkNumberOfProjects(projectService, { configuredProjects: 1 });
const p = configuredProjectAt(projectService, 0);
checkProjectActualFiles(p, [app.path, jsconfig.path]);
- checkWatchedFiles(host, [jsconfig.path, "/bower_components", "/node_modules", libFile.path]);
+
+ const watchedFilesExpected = createMap();
+ watchedFilesExpected.set(jsconfig.path, 1); // project files
+ watchedFilesExpected.set(libFile.path, 1); // project files
+ checkWatchedFilesDetailed(host, watchedFilesExpected);
+
+ checkWatchedDirectories(host, emptyArray, /*recursive*/ false);
+
+ const watchedRecursiveDirectoriesExpected = createMap();
+ watchedRecursiveDirectoriesExpected.set("/", 2); // wild card + type installer
+ checkWatchedDirectoriesDetailed(host, watchedRecursiveDirectoriesExpected, /*recursive*/ true);
installer.installAll(/*expectedCount*/ 1);
@@ -999,14 +1023,14 @@ namespace ts.projectSystem {
proj.updateGraph();
assert.deepEqual(
- proj.getCachedUnresolvedImportsPerFile_TestOnly().get(f1.path),
+ proj.cachedUnresolvedImportsPerFile.get(f1.path),
["foo", "foo", "foo", "@bar/router", "@bar/common", "@bar/common"]
);
installer.installAll(/*expectedCount*/ 1);
});
- it("should recompute resolutions after typings are installed", () => {
+ it("cached unresolved typings are not recomputed if program structure did not change", () => {
const host = createServerHost([]);
const session = createSession(host);
const f = {
@@ -1029,7 +1053,7 @@ namespace ts.projectSystem {
const projectService = session.getProjectService();
checkNumberOfProjects(projectService, { inferredProjects: 1 });
const proj = projectService.inferredProjects[0];
- const version1 = proj.getCachedUnresolvedImportsPerFile_TestOnly().getVersion();
+ const version1 = proj.lastCachedUnresolvedImportsList;
// make a change that should not affect the structure of the program
const changeRequest: server.protocol.ChangeRequest = {
@@ -1047,8 +1071,8 @@ namespace ts.projectSystem {
};
session.executeCommand(changeRequest);
host.checkTimeoutQueueLengthAndRun(2); // This enqueues the updategraph and refresh inferred projects
- const version2 = proj.getCachedUnresolvedImportsPerFile_TestOnly().getVersion();
- assert.notEqual(version1, version2, "set of unresolved imports should change");
+ const version2 = proj.lastCachedUnresolvedImportsList;
+ assert.strictEqual(version1, version2, "set of unresolved imports should change");
});
it("expired cache entry (inferred project, should install typings)", () => {
@@ -1593,4 +1617,103 @@ namespace ts.projectSystem {
checkProjectActualFiles(projectService.inferredProjects[0], [f1.path]);
});
});
+
+ describe("typing installer's npm installation command", () => {
+ const npmPath = "npm", tsVersion = "2.9.0-dev.20180410";
+ const packageNames = ["@types/graphql@ts2.8", "@types/highlight.js@ts2.8", "@types/jest@ts2.8", "@types/mini-css-extract-plugin@ts2.8", "@types/mongoose@ts2.8", "@types/pg@ts2.8", "@types/webpack-bundle-analyzer@ts2.8", "@types/enhanced-resolve@ts2.8", "@types/eslint-plugin-prettier@ts2.8", "@types/friendly-errors-webpack-plugin@ts2.8", "@types/hammerjs@ts2.8", "@types/history@ts2.8", "@types/image-size@ts2.8", "@types/js-cookie@ts2.8", "@types/koa-compress@ts2.8", "@types/less@ts2.8", "@types/material-ui@ts2.8", "@types/mysql@ts2.8", "@types/nodemailer@ts2.8", "@types/prettier@ts2.8", "@types/query-string@ts2.8", "@types/react-places-autocomplete@ts2.8", "@types/react-router@ts2.8", "@types/react-router-config@ts2.8", "@types/react-select@ts2.8", "@types/react-transition-group@ts2.8", "@types/redux-form@ts2.8", "@types/abbrev@ts2.8", "@types/accepts@ts2.8", "@types/acorn@ts2.8", "@types/ansi-regex@ts2.8", "@types/ansi-styles@ts2.8", "@types/anymatch@ts2.8", "@types/apollo-codegen@ts2.8", "@types/are-we-there-yet@ts2.8", "@types/argparse@ts2.8", "@types/arr-union@ts2.8", "@types/array-find-index@ts2.8", "@types/array-uniq@ts2.8", "@types/array-unique@ts2.8", "@types/arrify@ts2.8", "@types/assert-plus@ts2.8", "@types/async@ts2.8", "@types/autoprefixer@ts2.8", "@types/aws4@ts2.8", "@types/babel-code-frame@ts2.8", "@types/babel-generator@ts2.8", "@types/babel-plugin-syntax-jsx@ts2.8", "@types/babel-template@ts2.8", "@types/babel-traverse@ts2.8", "@types/babel-types@ts2.8", "@types/babylon@ts2.8", "@types/base64-js@ts2.8", "@types/basic-auth@ts2.8", "@types/big.js@ts2.8", "@types/bl@ts2.8", "@types/bluebird@ts2.8", "@types/body-parser@ts2.8", "@types/bonjour@ts2.8", "@types/boom@ts2.8", "@types/brace-expansion@ts2.8", "@types/braces@ts2.8", "@types/brorand@ts2.8", "@types/browser-resolve@ts2.8", "@types/bson@ts2.8", "@types/buffer-equal@ts2.8", "@types/builtin-modules@ts2.8", "@types/bytes@ts2.8", "@types/callsites@ts2.8", "@types/camelcase@ts2.8", "@types/camelcase-keys@ts2.8", "@types/caseless@ts2.8", "@types/change-emitter@ts2.8", "@types/check-types@ts2.8", "@types/cheerio@ts2.8", "@types/chokidar@ts2.8", "@types/chownr@ts2.8", "@types/circular-json@ts2.8", "@types/classnames@ts2.8", "@types/clean-css@ts2.8", "@types/clone@ts2.8", "@types/co-body@ts2.8", "@types/color@ts2.8", "@types/color-convert@ts2.8", "@types/color-name@ts2.8", "@types/color-string@ts2.8", "@types/colors@ts2.8", "@types/combined-stream@ts2.8", "@types/common-tags@ts2.8", "@types/component-emitter@ts2.8", "@types/compressible@ts2.8", "@types/compression@ts2.8", "@types/concat-stream@ts2.8", "@types/connect-history-api-fallback@ts2.8", "@types/content-disposition@ts2.8", "@types/content-type@ts2.8", "@types/convert-source-map@ts2.8", "@types/cookie@ts2.8", "@types/cookie-signature@ts2.8", "@types/cookies@ts2.8", "@types/core-js@ts2.8", "@types/cosmiconfig@ts2.8", "@types/create-react-class@ts2.8", "@types/cross-spawn@ts2.8", "@types/cryptiles@ts2.8", "@types/css-modules-require-hook@ts2.8", "@types/dargs@ts2.8", "@types/dateformat@ts2.8", "@types/debug@ts2.8", "@types/decamelize@ts2.8", "@types/decompress@ts2.8", "@types/decompress-response@ts2.8", "@types/deep-equal@ts2.8", "@types/deep-extend@ts2.8", "@types/deepmerge@ts2.8", "@types/defined@ts2.8", "@types/del@ts2.8", "@types/depd@ts2.8", "@types/destroy@ts2.8", "@types/detect-indent@ts2.8", "@types/detect-newline@ts2.8", "@types/diff@ts2.8", "@types/doctrine@ts2.8", "@types/download@ts2.8", "@types/draft-js@ts2.8", "@types/duplexer2@ts2.8", "@types/duplexer3@ts2.8", "@types/duplexify@ts2.8", "@types/ejs@ts2.8", "@types/end-of-stream@ts2.8", "@types/entities@ts2.8", "@types/escape-html@ts2.8", "@types/escape-string-regexp@ts2.8", "@types/escodegen@ts2.8", "@types/eslint-scope@ts2.8", "@types/eslint-visitor-keys@ts2.8", "@types/esprima@ts2.8", "@types/estraverse@ts2.8", "@types/etag@ts2.8", "@types/events@ts2.8", "@types/execa@ts2.8", "@types/exenv@ts2.8", "@types/exit@ts2.8", "@types/exit-hook@ts2.8", "@types/expect@ts2.8", "@types/express@ts2.8", "@types/express-graphql@ts2.8", "@types/extend@ts2.8", "@types/extract-zip@ts2.8", "@types/fancy-log@ts2.8", "@types/fast-diff@ts2.8", "@types/fast-levenshtein@ts2.8", "@types/figures@ts2.8", "@types/file-type@ts2.8", "@types/filenamify@ts2.8", "@types/filesize@ts2.8", "@types/finalhandler@ts2.8", "@types/find-root@ts2.8", "@types/find-up@ts2.8", "@types/findup-sync@ts2.8", "@types/forever-agent@ts2.8", "@types/form-data@ts2.8", "@types/forwarded@ts2.8", "@types/fresh@ts2.8", "@types/from2@ts2.8", "@types/fs-extra@ts2.8", "@types/get-caller-file@ts2.8", "@types/get-stdin@ts2.8", "@types/get-stream@ts2.8", "@types/get-value@ts2.8", "@types/glob-base@ts2.8", "@types/glob-parent@ts2.8", "@types/glob-stream@ts2.8", "@types/globby@ts2.8", "@types/globule@ts2.8", "@types/got@ts2.8", "@types/graceful-fs@ts2.8", "@types/gulp-rename@ts2.8", "@types/gulp-sourcemaps@ts2.8", "@types/gulp-util@ts2.8", "@types/gzip-size@ts2.8", "@types/handlebars@ts2.8", "@types/has-ansi@ts2.8", "@types/hasha@ts2.8", "@types/he@ts2.8", "@types/hoek@ts2.8", "@types/html-entities@ts2.8", "@types/html-minifier@ts2.8", "@types/htmlparser2@ts2.8", "@types/http-assert@ts2.8", "@types/http-errors@ts2.8", "@types/http-proxy@ts2.8", "@types/http-proxy-middleware@ts2.8", "@types/indent-string@ts2.8", "@types/inflected@ts2.8", "@types/inherits@ts2.8", "@types/ini@ts2.8", "@types/inline-style-prefixer@ts2.8", "@types/inquirer@ts2.8", "@types/internal-ip@ts2.8", "@types/into-stream@ts2.8", "@types/invariant@ts2.8", "@types/ip@ts2.8", "@types/ip-regex@ts2.8", "@types/is-absolute-url@ts2.8", "@types/is-binary-path@ts2.8", "@types/is-finite@ts2.8", "@types/is-glob@ts2.8", "@types/is-my-json-valid@ts2.8", "@types/is-number@ts2.8", "@types/is-object@ts2.8", "@types/is-path-cwd@ts2.8", "@types/is-path-in-cwd@ts2.8", "@types/is-promise@ts2.8", "@types/is-scoped@ts2.8", "@types/is-stream@ts2.8", "@types/is-svg@ts2.8", "@types/is-url@ts2.8", "@types/is-windows@ts2.8", "@types/istanbul-lib-coverage@ts2.8", "@types/istanbul-lib-hook@ts2.8", "@types/istanbul-lib-instrument@ts2.8", "@types/istanbul-lib-report@ts2.8", "@types/istanbul-lib-source-maps@ts2.8", "@types/istanbul-reports@ts2.8", "@types/jest-diff@ts2.8", "@types/jest-docblock@ts2.8", "@types/jest-get-type@ts2.8", "@types/jest-matcher-utils@ts2.8", "@types/jest-validate@ts2.8", "@types/jpeg-js@ts2.8", "@types/js-base64@ts2.8", "@types/js-string-escape@ts2.8", "@types/js-yaml@ts2.8", "@types/jsbn@ts2.8", "@types/jsdom@ts2.8", "@types/jsesc@ts2.8", "@types/json-parse-better-errors@ts2.8", "@types/json-schema@ts2.8", "@types/json-stable-stringify@ts2.8", "@types/json-stringify-safe@ts2.8", "@types/json5@ts2.8", "@types/jsonfile@ts2.8", "@types/jsontoxml@ts2.8", "@types/jss@ts2.8", "@types/keygrip@ts2.8", "@types/keymirror@ts2.8", "@types/keyv@ts2.8", "@types/klaw@ts2.8", "@types/koa-send@ts2.8", "@types/leven@ts2.8", "@types/listr@ts2.8", "@types/load-json-file@ts2.8", "@types/loader-runner@ts2.8", "@types/loader-utils@ts2.8", "@types/locate-path@ts2.8", "@types/lodash-es@ts2.8", "@types/lodash.assign@ts2.8", "@types/lodash.camelcase@ts2.8", "@types/lodash.clonedeep@ts2.8", "@types/lodash.debounce@ts2.8", "@types/lodash.escape@ts2.8", "@types/lodash.flowright@ts2.8", "@types/lodash.get@ts2.8", "@types/lodash.isarguments@ts2.8", "@types/lodash.isarray@ts2.8", "@types/lodash.isequal@ts2.8", "@types/lodash.isobject@ts2.8", "@types/lodash.isstring@ts2.8", "@types/lodash.keys@ts2.8", "@types/lodash.memoize@ts2.8", "@types/lodash.merge@ts2.8", "@types/lodash.mergewith@ts2.8", "@types/lodash.pick@ts2.8", "@types/lodash.sortby@ts2.8", "@types/lodash.tail@ts2.8", "@types/lodash.template@ts2.8", "@types/lodash.throttle@ts2.8", "@types/lodash.unescape@ts2.8", "@types/lodash.uniq@ts2.8", "@types/log-symbols@ts2.8", "@types/log-update@ts2.8", "@types/loglevel@ts2.8", "@types/loud-rejection@ts2.8", "@types/lru-cache@ts2.8", "@types/make-dir@ts2.8", "@types/map-obj@ts2.8", "@types/media-typer@ts2.8", "@types/mem@ts2.8", "@types/mem-fs@ts2.8", "@types/memory-fs@ts2.8", "@types/meow@ts2.8", "@types/merge-descriptors@ts2.8", "@types/merge-stream@ts2.8", "@types/methods@ts2.8", "@types/micromatch@ts2.8", "@types/mime@ts2.8", "@types/mime-db@ts2.8", "@types/mime-types@ts2.8", "@types/minimatch@ts2.8", "@types/minimist@ts2.8", "@types/minipass@ts2.8", "@types/mkdirp@ts2.8", "@types/mongodb@ts2.8", "@types/morgan@ts2.8", "@types/move-concurrently@ts2.8", "@types/ms@ts2.8", "@types/msgpack-lite@ts2.8", "@types/multimatch@ts2.8", "@types/mz@ts2.8", "@types/negotiator@ts2.8", "@types/node-dir@ts2.8", "@types/node-fetch@ts2.8", "@types/node-forge@ts2.8", "@types/node-int64@ts2.8", "@types/node-ipc@ts2.8", "@types/node-notifier@ts2.8", "@types/nomnom@ts2.8", "@types/nopt@ts2.8", "@types/normalize-package-data@ts2.8", "@types/normalize-url@ts2.8", "@types/number-is-nan@ts2.8", "@types/object-assign@ts2.8", "@types/on-finished@ts2.8", "@types/on-headers@ts2.8", "@types/once@ts2.8", "@types/onetime@ts2.8", "@types/opener@ts2.8", "@types/opn@ts2.8", "@types/optimist@ts2.8", "@types/ora@ts2.8", "@types/os-homedir@ts2.8", "@types/os-locale@ts2.8", "@types/os-tmpdir@ts2.8", "@types/p-cancelable@ts2.8", "@types/p-each-series@ts2.8", "@types/p-event@ts2.8", "@types/p-lazy@ts2.8", "@types/p-limit@ts2.8", "@types/p-locate@ts2.8", "@types/p-map@ts2.8", "@types/p-map-series@ts2.8", "@types/p-reduce@ts2.8", "@types/p-timeout@ts2.8", "@types/p-try@ts2.8", "@types/pako@ts2.8", "@types/parse-glob@ts2.8", "@types/parse-json@ts2.8", "@types/parseurl@ts2.8", "@types/path-exists@ts2.8", "@types/path-is-absolute@ts2.8", "@types/path-parse@ts2.8", "@types/pg-pool@ts2.8", "@types/pg-types@ts2.8", "@types/pify@ts2.8", "@types/pixelmatch@ts2.8", "@types/pkg-dir@ts2.8", "@types/pluralize@ts2.8", "@types/pngjs@ts2.8", "@types/prelude-ls@ts2.8", "@types/pretty-bytes@ts2.8", "@types/pretty-format@ts2.8", "@types/progress@ts2.8", "@types/promise-retry@ts2.8", "@types/proxy-addr@ts2.8", "@types/pump@ts2.8", "@types/q@ts2.8", "@types/qs@ts2.8", "@types/range-parser@ts2.8", "@types/rc@ts2.8", "@types/rc-select@ts2.8", "@types/rc-slider@ts2.8", "@types/rc-tooltip@ts2.8", "@types/rc-tree@ts2.8", "@types/react-event-listener@ts2.8", "@types/react-side-effect@ts2.8", "@types/react-slick@ts2.8", "@types/read-chunk@ts2.8", "@types/read-pkg@ts2.8", "@types/read-pkg-up@ts2.8", "@types/recompose@ts2.8", "@types/recursive-readdir@ts2.8", "@types/relateurl@ts2.8", "@types/replace-ext@ts2.8", "@types/request@ts2.8", "@types/request-promise-native@ts2.8", "@types/require-directory@ts2.8", "@types/require-from-string@ts2.8", "@types/require-relative@ts2.8", "@types/resolve@ts2.8", "@types/resolve-from@ts2.8", "@types/retry@ts2.8", "@types/rx@ts2.8", "@types/rx-lite@ts2.8", "@types/rx-lite-aggregates@ts2.8", "@types/safe-regex@ts2.8", "@types/sane@ts2.8", "@types/sass-graph@ts2.8", "@types/sax@ts2.8", "@types/scriptjs@ts2.8", "@types/semver@ts2.8", "@types/send@ts2.8", "@types/serialize-javascript@ts2.8", "@types/serve-index@ts2.8", "@types/serve-static@ts2.8", "@types/set-value@ts2.8", "@types/shallowequal@ts2.8", "@types/shelljs@ts2.8", "@types/sockjs@ts2.8", "@types/sockjs-client@ts2.8", "@types/source-list-map@ts2.8", "@types/source-map-support@ts2.8", "@types/spdx-correct@ts2.8", "@types/spdy@ts2.8", "@types/split@ts2.8", "@types/sprintf@ts2.8", "@types/sprintf-js@ts2.8", "@types/sqlstring@ts2.8", "@types/sshpk@ts2.8", "@types/stack-utils@ts2.8", "@types/stat-mode@ts2.8", "@types/statuses@ts2.8", "@types/strict-uri-encode@ts2.8", "@types/string-template@ts2.8", "@types/strip-ansi@ts2.8", "@types/strip-bom@ts2.8", "@types/strip-json-comments@ts2.8", "@types/supports-color@ts2.8", "@types/svg2png@ts2.8", "@types/svgo@ts2.8", "@types/table@ts2.8", "@types/tapable@ts2.8", "@types/tar@ts2.8", "@types/temp@ts2.8", "@types/tempfile@ts2.8", "@types/through@ts2.8", "@types/through2@ts2.8", "@types/tinycolor2@ts2.8", "@types/tmp@ts2.8", "@types/to-absolute-glob@ts2.8", "@types/tough-cookie@ts2.8", "@types/trim@ts2.8", "@types/tryer@ts2.8", "@types/type-check@ts2.8", "@types/type-is@ts2.8", "@types/ua-parser-js@ts2.8", "@types/uglify-js@ts2.8", "@types/uglifyjs-webpack-plugin@ts2.8", "@types/underscore@ts2.8", "@types/uniq@ts2.8", "@types/uniqid@ts2.8", "@types/untildify@ts2.8", "@types/urijs@ts2.8", "@types/url-join@ts2.8", "@types/url-parse@ts2.8", "@types/url-regex@ts2.8", "@types/user-home@ts2.8", "@types/util-deprecate@ts2.8", "@types/util.promisify@ts2.8", "@types/utils-merge@ts2.8", "@types/uuid@ts2.8", "@types/vali-date@ts2.8", "@types/vary@ts2.8", "@types/verror@ts2.8", "@types/vinyl@ts2.8", "@types/vinyl-fs@ts2.8", "@types/warning@ts2.8", "@types/watch@ts2.8", "@types/watchpack@ts2.8", "@types/webpack-dev-middleware@ts2.8", "@types/webpack-sources@ts2.8", "@types/which@ts2.8", "@types/window-size@ts2.8", "@types/wrap-ansi@ts2.8", "@types/write-file-atomic@ts2.8", "@types/ws@ts2.8", "@types/xml2js@ts2.8", "@types/xmlbuilder@ts2.8", "@types/xtend@ts2.8", "@types/yallist@ts2.8", "@types/yargs@ts2.8", "@types/yauzl@ts2.8", "@types/yeoman-generator@ts2.8", "@types/zen-observable@ts2.8", "@types/react-content-loader@ts2.8"];
+ const expectedCommands = [
+ TI.getNpmCommandForInstallation(npmPath, tsVersion, packageNames, packageNames.length).command,
+ TI.getNpmCommandForInstallation(npmPath, tsVersion, packageNames, packageNames.length - Math.ceil(packageNames.length / 2)).command
+ ];
+ it("works when the command is too long to install all packages at once", () => {
+ const commands: string[] = [];
+ const hasError = TI.installNpmPackages(npmPath, tsVersion, packageNames, command => {
+ commands.push(command);
+ return false;
+ });
+ assert.isFalse(hasError);
+ assert.deepEqual(commands, expectedCommands, "commands");
+ });
+
+ it("installs remaining packages when one of the partial command fails", () => {
+ const commands: string[] = [];
+ const hasError = TI.installNpmPackages(npmPath, tsVersion, packageNames, command => {
+ commands.push(command);
+ return commands.length === 1;
+ });
+ assert.isTrue(hasError);
+ assert.deepEqual(commands, expectedCommands, "commands");
+ });
+ });
+
+ describe("recomputing resolutions of unresolved imports", () => {
+ const globalTypingsCacheLocation = "/tmp";
+ const appPath = "/a/b/app.js" as Path;
+ const foooPath = "/a/b/node_modules/fooo/index.d.ts";
+ function verifyResolvedModuleOfFooo(project: server.Project) {
+ const foooResolution = project.getLanguageService().getProgram().getSourceFileByPath(appPath).resolvedModules.get("fooo");
+ assert.equal(foooResolution.resolvedFileName, foooPath);
+ return foooResolution;
+ }
+
+ function verifyUnresolvedImportResolutions(appContents: string, typingNames: string[], typingFiles: FileOrFolder[]) {
+ const app: FileOrFolder = {
+ path: appPath,
+ content: `${appContents}import * as x from "fooo";`
+ };
+ const fooo: FileOrFolder = {
+ path: foooPath,
+ content: `export var x: string;`
+ };
+ const host = createServerHost([app, fooo]);
+ const installer = new (class extends Installer {
+ constructor() {
+ super(host, { globalTypingsCacheLocation, typesRegistry: createTypesRegistry("foo") });
+ }
+ installWorker(_requestId: number, _args: string[], _cwd: string, cb: TI.RequestCompletedAction) {
+ executeCommand(this, host, typingNames, typingFiles, cb);
+ }
+ })();
+ const projectService = createProjectService(host, { typingsInstaller: installer });
+ projectService.openClientFile(app.path);
+ projectService.checkNumberOfProjects({ inferredProjects: 1 });
+
+ const proj = projectService.inferredProjects[0];
+ checkProjectActualFiles(proj, [app.path, fooo.path]);
+ const foooResolution1 = verifyResolvedModuleOfFooo(proj);
+
+ installer.installAll(/*expectedCount*/ 1);
+ host.checkTimeoutQueueLengthAndRun(2);
+ checkProjectActualFiles(proj, typingFiles.map(f => f.path).concat(app.path, fooo.path));
+ const foooResolution2 = verifyResolvedModuleOfFooo(proj);
+ assert.strictEqual(foooResolution1, foooResolution2);
+ }
+
+ it("correctly invalidate the resolutions with typing names", () => {
+ verifyUnresolvedImportResolutions('import * as a from "foo";', ["foo"], [{
+ path: `${globalTypingsCacheLocation}/node_modules/foo/index.d.ts`,
+ content: "export function a(): void;"
+ }]);
+ });
+
+ it("correctly invalidate the resolutions with typing names that are trimmed", () => {
+ const fooAA: FileOrFolder = {
+ path: `${globalTypingsCacheLocation}/node_modules/foo/a/a.d.ts`,
+ content: "export function a (): void;"
+ };
+ const fooAB: FileOrFolder = {
+ path: `${globalTypingsCacheLocation}/node_modules/foo/a/b.d.ts`,
+ content: "export function b (): void;"
+ };
+ const fooAC: FileOrFolder = {
+ path: `${globalTypingsCacheLocation}/node_modules/foo/a/c.d.ts`,
+ content: "export function c (): void;"
+ };
+ verifyUnresolvedImportResolutions(`
+ import * as a from "foo/a/a";
+ import * as b from "foo/a/b";
+ import * as c from "foo/a/c";
+ `, ["foo"], [fooAA, fooAB, fooAC]);
+ });
+ });
}
diff --git a/src/harness/virtualFileSystem.ts b/src/harness/virtualFileSystem.ts
index 16267a092fc..698f99616ca 100644
--- a/src/harness/virtualFileSystem.ts
+++ b/src/harness/virtualFileSystem.ts
@@ -125,7 +125,7 @@ namespace Utils {
addFile(path: string, content?: Harness.LanguageService.ScriptInfo) {
const absolutePath = ts.normalizePath(ts.getNormalizedAbsolutePath(path, this.currentDirectory));
- const fileName = ts.getBaseFileName(path);
+ const fileName = ts.getBaseFileName(absolutePath);
const directoryPath = ts.getDirectoryPath(absolutePath);
const directory = this.addDirectory(directoryPath);
return directory ? directory.addFile(fileName, content) : undefined;
diff --git a/src/harness/virtualFileSystemWithWatch.ts b/src/harness/virtualFileSystemWithWatch.ts
index 71b7da2ed14..3756f435d43 100644
--- a/src/harness/virtualFileSystemWithWatch.ts
+++ b/src/harness/virtualFileSystemWithWatch.ts
@@ -179,10 +179,18 @@ interface Array {}`
checkMapKeys("watchedFiles", host.watchedFiles, expectedFiles);
}
- export function checkWatchedDirectories(host: TestServerHost, expectedDirectories: string[], recursive = false) {
+ export function checkWatchedFilesDetailed(host: TestServerHost, expectedFiles: Map) {
+ checkMultiMapKeyCount("watchedFiles", host.watchedFiles, expectedFiles);
+ }
+
+ export function checkWatchedDirectories(host: TestServerHost, expectedDirectories: string[], recursive: boolean) {
checkMapKeys(`watchedDirectories${recursive ? " recursive" : ""}`, recursive ? host.watchedDirectoriesRecursive : host.watchedDirectories, expectedDirectories);
}
+ export function checkWatchedDirectoriesDetailed(host: TestServerHost, expectedDirectories: Map, recursive: boolean) {
+ checkMultiMapKeyCount(`watchedDirectories${recursive ? " recursive" : ""}`, recursive ? host.watchedDirectoriesRecursive : host.watchedDirectories, expectedDirectories);
+ }
+
export function checkOutputContains(host: TestServerHost, expected: ReadonlyArray) {
const mapExpected = arrayToSet(expected);
const mapSeen = createMap();
diff --git a/src/lib/es2015.core.d.ts b/src/lib/es2015.core.d.ts
index 68be040c29d..cfb300c784d 100644
--- a/src/lib/es2015.core.d.ts
+++ b/src/lib/es2015.core.d.ts
@@ -1,5 +1,3 @@
-declare type PropertyKey = string | number | symbol;
-
interface Array {
/**
* Returns the value of the first element in the array where predicate is true, and undefined
@@ -258,20 +256,6 @@ interface NumberConstructor {
parseInt(string: string, radix?: number): number;
}
-interface Object {
- /**
- * Determines whether an object has a property with the specified name.
- * @param v A property name.
- */
- hasOwnProperty(v: PropertyKey): boolean;
-
- /**
- * Determines whether a specified property is enumerable.
- * @param v A property name.
- */
- propertyIsEnumerable(v: PropertyKey): boolean;
-}
-
interface ObjectConstructor {
/**
* Copy the values of all of the enumerable own properties from one or more source objects to a
@@ -327,25 +311,6 @@ interface ObjectConstructor {
* @param proto The value of the new prototype or null.
*/
setPrototypeOf(o: any, proto: object | null): any;
-
- /**
- * Gets the own property descriptor of the specified object.
- * An own property descriptor is one that is defined directly on the object and is not
- * inherited from the object's prototype.
- * @param o Object that contains the property.
- * @param p Name of the property.
- */
- getOwnPropertyDescriptor(o: any, propertyKey: PropertyKey): PropertyDescriptor | undefined;
-
- /**
- * Adds a property to an object, or modifies attributes of an existing property.
- * @param o Object on which to add or modify the property. This can be a native JavaScript
- * object (that is, a user-defined object or a built in object) or a DOM object.
- * @param p The property name.
- * @param attributes Descriptor for the property. It can be for a data property or an accessor
- * property.
- */
- defineProperty(o: any, propertyKey: PropertyKey, attributes: PropertyDescriptor): any;
}
interface ReadonlyArray {
diff --git a/src/lib/es2015.promise.d.ts b/src/lib/es2015.promise.d.ts
index ab33531191f..14602c0b5ed 100644
--- a/src/lib/es2015.promise.d.ts
+++ b/src/lib/es2015.promise.d.ts
@@ -177,14 +177,7 @@ interface PromiseConstructor {
* @param reason The reason the promise was rejected.
* @returns A new rejected Promise.
*/
- reject(reason: any): Promise;
-
- /**
- * Creates a new rejected promise for the provided reason.
- * @param reason The reason the promise was rejected.
- * @returns A new rejected Promise.
- */
- reject(reason: any): Promise;
+ reject(reason?: any): Promise;
/**
* Creates a new resolved promise for the provided value.
diff --git a/src/lib/es5.d.ts b/src/lib/es5.d.ts
index 55c184f672f..0f1782ef3e6 100644
--- a/src/lib/es5.d.ts
+++ b/src/lib/es5.d.ts
@@ -74,6 +74,8 @@ declare function escape(string: string): string;
*/
declare function unescape(string: string): string;
+declare type PropertyKey = string | number | symbol;
+
interface PropertyDescriptor {
configurable?: boolean;
enumerable?: boolean;
@@ -104,7 +106,7 @@ interface Object {
* Determines whether an object has a property with the specified name.
* @param v A property name.
*/
- hasOwnProperty(v: string): boolean;
+ hasOwnProperty(v: PropertyKey): boolean;
/**
* Determines whether an object exists in another object's prototype chain.
@@ -116,7 +118,7 @@ interface Object {
* Determines whether a specified property is enumerable.
* @param v A property name.
*/
- propertyIsEnumerable(v: string): boolean;
+ propertyIsEnumerable(v: PropertyKey): boolean;
}
interface ObjectConstructor {
@@ -139,7 +141,7 @@ interface ObjectConstructor {
* @param o Object that contains the property.
* @param p Name of the property.
*/
- getOwnPropertyDescriptor(o: any, p: string): PropertyDescriptor | undefined;
+ getOwnPropertyDescriptor(o: any, p: PropertyKey): PropertyDescriptor | undefined;
/**
* Returns the names of the own properties of an object. The own properties of an object are those that are defined directly
@@ -167,7 +169,7 @@ interface ObjectConstructor {
* @param p The property name.
* @param attributes Descriptor for the property. It can be for a data property or an accessor property.
*/
- defineProperty(o: any, p: string, attributes: PropertyDescriptor & ThisType): any;
+ defineProperty(o: any, p: PropertyKey, attributes: PropertyDescriptor & ThisType): any;
/**
* Adds one or more properties to an object, and/or modifies attributes of existing properties.
@@ -1349,7 +1351,7 @@ type Pick = {
/**
* Construct a type with a set of properties K of type T
*/
-type Record = {
+type Record = {
[P in K]: T;
};
diff --git a/src/loc/lcl/chs/diagnosticMessages/diagnosticMessages.generated.json.lcl b/src/loc/lcl/chs/diagnosticMessages/diagnosticMessages.generated.json.lcl
index 962956e5bbf..546572f66c2 100644
--- a/src/loc/lcl/chs/diagnosticMessages/diagnosticMessages.generated.json.lcl
+++ b/src/loc/lcl/chs/diagnosticMessages/diagnosticMessages.generated.json.lcl
@@ -903,6 +903,15 @@
+ -
+
+
+
+
+
+
+
+
-
@@ -999,27 +1008,15 @@
- -
+
-
-
+
-
+
- -
-
-
-
-
-
-
-
-
-
-
-
-
@@ -2388,15 +2385,6 @@
- -
-
-
-
-
-
-
-
-
-
@@ -3771,17 +3759,20 @@
- -
+
-
-
+
+
+
+
- -
+
-
-
+
-
+
@@ -3894,6 +3885,15 @@
+ -
+
+
+
+
+
+
+
+
-
@@ -6006,6 +6006,9 @@
-
+
+
+
@@ -6501,6 +6504,12 @@
+ -
+
+
+
+
+
-
diff --git a/src/loc/lcl/cht/diagnosticMessages/diagnosticMessages.generated.json.lcl b/src/loc/lcl/cht/diagnosticMessages/diagnosticMessages.generated.json.lcl
index 8c72ca29d98..f6f14d4a402 100644
--- a/src/loc/lcl/cht/diagnosticMessages/diagnosticMessages.generated.json.lcl
+++ b/src/loc/lcl/cht/diagnosticMessages/diagnosticMessages.generated.json.lcl
@@ -642,6 +642,9 @@
-
+
+
+
@@ -900,21 +903,39 @@
+ -
+
+
+
+
+
+
+
+
-
+
+
+
-
+
+
+
-
+
+
+
@@ -939,6 +960,9 @@
-
+
+
+
@@ -966,6 +990,9 @@
-
+
+
+
@@ -981,39 +1008,39 @@
- -
+
-
-
-
-
-
- -
-
-
+
-
+
-
-
-
-
+
+
+
-
+
+
+
-
+
+
+
@@ -1524,6 +1551,9 @@
-
+
+
+
@@ -2151,18 +2181,27 @@
-
+
+
+
-
+
+
+
-
+
+
+
@@ -2346,15 +2385,6 @@
- -
-
-
-
-
-
-
-
-
-
@@ -2475,12 +2505,18 @@
-
+
+
+
-
+
+
+
@@ -2664,6 +2700,9 @@
-
+
+
+
@@ -3714,6 +3753,27 @@
-
+
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
@@ -3825,6 +3885,15 @@
+ -
+
+
+
+
+
+
+
+
-
@@ -4032,12 +4101,18 @@
-
+
+
+
-
+
+
+
@@ -4239,6 +4314,9 @@
-
+
+
+
@@ -4356,6 +4434,9 @@
-
+
+
+
@@ -4851,6 +4932,9 @@
-
+
+
+
@@ -4950,12 +5034,18 @@
-
+
+
+
-
+
+
+
@@ -5853,6 +5943,9 @@
-
+
+
+
@@ -5910,6 +6003,15 @@
+ -
+
+
+
+
+
+
+
+
-
@@ -6402,6 +6504,12 @@
+ -
+
+
+
+
+
-
@@ -6756,6 +6864,9 @@
-
+
+
+
@@ -7500,6 +7611,9 @@
-
+
+
+
@@ -7821,6 +7935,9 @@
-
+
+
+
@@ -7836,6 +7953,9 @@
-
+
+
+
@@ -7896,12 +8016,18 @@
-
+
+
+
-
+
+
+
@@ -7986,6 +8112,9 @@
-
+
+
+
diff --git a/src/loc/lcl/csy/diagnosticMessages/diagnosticMessages.generated.json.lcl b/src/loc/lcl/csy/diagnosticMessages/diagnosticMessages.generated.json.lcl
index 6f458cd9d3e..203d2c22ab9 100644
--- a/src/loc/lcl/csy/diagnosticMessages/diagnosticMessages.generated.json.lcl
+++ b/src/loc/lcl/csy/diagnosticMessages/diagnosticMessages.generated.json.lcl
@@ -912,6 +912,15 @@
+ -
+
+
+
+
+
+
+
+
-
@@ -1008,27 +1017,15 @@
- -
+
-
-
+
-
+
- -
-
-
-
-
-
-
-
-
-
-
-
-
@@ -2397,15 +2394,6 @@
- -
-
-
-
-
-
-
-
-
-
@@ -3780,6 +3768,24 @@
+ -
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
-
@@ -3888,6 +3894,15 @@
+ -
+
+
+
+
+
+
+
+
-
@@ -5997,6 +6012,15 @@
+ -
+
+
+
+
+
+
+
+
-
diff --git a/src/loc/lcl/deu/diagnosticMessages/diagnosticMessages.generated.json.lcl b/src/loc/lcl/deu/diagnosticMessages/diagnosticMessages.generated.json.lcl
index e5a04125bd7..a2fd58ac665 100644
--- a/src/loc/lcl/deu/diagnosticMessages/diagnosticMessages.generated.json.lcl
+++ b/src/loc/lcl/deu/diagnosticMessages/diagnosticMessages.generated.json.lcl
@@ -900,6 +900,15 @@
+ -
+
+
+
+
+
+
+
+
-
@@ -996,27 +1005,15 @@
- -
+
-
-
+
-
+
- -
-
-
-
-
-
-
-
-
-
-
-
-
@@ -2385,15 +2382,6 @@
- -
-
-
-
-
-
-
-
-
-
@@ -3768,6 +3756,24 @@
+ -
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
-
@@ -3876,6 +3882,15 @@
+ -
+
+
+
+
+
+
+
+
-
@@ -5982,6 +5997,15 @@
+ -
+
+
+
+
+
+
+
+
-
@@ -6474,6 +6498,12 @@
+ -
+
+
+
+
+
-
diff --git a/src/loc/lcl/esn/diagnosticMessages/diagnosticMessages.generated.json.lcl b/src/loc/lcl/esn/diagnosticMessages/diagnosticMessages.generated.json.lcl
index f46e427ce62..f1cec4555ac 100644
--- a/src/loc/lcl/esn/diagnosticMessages/diagnosticMessages.generated.json.lcl
+++ b/src/loc/lcl/esn/diagnosticMessages/diagnosticMessages.generated.json.lcl
@@ -912,6 +912,15 @@
+ -
+
+
+
+
+
+
+
+
-
@@ -1008,27 +1017,15 @@
- -
+
-
-
+
-
+
- -
-
-
-
-
-
-
-
-
-
-
-
-
@@ -2397,15 +2394,6 @@
- -
-
-
-
-
-
-
-
-
-
@@ -3780,6 +3768,24 @@
+ -
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
-
@@ -3888,6 +3894,15 @@
+ -
+
+
+
+
+
+
+
+
-
@@ -5997,6 +6012,15 @@
+ -
+
+
+
+
+
+
+
+
-
@@ -6489,6 +6513,12 @@
+ -
+
+
+
+
+
-
diff --git a/src/loc/lcl/fra/diagnosticMessages/diagnosticMessages.generated.json.lcl b/src/loc/lcl/fra/diagnosticMessages/diagnosticMessages.generated.json.lcl
index 09f82b9b47d..5f93b90c20e 100644
--- a/src/loc/lcl/fra/diagnosticMessages/diagnosticMessages.generated.json.lcl
+++ b/src/loc/lcl/fra/diagnosticMessages/diagnosticMessages.generated.json.lcl
@@ -912,6 +912,15 @@
+ -
+
+
+
+
+
+
+
+
-
@@ -1008,27 +1017,15 @@
- -
+
-
-
+
-